chunk-7e8d6eaa.bc0f8ce3.js 1.1 MB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7e8d6eaa"],{"030f":function(t,e,n){(function(t){(function(){"use strict";var e=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},n=function(t){return function(n){return e(n)===t}},r=function(t){return function(e){return typeof e===t}},o=function(t){return function(e){return t===e}},i=n("string"),u=n("object"),a=n("array"),c=o(null),s=r("boolean"),f=o(void 0),l=function(t){return null===t||void 0===t},d=function(t){return!l(t)},m=r("function"),g=r("number"),p=function(t,e){if(a(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},h=function(){},v=function(t){return function(){return t()}},b=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},y=function(t,e){return function(n){return t(e(n))}},w=function(t){return function(){return t}},x=function(t){return t},C=function(t,e){return t===e};function S(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var k=function(t){return function(e){return!t(e)}},O=function(t){return function(){throw new Error(t)}},T=w(!1),E=w(!0),_=tinymce.util.Tools.resolve("tinymce.ThemeManager"),D=function(){return D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},D.apply(this,arguments)};function A(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function R(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var N=function(){return B},B=function(){var t=function(t){return t()},e=x,n={fold:function(t,e){return t()},isSome:T,isNone:E,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:w(null),getOrUndefined:w(void 0),or:e,orThunk:t,map:N,each:h,bind:N,exists:T,forall:E,filter:function(){return N()},toArray:function(){return[]},toString:w("none()")};return n}(),M=function(t){var e=w(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:E,isNone:T,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return M(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:B},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},P=function(t){return null===t||void 0===t?B:M(t)},I={some:M,none:N,from:P},L=Array.prototype.slice,F=Array.prototype.indexOf,z=Array.prototype.push,H=function(t,e){return F.call(t,e)},V=function(t,e){var n=H(t,e);return-1===n?I.none():I.some(n)},U=function(t,e){return H(t,e)>-1},j=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return!0}return!1},W=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},q=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=L.call(t,r,r+e);n.push(o)}return n},$=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},G=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},K=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];e(r,n)}},X=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o],a=e(u,o)?n:r;a.push(u)}return{pass:n,fail:r}},Y=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},J=function(t,e,n){return K(t,(function(t,r){n=e(n,t,r)})),n},Q=function(t,e,n){return G(t,(function(t,r){n=e(n,t,r)})),n},Z=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return I.some(i);if(n(i,r))break}return I.none()},tt=function(t,e){return Z(t,e,T)},et=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return I.some(n)}return I.none()},nt=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);z.apply(e,t[n])}return e},rt=function(t,e){return nt($(t,e))},ot=function(t,e){for(var n=0,r=t.length;n<r;++n){var o=t[n];if(!0!==e(o,n))return!1}return!0},it=function(t){var e=L.call(t,0);return e.reverse(),e},ut=function(t,e){return Y(t,(function(t){return!U(e,t)}))},at=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},ct=function(t){return[t]},st=function(t,e){var n=L.call(t,0);return n.sort(e),n},ft=function(t,e){return e>=0&&e<t.length?I.some(t[e]):I.none()},lt=function(t){return ft(t,0)},dt=function(t){return ft(t,t.length-1)},mt=m(Array.from)?Array.from:function(t){return L.call(t)},gt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return I.none()},pt=Object.keys,ht=Object.hasOwnProperty,vt=function(t,e){for(var n=pt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},bt=function(t,e){return yt(t,(function(t,n){return{k:n,v:e(t,n)}}))},yt=function(t,e){var n={};return vt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},wt=function(t){return function(e,n){t[n]=e}},xt=function(t,e,n,r){var o={};return vt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},Ct=function(t,e){var n={};return xt(t,e,wt(n),h),n},St=function(t,e){var n=[];return vt(t,(function(t,r){n.push(e(t,r))})),n},kt=function(t,e){for(var n=pt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return I.some(u)}return I.none()},Ot=function(t){return St(t,x)},Tt=function(t,e){return Et(t,e)?I.from(t[e]):I.none()},Et=function(t,e){return ht.call(t,e)},_t=function(t,e){return Et(t,e)&&void 0!==t[e]&&null!==t[e]},Dt=function(t,e,n){return void 0===n&&(n=C),t.exists((function(t){return n(t,e)}))},At=function(t,e,n){return void 0===n&&(n=C),Bt(t,e,n).getOr(t.isNone()&&e.isNone())},Rt=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Nt=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return I.none();e.push(r.getOrDie())}return I.some(e)},Bt=function(t,e,n){return t.isSome()&&e.isSome()?I.some(n(t.getOrDie(),e.getOrDie())):I.none()},Mt=function(t,e,n,r){return t.isSome()&&e.isSome()&&n.isSome()?I.some(r(t.getOrDie(),e.getOrDie(),n.getOrDie())):I.none()},Pt=function(t,e){return void 0!==t&&null!==t?I.some(e(t)):I.none()},It=function(t,e){return t?I.some(e):I.none()},Lt=function(t,e){return t+e},Ft=function(t,e){return t.substring(e)},zt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Ht=function(t,e){return jt(t,e)?Ft(t,e.length):t},Vt=function(t,e){return Wt(t,e)?t:Lt(t,e)},Ut=function(t,e){return-1!==t.indexOf(e)},jt=function(t,e){return zt(t,e,0)},Wt=function(t,e){return zt(t,e,t.length-e.length)},qt=function(t){return function(e){return e.replace(t,"")}},$t=qt(/^\s+|\s+$/g),Gt=function(t){return t.length>0},Kt=function(t){return!Gt(t)},Xt=function(t){return void 0!==t.style&&m(t.style.getPropertyValue)},Yt=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return Zt(r.childNodes[0])},Jt=function(t,e){var n=e||document,r=n.createElement(t);return Zt(r)},Qt=function(t,e){var n=e||document,r=n.createTextNode(t);return Zt(r)},Zt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},te=function(t,e,n){return I.from(t.dom.elementFromPoint(e,n)).map(Zt)},ee={fromHtml:Yt,fromTag:Jt,fromText:Qt,fromDom:Zt,fromPoint:te};"undefined"!==typeof window?window:Function("return this;")();var ne,re=9,oe=11,ie=1,ue=3,ae=function(t){var e=t.dom.nodeName;return e.toLowerCase()},ce=function(t){return t.dom.nodeType},se=function(t){return function(e){return ce(e)===t}},fe=se(ie),le=se(ue),de=se(re),me=se(oe),ge=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},pe=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),l=!s&&!c&&!f;return{isiPad:w(o),isiPhone:w(i),isTablet:w(c),isPhone:w(s),isTouch:w(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:w(f),isDesktop:w(l)}},he=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},ve=function(t,e){var n=he(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return we(r(1),r(2))},be=function(t,e){var n=String(e).toLowerCase();return 0===t.length?ye():ve(t,n)},ye=function(){return we(0,0)},we=function(t,e){return{major:t,minor:e}},xe={nu:we,detect:be,unknown:ye},Ce=function(t,e){return gt(e.brands,(function(e){var n=e.brand.toLowerCase();return tt(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:xe.nu(parseInt(e.version,10),0)}}))}))},Se=function(t,e){var n=String(e).toLowerCase();return tt(t,(function(t){return t.search(n)}))},ke=function(t,e){return Se(t,e).map((function(t){var n=xe.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Oe=function(t,e){return Se(t,e).map((function(t){var n=xe.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Te=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ee=function(t){return function(e){return Ut(e,t)}},_e=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Ut(t,"edge/")&&Ut(t,"chrome")&&Ut(t,"safari")&&Ut(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Te],search:function(t){return Ut(t,"chrome")&&!Ut(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Ut(t,"msie")||Ut(t,"trident")}},{name:"Opera",versionRegexes:[Te,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ee("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ee("firefox")},{name:"Safari",versionRegexes:[Te,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Ut(t,"safari")||Ut(t,"mobile/"))&&Ut(t,"applewebkit")}}],De=[{name:"Windows",search:Ee("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Ut(t,"iphone")||Ut(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ee("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ee("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ee("linux"),versionRegexes:[]},{name:"Solaris",search:Ee("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ee("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Ee("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ae={browsers:w(_e),oses:w(De)},Re="Edge",Ne="Chrome",Be="IE",Me="Opera",Pe="Firefox",Ie="Safari",Le=function(){return Fe({current:void 0,version:xe.unknown()})},Fe=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Re),isChrome:r(Ne),isIE:r(Be),isOpera:r(Me),isFirefox:r(Pe),isSafari:r(Ie)}},ze={unknown:Le,nu:Fe,edge:w(Re),chrome:w(Ne),ie:w(Be),opera:w(Me),firefox:w(Pe),safari:w(Ie)},He="Windows",Ve="iOS",Ue="Android",je="Linux",We="OSX",qe="Solaris",$e="FreeBSD",Ge="ChromeOS",Ke=function(){return Xe({current:void 0,version:xe.unknown()})},Xe=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(He),isiOS:r(Ve),isAndroid:r(Ue),isOSX:r(We),isLinux:r(je),isSolaris:r(qe),isFreeBSD:r($e),isChromeOS:r(Ge)}},Ye={unknown:Ke,nu:Xe,windows:w(He),ios:w(Ve),android:w(Ue),linux:w(je),osx:w(We),solaris:w(qe),freebsd:w($e),chromeos:w(Ge)},Je=function(t,e,n){var r=Ae.browsers(),o=Ae.oses(),i=e.bind((function(t){return Ce(r,t)})).orThunk((function(){return ke(r,t)})).fold(ze.unknown,ze.nu),u=Oe(o,t).fold(Ye.unknown,Ye.nu),a=pe(u,i,t,n);return{browser:i,os:u,deviceType:a}},Qe={detect:Je},Ze=function(t){return window.matchMedia(t).matches},tn=ge((function(){return Qe.detect(navigator.userAgent,I.from(navigator.userAgentData),Ze)})),en=function(){return tn()},nn=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},rn=function(t,e){return nn(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},on=function(t,e){var n=t.dom;if(n.nodeType!==ie)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},un=function(t){return t.nodeType!==ie&&t.nodeType!==re&&t.nodeType!==oe||0===t.childElementCount},an=function(t,e){var n=void 0===e?document:e.dom;return un(n)?[]:$(n.querySelectorAll(t),ee.fromDom)},cn=function(t,e){var n=void 0===e?document:e.dom;return un(n)?I.none():I.from(n.querySelector(t)).map(ee.fromDom)},sn=function(t,e){return t.dom===e.dom},fn=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},ln=function(t,e){return rn(t.dom,e.dom)},dn=function(t,e){return en().browser.isIE()?ln(t,e):fn(t,e)},mn=function(t){return ee.fromDom(t.dom.ownerDocument)},gn=function(t){return de(t)?t:mn(t)},pn=function(t){return ee.fromDom(gn(t).dom.documentElement)},hn=function(t){return ee.fromDom(gn(t).dom.defaultView)},vn=function(t){return I.from(t.dom.parentNode).map(ee.fromDom)},bn=function(t){return vn(t)},yn=function(t){return I.from(t.dom.offsetParent).map(ee.fromDom)},wn=function(t){return I.from(t.dom.nextSibling).map(ee.fromDom)},xn=function(t){return $(t.dom.childNodes,ee.fromDom)},Cn=function(t,e){var n=t.dom.childNodes;return I.from(n[e]).map(ee.fromDom)},Sn=function(t){return Cn(t,0)},kn=function(t,e){return{element:t,offset:e}},On=function(t,e){var n=xn(t);return n.length>0&&e<n.length?kn(n[e],0):kn(t,e)},Tn=function(t){return me(t)&&d(t.dom.host)},En=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode),_n=w(En),Dn=En?function(t){return ee.fromDom(t.dom.getRootNode())}:gn,An=function(t){return Tn(t)?t:ee.fromDom(gn(t).dom.body)},Rn=function(t){return Nn(t).isSome()},Nn=function(t){var e=Dn(t);return Tn(e)?I.some(e):I.none()},Bn=function(t){return ee.fromDom(t.dom.host)},Mn=function(t){if(_n()&&d(t.target)){var e=ee.fromDom(t.target);if(fe(e)&&Pn(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return lt(n)}}return I.from(t.target)},Pn=function(t){return d(t.dom.shadowRoot)},In=function(t){var e=le(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return Nn(ee.fromDom(e)).fold((function(){return n.body.contains(e)}),y(In,Bn))},Ln=function(){return Fn(ee.fromDom(document))},Fn=function(t){var e=t.dom.body;if(null===e||void 0===e)throw new Error("Body is not available yet");return ee.fromDom(e)},zn=function(t,e,n){if(!(i(n)||s(n)||g(n)))throw new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Hn=function(t,e,n){zn(t.dom,e,n)},Vn=function(t,e){var n=t.dom;vt(e,(function(t,e){zn(n,e,t)}))},Un=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},jn=function(t,e){return I.from(Un(t,e))},Wn=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},qn=function(t,e){t.dom.removeAttribute(e)},$n=function(t,e,n){if(!i(n))throw new Error("CSS value must be a string: "+n);Xt(t)&&t.style.setProperty(e,n)},Gn=function(t,e){Xt(t)&&t.style.removeProperty(e)},Kn=function(t,e,n){var r=t.dom;$n(r,e,n)},Xn=function(t,e){var n=t.dom;vt(e,(function(t,e){$n(n,e,t)}))},Yn=function(t,e){var n=t.dom;vt(e,(function(t,e){t.fold((function(){Gn(n,e)}),(function(t){$n(n,e,t)}))}))},Jn=function(t,e){var n=t.dom,r=window.getComputedStyle(n),o=r.getPropertyValue(e);return""!==o||In(t)?o:Qn(n,e)},Qn=function(t,e){return Xt(t)?t.style.getPropertyValue(e):""},Zn=function(t,e){var n=t.dom,r=Qn(n,e);return I.from(r).filter((function(t){return t.length>0}))},tr=function(t){var e={},n=t.dom;if(Xt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},er=function(t,e,n){var r=ee.fromTag(t);Kn(r,e,n);var o=Zn(r,e);return o.isSome()},nr=function(t,e){var n=t.dom;Gn(n,e),Dt(jn(t,"style").map($t),"")&&qn(t,"style")},rr=function(t){return t.dom.offsetWidth},or=function(t,e){var n=function(e,n){if(!g(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Xt(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=Jn(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return Q(e,(function(e,n){var r=Jn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}},ir=or("height",(function(t){var e=t.dom;return In(t)?e.getBoundingClientRect().height:e.offsetHeight})),ur=function(t){return ir.get(t)},ar=function(t){return ir.getOuter(t)},cr=function(t,e){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=ir.max(t,e,n);Kn(t,"max-height",r+"px")},sr=function(t,e){var n=function(n,r){return sr(t+n,e+r)};return{left:t,top:e,translate:n}},fr=sr,lr=function(t){var e=t.getBoundingClientRect();return fr(e.left,e.top)},dr=function(t,e){return void 0!==t?t:void 0!==e?e:0},mr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return fr(n.offsetLeft,n.offsetTop);var i=dr(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=dr(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=dr(o.clientTop,n.clientTop),c=dr(o.clientLeft,n.clientLeft);return gr(t).translate(u-c,i-a)},gr=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?fr(r.offsetLeft,r.offsetTop):In(t)?lr(e):fr(0,0)},pr=or("width",(function(t){return t.dom.offsetWidth})),hr=function(t,e){return pr.set(t,e)},vr=function(t){return pr.get(t)},br=function(t){return pr.getOuter(t)},yr=function(t,e){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=pr.max(t,e,n);Kn(t,"max-width",r+"px")},wr=function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}},xr=function(t){var e=ee.fromDom(Mn(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=b(r,n);return wr(e,t.clientX,t.clientY,n,r,o,t)},Cr=function(t,e){return function(n){t(n)&&e(xr(n))}},Sr=function(t,e,n,r,o){var i=Cr(n,r);return t.dom.addEventListener(e,i,o),{unbind:S(Tr,t,e,i,o)}},kr=function(t,e,n,r){return Sr(t,e,n,r,!1)},Or=function(t,e,n,r){return Sr(t,e,n,r,!0)},Tr=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Er=function(t,e){var n=vn(t);n.each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},_r=function(t,e){var n=wn(t);n.fold((function(){var n=vn(t);n.each((function(t){Ar(t,e)}))}),(function(t){Er(t,e)}))},Dr=function(t,e){var n=Sn(t);n.fold((function(){Ar(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Ar=function(t,e){t.dom.appendChild(e.dom)},Rr=function(t,e,n){Cn(t,n).fold((function(){Ar(t,e)}),(function(t){Er(t,e)}))},Nr=function(t,e){G(e,(function(e){Er(t,e)}))},Br=function(t,e){G(e,(function(e){Ar(t,e)}))},Mr=function(t){t.dom.textContent="",G(xn(t),(function(t){Pr(t)}))},Pr=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ir=function(t){var e=xn(t);e.length>0&&Nr(t,e),Pr(t)},Lr=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return fr(n,r)},Fr=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(t,e)},zr=function(t){var e=void 0===t?window:t;return en().browser.isFirefox()?I.none():I.from(e["visualViewport"])},Hr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Vr=function(t){var e=void 0===t?window:t,n=e.document,r=Lr(ee.fromDom(n));return zr(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Hr(r.left,r.top,n,o)}),(function(t){return Hr(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Ur=function(t,e){var n=t.view(e);return n.fold(w([]),(function(e){var n=t.owner(e),r=Ur(t,n);return[e].concat(r)}))},jr=function(t,e){var n=e.owner(t),r=Ur(e,n);return I.some(r)},Wr=function(t){var e,n=t.dom===document?I.none():I.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement);return n.map(ee.fromDom)},qr=function(t){return mn(t)},$r=Object.freeze({__proto__:null,view:Wr,owner:qr}),Gr=function(t){var e=ee.fromDom(document),n=Lr(e),r=jr(t,$r);return r.fold(S(mr,t),(function(e){var r=gr(t),o=J(e,(function(t,e){var n=gr(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return fr(o.left+r.left+n.left,o.top+r.top+n.top)}))},Kr=function(t,e,n){return{point:t,width:e,height:n}},Xr=function(t,e,n,r){return{x:t,y:e,width:n,height:r}},Yr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Jr=function(t){var e=mr(t),n=br(t),r=ar(t);return Yr(e.left,e.top,n,r)},Qr=function(t){var e=Gr(t),n=br(t),r=ar(t);return Yr(e.left,e.top,n,r)},Zr=function(){return Vr(window)},to=function(t){var e=function(e){return to(t)},n=function(e){return to(t)},r=function(e){return to(e(t))},o=function(e){return to(t)},i=function(e){e(t)},u=function(e){return e(t)},a=function(e,n){return n(t)},c=function(e){return e(t)},s=function(e){return e(t)},f=function(){return I.some(t)};return{isValue:E,isError:T,getOr:w(t),getOrThunk:w(t),getOrDie:w(t),or:e,orThunk:n,fold:a,map:r,mapError:o,each:i,bind:u,exists:c,forall:s,toOptional:f}},eo=function(t){var e=function(t){return t()},n=function(){return O(String(t))()},r=x,o=function(t){return t()},i=function(e){return eo(t)},u=function(e){return eo(e(t))},a=function(e){return eo(t)},c=function(e,n){return e(t)};return{isValue:T,isError:E,getOr:x,getOrThunk:e,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:u,each:h,bind:a,exists:T,forall:E,toOptional:I.none}},no=function(t,e){return t.fold((function(){return eo(e)}),to)},ro={value:to,error:eo,fromOption:no};(function(t){t[t["Error"]=0]="Error",t[t["Value"]=1]="Value"})(ne||(ne={}));var oo=function(t,e,n){return t.stype===ne.Error?e(t.serror):n(t.svalue)},io=function(t){var e=[],n=[];return G(t,(function(t){oo(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},uo=function(t,e){return t.stype===ne.Error?{stype:ne.Error,serror:e(t.serror)}:t},ao=function(t,e){return t.stype===ne.Value?{stype:ne.Value,svalue:e(t.svalue)}:t},co=function(t,e){return t.stype===ne.Value?e(t.svalue):t},so=function(t,e){return t.stype===ne.Error?e(t.serror):t},fo=function(t){return{stype:ne.Value,svalue:t}},lo=function(t){return{stype:ne.Error,serror:t}},mo=function(t){return oo(t,ro.error,ro.value)},go=function(t){return t.fold(lo,fo)},po={fromResult:go,toResult:mo,svalue:fo,partition:io,serror:lo,bind:co,bindError:so,map:ao,mapError:uo,fold:oo},ho=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},vo=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},bo=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},yo=function(t,e){return e},wo=function(t,e){var n=u(t)&&u(e);return n?Co(t,e):e},xo=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)Et(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Co=xo(wo),So=xo(yo),ko=function(){return{tag:"required",process:{}}},Oo=function(t){return{tag:"defaultedThunk",process:t}},To=function(t){return Oo(w(t))},Eo=function(){return{tag:"option",process:{}}},_o=function(t){return{tag:"mergeWithThunk",process:t}},Do=function(t){return _o(w(t))},Ao=function(t,e){return t.length>0?po.svalue(Co(e,So.apply(void 0,t))):po.svalue(e)},Ro=function(t){return b(po.serror,nt)(t)},No=function(t,e){var n=po.partition(t);return n.errors.length>0?Ro(n.errors):Ao(n.values,e)},Bo=function(t){var e=po.partition(t);return e.errors.length>0?Ro(e.errors):po.svalue(e.values)},Mo={consolidateObj:No,consolidateArr:Bo},Po=function(t){return u(t)&&pt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Io=function(t){var e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):t;return $(e,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))},Lo=function(t,e){return po.serror([{path:t,getErrorInfo:e}])},Fo=function(t,e,n){return Lo(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+Po(n)}))},zo=function(t,e){return Lo(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))},Ho=function(t,e,n){return Lo(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Po(e)}))},Vo=function(t,e){return Lo(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},Uo=function(t,e){return Lo(t,w(e))},jo=function(t){var e=function(e,n){return po.bindError(t(n),(function(t){return Uo(e,t)}))},n=w("val");return{extract:e,toString:n}},Wo=jo(po.svalue),qo=function(t,e,n,r){return Tt(e,n).fold((function(){return Fo(t,n,e)}),r)},$o=function(t,e,n,r){var o=Tt(t,e).getOrThunk((function(){return n(t)}));return r(o)},Go=function(t,e,n){return n(Tt(t,e))},Ko=function(t,e,n,r){var o=Tt(t,e).map((function(e){return!0===e?n(t):e}));return r(o)},Xo=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},u=function(t){return t.fold((function(){return po.svalue(I.none())}),(function(t){var n=o.extract(e.concat([r]),t);return po.map(n,I.some)}))};switch(t.tag){case"required":return qo(e,n,r,i);case"defaultedThunk":return $o(n,r,t.process,i);case"option":return Go(n,r,u);case"defaultedOptionThunk":return Ko(n,r,t.process,u);case"mergeWithThunk":return $o(n,r,w({}),(function(e){var r=Co(t.process(n),e);return i(r)}))}},Yo=function(t,e,n){for(var r={},o=[],i=0,u=n;i<u.length;i++){var a=u[i];bo(a,(function(n,i,u,a){var c=Xo(u,t,e,n,a);po.fold(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?po.serror(o):po.svalue(r)},Jo=function(t){var e=function(e,n){return t().extract(e,n)},n=function(){return t().toString()};return{extract:e,toString:n}},Qo=function(t){return pt(Ct(t,d))},Zo=function(t){var e=ti(t),n=J(t,(function(t,e){return bo(e,(function(e){var n;return Co(t,(n={},n[e]=!0,n))}),w(t))}),{}),r=function(t,r){var o=s(r)?[]:Qo(r),i=Y(o,(function(t){return!_t(n,t)}));return 0===i.length?e.extract(t,r):Vo(t,i)};return{extract:r,toString:e.toString}},ti=function(t){var e=function(e,n){return Yo(e,n,t)},n=function(){var e=$(t,(function(t){return bo(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))}));return"obj{\n"+e.join("\n")+"}"};return{extract:e,toString:n}},ei=function(t){var e=function(e,n){var r=$(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return Mo.consolidateArr(r)},n=function(){return"array("+t.toString()+")"};return{extract:e,toString:n}},ni=function(t){var e=function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var u=i[o],a=u.extract(e,n);if(a.stype===ne.Value)return a;r.push(a)}return Mo.consolidateArr(r)},n=function(){return"oneOf("+$(t,(function(t){return t.toString()})).join(", ")+")"};return{extract:e,toString:n}},ri=function(t,e){var n=function(e,n){return ei(jo(t)).extract(e,n)},r=function(t,r){var o=pt(r),i=n(t,o);return po.bind(i,(function(n){var o=$(n,(function(t){return ho(t,t,ko(),e)}));return ti(o).extract(t,r)}))},o=function(){return"setOf("+e.toString()+")"};return{extract:r,toString:o}},oi=function(t,e){var n=ge(e),r=function(t,e){return n().extract(t,e)},o=function(){return n().toString()};return{extract:r,toString:o}},ii=b(ei,ti),ui=w(Wo),ai=function(t,e){return jo((function(n){var r=typeof n;return t(n)?po.svalue(n):po.serror("Expected type: "+e+" but got: "+r)}))},ci=ai(g,"number"),si=ai(i,"string"),fi=ai(s,"boolean"),li=ai(m,"function"),di=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every((function(e){return di(t[e])}));default:return!1}},mi=jo((function(t){return di(t)?po.svalue(t):po.serror("Expected value to be acceptable for sending via postMessage")})),gi=function(t,e,n,r){var o=Tt(n,r);return o.fold((function(){return Ho(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},pi=function(t,e){var n=function(n,r){var o=Tt(r,t);return o.fold((function(){return zo(n,t)}),(function(t){return gi(n,r,e,t)}))},r=function(){return"chooseOn("+t+"). Possible values: "+pt(e)};return{extract:n,toString:r}},hi=function(){return ei(Wo)},vi=function(t){return jo((function(e){return t(e).fold(po.serror,po.svalue)}))},bi=function(t,e){return ri((function(e){return po.fromResult(t(e))}),e)},yi=function(t,e,n){var r=e.extract([t],n);return po.mapError(r,(function(t){return{input:n,errors:t}}))},wi=function(t,e,n){return po.toResult(yi(t,e,n))},xi=function(t){return t.fold((function(t){throw new Error(Si(t))}),x)},Ci=function(t,e,n){return xi(wi(t,e,n))},Si=function(t){return"Errors: \n"+Io(t.errors).join("\n")+"\n\nInput object: "+Po(t.input)},ki=function(t,e){return pi(t,bt(e,ti))},Oi=function(t,e){return oi(t,e)},Ti=ho,Ei=vo,_i=function(t){return vi((function(e){return U(t,e)?ro.value(e):ro.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Di=function(t){return Ti(t,t,ko(),ui())},Ai=function(t,e){return Ti(t,t,ko(),e)},Ri=function(t){return Ai(t,ci)},Ni=function(t){return Ai(t,si)},Bi=function(t,e){return Ti(t,t,ko(),_i(e))},Mi=function(t){return Ai(t,fi)},Pi=function(t){return Ai(t,li)},Ii=function(t,e){return Ti(t,t,Eo(),jo((function(n){return po.serror("The field: "+t+" is forbidden. "+e)})))},Li=function(t,e){return Ti(t,t,ko(),ti(e))},Fi=function(t,e){return Ti(t,t,ko(),ii(e))},zi=function(t,e){return Ti(t,t,ko(),ei(e))},Hi=function(t){return Ti(t,t,Eo(),ui())},Vi=function(t,e){return Ti(t,t,Eo(),e)},Ui=function(t){return Vi(t,ci)},ji=function(t){return Vi(t,si)},Wi=function(t){return Vi(t,li)},qi=function(t,e){return Vi(t,ei(e))},$i=function(t,e){return Vi(t,ti(e))},Gi=function(t,e){return Vi(t,Zo(e))},Ki=function(t,e){return Ti(t,t,To(e),ui())},Xi=function(t,e,n){return Ti(t,t,To(e),n)},Yi=function(t,e){return Xi(t,e,ci)},Ji=function(t,e){return Xi(t,e,si)},Qi=function(t,e,n){return Xi(t,e,_i(n))},Zi=function(t,e){return Xi(t,e,fi)},tu=function(t,e){return Xi(t,e,li)},eu=function(t,e){return Xi(t,e,mi)},nu=function(t,e,n){return Xi(t,e,ei(n))},ru=function(t,e,n){return Xi(t,e,ti(n))},ou=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},iu=function(t){if(!a(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return G(t,(function(r,o){var i=pt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(t){var r=pt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));var o=ot(e,(function(t){return U(r,t)}));if(!o)throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:a,log:function(t){}}}})),n},uu={generate:iu};uu.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var au,cu=function(t){var e=[],n=[];return G(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}},su=function(t,e){var n={};return vt(t,(function(t,r){U(e,r)||(n[r]=t)})),n},fu=function(t,e){var n;return n={},n[t]=e,n},lu=function(t){var e={};return G(t,(function(t){e[t.key]=t.value})),e},du=function(t,e){return su(t,e)},mu=function(t,e){return fu(t,e)},gu=function(t){return lu(t)},pu=function(t,e){return 0===t.length?ro.value(e):ro.value(Co(e,So.apply(void 0,t)))},hu=function(t){return ro.error(nt(t))},vu=function(t,e){var n=cu(t);return n.errors.length>0?hu(n.errors):pu(n.values,e)},bu=function(t){return m(t)?t:T},yu=function(t,e,n){var r=t.dom,o=bu(n);while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return I.none()},wu=function(t,e,n){var r=e(t),o=bu(n);return r.orThunk((function(){return o(t)?I.none():yu(t,e,o)}))},xu=function(t,e){return sn(t.element,e.event.target)},Cu={can:E,abort:T,run:h},Su=function(t){if(!_t(t,"can")&&!_t(t,"abort")&&!_t(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return D(D({},Cu),t)},ku=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Q(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}},Ou=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Q(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}},Tu=function(t){return m(t)?{can:E,abort:T,run:t}:t},Eu=function(t){var e=ku(t,(function(t){return t.can})),n=Ou(t,(function(t){return t.abort})),r=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];G(t,(function(t){t.run.apply(void 0,e)}))};return{can:e,abort:n,run:r}},_u=w,Du=_u("touchstart"),Au=_u("touchmove"),Ru=_u("touchend"),Nu=_u("touchcancel"),Bu=_u("mousedown"),Mu=_u("mousemove"),Pu=_u("mouseout"),Iu=_u("mouseup"),Lu=_u("mouseover"),Fu=_u("focusin"),zu=_u("focusout"),Hu=_u("keydown"),Vu=_u("keyup"),Uu=_u("input"),ju=_u("change"),Wu=_u("click"),qu=_u("transitioncancel"),$u=_u("transitionend"),Gu=_u("transitionstart"),Ku=_u("selectstart"),Xu=function(t){return w("alloy."+t)},Yu={tap:Xu("tap")},Ju=Xu("focus"),Qu=Xu("blur.post"),Zu=Xu("paste.post"),ta=Xu("receive"),ea=Xu("execute"),na=Xu("focus.item"),ra=Yu.tap,oa=Xu("longpress"),ia=Xu("sandbox.close"),ua=Xu("typeahead.cancel"),aa=Xu("system.init"),ca=Xu("system.touchmove"),sa=Xu("system.touchend"),fa=Xu("system.scroll"),la=Xu("system.resize"),da=Xu("system.attached"),ma=Xu("system.detached"),ga=Xu("system.dismissRequested"),pa=Xu("system.repositionRequested"),ha=Xu("focusmanager.shifted"),va=Xu("slotcontainer.visibility"),ba=Xu("change.tab"),ya=Xu("dismiss.tab"),wa=Xu("highlight"),xa=Xu("dehighlight"),Ca=function(t,e){Ta(t,t.element,e,{})},Sa=function(t,e,n){Ta(t,t.element,e,n)},ka=function(t){Ca(t,ea())},Oa=function(t,e,n){Ta(t,e,n,{})},Ta=function(t,e,n,r){var o=D({target:e},r);t.getSystem().triggerEvent(n,e,o)},Ea=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},_a=function(t){return gu(t)},Da=function(t,e){return{key:t,value:Su({abort:e})}},Aa=function(t,e){return{key:t,value:Su({can:e})}},Ra=function(t){return{key:t,value:Su({run:function(t,e){e.event.prevent()}})}},Na=function(t,e){return{key:t,value:Su({run:e})}},Ba=function(t,e,n){return{key:t,value:Su({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Ma=function(t){return function(e){return Na(t,e)}},Pa=function(t){return function(e){return{key:t,value:Su({run:function(t,n){xu(t,n)&&e(t,n)}})}}},Ia=function(t,e){return Na(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){Ea(e,e.element,t,r)}))}))},La=function(t,e,n){var r=e.partUids[n];return Ia(t,r)},Fa=function(t,e){return Na(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){var e=wu(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),T);return e.getOr(t)}));e(t,o,n)}))},za=function(t){return Na(t,(function(t,e){e.cut()}))},Ha=function(t){return Na(t,(function(t,e){e.stop()}))},Va=function(t,e){return Pa(t)(e)},Ua=Pa(da()),ja=Pa(ma()),Wa=Pa(aa()),qa=Ma(ea()),$a=function(t,e){var n=e||document,r=n.createElement("div");return r.innerHTML=t,xn(ee.fromDom(r))},Ga=function(t){return t.dom.innerHTML},Ka=function(t,e){var n=mn(t),r=n.dom,o=ee.fromDom(r.createDocumentFragment()),i=$a(e,r);Br(o,i),Mr(t),Ar(t,o)},Xa=function(t){var e=ee.fromTag("div"),n=ee.fromDom(t.dom.cloneNode(!0));return Ar(e,n),Ga(e)},Ya=function(t,e){return ee.fromDom(t.dom.cloneNode(e))},Ja=function(t){return Ya(t,!1)},Qa=function(t){if(Tn(t))return"#shadow-root";var e=Ja(t);return Xa(e)},Za=function(t){return Qa(t)},tc=function(t,e,n){return sn(e,t.element)&&!sn(e,n)},ec=_a([Aa(Ju(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!tc(t,r,o)}))]),nc=Object.freeze({__proto__:null,events:ec}),rc=0,oc=function(t){var e=new Date,n=e.getTime(),r=Math.floor(1e9*Math.random());return rc++,t+"_"+r+rc+String(n)},ic=w("alloy-id-"),uc=w("data-alloy-id"),ac=ic(),cc=uc(),sc=function(t,e){var n=oc(ac+t);return fc(e,n),n},fc=function(t,e){Object.defineProperty(t.dom,cc,{value:e,writable:!0})},lc=function(t){var e=fe(t)?t.dom[cc]:null;return I.from(e)},dc=function(t){return oc(t)},mc=x,gc=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+Za(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){}};return{debugInfo:w("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:T}},pc=gc(),hc=function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:vc(u.slice(0,1).concat(u.slice(3)))}},t},vc=function(t){return $(t,(function(t){return Wt(t,"/*")?t.substring(0,t.length-"/*".length):t}))},bc=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:vc(i)}},t},yc=function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:vc(i.slice(1))}},t},wc=oc("alloy-premade"),xc=function(t){return mu(wc,t)},Cc=function(t){return Tt(t,wc)},Sc=function(t){return yc((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,R([e.getApis(),e],n,!1))}),t)},kc={init:function(){return Oc({readState:w("No State required")})}},Oc=function(t){return t},Tc=function(t,e){var n=$(e,(function(t){return $i(t.name(),[Di("config"),Ki("state",kc)])})),r=wi("component.behaviours",ti(n),t.behaviours).fold((function(e){throw new Error(Si(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),x);return{list:e,data:bt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return w(e)}))}},Ec=function(t){return t.list},_c=function(t){return t.data},Dc=function(t,e){var n={};return vt(t,(function(t,r){vt(t,(function(t,o){var i=Tt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},Ac=function(t){return{classes:f(t.classes)?[]:t.classes,attributes:f(t.attributes)?{}:t.attributes,styles:f(t.styles)?{}:t.styles}},Rc=function(t,e){return D(D({},t),{attributes:D(D({},t.attributes),e.attributes),styles:D(D({},t.styles),e.styles),classes:t.classes.concat(e.classes)})},Nc=function(t,e,n,r){var o=D({},e);G(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Dc(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return J(t,(function(t,e){return D(D({},e.modification),t)}),{})},a=J(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return Ac({classes:a,attributes:c,styles:s})},Bc=function(t,e,n,r){try{var o=st(n,(function(n,o){var i=n[e],u=o[e],a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0}));return ro.value(o)}catch(i){return ro.error([i])}},Mc=function(t,e){return{handler:t,purpose:e}},Pc=function(t,e){return{cHandler:t,purpose:e}},Ic=function(t,e){return Pc(S.apply(void 0,[t.handler].concat(e)),t.purpose)},Lc=function(t){return t.cHandler},Fc=function(t,e){return{name:t,handler:e}},zc=function(t,e){var n={};return G(t,(function(t){n[t.name()]=t.handlers(e)})),n},Hc=function(t,e,n){var r=D(D({},n),zc(e,t));return Dc(r,Fc)},Vc=function(t,e,n,r){var o=Hc(t,n,r);return qc(o,e)},Uc=function(t){var e=Tu(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},jc=function(t,e){return ro.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify($(e,(function(t){return t.name})),null,2)])},Wc=function(t,e,n){var r=e[n];return r?Bc("Event: "+n,"name",t,r).map((function(t){var e=$(t,(function(t){return t.handler}));return Eu(e)})):jc(n,t)},qc=function(t,e){var n=St(t,(function(t,n){var r=1===t.length?ro.value(t[0].handler):Wc(t,e,n);return r.map((function(r){var o=Uc(r),i=t.length>1?Y(e[n],(function(e){return j(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return mu(n,Mc(o,i))}))}));return vu(n,{})},$c="alloy.base.behaviour",Gc=ti([Ti("dom","dom",ko(),ti([Di("tag"),Ki("styles",{}),Ki("classes",[]),Ki("attributes",{}),Hi("value"),Hi("innerHtml")])),Di("components"),Di("uid"),Ki("events",{}),Ki("apis",{}),Ti("eventOrder","eventOrder",Do((au={},au[ea()]=["disabling",$c,"toggling","typeaheadevents"],au[Ju()]=[$c,"focusing","keying"],au[aa()]=[$c,"disabling","toggling","representing"],au[Uu()]=[$c,"representing","streaming","invalidating"],au[ma()]=[$c,"representing","item-events","tooltipping"],au[Bu()]=["focusing",$c,"item-type-events"],au[Du()]=["focusing",$c,"item-type-events"],au[Lu()]=["item-type-events","tooltipping"],au[ta()]=["receiving","reflecting","tooltipping"],au)),ui()),Hi("domModification")]),Kc=function(t){return wi("custom.definition",Gc,t)},Xc=function(t){return D(D({},t.dom),{uid:t.uid,domChildren:$(t.components,(function(t){return t.element}))})},Yc=function(t){return t.domModification.fold((function(){return Ac({})}),Ac)},Jc=function(t){return t.events},Qc=function(t,e){var n=Un(t,e);return void 0===n||""===n?[]:n.split(" ")},Zc=function(t,e,n){var r=Qc(t,e),o=r.concat([n]);return Hn(t,e,o.join(" ")),!0},ts=function(t,e,n){var r=Y(Qc(t,e),(function(t){return t!==n}));return r.length>0?Hn(t,e,r.join(" ")):qn(t,e),!1},es=function(t){return void 0!==t.dom.classList},ns=function(t){return Qc(t,"class")},rs=function(t,e){return Zc(t,"class",e)},os=function(t,e){return ts(t,"class",e)},is=function(t,e){es(t)?t.dom.classList.add(e):rs(t,e)},us=function(t){var e=es(t)?t.dom.classList:ns(t);0===e.length&&qn(t,"class")},as=function(t,e){if(es(t)){var n=t.dom.classList;n.remove(e)}else os(t,e);us(t)},cs=function(t,e){return es(t)&&t.dom.classList.contains(e)},ss=function(t,e){G(e,(function(e){is(t,e)}))},fs=function(t,e){G(e,(function(e){as(t,e)}))},ls=function(t,e){return ot(e,(function(e){return cs(t,e)}))},ds=function(t){return t.dom.value},ms=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},gs=function(t){var e=ee.fromTag(t.tag);Vn(e,t.attributes),ss(e,t.classes),Xn(e,t.styles),t.innerHtml.each((function(t){return Ka(e,t)}));var n=t.domChildren;return Br(e,n),t.value.each((function(t){ms(e,t)})),t.uid,fc(e,t.uid),e},ps=function(t){var e=Tt(t,"behaviours").getOr({});return rt(pt(e),(function(t){var n=e[t];return d(n)?[n.me]:[]}))},hs=function(t,e){return Tc(t,e)},vs=function(t){var e=ps(t);return hs(t,e)},bs=function(t,e,n){var r=Xc(t),o=Yc(t),i={"alloy.base.modification":o},u=e.length>0?Nc(n,i,e,r):o;return Rc(r,u)},ys=function(t,e,n){var r={"alloy.base.behaviour":Jc(t)};return Vc(n,t.eventOrder,e,r).getOrDie()},ws=function(t){var e=function(){return y},n=ou(pc),r=xi(Kc(t)),o=vs(t),i=Ec(o),u=_c(o),a=bs(r,i,u),c=gs(a),s=ys(r,i,u),f=ou(r.components),l=function(t){n.set(t)},d=function(){n.set(gc(e))},g=function(){var t=xn(c),e=rt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),ct)}));f.set(e)},p=function(e){var n=u,r=m(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))};return r()},h=function(t){return m(u[t.name()])},v=function(){return r.apis},b=function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},y={uid:t.uid,getSystem:n.get,config:p,hasConfigured:h,spec:t,readState:b,getApis:v,connect:l,disconnect:d,element:c,syncComponents:g,components:f.get,events:s};return y},xs=function(t){var e=Tt(t,"components").getOr([]);return $(e,Es)},Cs=function(t){var e=mc(t),n=e.events,r=A(e,["events"]),o=xs(r),i=D(D({},r),{events:D(D({},nc),n),components:o});return ro.value(ws(i))},Ss=function(t){var e=ee.fromText(t);return ks({element:e})},ks=function(t){var e=Ci("external.component",Zo([Di("element"),Hi("uid")]),t),n=ou(gc()),r=function(t){n.set(t)},o=function(){n.set(gc((function(){return u})))},i=e.uid.getOrThunk((function(){return dc("external")}));fc(e.element,i);var u={uid:i,getSystem:n.get,config:I.none,hasConfigured:T,connect:r,disconnect:o,getApis:function(){return{}},element:e.element,spec:t,readState:w("No state"),syncComponents:h,components:w([]),events:{}};return xc(u)},Os=dc,Ts=function(t){return Et(t,"uid")},Es=function(t){return Cc(t).getOrThunk((function(){var e=Ts(t)?t:D({uid:Os("")},t);return Cs(e).getOrDie()}))},_s=xc;function Ds(t,e,n,r,o){return t(n,r)?I.some(n):m(o)&&o(n)?I.none():e(n,r,o)}var As,Rs=function(t,e,n){var r=t.dom,o=m(n)?n:T;while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r);if(e(i))return I.some(i);if(o(i))break}return I.none()},Ns=function(t,e,n){var r=function(t,e){return e(t)};return Ds(r,Rs,t,e,n)},Bs=function(t,e){var n=function(t){return e(ee.fromDom(t))},r=tt(t.dom.childNodes,n);return r.map(ee.fromDom)},Ms=function(t,e){var n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=ee.fromDom(t.childNodes[r]);if(e(o))return I.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return I.none()};return n(t.dom)},Ps=function(t,e,n){return Ns(t,e,n).isSome()},Is=function(t,e,n){return Rs(t,(function(t){return on(t,e)}),n)},Ls=function(t,e){return Bs(t,(function(t){return on(t,e)}))},Fs=function(t,e){return cn(e,t)},zs=function(t,e,n){var r=function(t,e){return on(t,e)};return Ds(r,Is,t,e,n)},Hs=function(t){var e=Ns(t,(function(t){if(!fe(t))return!1;var e=Un(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1}));return e.bind((function(t){var e=Un(t,"id"),n=Dn(t);return Fs(n,'[aria-owns="'+e+'"]')}))},Vs=function(){var t=oc("aria-owns"),e=function(e){Hn(e,"aria-owns",t)},n=function(t){qn(t,"aria-owns")};return{id:t,link:e,unlink:n}},Us=function(t,e){return Hs(e).exists((function(e){return js(t,e)}))},js=function(t,e){return Ps(e,(function(e){return sn(e,t.element)}),T)||Us(t,e)},Ws="unknown";(function(t){t[t["STOP"]=0]="STOP",t[t["NORMAL"]=1]="NORMAL",t[t["LOGGING"]=2]="LOGGING"})(As||(As={}));var qs=ou({}),$s=function(t,e){var n=[];(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){(new Date).getTime();U(["mousemove","mouseover","mouseout",aa()],t)}}},Gs=function(t,e,n){var r=Tt(qs.get(),t).orThunk((function(){var e=pt(qs.get());return gt(e,(function(e){return t.indexOf(e)>-1?I.some(qs.get()[e]):I.none()}))})).getOr(As.NORMAL);switch(r){case As.NORMAL:return n(Qs());case As.LOGGING:var o=$s(t,e),i=n(o);return o.write(),i;case As.STOP:return!0}},Ks=["alloy/data/Fields","alloy/debugging/Debugging"],Xs=function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return tt(e,(function(t){return t.indexOf("alloy")>0&&!j(Ks,(function(e){return t.indexOf(e)>-1}))})).getOr(Ws)}return Ws},Ys={logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h},Js=function(t,e,n){return Gs(t,e,n)},Qs=w(Ys),Zs=w([Di("menu"),Di("selectedMenu")]),tf=w([Di("item"),Di("selectedItem")]);w(ti(tf().concat(Zs())));var ef=w(ti(tf())),nf=Li("initSize",[Di("numColumns"),Di("numRows")]),rf=function(){return Ai("markers",ef())},of=function(){return Li("markers",[Di("backgroundMenu")].concat(Zs()).concat(tf()))},uf=function(t){return Li("markers",$(t,Di))},af=function(t,e,n){return Xs(),Ti(e,e,n,vi((function(t){return ro.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},cf=function(t){return af("onHandler",t,To(h))},sf=function(t){return af("onKeyboardHandler",t,To(I.none))},ff=function(t){return af("onHandler",t,ko())},lf=function(t){return af("onKeyboardHandler",t,ko())},df=function(t,e){return Ei(t,w(e))},mf=function(t){return Ei(t,x)},gf=w(nf),pf=function(t,e,n,r,o,i,u,a){return void 0===a&&(a=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:u+"-"+o,alwaysFit:a}},hf=uu.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),vf=function(t,e,n,r,o,i,u,a,c){return t.fold(e,n,r,o,i,u,a,c)},bf=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)},yf=function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)},wf=hf.southeast,xf=hf.southwest,Cf=hf.northeast,Sf=hf.northwest,kf=hf.south,Of=hf.north,Tf=hf.east,Ef=hf.west,_f=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},Df=function(t,e,n){return Math.min(Math.max(t,e),n)},Af=function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}},Rf=function(t,e){return at(["left","right","top","bottom"],(function(n){return Tt(e,n).map((function(e){return Af(t,e)}))}))},Nf=function(t,e,n){var r=function(r,o){return e[r].map((function(e){var i="top"===r||"bottom"===r,u=i?n.top:n.left,a="left"===r||"top"===r?Math.max:Math.min,c=a(e,o)+u;return i?Df(c,t.y,t.bottom):Df(c,t.x,t.right)})).getOr(o)},o=r("left",t.x),i=r("top",t.y),u=r("right",t.right),a=r("bottom",t.bottom);return Yr(o,i,u-o,a-i)},Bf="layout",Mf=function(t){return t.x},Pf=function(t,e){return t.x+t.width/2-e.width/2},If=function(t,e){return t.x+t.width-e.width},Lf=function(t,e){return t.y-e.height},Ff=function(t){return t.y+t.height},zf=function(t,e){return t.y+t.height/2-e.height/2},Hf=function(t){return t.x+t.width},Vf=function(t,e){return t.x-e.width},Uf=function(t,e,n){return pf(Mf(t),Ff(t),n.southeast(),wf(),"southeast",Rf(t,{left:1,top:3}),Bf)},jf=function(t,e,n){return pf(If(t,e),Ff(t),n.southwest(),xf(),"southwest",Rf(t,{right:0,top:3}),Bf)},Wf=function(t,e,n){return pf(Mf(t),Lf(t,e),n.northeast(),Cf(),"northeast",Rf(t,{left:1,bottom:2}),Bf)},qf=function(t,e,n){return pf(If(t,e),Lf(t,e),n.northwest(),Sf(),"northwest",Rf(t,{right:0,bottom:2}),Bf)},$f=function(t,e,n){return pf(Pf(t,e),Lf(t,e),n.north(),Of(),"north",Rf(t,{bottom:2}),Bf)},Gf=function(t,e,n){return pf(Pf(t,e),Ff(t),n.south(),kf(),"south",Rf(t,{top:3}),Bf)},Kf=function(t,e,n){return pf(Hf(t),zf(t,e),n.east(),Tf(),"east",Rf(t,{left:0}),Bf)},Xf=function(t,e,n){return pf(Vf(t,e),zf(t,e),n.west(),Ef(),"west",Rf(t,{right:1}),Bf)},Yf=function(){return[Uf,jf,Wf,qf,Gf,$f,Kf,Xf]},Jf=function(){return[jf,Uf,qf,Wf,Gf,$f,Kf,Xf]},Qf=function(){return[Wf,qf,Uf,jf,$f,Gf]},Zf=function(){return[qf,Wf,jf,Uf,$f,Gf]},tl=function(){return[Uf,jf,Wf,qf,Gf,$f]},el=function(){return[jf,Uf,qf,Wf,Gf,$f]},nl=function(t,e){return e.universal?t:Y(t,(function(t){return U(e.channels,t)}))},rl=function(t){return _a([Na(ta(),(function(e,n){var r=t.channels,o=pt(r),i=n,u=nl(o,i);G(u,(function(t){var n=r[t],o=n.schema,u=Ci("channel["+t+"] data\nReceiver: "+Za(e.element),o,i.data);n.onReceive(e,u)}))}))])},ol=Object.freeze({__proto__:null,events:rl}),il=[Ai("channels",bi(ro.value,Zo([ff("onReceive"),Ki("schema",ui())])))],ul=function(t,e,n){return qa((function(r){n(r,t,e)}))},al=function(t,e,n){return Wa((function(r,o){n(r,t,e)}))},cl=function(t,e,n,r,o,i){var u=Zo(t),a=$i(e,[Gi("config",t)]);return dl(u,a,e,n,r,o,i)},sl=function(t,e,n,r,o,i){var u=t,a=$i(e,[Vi("config",t)]);return dl(u,a,e,n,r,o,i)},fl=function(t,e,n){var r=function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var u=[r].concat(o);return r.config({name:w(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(u,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))};return hc(r,n,e)},ll=function(t){return{key:t,value:void 0}},dl=function(t,e,n,r,o,i,u){var a=function(t){return _t(t,n)?t[n]():I.none()},c=bt(o,(function(t,e){return fl(n,t,e)})),s=bt(i,(function(t,e){return bc(t,e)})),f=D(D(D({},s),c),{revoke:S(ll,n),config:function(e){var r=Ci(n+"-config",t,e);return{key:n,value:{config:r,me:f,configAsRaw:ge((function(){return Ci(n+"-config",t,e)})),initialConfig:e,state:u}}},schema:w(e),exhibit:function(t,e){return Bt(a(t),Tt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return Ac({})}))},name:w(n),handlers:function(t){return a(t).map((function(t){var e=Tt(r,"events").getOr((function(){return{}}));return e(t.config,t.state)})).getOr({})}});return f},ml=function(t){return gu(t)},gl=Zo([Di("fields"),Di("name"),Ki("active",{}),Ki("apis",{}),Ki("state",kc),Ki("extra",{})]),pl=function(t){var e=Ci("Creating behaviour: "+t.name,gl,t);return cl(e.fields,e.name,e.active,e.apis,e.extra,e.state)},hl=Zo([Di("branchKey"),Di("branches"),Di("name"),Ki("active",{}),Ki("apis",{}),Ki("state",kc),Ki("extra",{})]),vl=function(t){var e=Ci("Creating behaviour: "+t.name,hl,t);return sl(ki(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},bl=w(void 0),yl=pl({fields:il,name:"receiving",active:ol}),wl=function(t,e){return Ac({classes:[],styles:e.useFixed()?{}:{position:"relative"}})},xl=Object.freeze({__proto__:null,exhibit:wl}),Cl=function(){return ee.fromDom(document)},Sl=function(t){return t.dom.focus()},kl=function(t){return t.dom.blur()},Ol=function(t){var e=Dn(t).dom;return t.dom===e.activeElement},Tl=function(t){return void 0===t&&(t=Cl()),I.from(t.dom.activeElement).map(ee.fromDom)},El=function(t){return Tl(Dn(t)).filter((function(e){return t.dom.contains(e.dom)}))},_l=function(t,e){var n=Dn(e),r=Tl(n).bind((function(t){var n=function(e){return sn(t,e)};return n(e)?I.some(e):Ms(e,n)})),o=t(e);return r.each((function(t){Tl(n).filter((function(e){return sn(e,t)})).fold((function(){Sl(t)}),h)})),o},Dl=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Al=function(t){return D(D({},t),{position:I.some(t.position)})},Rl=function(t,e){Yn(t,Al(e))},Nl=uu.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Bl=function(t,e,n,r,o,i){var u=e.rect,a=u.x-n,c=u.y-r,s=u.width,f=u.height,l=o-(a+s),d=i-(c+f),m=I.some(a),g=I.some(c),p=I.some(l),h=I.some(d),v=I.none();return vf(e.direction,(function(){return Dl(t,m,g,v,v)}),(function(){return Dl(t,v,g,p,v)}),(function(){return Dl(t,m,v,v,h)}),(function(){return Dl(t,v,v,p,h)}),(function(){return Dl(t,m,g,v,v)}),(function(){return Dl(t,m,v,v,h)}),(function(){return Dl(t,m,g,v,v)}),(function(){return Dl(t,v,g,p,v)}))},Ml=function(t,e){return t.fold((function(){var t=e.rect;return Dl("absolute",I.some(t.x),I.some(t.y),I.none(),I.none())}),(function(t,n,r,o){return Bl("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Bl("fixed",e,t,n,r,o)}))},Pl=function(t,e){var n=S(Gr,e),r=t.fold(n,n,(function(){var t=Lr();return Gr(e).translate(-t.left,-t.top)})),o=br(e),i=ar(e);return Yr(r.left,r.top,o,i)},Il=function(t,e){return e.fold((function(){return t.fold(Zr,Zr,Yr)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=Ll(t,n.x,n.y);return Yr(r.left,r.top,n.width,n.height)}))}))},Ll=function(t,e,n){var r=fr(e,n),o=function(){var t=Lr();return r.translate(-t.left,-t.top)};return t.fold(w(r),w(r),o)},Fl=function(t,e,n,r){return t.fold(e,n,r)};Nl.none;var zl,Hl=Nl.relative,Vl=Nl.fixed,Ul=function(t,e){return{anchorBox:t,origin:e}},jl=function(t,e){return Ul(t,e)},Wl="data-alloy-placement",ql=function(t,e){Hn(t,Wl,e)},$l=function(t){return jn(t,Wl)},Gl=function(t){return qn(t,Wl)},Kl=uu.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Xl=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.right,s=t.bottom,f=t.width,l=t.height,d=u>=n&&u<=o,m=a>=r&&a<=i,g=d&&m,p=c<=o&&c>=n,h=s<=i&&s>=r,v=p&&h,b=Math.min(f,u>=n?o-u:c-n),y=Math.min(l,a>=r?i-a:s-r);return{originInBounds:g,sizeInBounds:v,visibleW:b,visibleH:y}},Yl=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.width,s=t.height,f=Math.max(n,o-c),l=Math.max(r,i-s),d=Df(u,n,f),m=Df(a,r,l),g=Math.min(d+c,o)-d,p=Math.min(m+s,i)-m;return Yr(d,m,g,p)},Jl=function(t,e,n){var r=w(e.bottom-n.y),o=w(n.bottom-e.y),i=bf(t,o,o,r),u=w(e.right-n.x),a=w(n.right-e.x),c=yf(t,a,a,u);return{maxWidth:c,maxHeight:i}},Ql=function(t,e,n,r){var o=t.bubble,i=o.offset,u=Nf(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=Yr(a,c,e,n),f=Xl(s,u),l=f.originInBounds,d=f.sizeInBounds,m=f.visibleW,g=f.visibleH,p=l&&d,h=p?s:Yl(s,u),v=h.width>0&&h.height>0,b=Jl(t.direction,h,r),y=b.maxWidth,w=b.maxHeight,x={rect:h,maxHeight:w,maxWidth:y,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return p||t.alwaysFit?Kl.fit(x):Kl.nofit(x,m,g,v)},Zl=function(t,e,n,r,o,i){var u=r.width,a=r.height,c=function(e,c,s,f,l){var d=e(n,r,o,t,i),m=Ql(d,u,a,i);return m.fold(w(m),(function(t,e,n,r){var o=l===r?n>f||e>s:!l&&r;return o?m:Kl.nofit(c,s,f,l)}))},s=Q(e,(function(t,e){var n=S(c,e);return t.fold(w(t),n)}),Kl.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:wf(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return s.fold(x,x)},td=function(t){var e=ou(I.none()),n=function(){return e.get().each(t)},r=function(){n(),e.set(I.none())},o=function(){return e.get().isSome()},i=function(){return e.get()},u=function(t){n(),e.set(I.some(t))};return{clear:r,isSet:o,get:i,set:u}},ed=function(){return td((function(t){return t.destroy()}))},nd=function(){return td((function(t){return t.unbind()}))},rd=function(){var t=ed(),e=function(e){return t.get().each(e)};return D(D({},t),{run:e})},od=function(){var t=td(h),e=function(e){return t.get().each(e)};return D(D({},t),{on:e})},id=E,ud=function(t,e,n){return kr(t,e,id,n)},ad=function(t,e,n){return Or(t,e,id,n)},cd=xr,sd=["top","bottom","right","left"],fd="data-alloy-transition-timer",ld=function(t,e){return ls(t,e.classes)},dd=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))},md=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return kt(e,(function(e,r){var o=t[r].map(n),i=e.map(n);return!At(o,i)})).isSome()},gd=function(t){var e=function(e){var n=Jn(t,e),r=i(n)?n.split(/\s*,\s*/):[];return Y(r,Gt)},n=function(t){if(i(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Wt(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),o=e("transition-duration");return Q(o,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)},pd=function(t,e){var n,r=nd(),o=nd(),i=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return sn(e.target,t)&&Kt(r)&&U(sd,e.raw.propertyName)},u=function(u){if(l(u)||i(u)){r.clear(),o.clear();var a=null===u||void 0===u?void 0:u.raw.type;(l(a)||a===$u())&&(clearTimeout(n),qn(t,fd),fs(t,e.classes))}},a=function(){r.set(ud(t,$u(),u)),o.set(ud(t,qu(),u))};if("ontransitionstart"in t.dom)var c=ud(t,Gu(),(function(t){i(t)&&(c.unbind(),a())}));else a();var s=gd(t);requestAnimationFrame((function(){n=setTimeout(u,s+17),Hn(t,fd,n)}))},hd=function(t,e){ss(t,e.classes),jn(t,fd).each((function(e){clearTimeout(parseInt(e,10)),qn(t,fd)})),pd(t,e)},vd=function(t,e,n,r,o,i){var u=dd(r,o,i);if(u||ld(t,r)){Kn(t,"position",n.position);var a=Pl(e,t),c=Ml(e,D(D({},o),{rect:a})),s=at(sd,(function(t){return c[t]}));md(n,s)&&(Yn(t,s),u&&hd(t,r),rr(t))}else fs(t,r.classes)},bd=function(t){return{width:br(t),height:ar(t)}},yd=function(t,e,n,r){nr(e,"max-height"),nr(e,"max-width");var o=bd(e);return Zl(e,r.preference,t,o,n,r.bounds)},wd=function(t,e){var n=e.classes;fs(t,n.off),ss(t,n.on)},xd=function(t,e,n){var r=n.maxHeightFunction;r(t,e.maxHeight)},Cd=function(t,e,n){var r=n.maxWidthFunction;r(t,e.maxWidth)},Sd=function(t,e,n){var r=Ml(n.origin,e);n.transition.each((function(o){vd(t,n.origin,r,o,e,n.lastPlacement)})),Rl(t,r)},kd=function(t,e){ql(t,e.placement)},Od=function(t,e){cr(t,Math.floor(e))},Td=w((function(t,e){Od(t,e),Xn(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Ed=w((function(t,e){Od(t,e)})),_d=function(t,e,n){return void 0===t[e]?n:t[e]},Dd=function(t,e,n,r,o,i,u,a){var c=_d(u,"maxHeightFunction",Td()),s=_d(u,"maxWidthFunction",h),f=t.anchorBox,l=t.origin,d={bounds:Il(l,i),origin:l,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return Ad(f,e,n,d)},Ad=function(t,e,n,r){var o=yd(t,e,n,r);return Sd(e,o,r),kd(e,o),wd(e,o),xd(e,o,r),Cd(e,o,r),{layout:o.layout,placement:o.placement}},Rd=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Nd=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return Tt(n,t).getOr([])},a=function(t,e,n){var r=ut(Rd,n);return{offset:fr(t,e),classesOn:rt(n,u),classesOff:rt(r,u)}};return{southeast:function(){return a(-t,e,["top","alignLeft"])},southwest:function(){return a(t,e,["top","alignRight"])},south:function(){return a(-t/2,e,["top","alignCentre"])},northeast:function(){return a(-t,-e,["bottom","alignLeft"])},northwest:function(){return a(t,-e,["bottom","alignRight"])},north:function(){return a(-t/2,-e,["bottom","alignCentre"])},east:function(){return a(t,-e/2,["valignCentre","left"])},west:function(){return a(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return a(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-o,i,["top","alignRight","inset"])},insetNorth:function(){return a(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(o,-i/2,["valignCentre","left","inset"])}}},Bd=function(){return Nd(0,0,{})},Md=x,Pd=function(t,e){return function(n){return"rtl"===Id(n)?e:t}},Id=function(t){return"rtl"===Jn(t,"direction")?"rtl":"ltr"};(function(t){t["TopToBottom"]="toptobottom",t["BottomToTop"]="bottomtotop"})(zl||(zl={}));var Ld="data-alloy-vertical-dir",Fd=function(t){return Ps(t,(function(t){return fe(t)&&Un(t,"data-alloy-vertical-dir")===zl.BottomToTop}))},zd=function(){return $i("layouts",[Di("onLtr"),Di("onRtl"),Hi("onBottomLtr"),Hi("onBottomRtl")])},Hd=function(t,e,n,r,o,i,u){var a=u.map(Fd).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),f=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),l=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r),d=Pd(f,l);return d(t)},Vd=function(t,e,n){var r=e.hotspot,o=Pl(n,r.element),i=Hd(t.element,e,tl(),el(),Qf(),Zf(),I.some(e.hotspot.element));return I.some(Md({anchorBox:o,bubble:e.bubble.getOr(Bd()),overrides:e.overrides,layouts:i,placer:I.none()}))},Ud=[Di("hotspot"),Hi("bubble"),Ki("overrides",{}),zd(),df("placement",Vd)],jd=function(t,e,n){var r=Ll(n,e.x,e.y),o=Yr(r.left,r.top,e.width,e.height),i=Hd(t.element,e,Yf(),Jf(),Yf(),Jf(),I.none());return I.some(Md({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:I.none()}))},Wd=[Di("x"),Di("y"),Ki("height",0),Ki("width",0),Ki("bubble",Bd()),Ki("overrides",{}),zd(),df("placement",jd)],qd=uu.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$d=function(t){return t.fold(x,(function(t,e,n){return t.translate(-e,-n)}))},Gd=function(t){return t.fold(x,x)},Kd=function(t){return Q(t,(function(t,e){return t.translate(e.left,e.top)}),fr(0,0))},Xd=function(t){var e=$(t,$d);return Kd(e)},Yd=function(t){var e=$(t,Gd);return Kd(e)},Jd=qd.screen,Qd=qd.absolute,Zd=function(t,e,n){var r=hn(n.root).dom,o=function(e){var n=mn(e),r=mn(t.element);return sn(n,r)};return I.from(r.frameElement).map(ee.fromDom).filter(o).map(mr)},tm=function(t,e,n){var r=mn(t.element),o=Lr(r),i=Zd(t,e,n).getOr(o);return Qd(i,o.left,o.top)},em=function(t,e,n,r){var o=Jd(fr(t,e));return I.some(Kr(o,n,r))},nm=function(t,e,n,r,o){return t.map((function(t){var i=[e,t.point],u=Fl(r,(function(){return Yd(i)}),(function(){return Yd(i)}),(function(){return Xd(i)})),a=Xr(u.left,u.top,t.width,t.height),c=n.showAbove?Qf():tl(),s=n.showAbove?Zf():el(),f=Hd(o,n,c,s,c,s,I.none());return Md({anchorBox:a,bubble:n.bubble.getOr(Bd()),overrides:n.overrides,layouts:f,placer:I.none()})}))},rm=function(t,e,n){var r=tm(t,n,e);return e.node.filter(In).bind((function(o){var i=o.dom.getBoundingClientRect(),u=em(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return nm(u,r,e,n,a)}))},om=[Di("node"),Di("root"),Hi("bubble"),zd(),Ki("overrides",{}),Ki("showAbove",!1),df("placement",rm)],im="\ufeff",um=" ",am=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},cm={create:am},sm=uu.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),fm=function(t,e,n,r){return t.fold(e,n,r)},lm=function(t){return t.fold(x,x,x)},dm=sm.before,mm=sm.on,gm=sm.after,pm={before:dm,on:mm,after:gm,cata:fm,getStart:lm},hm=uu.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),vm=function(t){return hm.exact(t.start,t.soffset,t.finish,t.foffset)},bm=function(t){return t.match({domRange:function(t){return ee.fromDom(t.startContainer)},relative:function(t,e){return pm.getStart(t)},exact:function(t,e,n,r){return t}})},ym=hm.domRange,wm=hm.relative,xm=hm.exact,Cm=function(t){var e=bm(t);return hn(e)},Sm=cm.create,km={domRange:ym,relative:wm,exact:xm,exactFromRange:vm,getWin:Cm,range:Sm},Om=function(t,e){e.fold((function(e){t.setStartBefore(e.dom)}),(function(e,n){t.setStart(e.dom,n)}),(function(e){t.setStartAfter(e.dom)}))},Tm=function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))},Em=function(t,e,n){var r=t.document.createRange();return Om(r,e),Tm(r,n),r},_m=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Dm=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Am=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?I.some(n).map(Dm):I.none()},Rm=function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?I.some(e).map(Dm):I.none()},Nm=uu.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Bm=function(t,e,n){return e(ee.fromDom(n.startContainer),n.startOffset,ee.fromDom(n.endContainer),n.endOffset)},Mm=function(t,e){return e.match({domRange:function(t){return{ltr:w(t),rtl:I.none}},relative:function(e,n){return{ltr:ge((function(){return Em(t,e,n)})),rtl:ge((function(){return I.some(Em(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:ge((function(){return _m(t,e,n,r,o)})),rtl:ge((function(){return I.some(_m(t,r,o,e,n))}))}}})},Pm=function(t,e){var n=e.ltr();if(n.collapsed){var r=e.rtl().filter((function(t){return!1===t.collapsed}));return r.map((function(t){return Nm.rtl(ee.fromDom(t.endContainer),t.endOffset,ee.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Bm(t,Nm.ltr,n)}))}return Bm(t,Nm.ltr,n)},Im=function(t,e){var n=Mm(t,e);return Pm(t,n)},Lm=function(t,e){var n=Im(t,e);return n.match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Nm.ltr,Nm.rtl;var Fm,zm=function(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?I.from(e.dom.nodeValue):I.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:o}},Hm=zm(le,"text"),Vm=function(t){return Hm.get(t)},Um=function(t){return Hm.getOption(t)},jm=function(t){return"img"===ae(t)?1:Um(t).fold((function(){return xn(t).length}),(function(t){return t.length}))},Wm=function(t){return Um(t).filter((function(t){return 0!==t.trim().length||t.indexOf(um)>-1})).isSome()},qm=["img","br"],$m=function(t){var e=Wm(t);return e||U(qm,ae(t))},Gm=function(t){return Km(t,$m)},Km=function(t,e){var n=function(t){for(var r=xn(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return I.some(i);var u=n(i);if(u.isSome())return u}return I.none()};return n(t)},Xm=function(t,e){return an(e,t)},Ym=function(t,e,n,r){var o=mn(t),i=o.dom.createRange();return i.setStart(t.dom,e),i.setEnd(n.dom,r),i},Jm=function(t,e,n,r){var o=Ym(t,e,n,r),i=sn(t,n)&&e===r;return o.collapsed&&!i},Qm=function(t){return I.from(t.getSelection())},Zm=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return I.some(cm.create(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(n.endContainer),n.endOffset))}return I.none()},tg=function(t){if(null===t.anchorNode||null===t.focusNode)return Zm(t);var e=ee.fromDom(t.anchorNode),n=ee.fromDom(t.focusNode);return Jm(e,t.anchorOffset,n,t.focusOffset)?I.some(cm.create(e,t.anchorOffset,n,t.focusOffset)):Zm(t)},eg=function(t){return Qm(t).filter((function(t){return t.rangeCount>0})).bind(tg)},ng=function(t,e){var n=Lm(t,e);return Am(n)},rg=function(t,e){var n=Lm(t,e);return Rm(n)},og=function(t,e){return{element:t,offset:e}},ig=function(t,e){var n=xn(t);if(0===n.length)return og(t,e);if(e<n.length)return og(n[e],0);var r=n[n.length-1],o=le(r)?Vm(r).length:xn(r).length;return og(r,o)},ug=function(t,e){return le(t)?og(t,e):ig(t,e)},ag=function(t,e){var n=e.getSelection.getOrThunk((function(){return function(){return eg(t)}}));return n().map((function(t){var e=ug(t.start,t.soffset),n=ug(t.finish,t.foffset);return km.range(e.element,e.offset,n.element,n.offset)}))},cg=function(t,e,n){var r=hn(e.root).dom,o=tm(t,n,e),i=ag(r,e).bind((function(t){var e=rg(r,km.exactFromRange(t)).orThunk((function(){var e=ee.fromText(im);Er(t.start,e);var n=ng(r,km.exact(e,0,e,1));return Pr(e),n}));return e.bind((function(t){return em(t.left,t.top,t.width,t.height)}))})),u=ag(r,e).bind((function(t){return fe(t.start)?I.some(t.start):bn(t.start)})),a=u.getOr(t.element);return nm(i,o,e,n,a)},sg=[Hi("getSelection"),Di("root"),Hi("bubble"),zd(),Ki("overrides",{}),Ki("showAbove",!1),df("placement",cg)],fg="link-layout",lg=function(t){return t.x+t.width},dg=function(t,e){return t.x-e.width},mg=function(t,e){return t.y-e.height+t.height},gg=function(t){return t.y},pg=function(t,e,n){return pf(lg(t),gg(t),n.southeast(),wf(),"southeast",Rf(t,{left:0,top:2}),fg)},hg=function(t,e,n){return pf(dg(t,e),gg(t),n.southwest(),xf(),"southwest",Rf(t,{right:1,top:2}),fg)},vg=function(t,e,n){return pf(lg(t),mg(t,e),n.northeast(),Cf(),"northeast",Rf(t,{left:0,bottom:3}),fg)},bg=function(t,e,n){return pf(dg(t,e),mg(t,e),n.northwest(),Sf(),"northwest",Rf(t,{right:1,bottom:3}),fg)},yg=function(){return[pg,hg,vg,bg]},wg=function(){return[hg,pg,bg,vg]},xg=function(t,e,n){var r=Pl(n,e.item.element),o=Hd(t.element,e,yg(),wg(),yg(),wg(),I.none());return I.some(Md({anchorBox:r,bubble:Bd(),overrides:e.overrides,layouts:o,placer:I.none()}))},Cg=[Di("item"),zd(),Ki("overrides",{}),df("placement",xg)],Sg=ki("type",{selection:sg,node:om,hotspot:Ud,submenu:Cg,makeshift:Wd}),kg=[zi("classes",si),Qi("mode","all",["all","layout","placement"])],Og=[Ki("useFixed",T),Hi("getBounds")],Tg=[Ai("anchor",Sg),$i("transition",kg)],Eg=function(){var t=document.documentElement;return Vl(0,0,t.clientWidth,t.clientHeight)},_g=function(t){var e=mr(t.element),n=t.element.dom.getBoundingClientRect();return Hl(e.left,e.top,n.width,n.height)},Dg=function(t,e,n,r,o,i,u){var a=jl(n.anchorBox,e);return Dd(a,o.element,n.bubble,n.layouts,i,r,n.overrides,u)},Ag=function(t,e,n,r,o){Rg(t,e,n,r,o,I.none())},Rg=function(t,e,n,r,o,i){var u=i.map(Jr);return Ng(t,e,n,r,o,u)},Ng=function(t,e,n,r,o,i){var u=Ci("placement.info",ti(Tg),o),a=u.anchor,c=r.element,s=n.get(r.uid);_l((function(){Kn(c,"position","fixed");var o=Zn(c,"visibility");Kn(c,"visibility","hidden");var f=e.useFixed()?Eg():_g(t),l=a.placement,d=i.map(w).or(e.getBounds);l(t,a,f).each((function(e){var o=e.placer.getOr(Dg),i=o(t,f,e,d,r,s,u.transition);n.set(r.uid,i)})),o.fold((function(){nr(c,"visibility")}),(function(t){Kn(c,"visibility",t)})),Zn(c,"left").isNone()&&Zn(c,"top").isNone()&&Zn(c,"right").isNone()&&Zn(c,"bottom").isNone()&&Dt(Zn(c,"position"),"fixed")&&nr(c,"position")}),c)},Bg=function(t,e,n){return e.useFixed()?"fixed":"absolute"},Mg=function(t,e,n,r){var o=r.element;G(["position","left","right","top","bottom"],(function(t){return nr(o,t)})),Gl(o),n.clear(r.uid)},Pg=Object.freeze({__proto__:null,position:Ag,positionWithin:Rg,positionWithinBounds:Ng,getMode:Bg,reset:Mg}),Ig=function(){var t={},e=function(e,n){t[e]=n},n=function(e){return Tt(t,e)},r=function(e){d(e)?delete t[e]:t={}};return Oc({readState:function(){return t},clear:r,set:e,get:n})},Lg=Object.freeze({__proto__:null,init:Ig}),Fg=pl({fields:Og,name:"positioning",active:xl,apis:Pg,state:Lg}),zg=function(t){Ca(t,ma());var e=t.components();G(e,zg)},Hg=function(t){var e=t.components();G(e,Hg),Ca(t,da())},Vg=function(t,e){Ar(t.element,e.element)},Ug=function(t){G(t.components(),(function(t){return Pr(t.element)})),Mr(t.element),t.syncComponents()},jg=function(t,e){var n=t.components();Ug(t);var r=ut(n,e);G(r,(function(e){zg(e),t.getSystem().removeFromWorld(e)})),G(e,(function(e){e.getSystem().isConnected()?Vg(t,e):(t.getSystem().addToWorld(e),Vg(t,e),In(t.element)&&Hg(e)),t.syncComponents()}))},Wg=function(t,e){qg(t,e,Ar)},qg=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),In(t.element)&&Hg(e),t.syncComponents()},$g=function(t){zg(t),Pr(t.element),t.getSystem().removeFromWorld(t)},Gg=function(t){var e=vn(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));$g(t),e.each((function(t){t.syncComponents()}))},Kg=function(t){var e=t.components();G(e,$g),Mr(t.element),t.syncComponents()},Xg=function(t,e){Jg(t,e,Ar)},Yg=function(t,e){Jg(t,e,_r)},Jg=function(t,e,n){n(t,e.element);var r=xn(e.element);G(r,(function(t){e.getByDom(t).each(Hg)}))},Qg=function(t){var e=xn(t.element);G(e,(function(e){t.getByDom(e).each(zg)})),Pr(t.element)},Zg=function(t,e,n,r){n.get().each((function(e){Kg(t)}));var o=e.getAttachPoint(t);Wg(o,t);var i=t.getSystem().build(r);return Wg(t,i),n.set(i),i},tp=function(t,e,n,r){var o=Zg(t,e,n,r);return e.onOpen(t,o),o},ep=function(t,e,n,r){return n.get().map((function(){return Zg(t,e,n,r)}))},np=function(t,e,n,r,o){sp(t,e),tp(t,e,n,r),o(),lp(t,e)},rp=function(t,e,n){n.get().each((function(r){Kg(t),Gg(t),e.onClose(t,r),n.clear()}))},op=function(t,e,n){return n.isOpen()},ip=function(t,e,n,r){return op(t,e,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},up=function(t,e,n){return n.get()},ap=function(t,e,n,r){Zn(t.element,e).fold((function(){qn(t.element,n)}),(function(e){Hn(t.element,n,e)})),Kn(t.element,e,r)},cp=function(t,e,n){jn(t.element,n).fold((function(){return nr(t.element,e)}),(function(n){return Kn(t.element,e,n)}))},sp=function(t,e,n){var r=e.getAttachPoint(t);Kn(t.element,"position",Fg.getMode(r)),ap(t,"visibility",e.cloakVisibilityAttr,"hidden")},fp=function(t){return j(["top","left","right","bottom"],(function(e){return Zn(t,e).isSome()}))},lp=function(t,e,n){fp(t.element)||nr(t.element,"position"),cp(t,"visibility",e.cloakVisibilityAttr)},dp=Object.freeze({__proto__:null,cloak:sp,decloak:lp,open:tp,openWhileCloaked:np,close:rp,isOpen:op,isPartOf:ip,getState:up,setContent:ep}),mp=function(t,e){return _a([Na(ia(),(function(n,r){rp(n,t,e)}))])},gp=Object.freeze({__proto__:null,events:mp}),pp=[cf("onOpen"),cf("onClose"),Di("isPartOf"),Di("getAttachPoint"),Ki("cloakVisibilityAttr","data-precloak-visibility")],hp=function(){var t=od(),e=w("not-implemented");return Oc({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})},vp=Object.freeze({__proto__:null,init:hp}),bp=pl({fields:pp,name:"sandboxing",active:gp,apis:dp,state:vp}),yp=w("dismiss.popups"),wp=w("reposition.popups"),xp=w("mouse.released"),Cp=Zo([Ki("isExtraPart",T),$i("fireEventInstead",[Ki("event",ga())])]),Sp=function(t){var e,n=Ci("Dismissal",Cp,t);return e={},e[yp()]={schema:Zo([Di("target")]),onReceive:function(t,e){if(bp.isOpen(t)){var r=bp.isPartOf(t,e.target)||n.isExtraPart(t,e.target);r||n.fireEventInstead.fold((function(){return bp.close(t)}),(function(e){return Ca(t,e.event)}))}}},e},kp=Zo([$i("fireEventInstead",[Ki("event",pa())]),Pi("doReposition")]),Op=function(t){var e,n=Ci("Reposition",kp,t);return e={},e[wp()]={onReceive:function(t){bp.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Ca(t,e.event)}))}},e},Tp=function(t,e,n){e.store.manager.onLoad(t,e,n)},Ep=function(t,e,n){e.store.manager.onUnload(t,e,n)},_p=function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},Dp=function(t,e,n){return e.store.manager.getValue(t,e,n)},Ap=function(t,e,n){return n},Rp=Object.freeze({__proto__:null,onLoad:Tp,onUnload:Ep,setValue:_p,getValue:Dp,getState:Ap}),Np=function(t,e){var n=t.resetOnDom?[Ua((function(n,r){Tp(n,t,e)})),ja((function(n,r){Ep(n,t,e)}))]:[al(t,e,Tp)];return _a(n)},Bp=Object.freeze({__proto__:null,events:Np}),Mp=function(){var t=ou(null),e=function(){return{mode:"memory",value:t.get()}},n=function(){return null===t.get()},r=function(){t.set(null)};return Oc({set:t.set,get:t.get,isNotSet:n,clear:r,readState:e})},Pp=function(){var t=h;return Oc({readState:t})},Ip=function(){var t=ou({}),e=ou({}),n=function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},r=function(){t.set({}),e.set({})},o=function(n){return Tt(t.get(),n).orThunk((function(){return Tt(e.get(),n)}))},i=function(n){var r=t.get(),o=e.get(),i={},u={};G(n,(function(t){i[t.value]=t,Tt(t,"meta").each((function(e){Tt(e,"text").each((function(e){u[e]=t}))}))})),t.set(D(D({},r),i)),e.set(D(D({},o),u))};return Oc({readState:n,lookup:o,update:i,clear:r})},Lp=function(t){return t.store.manager.state(t)},Fp=Object.freeze({__proto__:null,memory:Mp,dataset:Ip,manual:Pp,init:Lp}),zp=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Hp=function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},Vp=function(t,e,n){var r=e.store;r.initialValue.each((function(r){zp(t,e,n,r)}))},Up=function(t,e,n){n.clear()},jp=[Hi("initialValue"),Di("getFallbackEntry"),Di("getDataKey"),Di("setValue"),df("manager",{setValue:zp,getValue:Hp,onLoad:Vp,onUnload:Up,state:Ip})],Wp=function(t,e,n){return e.store.getValue(t)},qp=function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},$p=function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},Gp=[Di("getValue"),Ki("setValue",h),Hi("initialValue"),df("manager",{setValue:qp,getValue:Wp,onLoad:$p,onUnload:h,state:kc.init})],Kp=function(t,e,n,r){n.set(r),e.onSetValue(t,r)},Xp=function(t,e,n){return n.get()},Yp=function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},Jp=function(t,e,n){n.clear()},Qp=[Hi("initialValue"),df("manager",{setValue:Kp,getValue:Xp,onLoad:Yp,onUnload:Jp,state:Mp})],Zp=[Xi("store",{mode:"memory"},ki("mode",{memory:Qp,manual:Gp,dataset:jp})),cf("onSetValue"),Ki("resetOnDom",!1)],th=pl({fields:Zp,name:"representing",active:Bp,apis:Rp,extra:{setValueFrom:function(t,e){var n=th.getValue(e);th.setValue(t,n)}},state:Fp}),eh=function(t,e){return ru(t,{},$(e,(function(e){return Ii(e.name(),"Cannot configure "+e.name()+" for "+t)})).concat([Ei("dump",x)]))},nh=function(t){return t.dump},rh=function(t,e){return D(D({},ml(e)),t.dump)},oh={field:eh,augment:rh,get:nh},ih="placeholder",uh=uu.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),ah=function(t){return Et(t,"uiType")},ch=function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?uh.single(!0,w(n)):Tt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+pt(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))},sh=function(t,e,n,r){return ah(n)&&n.uiType===ih?ch(t,e,n,r):uh.single(!1,w(n))},fh=function(t,e,n,r){var o=sh(t,e,n,r);return o.fold((function(o,i){var u=ah(n)?i(e,n.config,n.validated):i(e),a=Tt(u,"components").getOr([]),c=rt(a,(function(n){return fh(t,e,n,r)}));return[D(D({},u),{components:c})]}),(function(t,r){if(ah(n)){var o=r(e,n.config,n.validated),i=n.validated.preprocess.getOr(x);return i(o)}return r(e)}))},lh=function(t,e,n,r){return rt(n,(function(n){return fh(t,e,n,r)}))},dh=function(t,e){var n=!1,r=function(){return n},o=function(){if(n)throw new Error("Trying to use the same placeholder more than once: "+t);return n=!0,e},i=function(){return e.fold((function(t,e){return t}),(function(t,e){return t}))};return{name:w(t),required:i,used:r,replace:o}},mh=function(t,e,n,r){var o=bt(r,(function(t,e){return dh(e,t)})),i=lh(t,e,n,o);return vt(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},gh=uh.single,ph=uh.multiple,hh=w(ih),vh=uu.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),bh=Ki("factory",{sketch:x}),yh=Ki("schema",[]),wh=Di("name"),xh=Ti("pname","pname",Oo((function(t){return"<alloy."+oc(t.name)+">"})),ui()),Ch=Ei("schema",(function(){return[Hi("preprocess")]})),Sh=Ki("defaults",w({})),kh=Ki("overrides",w({})),Oh=ti([bh,yh,wh,xh,Sh,kh]),Th=ti([bh,yh,wh,Sh,kh]),Eh=ti([bh,yh,wh,xh,Sh,kh]),_h=ti([bh,Ch,wh,Di("unit"),xh,Sh,kh]),Dh=function(t){return t.fold(I.some,I.none,I.some,I.some)},Ah=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Rh=function(t){return t.fold(x,x,x,x)},Nh=function(t,e){return function(n){var r=Ci("Converting part type",e,n);return t(r)}},Bh=Nh(vh.required,Oh),Mh=Nh(vh.external,Th),Ph=Nh(vh.optional,Eh),Ih=Nh(vh.group,_h),Lh=w("entirety"),Fh=Object.freeze({__proto__:null,required:Bh,external:Mh,optional:Ph,group:Ih,asNamedPart:Dh,name:Ah,asCommon:Rh,original:Lh}),zh=function(t,e,n,r){return Co(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Hh=function(t,e,n){var r={},o={};return G(n,(function(t){t.fold((function(t){r[t.pname]=gh(!0,(function(e,n,r){return t.factory.sketch(zh(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=w(t.factory.sketch(zh(e,t,n[Lh()]),n))}),(function(t){r[t.pname]=gh(!1,(function(e,n,r){return t.factory.sketch(zh(e,t,n,r))}))}),(function(t){r[t.pname]=ph(!0,(function(e,n,r){var o=e[t.name];return $(o,(function(n){return t.factory.sketch(Co(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:w(r),externals:w(o)}},Vh=function(t,e){var n={};return G(e,(function(e){Dh(e).each((function(e){var r=Uh(t,e.pname);n[e.name]=function(n){var o=Ci("Part: "+e.name+" in "+t,ti(e.schema),n);return D(D({},r),{config:n,validated:o})}}))})),n},Uh=function(t,e){return{uiType:hh(),owner:t,name:e}},jh=function(t,e,n){return{uiType:hh(),owner:t,name:e,config:n,validated:{}}},Wh=function(t){return rt(t,(function(t){return t.fold(I.none,I.some,I.none,I.none).map((function(t){return Li(t.name,t.schema.concat([mf(Lh())]))})).toArray()}))},qh=function(t){return $(t,Ah)},$h=function(t,e,n){return Hh(t,e,n)},Gh=function(t,e,n){return mh(I.some(t),e,e.components,n)},Kh=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Xh=function(t,e,n){return Kh(t,e,n).getOrDie("Could not find part: "+n)},Yh=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=w(i.getByUid(o[t]))})),r},Jh=function(t,e){var n=t.getSystem();return bt(e.partUids,(function(t,e){return w(n.getByUid(t))}))},Qh=function(t){return pt(t.partUids)},Zh=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=w(i.getByUid(o[t]).getOrDie())})),r},tv=function(t,e){var n=qh(e);return gu($(n,(function(e){return{key:e,value:t+"-"+e}})))},ev=function(t){return Ti("partUids","partUids",_o((function(e){return tv(e.uid,t)})),ui())},nv=Object.freeze({__proto__:null,generate:Vh,generateOne:jh,schemas:Wh,names:qh,substitutes:$h,components:Gh,defaultUids:tv,defaultUidsSchema:ev,getAllParts:Jh,getAllPartNames:Qh,getPart:Kh,getPartOrDie:Xh,getParts:Yh,getPartsOrDie:Zh}),rv=function(t,e){var n=t.length>0?[Li("parts",t)]:[];return n.concat([Di("uid"),Ki("dom",{}),Ki("components",[]),mf("originalSpec"),Ki("debug.sketcher",{})]).concat(e)},ov=function(t,e,n,r,o){var i=rv(r,o);return Ci(t+" [SpecSchema]",Zo(i.concat(e)),n)},iv=function(t,e,n,r){var o=cv(r),i=ov(t,e,o,[],[]);return n(i,o)},uv=function(t,e,n,r,o){var i=cv(o),u=Wh(n),a=ev(n),c=ov(t,e,i,u,[a]),s=$h(t,c,n),f=Gh(t,c,s.internals());return r(c,f,i,s.externals())},av=function(t){return Et(t,"uid")},cv=function(t){return av(t)?t:D(D({},t),{uid:dc("uid")})},sv=function(t){return void 0!==t.uid},fv=Zo([Di("name"),Di("factory"),Di("configFields"),Ki("apis",{}),Ki("extraApis",{})]),lv=Zo([Di("name"),Di("factory"),Di("configFields"),Di("partFields"),Ki("apis",{}),Ki("extraApis",{})]),dv=function(t){var e=Ci("Sketcher for "+t.name,fv,t),n=function(t){return iv(e.name,e.configFields,e.factory,t)},r=bt(e.apis,Sc),o=bt(e.extraApis,(function(t,e){return bc(t,e)}));return D(D({name:e.name,configFields:e.configFields,sketch:n},r),o)},mv=function(t){var e=Ci("Sketcher for "+t.name,lv,t),n=function(t){return uv(e.name,e.configFields,e.partFields,e.factory,t)},r=Vh(e.name,e.partFields),o=bt(e.apis,Sc),i=bt(e.extraApis,(function(t,e){return bc(t,e)}));return D(D({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:n,parts:r},o),i)},gv=function(t){return"input"===ae(t)&&"radio"!==Un(t,"type")||"textarea"===ae(t)},pv=function(t,e,n){return e.find(t)},hv=Object.freeze({__proto__:null,getCurrent:pv}),vv=[Di("find")],bv=pl({fields:vv,name:"composing",apis:hv}),yv=["input","button","textarea","select"],wv=function(t,e,n){var r=e.disabled()?_v:Dv;r(t,e)},xv=function(t,e){return!0===e.useNative&&U(yv,ae(t.element))},Cv=function(t){return Wn(t.element,"disabled")},Sv=function(t){Hn(t.element,"disabled","disabled")},kv=function(t){qn(t.element,"disabled")},Ov=function(t){return"true"===Un(t.element,"aria-disabled")},Tv=function(t){Hn(t.element,"aria-disabled","true")},Ev=function(t){Hn(t.element,"aria-disabled","false")},_v=function(t,e,n){e.disableClass.each((function(e){is(t.element,e)}));var r=xv(t,e)?Sv:Tv;r(t),e.onDisabled(t)},Dv=function(t,e,n){e.disableClass.each((function(e){as(t.element,e)}));var r=xv(t,e)?kv:Ev;r(t),e.onEnabled(t)},Av=function(t,e){return xv(t,e)?Cv(t):Ov(t)},Rv=function(t,e,n,r){var o=r?_v:Dv;o(t,e)},Nv=Object.freeze({__proto__:null,enable:Dv,disable:_v,isDisabled:Av,onLoad:wv,set:Rv}),Bv=function(t,e){return Ac({classes:e.disabled()?e.disableClass.toArray():[]})},Mv=function(t,e){return _a([Da(ea(),(function(e,n){return Av(e,t)})),al(t,e,wv)])},Pv=Object.freeze({__proto__:null,exhibit:Bv,events:Mv}),Iv=[tu("disabled",T),Ki("useNative",!0),Hi("disableClass"),cf("onDisabled"),cf("onEnabled")],Lv=pl({fields:Iv,name:"disabling",active:Pv,apis:Nv}),Fv=function(t,e,n,r){var o=Xm(t.element,"."+e.highlightClass);G(o,(function(n){j(r,(function(t){return t.element===n}))||(as(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Ca(n,xa())})))}))},zv=function(t,e,n){return Fv(t,e,n,[])},Hv=function(t,e,n,r){$v(t,e,n,r)&&(as(r.element,e.highlightClass),e.onDehighlight(t,r),Ca(r,xa()))},Vv=function(t,e,n,r){Fv(t,e,n,[r]),$v(t,e,n,r)||(is(r.element,e.highlightClass),e.onHighlight(t,r),Ca(r,wa()))},Uv=function(t,e,n){Xv(t,e).each((function(r){Vv(t,e,n,r)}))},jv=function(t,e,n){Yv(t,e).each((function(r){Vv(t,e,n,r)}))},Wv=function(t,e,n,r){Kv(t,e,n,r).fold((function(t){throw t}),(function(r){Vv(t,e,n,r)}))},qv=function(t,e,n,r){var o=tb(t,e),i=tt(o,r);i.each((function(r){Vv(t,e,n,r)}))},$v=function(t,e,n,r){return cs(r.element,e.highlightClass)},Gv=function(t,e,n){return Fs(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Kv=function(t,e,n,r){var o=Xm(t.element,"."+e.itemClass);return I.from(o[r]).fold((function(){return ro.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},Xv=function(t,e,n){return Fs(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Yv=function(t,e,n){var r=Xm(t.element,"."+e.itemClass),o=r.length>0?I.some(r[r.length-1]):I.none();return o.bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Jv=function(t,e,n,r){var o=Xm(t.element,"."+e.itemClass),i=et(o,(function(t){return cs(t,e.highlightClass)}));return i.bind((function(e){var n=_f(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Qv=function(t,e,n){return Jv(t,e,n,-1)},Zv=function(t,e,n){return Jv(t,e,n,1)},tb=function(t,e,n){var r=Xm(t.element,"."+e.itemClass);return Rt($(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},eb=Object.freeze({__proto__:null,dehighlightAll:zv,dehighlight:Hv,highlight:Vv,highlightFirst:Uv,highlightLast:jv,highlightAt:Wv,highlightBy:qv,isHighlighted:$v,getHighlighted:Gv,getFirst:Xv,getLast:Yv,getPrevious:Qv,getNext:Zv,getCandidates:tb}),nb=[Di("highlightClass"),Di("itemClass"),cf("onHighlight"),cf("onDehighlight")],rb=pl({fields:nb,name:"highlighting",apis:eb}),ob=[8],ib=[9],ub=[13],ab=[27],cb=[32],sb=[37],fb=[38],lb=[39],db=[40],mb=function(t,e,n){var r=it(t.slice(0,e)),o=it(t.slice(e+1));return tt(r.concat(o),n)},gb=function(t,e,n){var r=it(t.slice(0,e));return tt(r,n)},pb=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return tt(o.concat(r),n)},hb=function(t,e,n){var r=t.slice(e+1);return tt(r,n)},vb=function(t){return function(e){var n=e.raw;return U(t,n.which)}},bb=function(t){return function(e){return ot(t,(function(t){return t(e)}))}},yb=function(t){var e=t.raw;return!0===e.shiftKey},wb=function(t){var e=t.raw;return!0===e.ctrlKey},xb=k(yb),Cb=function(t,e){return{matches:t,classification:e}},Sb=function(t,e){var n=tt(t,(function(t){return t.matches(e)}));return n.map((function(t){return t.classification}))},kb=function(t,e,n){var r=e.exists((function(t){return n.exists((function(e){return sn(e,t)}))}));r||Sa(t,ha(),{prevFocus:e,newFocus:n})},Ob=function(){var t=function(t){return El(t.element)},e=function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);kb(e,r,o)};return{get:t,set:e}},Tb=function(){var t=function(t){return rb.getHighlighted(t).map((function(t){return t.element}))},e=function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){rb.highlight(e,t)}));var o=t(e);kb(e,r,o)};return{get:t,set:e}};(function(t){t["OnFocusMode"]="onFocus",t["OnEnterOrSpaceMode"]="onEnterOrSpace",t["OnApiMode"]="onApi"})(Fm||(Fm={}));var Eb=function(t,e,n,r,o){var i=function(){return t.concat([Ki("focusManager",Ob()),Xi("focusInside","onFocus",vi((function(t){return U(["onFocus","onEnterOrSpace","onApi"],t)?ro.value(t):ro.error("Invalid value for focusInside")}))),df("handler",c),df("state",e),df("sendFocusIn",o)])},u=function(t,e,n,r,o){var i=n(t,e,r,o);return Sb(i,e.event).bind((function(n){return n(t,e,r,o)}))},a=function(t,e){var i=t.focusInside!==Fm.OnFocusMode?I.none():o(t).map((function(n){return Na(Ju(),(function(r,o){n(r,t,e),o.stop()}))})),a=function(n,r){var i=vb(cb.concat(ub))(r.event);t.focusInside===Fm.OnEnterOrSpaceMode&&i&&xu(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))},c=[Na(Hu(),(function(r,o){u(r,o,n,t,e).fold((function(){a(r,o)}),(function(t){o.stop()}))})),Na(Vu(),(function(n,o){u(n,o,r,t,e).each((function(t){o.stop()}))}))];return _a(i.toArray().concat(c))},c={schema:i,processKey:u,toEvents:a};return c},_b=function(t){var e=[Hi("onEscape"),Hi("onEnter"),Ki("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ki("firstTabstop",0),Ki("useTabstopAt",E),Hi("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return zs(e,t)})).getOr(e);return ur(n)>0},r=function(t,e){var r=Xm(t.element,e.selector),o=Y(r,(function(t){return n(e,t)}));return I.from(o[e.firstTabstop])},o=function(t,e){return e.focusManager.get(t).bind((function(t){return zs(t,e.selector)}))},i=function(t,e){return n(t,e)&&t.useTabstopAt(e)},u=function(t,e,n){r(t,e).each((function(n){e.focusManager.set(t,n)}))},a=function(t,e,n,r,o){return o(e,n,(function(t){return i(r,t)})).fold((function(){return r.cyclic?I.some(!0):I.none()}),(function(e){return r.focusManager.set(t,e),I.some(!0)}))},c=function(t,e,n,r){var i=Xm(t.element,n.selector);return o(t,n).bind((function(e){var o=et(i,S(sn,e));return o.bind((function(e){return a(t,i,e,n,r)}))}))},s=function(t,e,n){var r=n.cyclic?mb:gb;return c(t,e,n,r)},f=function(t,e,n){var r=n.cyclic?pb:hb;return c(t,e,n,r)},l=function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))},d=function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))},m=w([Cb(bb([yb,vb(ib)]),s),Cb(vb(ib),f),Cb(vb(ab),d),Cb(bb([xb,vb(ub)]),l)]),g=w([]);return Eb(e,kc.init,m,g,(function(){return I.some(u)}))},Db=_b(Ei("cyclic",T)),Ab=_b(Ei("cyclic",E)),Rb=function(t,e,n){return Oa(t,n,ea()),I.some(!0)},Nb=function(t,e,n){var r=gv(n)&&vb(cb)(e.event);return r?I.none():Rb(t,e,n)},Bb=function(t,e){return I.some(!0)},Mb=[Ki("execute",Nb),Ki("useSpace",!1),Ki("useEnter",!0),Ki("useControlEnter",!1),Ki("useDown",!1)],Pb=function(t,e,n){return n.execute(t,e,t.element)},Ib=function(t,e,n,r){var o=n.useSpace&&!gv(t.element)?cb:[],i=n.useEnter?ub:[],u=n.useDown?db:[],a=o.concat(i).concat(u);return[Cb(vb(a),Pb)].concat(n.useControlEnter?[Cb(bb([wb,vb(ub)]),Pb)]:[])},Lb=function(t,e,n,r){return n.useSpace&&!gv(t.element)?[Cb(vb(cb),Bb)]:[]},Fb=Eb(Mb,kc.init,Ib,Lb,(function(){return I.none()})),zb=function(){var t=od(),e=function(e,n){t.set({numRows:e,numColumns:n})},n=function(){return t.get().map((function(t){return t.numRows}))},r=function(){return t.get().map((function(t){return t.numColumns}))};return Oc({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:e,getNumRows:n,getNumColumns:r})},Hb=function(t){return t.state(t)},Vb=Object.freeze({__proto__:null,flatgrid:zb,init:Hb}),Ub=function(t){return function(e,n,r,o){var i=t(e.element);return $b(i,e,n,r,o)}},jb=function(t,e){var n=Pd(t,e);return Ub(n)},Wb=function(t,e){var n=Pd(e,t);return Ub(n)},qb=function(t){return function(e,n,r,o){return $b(t,e,n,r,o)}},$b=function(t,e,n,r,o){var i=r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)}));return i.map((function(t){return r.focusManager.set(e,t),!0}))},Gb=qb,Kb=qb,Xb=qb,Yb=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Jb=function(t){return!Yb(t.dom)},Qb=function(t,e){return et(t,e).map((function(e){return{index:e,candidates:t}}))},Zb=function(t,e,n){var r=function(t){return sn(t,e)},o=Xm(t,n),i=Y(o,Jb);return Qb(i,r)},ty=function(t,e){return et(t,(function(t){return sn(e,t)}))},ey=function(t,e,n,r){var o=Math.floor(e/n),i=e%n;return r(o,i).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?I.some(t[r]):I.none()}))},ny=function(t,e,n,r,o){return ey(t,e,r,(function(e,i){var u=e===n-1,a=u?t.length-e*r:r,c=_f(i,o,0,a-1);return I.some({row:e,column:c})}))},ry=function(t,e,n,r,o){return ey(t,e,r,(function(e,i){var u=_f(e,o,0,n-1),a=u===n-1,c=a?t.length-u*r:r,s=Df(i,0,c-1);return I.some({row:u,column:s})}))},oy=function(t,e,n,r){return ny(t,e,n,r,1)},iy=function(t,e,n,r){return ny(t,e,n,r,-1)},uy=function(t,e,n,r){return ry(t,e,n,r,-1)},ay=function(t,e,n,r){return ry(t,e,n,r,1)},cy=[Di("selector"),Ki("execute",Nb),sf("onEscape"),Ki("captureTab",!1),gf()],sy=function(t,e,n){Fs(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},fy=function(t,e){return e.focusManager.get(t).bind((function(t){return zs(t,e.selector)}))},ly=function(t,e,n,r){return fy(t,n).bind((function(r){return n.execute(t,e,r)}))},dy=function(t){return function(e,n,r,o){return Zb(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},my=function(t,e,n){return n.captureTab?I.some(!0):I.none()},gy=function(t,e,n){return n.onEscape(t,e)},py=dy(iy),hy=dy(oy),vy=dy(uy),by=dy(ay),yy=w([Cb(vb(sb),jb(py,hy)),Cb(vb(lb),Wb(py,hy)),Cb(vb(fb),Gb(vy)),Cb(vb(db),Kb(by)),Cb(bb([yb,vb(ib)]),my),Cb(bb([xb,vb(ib)]),my),Cb(vb(ab),gy),Cb(vb(cb.concat(ub)),ly)]),wy=w([Cb(vb(cb),Bb)]),xy=Eb(cy,zb,yy,wy,(function(){return I.some(sy)})),Cy=function(t,e,n,r){var o=function(t){return"button"===ae(t)&&"disabled"===Un(t,"disabled")},i=function(t,e,n){var u=_f(e,r,0,n.length-1);return u===t?I.none():o(n[u])?i(t,u,n):I.from(n[u])};return Zb(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return i(e,e,n)}))},Sy=[Di("selector"),Ki("getInitial",I.none),Ki("execute",Nb),sf("onEscape"),Ki("executeOnMove",!1),Ki("allowVertical",!0)],ky=function(t,e){return e.focusManager.get(t).bind((function(t){return zs(t,e.selector)}))},Oy=function(t,e,n){return ky(t,n).bind((function(r){return n.execute(t,e,r)}))},Ty=function(t,e,n){e.getInitial(t).orThunk((function(){return Fs(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},Ey=function(t,e,n){return Cy(t,n.selector,e,-1)},_y=function(t,e,n){return Cy(t,n.selector,e,1)},Dy=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Oy(e,n,r):I.some(!0)}))}},Ay=function(t,e,n){return n.onEscape(t,e)},Ry=function(t,e,n,r){var o=sb.concat(n.allowVertical?fb:[]),i=lb.concat(n.allowVertical?db:[]);return[Cb(vb(o),Dy(jb(Ey,_y))),Cb(vb(i),Dy(Wb(Ey,_y))),Cb(vb(ub),Oy),Cb(vb(cb),Oy),Cb(vb(ab),Ay)]},Ny=w([Cb(vb(cb),Bb)]),By=Eb(Sy,kc.init,Ry,Ny,(function(){return I.some(Ty)})),My=function(t,e,n){return I.from(t[e]).bind((function(t){return I.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},Py=function(t,e,n,r){var o=t[e],i=o.length,u=_f(n,r,0,i-1);return My(t,e,u)},Iy=function(t,e,n,r){var o=_f(n,r,0,t.length-1),i=t[o].length,u=Df(e,0,i-1);return My(t,o,u)},Ly=function(t,e,n,r){var o=t[e],i=o.length,u=Df(n+r,0,i-1);return My(t,e,u)},Fy=function(t,e,n,r){var o=Df(n+r,0,t.length-1),i=t[o].length,u=Df(e,0,i-1);return My(t,o,u)},zy=function(t,e,n){return Py(t,e,n,1)},Hy=function(t,e,n){return Py(t,e,n,-1)},Vy=function(t,e,n){return Iy(t,n,e,-1)},Uy=function(t,e,n){return Iy(t,n,e,1)},jy=function(t,e,n){return Ly(t,e,n,-1)},Wy=function(t,e,n){return Ly(t,e,n,1)},qy=function(t,e,n){return Fy(t,n,e,-1)},$y=function(t,e,n){return Fy(t,n,e,1)},Gy=[Li("selectors",[Di("row"),Di("cell")]),Ki("cycles",!0),Ki("previousSelector",I.none),Ki("execute",Nb)],Ky=function(t,e,n){var r=e.previousSelector(t).orThunk((function(){var n=e.selectors;return Fs(t.element,n.cell)}));r.each((function(n){e.focusManager.set(t,n)}))},Xy=function(t,e,n){return El(t.element).bind((function(r){return n.execute(t,e,r)}))},Yy=function(t,e){return $(t,(function(t){return Xm(t,e.selectors.cell)}))},Jy=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return zs(r,o.selectors.row).bind((function(t){var e=Xm(t,o.selectors.cell);return ty(e,r).bind((function(e){var r=Xm(n,o.selectors.row);return ty(r,t).bind((function(t){var n=Yy(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Qy=Jy(Hy,jy),Zy=Jy(zy,Wy),tw=Jy(Vy,qy),ew=Jy(Uy,$y),nw=w([Cb(vb(sb),jb(Qy,Zy)),Cb(vb(lb),Wb(Qy,Zy)),Cb(vb(fb),Gb(tw)),Cb(vb(db),Kb(ew)),Cb(vb(cb.concat(ub)),Xy)]),rw=w([Cb(vb(cb),Bb)]),ow=Eb(Gy,kc.init,nw,rw,(function(){return I.some(Ky)})),iw=[Di("selector"),Ki("execute",Nb),Ki("moveOnTab",!1)],uw=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},aw=function(t,e,n){Fs(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},cw=function(t,e,n){return Cy(t,n.selector,e,-1)},sw=function(t,e,n){return Cy(t,n.selector,e,1)},fw=function(t,e,n,r){return n.moveOnTab?Xb(cw)(t,e,n,r):I.none()},lw=function(t,e,n,r){return n.moveOnTab?Xb(sw)(t,e,n,r):I.none()},dw=w([Cb(vb(fb),Xb(cw)),Cb(vb(db),Xb(sw)),Cb(bb([yb,vb(ib)]),fw),Cb(bb([xb,vb(ib)]),lw),Cb(vb(ub),uw),Cb(vb(cb),uw)]),mw=w([Cb(vb(cb),Bb)]),gw=Eb(iw,kc.init,dw,mw,(function(){return I.some(aw)})),pw=[sf("onSpace"),sf("onEnter"),sf("onShiftEnter"),sf("onLeft"),sf("onRight"),sf("onTab"),sf("onShiftTab"),sf("onUp"),sf("onDown"),sf("onEscape"),Ki("stopSpaceKeyup",!1),Hi("focusIn")],hw=function(t,e,n){return[Cb(vb(cb),n.onSpace),Cb(bb([xb,vb(ub)]),n.onEnter),Cb(bb([yb,vb(ub)]),n.onShiftEnter),Cb(bb([yb,vb(ib)]),n.onShiftTab),Cb(bb([xb,vb(ib)]),n.onTab),Cb(vb(fb),n.onUp),Cb(vb(db),n.onDown),Cb(vb(sb),n.onLeft),Cb(vb(lb),n.onRight),Cb(vb(cb),n.onSpace),Cb(vb(ab),n.onEscape)]},vw=function(t,e,n){return n.stopSpaceKeyup?[Cb(vb(cb),Bb)]:[]},bw=Eb(pw,kc.init,hw,vw,(function(t){return t.focusIn})),yw=Db.schema(),ww=Ab.schema(),xw=By.schema(),Cw=xy.schema(),Sw=ow.schema(),kw=Fb.schema(),Ow=gw.schema(),Tw=bw.schema(),Ew=Object.freeze({__proto__:null,acyclic:yw,cyclic:ww,flow:xw,flatgrid:Cw,matrix:Sw,execution:kw,menu:Ow,special:Tw}),_w=function(t){return _t(t,"setGridSize")},Dw=vl({branchKey:"mode",branches:Ew,name:"keying",active:{events:function(t,e){var n=t.handler;return n.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){_w(n)&&n.setGridSize(r,o)}},state:Vb}),Aw=function(t,e,n,r){_l((function(){var e=$(r,t.getSystem().build);jg(t,e)}),t.element)},Rw=function(t,e,n,r){var o=t.getSystem().build(r);qg(t,o,n)},Nw=function(t,e,n,r){Rw(t,e,Ar,r)},Bw=function(t,e,n,r){Rw(t,e,Dr,r)},Mw=function(t,e,n,r){var o=Pw(t),i=tt(o,(function(t){return sn(r.element,t.element)}));i.each(Gg)},Pw=function(t,e){return t.components()},Iw=function(t,e,n,r,o){var i=Pw(t);return I.from(i[r]).map((function(i){return Mw(t,e,n,i),o.each((function(n){Rw(t,e,(function(t,e){Rr(t,e,r)}),n)})),i}))},Lw=function(t,e,n,r,o){var i=Pw(t);return et(i,r).bind((function(r){return Iw(t,e,n,r,o)}))},Fw=Object.freeze({__proto__:null,append:Nw,prepend:Bw,remove:Mw,replaceAt:Iw,replaceBy:Lw,set:Aw,contents:Pw}),zw=pl({fields:[],name:"replacing",apis:Fw}),Hw=function(t,e){var n=_a(e);return pl({fields:[Di("enabled")],name:t,active:{events:w(n)}})},Vw=function(t,e){var n=Hw(t,e);return{key:t,value:{config:{},me:n,configAsRaw:w({}),initialConfig:{},state:kc}}},Uw=function(t,e){e.ignore||(Sl(t.element),e.onFocus(t))},jw=function(t,e){e.ignore||kl(t.element)},Ww=function(t){return Ol(t.element)},qw=Object.freeze({__proto__:null,focus:Uw,blur:jw,isFocused:Ww}),$w=function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return Ac(n)},Gw=function(t){return _a([Na(Ju(),(function(e,n){Uw(e,t),n.stop()}))].concat(t.stopMousedown?[Na(Bu(),(function(t,e){e.event.prevent()}))]:[]))},Kw=Object.freeze({__proto__:null,exhibit:$w,events:Gw}),Xw=[cf("onFocus"),Ki("stopMousedown",!1),Ki("ignore",!1)],Yw=pl({fields:Xw,name:"focusing",active:Kw,apis:qw}),Jw=function(t){var e=function(){var e=ou(t),n=function(){return e.get()},r=function(t){return e.set(t)},o=function(){return e.set(t)},i=function(){return e.get()};return{get:n,set:r,clear:o,readState:i}};return{init:e}},Qw=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Zw=function(t,e,n){e.toggleClass.each((function(e){n.get()?is(t.element,e):as(t.element,e)}))},tx=function(t,e,n){rx(t,e,n,!n.get())},ex=function(t,e,n){n.set(!0),Zw(t,e,n),Qw(t,e,n)},nx=function(t,e,n){n.set(!1),Zw(t,e,n),Qw(t,e,n)},rx=function(t,e,n,r){var o=r?ex:nx;o(t,e,n)},ox=function(t,e,n){return n.get()},ix=function(t,e,n){rx(t,e,n,e.selected)},ux=Object.freeze({__proto__:null,onLoad:ix,toggle:tx,isOn:ox,on:ex,off:nx,set:rx}),ax=function(){return Ac({})},cx=function(t,e){var n=ul(t,e,tx),r=al(t,e,ix);return _a(nt([t.toggleOnExecute?[n]:[],[r]]))},sx=Object.freeze({__proto__:null,exhibit:ax,events:cx}),fx=function(t,e,n){Hn(t.element,"aria-pressed",n),e.syncWithExpanded&&mx(t,e,n)},lx=function(t,e,n){Hn(t.element,"aria-selected",n)},dx=function(t,e,n){Hn(t.element,"aria-checked",n)},mx=function(t,e,n){Hn(t.element,"aria-expanded",n)},gx=[Ki("selected",!1),Hi("toggleClass"),Ki("toggleOnExecute",!0),Xi("aria",{mode:"none"},ki("mode",{pressed:[Ki("syncWithExpanded",!1),df("update",fx)],checked:[df("update",dx)],expanded:[df("update",mx)],selected:[df("update",lx)],none:[df("update",h)]}))],px=pl({fields:gx,name:"toggling",active:sx,apis:ux,state:Jw(!1)}),hx=function(){var t=function(t,e){e.stop(),ka(t)};return[Na(Wu(),t),Na(ra(),t),za(Du()),za(Bu())]},vx=function(t){var e=function(t){return qa((function(e,n){t(e),n.stop()}))};return _a(nt([t.map(e).toArray(),hx()]))},bx="alloy.item-hover",yx="alloy.item-focus",wx=function(t){(El(t.element).isNone()||Yw.isFocused(t))&&(Yw.isFocused(t)||Yw.focus(t),Sa(t,bx,{item:t}))},xx=function(t){Sa(t,yx,{item:t})},Cx=w(bx),Sx=w(yx),kx=function(t){return{dom:t.dom,domModification:D(D({},t.domModification),{attributes:D(D(D({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:oh.augment(t.itemBehaviours,[t.toggling.fold(px.revoke,(function(t){return px.config(D({aria:{mode:"checked"}},t))})),Yw.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){xx(t)}}),Dw.config({mode:"execution"}),th.config({store:{mode:"memory",initialValue:t.data}}),Vw("item-type-events",R(R([],hx(),!0),[Na(Lu(),wx),Na(na(),Yw.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}},Ox=[Di("data"),Di("components"),Di("dom"),Ki("hasSubmenu",!1),Hi("toggling"),oh.field("itemBehaviours",[px,Yw,Dw,th]),Ki("ignoreFocus",!1),Ki("domModification",{}),df("builder",kx),Ki("eventOrder",{})],Tx=function(t){return{dom:t.dom,components:t.components,events:_a([Ha(na())])}},Ex=[Di("dom"),Di("components"),df("builder",Tx)],_x=w("item-widget"),Dx=w([Bh({name:"widget",overrides:function(t){return{behaviours:ml([th.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),Ax=function(t){var e=$h(_x(),t,Dx()),n=Gh(_x(),t,e.internals()),r=function(e){return Kh(e,t,"widget").map((function(t){return Dw.focusIn(t),t}))},o=function(e,n){return gv(n.event.target)?I.none():function(){return t.autofocus?(n.setSource(e.element),I.none()):I.none()}()};return{dom:t.dom,components:n,domModification:t.domModification,events:_a([qa((function(t,e){r(t).each((function(t){e.stop()}))})),Na(Lu(),wx),Na(na(),(function(e,n){t.autofocus?r(e):Yw.focus(e)}))]),behaviours:oh.augment(t.widgetBehaviours,[th.config({store:{mode:"memory",initialValue:t.data}}),Yw.config({ignore:t.ignoreFocus,onFocus:function(t){xx(t)}}),Dw.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:bl(),onLeft:o,onRight:o,onEscape:function(e,n){return Yw.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),I.none()):I.none():(Yw.focus(e),I.some(!0))}})])}},Rx=[Di("uid"),Di("data"),Di("components"),Di("dom"),Ki("autofocus",!1),Ki("ignoreFocus",!1),oh.field("widgetBehaviours",[th,Yw,Dw]),Ki("domModification",{}),ev(Dx()),df("builder",Ax)],Nx=ki("type",{widget:Rx,item:Ox,separator:Ex}),Bx=function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}},Mx=function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}},Px=function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}},Ix=w([Ih({factory:{sketch:function(t){var e=Ci("menu.spec item",Nx,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return Et(e,"uid")?e:D(D({},e),{uid:dc("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Lx=w([Di("value"),Di("items"),Di("dom"),Di("components"),Ki("eventOrder",{}),eh("menuBehaviours",[rb,th,bv,Dw]),Xi("movement",{mode:"menu",moveOnTab:!0},ki("mode",{grid:[gf(),df("config",Bx)],matrix:[df("config",Mx),Di("rowSelector")],menu:[Ki("moveOnTab",!0),df("config",Px)]})),rf(),Ki("fakeFocus",!1),Ki("focusManager",Ob()),cf("onHighlight")]),Fx=w("alloy.menu-focus"),zx=function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:rh(t.menuBehaviours,[rb.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),th.config({store:{mode:"memory",initialValue:t.value}}),bv.config({find:I.some}),Dw.config(t.movement.config(t,t.movement))]),events:_a([Na(Sx(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){rb.highlight(t,n),e.stop(),Sa(t,Fx(),{menu:t,item:n})}))})),Na(Cx(),(function(t,e){var n=e.event.item;rb.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}},Hx=mv({name:"Menu",configFields:Lx(),partFields:Ix(),factory:zx}),Vx=function(t){return yt(t,(function(t,e){return{k:t,v:e}}))},Ux=function(t,e,n,r){return Tt(n,r).bind((function(r){return Tt(t,r).bind((function(r){var o=Ux(t,e,n,r);return I.some([r].concat(o))}))})).getOr([])},jx=function(t,e){var n={};vt(t,(function(t,e){G(t,(function(t){n[t]=e}))}));var r=e,o=Vx(e),i=bt(o,(function(t,e){return[e].concat(Ux(n,r,o,e))}));return bt(n,(function(t){return Tt(i,t).getOr([t])}))},Wx=function(){var t=ou({}),e=ou({}),n=ou({}),r=od(),o=ou({}),i=function(){t.set({}),e.set({}),n.set({}),r.clear()},u=function(){return r.get().isNone()},a=function(t,n){var r;e.set(D(D({},e.get()),(r={},r[t]={type:"prepared",menu:n},r)))},c=function(i,u,a,c){r.set(i),t.set(a),e.set(u),o.set(c);var s=jx(c,a);n.set(s)},s=function(e){return kt(t.get(),(function(t,n){return t===e}))},f=function(t,e,n){return p(t).bind((function(r){return s(t).bind((function(t){return e(t).map((function(t){return{triggeredMenu:r,triggeringItem:t,triggeringPath:n}}))}))}))},l=function(t,e){var o=Y(v(t).toArray(),(function(t){return p(t).isSome()}));return Tt(n.get(),t).bind((function(t){var n=it(o.concat(t)),i=rt(n,(function(t,o){return f(t,e,n.slice(0,o+1)).fold((function(){return Dt(r.get(),t)?[]:[I.none()]}),(function(t){return[I.some(t)]}))}));return Nt(i)}))},d=function(e){return Tt(t.get(),e).map((function(t){var r=Tt(n.get(),e).getOr([]);return[t].concat(r)}))},m=function(t){return Tt(n.get(),t).bind((function(t){return t.length>1?I.some(t.slice(1)):I.none()}))},g=function(t){return Tt(n.get(),t)},p=function(t){return h(t).bind(qx)},h=function(t){return Tt(e.get(),t)},v=function(e){return Tt(t.get(),e)},b=function(t){var e=o.get();return ut(pt(e),t)},y=function(){return r.get().bind(p)},w=function(){return e.get()};return{setMenuBuilt:a,setContents:c,expand:d,refresh:g,collapse:m,lookupMenu:h,lookupItem:v,otherMenus:b,getPrimary:y,getMenus:w,clear:i,isClear:u,getTriggeringPath:l}},qx=function(t){return"prepared"===t.type?I.some(t.menu):I.none()},$x={init:Wx,extractPreparedMenu:qx},Gx=function(t,e){var n,r=od(),o=function(e,n,r){return bt(r,(function(r,o){var i=function(){return Hx.sketch(D(D({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Tb():Ob()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},i=$x.init(),u=function(e){var n=o(e,t.data.primary,t.data.menus),r=s();return i.setContents(t.data.primary,n,t.data.expansions,r),i.getPrimary()},a=function(t){return th.getValue(t).value},c=function(t,e,n){return gt(e,(function(t){if(!t.getSystem().isConnected())return I.none();var e=rb.getCandidates(t);return tt(e,(function(t){return a(t)===n}))}))},s=function(e){return bt(t.data.menus,(function(t,e){return rt(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},f=function(t,e){rb.highlight(t,e),rb.getHighlighted(e).orThunk((function(){return rb.getFirst(e)})).each((function(e){Oa(t,e.element,na())}))},l=function(t,e){return Rt($(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?I.some(t.menu):I.none()}))})))},d=function(e,n,r){var o=l(n,n.otherMenus(r));G(o,(function(n){fs(n.element,[t.markers.backgroundMenu]),t.stayInDom||zw.remove(e,n)}))},m=function(e){return r.get().getOrThunk((function(){var n={},o=Xm(e.element,"."+t.markers.item),i=Y(o,(function(t){return"true"===Un(t,"aria-haspopup")}));return G(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(n),n}))},g=function(t,e){var n=m(t);vt(n,(function(t,n){var r=U(e,n);Hn(t.element,"aria-expanded",r)}))},p=function(e,n,r){return I.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return I.none();var i=o.menu,u=l(n,r.slice(1));return G(u,(function(e){is(e.element,t.markers.backgroundMenu)})),In(i.element)||zw.append(e,_s(i)),fs(i.element,[t.markers.backgroundMenu]),f(e,i),d(e,n,r),I.some(i)}))}))};(function(t){t[t["HighlightSubmenu"]=0]="HighlightSubmenu",t[t["HighlightParent"]=1]="HighlightParent"})(n||(n={}));var v=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return i.setMenuBuilt(e,r),r}return n.menu},b=function(e,r,o){if(void 0===o&&(o=n.HighlightSubmenu),r.hasConfigured(Lv)&&Lv.isDisabled(r))return I.some(r);var u=a(r);return i.expand(u).bind((function(u){return g(e,u),I.from(u[0]).bind((function(a){return i.lookupMenu(a).bind((function(c){var s=v(e,a,c);return In(s.element)||zw.append(e,_s(s)),t.onOpenSubmenu(e,r,s,it(u)),o===n.HighlightSubmenu?(rb.highlightFirst(s),p(e,i,u)):(rb.dehighlightAll(s),I.some(r))}))}))}))},y=function(e,n){var r=a(n);return i.collapse(r).bind((function(r){return g(e,r),p(e,i,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},w=function(t,e){var n=a(e);return i.refresh(n).bind((function(e){return g(t,e),p(t,i,e)}))},x=function(t,e){return gv(e.element)?I.none():b(t,e,n.HighlightSubmenu)},C=function(t,e){return gv(e.element)?I.none():y(t,e)},S=function(e,n){return y(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))},k=function(e){return function(n,r){return zs(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(E)}))}))}},O=_a([Na(Fx(),(function(t,e){var n=e.event.item;i.lookupItem(a(n)).each((function(){var n=e.event.menu;rb.highlight(t,n);var r=a(e.event.item);i.refresh(r).each((function(e){return d(t,i,e)}))}))})),qa((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){var o=a(r);0===o.indexOf("collapse-item")&&y(e,r),b(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),h)}))})),Ua((function(e,n){u(e).each((function(n){zw.append(e,_s(n)),t.onOpenMenu(e,n),t.highlightImmediately&&f(e,n)}))}))].concat(t.navigateOnHover?[Na(Cx(),(function(e,r){var o=r.event.item;w(e,o),b(e,o,n.HighlightParent),t.onHover(e,o)}))]:[])),T=function(t){return rb.getHighlighted(t).bind(rb.getHighlighted)},_=function(t){T(t).each((function(e){y(t,e)}))},A=function(t){i.getPrimary().each((function(e){f(t,e)}))},R=function(t){return I.from(t.components()[0]).filter((function(t){return"menu"===Un(t.element,"role")}))},N=function(e){var n=i.getPrimary().bind((function(t){return T(e).bind((function(t){var n=a(t),r=Ot(i.getMenus()),o=Rt($(r,$x.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return c(e,o,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){R(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))},B={collapseMenu:_,highlightPrimary:A,repositionMenus:N};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:rh(t.tmenuBehaviours,[Dw.config({mode:"special",onRight:k(x),onLeft:k(C),onEscape:k(S),focusIn:function(t,e){i.getPrimary().each((function(e){Oa(t,e.element,na())}))}}),rb.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),bv.config({find:function(t){return rb.getHighlighted(t)}}),zw.config({})]),eventOrder:t.eventOrder,apis:B,events:O}},Kx=w("collapse-item"),Xx=function(t,e,n){return{primary:t,menus:e,expansions:n}},Yx=function(t,e){return{primary:t,menus:mu(t,e),expansions:{}}},Jx=function(t){return{value:oc(Kx()),meta:{text:t}}},Qx=dv({name:"TieredMenu",configFields:[lf("onExecute"),lf("onEscape"),ff("onOpenMenu"),ff("onOpenSubmenu"),cf("onRepositionMenu"),cf("onCollapseMenu"),Ki("highlightImmediately",!0),Li("data",[Di("primary"),Di("menus"),Di("expansions")]),Ki("fakeFocus",!1),cf("onHighlight"),cf("onHover"),of(),Di("dom"),Ki("navigateOnHover",!0),Ki("stayInDom",!1),eh("tmenuBehaviours",[Dw,rb,bv,zw]),Ki("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:Gx,extraApis:{tieredData:Xx,singleData:Yx,collapseItem:Jx}}),Zx=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return tl()},onRtl:function(){return el()}}}:{},a=function(t){return 2===t.length},c=function(t){return a(t)?u:{}};return Qx.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return bp.close(e),t.onEscape.map((function(t){return t(e)})),I.some(!0)},onExecute:function(){return I.some(!0)},onOpenMenu:function(t,e){Fg.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Fg.position(o,n,{anchor:D({type:"submenu",item:e},c(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Fg.positionWithinBounds(u,e,n,o()),G(r,(function(t){var e=c(t.triggeringPath);Fg.position(u,t.triggeredMenu,{anchor:D({type:"submenu",item:t.triggeringItem},e)})}))}})},tC=function(t,e){var n=function(e,n){var r=t.getRelated(e);return r.exists((function(t){return js(t,n)}))},r=function(t,e){bp.setContent(t,e)},o=function(t,e,n){i(t,e,n,I.none())},i=function(t,e,n,r){u(t,e,n,(function(){return r.map((function(t){return Jr(t)}))}))},u=function(e,n,r,o){var i=t.lazySink(e).getOrDie();bp.openWhileCloaked(e,n,(function(){return Fg.positionWithinBounds(i,e,r,o())})),th.setValue(e,I.some({mode:"position",config:r,getBounds:o}))},a=function(t,e,n){c(t,e,n,I.none)},c=function(e,n,r,o){var i=Zx(t,e,n,r,o);bp.open(e,i),th.setValue(e,I.some({mode:"menu",menu:i}))},s=function(t){bp.isOpen(t)&&(th.setValue(t,I.none()),bp.close(t))},f=function(t){return bp.getState(t)},l=function(e){bp.isOpen(e)&&th.getValue(e).each((function(n){switch(n.mode){case"menu":bp.getState(e).each(Qx.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Fg.positionWithinBounds(r,e,n.config,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:u,showMenuAt:a,showMenuWithinBounds:c,hide:s,getContent:f,reposition:l,isOpen:bp.isOpen};return{uid:t.uid,dom:t.dom,behaviours:rh(t.inlineBehaviours,[bp.config({isPartOf:function(t,e,r){return js(e,r)||n(t,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),th.config({store:{mode:"memory",initialValue:I.none()}}),yl.config({channels:D(D({},Sp(D({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Op(D(D({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:l})))})]),eventOrder:t.eventOrder,apis:d}},eC=dv({name:"InlineView",configFields:[Di("lazySink"),cf("onShow"),cf("onHide"),Wi("onEscape"),eh("inlineBehaviours",[bp,th,yl]),$i("fireDismissalEventInstead",[Ki("event",ga())]),$i("fireRepositionEventInstead",[Ki("event",pa())]),Ki("getRelated",I.none),Ki("isExtraPart",T),Ki("eventOrder",I.none)],factory:tC,apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),nC="layout-inset",rC=function(t){return t.x},oC=function(t,e){return t.x+t.width/2-e.width/2},iC=function(t,e){return t.x+t.width-e.width},uC=function(t){return t.y},aC=function(t,e){return t.y+t.height-e.height},cC=function(t,e){return t.y+t.height/2-e.height/2},sC=function(t,e,n){return pf(iC(t,e),aC(t,e),n.insetSouthwest(),Sf(),"southwest",Rf(t,{right:0,bottom:3}),nC)},fC=function(t,e,n){return pf(rC(t),aC(t,e),n.insetSoutheast(),Cf(),"southeast",Rf(t,{left:1,bottom:3}),nC)},lC=function(t,e,n){return pf(iC(t,e),uC(t),n.insetNorthwest(),xf(),"northwest",Rf(t,{right:0,top:2}),nC)},dC=function(t,e,n){return pf(rC(t),uC(t),n.insetNortheast(),wf(),"northeast",Rf(t,{left:1,top:2}),nC)},mC=function(t,e,n){return pf(oC(t,e),uC(t),n.insetNorth(),kf(),"north",Rf(t,{top:2}),nC)},gC=function(t,e,n){return pf(oC(t,e),aC(t,e),n.insetSouth(),Of(),"south",Rf(t,{bottom:3}),nC)},pC=function(t,e,n){return pf(iC(t,e),cC(t,e),n.insetEast(),Ef(),"east",Rf(t,{right:0}),nC)},hC=function(t,e,n){return pf(rC(t),cC(t,e),n.insetWest(),Tf(),"west",Rf(t,{left:1}),nC)},vC=function(t){switch(t){case"north":return mC;case"northeast":return dC;case"northwest":return lC;case"south":return gC;case"southeast":return fC;case"southwest":return sC;case"east":return pC;case"west":return hC}},bC=function(t,e,n,r,o){var i=$l(r).map(vC).getOr(mC);return i(t,e,n,r,o)},yC=function(t){switch(t){case"north":return gC;case"northeast":return fC;case"northwest":return sC;case"south":return mC;case"southeast":return dC;case"southwest":return lC;case"east":return hC;case"west":return pC}},wC=function(t,e,n,r,o){var i=$l(r).map(yC).getOr(mC);return i(t,e,n,r,o)},xC=tinymce.util.Tools.resolve("tinymce.util.Delay"),CC=function(t){var e=vx(t.action),n=t.dom.tag,r=function(e){return Tt(t.dom,"attributes").bind((function(t){return Tt(t,e)}))},o=function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return D({type:t},e)}var o=r("role").getOr("button");return{role:o}};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:oh.augment(t.buttonBehaviours,[Yw.config({}),Dw.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:t.eventOrder}},SC=dv({name:"Button",factory:CC,configFields:[Ki("uid",void 0),Di("dom"),Ki("components",[]),oh.field("buttonBehaviours",[Yw,Dw]),Hi("action"),Hi("role"),Ki("eventOrder",{})]}),kC=function(t){var e=sv(t)&&_t(t,"uid")?t.uid:dc("memento"),n=function(t){return t.getSystem().getByUid(e).getOrDie()},r=function(t){return t.getSystem().getByUid(e).toOptional()},o=function(){return D(D({},t),{uid:e})};return{get:n,getOpt:r,asSpec:o}},OC=tinymce.util.Tools.resolve("tinymce.util.I18n"),TC={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},EC="temporary-placeholder",_C=function(t){return function(){return Tt(t,EC).getOr("!not found!")}},DC=function(t,e){var n=t.toLowerCase();if(OC.isRtl()){var r=Vt(n,"-rtl");return Et(e,r)?r:n}return n},AC=function(t,e){return Tt(e,DC(t,e))},RC=function(t,e){var n=e();return AC(t,n).getOrThunk(_C(n))},NC=function(t,e,n){var r=e();return AC(t,r).or(n).getOrThunk(_C(r))},BC=function(t){return!!OC.isRtl()&&Et(TC,t)},MC=function(){return Vw("add-focusable",[Ua((function(t){Ls(t.element,"svg").each((function(t){return Hn(t,"focusable","false")}))}))])},PC=function(t,e,n,r){var o,i,u=BC(e)?["tox-icon--flip"]:[],a=Tt(n,DC(e,n)).or(r).getOrThunk(_C(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(u),innerHtml:a},behaviours:ml(R(R([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[MC()],!1))}},IC=function(t,e,n,r){return void 0===r&&(r=I.none()),PC(e,t,n(),r)},LC=function(t,e,n){var r=n(),o=tt(t,(function(t){return Et(r,DC(t,r))}));return PC(e,o.getOr(EC),r,I.none())},FC={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},zC=function(t){var e=kC({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:ml([zw.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=kC({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:ml([zw.config({})])}),i=function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){zw.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},u=function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);zw.set(r,[Ss(n)])}},a={updateProgress:i,updateText:u},c=nt([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return I.from(FC[t])})).toArray()]),s=kC(SC.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[IC("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),f=LC(c,{tag:"div",classes:["tox-notification__icon"]},t.iconProvider),l={dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:ml([zw.config({})])},d=[f,l];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:ml([Yw.config({}),Vw("notification-events",[Na(Fu(),(function(t){s.getOpt(t).each(Yw.focus)}))])]),components:d.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[s.asSpec()]:[]),apis:a}},HC=dv({name:"Notification",factory:zC,configFields:[Hi("level"),Di("progress"),Di("icon"),Di("onAction"),Di("text"),Di("iconProvider"),Di("translationProvider"),Zi("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function VC(t,e,n){var r=e.backstage.shared,o=function(t){switch(t){case"bc-bc":return gC;case"tc-tc":return mC;case"tc-bc":return $f;case"bc-tc":default:return Gf}},i=function(t){t.length>0&&G(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},u=function(e,i){var u=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),a=function(){i(),eC.hide(s)},c=Es(HC.sketch({text:e.text,level:U(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:I.from(e.icon),closeButton:!u,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),s=Es(eC.sketch(D({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(s),e.timeout>0&&xC.setTimeout((function(){a()}),e.timeout);var f=function(){var e=Jr(ee.fromDom(t.getContentAreaContainer())),n=Zr(),r=Df(n.x,e.x,e.right),o=Df(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),u=Math.max(e.bottom,n.bottom);return I.some(Yr(r,o,i-r,u-o))};return{close:a,moveTo:function(t,e){eC.showAt(s,_s(c),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=_s(c),i={maxHeightFunction:Ed()};if("banner"!==e&&d(t)){var u=o(e),a={type:"node",root:Ln(),node:I.some(ee.fromDom(t)),overrides:i,layouts:{onRtl:function(){return[u]},onLtr:function(){return[u]}}};eC.showWithinBounds(s,n,{anchor:a},f)}else{var l=D(D({},r.anchors.banner()),{overrides:i});eC.showWithinBounds(s,n,{anchor:l},f)}},text:function(t){HC.updateText(c,t)},settings:e,getEl:function(){return c.element.dom},progressBar:{value:function(t){HC.updateProgress(c,t)}}}},a=function(t){t.close()},c=function(t){return t.settings};return{open:u,close:a,reposition:i,getArgs:c}}var UC,jC=function(t,e){var n=null,r=function(){c(n)||(clearTimeout(n),n=null)},o=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];c(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))};return{cancel:r,throttle:o}},WC=function(t,e){var n=null,r=function(){c(n)||(clearTimeout(n),n=null)},o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)};return{cancel:r,throttle:o}},qC=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),$C=function(t,e){return t.isBlock(e)||U(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)},GC=function(t,e,n,r,o){var i=qC(t,(function(e){return $C(t,e)}));return I.from(i.backwards(e,n,r,o))},KC="[data-mce-autocompleter]",XC=function(t,e){return YC(ee.fromDom(t.selection.getNode())).getOrThunk((function(){var n=ee.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Ar(n,ee.fromDom(e.extractContents())),e.insertNode(n.dom),vn(n).each((function(t){return t.dom.normalize()})),Gm(n).map((function(e){t.selection.setCursorLocation(e.dom,jm(e))})),n}))},YC=function(t){return zs(t,KC)},JC=function(t){return t.collapsed&&3===t.startContainer.nodeType},QC=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},ZC=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},tS=function(t,e){return t.substring(e.length)},eS=function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(ZC(o))return I.none();if(o===n)break}return I.some(r)},nS=function(t,e,n,r){if(void 0===r&&(r=0),!JC(e))return I.none();var o=function(t,e,r){return eS(r,e,n).getOr(e)},i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return GC(t,e.startContainer,e.startOffset,o,i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return I.none();var i=QC(o),u=i.lastIndexOf(n);return 0!==u||tS(i,n).length<r?I.none():I.some({text:tS(i,n),range:o,triggerChar:n})}))},rS=function(t,e,n,r){return void 0===r&&(r=0),YC(ee.fromDom(e.startContainer)).fold((function(){return nS(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=QC(r);return I.some({range:r,text:tS(o,n),triggerChar:n})}))},oS=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Sa(t,Hu(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(rb.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(ka),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(rb.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&YC(ee.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},iS={setup:oS},uS=tinymce.util.Tools.resolve("tinymce.util.Promise"),aS=function(t,e){return{container:t,offset:e}},cS=function(t){return t.nodeType===ue},sS=function(t){return t.nodeType===ie},fS=function(t){if(cS(t))return aS(t,t.data.length);var e=t.childNodes;return e.length>0?fS(e[e.length-1]):aS(t,e.length)},lS=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?lS(n[e],0):n.length>0&&sS(t)&&n.length===e?fS(n[n.length-1]):aS(t,e)},dS=function(t,e){return GC(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!ZC(e)})).isSome()},mS=function(t){return function(e){var n=lS(e.startContainer,e.startOffset);return!dS(t,n)}},gS=function(t,e,n){return gt(n.triggerChars,(function(n){return rS(t,e,n)}))},pS=function(t,e){var n=e(),r=t.selection.getRng();return gS(t.dom,r,n).bind((function(n){return hS(t,e,n)}))},hS=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng(),u=i.startContainer.nodeValue,a=Y(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return mS(t.dom)}))(n.range,u,n.text)}));if(0===a.length)return I.none();var c=uS.all($(a,(function(t){var e=t.fetch(n.text,t.maxResults,r);return e.then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return I.some({lookupData:c,context:n})},vS=ti([Ni("type"),ji("text")]),bS=function(t){return wi("separatormenuitem",vS,t)},yS=ti([Ki("type","autocompleteitem"),Ki("active",!1),Ki("disabled",!1),Ki("meta",{}),Ni("value"),ji("text"),ji("icon")]),wS=ti([Ni("type"),Ni("ch"),Yi("minChars",1),Ki("columns",1),Yi("maxResults",10),Wi("matches"),Pi("fetch"),Pi("onAction"),nu("highlightOn",[],si)]),xS=function(t){return wi("Autocompleter.Separator",vS,t)},CS=function(t){return wi("Autocompleter.Item",yS,t)},SS=function(t){return wi("Autocompleter",wS,t)},kS=[Zi("disabled",!1),ji("tooltip"),ji("icon"),ji("text"),tu("onSetup",(function(){return h}))],OS=ti([Ni("type"),Pi("onAction")].concat(kS)),TS=function(t){return wi("toolbarbutton",OS,t)},ES=[Zi("active",!1)].concat(kS),_S=ti(ES.concat([Ni("type"),Pi("onAction")])),DS=function(t){return wi("ToggleButton",_S,t)},AS=[tu("predicate",T),Qi("scope","node",["node","editor"]),Qi("position","selection",["node","selection","line"])],RS=kS.concat([Ki("type","contextformbutton"),Ki("primary",!1),Pi("onAction"),Ei("original",x)]),NS=ES.concat([Ki("type","contextformbutton"),Ki("primary",!1),Pi("onAction"),Ei("original",x)]),BS=kS.concat([Ki("type","contextformbutton")]),MS=ES.concat([Ki("type","contextformtogglebutton")]),PS=ki("type",{contextformbutton:RS,contextformtogglebutton:NS}),IS=ti([Ki("type","contextform"),tu("initValue",w("")),ji("label"),zi("commands",PS),Vi("launch",ki("type",{contextformbutton:BS,contextformtogglebutton:MS}))].concat(AS)),LS=function(t){return wi("ContextForm",IS,t)},FS=ti([Ki("type","contexttoolbar"),Ni("items")].concat(AS)),zS=function(t){return wi("ContextToolbar",FS,t)},HS=function(t){var e={};return G(t,(function(t){e[t]={}})),pt(e)},VS=function(t){var e=t.ui.registry.getAll().popups,n=bt(e,(function(t){return SS(t).fold((function(t){throw new Error(Si(t))}),x)})),r=HS(St(n,(function(t){return t.ch}))),o=Ot(n),i=function(t){return Y(o,(function(e){return e.ch===t}))};return{dataset:n,triggerChars:r,lookupByChar:i}};(function(t){t[t["CLOSE_ON_EXECUTE"]=0]="CLOSE_ON_EXECUTE",t[t["BUBBLE_TO_SANDBOX"]=1]="BUBBLE_TO_SANDBOX"})(UC||(UC={}));var US,jS=UC,WS="tox-menu-nav__js",qS="tox-collection__item",$S="tox-swatch",GS={normal:WS,color:$S},KS="tox-collection__item--enabled",XS="tox-collection__group-heading",YS="tox-collection__item-icon",JS="tox-collection__item-label",QS="tox-collection__item-accessory",ZS="tox-collection__item-caret",tk="tox-collection__item-checkmark",ek="tox-collection__item--active",nk="tox-collection__item-container",rk="tox-collection__item-container--column",ok="tox-collection__item-container--row",ik="tox-collection__item-container--align-right",uk="tox-collection__item-container--align-left",ak="tox-collection__item-container--valign-top",ck="tox-collection__item-container--valign-middle",sk="tox-collection__item-container--valign-bottom",fk=function(t){return Tt(GS,t).getOr(WS)},lk=function(t){return"color"===t?"tox-swatches":"tox-menu"},dk=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:lk(t),tieredMenu:"tox-tiered-menu"}},mk=function(t){var e=dk(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:fk(t)}},gk=function(t,e,n){var r=dk(n);return{tag:"div",classes:nt([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},pk=[Hx.parts.items({})],hk=function(t,e,n){var r=dk(n),o={tag:"div",classes:nt([[r.tieredMenu]])};return{dom:o,markers:mk(n)}},vk=function(t,e){return function(n){var r=q(n,e);return $(r,(function(e){return{dom:t,components:e}}))}},bk=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Hx.parts.items({preprocess:"auto"!==t?vk({tag:"div",classes:["tox-swatches__row"]},t):x})]}]}},yk=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Hx.parts.items({preprocess:vk({tag:"div",classes:["tox-collection__group"]},t)})]}},wk=function(t,e){var n=[],r=[];return G(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Et(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),$(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},xk=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Hx.parts.items({preprocess:function(n){return"auto"!==t&&t>1?vk({tag:"div",classes:["tox-collection__group"]},t)(n):wk(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ck=function(t,e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Hx.parts.items({preprocess:function(e){return wk(e,(function(e,n){return"separator"===t[n].type}))}})]}},Sk=function(t){return j(t,(function(t){return"icon"in t&&void 0!==t.icon}))},kk=function(t){return I.none()},Ok=function(t,e,n,r,o){var i=Ck(n);return{value:t,dom:i.dom,components:i.components,items:n}},Tk=function(t,e,n,r,o){if("color"===o){var i=bk(r);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r){i=xk(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=xk(1,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=xk(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("listpreview"===o&&"auto"!==r){i=yk(r);return{value:t,dom:i.dom,components:i.components,items:n}}return{value:t,dom:gk(e,r,o),components:pk,items:n}},Ek=[Ni("type"),Ni("src"),ji("alt"),nu("classes",[],si)],_k=ti(Ek),Dk=[Ni("type"),Ni("text"),ji("name"),nu("classes",["tox-collection__item-label"],si)],Ak=ti(Dk),Rk=Jo((function(){return pi("type",{cardimage:_k,cardtext:Ak,cardcontainer:Nk})})),Nk=ti([Ni("type"),Ji("direction","horizontal"),Ji("align","left"),Ji("valign","middle"),zi("items",Rk)]),Bk=[Zi("disabled",!1),ji("text"),ji("shortcut"),Ti("value","value",Oo((function(){return oc("menuitem-value")})),ui()),Ki("meta",{})],Mk=ti([Ni("type"),ji("label"),zi("items",Rk),tu("onSetup",(function(){return h})),tu("onAction",h)].concat(Bk)),Pk=function(t){return wi("cardmenuitem",Mk,t)},Ik=ti([Ni("type"),Zi("active",!1),ji("icon")].concat(Bk)),Lk=function(t){return wi("choicemenuitem",Ik,t)},Fk=[Ni("type"),Ni("fancytype"),tu("onAction",h)],zk=[Ki("initData",{})].concat(Fk),Hk=[ru("initData",{},[Zi("allowCustomColors",!0),qi("colors",ui())])].concat(Fk),Vk=ki("fancytype",{inserttable:zk,colorswatch:Hk}),Uk=function(t){return wi("fancymenuitem",Vk,t)},jk=ti([Ni("type"),tu("onSetup",(function(){return h})),tu("onAction",h),ji("icon")].concat(Bk)),Wk=function(t){return wi("menuitem",jk,t)},qk=ti([Ni("type"),Pi("getSubmenuItems"),tu("onSetup",(function(){return h})),ji("icon")].concat(Bk)),$k=function(t){return wi("nestedmenuitem",qk,t)},Gk=ti([Ni("type"),ji("icon"),Zi("active",!1),tu("onSetup",(function(){return h})),Pi("onAction")].concat(Bk)),Kk=function(t){return wi("togglemenuitem",Gk,t)},Xk=function(t,e,n){var r=Xm(t.element,"."+n);if(r.length>0){var o=et(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return I.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return I.none()},Yk=function(t,e){return ml([Vw(t,e)])},Jk=function(t){return Yk(oc("unnamed-events"),t)},Qk={namedEvents:Yk,unnamedEvents:Jk},Zk=oc("tooltip.exclusive"),tO=oc("tooltip.show"),eO=oc("tooltip.hide"),nO=function(t,e,n){t.getSystem().broadcastOn([Zk],{})},rO=function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&zw.set(t,r)}))},oO=Object.freeze({__proto__:null,hideAllExclusive:nO,setComponents:rO}),iO=function(t,e){var n=function(n){e.getTooltip().each((function(r){Gg(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()},r=function(n){if(!e.isShowing()){nO(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:_a("normal"===t.mode?[Na(Lu(),(function(t){Ca(n,tO)})),Na(Pu(),(function(t){Ca(n,eO)}))]:[]),behaviours:ml([zw.config({})])});e.setTooltip(o),Wg(r,o),t.onShow(n,o),Fg.position(r,o,{anchor:t.anchor(n)})}};return _a(nt([[Na(tO,(function(n){e.resetTimer((function(){r(n)}),t.delay)})),Na(eO,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Na(ta(),(function(t,e){var r=e;r.universal||U(r.channels,Zk)&&n(t)})),ja((function(t){n(t)}))],"normal"===t.mode?[Na(Fu(),(function(t){Ca(t,tO)})),Na(Qu(),(function(t){Ca(t,eO)})),Na(Lu(),(function(t){Ca(t,tO)})),Na(Pu(),(function(t){Ca(t,eO)}))]:[Na(wa(),(function(t,e){Ca(t,tO)})),Na(xa(),(function(t){Ca(t,eO)}))]]))},uO=Object.freeze({__proto__:null,events:iO}),aO=[Di("lazySink"),Di("tooltipDom"),Ki("exclusive",!0),Ki("tooltipComponents",[]),Ki("delay",300),Qi("mode","normal",["normal","follow-highlight"]),Ki("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:w([Gf,$f,Uf,Wf,jf,qf]),onRtl:w([Gf,$f,Uf,Wf,jf,qf])}}})),cf("onHide"),cf("onShow")],cO=function(){var t=od(),e=od(),n=function(){t.on(clearTimeout)},r=function(e,r){n(),t.set(setTimeout(e,r))},o=w("not-implemented");return Oc({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:r,readState:o})},sO=Object.freeze({__proto__:null,init:cO}),fO=pl({fields:aO,name:"tooltipping",active:uO,state:sO,apis:oO}),lO=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},dO=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),mO=tinymce.util.Tools.resolve("tinymce.EditorManager"),gO=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):mO.baseURL+"/skins/ui/"+r}return n},pO=function(t){return t.getParam("readonly",!1,"boolean")},hO=function(t){return!1===t.getParam("skin")},vO=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},bO=function(t){return t.getParam("width",dO.DOM.getStyle(t.getElement(),"width"))},yO=function(t){return I.from(t.getParam("min_width")).filter(g)},wO=function(t){return I.from(t.getParam("min_height")).filter(g)},xO=function(t){return I.from(t.getParam("max_width")).filter(g)},CO=function(t){return I.from(t.getParam("max_height")).filter(g)},SO=function(t){return I.from(t.getParam("style_formats")).filter(a)},kO=function(t){return t.getParam("style_formats_merge",!1,"boolean")},OO=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},TO=function(t){return t.getParam("content_langs",void 0,"array")},EO=function(t){return t.getParam("removed_menuitems","")},_O=function(t){return!1!==t.getParam("menubar",!0,"boolean")},DO=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=i(e),o=a(e)&&e.length>0;return!RO(t)&&(o||r||n)},AO=function(t){var e=W(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=Y(e,(function(t){return"string"===typeof t}));return n.length>0?I.some(n):I.none()},RO=function(t){return AO(t).fold((function(){var e=t.getParam("toolbar",[],"string[]");return e.length>0}),E)};(function(t){t["default"]="wrap",t["floating"]="floating",t["sliding"]="sliding",t["scrolling"]="scrolling"})(US||(US={}));var NO,BO=function(t){return t.getParam("toolbar_mode","","string")};(function(t){t["auto"]="auto",t["top"]="top",t["bottom"]="bottom"})(NO||(NO={}));var MO,PO=function(t){return t.getParam("toolbar_groups",{},"object")},IO=function(t){return t.getParam("toolbar_location",NO.auto,"string")},LO=function(t){return IO(t)===NO.bottom},FO=function(t){return t.getParam("fixed_toolbar_container","","string")},zO=function(t){return t.getParam("fixed_toolbar_container_target")},HO=function(t){return t.getParam("toolbar_persist",!1,"boolean")},VO=function(t){if(!t.inline)return I.none();var e=FO(t);if(e.length>0)return Fs(Ln(),e);var n=zO(t);return d(n)?I.some(ee.fromDom(n)):I.none()},UO=function(t){return t.inline&&VO(t).isSome()},jO=function(t){var e=VO(t);return e.getOrThunk((function(){return An(Dn(ee.fromDom(t.getElement())))}))},WO=function(t){return t.inline&&!_O(t)&&!DO(t)&&!RO(t)},qO=function(t){var e=t.getParam("toolbar_sticky",!1,"boolean");return(e||t.inline)&&!UO(t)&&!WO(t)},$O=function(t){return t.getParam("toolbar_sticky_offset",0,"number")},GO=function(t){return t.getParam("draggable_modal",!1,"boolean")},KO=function(t){var e=t.getParam("menu");return e?bt(e,(function(t){return D(D({},t),{items:t.items})})):{}},XO=function(t){return t.getParam("menubar")},YO=function(t){return t.getParam("toolbar",!0)},JO=function(t){return t.getParam("file_picker_callback")},QO=function(t){return t.getParam("file_picker_types")},ZO=function(t){return t.getParam("file_browser_callback_types")},tT=function(t){return!1===t.getParam("typeahead_urls")},eT=function(t){return t.getParam("anchor_top","#top")},nT=function(t){return t.getParam("anchor_bottom","#bottom")},rT=function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e},oT="silver.readonly",iT=ti([Mi("readonly")]),uT=function(t,e){var n=t.outerContainer,r=n.element;e&&(t.mothership.broadcastOn([yp()],{target:r}),t.uiMothership.broadcastOn([yp()],{target:r})),t.mothership.broadcastOn([oT],{readonly:e}),t.uiMothership.broadcastOn([oT],{readonly:e})},aT=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&uT(e,!0)})),t.on("SwitchMode",(function(){return uT(e,t.mode.isReadOnly())})),pO(t)&&t.setMode("readonly")},cT=function(){var t;return yl.config({channels:(t={},t[oT]={schema:iT,onReceive:function(t,e){Lv.set(t,e.readonly)}},t)})},sT=function(t){return Lv.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},fT=function(t){return Lv.config({disabled:t})},lT=function(t){return Lv.config({disabled:t,disableClass:"tox-tbtn--disabled"})},dT=function(t){return Lv.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},mT={item:sT,button:fT,splitButton:lT,toolbarButton:dT},gT=function(t,e){var n=t.getApi(e);return function(t){t(n)}},pT=function(t,e){return Ua((function(n){var r=gT(t,n);r((function(n){var r=t.onSetup(n);m(r)&&e.set(r)}))}))},hT=function(t,e){return ja((function(n){return gT(t,n)(e.get())}))},vT=function(t,e){return qa((function(n,r){gT(t,n)(t.onAction),t.triggersSubmenu||e!==jS.CLOSE_ON_EXECUTE||(Ca(n,ia()),r.stop())}))},bT=(MO={},MO[ea()]=["disabling","alloy.base.behaviour","toggling","item-events"],MO),yT=Rt,wT=function(t,e,n,r){var o=ou(h);return{type:"item",dom:e.dom,components:yT(e.optComponents),data:t.data,eventOrder:bT,hasSubmenu:t.triggersSubmenu,itemBehaviours:ml([Vw("item-events",[vT(t,n),pT(t,o),hT(t,o)]),mT.item((function(){return t.disabled||r.isDisabled()})),cT(),zw.config({})].concat(t.itemBehaviours))}},xT=function(t){return{value:t.value,meta:D({text:t.text.getOr("")},t.meta)}},CT=tinymce.util.Tools.resolve("tinymce.Env"),ST=function(t){var e={alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"},n={meta:"Ctrl",access:"Shift+Alt"},r=CT.mac?e:n,o=t.split("+"),i=$(o,(function(t){var e=t.toLowerCase().trim();return Et(r,e)?r[e]:t}));return CT.mac?i.join(""):i.join("+")},kT=function(t,e,n){return void 0===n&&(n=[YS]),IC(t,{tag:"div",classes:n},e)},OT=function(t){return{dom:{tag:"div",classes:[JS]},components:[Ss(OC.translate(t))]}},TT=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},ET=function(t,e){return{dom:{tag:"div",classes:[JS]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Ss(OC.translate(e))]}]}},_T=function(t){return{dom:{tag:"div",classes:[QS],innerHtml:ST(t)}}},DT=function(t){return kT("checkmark",t,[tk])},AT=function(t){return kT("chevron-right",t,[ZS])},RT=function(t){return kT("chevron-down",t,[ZS])},NT=function(t,e){var n="vertical"===t.direction?rk:ok,r="left"===t.align?uk:ik,o=function(){switch(t.valign){case"top":return ak;case"middle":return ck;case"bottom":return sk}};return{dom:{tag:"div",classes:[nk,n,r,o()]},components:e}},BT=function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}},MT=function(t,e,n){var r="custom",o="remove",i=t.ariaLabel,u=t.value,a=t.iconContent.map((function(t){return NC(t,e.icons,n)})),c=function(){var t=$S,n=a.getOr(""),c=i.map((function(t){return{title:e.translate(t)}})).getOr({}),s={tag:"div",attributes:c,classes:[t]};return D(D({},s),u===r?{tag:"button",classes:R(R([],s.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:n}:u===o?{classes:R(R([],s.classes,!0),["tox-swatch--remove"],!1),innerHtml:n}:{attributes:D(D({},s.attributes),{"data-mce-color":u}),styles:{"background-color":u}})};return{dom:c(),optComponents:[]}},PT=function(t){var e=t.map((function(t){return{attributes:{title:OC.translate(t)}}})).getOr({});return D({tag:"div",classes:[WS,qS]},e)},IT=function(t,e,n,r){var o={tag:"div",classes:[YS]},i=function(t){return IC(t,o,e.icons,r)},u=function(){return I.some({dom:o})},a=n?t.iconContent.map(i).orThunk(u):I.none(),c=t.checkMark,s=I.from(t.meta).fold((function(){return OT}),(function(t){return Et(t,"style")?S(ET,t.style):OT})),f=t.htmlContent.fold((function(){return t.textContent.map(s)}),(function(t){return I.some(TT(t,[JS]))})),l={dom:PT(t.ariaLabel),optComponents:[a,f,t.shortcutContent.map(_T),c,t.caret]};return l},LT=function(t,e,n,r){return void 0===r&&(r=I.none()),"color"===t.presets?MT(t,e,r):IT(t,e,n,r)},FT=function(t,e){return Tt(t,"tooltipWorker").map((function(t){return[fO.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Ed}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){fO.setComponents(e,[ks({element:ee.fromDom(t)})])}))}})]})).getOr([])},zT=function(t){return dO.DOM.encode(t)},HT=function(t,e){var n=OC.translate(t),r=zT(n);if(e.length>0){var o=new RegExp(lO(e),"gi");return r.replace(o,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return r},VT=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=LT({presets:r,textContent:I.none(),htmlContent:n?t.text.map((function(t){return HT(t,e)})):I.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:I.none(),checkMark:I.none(),caret:I.none(),value:t.value},u.providers,a,t.icon);return wT({data:xT(t),disabled:t.disabled,getApi:w({}),onAction:function(e){return o(t.value,t.meta)},onSetup:w(h),triggersSubmenu:!1,itemBehaviours:FT(t.meta,u)},c,i,u.providers)},UT=function(t,e){return $(t,(function(t){switch(t.type){case"cardcontainer":return NT(t,UT(t.items,e));case"cardimage":return BT(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return U(e.cardText.highlightOn,t)})),r=n?I.from(e.cardText.matchText).getOr(""):"";return TT(HT(t.text,r),t.classes)}}))},jT=function(t,e,n,r){var o=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){Lv.set(t,e),G(Xm(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Lv)&&Lv.set(t,e)}))}))}}},i={dom:PT(t.label),optComponents:[I.some({dom:{tag:"div",classes:[nk,ok]},components:UT(t.items,r)})]};return wT({data:xT(D({text:I.none()},t)),disabled:t.disabled,getApi:o,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:I.from(r.itemBehaviours).getOr([])},i,e,n.providers)},WT=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=function(t){return{setActive:function(e){px.set(t,e)},isActive:function(){return px.isOn(t)},isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},s=LT({presets:n,textContent:e?t.text:I.none(),htmlContent:I.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:I.none(),checkMark:e?I.some(DT(u.icons)):I.none(),caret:I.none(),value:t.value},u,a);return Co(wT({data:xT(t),disabled:t.disabled,getApi:c,onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},s,i,u),{toggling:{toggleClass:KS,toggleOnExecute:!1,selected:t.active}})},qT=Vh(_x(),Dx()),$T=function(t){return{value:t}},GT=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,KT=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,XT=function(t){return GT.test(t)||KT.test(t)},YT=function(t){return Ht(t,"#").toUpperCase()},JT=function(t){return XT(t)?I.some({value:YT(t)}):I.none()},QT=function(t){var e=t.value.replace(GT,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}},ZT=function(t){var e=QT(t),n=KT.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},tE=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},eE=function(t){var e=tE(t.red)+tE(t.green)+tE(t.blue);return $T(e)},nE=Math.min,rE=Math.max,oE=Math.round,iE=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,uE=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,aE=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},cE=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},sE=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=rE(0,nE(i,1)),u=rE(0,nE(u,1)),0===i)return e=n=r=oE(255*u),aE(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=oE(255*(e+f)),n=oE(255*(n+f)),r=oE(255*(r+f)),aE(e,n,r,1)},fE=function(t){var e=ZT(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return aE(n,r,o,1)},lE=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return aE(o,i,u,a)},dE=function(t){if("transparent"===t)return I.some(aE(0,0,0,0));var e=iE.exec(t);if(null!==e)return I.some(lE(e[1],e[2],e[3],"1"));var n=uE.exec(t);return null!==n?I.some(lE(n[1],n[2],n[3],n[4])):I.none()},mE=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},gE=aE(255,0,0,1),pE=function(t){return t.fire("SkinLoaded")},hE=function(t,e){return t.fire("SkinLoadError",e)},vE=function(t){return t.fire("ResizeEditor")},bE=function(t,e){return t.fire("ResizeContent",e)},yE=function(t,e){return t.fire("ScrollContent",e)},wE=function(t,e){return t.fire("TextColorChange",e)},xE=function(t,e,n){return{hue:t,saturation:e,value:n}},CE=function(t){var e=0,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));if(a===c)return r=a,xE(0,0,100*r);var s=o===a?i-u:u===a?o-i:u-o;return e=o===a?3:u===a?1:5,e=60*(e-s/(c-a)),n=(c-a)/c,r=c,xE(Math.round(e),Math.round(100*n),Math.round(100*r))},SE=function(t){return CE(fE(t))},kE=function(t){return eE(sE(t))},OE=function(t){return JT(t).orThunk((function(){return dE(t).map(eE)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return eE(aE(o,i,u,a))}))},TE=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),EE="tinymce-custom-colors";function _E(t){void 0===t&&(t=10);var e=TE.getItem(EE),n=i(e)?JSON.parse(e):[],r=function(e){var n=t-e.length;return n<0?e.slice(0,t):e},o=r(n),u=function(e){V(o,e).each(a),o.unshift(e),o.length>t&&o.pop(),TE.setItem(EE,JSON.stringify(o))},a=function(t){o.splice(t,1)},c=function(){return o.slice(0)};return{add:u,state:c}}var DE,AE="choiceitem",RE=[{type:AE,text:"Light Green",value:"#BFEDD2"},{type:AE,text:"Light Yellow",value:"#FBEEB8"},{type:AE,text:"Light Red",value:"#F8CAC6"},{type:AE,text:"Light Purple",value:"#ECCAFA"},{type:AE,text:"Light Blue",value:"#C2E0F4"},{type:AE,text:"Green",value:"#2DC26B"},{type:AE,text:"Yellow",value:"#F1C40F"},{type:AE,text:"Red",value:"#E03E2D"},{type:AE,text:"Purple",value:"#B96AD9"},{type:AE,text:"Blue",value:"#3598DB"},{type:AE,text:"Dark Turquoise",value:"#169179"},{type:AE,text:"Orange",value:"#E67E23"},{type:AE,text:"Dark Red",value:"#BA372A"},{type:AE,text:"Dark Purple",value:"#843FA1"},{type:AE,text:"Dark Blue",value:"#236FA1"},{type:AE,text:"Light Gray",value:"#ECF0F1"},{type:AE,text:"Medium Gray",value:"#CED4D9"},{type:AE,text:"Gray",value:"#95A5A6"},{type:AE,text:"Dark Gray",value:"#7E8C8D"},{type:AE,text:"Navy Blue",value:"#34495E"},{type:AE,text:"Black",value:"#000000"},{type:AE,text:"White",value:"#ffffff"}],NE=_E(10),BE=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+OE(t[n]).value,type:"choiceitem"});return e},ME=function(t,e){return t.getParam("color_cols",e,"number")},PE=function(t){return!1!==t.getParam("custom_colors")},IE=function(t){return t.getParam("color_map")},LE=function(t){var e=IE(t);return void 0!==e?BE(e):RE},FE=function(){return $(NE.state(),(function(t){return{type:AE,text:t,value:t}}))},zE=function(t){NE.add(t)},HE="#000000",VE=function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),I.from(n)},UE=function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))},jE=function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))},WE=function(t){t.addCommand("mceApplyTextcolor",(function(e,n){UE(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){jE(t,e)}))},qE=function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))},$E=function(t){var e=LE(t),n=qE(e.length);return ME(t,n)},GE=function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},r={type:e,text:"Custom color",icon:"color-picker",value:"custom"};return t?[n,r]:[n]},KE=function(t,e,n,r){if("custom"===n){var o=t_(t);o((function(n){n.each((function(n){zE(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),HE)}else"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},XE=function(t,e){return t.concat(FE().concat(GE(e)))},YE=function(t,e){return function(n){n(XE(t,e))}},JE=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},QE=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){var r=VE(t,n);return r.bind((function(t){return dE(t).map((function(t){var n=eE(t).value;return Ut(e.toLowerCase(),n)}))})).getOr(!1)},columns:$E(t),fetch:YE(LE(t),PE(t)),onAction:function(e){KE(t,n,o.get(),h)},onItemAction:function(r,i){KE(t,n,i,(function(n){o.set(n),wE(t,{name:e,color:n})}))},onSetup:function(n){JE(n,e,o.get());var r=function(t){t.name===e&&JE(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},ZE=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){KE(t,n,e.value,h)}}]}})},t_=function(t){return function(e,n){var r=!1,o=function(n){var o=n.getData(),i=o.colorpicker;r?(e(I.from(i)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",i]))},i=function(t,e){"hex-valid"===e.name&&(r=e.value)},u={colorpicker:n};t.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:u,onAction:i,onSubmit:o,onClose:h,onCancel:function(){e(I.none())}})}},e_=function(t){WE(t);var e=ou(HE),n=ou(HE);QE(t,"forecolor","forecolor","Text color",e),QE(t,"backcolor","hilitecolor","Background color",n),ZE(t,"forecolor","forecolor","Text color"),ZE(t,"backcolor","hilitecolor","Background color")},n_=function(t,e,n,r,o,i,u,a){var c=Sk(e),s="color"!==o?"normal":"color",f=r_(e,n,r,s,i,u,a);return Tk(t,c,f,r,o)},r_=function(t,e,n,r,o,i,u){return Rt($(t,(function(a){return"choiceitem"===a.type?Lk(a).fold(kk,(function(c){return I.some(WT(c,1===n,r,e,i(a.value),o,u,Sk(t)))})):I.none()})))},o_=function(t,e){var n=mk(e);if(1===t)return{mode:"menu",moveOnTab:!0};if("auto"===t)return{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}};var r="color"===e?"tox-swatches__row":"tox-collection__group";return{mode:"matrix",rowSelector:"."+r}},i_=function(t,e){return 1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+$S:"."+qS}}},u_=function(t,e){var n=a_(t,e),r=e.colorinput.getColorCols(),o="color",i=n_(oc("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,jS.CLOSE_ON_EXECUTE,T,e.shared.providers),u=D(D({},i),{markers:mk(o),movement:o_(r,o)});return{type:"widget",data:{value:oc("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[qT.widget(Hx.sketch(u))]}},a_=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold((function(){return XE(e.colorinput.getColors(),n)}),(function(t){return t.concat(GE(n))}))},c_=oc("cell-over"),s_=oc("cell-execute"),f_=function(t,e,n){var r,o=function(n){return Sa(n,c_,{row:t,col:e})},i=function(n){return Sa(n,s_,{row:t,col:e})},u=function(t,e){e.stop(),i(t)};return Es({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:ml([Vw("insert-table-picker-cell",[Na(Lu(),Yw.focus),Na(ea(),i),Na(Wu(),u),Na(ra(),u)]),px.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Yw.config({onFocus:o})])})},l_=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],u=0;u<n;u++)i.push(f_(o,u,t));r.push(i)}return r},d_=function(t,e,n,r,o){for(var i=0;i<r;i++)for(var u=0;u<o;u++)px.set(t[i][u],i<=e&&u<=n)},m_=function(t){return rt(t,(function(t){return $(t,_s)}))},g_=function(t,e){return Ss(e+"x"+t)},p_=function(t){var e=10,n=10,r=oc("size-label"),o=l_(r,e,n),i=g_(0,0),u=kC({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:r}},components:[i],behaviours:ml([zw.config({})])});return{type:"widget",data:{value:oc("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[qT.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:m_(o).concat(u.asSpec()),behaviours:ml([Vw("insert-table-picker",[Ua((function(t){zw.set(u.get(t),[i])})),Fa(c_,(function(t,r,i){var a=i.event,c=a.row,s=a.col;d_(o,c,s,e,n),zw.set(u.get(t),[g_(c+1,s+1)])})),Fa(s_,(function(e,n,r){var o=r.event,i=o.row,u=o.col;t.onAction({numRows:i+1,numColumns:u+1}),Ca(e,ia())}))]),Dw.config({initSize:{numRows:e,numColumns:n},mode:"flatgrid",selector:'[role="button"]'})])})]}},h_={inserttable:p_,colorswatch:u_},v_=function(t,e){return Tt(h_,t.fancytype).map((function(n){return n(t,e)}))},b_=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i=o?RT(n.icons):AT(n.icons),u=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},a=LT({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:I.none(),ariaLabel:t.text,caret:I.some(i),checkMark:I.none(),shortcutContent:t.shortcut},n,r);return wT({data:xT(t),getApi:u,disabled:t.disabled,onAction:h,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},a,e,n)},y_=function(t,e,n,r){void 0===r&&(r=!0);var o=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},i=LT({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:I.none(),ariaLabel:t.text,caret:I.none(),checkMark:I.none(),shortcutContent:t.shortcut},n,r);return wT({data:xT(t),getApi:o,disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},i,e,n)},w_=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:D({tag:"div",classes:[qS,XS]},e),components:[]}},x_=function(t,e,n,r){void 0===r&&(r=!0);var o=function(t){return{setActive:function(e){px.set(t,e)},isActive:function(){return px.isOn(t)},isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},i=LT({iconContent:t.icon,textContent:t.text,htmlContent:I.none(),ariaLabel:t.text,checkMark:I.some(DT(n.icons)),caret:I.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Co(wT({data:xT(t),disabled:t.disabled,getApi:o,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},i,e,n),{toggling:{toggleClass:KS,toggleOnExecute:!1,selected:t.active}})},C_=VT,S_=w_,k_=y_,O_=b_,T_=x_,E_=v_,__=jT;(function(t){t[t["ContentFocus"]=0]="ContentFocus",t[t["UiFocus"]=1]="UiFocus"})(DE||(DE={}));var D_=function(t,e,n,r,o){var i=n.shared.providers,u=function(t){return o?D(D({},t),{shortcut:I.none(),icon:t.text.isSome()?I.none():t.icon}):t};switch(t.type){case"menuitem":return Wk(t).fold(kk,(function(t){return I.some(k_(u(t),e,i,r))}));case"nestedmenuitem":return $k(t).fold(kk,(function(t){return I.some(O_(u(t),e,i,r,o))}));case"togglemenuitem":return Kk(t).fold(kk,(function(t){return I.some(T_(u(t),e,i,r))}));case"separator":return bS(t).fold(kk,(function(t){return I.some(S_(t))}));case"fancymenuitem":return Uk(t).fold(kk,(function(t){return E_(u(t),n)}));default:return I.none()}},A_=function(t,e,n,r,o,i,u){var a=1===r,c=!a||Sk(t);return Rt($(t,(function(t){switch(t.type){case"separator":return xS(t).fold(kk,(function(t){return I.some(S_(t))}));case"cardmenuitem":return Pk(t).fold(kk,(function(t){return I.some(__(D(D({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:FT(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return CS(t).fold(kk,(function(t){return I.some(C_(t,e,a,"normal",n,o,i,c))}))}})))},R_=function(t,e,n,r,o){var i=Sk(e),u=Rt($(e,(function(t){var e=function(t){return o?!Et(t,"text"):i},u=function(t){return D_(t,n,r,e(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?u(D(D({},t),{disabled:!0})):u(t)}))),a=o?Ok:Tk;return a(t,i,u,1,"normal")},N_=function(t){return Qx.singleData(t.value,t)},B_=function(t,e,n,r){var o=n===DE.ContentFocus?Tb():Ob(),i=o_(e,r),u=mk(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===DE.ContentFocus,focusManager:o,menuBehaviours:Qk.unnamedEvents("auto"!==e?[]:[Ua((function(t,e){Xk(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;Dw.setGridSize(t,r,n)}))}))])}},M_=function(t,e){var n=od(),r=ou(!1),o=Es(eC.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ml([Vw("dismissAutocompleter",[Na(ga(),(function(){return c()}))])]),lazySink:e.getSink})),i=function(){return eC.isOpen(o)},u=function(){return n.get().isSome()},a=function(){u()&&eC.hide(o)},c=function(){if(u()){var e=n.get().map((function(t){return t.element}));YC(e.getOr(ee.fromDom(t.selection.getNode()))).each(Ir),a(),n.clear(),r.set(!1)}},s=ge((function(){return VS(t)})),f=function(n,o){var i=gt(o,(function(t){return I.from(t.columns)})).getOr(1);return rt(o,(function(o){var u=o.items;return A_(u,o.matchText,(function(e,i){var u=t.selection.getRng();rS(t.dom,u,n).fold((function(){}),(function(t){var n=t.range,u={hide:function(){c()},reload:function(t){a(),g(t)}};r.set(!0),o.onAction(u,n,e,i),r.set(!1)}))}),i,jS.BUBBLE_TO_SANDBOX,e,o.highlightOn)}))},l=function(e){if(!u()){var o=XC(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}},d=function(e,n,r,i){e.matchLength=n.text.length;var u=gt(r,(function(t){return I.from(t.columns)})).getOr(1);eC.showAt(o,Hx.sketch(B_(Tk("autocompleter-value",!0,i,u,"normal"),u,DE.ContentFocus,"normal")),{anchor:{type:"node",root:ee.fromDom(t.getBody()),node:I.from(e.element)}}),eC.getContent(o).each(rb.highlightFirst)},m=function(e){return n.get().map((function(n){return rS(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return hS(t,s,n,e)}))})).getOrThunk((function(){return pS(t,s)}))},g=function(t){m(t).fold(c,(function(t){l(t.context),t.lookupData.then((function(e){n.get().map((function(n){var r=t.context;if(n.triggerChar===r.triggerChar){var o=f(r.triggerChar,e);o.length>0?d(n,r,e,o):r.text.length-n.matchLength>=10?c():a()}}))}))}))},p=WC((function(t){27!==t.which&&g()}),50),h={onKeypress:p,cancelIfNecessary:c,isMenuOpen:i,isActive:u,isProcessingAction:r.get,getView:function(){return eC.getContent(o)}};!1===t.hasPlugin("rtc")&&iS.setup(h,t)},P_={register:M_},I_=function(t,e,n){return zs(t,e,n).isSome()},L_=function(t,e){var n=null,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)},o=function(){null!==n&&(clearTimeout(n),n=null)};return{cancel:o,schedule:r}},F_=5,z_=400,H_=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?I.none():I.some(e.touches[0])},V_=function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>F_||r>F_},U_=function(t){var e=od(),n=ou(!1),r=L_((function(e){t.triggerEvent(oa(),e),n.set(!0)}),z_),o=function(t){return H_(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),I.none()},i=function(t){return r.cancel(),H_(t).each((function(t){e.on((function(n){V_(t,n)&&e.clear()}))})),I.none()},u=function(o){r.cancel();var i=function(t){return sn(t.target,o.target)};return e.get().filter(i).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(ra(),o)}))},a=gu([{key:Du(),value:o},{key:Au(),value:i},{key:Ru(),value:u}]),c=function(t,e){return Tt(a,e).bind((function(e){return e(t)}))};return{fireIfReady:c}},j_=function(t){var e=t.raw;return e.which===ob[0]&&!U(["input","textarea"],ae(t.target))&&!I_(t.target,'[contenteditable="true"]')},W_=function(){return en().browser.isFirefox()},q_=function(t,e){return W_()?ad(t,"focus",e):ud(t,"focusin",e)},$_=function(t,e){return W_()?ad(t,"blur",e):ud(t,"focusout",e)},G_=function(t,e){var n=D({stopBackspace:!0},e),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=U_(n),i=$(r.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return ud(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()}));var r=n.triggerEvent(e,t);r&&t.kill()}))})),u=od(),a=ud(t,"paste",(function(t){o.fireIfReady(t,"paste").each((function(e){e&&t.kill()}));var e=n.triggerEvent("paste",t);e&&t.kill(),u.set(setTimeout((function(){n.triggerEvent(Zu(),t)}),0))})),c=ud(t,"keydown",(function(t){var e=n.triggerEvent("keydown",t);e?t.kill():n.stopBackspace&&j_(t)&&t.prevent()})),s=q_(t,(function(t){var e=n.triggerEvent("focusin",t);e&&t.kill()})),f=od(),l=$_(t,(function(t){var e=n.triggerEvent("focusout",t);e&&t.kill(),f.set(setTimeout((function(){n.triggerEvent(Qu(),t)}),0))})),d=function(){G(i,(function(t){t.unbind()})),c.unbind(),s.unbind(),l.unbind(),a.unbind(),u.on(clearTimeout),f.on(clearTimeout)};return{unbind:d}},K_=function(t,e){var n=Tt(t,"target").getOr(e);return ou(n)},X_=function(t,e){var n=ou(!1),r=ou(!1),o=function(){n.set(!0)},i=function(){r.set(!0)};return{stop:o,cut:i,isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}},Y_=function(t){var e=ou(!1),n=function(){e.set(!0)};return{stop:n,cut:h,isStopped:e.get,isCut:T,event:t,setSource:O("Cannot set source of a broadcasted event"),getSource:O("Cannot get source of a broadcasted event")}},J_=uu.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),Q_=function(t,e,n,r,o,i){var u=t(e,r),a=X_(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),J_.complete()}),(function(t){var n=t.descHandler,r=Lc(n);return r(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),J_.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),J_.complete()):vn(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),J_.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),J_.resume(r)}))}))},Z_=function(t,e,n,r,o,i){return Q_(t,e,n,r,o,i).fold(E,(function(r){return Z_(t,e,n,r,o,i)}),T)},tD=function(t,e,n,r,o){var i=K_(n,r);return Q_(t,e,n,r,i,o)},eD=function(t,e,n){var r=Y_(e);return G(t,(function(t){var e=t.descHandler,n=Lc(e);n(r)})),r.isStopped()},nD=function(t,e,n,r){return rD(t,e,n,n.target,r)},rD=function(t,e,n,r,o){var i=K_(n,r);return Z_(t,e,n,r,i,o)},oD=function(t,e){return{element:t,descHandler:e}},iD=function(t,e){return{id:t,descHandler:e}},uD=function(){var t={},e=function(e,n,r){vt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=Ic(r,e),t[o]=i}))},n=function(t,e){return lc(e).bind((function(e){return Tt(t,e)})).map((function(t){return oD(e,t)}))},r=function(e){return Tt(t,e).map((function(t){return St(t,(function(t,e){return iD(e,t)}))})).getOr([])},o=function(e,r,o){return Tt(t,r).bind((function(t){return wu(o,(function(e){return n(t,e)}),e)}))},i=function(e){vt(t,(function(t,n){Et(t,e)&&delete t[e]}))};return{registerId:e,unregisterId:i,filterByType:r,find:o}},aD=function(){var t=uD(),e={},n=function(t){var e=t.element;return lc(e).getOrThunk((function(){return sc("uid-",t.element)}))},r=function(t,n){var r=e[n];if(r!==t)throw new Error('The tagId "'+n+'" is already used by: '+Za(r.element)+"\nCannot use it for: "+Za(t.element)+"\nThe conflicting element is"+(In(r.element)?" ":" not ")+"already in the DOM");i(t)},o=function(o){var i=n(o);_t(e,i)&&r(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},i=function(n){lc(n.element).each((function(n){delete e[n],t.unregisterId(n)}))},u=function(e){return t.filterByType(e)},a=function(e,n,r){return t.find(e,n,r)},c=function(t){return Tt(e,t)};return{find:a,filter:u,register:o,unregister:i,getById:c}},cD=function(t){var e=t.dom,n=e.attributes,r=A(e,["attributes"]);return{uid:t.uid,dom:D({tag:"div",attributes:D({role:"presentation"},n)},r),components:t.components,behaviours:nh(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},sD=dv({name:"Container",factory:cD,configFields:[Ki("components",[]),eh("containerBehaviours",[]),Ki("events",{}),Ki("domModification",{}),Ki("eventOrder",{})]}),fD=function(t){var e=function(e){return vn(t.element).fold(E,(function(t){return sn(e,t)}))},n=aD(),r=function(t,r){return n.find(e,t,r)},o=G_(t.element,{triggerEvent:function(t,e){return Js(t,e.target,(function(n){return nD(r,t,e,n)}))}}),i={debugInfo:w("real"),triggerEvent:function(t,e,n){Js(t,e,(function(o){return rD(r,t,n,e,o)}))},triggerFocus:function(t,e){lc(t).fold((function(){Sl(t)}),(function(n){Js(Ju(),t,(function(n){return tD(r,Ju(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return p(t)},getByDom:function(t){return v(t)},build:Es,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){d(t)},broadcastOn:function(t,e){m(t,e)},broadcastEvent:function(t,e){g(t,e)},isConnected:E},u=function(t){t.connect(i),le(t.element)||(n.register(t),G(t.components(),u),i.triggerEvent(aa(),t.element,{target:t.element}))},a=function(t){le(t.element)||(G(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){Wg(t,e)},s=function(t){Gg(t)},f=function(){o.unbind(),Pr(t.element)},l=function(t){var e=n.filter(ta());G(e,(function(e){var n=e.descHandler,r=Lc(n);r(t)}))},d=function(t){l({universal:!0,data:t})},m=function(t,e){l({universal:!1,channels:t,data:e})},g=function(t,e){var r=n.filter(t);return eD(r,e)},p=function(t){return n.getById(t).fold((function(){return ro.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ro.value)},v=function(t){var e=lc(t).getOr("not found");return p(e)};return u(t),{root:t,element:t.element,destroy:f,add:c,remove:s,getByUid:p,getByDom:v,addToWorld:u,removeFromWorld:a,broadcast:d,broadcastOn:m,broadcastEvent:g}},lD=function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:$(t.items,e.interpreter)}},dD=w([Ki("prefix","form-field"),eh("fieldBehaviours",[bv,th])]),mD=w([Ph({schema:[Di("dom")],name:"label"}),Ph({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Di("text")],name:"aria-descriptor"}),Bh({factory:{sketch:function(t){var e=du(t,["factory"]);return t.factory.sketch(e)}},schema:[Di("factory")],name:"field"})]),gD=function(t,e,n,r){var o=rh(t.fieldBehaviours,[bv.config({find:function(e){return Kh(e,t,"field")}}),th.config({store:{mode:"manual",getValue:function(t){return bv.getCurrent(t).bind(th.getValue)},setValue:function(t,e){bv.getCurrent(t).each((function(t){th.setValue(t,e)}))}}})]),i=_a([Ua((function(e,n){var r=Yh(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=oc(t.prefix);r.label().each((function(t){Hn(t.element,"for",n),Hn(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=oc(t.prefix);Hn(n.element,"id",r),Hn(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Kh(e,t,"field")},getLabel:function(e){return Kh(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},pD=mv({name:"FormField",configFields:dD(),partFields:mD(),factory:gD,apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),hD=function(t,e){return Ac({attributes:gu([{key:e.tabAttr,value:"true"}])})},vD=Object.freeze({__proto__:null,exhibit:hD}),bD=[Ki("tabAttr","data-alloy-tabstop")],yD=pl({fields:bD,name:"tabstopping",active:vD}),wD=tinymce.util.Tools.resolve("tinymce.html.Entities"),xD=function(t,e,n,r){var o=SD(t,e,n,r);return pD.sketch(o)},CD=function(t,e){return xD(t,e,[],[])},SD=function(t,e,n,r){return{dom:OD(n),components:t.toArray().concat([e]),fieldBehaviours:ml(r)}},kD=function(){return OD([])},OD=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},TD=function(t,e){return pD.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ED=oc("form-component-change"),_D=oc("form-close"),DD=oc("form-cancel"),AD=oc("form-action"),RD=oc("form-submit"),ND=oc("form-block"),BD=oc("form-unblock"),MD=oc("form-tabchange"),PD=oc("form-resize"),ID=function(t,e){var n,r=t.label.map((function(t){return TD(t,e)})),o=function(t){return function(e,n){zs(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Un(r,"data-collection-item-value"))}))}},i=function(n,r){var o=$(r,(function(n){var r=OC.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]})),c=e.isDisabled()?" tox-collection__item--state-disabled":"";return'<div class="tox-collection__item'+c+'" tabindex="-1" data-collection-item-value="'+wD.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?q(o,t.columns):[o],u=$(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ka(n.element,u.join(""))},u=o((function(n,r,o,i){r.stop(),e.isDisabled()||Sa(n,AD,{name:t.name,value:i})})),a=[Na(Lu(),o((function(t,e,n){Sl(n)}))),Na(Wu(),u),Na(ra(),u),Na(Fu(),o((function(t,e,n){Fs(t.element,"."+ek).each((function(t){as(t,ek)})),is(n,ek)}))),Na(zu(),o((function(t){Fs(t.element,"."+ek).each((function(t){as(t,ek)}))}))),qa(o((function(e,n,r,o){Sa(e,AD,{name:t.name,value:o})})))],c=function(t,e){return $(Xm(t.element,".tox-collection__item"),e)},s=pD.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:x},behaviours:ml([Lv.config({disabled:e.isDisabled,onDisabled:function(t){c(t,(function(t){is(t,"tox-collection__item--state-disabled"),Hn(t,"aria-disabled",!0)}))},onEnabled:function(t){c(t,(function(t){as(t,"tox-collection__item--state-disabled"),qn(t,"aria-disabled")}))}}),cT(),zw.config({}),th.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,n){i(e,n),"auto"===t.columns&&Xk(e,5,"tox-collection__item").each((function(t){var n=t.numRows,r=t.numColumns;Dw.setGridSize(e,n,r)})),Ca(e,PD)}}),yD.config({}),Dw.config(i_(t.columns,"normal")),Vw("collection-events",a)]),eventOrder:(n={},n[ea()]=["disabling","alloy.base.behaviour","collection-events"],n)}),f=["tox-form__group--collection"];return xD(r,s,f,[])},LD=w([Hi("data"),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("tag","input"),Ki("inputClasses",[]),cf("onSetValue"),Ki("styles",{}),Ki("eventOrder",{}),eh("inputBehaviours",[th,Yw]),Ki("selectOnFocus",!0)]),FD=function(t){return ml([Yw.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=ds(e);e.dom.setSelectionRange(0,n.length)}:h})])},zD=function(t){return D(D({},FD(t)),rh(t.inputBehaviours,[th.config({store:D(D({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return ds(t.element)},setValue:function(t,e){var n=ds(t.element);n!==e&&ms(t.element,e)}}),onSetValue:t.onSetValue})]))},HD=function(t){return{tag:t.tag,attributes:D({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},VD=function(t,e){return{uid:t.uid,dom:HD(t),components:[],behaviours:zD(t),eventOrder:t.eventOrder}},UD=dv({name:"Input",configFields:LD(),factory:VD}),jD={},WD={exports:jD};(function(e,n,r,o){(function(t,o){"object"===typeof n&&"undefined"!==typeof r?r.exports=o():"function"===typeof e&&e.amd?e(o):(t="undefined"!==typeof globalThis?globalThis:t||self,t.EphoxContactWrapper=o())})(this,(function(){var e="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},n={exports:{}};(function(t){(function(e){var n=setTimeout;function r(){}function o(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function u(t,e){while(3===t._state)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void c(e.promise,o)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===typeof e||"function"===typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"===typeof n)return void l(o(n,e),t)}t._state=1,t._value=e,s(t)}catch(r){c(t,r)}}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(r){if(n)return;n=!0,c(e,r)}}i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return u(this,new f(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"===typeof u||"function"===typeof u)){var a=u.then;if("function"===typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0===--r&&t(e)}catch(c){n(c)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"===typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"===typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!==typeof console&&console},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},t.exports?t.exports=i:e.Promise||(e.Promise=i)})(e)})(n);var r=n.exports,o=function(){return"undefined"!==typeof window?window:Function("return this;")()}(),i={boltExport:o.Promise||r};return i}))})(void 0,jD,WD);var qD,$D=WD.exports.boltExport,GD=function(t){var e=I.none(),n=[],r=function(t){return GD((function(e){o((function(n){e(t(n))}))}))},o=function(t){u()?c(t):n.push(t)},i=function(t){u()||(e=I.some(t),a(n),n=[])},u=function(){return e.isSome()},a=function(t){G(t,c)},c=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t(i),{get:o,map:r,isReady:u}},KD=function(t){return GD((function(e){e(t)}))},XD={nu:GD,pure:KD},YD=function(t){setTimeout((function(){throw t}),0)},JD=function(t){var e=function(e){t().then(e,YD)},n=function(e){return JD((function(){return t().then(e)}))},r=function(e){return JD((function(){return t().then((function(t){return e(t).toPromise()}))}))},o=function(e){return JD((function(){return t().then((function(){return e.toPromise()}))}))},i=function(){return XD.nu(e)},u=function(){var e=null;return JD((function(){return null===e&&(e=t()),e}))},a=t;return{map:n,bind:r,anonBind:o,toLazy:i,toCached:u,toPromise:a,get:e}},QD=function(t){return JD((function(){return new $D(t)}))},ZD=function(t){return JD((function(){return $D.resolve(t)}))},tA={nu:QD,pure:ZD},eA=["input","textarea"],nA=function(t){var e=ae(t);return U(eA,e)},rA=function(t,e){var n=e.getRoot(t).getOr(t.element);as(n,e.invalidClass),e.notify.each((function(e){nA(t.element)&&Hn(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ka(t,e.validHtml)})),e.onValid(t)}))},oA=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);is(o,e.invalidClass),e.notify.each((function(e){nA(t.element)&&Hn(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ka(t,r)})),e.onInvalid(t,r)}))},iA=function(t,e,n){return e.validator.fold((function(){return tA.pure(ro.value(!0))}),(function(e){return e.validate(t)}))},uA=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),iA(t,e).map((function(r){return t.getSystem().isConnected()?r.fold((function(r){return oA(t,e,n,r),ro.error(r)}),(function(n){return rA(t,e),ro.value(n)})):ro.error("No longer in system")}))},aA=function(t,e){var n=e.getRoot(t).getOr(t.element);return cs(n,e.invalidClass)},cA=Object.freeze({__proto__:null,markValid:rA,markInvalid:oA,query:iA,run:uA,isInvalid:aA}),sA=function(t,e){return t.validator.map((function(n){return _a([Na(n.onEvent,(function(n){uA(n,t,e).get(x)}))].concat(n.validateOnLoad?[Ua((function(n){uA(n,t,e).get(h)}))]:[]))})).getOr({})},fA=Object.freeze({__proto__:null,events:sA}),lA=[Di("invalidClass"),Ki("getRoot",I.none),$i("notify",[Ki("aria","alert"),Ki("getContainer",I.none),Ki("validHtml",""),cf("onValid"),cf("onInvalid"),cf("onValidate")]),$i("validator",[Di("validate"),Ki("onEvent","input"),Ki("validateOnLoad",!0)])],dA=pl({fields:lA,name:"invalidating",active:fA,apis:cA,extra:{validation:function(t){return function(e){var n=th.getValue(e);return tA.pure(t(n))}}}}),mA=function(t,e,n,r){return n.getOrCreate(t,e,r)},gA=Object.freeze({__proto__:null,getCoupled:mA}),pA=[Ai("others",bi(ro.value,ui()))],hA=function(){var t={},e=function(e,n,r){var o=pt(n.others);if(o)return Tt(t,r).getOrThunk((function(){var o=Tt(n.others,r).getOrDie("No information found for coupled component: "+r),i=o(e),u=e.getSystem().build(i);return t[r]=u,u}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))},n=w({});return Oc({readState:n,getOrCreate:e})},vA=Object.freeze({__proto__:null,init:hA}),bA=pl({fields:pA,name:"coupling",apis:gA,state:vA}),yA=w("sink"),wA=w(Ph({name:yA(),overrides:w({dom:{tag:"div"},behaviours:ml([Fg.config({useFixed:E})]),events:_a([za(Hu()),za(Bu()),za(Wu())])})}));(function(t){t[t["HighlightFirst"]=0]="HighlightFirst",t[t["HighlightNone"]=1]="HighlightNone"})(qD||(qD={}));var xA,CA=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{type:r,hotspot:n,overrides:o}}),(function(t){return{type:r,hotspot:n,overrides:o,layouts:t}}))},SA=function(t,e,n){var r=t.fetch;return r(n).map(e)},kA=function(t,e,n,r,o,i,u){var a=SA(t,e,r),c=DA(r,t);return a.map((function(t){return t.bind((function(t){return I.from(Qx.sketch(D(D({},i.menu()),{uid:dc(""),data:t,highlightImmediately:u===qD.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Fg.position(r,e,{anchor:n}),bp.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Fg.position(r,n,{anchor:{type:"submenu",item:e}}),bp.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Fg.position(o,e,{anchor:n}),G(r,(function(t){Fg.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return Yw.focus(r),bp.close(o),I.some(!0)}})))}))}))},OA=function(t,e,n,r,o,i,u){var a=CA(t,n),c=kA(t,e,a,n,r,o,u);return c.map((function(t){return t.fold((function(){bp.isOpen(r)&&bp.close(r)}),(function(t){bp.cloak(r),bp.open(r,t),i(r)})),r}))},TA=function(t,e,n,r,o,i,u){return bp.close(r),tA.pure(r)},EA=function(t,e,n,r,o,i){var u=bA.getCoupled(n,"sandbox"),a=bp.isOpen(u),c=a?TA:OA;return c(t,e,n,u,r,o,i)},_A=function(t,e,n){var r=bv.getCurrent(e).getOr(e),o=vr(t.element);n?Kn(r.element,"min-width",o+"px"):hr(r.element,o)},DA=function(t,e){return t.getSystem().getByUid(e.uid+"-"+yA()).map((function(t){return function(){return ro.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return ro.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},AA=function(t){bp.getState(t).each((function(t){Qx.repositionMenus(t)}))},RA=function(t,e,n){var r=Vs(),o=function(o,i){var u=CA(t,e);r.link(e.element),t.matchWidth&&_A(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},i=function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},u=DA(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:oh.augment(t.sandboxBehaviours,[th.config({store:{mode:"memory",initialValue:e}}),bp.config({onOpen:o,onClose:i,isPartOf:function(t,n,r){return js(n,r)||js(e,r)},getAttachPoint:function(){return u().getOrDie()}}),bv.config({find:function(t){return bp.getState(t).bind((function(t){return bv.getCurrent(t)}))}}),yl.config({channels:D(D({},Sp({isExtraPart:T})),Op({doReposition:AA}))})])}},NA=function(t){var e=bA.getCoupled(t,"sandbox");AA(e)},BA=function(){return[Ki("sandboxClasses",[]),oh.field("sandboxBehaviours",[bv,yl,bp,th])]},MA=w([Di("dom"),Di("fetch"),cf("onOpen"),sf("onExecute"),Ki("getHotspot",I.some),Ki("getAnchorOverrides",w({})),zd(),eh("dropdownBehaviours",[px,bA,Dw,Yw]),Di("toggleClass"),Ki("eventOrder",{}),Hi("lazySink"),Ki("matchWidth",!1),Ki("useMinWidth",!1),Hi("role")].concat(BA())),PA=w([Mh({schema:[of()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),wA()]),IA=function(t,e,n,r){var o,i=function(e){return Tt(t.dom,"attributes").bind((function(t){return Tt(t,e)}))},u=function(t){bp.getState(t).each((function(t){Qx.highlightPrimary(t)}))},a=function(e){var n=u;EA(t,x,e,r,n,qD.HighlightFirst).get(h)},c={expand:function(e){px.isOn(e)||EA(t,x,e,r,h,qD.HighlightNone).get(h)},open:function(e){px.isOn(e)||EA(t,x,e,r,h,qD.HighlightFirst).get(h)},isOpen:px.isOn,close:function(e){px.isOn(e)&&EA(t,x,e,r,h,qD.HighlightFirst).get(h)},repositionMenus:function(t){px.isOn(t)&&NA(t)}},s=function(t,e){return ka(t),I.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.dropdownBehaviours,[px.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),bA.config({others:{sandbox:function(e){return RA(t,e,{onOpen:function(){return px.on(e)},onClose:function(){return px.off(e)}})}}}),Dw.config({mode:"special",onSpace:s,onEnter:s,onDown:function(t,e){if(LA.isOpen(t)){var n=bA.getCoupled(t,"sandbox");u(n)}else LA.open(t);return I.some(!0)},onEscape:function(t,e){return LA.isOpen(t)?(LA.close(t),I.some(!0)):I.none()}}),Yw.config({})]),events:vx(I.some(a)),eventOrder:D(D({},t.eventOrder),(o={},o[ea()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:c,domModification:{attributes:D(D({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:i("type").getOr("button")}:{})}}},LA=mv({name:"Dropdown",configFields:MA(),partFields:PA(),factory:IA,apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),FA=function(){return Ac({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})},zA=function(){return _a([Da(Ku(),E)])},HA=Object.freeze({__proto__:null,events:zA,exhibit:FA}),VA=pl({fields:[],name:"unselecting",active:HA}),UA=function(t,e){return LA.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:ml([mT.button(e.providers.isDisabled),cT(),VA.config({}),yD.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return tA.nu((function(e){return t.fetch(e)})).map((function(r){return I.from(N_(Co(n_(oc("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,jS.CLOSE_ON_EXECUTE,T,e.providers),{movement:o_(t.columns,t.presets)})))}))},parts:{menu:hk(!1,1,t.presets)}})},jA=oc("color-input-change"),WA=oc("color-swatch-change"),qA=oc("color-picker-cancel"),$A=function(t,e,n){var r=pD.parts.field({factory:UD,inputClasses:["tox-textfield"],onSetValue:function(t){return dA.run(t).get(h)},inputBehaviours:ml([Lv.config({disabled:e.providers.isDisabled}),cT(),yD.config({}),dA.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return vn(t.element)},notify:{onValid:function(t){var e=th.getValue(t);Sa(t,jA,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=th.getValue(t);if(0===e.length)return tA.pure(ro.value(!0));var n=ee.fromTag("span");Kn(n,"background-color",e);var r=Zn(n,"background-color").fold((function(){return ro.error("blah")}),(function(t){return ro.value(e)}));return tA.pure(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return TD(t,e.providers)})),i=function(t,e){Sa(t,WA,{value:e})},u=function(t,e){a.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Ca(t,qA)}),(function(e){i(t,e),zE(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))},a=kC(UA({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[jf,Uf,Gf]},onLtr:function(){return[Uf,jf,Gf]}},components:[],fetch:YE(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:u},e));return pD.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:ml([Vw("form-field-events",[Na(jA,(function(e,n){a.getOpt(e).each((function(t){Kn(t.element,"background-color",n.event.color)})),Sa(e,ED,{name:t.name})})),Na(WA,(function(t,e){pD.getField(t).each((function(n){th.setValue(n,e.event.value),bv.getCurrent(t).each(Yw.focus)}))})),Na(qA,(function(t,e){pD.getField(t).each((function(e){bv.getCurrent(t).each(Yw.focus)}))}))])])})},GA=Ph({schema:[Di("dom")],name:"label"}),KA=function(t){return Ph({name:t+"-edge",overrides:function(e){var n=e.model.manager.edgeActions[t];return n.fold((function(){return{}}),(function(t){return{events:_a([Ba(Du(),(function(e,n,r){return t(e,r)}),[e]),Ba(Bu(),(function(e,n,r){return t(e,r)}),[e]),Ba(Mu(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},XA=KA("top-left"),YA=KA("top"),JA=KA("top-right"),QA=KA("right"),ZA=KA("bottom-right"),tR=KA("bottom"),eR=KA("bottom-left"),nR=KA("left"),rR=Bh({name:"thumb",defaults:w({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:_a([La(Du(),t,"spectrum"),La(Au(),t,"spectrum"),La(Ru(),t,"spectrum"),La(Bu(),t,"spectrum"),La(Mu(),t,"spectrum"),La(Iu(),t,"spectrum")])}}}),oR=Bh({schema:[Ei("mouseIsDown",(function(){return ou(!1)}))],name:"spectrum",overrides:function(t){var e=t.model,n=e.manager,r=function(e,r){return n.getValueFromEvent(r).map((function(r){return n.setValueFrom(e,t,r)}))};return{behaviours:ml([Dw.config({mode:"special",onLeft:function(e){return n.onLeft(e,t)},onRight:function(e){return n.onRight(e,t)},onUp:function(e){return n.onUp(e,t)},onDown:function(e){return n.onDown(e,t)}}),Yw.config({})]),events:_a([Na(Du(),r),Na(Au(),r),Na(Bu(),r),Na(Mu(),(function(e,n){t.mouseIsDown.get()&&r(e,n)}))])}}}),iR=[GA,nR,QA,YA,tR,XA,JA,eR,ZA,rR,oR],uR="slider.change.value",aR=w(uR),cR=function(t){return-1!==t.type.indexOf("touch")},sR=function(t){var e=t.event.raw;if(cR(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?I.some(n.touches[0]).map((function(t){return fr(t.clientX,t.clientY)})):I.none()}var r=e;return void 0!==r.clientX?I.some(r).map((function(t){return fr(t.clientX,t.clientY)})):I.none()},fR="top",lR="right",dR="bottom",mR="left",gR=function(t){return t.model.minX},pR=function(t){return t.model.minY},hR=function(t){return t.model.minX-1},vR=function(t){return t.model.minY-1},bR=function(t){return t.model.maxX},yR=function(t){return t.model.maxY},wR=function(t){return t.model.maxX+1},xR=function(t){return t.model.maxY+1},CR=function(t,e,n){return e(t)-n(t)},SR=function(t){return CR(t,bR,gR)},kR=function(t){return CR(t,yR,pR)},OR=function(t){return SR(t)/2},TR=function(t){return kR(t)/2},ER=function(t){return t.stepSize},_R=function(t){return t.snapToGrid},DR=function(t){return t.snapStart},AR=function(t){return t.rounded},RR=function(t,e){return void 0!==t[e+"-edge"]},NR=function(t){return RR(t,mR)},BR=function(t){return RR(t,lR)},MR=function(t){return RR(t,fR)},PR=function(t){return RR(t,dR)},IR=function(t){return t.model.value.get()},LR=function(t){return{x:t}},FR=function(t){return{y:t}},zR=function(t,e){return{x:t,y:e}},HR=function(t,e){Sa(t,aR(),{value:e})},VR=function(t,e){HR(t,zR(hR(e),vR(e)))},UR=function(t,e){HR(t,FR(vR(e)))},jR=function(t,e){HR(t,zR(OR(e),vR(e)))},WR=function(t,e){HR(t,zR(wR(e),vR(e)))},qR=function(t,e){HR(t,LR(wR(e)))},$R=function(t,e){HR(t,zR(wR(e),TR(e)))},GR=function(t,e){HR(t,zR(wR(e),xR(e)))},KR=function(t,e){HR(t,FR(xR(e)))},XR=function(t,e){HR(t,zR(OR(e),xR(e)))},YR=function(t,e){HR(t,zR(hR(e),xR(e)))},JR=function(t,e){HR(t,LR(hR(e)))},QR=function(t,e){HR(t,zR(hR(e),TR(e)))},ZR=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},tN=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},eN=function(t,e,n){return Math.max(e,Math.min(n,t))},nN=function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return eN(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=Math.min(a,u+i),s=e+c*r;return Math.max(e,s)}))},rN=function(t,e,n){return Math.min(n,Math.max(t,e))-e},oN=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,f=t.hasMaxEdge,l=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,p=f?n+1:n;if(o<l)return g;if(o>d)return p;var h=rN(o,l,d),v=eN(h/m*r+e,g,p);return u&&v>=e&&v<=n?nN(v,e,n,i,a):c?Math.round(v):v},iN=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,f=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:f:(o-e)/r*c},uN="top",aN="right",cN="bottom",sN="left",fN="width",lN="height",dN=function(t){return t.element.dom.getBoundingClientRect()},mN=function(t,e){return t[e]},gN=function(t){var e=dN(t);return mN(e,sN)},pN=function(t){var e=dN(t);return mN(e,aN)},hN=function(t){var e=dN(t);return mN(e,uN)},vN=function(t){var e=dN(t);return mN(e,cN)},bN=function(t){var e=dN(t);return mN(e,fN)},yN=function(t){var e=dN(t);return mN(e,lN)},wN=function(t,e,n){return(t+e)/2-n},xN=function(t,e){var n=dN(t),r=dN(e),o=mN(n,sN),i=mN(n,aN),u=mN(r,sN);return wN(o,i,u)},CN=function(t,e){var n=dN(t),r=dN(e),o=mN(n,uN),i=mN(n,cN),u=mN(r,uN);return wN(o,i,u)},SN=function(t,e){Sa(t,aR(),{value:e})},kN=function(t){return{x:t}},ON=function(t,e,n){var r={min:gR(e),max:bR(e),range:SR(e),value:n,step:ER(e),snap:_R(e),snapStart:DR(e),rounded:AR(e),hasMinEdge:NR(e),hasMaxEdge:BR(e),minBound:gN(t),maxBound:pN(t),screenRange:bN(t)};return oN(r)},TN=function(t,e,n){var r=ON(t,e,n),o=kN(r);return SN(t,o),r},EN=function(t,e){var n=gR(e);SN(t,kN(n))},_N=function(t,e){var n=bR(e);SN(t,kN(n))},DN=function(t,e,n){var r=t>0?tN:ZR,o=r(IR(n).x,gR(n),bR(n),ER(n));return SN(e,kN(o)),I.some(o)},AN=function(t){return function(e,n){return DN(t,e,n).map(E)}},RN=function(t){var e=sR(t);return e.map((function(t){return t.left}))},NN=function(t,e,n,r,o){var i=0,u=bN(t),a=r.bind((function(e){return I.some(xN(e,t))})).getOr(i),c=o.bind((function(e){return I.some(xN(e,t))})).getOr(u),s={min:gR(e),max:bR(e),range:SR(e),value:n,hasMinEdge:NR(e),hasMaxEdge:BR(e),minBound:gN(t),minOffset:i,maxBound:pN(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return iN(s)},BN=function(t,e,n,r,o,i){var u=NN(e,i,n,r,o);return gN(e)-gN(t)+u},MN=function(t,e,n,r){var o=IR(n),i=BN(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=vr(e.element)/2;Kn(e.element,"left",i-u+"px")},PN=AN(-1),IN=AN(1),LN=I.none,FN=I.none,zN={"top-left":I.none(),top:I.none(),"top-right":I.none(),right:I.some(qR),"bottom-right":I.none(),bottom:I.none(),"bottom-left":I.none(),left:I.some(JR)},HN=Object.freeze({__proto__:null,setValueFrom:TN,setToMin:EN,setToMax:_N,findValueOfOffset:ON,getValueFromEvent:RN,findPositionOfValue:BN,setPositionFromValue:MN,onLeft:PN,onRight:IN,onUp:LN,onDown:FN,edgeActions:zN}),VN=function(t,e){Sa(t,aR(),{value:e})},UN=function(t){return{y:t}},jN=function(t,e,n){var r={min:pR(e),max:yR(e),range:kR(e),value:n,step:ER(e),snap:_R(e),snapStart:DR(e),rounded:AR(e),hasMinEdge:MR(e),hasMaxEdge:PR(e),minBound:hN(t),maxBound:vN(t),screenRange:yN(t)};return oN(r)},WN=function(t,e,n){var r=jN(t,e,n),o=UN(r);return VN(t,o),r},qN=function(t,e){var n=pR(e);VN(t,UN(n))},$N=function(t,e){var n=yR(e);VN(t,UN(n))},GN=function(t,e,n){var r=t>0?tN:ZR,o=r(IR(n).y,pR(n),yR(n),ER(n));return VN(e,UN(o)),I.some(o)},KN=function(t){return function(e,n){return GN(t,e,n).map(E)}},XN=function(t){var e=sR(t);return e.map((function(t){return t.top}))},YN=function(t,e,n,r,o){var i=0,u=yN(t),a=r.bind((function(e){return I.some(CN(e,t))})).getOr(i),c=o.bind((function(e){return I.some(CN(e,t))})).getOr(u),s={min:pR(e),max:yR(e),range:kR(e),value:n,hasMinEdge:MR(e),hasMaxEdge:PR(e),minBound:hN(t),minOffset:i,maxBound:vN(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return iN(s)},JN=function(t,e,n,r,o,i){var u=YN(e,i,n,r,o);return hN(e)-hN(t)+u},QN=function(t,e,n,r){var o=IR(n),i=JN(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=ur(e.element)/2;Kn(e.element,"top",i-u+"px")},ZN=I.none,tB=I.none,eB=KN(-1),nB=KN(1),rB={"top-left":I.none(),top:I.some(UR),"top-right":I.none(),right:I.none(),"bottom-right":I.none(),bottom:I.some(KR),"bottom-left":I.none(),left:I.none()},oB=Object.freeze({__proto__:null,setValueFrom:WN,setToMin:qN,setToMax:$N,findValueOfOffset:jN,getValueFromEvent:XN,findPositionOfValue:JN,setPositionFromValue:QN,onLeft:ZN,onRight:tB,onUp:eB,onDown:nB,edgeActions:rB}),iB=function(t,e){Sa(t,aR(),{value:e})},uB=function(t,e){return{x:t,y:e}},aB=function(t,e,n){var r=ON(t,e,n.left),o=jN(t,e,n.top),i=uB(r,o);return iB(t,i),i},cB=function(t,e,n,r){var o=t>0?tN:ZR,i=e?IR(r).x:o(IR(r).x,gR(r),bR(r),ER(r)),u=e?o(IR(r).y,pR(r),yR(r),ER(r)):IR(r).y;return iB(n,uB(i,u)),I.some(i)},sB=function(t,e){return function(n,r){return cB(t,e,n,r).map(E)}},fB=function(t,e){var n=gR(e),r=pR(e);iB(t,uB(n,r))},lB=function(t,e){var n=bR(e),r=yR(e);iB(t,uB(n,r))},dB=function(t){return sR(t)},mB=function(t,e,n,r){var o=IR(n),i=BN(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=JN(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=vr(e.element)/2,c=ur(e.element)/2;Kn(e.element,"left",i-a+"px"),Kn(e.element,"top",u-c+"px")},gB=sB(-1,!1),pB=sB(1,!1),hB=sB(-1,!0),vB=sB(1,!0),bB={"top-left":I.some(VR),top:I.some(jR),"top-right":I.some(WR),right:I.some($R),"bottom-right":I.some(GR),bottom:I.some(XR),"bottom-left":I.some(YR),left:I.some(QR)},yB=Object.freeze({__proto__:null,setValueFrom:aB,setToMin:fB,setToMax:lB,getValueFromEvent:dB,setPositionFromValue:mB,onLeft:gB,onRight:pB,onUp:hB,onDown:vB,edgeActions:bB}),wB=[Ki("stepSize",1),Ki("onChange",h),Ki("onChoose",h),Ki("onInit",h),Ki("onDragStart",h),Ki("onDragEnd",h),Ki("snapToGrid",!1),Ki("rounded",!0),Hi("snapStart"),Ai("model",ki("mode",{x:[Ki("minX",0),Ki("maxX",100),Ei("value",(function(t){return ou(t.mode.minX)})),Di("getInitialValue"),df("manager",HN)],y:[Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return ou(t.mode.minY)})),Di("getInitialValue"),df("manager",oB)],xy:[Ki("minX",0),Ki("maxX",100),Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return ou({x:t.mode.minX,y:t.mode.minY})})),Di("getInitialValue"),df("manager",yB)]})),eh("sliderBehaviours",[Dw,th]),Ei("mouseIsDown",(function(){return ou(!1)}))],xB=function(t,e,n,r){var o,i=function(e){return Xh(e,t,"thumb")},u=function(e){return Xh(e,t,"spectrum")},a=function(e){return Kh(e,t,"left-edge")},c=function(e){return Kh(e,t,"right-edge")},s=function(e){return Kh(e,t,"top-edge")},f=function(e){return Kh(e,t,"bottom-edge")},l=t.model,d=l.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:f,getSpectrum:u})},g=function(t,e){l.value.set(e);var n=i(t);m(t,n)},p=function(e,n){g(e,n);var r=i(e);return t.onChange(e,r,n),I.some(!0)},h=function(e){d.setToMin(e,t)},v=function(e){d.setToMax(e,t)},b=function(e){var n=function(){Kh(e,t,"thumb").each((function(n){var r=l.value.get();t.onChoose(e,n,r)}))},r=t.mouseIsDown.get();t.mouseIsDown.set(!1),r&&n()},y=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},w=function(e,n){n.stop(),t.onDragEnd(e,i(e)),b(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.sliderBehaviours,[Dw.config({mode:"special",focusIn:function(e){return Kh(e,t,"spectrum").map(Dw.focusIn).map(E)}}),th.config({store:{mode:"manual",getValue:function(t){return l.value.get()}}}),yl.config({channels:(o={},o[xp()]={onReceive:b},o)})]),events:_a([Na(aR(),(function(t,e){p(t,e.event.value)})),Ua((function(e,n){var r=l.getInitialValue();l.value.set(r);var o=i(e);m(e,o);var a=u(e);t.onInit(e,o,a,l.value.get())})),Na(Du(),y),Na(Ru(),w),Na(Bu(),y),Na(Iu(),w)]),apis:{resetToMin:h,resetToMax:v,setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},CB=mv({name:"Slider",configFields:wB,partFields:iR,factory:xB,apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),SB=oc("rgb-hex-update"),kB=oc("slider-update"),OB=oc("palette-update"),TB=function(t,e){var n=CB.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=CB.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return CB.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:w({y:0})},components:[n,r],sliderBehaviours:ml([Yw.config({})]),onChange:function(t,e,n){Sa(t,kB,{value:n})}})},EB="form",_B=[eh("formBehaviours",[th])],DB=function(t){return"<alloy.field."+t+">"},AB=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),jh(EB,DB(e),n)};return{field:e,record:w(t)}}(),n=t(e),r=e.record(),o=$(r,(function(t){return Bh({name:t,pname:DB(t)})}));return uv(EB,_B,o,NB,n)},RB=function(t,e){return t.fold((function(){return ro.error(e)}),ro.value)},NB=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.formBehaviours,[th.config({store:{mode:"manual",getValue:function(e){var n=Jh(e,t);return bt(n,(function(t,e){return t().bind((function(t){var n=bv.getCurrent(t);return RB(n,new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Za(t.element)))})).map(th.getValue)}))},setValue:function(e,n){vt(n,(function(n,r){Kh(e,t,r).each((function(t){bv.getCurrent(t).each((function(t){th.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Kh(e,t,n).bind(bv.getCurrent)}}}},BB={getField:Sc((function(t,e,n){return t.getField(e,n)})),sketch:AB},MB=oc("valid-input"),PB=oc("invalid-input"),IB=oc("validating-input"),LB="colorcustom.rgb.",FB=function(t,e,n,r){var o=function(n,r){return dA.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Sa(t,IB,{type:n})},onValid:function(t){Sa(t,MB,{type:n,value:th.getValue(t)})},onInvalid:function(t){Sa(t,PB,{type:n,value:th.getValue(t)})}},validator:{validate:function(e){var n=th.getValue(e),o=r(n)?ro.value(!0):ro.error(t("aria.input.invalid"));return tA.pure(o)},validateOnLoad:!1}})},i=function(n,r,i,u,a){var c=t(LB+"range"),s=pD.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":u}}}),f=pD.parts.field({data:a,factory:UD,inputAttributes:D({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:ml([o(r,n),yD.config({})]),onSetValue:function(t){if(dA.isInvalid(t)){var e=dA.run(t);e.get(h)}}}),l=[s,f],d="hex"!==r?[pD.parts["aria-descriptor"]({text:c})]:[],m=l.concat(d);return{dom:{tag:"div",attributes:{role:"presentation"}},components:m}},u=function(t,e){var n=eE(e);return BB.getField(t,"hex").each((function(e){Yw.isFocused(e)||th.setValue(t,{hex:n.value})})),n},a=function(t,e){var n=e.red,r=e.green,o=e.blue;th.setValue(t,{red:n,green:r,blue:o})},c=kC({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Kn(t.element,"background-color","#"+e.value)}))},f=function(){var o={red:ou(I.some(255)),green:ou(I.some(255)),blue:ou(I.some(255)),hex:ou(I.some("ffffff"))},f=function(t,e){var n=fE(e);a(t,n),g(n)},l=function(t){return o[t].get()},d=function(t,e){o[t].set(e)},m=function(){return l("red").bind((function(t){return l("green").bind((function(e){return l("blue").map((function(n){return aE(t,e,n,1)}))}))}))},g=function(t){var e=t.red,n=t.green,r=t.blue;d("red",I.some(e)),d("green",I.some(n)),d("blue",I.some(r))},p=function(t,e){var n=e.event;"hex"!==n.type?d(n.type,I.none()):r(t)},h=function(t,e){n(t);var r=$T(e);d("hex",I.some(e));var o=fE(r);a(t,o),g(o),Sa(t,SB,{hex:r}),s(t,r)},v=function(t,e,n){var r=parseInt(n,10);d(e,I.some(r)),m().each((function(e){var n=u(t,e);Sa(t,SB,{hex:n}),s(t,n)}))},b=function(t){return"hex"===t.type},y=function(t,e){var n=e.event;b(n)?h(t,n.value):v(t,n.type,n.value)},w=function(e){return{label:t(LB+e+".label"),description:t(LB+e+".description")}},x=w("red"),C=w("green"),S=w("blue"),k=w("hex");return Co(BB.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",pD.sketch(i(cE,"red",x.label,x.description,255))),n.field("green",pD.sketch(i(cE,"green",C.label,C.description,255))),n.field("blue",pD.sketch(i(cE,"blue",S.label,S.description,255))),n.field("hex",pD.sketch(i(XT,"hex",k.label,k.description,"ffffff"))),c.asSpec()],formBehaviours:ml([dA.config({invalidClass:e("form-invalid")}),Vw("rgb-form-events",[Na(MB,y),Na(PB,p),Na(IB,p)])])}})),{apis:{updateHex:function(t,e){th.setValue(t,{hex:e.value}),f(t,e),s(t,e)}}})},l=dv({factory:f,name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return l},zB=function(t,e){var n=CB.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=CB.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}},i=function(t,e){var n=t.components()[0].element.dom,r=xE(e,100,100),i=sE(r);o(n,mE(i))},u=function(t,e){var n=CE(fE(e));CB.setValue(t,{x:n.saturation,y:100-n.value})},a=function(t){var i=w({x:0,y:0}),u=function(t,e,n){Sa(t,OB,{value:n})},a=function(t,e,n,r){o(n.element.dom,mE(gE))},c=ml([bv.config({find:I.some}),Yw.config({})]);return CB.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:u,onInit:a,sliderBehaviours:c})},c=dv({factory:a,name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){i(e,n)},setThumb:function(t,e,n){u(e,n)}},extraApis:{}});return c},HB=function(t,e){var n=function(n){var r=FB(t,e,n.onValidHex,n.onInvalidHex),o=zB(t,e),i=function(t){return(100-t)/100*360},u=function(t){return 100-t/360*100},a={paletteRgba:ou(gE),paletteHue:ou(0)},c=kC(TB(t,e)),s=kC(o.sketch({})),f=kC(r.sketch({})),l=function(t,e,n){s.getOpt(t).each((function(t){o.setHue(t,n)}))},d=function(t,e){f.getOpt(t).each((function(t){r.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){CB.setValue(t,{y:u(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){o.setThumb(t,e)}))},p=function(t,e){var n=fE(t);a.paletteRgba.set(n),a.paletteHue.set(e)},h=function(t,e,n,r){p(e,n),G(r,(function(r){r(t,e,n)}))},v=function(){var t=[d];return function(e,n){var r=n.event.value,o=a.paletteHue.get(),i=xE(o,r.x,100-r.y),u=kE(i);h(e,u,o,t)}},b=function(){var t=[l,d];return function(e,n){var r=i(n.event.value.y),o=a.paletteRgba.get(),u=CE(o),c=xE(r,u.saturation,u.value),s=kE(c);h(e,s,r,t)}},y=function(){var t=[l,m,g];return function(e,n){var r=n.event.hex,o=SE(r);h(e,r,o.hue,t)}};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),f.asSpec()],behaviours:ml([Vw("colour-picker-events",[Na(SB,y()),Na(OB,v()),Na(kB,b())]),bv.config({find:function(t){return f.getOpt(t)}}),Dw.config({mode:"acyclic"})])}},r=dv({name:"ColourPicker",configFields:[Di("dom"),Ki("onValidHex",h),Ki("onInvalidHex",h)],factory:n});return r},VB=function(){return bv.config({find:I.some})},UB=function(t){return bv.config({find:t.getOpt})},jB=function(t){return bv.config({find:function(e){return Cn(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},WB={self:VB,memento:UB,childAt:jB},qB={"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"},$B=function(t){return qB[t]},GB=function(t){return $B(t)},KB=function(t){var e=function(t){return"tox-"+t},n=HB(GB,e),r=function(t){Sa(t,AD,{name:"hex-valid",value:!0})},o=function(t){Sa(t,AD,{name:"hex-valid",value:!1})},i=kC(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:r,onInvalidHex:o}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:ml([th.config({store:{mode:"manual",getValue:function(t){var e=i.get(t),n=bv.getCurrent(e),r=n.bind((function(t){var e=th.getValue(t);return e.hex}));return r.map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,r=n.exec(e),o=i.get(t),u=bv.getCurrent(o);u.fold((function(){}),(function(t){th.setValue(t,{hex:I.from(r[1]).getOr("")}),BB.getField(t,"hex").each((function(t){Ca(t,Uu())}))}))}}}),WB.self()])}},XB=tinymce.util.Tools.resolve("tinymce.Resource"),YB=function(t){return Et(t,"init")},JB=function(t){var e=od(),n=kC({dom:{tag:t.tag}}),r=od();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ml([Vw("custom-editor-events",[Ua((function(o){n.getOpt(o).each((function(n){(YB(t)?t.init(n.element.dom):XB.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)}))).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),th.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),WB.self()]),components:[n.asSpec()]}},QB=tinymce.util.Tools.resolve("tinymce.util.Tools"),ZB=ti([Ki("preprocess",x),Ki("postprocess",x)]),tM=function(t,e){var n=Ci("RepresentingConfigs.memento processors",ZB,e);return th.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=th.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);th.setValue(i,o)}}})},eM=function(t,e,n){return th.config(Co({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},nM=function(t,e,n){return eM(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},rM=function(t){return nM(t,ds,ms)},oM=function(t){return nM(t,Ga,Ka)},iM=function(t){return th.config({store:{mode:"memory",initialValue:t}})},uM={memento:tM,withElement:nM,withComp:eM,domValue:rM,domHtml:oM,memory:iM},aM="jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",cM=function(t,e){var n=QB.explode(e.getSetting("images_file_types",aM,"string")),r=function(t){return j(n,(function(e){return Wt(t.name.toLowerCase(),"."+e.toLowerCase())}))};return Y(mt(t),r)},sM=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){G(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Lv.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){th.setValue(n,cM(r,e)),Sa(n,ED,{name:t.name})},a=kC({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ml([Vw("input-file-events",[za(Wu()),za(ra())])])}),c=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ml([uM.memory([]),WB.self(),Lv.config({}),px.config({toggleClass:"dragenter",toggleOnExecute:!1}),Vw("dropzone-events",[Na("dragenter",r([n,px.toggle])),Na("dragleave",r([n,px.toggle])),Na("dragover",n),Na("drop",r([n,o])),Na(ju(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},SC.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){var e=a.get(t);e.element.dom.click()},buttonBehaviours:ml([yD.config({}),mT.button(e.isDisabled),cT()])})]}]}},s=t.label.map((function(t){return TD(t,e)})),f=pD.parts.field({factory:{sketch:c}});return xD(s,f,["tox-form__group--stretched"],[])},fM=function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:$(t.items,e.interpreter)}},lM=oc("alloy-fake-before-tabstop"),dM=oc("alloy-fake-after-tabstop"),mM=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ml([Yw.config({ignore:!0}),yD.config({})])}},gM=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[mM([lM]),t,mM([dM])],behaviours:ml([WB.childAt(1)])}},pM=function(t,e){Sa(t,Hu(),{raw:{which:9,shiftKey:e}})},hM=function(t,e){var n=e.element;cs(n,lM)?pM(t,!0):cs(n,dM)&&pM(t,!1)},vM=function(t){return I_(t,["."+lM,"."+dM].join(","),T)},bM=!(en().browser.isIE()||en().browser.isEdge()),yM=function(t){var e=ou("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Hn(n.element,"srcdoc",r);else{Hn(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}},wM=function(t,e){var n=bM&&t.sandboxed,r=D(D({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=yM(n),i=t.label.map((function(t){return TD(t,e)})),u=function(t){return gM({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:ml([yD.config({}),Yw.config({}),uM.withComp(I.none(),o.getValue,o.setValue)])})},a=pD.parts.field({factory:{sketch:u}});return xD(i,a,["tox-form__group--stretched"],[])},xM=function(t,e){return kM(document.createElement("canvas"),t,e)},CM=function(t){var e=xM(t.width,t.height),n=SM(e);return n.drawImage(t,0,0),e},SM=function(t){return t.getContext("2d")},kM=function(t,e,n){return t.width=e,t.height=n,t},OM=function(t){return t.naturalWidth||t.width},TM=function(t){return t.naturalHeight||t.height},EM=function(t){return new $D((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))},_M=function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return I.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),f=0;f<c;++f){for(var l=f*i,d=Math.min(l+i,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);s[f]=new Uint8Array(m)}return I.some(new Blob(s,{type:r}))},DM=function(t){return new $D((function(e,n){_M(t).fold((function(){n("uri is not base64: "+t)}),e)}))},AM=function(t,e,n){return e=e||"image/png",m(HTMLCanvasElement.prototype.toBlob)?new $D((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):DM(t.toDataURL(e,n))},RM=function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)},NM=function(t){return EM(t).then((function(t){MM(t);var e=xM(OM(t),TM(t)),n=SM(e);return n.drawImage(t,0,0),e}))},BM=function(t){return new $D((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))},MM=function(t){URL.revokeObjectURL(t.src)},PM=function(t,e,n){var r=e.type,o=w(r),i=function(){return $D.resolve(e)},u=w(n),a=function(){return n.split(",")[1]},c=function(e,n){return t.then((function(t){return AM(t,e,n)}))},s=function(e,n){return t.then((function(t){return RM(t,e,n)}))},f=function(t,e){return s(t,e).then((function(t){return t.split(",")[1]}))},l=function(){return t.then(CM)};return{getType:o,toBlob:i,toDataURL:u,toBase64:a,toAdjustedBlob:c,toAdjustedDataURL:s,toAdjustedBase64:f,toCanvas:l}},IM=function(t){return BM(t).then((function(e){return PM(NM(t),t,e)}))},LM=function(t,e){return AM(t,e).then((function(e){return PM($D.resolve(t),e,t.toDataURL())}))},FM=function(t){return IM(t)},zM=function(t,e,n){var r="string"===typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},HM=function(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]},VM=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],UM=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o},jM=function(t,e){var n;return e=zM(e,-1,1),e*=100,e<0?n=127+e/100*127:(n=e%1,n=0===n?VM[e]:VM[Math.floor(e)]*(1-n)+VM[Math.floor(e)+1]*n,n=127*n+127),UM(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])},WM=function(t,e){return e=zM(255*e,-255,255),UM(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])},qM=function(t,e,n,r){return e=zM(e,0,2),n=zM(n,0,2),r=zM(r,0,2),UM(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])},$M=function(t,e){return t.toCanvas().then((function(n){return GM(n,t.getType(),e)}))},GM=function(t,e,n){var r=SM(t),o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],f=e[3],l=e[4],d=e[5],m=e[6],g=e[7],p=e[8],h=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],E=0;E<u.length;E+=4)n=u[E],r=u[E+1],o=u[E+2],i=u[E+3],u[E]=n*a+r*c+o*s+i*f+l,u[E+1]=n*d+r*m+o*g+i*p+h,u[E+2]=n*v+r*b+o*y+i*w+x,u[E+3]=n*C+r*S+o*k+i*O+T;return t},i=o(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(i,0,0),LM(t,e)},KM=function(t,e){return t.toCanvas().then((function(n){return XM(n,t.getType(),e)}))},XM=function(t,e,n){var r=SM(t),o=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,f=0;f<s;f++)for(var l=0;l<c;l++){for(var d=0,m=0,g=0,p=0;p<o;p++)for(var h=0;h<o;h++){var v=r(l+h-i,0,c-1),b=r(f+p-i,0,s-1),y=4*(b*c+v),w=n[p*o+h];d+=u[y]*w,m+=u[y+1]*w,g+=u[y+2]*w}var x=4*(f*c+l);a[x]=r(d,0,255),a[x+1]=r(m,0,255),a[x+2]=r(g,0,255)}return e},i=r.getImageData(0,0,t.width,t.height),u=r.getImageData(0,0,t.width,t.height);return u=o(i,u,n),r.putImageData(u,0,0),LM(t,e)},YM=function(t){var e=function(e,n,r){for(var o=SM(e),i=new Array(256),u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t},a=0;a<i.length;a++)i[a]=t(a,r);var c=u(o.getImageData(0,0,e.width,e.height),i);return o.putImageData(c,0,0),LM(e,n)};return function(t,n){return t.toCanvas().then((function(r){return e(r,t.getType(),n)}))}},JM=function(t){return function(e,n){return $M(e,t(HM(),n))}},QM=function(t){return function(e){return $M(e,t)}},ZM=function(t){return function(e){return KM(e,t)}},tP=QM([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),eP=JM(WM),nP=JM(jM),rP=function(t,e,n,r){return $M(t,qM(HM(),e,n,r))},oP=ZM([0,-1,0,-1,5,-1,0,-1,0]),iP=YM((function(t,e){return 255*Math.pow(t/255,1-e)})),uP=function(t,e,n){var r=OM(t),o=TM(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=aP(t,i,u);return a?c.then((function(t){return uP(t,e,n)})):c},aP=function(t,e,n){return new $D((function(r){var o=OM(t),i=TM(t),u=Math.floor(o*e),a=Math.floor(i*n),c=xM(u,a),s=SM(c);s.drawImage(t,0,0,o,i,0,0,u,a),r(c)}))},cP=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},sP=function(t,e){return t.toCanvas().then((function(n){return fP(n,t.getType(),e)}))},fP=function(t,e,n){var r=n<0?360+n:n,o=r*Math.PI/180,i=t.width,u=t.height,a=Math.sin(o),c=Math.cos(o),s=cP(Math.abs(i*c)+Math.abs(u*a)),f=cP(Math.abs(i*a)+Math.abs(u*c)),l=xM(s,f),d=SM(l);return d.translate(s/2,f/2),d.rotate(o),d.drawImage(t,-i/2,-u/2),LM(l,e)},lP=function(t,e){return t.toCanvas().then((function(n){return dP(n,t.getType(),e)}))},dP=function(t,e,n){var r=xM(t.width,t.height),o=SM(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),LM(r,e)},mP=function(t,e,n,r,o){return t.toCanvas().then((function(i){return gP(i,t.getType(),e,n,r,o)}))},gP=function(t,e,n,r,o,i){var u=xM(o,i),a=SM(u);return a.drawImage(t,-n,-r),LM(u,e)},pP=function(t,e,n){return t.toCanvas().then((function(r){return uP(r,e,n).then((function(e){return LM(e,t.getType())}))}))},hP=function(t){return tP(t)},vP=function(t){return oP(t)},bP=function(t,e){return iP(t,e)},yP=function(t,e,n,r){return rP(t,e,n,r)},wP=function(t,e){return eP(t,e)},xP=function(t,e){return nP(t,e)},CP=function(t,e){return lP(t,e)},SP=function(t,e,n,r,o){return mP(t,e,n,r,o)},kP=function(t,e,n){return pP(t,e,n)},OP=function(t,e){return sP(t,e)},TP=function(t,e,n){return IC(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},EP=function(t,e){return TP(t,e,[])},_P=function(t,e){return TP(t,e,[zw.config({})])},DP=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:ml([zw.config({})])}},AP=oc("toolbar.button.execute"),RP=function(t){return qa((function(e,n){gT(t,e)((function(n){Sa(e,AP,{buttonApi:n}),t.onAction(n)}))}))},NP=(xA={},xA[ea()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],xA),BP=oc("update-menu-text"),MP=oc("update-menu-icon"),PP=function(t,e,n){var r=ou(h),o=t.text.map((function(t){return kC(DP(t,e,n.providers))})),i=t.icon.map((function(t){return kC(_P(t,n.providers.icons))})),u=function(t,e){var n=th.getValue(t);return Yw.focus(n),Sa(n,"keydown",{raw:e.event.raw}),LA.close(n),I.some(!0)},a=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=IC("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons),f=kC(LA.sketch(D(D(D({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat($(t.classes,(function(t){return e+"--"+t}))),attributes:D({},c)},components:yT([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),I.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ml(R(R([],t.dropdownBehaviours,!0),[mT.button((function(){return t.disabled||n.providers.isDisabled()})),cT(),VA.config({}),zw.config({}),Vw("dropdown-events",[pT(t,r),hT(t,r)]),Vw("menubutton-update-display-text",[Na(BP,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){zw.set(t,[Ss(n.providers.translate(e.event.text))])}))})),Na(MP,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){zw.set(t,[_P(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:Co(NP,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ml([Dw.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:hk(!1,t.columns,t.presets)},fetch:function(e){return tA.nu(S(t.fetch,e))}})));return f.asSpec()},IP=function(t){return i(t)},LP=function(t){return"separator"===t.type},FP=function(t){return Et(t,"getSubmenuItems")},zP={type:"separator"},HP=function(t,e){var n=Q(t,(function(t,n){return IP(n)?""===n?t:"|"===n?t.length>0&&!LP(t[t.length-1])?t.concat([zP]):t:Et(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&LP(n[n.length-1])&&n.pop(),n},VP=function(t,e){var n=t.getSubmenuItems(),r=WP(n,e),o=Co(r.menus,mu(t.value,r.items)),i=Co(r.expansions,mu(t.value,t.value));return{item:t,menus:o,expansions:i}},UP=function(t,e){return FP(t)?VP(t,e):{item:t,menus:{},expansions:{}}},jP=function(t){if(LP(t))return t;var e=Tt(t,"value").getOrThunk((function(){return oc("generated-menu-item")}));return Co({value:e},t)},WP=function(t,e){var n=HP(i(t)?t.split(" "):t,e);return J(n,(function(t,n){var r=jP(n),o=UP(r,e);return{menus:Co(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Co(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},qP=function(t,e,n,r){var o=oc("primary-menu"),i=WP(t,n.shared.providers.menuItems());if(0===i.items.length)return I.none();var u=R_(o,i.items,e,n,r),a=bt(i.menus,(function(t,r){return R_(r,t,e,n,!1)})),c=Co(a,mu(o,u));return I.from(Qx.tieredData(o,c,i.expansions))},$P=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)},setActive:function(e){var n=t.element;e?(is(n,"tox-tbtn--enabled"),Hn(n,"aria-pressed",!0)):(as(n,"tox-tbtn--enabled"),qn(n,"aria-pressed"))},isActive:function(){return cs(t.element,"tox-tbtn--enabled")}}},GP=function(t,e,n,r){return PP({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(qP(t,jS.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:$P,columns:1,presets:"normal",classes:[],dropdownBehaviours:[yD.config({})]},e,n.shared)},KP=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Sl(e.element),Sa(e,AD,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e($(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return D(D({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},XP=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=D({buttonBehaviours:ml([mT.button((function(){return t.disabled||i.isDisabled()})),cT(),yD.config({}),Vw("button press",[Ra("click"),Ra("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Co(a,{dom:r});return Co(c,{components:o})},YP=function(t,e,n,r){void 0===r&&(r=[]);var o=t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({}),i={tag:"button",classes:["tox-tbtn"],attributes:o},u=t.icon.map((function(t){return EP(t,n.icons)})),a=yT([u]);return XP(t,e,r,i,a,n)},JP=function(t,e,n,r){void 0===r&&(r=[]);var o=YP(t,I.some(e),n,r);return SC.sketch(o)},QP=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return EP(t,n.icons)})):I.none(),a=u.isSome()?yT([u]):[],c=u.isSome()?{}:{innerHtml:i},s=R(R(R(R([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),f=D(D({tag:"button",classes:s},c),{attributes:{title:i}});return XP(t,e,r,f,a,n)},ZP=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=QP(t,I.some(e),n,r,o);return SC.sketch(i)},tI=function(t,e){return function(n){"custom"===e?Sa(n,AD,{name:t,value:{}}):"submit"===e?Ca(n,RD):"cancel"===e&&Ca(n,DD)}},eI=function(t,e){return"menu"===e},nI=function(t,e){return"custom"===e||"cancel"===e||"submit"===e},rI=function(t,e,n){if(eI(t,e)){var r=function(){return u},o=t,i=D(D({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:KP(o.items,r,n)}),u=kC(GP(i,"tox-tbtn",n,I.none()));return u.asSpec()}if(nI(t,e)){var a=tI(t.name,e),c=D(D({},t),{borderless:!1});return ZP(c,a,n.shared.providers,[])}},oI=function(t,e){var n=tI(t.name,"custom");return CD(I.none(),pD.parts.field(D({factory:SC},QP(t,I.some(n),e,[uM.memory(""),WB.self()]))))},iI=w([Ki("field1Name","field1"),Ki("field2Name","field2"),ff("onLockedChange"),uf(["lockClass"]),Ki("locked",!1),oh.field("coupledFieldBehaviours",[bv,th])]),uI=function(t,e,n){return Kh(t,e,n).bind(bv.getCurrent)},aI=function(t,e){return Bh({factory:pD,name:t,overrides:function(t){return{fieldBehaviours:ml([Vw("coupled-input-behaviour",[Na(Uu(),(function(n){uI(n,t,e).each((function(e){Kh(n,t,"lock").each((function(r){px.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},cI=w([aI("field1","field2"),aI("field2","field1"),Bh({factory:SC,schema:[Di("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ml([px.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),sI=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:oh.augment(t.coupledFieldBehaviours,[bv.config({find:I.some}),th.config({store:{mode:"manual",getValue:function(e){var n,r=Zh(e,t,["field1","field2"]);return n={},n[t.field1Name]=th.getValue(r.field1()),n[t.field2Name]=th.getValue(r.field2()),n},setValue:function(e,n){var r=Zh(e,t,["field1","field2"]);_t(n,t.field1Name)&&th.setValue(r.field1(),n[t.field1Name]),_t(n,t.field2Name)&&th.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Kh(e,t,"field1")},getField2:function(e){return Kh(e,t,"field2")},getLock:function(e){return Kh(e,t,"lock")}}}},fI=mv({name:"FormCoupledInputs",configFields:iI(),partFields:cI(),factory:sI,apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),lI=function(t){var e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},n=function(t){return t in e?e[t]:1},r=t.value.toFixed(n(t.unit));return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit},dI=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,n=e.exec(t);if(null!==n){var r=parseFloat(n[1]),o=n[2];return ro.value({value:r,unit:o})}return ro.error(t)},mI=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Et(n,t)};return t.unit===e?I.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?I.some(t.value):I.some(t.value/n[t.unit]*n[e]):I.none()},gI=function(t){return I.none()},pI=function(t,e){return function(n){return mI(n,e).map((function(n){return{value:n*t,unit:e}}))}},hI=function(t,e){var n=dI(t).toOptional(),r=dI(e).toOptional();return Bt(n,r,(function(t,e){return mI(t,e.unit).map((function(t){return e.value/t})).map((function(t){return pI(t,e.unit)})).getOr(gI)})).getOr(gI)},vI=function(t,e){var n=gI,r=oc("ratio-event"),o=function(t){return IC(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=fI.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cT(),yD.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return pD.parts.field({factory:UD,inputClasses:["tox-textfield"],inputBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cT(),yD.config({}),Vw("size-input-events",[Na(Fu(),(function(t,e){Sa(t,r,{isField1:n})})),Na(ju(),(function(e,n){Sa(e,ED,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=fI.parts.field1(u([pD.parts.label(c("Width")),a(!0)])),f=fI.parts.field2(u([pD.parts.label(c("Height")),a(!1)]));return fI.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,f,u([c("&nbsp;"),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){dI(th.getValue(t)).each((function(t){n(t).each((function(t){th.setValue(e,lI(t))}))}))},coupledFieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){fI.getField1(t).bind(pD.getField).each(Lv.disable),fI.getField2(t).bind(pD.getField).each(Lv.disable),fI.getLock(t).each(Lv.disable)},onEnabled:function(t){fI.getField1(t).bind(pD.getField).each(Lv.enable),fI.getField2(t).bind(pD.getField).each(Lv.enable),fI.getLock(t).each(Lv.enable)}}),cT(),Vw("size-input-events2",[Na(r,(function(t,e){var r=e.event.isField1,o=r?fI.getField1(t):fI.getField2(t),i=r?fI.getField2(t):fI.getField1(t),u=o.map(th.getValue).getOr(""),a=i.map(th.getValue).getOr("");n=hI(u,a)}))])])})},bI=w(oc("undo")),yI=w(oc("redo")),wI=w(oc("zoom")),xI=w(oc("back")),CI=w(oc("apply")),SI=w(oc("swap")),kI=w(oc("transform")),OI=w(oc("temp-transform")),TI=w(oc("transform-apply")),EI={undo:bI,redo:yI,zoom:wI,back:xI,apply:CI,swap:SI,transform:kI,tempTransform:OI,transformApply:TI},_I=w("save-state"),DI=w("disable"),AI=w("enable"),RI={formActionEvent:AD,saveState:_I,disable:DI,enable:AI},NI=function(t,e){var n=function(t,n,r,o){return kC(ZP({name:t,text:t,disabled:r,primary:o,icon:I.none(),borderless:!1},n,e))},r=function(t,n,r,o){return kC(JP({name:t,icon:I.some(t),tooltip:I.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Lv)&&Lv.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Lv)&&Lv.enable(n)}))},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=h,c=function(t,e,n){Sa(t,e,n)},s=function(t){return Ca(t,RI.disable())},f=function(t){return Ca(t,RI.enable())},l=function(t,e){s(t),c(t,EI.transform(),{transform:e}),f(t)},d=function(t,e){s(t),c(t,EI.tempTransform(),{transform:e}),f(t)},m=function(t){return function(){ut.getOpt(t).each((function(t){zw.set(t,[ot])}))}},g=function(t,e){s(t),c(t,EI.transformApply(),{transform:e,swap:m(t)}),f(t)},p=function(){return n("Back",(function(t){return c(t,EI.back(),{swap:m(t)})}),!1,!1)},v=function(){return kC({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ml([Lv.config({})])})},b=function(){return n("Apply",(function(t){return c(t,EI.apply(),{swap:m(t)})}),!0,!0)},y=function(){return function(e){var n=t.getRect();return SP(e,n.x,n.y,n.w,n.h)}},x=[p(),v(),n("Apply",(function(e){var n=y();g(e,n),t.hideCrop()}),!1,!0)],C=sD.sketch({dom:u,components:x.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-crop-buttons-events",[Na(RI.disable(),(function(t,e){o(x,t)})),Na(RI.enable(),(function(t,e){i(x,t)}))])])}),S=kC(vI({name:"size",label:I.none(),constrain:!0,disabled:!1},e)),k=function(t,e){return function(n){return kP(n,t,e)}},O=[p(),v(),S,v(),n("Apply",(function(t){S.getOpt(t).each((function(e){var n=th.getValue(e),r=parseInt(n.width,10),o=parseInt(n.height,10),i=k(r,o);g(t,i)}))}),!1,!0)],T=sD.sketch({dom:u,components:O.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-resize-buttons-events",[Na(RI.disable(),(function(t,e){o(O,t)})),Na(RI.enable(),(function(t,e){i(O,t)}))])])}),E=function(t,e){return function(n){return t(n,e)}},_=E(CP,"h"),D=E(CP,"v"),A=E(OP,-90),R=E(OP,90),N=function(t,e){d(t,e)},B=[p(),v(),r("flip-horizontally","Flip horizontally",(function(t){N(t,_)}),!1),r("flip-vertically","Flip vertically",(function(t){N(t,D)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){N(t,A)}),!1),r("rotate-right","Rotate clockwise",(function(t){N(t,R)}),!1),v(),b()],M=sD.sketch({dom:u,components:B.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-fliprotate-buttons-events",[Na(RI.disable(),(function(t,e){o(B,t)})),Na(RI.enable(),(function(t,e){i(B,t)}))])])}),P=function(t,n,r,o,i){var u=CB.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),a=CB.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=CB.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return kC(CB.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:w({x:o})},components:[u,a,c],sliderBehaviours:ml([Yw.config({})]),onChoose:n}))},L=function(t,e,n,r,o){var i=function(t,n,r){var o=E(e,r.x/100);l(t,o)};return P(t,i,n,r,o)},F=function(t,e,n,r,o){return[p(),L(t,e,n,r,o),b()]},z=function(t,e,n,r,a){var c=F(t,e,n,r,a);return sD.sketch({dom:u,components:c.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-filter-panel-buttons-events",[Na(RI.disable(),(function(t,e){o(c,t)})),Na(RI.enable(),(function(t,e){i(c,t)}))])])})},H=[p(),v(),b()],V=sD.sketch({dom:u,components:H.map((function(t){return t.asSpec()}))}),U=z("Brightness",wP,-100,0,100),j=z("Contrast",xP,-100,0,100),W=z("Gamma",bP,-100,0,100),q=function(t,e,n){return function(r){return yP(r,t,e,n)}},$=function(t){var e=function(t,e,n){var r=G.getOpt(t),o=X.getOpt(t),i=K.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=th.getValue(e).x/100,i=th.getValue(r).x/100,u=th.getValue(n).x/100,a=q(o,i,u);l(t,a)}))}))}))};return P(t,e,0,100,200)},G=$("R"),K=$("G"),X=$("B"),Y=[p(),G,K,X,b()],J=sD.sketch({dom:u,components:Y.map((function(t){return t.asSpec()}))}),Q=function(t,e,n){return function(r){var o=function(){ut.getOpt(r).each((function(e){zw.set(e,[t]),n(e)}))};c(r,EI.swap(),{transform:e,swap:o})}},Z=function(e){t.showCrop()},tt=function(e){S.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;th.setValue(e,{width:r,height:o})}))},et=I.some(vP),nt=I.some(hP),rt=[r("crop","Crop",Q(C,I.none(),Z),!1),r("resize","Resize",Q(T,I.none(),tt),!1),r("orientation","Orientation",Q(M,I.none(),a),!1),r("brightness","Brightness",Q(U,I.none(),a),!1),r("sharpen","Sharpen",Q(V,et,a),!1),r("contrast","Contrast",Q(j,I.none(),a),!1),r("color-levels","Color levels",Q(J,I.none(),a),!1),r("gamma","Gamma",Q(W,I.none(),a),!1),r("invert","Invert",Q(V,nt,a),!1)],ot=sD.sketch({dom:u,components:rt.map((function(t){return t.asSpec()}))}),it=sD.sketch({dom:{tag:"div"},components:[ot],containerBehaviours:ml([zw.config({})])}),ut=kC(it),at=function(t){return ut.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))};return{memContainer:ut,getApplyButton:at}},BI=tinymce.util.Tools.resolve("tinymce.geom.Rect"),MI=tinymce.util.Tools.resolve("tinymce.util.Observable"),PI=tinymce.util.Tools.resolve("tinymce.util.VK"),II=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight),s=e(n.offsetHeight,r.offsetHeight);return{width:o<u?i:o,height:a<s?c:a}},LI=function(t){return d(t.changedTouches)},FI=function(t){if(LI(t))for(var e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};function zI(t,e){var n,r,o,i,u,a,c,s=[],f=[],l=null!==(n=e.document)&&void 0!==n?n:document,m=null!==(r=e.root)&&void 0!==r?r:l,g=ee.fromDom(l),p=ee.fromDom(m.getElementById(null!==(o=e.handle)&&void 0!==o?o:t)),h=function(t){var n=t.raw,r=II(l);FI(n),t.prevent(),u=n.button,a=n.screenX,c=n.screenY;var o=Jn(p,"cursor");i=ee.fromTag("div",l),Xn(i,{position:"absolute",top:"0",left:"0",width:r.width+"px",height:r.height+"px","z-index":"2147483647",opacity:"0.0001",cursor:o}),Ar(Fn(g),i),f.push(ud(g,"mousemove",v),ud(g,"touchmove",v),ud(g,"mouseup",b),ud(g,"touchend",b)),e.start(n)},v=function(t){var n=t.raw;if(FI(n),n.button!==u)return b(t);n.deltaX=n.screenX-a,n.deltaY=n.screenY-c,t.prevent(),e.drag(n)},b=function(t){FI(t.raw),G(f,(function(t){return t.unbind()})),f=[],Pr(i),e.stop&&e.stop(t.raw)},y=function(){G(f.concat(s),(function(t){return t.unbind()})),f=[],s=[],d(i)&&Pr(i)};return s.push(ud(p,"mousedown",h),ud(p,"touchstart",h)),{destroy:y}}var HI=0,VI=function(t,e,n,r,o){var i,u=[],a="tox-",c=a+"crid-"+HI++,s=ee.fromDom(r),f=[{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"}],l=["top","right","bottom","left"],d=function(t,e){return{x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},m=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},g=function(){return m(n,t)},p=function(e,r,o,i){var u=r.x+o*e.deltaX,a=r.y+i*e.deltaY,c=Math.max(20,r.w+o*e.deltaW),s=Math.max(20,r.h+i*e.deltaH),f=t=BI.clamp({x:u,y:a,w:c,h:s},n,"move"===e.name);f=m(n,f),k.fire("updateRect",{rect:f}),x(f)},h=function(){var e=function(e){var n;return zI(c,{document:r.ownerDocument,root:Dn(s).dom,handle:c+"-"+e.name,start:function(){n=t},drag:function(t){p(e,n,t.deltaX,t.deltaY)}})},n=ee.fromTag("div");Vn(n,{id:c,class:a+"croprect-container",role:"grid","aria-dropeffect":"execute"}),Ar(s,n),G(l,(function(t){Fs(s,"#"+c).each((function(e){var n=ee.fromTag("div");Vn(n,{id:c+"-"+t,class:a+"croprect-block","data-mce-bogus":"all"}),Kn(n,"display","none"),Ar(e,n)}))})),G(f,(function(t){Fs(s,"#"+c).each((function(e){var n=ee.fromTag("div");Vn(n,{id:c+"-"+t.name,"aria-label":t.label,"aria-grabbed":"false","data-mce-bogus":"all",role:"gridcell",tabindex:"-1",title:t.label}),ss(n,[a+"croprect-handle",a+"croprect-handle-"+t.name]),Kn(n,"display","none"),Ar(e,n)}))})),i=$(f,e),b(t);var d=function(t){Hn(t.target,"aria-grabbed","focus"===t.raw.type?"true":"false")},m=function(e){var n;G(f,(function(t){if(Un(e.target,"id")===c+"-"+t.name)return n=t,!1}));var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),p(n,r,o,i)};switch(e.raw.keyCode){case PI.LEFT:r(e,n,t,-10,0);break;case PI.RIGHT:r(e,n,t,10,0);break;case PI.UP:r(e,n,t,0,-10);break;case PI.DOWN:r(e,n,t,0,10);break;case PI.ENTER:case PI.SPACEBAR:e.prevent(),o();break}};u.push(ud(s,"focusin",d),ud(s,"focusout",d),ud(s,"keydown",m))},v=function(t){var e=R(R([],$(f,(function(t){return"#"+c+"-"+t.name})),!0),$(l,(function(t){return"#"+c+"-"+t})),!0).join(","),n=Xm(s,e);G(n,t?function(t){return nr(t,"display")}:function(t){return Kn(t,"display","none")})},b=function(t){var n=function(t,e){Fs(s,"#"+c+"-"+t).each((function(t){Xn(t,{left:e.x+"px",top:e.y+"px",width:Math.max(0,e.w)+"px",height:Math.max(0,e.h)+"px"})}))};G(f,(function(e){Fs(s,"#"+c+"-"+e.name).each((function(n){Xn(n,{left:t.w*e.xMul+t.x+"px",top:t.h*e.yMul+t.y+"px"})}))})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},y=function(e){t=e,b(t)},w=function(n){e=n,b(t)},x=function(t){y(d(n,t))},C=function(e){n=e,b(t)},S=function(){G(i,(function(t){return t.destroy()})),i=[],G(u,(function(t){return t.unbind()})),u=[]};h();var k=D(D({},MI),{toggleVisibility:v,setClampRect:C,setRect:y,getInnerRect:g,setInnerRect:x,setViewPortRect:w,destroy:S});return k},UI={create:VI},jI=function(t){return new uS((function(e){var n=function(){t.removeEventListener("load",n),e(t)};t.complete?e(t):t.addEventListener("load",n)}))},WI=function(t){var e=kC({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=ou(1),r=rd(),o=ou({x:0,y:0,w:1,h:1}),i=ou({x:0,y:0,w:1,h:1}),u=function(t,i){g.getOpt(t).each((function(t){var u=n.get(),a=vr(t.element),c=ur(t.element),s=i.dom.naturalWidth*u,f=i.dom.naturalHeight*u,l=Math.max(0,a/2-s/2),d=Math.max(0,c/2-f/2),m={left:l.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:f.toString()+"px",position:"absolute"};Xn(i,m),e.getOpt(t).each((function(t){Xn(t.element,m)})),r.run((function(t){var e=o.get();t.setRect({x:e.x*u+l,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:l,y:d,w:s,h:f}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){g.getOpt(t).each((function(t){var r=vr(t.element),o=ur(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))},c=function(t,e){var n=ee.fromTag("img");return Hn(n,"src",e),jI(n.dom).then((function(){t.getSystem().isConnected()&&g.getOpt(t).map((function(t){var e=ks({element:n});zw.replaceAt(t,1,I.some(e));var r=i.get(),c={x:0,y:0,w:n.dom.naturalWidth,h:n.dom.naturalHeight};i.set(c);var s=BI.inflate(c,-20,-20);o.set(s),r.w===c.w&&r.h===c.h||a(t,n),u(t,n)}))}))},s=function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),g.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},f=function(){r.run((function(t){t.toggleVisibility(!0)}))},l=function(){r.run((function(t){t.toggleVisibility(!1)}))},d=function(){return o.get()},m=sD.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ml([Vw("image-panel-crop-events",[Ua((function(t){g.getOpt(t).each((function(t){var e=t.element.dom,i=UI.create({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,h);i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(i)}))})),ja((function(){r.clear()}))])])}],containerBehaviours:ml([zw.config({}),Vw("image-panel-events",[Ua((function(e){c(e,t)}))])])}),g=kC(m),p=function(){var t=i.get();return{width:t.w,height:t.h}};return{memContainer:g,updateSrc:c,zoom:s,showCrop:f,hideCrop:l,getRect:d,getMeasurements:p}},qI=function(t,e,n,r,o){return JP({name:t,icon:I.some(e),disabled:n,tooltip:I.some(t),primary:!1,borderless:!1},r,o)},$I=function(t,e){e?Lv.enable(t):Lv.disable(t)},GI=function(t){var e=function(t,e,o){n.getOpt(t).each((function(t){$I(t,e)})),r.getOpt(t).each((function(t){$I(t,o)}))},n=kC(qI("Undo","undo",!0,(function(t){Sa(t,EI.undo(),{direction:1})}),t)),r=kC(qI("Redo","redo",!0,(function(t){Sa(t,EI.redo(),{direction:1})}),t)),o=sD.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[n.asSpec(),r.asSpec(),qI("Zoom in","zoom-in",!1,(function(t){Sa(t,EI.zoom(),{direction:1})}),t),qI("Zoom out","zoom-out",!1,(function(t){Sa(t,EI.zoom(),{direction:-1})}),t)]});return{container:o,updateButtonUndoStates:e}};function KI(){var t=[],e=-1,n=function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},r=function(){if(i())return t[--e]},o=function(){if(u())return t[++e]},i=function(){return e>0},u=function(){return-1!==e&&e<t.length-1};return{data:t,add:n,undo:r,redo:o,canUndo:i,canRedo:u}}var XI,YI=function(t){var e=ou(t),n=od(),r=KI();r.add(t);var o=function(){return e.get()},i=function(t){e.set(t)},u=function(){return n.get().getOrThunk(e.get)},a=function(t){var e=c(t);return l(),n.set(e),e.url},c=function(t){return{blob:t,url:URL.createObjectURL(t)}},s=function(t){URL.revokeObjectURL(t.url)},f=function(t){QB.each(t,s)},l=function(){n.on(s),n.clear()},d=function(t){var e=c(t);i(e);var n=r.add(e).removed;return f(n),e.url},m=function(t){var e=c(t);return n.set(e),e.url},g=function(t){return n.get().fold(h,(function(e){d(e.blob),t()}))},p=function(){var t=r.undo();return i(t),t.url},v=function(){var t=r.redo();return i(t),t.url},b=function(){var t=r.canUndo(),e=r.canRedo();return{undoEnabled:t,redoEnabled:e}};return{getBlobState:o,setBlobState:i,addBlobState:d,getTempState:u,updateTempState:a,addTempState:m,applyTempState:g,destroyTempState:l,undo:p,redo:v,getHistoryStates:b}},JI=function(t,e){var n=YI(t.currentState),r=function(t,e){var n=e.event.direction;k.zoom(t,n)},o=function(t){var e=n.getHistoryStates();O.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Sa(t,RI.formActionEvent,{name:RI.saveState(),value:e.undoEnabled})},i=function(t){O.updateButtonUndoStates(t,!1,!1)},u=function(t,e){var r=n.undo();l(t,r).then((function(e){f(t),o(t)}))},a=function(t,e){var r=n.redo();l(t,r).then((function(e){f(t),o(t)}))},c=function(t){return t.toBlob()},s=function(t){Sa(t,RI.formActionEvent,{name:RI.disable(),value:{}})},f=function(t){T.getApplyButton(t).each((function(t){Lv.enable(t)})),Sa(t,RI.formActionEvent,{name:RI.enable(),value:{}})},l=function(t,e){return s(t),k.updateSrc(t,e)},d=function(t,e,n,r,i){s(t),FM(e).then(n).then(c).then(r).then((function(e){return l(t,e)})).then((function(){o(t),i(),f(t)})).catch((function(e){t.getSystem().isConnected()&&f(t)}))},m=function(t,e,r){var o=n.getBlobState().blob,i=function(t){return n.updateTempState(t)};d(t,o,e,i,r)},g=function(t,e){var r=n.getTempState().blob,o=function(t){return n.addTempState(t)};d(t,r,e,o,h)},p=function(t,e,r){var o=n.getBlobState().blob,i=function(e){var r=n.addBlobState(e);return b(t),r};d(t,o,e,i,r)},v=function(t,e){var r=function(){b(t);var n=e.event.swap;n()};n.applyTempState(r)},b=function(t){var e=n.getBlobState().url;return n.destroyTempState(),o(t),e},y=function(t){var e=b(t);l(t,e).then((function(e){f(t)}))},w=function(t,e){y(t);var n=e.event.swap;n(),k.hideCrop()},x=function(t,e){return m(t,e.event.transform,h)},C=function(t,e){return g(t,e.event.transform)},S=function(t,e){return p(t,e.event.transform,e.event.swap)},k=WI(t.currentState.url),O=GI(e),T=NI(k,e),E=function(t,e){i(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){m(t,e,r)}))};return{dom:{tag:"div",attributes:{role:"presentation"}},components:[T.memContainer.asSpec(),k.memContainer.asSpec(),O.container],behaviours:ml([th.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),Vw("image-tools-events",[Na(EI.undo(),u),Na(EI.redo(),a),Na(EI.zoom(),r),Na(EI.back(),w),Na(EI.apply(),v),Na(EI.transform(),x),Na(EI.tempTransform(),C),Na(EI.transformApply(),S),Na(EI.swap(),E)]),WB.self()])}},QI=function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=$(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:ml([WB.self(),zw.config({}),uM.domHtml(I.none()),Dw.config({mode:"acyclic"})])}},ZI=function(t){return!Et(t,"items")},tL="data-value",eL=function(t,e,n,r){return $(n,(function(n){return ZI(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){th.setValue(t,n.value),Sa(t,ED,{name:e}),Yw.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return eL(t,e,n.items,r)}}}))},nL=function(t,e){return gt(t,(function(t){return ZI(t)?It(t.value===e,t):nL(t.items,e)}))},rL=function(t,e){var n=e.shared.providers,r=lt(t.items).filter(ZI),o=t.label.map((function(t){return TD(t,n)})),i=pD.parts.field({dom:{},factory:{sketch:function(n){return PP({uid:n.uid,text:r.map((function(t){return t.text})),icon:I.none(),tooltip:t.label,role:I.none(),fetch:function(n,r){var o=eL(n,t.name,t.items,th.getValue(n));r(qP(o,jS.CLOSE_ON_EXECUTE,e,!1))},onSetup:w(h),getApi:w({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[yD.config({}),th.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return Un(t.element,tL)},setValue:function(e,n){nL(t.items,n).each((function(t){Hn(e.element,tL,t.value),Sa(e,BP,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}}),u={dom:{tag:"div",classes:["tox-listboxfield"]},components:[i]};return pD.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:nt([o.toArray(),[u]]),fieldBehaviours:ml([Lv.config({disabled:w(t.disabled),onDisabled:function(t){pD.getField(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable)}})])})},oL=function(t,e){return{dom:{tag:"div",classes:t.classes},components:$(t.items,e.shared.interpreter)}},iL=function(t,e){var n=$(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return mu("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:rh(t.selectBehaviours,[Yw.config({}),th.config({store:D({mode:"manual",getValue:function(t){return ds(t.element)},setValue:function(e,n){var r=tt(t.options,(function(t){return t.value===n}));r.isSome()&&ms(e.element,n)}},r)})])}},uL=dv({name:"HtmlSelect",configFields:[Di("options"),eh("selectBehaviours",[Yw,th]),Ki("selectClasses",[]),Ki("selectAttributes",{}),Hi("data")],factory:iL}),aL=function(t,e){var n=$(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return TD(t,e)})),o=pD.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:uL,selectBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),yD.config({}),Vw("selectbox-change",[Na(ju(),(function(e,n){Sa(e,ED,{name:t.name})}))])])}),i=t.size>1?I.none():I.some(IC("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:nt([[o],i.toArray()])};return pD.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:nt([r.toArray(),[u]]),fieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){pD.getField(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable)}}),cT()])})},cL=function(t,e){var n=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},r=function(t){return{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:$(t,n)}]}},o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"tr"},components:$(t,o)}},u=function(t){return{dom:{tag:"tbody"},components:$(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[r(t.header),u(t.cells)],behaviours:ml([yD.config({}),Yw.config({})])}},sL=function(t,e){var n=t.label.map((function(t){return TD(t,e)})),r=[Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cT(),Dw.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Ca(t,RD),I.some(!0)}}),Vw("textfield-change",[Na(Uu(),(function(e,n){Sa(e,ED,{name:t.name})})),Na(Zu(),(function(e,n){Sa(e,ED,{name:t.name})}))]),yD.config({})],o=t.validation.map((function(t){return dA.config({getRoot:function(t){return vn(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=th.getValue(e),r=t.validator(n);return tA.pure(!0===r?ro.value(n):ro.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(w({}),(function(t){return{placeholder:e.translate(t)}})),u=t.inputMode.fold(w({}),(function(t){return{inputmode:t}})),a=D(D({},i),u),c=pD.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:ml(nt([r,o])),selectOnFocus:!1,factory:UD}),s=t.flex?["tox-form__group--stretched"]:[],f=s.concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){pD.getField(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable)}}),cT()];return xD(n,c,f,l)},fL=function(t,e){return sL({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:I.none(),maximized:t.maximized},e)},lL=function(t,e){return sL({name:t.name,multiline:!0,label:t.label,inputMode:I.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:I.none(),maximized:t.maximized},e)},dL=function(t,e){var n=t.stream.streams,r=n.setup(t,e);return _a([Na(t.event,r),ja((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Na(t,(function(){return e.cancel()}))]})).getOr([])))},mL=Object.freeze({__proto__:null,events:dL}),gL=function(t){var e=ou(null),n=function(){return{timer:null!==e.get()?"set":"unset"}},r=function(t){e.set(t)},o=function(){var t=e.get();null!==t&&t.cancel()};return Oc({readState:n,setTimer:r,cancel:o})},pL=function(t){return t.stream.streams.state(t)},hL=Object.freeze({__proto__:null,throttle:gL,init:pL}),vL=function(t,e){var n=t.stream,r=WC(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},bL=[Ai("stream",ki("mode",{throttle:[Di("delay"),Ki("stopEvent",!0),df("streams",{setup:vL,state:gL})]})),Ki("event","input"),Hi("cancelEvent"),ff("onStream")],yL=pl({fields:bL,name:"streaming",active:mL,state:hL}),wL=function(t,e,n){var r=th.getValue(n);th.setValue(e,r),CL(e)},xL=function(t,e){var n=t.element,r=ds(n),o=n.dom;"number"!==Un(n,"type")&&e(o,r)},CL=function(t){xL(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},SL=function(t,e){xL(t,(function(t,n){return t.setSelectionRange(e,n.length)}))},kL=function(t,e,n){if(t.selectsOver){var r=th.getValue(e),o=t.getDisplayText(r),i=th.getValue(n),u=t.getDisplayText(i);return 0===u.indexOf(o)?I.some((function(){wL(t,e,n),SL(e,o.length)})):I.none()}return I.none()},OL=w("alloy.typeahead.itemexecute"),TL=function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=bA.getCoupled(e,"sandbox");if(bp.isOpen(i))bv.getCurrent(i).each((function(t){rb.getHighlighted(t).fold((function(){o(t)}),(function(){Ea(i,t.element,"keydown",n)}))}));else{var a=function(t){bv.getCurrent(t).each(o)};OA(t,u(e),e,i,r,a,qD.HighlightFirst).get(h)}},i=FD(t),u=function(t){return function(e){return e.map((function(e){var n=Ot(e.menus),r=rt(n,(function(t){return Y(t.items,(function(t){return"item"===t.type}))})),o=th.getState(t);return o.update($(r,(function(t){return t.data}))),e}))}},a=[Yw.config({}),th.config({onSetValue:t.onSetValue,store:D({mode:"dataset",getDataKey:function(t){return ds(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){ms(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return mu("initialValue",t)})).getOr({}))}),yL.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=bA.getCoupled(e,"sandbox"),i=Yw.isFocused(e);if(i&&ds(e.element).length>=t.minChars){var a=bv.getCurrent(o).bind((function(t){return rb.getHighlighted(t).map(th.getValue)}));t.previewing.set(!0);var c=function(e){bv.getCurrent(o).each((function(e){a.fold((function(){t.model.selectsOver&&rb.highlightFirst(e)}),(function(t){rb.highlightBy(e,(function(e){var n=th.getValue(e);return n.value===t.value})),rb.getHighlighted(e).orThunk((function(){return rb.highlightFirst(e),I.none()}))}))}))};OA(t,u(e),e,o,r,c,qD.HighlightFirst).get(h)}},cancelEvent:ua()}),Dw.config({mode:"special",onDown:function(t,e){return o(t,e,rb.highlightFirst),I.some(!0)},onEscape:function(t){var e=bA.getCoupled(t,"sandbox");return bp.isOpen(e)?(bp.close(e),I.some(!0)):I.none()},onUp:function(t,e){return o(t,e,rb.highlightLast),I.some(!0)},onEnter:function(e){var n=bA.getCoupled(e,"sandbox"),r=bp.isOpen(n);if(r&&!t.previewing.get())return bv.getCurrent(n).bind((function(t){return rb.getHighlighted(t)})).map((function(t){return Sa(e,OL(),{item:t}),!0}));var o=th.getValue(e);return Ca(e,ua()),t.onExecute(n,e,o),r&&bp.close(n),I.some(!0)}}),px.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),bA.config({others:{sandbox:function(e){return RA(t,e,{onOpen:function(){return px.on(e)},onClose:function(){return px.off(e)}})}}}),Vw("typeaheadevents",[qa((function(e){var n=h;EA(t,u(e),e,r,n,qD.HighlightFirst).get(h)})),Na(OL(),(function(e,n){var r=bA.getCoupled(e,"sandbox");wL(t.model,e,n.event.item),Ca(e,ua()),t.onItemExecute(e,r,n.event.item,th.getValue(e)),bp.close(r),CL(e)}))].concat(t.dismissOnBlur?[Na(Qu(),(function(t){var e=bA.getCoupled(t,"sandbox");El(e.element).isNone()&&bp.close(e)}))]:[]))];return{uid:t.uid,dom:HD(Co(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:D(D({},i),rh(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}},EL=w([Hi("lazySink"),Di("fetch"),Ki("minChars",5),Ki("responseTime",1e3),cf("onOpen"),Ki("getHotspot",I.some),Ki("getAnchorOverrides",w({})),Ki("layouts",I.none()),Ki("eventOrder",{}),ru("model",{},[Ki("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),Ki("selectsOver",!0),Ki("populateFromBrowse",!0)]),cf("onSetValue"),sf("onExecute"),cf("onItemExecute"),Ki("inputClasses",[]),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("matchWidth",!0),Ki("useMinWidth",!1),Ki("dismissOnBlur",!0),uf(["openClass"]),Hi("initialData"),eh("typeaheadBehaviours",[Yw,th,yL,Dw,px,bA]),Ei("previewing",(function(){return ou(!0)}))].concat(LD()).concat(BA())),_L=w([Mh({schema:[of()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){kL(t.model,r,n).fold((function(){return rb.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&wL(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Sa(t,OL(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&wL(t.model,e,n)}))}}}})]),DL=mv({name:"Typeahead",configFields:EL(),partFields:_L(),factory:TL}),AL=function(t){var e=function(){return AL(t.toCached())},n=function(e){return AL(t.bind((function(t){return t.fold((function(t){return tA.pure(ro.error(t))}),(function(t){return e(t)}))})))},r=function(e){return AL(t.map((function(t){return t.bind(e)})))},o=function(e){return AL(t.map((function(t){return t.map(e)})))},i=function(e){return AL(t.map((function(t){return t.mapError(e)})))},u=function(e,n){return t.map((function(t){return t.fold(e,n)}))},a=function(e,n){return AL(tA.nu((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ro.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))};return D(D({},t),{toCached:e,bindFuture:n,bindResult:r,mapResult:o,mapError:i,foldResult:u,withTimeout:a})},RL=function(t){return AL(tA.nu(t))},NL=function(t){return AL(tA.pure(ro.value(t)))},BL=function(t){return AL(tA.pure(ro.error(t)))},ML=function(t){return AL(tA.pure(t))},PL=function(t){return AL(t.map(ro.value))},IL=function(t){return RL((function(e){t.then((function(t){e(ro.value(t))}),(function(t){e(ro.error(t))}))}))},LL={nu:RL,wrap:AL,pure:NL,value:NL,error:BL,fromResult:ML,fromFuture:PL,fromPromise:IL},FL={type:"separator"},zL=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},HL=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},VL=function(t){return $(t,zL)},UL=function(t,e){return Y(e,(function(e){return e.type===t}))},jL=function(t,e){return VL(UL(t,e))},WL=function(t){return jL("header",t.targets)},qL=function(t){return jL("anchor",t.targets)},$L=function(t){return I.from(t.anchorTop).map((function(t){return HL("<top>",t)})).toArray()},GL=function(t){return I.from(t.anchorBottom).map((function(t){return HL("<bottom>",t)})).toArray()},KL=function(t){return $(t,(function(t){return HL(t,t)}))},XL=function(t){return Q(t,(function(t,e){var n=0===t.length||0===e.length;return n?t.concat(e):t.concat(FL,e)}),[])},YL=function(t,e){var n=t.toLowerCase();return Y(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Ut(e.toLowerCase(),n)||Ut(t.value.toLowerCase(),n)}))},JL=function(t,e,n){var r=th.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value,i=n.getLinkInformation();return i.fold((function(){return[]}),(function(e){var r=YL(o,KL(n.getHistory(t)));return"file"===t?XL([r,YL(o,WL(e)),YL(o,nt([$L(e),qL(e),GL(e)]))]):r}))},QL=oc("aria-invalid"),ZL=function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=th.getValue(e);n.addToHistory(r.value,t.filetype)},u=pD.parts.field({factory:DL,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":QL,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=JL(t.filetype,r,n),i=qP(o,jS.BUBBLE_TO_SANDBOX,e,!1);return tA.pure(i)},getHotspot:function(t){return m.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(dA)&&dA.run(t).get(h)},typeaheadBehaviours:ml(nt([n.getValidationHandler().map((function(e){return dA.config({getRoot:function(t){return vn(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){Hn(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=th.getValue(n);return LL.nu((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ro.error(t.message);n(e)}else{var r=ro.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Lv.config({disabled:function(){return t.disabled||o.isDisabled()}}),yD.config({}),Vw("urlinput-events",nt(["file"===t.filetype?[Na(Uu(),(function(e){Sa(e,ED,{name:t.name})}))]:[],[Na(ju(),(function(e){Sa(e,ED,{name:t.name}),i(e)})),Na(Zu(),(function(e){Sa(e,ED,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Uu()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:hk(!1,1,"normal")},onExecute:function(t,e,n){Sa(e,RD,{})},onItemExecute:function(e,n,r,o){i(e),Sa(e,ED,{name:t.name})}}),a=t.label.map((function(t){return TD(t,o)})),c=function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),IC(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:D({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)},s=kC(c("invalid",I.some(QL),"warning")),f=kC({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),l=n.getUrlPicker(t.filetype),d=oc("browser.url.event"),m=kC({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,f.asSpec()],behaviours:ml([Lv.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),g=kC(ZP({name:t.name,icon:I.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Ca(t,d)}),o,[],["tox-browse-url"])),p=function(){return{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:nt([[m.asSpec()],l.map((function(){return g.asSpec()})).toArray()])}},v=function(e){bv.getCurrent(e).each((function(n){var r=th.getValue(n),o=D({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){th.setValue(n,r),Sa(e,ED,{name:t.name})}))}))}))};return pD.sketch({dom:kD(),components:a.toArray().concat([p()]),fieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){pD.getField(t).each(Lv.disable),g.getOpt(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable),g.getOpt(t).each(Lv.enable)}}),cT(),Vw("url-input-events",[Na(d,v)])])})},tF=function(t,e){return sD.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[SC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:RC(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Sa(e,AD,{name:"alert-banner",value:t.url})},buttonBehaviours:ml([MC()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})},eF=function(t,e){var n=th.config({store:{mode:"manual",getValue:function(t){var e=t.element.dom;return e.checked},setValue:function(t,e){var n=t.element.dom;n.checked=e}}}),r=function(t){return t.element.dom.click(),I.some(!0)},o=pD.parts.field({factory:{sketch:x},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ml([WB.self(),Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),yD.config({}),Yw.config({}),n,Dw.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Vw("checkbox-events",[Na(ju(),(function(e,n){Sa(e,ED,{name:t.name})}))])])}),i=pD.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:ml([VA.config({})])}),u=function(t){var n="checked"===t?"selected":"unselected";return IC(n,{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=kC({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return pD.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,a.asSpec(),i],fieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){pD.getField(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable)}}),cT()])})},nF=function(t){return"presentation"===t.presets?sD.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):sD.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ml([yD.config({}),Yw.config({})])})},rF=function(t){return function(e,n,r){return Tt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},oF=function(t){return function(e,n,r){var o=Co(n,{source:"dynamic"});return rF(t)(e,o,r)}},iF={bar:rF((function(t,e){return lD(t,e.shared)})),collection:rF((function(t,e){return ID(t,e.shared.providers)})),alertbanner:rF((function(t,e){return tF(t,e.shared.providers)})),input:rF((function(t,e){return fL(t,e.shared.providers)})),textarea:rF((function(t,e){return lL(t,e.shared.providers)})),label:rF((function(t,e){return QI(t,e.shared)})),iframe:oF((function(t,e){return wM(t,e.shared.providers)})),button:rF((function(t,e){return oI(t,e.shared.providers)})),checkbox:rF((function(t,e){return eF(t,e.shared.providers)})),colorinput:rF((function(t,e){return $A(t,e.shared,e.colorinput)})),colorpicker:rF(KB),dropzone:rF((function(t,e){return sM(t,e.shared.providers)})),grid:rF((function(t,e){return fM(t,e.shared)})),listbox:rF((function(t,e){return rL(t,e)})),selectbox:rF((function(t,e){return aL(t,e.shared.providers)})),sizeinput:rF((function(t,e){return vI(t,e.shared.providers)})),urlinput:rF((function(t,e){return ZL(t,e,e.urlinput)})),customeditor:rF(JB),htmlpanel:rF(nF),imagetools:rF((function(t,e){return JI(t,e.shared.providers)})),table:rF((function(t,e){return cL(t,e.shared.providers)})),panel:rF((function(t,e){return oL(t,e)}))},uF={field:function(t,e){return e}},aF=function(t,e,n){var r=Co(n,{shared:{interpreter:function(e){return cF(t,e,r)}}});return cF(t,e,r)},cF=function(t,e,n){return Tt(iF,e.type).fold((function(){return e}),(function(r){return r(t,e,n)}))},sF=function(t,e){var n=uF;return cF(n,t,e)},fF={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},lF=function(t,e,n){var r=12,o={maxHeightFunction:Ed()},i=function(){return{type:"node",root:An(t()),node:I.from(t()),bubble:Nd(r,r,fF),layouts:{onRtl:function(){return[dC]},onLtr:function(){return[lC]}},overrides:o}},u=function(){return{type:"hotspot",hotspot:e(),bubble:Nd(-r,r,fF),layouts:{onRtl:function(){return[Uf]},onLtr:function(){return[jf]}},overrides:o}};return function(){return n()?i():u()}},dF=function(t,e,n){var r=function(){return{type:"node",root:An(t()),node:I.from(t()),layouts:{onRtl:function(){return[mC]},onLtr:function(){return[mC]}}}},o=function(){return{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[Gf]},onLtr:function(){return[Gf]}}}};return function(){return n()?r():o()}},mF=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return I.some(km.range(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(e.endContainer),e.endOffset))}}}},gF=function(t){return function(e){return{type:"node",root:t(),node:e}}},pF=function(t,e,n){var r=UO(t),o=function(){return ee.fromDom(t.getBody())},i=function(){return ee.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:lF(i,e,u),banner:dF(i,e,u),cursor:mF(t,o),node:gF(o)}},hF=function(t){return function(e,n){var r=t_(t);r(e,n)}},vF=function(t){return function(){return PE(t)}},bF=function(t){return function(){return LE(t)}},yF=function(t){return function(){return $E(t)}},wF=function(t){return{colorPicker:hF(t),hasCustomColors:vF(t),getColors:bF(t),getColorCols:yF(t)}},xF=function(t){return function(){return GO(t)}},CF=function(t){return{isDraggableModal:xF(t)}},SF=function(t){var e=ou(LO(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}},kF=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],OF=function(t){return Et(t,"items")},TF=function(t){return Et(t,"block")},EF=function(t){return Et(t,"inline")},_F=function(t){return Et(t,"selector")},DF=function(t){return Q(t,(function(t,e){if(OF(e)){var n=DF(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(EF(e)||TF(e)||_F(e)){var r=i(e.name)?e.name:e.title.toLowerCase(),o="custom-"+r;return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return D(D({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},AF=function(t,e){var n=DF(e),r=function(e){G(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats},RF=function(t){return SO(t).map((function(e){var n=AF(t,e);return kO(t)?kF.concat(n):n})).getOr(kF)},NF=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Co(t,r)},BF=function(t,e,n,r){var o=function(t){return NF(t,n,r)},u=function(t){var e={type:"submenu"};return Co(t,e)},a=function(e){var o=i(e.name)?e.name:oc(e.title),u="custom-"+o,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:r(u)},c=Co(e,a);return t.formatter.register(o,c),c},c=function(t){return $(t,(function(t){var e=pt(t);if(_t(t,"items")){var n=c(t.items);return Co(u(t),{getStyleItems:w(n)})}return _t(t,"format")?o(t):1===e.length&&U(e,"title")?Co(t,{type:"separator"}):a(t)}))};return c(e)},MF=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?I.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):I.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[t.format]},o=ou([]),i=ou([]),u=ou([]),a=ou([]),c=ou(!1);t.on("PreInit",(function(u){var a=RF(t),c=BF(t,a,e,n);o.set(c),i.set(rt(c,r))})),t.on("addStyleModifications",(function(o){var i=BF(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(rt(i,r))}));var s=function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},f=function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)};return{getData:s,getFlattenedKeys:f}},PF=function(t){return d(t)&&1===t.nodeType},IF=QB.trim,LF=function(t){return function(e){if(PF(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},FF=LF("true"),zF=LF("false"),HF=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},VF=function(t){while(t=t.parentNode){var e=t.contentEditable;if(e&&"inherit"!==e)return FF(t)}return!1},UF=function(t,e){return $(Xm(ee.fromDom(e),t),(function(t){return t.dom}))},jF=function(t){return t.innerText||t.textContent},WF=function(t){return t.id?t.id:oc("h")},qF=function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)},$F=function(t){return qF(t)&&KF(t)},GF=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},KF=function(t){return VF(t)&&!zF(t)},XF=function(t){return GF(t)&&KF(t)},YF=function(t){return GF(t)?parseInt(t.nodeName.substr(1),10):0},JF=function(t){var e=WF(t),n=function(){t.id=e};return HF("header",jF(t),"#"+e,YF(t),n)},QF=function(t){var e=t.id||t.name,n=jF(t);return HF("anchor",n||"#"+e,"#"+e,0,h)},ZF=function(t){return $(Y(t,XF),JF)},tz=function(t){return $(Y(t,$F),QF)},ez=function(t){var e=UF("h1,h2,h3,h4,h5,h6,a:not([href])",t);return e},nz=function(t){return IF(t.title).length>0},rz=function(t){var e=ez(t);return Y(ZF(e).concat(tz(e)),nz)},oz={find:rz},iz="tinymce-url-history",uz=5,az=function(t){return i(t)&&/^https?/.test(t)},cz=function(t){return a(t)&&t.length<=uz&&ot(t,az)},sz=function(t){return u(t)&&kt(t,(function(t){return!cz(t)})).isNone()},fz=function(){var t,e=TE.getItem(iz);if(null===e)return{};try{t=JSON.parse(e)}catch(n){if(n instanceof SyntaxError)return{};throw n}return sz(t)?t:{}},lz=function(t){if(!sz(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));TE.setItem(iz,JSON.stringify(t))},dz=function(t){var e=fz();return Tt(e,t).getOr([])},mz=function(t,e){if(az(t)){var n=fz(),r=Tt(n,e).getOr([]),o=Y(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,uz),lz(n)}},gz=function(t){return!!t},pz=function(t){return bt(QB.makeMap(t,/[, ]/),gz)},hz=function(t){return I.from(JO(t)).filter(m)},vz=function(t){var e=I.some(QO(t)).filter(gz),n=I.some(ZO(t)).filter(gz),r=e.or(n).map(pz);return hz(t).fold(T,(function(t){return r.fold(E,(function(t){return pt(t).length>0&&t}))}))},bz=function(t,e){var n=vz(t);return s(n)?n?hz(t):I.none():n[e]?hz(t):I.none()},yz=function(t,e){return bz(t,e).map((function(n){return function(r){return tA.nu((function(o){var a=function(t,e){if(!i(t))throw new Error("Expected value to be string");if(void 0!==e&&!u(e))throw new Error("Expected meta to be a object");var n={value:t,meta:e};o(n)},c=D({filetype:e,fieldname:r.fieldname},I.from(r.meta).getOr({}));n.call(t,a,r.value,c)}))}}))},wz=function(t){return I.from(t).filter(i).getOrUndefined()},xz=function(t){return tT(t)?I.none():I.some({targets:oz.find(t.getBody()),anchorTop:wz(eT(t)),anchorBottom:wz(nT(t))})},Cz=function(t){return I.from(rT(t))},Sz=function(t){return{getHistory:dz,addToHistory:mz,getLinkInformation:function(){return xz(t)},getValidationHandler:function(){return Cz(t)},getUrlPicker:function(e){return yz(t,e)}}},kz=function(t,e,n){var r=ou(!1),o=SF(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:OC.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return sF(t,i)},anchors:pF(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ro.value(t)}},urlinput:Sz(e),styleselect:MF(e),colorinput:wF(e),dialog:CF(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},Oz=function(t,e,n){var r=function(t,r){G([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){G([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(yp(),{target:t.target})},u=Cl(),a=ud(u,"touchstart",i),c=ud(u,"touchmove",(function(t){return r(ca(),t)})),s=ud(u,"touchend",(function(t){return r(sa(),t)})),f=ud(u,"mousedown",i),l=ud(u,"mouseup",(function(t){0===t.raw.button&&o(xp(),{target:t.target})})),d=function(t){return o(yp(),{target:ee.fromDom(t.target)})},m=function(t){0===t.button&&o(xp(),{target:ee.fromDom(t.target)})},g=function(){G(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},p=function(t){return r(fa(),cd(t))},h=function(t){o(wp(),{}),r(la(),cd(t))},v=function(){return o(wp(),{})},b=function(e){e.state&&o(yp(),{target:ee.fromDom(t.getContainer())})},y=function(t){o(yp(),{target:ee.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",p),t.on("ResizeWindow",h),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",p),t.off("ResizeWindow",h),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),f.unbind(),a.unbind(),c.unbind(),s.unbind(),l.unbind()})),t.on("detach",(function(){Qg(e),Qg(n),e.destroy(),n.destroy()}))},Tz=nv,Ez=Fh,_z=w([Ki("shell",!1),Di("makeItem"),Ki("setupItem",h),oh.field("listBehaviours",[zw])]),Dz=function(){return{behaviours:ml([zw.config({})])}},Az=Ph({name:"items",overrides:Dz}),Rz=w([Az]),Nz=w("CustomList"),Bz=function(t,e,n,r){var o=function(e,n){u(e).fold((function(){throw new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=zw.contents(r),i=n.length,u=i-o.length,a=u>0?W(u,(function(){return t.makeItem()})):[],c=o.slice(i);G(c,(function(t){return zw.remove(r,t)})),G(a,(function(t){return zw.append(r,t)}));var s=zw.contents(r);G(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))},i=t.shell?{behaviours:[zw.config({})],components:[]}:{behaviours:[],components:e},u=function(e){return t.shell?I.some(e):Kh(e,t,"items")};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:rh(t.listBehaviours,i.behaviours),apis:{setItems:o}}},Mz=mv({name:Nz(),configFields:_z(),partFields:Rz(),factory:Bz,apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),Pz=w([Di("dom"),Ki("shell",!0),eh("toolbarBehaviours",[zw])]),Iz=function(){return{behaviours:ml([zw.config({})])}},Lz=w([Ph({name:"groups",overrides:Iz})]),Fz=function(t,e,n,r){var o=function(t,e){i(t).fold((function(){throw new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){zw.set(t,e)}))},i=function(e){return t.shell?I.some(e):Kh(e,t,"groups")},u=t.shell?{behaviours:[zw.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:u.components,behaviours:rh(t.toolbarBehaviours,u.behaviours),apis:{setGroups:o},domModification:{attributes:{role:"group"}}}},zz=mv({name:"Toolbar",configFields:Pz(),partFields:Lz(),factory:Fz,apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),Hz=h,Vz=T,Uz=w([]),jz=Object.freeze({__proto__:null,setup:Hz,isDocked:Vz,getBehaviours:Uz}),Wz=function(t){var e=Dt(Zn(t,"position"),"fixed"),n=e?I.none():yn(t);return n.orThunk((function(){var e=ee.fromTag("span");return vn(t).bind((function(t){Ar(t,e);var n=yn(e);return Pr(e),n}))}))},qz=function(t){return Wz(t).map(mr).getOrThunk((function(){return fr(0,0)}))},$z=uu.generate([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),Gz=function(t,e){var n=t.element;is(n,e.transitionClass),as(n,e.fadeOutClass),is(n,e.fadeInClass),e.onShow(t)},Kz=function(t,e){var n=t.element;is(n,e.transitionClass),as(n,e.fadeInClass),is(n,e.fadeOutClass),e.onHide(t)},Xz=function(t,e){return t.y<e.bottom&&t.bottom>e.y},Yz=function(t,e){return t.y>=e.y},Jz=function(t,e){return t.bottom<=e.bottom},Qz=function(t,e,n){return ot(t,(function(t){switch(t){case"bottom":return Jz(e,n);case"top":return Yz(e,n)}}))},Zz=function(t,e){return e.getInitialPos().map((function(e){return Yr(e.bounds.x,e.bounds.y,vr(t),ur(t))}))},tH=function(t,e,n){n.setInitialPos({style:tr(t),position:Jn(t,"position")||"static",bounds:e})},eH=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return I.some($z.static());case"absolute":var o=Wz(t).map(Jr).getOrThunk((function(){return Jr(Ln())}));return I.some($z.absolute(Dl("absolute",Tt(r.style,"left").map((function(t){return e.x-o.x})),Tt(r.style,"top").map((function(t){return e.y-o.y})),Tt(r.style,"right").map((function(t){return o.right-e.right})),Tt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return I.none()}}))},nH=function(t,e,n){return Zz(t,n).filter((function(t){return Qz(n.getModes(),t,e)})).bind((function(e){return eH(t,e,n)}))},rH=function(t,e,n){var r=Jr(t);if(Qz(n.getModes(),r,e))return I.none();tH(t,r,n);var o=Zr(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return I.some($z.fixed(Dl("fixed",I.some(i),c?I.some(u):I.none(),I.none(),c?I.none():I.some(a))))},oH=function(t,e,n){var r=t.element,o=Dt(Zn(r,"position"),"fixed");return o?nH(r,e,n):rH(r,e,n)},iH=function(t,e){var n=t.element;return Zz(n,e).bind((function(t){return eH(n,t,e)}))},uH=function(t,e,n){n.setDocked(!1),G(["left","right","top","bottom","position"],(function(e){return nr(t.element,e)})),e.onUndocked(t)},aH=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Rl(t.element,r);var i=o?e.onDocked:e.onUndocked;i(t)},cH=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=Xz(i,r);if(u!==n.isVisible())if(n.setVisible(u),o&&!u)ss(t.element,[e.fadeOutClass]),e.onHide(t);else{var a=u?Gz:Kz;a(t,e)}}))}))},sH=function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&cH(t,e,n,r),oH(t,r,n).each((function(o){o.fold((function(){return uH(t,e,n)}),(function(r){return aH(t,e,n,r)}),(function(o){cH(t,e,n,r,!0),aH(t,e,n,o)}))}))},fH=function(t,e,n){var r=t.element;n.setDocked(!1),iH(t,n).each((function(r){r.fold((function(){return uH(t,e,n)}),(function(r){return aH(t,e,n,r)}),h)})),n.setVisible(!0),e.contextual.each((function(e){fs(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),lH(t,e,n)},lH=function(t,e,n){t.getSystem().isConnected()&&sH(t,e,n)},dH=function(t,e,n){n.isDocked()&&fH(t,e,n)},mH=function(t,e,n){return n.isDocked()},gH=function(t,e,n,r){return n.setModes(r)},pH=function(t,e,n){return n.getModes()},hH=Object.freeze({__proto__:null,refresh:lH,reset:dH,isDocked:mH,getModes:pH,setModes:gH}),vH=function(t,e){return _a([Va($u(),(function(n,r){t.contextual.each((function(t){if(cs(n.element,t.transitionClass)){fs(n.element,[t.transitionClass,t.fadeInClass]);var o=e.isVisible()?t.onShown:t.onHidden;o(n)}r.stop()}))})),Na(fa(),(function(n,r){lH(n,t,e)})),Na(la(),(function(n,r){dH(n,t,e)}))])},bH=Object.freeze({__proto__:null,events:vH}),yH=[$i("contextual",[Ni("fadeInClass"),Ni("fadeOutClass"),Ni("transitionClass"),Pi("lazyContext"),cf("onShow"),cf("onShown"),cf("onHide"),cf("onHidden")]),tu("lazyViewport",Zr),nu("modes",["top","bottom"],si),cf("onDocked"),cf("onUndocked")],wH=function(t){var e=ou(!1),n=ou(!0),r=od(),o=ou(t.modes),i=function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")};return Oc({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:i})},xH=Object.freeze({__proto__:null,init:wH}),CH=pl({fields:yH,name:"docking",active:bH,apis:hH,state:xH}),SH=w(oc("toolbar-height-change")),kH={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},OH="tox-tinymce--toolbar-sticky-on",TH="tox-tinymce--toolbar-sticky-off",EH=function(t,e){var n=mn(e),r=n.dom.defaultView.innerHeight,o=Lr(n),i=ee.fromDom(t.elm),u=Qr(i),a=ur(i),c=u.y,s=c+a,f=mr(e),l=ur(e),d=f.top,m=d+l,g=Math.abs(d-o.top)<2,p=Math.abs(m-(o.top+r))<2;if(g&&c<m)Fr(o.left,c-l,n);else if(p&&s>d){var h=c-r+a+l;Fr(o.left,h,n)}},_H=function(t,e){return U(CH.getModes(t),e)},DH=function(t){var e=function(t){return ar(t)+(parseInt(Jn(t,"margin-top"),10)||0)+(parseInt(Jn(t,"margin-bottom"),10)||0)},n=t.element;vn(n).each((function(r){var o="padding-"+CH.getModes(t)[0];if(CH.isDocked(t)){var i=vr(r);Kn(n,"width",i+"px"),Kn(r,o,e(n)+"px")}else nr(n,"width"),nr(r,o)}))},AH=function(t,e){e?(as(t,kH.fadeOutClass),ss(t,[kH.transitionClass,kH.fadeInClass])):(as(t,kH.fadeInClass),ss(t,[kH.fadeOutClass,kH.transitionClass]))},RH=function(t,e){var n=ee.fromDom(t.getContainer());e?(is(n,OH),as(n,TH)):(is(n,TH),as(n,OH))},NH=function(t,e){var n=mn(e);Tl(n).filter((function(t){return!sn(e,t)})).filter((function(e){return sn(e,ee.fromDom(n.dom.body))||dn(t,e)})).each((function(){return Sl(e)}))},BH=function(t,e){return El(t).orThunk((function(){return e().toOptional().bind((function(t){return El(t.element)}))}))},MH=function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(CH.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(DH)})),t.on("SkinLoaded",(function(){n().each((function(t){CH.isDocked(t)?CH.reset(t):CH.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(CH.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){CH.refresh(e);var n=e.element;Jb(n)&&EH(t,n)}))})),t.on("PostRender",(function(){RH(t,!1)}))},PH=function(t){return t().map(CH.isDocked).getOr(!1)},IH=function(){var t;return[yl.config({channels:(t={},t[SH()]={onReceive:DH},t)})]},LH=function(t,e){var n=od(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||DH(e),RH(t,CH.isDocked(e)),e.getSystem().broadcastOn([wp()],{}),r().each((function(t){return t.getSystem().broadcastOn([wp()],{})}))},u=t.inline?[]:IH();return R([Yw.config({}),CH.config({contextual:D({lazyContext:function(e){var n=ar(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Jr(ee.fromDom(r)),i=o.height-n,u=o.y+(_H(e,"top")?0:n);return I.some(Yr(o.x,u,o.width,i))},onShow:function(){o((function(t){return AH(t,!0)}))},onShown:function(t){o((function(t){return fs(t,[kH.transitionClass,kH.fadeInClass])})),n.get().each((function(e){NH(t.element,e),n.clear()}))},onHide:function(t){BH(t.element,r).fold(n.clear,n.set),o((function(t){return AH(t,!1)}))},onHidden:function(){o((function(t){return fs(t,[kH.transitionClass])}))}},kH),lazyViewport:function(e){var n=Zr(),r=$O(t),o=n.y+(_H(e,"top")?r:0),i=n.height-(_H(e,"bottom")?r:0);return Yr(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u,!0)},FH=Object.freeze({__proto__:null,setup:MH,isDocked:PH,getBehaviours:LH}),zH=function(t){var e=t.editor,n=t.sticky?LH:Uz;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:ml(n(e,t.sharedBackstage))}},HH=ti([Ni("type"),Ai("items",ni([ii([Ni("name"),zi("items",si)]),si]))].concat(kS)),VH=function(t){return wi("GroupToolbarButton",HH,t)},UH=[ji("text"),ji("tooltip"),ji("icon"),Pi("fetch"),tu("onSetup",(function(){return h}))],jH=ti(R([Ni("type")],UH,!0)),WH=function(t){return wi("menubutton",jH,t)},qH=ti([Ni("type"),ji("tooltip"),ji("icon"),ji("text"),Wi("select"),Pi("fetch"),tu("onSetup",(function(){return h})),Qi("presets","normal",["normal","color","listpreview"]),Ki("columns",1),Pi("onAction"),Pi("onItemAction")]),$H=function(t){return wi("SplitButton",qH,t)},GH=function(t,e){var n=function(t,n){var r=$(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=WH(n).mapError((function(t){return Si(t)})).getOrDie();return GP(r,"tox-mbtn",e.backstage,I.some("menuitem"))}));zw.set(t,r)},r={focus:Dw.focusIn,setMenus:n};return{uid:t.uid,dom:t.dom,components:[],behaviours:ml([zw.config({}),Vw("menubar-events",[Ua((function(e){t.onSetup(e)})),Na(Lu(),(function(t,e){Fs(t.element,".tox-mbtn--active").each((function(n){zs(e.event.target,".tox-mbtn").each((function(e){sn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){LA.expand(t),LA.close(n),Yw.focus(t)}))}))}))}))})),Na(ha(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){LA.isOpen(n)&&(LA.expand(t),LA.close(n))}))}))}))]),Dw.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),I.some(!0)}}),yD.config({})]),apis:r,domModification:{attributes:{role:"menubar"}}}},KH=dv({factory:GH,name:"silver.Menubar",configFields:[Di("dom"),Di("uid"),Di("onEscape"),Di("backstage"),Ki("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),XH=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},YH=function(t){return t.dimension.property},JH=function(t,e){return t.dimension.getDimension(e)},QH=function(t,e){var n=XH(t,e);fs(n,[e.shrinkingClass,e.growingClass])},ZH=function(t,e){as(t.element,e.openClass),is(t.element,e.closedClass),Kn(t.element,YH(e),"0px"),rr(t.element)},tV=function(t,e){as(t.element,e.closedClass),is(t.element,e.openClass),nr(t.element,YH(e))},eV=function(t,e,n,r){n.setCollapsed(),Kn(t.element,YH(e),JH(e,t.element)),rr(t.element),QH(t,e),ZH(t,e),e.onStartShrink(t),e.onShrunk(t)},nV=function(t,e,n,r){var o=r.getOrThunk((function(){return JH(e,t.element)}));n.setCollapsed(),Kn(t.element,YH(e),o),rr(t.element);var i=XH(t,e);as(i,e.growingClass),is(i,e.shrinkingClass),ZH(t,e),e.onStartShrink(t)},rV=function(t,e,n){var r=JH(e,t.element),o="0px"===r?eV:nV;o(t,e,n,I.some(r))},oV=function(t,e,n){var r=XH(t,e),o=cs(r,e.shrinkingClass),i=JH(e,t.element);tV(t,e);var u=JH(e,t.element),a=function(){Kn(t.element,YH(e),i),rr(t.element)},c=function(){ZH(t,e)},s=o?a:c;s(),as(r,e.shrinkingClass),is(r,e.growingClass),tV(t,e),Kn(t.element,YH(e),u),n.setExpanded(),e.onStartGrow(t)},iV=function(t,e,n){if(n.isExpanded()){nr(t.element,YH(e));var r=JH(e,t.element);Kn(t.element,YH(e),r)}},uV=function(t,e,n){n.isExpanded()||oV(t,e,n)},aV=function(t,e,n){n.isExpanded()&&rV(t,e,n)},cV=function(t,e,n){n.isExpanded()&&eV(t,e,n)},sV=function(t,e,n){return n.isExpanded()},fV=function(t,e,n){return n.isCollapsed()},lV=function(t,e,n){var r=XH(t,e);return!0===cs(r,e.growingClass)},dV=function(t,e,n){var r=XH(t,e);return!0===cs(r,e.shrinkingClass)},mV=function(t,e,n){return lV(t,e)||dV(t,e)},gV=function(t,e,n){var r=n.isExpanded()?rV:oV;r(t,e,n)},pV=Object.freeze({__proto__:null,refresh:iV,grow:uV,shrink:aV,immediateShrink:cV,hasGrown:sV,hasShrunk:fV,isGrowing:lV,isShrinking:dV,isTransitioning:mV,toggleGrow:gV,disableTransitions:QH}),hV=function(t,e,n){var r=e.expanded;return Ac(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:mu(e.dimension.property,"0px")})},vV=function(t,e){return _a([Va($u(),(function(n,r){var o=r.event.raw;if(o.propertyName===t.dimension.property){QH(n,t),e.isExpanded()&&nr(n.element,t.dimension.property);var i=e.isExpanded()?t.onGrown:t.onShrunk;i(n)}}))])},bV=Object.freeze({__proto__:null,exhibit:hV,events:vV}),yV=[Di("closedClass"),Di("openClass"),Di("shrinkingClass"),Di("growingClass"),Hi("getAnimationRoot"),cf("onShrunk"),cf("onStartShrink"),cf("onGrown"),cf("onStartGrow"),Ki("expanded",!1),Ai("dimension",ki("property",{width:[df("property","width"),df("getDimension",(function(t){return vr(t)+"px"}))],height:[df("property","height"),df("getDimension",(function(t){return ur(t)+"px"}))]}))],wV=function(t){var e=ou(t.expanded),n=function(){return"expanded: "+e.get()};return Oc({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:S(e.set,!1),setExpanded:S(e.set,!0),readState:n})},xV=Object.freeze({__proto__:null,init:wV}),CV=pl({fields:yV,name:"sliding",active:bV,apis:pV,state:xV}),SV="container",kV=[eh("slotBehaviours",[])],OV=function(t){return"<alloy.field."+t+">"},TV=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),jh(SV,OV(e),n)};return{slot:e,record:w(t)}}(),n=t(e),r=e.record(),o=$(r,(function(t){return Bh({name:t,pname:OV(t)})}));return uv(SV,kV,o,EV,n)},EV=function(t,e){var n=function(e){return Qh(t)},r=function(e,n){return Kh(e,t,n)},o=function(e,n){return function(r,o){return Kh(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t){return function(e,n){G(n,(function(n){return t(e,n)}))}},u=function(t,e){return"true"!==Un(t.element,"aria-hidden")},a=function(t,e){if(!u(t)){var n=t.element;nr(n,"display"),qn(n,"aria-hidden"),Sa(t,va(),{name:e,visible:!0})}},c=function(t,e){if(u(t)){var n=t.element;Kn(n,"display","none"),Hn(n,"aria-hidden","true"),Sa(t,va(),{name:e,visible:!1})}},s=o(u,!1),f=o(c),l=i(f),d=function(t){return l(t,n())},m=o(a),g={getSlotNames:n,getSlot:r,isShowing:s,hideSlot:f,hideAllSlots:d,showSlot:m};return{uid:t.uid,dom:t.dom,components:e,behaviours:nh(t.slotBehaviours),apis:g}},_V=bt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return Sc(t)})),DV=D(D({},_V),{sketch:TV}),AV=ti([ji("icon"),ji("tooltip"),tu("onShow",h),tu("onHide",h),tu("onSetup",(function(){return h}))]),RV=function(t){return wi("sidebar",AV,t)},NV=function(t){var e=t.ui.registry.getAll().sidebars;G(pt(e),(function(n){var r=e[n],o=function(){return Dt(I.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))},BV=function(t){return{element:function(){return t.element.dom}}},MV=function(t,e){var n=$(pt(e),(function(t){var n=e[t],r=xi(RV(n));return{name:t,getApi:BV,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return $(n,(function(e){var r=ou(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Qk.unnamedEvents([pT(e,r),hT(e,r),Na(va(),(function(t,e){var r=e.event,o=tt(n,(function(t){return t.name===r.name}));o.each((function(e){var n=r.visible?e.onShow:e.onHide;n(e.getApi(t))}))}))])})}))},PV=function(t){return DV.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:MV(e,t),slotBehaviours:Qk.unnamedEvents([Ua((function(t){return DV.hideAllSlots(t)}))])}}))},IV=function(t,e){var n=bv.getCurrent(t);n.each((function(t){return zw.set(t,[PV(e)])}))},LV=function(t,e){var n=bv.getCurrent(t);n.each((function(t){var n=bv.getCurrent(t);n.each((function(n){CV.hasGrown(t)?DV.isShowing(n,e)?CV.shrink(t):(DV.hideAllSlots(n),DV.showSlot(n,e)):(DV.hideAllSlots(n),DV.showSlot(n,e),CV.grow(t))}))}))},FV=function(t){var e=bv.getCurrent(t);return e.bind((function(t){var e=CV.isGrowing(t)||CV.hasGrown(t);if(e){var n=bv.getCurrent(t);return n.bind((function(t){return tt(DV.getSlotNames(t),(function(e){return DV.isShowing(t,e)}))}))}return I.none()}))},zV=oc("FixSizeEvent"),HV=oc("AutoSizeEvent"),VV=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ml([yD.config({}),Yw.config({}),CV.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){var e=bv.getCurrent(t);e.each(DV.hideAllSlots),Ca(t,HV)},onGrown:function(t){Ca(t,HV)},onStartGrow:function(t){Sa(t,zV,{width:Zn(t.element,"width").getOr("")})},onStartShrink:function(t){Sa(t,zV,{width:vr(t.element)+"px"})}}),zw.config({}),bv.config({find:function(t){var e=zw.contents(t);return lt(e)}})])}],behaviours:ml([WB.childAt(0),Vw("sidebar-sliding-events",[Na(zV,(function(t,e){Kn(t.element,"width",e.event.width)})),Na(HV,(function(t,e){nr(t.element,"width")}))])])}},UV=function(t,e,n,r){Hn(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=ml([Dw.config({mode:"special",onTab:function(){return I.some(!0)},onShiftTab:function(){return I.some(!0)}}),Yw.config({})]),u=r(o,i),a=o.getSystem().build(u);zw.append(o,_s(a)),a.hasConfigured(Dw)&&e.focus&&Dw.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return zw.remove(o,a)}))},jV=function(t,e,n){qn(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()},WV=Object.freeze({__proto__:null,block:UV,unblock:jV}),qV=[tu("getRoot",I.none),Zi("focus",!0),cf("onBlock"),cf("onUnblock")],$V=function(){var t=ed(),e=function(e){t.set({destroy:e})};return Oc({readState:t.isSet,blockWith:e,clear:t.clear,isBlocked:t.isSet})},GV=Object.freeze({__proto__:null,init:$V}),KV=pl({fields:qV,name:"blocking",apis:WV,state:GV}),XV=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return Q(e,(function(t,e){var n;return"class"===e.name?t:D(D({},t),(n={},n[e.name]=e.value,n))}),{})},YV=function(t){return Array.prototype.slice.call(t.dom.classList,0)},JV=function(t){var e=ee.fromHtml(t),n=xn(e),r=XV(e),o=YV(e),i=0===n.length?{}:{innerHtml:Ga(e)};return D({tag:ae(e),classes:o,attributes:r},i)},QV=function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:JV('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}},ZV=function(t){return bv.getCurrent(t).each((function(t){return Sl(t.element)}))},tU=function(t,e){var n="tabindex",r="data-mce-"+n;I.from(t.iframeElement).map(ee.fromDom).each((function(t){e?(jn(t,n).each((function(e){return Hn(t,r,e)})),Hn(t,n,-1)):(qn(t,n),jn(t,r).each((function(e){Hn(t,n,e),qn(t,r)})))}))},eU=function(t,e,n,r){var o=e.element;if(tU(t,n),n)KV.block(e,QV(r)),nr(o,"display"),qn(o,"aria-hidden"),t.hasFocus()&&ZV(e);else{var i=bv.getCurrent(e).exists((function(t){return Ol(t.element)}));KV.unblock(e),Kn(o,"display","none"),Hn(o,"aria-hidden","true"),i&&t.focus()}},nU=function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ml([zw.config({}),KV.config({focus:!1}),bv.config({find:function(t){return lt(t.components())}})]),components:[]}},rU=function(t){return"focusin"===t.type},oU=function(t){if(rU(t)){var e=t.composed?lt(t.composedPath()):I.from(t.target);return e.map(ee.fromDom).filter(fe).exists((function(t){return cs(t,"mce-pastebin")}))}return!1},iU=function(t,e,n){var r=ou(!1),o=od(),i=function(n){r.get()&&!oU(n)&&(n.preventDefault(),ZV(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var u=function(o){o!==r.get()&&(r.set(o),eU(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(xC.clearTimeout),g(e.time)){var n=xC.setEditorTimeout(t,(function(){return u(e.state)}),e.time);o.set(n)}else u(e.state),o.clear()}))},uU=function(t,e){var n={len:0,list:[]},r=Q(t,(function(t,n){var r=e(n,t.len);return r.fold(w(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),n);return r.list},aU=function(t,e,n){return{within:t,extra:e,withinWidth:n}},cU=function(t,e,n){var r=uU(t,(function(t,e){var r=n(t);return I.some({element:t,start:e,finish:e+r,width:r})})),o=Y(r,(function(t){return t.finish<=e})),i=J(o,(function(t,e){return t+e.width}),0),u=r.slice(o.length);return{within:o,extra:u,withinWidth:i}},sU=function(t){return $(t,(function(t){return t.element}))},fU=function(t,e,n){var r=sU(t.concat(e));return aU(r,[],n)},lU=function(t,e,n,r){var o=sU(t).concat([n]);return aU(o,sU(e),r)},dU=function(t,e,n){return aU(sU(t),[],n)},mU=function(t,e,n){var r=cU(e,t,n);return 0===r.extra.length?I.some(r):I.none()},gU=function(t,e,n,r){var o=mU(t,e,n).getOrThunk((function(){return cU(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?fU(i,u,a):u.length>=1?lU(i,u,r,a):dU(i,u,a)},pU=function(t,e){var n=$(e,(function(t){return _s(t)}));zz.setGroups(t,n)},hU=function(t){return gt(t,(function(t){return El(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}))},vU=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=Xh(t,e,"primary"),i=bA.getCoupled(t,"overflowGroup");Kn(o.element,"visibility","hidden");var u=r.concat([i]),a=hU(u);n([]),pU(o,u);var c=vr(o.element),s=gU(c,e.builtGroups.get(),(function(t){return vr(t.element)}),i);0===s.extra.length?(zw.remove(o,i),n([])):(pU(o,s.within),n(s.extra)),nr(o.element,"visibility"),rr(o.element),a.each(Yw.focus)}},bU=w([eh("splitToolbarBehaviours",[bA]),Ei("builtGroups",(function(){return ou([])}))]),yU=w([uf(["overflowToggledClass"]),Wi("getOverflowBounds"),Di("lazySink"),Ei("overflowGroups",(function(){return ou([])}))].concat(bU())),wU=w([Bh({factory:zz,schema:Pz(),name:"primary"}),Mh({schema:Pz(),name:"overflow"}),Mh({name:"overflow-button"}),Mh({name:"overflow-group"})]),xU=w((function(t,e){yr(t,Math.floor(e))})),CU=w([uf(["toggledClass"]),Di("lazySink"),Pi("fetch"),Wi("getBounds"),$i("fireDismissalEventInstead",[Ki("event",ga())]),zd()]),SU=w([Mh({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ml([px.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Mh({factory:zz,schema:Pz(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:ml([Dw.config({mode:"cyclic",onEscape:function(e){return Kh(e,t,"button").each(Yw.focus),I.none()}})])}}})]),kU=function(t,e){var n=bA.getCoupled(t,"toolbarSandbox");bp.isOpen(n)?bp.close(n):bp.open(n,e.toolbar())},OU=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Fg.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:xU()}}},o)},TU=function(t,e,n,r,o){zz.setGroups(e,o),OU(t,e,n,r),px.on(t)},EU=function(t,e,n){var r=Vs(),o=function(o,i){n.fetch().get((function(o){TU(t,i,n,e.layouts,o),r.link(t.element),Dw.focusIn(i)}))},i=function(){px.off(t),Yw.focus(t),r.unlink(t.element)};return{dom:{tag:"div",attributes:{id:r.id}},behaviours:ml([Dw.config({mode:"special",onEscape:function(t){return bp.close(t),I.some(!0)}}),bp.config({onOpen:o,onClose:i,isPartOf:function(e,n,r){return js(n,r)||js(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),yl.config({channels:D(D({},Sp(D({isExtraPart:T},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Op({doReposition:function(){bp.getState(bA.getCoupled(t,"toolbarSandbox")).each((function(r){OU(t,r,n,e.layouts)}))}}))})])}},_U=function(t,e,n,r){return D(D({},SC.sketch(D(D({},r.button()),{action:function(t){kU(t,r)},buttonBehaviours:oh.augment({dump:r.button().buttonBehaviours},[bA.config({others:{toolbarSandbox:function(e){return EU(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){bp.getState(bA.getCoupled(e,"toolbarSandbox")).each((function(o){TU(e,o,t,n.layouts,r)}))},reposition:function(e){bp.getState(bA.getCoupled(e,"toolbarSandbox")).each((function(r){OU(e,r,t,n.layouts)}))},toggle:function(t){kU(t,r)},getToolbar:function(t){return bp.getState(bA.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return bp.isOpen(bA.getCoupled(t,"toolbarSandbox"))}}})},DU=mv({name:"FloatingToolbarButton",factory:_U,configFields:CU(),partFields:SU(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),AU=w([Di("items"),uf(["itemSelector"]),eh("tgroupBehaviours",[Dw])]),RU=w([Ih({name:"items",unit:"item"})]),NU=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.tgroupBehaviours,[Dw.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}},BU=mv({name:"ToolbarGroup",configFields:AU(),partFields:RU(),factory:NU}),MU=function(t){return $(t,(function(t){return _s(t)}))},PU=function(t,e,n){vU(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){DU.setGroups(t,MU(r))}))}))},IU=function(t,e,n,r){var o=kC(DU.sketch({fetch:function(){return tA.nu((function(e){e(MU(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[jf,Uf]},onRtl:function(){return[Uf,jf]},onBottomLtr:function(){return[qf,Wf]},onBottomRtl:function(){return[Wf,qf]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.splitToolbarBehaviours,[bA.config({others:{overflowGroup:function(){return BU.sketch(D(D({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set($(n,e.getSystem().build)),PU(e,o,t)},refresh:function(e){return PU(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){DU.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(DU.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){DU.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(DU.getToolbar)}},domModification:{attributes:{role:"group"}}}},LU=mv({name:"SplitFloatingToolbar",configFields:yU(),partFields:wU(),factory:IU,apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),FU=w([uf(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),cf("onOpened"),cf("onClosed")].concat(bU())),zU=w([Bh({factory:zz,schema:Pz(),name:"primary"}),Bh({factory:zz,schema:Pz(),name:"overflow",overrides:function(t){return{toolbarBehaviours:ml([CV.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Kh(e,t,"overflow-button").each((function(t){px.off(t),Yw.focus(t)})),t.onClosed(e)},onGrown:function(e){Dw.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Kh(e,t,"overflow-button").each(px.on)}}),Dw.config({mode:"acyclic",onEscape:function(e){return Kh(e,t,"overflow-button").each(Yw.focus),I.some(!0)}})])}}}),Mh({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ml([px.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Mh({name:"overflow-group"})]),HU=function(t,e){return Kh(t,e,"overflow").map(CV.hasGrown).getOr(!1)},VU=function(t,e){Kh(t,e,"overflow-button").bind((function(){return Kh(t,e,"overflow")})).each((function(n){UU(t,e),CV.toggleGrow(n)}))},UU=function(t,e){Kh(t,e,"overflow").each((function(n){vU(t,e,(function(t){var e=$(t,(function(t){return _s(t)}));zz.setGroups(n,e)})),Kh(t,e,"overflow-button").each((function(t){CV.hasGrown(n)&&px.on(t)})),CV.refresh(n)}))},jU=function(t,e,n,r){var o="alloy.toolbar.toggle",i=function(e,n){var r=$(n,e.getSystem().build);t.builtGroups.set(r)};return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.splitToolbarBehaviours,[bA.config({others:{overflowGroup:function(t){return BU.sketch(D(D({},r["overflow-group"]()),{items:[SC.sketch(D(D({},r["overflow-button"]()),{action:function(e){Ca(t,o)}}))]}))}}}),Vw("toolbar-toggle-events",[Na(o,(function(e){VU(e,t)}))])]),apis:{setGroups:function(e,n){i(e,n),UU(e,t)},refresh:function(e){return UU(e,t)},toggle:function(e){return VU(e,t)},isOpen:function(e){return HU(e,t)}},domModification:{attributes:{role:"group"}}}},WU=mv({name:"SplitSlidingToolbar",configFields:FU(),partFields:zU(),factory:jU,apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),qU=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:D({tag:"div",classes:["tox-toolbar__group"]},e),components:[BU.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ml([yD.config({}),Yw.config({})])}},$U=function(t){return BU.sketch(qU(t))},GU=function(t,e){var n=Ua((function(e){var n=$(t.initGroups,$U);zz.setGroups(e,n)}));return ml([mT.toolbarButton(t.providers.isDisabled),cT(),Dw.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Vw("toolbar-events",[n])])},KU=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":qU({title:I.none(),items:[]}),"overflow-button":YP({name:"more",icon:I.some("more-drawer"),disabled:!1,tooltip:I.some("More..."),primary:!1,borderless:!1},I.none(),t.providers)},splitToolbarBehaviours:GU(t,e)}},XU=function(t){var e=KU(t),n=4,r=LU.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return LU.sketch(D(D({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,r=Qr(e),o=pn(e),i=Qr(o),u=Math.max(o.dom.scrollHeight,i.height);return Yr(r.x+n,i.y,r.width-2*n,u)},parts:D(D({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[r],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},YU=function(t){var e=WU.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=WU.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=KU(t);return WU.sketch(D(D({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([SH()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([SH()],{type:"closed"})}}))},JU=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return zz.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===US.scrolling?["tox-toolbar--scrolling"]:[])},components:[zz.parts.groups({})],toolbarBehaviours:GU(t,e)})},QU=function(t,e,n){var r={getSocket:function(e){return Tz.getPart(e,t,"socket")},setSidebar:function(e,n){Tz.getPart(e,t,"sidebar").each((function(t){return IV(t,n)}))},toggleSidebar:function(e,n){Tz.getPart(e,t,"sidebar").each((function(t){return LV(t,n)}))},whichSidebar:function(e){return Tz.getPart(e,t,"sidebar").bind(FV).getOrNull()},getHeader:function(e){return Tz.getPart(e,t,"header")},getToolbar:function(e){return Tz.getPart(e,t,"toolbar")},setToolbar:function(e,n){Tz.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){Tz.getPart(e,t,"multiple-toolbar").each((function(t){Mz.setItems(t,n)}))},refreshToolbar:function(e){var n=Tz.getPart(e,t,"toolbar");n.each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){Tz.getPart(e,t,"toolbar").each((function(t){Pt(t.getApis().toggle,(function(e){return e(t)}))}))},isToolbarDrawerToggled:function(e){return Tz.getPart(e,t,"toolbar").bind((function(t){return I.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return Tz.getPart(e,t,"throbber")},focusToolbar:function(e){var n=Tz.getPart(e,t,"toolbar").orThunk((function(){return Tz.getPart(e,t,"multiple-toolbar")}));n.each((function(t){Dw.focusIn(t)}))},setMenubar:function(e,n){Tz.getPart(e,t,"menubar").each((function(t){KH.setMenus(t,n)}))},focusMenubar:function(e){Tz.getPart(e,t,"menubar").each((function(t){KH.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},ZU=Ez.optional({factory:KH,name:"menubar",schema:[Di("backstage")]}),tj=function(t){return t.type===US.sliding?YU:t.type===US.floating?XU:JU},ej=Ez.optional({factory:{sketch:function(t){return Mz.sketch({uid:t.uid,dom:t.dom,listBehaviours:ml([Dw.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return JU({type:t.type,uid:oc("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),I.some(!0)}})},setupItem:function(t,e,n,r){zz.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Di("dom"),Di("onEscape")]}),nj=Ez.optional({factory:{sketch:function(t){var e=tj(t),n={type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),I.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes};return e(n)}},name:"toolbar",schema:[Di("dom"),Di("onEscape"),Di("getSink")]}),rj=Ez.optional({factory:{sketch:zH},name:"header",schema:[Di("dom")]}),oj=Ez.optional({name:"socket",schema:[Di("dom")]}),ij=Ez.optional({factory:{sketch:VV},name:"sidebar",schema:[Di("dom")]}),uj=Ez.optional({factory:{sketch:nU},name:"throbber",schema:[Di("dom")]}),aj=mv({name:"OuterContainer",factory:QU,configFields:[Di("dom"),Di("behaviours")],partFields:[rj,ZU,nj,ej,oj,ij,uj],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=$(n,(function(t){return $U(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=$(n,(function(t){return $(t,$U)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),cj="file edit view insert format tools table help",sj={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},fj=function(t,e,n){var r=EO(n).split(/[ ,]/);return{text:t.title,getItems:function(){return rt(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||j(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}},lj=function(t){return"string"===typeof t?t.split(" "):t},dj=function(t,e){var n=D(D({},sj),e.menus),r=pt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?lj(cj):lj(!1===e.menubar?"":e.menubar),i=Y(o,(function(t){var n=Et(sj,t);return r?n||Tt(e.menus,t).exists((function(t){return Et(t,"items")})):n})),u=$(i,(function(r){var o=n[r];return fj({title:o.title,items:lj(o.items)},e,t)}));return Y(u,(function(t){var e=function(t){return"separator"!==t.type};return t.getItems().length>0&&j(t.getItems(),e)}))},mj=function(t){var e=function(){t._skinLoaded=!0,pE(t)};return function(){t.initialized?e():t.on("init",e)}},gj=function(t,e){return function(){return hE(t,{message:e})}},pj=function(t,e,n){return new uS((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},hj=function(t,e){var n=e+"/skin.min.css";return pj(t,n,t.ui.styleSheetLoader)},vj=function(t,e){var n=Rn(ee.fromDom(t.getElement()));if(n){var r=e+"/skin.shadowdom.min.css";return pj(t,r,dO.DOM.styleSheetLoader)}return uS.resolve()},bj=function(t,e){var n=gO(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===hO(e)&&i(n)?uS.all([hj(e,n),vj(e,n)]).then(mj(e),gj(e,"Skin could not be loaded")):mj(e)()},yj=S(bj,!1),wj=S(bj,!0),xj=function(t,e){return function(n){var r=nd(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},Cj=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},Sj=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},kj=function(t,e){return function(){return t.execCommand(e)}},Oj=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return I.some({type:"separator",text:a});if("submenu"===t.type){var c=rt(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?I.none():I.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return rt(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return I.some(D({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return rt(t,(function(t){return o(t,r,e)}))},u=function(t,e){return function(n,r){var o=e(),u=i(o),a=qP(u,jS.CLOSE_ON_EXECUTE,t,!1);r(a)}};return{validateItems:i,getFetch:u}},Tj=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return $(r.data,(function(t){return NF(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:Oj(t,e,n),getStyleItems:o}},Ej=function(t,e,n){var r=Tj(t,e,n),o=r.items,i=r.getStyleItems,u=function(t){return{getComponent:w(t)}},a=Cj(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return PP({text:n.icon.isSome()?I.none():n.text,icon:n.icon,tooltip:I.from(n.tooltip),role:I.none(),fetch:o.getFetch(e,i),onSetup:a,getApi:u,columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)},_j=function(t){return $(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))},Dj=function(t){return{type:"basic",data:t}};(function(t){t[t["SemiColon"]=0]="SemiColon",t[t["Space"]=1]="Space"})(XI||(XI={}));var Aj,Rj=function(t,e){return e===XI.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")},Nj=function(t,e,n,r){var o=t.getParam(e,n,"string"),i=_j(Rj(o,r));return{type:"basic",data:i}},Bj=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],Mj=function(t){var e=function(){return tt(Bj,(function(e){return t.formatter.match(e.format)}))},n=function(e){return function(){return t.formatter.match(e)}},r=function(t){return I.none},o=function(t){var n=e(),r=n.fold(w("left"),(function(t){return t.title.toLowerCase()}));Sa(t,MP,{icon:"align-"+r})},i=Dj(Bj),u=function(e){return function(){return tt(Bj,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}};return{tooltip:"Align",text:I.none(),icon:I.some("align-left"),isSelectedFor:n,getCurrentValue:I.none,getPreviewFor:r,onAction:u,updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},Pj=function(t,e){return Ej(t,e,Mj(t))},Ij=function(t,e){var n=Tj(t,e,Mj(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Lj="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",Fj=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],zj=function(t){var e=t.split(/\s*,\s*/);return $(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},Hj=function(t){var e=function(){var e=zj(t.toLowerCase());return ot(Fj,(function(t){return e.indexOf(t.toLowerCase())>-1}))};return 0===t.indexOf("-apple-system")&&e()},Vj=function(t){var e="System Font",n=function(){var n=function(t){return t?zj(t)[0]:""},r=t.queryCommandValue("FontName"),o=c.data,i=r?r.toLowerCase():"",u=tt(o,(function(t){var e=t.format;return e.toLowerCase()===i||n(e).toLowerCase()===n(i).toLowerCase()})).orThunk((function(){return It(Hj(i),{title:e,format:i})}));return{matchOpt:u,font:r}},r=function(t){return function(e){return e.exists((function(e){return e.format===t}))}},o=function(){var t=n().matchOpt;return t},i=function(t){return function(){return I.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},u=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},a=function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(w(o),(function(t){return t.title}));Sa(t,BP,{text:i})},c=Nj(t,"font_formats",Lj,XI.SemiColon);return{tooltip:"Fonts",text:I.some(e),icon:I.none(),isSelectedFor:r,getCurrentValue:o,getPreviewFor:i,onAction:u,updateText:a,dataset:c,shouldHide:!1,isInvalid:T}},Uj=function(t,e){return Ej(t,e,Vj(t))},jj=function(t,e){var n=Tj(t,e,Vj(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Wj="8pt 10pt 12pt 14pt 18pt 24pt 36pt",qj={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},$j={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},Gj=function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},Kj=function(t,e){return/[0-9.]+px$/.test(t)?Gj(72*parseInt(t,10)/96,e||0)+"pt":Tt($j,t).getOr(t)},Xj=function(t){return Tt(qj,t).getOr("")},Yj=function(t){var e=function(){var e=I.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=Kj(r,t),i=Xj(o);e=tt(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=function(t){return function(e){return e.exists((function(e){return e.format===t}))}},r=function(){var t=e().matchOpt;return t},o=w(I.none),i=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},u=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(w(o),(function(t){return t.title}));Sa(t,BP,{text:i})},a=Nj(t,"fontsize_formats",Wj,XI.Space);return{tooltip:"Font sizes",text:I.some("12pt"),icon:I.none(),isSelectedFor:n,getPreviewFor:o,getCurrentValue:r,onAction:i,updateText:u,dataset:a,shouldHide:!1,isInvalid:T}},Jj=function(t,e){return Ej(t,e,Yj(t))},Qj=function(t,e){var n=Tj(t,e,Yj(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Zj=function(t,e){var n=e(),r=$(n,(function(t){return t.format}));return I.from(t.formatter.closest(r)).bind((function(t){return tt(n,(function(e){return e.format===t}))})).orThunk((function(){return It(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},tW="Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",eW=function(t){var e="Paragraph",n=function(e){return function(){return t.formatter.match(e)}},r=function(e){return function(){var n=t.formatter.get(e);return I.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},o=function(n){var r=Zj(t,(function(){return i.data})),o=r.fold(w(e),(function(t){return t.title}));Sa(n,BP,{text:o})},i=Nj(t,"block_formats",tW,XI.SemiColon);return{tooltip:"Blocks",text:I.some(e),icon:I.none(),isSelectedFor:n,getCurrentValue:I.none,getPreviewFor:r,onAction:Sj(t),updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},nW=function(t,e){return Ej(t,e,eW(t))},rW=function(t,e){var n=Tj(t,e,eW(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},oW=function(t,e){var n="Paragraph",r=function(e){return function(){return t.formatter.match(e)}},o=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?I.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):I.none()}},i=function(e){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[{title:t.title,format:t.format}]},o=rt(RF(t),r),i=Zj(t,w(o)),u=i.fold(w(n),(function(t){return t.title}));Sa(e,BP,{text:u})};return{tooltip:"Formats",text:I.some(n),icon:I.none(),isSelectedFor:r,getCurrentValue:I.none,getPreviewFor:o,onAction:Sj(t),updateText:i,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},iW=function(t,e){var n=D({type:"advanced"},e.styleselect);return Ej(t,e,oW(t,n))},uW=function(t,e){var n=D({type:"advanced"},e.styleselect),r=Tj(t,e,oW(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})},aW=function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=$(o,n.getSystem().build);jg(n,i)}))};return _a([Na(ta(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;U(o.channels,i)&&n(e,o.data)}})),Ua((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])},cW=Object.freeze({__proto__:null,events:aW}),sW=function(t,e,n){return n},fW=Object.freeze({__proto__:null,getState:sW}),lW=[Di("channel"),Hi("renderComponents"),Hi("updateState"),Hi("initialData")],dW=function(){var t=ou(I.none()),e=function(){return t.set(I.none())},n=function(){return t.get().getOr("none")};return{readState:n,get:t.get,set:t.set,clear:e}},mW=Object.freeze({__proto__:null,init:dW}),gW=pl({fields:lW,name:"reflecting",active:cW,apis:fW,state:mW}),pW=w([Di("toggleClass"),Di("fetch"),ff("onExecute"),Ki("getHotspot",I.some),Ki("getAnchorOverrides",w({})),zd(),ff("onItemExecute"),Hi("lazySink"),Di("dom"),cf("onOpen"),eh("splitDropdownBehaviours",[bA,Dw,Yw]),Ki("matchWidth",!1),Ki("useMinWidth",!1),Ki("eventOrder",{}),Hi("role")].concat(BA())),hW=Bh({factory:SC,schema:[Di("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:ml([Yw.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(ka)},buttonBehaviours:ml([px.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),vW=Bh({factory:SC,schema:[Di("dom")],name:"button",defaults:function(){return{buttonBehaviours:ml([Yw.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),bW=w([hW,vW,Ph({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Di("text")],name:"aria-descriptor"}),Mh({schema:[of()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),wA()]),yW=function(t,e,n,r){var o,i=function(t){bv.getCurrent(t).each((function(t){rb.highlightFirst(t),Dw.focusIn(t)}))},u=function(e){var n=i;EA(t,x,e,r,n,qD.HighlightFirst).get(h)},a=function(t){return u(t),I.some(!0)},c=function(e){var n=Xh(e,t,"button");return ka(n),I.some(!0)},s=D(D({},_a([Ua((function(e,n){var r=Kh(e,t,"aria-descriptor");r.each((function(t){var n=oc("aria");Hn(t.element,"id",n),Hn(e.element,"aria-describedby",n)}))}))])),vx(I.some(u))),f={repositionMenus:function(t){px.isOn(t)&&NA(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:f,eventOrder:D(D({},t.eventOrder),(o={},o[ea()]=["disabling","toggling","alloy.base.behaviour"],o)),events:s,behaviours:rh(t.splitDropdownBehaviours,[bA.config({others:{sandbox:function(e){var n=Xh(e,t,"arrow"),r={onOpen:function(){px.on(n),px.on(e)},onClose:function(){px.off(n),px.off(e)}};return RA(t,e,r)}}}),Dw.config({mode:"special",onSpace:c,onEnter:c,onDown:a}),Yw.config({}),px.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},wW=mv({name:"SplitDropdown",configFields:pW(),partFields:bW(),factory:yW,apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),xW=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},CW=function(t){return{setActive:function(e){px.set(t,e)},isActive:function(){return px.isOn(t)},isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},SW=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},kW=oc("focus-button"),OW=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:SW(n,i)},components:yT([t.map((function(t){return EP(t,i.icons)})),e.map((function(t){return DP(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Bu()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ml([mT.toolbarButton(i.isDisabled),cT(),Vw("common-button-display-events",[Na(Bu(),(function(t,e){e.event.prevent(),Ca(t,kW)}))])].concat(r.map((function(n){return gW.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return yT([t.icon.map((function(t){return EP(t,i.icons)})),t.text.map((function(t){return DP(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},TW=function(t,e,n,r){var o=e.shared;return DU.sketch({lazySink:o.getSink,fetch:function(){return tA.nu((function(e){e($(n(t.items),$U))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:OW(t.icon,t.text,t.tooltip,I.none(),I.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})},EW=function(t,e,n){var r=ou(h),o=OW(t.icon,t.text,t.tooltip,I.none(),I.none(),n);return SC.sketch({dom:o.dom,components:o.components,eventOrder:NP,buttonBehaviours:ml([Vw("toolbar-button-events",[RP({onAction:t.onAction,getApi:e.getApi}),pT(e,r),hT(e,r)]),mT.toolbarButton((function(){return t.disabled||n.isDisabled()})),cT()].concat(e.toolbarButtonBehaviours))})},_W=function(t,e){return DW(t,e,[])},DW=function(t,e,n){return EW(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Vw("toolbarButtonWith",n)]:[]),getApi:xW,onSetup:t.onSetup},e)},AW=function(t,e){return RW(t,e,[])},RW=function(t,e,n){return Co(EW(t,{toolbarButtonBehaviours:[zw.config({}),px.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Vw("toolbarToggleButtonWith",n)]:[]),getApi:CW,onSetup:t.onSetup},e))},NW=function(t,e,n){return function(r){return tA.nu((function(t){return e.fetch(t)})).map((function(o){return I.from(N_(Co(n_(oc("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,jS.CLOSE_ON_EXECUTE,e.select.getOr(T),n),{movement:o_(e.columns,e.presets),menuBehaviours:Qk.unnamedEvents("auto"!==e.columns?[]:[Ua((function(t,n){Xk(t,4,fk(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Dw.setGridSize(t,n,r)}))}))])})))}))}},BW=function(t,e){var n,r=oc("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)},setIconFill:function(e,n){Fs(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Hn(t,"fill",n)}))},setIconStroke:function(e,n){Fs(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Hn(t,"stroke",n)}))},setActive:function(e){Hn(t.element,"aria-pressed",e),Fs(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return px.set(t,e)}))}))},isActive:function(){return Fs(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(px.isOn)}))}}},i=ou(h),u={getApi:o,onSetup:t.onSetup};return wW.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:D({"aria-pressed":!1},SW(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:ml([mT.splitButton(e.providers.isDisabled),cT(),Vw("split-dropdown-events",[Na(kW,Yw.focus),pT(u,i),hT(u,i)]),VA.config({})]),eventOrder:(n={},n[da()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:NW(o,t,e.providers),parts:{menu:hk(!1,t.columns,t.presets)},components:[wW.parts.button(OW(t.icon,t.text,I.none(),I.some(r),I.some([px.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),wW.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:RC("chevron-down",e.providers.icons)},buttonBehaviours:ml([mT.splitButton(e.providers.isDisabled),cT(),MC()])}),wW.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})},MW=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],PW=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Si(t)})).getOrDie();return e(i,r,o)}},IW={button:PW(TS,(function(t,e){return _W(t,e.backstage.shared.providers)})),togglebutton:PW(DS,(function(t,e){return AW(t,e.backstage.shared.providers)})),menubutton:PW(WH,(function(t,e){return GP(t,"tox-tbtn",e.backstage,I.none())})),splitbutton:PW($H,(function(t,e){return BW(t,e.backstage.shared)})),grouptoolbarbutton:PW(VH,(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=function(t){return WW(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,I.none())},u=(r={},r[Ld]=e.backstage.shared.header.isPositionedAtTop()?zl.TopToBottom:zl.BottomToTop,r);switch(BO(n)){case US.floating:return TW(t,e.backstage,i,u);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return iW(t,e.backstage)},fontsizeSelectButton:function(t,e){return Jj(t,e.backstage)},fontSelectButton:function(t,e){return Uj(t,e.backstage)},formatButton:function(t,e){return nW(t,e.backstage)},alignMenuButton:function(t,e){return Pj(t,e.backstage)}},LW=function(t,e,n){return Tt(IW,t.type).fold((function(){return I.none()}),(function(r){return I.some(r(t,e,n))}))},FW={styleselect:IW.styleSelectButton,fontsizeselect:IW.fontsizeSelectButton,fontselect:IW.fontSelectButton,formatselect:IW.formatButton,align:IW.alignMenuButton},zW=function(t){var e=$(MW,(function(e){var n=Y(e.items,(function(e){return Et(t,e)||Et(FW,e)}));return{name:e.name,items:n}}));return Y(e,(function(t){return t.items.length>0}))},HW=function(t){var e=t.split("|");return $(e,(function(t){return{items:t.trim().split(" ")}}))},VW=function(t){return p(t,(function(t){return Et(t,"name")&&Et(t,"items")}))},UW=function(t){var e=t.toolbar,n=t.buttons;return!1===e?[]:void 0===e||!0===e?zW(n):i(e)?HW(e):VW(e)?e:[]},jW=function(t,e,n,r,o,i){return Tt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return gt(t,(function(t){return Tt(e,t+n.toLowerCase())}))}))})).fold((function(){return Tt(FW,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return I.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?LW(e,o,t):I.none()}))},WW=function(t,e,n,r){var o=UW(e),i=$(o,(function(o){var i=rt(o.items,(function(o){return 0===o.trim().length?[]:jW(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:I.from(t.translate(o.name)),items:i}}));return Y(i,(function(t){return t.items.length>0}))},qW=function(t,e,n,r){var o=e.outerContainer,u=n.toolbar,a=n.buttons;if(p(u,i)){var c=u.map((function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return WW(t,o,{backstage:r},I.none())}));aj.setToolbars(o,c)}else aj.setToolbar(o,WW(t,n,{backstage:r},I.none()))},$W=en(),GW=$W.os.isiOS()&&$W.os.version.major<=12,KW=function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=ou(fr(r.innerWidth,r.innerHeight)),u=ou(fr(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(fr(r.innerWidth,r.innerHeight)),bE(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(fr(e.offsetWidth,e.offsetHeight)),bE(t))},s=function(e){return yE(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var f=ad(ee.fromDom(t.getBody()),"load",c),l=e.uiMothership.element;t.on("hide",(function(){Kn(l,"display","none")})),t.on("show",(function(){nr(l,"display")})),t.on("NodeChange",c),t.on("remove",(function(){f.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))},XW=function(t,e,n,r,o){var i=ou(0),u=e.outerContainer;yj(t);var a=ee.fromDom(o.targetNode),c=An(Dn(a));Yg(a,e.mothership),Xg(c,e.uiMothership),t.on("PostRender",(function(){qW(t,e,n,r),i.set(t.getWin().innerWidth),aj.setMenubar(u,dj(t,n)),aj.setSidebar(u,n.sidebar),KW(t,e)}));var s=aj.getSocket(u).getOrDie("Could not find expected socket element");if(GW){Xn(s.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var f=jC((function(){t.fire("ScrollContent")}),20),l=ud(s.element,"scroll",f.throttle);t.on("remove",l.unbind)}aT(t,e),t.addCommand("ToggleSidebar",(function(e,n){aj.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return aj.whichSidebar(u)}));var d=BO(t),m=function(){aj.refreshToolbar(e.outerContainer)};d!==US.sliding&&d!==US.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var e=t.getWin().innerWidth;e!==i.get()&&(m(),i.set(e))}));var g={enable:function(){uT(e,!1)},disable:function(){uT(e,!0)},isDisabled:function(){return Lv.isDisabled(u)}};return{iframeContainer:s.element.dom,editorContainer:u.element.dom,api:g}},YW=Object.freeze({__proto__:null,render:XW}),JW=function(t){var e=/^[0-9\.]+(|px)$/i;return e.test(""+t)?I.some(parseInt(""+t,10)):I.none()},QW=function(t){return g(t)?t+"px":t},ZW=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},tq=function(t){var e=vO(t),n=wO(t),r=CO(t);return JW(e).map((function(t){return ZW(t,n,r)}))},eq=function(t){var e=tq(t);return e.getOr(vO(t))},nq=function(t){var e=bO(t),n=yO(t),r=xO(t);return JW(e).map((function(t){return ZW(t,n,r)}))},rq=function(t){var e=nq(t);return e.getOr(bO(t))},oq=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=dO.DOM,c=UO(t),s=qO(t),f=xO(t).or(nq(t)),l=r.shared.header,d=l.isPositionedAtTop,m=BO(t),g=m===US.sliding||m===US.floating,p=ou(!1),h=function(){return p.get()&&!t.removed},v=function(t){return g?t.fold(w(0),(function(t){return t.components().length>1?ur(t.components()[1].element):0})):0},b=function(n){switch(IO(t)){case NO.auto:var r=aj.getToolbar(u),o=v(r),i=ur(n.element)-o,a=Jr(e),c=a.y>i;if(c)return"top";var s=pn(e),f=Math.max(s.dom.scrollHeight,ur(s)),l=a.bottom<f-i;if(l)return"bottom";var d=Zr(),m=d.bottom<a.bottom-i;return m?"bottom":"top";case NO.bottom:return"bottom";case NO.top:default:return"top"}},y=function(t){var e=o.get();CH.setModes(e,[t]),l.setDockingMode(t);var n=d()?zl.TopToBottom:zl.BottomToTop;Hn(e.element,Ld,n)},x=function(){var t=f.getOrThunk((function(){var t=JW(Jn(Ln(),"margin-left")).getOr(0);return vr(Ln())-mr(e).left+t}));Kn(o.get().element,"max-width",t+"px")},C=function(){var t=aj.getToolbar(u),n=v(t),r=Jr(e),i=d()?Math.max(r.y-ur(o.get().element)+n,0):r.bottom;Xn(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})},S=function(){i.broadcastOn([wp()],{})},k=function(t){if(void 0===t&&(t=!1),h()){if(c||x(),g&&aj.refreshToolbar(u),c||C(),s){var e=o.get();t?CH.reset(e):CH.refresh(e)}S()}},O=function(t){if(void 0===t&&(t=!0),!c&&s&&h()){var e=l.getDockingMode(),n=b(o.get());n!==e&&(y(n),t&&k(!0))}},T=function(){p.set(!0),Kn(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),nr(i.element,"display"),O(!1),k()},E=function(){p.set(!1),n.outerContainer&&(Kn(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Kn(i.element,"display","none")};return{isVisible:h,isPositionedAtTop:d,show:T,hide:E,update:k,updateMode:O,repositionPopups:S}},iq=function(t,e){var n=Jr(t);return{pos:e?n.y:n.bottom,bounds:n}},uq=function(t,e,n,r){var o=ou(iq(e,n.isPositionedAtTop())),i=function(r){var i=iq(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,f=c.bounds,l=a.height!==f.height||a.width!==f.width;o.set({pos:u,bounds:a}),l&&bE(t,r),n.isVisible()&&(s!==u?n.update(!0):l&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){xC.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=nd();u.set(ad(ee.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))},aq=function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=ou(null),s=ee.fromDom(o.targetNode),f=oq(t,s,e,r,c),l=HO(t);wj(t);var d=function(){if(c.get())f.show();else{c.set(aj.getHeader(a).getOrDie());var o=jO(t);Xg(o,i),Xg(o,u),qW(t,e,n,r),aj.setMenubar(a,dj(t,n)),f.show(),uq(t,s,f,l),t.nodeChanged()}};t.on("show",d),t.on("hide",f.hide),l||(t.on("focus",d),t.on("blur",f.hide)),t.on("init",(function(){(t.hasFocus()||l)&&d()})),aT(t,e);var m={show:function(){f.show()},hide:function(){f.hide()},enable:function(){uT(e,!1)},disable:function(){uT(e,!0)},isDisabled:function(){return Lv.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}},cq=Object.freeze({__proto__:null,render:aq}),sq="contexttoolbar-show",fq="contexttoolbar-hide",lq=function(t){return{hide:function(){return Ca(t,ia())},getValue:function(){return th.getValue(t)}}},dq=function(t,e){return Na(AP,(function(n,r){var o=t.get(n),i=lq(o);e.onAction(i,r.event.buttonApi)}))},mq=function(t,e,n){var r=e.original;r.primary;var o=A(r,["primary"]),i=xi(TS(D(D({},o),{type:"button",onAction:h})));return DW(i,n.backstage.shared.providers,[dq(t,e)])},gq=function(t,e,n){var r=e.original;r.primary;var o=A(r,["primary"]),i=xi(DS(D(D({},o),{type:"togglebutton",onAction:h})));return RW(i,n.backstage.shared.providers,[dq(t,e)])},pq=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?gq(t,e,r):mq(t,e,r)},hq=function(t,e,n){var r=$(e,(function(e){return kC(pq(t,e,n))})),o=function(){return $(r,(function(t){return t.asSpec()}))},i=function(t){return gt(e,(function(e,n){return e.primary?I.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(k(Lv.isDisabled)):I.none()}))};return{asSpecs:o,findPrimary:i}},vq=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=kC(UD.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:ml([Dw.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return ka(t),!0}))},onLeft:function(t,e){return e.cut(),I.none()},onRight:function(t,e){return e.cut(),I.none()}})])})),o=hq(r,t.commands,e);return[{title:I.none(),items:[r.asSpec()]},{title:I.none(),items:o.asSpecs()}]},bq=function(t,e,n){return JU({type:t,uid:oc("context-toolbar"),initGroups:vq(e,n),onEscape:I.none,cyclicKeying:!0,providers:n})},yq={renderContextForm:bq,buildInitGroups:vq},wq=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},xq=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=On(ee.fromDom(t.startContainer),t.startOffset).element,r=le(n)?vn(n):I.some(n);return r.filter(fe).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e},Cq=function(t){var e=t.selection.getRng(),n=xq(e);if(t.inline){var r=Lr();return Yr(r.left+n.left,r.top+n.top,n.width,n.height)}var o=Qr(ee.fromDom(t.getBody()));return Yr(o.x+n.left,o.y+n.top,n.width,n.height)},Sq=function(t,e){return e.filter(In).map(Qr).getOrThunk((function(){return Cq(t)}))},kq=function(t,e,n){var r=Math.max(t.x+n,e.x),o=Math.min(t.right-n,e.right);return{x:r,width:o-r}},Oq=function(t,e,n,r,o,i){var u=ee.fromDom(t.getContainer()),a=Fs(u,".tox-editor-header").getOr(u),c=Jr(a),s=c.y>=e.bottom,f=r&&!s;if(t.inline&&f)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!f)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var l="line"===o?Jr(u):e;return f?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(l.bottom-i,n.bottom)}:{y:Math.max(l.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}},Tq=function(t,e,n,r){void 0===r&&(r=0);var o=Vr(window),i=Jr(ee.fromDom(t.getContentAreaContainer())),u=_O(t)||DO(t)||RO(t),a=kq(i,o,r),c=a.x,s=a.width;if(t.inline&&!u)return Yr(c,o.y,s,o.height);var f=e.header.isPositionedAtTop(),l=Oq(t,i,o,f,n,r),d=l.y,m=l.bottom;return Yr(c,d,s,m-d)},Eq=12,_q={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},Dq={maxHeightFunction:Ed(),maxWidthFunction:xU()},Aq=function(t,e){var n=t.selection.getRng(),r=On(ee.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&sn(r.element,e)},Rq=function(t,e,n){var r=Zn(t,"position");Kn(t,"position",e);var o=n(t);return r.each((function(e){return Kn(t,"position",e)})),o},Nq=function(t){return"node"===t},Bq=function(t,e,n,r,o){var i=Cq(t),u=r.lastElement().exists((function(t){return sn(n,t)}));if(Aq(t,n))return u?bC:mC;if(u)return Rq(e,r.getMode(),(function(){var t=wq(i,Jr(e));return t&&!r.isReposition()?wC:bC}));var a="fixed"===r.getMode()?o.y+Lr().top:o.y,c=ur(e)+Eq;return a+c<=i.y?mC:gC},Mq=function(t,e,n,r){var o=function(e){return function(r,o,i,u,a){var c=Bq(t,u,e,n,a),s=D(D({},r),{y:a.y,height:a.height});return D(D({},c(s,o,i,u,a)),{alwaysFit:!0})}},i=function(t){return Nq(r)?[o(t)]:[]},u={onLtr:function(t){return[$f,Gf,Wf,Uf,qf,jf].concat(i(t))},onRtl:function(t){return[$f,Gf,qf,jf,Wf,Uf].concat(i(t))}},a={onLtr:function(t){return[Gf,Uf,jf,Wf,qf,$f].concat(i(t))},onRtl:function(t){return[Gf,jf,Uf,qf,Wf,$f].concat(i(t))}};return e?a:u},Pq=function(t,e,n,r){return"line"===e?{bubble:Nd(Eq,0,_q),layouts:{onLtr:function(){return[Kf]},onRtl:function(){return[Xf]}},overrides:Dq}:{bubble:Nd(0,Eq,_q,1/Eq),layouts:Mq(t,n,r,e),overrides:Dq}},Iq=function(t,e){var n=Y(e,(function(e){return e.predicate(t.dom)})),r=X(n,(function(t){return"contexttoolbar"===t.type})),o=r.pass,i=r.fail;return{contextToolbars:o,contextForms:i}},Lq=function(t){if(t.length<=1)return t;var e=function(e){return j(t,(function(t){return t.position===e}))},n=function(e){return Y(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=$(n("selection"),(function(t){return D(D({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")},Fq=function(t){if(t.length<=1)return t;var e=function(e){return tt(t,(function(t){return t.position===e}))},n=e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position}));return n.fold((function(){return[]}),(function(e){return Y(t,(function(t){return t.position===e}))}))},zq=function(t,e,n){var r=Iq(t,e);if(r.contextForms.length>0)return I.some({elem:t,toolbars:[r.contextForms[0]]});var o=Iq(t,n);if(o.contextForms.length>0)return I.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=Lq(r.contextToolbars.concat(o.contextToolbars));return I.some({elem:t,toolbars:i})}return I.none()},Hq=function(t,e,n){return t(e)?I.none():yu(e,(function(t){if(fe(t)){var e=Iq(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:Fq(r);return i.length>0?I.some({elem:t,toolbars:i}):I.none()}return I.none()}),t)},Vq=function(t,e){var n=ee.fromDom(e.getBody()),r=function(t){return sn(t,n)},o=function(t){return!r(t)&&!dn(n,t)},i=ee.fromDom(e.selection.getNode());return o(i)?I.none():zq(i,t.inNodeScope,t.inEditorScope).orThunk((function(){return Hq(r,i,t)}))},Uq=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=xi(LS(a));n[t]=c,c.launch.map((function(n){i["form:"+t]=D(D({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){zS(e).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=pt(t);return G(s,(function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},jq=oc("forward-slide"),Wq=oc("backward-slide"),qq=oc("change-slide-event"),$q="tox-pop--resizing",Gq=function(t){var e=ou([]);return eC.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){e.set([]),eC.getContent(t).each((function(t){nr(t.element,"visibility")})),as(t.element,$q),nr(t.element,"width")},inlineBehaviours:ml([Vw("context-toolbar-events",[Va($u(),(function(t,e){"width"===e.event.raw.propertyName&&(as(t.element,$q),nr(t.element,"width"))})),Na(qq,(function(t,e){var n=t.element;nr(n,"width");var r=vr(n);eC.setContent(t,e.event.contents),is(n,$q);var o=vr(n);Kn(n,"width",r+"px"),eC.getContent(t).each((function(t){e.event.focus.bind((function(t){return Sl(t),El(n)})).orThunk((function(){return Dw.focusIn(t),Tl(Dn(n))}))})),xC.setTimeout((function(){Kn(t.element,"width",o+"px")}),0)})),Na(jq,(function(t,n){eC.getContent(t).each((function(n){e.set(e.get().concat([{bar:n,focus:Tl(Dn(t.element))}]))})),Sa(t,qq,{contents:n.event.forwardContents,focus:I.none()})})),Na(Wq,(function(t,n){dt(e.get()).each((function(n){e.set(e.get().slice(0,e.get().length-1)),Sa(t,qq,{contents:_s(n.bar),focus:n.focus})}))}))]),Dw.config({mode:"special",onEscape:function(n){return dt(e.get()).fold((function(){return t.onEscape()}),(function(t){return Ca(n,Wq),I.some(!0)}))}})]),lazySink:function(){return ro.value(t.sink)}})},Kq="tox-pop--transition",Xq=function(t,e,n,r){var o=r.backstage,i=o.shared,u=en().deviceType.isTouch,a=od(),c=od(),s=od(),f=Es(Gq({sink:n,onEscape:function(){return t.focus(),I.some(!0)}})),l=function(){var e=s.get().getOr("node"),n=Nq(e)?1:0;return Tq(t,i,e,n)},d=function(){return!t.removed&&!(u()&&o.isContextMenuOpen())},m=function(t){return Dt(Bt(t,a.get(),sn),!0)},g=function(){if(d()){var e=l(),n=Dt(s.get(),"node")?Sq(t,a.get()):Cq(t);return e.height<=0||!wq(n,e)}return!0},p=function(){a.clear(),c.clear(),s.clear(),eC.hide(f)},v=function(){if(eC.isOpen(f)){var t=f.element;nr(t,"display"),g()?Kn(t,"display","none"):(c.set(0),eC.reposition(f))}},b=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:ml([Dw.config({mode:"acyclic"}),Vw("pop-dialog-wrap-events",[Ua((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Dw.focusIn(e)}))})),ja((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},y=ge((function(){return Uq(e,(function(t){var e=C([t]);Sa(f,jq,{forwardContents:b(e)})}))})),w=function(e,n){return WW(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,I.some(["form:"]))},x=function(t,e){return yq.buildInitGroups(t,e)},C=function(e){var n=t.ui.registry.getAll().buttons,r=y(),o=D(D({},n),r.formNavigators),u=BO(t)===US.scrolling?US.scrolling:US.default,a=nt($(e,(function(t){return"contexttoolbar"===t.type?w(o,t):x(t,i.providers)})));return JU({type:u,uid:oc("context-toolbar"),initGroups:a,onEscape:I.none,cyclicKeying:!0,providers:i.providers})},S=function(e,r){var o="node"===e?i.anchors.node(r):i.anchors.cursor(),s=Pq(t,e,u(),{lastElement:a.get,isReposition:function(){return Dt(c.get(),0)},getMode:function(){return Fg.getMode(n)}});return Co(o,s)},k=function(t,e){if(O.cancel(),d()){var r=C(t),o=t[0].position,i=S(o,e);s.set(o),c.set(1);var u=f.element;nr(u,"display"),m(e)||(as(u,Kq),Fg.reset(n,f)),eC.showWithinBounds(f,b(r),{anchor:i,transition:{classes:[Kq],mode:"placement"}},(function(){return I.some(l())})),e.fold(a.clear,a.set),g()&&Kn(u,"display","none")}},O=WC((function(){if(t.hasFocus()&&!t.removed)if(cs(f.element,Kq))O.throttle();else{var e=y();Vq(e,t).fold(p,(function(t){k(t.toolbars,I.some(t.elem))}))}}),17);t.on("init",(function(){t.on("remove",p),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",v),t.on("click keyup focus SetContent",O.throttle),t.on(fq,p),t.on(sq,(function(e){var n=y();Tt(n.lookupTable,e.toolbarKey).each((function(n){k([n],It(e.target!==t,e.target)),eC.getContent(f).each(Dw.focusIn)}))})),t.on("focusout",(function(e){xC.setEditorTimeout(t,(function(){El(n.element).isNone()&&El(f.element).isNone()&&p()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&p()})),t.on("AfterProgressState",(function(e){e.state?p():t.hasFocus()&&O.throttle()})),t.on("NodeChange",(function(t){El(f.element).fold(O.throttle,h)}))}))},Yq=function(t){var e=[{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}];G(e,(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kj(t,e.cmd),onSetup:xj(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:kj(t,"JustifyNone")})},Jq={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Qq=function(){var t="[0-9]+",e="[+-]?"+t,n="[eE]"+e,r="\\.",o=function(t){return"(?:"+t+")?"},i=["Infinity",t+r+o(t)+o(n),r+t+o(n),t+o(n)].join("|"),u="[+-]?(?:"+i+")";return new RegExp("^("+u+")(.*)$")}(),Zq=function(t,e){return j(e,(function(e){return j(Jq[e],(function(e){return t===e}))}))},t$=function(t,e){var n=I.from(Qq.exec(t));return n.bind((function(t){var n=Number(t[1]),r=t[2];return Zq(r,e)?I.some({value:n,unit:r}):I.none()}))},e$=function(t,e){return t$(t,e).map((function(t){var e=t.value,n=t.unit;return e+n}))},n$=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=od();return $(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var u=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};u(Dt(r,e.hash(n)));var a=e.watcher(t,n,u);return function(){o.clear(),a()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},r$={name:"lineheight",text:"Line height",icon:"line-height",getOptions:OO,hash:function(t){return e$(t,["fixed","relative","empty"]).getOr(t)},display:x,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return I.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},o$=function(t){var e=I.from(TO(t));return e.map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:w(e),hash:function(t){return f(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=ee.fromDom(t.selection.getNode());return wu(e,(function(t){return I.some(t).filter(fe).bind((function(t){var e=jn(t,"lang");return e.map((function(e){var n=jn(t,"data-mce-lang").getOrUndefined();return{code:e,customCode:n,title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=nd();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))},i$=function(t){n$(t,r$),o$(t).each((function(e){return n$(t,e)}))},u$=function(t,e){Ij(t,e),jj(t,e),uW(t,e),rW(t,e),Qj(t,e)},a$=function(t){return Cj(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},c$=function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:a$(t),onAction:kj(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:kj(t,"indent")})},s$=function(t){c$(t)},f$=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},l$=function(t){QB.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:xj(t,e.name),onAction:f$(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:xj(t,n),onAction:f$(t,n)})}},d$=function(t){QB.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kj(t,e.action)})}))},m$=function(t){QB.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kj(t,e.action),onSetup:xj(t,e.name)})}))},g$=function(t){l$(t),d$(t),m$(t)},p$=function(t){QB.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:kj(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:f$(t,"code")})},h$=function(t){g$(t),p$(t)},v$=function(t,e){return Cj(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},b$=function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:v$(t,"hasUndo"),onAction:kj(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:v$(t,"hasRedo"),onAction:kj(t,"redo")})},y$=function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:v$(t,"hasUndo"),onAction:kj(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:v$(t,"hasRedo"),onAction:kj(t,"redo")})},w$=function(t){b$(t),y$(t)},x$=function(t){return Cj(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},C$=function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:x$(t),onAction:kj(t,"mceToggleVisualAid")})},S$=function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:kj(t,"mceToggleVisualAid")})},k$=function(t){S$(t),C$(t)},O$=function(t,e){Yq(t),h$(t),u$(t,e),w$(t),e_(t),k$(t),s$(t),i$(t)},T$=function(t,e){return{type:"makeshift",x:t,y:e}},E$=function(t,e,n){return T$(t.x+e,t.y+n)},_$=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},D$=function(t){if(_$(t)){var e=t.touches[0];return T$(e.pageX,e.pageY)}return T$(t.pageX,t.pageY)},A$=function(t){if(_$(t)){var e=t.touches[0];return T$(e.clientX,e.clientY)}return T$(t.clientX,t.clientY)},R$=function(t,e){var n=dO.DOM.getPos(t);return E$(e,n.x,n.y)},N$=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?D$(e):R$(t.getContentAreaContainer(),A$(e)):B$(t)},B$=function(t){return{type:"selection",root:ee.fromDom(t.selection.getNode())}},M$=function(t){return{type:"node",node:I.some(ee.fromDom(t.selection.getNode())),root:ee.fromDom(t.getBody())}},P$=function(t,e,n){switch(n){case"node":return M$(t);case"point":return N$(t,e);case"selection":return B$(t)}},I$=function(t,e,n,r,o,i){var u=n(),a=P$(t,e,i);qP(u,jS.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),eC.showMenuAt(o,{anchor:a},{menu:{markers:mk("normal")},data:t})}))},L$={onLtr:function(){return[Gf,Uf,jf,Wf,qf,$f,mC,gC,dC,fC,lC,sC]},onRtl:function(){return[Gf,jf,Uf,qf,Wf,$f,mC,gC,lC,sC,dC,fC]}},F$=12,z$={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},H$=function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng(),i=ng(t.getWin(),km.domRange(o));return i.exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))},V$=function(t){var e=t.selection.getRng(),n=function(){xC.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}},U$=function(t,e,n){var r=P$(t,e,n),o="point"===n?F$:0;return D({bubble:Nd(0,o,z$),layouts:L$,overrides:{maxWidthFunction:xU(),maxHeightFunction:Ed()}},r)},j$=function(t,e,n,r,o,i,u){var a=U$(t,e,i);qP(n,jS.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),eC.showMenuWithinBounds(o,{anchor:a},{menu:{markers:mk("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return I.some(Tq(t,r.shared,"node"===i?"node":"selection"))})),t.fire(fq)}))},W$=function(t,e,n,r,o,i){var u=en(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),f=u.deviceType.isTouch(),l=function(){return!(s||a||c&&f)},d=function(){var u=n();j$(t,e,u,r,o,i,l())};if((c||a)&&"node"!==i){var m=function(){V$(t),d()};H$(t,e)?m():(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)})))}else d()},q$=function(t){return"string"===typeof t?t.split(/[ ,]/):t},$$=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},G$=function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return I.from(t.getParam(e)).map(q$).getOrThunk((function(){return Y(q$(n),(function(t){return Et(r,t)}))}))},K$=function(t){return!1===t.getParam("contextmenu")},X$=function(t){return G$(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},Y$=function(t){return t.getParam("contextmenu_avoid_overlap","","string")},J$=function(t){return i(t)?"|"===t:"separator"===t.type},Q$={type:"separator"},Z$=function(t){var e=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(i(t))return t;switch(t.type){case"separator":return Q$;case"submenu":return D(D({type:"nestedmenuitem"},e(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return i(e)?e:$(e,Z$)}});default:return D(D({type:"menuitem"},e(t)),{onAction:v(t.onAction)})}},tG=function(t,e){if(0===e.length)return t;var n=dt(t).filter((function(t){return!J$(t)})),r=n.fold((function(){return[]}),(function(t){return[Q$]}));return t.concat(r).concat(e).concat([Q$])},eG=function(t,e,n){var r=Q(e,(function(e,r){return Tt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(i(r))return tG(e,r.split(" "));if(r.length>0){var o=$(r,Z$);return tG(e,o)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&J$(r[r.length-1])&&r.pop(),r},nG=function(t,e){return e.ctrlKey&&!$$(t)},rG=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},oG=function(t,e){return rG(t,e)?t.selection.getStart(!0):e.target},iG=function(t,e){var n=Y$(t),r=rG(t,e)?"selection":"point";if(Gt(n)){var o=oG(t,e),i=I_(ee.fromDom(o),n);return i?"node":r}return r},uG=function(t,e,n){var r=en(),o=r.deviceType.isTouch,i=Es(eC.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ml([Vw("dismissContextMenu",[Na(ga(),(function(e,n){bp.close(e),t.focus()}))])])})),u=function(t){return eC.hide(i)},a=function(e){if($$(t)&&e.preventDefault(),!nG(t,e)&&!K$(t)){var r=iG(t,e),u=function(){var n=oG(t,e),r=t.ui.registry.getAll(),o=X$(t);return eG(r.contextMenus,o,n)},a=o()?W$:I$;a(t,e,u,n,i,r)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(e,u),t.on("longpress contextmenu",a)}))},aG=uu.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),cG=function(t){return function(e){return e.translate(-t.left,-t.top)}},sG=function(t){return function(e){return e.translate(t.left,t.top)}},fG=function(t){return function(e,n){return Q(t,(function(t,e){return e(t)}),fr(e,n))}},lG=function(t,e,n){return t.fold(fG([sG(n),cG(e)]),fG([cG(e)]),fG([]))},dG=function(t,e,n){return t.fold(fG([sG(n)]),fG([]),fG([sG(e)]))},mG=function(t,e,n){return t.fold(fG([]),fG([cG(n)]),fG([sG(e),cG(n)]))},gG=function(t,e,n,r,o,i){var u=dG(t,o,i),a=dG(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r},pG=function(t,e,n,r,o,i){var u=dG(t,o,i),a=dG(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return fr(c,s)},hG=function(t,e,n){var r=t.fold((function(t,e){return{position:I.some("absolute"),left:I.some(t+"px"),top:I.some(e+"px")}}),(function(t,e){return{position:I.some("absolute"),left:I.some(t-n.left+"px"),top:I.some(e-n.top+"px")}}),(function(t,e){return{position:I.some("fixed"),left:I.some(t+"px"),top:I.some(e+"px")}}));return D({right:I.none(),bottom:I.none()},r)},vG=function(t,e,n){return t.fold((function(t,r){return yG(t+e,r+n)}),(function(t,r){return wG(t+e,r+n)}),(function(t,r){return xG(t+e,r+n)}))},bG=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(mG,yG),o(dG,wG),o(lG,xG))},yG=aG.offset,wG=aG.absolute,xG=aG.fixed,CG=function(t,e){var n=Un(t,e);return f(n)?NaN:parseInt(n,10)},SG=function(t,e){var n=t.element,r=CG(n,e.leftAttr),o=CG(n,e.topAttr);return isNaN(r)||isNaN(o)?I.none():I.some(fr(r,o))},kG=function(t,e,n){var r=t.element;Hn(r,e.leftAttr,n.left+"px"),Hn(r,e.topAttr,n.top+"px")},OG=function(t,e){var n=t.element;qn(n,e.leftAttr),qn(n,e.topAttr)},TG=function(t,e,n,r){return SG(t,e).fold((function(){return n}),(function(t){return xG(t.left+r.left,t.top+r.top)}))},EG=function(t,e,n,r,o,i){var u=TG(t,e,n,r),a=e.mustSnap?AG(t,e,u,o,i):RG(t,e,u,o,i),c=lG(u,o,i);return kG(t,e,c),a.fold((function(){return{coord:xG(c.left,c.top),extra:I.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},_G=function(t,e){OG(t,e)},DG=function(t,e,n,r){return gt(t,(function(t){var o=t.sensor,i=gG(e,o,t.range.left,t.range.top,n,r);return i?I.some({output:bG(t.output,e,n,r),extra:t.extra}):I.none()}))},AG=function(t,e,n,r,o){var i=e.getSnapPoints(t),u=DG(i,n,r,o);return u.orThunk((function(){var t=Q(i,(function(t,e){var i=e.sensor,u=pG(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:I.some(u),snap:I.some(e)}}),(function(n){var r=(u.left+u.top)/2,o=(n.left+n.top)/2;return r<=o?{deltas:I.some(u),snap:I.some(e)}:t}))}),{deltas:I.none(),snap:I.none()});return t.snap.map((function(t){return{output:bG(t.output,n,r,o),extra:t.extra}}))}))},RG=function(t,e,n,r,o){var i=e.getSnapPoints(t);return DG(i,n,r,o)},NG=function(t,e,n){return{coord:bG(t.output,t.output,e,n),extra:t.extra}},BG=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=mn(t.element),u=Lr(i),a=qz(o),c=NG(r,u,a),s=hG(c.coord,u,a);Yn(o,s)}},MG=Object.freeze({__proto__:null,snapTo:BG}),PG="data-initial-z-index",IG=function(t){vn(t.element).filter(fe).each((function(t){jn(t,PG).fold((function(){return nr(t,"z-index")}),(function(e){return Kn(t,"z-index",e)})),qn(t,PG)}))},LG=function(t){vn(t.element).filter(fe).each((function(e){Zn(e,"z-index").each((function(t){Hn(e,PG,t)})),Kn(e,"z-index",Jn(t.element,"z-index"))}))},FG=function(t,e){t.getSystem().addToGui(e),LG(e)},zG=function(t){IG(t),t.getSystem().removeFromGui(t)},HG=function(t,e,n){return t.getSystem().build(sD.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},VG=$i("snaps",[Di("getSnapPoints"),cf("onSensor"),Di("leftAttr"),Di("topAttr"),Ki("lazyViewport",Zr),Ki("mustSnap",!1)]),UG=[Ki("useFixed",T),Di("blockerClass"),Ki("getTarget",x),Ki("onDrag",h),Ki("repositionTarget",!0),Ki("onDrop",h),tu("getBounds",Zr),VG],jG=function(t){return Mt(Zn(t,"left"),Zn(t,"top"),Zn(t,"position"),(function(t,e,n){var r="fixed"===n?xG:yG;return r(parseInt(t,10),parseInt(e,10))})).getOrThunk((function(){var e=mr(t);return wG(e.left,e.top)}))},WG=function(t,e,n,r,o){var i=o.bounds,u=dG(e,n,r),a=Df(u.left,i.x,i.x+i.width-o.width),c=Df(u.top,i.y,i.y+i.height-o.height),s=wG(a,c);return e.fold((function(){var t=mG(s,n,r);return yG(t.left,t.top)}),w(s),(function(){var t=lG(s,n,r);return xG(t.left,t.top)}))},qG=function(t,e,n,r,o,i,u){var a=e.fold((function(){var t=vG(n,i.left,i.top),e=lG(t,r,o);return xG(e.left,e.top)}),(function(e){var u=EG(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord}));return WG(t,a,r,o,u)},$G=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=mn(t.element),u=Lr(i),a=qz(o),c=jG(o),s=qG(t,e.snaps,c,u,a,r,n),f=hG(s,u,a);Yn(o,f)}e.onDrag(t,o,r)},GG=function(t,e){return{bounds:t.getBounds(),height:ar(e.element),width:br(e.element)}},KG=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return GG(e,t)}));i.each((function(n){$G(t,e,u,n)}))},XG=function(t,e,n,r){e.each(zG),n.snaps.each((function(e){_G(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},YG=function(t){return function(e,n){var r=function(t){n.setStartData(GG(e,t))};return _a(R([Na(fa(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},JG=function(t){return _a([Na(Bu(),t.forceDrop),Na(Iu(),t.drop),Na(Mu(),(function(e,n){t.move(n.event)})),Na(Pu(),t.delayDrop)])},QG=function(t){return I.from(fr(t.x,t.y))},ZG=function(t,e){return fr(e.left-t.left,e.top-t.top)},tK=Object.freeze({__proto__:null,getData:QG,getDelta:ZG}),eK=function(t,e,n){return[Na(Bu(),(function(r,o){var i=o.event.raw;if(0===i.button){o.stop();var u=function(){return XG(r,I.some(s),t,e)},a=L_(u,200),c={drop:u,delayDrop:a.schedule,forceDrop:u,move:function(n){a.cancel(),KG(r,t,e,tK,n)}},s=HG(r,t.blockerClass,JG(c)),f=function(){n(r),FG(r,s)};f()}}))]},nK=R(R([],UG,!0),[df("dragger",{handlers:YG(eK)})],!1),rK=function(t){return _a([Na(Du(),t.forceDrop),Na(Ru(),t.drop),Na(Nu(),t.drop),Na(Au(),(function(e,n){t.move(n.event)}))])},oK=function(t){var e=t[0];return I.some(fr(e.clientX,e.clientY))},iK=function(t){var e=t.raw,n=e.touches;return 1===n.length?oK(n):I.none()},uK=function(t,e){return fr(e.left-t.left,e.top-t.top)},aK=Object.freeze({__proto__:null,getData:iK,getDelta:uK}),cK=function(t,e,n){var r=od(),o=function(n){XG(n,r.get(),t,e),r.clear()};return[Na(Du(),(function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:h,forceDrop:a,move:function(n){KG(i,t,e,aK,n)}},s=HG(i,t.blockerClass,rK(c));r.set(s);var f=function(){n(i),FG(i,s)};f()})),Na(Au(),(function(n,r){r.stop(),KG(n,t,e,aK,r.event)})),Na(Ru(),(function(t,e){e.stop(),o(t)})),Na(Nu(),o)]},sK=R(R([],UG,!0),[df("dragger",{handlers:YG(cK)})],!1),fK=function(t,e,n){return R(R([],eK(t,e,n),!0),cK(t,e,n),!0)},lK=R(R([],UG,!0),[df("dragger",{handlers:YG(fK)})],!1),dK=nK,mK=sK,gK=lK,pK=Object.freeze({__proto__:null,mouse:dK,touch:mK,mouseOrTouch:gK}),hK=function(){var t=I.none(),e=I.none(),n=function(){t=I.none(),e=I.none()},r=function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=I.some(n),r},o=function(t,e){return t.getData(e).bind((function(e){return r(t,e)}))},i=function(t){e=I.some(t)},u=function(){return e},a=w({});return Oc({readState:a,reset:n,update:o,getStartData:u,setStartData:i})},vK=Object.freeze({__proto__:null,init:hK}),bK=vl({branchKey:"mode",branches:pK,name:"dragging",active:{events:function(t,e){var n=t.dragger;return n.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:I.from(t.extra)}}},state:vK,apis:MG}),yK=40,wK=yK/2,xK=function(t,e,n,r,o,i){return t.fold((function(){return bK.snap({sensor:wG(n-wK,r-wK),range:fr(o,i),output:wG(I.some(n),I.some(r)),extra:{td:e}})}),(function(t){var o=n-wK,i=r-wK,u=yK,a=yK,c=t.element.dom.getBoundingClientRect();return bK.snap({sensor:wG(o,i),range:fr(u,a),output:wG(I.some(n-c.width/2),I.some(r-c.height/2)),extra:{td:e}})}))},CK=function(t,e,n){var r=function(t,e){return t.exists((function(t){return sn(t,e)}))};return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,o){var i=o.td;r(e.get(),i)||(e.set(i),n(i))},mustSnap:!0}},SK=function(t){return kC(SC.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ml([bK.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),VA.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},kK=function(t,e){var n=ou([]),r=ou([]),o=ou(!1),i=od(),u=od(),a=function(t){var n=Qr(t);return xK(m.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(){return $(n.get(),(function(t){return a(t)}))},s=function(t){var n=Qr(t);return xK(g.getOpt(e),t,n.right,n.bottom,n.width,n.height)},f=function(){return $(r.get(),(function(t){return s(t)}))},l=CK(c,i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),d=CK(f,u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),m=SK(l),g=SK(d),p=Es(m.asSpec()),h=Es(g.asSpec()),v=function(e,n,r,o){var i=n.dom.getBoundingClientRect();nr(e.element,"display");var u=hn(ee.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&Kn(e.element,"display","none")},b=function(t,e,n,r){var o=n(e);bK.snapTo(t,o);var i=function(t){return t[r]<0},u=function(t,e){return t[r]>e};v(t,e,i,u)},y=function(t){return b(p,t,a,"top")},w=function(){return i.get().each(y)},x=function(t){return b(h,t,s,"bottom")},C=function(){return u.get().each(x)};en().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Wg(e,p),Wg(e,h),o.set(!0)),i.set(t.start),u.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),y(t.start),x(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){w(),C()})),t.on("TableSelectionClear",(function(){o.get()&&(Gg(p),Gg(h),o.set(!1)),i.clear(),u.clear()})))},OK=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},TK=function(t,e,n){e.delimiter||(e.delimiter="»");var r=function(r){var o=r||[],i=$(o,(function(e,r){return SC.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:ml([mT.button(n.isDisabled),cT()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}};return Q(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]])},o=function(e){var n=[],r=e.length;while(r-- >0){var o=e[r];if(1===o.nodeType&&!OK(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ml([Dw.config({mode:"flow",selector:"div[role=button]"}),Lv.config({disabled:n.isDisabled}),cT(),yD.config({}),zw.config({}),Vw("elementPathEvents",[Ua((function(e,n){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Dw.focusIn(e)})),t.on("NodeChange",(function(t){var n=o(t.parents);n.length>0?zw.set(e,r(n)):zw.set(e,[])}))}))])]),components:[]}};(function(t){t[t["None"]=0]="None",t[t["Both"]=1]="Both",t[t["Vertical"]=2]="Vertical"})(Aj||(Aj={}));var EK=function(t,e,n,r,o){var i={};return i.height=ZW(r+e.top,wO(t),CO(t)),n===Aj.Both&&(i.width=ZW(o+e.left,yO(t),xO(t))),i},_K=function(t,e,n){var r=ee.fromDom(t.getContainer()),o=EK(t,e,n,ur(r),vr(r));vt(o,(function(t,e){return Kn(r,e,QW(t))})),vE(t)},DK=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?Aj.None:"both"===n?Aj.Both:Aj.Vertical},AK=function(t,e,n,r){var o=20,i=fr(n*o,r*o);return _K(t,i,e),I.some(!0)},RK=function(t,e){var n=DK(t);return n===Aj.None?I.none():I.some(IC("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[bK.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return _K(t,o,n)},blockerClass:"tox-blocker"}),Dw.config({mode:"special",onLeft:function(){return AK(t,n,-1,0)},onRight:function(){return AK(t,n,1,0)},onUp:function(){return AK(t,n,0,-1)},onDown:function(){return AK(t,n,0,1)}}),yD.config({}),Yw.config({})]},e.icons))},NK=function(t,e){var n,r=function(t,n,r){return zw.set(t,[Ss(e.translate(["{0} "+r,n[r]]))])};return SC.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ml([mT.button(e.isDisabled),cT(),yD.config({}),zw.config({}),th.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Vw("wordcount-events",[qa((function(t){var e=th.getValue(t),n="words"===e.mode?"characters":"words";th.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),Ua((function(e){t.on("wordCountUpdate",(function(t){var n=th.getValue(e).mode;th.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[ea()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})},BK=function(t,e){var n=function(){var t=OC.translate(["Powered by {0}","Tiny"]),e='<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+t+'">'+t+"</a>";return{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:e}}},r=function(){var r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(TK(t,{},e)),t.hasPlugin("wordcount")&&r.push(NK(t,e)),t.getParam("branding",!0,"boolean")&&r.push(n()),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]},o=function(){var n=r(),o=RK(t,e);return n.concat(o.toArray())};return{dom:{tag:"div",classes:["tox-statusbar"]},components:o()}},MK=function(t){var e,n=t.inline,r=n?cq:YW,o=qO(t)?FH:jz,i=I.none(),u=en(),a=u.browser.isIE(),c=a?["tox-platform-ie"]:[],s=u.deviceType.isTouch(),f="tox-platform-touch",l=s?[f]:[],d=LO(t),m=jO(t),g=OC.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[Ld]=d?zl.BottomToTop:zl.TopToBottom,e)},v=function(){return i.bind(aj.getHeader)},b=function(){return o.isDocked(v)},y=function(){Kn(Q.element,"width",document.body.clientWidth+"px")},w=function(){var t=sn(Ln(),m)&&"grid"===Jn(m,"display"),e={dom:D({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c).concat(l)},g),behaviours:ml([Fg.config({useFixed:function(){return b()}})])},n={dom:{styles:{width:document.body.clientWidth+"px"}},events:_a([Na(la(),y)])};return Co(e,t?n:{})},x=Es(w()),C=function(){return ro.value(x)},S=kC({dom:{tag:"div",classes:["tox-anchorbar"]}}),k=function(){return i.bind((function(t){return S.getOpt(t)})).getOrDie("Could not find a anchor bar element")},O=function(){return i.bind((function(t){return aj.getToolbar(t)})).getOrDie("Could not find more toolbar element")},T=function(){return i.bind((function(t){return aj.getThrobber(t)})).getOrDie("Could not find throbber element")},E=kz(x,t,k),_=aj.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:E,onEscape:function(){t.focus()}}),A=BO(t),R=aj.parts.toolbar(D({dom:{tag:"div",classes:["tox-toolbar"]},getSink:C,providers:E.shared.providers,onEscape:function(){t.focus()},type:A,lazyToolbar:O,lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),N=aj.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:E.shared.providers,onEscape:function(){t.focus()},type:A}),B=aj.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),M=aj.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),P=aj.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:E}),L=t.getParam("statusbar",!0,"boolean"),F=L&&!n?I.some(BK(t,E.shared.providers)):I.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[B,M]},H=RO(t),V=DO(t),U=_O(t),j=function(){return H?[N]:V?[R]:[]},W=aj.parts.header({dom:D({tag:"div",classes:["tox-editor-header"]},p),components:nt([U?[_]:[],j(),UO(t)?[]:[S.asSpec()]]),sticky:qO(t),editor:t,sharedBackstage:E.shared}),q=nt([d?[]:[W],n?[]:[z],d?[W]:[]]),$={dom:{tag:"div",classes:["tox-editor-container"]},components:q},G=nt([[$],n?[]:F.toArray(),[P]]),K=WO(t),X=D(D({role:"application"},OC.isRtl()?{dir:"rtl"}:{}),K?{"aria-hidden":"true"}:{}),Y=Es(aj.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(l).concat(c),styles:D({visibility:"hidden"},K?{opacity:"0",border:"0"}:{}),attributes:X},components:G,behaviours:ml([cT(),Lv.config({disableClass:"tox-tinymce--disabled"}),Dw.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));i=I.some(Y),t.shortcuts.add("alt+F9","focus menubar",(function(){aj.focusMenubar(Y)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){aj.focusToolbar(Y)})),t.addCommand("ToggleToolbarDrawer",(function(){aj.toggleToolbarDrawer(Y)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return aj.isToolbarDrawerToggled(Y)}));var J=fD(Y),Q=fD(x);Oz(t,J,Q);var Z=function(){var t={broadcastAll:Q.broadcast,broadcastOn:Q.broadcastOn,register:h};return{channels:t}},tt=function(){var e=QW(eq(t)),n=QW(rq(t));return t.inline||(er("div","width",n)&&Kn(Y.element,"width",n),er("div","height",e)?Kn(Y.element,"height",e):Kn(Y.element,"height","200px")),e},et=function(){o.setup(t,E.shared,v),O$(t,E),uG(t,C,E),NV(t),iU(t,T,E.shared),bt(PO(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,i=e.menuItems,u=e.contextToolbars,a=e.sidebars,c=AO(t),s={menuItems:i,menus:KO(t),menubar:XO(t),toolbar:c.getOrThunk((function(){return YO(t)})),allowToolbarGroups:A===US.floating,buttons:n,sidebar:a};Xq(t,u,x,{backstage:E}),kK(t,x);var f=t.getElement(),l=tt(),d={mothership:J,uiMothership:Q,outerContainer:Y},m={targetNode:f,height:l};return r.render(t,d,s,E,m)};return{mothership:J,uiMothership:Q,backstage:E,renderUI:et,getUi:Z}},PK=function(t,e){var n=I.from(Un(t,"id")).fold((function(){var t=oc("dialog-describe");return Hn(e,"id",t),t}),x);Hn(t,"aria-describedby",n)},IK=function(t,e){var n=jn(t,"id").fold((function(){var t=oc("dialog-label");return Hn(e,"id",t),t}),x);Hn(t,"aria-labelledby",n)},LK=w([Di("lazySink"),Hi("dragBlockClass"),tu("getBounds",Zr),Ki("useTabstopAt",E),Ki("eventOrder",{}),eh("modalBehaviours",[Dw]),sf("onExecute"),lf("onEscape")]),FK={sketch:x},zK=w([Ph({name:"draghandle",overrides:function(t,e){return{behaviours:ml([bK.config({mode:"mouse",getTarget:function(t){return Is(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Bh({schema:[Di("dom")],name:"title"}),Bh({factory:FK,schema:[Di("dom")],name:"close"}),Bh({factory:FK,schema:[Di("dom")],name:"body"}),Ph({factory:FK,schema:[Di("dom")],name:"footer"}),Mh({factory:{sketch:function(t,e){return D(D({},t),{dom:e.dom,components:e.components})}},schema:[Ki("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ki("components",[])],name:"blocker"})]),HK=function(t,e,n,r){var o,i=od(),u=function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),u=n.getSystem().build(D(D({},o),{components:o.components.concat([_s(e)]),behaviours:ml([Yw.config({}),Vw("dialog-blocker-events",[Va(Fu(),(function(){Dw.focusIn(e)}))])])}));Wg(n,u),Dw.focusIn(e)},a=function(t){i.clear(),vn(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Gg(t)}))}))},c=function(e){return Xh(e,t,"body")},s=function(e){return Xh(e,t,"footer")},f=function(t,e){KV.block(t,e)},l=function(t){KV.unblock(t)},d=oc("modal-events"),m=D(D({},t.eventOrder),(o={},o[da()]=[d].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:u,hide:a,getBody:c,getFooter:s,setIdle:l,setBusy:f},eventOrder:m,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:rh(t.modalBehaviours,[zw.config({}),Dw.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),KV.config({getRoot:i.get}),Vw(d,[Ua((function(e){IK(e.element,Xh(e,t,"title").element),PK(e.element,Xh(e,t,"body").element)}))])])}},VK=mv({name:"ModalDialog",configFields:LK(),partFields:zK(),factory:HK,apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),UK=ti([Ni("type"),Ni("name")].concat(Bk)),jK=fi,WK=[Ti("name","name",Oo((function(){return oc("button-name")})),si),ji("icon"),Qi("align","end",["start","end"]),Zi("primary",!1),Zi("disabled",!1)],qK=R(R([],WK,!0),[Ni("text")],!1),$K=R([Bi("type",["submit","cancel","custom"])],qK,!0),GK=R([Bi("type",["menu"]),ji("text"),ji("tooltip"),ji("icon"),zi("items",UK)],WK,!0),KK=ki("type",{submit:$K,cancel:$K,custom:$K,menu:GK}),XK=[Ni("type"),Ni("text"),Bi("level",["info","warn","error","success"]),Ni("icon"),Ki("url","")],YK=ti(XK),JK=function(t){return[Ni("type"),t]},QK=[Ni("type"),Ni("text"),Zi("disabled",!1),Zi("primary",!1),Ti("name","name",Oo((function(){return oc("button-name")})),si),ji("icon"),Zi("borderless",!1)],ZK=ti(QK),tX=[Ni("type"),Ni("name"),Ni("label"),Zi("disabled",!1)],eX=ti(tX),nX=fi,rX=[Ni("type"),Ni("name")],oX=rX.concat([ji("label")]),iX=oX.concat([Ki("columns","auto")]),uX=ti(iX),aX=ii([Ni("value"),Ni("text"),Ni("icon")]),cX=oX,sX=ti(cX),fX=si,lX=oX,dX=ti(lX),mX=si,gX=rX.concat([Ji("tag","textarea"),Ni("scriptId"),Ni("scriptUrl"),eu("settings",void 0)]),pX=rX.concat([Ji("tag","textarea"),Pi("init")]),hX=vi((function(t){return wi("customeditor.old",Zo(pX),t).orThunk((function(){return wi("customeditor.new",Zo(gX),t)}))})),vX=si,bX=oX,yX=ti(bX),wX=hi(),xX=function(t){return[Ni("type"),Ri("columns"),t]},CX=[Ni("type"),Ni("html"),Qi("presets","presentation",["presentation","document"])],SX=ti(CX),kX=oX.concat([Zi("sandboxed",!0)]),OX=ti(kX),TX=si,EX=oX.concat([Ai("currentState",ti([Di("blob"),Ni("url")]))]),_X=ti(EX),DX=oX.concat([ji("inputMode"),ji("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),AX=ti(DX),RX=si,NX=function(t){return[Ni("type"),Ni("label"),t]},BX=[Ni("text"),Ni("value")],MX=[Ni("text"),zi("items",Oi("items",(function(){return PX})))],PX=ni([ti(BX),ti(MX)]),IX=oX.concat([zi("items",PX),Zi("disabled",!1)]),LX=ti(IX),FX=si,zX=oX.concat([Fi("items",[Ni("text"),Ni("value")]),Yi("size",1),Zi("disabled",!1)]),HX=ti(zX),VX=si,UX=oX.concat([Zi("constrain",!0),Zi("disabled",!1)]),jX=ti(UX),WX=ti([Ni("width"),Ni("height")]),qX=[Ni("type"),zi("header",si),zi("cells",ei(si))],$X=ti(qX),GX=oX.concat([ji("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),KX=ti(GX),XX=si,YX=oX.concat([Qi("filetype","file",["image","media","file"]),Ki("disabled",!1)]),JX=ti(YX),QX=ti([Ni("value"),Ki("meta",{})]),ZX=function(t){return Ti("items","items",ko(),ei(vi((function(e){return wi("Checking item of "+t,tY,e).fold((function(t){return ro.error(Si(t))}),(function(t){return ro.value(t)}))}))))},tY=Jo((function(){return pi("type",{alertbanner:YK,bar:ti(JK(ZX("bar"))),button:ZK,checkbox:eX,colorinput:sX,colorpicker:dX,dropzone:yX,grid:ti(xX(ZX("grid"))),iframe:OX,input:AX,listbox:LX,selectbox:HX,sizeinput:jX,textarea:KX,urlinput:JX,customeditor:hX,htmlpanel:SX,imagetools:_X,collection:uX,label:ti(NX(ZX("label"))),table:$X,panel:nY})})),eY=[Ni("type"),Ki("classes",[]),zi("items",tY)],nY=ti(eY),rY=[Ti("name","name",Oo((function(){return oc("tab-name")})),si),Ni("title"),zi("items",tY)],oY=[Ni("type"),Fi("tabs",rY)],iY=ti(oY),uY=qK,aY=KK,cY=ti([Ni("title"),Ai("body",pi("type",{panel:nY,tabpanel:iY})),Ji("size","normal"),zi("buttons",aY),Ki("initialData",{}),tu("onAction",h),tu("onChange",h),tu("onSubmit",h),tu("onClose",h),tu("onCancel",h),Ki("onTabChange",h)]),sY=function(t){return wi("dialog",cY,t)},fY=ti(R([Bi("type",["cancel","custom"])],uY,!0)),lY=ti([Ni("title"),Ni("url"),Ui("height"),Ui("width"),qi("buttons",fY),tu("onAction",h),tu("onCancel",h),tu("onClose",h),tu("onMessage",h)]),dY=function(t){return wi("dialog",lY,t)},mY=function(t){return u(t)?[t].concat(rt(Ot(t),mY)):a(t)?rt(t,mY):[]},gY=function(t){return i(t.type)&&i(t.name)},pY={checkbox:nX,colorinput:fX,colorpicker:mX,dropzone:wX,input:RX,iframe:TX,sizeinput:WX,selectbox:VX,listbox:FX,size:WX,textarea:XX,urlinput:QX,customeditor:vX,collection:aX,togglemenuitem:jK},hY=function(t){return I.from(pY[t.type])},vY=function(t){return Y(mY(t),gY)},bY=function(t){var e=vY(t),n=rt(e,(function(t){return hY(t).fold((function(){return[]}),(function(e){return[Ai(t.name,e)]}))}));return ti(n)},yY=function(t){var e=xi(sY(t)),n=bY(t),r=t.initialData;return{internalDialog:e,dataValidator:n,initialData:r}},wY={open:function(t,e){var n=yY(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){var n=xi(dY(e));return t(n)},redial:function(t){return yY(t)}},xY=function(t){var e=[],n={};return vt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ro.error(e):ro.value(n)},CY=function(t,e){var n=kC(BB.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:$(t.items,(function(t){return aF(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:ml([Dw.config({mode:"acyclic",useTabstopAt:k(vM)}),WB.memento(n),uM.memento(n,{postprocess:function(t){return xY(t).fold((function(t){return{}}),x)}})])}},SY=function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:vx(t.action),behaviours:rh(t.tabButtonBehaviours,[Yw.config({}),Dw.config({mode:"execution",useSpace:!0,useEnter:!0}),th.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}},kY=dv({name:"TabButton",configFields:[Ki("uid",void 0),Di("value"),Ti("dom","dom",_o((function(){return{attributes:{role:"tab",id:oc("aria"),"aria-selected":"false"}}})),ui()),Hi("action"),Ki("domModification",{}),eh("tabButtonBehaviours",[Yw,Dw,th]),Di("view")],factory:SY}),OY=w([Di("tabs"),Di("dom"),Ki("clickToDismiss",!1),eh("tabbarBehaviours",[rb,Dw]),uf(["tabClass","selectedClass"])]),TY=Ih({factory:kY,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){rb.dehighlight(t,e),Sa(t,ya(),{tabbar:t,button:e})},n=function(t,e){rb.highlight(t,e),Sa(t,ba(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=rb.isHighlighted(o,r),u=function(){return i&&t.clickToDismiss?e:i?h:n}();u(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),EY=w([TY]),_Y=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:rh(t.tabbarBehaviours,[rb.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Hn(e.element,"aria-selected","true")},onDehighlight:function(t,e){Hn(e.element,"aria-selected","false")}}),Dw.config({mode:"flow",getInitial:function(t){return rb.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}},DY=mv({name:"Tabbar",configFields:OY(),partFields:EY(),factory:_Y}),AY=function(t,e){return{uid:t.uid,dom:t.dom,behaviours:rh(t.tabviewBehaviours,[zw.config({})]),domModification:{attributes:{role:"tabpanel"}}}},RY=dv({name:"Tabview",configFields:[eh("tabviewBehaviours",[zw])],factory:AY}),NY=w([Ki("selectFirst",!0),cf("onChangeTab"),cf("onDismissTab"),Ki("tabs",[]),eh("tabSectionBehaviours",[])]),BY=Bh({factory:DY,schema:[Di("dom"),Li("markers",[Di("tabClass"),Di("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),MY=Bh({factory:RY,name:"tabview"}),PY=w([BY,MY]),IY=function(t,e,n,r){var o=function(e){var n=th.getValue(e);Kh(e,t,"tabview").each((function(r){var o=tt(t.tabs,(function(t){return t.value===n}));o.each((function(n){var o=n.view();jn(e.element,"id").each((function(t){Hn(r.element,"aria-labelledby",t)})),zw.set(r,o),t.onChangeTab(r,e,o)}))}))},i=function(e,n){Kh(e,t,"tabbar").each((function(t){n(t).each(ka)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:nh(t.tabSectionBehaviours),events:_a(nt([t.selectFirst?[Ua((function(t,e){i(t,rb.getFirst)}))]:[],[Na(ba(),(function(t,e){var n=e.event.button;o(n)})),Na(ya(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Kh(e,t,"tabview").map((function(t){return zw.contents(t)})).getOr([])},showTab:function(t,e){var n=function(t){var n=rb.getCandidates(t),r=tt(n,(function(t){return th.getValue(t)===e}));return r.filter((function(e){return!rb.isHighlighted(t,e)}))};i(t,n)}}}},LY=mv({name:"TabSection",configFields:NY(),partFields:PY(),factory:IY,apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),FY=function(t,e,n){return $(t,(function(r,o){zw.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return zw.set(n,[]),i.height}))},zY=function(t){return lt(st(t,(function(t,e){return t>e?-1:t<e?1:0})))},HY=function(t,e,n){var r,o=pn(t).dom,i=Is(t,".tox-dialog-wrap").getOr(t),u="fixed"===Jn(i,"position");r=u?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var a=ur(e),c=e.dom.offsetLeft>=n.dom.offsetLeft+vr(n),s=c?Math.max(ur(n),a):a,f=parseInt(Jn(t,"margin-top"),10)||0,l=parseInt(Jn(t,"margin-bottom"),10)||0,d=ur(t)+f+l,m=d-s;return r-m},VY=function(t,e){lt(t).each((function(t){return LY.showTab(e,t.value)}))},UY=function(t,e){Kn(t,"height",e+"px"),en().browser.isIE()?nr(t,"flex-basis"):Kn(t,"flex-basis",e+"px")},jY=function(t,e,n){Is(t,'[role="dialog"]').each((function(t){Fs(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Kn(e,"height","0"),Kn(e,"flex-basis","0"),Math.min(n,HY(t,e,r))})).each((function(t){UY(e,t)}))}))}))},WY=function(t){return Fs(t,'[role="tabpanel"]')},qY=function(t){var e=function(){var e=od(),n=[Ua((function(n){var r=n.element;WY(r).each((function(o){Kn(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=FY(t,o,n),i=zY(r);i.fold(e.clear,e.set)})),jY(r,o,e),nr(o,"visibility"),VY(t,n),xC.requestAnimationFrame((function(){jY(r,o,e)}))}))})),Na(la(),(function(t){var n=t.element;WY(n).each((function(t){jY(n,t,e)}))})),Na(PD,(function(t,n){var r=t.element;WY(r).each((function(t){var n=Tl(Dn(t));Kn(t,"visibility","hidden");var o=Zn(t,"height").map((function(t){return parseInt(t,10)}));nr(t,"height"),nr(t,"flex-basis");var i=t.dom.getBoundingClientRect().height,u=o.forall((function(t){return i>t}));u?(e.set(i),jY(r,t,e)):o.each((function(e){UY(t,e)})),nr(t,"visibility"),n.each(Sl)}))}))],r=!1;return{extraEvents:n,selectFirst:r}}(),n=function(){var t=[],e=!0;return{extraEvents:t,selectFirst:e}}();return{smartTabHeight:e,naiveTabHeight:n}},$Y="send-data-to-section",GY="send-data-to-view",KY=function(t,e){var n=ou({}),r=function(t){var e=th.getValue(t),r=xY(e).getOr({}),o=n.get(),i=Co(o,r);n.set(i)},o=function(t){var e=n.get();th.setValue(t,e)},i=ou(null),u=$(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[BB.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:$(t.items,(function(t){return aF(n,t,e)})),formBehaviours:ml([Dw.config({mode:"acyclic",useTabstopAt:k(vM)}),Vw("TabView.form.events",[Ua(o),ja(r)]),yl.config({channels:gu([{key:$Y,value:{onReceive:r}},{key:GY,value:{onReceive:o}}])})])}}))]}}})),a=qY(u).smartTabHeight;return LY.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=th.getValue(e);Sa(t,MD,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[LY.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[DY.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ml([yD.config({})])}),LY.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:ml([Vw("tabpanel",a.extraEvents),Dw.config({mode:"acyclic"}),bv.config({find:function(t){return lt(LY.getViewItems(t))}}),th.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([$Y],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([GY],{})}}})])})},XY=oc("update-dialog"),YY=oc("update-title"),JY=oc("update-body"),QY=oc("update-footer"),ZY=oc("body-send-message"),tJ=function(t,e,n,r){var o=function(t){switch(t.body.type){case"tabpanel":return[KY(t.body,n)];default:return[CY(t.body,n)]}},i=function(t,e){return I.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},u={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:D(D({},e.map((function(t){return{id:t}})).getOr({})),r?u:{})},components:[],behaviours:ml([WB.childAt(0),gW.config({channel:JY,updateState:i,renderComponents:o,initialData:t})])}},eJ=function(t,e,n,r){return tJ(t,I.some(e),n,r)},nJ=function(t,e){var n=tJ(t,I.none(),e,!1);return VK.parts.body(n)},rJ=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[gM({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:ml([yD.config({}),Yw.config({})])})]}],behaviours:ml([Dw.config({mode:"acyclic",useTabstopAt:k(vM)})])};return VK.parts.body(e)},oJ=CT.deviceType.isTouch(),iJ=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},uJ=function(t,e){return VK.parts.close(SC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:ml([yD.config({})])}))},aJ=function(){return VK.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},cJ=function(t,e){return VK.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:JV("<p>"+e.translate(t)+"</p>")}]}]})},sJ=function(t){return VK.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},fJ=function(t,e){return[sD.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),sD.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},lJ=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return VK.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),I.some(!0)},useTabstopAt:function(t){return!vM(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:D({position:"relative"},t.extraStyles)},components:R([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:JV('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:oJ?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:ml(R([Yw.config({}),Vw("dialog-events",t.dialogEvents.concat([Va(Fu(),(function(t,e){Dw.focusIn(t)}))])),Vw("scroll-lock",[Ua((function(){is(Ln(),i)})),ja((function(){as(Ln(),i)}))])],t.extraBehaviours,!0)),eventOrder:D((e={},e[ea()]=["dialog-events"],e[da()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[ma()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},dJ=function(t){return SC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[IC("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Ca(t,DD)}})},mJ=function(t,e,n){var r=function(t){return[Ss(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:D({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:ml([gW.config({channel:YY,renderComponents:r})])}},gJ=function(){return{dom:JV('<div class="tox-dialog__draghandle"></div>')}},pJ=function(t,e,n){return sD.sketch({dom:JV('<div class="tox-dialog__header"></div>'),components:[mJ(t,I.some(e),n),gJ(),dJ(n)],containerBehaviours:ml([bK.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return zs(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})},hJ=function(t,e){var n=VK.parts.title(mJ(t,I.none(),e)),r=VK.parts.draghandle(gJ()),o=VK.parts.close(dJ(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return sD.sketch({dom:JV('<div class="tox-dialog__header"></div>'),components:i})},vJ=function(t,e){return hJ({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},bJ=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:JV('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},yJ=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){VK.setBusy(t(),(function(t,r){return bJ(n.message,r,e)}))},onUnblock:function(){VK.setIdle(t())}}},wJ=function(t,e,n,r){var o,i=function(t,e){return I.some(e)};return Es(lJ(D(D({},t),{lazySink:r.shared.getSink,extraBehaviours:R([gW.config({channel:XY,updateState:i,initialData:e}),uM.memory({})],t.extraBehaviours,!0),onEscape:function(t){Ca(t,DD)},dialogEvents:n,eventOrder:(o={},o[ta()]=[gW.name(),yl.name()],o[da()]=["scroll-lock",gW.name(),"messages","dialog-events","alloy.base.behaviour"],o[ma()]=["alloy.base.behaviour","dialog-events","messages",gW.name(),"scroll-lock"],o)})))},xJ=function(t){var e=function(t){var e=$(t.items,(function(t){var e=ou(!1);return D(D({},t),{storage:e})}));return D(D({},t),{items:e})};return $(t,(function(t){return"menu"===t.type?e(t):t}))},CJ=function(t){return Q(t,(function(t,e){if("menu"===e.type){var n=e;return Q(n.items,(function(t,e){return t[e.name]=e.storage,t}),t)}return t}),{})},SJ=function(t,e){return[Fa(Fu(),hM),t(_D,(function(t,n){e.onClose(),n.onClose()})),t(DD,(function(t,e,n,r){e.onCancel(t),Ca(r,_D)})),Na(BD,(function(t,n){return e.onUnblock()})),Na(ND,(function(t,n){return e.onBlock(n.event)}))]},kJ=function(t,e){var n=function(e,n){return Na(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){gW.getState(t).get().each((function(n){e(n,t)}))};return R(R([],SJ(n,e),!0),[n(AD,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},OJ=function(t,e,n){var r=function(e,n){return Na(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){gW.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return R(R([],SJ(r,e),!0),[r(RD,(function(t,e){return e.onSubmit(t)})),r(ED,(function(t,e,n){e.onChange(t,{name:n.name})})),r(AD,(function(t,e,r,o){var i=function(){return Dw.focusIn(o)},u=function(t){return Wn(t,"disabled")||jn(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Dn(o.element),c=Tl(a);e.onAction(t,{name:r.name,value:r.value}),Tl(a).fold(i,(function(t){u(t)||c.exists((function(e){return dn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!dn(e.element,t)})).each(i)}))})),r(MD,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),ja((function(e){var n=t();th.setValue(e,n.getData())}))],!1)},TJ={initUrlDialog:kJ,initDialog:OJ},EJ=function(t,e){return rI(t,t.type,e)},_J=function(t,e,n){return tt(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))},DJ=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=X(n,(function(t){return"start"===t.align})),o=function(t,e){return sD.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:$(e,(function(t){return t.memento.asSpec()}))})},i=o("start",r.pass),u=o("end",r.fail);return[i,u]},AJ=function(t,e){var n=function(t,n){var r=$(n.buttons,(function(t){var n=kC(EJ(t,e));return{name:t.name,align:t.align,memento:n}})),o=function(t,e){return _J(t,r,e)};return I.some({lookupByName:o,footerButtons:r})};return{dom:JV('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ml([gW.config({channel:QY,initialData:t,updateState:n,renderComponents:DJ})])}},RJ=function(t,e){return AJ(t,e)},NJ=function(t,e){return VK.parts.footer(AJ(t,e))},BJ=function(t,e){var n=t.getRoot();if(n.getSystem().isConnected()){var r=bv.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return BB.getField(r,e).fold((function(){var n=t.getFooter(),o=gW.getState(n);return o.get().bind((function(t){return t.lookupByName(r,e)}))}),(function(t){return I.some(t)}))}return I.none()},MJ=function(t,e){var n=t.getRoot();return gW.getState(n).get().map((function(t){return xi(wi("data",t.dataValidator,e))})).getOr(e)},PJ=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o=function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=th.getValue(r),i=bt(n,(function(t){return t.get()}));return D(D({},o),i)},u=function(e){r((function(r){var o=p.getData(),i=D(D({},o),e),u=MJ(t,i),a=t.getFormWrapper();th.setValue(a,u),vt(n,(function(t,e){Et(i,e)&&t.set(i[e])}))}))},a=function(e){BJ(t,e).each(Lv.disable)},c=function(e){BJ(t,e).each(Lv.enable)},s=function(e){BJ(t,e).each(Yw.focus)},f=function(t){if(!i(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Sa(e,ND,{message:t})}))},l=function(){r((function(t){Ca(t,BD)}))},d=function(e){r((function(n){var r=t.getBody(),o=gW.getState(r);o.get().exists((function(t){return t.isTabPanel()}))&&bv.getCurrent(r).each((function(t){LY.showTab(t,e)}))}))},m=function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([XY],r),n.getSystem().broadcastOn([YY],r.internalDialog),n.getSystem().broadcastOn([JY],r.internalDialog),n.getSystem().broadcastOn([QY],r.internalDialog),p.setData(r.initialData)}))},g=function(){r((function(t){Ca(t,_D)}))},p={getData:o,setData:u,disable:a,enable:c,focus:s,block:f,unblock:l,showTab:d,redial:m,close:g};return p},IJ=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},LJ=function(t,e,n){var r=vJ(t.internalDialog.title,n),o=nJ({body:t.internalDialog.body},n),i=xJ(t.internalDialog.buttons),u=CJ(i),a=NJ({buttons:i},n),c=TJ.initDialog((function(){return m}),yJ((function(){return l}),n.shared.providers,e),n.shared.getSink),s=IJ(t.internalDialog.size),f={header:r,body:o,footer:I.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=wJ(f,t,c,n),d=function(){var t=function(){var t=VK.getBody(l);return bv.getCurrent(t).getOr(t)};return{getRoot:w(l),getBody:function(){return VK.getBody(l)},getFooter:function(){return VK.getFooter(l)},getFormWrapper:t}}(),m=PJ(d,e.redial,u);return{dialog:l,instanceApi:m}},FJ=function(t,e,n,r){var o,i,u=oc("dialog-label"),a=oc("dialog-content"),c=function(t,e){return I.some(e)},s=kC(pJ({title:t.internalDialog.title,draggable:!0},u,n.shared.providers)),f=kC(eJ({body:t.internalDialog.body},a,n,r)),l=xJ(t.internalDialog.buttons),d=CJ(l),m=kC(RJ({buttons:l},n)),g=TJ.initDialog((function(){return h}),{onBlock:function(t){KV.block(p,(function(e,r){return bJ(t.message,r,n.shared.providers)}))},onUnblock:function(){KV.unblock(p)},onClose:function(){return e.closeWindow()}},n.shared.getSink),p=Es({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=u,o["aria-describedby"]=a,o)},eventOrder:(i={},i[ta()]=[gW.name(),yl.name()],i[ea()]=["execute-on-form"],i[da()]=["reflecting","execute-on-form"],i),behaviours:ml([Dw.config({mode:"cyclic",onEscape:function(t){return Ca(t,_D),I.some(!0)},useTabstopAt:function(t){return!vM(t)&&("button"!==ae(t)||"disabled"!==Un(t,"disabled"))}}),gW.config({channel:XY,updateState:c,initialData:t}),Yw.config({}),Vw("execute-on-form",g.concat([Va(Fu(),(function(t,e){Dw.focusIn(t)}))])),KV.config({getRoot:function(){return I.some(p)}}),zw.config({}),uM.memory({})]),components:[s.asSpec(),f.asSpec(),m.asSpec()]}),h=PJ({getRoot:w(p),getFooter:function(){return m.get(p)},getBody:function(){return f.get(p)},getFormWrapper:function(){var t=f.get(p);return bv.getCurrent(t).getOr(t)}},e.redial,d);return{dialog:p,instanceApi:h}},zJ=tinymce.util.Tools.resolve("tinymce.util.URI"),HJ=function(t){var e=function(e){t.getSystem().isConnected()&&e(t)},n=function(t){if(!i(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");e((function(e){Sa(e,ND,{message:t})}))},r=function(){e((function(t){Ca(t,BD)}))},o=function(){e((function(t){Ca(t,_D)}))},u=function(t){e((function(e){e.getSystem().broadcastOn([ZY],t)}))};return{block:n,unblock:r,close:o,sendMessage:u}},VJ=["insertContent","setContent","execCommand","close","block","unblock"],UJ=function(t){return u(t)&&-1!==VJ.indexOf(t.mceAction)},jJ=function(t){return!UJ(t)&&u(t)&&Et(t,"mceAction")},WJ=function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!s(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock();break}},qJ=function(t,e,n,r){var o,i=vJ(t.title,r),u=rJ(t),a=t.buttons.bind((function(t){return 0===t.length?I.none():I.some(NJ({buttons:t},r))})),c=TJ.initUrlDialog((function(){return v}),yJ((function(){return h}),r.shared.providers,e)),s=D(D({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),f=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],l=new zJ(t.url,{base_uri:new zJ(window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=nd(),g=[Vw("messages",[Ua((function(){var e=ud(ee.fromDom(window),"message",(function(e){if(l.isSameOrigin(new zJ(e.raw.origin))){var r=e.raw.data;UJ(r)?WJ(n,v,r):jJ(r)&&t.onMessage(v,r)}}));m.set(e)})),ja(m.clear)]),yl.config({channels:(o={},o[ZY]={onReceive:function(t,e){Fs(t.element,"iframe").each((function(t){var n=t.dom.contentWindow;n.postMessage(e,d)}))}},o)})],p={header:i,body:u,footer:a,extraClasses:f,extraBehaviours:g,extraStyles:s},h=wJ(p,t,c,r),v=HJ(h);return{dialog:h,instanceApi:v}},$J=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(){VK.hide(c),r()},i=kC(rI({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:I.none()},"cancel",t.backstage)),u=aJ(),a=uJ(o,e.providers),c=Es(lJ({lazySink:function(){return e.getSink()},header:iJ(u,a),body:cJ(n,e.providers),footer:I.some(sJ(fJ([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Na(DD,o)],eventOrder:{}}));VK.show(c);var s=i.get(c);Yw.focus(s)};return{open:n}},GJ=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(t){VK.hide(s),r(t)},i=kC(rI({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:I.none()},"submit",t.backstage)),u=rI({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:I.none()},"cancel",t.backstage),a=aJ(),c=uJ((function(){return o(!1)}),e.providers),s=Es(lJ({lazySink:function(){return e.getSink()},header:iJ(a,c),body:cJ(n,e.providers),footer:I.some(sJ(fJ([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Na(DD,(function(){return o(!1)})),Na(RD,(function(){return o(!0)}))],eventOrder:{}}));VK.show(s);var f=i.get(s);Yw.focus(f)};return{open:n}},KJ=function(t,e){return xi(wi("data",e,t))},XJ=function(t){return I_(t,".tox-alert-dialog")||I_(t,".tox-confirm-dialog")},YJ=function(t,e,n){return e&&n?[]:[CH.config({contextual:{lazyContext:function(){return I.some(Jr(ee.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},JJ=function(t){var e=t.backstage,n=t.editor,r=qO(n),o=$J(t),i=GJ(t),u=function(t,n,r){return void 0!==n&&"toolbar"===n.inline?f(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?f(t,e.shared.anchors.cursor(),r,n.ariaAttrs):s(t,r)},a=function(t,e){return c(t,e)},c=function(t,r){var o=function(t){var o=qJ(t,{closeWindow:function(){VK.hide(o.dialog),r(o.instanceApi)}},n,e);return VK.show(o.dialog),o.instanceApi};return wY.openUrl(o,t)},s=function(t,n){var r=function(t,r,o){var i=r,u={dataValidator:o,initialData:i,internalDialog:t},a=LJ(u,{redial:wY.redial,closeWindow:function(){VK.hide(a.dialog),n(a.instanceApi)}},e);return VK.show(a.dialog),a.instanceApi.setData(i),a.instanceApi};return wY.open(r,t)},f=function(t,o,i,u){var a=function(t,a,c){var s=KJ(a,c),f=od(),l=e.shared.header.isPositionedAtTop(),d={dataValidator:c,initialData:s,internalDialog:t},m=function(){return f.on((function(t){eC.reposition(t),CH.refresh(t)}))},g=FJ(d,{redial:wY.redial,closeWindow:function(){f.on(eC.hide),n.off("ResizeEditor",m),f.clear(),i(g.instanceApi)}},e,u),p=Es(eC.sketch(D(D({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},l?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:ml(R([Vw("window-manager-inline-events",[Na(ga(),(function(t,e){Ca(g.dialog,DD)}))])],YJ(n,r,l),!0)),isExtraPart:function(t,e){return XJ(e)}})));return f.set(p),eC.showWithin(p,_s(g.dialog),{anchor:o},I.some(Ln())),r&&l||(CH.refresh(p),n.on("ResizeEditor",m)),g.instanceApi.setData(s),Dw.focusIn(g.dialog),g.instanceApi};return wY.open(a,t)},l=function(t,e){i.open(t,(function(t){e(t)}))},d=function(t,e){o.open(t,(function(){e()}))},m=function(t){t.close()};return{open:u,openUrl:a,alert:d,close:m,confirm:l}};function QJ(){_.add("silver",(function(t){var e=MK(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;P_.register(t,r.shared);var u=JJ({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:w(u),getNotificationManagerImpl:function(){return VC(t,{backstage:r},n)},ui:i()}}))}QJ()})()}).call(this,n("c8ba"))},"07d1":function(t,e,n){n("94ce")},"09cf":function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function e(){t.add("textcolor",(function(){}))}e()})()},"1f38":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var r=function(){return"undefined"!==typeof window?window:t},o=function(){var t=r();return t&&t.tinymce?t.tinymce:null}}).call(this,n("c8ba"))},2401:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},n=function(t){return function(n){return e(n)===t}},r=function(t){return function(e){return typeof e===t}},o=n("string"),i=n("object"),u=n("array"),a=r("boolean"),c=r("function"),s=r("number"),f=function(){},l=function(t){return function(){return t}},d=function(t){return t},m=function(t,e){return t===e},g=function(t){return function(e){return!t(e)}},p=l(!1),h=l(!0),v=function(){return b},b=function(){var t=function(t){return t()},e=d,n={fold:function(t,e){return t()},isSome:p,isNone:h,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:e,orThunk:t,map:v,each:f,bind:v,exists:p,forall:h,filter:function(){return v()},toArray:function(){return[]},toString:l("none()")};return n}(),y=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w=function(t){return null===t||void 0===t?b:y(t)},x={some:y,none:v,from:w},C=Array.prototype.slice,S=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},T=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},E=function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r},_=function(t,e,n){return O(t,(function(t,r){n=e(n,t,r)})),n},D=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()},A=function(t,e){return D(t,e,p)},R=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e},N=function(t,e){return R(k(t,e))},B=function(t){var e=C.call(t,0);return e.reverse(),e},M=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},P=function(t){return M(t,0)},I=function(t){return M(t,t.length-1)},L=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},F=function(){return F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},F.apply(this,arguments)};function z(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var H=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},V=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!s&&!c&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(c),isPhone:l(s),isTouch:l(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:l(f),isDesktop:l(d)}},U=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},j=function(t,e){var n=U(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return $(r(1),r(2))},W=function(t,e){var n=String(e).toLowerCase();return 0===t.length?q():j(t,n)},q=function(){return $(0,0)},$=function(t,e){return{major:t,minor:e}},G={nu:$,detect:W,unknown:q},K=function(t,e){return L(e.brands,(function(e){var n=e.brand.toLowerCase();return A(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:G.nu(parseInt(e.version,10),0)}}))}))},X=function(t,e){var n=String(e).toLowerCase();return A(t,(function(t){return t.search(n)}))},Y=function(t,e){return X(t,e).map((function(t){var n=G.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},J=function(t,e){return X(t,e).map((function(t){var n=G.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Q=function(t,e){return-1!==t.indexOf(e)},Z=function(t){return function(e){return e.replace(t,"")}},tt=Z(/^\s+|\s+$/g),et=function(t){return t.length>0},nt=function(t){return!et(t)},rt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ot=function(t){return function(e){return Q(e,t)}},it=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Q(t,"edge/")&&Q(t,"chrome")&&Q(t,"safari")&&Q(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,rt],search:function(t){return Q(t,"chrome")&&!Q(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Q(t,"msie")||Q(t,"trident")}},{name:"Opera",versionRegexes:[rt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ot("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ot("firefox")},{name:"Safari",versionRegexes:[rt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Q(t,"safari")||Q(t,"mobile/"))&&Q(t,"applewebkit")}}],ut=[{name:"Windows",search:ot("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Q(t,"iphone")||Q(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ot("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ot("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ot("linux"),versionRegexes:[]},{name:"Solaris",search:ot("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ot("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ot("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],at={browsers:l(it),oses:l(ut)},ct="Edge",st="Chrome",ft="IE",lt="Opera",dt="Firefox",mt="Safari",gt=function(){return pt({current:void 0,version:G.unknown()})},pt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(ct),isChrome:r(st),isIE:r(ft),isOpera:r(lt),isFirefox:r(dt),isSafari:r(mt)}},ht={unknown:gt,nu:pt,edge:l(ct),chrome:l(st),ie:l(ft),opera:l(lt),firefox:l(dt),safari:l(mt)},vt="Windows",bt="iOS",yt="Android",wt="Linux",xt="OSX",Ct="Solaris",St="FreeBSD",kt="ChromeOS",Ot=function(){return Tt({current:void 0,version:G.unknown()})},Tt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r(bt),isAndroid:r(yt),isOSX:r(xt),isLinux:r(wt),isSolaris:r(Ct),isFreeBSD:r(St),isChromeOS:r(kt)}},Et={unknown:Ot,nu:Tt,windows:l(vt),ios:l(bt),android:l(yt),linux:l(wt),osx:l(xt),solaris:l(Ct),freebsd:l(St),chromeos:l(kt)},_t=function(t,e,n){var r=at.browsers(),o=at.oses(),i=e.bind((function(t){return K(r,t)})).orThunk((function(){return Y(r,t)})).fold(ht.unknown,ht.nu),u=J(o,t).fold(Et.unknown,Et.nu),a=V(u,i,t,n);return{browser:i,os:u,deviceType:a}},Dt={detect:_t},At=function(t){return window.matchMedia(t).matches},Rt=H((function(){return Dt.detect(navigator.userAgent,x.from(navigator.userAgentData),At)})),Nt=function(){return Rt()},Bt=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},Mt=function(t,e){return Bt(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},Pt=1,It=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return zt(r.childNodes[0])},Lt=function(t,e){var n=e||document,r=n.createElement(t);return zt(r)},Ft=function(t,e){var n=e||document,r=n.createTextNode(t);return zt(r)},zt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},Ht=function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(zt)},Vt={fromHtml:It,fromTag:Lt,fromText:Ft,fromDom:zt,fromPoint:Ht},Ut=function(t,e){var n=t.dom;if(n.nodeType!==Pt)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},jt=function(t,e){return t.dom===e.dom},Wt=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},qt=function(t,e){return Mt(t.dom,e.dom)},$t=function(t,e){return Nt().browser.isIE()?qt(t,e):Wt(t,e)},Gt=Ut,Kt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Xt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Yt=tinymce.util.Tools.resolve("tinymce.util.VK"),Jt=Object.keys,Qt=function(t,e){for(var n=Jt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},Zt=function(t){return function(e,n){t[n]=e}},te=function(t,e,n,r){var o={};return Qt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},ee=function(t,e){var n={};return te(t,e,Zt(n),f),n};"undefined"!==typeof window?window:Function("return this;")();var ne=function(t){var e=t.dom.nodeName;return e.toLowerCase()},re=function(t){return t.dom.nodeType},oe=function(t){return function(e){return re(e)===t}},ie=oe(Pt),ue=function(t){return function(e){return ie(e)&&ne(e)===t}},ae=function(t,e,n){if(!(o(n)||a(n)||s(n)))throw new Error("Attribute value was not simple");t.setAttribute(e,n+"")},ce=function(t,e){var n=t.dom;Qt(e,(function(t,e){ae(n,e,t)}))},se=function(t){return _(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},fe=function(t){return x.from(t.dom.parentNode).map(Vt.fromDom)},le=function(t){return k(t.dom.childNodes,Vt.fromDom)},de=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(Vt.fromDom)},me=function(t){return de(t,0)},ge=function(t){return de(t,t.dom.childNodes.length-1)},pe=function(t,e){var n=fe(t);n.each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},he=function(t,e){t.dom.appendChild(e.dom)},ve=function(t,e){O(e,(function(e){pe(t,e)}))},be=function(t,e){O(e,(function(e){he(t,e)}))},ye=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},we=function(t,e){return Vt.fromDom(t.dom.cloneNode(e))},xe=function(t){return we(t,!0)},Ce=function(t,e){var n=Vt.fromTag(e),r=se(t);return ce(n,r),n},Se=function(t,e){var n=Ce(t,e);pe(t,n);var r=le(t);return be(n,r),ye(t),n},ke=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Oe=tinymce.util.Tools.resolve("tinymce.util.Tools"),Te=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Ee=function(t){return function(e){return e&&t.test(e.nodeName)}},_e=function(t){return t&&3===t.nodeType},De=Ee(/^(OL|UL|DL)$/),Ae=Ee(/^(OL|UL)$/),Re=Te("ol"),Ne=Ee(/^(LI|DT|DD)$/),Be=Ee(/^(DT|DD)$/),Me=Ee(/^(TH|TD)$/),Pe=Te("br"),Ie=function(t){return t.parentNode.firstChild===t},Le=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Fe=function(t,e){return t&&t.nodeName in e},ze=function(t,e){return!!Pe(e)&&(t.isBlock(e.nextSibling)&&!Pe(e.previousSibling))},He=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Ve=function(t,e){return t.isChildOf(e,t.getRoot())},Ue=function(t){return t.getParam("lists_indent_on_tab",!0)},je=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},We=function(t){return t.getParam("forced_root_block_attrs",{})},qe=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=je(t);if(c&&(r=i.create(c),r.tagName===c.toUpperCase()&&i.setAttribs(r,We(t)),Fe(e.firstChild,u)||a.appendChild(r)),e)while(n=e.firstChild){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Fe(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},$e=ke.DOM,Ge=function(t,e,n){var r=function(t){Oe.each(o,(function(e){t.parentNode.insertBefore(e,n.parentNode)})),$e.remove(t)},o=$e.select('span[data-mce-type="bookmark"]',e),i=qe(t,n),u=$e.createRng();u.setStartAfter(n),u.setEndAfter(e);for(var a=u.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){$e.remove(c);break}t.dom.isEmpty(a)||$e.insertAfter(a,e),$e.insertAfter(i,e),He(t.dom,n.parentNode)&&r(n.parentNode),$e.remove(n),He(t.dom,e)&&$e.remove(e)},Ke=ue("dd"),Xe=ue("dt"),Ye=function(t,e){Ke(e)?Se(e,"dt"):Xe(e)&&fe(e).each((function(n){return Ge(t,n.dom,e.dom)}))},Je=function(t){Xe(t)&&Se(t,"dd")},Qe=function(t,e,n){O(n,"Indent"===e?Je:function(e){return Ye(t,e)})},Ze=function(t,e){if(_e(t))return{container:t,offset:e};var n=Kt.getNode(t,e);return _e(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&_e(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&_e(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},tn=function(t){var e=t.cloneRange(),n=Ze(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=Ze(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},en=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),nn=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",fn(t,n))},rn=function(t,e){return t&&1===e.length&&e[0]===t},on=function(t){return T(t.querySelectorAll("ol,ul,dl"),De)},un=function(t){var e=nn(t),n=t.selection.getSelectedBlocks();return rn(e,n)?on(e):T(n,(function(t){return De(t)&&e!==t}))},an=function(t,e){var n=Oe.map(e,(function(e){var n=t.dom.getParent(e,"li,dd,dt",fn(t,e));return n||e}));return en.unique(n)},cn=function(t){var e=t.selection.getSelectedBlocks();return T(an(t,e),Ne)},sn=function(t){return T(cn(t),Be)},fn=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ln=function(t,e){var n=t.dom.getParents(e,"ol,ul",fn(t,e));return I(n)},dn=function(t){var e=ln(t,t.selection.getStart()),n=T(t.selection.getSelectedBlocks(),Ae);return e.toArray().concat(n)},mn=function(t){var e=dn(t);return gn(t,e)},gn=function(t,e){var n=k(e,(function(e){return ln(t,e).getOr(e)}));return en.unique(n)},pn=function(t,e,n){return void 0===n&&(n=m),t.exists((function(t){return n(t,e)}))},hn=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},vn=function(t,e){var n=e||document,r=n.createDocumentFragment();return O(t,(function(t){r.appendChild(t.dom)})),Vt.fromDom(r)},bn=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},yn=function(t){return void 0!==t.style&&c(t.style.getPropertyValue)},wn=function(t,e,n){if(!o(n))throw new Error("CSS value must be a string: "+n);yn(t)&&t.style.setProperty(e,n)},xn=function(t,e,n){var r=t.dom;wn(r,e,n)},Cn=function(t,e){he(t.item,e.list)},Sn=function(t){for(var e=1;e<t.length;e++)Cn(t[e-1],t[e])},kn=function(t,e){hn(I(t),P(e),Cn)},On=function(t,e){var n={list:Vt.fromTag(e,t),item:Vt.fromTag("li",t)};return he(n.list,n.item),n},Tn=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(On(t,e.listType));return r},En=function(t,e){for(var n=0;n<t.length-1;n++)xn(t[n].item,"list-style-type","none");I(t).each((function(t){ce(t.list,e.listAttributes),ce(t.item,e.itemAttributes),be(t.item,e.content)}))},_n=function(t,e){ne(t.list)!==e.listType&&(t.list=Se(t.list,e.listType)),ce(t.list,e.listAttributes)},Dn=function(t,e,n){var r=Vt.fromTag("li",t);return ce(r,e),be(r,n),r},An=function(t,e){he(t.list,e),t.item=e},Rn=function(t,e,n){var r=e.slice(0,n.depth);return I(r).each((function(e){var r=Dn(t,n.itemAttributes,n.content);An(e,r),_n(e,n)})),r},Nn=function(t,e,n){var r=Tn(t,n,n.depth-e.length);return Sn(r),En(r,n),kn(e,r),e.concat(r)},Bn=function(t,e){var n=_(e,(function(e,n){return n.depth>e.length?Nn(t,e,n):Rn(t,e,n)}),[]);return P(n).map((function(t){return t.list}))},Mn=function(t){return Gt(t,"OL,UL")},Pn=function(t){return me(t).exists(Mn)},In=function(t){return ge(t).exists(Mn)},Ln=function(t){return t.depth>0},Fn=function(t){return t.isSelected},zn=function(t){var e=le(t),n=In(t)?e.slice(0,-1):e;return k(n,xe)},Hn=function(t,e,n){return fe(t).filter(ie).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:zn(t),itemAttributes:se(t),listAttributes:se(r),listType:ne(r)}}))},Vn=function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0},Un=function(t,e){t.listType=e.listType,t.listAttributes=F({},e.listAttributes)},jn=function(t){t.listAttributes=ee(t.listAttributes,(function(t,e){return"start"!==e}))},Wn=function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return D(B(t.slice(0,e)),r,o).orThunk((function(){return D(t.slice(e+1),r,o)}))},qn=function(t){return O(t,(function(e,n){Wn(t,n).fold((function(){e.dirty&&jn(e)}),(function(t){return Un(e,t)}))})),t},$n=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},Gn=function(t,e,n,r){return me(r).filter(Mn).fold((function(){e.each((function(t){jt(t.start,r)&&n.set(!0)}));var o=Hn(r,t,n.get());e.each((function(t){jt(t.end,r)&&n.set(!1)}));var i=ge(r).filter(Mn).map((function(r){return Kn(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return Kn(t,e,n,r)}))},Kn=function(t,e,n,r){return N(le(r),(function(r){var o=Mn(r)?Kn:Gn,i=t+1;return o(i,e,n,r)}))},Xn=function(t,e){var n=$n(!1),r=0;return k(t,(function(t){return{sourceList:t,entries:Kn(r,e,n,t)}}))},Yn=function(t,e){var n=qn(e);return k(n,(function(e){var n=vn(e.content);return Vt.fromDom(qe(t,n.dom))}))},Jn=function(t,e){var n=qn(e);return Bn(t.contentDocument,n).toArray()},Qn=function(t,e){return N(E(e,Ln),(function(e){var n=P(e).exists(Ln);return n?Jn(t,e):Yn(t,e)}))},Zn=function(t,e){O(T(t,Fn),(function(t){return Vn(e,t)}))},tr=function(t){var e=k(cn(t),Vt.fromDom);return hn(A(e,g(Pn)),A(B(e),g(Pn)),(function(t,e){return{start:t,end:e}}))},er=function(t,e,n){var r=Xn(e,tr(t));O(r,(function(e){Zn(e.entries,n);var r=Qn(t,e.entries);O(r,(function(e){bn(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),ve(e.sourceList,r),ye(e.sourceList)}))},nr=function(t,e){var n=k(mn(t),Vt.fromDom),r=k(sn(t),Vt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();er(t,n,e),Qe(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(tn(t.selection.getRng())),t.nodeChanged(),o=!0}return o},rr=function(t){return nr(t,"Indent")},or=function(t){return nr(t,"Outdent")},ir=function(t){return nr(t,"Flatten")},ur=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),ar=ke.DOM,cr=function(t){var e={},n=function(n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=ar.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):ar.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=o};return n(!0),t.collapsed||n(),e},sr=function(t){var e=function(e){var n,r=function(t){var e=t.parentNode.firstChild,n=0;while(e){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1},o=n=t[e?"startContainer":"endContainer"],i=t[e?"startOffset":"endOffset"];o&&(1===o.nodeType&&(i=r(o),o=o.parentNode,ar.remove(n),!o.hasChildNodes()&&ar.isBlock(o)&&o.appendChild(ar.create("br"))),t[e?"startContainer":"endContainer"]=o,t[e?"startOffset":"endOffset"]=i)};e(!0),e();var n=ar.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),tn(n)},fr=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},lr=function(t){return/\btox\-/.test(t.className)},dr=function(t,e,n){var r=function(t){var r=D(t.parents,De,Me).filter((function(t){return t.nodeName===e&&!lr(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},mr=function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)},gr=function(t,e){Oe.each(e,(function(e,n){t.setAttribute(n,e)}))},pr=function(t,e,n){gr(e,n["list-attributes"]),Oe.each(t.select("li",e),(function(t){gr(t,n["list-item-attributes"])}))},hr=function(t,e,n){mr(t,e,n),pr(t,e,n)},vr=function(t,e,n){Oe.each(n,(function(n){var r;return t.setStyle(e,(r={},r[n]="",r))}))},br=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Pe(o.nextSibling)&&(o=o.nextSibling);while(o.parentNode!==r){if(Le(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},yr=function(t,e,n){for(var r,o=[],i=t.dom,u=br(t,e,!0,n),a=br(t,e,!1,n),c=[],s=u;s;s=s.nextSibling)if(c.push(s),s===a)break;return Oe.each(c,(function(e){if(Le(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Pe(e))return Pe(e)&&i.remove(e),void(r=null);var u=e.nextSibling;ur.isBookmarkNode(e)&&(De(u)||Le(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o},wr=function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return o=null===o?"":o,r===o},xr=function(t,e,n){var r=t.selection.getRng(),o="LI",i=fn(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){e=e.toUpperCase(),"DL"===e&&(o="DT");var a=cr(r),c=yr(t,r,i);Oe.each(c,(function(r){var i,a=r.previousSibling,c=r.parentNode;Ne(c)||(a&&De(a)&&a.nodeName===e&&wr(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),vr(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),hr(u,i,n),Tr(t.dom,i))})),t.selection.setRng(sr(a))}},Cr=function(t,e){return t&&e&&De(t)&&t.nodeName===e.nodeName},Sr=function(t,e,n){var r=t.getStyle(e,"list-style-type",!0),o=t.getStyle(n,"list-style-type",!0);return r===o},kr=function(t,e){return t.className===e.className},Or=function(t,e,n){return Cr(e,n)&&Sr(t,e,n)&&kr(e,n)},Tr=function(t,e){var n,r;if(n=e.nextSibling,Or(t,e,n)){while(r=n.firstChild)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,Or(t,e,n)){while(r=n.lastChild)e.insertBefore(r,e.firstChild);t.remove(n)}},Er=function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);hr(t.dom,o,r),bn(t,fr(n),o)}else hr(t.dom,e,r),bn(t,fr(n),e)},_r=function(t,e,n,r,o){var i=De(e);if(i&&e.nodeName===r&&!Dr(o))ir(t);else{xr(t,r,o);var u=cr(t.selection.getRng()),a=i?z([e],n,!0):n;Oe.each(a,(function(e){Er(t,e,r,o)})),t.selection.setRng(sr(u))}},Dr=function(t){return"list-style-type"in t},Ar=function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Dr(r)||lr(e)){var o=cr(t.selection.getRng());hr(t.dom,e,r);var i=t.dom.rename(e,n);Tr(t.dom,i),t.selection.setRng(sr(o)),xr(t,n,r),bn(t,fr(n),i)}else ir(t);else xr(t,n,r),bn(t,fr(n),e)},Rr=function(t,e,n){var r=nn(t),o=un(t),u=i(n)?n:{};o.length>0?_r(t,r,o,e,u):Ar(t,r,e,u)},Nr=ke.DOM,Br=function(t,e){var n=e.parentNode;if("LI"===n.nodeName&&n.firstChild===e){var r=n.previousSibling;r&&"LI"===r.nodeName?(r.appendChild(e),He(t,n)&&Nr.remove(n)):Nr.setStyle(n,"listStyleType","none")}if(De(n)){r=n.previousSibling;r&&"LI"===r.nodeName&&r.appendChild(e)}},Mr=function(t,e){var n=Oe.grep(t.select("ol,ul",e));Oe.each(n,(function(e){Br(t,e)}))},Pr=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(_e(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=Kt.getNode(o,i));var a=new Xt(o,r);n&&ze(t.dom,o)&&a.next();while(o=a[n?"next":"prev2"]()){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(_e(o)&&o.data.length>0)return o}},Ir=function(t,e){var n=e.childNodes;return 1===n.length&&!De(n[0])&&t.isBlock(n[0])},Lr=function(t,e){Ir(t,e)&&t.remove(e.firstChild,!0)},Fr=function(t,e,n){var r,o=Ir(t,n)?n.firstChild:n;if(Lr(t,e),!He(t,e,!0))while(r=e.firstChild)o.appendChild(r)},zr=function(t,e,n){var r,o=e.parentNode;if(Ve(t,e)&&Ve(t,n)){De(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Pe(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Pe(i)&&e.hasChildNodes()&&t.remove(i),He(t,n,!0)&&t.$(n).empty(),Fr(t,e,n),r&&n.appendChild(r);var u=$t(Vt.fromDom(n),Vt.fromDom(e)),a=u?t.getParents(e,De,n):[];t.remove(e),O(a,(function(e){He(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Hr=function(t,e,n){t.dom.$(n).empty(),zr(t.dom,e,n),t.selection.setCursorLocation(n,0)},Vr=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))Hr(t,n,r);else{var i=cr(e);zr(o,n,r),t.selection.setRng(sr(i))}},Ur=function(t,e,n,r){var o=cr(e);zr(t.dom,n,r);var i=sr(o);t.selection.setRng(i)},jr=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=fn(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&He(n,a))return!0;var c=tn(r.getRng()),s=n.getParent(Pr(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){e?Vr(t,c,s,u):Ie(u)?or(t):Ur(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){ir(t)})),!0}return!1},Wr=function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)},qr=function(t,e){var n=t.dom,r=t.selection.getStart(),o=fn(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=tn(t.selection.getRng()),a=n.getParent(Pr(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){Wr(n,i,o),Tr(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1},$r=function(t,e){return jr(t,e)||qr(t,e)},Gr=function(t){var e=t.selection.getStart(),n=fn(t,e),r=t.dom.getParent(e,"LI,DT,DD",n);return!!(r||cn(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),Mr(t.dom,t.getBody())})),!0)},Kr=function(t,e){return t.selection.isCollapsed()?$r(t,e):Gr(t)},Xr=function(t){t.on("keydown",(function(e){e.keyCode===Yt.BACKSPACE?Kr(t,!1)&&e.preventDefault():e.keyCode===Yt.DELETE&&Kr(t,!0)&&e.preventDefault()}))},Yr=function(t){return{backspaceDelete:function(e){Kr(t,e)}}},Jr=function(t,e){var n=nn(t);t.undoManager.transact((function(){i(e.styles)&&t.dom.setStyles(n,e.styles),i(e.attrs)&&Qt(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))},Qr=function(t){var e=B(tt(t).split("")),n=k(e,(function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n}));return _(n,(function(t,e){return t+e}),0)},Zr=function(t){if(t--,t<0)return"";var e=t%26,n=Math.floor(t/26),r=Zr(n),o=String.fromCharCode("A".charCodeAt(0)+e);return r+o},to=function(t){return/^[A-Z]+$/.test(t)},eo=function(t){return/^[a-z]+$/.test(t)},no=function(t){return/^[0-9]+$/.test(t)},ro=function(t){return no(t)?2:to(t)?0:eo(t)?1:nt(t)?3:4},oo=function(t){switch(ro(t)){case 2:return x.some({listStyleType:x.none(),start:t});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:Qr(t).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:Qr(t).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}},io=function(t){var e=parseInt(t.start,10);return pn(t.listStyleType,"upper-alpha")?Zr(e):pn(t.listStyleType,"lower-alpha")?Zr(e).toLowerCase():t.start},uo=function(t){var e=nn(t);Re(e)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:io({start:t.dom.getAttrib(e,"start","1"),listStyleType:x.some(t.dom.getStyle(e,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var n=e.getData();oo(n.start).each((function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})},ao=function(t,e){return function(){var n=nn(t);return n&&n.nodeName===e}},co=function(t){t.addCommand("mceListProps",(function(){uo(t)}))},so=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?rr(t):"outdent"===n&&or(t)})),t.addCommand("InsertUnorderedList",(function(e,n){Rr(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){Rr(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){Rr(t,"DL",n)})),t.addCommand("RemoveList",(function(){ir(t)})),co(t),t.addCommand("mceListUpdate",(function(e,n){i(n)&&Jr(t,n)})),t.addQueryStateHandler("InsertUnorderedList",ao(t,"UL")),t.addQueryStateHandler("InsertOrderedList",ao(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",ao(t,"DL"))},fo=function(t){t.on("keydown",(function(e){e.keyCode!==Yt.TAB||Yt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?or(t):rr(t))&&e.preventDefault()}))}))},lo=function(t){Ue(t)&&fo(t),Xr(t)},mo=function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return dr(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return dr(t,"UL",e.setActive)}}))},go=function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return dr(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=nn(t,e);return Re(n)?["listprops"]:[]}})};function po(){t.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(lo(t),so(t)):co(t),mo(t),go(t),Yr(t)}))}po()})()},"2d33":function(t,e,n){n("303c7")},"303c7":function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function e(){t.add("colorpicker",(function(){}))}e()})()},3154:function(t,e,n){n("f034")},"34de":function(t,e,n){n("09cf")},3699:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},e.apply(this,arguments)},n=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return function(e){return n(e)===t}},o=r("string"),i=r("object"),u=r("array"),a=function(t){return null===t||void 0===t},c=function(t){return!a(t)},s=function(){},f=function(t){return function(){return t}},l=function(t){return t},d=f(!1),m=f(!0),g=function(){return p},p=function(){var t=function(t){return t()},e=l,n={fold:function(t,e){return t()},isSome:d,isNone:m,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:e,orThunk:t,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:f("none()")};return n}(),h=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return h(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},v=function(t){return null===t||void 0===t?p:h(t)},b={some:h,none:g,from:v},y=Array.prototype.push,w=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},x=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);y.apply(e,t[n])}return e},C=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},S=Object.keys,k=Object.hasOwnProperty,O=function(t,e){for(var n=S(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},T=function(t,e){return E(t,e)?b.from(t[e]):b.none()},E=function(t,e){return k.call(t,e)},_=function(t){return t.getParam("media_scripts")},D=function(t){return t.getParam("audio_template_callback")},A=function(t){return t.getParam("video_template_callback")},R=function(t){return t.getParam("media_live_embeds",!0)},N=function(t){return t.getParam("media_filter_html",!0)},B=function(t){return t.getParam("media_url_resolver")},M=function(t){return t.getParam("media_alt_source",!0)},P=function(t){return t.getParam("media_poster",!0)},I=function(t){return t.getParam("media_dimensions",!0)},L=tinymce.util.Tools.resolve("tinymce.util.Tools"),F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),z=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),H=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},V=F.DOM,U=function(t){return t.replace(/px$/,"")},j=function(t){var e=t.map.style,n=e?V.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:T(n,"max-width").map(U).getOr(""),height:T(n,"max-height").map(U).getOr("")}},W=function(t,e){var n=C(!1),r={};return z({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(E(o.map,"data-ephox-embed-iri"))n.set(!0),r=j(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=L.extend(o.map,r)),"script"===e){var i=H(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},q=function(t){var e={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},n=t.toLowerCase().split(".").pop(),r=e[n];return r||""},$=tinymce.util.Tools.resolve("tinymce.html.Schema"),G=tinymce.util.Tools.resolve("tinymce.html.Writer"),K=F.DOM,X=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},Y=function(t,e){O(e,(function(e,n){var r=""+e;if(t.map[n]){var o=t.length;while(o--){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},J=function(t,e){var n=e.map.style,r=n?K.parseStyle(n):{};r["max-width"]=X(t.width),r["max-height"]=X(t.height),Y(e,{style:K.serializeStyle(r)})},Q=["source","altsource"],Z=function(t,e,n){var r,o=G(),i=C(!1),u=0;return z({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,a,c){if(i.get());else if(E(a.map,"data-ephox-embed-iri"))i.set(!0),J(e,a);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&Y(a,{width:e.width,height:e.height});break}if(n)switch(t){case"video":Y(a,{poster:e.poster,src:""}),e.altsource&&Y(a,{src:""});break;case"iframe":Y(a,{src:e.source});break;case"source":if(u<2&&(Y(a,{src:e[Q[u]],type:e[Q[u]+"mime"]}),!e[Q[u]]))return;u++;break;case"img":if(!e.poster)return;r=!0;break}}o.start(t,a,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var a=0;a<2;a++)if(e[Q[a]]){var c=[];c.map={},u<=a&&(Y(c,{src:e[Q[a]],type:e[Q[a]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},Y(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},$({})).parse(t),o.getContent()},tt=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],et=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"},nt=function(t,e){for(var n=et(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},u=0;u<r.length;u++)i(u);return o.replace(/\?$/,"")},rt=function(t){var e=tt.filter((function(e){return e.regex.test(t)}));return e.length>0?L.extend({},e[0],{url:nt(e[0],t)}):null},ot=function(t){var e=t.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"},it=function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+="</object>",e},ut=function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"},at=function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"},ct=function(t){return'<script src="'+t.source+'"><\/script>'},st=function(t,e){var n=L.extend({},e);if(!n.source&&(L.extend(n,W(_(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=q(n.source),n.altsourcemime=q(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r=rt(n.source);if(r&&(n.source=r.url,n.type=r.type,n.allowfullscreen=r.allowFullscreen,n.width=n.width||String(r.w),n.height=n.height||String(r.h)),n.embed)return Z(n.embed,n,!0);var o=H(_(t),n.source);o&&(n.type="script",n.width=String(o.width),n.height=String(o.height));var i=D(t),u=A(t);return n.width=n.width||"300",n.height=n.height||"150",L.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?ot(n):"application/x-shockwave-flash"===n.sourcemime?it(n):-1!==n.sourcemime.indexOf("audio")?ut(n,i):"script"===n.type?ct(n):at(n,u)},ft=function(t){return t.hasAttribute("data-mce-object")||t.hasAttribute("data-ephox-embed-iri")},lt=function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){var e=t.target.getAttribute("data-mce-object");"script"===e&&t.preventDefault()})),t.on("ObjectResized",(function(t){var e=t.target;if(e.getAttribute("data-mce-object")){var n=e.getAttribute("data-mce-html");n&&(n=unescape(n),e.setAttribute("data-mce-html",escape(Z(n,{width:String(t.width),height:String(t.height)}))))}}))},dt=tinymce.util.Tools.resolve("tinymce.util.Promise"),mt={},gt=function(t,e,n){return new dt((function(r,o){var i=function(n){return n.html&&(mt[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};mt[t.source]?i(mt[t.source]):n({url:t.source},i,o)}))},pt=function(t,e){return dt.resolve({html:e(t),url:t.source})},ht=function(t){return function(e){return st(t,e)}},vt=function(t,e){var n=B(t);return n?gt(e,ht(t),n):pt(e,ht(t))},bt=function(t){return E(mt,t)},yt=function(t,e){return T(e,t).bind((function(t){return T(t,"meta")}))},wt=function(t,e,n){return function(r){var o,u=function(){return T(t,r)},a=function(){return T(e,r)},c=function(t){return T(t,"value").bind((function(t){return t.length>0?b.some(t):b.none()}))},s=function(){return u().bind((function(t){return i(t)?c(t).orThunk(a):a().orThunk((function(){return b.from(t)}))}))},f=function(){return a().orThunk((function(){return u().bind((function(t){return i(t)?c(t):b.from(t)}))}))};return o={},o[r]=(r===n?s():f()).getOr(""),o}},xt=function(t,e){var n={};return T(t,"dimensions").each((function(t){w(["width","height"],(function(r){T(e,r).orThunk((function(){return T(t,r)})).each((function(t){return n[r]=t}))}))})),n},Ct=function(t,n){var r=n?yt(n,t).getOr({}):{},o=wt(t,r,n);return e(e(e(e(e({},o("source")),o("altsource")),o("poster")),o("embed")),xt(t,r))},St=function(t){var n=e(e({},t),{source:{value:T(t,"source").getOr("")},altsource:{value:T(t,"altsource").getOr("")},poster:{value:T(t,"poster").getOr("")}});return w(["width","height"],(function(e){T(t,e).each((function(t){var r=n.dimensions||{};r[e]=t,n.dimensions=r}))})),n},kt=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},Ot=function(t,e){return W(_(t),e)},Tt=function(t){var n=t.selection.getNode(),r=ft(n)?t.serializer.serialize(n,{selection:!0}):"";return e({embed:r},W(_(t),r))},Et=function(t,n){return function(r){if(o(r.url)&&r.url.trim().length>0){var i=r.html,u=Ot(n,i),a=e(e({},u),{source:r.url,embed:i});t.setData(St(a))}}},_t=function(t,e){for(var n=t.dom.select("*[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])},Dt=function(t,e){var n=t.dom.select("*[data-mce-object]");t.insertContent(e),_t(t,n),t.nodeChanged()},At=function(t,e,n){e.embed=Z(e.embed,e),e.embed&&(t.source===e.source||bt(e.source))?Dt(n,e.embed):vt(n,e).then((function(t){Dt(n,t.html)})).catch(kt(n))},Rt=function(t){var n=Tt(t),r=C(n),o=St(n),i=function(e,n){var r=Ct(n.getData(),"source");e.source!==r.source&&(Et(v,t)({url:r.source,html:""}),vt(t,r).then(Et(v,t)).catch(kt(t)))},u=function(e){var n=Ct(e.getData()),r=Ot(t,n.embed);e.setData(St(r))},a=function(n,r){var o=Ct(n.getData(),r),i=st(t,o);n.setData(St(e(e({},o),{embed:i})))},c=[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],s=I(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],f={title:"General",name:"general",items:x([c,s])},l={type:"textarea",name:"embed",label:"Paste your embed code below:"},d={title:"Embed",items:[l]},m=[];M(t)&&m.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),P(t)&&m.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var g={title:"Advanced",name:"advanced",items:m},p=[f,d];m.length>0&&p.push(g);var h={type:"tabpanel",tabs:p},v=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:h,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var n=Ct(e.getData());At(r.get(),n,t),e.close()},onChange:function(t,e){switch(e.name){case"source":i(r.get(),t);break;case"embed":u(t);break;case"dimensions":case"altsource":case"poster":a(t,e.name);break}r.set(Ct(t.getData()))},initialData:o})},Nt=function(t){var e=function(){Rt(t)};return{showDialog:e}},Bt=function(t){var e=function(){Rt(t)};t.addCommand("mceMedia",e)},Mt=tinymce.util.Tools.resolve("tinymce.html.Node"),Pt=tinymce.util.Tools.resolve("tinymce.Env"),It=tinymce.util.Tools.resolve("tinymce.html.DomParser"),Lt=function(t,e){if(!1===N(t))return e;var n,r=G();return z({validate:!1,allow_conditional_comments:!1,comment:function(t){n||r.comment(t)},cdata:function(t){n||r.cdata(t)},text:function(t,e){n||r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var u=o.length-1;u>=0;u--){var a=o[u].name;0===a.indexOf("on")&&(delete o.map[a],o.splice(u,1)),"style"===a&&(o[u].value=t.dom.serializeStyle(t.dom.parseStyle(o[u].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},$({})).parse(e),r.getContent()},Ft=function(t){var e=t.name;return"iframe"===e||"video"===e||"audio"===e},zt=function(t,e,n,r){void 0===r&&(r=null);var o=t.attr(n);return c(o)?o:E(e,n)?null:r},Ht=function(t,e,n){var r="img"===e.name||"video"===t.name,o=r?"300":null,i="audio"===t.name?"30":"150",u=r?i:null;e.attr({width:zt(t,n,"width",o),height:zt(t,n,"height",u)})},Vt=function(t,e,n,r){var o=It({forced_root_block:!1,validate:!1},t.schema).parse(r,{context:e});while(o.firstChild)n.append(o.firstChild)},Ut=function(t,e){var n=e.name,r=new Mt("img",1);return r.shortEnded=!0,Wt(t,e,r),Ht(e,r,{}),r.attr({style:e.attr("style"),src:Pt.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},jt=function(t,e){var n=e.name,r=new Mt("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),Wt(t,e,r);var o=t.dom.parseStyle(e.attr("style")),i=new Mt(n,1);if(Ht(e,i,o),i.attr({src:e.attr("src"),style:e.attr("style"),class:e.attr("class")}),"iframe"===n)i.attr({allowfullscreen:e.attr("allowfullscreen"),frameborder:"0"});else{var u=["controls","crossorigin","currentTime","loop","muted","poster","preload"];w(u,(function(t){i.attr(t,e.attr(t))}));var a=r.attr("data-mce-html");c(a)&&Vt(t,n,i,unescape(a))}var s=new Mt("span",1);return s.attr("class","mce-shim"),r.append(i),r.append(s),r},Wt=function(t,e,n){var r=e.attributes,o=r.length;while(o--){var i=r[o].name,u=r[o].value;"width"!==i&&"height"!==i&&"style"!==i&&("data"!==i&&"src"!==i||(u=t.convertURL(u,i)),n.attr("data-mce-p-"+i,u))}var a=e.firstChild&&e.firstChild.value;a&&(n.attr("data-mce-html",escape(Lt(t,a))),n.firstChild=null)},qt=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},$t=function(t){while(t=t.parent)if(t.attr("data-ephox-embed-iri")||qt(t))return!0;return!1},Gt=function(t){return function(e){var n,r,o=e.length;while(o--)n=e[o],n.parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=H(_(t),n.attr("src")),r))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),Ft(n)&&R(t)&&Pt.ceFalse?$t(n)||n.replace(jt(t,n)):$t(n)||n.replace(Ut(t,n))))}},Kt=function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();L.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();L.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",Gt(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){var r,o,i,u,a,c,s,f,l=e.length;while(l--)if(r=e[l],r.parent){s=r.attr(n),o=new Mt(s,1),"audio"!==s&&"script"!==s&&(f=r.attr("class"),f&&-1!==f.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),u=r.attributes,i=u.length;while(i--){var d=u[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),u[i].value)}"script"===s&&o.attr("type","text/javascript"),a=r.attr("data-mce-html"),a&&(c=new Mt("#text",3),c.raw=!0,c.value=Lt(t,unescape(a)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))},Xt=function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))},Yt=function(t){var e=function(){return t.execCommand("mceMedia")};t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:e,onSetup:function(e){var n=t.selection;return e.setActive(ft(n.getNode())),n.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",e.setActive).unbind}}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:e})};function Jt(){t.add("media",(function(t){return Bt(t),Yt(t),Xt(t),Kt(t),lt(t),Nt(t)}))}Jt()})()},"3aea":function(t,e,n){n("3699")},4237:function(t,e,n){n("be7f")},"4ea8":function(t,e,n){n("cdd9")},"5e4c":function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function e(){t.add("contextmenu",(function(){}))}e()})()},"84ec8":function(t,e,n){n("2401")},9434:function(t,e,n){n("e8b0")},"94ce":function(t,e){(function(){"use strict";var t=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},e=function(e){return function(n){return t(n)===e}},n=function(t){return function(e){return typeof e===t}},r=function(t){return function(e){return t===e}},o=e("string"),i=e("object"),u=e("array"),a=r(null),c=n("boolean"),s=r(void 0),f=function(t){return null===t||void 0===t},l=function(t){return!f(t)},d=n("function"),m=n("number"),g=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},h=function(t,e){return function(n){return t(e(n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},C=function(t){return function(){throw new Error(t)}},S=v(!1),k=v(!0),O=function(){return T},T=function(){var t=function(t){return t()},e=b,n={fold:function(t,e){return t()},isSome:S,isNone:k,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:e,orThunk:t,map:O,each:g,bind:O,exists:S,forall:k,filter:function(){return O()},toArray:function(){return[]},toString:v("none()")};return n}(),E=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:k,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return E(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:T},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},_=function(t){return null===t||void 0===t?T:E(t)},D={some:E,none:O,from:_},A=Array.prototype.slice,R=Array.prototype.indexOf,N=Array.prototype.push,B=function(t,e){return R.call(t,e)},M=function(t,e){return B(t,e)>-1},P=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return!0}return!1},I=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},L=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},F=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},z=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];e(r,n)}},H=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o],a=e(u,o)?n:r;a.push(u)}return{pass:n,fail:r}},V=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},U=function(t,e,n){return z(t,(function(t,r){n=e(n,t,r)})),n},j=function(t,e,n){return F(t,(function(t,r){n=e(n,t,r)})),n},W=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return D.some(i);if(n(i,r))break}return D.none()},q=function(t,e){return W(t,e,S)},$=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return D.some(n)}return D.none()},G=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);N.apply(e,t[n])}return e},K=function(t,e){return G(L(t,e))},X=function(t,e){for(var n=0,r=t.length;n<r;++n){var o=t[n];if(!0!==e(o,n))return!1}return!0},Y=function(t){var e=A.call(t,0);return e.reverse(),e},J=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},Q=function(t){return[t]},Z=function(t,e){var n=A.call(t,0);return n.sort(e),n},tt=function(t,e){return e>=0&&e<t.length?D.some(t[e]):D.none()},et=function(t){return tt(t,0)},nt=function(t){return tt(t,t.length-1)},rt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return D.none()},ot=function(){return ot=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ot.apply(this,arguments)};function it(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var ut=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},at=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),l=!s&&!c&&!f;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(f),isDesktop:v(l)}},ct=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},st=function(t,e){var n=ct(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return dt(r(1),r(2))},ft=function(t,e){var n=String(e).toLowerCase();return 0===t.length?lt():st(t,n)},lt=function(){return dt(0,0)},dt=function(t,e){return{major:t,minor:e}},mt={nu:dt,detect:ft,unknown:lt},gt=function(t,e){return rt(e.brands,(function(e){var n=e.brand.toLowerCase();return q(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:mt.nu(parseInt(e.version,10),0)}}))}))},pt=function(t,e){var n=String(e).toLowerCase();return q(t,(function(t){return t.search(n)}))},ht=function(t,e){return pt(t,e).map((function(t){var n=mt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},vt=function(t,e){return pt(t,e).map((function(t){var n=mt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},bt=function(t,e){return t.substring(e)},yt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},wt=function(t,e){return Ct(t,e)?bt(t,e.length):t},xt=function(t,e){return-1!==t.indexOf(e)},Ct=function(t,e){return yt(t,e,0)},St=function(t,e){return yt(t,e,t.length-e.length)},kt=function(t){return function(e){return e.replace(t,"")}},Ot=kt(/^\s+|\s+$/g),Tt=function(t){return t.length>0},Et=function(t){return!Tt(t)},_t=function(t){var e=parseFloat(t);return isNaN(e)?D.none():D.some(e)},Dt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,At=function(t){return function(e){return xt(e,t)}},Rt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return xt(t,"edge/")&&xt(t,"chrome")&&xt(t,"safari")&&xt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Dt],search:function(t){return xt(t,"chrome")&&!xt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return xt(t,"msie")||xt(t,"trident")}},{name:"Opera",versionRegexes:[Dt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:At("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:At("firefox")},{name:"Safari",versionRegexes:[Dt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(xt(t,"safari")||xt(t,"mobile/"))&&xt(t,"applewebkit")}}],Nt=[{name:"Windows",search:At("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return xt(t,"iphone")||xt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:At("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:At("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:At("linux"),versionRegexes:[]},{name:"Solaris",search:At("sunos"),versionRegexes:[]},{name:"FreeBSD",search:At("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:At("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Bt={browsers:v(Rt),oses:v(Nt)},Mt="Edge",Pt="Chrome",It="IE",Lt="Opera",Ft="Firefox",zt="Safari",Ht=function(){return Vt({current:void 0,version:mt.unknown()})},Vt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Mt),isChrome:r(Pt),isIE:r(It),isOpera:r(Lt),isFirefox:r(Ft),isSafari:r(zt)}},Ut={unknown:Ht,nu:Vt,edge:v(Mt),chrome:v(Pt),ie:v(It),opera:v(Lt),firefox:v(Ft),safari:v(zt)},jt="Windows",Wt="iOS",qt="Android",$t="Linux",Gt="OSX",Kt="Solaris",Xt="FreeBSD",Yt="ChromeOS",Jt=function(){return Qt({current:void 0,version:mt.unknown()})},Qt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(jt),isiOS:r(Wt),isAndroid:r(qt),isOSX:r(Gt),isLinux:r($t),isSolaris:r(Kt),isFreeBSD:r(Xt),isChromeOS:r(Yt)}},Zt={unknown:Jt,nu:Qt,windows:v(jt),ios:v(Wt),android:v(qt),linux:v($t),osx:v(Gt),solaris:v(Kt),freebsd:v(Xt),chromeos:v(Yt)},te=function(t,e,n){var r=Bt.browsers(),o=Bt.oses(),i=e.bind((function(t){return gt(r,t)})).orThunk((function(){return ht(r,t)})).fold(Ut.unknown,Ut.nu),u=vt(o,t).fold(Zt.unknown,Zt.nu),a=at(u,i,t,n);return{browser:i,os:u,deviceType:a}},ee={detect:te},ne=function(t){return window.matchMedia(t).matches},re=ut((function(){return ee.detect(navigator.userAgent,D.from(navigator.userAgentData),ne)})),oe=function(){return re()},ie=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},ue=function(t,e){return ie(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},ae=8,ce=9,se=11,fe=1,le=3,de=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return pe(r.childNodes[0])},me=function(t,e){var n=e||document,r=n.createElement(t);return pe(r)},ge=function(t,e){var n=e||document,r=n.createTextNode(t);return pe(r)},pe=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},he=function(t,e,n){return D.from(t.dom.elementFromPoint(e,n)).map(pe)},ve={fromHtml:de,fromTag:me,fromText:ge,fromDom:pe,fromPoint:he},be=function(t,e){var n=t.dom;if(n.nodeType!==fe)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ye=function(t){return t.nodeType!==fe&&t.nodeType!==ce&&t.nodeType!==se||0===t.childElementCount},we=function(t,e){var n=void 0===e?document:e.dom;return ye(n)?[]:L(n.querySelectorAll(t),ve.fromDom)},xe=function(t,e){var n=void 0===e?document:e.dom;return ye(n)?D.none():D.from(n.querySelector(t)).map(ve.fromDom)},Ce=function(t,e){return t.dom===e.dom},Se=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},ke=function(t,e){return ue(t.dom,e.dom)},Oe=function(t,e){return oe().browser.isIE()?ke(t,e):Se(t,e)},Te=be,Ee=Object.keys,_e=Object.hasOwnProperty,De=function(t,e){for(var n=Ee(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},Ae=function(t,e){return Re(t,(function(t,n){return{k:n,v:e(t,n)}}))},Re=function(t,e){var n={};return De(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ne=function(t){return function(e,n){t[n]=e}},Be=function(t,e,n,r){var o={};return De(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},Me=function(t,e){var n={};return Be(t,e,Ne(n),g),n},Pe=function(t,e){var n=[];return De(t,(function(t,r){n.push(e(t,r))})),n},Ie=function(t){return Pe(t,b)},Le=function(t){return Ee(t).length},Fe=function(t,e){return ze(t,e)?D.from(t[e]):D.none()},ze=function(t,e){return _e.call(t,e)},He=function(t,e){return ze(t,e)&&void 0!==t[e]&&null!==t[e]},Ve=function(t){for(var e in t)if(_e.call(t,e))return!1;return!0},Ue=["tfoot","thead","tbody","colgroup"],je=function(t){return M(Ue,t)},We=function(t,e){return{rows:t,columns:e}},qe=function(t,e){return{row:t,column:e}},$e=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Ge=function(t,e,n,r){return{element:t,rowspan:e,colspan:n,isNew:r}},Ke=function(t,e,n,r,o,i){return{element:t,rowspan:e,colspan:n,row:r,column:o,isLocked:i}},Xe=function(t,e,n){return{element:t,cells:e,section:n}},Ye=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}},Je=function(t,e,n){return{element:t,isNew:e,isLocked:n}},Qe=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}},Ze=function(t,e,n,r){return{startRow:t,startCol:e,finishRow:n,finishCol:r}},tn=function(t,e,n){return{element:t,colspan:e,column:n}},en=function(t,e){return{element:t,columns:e}};"undefined"!==typeof window?window:Function("return this;")();var nn=function(t){var e=t.dom.nodeName;return e.toLowerCase()},rn=function(t){return t.dom.nodeType},on=function(t){return function(e){return rn(e)===t}},un=function(t){return rn(t)===ae||"#comment"===nn(t)},an=on(fe),cn=on(le),sn=on(ce),fn=on(se),ln=function(t){return function(e){return an(e)&&nn(e)===t}},dn=function(t){return ve.fromDom(t.dom.ownerDocument)},mn=function(t){return sn(t)?t:dn(t)},gn=function(t){return ve.fromDom(mn(t).dom.defaultView)},pn=function(t){return D.from(t.dom.parentNode).map(ve.fromDom)},hn=function(t){return D.from(t.dom.parentElement).map(ve.fromDom)},vn=function(t,e){var n=d(e)?e:S,r=t.dom,o=[];while(null!==r.parentNode&&void 0!==r.parentNode){var i=r.parentNode,u=ve.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},bn=function(t){return D.from(t.dom.previousSibling).map(ve.fromDom)},yn=function(t){return D.from(t.dom.nextSibling).map(ve.fromDom)},wn=function(t){return L(t.dom.childNodes,ve.fromDom)},xn=function(t,e){var n=t.dom.childNodes;return D.from(n[e]).map(ve.fromDom)},Cn=function(t){return xn(t,0)},Sn=function(t){return fn(t)&&l(t.dom.host)},kn=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),On=v(kn),Tn=kn?function(t){return ve.fromDom(t.dom.getRootNode())}:mn,En=function(t){var e=Tn(t);return Sn(e)?D.some(e):D.none()},_n=function(t){return ve.fromDom(t.dom.host)},Dn=function(t){if(On()&&l(t.target)){var e=ve.fromDom(t.target);if(an(e)&&An(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return et(n)}}return D.from(t.target)},An=function(t){return l(t.dom.shadowRoot)},Rn=function(t){var e=cn(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return En(ve.fromDom(e)).fold((function(){return n.body.contains(e)}),h(Rn,_n))},Nn=function(){return Bn(ve.fromDom(document))},Bn=function(t){var e=t.dom.body;if(null===e||void 0===e)throw new Error("Body is not available yet");return ve.fromDom(e)},Mn=function(t,e,n){return V(vn(t,n),e)},Pn=function(t,e){return V(wn(t),e)},In=function(t,e){var n=[];return F(wn(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(In(t,e))})),n},Ln=function(t,e,n){return Mn(t,(function(t){return be(t,e)}),n)},Fn=function(t,e){return Pn(t,(function(t){return be(t,e)}))},zn=function(t,e){return we(e,t)};function Hn(t,e,n,r,o){return t(n,r)?D.some(n):d(o)&&o(n)?D.none():e(n,r,o)}var Vn=function(t,e,n){var r=t.dom,o=d(n)?n:S;while(r.parentNode){r=r.parentNode;var i=ve.fromDom(r);if(e(i))return D.some(i);if(o(i))break}return D.none()},Un=function(t,e,n){var r=function(t,e){return e(t)};return Hn(r,Vn,t,e,n)},jn=function(t,e){var n=function(t){return e(ve.fromDom(t))},r=q(t.dom.childNodes,n);return r.map(ve.fromDom)},Wn=function(t,e){var n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=ve.fromDom(t.childNodes[r]);if(e(o))return D.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return D.none()};return n(t.dom)},qn=function(t,e,n){return Vn(t,(function(t){return be(t,e)}),n)},$n=function(t,e){return jn(t,(function(t){return be(t,e)}))},Gn=function(t,e){return xe(e,t)},Kn=function(t,e,n){var r=function(t,e){return be(t,e)};return Hn(r,qn,t,e,n)},Xn=function(t,e,n){if(!(o(n)||c(n)||m(n)))throw new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Yn=function(t,e,n){Xn(t.dom,e,n)},Jn=function(t,e){var n=t.dom;De(e,(function(t,e){Xn(n,e,t)}))},Qn=function(t,e){De(e,(function(e,n){e.fold((function(){er(t,n)}),(function(e){Xn(t.dom,n,e)}))}))},Zn=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},tr=function(t,e){return D.from(Zn(t,e))},er=function(t,e){t.dom.removeAttribute(e)},nr=function(t){return j(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},rr=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},or=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},ir=function(t,e,n){return t.isSome()&&e.isSome()?D.some(n(t.getOrDie(),e.getOrDie())):D.none()},ur=function(t,e){return void 0!==t&&null!==t?e(t):D.none()},ar=function(t){return t.bind(b)},cr=function(t,e){return t?D.some(e):D.none()},sr=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},fr=function(t,e,n){if(!o(n))throw new Error("CSS value must be a string: "+n);sr(t)&&t.style.setProperty(e,n)},lr=function(t,e){sr(t)&&t.style.removeProperty(e)},dr=function(t,e,n){var r=t.dom;fr(r,e,n)},mr=function(t,e){var n=t.dom;De(e,(function(t,e){fr(n,e,t)}))},gr=function(t,e){var n=t.dom,r=window.getComputedStyle(n),o=r.getPropertyValue(e);return""!==o||Rn(t)?o:pr(n,e)},pr=function(t,e){return sr(t)?t.style.getPropertyValue(e):""},hr=function(t,e){var n=t.dom,r=pr(n,e);return D.from(r).filter((function(t){return t.length>0}))},vr=function(t,e){var n=t.dom;lr(n,e),rr(tr(t,"style").map(Ot),"")&&er(t,"style")},br=function(t,e){var n=t.dom,r=e.dom;sr(n)&&sr(r)&&(r.style.cssText=n.style.cssText)},yr=function(t,e,n){return void 0===n&&(n=0),tr(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},wr=function(t,e){return yr(t,e,1)},xr=function(t){return ln("col")(t)?yr(t,"span",1)>1:wr(t,"colspan")>1},Cr=function(t){return wr(t,"rowspan")>1},Sr=function(t,e){return parseInt(gr(t,e),10)},kr=v(10),Or=v(10),Tr=function(t,e){return Er(t,e,k)},Er=function(t,e,n){return K(wn(t),(function(t){return be(t,e)?n(t)?[t]:[]:Er(t,e,n)}))},_r=function(t,e,n){if(void 0===n&&(n=S),n(e))return D.none();if(M(t,nn(e)))return D.some(e);var r=function(t){return be(t,"table")||n(t)};return qn(e,t.join(","),r)},Dr=function(t,e){return _r(["td","th"],t,e)},Ar=function(t){return Tr(t,"th,td")},Rr=function(t){return be(t,"colgroup")?Fn(t,"col"):K(Mr(t),(function(t){return Fn(t,"col")}))},Nr=function(t,e){return Kn(t,"table",e)},Br=function(t){return Tr(t,"tr")},Mr=function(t){return Nr(t).fold(v([]),(function(t){return Fn(t,"colgroup")}))},Pr=function(t,e){return L(t,(function(t){if("colgroup"===nn(t)){var n=L(Rr(t),(function(t){var e=yr(t,"span",1);return $e(t,1,e)}));return Xe(t,n,"colgroup")}n=L(Ar(t),(function(t){var e=yr(t,"rowspan",1),n=yr(t,"colspan",1);return $e(t,e,n)}));return Xe(t,n,e(t))}))},Ir=function(t){return pn(t).map((function(t){var e=nn(t);return je(e)?e:"tbody"})).getOr("tbody")},Lr=function(t){var e=Br(t),n=Mr(t),r=it(it([],n,!0),e,!0);return Pr(r,Ir)},Fr=function(t,e){return Pr(t,(function(){return e}))},zr=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat(n).concat(i);return Ur(t,u)},Hr=function(t,e,n){return zr(t,e,[n])},Vr=function(t,e,n){var r=t.cells;r[e]=n},Ur=function(t,e){return Qe(t.element,e,t.section,t.isNew)},jr=function(t,e){var n=t.cells,r=L(n,e);return Qe(t.element,r,t.section,t.isNew)},Wr=function(t,e){return t.cells[e]},qr=function(t,e){return Wr(t,e).element},$r=function(t){return t.cells.length},Gr=function(t){var e=H(t,(function(t){return"colgroup"===t.section}));return{rows:e.fail,cols:e.pass}},Kr=function(t,e,n){var r=L(t.cells,n);return Qe(e(t.element),r,t.section,!0)},Xr="data-snooker-locked-cols",Yr=function(t){return tr(t,Xr).bind((function(t){return D.from(t.match(/\d+/g))})).map((function(t){return J(t,k)}))},Jr=function(t){var e=j(Gr(t).rows,(function(t,e){return F(e.cells,(function(e,n){e.isLocked&&(t[n]=!0)})),t}),{}),n=Pe(e,(function(t,e){return parseInt(e,10)}));return Z(n)},Qr=function(t,e){return t+","+e},Zr=function(t,e,n){return D.from(t.access[Qr(e,n)])},to=function(t,e,n){var r=eo(t,(function(t){return n(e,t.element)}));return r.length>0?D.some(r[0]):D.none()},eo=function(t,e){var n=K(t.all,(function(t){return t.cells}));return V(n,e)},no=function(t){var e={},n=0;return F(t.cells,(function(t){var r=t.colspan;I(r,(function(o){var i=n+o;e[i]=tn(t.element,r,i)})),n+=r})),e},ro=function(t){var e={},n=[],r=et(t).map((function(t){return t.element})).bind(Nr),o=r.bind(Yr).getOr({}),i=0,u=0,a=0,c=H(t,(function(t){return"colgroup"===t.section})),s=c.pass,f=c.fail;F(f,(function(t){var r=[];F(t.cells,(function(t){var n=0;while(void 0!==e[Qr(a,n)])n++;for(var i=He(o,n.toString()),c=Ke(t.element,t.rowspan,t.colspan,a,n,i),s=0;s<t.colspan;s++)for(var f=0;f<t.rowspan;f++){var l=a+f,d=n+s,m=Qr(l,d);e[m]=c,u=Math.max(u,d+1)}r.push(c)})),i++,n.push(Xe(t.element,r,t.section)),a++}));var l=nt(s).map((function(t){var e=no(t),n=en(t.element,Ie(e));return{colgroups:[n],columns:e}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),d=l.columns,m=l.colgroups,g=We(i,u);return{grid:g,access:e,all:n,columns:d,colgroups:m}},oo=function(t){var e=Lr(t);return ro(e)},io=function(t){return K(t.all,(function(t){return t.cells}))},uo=function(t){return Ie(t.columns)},ao=function(t){return Ee(t.columns).length>0},co=function(t,e){return D.from(t.columns[e])},so={fromTable:oo,generate:ro,getAt:Zr,findItem:to,filterItems:eo,justCells:io,justColumns:uo,hasColumns:ao,getColumnAt:co},fo=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},lo=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},mo=function(t,e){for(var n=!0,r=w(lo,e),o=e.startRow;o<=e.finishRow;o++)for(var i=e.startCol;i<=e.finishCol;i++)n=n&&so.getAt(t,o,i).exists(r);return n?D.some(e):D.none()},go=function(t,e){return Ze(Math.min(t.row,e.row),Math.min(t.column,e.column),Math.max(t.row+t.rowspan-1,e.row+e.rowspan-1),Math.max(t.column+t.colspan-1,e.column+e.colspan-1))},po=function(t,e,n){var r=so.findItem(t,e,Ce),o=so.findItem(t,n,Ce);return r.bind((function(t){return o.map((function(e){return go(t,e)}))}))},ho=function(t,e,n){return po(t,e,n).bind((function(e){return mo(t,e)}))},vo=function(t,e,n,r){return so.findItem(t,e,Ce).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column,u=so.getAt(t,o+n,i+r);return u.map((function(t){return t.element}))}))},bo=function(t,e,n){return po(t,e,n).map((function(e){var n=so.filterItems(t,w(fo,e));return L(n,(function(t){return t.element}))}))},yo=function(t,e){var n=function(t,e){return Oe(e,t)};return so.findItem(t,e,n).map((function(t){return t.element}))},wo=function(t,e,n){return Nr(t).bind((function(r){var o=ko(r);return vo(o,t,e,n)}))},xo=function(t,e,n){var r=ko(t);return bo(r,e,n)},Co=function(t,e,n,r,o){var i=ko(t),u=Ce(t,n)?D.some(e):yo(i,e),a=Ce(t,o)?D.some(r):yo(i,r);return u.bind((function(t){return a.bind((function(e){return bo(i,t,e)}))}))},So=function(t,e,n){var r=ko(t);return ho(r,e,n)},ko=so.fromTable,Oo=function(t,e){var n=pn(t);n.each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},To=function(t,e){var n=yn(t);n.fold((function(){var n=pn(t);n.each((function(t){_o(t,e)}))}),(function(t){Oo(t,e)}))},Eo=function(t,e){var n=Cn(t);n.fold((function(){_o(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},_o=function(t,e){t.dom.appendChild(e.dom)},Do=function(t,e,n){xn(t,n).fold((function(){_o(t,e)}),(function(t){Oo(t,e)}))},Ao=function(t,e){Oo(t,e),_o(e,t)},Ro=function(t,e){F(e,(function(e){Oo(t,e)}))},No=function(t,e){F(e,(function(n,r){var o=0===r?t:e[r-1];To(o,n)}))},Bo=function(t,e){F(e,(function(e){_o(t,e)}))},Mo=function(t){t.dom.textContent="",F(wn(t),(function(t){Po(t)}))},Po=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Io=function(t){var e=wn(t);e.length>0&&Ro(t,e),Po(t)},Lo=function(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?D.from(e.dom.nodeValue):D.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:o}},Fo=Lo(cn,"text"),zo=function(t){return Fo.get(t)},Ho=function(t){return Fo.getOption(t)},Vo=function(t,e){return Fo.set(t,e)},Uo=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function jo(){var t=function(t){return ve.fromDom(t.dom.cloneNode(!1))},e=function(t){return mn(t).dom},n=function(t){return!!an(t)&&("body"===nn(t)||M(Uo,nn(t)))},r=function(t){return!!an(t)&&M(["br","img","hr","input"],nn(t))},o=function(t){return an(t)&&"false"===Zn(t,"contenteditable")},i=function(t,e){return t.dom.compareDocumentPosition(e.dom)},u=function(t,e){var n=nr(t);Jn(e,n)},a=function(t){var e=nn(t);return M(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},c=function(t){return an(t)?tr(t,"lang"):D.none()};return{up:v({selector:qn,closest:Kn,predicate:Vn,all:vn}),down:v({selector:zn,predicate:In}),styles:v({get:gr,getRaw:hr,set:dr,remove:vr}),attrs:v({get:Zn,set:Yn,remove:er,copyTo:u}),insert:v({before:Oo,after:To,afterAll:No,append:_o,appendAll:Bo,prepend:Eo,wrap:Ao}),remove:v({unwrap:Io,remove:Po}),create:v({nu:ve.fromTag,clone:t,text:ve.fromText}),query:v({comparePosition:i,prevSibling:bn,nextSibling:yn}),property:v({children:wn,name:nn,parent:pn,document:e,isText:cn,isComment:un,isElement:an,isSpecial:a,getLanguage:c,getText:zo,setText:Vo,isBoundary:n,isEmptyTag:r,isNonEditable:o}),eq:Ce,is:Te}}var Wo=function(t,e,n,r){var o=n[0],i=n.slice(1);return r(t,e,o,i)},qo=function(t,e,n){return n.length>0?Wo(t,e,n,$o):D.none()},$o=function(t,e,n,r){var o=e(t,n);return U(r,(function(n,r){var o=e(t,r);return Go(t,n,o)}),o)},Go=function(t,e,n){return e.bind((function(e){return n.filter(w(t.eq,e))}))},Ko=function(t,e){return w(t.eq,e)},Xo=function(t,e,n,r){void 0===r&&(r=S);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){var e=$(t,r);return e.fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},a=u(o),c=u(i),s=q(a,(function(e){return P(c,Ko(t,e))}));return{firstpath:a,secondpath:c,shared:s}},Yo=qo,Jo=Xo,Qo=jo(),Zo=function(t,e){return Yo(Qo,(function(e,n){return t(n)}),e)},ti=function(t,e,n){return Jo(Qo,t,e,n)},ei=function(t){return qn(t,"table")},ni=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||Ce(e,t)}};return Ce(t,e)?D.some({boxes:D.some([t]),start:t,finish:e}):ei(t).bind((function(o){return ei(e).bind((function(i){if(Ce(o,i))return D.some({boxes:xo(o,t,e),start:t,finish:e});if(Oe(o,i)){var u=Ln(e,"td,th",r(o)),a=u.length>0?u[u.length-1]:e;return D.some({boxes:Co(o,t,o,e,i),start:t,finish:a})}if(Oe(i,o)){u=Ln(t,"td,th",r(i));var c=u.length>0?u[u.length-1]:t;return D.some({boxes:Co(i,t,o,e,i),start:t,finish:c})}return ti(t,e).shared.bind((function(u){return Kn(u,"table",n).bind((function(n){var u=Ln(e,"td,th",r(n)),a=u.length>0?u[u.length-1]:e,c=Ln(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return D.some({boxes:Co(n,t,o,e,i),start:s,finish:a})}))}))}))}))},ri=function(t,e){var n=zn(t,e);return n.length>0?D.some(n):D.none()},oi=function(t,e){return q(t,(function(t){return be(t,e)}))},ii=function(t,e,n){return Gn(t,e).bind((function(e){return Gn(t,n).bind((function(t){return Zo(ei,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},ui=function(t,e){return qn(t,"table").bind((function(n){return Gn(n,e).bind((function(e){return ni(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))},ai=function(t,e,n,r,o){return oi(t,o).bind((function(t){return wo(t,e,n).bind((function(t){return ui(t,r)}))}))},ci=function(t,e){return ri(t,e)},si=function(t,e,n){return ii(t,e,n).bind((function(e){var n=function(e){return Ce(t,e)},r="thead,tfoot,tbody,table",o=qn(e.first,r,n),i=qn(e.last,r,n);return o.bind((function(t){return i.bind((function(n){return Ce(t,n)?So(e.table,e.first,e.last):D.none()}))}))}))},fi=function(t){if(!u(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return F(t,(function(r,o){var i=Ee(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=Ee(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));var o=X(e,(function(t){return M(r,t)}));if(!o)throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){}}}})),n},li={generate:fi},di=li.generate([{none:[]},{multiple:["elements"]},{single:["element"]}]),mi=function(t,e,n,r){return t.fold(e,n,r)},gi=di.none,pi=di.multiple,hi=di.single,vi=function(t,e,n){var r=function(){return ci(t(),n).fold((function(){return e().fold(gi,hi)}),(function(t){return pi(t)}))};return{get:r}},bi=tinymce.util.Tools.resolve("tinymce.PluginManager"),yi=function(t,e){return ve.fromDom(t.dom.cloneNode(e))},wi=function(t){return yi(t,!1)},xi=function(t){return yi(t,!0)},Ci=function(t,e){var n=ve.fromTag(e),r=nr(t);return Jn(n,r),n},Si=function(t,e){var n=Ci(t,e),r=wn(xi(t));return Bo(n,r),n},ki=function(t,e){var n=Ci(t,e);Oo(t,n);var r=wn(t);return Bo(n,r),Po(t),n},Oi=function(t,e){var n=function(e,n){if(!m(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;sr(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=gr(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return j(e,(function(e,n){var r=gr(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}},Ti=function(){var t=oe().browser;return t.isIE()||t.isEdge()},Ei=function(t,e){return _t(t).getOr(e)},_i=function(t,e,n){return Ei(gr(t,e),n)},Di=function(t){return gr(t,"box-sizing")},Ai=function(t,e,n,r){var o=_i(t,"padding-"+n,0),i=_i(t,"padding-"+r,0),u=_i(t,"border-"+n+"-width",0),a=_i(t,"border-"+r+"-width",0);return e-o-i-u-a},Ri=function(t,e){var n=t.dom,r=n.getBoundingClientRect().height||n.offsetHeight;return"border-box"===e?r:Ai(t,r,"top","bottom")},Ni=function(t,e){var n=t.dom,r=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===e?r:Ai(t,r,"left","right")},Bi=function(t){return Ti()?Ri(t,Di(t)):_i(t,"height",t.dom.offsetHeight)},Mi=function(t){return Ti()?Ni(t,Di(t)):_i(t,"width",t.dom.offsetWidth)},Pi=function(t){return Ni(t,"content-box")},Ii=Oi("width",(function(t){return t.dom.offsetWidth})),Li=function(t){return Ii.get(t)},Fi=function(t){return Ii.getOuter(t)},zi=Pi,Hi=Mi,Vi=function(t,e){void 0===e&&(e=k);var n=t.grid,r=I(n.columns,b),o=I(n.rows,b);return L(r,(function(n){var r=function(){return K(o,(function(e){return so.getAt(t,e,n).filter((function(t){return t.column===n})).toArray()}))},i=function(t){return 1===t.colspan&&e(t.element)},u=function(){return so.getAt(t,0,n)};return Ui(r,i,u)}))},Ui=function(t,e,n){var r=t(),o=q(r,e),i=o.orThunk((function(){return D.from(r[0]).orThunk(n)}));return i.map((function(t){return t.element}))},ji=function(t){var e=t.grid,n=I(e.rows,b),r=I(e.columns,b);return L(n,(function(e){var n=function(){return K(r,(function(n){return so.getAt(t,e,n).filter((function(t){return t.row===e})).fold(v([]),(function(t){return[t]}))}))},o=function(t){return 1===t.rowspan},i=function(){return so.getAt(t,e,0)};return Ui(n,o,i)}))},Wi=function(t,e){if(e<0||e>=t.length-1)return D.none();var n=t[e].fold((function(){var n=Y(t.slice(0,e));return rt(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return D.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return rt(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return D.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))},qi=function(t,e){return function(n){return"rtl"===$i(n)?e:t}},$i=function(t){return"rtl"===gr(t,"direction")?"rtl":"ltr"},Gi=Oi("height",(function(t){var e=t.dom;return Rn(t)?e.getBoundingClientRect().height:e.offsetHeight})),Ki=function(t){return Gi.get(t)},Xi=function(t){return Gi.getOuter(t)},Yi=Bi,Ji=function(t,e){var n=function(n,r){return Ji(t+n,e+r)};return{left:t,top:e,translate:n}},Qi=Ji,Zi=function(t){var e=t.getBoundingClientRect();return Qi(e.left,e.top)},tu=function(t,e){return void 0!==t?t:void 0!==e?e:0},eu=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Qi(n.offsetLeft,n.offsetTop);var i=tu(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=tu(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=tu(o.clientTop,n.clientTop),c=tu(o.clientLeft,n.clientLeft);return nu(t).translate(u-c,i-a)},nu=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?Qi(r.offsetLeft,r.offsetTop):Rn(t)?Zi(e):Qi(0,0)},ru=function(t,e){return{row:t,y:e}},ou=function(t,e){return{col:t,x:e}},iu=function(t){var e=eu(t);return e.left+Fi(t)},uu=function(t){return eu(t).left},au=function(t,e){return ou(t,uu(e))},cu=function(t,e){return ou(t,iu(e))},su=function(t){return eu(t).top},fu=function(t,e){return ru(t,su(e))},lu=function(t,e){return ru(t,su(e)+Xi(e))},du=function(t,e,n){if(0===n.length)return[];var r=L(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},mu=function(t){return-t},gu={delta:b,positions:function(t){return du(fu,lu,t)},edge:su},pu={delta:b,edge:uu,positions:function(t){return du(au,cu,t)}},hu={delta:mu,edge:iu,positions:function(t){return du(cu,au,t)}},vu=qi(pu,hu),bu={delta:function(t,e){return vu(e).delta(t,e)},positions:function(t,e){return vu(e).positions(t,e)},edge:function(t){return vu(t).edge(t)}},yu={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},wu=function(){var t="[0-9]+",e="[+-]?"+t,n="[eE]"+e,r="\\.",o=function(t){return"(?:"+t+")?"},i=["Infinity",t+r+o(t)+o(n),r+t+o(n),t+o(n)].join("|"),u="[+-]?(?:"+i+")";return new RegExp("^("+u+")(.*)$")}(),xu=function(t,e){return P(e,(function(e){return P(yu[e],(function(e){return t===e}))}))},Cu=function(t,e){var n=D.from(wu.exec(t));return n.bind((function(t){var n=Number(t[1]),r=t[2];return xu(r,e)?D.some({value:n,unit:r}):D.none()}))},Su=/(\d+(\.\d+)?)%/,ku=/(\d+(\.\d+)?)px|em/,Ou=ln("col"),Tu=function(t,e,n){var r=hn(t).getOrThunk((function(){return Bn(dn(t))}));return e(t)/n(r)*100},Eu=function(t,e){dr(t,"width",e+"px")},_u=function(t,e){dr(t,"width",e+"%")},Du=function(t,e){dr(t,"height",e+"px")},Au=function(t){return Yi(t)+"px"},Ru=function(t,e,n,r){var o=Nr(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o},Nu=function(t,e,n,r){var o=parseFloat(t);return St(t,"%")&&"table"!==nn(e)?Ru(e,o,n,r):o},Bu=function(t){var e=Au(t);return e?Nu(e,t,Ki,Du):Ki(t)},Mu=function(t,e,n){var r=n(t),o=wr(t,e);return r/o},Pu=function(t,e){return hr(t,e).orThunk((function(){return tr(t,e).map((function(t){return t+"px"}))}))},Iu=function(t){return Pu(t,"width")},Lu=function(t){return Pu(t,"height")},Fu=function(t){return Tu(t,Li,zi)},zu=function(t){return Ou(t)?Li(t):Hi(t)},Hu=function(t){return Mu(t,"rowspan",Bu)},Vu=function(t){var e=Iu(t);return e.bind((function(t){return Cu(t,["fixed","relative","empty"])}))},Uu=function(t,e,n){dr(t,"width",e+n)},ju=function(t){return Li(t)+"px"},Wu=function(t){return Tu(t,Li,zi)+"%"},qu=function(t){return Iu(t).exists((function(t){return Su.test(t)}))},$u=function(t){return Iu(t).exists((function(t){return ku.test(t)}))},Gu=function(t){return Iu(t).isNone()},Ku=v(Su),Xu=ln("col"),Yu=function(t){return Iu(t).getOrThunk((function(){return zu(t)+"px"}))},Ju=function(t){return Lu(t).getOrThunk((function(){return Hu(t)+"px"}))},Qu=function(t){return L(so.justColumns(t),(function(t){return D.from(t.element)}))},Zu=function(t){var e=oe().browser,n=e.isChrome()||e.isFirefox();return!Xu(t)||n},ta=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(Wi(n,e))}),(function(t){return o(t)}))},ea=function(t,e,n,r){var o=Vi(t),i=so.hasColumns(t)?Qu(t):o,u=[D.some(bu.edge(e))].concat(L(bu.positions(o,e),(function(t){return t.map((function(t){return t.x}))}))),a=x(xr);return L(i,(function(t,e){return ta(t,e,u,a,(function(t){if(Zu(t))return n(t);var i=ur(o[e],b);return ta(i,e,u,a,(function(t){return r(D.some(Li(t)))}),r)}),r)}))},na=function(t){return t.map((function(t){return t+"px"})).getOr("")},ra=function(t,e){return ea(t,e,Yu,na)},oa=function(t,e,n){return ea(t,e,Fu,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}))},ia=function(t,e,n){return ea(t,e,zu,(function(t){return t.getOrThunk(n.minCellWidth)}))},ua=function(t,e,n,r,o){var i=ji(t),u=[D.some(n.edge(e))].concat(L(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return L(i,(function(t,e){return ta(t,e,u,x(Cr),r,o)}))},aa=function(t,e,n){return ua(t,e,n,Hu,(function(t){return t.getOrThunk(Or)}))},ca=function(t,e,n){return ua(t,e,n,Ju,na)},sa=function(t,e){return function(){return Rn(t)?e(t):parseFloat(hr(t,"width").getOr("0"))}},fa=function(t){var e=sa(t,Li),n=v(0),r=function(e,n){return ia(e,t,n)};return{width:e,pixelWidth:e,getWidths:r,getCellDelta:n,singleColumnWidth:v([0]),minCellWidth:n,setElementWidth:g,adjustTableWidth:g,isRelative:!0,label:"none"}},la=function(t){var e=sa(t,(function(t){return parseFloat(Wu(t))})),n=sa(t,Li),r=function(t){return t/n()*100},o=function(t,e){return[100-t]},i=function(){return kr()/n()*100},u=function(n){var r=e(),o=n/100*r,i=r+o;_u(t,i)},a=function(e,n){return oa(e,t,n)};return{width:e,pixelWidth:n,getWidths:a,getCellDelta:r,singleColumnWidth:o,minCellWidth:i,setElementWidth:_u,adjustTableWidth:u,isRelative:!0,label:"percent"}},da=function(t){var e=sa(t,Li),n=b,r=function(t,e){var n=Math.max(kr(),t+e);return[n-t]},o=function(n){var r=e()+n;Eu(t,r)},i=function(e,n){return ia(e,t,n)};return{width:e,pixelWidth:e,getWidths:i,getCellDelta:n,singleColumnWidth:r,minCellWidth:kr,setElementWidth:Eu,adjustTableWidth:o,isRelative:!1,label:"pixel"}},ma=function(t,e){var n=Ku().exec(e);return null!==n?la(t):da(t)},ga=function(t){var e=Iu(t);return e.fold((function(){return fa(t)}),(function(e){return ma(t,e)}))},pa={getTableSize:ga,pixelSize:da,percentageSize:la,noneSize:fa},ha=function(t,e,n,r,o,i){return{minRow:t,minCol:e,maxRow:n,maxCol:r,allCells:o,selectedCells:i}},va=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=r,i=n,u=0,a=0,c=[],s=[];return De(t.access,(function(t){if(c.push(t),e(t)){s.push(t);var n=t.row,r=n+t.rowspan-1,f=t.column,l=f+t.colspan-1;n<o?o=n:r>u&&(u=r),f<i?i=f:l>a&&(a=l)}})),ha(o,i,u,a,c,s)},ba=function(t,e,n){var r=t[n].element,o=ve.fromTag("td");_o(o,ve.fromTag("br"));var i=e?_o:Eo;i(r,o)},ya=function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)if(!(u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol)){var s=so.getAt(e,u,c).filter(r).isNone();s?ba(t,a,u):a=!0}},wa=function(t,e,n,r){De(n.columns,(function(t){(t.column<e.minCol||t.column>e.maxCol)&&Po(t.element)}));var o=V(Tr(t,"tr"),(function(t){return 0===t.dom.childElementCount}));F(o,Po),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||F(Tr(t,"th,td"),(function(t){er(t,"rowspan"),er(t,"colspan")})),er(t,Xr),er(t,"data-snooker-col-series");var i=pa.getTableSize(t);i.adjustTableWidth(r)},xa=function(t,e,n,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=ia(e,t,n),i=j(o,(function(t,e){return t+e}),0),u=j(o.slice(r.minCol,r.maxCol+1),(function(t,e){return t+e}),0),a=u/i*n.pixelWidth(),c=a-n.pixelWidth();return n.getCellDelta(c)},Ca=function(t,e){var n=function(t){return be(t.element,e)},r=xi(t),o=Lr(r),i=pa.getTableSize(t),u=so.generate(o),a=va(u,n),c="th:not("+e+"),td:not("+e+")",s=Er(r,"th,td",(function(t){return be(t,c)}));F(s,Po),ya(o,u,a,n);var f=so.fromTable(t),l=xa(t,f,i,a);return wa(r,a,u,l),r},Sa=" ",ka=function(t){return"img"===nn(t)?1:Ho(t).fold((function(){return wn(t).length}),(function(t){return t.length}))},Oa=function(t){return Ho(t).filter((function(t){return 0!==t.trim().length||t.indexOf(Sa)>-1})).isSome()},Ta=["img","br"],Ea=function(t){var e=Oa(t);return e||M(Ta,nn(t))},_a=function(t){return Wn(t,Ea)},Da=function(t){return Aa(t,Ea)},Aa=function(t,e){var n=function(t){for(var r=wn(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return D.some(i);var u=n(i);if(u.isSome())return u}return D.none()};return n(t)},Ra={scope:["row","col"]},Na=function(t){return function(){var e=ve.fromTag("td",t.dom);return _o(e,ve.fromTag("br",t.dom)),e}},Ba=function(t){return function(){return ve.fromTag("col",t.dom)}},Ma=function(t){return function(){return ve.fromTag("colgroup",t.dom)}},Pa=function(t){return function(){return ve.fromTag("tr",t.dom)}},Ia=function(t,e,n){var r=Si(t,e);return De(n,(function(t,e){null===t?er(r,e):Yn(r,e,t)})),r},La=function(t){return t},Fa=function(t,e,n){var r=_a(t);return r.map((function(r){var o=n.join(","),i=Ln(r,o,(function(e){return Ce(e,t)}));return U(i,(function(t,e){var n=wi(e);return er(n,"contenteditable"),_o(t,n),n}),e)})).getOr(e)},za=function(t,e){De(Ra,(function(n,r){return tr(t,r).filter((function(t){return M(n,t)})).each((function(t){return Yn(e,r,t)}))}))},Ha=function(t,e,n){var r=function(t,e){br(t.element,e),vr(e,"height"),1!==t.colspan&&vr(e,"width")},o=function(o){var i=ve.fromTag(nn(o.element),e.dom),u=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=u.length>0?Fa(o.element,i,u):i;return _o(a,ve.fromTag("br")),r(o,i),za(o.element,i),t(o.element,i),i},i=function(n){var o=ve.fromTag(nn(n.element),e.dom);return r(n,o),t(n.element,o),o};return{col:i,colgroup:Ma(e),row:Pa(e),cell:o,replace:Ia,colGap:Ba(e),gap:Na(e)}},Va=function(t){return{col:Ba(t),colgroup:Ma(t),row:Pa(t),cell:Na(t),replace:La,colGap:Ba(t),gap:Na(t)}},Ua=function(t,e){var n=e||document,r=n.createElement("div");return r.innerHTML=t,wn(ve.fromDom(r))},ja=function(t){return L(t,ve.fromDom)},Wa=function(t){return t.nodeName.toLowerCase()},qa=function(t){return ve.fromDom(t.getBody())},$a=function(t){return t.getBoundingClientRect().width},Ga=function(t){return t.getBoundingClientRect().height},Ka=function(t){return function(e){return Ce(e,qa(t))}},Xa=function(t){return t?t.replace(/px$/,""):""},Ya=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Ja=function(t){er(t,"data-mce-style");var e=function(t){return er(t,"data-mce-style")};F(Ar(t),e),F(Rr(t),e),F(Br(t),e)},Qa=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return D.from(n).filter(Tt)},Za=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},tc=function(t){return/^(\d+(\.\d+)?)px$/.test(t)},ec=function(t){return ve.fromDom(t.selection.getStart())},nc=function(t){return ve.fromDom(t.selection.getEnd())},rc=function(t){return mi(t.get(),v([]),b,Q)},oc=function(t){var e=function(t,e){return tr(t,e).exists((function(t){return parseInt(t,10)>1}))},n=function(t){return e(t,"rowspan")||e(t,"colspan")},r=rc(t);return r.length>0&&X(r,n)?D.some(r):D.none()},ic=function(t,e,n){return mi(e.get(),D.none,(function(e){return e.length<=1?D.none():si(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),D.none)},uc="data-mce-selected",ac="td["+uc+"],th["+uc+"]",cc="["+uc+"]",sc="data-mce-first-selected",fc="td["+sc+"],th["+sc+"]",lc="data-mce-last-selected",dc="td["+lc+"],th["+lc+"]",mc=cc,gc={selected:uc,selectedSelector:ac,firstSelected:sc,firstSelectedSelector:fc,lastSelected:lc,lastSelectedSelector:dc},pc=function(t){return{element:t,mergable:D.none(),unmergable:D.none(),selection:[t]}},hc=function(t,e,n){return{element:n,mergable:ic(e,t,gc),unmergable:oc(t),selection:rc(t)}},vc=function(t,e,n){return{element:t,clipboard:e,generators:n}},bc=function(t,e,n,r){return{selection:rc(t),clipboard:n,generators:r}},yc=function(t){return Nr(t).bind((function(t){return ci(t,gc.firstSelectedSelector)})).fold(v(t),(function(t){return t[0]}))},wc=function(t){return function(e,n){var r=nn(e),o="col"===r||"colgroup"===r?yc(e):e;return Kn(o,t,n)}},xc=wc("th,td,caption"),Cc=wc("th,td"),Sc=function(t){return rc(t)},kc=function(t,e){var n=Cc(t),r=n.bind((function(t){return Nr(t)})).map((function(t){return Br(t)}));return ir(n,r,(function(t,n){return V(n,(function(n){return P(ja(n.dom.cells),(function(n){return"1"===Zn(n,e)||Ce(n,t)}))}))})).getOr([])},Oc=function(t){return Nr(t[0]).map((function(t){var e=Ca(t,mc);return Ja(e),[e]}))},Tc=function(t,e){return L(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")},Ec=function(t){return L(t,(function(t){return t.dom.innerText})).join("")},_c=function(t,e,n){t.on("BeforeGetContent",(function(n){var r=function(e){n.preventDefault(),Oc(e).each((function(e){n.content="text"===n.format?Ec(e):Tc(t,e)}))};!0===n.selection&&mi(e.get(),g,r,g)})),t.on("BeforeSetContent",(function(r){if(!0===r.selection&&!0===r.paste){var o=Sc(e);et(o).each((function(e){Nr(e).each((function(o){var i=V(Ua(r.content),(function(t){return"meta"!==nn(t)})),u=ln("table");if(1===i.length&&u(i[0])){r.preventDefault();var a=ve.fromDom(t.getDoc()),c=Va(a),s=vc(e,i[0],c);n.pasteCells(o,s).each((function(){t.focus()}))}}))}))}}))},Dc=li.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ac=ot({},Dc),Rc=function(t,e){return 0===t.length?Ac.none():1===t.length?Ac.only(0):0===e?Ac.left(0,1):e===t.length-1?Ac.right(e-1,e):e>0&&e<t.length-1?Ac.middle(e-1,e,e+1):Ac.none()},Nc=function(t,e,n,r,o){var i=t.slice(0),u=Rc(t,e),a=v(L(i,v(0))),c=function(t){return r.singleColumnWidth(i[t],n)},s=function(t,e){return o.calcLeftEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)},f=function(t,e,u){return o.calcMiddleDeltas(i,t,e,u,n,r.minCellWidth(),r.isRelative)},l=function(t,e){return o.calcRightEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)};return u.fold(a,c,s,f,l)},Bc=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Mc=function(t,e){var n=so.justCells(t);return L(n,(function(t){var n=Bc(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))},Pc=function(t,e){var n=so.justColumns(t);return L(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))},Ic=function(t,e){var n=so.justCells(t);return L(n,(function(t){var n=Bc(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Lc=function(t,e){return L(t.all,(function(t,n){return{element:t.element,height:e[n]}}))},Fc=function(t){return U(t,(function(t,e){return t+e}),0)},zc=function(t,e){return so.hasColumns(t)?Pc(t,e):Mc(t,e)},Hc=function(t,e,n){var r=zc(t,e);F(r,(function(t){n.setElementWidth(t.element,t.width)}))},Vc=function(t,e,n,r,o){var i=so.fromTable(t),u=o.getCellDelta(e),a=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(a,n,u,o.minCellWidth(),c),f=Nc(a,n,s,o,r),l=L(f,(function(t,e){return t+a[e]}));Hc(i,l,o),r.resizeTable(o.adjustTableWidth,s,c)},Uc=function(t,e,n,r){var o=so.fromTable(t),i=aa(o,t,r),u=L(i,(function(t,r){return n===r?Math.max(e+t,Or()):t})),a=Ic(o,u),c=Lc(o,u);F(c,(function(t){Du(t.element,t.height)})),F(a,(function(t){Du(t.element,t.height)}));var s=Fc(u);Du(t,s)},jc=function(t,e,n,r,o){var i=so.generate(e),u=r.getWidths(i,r),a=r.pixelWidth(),c=o.calcRedestributedWidths(u,a,n.pixelDelta,r.isRelative),s=c.newSizes,f=c.delta;Hc(i,s,r),r.adjustTableWidth(f)},Wc=function(t,e,n,r){var o=so.generate(e),i=r.getWidths(o,r);Hc(o,i,r)},qc=function(t){return L(t,v(0))},$c=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},Gc=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},Kc=Gc((function(t){return t<0})),Xc=Gc(k),Yc=function(){var t=function(t,e,n,r,o){var i=Kc(t,e,r,o);return $c(t,e,n+1,[i,0],qc)},e=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return L(t,(function(t,n){var r=n===e?i:t/o;return r-t}))},n=function(n,r,o,i,u,a){return a?e(n,r,i,u):t(n,r,o,i,u)},r=function(t,e,r,o,i,u,a){return n(t,r,o,i,u,a)},o=function(t,e){return t(e)},i=function(t,n,r,o,i,u){if(u)return e(t,r,o,i);var a=Kc(t,r,o,i);return qc(t.slice(0,r)).concat([a])},u=function(t,e,n,r){if(r){var o=e+n,i=o/e,u=L(t,(function(t){return t/i}));return{delta:100*i-100,newSizes:u}}return{delta:n,newSizes:t}};return{resizeTable:o,clampTableDelta:Kc,calcLeftEdgeDeltas:n,calcMiddleDeltas:r,calcRightEdgeDeltas:i,calcRedestributedWidths:u}},Jc=function(){var t=function(t,e,n,r,o){var i=r>=0?n:e,u=Xc(t,i,r,o);return $c(t,e,n+1,[u,-u],qc)},e=function(e,n,r,o,i,u){return t(e,r,o,i,u)},n=function(t,e,n){n&&t(e)},r=function(t,e,n,r,o,i){if(i)return qc(t);var u=r/t.length;return L(t,v(u))},o=function(t,e,n,r,o){if(o){if(n>=0)return n;var i=j(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return Kc(t,e,n,r)},i=function(t,e,n,r){return{delta:0,newSizes:t}};return{resizeTable:n,clampTableDelta:o,calcLeftEdgeDeltas:t,calcMiddleDeltas:e,calcRightEdgeDeltas:r,calcRedestributedWidths:i}},Qc=function(t,e){var n=D.from(t.dom.documentElement).map(ve.fromDom).getOr(t);return{parent:v(n),view:v(t),origin:v(Qi(0,0)),isResizable:e}},Zc=function(t,e,n){var r=function(){return eu(e)};return{parent:v(e),view:v(t),origin:r,isResizable:n}},ts=function(t,e,n){return{parent:v(e),view:v(t),origin:v(Qi(0,0)),isResizable:n}},es={only:Qc,detached:Zc,body:ts},ns=li.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),rs=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):ns.invalid(n)},os=function(t){return St(t,"%")?rs("%",ns.percent,t):St(t,"px")?rs("px",ns.pixels,t):ns.invalid(t)},is=ot(ot({},ns),{from:os}),us=function(t,e){return L(t,(function(t){var n=is.from(t);return n.fold((function(){return t}),(function(t){var n=t/e*100;return n+"%"}),(function(t){return t+"%"}))}))},as=function(t,e,n){var r=n/e;return L(t,(function(t){var e=is.from(t);return e.fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))},cs=function(t,e){var n=t.fold((function(){return v("")}),(function(t){var n=t/e;return v(n+"px")}),(function(){var t=100/e;return v(t+"%")}));return I(e,n)},ss=function(t,e,n){return t.fold((function(){return e}),(function(t){return as(e,n,t)}),(function(t){return us(e,n)}))},fs=function(t,e,n){var r=is.from(n),o=X(t,(function(t){return"0px"===t}))?cs(r,t.length):ss(r,t,e);return gs(o)},ls=function(t,e){return 0===t.length?e:U(t,(function(t,e){return is.from(e).fold(v(0),b,b)+t}),0)},ds=function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}},ms=function(t,e){return is.from(t).fold(v(t),(function(t){return t+e+"px"}),(function(t){return t+e+"%"}))},gs=function(t){if(0===t.length)return t;var e=U(t,(function(t,e){var n=is.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return ds(t,"px")}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([ms(n[n.length-1],Math.round(e.remainder))])},ps=is.from,hs=function(t,e,n){F(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=ls(r,kr());dr(e.element,"width",o+n)}))},vs=function(t,e,n){F(e,(function(e,r){var o=ls([t[r]],kr());dr(e.element,"width",o+n)}))},bs=function(t,e,n,r){F(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=ls(n,Or());dr(e.element,"height",o+r)})),F(e,(function(e,n){dr(e.element,"height",t[n])}))},ys=function(t){return ps(t).fold(v("px"),v("px"),v("%"))},ws=function(t,e,n){var r=so.fromTable(t),o=r.all,i=so.justCells(r),u=so.justColumns(r);e.each((function(e){var n=ys(e),o=Li(t),a=ra(r,t),c=fs(a,o,e);so.hasColumns(r)?vs(c,u,n):hs(c,i,n),dr(t,"width",e)})),n.each((function(e){var n=ys(e),u=Ki(t),a=ca(r,t,gu),c=fs(a,u,e);bs(c,o,i,n),dr(t,"height",e)}))},xs=qu,Cs=$u,Ss=Gu,ks=function(t){var e=so.fromTable(t);return e.grid},Os=function(t){var e=[],n=function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},r=function(t){e=V(e,(function(e){return e!==t}))},o=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};F(t,(function(t,e){o[t]=n[e]})),F(e,(function(t){t(o)}))};return{bind:n,unbind:r,trigger:o}},Ts=function(t){var e=Ae(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),n=Ae(t,(function(t){return t.trigger}));return{registry:e,trigger:n}},Es=function(t,e){var n=null,r=function(){a(n)||(clearTimeout(n),n=null)},o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)};return{cancel:r,throttle:o}},_s=function(t){return t.slice(0).sort()},Ds=function(t,e){throw new Error("All required keys ("+_s(t).join(", ")+") were not specified. Specified keys were: "+_s(e).join(", ")+".")},As=function(t){throw new Error("Unsupported keys for object: "+_s(t).join(", "))},Rs=function(t,e){if(!u(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");F(e,(function(e){if(!o(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))},Ns=function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+_s(t).join(", ")+") were not.")},Bs=function(t){var e=_s(t),n=q(e,(function(t,n){return n<e.length-1&&t===e[n+1]}));n.each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+e.join(", ")+"].")}))},Ms=function(t,e){return Ps(t,e,{validate:d,label:"function"})},Ps=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");return Rs("required",e),Bs(e),function(r){var o=Ee(r),i=X(e,(function(t){return M(o,t)}));i||Ds(e,o),t(e,o);var u=V(e,(function(t){return!n.validate(r[t],t)}));return u.length>0&&Ns(u,n.label),r}},Is=function(t,e){var n=V(e,(function(e){return!M(t,e)}));n.length>0&&As(n)},Ls=function(t){return Ms(Is,t)},Fs=Ls(["compare","extract","mutate","sink"]),zs=Ls(["element","start","stop","destroy"]),Hs=Ls(["forceDrop","drop","move","delayDrop"]),Vs=function(){var t=D.none(),e=function(){t=D.none()},n=function(e,n){var r=t.map((function(t){return e.compare(t,n)}));return t=D.some(n),r},r=function(t,e){var r=e.extract(t);r.each((function(t){var r=n(e,t);r.each((function(t){o.trigger.move(t)}))}))},o=Ts({move:Os(["info"])});return{onEvent:r,reset:e,events:o.registry}},Us=function(){var t=Ts({move:Os(["info"])});return{onEvent:g,reset:g,events:t.registry}},js=function(){var t=Us(),e=Vs(),n=t,r=function(){n.reset(),n=e},o=function(){n.reset(),n=t},i=function(t,e){n.onEvent(t,e)},u=function(){return n===e};return{on:r,off:o,isOn:u,onEvent:i,events:e.events}},Ws=function(t,e,n){var r=!1,o=Ts({start:Os([]),stop:Os([])}),i=js(),u=function(){m.stop(),i.isOn()&&(i.off(),o.trigger.stop())},a=Es(u,200),c=function(t){m.start(t),i.on(),o.trigger.start()},s=function(t){a.cancel(),i.onEvent(t,e)};i.events.move.bind((function(n){e.mutate(t,n.info)}));var f=function(){r=!0},l=function(){r=!1},d=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r&&t.apply(null,e)}},m=e.sink(Hs({forceDrop:u,drop:d(u),move:d(s),delayDrop:d(a.throttle)}),n),g=function(){m.destroy()};return{element:m.element,go:c,on:f,off:l,destroy:g,events:o.registry}},qs=function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}},$s=function(t){var e=ve.fromDom(Dn(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return qs(e,t.clientX,t.clientY,n,r,o,t)},Gs=function(t,e){return function(n){t(n)&&e($s(n))}},Ks=function(t,e,n,r,o){var i=Gs(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(Ys,t,e,i,o)}},Xs=function(t,e,n,r){return Ks(t,e,n,r,!1)},Ys=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Js=k,Qs=function(t,e,n){return Xs(t,e,Js,n)},Zs=$s,tf=function(t,e){var n=Zn(t,e);return void 0===n||""===n?[]:n.split(" ")},ef=function(t,e,n){var r=tf(t,e),o=r.concat([n]);return Yn(t,e,o.join(" ")),!0},nf=function(t,e,n){var r=V(tf(t,e),(function(t){return t!==n}));return r.length>0?Yn(t,e,r.join(" ")):er(t,e),!1},rf=function(t){return void 0!==t.dom.classList},of=function(t){return tf(t,"class")},uf=function(t,e){return ef(t,"class",e)},af=function(t,e){return nf(t,"class",e)},cf=function(t,e){rf(t)?t.dom.classList.add(e):uf(t,e)},sf=function(t){var e=rf(t)?t.dom.classList:of(t);0===e.length&&er(t,"class")},ff=function(t,e){if(rf(t)){var n=t.dom.classList;n.remove(e)}else af(t,e);sf(t)},lf=function(t,e){return rf(t)&&t.dom.classList.contains(e)},df=function(t){var e=t.replace(/\./g,"-"),n=function(t){return e+"-"+t};return{resolve:n}},mf=df("ephox-dragster"),gf=mf.resolve,pf=function(t){var e=ot({layerClass:gf("blocker")},t),n=ve.fromTag("div");Yn(n,"role","presentation"),mr(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),cf(n,gf("blocker")),cf(n,e.layerClass);var r=v(n),o=function(){Po(n)};return{element:r,destroy:o}},hf=function(t,e){return Qi(e.left-t.left,e.top-t.top)},vf=function(t){return D.some(Qi(t.x,t.y))},bf=function(t,e){t.mutate(e.left,e.top)},yf=function(t,e){var n=pf(e),r=Qs(n.element(),"mousedown",t.forceDrop),o=Qs(n.element(),"mouseup",t.drop),i=Qs(n.element(),"mousemove",t.move),u=Qs(n.element(),"mouseout",t.delayDrop),a=function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()},c=function(t){_o(t,n.element())},s=function(){Po(n.element())};return zs({element:n.element,start:c,stop:s,destroy:a})},wf=Fs({compare:hf,extract:vf,sink:yf,mutate:bf}),xf=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:wf;return Ws(t,n,e)},Cf=function(t){return Kn(t,"[contenteditable]")},Sf=function(t,e){return void 0===e&&(e=!1),!oe().browser.isIE()&&Rn(t)?t.dom.isContentEditable:Cf(t).fold(v(e),(function(t){return"true"===kf(t)}))},kf=function(t){return t.dom.contentEditable},Of=df("ephox-snooker"),Tf=Of.resolve,Ef=function(){var t=Ts({drag:Os(["xDelta","yDelta"])}),e=function(e,n){t.trigger.drag(e,n)};return{mutate:e,events:t.registry}},_f=function(){var t=Ts({drag:Os(["xDelta","yDelta","target"])}),e=D.none(),n=Ef();n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))}));var r=function(t){e=D.some(t)},o=function(){return e};return{assign:r,get:o,mutate:n.mutate,events:t.registry}},Df=function(t,e,n,r,o){var i=ve.fromTag("div");return mr(i,{position:"absolute",left:e-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),Jn(i,{"data-column":t,role:"presentation"}),i},Af=function(t,e,n,r,o){var i=ve.fromTag("div");return mr(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),Jn(i,{"data-row":t,role:"presentation"}),i},Rf=Tf("resizer-bar"),Nf=Tf("resizer-rows"),Bf=Tf("resizer-cols"),Mf=7,Pf=function(t,e){return K(t.all,(function(t,n){return e(t.element)?[n]:[]}))},If=function(t,e){var n=[];return I(t.grid.columns,(function(r){var o=so.getColumnAt(t,r).map((function(t){return t.element}));o.forall(e)&&n.push(r)})),V(n,(function(n){var r=so.filterItems(t,(function(t){return t.column===n}));return X(r,(function(t){return e(t.element)}))}))},Lf=function(t){var e=zn(t.parent(),"."+Rf);F(e,Po)},Ff=function(t,e,n){var r=t.origin();F(e,(function(e){e.each((function(e){var o=n(r,e);cf(o,Rf),_o(t.parent(),o)}))}))},zf=function(t,e,n,r){Ff(t,e,(function(t,e){var o=Df(e.col,e.x-t.left,n.top-t.top,Mf,r);return cf(o,Bf),o}))},Hf=function(t,e,n,r){Ff(t,e,(function(t,e){var o=Af(e.row,n.left-t.left,e.y-t.top,r,Mf);return cf(o,Nf),o}))},Vf=function(t,e,n,r,o){var i=eu(n),u=e.isResizable,a=r.length>0?gu.positions(r,n):[],c=a.length>0?Pf(t,u):[],s=V(a,(function(t,e){return P(c,(function(t){return e===t}))}));Hf(e,s,i,Fi(n));var f=o.length>0?bu.positions(o,n):[],l=f.length>0?If(t,u):[],d=V(f,(function(t,e){return P(l,(function(t){return e===t}))}));zf(e,d,i,Xi(n))},Uf=function(t,e){if(Lf(t),t.isResizable(e)){var n=so.fromTable(e),r=ji(n),o=Vi(n);Vf(n,t,e,r,o)}},jf=function(t,e){var n=zn(t.parent(),"."+Rf);F(n,e)},Wf=function(t){jf(t,(function(t){dr(t,"display","none")}))},qf=function(t){jf(t,(function(t){dr(t,"display","block")}))},$f=function(t){return lf(t,Nf)},Gf=function(t){return lf(t,Bf)},Kf=Tf("resizer-bar-dragging"),Xf=function(t){var e=_f(),n=xf(e,{}),r=D.none(),o=function(t,e){return D.from(Zn(t,e))};e.events.drag.bind((function(t){o(t.target,"data-row").each((function(e){var n=Sr(t.target,"top");dr(t.target,"top",n+t.yDelta+"px")})),o(t.target,"data-column").each((function(e){var n=Sr(t.target,"left");dr(t.target,"left",n+t.xDelta+"px")}))}));var i=function(t,e){var n=Sr(t,e),r=yr(t,"data-initial-"+e,0);return n-r};n.events.stop.bind((function(){e.get().each((function(e){r.each((function(n){o(e,"data-row").each((function(t){var r=i(e,"top");er(e,"data-initial-top"),m.trigger.adjustHeight(n,r,parseInt(t,10))})),o(e,"data-column").each((function(t){var r=i(e,"left");er(e,"data-initial-left"),m.trigger.adjustWidth(n,r,parseInt(t,10))})),Uf(t,n)}))}))}));var u=function(r,o){m.trigger.startAdjust(),e.assign(r),Yn(r,"data-initial-"+o,Sr(r,o)),cf(r,Kf),dr(r,"opacity","0.2"),n.go(t.parent())},a=Qs(t.parent(),"mousedown",(function(t){$f(t.target)&&u(t.target,"top"),Gf(t.target)&&u(t.target,"left")})),c=function(e){return Ce(e,t.view())},s=function(t){return Kn(t,"table",c).filter(Sf)},f=Qs(t.view(),"mouseover",(function(e){s(e.target).fold((function(){Rn(e.target)&&Lf(t)}),(function(e){r=D.some(e),Uf(t,e)}))})),l=function(){a.unbind(),f.unbind(),n.destroy(),Lf(t)},d=function(e){Uf(t,e)},m=Ts({adjustHeight:Os(["table","delta","row"]),adjustWidth:Os(["table","delta","column"]),startAdjust:Os([])});return{destroy:l,refresh:d,on:n.on,off:n.off,hideBars:w(Wf,t),showBars:w(qf,t),events:m.registry}},Yf=function(t,e,n){var r=gu,o=bu,i=Xf(t),u=Ts({beforeResize:Os(["table","type"]),afterResize:Os(["table","type"]),startDrag:Os([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);Uc(e,n,t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Vc(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},Jf={create:Yf},Qf=function(t,e){return t.fire("newrow",{node:e})},Zf=function(t,e){return t.fire("newcell",{node:e})},tl=function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})},el=function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})},nl=function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})},rl=function(t){t.fire("TableSelectionClear")},ol=function(t,e,n){t.fire("TableModified",ot(ot({},n),{table:e}))},il={structure:!1,style:!0},ul={structure:!0,style:!1},al={structure:!0,style:!0},cl="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",sl={"border-collapse":"collapse",width:"100%"},fl=I(5,(function(t){var e=t+1+"px";return{title:e,value:e}})),ll=L(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(t){return{title:t,value:t.toLowerCase()}})),dl=function(t){var e;if(Bl(t)){var n=t.dom,r=null!==(e=n.getParent(t.selection.getStart(),n.isBlock))&&void 0!==e?e:t.getBody(),o=zi(ve.fromDom(r));return ot(ot({},sl),{width:o+"px"})}return Ml(t)?Me(sl,(function(t,e){return"width"!==e})):sl},ml={border:"1"},gl="preservetable",pl=function(t){return t.getParam("table_sizing_mode","auto")},hl=function(t){return t.getParam("table_responsive_width")},vl=function(t){return t.getParam("table_border_widths",fl,"array")},bl=function(t){return t.getParam("table_border_styles",ll,"array")},yl=function(t){return t.getParam("table_default_attributes",ml,"object")},wl=function(t){return t.getParam("table_default_styles",dl(t),"object")},xl=function(t){return t.getParam("table_resize_bars",!0,"boolean")},Cl=function(t){return t.getParam("table_tab_navigation",!0,"boolean")},Sl=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},kl=function(t){return t.getParam("table_row_advtab",!0,"boolean")},Ol=function(t){return t.getParam("table_advtab",!0,"boolean")},Tl=function(t){return t.getParam("table_appearance_options",!0,"boolean")},El=function(t){return t.getParam("table_grid",!0,"boolean")},_l=function(t){return t.getParam("table_style_by_css",!1,"boolean")},Dl=function(t){return t.getParam("table_cell_class_list",[],"array")},Al=function(t){return t.getParam("table_row_class_list",[],"array")},Rl=function(t){return t.getParam("table_class_list",[],"array")},Nl=function(t){return"relative"===pl(t)||!0===hl(t)},Bl=function(t){return"fixed"===pl(t)||!1===hl(t)},Ml=function(t){return"responsive"===pl(t)},Pl=function(t){return t.getParam("table_toolbar",cl)},Il=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},Ll=function(t){var e="section",n=t.getParam("table_header_type",e,"string"),r=["section","cells","sectionCells","auto"];return M(r,n)?n:e},Fl=function(t){var e=["preservetable","resizetable"],n=t.getParam("table_column_resizing",gl,"string");return q(e,(function(t){return t===n})).getOr(gl)},zl=function(t){return"preservetable"===Fl(t)},Hl=function(t){return"resizetable"===Fl(t)},Vl=function(t){var e=t.getParam("table_clone_elements");return o(e)?D.some(e.split(/[ ,]/)):Array.isArray(e)?D.some(e):D.none()},Ul=function(t){var e=t.getParam("object_resizing",!0);return o(e)?"table"===e:e},jl=function(t){return t.getParam("table_background_color_map",[],"array")},Wl=function(t){return t.getParam("table_border_color_map",[],"array")},ql=function(t,e){return Nl(t)?pa.percentageSize(e):Bl(t)?pa.pixelSize(e):pa.getTableSize(e)},$l=function(t){er(t,"width")},Gl=function(t){var e=Wu(t);ws(t,D.some(e),D.none()),$l(t)},Kl=function(t){var e=ju(t);ws(t,D.some(e),D.none()),$l(t)},Xl=function(t){vr(t,"width");var e=Rr(t),n=e.length>0?e:Ar(t);F(n,(function(t){vr(t,"width"),$l(t)})),$l(t)},Yl=Gl,Jl=Kl,Ql=Xl,Zl=function(t){var e=so.fromTable(t);so.hasColumns(e)||F(Ar(t),(function(t){var e=gr(t,"width");dr(t,"width",e),er(t,"width")}))},td=function(){var t=ve.fromTag("div");return mr(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),_o(Nn(),t),t},ed=function(t,e){return t.inline?es.body(qa(t),td(),e):es.only(ve.fromDom(t.getDoc()),e)},nd=function(t,e){t.inline&&Po(e.parent())},rd="bar-",od=function(t){return"false"!==Zn(t,"data-mce-resize")},id=function(t){var e,n,r=D.none(),o=D.none(),i=D.none(),u=function(t){return"TABLE"===t.nodeName},a=function(){return o},c=function(){return i.getOr(es.only(ve.fromDom(t.getBody()),od))},s=function(e){return ql(t,e)},f=function(){return zl(t)?Jc():Yc()},l=function(t){return ks(t).columns},d=function(r,o,i){var u=St(o,"e");if(""===n&&Yl(r),i!==e&&""!==n){dr(r,"width",n);var a=f(),c=s(r),d=zl(t)||u?l(r)-1:0;Vc(r,i-e,d,a,c)}else if(Za(n)){var m=parseFloat(n.replace("%","")),g=i*m/e;dr(r,"width",g+"%")}tc(n)&&Zl(r)},m=function(){o.each((function(t){t.destroy()})),i.each((function(e){nd(t,e)}))};return t.on("init",(function(){var e=ed(t,od);if(i=D.some(e),Ul(t)&&xl(t)){var n=f(),u=Jf.create(e,n,s);u.on(),u.events.startDrag.bind((function(e){r=D.some(t.selection.getRng())})),u.events.beforeResize.bind((function(e){var n=e.table.dom;tl(t,n,$a(n),Ga(n),rd+e.type)})),u.events.afterResize.bind((function(e){var n=e.table,o=n.dom;Ja(n),r.each((function(e){t.selection.setRng(e),t.focus()})),el(t,o,$a(o),Ga(o),rd+e.type),t.undoManager.add()})),o=D.some(u)}})),t.on("ObjectResizeStart",(function(r){var o=r.target;if(u(o)){var i=ve.fromDom(o);F(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Fl(t)+"-columns")})),!Cs(i)&&Bl(t)?Jl(i):!xs(i)&&Nl(t)&&Yl(i),Ss(i)&&Ct(r.origin,rd)&&Yl(i),e=r.width,n=Ml(t)?"":Qa(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var n=e.target;if(u(n)){var r=ve.fromDom(n),o=e.origin;Ct(o,"corner-")&&d(r,o,e.width),Ja(r),ol(t,r.dom,il)}})),t.on("SwitchMode",(function(){a().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:a,lazyWire:c,destroy:m}},ud=function(t,e){return{element:t,offset:e}},ad=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return ad(t,e,n).orThunk((function(){return D.some(e)}))})):D.none()},cd=function(t,e){if(t.property().isText(e))return t.property().getText(e).length;var n=t.property().children(e);return n.length},sd=function(t,e){var n=ad(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return ud(n,cd(t,n));var r=t.property().children(n);return r.length>0?sd(t,r[r.length-1]):ud(n,cd(t,n))},fd=sd,ld=jo(),dd=function(t){return fd(ld,t)},md=function(t,e){var n=wr(t,"colspan");if(1===n){var r=Vu(t);r.each((function(n){var r=n.value/2;Uu(t,r,n.unit),Uu(e,r,n.unit)}))}},gd=ln("th"),pd=function(t){return X(t,(function(t){return gd(t.element)}))},hd=function(t,e){return t&&e?"sectionCells":t?"section":"cells"},vd=function(t){var e="thead"===t.section,n=rr(bd(t.cells),"th");return e||n?{type:"header",subType:hd(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},bd=function(t){var e=V(t,(function(t){return gd(t.element)}));return 0===e.length?D.some("td"):e.length===t.length?D.some("th"):D.none()},yd=function(t){var e=L(t,(function(t){return vd(t).type})),n=M(e,"header"),r=M(e,"footer");if(n||r){var o=M(e,"body");return!n||o||r?n||o||!r?D.none():D.some("footer"):D.some("header")}return D.some("body")},wd=function(t){return rt(t.all,(function(t){var e=vd(t);return"header"===e.type?D.from(e.subType):D.none()}))},xd=function(t,e,n){return Je(n(t.element,e),!0,t.isLocked)},Cd=function(t,e){return t.section!==e?Qe(t.element,t.cells,e,t.isNew):t},Sd=function(){return{transformRow:Cd,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==nn(r)?ki(r,"td"):r;return Je(o,t.isNew,t.isLocked)}}},kd=function(){return{transformRow:Cd,transformCell:xd}},Od=function(){return{transformRow:function(t,e){var n="thead"===e?"tbody":e;return Cd(t,n)},transformCell:xd}},Td=function(){return{transformRow:b,transformCell:xd}},Ed=function(t,e){var n=so.fromTable(t),r=wd(n).getOr(e);switch(r){case"section":return Sd();case"sectionCells":return kd();case"cells":return Od()}},_d={getTableSectionType:Ed,section:Sd,sectionCells:kd,cells:Od,fallback:Td},Dd=function(t,e,n,r){n===r?er(t,e):Yn(t,e,n)},Ad=function(t,e,n){nt(Fn(t,e)).fold((function(){return Eo(t,n)}),(function(t){return To(t,n)}))},Rd=function(t,e){var n=$n(t,e).getOrThunk((function(){var n=ve.fromTag(e,dn(t).dom);return"thead"===e?Ad(t,"caption,colgroup",n):"colgroup"===e?Ad(t,"caption",n):_o(t,n),n}));return Mo(n),n},Nd=function(t,e){var n=[],r=[],o=function(t){return L(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return Mo(e),F(t.cells,(function(t){t.isNew&&r.push(t.element),Dd(t.element,"colspan",t.colspan,1),Dd(t.element,"rowspan",t.rowspan,1),_o(e,t.element)})),e}))},i=function(t){return K(t,(function(t){return L(t.cells,(function(t){return Dd(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=Rd(t,n),u="colgroup"===n?i:o,a=u(e);Bo(r,a)},a=function(e){$n(t,e).each(Po)},c=function(t,e){t.length>0?u(t,e):a(e)},s=[],f=[],l=[],d=[];return F(e,(function(t){switch(t.section){case"thead":s.push(t);break;case"tbody":f.push(t);break;case"tfoot":l.push(t);break;case"colgroup":d.push(t);break}})),c(d,"colgroup"),c(s,"thead"),c(f,"tbody"),c(l,"tfoot"),{newRows:n,newCells:r}},Bd=function(t){return L(t,(function(t){var e=wi(t.element);return F(t.cells,(function(t){var n=xi(t.element);Dd(n,"colspan",t.colspan,1),Dd(n,"rowspan",t.rowspan,1),_o(e,n)})),e}))},Md=function(t,e){return L(t,(function(t){return Wr(t,e)}))},Pd=function(t,e){return t[e]},Id=function(t,e){if(0===t.length)return 0;var n=t[0],r=$(t,(function(t){return!e(n.element,t.element)}));return r.getOr(t.length)},Ld=function(t,e,n,r){var o=Pd(t,e),i="colgroup"===o.section,u=Id(o.cells.slice(n),r),a=i?1:Id(Md(t.slice(e),n),r);return{colspan:u,rowspan:a}},Fd=function(t,e){var n=L(t,(function(t){return L(t.cells,S)})),r=function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0};return L(t,(function(o,i){var u=K(o.cells,(function(o,u){if(!1===n[i][u]){var a=Ld(t,i,u,e);return r(i,u,a.rowspan,a.colspan),[Ge(o.element,a.rowspan,a.colspan,o.isNew)]}return[]}));return Ye(o.element,u,o.section,o.isNew)}))},zd=function(t,e,n){var r=[];F(t.colgroups,(function(o){for(var i=[],u=0;u<t.grid.columns;u++){var a=so.getColumnAt(t,u).map((function(t){return Je(t.element,n,!1)})).getOrThunk((function(){return Je(e.colGap(),!0,!1)}));i.push(a)}r.push(Qe(o.element,i,"colgroup",n))}));for(var o=0;o<t.grid.rows;o++){for(var i=[],u=0;u<t.grid.columns;u++){var a=so.getAt(t,o,u).map((function(t){return Je(t.element,n,t.isLocked)})).getOrThunk((function(){return Je(e.gap(),!0,!1)}));i.push(a)}var c=t.all[o],s=Qe(c.element,i,c.section,n);r.push(s)}return r},Hd=function(t,e){return zd(t,e,!1)},Vd=function(t){return Fd(t,Ce)},Ud=function(t,e){return rt(t.all,(function(t){return q(t.cells,(function(t){return Ce(e,t.element)}))}))},jd=function(t,e,n){var r=L(e.selection,(function(e){return Dr(e).bind((function(e){return Ud(t,e)})).filter(n)})),o=or(r);return cr(o.length>0,o)},Wd=function(t,e,n,r,o){return function(i,u,a,c,s){var f=so.fromTable(u),l=D.from(null===s||void 0===s?void 0:s.section).getOrThunk(_d.fallback),d=e(f,a).map((function(e){var n=Hd(f,c),r=t(n,e,Ce,o(c),l),i=Jr(r.grid),u=Vd(r.grid);return{info:e,grid:u,cursor:r.cursor,lockedColumns:i}}));return d.bind((function(t){var e=Nd(u,t.grid),o=D.from(null===s||void 0===s?void 0:s.sizing).getOrThunk((function(){return pa.getTableSize(u)})),a=D.from(null===s||void 0===s?void 0:s.resize).getOrThunk(Jc);return n(u,t.grid,t.info,{sizing:o,resize:a,section:l}),r(u),Uf(i,u),er(u,Xr),t.lockedColumns.length>0&&Yn(u,Xr,t.lockedColumns.join(",")),D.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},qd=function(t,e){return Dr(e.element).bind((function(n){return Ud(t,n).map((function(t){var n=ot(ot({},t),{generators:e.generators,clipboard:e.clipboard});return n}))}))},$d=function(t,e){return jd(t,e,k).map((function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}}))},Gd=function(t,e){return e.mergable},Kd=function(t,e){return e.unmergable},Xd=function(t,e){return jd(t,e,k)},Yd=function(t,e){return jd(t,e,(function(t){return!t.isLocked}))},Jd=function(t,e){return Ud(t,e).exists((function(t){return!t.isLocked}))},Qd=function(t,e){return X(e,(function(e){return Jd(t,e)}))},Zd=function(t,e){return Gd(t,e).filter((function(e){return Qd(t,e.cells)}))},tm=function(t,e){return Kd(t,e).filter((function(e){return Qd(t,e)}))},em=function(t,e,n,r){var o=Gr(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++){var a=o[i],c=Wr(a,u).isLocked;Vr(a,u,Je(r(),!1,c))}return t},nm=function(t,e,n,r){for(var o=Gr(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<$r(o[0]);a++){var c=o[u],s=Wr(c,a),f=s.element,l=n(f,e);!0===l&&!1===i?Vr(c,a,Je(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},rm=function(t,e){return j(t,(function(t,n){return P(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])},om=function(t,e,n,r){return e>0&&e<t[0].cells.length&&F(t,(function(t){var o=t.cells[e-1],i=t.cells[e],u=n(i.element,o.element);u&&Vr(t,e,Je(r(),!0,i.isLocked))})),t},im=function(t,e,n,r){var o=Gr(t).rows;if(e>0&&e<o.length){var i=o[e-1].cells,u=rm(i,n);F(u,(function(t){for(var i=D.none(),u=e;u<o.length;u++)for(var a=function(e){var a=o[u],c=Wr(a,e),s=n(c.element,t.element);s&&(i.isNone()&&(i=D.some(r())),i.each((function(t){Vr(a,e,Je(t,!0,c.isLocked))})))},c=0;c<$r(o[0]);c++)a(c)}))}return t},um=function(t){var e=function(e){return um(t)},n=function(e){return um(t)},r=function(e){return um(e(t))},o=function(e){return um(t)},i=function(e){e(t)},u=function(e){return e(t)},a=function(e,n){return n(t)},c=function(e){return e(t)},s=function(e){return e(t)},f=function(){return D.some(t)};return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:e,orThunk:n,fold:a,map:r,mapError:o,each:i,bind:u,exists:c,forall:s,toOptional:f}},am=function(t){var e=function(t){return t()},n=function(){return C(String(t))()},r=b,o=function(t){return t()},i=function(e){return am(t)},u=function(e){return am(e(t))},a=function(e){return am(t)},c=function(e,n){return e(t)};return{isValue:S,isError:k,getOr:b,getOrThunk:e,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:u,each:g,bind:a,exists:S,forall:k,toOptional:D.none}},cm=function(t,e){return t.fold((function(){return am(e)}),um)},sm={value:um,error:am,fromOption:cm},fm=function(t,e,n){if(t.row>=e.length||t.column>$r(e[0]))return sm.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=$r(n[0]),u=n.length;return sm.value({rowDelta:r.length-u,colDelta:o.length-i})},lm=function(t,e){var n=$r(t[0]),r=$r(e[0]);return{rowDelta:0,colDelta:n-r}},dm=function(t,e){var n=t.length,r=e.length;return{rowDelta:n-r,colDelta:0}},mm=function(t,e,n,r){var o="colgroup"===e.section?n.col:n.cell;return I(t,(function(t){return Je(o(),!0,r(t))}))},gm=function(t,e,n,r){var o=t[t.length-1];return t.concat(I(e,(function(){var t="colgroup"===o.section?n.colgroup:n.row,e=Kr(o,t,b),i=mm(e.cells.length,e,n,(function(t){return ze(r,t.toString())}));return Ur(e,i)})))},pm=function(t,e,n,r){return L(t,(function(t){var o=mm(e,t,n,S);return zr(t,r,o)}))},hm=function(t,e,n){return L(t,(function(t){return j(n,(function(n,r){var o=mm(1,t,e,k)[0];return Hr(n,r,o)}),t)}))},vm=function(t,e,n){var r=e.colDelta<0?pm:b,o=e.rowDelta<0?gm:b,i=Jr(t),u=$r(t[0]),a=P(i,(function(t){return t===u-1})),c=r(t,Math.abs(e.colDelta),n,a?u-1:u),s=Jr(c);return o(c,Math.abs(e.rowDelta),n,J(s,k))},bm=function(t,e,n,r){var o=Wr(t[e],n),i=w(r,o.element),u=t[e];return t.length>1&&$r(u)>1&&(n>0&&i(qr(u,n-1))||n<u.cells.length-1&&i(qr(u,n+1))||e>0&&i(qr(t[e-1],n))||e<t.length-1&&i(qr(t[e+1],n)))},ym=function(t,e,n,r,o,i){for(var u=t.row,a=t.column,c=n.length,s=$r(n[0]),f=u+c,l=a+s+i.length,d=J(i,k),m=u;m<f;m++)for(var g=0,p=a;p<l;p++)if(d[p])g++;else{bm(e,m,p,o)&&nm(e,qr(e[m],p),o,r.cell);var h=p-a-g,v=Wr(n[m-u],h),b=v.element,y=r.replace(b);Vr(e[m],p,Je(y,!0,v.isLocked))}return e},wm=function(t,e,n){var r=$r(e[0]),o=Gr(e).cols.length+t.row,i=I(r-t.column,(function(e){return e+t.column})),u=q(i,(function(t){return X(n,(function(e){return e!==t}))})).getOr(r-1);return{row:o,column:u}},xm=function(t,e,n){return V(n,(function(n){return n>=t.column&&n<=$r(e[0])+t.column}))},Cm=function(t,e,n,r,o){var i=Jr(e),u=wm(t,e,i),a=Gr(n).rows,c=xm(u,a,i),s=fm(u,e,a);return s.map((function(t){var n=ot(ot({},t),{colDelta:t.colDelta-c.length}),i=vm(e,n,r),s=Jr(i),f=xm(u,a,s);return ym(u,i,a,r,o,f)}))},Sm=function(t,e,n,r,o){om(e,t,o,r.cell);var i=dm(n,e),u=vm(n,i,r),a=dm(e,u),c=vm(e,a,r);return L(c,(function(e,n){return zr(e,t,u[n].cells)}))},km=function(t,e,n,r,o){im(e,t,o,r.cell);var i=Jr(e),u=lm(e,n),a=ot(ot({},u),{colDelta:u.colDelta-i.length}),c=vm(e,a,r),s=Gr(c),f=s.cols,l=s.rows,d=Jr(c),m=lm(n,e),g=ot(ot({},m),{colDelta:m.colDelta+d.length}),p=hm(n,r,d),h=vm(p,g,r);return f.concat(l.slice(0,t)).concat(h).concat(l.slice(t,l.length))},Om=function(t,e,n,r){return Kr(t,(function(t){return r(t,n)}),e)},Tm=function(t,e,n,r,o){var i=Gr(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),f=Om(u[n],(function(t,n){var i=e>0&&e<u.length&&r(qr(u[e-1],n),qr(u[e],n)),a=i?Wr(u[e],n):Je(o(t.element,r),!0,t.isLocked);return a}),r,o);return a.concat(c).concat([f]).concat(s)},Em=function(t,e,n,r,o,i,u){if("colgroup"!==n&&r)return Wr(t,e);var a=Wr(t,o);return Je(u(a.element,i),!0,!1)},_m=function(t,e,n,r,o){return L(t,(function(t){var i=e>0&&e<$r(t)&&r(qr(t,e-1),qr(t,e)),u=Em(t,e,t.section,i,n,r,o);return Hr(t,e,u)}))},Dm=function(t,e){return K(t,(function(t){var n=t.cells,r=U(e,(function(t,e){return e>=0&&e<t.length?t.slice(0,e).concat(t.slice(e+1)):t}),n);return r.length>0?[Qe(t.element,r,t.section,t.isNew)]:[]}))},Am=function(t,e,n){var r=Gr(t),o=r.rows,i=r.cols;return i.concat(o.slice(0,e)).concat(o.slice(n+1))},Rm=function(t,e,n,r){return void 0!==qr(t[e],n)&&e>0&&r(qr(t[e-1],n),qr(t[e],n))},Nm=function(t,e,n){return e>0&&n(qr(t,e-1),qr(t,e))},Bm=function(t,e,n,r){return Rm(t,e,n,r)||Nm(t[e],n,r)},Mm=function(t,e){var n=X(e,b)&&pd(t.cells);return n?k:function(t,n,r){var o=nn(t.element);return!("th"===o&&e[r])}},Pm=function(t,e){var n=X(e,b)&&pd(t);return n?k:function(t,n,r){var o=nn(t.element);return!("th"===o&&e[n])}},Im=function(t,e,n,r){var o=function(t){return"row"===t?Cr(e):xr(e)},i=function(t){return o(t)?t+"group":t};if(t)return gd(e)?i(n):null;if(r&&gd(e)){var u="row"===n?"col":"row";return i(u)}return null},Lm=function(t,e){return function(n,r,o){return D.some(Im(t,n.element,"col",e[o]))}},Fm=function(t,e){return function(n,r){return D.some(Im(t,n.element,"row",e[r]))}},zm=function(t,e,n){return Je(n(t.element,e),!0,t.isLocked)},Hm=function(t,e,n,r,o,i,u){var a=function(t){return P(e,(function(e){return n(t.element,e.element)}))};return L(t,(function(t,e){return jr(t,(function(t,c){if(a(t)){var s=u(t,e,c)?o(t,n,r):t;return i(s,e,c).each((function(t){Qn(s.element,{scope:D.from(t)})})),s}return t}))}))},Vm=function(t,e,n){return K(t,(function(r,o){return Bm(t,o,e,n)?[]:[Wr(r,e)]}))},Um=function(t,e,n){var r=t[e];return K(r.cells,(function(r,o){return Bm(t,e,o,n)?[]:[r]}))},jm=function(t,e,n,r,o){var i=Gr(t).rows,u=K(e,(function(t){return Vm(i,t,r)})),a=L(t,(function(t){return pd(t.cells)})),c=Pm(u,a),s=Fm(n,a);return Hm(t,u,r,o,zm,s,c)},Wm=function(t,e,n,r,o,i,u){var a=Gr(t),c=a.cols,s=a.rows,f=s[e[0]],l=K(e,(function(t){return Um(s,t,o)})),d=L(f.cells,(function(t,e){return pd(Vm(s,e,o))})),m=it([],s,!0);F(e,(function(t){m[t]=u.transformRow(s[t],n)}));var g=c.concat(m),p=Mm(f,d),h=Lm(r,d);return Hm(g,l,o,i,u.transformCell,h,p)},qm=function(t,e,n,r){var o=Gr(t).rows,i=L(e,(function(t){return Wr(o[t.row],t.column)}));return Hm(t,i,n,r,zm,D.none,k)},$m=function(t){var e=function(t,e){var n=P(t,(function(t){return t.column===e.column}));return n?t:t.concat([e])};return j(t,e,[]).sort((function(t,e){return t.column-e.column}))},Gm=ln("col"),Km=ln("colgroup"),Xm=function(t){return"tr"===nn(t)||Km(t)},Ym=function(t){var e=yr(t,"colspan",1),n=yr(t,"rowspan",1);return{element:t,colspan:e,rowspan:n}},Jm=function(t,e){void 0===e&&(e=Ym);var n=function(e){return Gm(e.element)?t.col(e):t.cell(e)},r=function(e){return Km(e.element)?t.colgroup(e):t.row(e)},o=function(t){if(Xm(t))return r({element:t});var o=n(e(t));return i=D.some({item:t,replacement:o}),o},i=D.none(),u=function(t,e){return i.fold((function(){return o(t)}),(function(n){return e(t,n.item)?n.replacement:o(t)}))};return{getOrInit:u}},Qm=function(t){return function(e){var n=[],r=function(t,e){return q(n,(function(n){return e(n.item,t)}))},o=function(r){var o="td"===t?{scope:null}:{},i=e.replace(r,t,o);return n.push({item:r,sub:i}),i},i=function(t,e){return Xm(t)||Gm(t)?t:r(t,e).fold((function(){return o(t)}),(function(n){return e(t,n.item)?n.sub:o(t)}))};return{replaceOrInit:i}}},Zm=function(t){return tr(t,"scope").map((function(t){return t.substr(0,3)}))},tg=function(t){var e=function(e){var n=Zm(e);return n.each((function(t){return Yn(e,"scope",t)})),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return vr(r,"width"),vr(e,"width"),n.each((function(t){return Yn(r,"scope",t)})),r}},n=function(t){var e=function(){var e=or(L(t,Zm));if(0===e.length)return D.none();var n=e[0],r=["row","col"],o=P(e,(function(t){return t!==n&&M(r,t)}));return o?D.none():D.from(n)};return vr(t[0],"width"),e().fold((function(){return er(t[0],"scope")}),(function(e){return Yn(t[0],"scope",e+"group")})),v(t[0])};return{unmerge:e,merge:n}},eg={modification:Jm,transform:Qm,merging:tg},ng=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],rg=function(t,e){var n=t.property().name(e);return M(["ol","ul"],n)},og=function(t,e){var n=t.property().name(e);return M(ng,n)},ig=function(t,e){return M(["br","img","hr","input"],t.property().name(e))},ug=jo(),ag=function(t){return og(ug,t)},cg=function(t){return rg(ug,t)},sg=function(t){return ig(ug,t)},fg=function(t){var e=function(t){return"br"===nn(t)},n=function(t){return X(t,(function(t){return e(t)||cn(t)&&0===zo(t).trim().length}))},r=function(t){return"li"===nn(t)||Vn(t,cg).isSome()},o=function(t){return yn(t).map((function(t){return!!ag(t)||!!sg(t)&&"img"!==nn(t)})).getOr(!1)},i=function(t){return Da(t).bind((function(n){var i=o(n);return pn(n).map((function(o){return!0===i||r(o)||e(n)||ag(o)&&!Ce(t,o)?[]:[ve.fromTag("br")]}))})).getOr([])},u=function(){var e=K(t,(function(t){var e=wn(t);return n(e)?[]:e.concat(i(t))}));return 0===e.length?[ve.fromTag("br")]:e},a=u();Mo(t[0]),Bo(t[0],a)},lg=function(t){return Sf(t,!0)},dg=function(t){var e=Ar(t);0===e.length&&Po(t)},mg=function(t,e){return{grid:t,cursor:e}},gg=function(t){return rt(t,(function(t){return rt(t.cells,(function(t){var e=t.element;return cr(lg(e),e)}))}))},pg=function(t,e,n){var r,o,i=Gr(t).rows;return D.from(null===(o=null===(r=i[e])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(lg).orThunk((function(){return gg(i)}))},hg=function(t,e,n){var r=pg(t,e,n);return mg(t,r)},vg=function(t){var e=function(t,e){var n=P(t,(function(t){return t.row===e.row}));return n?t:t.concat([e])};return j(t,e,[]).sort((function(t,e){return t.row-e.row}))},bg=function(t,e,n,r){var o=e[0].row,i=vg(e),u=U(i,(function(t,e){var i=Tm(t.grid,o,e.row+t.delta,n,r.getOrInit);return{grid:i,delta:t.delta+1}}),{grid:t,delta:0}).grid;return hg(u,o,e[0].column)},yg=function(t,e,n,r){var o=vg(e),i=o[o.length-1],u=i.row+i.rowspan,a=U(o,(function(t,e){return Tm(t,u,e.row,n,r.getOrInit)}),t);return hg(a,u,e[0].column)},wg=function(t,e,n,r){var o=e.details,i=$m(o),u=i[0].column,a=U(i,(function(t,e){var o=_m(t.grid,u,e.column+t.delta,n,r.getOrInit);return{grid:o,delta:t.delta+1}}),{grid:t,delta:0}).grid;return hg(a,o[0].row,u)},xg=function(t,e,n,r){var o=e.details,i=o[o.length-1],u=i.column+i.colspan,a=$m(o),c=U(a,(function(t,e){return _m(t,u,e.column,n,r.getOrInit)}),t);return hg(c,o[0].row,u)},Cg=function(t,e,n,r){var o=$m(e),i=L(o,(function(t){return t.column})),u=jm(t,i,!0,n,r.replaceOrInit);return hg(u,e[0].row,e[0].column)},Sg=function(t,e,n,r){var o=qm(t,e,n,r.replaceOrInit);return hg(o,e[0].row,e[0].column)},kg=function(t,e,n,r){var o=$m(e),i=L(o,(function(t){return t.column})),u=jm(t,i,!1,n,r.replaceOrInit);return hg(u,e[0].row,e[0].column)},Og=function(t,e,n,r){var o=qm(t,e,n,r.replaceOrInit);return hg(o,e[0].row,e[0].column)},Tg=function(t,e){return function(n,r,o,i,u){var a=vg(r),c=L(a,(function(t){return t.row})),s=Wm(n,c,t,e,o,i.replaceOrInit,u);return hg(s,r[0].row,r[0].column)}},Eg=Tg("thead",!0),_g=Tg("tbody",!1),Dg=Tg("tfoot",!1),Ag=function(t,e,n,r){var o=$m(e.details),i=Dm(t,L(o,(function(t){return t.column}))),u=i.length>0?i[0].cells.length-1:0;return hg(i,o[0].row,Math.min(o[0].column,u))},Rg=function(t,e,n,r){var o=vg(e),i=Am(t,o[0].row,o[o.length-1].row),u=i.length>0?i.length-1:0;return hg(i,Math.min(e[0].row,u),e[0].column)},Ng=function(t,e,n,r){var o=e.cells;fg(o);var i=em(t,e.bounds,n,r.merge(o));return mg(i,D.from(o[0]))},Bg=function(t,e,n,r){var o=function(t,e){return nm(t,e,n,r.unmerge(e))},i=U(e,o,t);return mg(i,D.from(e[0]))},Mg=function(t,e,n,r){var o=function(t,e){var n=so.fromTable(t);return zd(n,e,!0)},i=o(e.clipboard,e.generators),u=qe(e.row,e.column),a=Cm(u,t,i,e.generators,n);return a.fold((function(){return mg(t,D.some(e.element))}),(function(t){return hg(t,e.row,e.column)}))},Pg=function(t,e,n){var r=Fr(t,n.section),o=so.generate(r);return zd(o,e,!0)},Ig=function(t,e,n,r){var o=Gr(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=Pg(e.clipboard,e.generators,u),c=Sm(i,t,a,e.generators,n);return hg(c,e.cells[0].row,e.cells[0].column)},Lg=function(t,e,n,r){var o=Gr(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=Pg(e.clipboard,e.generators,u),c=Sm(i,t,a,e.generators,n);return hg(c,e.cells[0].row,e.cells[0].column)},Fg=function(t,e,n,r){var o=Gr(t).rows,i=e.cells[0].row,u=o[i],a=Pg(e.clipboard,e.generators,u),c=km(i,t,a,e.generators,n);return hg(c,e.cells[0].row,e.cells[0].column)},zg=function(t,e,n,r){var o=Gr(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=Pg(e.clipboard,e.generators,u),c=km(i,t,a,e.generators,n);return hg(c,e.cells[0].row,e.cells[0].column)},Hg=function(t,e){var n=so.fromTable(t),r=Xd(n,e);return r.bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=G(L(n.all,(function(t){return V(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return bd(i)})).getOr("")},Vg=function(t,e){var n=so.fromTable(t),r=Xd(n,e);return r.bind(bd).getOr("")},Ug=function(t,e){var n=so.fromTable(t),r=Xd(n,e);return r.bind((function(t){var e=t[t.length-1],r=t[0].row,o=e.row+e.rowspan,i=n.all.slice(r,o);return yd(i)})).getOr("")},jg=function(t,e,n,r){return Wc(t,e,n,r.sizing)},Wg=function(t,e,n,r){return jc(t,e,n,r.sizing,r.resize)},qg=function(t,e){return P(e,(function(t){return 0===t.column&&t.isLocked}))},$g=function(t,e){return P(e,(function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked}))},Gg=function(t,e){var n=Vi(t),r=$m(e);return j(r,(function(t,e){var r=n[e.column],o=r.map(Fi).getOr(0);return t+o}),0)},Kg=function(t){return function(e,n){return Xd(e,n).filter((function(n){var r=t?qg:$g;return!r(e,n)})).map((function(t){return{details:t,pixelDelta:Gg(e,t)}}))}},Xg=function(t,e){return Yd(t,e).map((function(e){return{details:e,pixelDelta:-Gg(t,e)}}))},Yg=function(t){return function(e,n){return $d(e,n).filter((function(n){var r=t?qg:$g;return!r(e,n.cells)}))}},Jg=eg.transform("th"),Qg=eg.transform("td"),Zg=Wd(bg,Xd,g,g,eg.modification),tp=Wd(yg,Xd,g,g,eg.modification),ep=Wd(wg,Kg(!0),Wg,g,eg.modification),np=Wd(xg,Kg(!1),Wg,g,eg.modification),rp=Wd(Ag,Xg,Wg,dg,eg.modification),op=Wd(Rg,Xd,g,dg,eg.modification),ip=Wd(Cg,Yd,g,g,Jg),up=Wd(kg,Yd,g,g,Qg),ap=Wd(Eg,Yd,g,g,Jg),cp=Wd(_g,Yd,g,g,Qg),sp=Wd(Dg,Yd,g,g,Qg),fp=Wd(Sg,Yd,g,g,Jg),lp=Wd(Og,Yd,g,g,Qg),dp=Wd(Ng,Zd,jg,g,eg.merging),mp=Wd(Bg,tm,jg,g,eg.merging),gp=Wd(Mg,qd,jg,g,eg.modification),pp=Wd(Ig,Yg(!0),g,g,eg.modification),hp=Wd(Lg,Yg(!1),g,g,eg.modification),vp=Wd(Fg,$d,g,g,eg.modification),bp=Wd(zg,$d,g,g,eg.modification),yp=Hg,wp=Vg,xp=Ug,Cp=function(t,e,n){var r=function(t){return"table"===nn(qa(t))},o=function(e){return!1===r(t)||ks(e).rows>1},i=function(e){return!1===r(t)||ks(e).columns>1},u=Vl(t),a=Hl(t)?g:md,c=function(e){switch(Ll(t)){case"section":return _d.section();case"sectionCells":return _d.sectionCells();case"cells":return _d.cells();default:return _d.getTableSectionType(e,"section")}},s=function(n,r){return r.cursor.fold((function(){var r=Ar(n);return et(r).filter(Rn).map((function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),Yn(r,"data-mce-selected","1"),o}))}),(function(r){var o=dd(r),i=t.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),t.selection.setRng(i),e.clear(n),D.some(i)}))},f=function(e,n,r,o,i){return function(a,f,l){void 0===l&&(l=!1),Ja(a);var d=o(),m=ve.fromDom(t.getDoc()),g=Ha(r,m,u),p={sizing:ql(t,a),resize:Hl(t)?Yc():Jc(),section:c(a)};return n(a)?e(d,a,f,g,p).bind((function(e){F(e.newRows,(function(e){Qf(t,e.dom)})),F(e.newCells,(function(e){Zf(t,e.dom)}));var n=s(a,e);return Rn(a)&&(Ja(a),l||ol(t,a.dom,i)),n.map((function(t){return{rng:t,effect:i}}))})):D.none()}},l=f(op,o,g,n,ul),d=f(rp,i,g,n,ul),m=f(Zg,k,g,n,ul),p=f(tp,k,g,n,ul),h=f(ep,k,a,n,ul),v=f(np,k,a,n,ul),b=f(dp,k,g,n,ul),y=f(mp,k,g,n,ul),w=f(pp,k,g,n,ul),x=f(hp,k,g,n,ul),C=f(vp,k,g,n,ul),S=f(bp,k,g,n,ul),O=f(gp,k,g,n,al),T=f(fp,k,g,n,ul),E=f(lp,k,g,n,ul),_=f(ip,k,g,n,ul),A=f(up,k,g,n,ul),R=f(ap,k,g,n,ul),N=f(cp,k,g,n,ul),B=f(sp,k,g,n,ul),M=wp,P=yp,I=xp;return{deleteRow:l,deleteColumn:d,insertRowsBefore:m,insertRowsAfter:p,insertColumnsBefore:h,insertColumnsAfter:v,mergeCells:b,unmergeCells:y,pasteColsBefore:w,pasteColsAfter:x,pasteRowsBefore:C,pasteRowsAfter:S,pasteCells:O,makeCellsHeader:T,unmakeCellsHeader:E,makeColumnsHeader:_,unmakeColumnsHeader:A,makeRowsHeader:R,makeRowsBody:N,makeRowsFooter:B,getTableRowType:I,getTableCellType:M,getTableColType:P}},Sp={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},kp=function(){return ve.fromTag("th")},Op=function(){return ve.fromTag("td")},Tp=function(){return ve.fromTag("col")},Ep=function(t,e,n,r){for(var o=ve.fromTag("tr"),i=0;i<t;i++){var u=r<e||i<n?kp():Op();i<n&&Yn(u,"scope","row"),r<e&&Yn(u,"scope","col"),_o(u,ve.fromTag("br")),_o(o,u)}return o},_p=function(t){var e=ve.fromTag("colgroup");return I(t,(function(){return _o(e,Tp())})),e},Dp=function(t,e,n,r){return I(t,(function(t){return Ep(e,n,r,t)}))},Ap=function(t,e,n,r,o,i){void 0===i&&(i=Sp);var u=ve.fromTag("table"),a="cells"!==o;mr(u,i.styles),Jn(u,i.attributes),i.colGroups&&_o(u,_p(e));var c=Math.min(t,n);if(a&&n>0){var s=ve.fromTag("thead");_o(u,s);var f="sectionCells"===o?c:0,l=Dp(n,e,f,r);Bo(s,l)}var d=ve.fromTag("tbody");_o(u,d);var m=a?t-c:t,g=a?0:n,p=Dp(m,e,g,r);return Bo(d,p),u},Rp=function(t){return t.dom.innerHTML},Np=function(t){var e=ve.fromTag("div"),n=ve.fromDom(t.dom.cloneNode(!0));return _o(e,n),Rp(e)},Bp=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Mp=function(t,e){Gn(e,"td,th").each(w(Bp,t))},Pp=function(t,e){F(zn(e,"tr"),(function(e){Qf(t,e.dom),F(zn(e,"th,td"),(function(e){Zf(t,e.dom)}))}))},Ip=function(t){return o(t)&&-1!==t.indexOf("%")},Lp=function(t,e,n,r,o){var i=wl(t),u={styles:i,attributes:yl(t),colGroups:Il(t)};return t.undoManager.ignore((function(){var i=Ap(n,e,o,r,Ll(t),u);Yn(i,"data-mce-id","__mce");var a=Np(i);t.insertContent(a),t.addVisual()})),Gn(qa(t),'table[data-mce-id="__mce"]').map((function(e){return Bl(t)?Jl(e):Ml(t)?Ql(e):(Nl(t)||Ip(i.width))&&Yl(e),Ja(e),er(e,"data-mce-id"),Pp(t,e),Mp(t,e),e.dom})).getOr(null)},Fp=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return m(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return Lp(t,n,e,a,u)}return null},zp=function(t){return function(){return t().fold((function(){return[]}),(function(t){return L(t,(function(t){return t.dom}))}))}},Hp=function(t){return function(e){var n=e.length>0?D.some(ja(e)):D.none();t(n)}},Vp=function(t){return function(e,n,r){void 0===r&&(r={});var o=Fp(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},Up=function(t,e,n,r){return{insertTable:Vp(t),setClipboardRows:Hp(e.setRows),getClipboardRows:zp(e.getRows),setClipboardCols:Hp(e.setColumns),getClipboardCols:zp(e.getColumns),resizeHandler:n,selectionTargets:r}},jp=function(t,e,n){var r=yr(t,e,1);1===n||r<=1?er(t,e):Yn(t,e,Math.min(n,r))},Wp=function(t,e,n){if(so.hasColumns(t)){var r=V(so.justColumns(t),(function(t){return t.column>=e&&t.column<n})),o=L(r,(function(t){var r=xi(t.element);return jp(r,"span",n-e),r})),i=ve.fromTag("colgroup");return Bo(i,o),[i]}return[]},qp=function(t,e,n){return L(t.all,(function(t){var r=V(t.cells,(function(t){return t.column>=e&&t.column<n})),o=L(r,(function(t){var r=xi(t.element);return jp(r,"colspan",n-e),r})),i=ve.fromTag("tr");return Bo(i,o),i}))},$p=function(t,e){var n=so.fromTable(t),r=Yd(n,e);return r.map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=Wp(n,r,o),u=qp(n,r,o);return it(it([],i,!0),u,!0)}))},Gp=function(t,e,n){var r=so.fromTable(t),o=Xd(r,e);return o.bind((function(t){var e=zd(r,n,!1),o=Gr(e).rows,i=o.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),u=K(i,(function(t){var e=V(t.cells,(function(t){return!t.isLocked}));return e.length>0?[ot(ot({},t),{cells:e})]:[]})),a=Vd(u);return cr(a.length>0,a)})).map((function(t){return Bd(t)}))},Kp=tinymce.util.Tools.resolve("tinymce.util.Tools"),Xp=function(t,e,n){var r,o=t.select("td,th",e),i=function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if("undefined"===typeof e&&(e=i),e!==i)return""}return e};return i(r,o)},Yp=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Jp=function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)},Qp=function(t,e){Kp.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Zp=function(t,e){Kp.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))},th=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],eh=function(t){return{value:t}},nh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,rh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,oh=function(t){return nh.test(t)||rh.test(t)},ih=function(t){return wt(t,"#").toUpperCase()},uh=function(t){return oh(t)?D.some({value:ih(t)}):D.none()},ah=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},ch=function(t){var e=ah(t.red)+ah(t.green)+ah(t.blue);return eh(e)},sh=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,fh=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,lh=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},dh=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return lh(o,i,u,a)},mh=function(t){if("transparent"===t)return D.some(lh(0,0,0,0));var e=sh.exec(t);if(null!==e)return D.some(dh(e[1],e[2],e[3],"1"));var n=fh.exec(t);return null!==n?D.some(dh(n[1],n[2],n[3],n[4])):D.none()},gh=function(t){return uh(t).orThunk((function(){return mh(t).map(ch)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return ch(lh(o,i,u,a))}))},ph=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},hh=function(t){var e=ph(D.none()),n=function(){return e.get().each(t)},r=function(){n(),e.set(D.none())},o=function(){return e.get().isSome()},i=function(){return e.get()},u=function(t){n(),e.set(D.some(t))};return{clear:r,isSet:o,get:i,set:u}},vh=function(){return hh((function(t){return t.unbind()}))},bh=function(){var t=hh(g),e=function(e){return t.get().each(e)};return ot(ot({},t),{on:e})},yh=function(t,e,n,r){return function(o){var i=vh(),u=Et(r),a=function(){var a=Sc(e),c=function(e){return t.formatter.match(n,{value:r},e.dom,u)};u?(o.setActive(!P(a,c)),i.set(t.formatter.formatChanged(n,(function(t){return o.setActive(!t)}),!0))):(o.setActive(X(a,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?a():t.on("init",a),i.clear}},wh=function(t){return He(t,"menu")},xh=function(t){return L(t,(function(t){var e=t.text||t.title;return wh(t)?{text:e,items:xh(t.menu)}:{text:e,value:t.value}}))},Ch=function(t,e,n,r,o){return L(n,(function(n){var i=n.text||n.title;return wh(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return Ch(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:yh(t,e,r,n.value)}}))},Sh=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,(r={},r[e]=n,r))}},kh=function(t){return K(t,(function(t){return wh(t)?[ot(ot({},t),{menu:kh(t.menu)})]:Tt(t.value)?[t]:[]}))},Oh=function(t,e,n,r,o){return function(i){return i(Ch(t,e,n,r,o))}},Th=function(t,e,n){var r=L(e,(function(t){return{text:t.title,value:"#"+gh(t.value).value,type:"choiceitem"}}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(e){var r,o="remove"===e.value?"":e.value;t.execCommand("mceTableApplyCellStyle",!1,(r={},r[n]=o,r))}}]},Eh=function(t){return function(){var e=t.queryCommandValue("mceTableRowType"),n="header"===e?"body":"header";t.execCommand("mceTableRowType",!1,{type:n})}},_h=function(t){return function(){var e=t.queryCommandValue("mceTableColType"),n="th"===e?"td":"th";t.execCommand("mceTableColType",!1,{type:n})}},Dh=function(t){var e=xh(Dl(t));return e.length>0?D.some({name:"class",type:"listbox",label:"Class",items:e}):D.none()},Ah=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:th}],Rh=function(t){return Ah.concat(Dh(t).toArray())},Nh=function(t,e){var n=[{text:"Select...",value:""}],r=[{name:"borderstyle",type:"listbox",label:"Border style",items:n.concat(xh(bl(t)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}],o={name:"borderwidth",type:"input",label:"Border width"},i="cell"===e?[o].concat(r):r;return{title:"Advanced",name:"advanced",items:i}},Bh=function(t){return function(e,n){var r=e.dom,o=function(e,o){t&&!o||r.setAttrib(n,e,o)},i=function(e,o){t&&!o||r.setStyle(n,e,o)},u=function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))};return{setAttrib:o,setStyle:i,setFormat:u}}},Mh={normal:Bh(!1),ifTruthy:Bh(!0)},Ph=function(t){return function(e){return Ct(e,"rgb")?t.toHex(e):e}},Ih=function(t,e){var n=ve.fromDom(e);return{borderwidth:hr(n,"border-width").getOr(""),borderstyle:hr(n,"border-style").getOr(""),bordercolor:hr(n,"border-color").map(Ph(t)).getOr(""),backgroundcolor:hr(n,"background-color").map(Ph(t)).getOr("")}},Lh=function(t){var e=t[0],n=t.slice(1);return F(n,(function(t){F(Ee(e),(function(n){De(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},Fh=function(t,e,n,r){return q(t,(function(t){return!s(n.formatter.matchNode(r,e+t))})).getOr("")},zh=w(Fh,["left","center","right"],"align"),Hh=w(Fh,["top","middle","bottom"],"valign"),Vh=function(t,e){var n=wl(t),r=yl(t),o=function(t){return{borderstyle:Fe(n,"border-style").getOr(""),bordercolor:Ph(t)(Fe(n,"border-color").getOr("")),backgroundcolor:Ph(t)(Fe(n,"background-color").getOr(""))}},i={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},u=function(){var e=n["border-width"];return _l(t)&&e?{border:e}:Fe(r,"border").fold((function(){return{}}),(function(t){return{border:t}}))},a=e?o(t.dom):{},c=function(){var t=Fe(n,"border-spacing").or(Fe(r,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),e=Fe(n,"border-padding").or(Fe(r,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}}));return ot(ot({},t),e)},s=ot(ot(ot(ot(ot(ot({},i),n),r),a),u()),c());return s},Uh=function(t){return Nr(ve.fromDom(t)).map((function(e){var n={selection:ja(t.cells)};return xp(e,n)})).getOr("")},jh=function(t,e,n){var r=function(e,n){var r=hr(ve.fromDom(n),"border-width");return _l(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||Xp(t.dom,n,"border-width")||Xp(t.dom,n,"border")},o=t.dom,i=_l(t)?o.getStyle(e,"border-spacing")||o.getAttrib(e,"cellspacing"):o.getAttrib(e,"cellspacing")||o.getStyle(e,"border-spacing"),u=_l(t)?Xp(o,e,"padding")||o.getAttrib(e,"cellpadding"):o.getAttrib(e,"cellpadding")||Xp(o,e,"padding");return ot({width:o.getStyle(e,"width")||o.getAttrib(e,"width"),height:o.getStyle(e,"height")||o.getAttrib(e,"height"),cellspacing:i,cellpadding:u,border:r(o,e),caption:!!o.select("caption",e)[0],class:o.getAttrib(e,"class",""),align:zh(t,e)},n?Ih(o,e):{})},Wh=function(t,e,n){var r=t.dom;return ot({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:Uh(e),align:zh(t,e)},n?Ih(r,e):{})},qh=function(t,e,n,r){var o=t.dom,i=r.getOr(e),u=function(t,e){return o.getStyle(t,e)||o.getAttrib(t,e)};return ot({width:u(i,"width"),height:u(e,"height"),scope:o.getAttrib(e,"scope"),celltype:Wa(e),class:o.getAttrib(e,"class",""),halign:zh(t,e),valign:Hh(t,e)},n?Ih(o,e):{})},$h=function(t,e){var n=so.fromTable(t),r=so.justCells(n),o=V(r,(function(t){return P(e,(function(e){return Ce(t.element,e)}))}));return L(o,(function(t){return{element:t.element.dom,column:so.getColumnAt(n,t.column).map((function(t){return t.element.dom}))}}))},Gh=function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Ya(n.height)),e.setStyle("width",Ya(n.width))},Kh=function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Ya(e.borderwidth))},Xh=function(t,e,n){var r=1===e.length;F(e,(function(e){var o=e.element,i=r?Mh.normal(t,o):Mh.ifTruthy(t,o),u=e.column.map((function(e){return r?Mh.normal(t,e):Mh.ifTruthy(t,e)})).getOr(i);Gh(i,u,n),Sl(t)&&Kh(i,n),r&&(Qp(t,o),Zp(t,o)),n.halign&&Yp(t,o,n.halign),n.valign&&Jp(t,o,n.valign)}))},Yh=function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})},Jh=function(t,e,n,r){var o=Me(r,(function(t,e){return n[e]!==t}));Le(o)>0&&e.length>=1&&Nr(e[0]).each((function(n){var i=$h(n,e),u=Le(Me(o,(function(t,e){return"scope"!==e&&"celltype"!==e})))>0,a=ze(o,"celltype");(u||ze(o,"scope"))&&Xh(t,i,r),a&&Yh(t,r),ol(t,n.dom,{structure:a,style:u})}))},Qh=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){Jh(t,e,n,o),t.focus()}))},Zh=function(t,e){var n=Nr(e[0]).map((function(n){return L($h(n,e),(function(e){return qh(t,e.element,Sl(t),e.column)}))}));return Lh(n.getOrDie())},tv=function(t,e){var n=Sc(e);if(0!==n.length){var r=Zh(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:Rh(t)},Nh(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:Rh(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:Sl(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:w(Qh,t,n,r)})}},ev=function(t){var e=xh(Al(t));return e.length>0?D.some({name:"class",type:"listbox",label:"Class",items:e}):D.none()},nv=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],rv=function(t){return nv.concat(ev(t).toArray())},ov=function(t,e){t.setAttrib("class",e.class),t.setStyle("height",Ya(e.height))},iv=function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)},uv=function(t,e,n,r){var o=1===e.length;F(e,(function(e){var i=o?Mh.normal(t,e):Mh.ifTruthy(t,e);ov(i,n),kl(t)&&iv(i,n),n.align!==r.align&&(Qp(t,e),Yp(t,e,n.align))}))},av=function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})},cv=function(t,e,n,r){var o=Me(r,(function(t,e){return n[e]!==t}));if(Le(o)>0){var i=ze(o,"type"),u=!i||Le(o)>1;u&&uv(t,e,r,n),i&&av(t,r),Nr(ve.fromDom(e[0])).each((function(e){return ol(t,e.dom,{structure:i,style:u})}))}},sv=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){cv(t,e,n,o),t.focus()}))},fv=function(t){var e=kc(ec(t),gc.selected);if(0!==e.length){var n=L(e,(function(e){return Wh(t,e.dom,kl(t))})),r=Lh(n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:rv(t)},Nh(t,"row")]},i={type:"panel",items:[{type:"grid",columns:2,items:rv(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:kl(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:w(sv,t,L(e,(function(t){return t.dom})),r)})}},lv=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],i=Tl(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],u=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],a=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat(o).concat(i).concat(u).concat(a)},dv=function(t,e,n,r){if("TD"===e.tagName||"TH"===e.tagName)o(n)?t.setStyle(e,n,r):t.setStyle(e,n);else if(e.children)for(var i=0;i<e.children.length;i++)dv(t,e.children[i],n,r)},mv=function(t,e,n){var r=t.dom,o={},i={};if(o.class=n.class,i.height=Ya(n.height),r.getAttrib(e,"width")&&!_l(t)?o.width=Xa(n.width):i.width=Ya(n.width),_l(t)?(i["border-width"]=Ya(n.border),i["border-spacing"]=Ya(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),_l(t)&&e.children)for(var u=0;u<e.children.length;u++)dv(r,e.children[u],{"border-width":Ya(n.border),padding:Ya(n.cellpadding)}),Ol(t)&&dv(r,e.children[u],{"border-color":n.bordercolor});Ol(t)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle(ot(ot({},wl(t)),i)),r.setAttribs(e,ot(ot({},yl(t)),o))},gv=function(t,e,n,r){var o=t.dom,i=r.getData(),u=Me(i,(function(t,e){return n[e]!==t}));r.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;e=Lp(t,n,r,0,0)}if(Le(u)>0){mv(t,e,i);var a=o.select("caption",e)[0];(a&&!i.caption||!a&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?Qp(t,e):Yp(t,e,i.align)}if(t.focus(),t.addVisual(),Le(u)>0){var c=ze(u,"caption"),s=!c||Le(u)>1;ol(t,e,{structure:c,style:s})}}))},pv=function(t,e){var n,r=t.dom,o=Vh(t,Ol(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()),n?o=jh(t,n,Ol(t)):Ol(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor="")):(o.cols="1",o.rows="1",Ol(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=xh(Rl(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:lv(t,i,e)},a=function(){return{type:"panel",items:[u]}},c=function(){return{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},Nh(t,"table")]}},s=Ol(t)?c():a();t.windowManager.open({title:"Table Properties",size:"normal",body:s,onSubmit:w(gv,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},hv=function(t){return xc(ec(t),Ka(t))},vv=function(t){return Cc(ec(t),Ka(t))},bv=function(t,e,n,r,u){var a=Ka(t),c=function(){return hv(t).each((function(e){Nr(e,a).filter(x(a)).each((function(e){var n=ve.fromText("");if(To(e,n),Po(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),t.selection.setRng(r),t.nodeChanged()}}))}))},s=function(e){return hv(t).each((function(n){var r=Ml(t)||Bl(t)||Nl(t);r||Nr(n,a).each((function(n){"relative"!==e||xs(n)?"fixed"!==e||Cs(n)?"responsive"!==e||Ss(n)||Ql(n):Jl(n):Yl(n),Ja(n),ol(t,n.dom,ul)}))}))},f=function(t){return Nr(t,a)},l=function(e){return vv(t).bind((function(t){return f(t).map((function(n){return e(n,t)}))}))},d=function(e,n){l((function(e){t.formatter.toggle("tableclass",{value:n},e.dom),ol(t,e.dom,il)}))},m=function(e,n){l((function(e){var o=Sc(r),i=X(o,(function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)})),u=i?t.formatter.remove:t.formatter.apply;F(o,(function(t){return u("tablecellclass",{value:n},t.dom)})),ol(t,e.dom,il)}))},p=function(){hv(t).each((function(e){Nr(e,a).each((function(n){$n(n,"caption").fold((function(){var e=ve.fromTag("caption");_o(e,ve.fromText("Caption")),Do(n,e,0),t.selection.setCursorLocation(e.dom,0)}),(function(r){ln("caption")(e)&&xe("td",n).each((function(e){return t.selection.setCursorLocation(e.dom,0)})),Po(r)})),ol(t,n.dom,ul)}))}))},h=function(e){t.focus()},v=function(t,e){return void 0===e&&(e=!1),l((function(n,o){var i=hc(r,n,o);t(n,i,e).each(h)}))},b=function(){return l((function(e,n){var o=hc(r,e,n),i=Ha(g,ve.fromDom(t.getDoc()),D.none());return Gp(e,o,i)}))},y=function(){return l((function(t,e){var n=hc(r,t,e);return $p(t,n)}))},C=function(e,n){return n().each((function(n){var o=L(n,(function(t){return xi(t)}));l((function(n,i){var u=Va(ve.fromDom(t.getDoc())),a=bc(r,i,o,u);e(n,a).each(h)}))}))},S=function(t){return function(e,n){return Fe(n,"type").each((function(e){v(t(e),n.no_events)}))}};De({mceTableSplitCells:function(){return v(e.unmergeCells)},mceTableMergeCells:function(){return v(e.mergeCells)},mceTableInsertRowBefore:function(){return v(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return v(e.insertRowsAfter)},mceTableInsertColBefore:function(){return v(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return v(e.insertColumnsAfter)},mceTableDeleteCol:function(){return v(e.deleteColumn)},mceTableDeleteRow:function(){return v(e.deleteRow)},mceTableCutCol:function(){return y().each((function(t){u.setColumns(t),v(e.deleteColumn)}))},mceTableCutRow:function(){return b().each((function(t){u.setRows(t),v(e.deleteRow)}))},mceTableCopyCol:function(){return y().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(){return b().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(){return C(e.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(){return C(e.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(){return C(e.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(){return C(e.pasteRowsAfter,u.getRows)},mceTableDelete:c,mceTableCellToggleClass:m,mceTableToggleClass:d,mceTableToggleCaption:p,mceTableSizingMode:function(t,e){return s(e)},mceTableCellType:S((function(t){return"th"===t?e.makeCellsHeader:e.unmakeCellsHeader})),mceTableColType:S((function(t){return"th"===t?e.makeColumnsHeader:e.unmakeColumnsHeader})),mceTableRowType:S((function(t){switch(t){case"header":return e.makeRowsHeader;case"footer":return e.makeRowsFooter;default:return e.makeRowsBody}}))},(function(e,n){return t.addCommand(n,e)})),De({mceTableProps:w(pv,t,!1),mceTableRowProps:w(fv,t),mceTableCellProps:w(tv,t,r)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){i(n)&&Ee(n).length>0?Fp(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):pv(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){var u=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(i(n)){var a=Sc(r);if(0!==a.length){var c=Me(n,(function(e,n){return t.formatter.has(u(n))&&o(e)}));Ve(c)||(De(c,(function(e,n){F(a,(function(r){Mh.normal(t,r.dom).setFormat(u(n),e)}))})),f(a[0]).each((function(e){return ol(t,e.dom,il)})))}}}))},yv=function(t,e,n){var r=Ka(t),o=function(e){return Cc(ec(t)).bind((function(t){return Nr(t,r).map((function(r){var o=hc(n,r,t);return e(r,o)}))})).getOr("")};De({mceTableRowType:function(){return o(e.getTableRowType)},mceTableCellType:function(){return o(e.getTableCellType)},mceTableColType:function(){return o(e.getTableColType)}},(function(e,n){return t.addQueryValueHandler(n,e)}))},wv=function(){var t=bh(),e=bh();return{getRows:t.get,setRows:function(n){n.fold(t.clear,t.set),e.clear()},clearRows:t.clear,getColumns:e.get,setColumns:function(n){n.fold(e.clear,e.set),t.clear()},clearColumns:e.clear}},xv={remove_similar:!0,inherit:!1},Cv=ot({selector:"td,th"},xv),Sv={tablecellbackgroundcolor:ot({styles:{backgroundColor:"%value"}},Cv),tablecellverticalalign:ot({styles:{"vertical-align":"%value"}},Cv),tablecellbordercolor:ot({styles:{borderColor:"%value"}},Cv),tablecellclass:ot({classes:["%value"]},Cv),tableclass:ot({selector:"table",classes:["%value"]},xv),tablecellborderstyle:ot({styles:{borderStyle:"%value"}},Cv),tablecellborderwidth:ot({styles:{borderWidth:"%value"}},Cv)},kv=function(t){t.formatter.register(Sv)},Ov=li.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Tv=function(t){return void 0===t&&(t=void 0),Ov.none(t)},Ev=ot(ot({},Ov),{none:Tv}),_v=function(t,e,n,r,o){void 0===o&&(o=k);var i=1===r;if(!i&&n<=0)return Ev.first(t[0]);if(i&&n>=t.length-1)return Ev.last(t[t.length-1]);var u=n+r,a=t[u];return o(a)?Ev.middle(e,a):_v(t,e,u,r,o)},Dv=function(t,e){return Nr(t,e).bind((function(e){var n=Ar(e),r=$(n,(function(e){return Ce(t,e)}));return r.map((function(t){return{index:t,all:n}}))}))},Av=function(t,e,n){var r=Dv(t,n);return r.fold((function(){return Ev.none(t)}),(function(n){return _v(n.all,t,n.index,1,e)}))},Rv=function(t,e,n){var r=Dv(t,n);return r.fold((function(){return Ev.none()}),(function(n){return _v(n.all,t,n.index,-1,e)}))},Nv=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Bv={create:Nv},Mv=li.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Pv=function(t,e,n,r){return t.fold(e,n,r)},Iv=function(t){return t.fold(b,b,b)},Lv=Mv.before,Fv=Mv.on,zv=Mv.after,Hv={before:Lv,on:Fv,after:zv,cata:Pv,getStart:Iv},Vv=li.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Uv=function(t){return Vv.exact(t.start,t.soffset,t.finish,t.foffset)},jv=function(t){return t.match({domRange:function(t){return ve.fromDom(t.startContainer)},relative:function(t,e){return Hv.getStart(t)},exact:function(t,e,n,r){return t}})},Wv=Vv.domRange,qv=Vv.relative,$v=Vv.exact,Gv=function(t){var e=jv(t);return gn(e)},Kv=Bv.create,Xv={domRange:Wv,relative:qv,exact:$v,exactFromRange:Uv,getWin:Gv,range:Kv},Yv=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},Jv=function(t,e){var n=t.document.createRange();return Qv(n,e),n},Qv=function(t,e){return t.selectNodeContents(e.dom)},Zv=function(t,e){e.fold((function(e){t.setStartBefore(e.dom)}),(function(e,n){t.setStart(e.dom,n)}),(function(e){t.setStartAfter(e.dom)}))},tb=function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))},eb=function(t,e,n){var r=t.document.createRange();return Zv(r,e),tb(r,n),r},nb=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rb=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},ob=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?D.some(n).map(rb):D.none()},ib=li.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ub=function(t,e,n){return e(ve.fromDom(n.startContainer),n.startOffset,ve.fromDom(n.endContainer),n.endOffset)},ab=function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:D.none}},relative:function(e,n){return{ltr:ut((function(){return eb(t,e,n)})),rtl:ut((function(){return D.some(eb(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:ut((function(){return nb(t,e,n,r,o)})),rtl:ut((function(){return D.some(nb(t,r,o,e,n))}))}}})},cb=function(t,e){var n=e.ltr();if(n.collapsed){var r=e.rtl().filter((function(t){return!1===t.collapsed}));return r.map((function(t){return ib.rtl(ve.fromDom(t.endContainer),t.endOffset,ve.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return ub(t,ib.ltr,n)}))}return ub(t,ib.ltr,n)},sb=function(t,e){var n=ab(t,e);return cb(t,n)},fb=function(t,e){var n=sb(t,e);return n.match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};ib.ltr,ib.rtl;var lb=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var a=t(u),c=Math.abs(e-a.left);if(n<=a.bottom){if(n<a.top||c>i)return u-1;i=c}}return 0},db=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},mb=function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=function(t){var e=i(t);return e.getBoundingClientRect()},a=zo(e).length,c=lb(u,n,r,o.right,a);return i(c)},gb=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects(),u=rt(i,(function(t){return db(t,n,r)?D.some(t):D.none()}));return u.map((function(o){return mb(t,e,n,r,o)}))},pb=function(t,e,n,r){var o=t.dom.createRange(),i=wn(e);return rt(i,(function(e){return o.selectNode(e.dom),db(o.getBoundingClientRect(),n,r)?hb(t,e,n,r):D.none()}))},hb=function(t,e,n,r){return cn(e)?gb(t,e,n,r):pb(t,e,n,r)},vb=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return hb(t,e,u,a)},bb=!0,yb=!1,wb=function(t,e){return e-t.left<t.right-e?bb:yb},xb=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Cb=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=wb(o,n),u=i===bb?_a:Da;return u(e).map((function(e){return xb(t,e,i)}))},Sb=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=wb(r,n);return D.some(xb(t,e,o))},kb=function(t,e,n){var r=0===wn(e).length?Sb:Cb;return r(t,e,n)},Ob=function(t,e,n){var r,o;return D.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind((function(e){if(null===e.offsetNode)return D.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),D.some(n)}))},Tb=function(t,e,n){var r,o;return D.from(null===(o=(r=t.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,e,n))},Eb=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return vb(t,e,u,a)},_b=function(t,e,n){return ve.fromPoint(t,e,n).bind((function(r){var o=function(){return kb(t,r,e)};return 0===wn(r).length?o():Eb(t,r,e,n).orThunk(o)}))},Db=function(){return document.caretPositionFromPoint?Ob:document.caretRangeFromPoint?Tb:_b}(),Ab=function(t,e,n){var r=ve.fromDom(t.document);return Db(r,e,n).map((function(t){return Bv.create(ve.fromDom(t.startContainer),t.startOffset,ve.fromDom(t.endContainer),t.endOffset)}))},Rb=function(t,e){var n=nn(t);return"input"===n?Hv.after(t):M(["br","img"],n)?0===e?Hv.before(t):Hv.after(t):Hv.on(t,e)},Nb=function(t,e){var n=t.fold(Hv.before,Rb,Hv.after),r=e.fold(Hv.before,Rb,Hv.after);return Xv.relative(n,r)},Bb=function(t,e,n,r){var o=Rb(t,e),i=Rb(n,r);return Xv.relative(o,i)},Mb=function(t){return t.match({domRange:function(t){var e=ve.fromDom(t.startContainer),n=ve.fromDom(t.endContainer);return Bb(e,t.startOffset,n,t.endOffset)},relative:Nb,exact:Bb})},Pb=function(t,e,n,r){var o=dn(t),i=o.dom.createRange();return i.setStart(t.dom,e),i.setEnd(n.dom,r),i},Ib=function(t,e,n,r){var o=Pb(t,e,n,r),i=Ce(t,n)&&e===r;return o.collapsed&&!i},Lb=function(t){return D.from(t.getSelection())},Fb=function(t,e){Lb(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},zb=function(t,e,n,r,o){var i=nb(t,e,n,r,o);Fb(t,i)},Hb=function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)},Vb=function(t,e){return sb(t,e).match({ltr:function(e,n,r,o){zb(t,e,n,r,o)},rtl:function(e,n,r,o){Lb(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{Hb(t,i,e,n,r,o)}catch(u){zb(t,r,o,e,n)}else zb(t,r,o,e,n)}))}})},Ub=function(t,e,n,r,o){var i=Bb(e,n,r,o);Vb(t,i)},jb=function(t,e,n){var r=Nb(e,n);Vb(t,r)},Wb=function(t){var e=Xv.getWin(t).dom,n=function(t,n,r,o){return nb(e,t,n,r,o)},r=Mb(t);return sb(e,r).match({ltr:n,rtl:n})},qb=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return D.some(Bv.create(ve.fromDom(e.startContainer),e.startOffset,ve.fromDom(n.endContainer),n.endOffset))}return D.none()},$b=function(t){if(null===t.anchorNode||null===t.focusNode)return qb(t);var e=ve.fromDom(t.anchorNode),n=ve.fromDom(t.focusNode);return Ib(e,t.anchorOffset,n,t.focusOffset)?D.some(Bv.create(e,t.anchorOffset,n,t.focusOffset)):qb(t)},Gb=function(t,e,n){void 0===n&&(n=!0);var r=n?Jv:Yv,o=r(t,e);Fb(t,o)},Kb=function(t){return Lb(t).filter((function(t){return t.rangeCount>0})).bind($b)},Xb=function(t){return Kb(t).map((function(t){return Xv.exact(t.start,t.soffset,t.finish,t.foffset)}))},Yb=function(t,e){var n=fb(t,e);return ob(n)},Jb=function(t,e,n){return Ab(t,e,n)},Qb=function(t){Lb(t).each((function(t){return t.removeAllRanges()}))},Zb=tinymce.util.Tools.resolve("tinymce.util.VK"),ty=function(t,e,n){return ry(t,e,Av(n,Sf))},ey=function(t,e,n){return ry(t,e,Rv(n,Sf))},ny=function(t,e){var n=Xv.exact(e,0,e,0);return Wb(n)},ry=function(t,e,n){return n.fold(D.none,D.none,(function(e,n){return _a(n).map((function(e){return ny(t,e)}))}),(function(n){return t.execCommand("mceTableInsertRowAfter"),ty(t,e,n)}))},oy=["table","li","dl"],iy=function(t,e,n){if(t.keyCode===Zb.TAB){var r=qa(e),o=function(t){var e=nn(t);return Ce(t,r)||M(oy,e)},i=e.selection.getRng(),u=ve.fromDom(t.shiftKey?i.startContainer:i.endContainer);Dr(u,o).each((function(r){t.preventDefault(),Nr(r,o).each(n.clear),e.selection.collapse(t.shiftKey);var i=t.shiftKey?ey:ty,u=i(e,o,r);u.each((function(t){e.selection.setRng(t)}))}))}},uy=function(t,e){return{selection:t,kill:e}},ay={create:uy},cy=function(t,e,n,r){return{start:Hv.on(t,e),finish:Hv.on(n,r)}},sy={create:cy},fy=function(t,e){var n=fb(t,e);return Bv.create(ve.fromDom(n.startContainer),n.startOffset,ve.fromDom(n.endContainer),n.endOffset)},ly=sy.create,dy=function(t,e,n,r,o,i,u){return Ce(n,o)&&r===i?D.none():Kn(n,"td,th",e).bind((function(n){return Kn(o,"td,th",e).bind((function(r){return my(t,e,n,r,u)}))}))},my=function(t,e,n,r,o){return Ce(n,r)?D.none():ni(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),D.some(ay.create(D.some(ly(n,0,n,ka(n))),!0))):D.none()}))},gy=function(t,e,n,r,o){var i=function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes};return ai(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map(i)},py=function(t,e){return{item:t,mode:e}},hy=function(t,e,n,r){return void 0===r&&(r=vy),t.property().parent(e).map((function(t){return py(t,r)}))},vy=function(t,e,n,r){return void 0===r&&(r=by),n.sibling(t,e).map((function(t){return py(t,r)}))},by=function(t,e,n,r){void 0===r&&(r=by);var o=t.property().children(e),i=n.first(o);return i.map((function(t){return py(t,r)}))},yy=[{current:hy,next:vy,fallback:D.none()},{current:vy,next:by,fallback:D.some(hy)},{current:by,next:by,fallback:D.some(vy)}],wy=function(t,e,n,r,o){void 0===o&&(o=yy);var i=q(o,(function(t){return t.current===n}));return i.bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return wy(t,e,n,r)}))}))}))},xy=function(){var t=function(t,e){return t.query().prevSibling(e)},e=function(t){return t.length>0?D.some(t[t.length-1]):D.none()};return{sibling:t,first:e}},Cy=function(){var t=function(t,e){return t.query().nextSibling(e)},e=function(t){return t.length>0?D.some(t[0]):D.none()};return{sibling:t,first:e}},Sy={left:xy,right:Cy},ky=function(t,e,n,r,o,i){var u=wy(t,e,r,o);return u.bind((function(e){return i(e.item)?D.none():n(e.item)?D.some(e.item):ky(t,e.item,n,e.mode,o,i)}))},Oy=function(t,e,n,r){return ky(t,e,n,vy,Sy.left(),r)},Ty=function(t,e,n,r){return ky(t,e,n,vy,Sy.right(),r)},Ey=function(t){return function(e){return 0===t.property().children(e).length}},_y=function(t,e,n){return Ay(t,e,Ey(t),n)},Dy=function(t,e,n){return Ry(t,e,Ey(t),n)},Ay=Oy,Ry=Ty,Ny=jo(),By=function(t,e){return _y(Ny,t,e)},My=function(t,e){return Dy(Ny,t,e)},Py=function(t,e,n){return Ay(Ny,t,e,n)},Iy=function(t,e,n){return Ry(Ny,t,e,n)},Ly=function(t,e,n){return Vn(t,e,n).isSome()},Fy=li.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),zy=function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right},Hy=function(t){return Kn(t,"tr")},Vy=function(t,e,n,r,o,i,u){return Kn(r,"td,th",u).bind((function(n){return Kn(e,"td,th",u).map((function(e){return Ce(n,e)?Ce(r,n)&&ka(n)===o?i(e):Fy.none("in same cell"):Zo(Hy,[n,e]).fold((function(){return zy(t,e,n)?Fy.success():i(e)}),(function(t){return i(e)}))}))})).getOr(Fy.none("default"))},Uy=function(t,e,n,r,o){return t.fold(e,n,r,o)},jy=ot(ot({},Fy),{verify:Vy,cata:Uy}),Wy=function(t,e,n,r){return{parent:t,children:e,element:n,index:r}},qy=function(t){return pn(t).bind((function(e){var n=wn(e);return $y(n,t).map((function(r){return Wy(e,n,t,r)}))}))},$y=function(t,e){return $(t,w(Ce,e))},Gy=function(t){return"br"===nn(t)},Ky=function(t,e,n){return e(t,n).bind((function(t){return cn(t)&&0===zo(t).trim().length?Ky(t,e,n):D.some(t)}))},Xy=function(t,e,n){return n.traverse(e).orThunk((function(){return Ky(e,n.gather,t)})).map(n.relative)},Yy=function(t,e){return xn(t,e).filter(Gy).orThunk((function(){return xn(t,e-1).filter(Gy)}))},Jy=function(t,e,n,r){return Yy(e,n).bind((function(e){return r.traverse(e).fold((function(){return Ky(e,r.gather,t).map(r.relative)}),(function(t){return qy(t).map((function(t){return Hv.on(t.parent,t.index)}))}))}))},Qy=function(t,e,n,r){var o=Gy(e)?Xy(t,e,r):Jy(t,e,n,r);return o.map((function(t){return{start:t,finish:t}}))},Zy=function(t){return jy.cata(t,(function(t){return D.none()}),(function(){return D.none()}),(function(t){return D.some(ud(t,0))}),(function(t){return D.some(ud(t,ka(t)))}))},tw=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},ew=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},nw=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},rw=function(t){return t.top},ow=function(t){return t.bottom},iw=function(t,e,n){return n>=0&&n<ka(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):D.none()},uw=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},aw=function(t,e){return D.some(t.getRect(e))},cw=function(t,e,n){return an(e)?aw(t,e).map(uw):cn(e)?iw(t,e,n).map(uw):D.none()},sw=function(t,e){return an(e)?aw(t,e).map(uw):cn(e)?t.getRangedRect(e,0,e,ka(e)).map(uw):D.none()},fw=5,lw=100,dw=li.generate([{none:[]},{retry:["caret"]}]),mw=function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right},gw=function(t,e,n){return Un(e,ag).fold(S,(function(e){return sw(t,e).exists((function(t){return mw(n,t)}))}))},pw=function(t,e,n,r,o){var i=tw(o,fw);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?dw.retry(i):n.top===o.bottom?dw.retry(tw(o,1)):gw(t,e,o)?dw.retry(nw(i,fw,0)):dw.none()},hw=function(t,e,n,r,o){var i=ew(o,fw);return Math.abs(n.top-r.top)<1||n.bottom<o.top?dw.retry(i):n.bottom===o.top?dw.retry(ew(o,1)):gw(t,e,o)?dw.retry(nw(i,fw,0)):dw.none()},vw={point:rw,adjuster:hw,move:ew,gather:By},bw={point:ow,adjuster:pw,move:tw,gather:My},yw=function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===nn(t)})).isSome()},ww=function(t,e,n,r,o){return xw(t,e,n,e.move(r,fw),o)},xw=function(t,e,n,r,o){return 0===o?D.some(r):yw(t,r.left,e.point(r))?ww(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(D.none,(function(i){return sw(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(D.none,(function(r){return xw(t,e,n,r,o-1)}))})).orThunk((function(){return D.some(r)}))}),D.none)}))},Cw=function(t,e){return t.situsFromPoint(e.left,e.bottom+fw)},Sw=function(t,e){return t.situsFromPoint(e.left,e.top-fw)},kw=function(t,e,n){return t.point(e)>n.getInnerHeight()?D.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?D.some(-t.point(e)):D.none()},Ow=function(t,e,n){var r=t.move(n,fw),o=xw(e,t,n,r,lw).getOr(r);return kw(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Tw={tryUp:w(Ow,vw),tryDown:w(Ow,bw),ieTryUp:Sw,ieTryDown:Cw,getJumpSize:v(fw)},Ew=20,_w=function(t,e,n){return t.getSelection().bind((function(r){return Qy(e,r.finish,r.foffset,n).fold((function(){return D.some(ud(r.finish,r.foffset))}),(function(o){var i=t.fromSitus(o),u=jy.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e);return Zy(u)}))}))},Dw=function(t,e,n,r,o,i){return 0===i?D.none():Nw(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=jy.verify(t,n,r,a.finish,a.foffset,o.failure,e);return jy.cata(c,(function(){return D.none()}),(function(){return D.some(u)}),(function(u){return Ce(n,u)&&0===r?Aw(t,n,r,ew,o):Dw(t,e,u,0,o,i-1)}),(function(u){return Ce(n,u)&&r===ka(u)?Aw(t,n,r,tw,o):Dw(t,e,u,ka(u),o,i-1)}))}))},Aw=function(t,e,n,r,o){return cw(t,e,n).bind((function(e){return Rw(t,o,r(e,Tw.getJumpSize()))}))},Rw=function(t,e,n){var r=oe().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):D.none()},Nw=function(t,e,n,r,o){return cw(t,n,r).bind((function(e){return Rw(t,o,e)}))},Bw=function(t,e,n){return _w(t,e,n).bind((function(r){return Dw(t,e,r.element,r.offset,n,Ew).map(t.fromSitus)}))},Mw=function(t,e){return Ly(t,(function(t){return pn(t).exists((function(t){return Ce(t,e)}))}))},Pw=function(t,e,n,r,o){return Kn(r,"td,th",e).bind((function(r){return Kn(r,"table",e).bind((function(i){return Mw(o,i)?Bw(t,e,n).bind((function(t){return Kn(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):D.none()}))}))},Iw=function(t,e,n,r,o,i){return oe().browser.isIE()?D.none():i(r,e).orThunk((function(){return Pw(t,e,n,r,o).map((function(t){var e=t.range;return ay.create(D.some(ly(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Lw=function(t,e){return Kn(t,"tr",e).bind((function(t){return Kn(t,"table",e).bind((function(n){var r=zn(n,"tr");return Ce(t,r[0])?Py(n,(function(t){return Da(t).isSome()}),e).map((function(t){var e=ka(t);return ay.create(D.some(ly(t,e,t,e)),!0)})):D.none()}))}))},Fw=function(t,e){return Kn(t,"tr",e).bind((function(t){return Kn(t,"table",e).bind((function(n){var r=zn(n,"tr");return Ce(t,r[r.length-1])?Iy(n,(function(t){return _a(t).isSome()}),e).map((function(t){return ay.create(D.some(ly(t,0,t,0)),!0)})):D.none()}))}))},zw=function(t,e,n,r,o,i,u){return Pw(t,n,r,o,i).bind((function(t){return my(e,n,t.start,t.finish,u)}))},Hw=function(t,e){return Kn(t,"td,th",e)},Vw=function(t,e,n,r){var o=bh(),i=o.clear,u=function(i){o.on((function(o){r.clearBeforeUpdate(e),Hw(i.target,n).each((function(u){ni(o,u,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var a=o[0],c="false"===kf(a),s=rr(Cf(i.target),a,Ce);c&&s&&(r.selectRange(e,o,a,a),t.selectContents(a))}else o.length>1&&(r.selectRange(e,o,n.start,n.finish),t.selectContents(u))}))}))}))},a=function(t){r.clear(e),Hw(t.target,n).each(o.set)},c=function(t){u(t)},s=function(t){u(t),i()};return{clearstate:i,mousedown:a,mouseover:c,mouseup:s}},Uw={traverse:yn,gather:My,relative:Hv.before,otherRetry:Tw.tryDown,ieRetry:Tw.ieTryDown,failure:jy.failedDown},jw={traverse:bn,gather:By,relative:Hv.before,otherRetry:Tw.tryUp,ieRetry:Tw.ieTryUp,failure:jy.failedUp},Ww=function(t){return function(e){return e===t}},qw=Ww(38),$w=Ww(40),Gw=function(t){return t>=37&&t<=40},Kw={isBackward:Ww(37),isForward:Ww(39)},Xw={isBackward:Ww(39),isForward:Ww(37)},Yw=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return Qi(n,r)},Jw=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollBy(t,e)},Qw=function(t){var e=function(e,n){return ve.fromPoint(ve.fromDom(t.document),e,n)},n=function(t){return t.dom.getBoundingClientRect()},r=function(e,n,r,o){var i=Xv.exact(e,n,r,o);return Yb(t,i)},o=function(){return Xb(t).map((function(e){return fy(t,e)}))},i=function(e){var n=Xv.relative(e.start,e.finish);return fy(t,n)},u=function(e,n){return Jb(t,e,n).map((function(t){return sy.create(t.start,t.soffset,t.finish,t.foffset)}))},a=function(){Qb(t)},c=function(e){void 0===e&&(e=!1),Xb(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;jb(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;Ub(t,u,a,u,a)}))}))},s=function(e){Gb(t,e,!1)},f=function(e){Gb(t,e)},l=function(e){Ub(t,e.start,e.soffset,e.finish,e.foffset)},d=function(e,n){jb(t,e,n)},m=function(){return t.innerHeight},g=function(){var e=Yw(ve.fromDom(t.document));return e.top},p=function(e,n){Jw(e,n,ve.fromDom(t.document))};return{elementFromPoint:e,getRect:n,getRangedRect:r,getSelection:o,fromSitus:i,situsFromPoint:u,clearSelection:a,collapseSelection:c,setSelection:l,setRelativeSelection:d,selectNode:s,selectContents:f,getInnerHeight:m,getScrollY:g,scrollBy:p}},Zw=function(t,e){return{rows:t,cols:e}},tx=function(t,e,n,r){var o=Qw(t),i=Vw(o,e,n,r);return{clearstate:i.clearstate,mousedown:i.mousedown,mouseover:i.mouseover,mouseup:i.mouseup}},ex=function(t,e,n,r){var o=Qw(t),i=function(){return r.clear(e),D.none()},u=function(t,u,a,c,s,f){var l=t.raw,d=l.which,m=!0===l.shiftKey,g=ri(e,r.selectedSelector).fold((function(){return Gw(d)&&!m&&r.clearBeforeUpdate(e),$w(d)&&m?w(zw,o,e,n,Uw,c,u,r.selectRange):qw(d)&&m?w(zw,o,e,n,jw,c,u,r.selectRange):$w(d)?w(Iw,o,n,Uw,c,u,Fw):qw(d)?w(Iw,o,n,jw,c,u,Lw):D.none}),(function(t){var n=function(n){return function(){var i=rt(n,(function(n){return gy(n.rows,n.cols,e,t,r)}));return i.fold((function(){return ii(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=$w(d)||f.isForward(d)?Hv.after:Hv.before;return o.setRelativeSelection(Hv.on(t.first,0),n(t.table)),r.clear(e),ay.create(D.none(),!0)}))}),(function(t){return D.some(ay.create(D.none(),!0))}))}};return $w(d)&&m?n([Zw(1,0)]):qw(d)&&m?n([Zw(-1,0)]):f.isBackward(d)&&m?n([Zw(0,-1),Zw(-1,0)]):f.isForward(d)&&m?n([Zw(0,1),Zw(1,0)]):Gw(d)&&!m?i:D.none}));return g()},a=function(t,o,i,u,a){return ri(e,r.selectedSelector).fold((function(){var c=t.raw,s=c.which,f=!0===c.shiftKey;return f&&Gw(s)?dy(e,n,o,i,u,a,r.selectRange):D.none()}),D.none)};return{keydown:u,keyup:a}},nx=function(t,e,n,r){var o=Qw(t);return function(t,i){r.clearBeforeUpdate(e),ni(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}},rx=function(t,e){F(e,(function(e){ff(t,e)}))},ox=function(t){return function(e){cf(e,t)}},ix=function(t){return function(e){rx(e,t)}},ux=function(t){var e=ox(t.selected),n=ix([t.selected,t.lastSelected,t.firstSelected]),r=function(e){var r=zn(e,t.selectedSelector);F(r,n)},o=function(n,o,i,u){r(n),F(o,e),cf(i,t.firstSelected),cf(u,t.lastSelected)};return{clearBeforeUpdate:r,clear:r,selectRange:o,selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},ax=function(t,e,n){var r=function(e){er(e,t.selected),er(e,t.firstSelected),er(e,t.lastSelected)},o=function(e){Yn(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=zn(e,t.selectedSelector+","+t.firstSelectedSelector+","+t.lastSelectedSelector);F(n,r)},a=function(n,r,u,a){i(n),F(r,o),Yn(u,t.firstSelected,"1"),Yn(a,t.lastSelected,"1"),e(r,u,a)};return{clearBeforeUpdate:u,clear:i,selectRange:a,selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},cx={byClass:ux,byAttr:ax},sx=function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=Vd(n);return K(r,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return L(n,(function(t){return t.element}))}))},fx=function(t,e){var n=t.slice(e[0].row+e[0].rowspan-1,t.length),r=Vd(n);return K(r,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return L(n,(function(t){return t.element}))}))},lx=function(t,e,n){var r=so.fromTable(t),o=Xd(r,e);return o.map((function(t){var e=zd(r,n,!1),o=sx(e,t),i=fx(e,t);return{upOrLeftCells:o,downOrRightCells:i}}))},dx=tinymce.util.Tools.resolve("tinymce.Env"),mx=function(t){return!1===lf(ve.fromDom(t.target),"ephox-snooker-resizer-bar")};function gx(t,e,n){var r=function(e,r,o){n.targets().each((function(n){var i=Nr(r);i.each((function(i){var u=Vl(t),a=Ha(g,ve.fromDom(t.getDoc()),u),c=lx(i,n,a);nl(t,e,r,o,c)}))}))},o=function(){return rl(t)},i=cx.byAttr(gc,r,o);return t.on("init",(function(n){var r=t.getWin(),o=qa(t),u=Ka(t),a=function(){var e=t.selection,n=ve.fromDom(e.getStart()),r=ve.fromDom(e.getEnd()),u=Zo(Nr,[n,r]);u.fold((function(){return i.clear(o)}),g)},c=tx(r,o,u,i),s=ex(r,o,u,i),f=nx(r,o,u,i),l=function(t){return!0===t.raw.shiftKey};t.on("TableSelectorChange",(function(t){return f(t.start,t.finish)}));var d=function(e,n){l(e)&&(n.kill&&e.kill(),n.selection.each((function(e){var n=Xv.relative(e.start,e.finish),o=fb(r,n);t.selection.setRng(o)})))},m=function(e){var n=Zs(e);if(n.raw.shiftKey&&Gw(n.raw.which)){var r=t.selection.getRng(),o=ve.fromDom(r.startContainer),i=ve.fromDom(r.endContainer);s.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){d(n,t)}))}},p=function(n){var r=Zs(n);e().each((function(t){return t.hideBars()}));var o=t.selection.getRng(),i=ve.fromDom(o.startContainer),u=ve.fromDom(o.endContainer),a=qi(Kw,Xw)(ve.fromDom(t.selection.getStart()));s.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){d(r,t)})),e().each((function(t){return t.showBars()}))},h=function(t){return 0===t.button},v=function(t){return void 0===t.buttons||(!(!dx.browser.isEdge()||0!==t.buttons)||0!==(1&t.buttons))},b=function(t){c.clearstate()},y=function(t){h(t)&&mx(t)&&c.mousedown(Zs(t))},w=function(t){v(t)&&mx(t)&&c.mouseover(Zs(t))},x=function(t){h(t)&&mx(t)&&c.mouseup(Zs(t))},C=function(){var t=ph(ve.fromDom(o)),e=ph(0),n=function(n){var r=ve.fromDom(n.target);if("td"===nn(r)||"th"===nn(r)){var o=t.get(),i=e.get();Ce(o,r)&&n.timeStamp-i<300&&(n.preventDefault(),f(r,r))}t.set(r),e.set(n.timeStamp)};return{touchEnd:n}},S=C();t.on("dragstart",b),t.on("mousedown",y),t.on("mouseover",w),t.on("mouseup",x),t.on("touchend",S.touchEnd),t.on("keyup",m),t.on("keydown",p),t.on("NodeChange",a)})),{clear:i.clear}}var px=function(t,e){return $n(t,e).isSome()},hx=function(t,e){var n=ph(D.none()),r=ph([]),o=D.none(),i=ln("caption"),u=function(t){return o.forall((function(e){return!e[t]}))},a=function(){return xc(ec(t),Ka(t))},c=function(){return xc(nc(t),Ka(t))},s=function(){return a().bind((function(t){return ar(ir(Nr(t),c().bind(Nr),(function(n,r){return Ce(n,r)?i(t)?D.some(pc(t)):D.some(hc(e,n,t)):D.none()})))}))},f=function(t){var e=Nr(t.element);return e.map((function(e){var n=so.fromTable(e),r=Xd(n,t).getOr([]),o=j(r,(function(t,e){return e.isLocked&&(t.onAny=!0,0===e.column?t.onFirst=!0:e.column+e.colspan>=n.grid.columns&&(t.onLast=!0)),t}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Zd(n,t).isSome(),unmergeable:tm(n,t).isSome(),locked:o}}))},l=function(){n.set(ut(s)()),o=n.get().bind(f),F(r.get(),(function(t){return t()}))},d=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(V(r.get(),(function(e){return e!==t})))}},m=function(t,e){return d((function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))}))},g=function(t,e,r){return d((function(){return n.get().fold((function(){t.setDisabled(!0),t.setActive(!1)}),(function(n){t.setDisabled(e(n)),t.setActive(r(n))}))}))},p=function(t){return o.exists((function(e){return e.locked[t]}))},h=function(t){return m(t,(function(t){return!1}))},v=function(t){return m(t,(function(t){return i(t.element)}))},b=function(t){return function(e){return m(e,(function(e){return i(e.element)||p(t)}))}},y=function(t){return function(e){return m(e,(function(e){return i(e.element)||t().isNone()}))}},w=function(t,e){return function(n){return m(n,(function(n){return i(n.element)||t().isNone()||p(e)}))}},x=function(t){return m(t,(function(t){return u("mergeable")}))},C=function(t){return m(t,(function(t){return u("unmergeable")}))},k=function(e){return g(e,S,(function(e){var n=Nr(e.element,Ka(t));return n.exists((function(t){return px(t,"caption")}))}))},O=function(e,n){return function(r){return g(r,(function(t){return i(t.element)}),(function(){return t.queryCommandValue(e)===n}))}},T=O("mceTableRowType","header"),E=O("mceTableColType","th");return t.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:h,onSetupCellOrRow:v,onSetupColumn:b,onSetupPasteable:y,onSetupPasteableColumn:w,onSetupMergeable:x,onSetupUnmergeable:C,resetTargets:l,onSetupTableWithCaption:k,onSetupTableRowHeaders:T,onSetupTableColumnHeaders:E,targets:n.get}},vx=function(t,e,n,r){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=kh(Rl(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Oh(t,e,i,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)})),onSetup:n.onSetupTable});var u=kh(Dl(t));0!==u.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Oh(t,e,u,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)})),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Oh(t,e,th,"tablecellverticalalign",Sh(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Oh(t,e,vl(t),"tablecellborderwidth",Sh(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Oh(t,e,bl(t),"tablecellborderstyle",Sh(t,"border-style")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),t.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(Th(t,jl(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(Th(t,Wl(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:Eh(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:_h(t),onSetup:n.onSetupTableColumnHeaders})},bx=function(t){var e=function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},n=Pl(t);n.length>0&&t.ui.registry.addContextToolbar("table",{predicate:e,items:n,scope:"node",position:"node"})},yx=function(t,e,n,r){var o=function(e){return function(){return t.execCommand(e)}},i=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},u={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},a={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)});var c={type:"nestedmenuitem",text:"Row",getSubmenuItems:v("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")});var s={type:"nestedmenuitem",text:"Column",getSubmenuItems:v("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});var f={type:"nestedmenuitem",text:"Cell",getSubmenuItems:v("tablecellprops tablemergecells tablesplitcells")};!1===El(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",u),t.ui.registry.addMenuItem("deletetable",a),t.ui.registry.addNestedMenuItem("row",c),t.ui.registry.addNestedMenuItem("column",s),t.ui.registry.addNestedMenuItem("cell",f),t.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(v(""),(function(t){return"caption"===nn(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var l=kh(Rl(t));0!==l.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Ch(t,e,l,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)}))},onSetup:n.onSetupTable});var d=kh(Dl(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Ch(t,e,d,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)}))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Ch(t,e,th,"tablecellverticalalign",Sh(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Ch(t,e,vl(t),"tablecellborderwidth",Sh(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Ch(t,e,bl(t),"tablecellborderstyle",Sh(t,"border-style"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),t.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return Th(t,jl(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return Th(t,Wl(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:Eh(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:_h(t),onSetup:n.onSetupTableColumnHeaders})},wx=function(t){var e=vi((function(){return qa(t)}),(function(){return Cc(ec(t),Ka(t))}),gc.selectedSelector),n=hx(t,e),r=id(t),o=gx(t,r.lazyResize,n),i=Cp(t,o,r.lazyWire),u=wv();return bv(t,i,o,e,u),yv(t,i,e),_c(t,e,i),yx(t,e,n,u),vx(t,e,n,u),bx(t),t.on("PreInit",(function(){t.serializer.addTempAttr(gc.firstSelected),t.serializer.addTempAttr(gc.lastSelected),kv(t)})),Cl(t)&&t.on("keydown",(function(e){iy(e,t,o)})),t.on("remove",(function(){r.destroy()})),Up(t,u,r,n)};function xx(){bi.add("table",wx)}xx()})()},a061:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"tinymce-editor"},[e("editor",{attrs:{init:t.init,disabled:t.disabled},on:{onClick:t.onClick},model:{value:t.myValue,callback:function(e){t.myValue=e},expression:"myValue"}})],1)},o=[],i=n("e562"),u=n.n(i),a=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],c=function(t){return-1!==a.indexOf(t)},s=function(t,e,n){Object.keys(e).filter(c).forEach((function(r){var o=e[r];"function"===typeof o&&("onInit"===r?o(t,n):n.on(r.substring(2),(function(t){return o(t,n)})))}))},f=function(t,e){var n,r=t.$props.modelEvents?t.$props.modelEvents:null,o=Array.isArray(r)?r.join(" "):r;t.$watch("value",(function(t,r){e&&"string"===typeof t&&t!==n&&t!==r&&(e.setContent(t),n=t)})),e.on(o||"change keyup undo redo",(function(){n=e.getContent(),t.$emit("input",n)}))},l=function(t,e,n){var r=e.$props.value?e.$props.value:"",o=e.$props.initialValue?e.$props.initialValue:"";n.setContent(r||o),e.$listeners.input&&f(e,n),s(t,e.$listeners,n)},d=0,m=function(t){var e=Date.now(),n=Math.floor(1e9*Math.random());return d++,t+"_"+n+d+String(e)},g=function(t){return null!==t&&"textarea"===t.tagName.toLowerCase()},p=function(t){return"undefined"===typeof t||""===t?[]:Array.isArray(t)?t:t.split(" ")},h=function(t,e){return p(t).concat(p(e))},v=function(t,e,n,r){var o=e.createElement("script");o.type="application/javascript",o.id=t,o.addEventListener("load",r),o.src=n,e.head&&e.head.appendChild(o)},b=function(){return{listeners:[],scriptId:m("tiny-script"),scriptLoaded:!1}},y=function(t,e,n,r){t.scriptLoaded?r():(t.listeners.push(r),e.getElementById(t.scriptId)||v(t.scriptId,e,n,(function(){t.listeners.forEach((function(t){return t()})),t.scriptLoaded=!0})))},w=n("1f38"),x={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],value:String,disabled:Boolean},C=function(){return C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},C.apply(this,arguments)},S=b(),k=function(t,e,n){return t(n||"div",{attrs:{id:e}})},O=function(t,e){return t("textarea",{attrs:{id:e},style:{visibility:"hidden"}})},T=function(t){return function(){var e=C({},t.$props.init,{readonly:t.$props.disabled,selector:"#"+t.elementId,plugins:h(t.$props.init&&t.$props.init.plugins,t.$props.plugins),toolbar:t.$props.toolbar||t.$props.init&&t.$props.init.toolbar,inline:t.inlineEditor,setup:function(e){t.editor=e,e.on("init",(function(n){return l(n,t,e)})),t.$props.init&&"function"===typeof t.$props.init.setup&&t.$props.init.setup(e)}});g(t.element)&&(t.element.style.visibility=""),Object(w["a"])().init(e)}},E={props:x,created:function(){this.elementId=this.$props.id||m("tiny-vue"),this.inlineEditor=this.$props.init&&this.$props.init.inline||this.$props.inline},watch:{disabled:function(){this.editor.setMode(this.disabled?"readonly":"design")}},mounted:function(){if(this.element=this.$el,null!==Object(w["a"])())T(this)();else if(this.element&&this.element.ownerDocument){var t=this.element.ownerDocument,e=this.$props.cloudChannel?this.$props.cloudChannel:"5",n=this.$props.apiKey?this.$props.apiKey:"no-api-key";y(S,t,"https://cdn.tiny.cloud/1/"+n+"/tinymce/"+e+"/tinymce.min.js",T(this))}},beforeDestroy:function(){null!==Object(w["a"])()&&Object(w["a"])().remove(this.editor)},render:function(t){return this.inlineEditor?k(t,this.elementId,this.$props.tagName):O(t,this.elementId)}},_=E,D=(n("030f"),n("4ea8"),n("4237"),n("3aea"),n("07d1"),n("84ec8"),n("f557"),n("9434"),n("2d33"),n("34de"),n("3154"),n("0fea")),A={components:{Editor:_},props:{value:{type:String,required:!1},triggerChange:{type:Boolean,default:!1,required:!1},disabled:{type:Boolean,default:!1},plugins:{type:[String,Array],default:"lists image link media table textcolor wordcount contextmenu fullscreen"},toolbar:{type:[String,Array],default:"undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists link unlink image media table | removeformat | fullscreen",branding:!1}},data:function(){return{init:{icons_url:"/tinymce/icons/default/icons.js",language_url:"/tinymce/langs/zh_CN.js",language:"zh_CN",content_css:"/tinymce/skins/lightgray/content.min.css",skin_url:"/tinymce/skins/lightgray",height:300,plugins:this.plugins,toolbar:this.toolbar,branding:!1,menubar:!1,toolbar_drawer:!1,images_upload_handler:function(t,e){var n=new FormData;n.append("file",t.blob(),t.filename()),n.append("biz","jeditor"),n.append("jeditor","1"),Object(D["l"])(window._CONFIG["domianURL"]+"/sys/common/upload",n).then((function(n){if(n.success)if("local"==n.message){var r="data:image/jpeg;base64,"+t.base64();e(r)}else{var o=Object(D["e"])(n.message);e(o)}}))}},myValue:this.value}},mounted:function(){u.a.init({})},methods:{onClick:function(t){this.$emit("onClick",t,u.a)},clear:function(){this.myValue=""}},watch:{value:function(t){this.myValue=null==t?"":t},myValue:function(t){this.triggerChange?this.$emit("change",t):this.$emit("input",t)}}},R=A,N=n("2877"),B=Object(N["a"])(R,r,o,!1,null,"6dc50a4e",null);e["default"]=B.exports},be7f:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.VK"),n=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return function(e){return n(e)===t}},o=function(t){return function(e){return typeof e===t}},i=function(t){return function(e){return t===e}},u=r("string"),a=r("array"),c=i(null),s=o("boolean"),f=o("function"),l=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=function(t,e){return t===e},p=d(!1),h=d(!0),v=function(){return b},b=function(){var t=function(t){return t()},e=m,n={fold:function(t,e){return t()},isSome:p,isNone:h,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:v,each:l,bind:v,exists:p,forall:h,filter:function(){return v()},toArray:function(){return[]},toString:d("none()")};return n}(),y=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w=function(t){return null===t||void 0===t?b:y(t)},x={some:y,none:v,from:w},C=Array.prototype.indexOf,S=Array.prototype.push,k=function(t,e){return C.call(t,e)},O=function(t,e){return k(t,e)>-1},T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},E=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},_=function(t,e,n){return E(t,(function(t,r){n=e(n,t,r)})),n},D=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e},A=function(t,e){return D(T(t,e))},R=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},N=function(t,e,n){return void 0===n&&(n=g),t.exists((function(t){return n(t,e)}))},B=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},M=function(t,e){return t?x.some(e):x.none()},P=function(t){var e=t.getParam("link_assume_external_targets",!1);return s(e)&&e?1:!u(e)||"http"!==e&&"https"!==e?0:e},I=function(t){return t.getParam("link_context_toolbar",!1,"boolean")},L=function(t){return t.getParam("link_list")},F=function(t){return t.getParam("default_link_target")},z=function(t){return t.getParam("target_list",!0)},H=function(t){return t.getParam("rel_list",[],"array")},V=function(t){return t.getParam("link_class_list",[],"array")},U=function(t){return t.getParam("link_title",!0,"boolean")},j=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},W=function(t){return t.getParam("link_quicklink",!1,"boolean")},q=function(t){return t.getParam("link_default_protocol","http","string")},$=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=function(t){return u(t.value)?t.value:""},K=function(t){return u(t.text)?t.text:u(t.title)?t.title:""},X=function(t,e){var n=[];return $.each(t,(function(t){var r=K(t);if(void 0!==t.menu){var o=X(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},Y=function(t){return void 0===t&&(t=G),function(e){return x.from(e).map((function(e){return X(e,t)}))}},J=function(t){return Y(G)(t)},Q=function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},Z={sanitize:J,sanitizeWith:Y,createUi:Q,getValue:G},tt=function(){return tt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},tt.apply(this,arguments)},et=Object.keys,nt=Object.hasOwnProperty,rt=function(t,e){for(var n=et(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},ot=function(t){return function(e,n){t[n]=e}},it=function(t,e,n,r){var o={};return rt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},ut=function(t,e){var n={};return it(t,e,ot(n),l),n},at=function(t,e){return nt.call(t,e)},ct=function(t,e){return at(t,e)&&void 0!==t[e]&&null!==t[e]},st=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ft=tinymce.util.Tools.resolve("tinymce.util.URI"),lt=function(t){return t&&"a"===t.nodeName.toLowerCase()},dt=function(t){return lt(t)&&!!pt(t)},mt=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new st(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},gt=function(t){return/^\w+:/i.test(t)},pt=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},ht=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return $.trim(t.sort().join(" "))},i=function(t){return t=u(t),t.length>0?t.concat(n):n},u=function(t){return t.filter((function(t){return-1===$.inArray(n,t)}))},a=e?i(r):u(r);return a.length>0?o(a):""},vt=function(t){return t.replace(/\uFEFF/g,"")},bt=function(t,e){return e=e||t.selection.getNode(),St(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},yt=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return vt(n)},wt=function(t){return $.grep(t,dt).length>0},xt=function(t){return mt(t,dt).length>0},Ct=function(t){var e=t.schema.getTextInlineElements(),n=function(t){return 1===t.nodeType&&!lt(t)&&!at(e,t.nodeName.toLowerCase())},r=mt(t.selection.getRng(),n);return 0===r.length},St=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},kt=function(t){var e=["title","rel","class","target"];return _(e,(function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e}),{href:t.href})},Ot=function(t,e){return"http"!==e&&"https"!==e||gt(t)?t:e+"://"+t},Tt=function(t,e){var n=tt({},e);if(!(H(t).length>0)&&!1===j(t)){var r=ht(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===z(t)&&(n.target=F(t)),n.href=Ot(n.href,P(t)),n},Et=function(t,e,n,r){n.each((function(t){at(e,"innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)},_t=function(t,e,n,r){St(e)?Lt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))},Dt=function(t,e,n){var r=t.selection.getNode(),o=bt(t,r),i=Tt(t,kt(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),Et(t,o,n.text,i)):_t(t,r,n.text,i)}))},At=function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)},Rt=function(t){t.undoManager.transact((function(){var e=t.selection.getNode();St(e)?It(t,e):At(t),t.focus()}))},Nt=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return ut({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,e){return!1===c(t)}))},Bt=function(t,e){var n=e.href;return tt(tt({},e),{href:ft.isDomSafe(n,"a",t.settings)?n:""})},Mt=function(t,e,n){var r=Bt(t,n);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,Nt(r)):Dt(t,e,r)},Pt=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):Rt(t)},It=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},Lt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},Ft=function(t){return ct(t,"items")},zt=function(t,e){return R(e,(function(e){return Ft(e)?zt(t,e.items):M(e.value===t,e)}))},Ht=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?zt(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:l}},text:i?t:e.text}})):x.none()},Vt=function(t,e){return"link"===e?t.link:"anchor"===e?t.anchor:x.none()},Ut=function(t,e){var n={text:t.text,title:t.title},r=function(t){return M(n.title.length<=0,x.from(t.meta.title).getOr(""))},o=function(t){return M(n.text.length<=0,x.from(t.meta.text).getOr(t.value))},i=function(t){var e=o(t.url),n=r(t.url);return e.isSome()||n.isSome()?x.some(tt(tt({},e.map((function(t){return{text:t}})).getOr({})),n.map((function(t){return{title:t}})).getOr({}))):x.none()},u=function(t,r){var o=Vt(e,r.name).getOr([]);return Ht(n.text,r.name,o,t)},a=function(t,e){var r=e.name;return"url"===r?i(t()):O(["anchor","link"],r)?u(t(),e):"text"===r||"title"===r?(n[r]=t()[r],x.none()):x.none()};return{onChange:a}},jt={init:Ut,getDelta:Ht},Wt=tinymce.util.Tools.resolve("tinymce.util.Delay"),qt=tinymce.util.Tools.resolve("tinymce.util.Promise"),$t=function(t,e,n){var r=t.selection.getRng();Wt.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))},Gt=function(t){var e=t.href,n=e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:");return n?x.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return tt(tt({},t),{href:"mailto:"+e})}}):x.none()},Kt=function(t,e){return function(n){var r=n.href,o=1===t&&!gt(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r);return o?x.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return tt(tt({},t),{href:e+"://"+r})}}):x.none()}},Xt=function(t,e){return R([Gt,Kt(P(t),q(t))],(function(t){return t(e)})).fold((function(){return qt.resolve(e)}),(function(n){return new qt((function(r){$t(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))},Yt={preprocess:Xt},Jt=function(t){var e=t.dom.select("a:not([href])"),n=A(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?x.some([{text:"None",value:""}].concat(n)):x.none()},Qt={getAnchors:Jt},Zt=function(t){var e=V(t);return e.length>0?Z.sanitize(e):x.none()},te={getClasses:Zt},ee=tinymce.util.Tools.resolve("tinymce.util.XHR"),ne=function(t){try{return x.some(JSON.parse(t))}catch(e){return x.none()}},re=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=L(t);return new qt((function(t){u(n)?ee.send({url:n,success:function(e){return t(ne(e))},error:function(e){return t(x.none())}}):f(n)?n((function(e){return t(x.some(e))})):t(x.from(n))})).then((function(t){return t.bind(Z.sanitizeWith(e)).map((function(t){if(t.length>0){var e=[{text:"None",value:""}];return e.concat(t)}return t}))}))},oe={getLinks:re},ie=function(t,e){var n=H(t);if(n.length>0){var r=N(e,"_blank"),o=!1===j(t),i=function(t){return ht(Z.getValue(t),r)},u=o?Z.sanitizeWith(i):Z.sanitize;return u(n)}return x.none()},ue={getRels:ie},ae=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],ce=function(t){var e=z(t);return a(e)?Z.sanitize(e).orThunk((function(){return x.some(ae)})):!1===e?x.none():x.some(ae)},se={getTargets:ce},fe=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?x.some(r):x.none()},le=function(t,e){var n=t.dom,r=Ct(t),o=r?x.some(yt(t.selection,e)):x.none(),i=e?x.some(n.getAttrib(e,"href")):x.none(),u=e?x.from(n.getAttrib(e,"target")):x.none(),a=fe(n,e,"rel"),c=fe(n,e,"class"),s=fe(n,e,"title");return{url:i,text:o,title:s,target:u,rel:a,linkClass:c}},de=function(t,e){return oe.getLinks(t).then((function(n){var r=le(t,e);return{anchor:r,catalogs:{targets:se.getTargets(t),rels:ue.getRels(t,r.target),classes:te.getClasses(t),anchor:Qt.getAnchors(t),link:n},optNode:x.from(e),flags:{titleEnabled:U(t)}}}))},me={collect:de},ge=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return Pt(t),void n.close();var o=function(t){return x.from(r[t]).filter((function(n){return!N(e.anchor[t],n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:l};Yt.preprocess(t,i).then((function(e){Mt(t,u,e)})),n.close()}},pe=function(t){var e=bt(t);return me.collect(t,e)},he=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}},ve=function(t,e,n){var r=[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],o=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),i=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],u=x.from(F(n)),a=he(t,u),c=t.catalogs,s=jt.init(a,c),f={type:"panel",items:D([r,o,i,B([c.anchor.map(Z.createUi("anchor","Anchors")),c.rels.map(Z.createUi("rel","Rel")),c.targets.map(Z.createUi("target","Open link in...")),c.link.map(Z.createUi("link","Link list")),c.classes.map(Z.createUi("linkClass","Class"))])])};return{title:"Insert/Edit Link",size:"normal",body:f,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onChange:function(t,e){var n=e.name;s.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}},be=function(t){var e=pe(t);e.then((function(e){var n=ge(t,e);return ve(e,n,t)})).then((function(e){t.windowManager.open(e)}))},ye=function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)},we=function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ye(e,n)},xe=function(t,e){return t.dom.getParent(e,"a[href]")},Ce=function(t){return xe(t,t.selection.getStart())},Se=function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey},ke=function(t,e){if(e){var n=pt(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else we(e.href)}},Oe=function(t){return function(){be(t)}},Te=function(t){return function(){ke(t,Ce(t))}},Ee=function(t){t.on("click",(function(n){var r=xe(t,n.target);r&&e.metaKeyPressed(n)&&(n.preventDefault(),ke(t,r))})),t.on("keydown",(function(e){var n=Ce(t);n&&13===e.keyCode&&Se(e)&&(e.preventDefault(),ke(t,n))}))},_e=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},De=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==bt(t,t.selection.getNode()))};return n(),_e(t,n)}},Ae=function(t){return function(e){var n=function(){return e.setDisabled(null===bt(t,t.selection.getNode()))};return n(),_e(t,n)}},Re=function(t){return function(e){var n=function(e){return wt(e)||xt(t.selection.getRng())},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),_e(t,(function(t){return e.setDisabled(!n(t.parents))}))}},Ne=function(t){t.addCommand("mceLink",(function(){W(t)?t.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):Oe(t)()}))},Be=function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))},Me=function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Oe(t),onSetup:De(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Te(t),onSetup:Ae(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return Pt(t)},onSetup:Re(t)})},Pe=function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Te(t),onSetup:Ae(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Oe(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return Pt(t)},onSetup:Re(t)})},Ie=function(t){var e="link unlink openlink",n="link";t.ui.registry.addContextMenu("link",{update:function(r){return wt(t.dom.getParents(r,"a"))?e:n}})},Le=function(t){var e=function(t){t.selection.collapse(!1)},n=function(e){var n=t.selection.getNode();return e.setDisabled(!bt(t,n)),l},r=function(e){var n=bt(t),r=Ct(t);if(!n&&r){var o=yt(t.selection,n);return x.some(o.length>0?o:e)}return x.none()};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:De(t)},label:"Link",predicate:function(e){return!!bt(t,e)&&I(t)},initValue:function(){var e=bt(t);return e?pt(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!bt(t,n)),De(t)(e)},onAction:function(n){var o=n.getValue(),i=r(o),u={href:o,attach:l};Mt(t,u,{href:o,text:i,title:x.none(),rel:x.none(),target:x.none(),class:x.none()}),e(t),n.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(e){Pt(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(e){Te(t)(),e.hide()}}]})};function Fe(){t.add("link",(function(t){Me(t),Pe(t),Ie(t),Le(t),Ee(t),Ne(t),Be(t)}))}Fe()})()},cdd9:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},e.apply(this,arguments)},n=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return function(e){return n(e)===t}},o=function(t){return function(e){return typeof e===t}},i=function(t){return function(e){return t===e}},u=r("string"),a=r("object"),c=r("array"),s=i(null),f=o("boolean"),l=function(t){return null===t||void 0===t},d=function(t){return!l(t)},m=o("function"),g=o("number"),p=function(){},h=function(t){return function(){return t}},v=function(t){return t},b=h(!1),y=h(!0),w=function(){return x},x=function(){var t=function(t){return t()},e=v,n={fold:function(t,e){return t()},isSome:b,isNone:y,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:e,orThunk:t,map:w,each:p,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:h("none()")};return n}(),C=function(t){var e=h(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S=function(t){return null===t||void 0===t?x:C(t)},k={some:C,none:w,from:S},O=Object.keys,T=Object.hasOwnProperty,E=function(t,e){for(var n=O(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},_=function(t){return function(e,n){t[n]=e}},D=function(t,e,n,r){var o={};return E(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},A=function(t,e){var n={};return D(t,e,_(n),p),n},R=function(t,e){return T.call(t,e)},N=function(t,e){return R(t,e)&&void 0!==t[e]&&null!==t[e]},B=Array.prototype.push,M=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},P=function(t,e){return e>=0&&e<t.length?k.some(t[e]):k.none()},I=function(t){return P(t,0)},L=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return k.none()};"undefined"!==typeof window?window:Function("return this;")();var F=function(t,e,n){if(!(u(n)||f(n)||g(n)))throw new Error("Attribute value was not simple");t.setAttribute(e,n+"")},z=function(t,e,n){F(t.dom,e,n)},H=function(t,e){t.dom.removeAttribute(e)},V=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return W(r.childNodes[0])},U=function(t,e){var n=e||document,r=n.createElement(t);return W(r)},j=function(t,e){var n=e||document,r=n.createTextNode(t);return W(r)},W=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},q=function(t,e,n){return k.from(t.dom.elementFromPoint(e,n)).map(W)},$={fromHtml:V,fromTag:U,fromText:j,fromDom:W,fromPoint:q},G=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),K=tinymce.util.Tools.resolve("tinymce.util.Promise"),X=tinymce.util.Tools.resolve("tinymce.util.URI"),Y=tinymce.util.Tools.resolve("tinymce.util.XHR"),J=function(t){return t.getParam("image_dimensions",!0,"boolean")},Q=function(t){return t.getParam("image_advtab",!1,"boolean")},Z=function(t){return t.getParam("image_uploadtab",!0,"boolean")},tt=function(t){return t.getParam("image_prepend_url","","string")},et=function(t){return t.getParam("image_class_list")},nt=function(t){return t.getParam("image_description",!0,"boolean")},rt=function(t){return t.getParam("image_title",!1,"boolean")},ot=function(t){return t.getParam("image_caption",!1,"boolean")},it=function(t){return t.getParam("image_list",!1)},ut=function(t){return d(t.getParam("images_upload_url"))},at=function(t){return d(t.getParam("images_upload_handler"))},ct=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")},st=function(t){return t.getParam("automatic_uploads",!0,"boolean")},ft=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},lt=function(t){return new K((function(e){var n=document.createElement("img"),r=function(t){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t=ft(n.width,n.clientWidth),e=ft(n.height,n.clientHeight),o={width:t,height:e};r(K.resolve(o))},n.onerror=function(){r(K.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))},dt=function(t){return t&&(t=t.replace(/px$/,"")),t},mt=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},gt=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},pt=function(t,e){var n=it(t);u(n)?Y.send({url:n,success:function(t){e(JSON.parse(t))}}):m(n)?n(e):e(n)},ht=function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!J(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r},vt=function(t){return new K((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(){n(r.error.message)},r.readAsDataURL(t)}))},bt=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},yt=function(t,e){return X.isDomSafe(e,"img",t.settings)},wt=G.DOM,xt=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?dt(t.style.marginLeft):""},Ct=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?dt(t.style.marginTop):""},St=function(t){return t.style.borderWidth?dt(t.style.borderWidth):""},kt=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},Ot=function(t,e){return t.style[e]?t.style[e]:""},Tt=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Et=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},_t=function(t){var e=wt.create("figure",{class:"image"});wt.insertAfter(e,t),e.appendChild(t),e.appendChild(wt.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"},Dt=function(t){var e=t.parentNode;wt.insertAfter(t,e),wt.remove(e)},At=function(t){Tt(t)?Dt(t):_t(t)},Rt=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},Nt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=mt(r),Rt(t,e)):Et(t,n,r)}},Bt=function(t,e){return t.style[e]?dt(t.style[e]):kt(t,e)},Mt=function(t,e){var n=mt(e);t.style.marginLeft=n,t.style.marginRight=n},Pt=function(t,e){var n=mt(e);t.style.marginTop=n,t.style.marginBottom=n},It=function(t,e){var n=mt(e);t.style.borderWidth=n},Lt=function(t,e){t.style.borderStyle=e},Ft=function(t){return Ot(t,"borderStyle")},zt=function(t){return"FIGURE"===t.nodeName},Ht=function(t){return"IMG"===t.nodeName},Vt=function(t){return 0===wt.getAttrib(t,"alt").length&&"presentation"===wt.getAttrib(t,"role")},Ut=function(t){return Vt(t)?"":kt(t,"alt")},jt=function(){return{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}},Wt=function(t,e){var n=document.createElement("img");return Et(n,"style",e.style),(xt(n)||""!==e.hspace)&&Mt(n,e.hspace),(Ct(n)||""!==e.vspace)&&Pt(n,e.vspace),(St(n)||""!==e.border)&&It(n,e.border),(Ft(n)||""!==e.borderStyle)&&Lt(n,e.borderStyle),t(n.getAttribute("style"))},qt=function(t,n){var r=document.createElement("img");if(Jt(t,e(e({},n),{caption:!1}),r),Kt(r,n.alt,n.isDecorative),n.caption){var o=wt.create("figure",{class:"image"});return o.appendChild(r),o.appendChild(wt.create("figcaption",{contentEditable:"true"},"Caption")),o.contentEditable="false",o}return r},$t=function(t,e){return{src:kt(e,"src"),alt:Ut(e),title:kt(e,"title"),width:Bt(e,"width"),height:Bt(e,"height"),class:kt(e,"class"),style:t(kt(e,"style")),caption:Tt(e),hspace:xt(e),vspace:Ct(e),border:St(e),borderStyle:Ot(e,"borderStyle"),isDecorative:Vt(e)}},Gt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},Kt=function(t,e,n){if(n){wt.setAttrib(t,"role","presentation");var r=$.fromDom(t);z(r,"alt","")}else{if(s(e)){r=$.fromDom(t);H(r,"alt")}else{r=$.fromDom(t);z(r,"alt",e)}"presentation"===wt.getAttrib(t,"role")&&wt.setAttrib(t,"role","")}},Xt=function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||Kt(t,n.alt,n.isDecorative)},Yt=function(t,e){return function(n,r,o){t(n,o),Rt(n,e)}},Jt=function(t,e,n){var r=$t(t,n);Gt(n,r,e,"caption",(function(t,e,n){return At(t)})),Gt(n,r,e,"src",Et),Gt(n,r,e,"title",Et),Gt(n,r,e,"width",Nt("width",t)),Gt(n,r,e,"height",Nt("height",t)),Gt(n,r,e,"class",Et),Gt(n,r,e,"style",Yt((function(t,e){return Et(t,"style",e)}),t)),Gt(n,r,e,"hspace",Yt(Mt,t)),Gt(n,r,e,"vspace",Yt(Pt,t)),Gt(n,r,e,"border",Yt(It,t)),Gt(n,r,e,"borderStyle",Yt(Lt,t)),Xt(n,r,e)},Qt=function(t,e){var n=t.dom.styles.parse(e),r=gt(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},Zt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||bt(e))?null:e},te=function(t,e){var n=t.dom,r=A(t.schema.getTextBlockElements(),(function(e,n){return!t.schema.isValidChild(n,"figure")})),o=n.getParent(e.parentNode,(function(t){return N(r,t.nodeName)}),t.getBody());return o?n.split(o,e):e},ee=function(t){var e=Zt(t);return e?$t((function(e){return Qt(t,e)}),e):jt()},ne=function(t,e){var n=qt((function(e){return Qt(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),zt(r)){var o=te(t,r);t.selection.select(o)}else t.selection.select(r)},re=function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))},oe=function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}},ie=function(t,e){var n=Zt(t);if(Jt((function(e){return Qt(t,e)}),e,n),re(t,n),zt(n.parentNode)){var r=n.parentNode;te(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),ht(t,e,n)},ue=function(t,n){var r=n.src;return e(e({},n),{src:yt(t,r)?r:""})},ae=function(t,n){var r=Zt(t);if(r){var o=$t((function(e){return Qt(t,e)}),r),i=e(e({},o),n),u=ue(t,i);i.src?ie(t,u):oe(t,r)}else n.src&&ne(t,e(e({},jt()),n))},ce=function(t,e){var n=a(t)&&a(e);return n?fe(t,e):e},se=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)R(i,u)&&(r[u]=t(r[u],i[u]))}return r}},fe=se(ce),le=function(t){return t.length>0},de=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),me=tinymce.util.Tools.resolve("tinymce.util.Tools"),ge=function(t){return u(t.value)?t.value:""},pe=function(t){return u(t.text)?t.text:u(t.title)?t.title:""},he=function(t,e){var n=[];return me.each(t,(function(t){var r=pe(t);if(void 0!==t.menu){var o=he(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},ve=function(t){return void 0===t&&(t=ge),function(e){return e?k.from(e).map((function(e){return he(e,t)})):k.none()}},be=function(t){return ve(ge)(t)},ye=function(t){return R(t,"items")},we=function(t,e){return L(t,(function(t){return ye(t)?we(t.items,e):t.value===e?k.some(t):k.none()}))},xe=function(t,e){return t.bind((function(t){return we(t,e)}))},Ce={sanitizer:ve,sanitize:be,findEntry:xe},Se=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},ke={makeTab:Se},Oe=function(t){var e=Ce.sanitizer((function(e){return t.convertURL(e.value||e.url,"src")})),n=new K((function(n){pt(t,(function(t){n(e(t).map((function(t){return M([[{text:"None",value:""}],t])})))}))})),r=Ce.sanitize(et(t)),o=Q(t),i=Z(t),a=ut(t),c=at(t),s=ee(t),f=nt(t),l=rt(t),d=J(t),m=ot(t),g=ct(t),p=st(t),h=k.some(tt(t)).filter((function(t){return u(t)&&t.length>0}));return n.then((function(t){return{image:s,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:a,hasUploadHandler:c,hasDescription:f,hasImageTitle:l,hasDimensions:d,hasImageCaption:m,prependURL:h,hasAccessibilityOptions:g,automaticUploads:p}}))},Te=function(t){var n={name:"src",type:"urlinput",filetype:"image",label:"Source"},r=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),o={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},i={name:"title",type:"input",label:"Image title"},u={name:"dimensions",type:"sizeinput"},a={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},c=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}})),s={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},f=function(t){return t?{type:"grid",columns:2}:{type:"panel"}};return M([[n],r.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[a]:[],t.hasDescription?[o]:[],t.hasImageTitle?[i]:[],t.hasDimensions?[u]:[],[e(e({},f(t.classList.isSome()&&t.hasImageCaption)),{items:M([c.toArray(),t.hasImageCaption?[s]:[]])})]])},Ee=function(t){return{title:"General",name:"general",items:Te(t)}},_e={makeTab:Ee,makeItems:Te},De=function(t){var e=[{type:"dropzone",name:"fileinput"}];return{title:"Upload",name:"upload",items:e}},Ae={makeTab:De},Re=function(t){return{prevImage:Ce.findEntry(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}},Ne=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},Be=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Me=function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?k.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?k.some(t+e):k.none()}))},Pe=function(t,e){var n=e.getData();Me(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))},Ie=function(t,e,n){t.hasDescription&&u(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&u(n.title)&&(e.title=n.title),t.hasDimensions&&(u(n.width)&&(e.dimensions.width=n.width),u(n.height)&&(e.dimensions.height=n.height)),u(n.class)&&Ce.findEntry(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&f(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(u(n.style)&&(e.style=n.style),u(n.vspace)&&(e.vspace=n.vspace),u(n.border)&&(e.border=n.border),u(n.hspace)&&(e.hspace=n.hspace),u(n.borderstyle)&&(e.borderstyle=n.borderstyle))},Le=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=fe({},n);Ie(t,o,r),e.setData(o)}},Fe=function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||(le(i)?t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})})).catch((function(t){})):r.setData({dimensions:{width:"",height:""}}))},ze=function(t,e,n){var r=n.getData(),o=Ce.findEntry(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})},He=function(t,e,n,r){Pe(e,r),Le(e,r),Fe(t,e,n,r),ze(e,n,r)},Ve=function(t,e,n,r){var o=r.getData(),i=Ce.findEntry(e.imageList,o.images);i.each((function(t){var e=""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1);e?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,He(t,e,n,r)},Ue=function(t){var e=t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"];return e?dt(String(t["margin-top"])):""},je=function(t){var e=t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"];return e?dt(String(t["margin-right"])):""},We=function(t){return t["border-width"]?dt(String(t["border-width"])):""},qe=function(t){return t["border-style"]?String(t["border-style"]):""},$e=function(t,e,n){return e(t(e(n)))},Ge=function(t,e,n){var r=gt(t(n.style)),o=fe({},n);return o.vspace=Ue(r),o.hspace=je(r),o.border=We(r),o.borderstyle=qe(r),o.style=$e(t,e,r),o},Ke=function(t,e){var n=e.getData(),r=Ge(t.parseStyle,t.serializeStyle,n);e.setData(r)},Xe=function(t,e,n){var r=fe(Ne(e.image),n.getData()),o=Wt(t.normalizeCss,Be(r,!1));n.setData({style:o})},Ye=function(t,e,n,r){var o=r.getData();r.block("Uploading image"),I(o.fileinput).fold((function(){r.unblock()}),(function(o){var i=URL.createObjectURL(o),u=function(){r.unblock(),URL.revokeObjectURL(i)},a=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),He(t,e,n,r)};vt(o).then((function(n){var c=t.createBlobCache(o,i,n);e.automaticUploads?t.uploadImage(c).then((function(t){a(t.url),u()})).catch((function(e){u(),t.alertErr(e)})):(t.addToBlobCache(c),a(c.blobUri()),r.unblock())}))}))},Je=function(t,e,n){return function(r,o){"src"===o.name?He(t,e,n,r):"images"===o.name?Ve(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?Ke(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?Xe(t,e,r):"fileinput"===o.name?Ye(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Qe=function(t){return function(){t.open=!1}},Ze=function(t){if(t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler){var e={type:"tabpanel",tabs:M([[_e.makeTab(t)],t.hasAdvTab?[ke.makeTab(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[Ae.makeTab(t)]:[]])};return e}var n={type:"panel",items:_e.makeItems(t)};return n},tn=function(t){return function(e){var n=Re(e);return{title:"Insert/Edit Image",size:"normal",body:Ze(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ne(e.image),onSubmit:t.onSubmit(e),onChange:Je(t,e,n),onClose:Qe(n)}}},en=function(t){return function(e){return function(n){var r=fe(Ne(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Be(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},nn=function(t){return function(e){return yt(t,e)?lt(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}})):K.resolve({width:"",height:""})}},rn=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},on=function(t){return function(e){t.editorUpload.blobCache.add(e)}},un=function(t){return function(e){t.windowManager.alert(e)}},an=function(t){return function(e){return Qt(t,e)}},cn=function(t){return function(e){return t.dom.parseStyle(e)}},sn=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},fn=function(t){return function(e){return de(t).upload([e],!1).then((function(t){return 0===t.length?K.reject("Failed to upload image"):!1===t[0].status?K.reject(t[0].error.message):t[0]}))}},ln=function(t){var e={onSubmit:en(t),imageSize:nn(t),addToBlobCache:on(t),createBlobCache:rn(t),alertErr:un(t),normalizeCss:an(t),parseStyle:cn(t),serializeStyle:sn(t),uploadImage:fn(t)},n=function(){Oe(t).then(tn(e)).then(t.windowManager.open)};return{open:n}},dn=function(t){t.addCommand("mceImage",ln(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return ae(t,n)}))}))},mn=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},gn=function(t){return function(e){var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};while(n--){var o=e[n];mn(o)&&(o.attr("contenteditable",t?"false":null),me.each(o.getAll("figcaption"),r))}}},pn=function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",gn(!0)),t.serializer.addNodeFilter("figure",gn(!1))}))},hn=function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ln(t).open,onSetup:function(e){return e.setActive(d(Zt(t))),t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ln(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return zt(t)||Ht(t)&&!bt(t)?["image"]:[]}})};function vn(){t.add("image",(function(t){pn(t),hn(t),dn(t)}))}vn()})()},e562:function(t,e,n){(function(e){(function(){"use strict";var n=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)},o=function(t,e){var n=Array.prototype.slice.call(t);return n.sort(e)},i=function(t,e){return u((function(n,r){return t.eq(e(n),e(r))}))},u=function(t){return{eq:t}},a=u((function(t,e){return t===e})),c=a,s=function(t){return u((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},f=function(t,e){return i(s(t),(function(t){return o(t,e)}))},l=function(t){return u((function(e,n){var r=Object.keys(e),o=Object.keys(n);if(!f(c).eq(r,o))return!1;for(var i=r.length,u=0;u<i;u++){var a=r[u];if(!t.eq(e[a],n[a]))return!1}return!0}))},d=u((function(t,e){if(t===e)return!0;var o=n(t),i=n(e);return o===i&&(r(o)?t===e:"array"===o?s(d).eq(t,e):"object"===o&&l(d).eq(t,e))})),m=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},g=function(t){return function(e){return m(e)===t}},p=function(t){return function(e){return typeof e===t}},h=function(t){return function(e){return t===e}},v=g("string"),b=g("object"),y=g("array"),w=h(null),x=p("boolean"),C=h(void 0),S=function(t){return null===t||void 0===t},k=function(t){return!S(t)},O=p("function"),T=p("number"),E=function(){},_=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},D=function(t,e){return function(n){return t(e(n))}},A=function(t){return function(){return t}},R=function(t){return t},N=function(t,e){return t===e};function B(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var M=function(t){return function(e){return!t(e)}},P=function(t){return function(){throw new Error(t)}},I=function(t){return t()},L=function(t){t()},F=A(!1),z=A(!0),H=function(){return V},V=function(){var t=function(t){return t()},e=R,n={fold:function(t,e){return t()},isSome:F,isNone:z,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:A(null),getOrUndefined:A(void 0),or:e,orThunk:t,map:H,each:E,bind:H,exists:F,forall:z,filter:function(){return H()},toArray:function(){return[]},toString:A("none()")};return n}(),U=function(t){var e=A(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:z,isNone:F,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return U(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:V},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},j=function(t){return null===t||void 0===t?V:U(t)},W={some:U,none:H,from:j},q=Array.prototype.slice,$=Array.prototype.indexOf,G=Array.prototype.push,K=function(t,e){return $.call(t,e)},X=function(t,e){var n=K(t,e);return-1===n?W.none():W.some(n)},Y=function(t,e){return K(t,e)>-1},J=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return!0}return!1},Q=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},Z=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},tt=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];e(r,n)}},et=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o],a=e(u,o)?n:r;a.push(u)}return{pass:n,fail:r}},nt=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},rt=function(t,e,n){return tt(t,(function(t,r){n=e(n,t,r)})),n},ot=function(t,e,n){return Z(t,(function(t,r){n=e(n,t,r)})),n},it=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return W.some(i);if(n(i,r))break}return W.none()},ut=function(t,e){return it(t,e,F)},at=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return W.some(n)}return W.none()},ct=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!y(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);G.apply(e,t[n])}return e},st=function(t,e){return ct(Q(t,e))},ft=function(t,e){for(var n=0,r=t.length;n<r;++n){var o=t[n];if(!0!==e(o,n))return!1}return!0},lt=function(t){var e=q.call(t,0);return e.reverse(),e},dt=function(t,e){return nt(t,(function(t){return!Y(e,t)}))},mt=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},gt=function(t,e){var n=q.call(t,0);return n.sort(e),n},pt=function(t,e){return e>=0&&e<t.length?W.some(t[e]):W.none()},ht=function(t){return pt(t,0)},vt=function(t){return pt(t,t.length-1)},bt=O(Array.from)?Array.from:function(t){return q.call(t)},yt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return W.none()},wt=Object.keys,xt=Object.hasOwnProperty,Ct=function(t,e){for(var n=wt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},St=function(t,e){return kt(t,(function(t,n){return{k:n,v:e(t,n)}}))},kt=function(t,e){var n={};return Ct(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ot=function(t){return function(e,n){t[n]=e}},Tt=function(t,e,n,r){var o={};return Ct(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},Et=function(t,e){var n={},r={};return Tt(t,e,Ot(n),Ot(r)),{t:n,f:r}},_t=function(t,e){var n={};return Tt(t,e,Ot(n),E),n},Dt=function(t,e){var n=[];return Ct(t,(function(t,r){n.push(e(t,r))})),n},At=function(t){return Dt(t,R)},Rt=function(t,e){return Nt(t,e)?W.from(t[e]):W.none()},Nt=function(t,e){return xt.call(t,e)},Bt=function(t,e){return Nt(t,e)&&void 0!==t[e]&&null!==t[e]},Mt=function(t,e,n){return void 0===n&&(n=d),l(n).eq(t,e)},Pt=Array.isArray,It=function(t){if(Pt(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},Lt=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(Nt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},Ft=function(t,e){var n=[];return Lt(t,(function(r,o){n.push(e(r,o,t))})),n},zt=function(t,e){var n=[];return Lt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},Ht=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},Vt=function(t,e,n,r){for(var o=C(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},Ut=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},jt=function(t){return t[t.length-1]},Wt=function(){return Wt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Wt.apply(this,arguments)};function qt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function $t(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var Gt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Kt=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),l=!s&&!c&&!f;return{isiPad:A(o),isiPhone:A(i),isTablet:A(c),isPhone:A(s),isTouch:A(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:A(f),isDesktop:A(l)}},Xt=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},Yt=function(t,e){var n=Xt(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Zt(r(1),r(2))},Jt=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Qt():Yt(t,n)},Qt=function(){return Zt(0,0)},Zt=function(t,e){return{major:t,minor:e}},te={nu:Zt,detect:Jt,unknown:Qt},ee=function(t,e){return yt(e.brands,(function(e){var n=e.brand.toLowerCase();return ut(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:te.nu(parseInt(e.version,10),0)}}))}))},ne=function(t,e){var n=String(e).toLowerCase();return ut(t,(function(t){return t.search(n)}))},re=function(t,e){return ne(t,e).map((function(t){var n=te.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},oe=function(t,e){return ne(t,e).map((function(t){var n=te.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},ie=function(t,e){return t.substring(e)},ue=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},ae=function(t,e){return se(t,e)?ie(t,e.length):t},ce=function(t,e){return-1!==t.indexOf(e)},se=function(t,e){return ue(t,e,0)},fe=function(t){return function(e){return e.replace(t,"")}},le=fe(/^\s+|\s+$/g),de=fe(/^\s+/g),me=fe(/\s+$/g),ge=function(t){return t.length>0},pe=function(t){return!ge(t)},he=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ve=function(t){return function(e){return ce(e,t)}},be=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ce(t,"edge/")&&ce(t,"chrome")&&ce(t,"safari")&&ce(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,he],search:function(t){return ce(t,"chrome")&&!ce(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ce(t,"msie")||ce(t,"trident")}},{name:"Opera",versionRegexes:[he,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ve("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ve("firefox")},{name:"Safari",versionRegexes:[he,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ce(t,"safari")||ce(t,"mobile/"))&&ce(t,"applewebkit")}}],ye=[{name:"Windows",search:ve("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ce(t,"iphone")||ce(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ve("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ve("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ve("linux"),versionRegexes:[]},{name:"Solaris",search:ve("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ve("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ve("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],we={browsers:A(be),oses:A(ye)},xe="Edge",Ce="Chrome",Se="IE",ke="Opera",Oe="Firefox",Te="Safari",Ee=function(){return _e({current:void 0,version:te.unknown()})},_e=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(xe),isChrome:r(Ce),isIE:r(Se),isOpera:r(ke),isFirefox:r(Oe),isSafari:r(Te)}},De={unknown:Ee,nu:_e,edge:A(xe),chrome:A(Ce),ie:A(Se),opera:A(ke),firefox:A(Oe),safari:A(Te)},Ae="Windows",Re="iOS",Ne="Android",Be="Linux",Me="OSX",Pe="Solaris",Ie="FreeBSD",Le="ChromeOS",Fe=function(){return ze({current:void 0,version:te.unknown()})},ze=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Ae),isiOS:r(Re),isAndroid:r(Ne),isOSX:r(Me),isLinux:r(Be),isSolaris:r(Pe),isFreeBSD:r(Ie),isChromeOS:r(Le)}},He={unknown:Fe,nu:ze,windows:A(Ae),ios:A(Re),android:A(Ne),linux:A(Be),osx:A(Me),solaris:A(Pe),freebsd:A(Ie),chromeos:A(Le)},Ve=function(t,e,n){var r=we.browsers(),o=we.oses(),i=e.bind((function(t){return ee(r,t)})).orThunk((function(){return re(r,t)})).fold(De.unknown,De.nu),u=oe(o,t).fold(He.unknown,He.nu),a=Kt(u,i,t,n);return{browser:i,os:u,deviceType:a}},Ue={detect:Ve},je=function(t){return window.matchMedia(t).matches},We=Gt((function(){return Ue.detect(navigator.userAgent,W.from(navigator.userAgentData),je)})),qe=function(){return We()},$e=navigator.userAgent,Ge=qe(),Ke=Ge.browser,Xe=Ge.os,Ye=Ge.deviceType,Je=/WebKit/.test($e)&&!Ke.isEdge(),Qe="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Ze=-1!==$e.indexOf("Windows Phone"),tn={opera:Ke.isOpera(),webkit:Je,ie:!(!Ke.isIE()&&!Ke.isEdge())&&Ke.version.major,gecko:Ke.isFirefox(),mac:Xe.isOSX()||Xe.isiOS(),iOS:Ye.isiPad()||Ye.isiPhone(),android:Xe.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:Ke.isIE()?document.documentMode||7:10,fileApi:Qe,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!Ke.isIE(),desktop:Ye.isDesktop(),windowsPhone:Ze,browser:{current:Ke.current,version:Ke.version,isChrome:Ke.isChrome,isEdge:Ke.isEdge,isFirefox:Ke.isFirefox,isIE:Ke.isIE,isOpera:Ke.isOpera,isSafari:Ke.isSafari},os:{current:Xe.current,version:Xe.version,isAndroid:Xe.isAndroid,isChromeOS:Xe.isChromeOS,isFreeBSD:Xe.isFreeBSD,isiOS:Xe.isiOS,isLinux:Xe.isLinux,isOSX:Xe.isOSX,isSolaris:Xe.isSolaris,isWindows:Xe.isWindows},deviceType:{isDesktop:Ye.isDesktop,isiPad:Ye.isiPad,isiPhone:Ye.isiPhone,isPhone:Ye.isPhone,isTablet:Ye.isTablet,isTouch:Ye.isTouch,isWebView:Ye.isWebView}},en=/^\s*|\s*$/g,nn=function(t){return null===t||void 0===t?"":(""+t).replace(en,"")},rn=function(t,e){return e?!("array"!==e||!Pt(t))||typeof t===e:void 0!==t},on=function(t,e,n){var r;t=t||[],e=e||",","string"===typeof t&&(t=t.split(e)),n=n||{},r=t.length;while(r--)n[t[r]]={};return n},un=Nt,an=function(t,e,n){var r,o,i,u=this,a=0;t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t);var c=t[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},cn=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(Nt(o,i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},sn=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),Lt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;sn(t,e,n,r)})))},fn=function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)r=t[n],e[r]||(e[r]={}),e=e[r];return e},ln=function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0,r=t.length;n<r;n++)if(e=e[t[n]],!e)break;return e},dn=function(t,e){return!t||rn(t,"array")?t:Ft(t.split(e||","),nn)},mn=function(t){var e=tn.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t},gn={trim:nn,isArray:Pt,is:rn,toArray:It,makeMap:on,each:Lt,map:Ft,grep:zt,inArray:Ht,hasOwn:un,extend:cn,create:an,walk:sn,createNS:fn,resolve:ln,explode:dn,_addCacheSuffix:mn},pn=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return bn(r.childNodes[0])},hn=function(t,e){var n=e||document,r=n.createElement(t);return bn(r)},vn=function(t,e){var n=e||document,r=n.createTextNode(t);return bn(r)},bn=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},yn=function(t,e,n){return W.from(t.dom.elementFromPoint(e,n)).map(bn)},wn={fromHtml:pn,fromTag:hn,fromText:vn,fromDom:bn,fromPoint:yn},xn=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Cn=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},Sn=function(t,e){return Cn(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},kn=8,On=9,Tn=11,En=1,_n=3,Dn=function(t,e){var n=t.dom;if(n.nodeType!==En)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},An=function(t){return t.nodeType!==En&&t.nodeType!==On&&t.nodeType!==Tn||0===t.childElementCount},Rn=function(t,e){var n=void 0===e?document:e.dom;return An(n)?[]:Q(n.querySelectorAll(t),wn.fromDom)},Nn=function(t,e){var n=void 0===e?document:e.dom;return An(n)?W.none():W.from(n.querySelector(t)).map(wn.fromDom)},Bn=function(t,e){return t.dom===e.dom},Mn=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},Pn=function(t,e){return Sn(t.dom,e.dom)},In=function(t,e){return qe().browser.isIE()?Pn(t,e):Mn(t,e)};"undefined"!==typeof window?window:Function("return this;")();var Ln=function(t){var e=t.dom.nodeName;return e.toLowerCase()},Fn=function(t){return t.dom.nodeType},zn=function(t){return function(e){return Fn(e)===t}},Hn=function(t){return Fn(t)===kn||"#comment"===Ln(t)},Vn=zn(En),Un=zn(_n),jn=zn(On),Wn=zn(Tn),qn=function(t){return function(e){return Vn(e)&&Ln(e)===t}},$n=function(t){return wn.fromDom(t.dom.ownerDocument)},Gn=function(t){return jn(t)?t:$n(t)},Kn=function(t){return wn.fromDom(Gn(t).dom.documentElement)},Xn=function(t){return wn.fromDom(Gn(t).dom.defaultView)},Yn=function(t){return W.from(t.dom.parentNode).map(wn.fromDom)},Jn=function(t,e){var n=O(e)?e:F,r=t.dom,o=[];while(null!==r.parentNode&&void 0!==r.parentNode){var i=r.parentNode,u=wn.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},Qn=function(t){var e=function(e){return nt(e,(function(e){return!Bn(t,e)}))};return Yn(t).map(rr).map(e).getOr([])},Zn=function(t){return W.from(t.dom.previousSibling).map(wn.fromDom)},tr=function(t){return W.from(t.dom.nextSibling).map(wn.fromDom)},er=function(t){return lt(xn(t,Zn))},nr=function(t){return xn(t,tr)},rr=function(t){return Q(t.dom.childNodes,wn.fromDom)},or=function(t,e){var n=t.dom.childNodes;return W.from(n[e]).map(wn.fromDom)},ir=function(t){return or(t,0)},ur=function(t){return or(t,t.dom.childNodes.length-1)},ar=function(t){return t.dom.childNodes.length},cr=function(t){var e=t.dom.head;if(null===e||void 0===e)throw new Error("Head is not available yet");return wn.fromDom(e)},sr=function(t){return Wn(t)&&k(t.dom.host)},fr=O(Element.prototype.attachShadow)&&O(Node.prototype.getRootNode),lr=A(fr),dr=fr?function(t){return wn.fromDom(t.dom.getRootNode())}:Gn,mr=function(t){return sr(t)?t:cr(Gn(t))},gr=function(t){var e=dr(t);return sr(e)?W.some(e):W.none()},pr=function(t){return wn.fromDom(t.dom.host)},hr=function(t){if(lr()&&k(t.target)){var e=wn.fromDom(t.target);if(Vn(e)&&vr(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return ht(n)}}return W.from(t.target)},vr=function(t){return k(t.dom.shadowRoot)},br=function(t,e){var n=Yn(t);n.each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},yr=function(t,e){var n=tr(t);n.fold((function(){var n=Yn(t);n.each((function(t){xr(t,e)}))}),(function(t){br(t,e)}))},wr=function(t,e){var n=ir(t);n.fold((function(){xr(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},xr=function(t,e){t.dom.appendChild(e.dom)},Cr=function(t,e){br(t,e),xr(e,t)},Sr=function(t,e){Z(e,(function(e){br(t,e)}))},kr=function(t,e){Z(e,(function(e){xr(t,e)}))},Or=function(t){t.dom.textContent="",Z(rr(t),(function(t){Tr(t)}))},Tr=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Er=function(t){var e=rr(t);e.length>0&&Sr(t,e),Tr(t)},_r=function(t){var e=Un(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return gr(wn.fromDom(e)).fold((function(){return n.body.contains(e)}),D(_r,pr))},Dr=function(t,e){var n=function(n,r){return Dr(t+n,e+r)};return{left:t,top:e,translate:n}},Ar=Dr,Rr=function(t){var e=t.getBoundingClientRect();return Ar(e.left,e.top)},Nr=function(t,e){return void 0!==t?t:void 0!==e?e:0},Br=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Ar(n.offsetLeft,n.offsetTop);var i=Nr(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=Nr(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=Nr(o.clientTop,n.clientTop),c=Nr(o.clientLeft,n.clientLeft);return Mr(t).translate(u-c,i-a)},Mr=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?Ar(r.offsetLeft,r.offsetTop):_r(t)?Rr(e):Ar(0,0)},Pr=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return Ar(n,r)},Ir=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(t,e)},Lr=function(t,e){var n=qe().browser.isSafari();n&&O(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},Fr=function(t){var e=void 0===t?window:t;return qe().browser.isFirefox()?W.none():W.from(e["visualViewport"])},zr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Hr=function(t){var e=void 0===t?window:t,n=e.document,r=Pr(wn.fromDom(n));return Fr(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return zr(r.left,r.top,n,o)}),(function(t){return zr(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Vr=function(t){return function(e){return!!e&&e.nodeType===t}},Ur=function(t){return!!t&&!Object.getPrototypeOf(t)},jr=Vr(1),Wr=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return Y(e,n)}return!1}},qr=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(jr(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null),i=o?o.getPropertyValue(t):null;if(i===n[r])return!0}return!1}},$r=function(t){return function(e){return jr(e)&&e.hasAttribute(t)}},Gr=function(t,e){return function(n){return jr(n)&&n.getAttribute(t)===e}},Kr=function(t){return jr(t)&&t.hasAttribute("data-mce-bogus")},Xr=function(t){return jr(t)&&"all"===t.getAttribute("data-mce-bogus")},Yr=function(t){return jr(t)&&"TABLE"===t.tagName},Jr=function(t){return function(e){if(jr(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Qr=Wr(["textarea","input"]),Zr=Vr(3),to=Vr(8),eo=Vr(9),no=Vr(11),ro=Wr(["br"]),oo=Wr(["img"]),io=Jr("true"),uo=Jr("false"),ao=Wr(["td","th"]),co=Wr(["video","audio","object","embed"]),so=function(t,e,n){return void 0===n&&(n=N),t.exists((function(t){return n(t,e)}))},fo=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},lo=function(t,e,n){return t.isSome()&&e.isSome()?W.some(n(t.getOrDie(),e.getOrDie())):W.none()},mo=function(t,e,n,r){return t.isSome()&&e.isSome()&&n.isSome()?W.some(r(t.getOrDie(),e.getOrDie(),n.getOrDie())):W.none()},go=function(t,e){return t?W.some(e):W.none()},po=function(t){return void 0!==t.style&&O(t.style.getPropertyValue)},ho=function(t,e,n){if(!(v(n)||x(n)||T(n)))throw new Error("Attribute value was not simple");t.setAttribute(e,n+"")},vo=function(t,e,n){ho(t.dom,e,n)},bo=function(t,e){var n=t.dom;Ct(e,(function(t,e){ho(n,e,t)}))},yo=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},wo=function(t,e){return W.from(yo(t,e))},xo=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Co=function(t,e){t.dom.removeAttribute(e)},So=function(t){return ot(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},ko=function(t,e,n){if(!v(n))throw new Error("CSS value must be a string: "+n);po(t)&&t.style.setProperty(e,n)},Oo=function(t,e){var n=t.dom;Ct(e,(function(t,e){ko(n,e,t)}))},To=function(t,e){var n=t.dom,r=window.getComputedStyle(n),o=r.getPropertyValue(e);return""!==o||_r(t)?o:Eo(n,e)},Eo=function(t,e){return po(t)?t.style.getPropertyValue(e):""},_o=function(t,e){var n=t.dom,r=Eo(n,e);return W.from(r).filter((function(t){return t.length>0}))},Do=function(t){var e={},n=t.dom;if(po(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Ao=function(t){return t.dom.offsetWidth},Ro=qe().browser,No=function(t){return ut(t,Vn)},Bo=function(t){return Ro.isFirefox()&&"table"===Ln(t)?No(rr(t)).filter((function(t){return"caption"===Ln(t)})).bind((function(t){return No(nr(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0},Mo=function(t,e){return t.children&&Y(t.children,e)},Po=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===To(wn.fromDom(t),"position")){var u=e.getBoundingClientRect();return r=u.left+(i.documentElement.scrollLeft||t.scrollLeft)-i.documentElement.clientLeft,o=u.top+(i.documentElement.scrollTop||t.scrollTop)-i.documentElement.clientTop,{x:r,y:o}}var a=e;while(a&&a!==n&&a.nodeType&&!Mo(a,n)){var c=a;r+=c.offsetLeft||0,o+=c.offsetTop||0,a=c.offsetParent}a=e.parentNode;while(a&&a!==n&&a.nodeType&&!Mo(a,n))r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;o+=Bo(wn.fromDom(e))}return{x:r,y:o}},Io={},Lo={exports:Io};(function(t,n,r,o){(function(e,o){"object"===typeof n&&"undefined"!==typeof r?r.exports=o():"function"===typeof t&&t.amd?t(o):(e="undefined"!==typeof globalThis?globalThis:e||self,e.EphoxContactWrapper=o())})(this,(function(){var t="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{},n={exports:{}};(function(e){(function(t){var n=setTimeout;function r(){}function o(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function u(t,e){while(3===t._state)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void c(e.promise,o)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===typeof e||"function"===typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"===typeof n)return void l(o(n,e),t)}t._state=1,t._value=e,s(t)}catch(r){c(t,r)}}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(r){if(n)return;n=!0,c(e,r)}}i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return u(this,new f(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"===typeof u||"function"===typeof u)){var a=u.then;if("function"===typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0===--r&&t(e)}catch(c){n(c)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"===typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"===typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!==typeof console&&console},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},e.exports?e.exports=i:t.Promise||(t.Promise=i)})(t)})(n);var r=n.exports,o=function(){return"undefined"!==typeof window?window:Function("return this;")()}(),i={boltExport:o.Promise||r};return i}))})(void 0,Io,Lo);var Fo=Lo.exports.boltExport,zo=function(t){var e=W.none(),n=[],r=function(t){return zo((function(e){o((function(n){e(t(n))}))}))},o=function(t){u()?c(t):n.push(t)},i=function(t){u()||(e=W.some(t),a(n),n=[])},u=function(){return e.isSome()},a=function(t){Z(t,c)},c=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t(i),{get:o,map:r,isReady:u}},Ho=function(t){return zo((function(e){e(t)}))},Vo={nu:zo,pure:Ho},Uo=function(t){setTimeout((function(){throw t}),0)},jo=function(t){var e=function(e){t().then(e,Uo)},n=function(e){return jo((function(){return t().then(e)}))},r=function(e){return jo((function(){return t().then((function(t){return e(t).toPromise()}))}))},o=function(e){return jo((function(){return t().then((function(){return e.toPromise()}))}))},i=function(){return Vo.nu(e)},u=function(){var e=null;return jo((function(){return null===e&&(e=t()),e}))},a=t;return{map:n,bind:r,anonBind:o,toLazy:i,toCached:u,toPromise:a,get:e}},Wo=function(t){return jo((function(){return new Fo(t)}))},qo=function(t){return jo((function(){return Fo.resolve(t)}))},$o={nu:Wo,pure:qo},Go=function(t,e){return e((function(e){var n=[],r=0,o=function(o){return function(i){n[o]=i,r++,r>=t.length&&e(n)}};0===t.length?e([]):Z(t,(function(t,e){t.get(o(e))}))}))},Ko=function(t){return Go(t,$o.nu)},Xo=function(t){var e=function(e){return Xo(t)},n=function(e){return Xo(t)},r=function(e){return Xo(e(t))},o=function(e){return Xo(t)},i=function(e){e(t)},u=function(e){return e(t)},a=function(e,n){return n(t)},c=function(e){return e(t)},s=function(e){return e(t)},f=function(){return W.some(t)};return{isValue:z,isError:F,getOr:A(t),getOrThunk:A(t),getOrDie:A(t),or:e,orThunk:n,fold:a,map:r,mapError:o,each:i,bind:u,exists:c,forall:s,toOptional:f}},Yo=function(t){var e=function(t){return t()},n=function(){return P(String(t))()},r=R,o=function(t){return t()},i=function(e){return Yo(t)},u=function(e){return Yo(e(t))},a=function(e){return Yo(t)},c=function(e,n){return e(t)};return{isValue:F,isError:z,getOr:R,getOrThunk:e,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:u,each:E,bind:a,exists:F,forall:z,toOptional:W.none}},Jo=function(t,e){return t.fold((function(){return Yo(e)}),Xo)},Qo={value:Xo,error:Yo,fromOption:Jo},Zo=function(t){if(!y(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return Z(t,(function(r,o){var i=wt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!y(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+i);var c=function(t){var r=wt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));var o=ft(e,(function(t){return Y(r,t)}));if(!o)throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){}}}})),n},ti={generate:Zo};ti.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var ei=function(t){return t.fold(R,R)};function ni(t,e,n,r,o){return t(n,r)?W.some(n):O(o)&&o(n)?W.none():e(n,r,o)}var ri,oi,ii,ui,ai,ci,si,fi,li,di,mi,gi,pi,hi,vi,bi,yi,wi,xi,Ci=function(t,e,n){var r=t.dom,o=O(n)?n:F;while(r.parentNode){r=r.parentNode;var i=wn.fromDom(r);if(e(i))return W.some(i);if(o(i))break}return W.none()},Si=function(t,e,n){var r=function(t,e){return e(t)};return ni(r,Ci,t,e,n)},ki=function(t,e){var n=t.dom;return n.parentNode?Oi(wn.fromDom(n.parentNode),(function(n){return!Bn(t,n)&&e(n)})):W.none()},Oi=function(t,e){var n=function(t){return e(wn.fromDom(t))},r=ut(t.dom.childNodes,n);return r.map(wn.fromDom)},Ti=function(t,e,n){return Ci(t,(function(t){return Dn(t,e)}),n)},Ei=function(t,e){return Nn(e,t)},_i=function(t,e,n){var r=function(t,e){return Dn(t,e)};return ni(r,Ti,t,e,n)},Di=window.Promise?window.Promise:Fo,Ai=function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=function(t){window.setTimeout(t,0)},i=0;i<r.length&&!n;i++)n=window[r[i]+"RequestAnimationFrame"];n||(n=o),n(t,e)},Ri=function(t,e){return"number"!==typeof e&&(e=0),setTimeout(t,e)},Ni=function(t,e){return"number"!==typeof e&&(e=1),setInterval(t,e)},Bi=function(t){return clearTimeout(t)},Mi=function(t){return clearInterval(t)},Pi=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Ri((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},Ii={requestAnimationFrame:function(t,e){ri?ri.then(t):ri=new Di((function(t){e||(e=document.body),Ai(t,e)})).then(t)},setTimeout:Ri,setInterval:Ni,setEditorTimeout:function(t,e,n){return Ri((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=Ni((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Pi,throttle:Pi,clearInterval:Mi,clearTimeout:Bi},Li=function(t,e){void 0===e&&(e={});var n=0,r={},o=wn.fromDom(t),i=Gn(o),u=e.maxLoadTime||5e3,a=function(t){e.referrerPolicy=t},c=function(t){xr(mr(o),t)},s=function(t){var e=mr(o);Ei(e,"#"+t).each(Tr)},f=function(t){return Rt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))},l=function(n,o,a){var s,l=gn._addCacheSuffix(n),d=f(l);r[l]=d,d.count++;var m=function(t,e){var n=t.length;while(n--)t[n]();d.status=e,d.passed=[],d.failed=[],s&&(s.onload=null,s.onerror=null,s=null)},g=function(){return m(d.passed,2)},p=function(){return m(d.failed,3)},h=function(t,e){t()||(Date.now()-y<u?Ii.setTimeout(e):p())},v=function(){h((function(){var e=t.styleSheets,n=e.length;while(n--){var r=e[n],o=r.ownerNode;if(o&&o.id===s.id)return g(),!0}return!1}),v)};if(o&&d.passed.push(o),a&&d.failed.push(a),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var b=wn.fromTag("link",i.dom);bo(b,{rel:"stylesheet",type:"text/css",id:d.id});var y=Date.now();e.contentCssCors&&vo(b,"crossOrigin","anonymous"),e.referrerPolicy&&vo(b,"referrerpolicy",e.referrerPolicy),s=b.dom,s.onload=v,s.onerror=p,c(b),vo(b,"href",l)}else p();else g()},d=function(t){return $o.nu((function(e){l(t,_(e,A(Qo.value(t))),_(e,A(Qo.error(t))))}))},m=function(t,e,n){Ko(Q(t,d)).get((function(t){var r=et(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(ei)):e(r.pass.map(ei))}))},g=function(t){var e=gn._addCacheSuffix(t);Rt(r,e).each((function(t){var n=--t.count;0===n&&(delete r[e],s(t.id))}))},p=function(t){Z(t,(function(t){g(t)}))};return{load:l,loadAll:m,unload:g,unloadAll:p,_setReferrerPolicy:a}},Fi=function(){var t=new WeakMap,e=function(e,n){var r=dr(e),o=r.dom;return W.from(t.get(o)).getOrThunk((function(){var e=Li(o,n);return t.set(o,e),e}))};return{forElement:e}},zi=Fi(),Hi=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n],o)return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n],o)return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if(i=t.parentNode,i&&i!==this.rootNode)return i}},t}(),Vi=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],Ui=["td","th"],ji=["thead","tbody","tfoot"],Wi=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],qi=["h1","h2","h3","h4","h5","h6"],$i=["li","dd","dt"],Gi=["ul","ol","dl"],Ki=["pre","script","textarea","style"],Xi=function(t){var e;return function(n){return e=e||mt(t,z),Nt(e,Ln(n))}},Yi=Xi(qi),Ji=Xi(Vi),Qi=function(t){return"table"===Ln(t)},Zi=function(t){return Vn(t)&&!Ji(t)},tu=function(t){return Vn(t)&&"br"===Ln(t)},eu=Xi(Wi),nu=Xi(Gi),ru=Xi($i),ou=Xi(ji),iu=Xi(Ui),uu=Xi(Ki),au=function(t,e,n){return Ti(t,e,n).isSome()},cu="\ufeff",su=" ",fu=function(t){return t===cu},lu=function(t){return t.replace(/\uFEFF/g,"")},du=cu,mu=fu,gu=lu,pu=jr,hu=Zr,vu=function(t){return hu(t)&&(t=t.parentNode),pu(t)&&t.hasAttribute("data-mce-caret")},bu=function(t){return hu(t)&&mu(t.data)},yu=function(t){return vu(t)||bu(t)},wu=function(t){return t.firstChild!==t.lastChild||!ro(t.firstChild)},xu=function(t,e){var n=t.ownerDocument,r=n.createTextNode(du),o=t.parentNode;if(e){i=t.previousSibling;if(hu(i)){if(yu(i))return i;if(Eu(i))return i.splitText(i.data.length-1)}o.insertBefore(r,t)}else{var i=t.nextSibling;if(hu(i)){if(yu(i))return i;if(Tu(i))return i.splitText(1),i}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r},Cu=function(t){var e=t.container();return!!Zr(e)&&(e.data.charAt(t.offset())===du||t.isAtStart()&&bu(e.previousSibling))},Su=function(t){var e=t.container();return!!Zr(e)&&(e.data.charAt(t.offset()-1)===du||t.isAtEnd()&&bu(e.nextSibling))},ku=function(){var t=document.createElement("br");return t.setAttribute("data-mce-bogus","1"),t},Ou=function(t,e,n){var r=e.ownerDocument,o=r.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(ku());var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},Tu=function(t){return hu(t)&&t.data[0]===du},Eu=function(t){return hu(t)&&t.data[t.data.length-1]===du},_u=function(t){var e=t.getElementsByTagName("br"),n=e[e.length-1];Kr(n)&&n.parentNode.removeChild(n)},Du=function(t){return t&&t.hasAttribute("data-mce-caret")?(_u(t),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null},Au=function(t){return vu(t.startContainer)},Ru=io,Nu=uo,Bu=ro,Mu=Zr,Pu=Wr(["script","style","textarea"]),Iu=Wr(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Lu=Wr(["table"]),Fu=yu,zu=function(t){return!Fu(t)&&(Mu(t)?!Pu(t.parentNode):Iu(t)||Bu(t)||Lu(t)||Vu(t))},Hu=function(t){return jr(t)&&"true"===t.getAttribute("unselectable")},Vu=function(t){return!1===Hu(t)&&Nu(t)},Uu=function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(Vu(t))return!1;if(Ru(t))return!0}return!0},ju=function(t){return!!Vu(t)&&!0!==ot(bt(t.getElementsByTagName("*")),(function(t,e){return t||Ru(e)}),!1)},Wu=function(t){return Iu(t)||ju(t)},qu=function(t,e){return zu(t)&&Uu(t,e)},$u=/^[ \t\r\n]*$/,Gu=function(t){return $u.test(t)},Ku=function(t,e){var n=wn.fromDom(e),r=wn.fromDom(t);return au(r,"pre,code",B(Bn,n))},Xu=function(t,e){return Zr(t)&&Gu(t.data)&&!1===Ku(t,e)},Yu=function(t){return jr(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))},Ju=function(t,e){return zu(t)&&!1===Xu(t,e)||Yu(t)||Qu(t)},Qu=$r("data-mce-bookmark"),Zu=$r("data-mce-bogus"),ta=Gr("data-mce-bogus","all"),ea=function(t,e){var n=0;if(Ju(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new Hi(r,t);do{if(e){if(ta(r)){r=o.next(!0);continue}if(Zu(r)){r=o.next();continue}}if(ro(r))n++,r=o.next();else{if(Ju(r,t))return!1;r=o.next()}}while(r);return n<=1},na=function(t,e){return void 0===e&&(e=!0),ea(t.dom,e)},ra=function(t){return"span"===t.nodeName.toLowerCase()},oa=function(t,e){return k(t)&&(Ju(t,e)||Zi(wn.fromDom(t)))},ia=function(t,e){var n=new Hi(t,e).prev(!1),r=new Hi(t,e).next(!1),o=C(n)||oa(n,e),i=C(r)||oa(r,e);return o&&i},ua=function(t){return ra(t)&&"bookmark"===t.getAttribute("data-mce-type")},aa=function(t,e){return Zr(t)&&t.data.length>0&&ia(t,e)},ca=function(t){return!!jr(t)&&t.childNodes.length>0},sa=function(t){return no(t)||eo(t)},fa=function(t,e,n){var r=n||e;if(jr(e)&&ua(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)fa(t,o[i],r);if(jr(e)){var u=e.childNodes;1===u.length&&ua(u[0])&&e.parentNode.insertBefore(u[0],e)}return sa(e)||Ju(e,r)||ca(e)||aa(e,r)||t.remove(e),e},la=gn.makeMap,da=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ma=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ga=/[<>&\"\']/g,pa=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,ha={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},va={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},ba={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},ya=function(t){var e=wn.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t},wa=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),va[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},xa=wa("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),Ca=function(t,e){return t.replace(e?da:ma,(function(t){return va[t]||t}))},Sa=function(t){return(""+t).replace(ga,(function(t){return va[t]||t}))},ka=function(t,e){return t.replace(e?da:ma,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":va[t]||"&#"+t.charCodeAt(0)+";"}))},Oa=function(t,e,n){return n=n||xa,t.replace(e?da:ma,(function(t){return va[t]||n[t]||t}))},Ta=function(t,e){var n=wa(e)||xa,r=function(t,e){return t.replace(e?da:ma,(function(t){return void 0!==va[t]?va[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))},o=function(t,e){return Oa(t,e,n)},i=la(t.replace(/\+/g,","));return i.named&&i.numeric?r:i.named?e?o:Oa:i.numeric?ka:Ca},Ea=function(t){return t.replace(pa,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10),e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):ha[e]||String.fromCharCode(e)):ba[t]||xa[t]||ya(t)}))},_a={encodeRaw:Ca,encodeAllRaw:Sa,encodeNumeric:ka,encodeNamed:Oa,getEncodeFunc:Ta,decode:Ea},Da={},Aa={},Ra=gn.makeMap,Na=gn.each,Ba=gn.extend,Ma=gn.explode,Pa=gn.inArray,Ia=function(t,e){return t=gn.trim(t),t?t.split(e||" "):[]},La=function(t,e){var n=Ra(t," ",Ra(t.toUpperCase()," "));return Ba(n,e)},Fa=function(t){return La("td th li dt dd figcaption caption details summary",t.getTextBlockElements())},za=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};r=r||[],n=n||"","string"===typeof r&&(r=Ia(r));var s=Ia(t);o=s.length;while(o--)i=Ia([e,n].join(" ")),u={attributes:c(i),attributesOrder:i,children:c(r,Aa)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=Ia(t);n=u.length;var c=Ia(e);while(n--)for(r=a[u[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return Da[t]?Da[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",u="acronym applet basefont big font strike tt",r=[r,u].join(" "),Na(Ia(u),(function(t){c(t,"",r)})),i="center dir isindex noframes",n=[n,i].join(" "),o=[n,r].join(" "),Na(Ia(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),Na(Ia("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,Da[t]=a,a)},Ha=function(t,e){var n;return t&&(n={},"string"===typeof t&&(t={"*":t}),Na(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Ra(t,/[, ]/):Ma(t,/[, ]/)}))),n},Va=function(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=Ra(o,/[, ]/,Ra(o.toUpperCase(),/[, ]/)):(o=Da[e],o||(o=La(n,r),Da[e]=o)),o};t=t||{};var a=za(t.schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=Ha(t.valid_styles),s=Ha(t.invalid_styles,"map"),f=Ha(t.valid_classes,"map"),l=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),p="td th iframe video audio object script code",h=u("non_empty_elements",p+" pre",m),v=u("move_caret_before_on_enter_elements",p+" table",m),b=u("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=u("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",b),w=u("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp");Na((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=Ia(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n]),a){if(h=a[1],l=a[2],v=a[3],f=a[5],g={},p=[],c={attributes:g,attributesOrder:p},"#"===h&&(c.paddEmpty=!0),"-"===h&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(Ct(b,(function(t,e){g[e]=t})),p.push.apply(p,y)),f)for(f=Ia(f,"|"),i=0,u=f.length;i<u;i++)if(a=S.exec(f[i]),a){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),h=a[3],w=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],p.splice(Pa(p,d),1);continue}h&&("="===h&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===h&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===h&&(s.validValues=Ra(w,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||p.push(d),g[d]=s)}b||"@"!==l||(b=g,y=p),v&&(c.outputName=l,e[v]=c),k.test(l)?(c.pattern=x(l),r.push(c)):e[l]=c}}},S=function(t){e={},r=[],C(t),Na(a,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(Da.text_block_elements=Da.block_elements=null,Na(Ia(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(y[c.toUpperCase()]={},y[c]={}),!e[c]){var s=e[a];s=Ba({},s),delete s.removeEmptyAttrs,delete s.removeEmpty,e[c]=s}Na(n,(function(t,e){t[a]&&(n[e]=t=Ba({},n[e]),t[c]=t[a])}))})))},O=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;Da[t.schema]=null,e&&Na(Ia(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],Na(Ia(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},T=function(t){var n,o=e[t];if(o)return o;n=r.length;while(n--)if(o=r[n],o.pattern.test(t))return o};t.valid_elements?S(t.valid_elements):(Na(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&Na(Ia("strong/b em/i"),(function(t){var n=Ia(t,"/");e[n[1]].outputName=n[0]})),Na(w,(function(n,r){e[r]&&(t.padd_empty_block_inline_children&&(e[r].paddInEmptyBlock=!0),e[r].removeEmpty=!0)})),Na(Ia("ol ul blockquote a table tbody"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),Na(Ia("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),Na(Ia("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),Na({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,n){e[n]&&(e[n].parentsRequired=Ia(t))})),t.invalid_elements&&Na(Ma(t.invalid_elements),(function(t){e[t]&&delete e[t]})),T("span")||C("span[!data-mce-type|*]");var E=A(c),_=A(s),D=A(f),R=A(g),N=A(y),B=A(b),M=A(w),P=A(m),I=A(d),L=A(h),F=A(v),z=A(l),H=A(i),V=function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},U=function(t,e){var n,r,o=T(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns,n){r=n.length;while(r--)if(n[r].pattern.test(t))return!0}}return!1},j=A(o);return{children:n,elements:e,getValidStyles:E,getValidClasses:D,getBlockElements:N,getInvalidStyles:_,getShortEndedElements:P,getTextBlockElements:B,getTextInlineElements:M,getBoolAttrs:R,getElementRule:T,getSelfClosingElements:I,getNonEmptyElements:L,getMoveCaretBeforeOnEnterElements:F,getWhiteSpaceElements:z,getSpecialElements:H,isValidChild:V,isValid:U,getCustomElements:j,addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}},Ua=function(t,e,n,r){var o=function(t){return t=parseInt(t,10).toString(16),t.length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},ja=function(t,e){var n,r,o,i=this,u=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,f={},l=cu;t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var d=("\\\" \\' \\; \\: ; : "+l).split(" ");for(n=0;n<d.length;n++)f[d[n]]=l+n,f[l+n]=d[n];return{toHex:function(t){return t.replace(u,Ua)},parse:function(e){var r,o,d,m,g={},p=t.url_converter,h=t.url_converter_scope||i,v=function(t,e,r){var o=g[t+"-top"+e];if(o){var i=g[t+"-right"+e];if(i){var u=g[t+"-bottom"+e];if(u){var a=g[t+"-left"+e];if(a){var c=[o,i,u,a];n=c.length-1;while(n--)if(c[n]!==c[n+1])break;n>-1&&r||(g[t+e]=-1===n?c[0]:c.join(" "),delete g[t+"-top"+e],delete g[t+"-right"+e],delete g[t+"-bottom"+e],delete g[t+"-left"+e])}}}}},b=function(t){var e,n=g[t];if(n){n=n.split(" "),e=n.length;while(e--)if(n[e]!==n[0])return!1;return g[t]=n[0],!0}},y=function(t,e,n,r){b(e)&&b(n)&&b(r)&&(g[t]=g[e]+" "+g[n]+" "+g[r],delete g[e],delete g[n],delete g[r])},w=function(t){return m=!0,f[t]},x=function(t,e){return m&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return f[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},C=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},S=function(t){return t.replace(/\\[0-9a-f]+/gi,C)},k=function(e,n,r,o,i,u){if(i=i||u,i)return i=x(i),"'"+i.replace(/\'/g,"\\'")+"'";if(n=x(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return p&&(n=p.call(h,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){e=e.replace(/[\u0000-\u001F]/g,""),e=e.replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,w)}));while(r=c.exec(e))if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),d=r[2].replace(s,""),o&&d){if(o=S(o),d=S(d),-1!==o.indexOf(l)||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=d.replace(u,Ua),d=d.replace(a,k),g[o]=m?x(d,!0):d}v("border","",!0),v("border","-width"),v("border","-color"),v("border","-style"),v("padding",""),v("margin",""),y("border","border-width","border-style","border-color"),"medium none"===g.border&&delete g.border,"none"===g["border-image"]&&delete g["border-image"]}return g},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],o=t[e],o&&(n+=(n.length>0?" ":"")+e+": "+o+";")},u=function(t,e){var n=o["*"];return(!n||!n[t])&&(n=o[e],!(n&&n[t]))};return e&&r?(i("*"),i(e)):Ct(t,(function(t,r){!t||o&&!u(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Wa={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},qa=function(t){return t instanceof Event||O(t.initEvent)},$a=function(t){return t.isDefaultPrevented===z||t.isDefaultPrevented===F},Ga=function(t){return S(t.preventDefault)||qa(t)},Ka=function(t,e){var n=null!==e&&void 0!==e?e:{};for(var r in t)Nt(Wa,r)||(n[r]=t[r]);return k(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n},Xa=function(t,e,n,r){var o,i=Ka(e,r);return i.type=t,S(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),Ga(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=z,O(e.preventDefault)?e.preventDefault():qa(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=z,O(e.stopPropagation)?e.stopPropagation():qa(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=z,i.stopPropagation()},$a(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?z:F,i.isPropagationStopped=!0===i.cancelBubble?z:F,i.isImmediatePropagationStopped=F)),i},Ya="mce-data-",Ja=/^(?:mouse|contextmenu)|click/,Qa=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Za=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},tc=function(t){return k(t)&&Ja.test(t.type)},ec=function(t,e){var n=Xa(t.type,t,document,e);if(tc(t)&&C(t.pageX)&&!C(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,u=n;u.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),u.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return C(n.metaKey)&&(n.metaKey=!1),n},nc=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},u=function(){Za(t,"DOMContentLoaded",u),Za(t,"load",u),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};i()?u():Qa(t,"DOMContentLoaded",u),n.domLoaded||Qa(t,"load",u)}},rc=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Ya+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,f,l=this,d=window,m=function(t){l.executeHandlers(ec(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[l.expando]?o=t[l.expando]:(o=l.count++,t[l.expando]=o,l.events[o]={}),r=r||t;var g=e.split(" ");u=g.length;while(u--)a=g[u],s=m,c=f=!1,"DOMContentLoaded"===a&&(a="ready"),l.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,ec({type:a})):(l.hasMouseEnterLeave||(c=l.mouseEnterLeave[a],c&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else while(n&&n!==e)n=n.parentNode;n||(t=ec(t||d.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,l.executeHandlers(t,o))})),l.hasFocusIn||"focusin"!==a&&"focusout"!==a||(f=!0,c="focusin"===a?"focus":"blur",s=function(t){t=ec(t||d.event),t.type="focus"===t.type?"focusin":"focusout",l.executeHandlers(t,o)}),i=l.events[o][a],i?"ready"===a&&l.domLoaded?n(ec({type:a})):i.push({func:n,scope:r}):(l.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=f,i.nativeHandler=s,"ready"===a?nc(t,s,l):Qa(t,c||a,s,f)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");o=s.length;while(o--)if(u=s[o],r=a[u],r){if(n){i=r.length;while(i--)if(r[i].func===n){var f=r.nativeHandler,l=r.fakeName,d=r.capture;r=r.slice(0,i).concat(r.slice(i+1)),r.nativeHandler=f,r.fakeName=l,r.capture=d,a[u]=r}}n&&0!==r.length||(delete a[u],Za(t,r.fakeName||u,r.nativeHandler,r.capture))}}else Ct(a,(function(e,n){Za(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(Nt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(m){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=ec({type:e,target:t},n);do{r=t[this.expando],r&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName){this.unbind(t),n=t.getElementsByTagName("*"),e=n.length;while(e--)t=n[e],t[this.expando]&&this.unbind(t)}return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),oc="sizzle"+-new Date,ic=window.document,uc=0,ac=0,cc=Uc(),sc=Uc(),fc=Uc(),lc=function(t,e){return t===e&&(mi=!0),0},dc="undefined",mc=1<<31,gc={}.hasOwnProperty,pc=[],hc=pc.pop,vc=pc.push,bc=pc.push,yc=pc.slice,wc=pc.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},xc="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",Cc="[\\x20\\t\\r\\n\\f]",Sc="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",kc="\\["+Cc+"*("+Sc+")(?:"+Cc+"*([*^$|!~]?=)"+Cc+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Sc+"))|)"+Cc+"*\\]",Oc=":("+Sc+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+kc+")*)|.*)\\)|)",Tc=new RegExp("^"+Cc+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Cc+"+$","g"),Ec=new RegExp("^"+Cc+"*,"+Cc+"*"),_c=new RegExp("^"+Cc+"*([>+~]|"+Cc+")"+Cc+"*"),Dc=new RegExp("="+Cc+"*([^\\]'\"]*?)"+Cc+"*\\]","g"),Ac=new RegExp(Oc),Rc=new RegExp("^"+Sc+"$"),Nc={ID:new RegExp("^#("+Sc+")"),CLASS:new RegExp("^\\.("+Sc+")"),TAG:new RegExp("^("+Sc+"|[*])"),ATTR:new RegExp("^"+kc),PSEUDO:new RegExp("^"+Oc),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Cc+"*(even|odd|(([+-]|)(\\d*)n|)"+Cc+"*(?:([+-]|)"+Cc+"*(\\d+)|))"+Cc+"*\\)|)","i"),bool:new RegExp("^(?:"+xc+")$","i"),needsContext:new RegExp("^"+Cc+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Cc+"*((?:-\\d)?\\d*)"+Cc+"*\\)|)(?=[^-]|$)","i")},Bc=/^(?:input|select|textarea|button)$/i,Mc=/^h\d$/i,Pc=/^[^{]+\{\s*\[native \w/,Ic=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Lc=/[+~]/,Fc=/'|\\/g,zc=new RegExp("\\\\([\\da-f]{1,6}"+Cc+"?|("+Cc+")|.)","ig"),Hc=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{bc.apply(pc=yc.call(ic.childNodes),ic.childNodes),pc[ic.childNodes.length].nodeType}catch(bV){bc={apply:pc.length?function(t,e){vc.apply(t,yc.call(e))}:function(t,e){var n=t.length,r=0;while(t[n++]=e[r++]);t.length=n-1}}}var Vc=function(t,e,n,r){var o,i,u,a,c,s,f,l,d,m;if((e?e.ownerDocument||e:ic)!==pi&&gi(e),e=e||pi,n=n||[],!t||"string"!==typeof t)return n;if(1!==(a=e.nodeType)&&9!==a)return[];if(vi&&!r){if(o=Ic.exec(t))if(u=o[1]){if(9===a){if(i=e.getElementById(u),!i||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&xi(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return bc.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&oi.getElementsByClassName)return bc.apply(n,e.getElementsByClassName(u)),n}if(oi.qsa&&(!bi||!bi.test(t))){if(l=f=oc,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){s=ci(t),(f=e.getAttribute("id"))?l=f.replace(Fc,"\\$&"):e.setAttribute("id",l),l="[id='"+l+"'] ",c=s.length;while(c--)s[c]=l+Yc(s[c]);d=Lc.test(t)&&Kc(e.parentNode)||e,m=s.join(",")}if(m)try{return bc.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{f||e.removeAttribute("id")}}}return fi(t.replace(Tc,"$1"),e,n,r)};function Uc(){var t=[];function e(n,r){return t.push(n+" ")>ii.cacheLength&&delete e[t.shift()],e[n+" "]=r}return e}function jc(t){return t[oc]=!0,t}function Wc(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||mc)-(~t.sourceIndex||mc);if(r)return r;if(n)while(n=n.nextSibling)if(n===e)return-1;return t?1:-1}function qc(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function $c(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function Gc(t){return jc((function(e){return e=+e,jc((function(n,r){var o,i=t([],n.length,e),u=i.length;while(u--)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function Kc(t){return t&&typeof t.getElementsByTagName!==dc&&t}function Xc(){}function Yc(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Jc(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=ac++;return e.first?function(e,n,i){while(e=e[r])if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[uc,i];if(u){while(e=e[r])if((1===e.nodeType||o)&&t(e,n,u))return!0}else while(e=e[r])if(1===e.nodeType||o){if(c=e[oc]||(e[oc]={}),(a=c[r])&&a[0]===uc&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function Qc(t){return t.length>1?function(e,n,r){var o=t.length;while(o--)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Zc(t,e,n){for(var r=0,o=e.length;r<o;r++)Vc(t,e[r],n);return n}function ts(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function es(t,e,n,r,o,i){return r&&!r[oc]&&(r=es(r)),o&&!o[oc]&&(o=es(o,i)),jc((function(i,u,a,c){var s,f,l,d=[],m=[],g=u.length,p=i||Zc(e||"*",a.nodeType?[a]:a,[]),h=!t||!i&&e?p:ts(p,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:h;if(n&&n(h,v,a,c),r){s=ts(v,m),r(s,[],a,c),f=s.length;while(f--)(l=s[f])&&(v[m[f]]=!(h[m[f]]=l))}if(i){if(o||t){if(o){s=[],f=v.length;while(f--)(l=v[f])&&s.push(h[f]=l);o(null,v=[],s,c)}f=v.length;while(f--)(l=v[f])&&(s=o?wc.call(i,l):d[f])>-1&&(i[s]=!(u[s]=l))}}else v=ts(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):bc.apply(u,v)}))}function ns(t){for(var e,n,r,o=t.length,i=ii.relative[t[0].type],u=i||ii.relative[" "],a=i?1:0,c=Jc((function(t){return t===e}),u,!0),s=Jc((function(t){return wc.call(e,t)>-1}),u,!0),f=[function(t,n,r){var o=!i&&(r||n!==li)||((e=n).nodeType?c(t,n,r):s(t,n,r));return e=null,o}];a<o;a++)if(n=ii.relative[t[a].type])f=[Jc(Qc(f),n)];else{if(n=ii.filter[t[a].type].apply(null,t[a].matches),n[oc]){for(r=++a;r<o;r++)if(ii.relative[t[r].type])break;return es(a>1&&Qc(f),a>1&&Yc(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(Tc,"$1"),n,a<r&&ns(t.slice(a,r)),r<o&&ns(t=t.slice(r)),r<o&&Yc(t))}f.push(n)}return Qc(f)}function rs(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,f,l,d=0,m="0",g=o&&[],p=[],h=li,v=o||r&&ii.find.TAG("*",c),b=uc+=null==h?1:Math.random()||.1,y=v.length;for(c&&(li=i!==pi&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){f=0;while(l=t[f++])if(l(s,i,u)){a.push(s);break}c&&(uc=b)}n&&((s=!l&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){f=0;while(l=e[f++])l(g,p,i,u);if(o){if(d>0)while(m--)g[m]||p[m]||(p[m]=hc.call(a));p=ts(p)}bc.apply(a,p),c&&!o&&p.length>0&&d+e.length>1&&Vc.uniqueSort(a)}return c&&(uc=b,li=h),g};return n?jc(o):o}oi=Vc.support={},ai=Vc.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},gi=Vc.setDocument=function(t){var e,n=t?t.ownerDocument||t:ic,r=n.defaultView;function o(t){try{return t.top}catch(e){}return null}return n!==pi&&9===n.nodeType&&n.documentElement?(pi=n,hi=n.documentElement,vi=!ai(n),r&&r!==o(r)&&(r.addEventListener?r.addEventListener("unload",(function(){gi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){gi()}))),oi.attributes=!0,oi.getElementsByTagName=!0,oi.getElementsByClassName=Pc.test(n.getElementsByClassName),oi.getById=!0,ii.find.ID=function(t,e){if(typeof e.getElementById!==dc&&vi){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},ii.filter.ID=function(t){var e=t.replace(zc,Hc);return function(t){return t.getAttribute("id")===e}},ii.find.TAG=oi.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==dc)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){while(n=i[o++])1===n.nodeType&&r.push(n);return r}return i},ii.find.CLASS=oi.getElementsByClassName&&function(t,e){if(vi)return e.getElementsByClassName(t)},yi=[],bi=[],oi.disconnectedMatch=!0,bi=bi.length&&new RegExp(bi.join("|")),yi=yi.length&&new RegExp(yi.join("|")),e=Pc.test(hi.compareDocumentPosition),xi=e||Pc.test(hi.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)while(e=e.parentNode)if(e===t)return!0;return!1},lc=e?function(t,e){if(t===e)return mi=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&r||!oi.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===ic&&xi(ic,t)?-1:e===n||e.ownerDocument===ic&&xi(ic,e)?1:di?wc.call(di,t)-wc.call(di,e):0:4&r?-1:1)}:function(t,e){if(t===e)return mi=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:di?wc.call(di,t)-wc.call(di,e):0;if(i===u)return Wc(t,e);r=t;while(r=r.parentNode)a.unshift(r);r=e;while(r=r.parentNode)c.unshift(r);while(a[o]===c[o])o++;return o?Wc(a[o],c[o]):a[o]===ic?-1:c[o]===ic?1:0},n):pi},Vc.matches=function(t,e){return Vc(t,null,null,e)},Vc.matchesSelector=function(t,e){if((t.ownerDocument||t)!==pi&&gi(t),e=e.replace(Dc,"='$1']"),oi.matchesSelector&&vi&&(!yi||!yi.test(e))&&(!bi||!bi.test(e)))try{var n=wi.call(t,e);if(n||oi.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(bV){}return Vc(e,pi,null,[t]).length>0},Vc.contains=function(t,e){return(t.ownerDocument||t)!==pi&&gi(t),xi(t,e)},Vc.attr=function(t,e){(t.ownerDocument||t)!==pi&&gi(t);var n=ii.attrHandle[e.toLowerCase()],r=n&&gc.call(ii.attrHandle,e.toLowerCase())?n(t,e,!vi):void 0;return void 0!==r?r:oi.attributes||!vi?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},Vc.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},Vc.uniqueSort=function(t){var e,n=[],r=0,o=0;if(mi=!oi.detectDuplicates,di=!oi.sortStable&&t.slice(0),t.sort(lc),mi){while(e=t[o++])e===t[o]&&(r=n.push(o));while(r--)t.splice(n[r],1)}return di=null,t},ui=Vc.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"===typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=ui(t)}else if(3===o||4===o)return t.nodeValue}else while(e=t[r++])n+=ui(e);return n},ii=Vc.selectors={cacheLength:50,createPseudo:jc,match:Nc,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(zc,Hc),t[3]=(t[3]||t[4]||t[5]||"").replace(zc,Hc),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Vc.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Vc.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Nc.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Ac.test(n)&&(e=ci(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(zc,Hc).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=cc[t+" "];return e||(e=new RegExp("(^|"+Cc+")"+t+"("+Cc+"|$)"))&&cc(t,(function(t){return e.test("string"===typeof t.className&&t.className||typeof t.getAttribute!==dc&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=Vc.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,f,l,d,m,g,p=i!==u?"nextSibling":"previousSibling",h=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(h){if(i){while(p){l=e;while(l=l[p])if(a?l.nodeName.toLowerCase()===v:1===l.nodeType)return!1;g=p="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?h.firstChild:h.lastChild],u&&b){f=h[oc]||(h[oc]={}),s=f[t]||[],m=s[0]===uc&&s[1],d=s[0]===uc&&s[2],l=m&&h.childNodes[m];while(l=++m&&l&&l[p]||(d=m=0)||g.pop())if(1===l.nodeType&&++d&&l===e){f[t]=[uc,m,d];break}}else if(b&&(s=(e[oc]||(e[oc]={}))[t])&&s[0]===uc)d=s[1];else while(l=++m&&l&&l[p]||(d=m=0)||g.pop())if((a?l.nodeName.toLowerCase()===v:1===l.nodeType)&&++d&&(b&&((l[oc]||(l[oc]={}))[t]=[uc,d]),l===e))break;return d-=o,d===r||d%r===0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=ii.pseudos[t]||ii.setFilters[t.toLowerCase()]||Vc.error("unsupported pseudo: "+t);return r[oc]?r(e):r.length>1?(n=[t,t,"",e],ii.setFilters.hasOwnProperty(t.toLowerCase())?jc((function(t,n){var o,i=r(t,e),u=i.length;while(u--)o=wc.call(t,i[u]),t[o]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:jc((function(t){var e=[],n=[],r=si(t.replace(Tc,"$1"));return r[oc]?jc((function(t,e,n,o){var i,u=r(t,null,o,[]),a=t.length;while(a--)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:jc((function(t){return function(e){return Vc(t,e).length>0}})),contains:jc((function(t){return t=t.replace(zc,Hc),function(e){return(e.textContent||e.innerText||ui(e)).indexOf(t)>-1}})),lang:jc((function(t){return Rc.test(t||"")||Vc.error("unsupported lang: "+t),t=t.replace(zc,Hc).toLowerCase(),function(e){var n;do{if(n=vi?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===hi},focus:function(t){return t===pi.activeElement&&(!pi.hasFocus||pi.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!ii.pseudos.empty(t)},header:function(t){return Mc.test(t.nodeName)},input:function(t){return Bc.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Gc((function(){return[0]})),last:Gc((function(t,e){return[e-1]})),eq:Gc((function(t,e,n){return[n<0?n+e:n]})),even:Gc((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:Gc((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:Gc((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:Gc((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}},ii.pseudos.nth=ii.pseudos.eq,Z(["radio","checkbox","file","password","image"],(function(t){ii.pseudos[t]=qc(t)})),Z(["submit","reset"],(function(t){ii.pseudos[t]=$c(t)})),Xc.prototype=ii.filters=ii.pseudos,ii.setFilters=new Xc,ci=Vc.tokenize=function(t,e){var n,r,o,i,u,a,c,s=sc[t+" "];if(s)return e?0:s.slice(0);u=t,a=[],c=ii.preFilter;while(u){for(i in n&&!(r=Ec.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=_c.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Tc," ")}),u=u.slice(n.length)),ii.filter)ii.filter.hasOwnProperty(i)&&(!(r=Nc[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?Vc.error(t):sc(t,a).slice(0)},si=Vc.compile=function(t,e){var n,r=[],o=[],i=fc[t+" "];if(!i){e||(e=ci(t)),n=e.length;while(n--)i=ns(e[n]),i[oc]?r.push(i):o.push(i);i=fc(t,rs(o,r)),i.selector=t}return i},fi=Vc.select=function(t,e,n,r){var o,i,u,a,c,s="function"===typeof t&&t,f=!r&&ci(t=s.selector||t);if(n=n||[],1===f.length){if(i=f[0]=f[0].slice(0),i.length>2&&"ID"===(u=i[0]).type&&oi.getById&&9===e.nodeType&&vi&&ii.relative[i[1].type]){if(e=(ii.find.ID(u.matches[0].replace(zc,Hc),e)||[])[0],!e)return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}o=Nc.needsContext.test(t)?0:i.length;while(o--){if(u=i[o],ii.relative[a=u.type])break;if((c=ii.find[a])&&(r=c(u.matches[0].replace(zc,Hc),Lc.test(i[0].type)&&Kc(e.parentNode)||e))){if(i.splice(o,1),t=r.length&&Yc(i),!t)return bc.apply(n,r),n;break}}}return(s||si(t,f))(r,e,!vi,n,Lc.test(t)&&Kc(e.parentNode)||e),n},oi.sortStable=oc.split("").sort(lc).join("")===oc,oi.detectDuplicates=!!mi,gi(),oi.sortDetached=!0;var os=document,is=Array.prototype.push,us=Array.prototype.slice,as=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,cs=rc.Event,ss=gn.makeMap("children,contents,next,prev"),fs=function(t){return"undefined"!==typeof t},ls=function(t){return"string"===typeof t},ds=function(t){return t&&t===t.window},ms=function(t,e){e=e||os;var n,r=e.createElement("div"),o=e.createDocumentFragment();r.innerHTML=t;while(n=r.firstChild)o.appendChild(n);return o},gs=function(t,e,n,r){var o;if(ls(e))e=ms(e,Ds(t[0]));else if(e.length&&!e.nodeType){if(e=Bs.makeArray(e),r)for(o=e.length-1;o>=0;o--)gs(t,e[o],n,r);else for(o=0;o<e.length;o++)gs(t,e[o],n,r);return t}if(e.nodeType){o=t.length;while(o--)n.call(t[o],e)}return t},ps=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},hs=function(t,e,n){var r,o;return e=Bs(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},vs=gn.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),bs=gn.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ys={for:"htmlFor",class:"className",readonly:"readOnly"},ws={float:"cssFloat"},xs={},Cs={},Ss=function(t,e){return new Bs.fn.init(t,e)},ks=function(t,e){var n;if(e.indexOf)return e.indexOf(t);n=e.length;while(n--)if(e[n]===t)return n;return-1},Os=/^\s*|\s*$/g,Ts=function(t){return null===t||void 0===t?"":(""+t).replace(Os,"")},Es=function(t,e){var n,r,o,i;if(t)if(n=t.length,void 0===n){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n;o++)if(i=t[o],!1===e.call(i,o,i))break;return t},_s=function(t,e){var n=[];return Es(t,(function(t,r){e(r,t)&&n.push(r)})),n},Ds=function(t){return t?9===t.nodeType?t:t.ownerDocument:os};Ss.fn=Ss.prototype={constructor:Ss,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return Bs(t).attr(e);o.context=e=document}if(ls(t)){if(o.selector=t,n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:as.exec(t),!n)return Bs(e).find(t);if(n[1]){r=ms(t,Ds(e)).firstChild;while(r)is.call(o,r),r=r.nextSibling}else{if(r=Ds(e).getElementById(n[2]),!r)return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return gn.toArray(this)},add:function(t,e){var n,r,o=this;if(ls(t))return o.add(Bs(t));if(!1!==e)for(n=Bs.unique(o.toArray().concat(Bs.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else is.apply(o,Bs.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"===typeof t)Es(t,(function(t,e){r.attr(t,e)}));else{if(!fs(e)){if(r[0]&&1===r[0].nodeType){if(n=xs[t],n&&n.get)return n.get(r[0],t);if(bs[t])return r.prop(t)?t:void 0;e=r[0].getAttribute(t,2),null===e&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if(n=xs[t],n&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if(t=ys[t]||t,"object"===typeof t)Es(t,(function(t,e){n.prop(t,e)}));else{if(!fs(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"===typeof t)Es(t,(function(t,e){o.css(t,e)}));else if(fs(e))t=i(t),"number"!==typeof e||vs[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if(r=Cs[t],r&&r.set)r.set(this,e);else{try{this.style[ws[t]||t]=e}catch(o){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],r=Cs[t],r&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(a){return}}return o},remove:function(){var t,e=this,n=this.length;while(n--)t=e[n],cs.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){var t,e=this,n=this.length;while(n--){t=e[n];while(t.firstChild)t.removeChild(t.firstChild)}return this},html:function(t){var e,n=this;if(fs(t)){e=n.length;try{while(e--)n[e].innerHTML=t}catch(r){Bs(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(fs(t)){e=n.length;while(e--)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return gs(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return gs(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?gs(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?gs(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Bs(t).append(this),this},prependTo:function(t){return Bs(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return hs(this,t)},wrapAll:function(t){return hs(this,t,!0)},wrapInner:function(t){return this.each((function(){Bs(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Bs(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Bs(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!==typeof t||(-1!==t.indexOf(" ")?Es(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=ps(r,t);if(o!==e){var i=r.className;o?r.className=Ts((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return ps(this[0],t)},each:function(t){return Es(this,t)},on:function(t,e){return this.each((function(){cs.bind(this,t,e)}))},off:function(t,e){return this.each((function(){cs.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"===typeof t?cs.fire(this,t.type,t):cs.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Bs(us.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Bs.find(t,this[e],r);return Bs(r)},filter:function(t){return Bs("function"===typeof t?_s(this.toArray(),(function(e,n){return t(n,e)})):Bs.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Bs&&(t=t[0]),this.each((function(n,r){while(r){if("string"===typeof t&&Bs(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Bs(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):(e=this[0],e&&(n=e.ownerDocument,r=n.documentElement,e.getBoundingClientRect&&(o=e.getBoundingClientRect(),i=o.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:is,sort:Array.prototype.sort,splice:Array.prototype.splice},gn.extend(Ss,{extend:gn.extend,makeArray:function(t){return ds(t)||t.nodeType?[t]:gn.toArray(t)},inArray:ks,isArray:gn.isArray,each:Es,trim:Ts,grep:_s,find:Vc,expr:Vc.selectors,unique:Vc.uniqueSort,text:Vc.getText,contains:Vc.contains,filter:function(t,e,n){var r=e.length;n&&(t=":not("+t+")");while(r--)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?Bs.find.matchesSelector(e[0],t)?[e[0]]:[]:Bs.find.matches(t,e),e}});var As=function(t,e,n){var r=[],o=t[e];"string"!==typeof n&&n instanceof Bs&&(n=n[0]);while(o&&9!==o.nodeType){if(void 0!==n){if(o===n)break;if("string"===typeof n&&Bs(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},Rs=function(t,e,n,r){var o=[];for(r instanceof Bs&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"===typeof r&&Bs(t).is(r))break}o.push(t)}return o},Ns=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Es({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return As(t,"parentNode")},next:function(t){return Ns(t,"nextSibling",1)},prev:function(t){return Ns(t,"previousSibling",1)},children:function(t){return Rs(t.firstChild,"nextSibling",1)},contents:function(t){return gn.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Ss.fn[t]=function(n){var r=this,o=[];r.each((function(){var t=e.call(o,this,n,o);t&&(Bs.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(ss[t]||(o=Bs.unique(o)),0===t.indexOf("parents")&&(o=o.reverse()));var i=Bs(o);return n?i.filter(n):i}})),Es({parentsUntil:function(t,e){return As(t,"parentNode",e)},nextUntil:function(t,e){return Rs(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return Rs(t,"previousSibling",1,e).slice(1)}},(function(t,e){Ss.fn[t]=function(n,r){var o=this,i=[];o.each((function(){var t=e.call(i,this,n,i);t&&(Bs.isArray(t)?i.push.apply(i,t):i.push(t))})),this.length>1&&(i=Bs.unique(i),0!==t.indexOf("parents")&&"prevUntil"!==t||(i=i.reverse()));var u=Bs(i);return r?u.filter(r):u}})),Ss.fn.is=function(t){return!!t&&this.filter(t).length>0},Ss.fn.init.prototype=Ss.fn,Ss.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Bs.extend(n,this),n},Ss.attrHooks=xs,Ss.cssHooks=Cs;var Bs=Ss,Ms=gn.each,Ps=gn.grep,Is=tn.ie,Ls=/^([a-z0-9],?)+$/i,Fs=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&null!==r&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!==typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"===typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return n=t.serialize(t.parse(n),e[0].nodeName),n}}};return r&&(i.href=i.src=o),i},zs=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},Hs=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},Vs=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,u=!0,a=!0,c=zi.forElement(wn.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),s=[],f=e.schema?e.schema:Va({}),l=ja({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new rc:rc.Event,m=f.getBlockElements(),g=Bs.overrideDefaults((function(){return{context:t,element:Rt.getRoot()}})),p=function(t){if("string"===typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},h=function(e){return e&&t&&v(e)?t.getElementById(e):e},b=function(t){return g("string"===typeof t?h(t):t)},y=function(t,e,n){var r,o,i=b(t);return i.length&&(r=Nt[e],o=r&&r.get?r.get(i,e):i.attr(e)),"undefined"===typeof o&&(o=n||""),o},w=function(t){var e=h(t);return e?e.attributes:[]},x=function(t,n,r){""===r&&(r=null);var o=b(t),i=o.attr(n);if(o.length){var u=Nt[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},C=function(e,n){if(!Is||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return Ms(w(e),(function(t){x(r,t.nodeName,y(e,t.nodeName))})),r},k=function(){return e.root_element||t.body},O=function(t){var e=Hr(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},T=function(e,n){return Po(t.body,h(e),n)},_=function(t,n,r){var o=v(n)?b(t).css(n,r):b(t).css(n);e.update_styles&&zs(l,o)},D=function(t,n){var r=b(t).css(n);e.update_styles&&zs(l,r)},R=function(t,e,n){var r=b(t);return n?r.css(e):(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})),"float"===e&&(e=tn.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},N=function(t){var e,n;return t=h(t),e=R(t,"width"),n=R(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},B=function(t){t=h(t);var e=T(t),n=N(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},M=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Ls.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return Vc(e,i[0].ownerDocument||i[0],null,i).length>0},P=function(t,e,n,r){var o,i=[],u=h(t);r=void 0===r,n=n||("BODY"!==k().nodeName?k().parentNode:null),gn.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return M(t,o)});while(u){if(u===n||S(u.nodeType)||eo(u)||no(u))break;if(!e||"function"===typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},I=function(t,e,n){var r=P(t,e,n,!1);return r&&r.length>0?r[0]:null},L=function(t,e,n){var r=e;if(t)for("string"===typeof e&&(r=function(t){return M(t,e)}),t=t[n];t;t=t[n])if("function"===typeof r&&r(t))return t;return null},F=function(t,e){return L(t,e,"nextSibling")},z=function(t,e){return L(t,e,"previousSibling")},H=function(n,r){return Vc(n,h(r)||e.root_element||t,[])},V=function(t,e,n){var r,o="string"===typeof t?h(t):t;if(!o)return!1;if(gn.isArray(o)&&(o.length||0===o.length))return r=[],Ms(o,(function(t,o){t&&r.push(e.call(n,"string"===typeof t?h(t):t,o))})),r;var i=n||this;return e.call(i,o)},U=function(t,e){b(t).each((function(t,n){Ms(e,(function(t,e){x(n,e,t)}))}))},j=function(t,e){var n=b(t);Is?n.each((function(t,n){if(!1!==n.canHaveHTML){while(n.firstChild)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(r){Bs("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},W=function(e,n,r,o,i){return V(e,(function(e){var u="string"===typeof n?t.createElement(n):n;return U(u,r),o&&("string"!==typeof o&&o.nodeType?u.appendChild(o):"string"===typeof o&&j(u,o)),i?u:e.appendChild(u)}))},q=function(e,n,r){return W(t.createElement(e),e,n,r,!0)},$=_a.decode,G=_a.encodeAllRaw,K=function(t,e,n){var r,o="";for(r in o+="<"+t,e)Bt(e,r)&&(o+=" "+r+'="'+G(e[r])+'"');return"undefined"!==typeof n?o+">"+n+"</"+t+">":o+" />"},X=function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();o.appendChild(r),e&&(r.innerHTML=e);while(n=r.firstChild)o.appendChild(n);return o.removeChild(r),o},Y=function(t,e){var n=b(t);return e?n.each((function(){var t;while(t=this.firstChild)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},J=function(t){return V(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},Q=function(t){return l.parse(t)},tt=function(t,e){return l.serialize(t,e)},et=function(e){var r,o;if(Rt!==Vs.DOM&&t===document){if(n[e])return;n[e]=!0}o=t.getElementById("mceDefaultStyles"),o||(o=t.createElement("style"),o.id="mceDefaultStyles",o.type="text/css",r=t.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},nt=function(t){t||(t=""),Z(t.split(","),(function(t){o[t]=!0,c.load(t,E)}))},rt=function(t,e,n){b(t).toggleClass(e,n).each((function(){""===this.className&&Bs(this).attr("class",null)}))},ot=function(t,e){b(t).addClass(e)},it=function(t,e){rt(t,e,!1)},ut=function(t,e){return b(t).hasClass(e)},at=function(t){b(t).show()},ct=function(t){b(t).hide()},st=function(t){return"none"===b(t).css("display")},ft=function(t){return(t||"mce_")+i++},lt=function(t){var e="string"===typeof t?h(t):t;return jr(e)?e.outerHTML:Bs("<div></div>").append(Bs(e).clone()).html()},dt=function(t,e){b(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}Y(Bs(this).html(e),!0)}))},mt=function(t,e){var n=h(e);return V(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},gt=function(t,e,n){return V(e,(function(e){return gn.is(e,"array")&&(t=t.cloneNode(!0)),n&&Ms(Ps(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},pt=function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=q(e),Ms(w(t),(function(e){x(n,e.nodeName,y(t,e.nodeName))})),gt(n,t,!0)),n||t},ht=function(t,e){var n,r=t;while(r){n=e;while(n&&r!==n)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},vt=function(t){return l.toHex(gn.trim(t))},bt=function(t){if(jr(t)){var e="a"===t.nodeName.toLowerCase()&&!y(t,"href")&&y(t,"id");if(y(t,"name")||y(t,"data-mce-bookmark")||e)return!0}return!1},yt=function(t,e){var n,r,o=0;if(bt(t))return!1;if(t=t.firstChild,t){var i=new Hi(t,t.parentNode),u=f?f.getWhiteSpaceElements():{};e=e||(f?f.getNonEmptyElements():null);do{if(n=t.nodeType,jr(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(bt(t))return!1}if(8===n)return!1;if(3===n&&!Gu(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&Gu(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},wt=function(){return t.createRange()},xt=function(t,e,n){var r,o,i,u=wt();if(t&&e)return u.setStart(t.parentNode,Hs(t)),u.setEnd(e.parentNode,Hs(e)),r=u.extractContents(),u=wt(),u.setStart(e.parentNode,Hs(e)+1),u.setEnd(t.parentNode,Hs(t)+1),o=u.extractContents(),i=t.parentNode,i.insertBefore(fa(Rt,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(fa(Rt,o),t),Y(t),n||e},St=function(n,o,i,u){if(gn.isArray(n)){var a=n.length,c=[];while(a--)c[a]=St(n[a],o,i,u);return c}!e.collect||n!==t&&n!==r||s.push([n,o,i,u]);var f=d.bind(n,o,i,u||Rt);return f},kt=function(e,n,o){if(gn.isArray(e)){var i=e.length,u=[];while(i--)u[i]=kt(e[i],n,o);return u}if(s.length>0&&(e===t||e===r)){i=s.length;while(i--){var a=s[i];e!==a[0]||n&&n!==a[1]||o&&o!==a[2]||d.unbind(a[0],a[1],a[2])}}return d.unbind(e,n,o)},Ot=function(t,e,n){return d.fire(t,e,n)},Tt=function(t){if(t&&jr(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},Et=function(t){for(var e=k(),n=null;t&&t!==e;t=t.parentNode)if(n=Tt(t),null!==n)break;return n},_t=function(){if(s.length>0){var t=s.length;while(t--){var e=s[t];d.unbind(e[0],e[1],e[2])}}Ct(o,(function(t,e){c.unload(e),delete o[e]})),Vc.setDocument&&Vc.setDocument()},Dt=function(t,e){if(Is){while(t){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},At=function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset},Rt={doc:t,settings:e,win:r,files:o,stdMode:u,boxModel:a,styleSheetLoader:c,boundEvents:s,styles:l,schema:f,events:d,isBlock:p,$:g,$$:b,root:null,clone:C,getRoot:k,getViewPort:O,getRect:B,getSize:N,getParent:I,getParents:P,get:h,getNext:F,getPrev:z,select:H,is:M,add:W,create:q,createHTML:K,createFragment:X,remove:Y,setStyle:_,getStyle:R,setStyles:D,removeAllAttribs:J,setAttrib:x,setAttribs:U,getAttrib:y,getPos:T,parseStyle:Q,serializeStyle:tt,addStyle:et,loadCSS:nt,addClass:ot,removeClass:it,hasClass:ut,toggleClass:rt,show:at,hide:ct,isHidden:st,uniqueId:ft,setHTML:j,getOuterHTML:lt,setOuterHTML:dt,decode:$,encode:G,insertAfter:mt,replace:gt,rename:pt,findCommonAncestor:ht,toHex:vt,run:V,getAttribs:w,isEmpty:yt,createRng:wt,nodeIndex:Hs,split:xt,bind:St,unbind:kt,fire:Ot,getContentEditable:Tt,getContentEditableParent:Et,destroy:_t,isChildOf:Dt,dumpRng:At},Nt=Fs(l,e,A(Rt));return Rt};Vs.DOM=Vs(document),Vs.nodeIndex=Hs;var Us=Vs.DOM,js=gn.each,Ws=gn.grep,qs=0,$s=1,Gs=2,Ks=3,Xs=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=Us,i=function(){o.remove(c),r&&(r.onerror=r.onload=r=null)},u=function(){i(),e()},a=function(){i(),O(n)?n():"undefined"!==typeof console&&console.log},c=o.uniqueId();r=document.createElement("script"),r.id=c,r.type="text/javascript",r.src=gn._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=u,r.onerror=a,(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return this.states[t]===Gs},t.prototype.markDone=function(t){this.states[t]=Gs},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=qs),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){js(o.scriptLoadedCallbacks[e],(function(e){O(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=Ws(t);if(t.length=0,js(e,(function(t){o.states[t]!==Gs?o.states[t]!==Ks?o.states[t]!==$s&&(o.states[t]=$s,o.loading++,o.loadScript(t,(function(){o.states[t]=Gs,o.loading--,u("success",t),a()}),(function(){o.states[t]=Ks,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,js(n,(function(t){0===i.length?O(t.success)&&t.success.call(t.scope):O(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),Ys=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},Js=function(t){return b(t)&&Nt(t,"raw")},Qs=function(t){return y(t)&&t.length>1},Zs={},tf=Ys("en"),ef=function(){return Rt(Zs,tf.get())},nf=function(){return St(Zs,(function(t){return Wt({},t)}))},rf=function(t){t&&tf.set(t)},of=function(){return tf.get()},uf=function(t,e){var n=Zs[t];n||(Zs[t]=n={}),Ct(e,(function(t,e){n[e.toLowerCase()]=t}))},af=function(t){var e=ef().getOr({}),n=function(t){return O(t)?Object.prototype.toString.call(t):r(t)?"":""+t},r=function(t){return""===t||null===t||void 0===t},o=function(t){var r=n(t);return Rt(e,r.toLowerCase()).map(n).getOr(r)},i=function(t){return t.replace(/{context:\w+}$/,"")};if(r(t))return"";if(Js(t))return n(t.raw);if(Qs(t)){var u=t.slice(1),a=o(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return Nt(u,e)?n(u[e]):t}));return i(a)}return i(o(t))},cf=function(){return ef().bind((function(t){return Rt(t,"_dir")})).exists((function(t){return"rtl"===t}))},sf=function(t){return Nt(Zs,t)},ff={getData:nf,setCode:rf,getCode:of,add:uf,translate:af,isRtl:cf,hasCode:sf},lf=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=nt(r,(function(n){return n.name===t&&n.state===e}));Z(n,(function(t){return t.callback()}))},i=function(t){if(n[t])return n[t].instance},u=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},a=function(t,n){!1!==lf.languageLoad&&g(t,(function(){var r=ff.getCode(),o=","+(n||"")+",";!r||n&&-1===o.indexOf(","+r+",")||Xs.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},c=function(e,r,i){var u=r;return t.push(u),n[e]={instance:u,dependencies:i},o(e,"added"),u},s=function(t){delete e[t],delete n[t]},f=function(t,e){return"object"===typeof e?e:"string"===typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},l=function(t,n){var r=e[t];Z(n,(function(t){Xs.ScriptLoader.add(r+"/"+t)}))},d=function(t,e,n,r){var o=u(t);Z(o,(function(t){var n=f(e,t);m(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(Xs))},m=function(t,r,i,u,a){if(!e[t]){var c="string"===typeof r?r:r.prefix+r.resource+r.suffix;0!==c.indexOf("/")&&-1===c.indexOf("://")&&(c=lf.baseURL+"/"+c),e[t]=c.substring(0,c.lastIndexOf("/"));var s=function(){o(t,"loaded"),d(t,r,i,u)};n[t]?s():Xs.ScriptLoader.add(c,s,u,a)}},g=function(t,o,i){void 0===i&&(i="added"),Nt(n,t)&&"added"===i||Nt(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:i,dependencies:u,requireLangPack:a,add:c,remove:s,createUrl:f,addComponents:l,load:m,waitFor:g}};lf.languageLoad=!0,lf.baseURL="",lf.PluginManager=lf(),lf.ThemeManager=lf();var df=function(t){var e=Ys(W.none()),n=function(){return e.get().each(t)},r=function(){n(),e.set(W.none())},o=function(){return e.get().isSome()},i=function(){return e.get()},u=function(t){n(),e.set(W.some(t))};return{clear:r,isSet:o,get:i,set:u}},mf=function(){var t=df(E),e=function(e){return t.get().each(e)};return Wt(Wt({},t),{on:e})},gf=function(t,e){var n=null,r=function(){w(n)||(clearTimeout(n),n=null)},o=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];w(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))};return{cancel:r,throttle:o}},pf=function(t,e){var n=null,r=function(){w(n)||(clearTimeout(n),n=null)},o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)};return{cancel:r,throttle:o}},hf=function(t,e){var n=yo(t,e);return void 0===n||""===n?[]:n.split(" ")},vf=function(t,e,n){var r=hf(t,e),o=r.concat([n]);return vo(t,e,o.join(" ")),!0},bf=function(t,e,n){var r=nt(hf(t,e),(function(t){return t!==n}));return r.length>0?vo(t,e,r.join(" ")):Co(t,e),!1},yf=function(t){return void 0!==t.dom.classList},wf=function(t){return hf(t,"class")},xf=function(t,e){return vf(t,"class",e)},Cf=function(t,e){return bf(t,"class",e)},Sf=function(t,e){yf(t)?t.dom.classList.add(e):xf(t,e)},kf=function(t){var e=yf(t)?t.dom.classList:wf(t);0===e.length&&Co(t,"class")},Of=function(t,e){if(yf(t)){var n=t.dom.classList;n.remove(e)}else Cf(t,e);kf(t)},Tf=function(t,e){return yf(t)&&t.dom.classList.contains(e)},Ef=function(t,e){var n=[];return Z(rr(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Ef(t,e))})),n},_f=function(t,e){return Rn(e,t)},Df=A("mce-annotation"),Af=A("data-mce-annotation"),Rf=A("data-mce-annotation-uid"),Nf=function(t,e){var n=t.selection.getRng(),r=wn.fromDom(n.startContainer),o=wn.fromDom(t.getBody()),i=e.fold((function(){return"."+Df()}),(function(t){return"["+Af()+'="'+t+'"]'})),u=or(r,n.startOffset).getOr(r),a=_i(u,i,(function(t){return Bn(t,o)})),c=function(t,e){return xo(t,e)?W.some(yo(t,e)):W.none()};return a.bind((function(e){return c(e,""+Rf()).bind((function(n){return c(e,""+Af()).map((function(e){var r=Mf(t,n);return{uid:n,name:e,elements:r}}))}))}))},Bf=function(t){return Vn(t)&&Tf(t,Df())},Mf=function(t,e){var n=wn.fromDom(t.getBody());return _f(n,"["+Rf()+'="'+e+'"]')},Pf=function(t,e){var n=wn.fromDom(t.getBody()),r=_f(n,"["+Af()+'="'+e+'"]'),o={};return Z(r,(function(t){var e=yo(t,Rf()),n=Rt(o,e).getOr([]);o[e]=n.concat([t])})),o},If=function(t,e){var n=Ys({}),r=function(){return{listeners:[],previous:mf()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=Rt(o,t).getOrThunk(r),u=e(i);o[t]=u,n.set(o)},u=function(t,e,n){o(t,(function(r){Z(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:Q(n,(function(t){return t.dom}))})}))}))},a=function(t){o(t,(function(e){Z(e.listeners,(function(e){return e(!1,t)}))}))},c=pf((function(){var e=n.get(),r=gt(wt(e));Z(r,(function(e){i(e,(function(n){var r=n.previous.get();return Nf(t,W.some(e)).fold((function(){r.isSome()&&(a(e),n.previous.clear())}),(function(t){var e=t.uid,o=t.name,i=t.elements;so(r,e)||(u(o,e,i),n.previous.set(e))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){c.cancel()})),t.on("NodeChange",(function(){c.throttle()}));var s=function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))};return{addListener:s}},Lf=function(t,e){var n=function(t){return W.from(t.attr(Af())).bind(e.lookup)};t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){Z(t,(function(t){n(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},Ff=function(){var t={},e=function(e,n){t[e]={name:e,settings:n}},n=function(e){return Rt(t,e).map((function(t){return t.settings}))};return{register:e,lookup:n}},zf=0,Hf=function(t){var e=new Date,n=e.getTime(),r=Math.floor(1e9*Math.random());return zf++,t+"_"+r+zf+String(n)},Vf=function(t,e){Z(e,(function(e){Sf(t,e)}))},Uf=function(t,e){var n=e||document,r=n.createElement("div");return r.innerHTML=t,rr(wn.fromDom(r))},jf=function(t){return Q(t,wn.fromDom)},Wf=function(t){return t.dom.innerHTML},qf=function(t,e){var n=$n(t),r=n.dom,o=wn.fromDom(r.createDocumentFragment()),i=Uf(e,r);kr(o,i),Or(t),xr(t,o)},$f=function(t,e){return wn.fromDom(t.dom.cloneNode(e))},Gf=function(t){return $f(t,!1)},Kf=function(t){return $f(t,!0)},Xf=function(t,e,n){void 0===n&&(n=F);var r=new Hi(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Zr(e)&&!n(e));return W.from(e).filter(Zr)};return{current:function(){return W.from(r.current()).filter(Zr)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Yf=function(t,e){var n=e||function(e){return t.isBlock(e)||ro(e)||uo(e)},r=function(t,e,n,o){if(Zr(t)){var i=o(t,e,t.data);if(-1!==i)return W.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))},o=function(t,e,o,i){var u=Xf(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},i=function(t,e,o,i){var u=Xf(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()};return{backwards:o,forwards:i}},Jf=Math.round,Qf=function(t){return t?{left:Jf(t.left),top:Jf(t.top),bottom:Jf(t.bottom),right:Jf(t.right),width:Jf(t.width),height:Jf(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Zf=function(t,e){return t=Qf(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},tl=function(t,e){return t.left===e.left&&t.top===e.top&&t.bottom===e.bottom&&t.right===e.right},el=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},nl=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&el(e.top-t.bottom,t,e)},rl=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&el(e.bottom-t.top,t,e)},ol=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},il=function(t,e,n){return Math.min(Math.max(t,e),n)},ul=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},al=function(t,e){if(jr(t)&&t.hasChildNodes()){var n=t.childNodes,r=il(e,0,n.length-1);return n[r]}return t},cl=function(t,e){return e<0&&jr(t)&&t.hasChildNodes()?void 0:al(t,e)},sl=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),fl=function(t){return"string"===typeof t&&t.charCodeAt(0)>=768&&sl.test(t)},ll=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}},dl=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}},ml=jr,gl=zu,pl=qr("display","block table"),hl=qr("float","left right"),vl=dl(ml,gl,M(hl)),bl=M(qr("white-space","pre pre-line pre-wrap")),yl=Zr,wl=ro,xl=Vs.nodeIndex,Cl=cl,Sl=function(t){return"createRange"in t?t.createRange():Vs.DOM.createRng()},kl=function(t){return t&&/[\r\n\t ]/.test(t)},Ol=function(t){return!!t.setStart&&!!t.setEnd},Tl=function(t){var e=t.startContainer,n=t.startOffset;if(kl(t.toString())&&bl(e.parentNode)&&Zr(e)){var r=e.data;if(kl(r[n-1])||kl(r[n+1]))return!0}return!1},El=function(t){var e=t.ownerDocument,n=Sl(e),r=e.createTextNode(su),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Qf(n.getBoundingClientRect());return o.removeChild(r),i},_l=function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Zr(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),Al(i)}return null},Dl=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},Al=function(t){var e,n=t.getClientRects();return e=n.length>0?Qf(n[0]):Qf(t.getBoundingClientRect()),!Ol(t)&&wl(t)&&Dl(e)?El(t):Dl(e)&&Ol(t)?_l(t):e},Rl=function(t,e){var n=Zf(t,e);return n.width=1,n.right=n.left+1,n},Nl=function(t){var e=[],n=function(t){0!==t.height&&(e.length>0&&tl(t,e[e.length-1])||e.push(t))},r=function(t,r){var o=Sl(t.ownerDocument);if(r<t.data.length){if(fl(t.data[r]))return e;if(fl(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!Tl(o)))return n(Rl(Al(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),Tl(o)||n(Rl(Al(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),Tl(o)||n(Rl(Al(o),!0)))},o=t.container(),i=t.offset();if(yl(o))return r(o,i),e;if(ml(o))if(t.isAtEnd()){var u=Cl(o,i);yl(u)&&r(u,u.data.length),vl(u)&&!wl(u)&&n(Rl(Al(u),!1))}else{u=Cl(o,i);if(yl(u)&&r(u,0),vl(u)&&t.isAtEnd())return n(Rl(Al(u),!1)),e;var a=Cl(t.container(),t.offset()-1);vl(a)&&!wl(a)&&(pl(a)||pl(u)||!vl(u))&&n(Rl(Al(a),!1)),vl(u)&&n(Rl(Al(u),!0))}return e},Bl=function(t,e,n){var r=function(){return yl(t),0===e},o=function(){return yl(t)?e>=t.data.length:e>=t.childNodes.length},i=function(){var n=Sl(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},u=function(){return n||(n=Nl(Bl(t,e))),n},a=function(){return u().length>0},c=function(n){return n&&t===n.container()&&e===n.offset()},s=function(n){return Cl(t,n?e-1:e)};return{container:A(t),offset:A(e),toRange:i,getClientRects:u,isVisible:a,isAtStart:r,isAtEnd:o,isEqual:c,getNode:s}};Bl.fromRangeStart=function(t){return Bl(t.startContainer,t.startOffset)},Bl.fromRangeEnd=function(t){return Bl(t.endContainer,t.endOffset)},Bl.after=function(t){return Bl(t.parentNode,xl(t)+1)},Bl.before=function(t){return Bl(t.parentNode,xl(t))},Bl.isAbove=function(t,e){return lo(ht(e.getClientRects()),vt(t.getClientRects()),nl).getOr(!1)},Bl.isBelow=function(t,e){return lo(vt(e.getClientRects()),ht(t.getClientRects()),rl).getOr(!1)},Bl.isAtStart=function(t){return!!t&&t.isAtStart()},Bl.isAtEnd=function(t){return!!t&&t.isAtEnd()},Bl.isTextPosition=function(t){return!!t&&Zr(t.container())},Bl.isElementPosition=function(t){return!1===Bl.isTextPosition(t)};var Ml,Pl=function(t,e){Zr(e)&&0===e.data.length&&t.remove(e)},Il=function(t,e,n){e.insertNode(n),Pl(t,n.previousSibling),Pl(t,n.nextSibling)},Ll=function(t,e,n){var r=W.from(n.firstChild),o=W.from(n.lastChild);e.insertNode(n),r.each((function(e){return Pl(t,e.previousSibling)})),o.each((function(e){return Pl(t,e.nextSibling)}))},Fl=function(t,e,n){no(n)?Ll(t,e,n):Il(t,e,n)},zl=Zr,Hl=Kr,Vl=Vs.nodeIndex,Ul=function(t){var e=t.parentNode;return Hl(e)?Ul(e):e},jl=function(t){return t?Vt(t.childNodes,(function(t,e){return Hl(e)&&"BR"!==e.nodeName?t=t.concat(jl(e)):t.push(e),t}),[]):[]},Wl=function(t,e){while(t=t.previousSibling){if(!zl(t))break;e+=t.data.length}return e},ql=function(t){return function(e){return t===e}},$l=function(t){var e,n;e=jl(Ul(t)),n=Ut(e,ql(t),t),e=e.slice(0,n+1);var r=Vt(e,(function(t,n,r){return zl(n)&&zl(e[r-1])&&t++,t}),0);return e=zt(e,Wr([t.nodeName])),n=Ut(e,ql(t),t),n-r},Gl=function(t){var e;return e=zl(t)?"text()":t.nodeName.toLowerCase(),e+"["+$l(t)+"]"},Kl=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode){if(n&&n(e))break;r.push(e)}return r},Xl=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),zl(n)?o=Wl(n,r):(i=n.childNodes,r>=i.length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(Gl(n)),u=Kl(t,n),u=zt(u,M(Kr)),a=a.concat(Ft(u,(function(t){return Gl(t)}))),a.reverse().join("/")+","+o},Yl=function(t,e,n){var r=jl(t);return r=zt(r,(function(t,e){return!zl(t)||!zl(r[e-1])})),r=zt(r,Wr([e])),r[n]},Jl=function(t,e){var n,r=t,o=0;while(zl(r)){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!zl(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return zl(t)&&e>t.data.length&&(e=t.data.length),Bl(t,e)},Ql=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Vt(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),Yl(t,n[1],parseInt(n[2],10))):null}),t);return i?zl(i)?Jl(i,parseInt(n,10)):(n="after"===n?Vl(i)+1:Vl(i),Bl(i.parentNode,n)):null},Zl=uo,td=function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Zr(r);r=r.previousSibling)o+=t(r.data).length;return o},ed=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,f=t.getRoot();for(Zr(u)?c.push(n?td(e,u,a):a):(i=u.childNodes,a>=i.length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==f;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},nd=function(t,e,n,r){var o=e.dom,i={};return i.start=ed(o,t,n,r,!0),e.isCollapsed()||(i.end=ed(o,t,n,r,!1)),Au(r)&&(i.isFakeCaret=!0),i},rd=function(t,e,n){var r=0;return gn.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},od=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],jr(n)&&"TR"===n.nodeName&&(o=n.childNodes,n=o[Math.min(e?r:r-1,o.length-1)],n&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r)))},id=function(t){return od(t,!0),od(t,!1),t},ud=function(t,e){var n;if(jr(t)&&(t=al(t,e),Zl(t)))return t;if(yu(t)){if(Zr(t)&&vu(t)&&(t=t.parentNode),n=t.previousSibling,Zl(n))return n;if(n=t.nextSibling,Zl(n))return n}},ad=function(t){return ud(t.startContainer,t.startOffset)||ud(t.endContainer,t.endOffset)},cd=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Zl(r)||"IMG"===o)return{name:o,index:rd(n.dom,o,r)};var u=ad(i);return u?(o=u.tagName,{name:o,index:rd(n.dom,o,u)}):nd(t,n,e,i)},sd=function(t){var e=t.getRng();return{start:Xl(t.dom.getRoot(),Bl.fromRangeStart(e)),end:Xl(t.dom.getRoot(),Bl.fromRangeEnd(e))}},fd=function(t){return{rng:t.getRng()}},ld=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,"&#xFEFF;"):t.create("span",r)},dd=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:rd(n,a,u)};var c=id(r.cloneRange());if(!i){c.collapse(!1);var s=ld(n,o+"_end",e);Fl(n,c,s)}r=id(r),r.collapse(!0);var f=ld(n,o+"_start",e);return Fl(n,r,f),t.moveToBookmark({id:o,keep:!0}),{id:o}},md=function(t,e,n){return 2===e?cd(gu,n,t):3===e?sd(t):e?fd(t):dd(t,!1)},gd=B(cd,R,!0),pd=Vs.DOM,hd="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow",vd=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return Rt(o,t.id).getOr(n)}return r},bd=function(t){return t.getParam("iframe_attrs",{})},yd=function(t){return t.getParam("doctype","<!DOCTYPE html>")},wd=function(t){return t.getParam("document_base_url","")},xd=function(t){return vd(t,"body_id","tinymce")},Cd=function(t){return vd(t,"body_class","")},Sd=function(t){return t.getParam("content_security_policy","")},kd=function(t){return t.getParam("br_in_pre",!0)},Od=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Td=function(t){return t.getParam("forced_root_block_attrs",{})},Ed=function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},_d=function(t){return t.getParam("no_newline_selector","")},Dd=function(t){return t.getParam("keep_styles",!0)},Ad=function(t){return t.getParam("end_container_on_empty_block",!1)},Rd=function(t){return gn.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))},Nd=function(t){return gn.explode(t.getParam("font_size_classes",""))},Bd=function(t){return t.getParam("images_dataimg_filter",z,"function")},Md=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Pd=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Id=function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")},Ld=function(t){return t.getParam("icons","","string")},Fd=function(t){return t.getParam("icons_url","","string")},zd=function(t){return t.getParam("images_upload_url","","string")},Hd=function(t){return t.getParam("images_upload_base_path","","string")},Vd=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Ud=function(t){return t.getParam("images_upload_handler",null,"function")},jd=function(t){return t.getParam("content_css_cors",!1,"boolean")},Wd=function(t){return t.getParam("referrer_policy","","string")},qd=function(t){return t.getParam("language","en","string")},$d=function(t){return t.getParam("language_url","","string")},Gd=function(t){return t.getParam("indent_use_margin",!1)},Kd=function(t){return t.getParam("indentation","40px","string")},Xd=function(t){var e=t.getParam("content_css");return v(e)?Q(e.split(","),le):y(e)?e:!1===e||t.inline?[]:["default"]},Yd=function(t){var e=t.getParam("font_css",[]);return y(e)?e:Q(e.split(","),le)},Jd=function(t){return t.getParam("directionality",ff.isRtl()?"rtl":void 0)},Qd=function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},Zd=function(t){var e=t.getParam("object_resizing");return!1!==e&&!tn.iOS&&(v(e)?e:"table,img,figure.image,div,video,iframe")},tm=function(t){return t.getParam("resize_img_proportional",!0,"boolean")},em=function(t){return t.getParam("placeholder",pd.getAttrib(t.getElement(),"placeholder"),"string")},nm=function(t){return t.getParam("event_root")},rm=function(t){return t.getParam("service_message")},om=function(t){return t.getParam("theme")},im=function(t){return t.getParam("validate")},um=function(t){return!1!==t.getParam("inline_boundaries")},am=function(t){return t.getParam("formats")},cm=function(t){var e=t.getParam("preview_styles",hd);return v(e)?e:""},sm=function(t){return t.getParam("format_empty_lines",!1,"boolean")},fm=function(t){return t.getParam("custom_ui_selector","","string")},lm=function(t){return t.getParam("theme_url")},dm=function(t){return t.getParam("inline")},mm=function(t){return t.getParam("hidden_input")},gm=function(t){return t.getParam("submit_patch")},pm=function(t){return"xml"===t.getParam("encoding")},hm=function(t){return t.getParam("add_form_submit_trigger")},vm=function(t){return t.getParam("add_unload_trigger")},bm=function(t){return""!==Od(t)},ym=function(t){return t.getParam("custom_undo_redo_levels",0,"number")},wm=function(t){return t.getParam("disable_nodechange")},xm=function(t){return t.getParam("readonly")},Cm=function(t){return t.getParam("content_css_cors")},Sm=function(t){return t.getParam("plugins","","string")},km=function(t){return t.getParam("external_plugins")},Om=function(t){return t.getParam("block_unsupported_drop",!0,"boolean")},Tm=function(t){return t.getParam("visual",!0,"boolean")},Em=function(t){return t.getParam("visual_table_class","mce-item-table","string")},_m=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")},Dm=function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")},Am=jr,Rm=Zr,Nm=function(t){var e=t.parentNode;e&&e.removeChild(t)},Bm=function(t){var e=gu(t);return{count:t.length-e.length,text:e}},Mm=function(t){var e;while(-1!==(e=t.data.lastIndexOf(du)))t.deleteData(e,1)},Pm=function(t,e){return Vm(t),e},Im=function(t,e){var n=Bm(t.data.substr(0,e.offset())),r=Bm(t.data.substr(e.offset())),o=n.text+r.text;return o.length>0?(Mm(t),Bl(t,e.offset()-n.count)):e},Lm=function(t,e){var n=e.container(),r=X(bt(n.childNodes),t).map((function(t){return t<e.offset()?Bl(n,e.offset()-1):e})).getOr(e);return Vm(t),r},Fm=function(t,e){return Rm(t)&&e.container()===t?Im(t,e):Pm(t,e)},zm=function(t,e){return e.container()===t.parentNode?Lm(t,e):Pm(t,e)},Hm=function(t,e){return Bl.isTextPosition(e)?Fm(t,e):zm(t,e)},Vm=function(t){Am(t)&&yu(t)&&(wu(t)?t.removeAttribute("data-mce-caret"):Nm(t)),Rm(t)&&(Mm(t),0===t.data.length&&Nm(t))},Um=qe().browser,jm=uo,Wm=co,qm=ao,$m="*[contentEditable=false],video,audio,embed,object",Gm=function(t,e,n){var r,o,i=Zf(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var u=t.ownerDocument.documentElement;r=t.scrollLeft||u.scrollLeft,o=t.scrollTop||u.scrollTop}else{var a=t.getBoundingClientRect();r=t.scrollLeft-a.left,o=t.scrollTop-a.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=e.offsetWidth-e.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},Km=function(t){for(var e=_f(wn.fromDom(t),$m),n=0;n<e.length;n++){var r=e[n].dom,o=r.previousSibling;if(Eu(o)){var i=o.data;1===i.length?o.parentNode.removeChild(o):o.deleteData(i.length-1,1)}if(o=r.nextSibling,Tu(o)){i=o.data;1===i.length?o.parentNode.removeChild(o):o.deleteData(0,1)}}},Xm=function(t,e,n,r){var o,i,u=mf(),a=Od(t),c=a.length>0?a:"p",s=function(t,r){var o;if(f(),qm(r))return null;if(!n(r))return i=xu(r,t),o=r.ownerDocument.createRange(),Jm(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=Ou(c,r,t);var a=Gm(e,r,t);Bs(i).css("top",a.top);var s=Bs('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Wt({},a)).appendTo(e)[0];return u.set({caret:s,element:r,before:t}),t&&Bs(s).addClass("mce-visual-caret-before"),l(),o=r.ownerDocument.createRange(),o.setStart(i,0),o.setEnd(i,0),o},f=function(){Km(e),i&&(Vm(i),i=null),u.on((function(t){Bs(t.caret).remove(),u.clear()})),o&&(Ii.clearInterval(o),o=void 0)},l=function(){o=Ii.setInterval((function(){r()?Bs("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Bs("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)},d=function(){u.on((function(t){var n=Gm(e,t.element,t.before);Bs(t.caret).css(Wt({},n))}))},m=function(){return Ii.clearInterval(o)},g=function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"};return{show:s,hide:f,getCss:g,reposition:d,destroy:m}},Ym=function(){return Um.isIE()||Um.isEdge()||Um.isFirefox()},Jm=function(t){return jm(t)||Wm(t)},Qm=function(t){return Jm(t)||Yr(t)&&Ym()},Zm=uo,tg=co,eg=qr("display","block table table-cell table-caption list-item"),ng=yu,rg=vu,og=jr,ig=zu,ug=function(t){return t>0},ag=function(t){return t<0},cg=function(t,e){var n;while(n=t(e))if(!rg(n))return n;return null},sg=function(t,e,n,r,o){var i=new Hi(t,r),u=Zm(t)||rg(t);if(ag(e)){if(u&&(t=cg(i.prev.bind(i),!0),n(t)))return t;while(t=cg(i.prev.bind(i),o))if(n(t))return t}if(ug(e)){if(u&&(t=cg(i.next.bind(i),!0),n(t)))return t;while(t=cg(i.next.bind(i),o))if(n(t))return t}return null},fg=function(t,e){while(t&&t!==e){if(eg(t))return t;t=t.parentNode}return null},lg=function(t,e,n){return fg(t.container(),n)===fg(e.container(),n)},dg=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return og(n)?n.childNodes[r+t]:null},mg=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},gg=function(t,e,n){return fg(e,t)===fg(n,t)},pg=function(t,e,n){var r=t?"previousSibling":"nextSibling";while(n&&n!==e){var o=n[r];if(ng(o)&&(o=o[r]),Zm(o)||tg(o)){if(gg(e,o,n))return o;break}if(ig(o))break;n=n.parentNode}return null},hg=B(mg,!0),vg=B(mg,!1),bg=function(t,e,n){var r,o=B(pg,!0,e),i=B(pg,!1,e),u=n.startContainer,a=n.startOffset;if(vu(u)){og(u)||(u=u.parentNode);var c=u.getAttribute("data-mce-caret");if("before"===c&&(r=u.nextSibling,Qm(r)))return hg(r);if("after"===c&&(r=u.previousSibling,Qm(r)))return vg(r)}if(!n.collapsed)return n;if(Zr(u)){if(ng(u)){if(1===t){if(r=i(u),r)return hg(r);if(r=o(u),r)return vg(r)}if(-1===t){if(r=o(u),r)return vg(r);if(r=i(u),r)return hg(r)}return n}if(Eu(u)&&a>=u.data.length-1)return 1===t&&(r=i(u),r)?hg(r):n;if(Tu(u)&&a<=1)return-1===t&&(r=o(u),r)?vg(r):n;if(a===u.data.length)return r=i(u),r?hg(r):n;if(0===a)return r=o(u),r?vg(r):n}return n},yg=function(t,e){return W.from(dg(t?0:-1,e)).filter(Zm)},wg=function(t,e,n){var r=bg(t,e,n);return-1===t?Bl.fromRangeStart(r):Bl.fromRangeEnd(r)},xg=function(t){return W.from(t.getNode()).map(wn.fromDom)},Cg=function(t){return W.from(t.getNode(!0)).map(wn.fromDom)},Sg=function(t,e){while(e=t(e))if(e.isVisible())return e;return e},kg=function(t,e){var n=lg(t,e);return!(n||!ro(t.getNode()))||n};(function(t){t[t["Backwards"]=-1]="Backwards",t[t["Forwards"]=1]="Forwards"})(Ml||(Ml={}));var Og=uo,Tg=Zr,Eg=jr,_g=ro,Dg=zu,Ag=Wu,Rg=qu,Ng=function(t,e){var n=[];while(t&&t!==e)n.push(t),t=t.parentNode;return n},Bg=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Mg=function(t,e){if(ug(t)){if(Dg(e.previousSibling)&&!Tg(e.previousSibling))return Bl.before(e);if(Tg(e))return Bl(e,0)}if(ag(t)){if(Dg(e.nextSibling)&&!Tg(e.nextSibling))return Bl.after(e);if(Tg(e))return Bl(e,e.data.length)}return ag(t)?_g(e)?Bl.before(e):Bl.after(e):Bl.before(e)},Pg=function(t,e){var n=e.nextSibling;return n&&Dg(n)?Tg(n)?Bl(n,0):Bl.before(n):Ig(Ml.Forwards,Bl.after(e),t)},Ig=function(t,e,n){var r,o,i,u;if(!Eg(n)||!e)return null;if(e.isEqual(Bl.after(n))&&n.lastChild){if(u=Bl.after(n.lastChild),ag(t)&&Dg(n.lastChild)&&Eg(n.lastChild))return _g(n.lastChild)?Bl.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(Tg(a)){if(ag(t)&&c>0)return Bl(a,--c);if(ug(t)&&c<a.length)return Bl(a,++c);r=a}else{if(ag(t)&&c>0&&(o=Bg(a,c-1),Dg(o)))return!Ag(o)&&(i=sg(o,t,Rg,o),i)?Tg(i)?Bl(i,i.data.length):Bl.after(i):Tg(o)?Bl(o,o.data.length):Bl.before(o);if(ug(t)&&c<a.childNodes.length&&(o=Bg(a,c),Dg(o)))return _g(o)?Pg(n,o):!Ag(o)&&(i=sg(o,t,Rg,o),i)?Tg(i)?Bl(i,0):Bl.before(i):Tg(o)?Bl(o,0):Bl.after(o);r=o||u.getNode()}if((ug(t)&&u.isAtEnd()||ag(t)&&u.isAtStart())&&(r=sg(r,t,z,n,!0),Rg(r,n)))return Mg(t,r);o=sg(r,t,Rg,n);var s=jt(nt(Ng(a,n),Og));return!s||o&&s.contains(o)?o?Mg(t,o):null:(u=ug(t)?Bl.after(s):Bl.before(s),u)},Lg=function(t){return{next:function(e){return Ig(Ml.Forwards,e,t)},prev:function(e){return Ig(Ml.Backwards,e,t)}}},Fg=function(t,e,n){var r=t?Bl.before(n):Bl.after(n);return qg(t,e,r)},zg=function(t){return ro(t)?Bl.before(t):Bl.after(t)},Hg=function(t){return Bl.isTextPosition(t)?0===t.offset():zu(t.getNode())},Vg=function(t){if(Bl.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return zu(t.getNode(!0))},Ug=function(t,e){return!Bl.isTextPosition(t)&&!Bl.isTextPosition(e)&&t.getNode()===e.getNode(!0)},jg=function(t){return!Bl.isTextPosition(t)&&ro(t.getNode())},Wg=function(t,e,n){return t?!Ug(e,n)&&!jg(e)&&Vg(e)&&Hg(n):!Ug(n,e)&&Hg(e)&&Vg(n)},qg=function(t,e,n){var r=Lg(e);return W.from(t?r.next(n):r.prev(n))},$g=function(t,e,n){return qg(t,e,n).bind((function(r){return lg(n,r,e)&&Wg(t,n,r)?qg(t,e,r):W.some(r)}))},Gg=function(t,e,n,r){return $g(t,e,n).bind((function(n){return r(n)?Gg(t,e,n,r):W.some(n)}))},Kg=function(t,e){var n=t?e.firstChild:e.lastChild;return Zr(n)?W.some(Bl(n,t?0:n.data.length)):n?zu(n)?W.some(t?Bl.before(n):zg(n)):Fg(t,e,n):W.none()},Xg=B(qg,!0),Yg=B(qg,!1),Jg=B(Kg,!0),Qg=B(Kg,!1),Zg="_mce_caret",tp=function(t){return jr(t)&&t.id===Zg},ep=function(t,e){while(e&&e!==t){if(e.id===Zg)return e;e=e.parentNode}return null},np=function(t){return v(t.start)},rp=function(t){return Nt(t,"rng")},op=function(t){return Nt(t,"id")},ip=function(t){return Nt(t,"name")},up=function(t){return gn.isArray(t.start)},ap=function(t,e){return jr(e)&&t.isBlock(e)&&!e.innerHTML&&!tn.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},cp=function(t,e){var n,r=t.createRng();return n=Ql(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Ql(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r},sp=function(t,e){var n=t.ownerDocument.createTextNode(du);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)},fp=function(t){return!1===t.hasChildNodes()},lp=function(t,e){return Qg(t).fold(F,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},dp=function(t,e,n){return!(!fp(e)||!ep(t,e))&&(sp(e,n),!0)},mp=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,dp(s,i,r))return!0;if(c[o]>a.length-1)return!!dp(s,i,r)||lp(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},gp=function(t){return Zr(t)&&t.data.length>0},pp=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),f=n.keep;if(s){if(r=s.parentNode,"start"===e?(f?s.hasChildNodes()?(r=s.firstChild,o=1):gp(s.nextSibling)?(r=s.nextSibling,o=0):gp(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(f?s.hasChildNodes()?(r=s.firstChild,o=1):gp(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!f){u=s.previousSibling,i=s.nextSibling,gn.each(gn.grep(s.childNodes),(function(t){Zr(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));while(s=t.get(n.id+"_"+e))t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&Zr(u)&&!tn.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return W.some(Bl(a,c))}return W.none()},hp=function(t,e){var n=t.createRng();return mp(t,!0,e,n)&&mp(t,!1,e,n)?W.some(n):W.none()},vp=function(t,e){var n=pp(t,"start",e),r=pp(t,"end",e);return lo(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(ap(t,e.container()),e.offset()),r.setEnd(ap(t,n.container()),n.offset()),r}))},bp=function(t,e){return W.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))},yp=function(t,e){var n=t.dom;if(e){if(up(e))return hp(n,e);if(np(e))return W.some(cp(n,e));if(op(e))return vp(n,e);if(ip(e))return bp(n,e);if(rp(e))return W.some(e.rng)}return W.none()},wp=function(t,e,n){return md(t,e,n)},xp=function(t,e){yp(t,e).each((function(e){t.setRng(e)}))},Cp=function(t){return jr(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Sp=function(t){return function(e){return t===e}},kp=Sp(su),Op=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Tp=function(t){return!Op(t)&&!kp(t)},Ep=function(t){return!!t.nodeType},_p=function(t){return t&&/^(IMG)$/.test(t.nodeName)},Dp=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!_p(o.childNodes[r]))&&jr(o)){var i=o.childNodes,u=void 0;r<i.length?(o=i[r],u=new Hi(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],u=new Hi(o,t.getParent(o,t.isBlock)),u.next(!0));for(var a=u.current();a;a=u.next())if(Zr(a)&&!Bp(a))return n.setStart(a,0),void e.setRng(n)}},Ap=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(jr(t)||!Bp(t))return t}},Rp=function(t,e){return Ep(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},Np=function(t,e,n){return t.schema.isValidChild(e,n)},Bp=function(t,e){if(void 0===e&&(e=!1),k(t)&&Zr(t)){var n=e?t.data.replace(/ /g," "):t.data;return Gu(n)}return!1},Mp=function(t){return k(t)&&Zr(t)&&0===t.length},Pp=function(t,e){return O(t)?t=t(e):k(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Ip=function(t,e){return t=t||"",e=e||"",t=""+(t.nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Lp=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},Fp=function(t,e,n){return Lp(t,t.getStyle(e,n),n)},zp=function(t,e){var n;return t.getParent(e,(function(e){return n=t.getStyle(e,"text-decoration"),n&&"none"!==n})),n},Hp=function(t,e,n){return t.getParents(e,n,t.getRoot())},Vp=function(t,e){var n=function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return J(["styles","attributes"],(function(n){return Rt(t,n).exists((function(t){var n=y(t)?t:At(t);return J(n,e)}))}))};return J(t.formatter.get(e),n)},Up=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return _t(t,(function(t,e){return J(r,(function(t){return t===e}))}))};return J(t.formatter.get(e),(function(e){var r=o(e);return J(t.formatter.get(n),(function(t){var e=o(t);return Mt(r,e)}))}))},jp=function(t){return Bt(t,"block")},Wp=function(t){return Bt(t,"selector")},qp=function(t){return Bt(t,"inline")},$p=function(t){return Wp(t)&&qp(t)&&so(Rt(t,"mixed"),!0)},Gp=function(t){return Wp(t)&&!1!==t.expand&&!qp(t)},Kp=Cp,Xp=Hp,Yp=Bp,Jp=Rp,Qp=function(t){return ro(t)&&t.getAttribute("data-mce-bogus")&&!t.nextSibling},Zp=function(t,e){var n=e;while(n){if(jr(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},th=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},eh=function(t,e,n){return th(t,e,n,(function(t){return kp(t)||Op(t)}))},nh=function(t,e,n){return th(t,e,n,Tp)},rh=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Yf(t),c=o?i.backwards:i.forwards;return W.from(c(e,n,(function(t,e){return Kp(t.parentNode)?-1:(u=t,r(o,t,e))}),a))},s=c(n,r,eh);return s.bind((function(t){return i?c(t.container,t.offset+(o?-1:0),nh):W.some(t)})).orThunk((function(){return u?W.some({container:u,offset:o?0:u.length}):W.none()}))},oh=function(t,e,n,r,o){Zr(r)&&pe(r.data)&&r[o]&&(r=r[o]);for(var i=Xp(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!k(c.collapsed)||c.collapsed===n.collapsed)&&(Wp(c)&&t.is(i[u],c.selector)))return i[u]}return r},ih=function(t,e,n,r){var o=n,i=t.dom,u=i.getRoot(),a=e[0];if(jp(a)&&(o=a.wrapper?null:i.getParent(n,a.block,u)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(Zr(n)?n.parentNode:n,(function(e){return e!==u&&Jp(t,e)}),c)}if(o&&jp(a)&&a.wrapper&&(o=Xp(i,o,"ul,ol").reverse()[0]||o),!o){o=n;while(o[r]&&!i.isBlock(o[r]))if(o=o[r],Ip(o,"br"))break}return o||n},uh=function(t,e,n,r){var o=n.parentNode;return!k(n[r])&&(!(o!==e&&!S(o)&&!t.isBlock(o))||uh(t,e,o,r))},ah=function(t,e,n,r,o){var i=n,u=o?"previousSibling":"nextSibling",a=t.getRoot();if(Zr(n)&&!Yp(n)&&(o?r>0:r<n.data.length))return n;while(1){if(!e[0].block_expand&&t.isBlock(i))return i;for(var c=i[u];c;c=c[u]){var s=Zr(c)&&!uh(t,a,c,u);if(!Kp(c)&&!Qp(c)&&!Yp(c,s))return i}if(i===a||i.parentNode===a){n=i;break}i=i.parentNode}return n},ch=function(t){return Kp(t.parentNode)||Kp(t)},sh=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom,s=n[0];if(jr(o)&&o.hasChildNodes()&&(o=al(o,i),Zr(o)&&(i=0)),jr(u)&&u.hasChildNodes()&&(u=al(u,e.collapsed?a:a-1),Zr(u)&&(a=u.nodeValue.length)),o=Zp(c,o),u=Zp(c,u),ch(o)&&(o=Kp(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Zr(o)&&(i=e.collapsed?o.length:0)),ch(u)&&(u=Kp(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,Zr(u)&&(a=e.collapsed?0:u.length)),e.collapsed){var f=rh(c,t.getBody(),o,i,!0,r);f.each((function(t){var e=t.container,n=t.offset;o=e,i=n}));var l=rh(c,t.getBody(),u,a,!1,r);l.each((function(t){var e=t.container,n=t.offset;u=e,a=n}))}return(qp(s)||s.block_expand)&&(qp(s)&&Zr(o)&&0!==i||(o=ah(c,n,o,i,!0)),qp(s)&&Zr(u)&&a!==u.nodeValue.length||(u=ah(c,n,u,a,!1))),Gp(s)&&(o=oh(c,n,e,o,"previousSibling"),u=oh(c,n,e,u,"nextSibling")),(jp(s)||Wp(s))&&(o=ih(t,n,o,"previousSibling"),u=ih(t,n,u,"nextSibling"),jp(s)&&(c.isBlock(o)||(o=ah(c,n,o,i,!0)),c.isBlock(u)||(u=ah(c,n,u,a,!1)))),jr(o)&&(i=c.nodeIndex(o),o=o.parentNode),jr(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},fh=function(t,e,n){var r=e.startOffset,o=al(e.startContainer,r),i=e.endOffset,u=al(e.endContainer,i-1),a=function(t){var e=t[0];Zr(e)&&e===o&&r>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===u&&Zr(n)&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)},f=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(o===u)return n(a([o]));var l=t.findCommonAncestor(o,u);if(t.isChildOf(o,u))return f(o,l,!0);if(t.isChildOf(u,o))return f(u,l);var d=s(o,l)||o,m=s(u,l)||u;f(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===u?m.nextSibling:m);g.length&&n(a(g)),f(u,m)},lh=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},dh=function(t){return st(t,(function(t){var e=ul(t);return e?[wn.fromDom(e)]:[]}))},mh=function(t){return lh(t).length>1},gh=function(t){return nt(dh(t),iu)},ph=function(t){return _f(t,"td[data-mce-selected],th[data-mce-selected]")},hh=function(t,e){var n=ph(e);return n.length>0?n:gh(t)},vh=function(t){return hh(lh(t.selection.getSel()),wn.fromDom(t.getBody()))},bh=function(t,e){return Ti(t,"table",e)},yh=function(t){var e=t.startContainer,n=t.startOffset;return Zr(e)?0===n?W.some(wn.fromDom(e)):W.none():W.from(e.childNodes[n]).map(wn.fromDom)},wh=function(t){var e=t.endContainer,n=t.endOffset;return Zr(e)?n===e.data.length?W.some(wn.fromDom(e)):W.none():W.from(e.childNodes[n-1]).map(wn.fromDom)},xh=function(t){return ir(t).fold(A([t]),(function(e){return[t].concat(xh(e))}))},Ch=function(t){return ur(t).fold(A([t]),(function(e){return"br"===Ln(e)?Zn(e).map((function(e){return[t].concat(Ch(e))})).getOr([]):[t].concat(Ch(e))}))},Sh=function(t,e){return lo(yh(e),wh(e),(function(e,n){var r=ut(xh(t),B(Bn,e)),o=ut(Ch(t),B(Bn,n));return r.isSome()&&o.isSome()})).getOr(!1)},kh=function(t,e,n,r){var o=n,i=new Hi(n,o),u=_t(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!Y(["td","th","table"],e.toLowerCase())}));do{if(Zr(n)&&0!==gn.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Oh=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Th=function(t,e){var n=vh(t);n.length>0?Z(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},Eh=function(t,e,n){var r=dd(t,e);n(r),t.moveToBookmark(r)},_h=function(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?W.from(e.dom.nodeValue):W.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:o}},Dh=_h(Un,"text"),Ah=function(t){return Dh.get(t)},Rh=function(t){return Un(t)&&Ah(t)===du},Nh=function(t,e,n,r){return Yn(e).fold((function(){return"skipping"}),(function(o){return"br"===r||Rh(e)?"valid":Bf(e)?"existing":tp(e.dom)?"caret":Np(t,n,r)&&Np(t,Ln(o),n)?"valid":"invalid-child"}))},Bh=function(t,e){var n=sh(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)},Mh=function(t,e,n,r){var o=e.uid,i=void 0===o?Hf("mce-annotation"):o,u=qt(e,["uid"]),a=wn.fromTag("span",t);Sf(a,Df()),vo(a,""+Rf(),i),vo(a,""+Af(),n);var c=r(i,u),s=c.attributes,f=void 0===s?{}:s,l=c.classes,d=void 0===l?[]:l;return bo(a,f),Vf(a,d),a},Ph=function(t,e,n,r,o){var i=[],u=Mh(t.getDoc(),o,n,r),a=mf(),c=function(){a.clear()},s=function(){return a.get().getOrThunk((function(){var t=Gf(u);return i.push(t),a.set(t),t}))},f=function(t){Z(t,l)},l=function(e){var n=Nh(t,e,"span",Ln(e));switch(n){case"invalid-child":c();var r=rr(e);f(r),c();break;case"valid":var o=s();Cr(e,o);break}},d=function(t){var e=Q(t,wn.fromDom);f(e)};return fh(t.dom,e,(function(t){c(),d(t)})),i},Ih=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=vh(t).length>0;if(i.collapsed&&!u&&Bh(t,i),o.getRng().collapsed&&!u){var a=Mh(t.getDoc(),r,e,n.decorate);qf(a,su),o.getRng().insertNode(a.dom),o.select(a.dom)}else Eh(o,!1,(function(){Th(t,(function(o){Ph(t,o,e,n.decorate,r)}))}))}))},Lh=function(t){var e=Ff();Lf(t,e);var n=If(t);return{register:function(t,n){e.register(t,n)},annotate:function(n,r){e.lookup(n).each((function(e){Ih(t,n,e,r)}))},annotationChanged:function(t,e){n.addListener(t,e)},remove:function(e){Nf(t,W.some(e)).each((function(t){var e=t.elements;Z(e,Er)}))},getAll:function(e){var n=Pf(t,e);return St(n,(function(t){return Q(t,(function(t){return t.dom}))}))}}},Fh=function(t){return{getBookmark:B(wp,t),moveToBookmark:B(xp,t)}};Fh.isBookmarkNode=Cp;var zh=function(t,e){while(e&&e!==t){if(io(e)||uo(e))return e;e=e.parentNode}return null},Hh=function(t,e,n){if(n.collapsed)return!1;if(tn.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(jr(r))return J(r.getClientRects(),(function(n){return ol(n,t,e)}))}return J(n.getClientRects(),(function(n){return ol(n,t,e)}))},Vh=function(t,e){return t.fire("PreProcess",e)},Uh=function(t,e){return t.fire("PostProcess",e)},jh=function(t){return t.fire("remove")},Wh=function(t){return t.fire("detach")},qh=function(t,e){return t.fire("SwitchMode",{mode:e})},$h=function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})},Gh=function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})},Kh=function(t){return t.fire("PreInit")},Xh=function(t){return t.fire("PostRender")},Yh=function(t){return t.fire("Init")},Jh=function(t,e){return t.fire("PlaceholderToggle",{state:e})},Qh=function(t,e,n){return t.fire(e,n)},Zh=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},tv=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},ev={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||ev.metaKeyPressed(t)},metaKeyPressed:function(t){return tn.mac?t.metaKey:t.ctrlKey&&!t.altKey}},nv=uo,rv=function(t,e){var n,r,o,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y="data-mce-selected",w=e.dom,x=gn.each,C=e.getDoc(),S=document,O=Math.abs,T=Math.round,E=e.getBody(),_={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},D=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},A=function(t){return co(t)||w.hasClass(t,"mce-preview-object")},R=function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return D(t.target)&&!Hh(n.clientX,n.clientY,e)}return D(t.target)&&!Hh(t.clientX,t.clientY,e)},N=function(t){var n=t.target;R(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},B=function(t){return w.is(t,"figure.image")?[t.querySelector("img")]:w.hasClass(t,"mce-preview-object")&&k(t.firstElementChild)?[t,t.firstElementChild]:[t]},M=function(t){var n=Zd(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(w.hasClass(t,"mce-preview-object")?Dn(wn.fromDom(t.firstElementChild),n):Dn(wn.fromDom(t),n))))},P=function(t){return A(t)?w.create("img",{src:tn.transparentSrc}):t.cloneNode(!0)},I=function(t,n,r){if(k(r)){var o=B(t);Z(o,(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?w.setStyle(t,n,r):w.setAttrib(t,n,""+r)}))}},L=function(t,e,n){I(t,"width",e),I(t,"height",n)},F=function(t){var u,y,x,C,S;u=t.screenX-a,y=t.screenY-c,p=u*i[2]+l,h=y*i[3]+d,p=p<5?5:p,h=h<5?5:h,x=(D(n)||A(n))&&!1!==tm(e)?!ev.modifierPressed(t):ev.modifierPressed(t),x&&(O(u)>O(y)?(h=T(p*m),p=T(h/m)):(p=T(h/m),h=T(p*m))),L(r,p,h),C=i.startPos.x+u,S=i.startPos.y+y,C=C>0?C:0,S=S>0?S:0,w.setStyles(o,{left:C,top:S,display:"block"}),o.innerHTML=p+" &times; "+h,i[2]<0&&r.clientWidth<=p&&w.setStyle(r,"left",s+(l-p)),i[3]<0&&r.clientHeight<=h&&w.setStyle(r,"top",f+(d-h)),u=E.scrollWidth-v,y=E.scrollHeight-b,u+y!==0&&w.setStyles(o,{left:C-u,top:S-y}),g||($h(e,n,l,d,"corner-"+i.name),g=!0)},z=function(){var t=g;g=!1,t&&(I(n,"width",p),I(n,"height",h)),w.unbind(C,"mousemove",F),w.unbind(C,"mouseup",z),S!==C&&(w.unbind(S,"mousemove",F),w.unbind(S,"mouseup",z)),w.remove(r),w.remove(o),w.remove(u),H(n),t&&(Gh(e,n,p,h,"corner-"+i.name),w.setAttrib(n,"style",w.getAttrib(n,"style"))),e.nodeChanged()},H=function(t){W();var s=w.getPos(t,E),f=s.x,g=s.y,k=t.getBoundingClientRect(),O=k.width||k.right-k.left,T=k.height||k.bottom-k.top;n!==t&&(V(),n=t,p=h=0);var D=e.fire("ObjectSelected",{target:t}),A=w.getAttrib(n,y,"1");M(t)&&!D.isDefaultPrevented()?x(_,(function(t,e){var s,p=function(s){var p=B(n)[0];a=s.screenX,c=s.screenY,l=p.clientWidth,d=p.clientHeight,m=d/l,i=t,i.name=e,i.startPos={x:O*t[0]+f,y:T*t[1]+g},v=E.scrollWidth,b=E.scrollHeight,u=w.add(E,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),w.setStyles(u,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=P(n),w.addClass(r,"mce-clonedresizable"),w.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",w.setStyles(r,{left:f,top:g,margin:0}),L(r,O,T),r.removeAttribute(y),E.appendChild(r),w.bind(C,"mousemove",F),w.bind(C,"mouseup",z),S!==C&&(w.bind(S,"mousemove",F),w.bind(S,"mouseup",z)),o=w.add(E,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},l+" &times; "+d)};s=w.get("mceResizeHandle"+e),s&&w.remove(s),s=w.add(E,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===tn.ie&&(s.contentEditable=!1),w.bind(s,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),p(t)})),t.elm=s,w.setStyles(s,{left:O*t[0]+f-s.offsetWidth/2,top:T*t[1]+g-s.offsetHeight/2})})):V(),w.getAttrib(n,y)||n.setAttribute(y,A)},V=function(){W(),n&&n.removeAttribute(y),Ct(_,(function(t,e){var n=w.get("mceResizeHandle"+e);n&&(w.unbind(n),w.remove(n))}))},U=function(n){var r,o,i=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};g||e.removed||(x(w.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute(y)})),o="mousedown"===n.type?n.target:t.getNode(),o=w.$(o).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],i(o,E)&&(q(),r=t.getStart(!0),i(r,o)&&i(t.getEnd(!0),o))?H(o):V())},j=function(t){return nv(zh(e.getBody(),t))},W=function(){Ct(_,(function(t){t.elm&&(w.unbind(t.elm),delete t.elm)}))},q=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};e.on("init",(function(){if(q(),tn.browser.isIE()||tn.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;g||!/^(TABLE|IMG|HR)$/.test(r)||j(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Ii.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(j(t.target)||co(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};w.bind(E,"mscontrolselect",t),e.on("remove",(function(){return w.unbind(E,"mscontrolselect",t)}))}var r=Ii.throttle((function(t){e.composing||U(t)}));e.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",V),e.on("contextmenu longpress",N,!0)})),e.on("remove",W);var $=function(){n=r=u=null};return{isResizable:M,showResizeRect:H,hideResizeRect:V,updateResizeRect:U,destroy:$}},ov=function(t){return io(t)||uo(t)},iv=function(t,e,n){while(t&&t!==e){if(n(t))return t;t=t.parentNode}return null},uv=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),r=gn.toArray(i.getClientRects()),r=r.sort((function(t,n){return t=Math.abs(Math.max(t.top-e,t.bottom-e)),n=Math.abs(Math.max(n.top-e,n.bottom-e)),t-n})),r.length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(u){}}return null},av=function(t,e){var n=t&&t.parentElement?t.parentElement():null;return uo(iv(n,e,ov))?null:t},cv=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)o=i.caretPositionFromPoint(t,e),o&&(r=n.createRange(),r.setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(u){r=uv(t,e,n)}return av(r,n.body)}return r},sv=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},fv=function(t,e,n){while(t&&t!==e){if(n(t))return t;t=t.parentNode}return null},lv=function(t,e,n){return null!==fv(t,e,n)},dv=function(t,e,n){return lv(t,e,(function(t){return t.nodeName===n}))},mv=function(t){return t&&"TABLE"===t.nodeName},gv=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},pv=function(t,e){return yu(t)&&!1===lv(t,e,tp)},hv=function(t,e,n){var r=new Hi(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());while(e=r[n?"prev":"next"]())if(ro(e))return!0},vv=function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e},bv=function(t,e){while(e&&e!==t){if(uo(e))return!0;e=e.parentNode}return!1},yv=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&ro(o)&&e&&t.isEmpty(s))return W.some(Bl(o.parentNode,t.nodeIndex(o)));var f=new Hi(o,s);while(u=f[r?"prev":"next"]()){if("false"===t.getContentEditableParent(u)||pv(u,a))return W.none();if(Zr(u)&&u.nodeValue.length>0)return!1===dv(u,a,"A")?W.some(Bl(u,r?u.nodeValue.length:0)):W.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return W.none();i=u}return n&&i?W.some(Bl(i,0)):W.none()},wv=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var f=jr(o)&&i===o.childNodes.length,l=t.schema.getNonEmptyElements();if(a=n,yu(o))return W.none();if(jr(o)&&i>o.childNodes.length-1&&(a=!1),eo(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0],u)){if(yu(u))return W.none();if(l[u.nodeName]||mv(u))return W.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Zr(o)&&f?o.data.length:0,!e&&o===c.lastChild&&mv(o))return W.none();if(bv(c,o)||yu(o))return W.none();if(o.hasChildNodes()&&!1===mv(o)){u=o;var d=new Hi(o,c);do{if(uo(u)||yu(u)){s=!1;break}if(Zr(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(l[u.nodeName.toLowerCase()]&&!gv(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(Zr(o)&&0===i&&yv(t,f,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),jr(o)&&(u=o.childNodes[i],u||(u=o.childNodes[i-1]),!u||!ro(u)||vv(u,"A")||hv(t,u,!1)||hv(t,u,!0)||yv(t,f,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&Zr(o)&&i===o.nodeValue.length&&yv(t,f,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?W.some(Bl(o,i)):W.none()},xv=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=Bl.fromRangeStart(e);return wv(t,n,!0,r).each((function(t){n&&Bl.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||wv(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),sv(e,r)?W.none():W.some(r)},Cv=function(t,e){return t.splitText(e)},Sv=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Zr(e)?n>0&&n<e.nodeValue.length&&(r=Cv(e,n),e=r.previousSibling,o>n?(o-=n,e=r=Cv(r,o).previousSibling,o=r.nodeValue.length,n=0):o=0):(Zr(e)&&n>0&&n<e.nodeValue.length&&(e=Cv(e,n),n=0),Zr(r)&&o>0&&o<r.nodeValue.length&&(r=Cv(r,o).previousSibling,o=r.nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},kv=function(t){var e=function(e,n){return fh(t,e,n)},n=Sv,r=function(e){return xv(t,e).fold(F,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))};return{walk:e,split:n,normalize:r}};kv.compareRanges=sv,kv.getCaretRangeFromPoint=cv,kv.getSelectedNode=ul,kv.getNode=al;var Ov,Tv=function(t,e){var n=function(e,n){if(!T(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;po(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=To(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return ot(e,(function(e,n){var r=To(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}},Ev=Tv("height",(function(t){var e=t.dom;return _r(t)?e.getBoundingClientRect().height:e.offsetHeight})),_v=function(t){return Ev.get(t)},Dv=function(t,e){var n=t.view(e);return n.fold(A([]),(function(e){var n=t.owner(e),r=Dv(t,n);return[e].concat(r)}))},Av=function(t,e){var n=e.owner(t);return Dv(e,n)},Rv=function(t){var e,n=t.dom===document?W.none():W.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement);return n.map(wn.fromDom)},Nv=function(t){return Gn(t)},Bv=Object.freeze({__proto__:null,view:Rv,owner:Nv}),Mv=function(t){var e=wn.fromDom(document),n=Pr(e),r=Av(t,Bv),o=Mr(t),i=rt(r,(function(t,e){var n=Mr(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return Ar(i.left+o.left+n.left,i.top+o.top+n.top)},Pv=function(t){return"textarea"===Ln(t)},Iv=function(t,e){var n=t.fire("ScrollIntoView",e);return n.isDefaultPrevented()},Lv=function(t,e){t.fire("AfterScrollIntoView",e)},Fv=function(t,e){var n=rr(t);if(0===n.length||Pv(t))return{element:t,offset:e};if(e<n.length&&!Pv(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return Pv(r)?{element:t,offset:e}:"img"===Ln(r)?{element:r,offset:1}:Un(r)?{element:r,offset:Ah(r).length}:{element:r,offset:rr(r).length}},zv=function(t,e){var n=Br(t),r=_v(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Hv=function(t,e){var n=Fv(t,e),r=wn.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">'+du+"</span>");return br(n.element,r),zv(r,(function(){return Tr(r)}))},Vv=function(t){return zv(wn.fromDom(t),E)},Uv=function(t,e,n,r){$v(t,(function(o,i){return Wv(t,e,n,r)}),n)},jv=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};if(!Iv(t,i)){var u=Pr(e).top;n(e,u,r,o),Lv(t,i)}},Wv=function(t,e,n,r){var o=wn.fromDom(t.getBody()),i=wn.fromDom(t.getDoc());Ao(o);var u=Hv(wn.fromDom(n.startContainer),n.startOffset);jv(t,i,e,u,r),u.cleanup()},qv=function(t,e,n,r){var o=wn.fromDom(t.getDoc());jv(t,o,n,Vv(e),r)},$v=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(wn.fromDom(r),wn.fromDom(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},Gv=function(t,e,n,r){var o=t.pos;if(n)Ir(o.left,o.top,r);else{var i=o.top-e+t.height;Ir(o.left,i,r)}},Kv=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;if(u<e)Gv(r,n,!1!==o,t);else if(u>i){var s=c?!1!==o:!0===o;Gv(r,n,s,t)}else a>i&&!c&&Gv(r,n,!0===o,t)},Xv=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Kv(t,e,o,n,r)},Yv=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Kv(t,e,o,n,r);var i=Mv(n.element),u=Hr(window);i.top<u.y?Lr(n.element,!1!==r):i.top>u.bottom&&Lr(n.element,!0===r)},Jv=function(t,e,n){return Uv(t,Xv,e,n)},Qv=function(t,e,n){return qv(t,e,Xv,n)},Zv=function(t,e,n){return Uv(t,Yv,e,n)},tb=function(t,e,n){return qv(t,e,Yv,n)},eb=function(t,e,n){var r=t.inline?Qv:tb;r(t,e,n)},nb=function(t,e,n){var r=t.inline?Jv:Zv;r(t,e,n)},rb=function(){return wn.fromDom(document)},ob=function(t){return t.dom.focus()},ib=function(t){var e=dr(t).dom;return t.dom===e.activeElement},ub=function(t){return void 0===t&&(t=rb()),W.from(t.dom.activeElement).map(wn.fromDom)},ab=function(t){return ub(dr(t)).filter((function(e){return t.dom.contains(e.dom)}))},cb=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},sb={create:cb},fb=ti.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),lb=function(t,e,n,r){return t.fold(e,n,r)},db=function(t){return t.fold(R,R,R)},mb=fb.before,gb=fb.on,pb=fb.after,hb={before:mb,on:gb,after:pb,cata:lb,getStart:db},vb=ti.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),bb=function(t){return vb.exact(t.start,t.soffset,t.finish,t.foffset)},yb=function(t){return t.match({domRange:function(t){return wn.fromDom(t.startContainer)},relative:function(t,e){return hb.getStart(t)},exact:function(t,e,n,r){return t}})},wb=vb.domRange,xb=vb.relative,Cb=vb.exact,Sb=function(t){var e=yb(t);return Xn(e)},kb=sb.create,Ob={domRange:wb,relative:xb,exact:Cb,exactFromRange:bb,getWin:Sb,range:kb},Tb=qe().browser,Eb=function(t,e){var n=Un(e)?Ah(e).length:rr(e).length+1;return t>n?n:t<0?0:t},_b=function(t){return Ob.range(t.start,Eb(t.soffset,t.start),t.finish,Eb(t.foffset,t.finish))},Db=function(t,e){return!Ur(e.dom)&&(In(t,e)||Bn(t,e))},Ab=function(t){return function(e){return Db(t,e.start)&&Db(t,e.finish)}},Rb=function(t){return!0===t.inline||Tb.isIE()},Nb=function(t){return Ob.range(wn.fromDom(t.startContainer),t.startOffset,wn.fromDom(t.endContainer),t.endOffset)},Bb=function(t){var e=t.getSelection(),n=e&&0!==e.rangeCount?W.from(e.getRangeAt(0)):W.none();return n.map(Nb)},Mb=function(t){var e=Xn(t);return Bb(e.dom).filter(Ab(t))},Pb=function(t,e){return W.from(e).filter(Ab(t)).map(_b)},Ib=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),W.some(e)}catch(n){return W.none()}},Lb=function(t){var e=Rb(t)?Mb(wn.fromDom(t.getBody())):W.none();t.bookmark=e.isSome()?e:t.bookmark},Fb=function(t,e){var n=wn.fromDom(t.getBody()),r=Rb(t)?W.from(e):W.none(),o=r.map(Nb).filter(Ab(n));t.bookmark=o.isSome()?o:t.bookmark},zb=function(t){var e=t.bookmark?t.bookmark:W.none();return e.bind((function(e){return Pb(wn.fromDom(t.getBody()),e)})).bind(Ib)},Hb=function(t){zb(t).each((function(e){return t.selection.setRng(e)}))},Vb=function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")},Ub={isEditorUIElement:Vb},jb=function(t){return"nodechange"===t.type&&t.selectionChange},Wb=function(t,e){var n=function(){e.throttle()};Vs.DOM.bind(document,"mouseup",n),t.on("remove",(function(){Vs.DOM.unbind(document,"mouseup",n)}))},qb=function(t){t.on("focusout",(function(){Lb(t)}))},$b=function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))},Gb=function(t,e){var n=qe().browser;n.isIE()?qb(t):$b(t,e),t.on("keyup NodeChange",(function(e){jb(e)||Lb(t)}))},Kb=function(t){var e=gf((function(){Lb(t)}),0);t.on("init",(function(){t.inline&&Wb(t,e),Gb(t,e)})),t.on("remove",(function(){e.cancel()}))},Xb=Vs.DOM,Yb=function(t){return Ub.isEditorUIElement(t)},Jb=function(t){var e=t.classList;return void 0!==e&&(e.contains("tox-edit-area")||e.contains("tox-edit-area__iframe")||e.contains("mce-content-body"))},Qb=function(t,e){var n=fm(t),r=Xb.getParent(e,(function(e){return Yb(e)||!!n&&t.dom.is(e,n)}));return null!==r},Zb=function(t){try{var e=dr(wn.fromDom(t.getElement()));return ub(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(n){return document.body}},ty=function(t,e){var n=e.editor;Kb(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){Ii.setEditorTimeout(n,(function(){var e=t.focusedEditor;Qb(n,Zb(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Ov||(Ov=function(e){var n=t.activeEditor;n&&hr(e).each((function(e){e.ownerDocument===document&&(e===document.body||Qb(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},Xb.bind(document,"focusin",Ov))},ey=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Xb.unbind(document,"focusin",Ov),Ov=null)},ny=function(t){t.on("AddEditor",B(ty,t)),t.on("RemoveEditor",B(ey,t))},ry=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))},oy=function(t){return t.collapsed?W.from(al(t.startContainer,t.startOffset)).map(wn.fromDom):W.none()},iy=function(t,e){return oy(e).bind((function(e){return ou(e)?W.some(e):!1===In(t,e)?W.some(t):W.none()}))},uy=function(t,e){iy(wn.fromDom(t.getBody()),e).bind((function(t){return Jg(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},ay=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},cy=function(t){return ib(t)||ab(t).isSome()},sy=function(t){return t.iframeElement&&ib(wn.fromDom(t.iframeElement))},fy=function(t){var e=t.getBody();return e&&cy(wn.fromDom(e))},ly=function(t){var e=dr(wn.fromDom(t.getElement()));return ub(e).filter((function(e){return!Jb(e.dom)&&Qb(t,e.dom)})).isSome()},dy=function(t){return t.inline?fy(t):sy(t)},my=function(t){return dy(t)||ly(t)},gy=function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===dy(t)&&zb(t).each((function(e){t.selection.setRng(e),r=e}));var o=ry(t,e.getNode());if(t.$.contains(n,o))return ay(o),uy(t,r),void py(t);t.inline||(tn.opera||ay(n),t.getWin().focus()),(tn.gecko||t.inline)&&(ay(n),uy(t,r)),py(t)},py=function(t){return t.editorManager.setActive(t)},hy=function(t,e){t.removed||(e?py(t):gy(t))},vy=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return W.from(i).map(wn.fromDom).map((function(t){return r&&e.collapsed?t:or(t,o(t,u)).getOr(t)})).bind((function(t){return Vn(t)?W.some(t):Yn(t).filter(Vn)})).map((function(t){return t.dom})).getOr(t)},by=function(t,e,n){return vy(t,e,!0,n,(function(t,e){return Math.min(ar(t),e)}))},yy=function(t,e,n){return vy(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},wy=function(t,e){var n=t;while(t&&Zr(t)&&0===t.length)t=e?t.nextSibling:t.previousSibling;return t||n},xy=function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?wy(r.nextSibling,!0):r.parentNode,o=0===u?wy(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n},Cy=function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||by(u,e,e.collapsed),t.isBlock),r=t.getParent(r||yy(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;var a=new Hi(n,u);while((o=a.next())&&o!==r)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i},Sy=function(t,e,n){return W.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(kh(t,o,e,!0),kh(t,o,e,!1)),o}))},ky=function(t,e){return Q(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Oy={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Ty=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o],i)return i}},Ey=function(t){if(!Gu(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},_y=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Dy=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Oy[e]||1);return n&&Ct(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!==typeof t)return void 0!==t&&null!==t&&Ct(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];var o=n.length;while(o--)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){o=n.length;while(o--)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,u=e.length;i<u;i++){var a=e[i];"id"!==a.name&&(o[o.length]={name:a.name,value:a.value},o.map[a.name]=a.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=this,n=[],r=e.firstChild;r;r=Ty(r,e))r.name===t&&n.push(r);return n},t.prototype.children=function(){for(var t=this,e=[],n=t.firstChild;n;n=n.next)e.push(n);return e},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Ty(n,t))e.push(n);var r=e.length;while(r--){n=e[r];n.parent=n.firstChild=n.lastChild=n.next=n.prev=null}}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(_y(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(_y(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Ey(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&Gu(o.value))return!1;if(n&&n(o))return!1}while(o=Ty(o,r));return!0},t.prototype.walk=function(t){return Ty(this,null,t)},t}(),Ay=function(t){var e,n=/data:[^;<"'\s]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Hf("img"),u=0,a=0;while(e=n.exec(t)){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}var f=new RegExp(i+"_[0-9]+","g");return 0===u?{prefix:i,uris:o,html:t,re:f}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join(""),re:f})},Ry=function(t,e){return t.replace(e.re,(function(t){return Rt(e.uris,t).getOr(t)}))},Ny=function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(t);return e?W.some({type:e[1],data:decodeURIComponent(e[2])}):W.none()},By=gn.each,My=gn.trim,Py="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Iy={ftp:21,http:80,https:443,mailto:25},Ly=["img","video"],Fy=function(t,e){return k(t)?!t:!k(e)||!Y(Ly,e)},zy=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?Fy(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},Hy=function(){function t(e,n){e=My(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);By(Py,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.isDomSafe=function(t,e,n){if(void 0===n&&(n={}),n.allow_script_urls)return!0;var r=_a.decode(t).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r)}catch(o){r=unescape(r)}return!/((java|vb)script|mhtml):/i.test(r)&&!zy(n,r,e)},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=Iy[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(By(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return n=a.length-o,r=n<=0?lt(i).join("/"):a.slice(0,n).join("/")+"/"+lt(i).join("/"),0!==r.indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),Vy=gn.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Uy=function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")},jy=Gt((function(){return document.implementation.createHTMLDocument("parser")})),Wy=function(t,e,n){var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),u=1,a=n;while(0!==u){r.lastIndex=a;while(1){var c=r.exec(e);if(null===c)return a;if("!"===c[1]){a=se(c[2],"--")?$y(e,!1,c.index+"!--".length):$y(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!w(s)&&s.index===r.lastIndex){"/"===c[1]?u-=1:Nt(i,c[2])||(u+=1),a=r.lastIndex+s[0].length;break}}}return a},qy=function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))},$y=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&qy(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/g;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length},Gy=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"===typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},Ky=function(t,e){void 0===e&&(e=Va()),t=t||{};var n=jy(),r=n.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var o=t.comment?t.comment:E,i=t.cdata?t.cdata:E,u=t.text?t.text:E,a=t.start?t.start:E,c=t.end?t.end:E,s=t.pi?t.pi:E,f=t.doctype?t.doctype:E,l=function(l,d){void 0===d&&(d="html");var m,g,p,h,v,b,y,w,x,C,S,k,O,T,E,_,D,A,R,N,B=l.html,M=0,P=[],I=0,L=_a.decode,F=gn.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),z="html"===d?0:1,H=function(t){var e,n;e=P.length;while(e--)if(P[e].name===t)break;if(e>=0){for(n=P.length-1;n>=e;n--)t=P[n],t.valid&&c(t.name);P.length=e}},V=function(t,e){return u(Ry(t,l),e)},U=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),o(Ry(e,l)))},j=function(t){return Ry(t,l)},W=function(t,e){var n=t||"",r=!se(n,"--"),o=$y(B,r,e);return t=B.substr(e,o-e),U(r?n+t:t),o+1},q=function(e,o,i,u,a){if(o=o.toLowerCase(),i=j(o in Y?o:L(i||u||a||"")),J&&!w&&!1===Uy(o)){var c=T[o];if(!c&&E){var s=E.length;while(s--)if(c=E[s],c.pattern.test(o))break;-1===s&&(c=null)}if(!c)return;if(c.validValues&&!(i in c.validValues))return}var f="name"===o||"id"===o;f&&e in Vy&&(i in n||i in r)||F[o]&&!Hy.isDomSafe(i,e,t)||w&&(o in F||0===o.indexOf("on"))||(h.map[o]=i,h.push({name:o,value:i}))},$=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),G=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,K=e.getShortEndedElements(),X=t.self_closing_elements||e.getSelfClosingElements(),Y=e.getBoolAttrs(),J=t.validate,Q=t.remove_internals,Z=t.fix_self_closing,tt=e.getSpecialElements(),et=B+">";while(m=$.exec(et)){var nt=m[0];if(M<m.index&&V(L(B.substr(M,m.index-M))),g=m[7])g=g.toLowerCase(),":"===g.charAt(0)&&(g=g.substr(1)),H(g);else if(g=m[8]){if(m.index+nt.length>B.length){V(L(B.substr(m.index))),M=m.index+nt.length;continue}g=g.toLowerCase(),":"===g.charAt(0)&&(g=g.substr(1)),x=g in K,Z&&X[g]&&P.length>0&&P[P.length-1].name===g&&H(g);var rt=Gy(G,m[9]);if(null!==rt){if("all"===rt){M=Wy(e,B,$.lastIndex),$.lastIndex=M;continue}S=!1}if(!J||(C=e.getElementRule(g))){if(S=!0,J&&(T=C.attributes,E=C.attributePatterns),(O=m[9])?(w=-1!==O.indexOf("data-mce-type"),w&&Q&&(S=!1),h=[],h.map={},O.replace(G,(function(t,e,n,r,o){return q(g,e,n,r,o),""}))):(h=[],h.map={}),J&&!w){if(_=C.attributesRequired,D=C.attributesDefault,A=C.attributesForced,R=C.removeEmptyAttrs,R&&!h.length&&(S=!1),A){v=A.length;while(v--)k=A[v],y=k.name,N=k.value,"{$uid}"===N&&(N="mce_"+I++),h.map[y]=N,h.push({name:y,value:N})}if(D){v=D.length;while(v--)k=D[v],y=k.name,y in h.map||(N=k.value,"{$uid}"===N&&(N="mce_"+I++),h.map[y]=N,h.push({name:y,value:N}))}if(_){v=_.length;while(v--)if(_[v]in h.map)break;-1===v&&(S=!1)}if(k=h.map["data-mce-bogus"]){if("all"===k){M=Wy(e,B,$.lastIndex),$.lastIndex=M;continue}S=!1}}S&&a(g,h,x)}else S=!1;if(p=tt[g]){p.lastIndex=M=m.index+nt.length,(m=p.exec(B))?(S&&(b=B.substr(M,m.index-M)),M=m.index+m[0].length):(b=B.substr(M),M=B.length),S&&(b.length>0&&V(b,!0),c(g)),$.lastIndex=M;continue}x||(O&&O.indexOf("/")===O.length-1?S&&c(g):P.push({name:g,valid:S}))}else if(g=m[1])U(g);else if(g=m[2]){var ot=1===z||t.preserve_cdata||P.length>0&&e.isValidChild(P[P.length-1].name,"#cdata");if(!ot){M=W("",m.index+2),$.lastIndex=M;continue}i(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===nt){M=W(g,m.index+nt.length),$.lastIndex=M;continue}if(g=m[5]){if(1!==z){M=W("?",m.index+2),$.lastIndex=M;continue}s(g,m[6])}}M=m.index+nt.length}for(M<B.length&&V(L(B.substr(M))),v=P.length-1;v>=0;v--)g=P[v],g.valid&&c(g.name)},d=function(t,e){void 0===e&&(e="html"),l(Ay(t),e)};return{parse:d}};Ky.findEndTag=Wy;var Xy=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")},Yy=function(t,e){var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=t.schema,i=Xy(t.getTempAttrs(),e),u=o.getShortEndedElements();while(n=r.exec(i)){var a=r.lastIndex,c=n[0].length,s=void 0;s=u[n[1]]?a:Ky.findEndTag(o,i,a),i=i.substring(0,a-c)+i.substring(s),r.lastIndex=a-c}return gu(i)},Jy=Yy,Qy=function(t,e){var n=Od(t),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")},Zy=function(t,e){return Wt(Wt({},t),{format:e,get:!0,getInner:!0})},tw=function(t,e,n,r){var o,i=Zy(e,n),u=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===u.format?gn.trim(Jy(t.serializer,r.innerHTML)):"text"===u.format?t.dom.isEmpty(r)?"":gu(r.innerText||r.textContent):"tree"===u.format?t.serializer.serialize(r,u):Qy(t,t.serializer.serialize(r,u)),Y(["text","tree"],u.format)||uu(wn.fromDom(r))?u.content=o:u.content=gn.trim(o),u.no_events?u.content:t.fire("GetContent",u).content},ew=function(t,e,n){return W.from(t.getBody()).fold(A("tree"===e.format?new Dy("body",11):""),(function(r){return tw(t,e,n,r)}))},nw=gn.each,rw=function(t){var e=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return nw(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(Nt(t,r)){if(n=e[r],"undefined"===typeof n)return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(Nt(e,r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Cp(e)&&!Cp(n)))};return{compare:e}},ow=gn.makeMap,iw=function(t){var e=[];t=t||{};var n=t.indent,r=ow(t.indent_before||""),o=ow(t.indent_after||""),i=_a.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,f,l,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1],d.length>0&&"\n"!==d&&e.push("\n")),e.push("<",t),a)for(s=0,f=a.length;s<f;s++)l=a[s],e.push(" ",l.name,'="',i(l.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1],d.length>0&&"\n"!==d&&e.push("\n"))},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1],r.length>0&&"\n"!==r&&e.push("\n"))},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},uw=function(t,e){void 0===e&&(e=Va());var n=iw(t);t=t||{},t.validate=!("validate"in t)||t.validate;var r=function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r=i[t.type];if(r)r(t);else{var a=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&s.length>1){var f=[];f.map={};var l=e.getElementRule(t.name);if(l){for(var d=0,m=l.attributesOrder.length;d<m;d++){var g=l.attributesOrder[d];if(g in s.map){var p=s.map[g];f.map[g]=p,f.push({name:g,value:p})}}for(d=0,m=s.length;d<m;d++){g=s[d].name;if(!(g in f.map)){p=s.map[g];f.map[g]=p,f.push({name:g,value:p})}}s=f}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(a)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()};return{serialize:r}},aw=new Set;(function(){var t=["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"];Z(t,(function(t){aw.add(t)}))})();var cw=["font","text-decoration","text-emphasis"],sw=function(t,e){return wt(t.parseStyle(t.getAttrib(e,"style")))},fw=function(t){return aw.has(t)},lw=function(t,e){return ft(sw(t,e),(function(t){return!fw(t)}))},dw=function(t){return nt(t,(function(t){return J(cw,(function(e){return se(t,e)}))}))},mw=function(t,e,n){var r=sw(t,e),o=sw(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return ge(o)&&ge(i)&&o!==i};return J(r,(function(t){var e=function(e){return J(e,(function(e){return e===t}))};if(!e(o)&&e(cw)){var n=dw(o);return J(n,i)}return i(t)}))},gw=function(t,e,n){return W.from(n.container()).filter(Zr).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},pw=B(gw,!0,Op),hw=B(gw,!1,Op),vw=function(t){var e=t.container();return Zr(e)&&(0===e.data.length||mu(e.data)&&Fh.isBookmarkNode(e.parentNode))},bw=function(t,e){return function(n){return W.from(dg(t?0:-1,n)).filter(e).isSome()}},yw=function(t){return oo(t)&&"block"===To(wn.fromDom(t),"display")},ww=function(t){return uo(t)&&!Xr(t)},xw=bw(!0,yw),Cw=bw(!1,yw),Sw=bw(!0,co),kw=bw(!1,co),Ow=bw(!0,Yr),Tw=bw(!1,Yr),Ew=bw(!0,ww),_w=bw(!1,ww),Dw=function(t){var e=[],n=t.dom;while(n)e.push(wn.fromDom(n)),n=n.lastChild;return e},Aw=function(t){var e=_f(t,"br"),n=nt(Dw(t).slice(-1),tu);e.length===n.length&&Z(n,Tr)},Rw=function(t){Or(t),xr(t,wn.fromHtml('<br data-mce-bogus="1">'))},Nw=function(t){ur(t).each((function(e){Zn(e).each((function(n){Ji(t)&&tu(e)&&Ji(n)&&Tr(e)}))}))},Bw=function(t){return t.slice(0,-1)},Mw=function(t,e,n){return In(e,t)?Bw(Jn(t,(function(t){return n(t)||Bn(t,e)}))):[]},Pw=function(t,e){return Mw(t,e,F)},Iw=function(t,e){return[t].concat(Pw(t,e))},Lw=function(t,e,n){return Gg(t,e,n,vw)},Fw=function(t,e){return ut(Iw(wn.fromDom(e.container()),t),Ji)},zw=function(t,e,n){return Lw(t,e.dom,n).forall((function(t){return Fw(e,n).fold((function(){return!1===lg(t,n,e.dom)}),(function(r){return!1===lg(t,n,e.dom)&&In(r,wn.fromDom(t.container()))}))}))},Hw=function(t,e,n){return Fw(e,n).fold((function(){return Lw(t,e.dom,n).forall((function(t){return!1===lg(t,n,e.dom)}))}),(function(e){return Lw(t,e.dom,n).isNone()}))},Vw=B(Hw,!1),Uw=B(Hw,!0),jw=B(zw,!1),Ww=B(zw,!0),qw=function(t){return xg(t).exists(tu)},$w=function(t,e,n){var r=nt(Iw(wn.fromDom(n.container()),e),Ji),o=ht(r).getOr(e);return qg(t,o.dom,n).filter(qw)},Gw=function(t,e){return xg(e).exists(tu)||$w(!0,t,e).isSome()},Kw=function(t,e){return Cg(e).exists(tu)||$w(!1,t,e).isSome()},Xw=B($w,!1),Yw=B($w,!0),Jw=function(t){return Bl.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},Qw=function(t,e){var n=nt(Iw(wn.fromDom(e.container()),t),Ji);return ht(n).getOr(t)},Zw=function(t,e){return Jw(e)?hw(e):hw(e)||Yg(Qw(t,e).dom,e).exists(hw)},tx=function(t,e){return Jw(e)?pw(e):pw(e)||Xg(Qw(t,e).dom,e).exists(pw)},ex=function(t){return Y(["pre","pre-wrap"],t)},nx=function(t){return xg(t).bind((function(t){return Si(t,Vn)})).exists((function(t){return ex(To(t,"white-space"))}))},rx=function(t,e){return Yg(t.dom,e).isNone()},ox=function(t,e){return Xg(t.dom,e).isNone()},ix=function(t,e){return rx(t,e)||ox(t,e)||Vw(t,e)||Uw(t,e)||Kw(t,e)||Gw(t,e)},ux=function(t,e){return!nx(e)&&(ix(t,e)||Zw(t,e)||tx(t,e))},ax=function(t,e){return!nx(e)&&(Vw(t,e)||jw(t,e)||Kw(t,e)||Zw(t,e))},cx=function(t){var e=t.container(),n=t.offset();return Zr(e)&&n<e.data.length?Bl(e,n+1):t},sx=function(t,e){return!nx(e)&&(Uw(t,e)||Ww(t,e)||Gw(t,e)||tx(t,e))},fx=function(t,e){return ax(t,e)||sx(t,cx(e))},lx=function(t,e){return kp(t.charAt(e))},dx=function(t){var e=t.container();return Zr(e)&&ce(e.data,su)},mx=function(t){var e=t.split("");return Q(e,(function(t,n){return kp(t)&&n>0&&n<e.length-1&&Tp(e[n-1])&&Tp(e[n+1])?" ":t})).join("")},gx=function(t,e){var n=e.data,r=Bl(e,0);return!(!lx(n,0)||fx(t,r))&&(e.data=" "+n.slice(1),!0)},px=function(t){var e=t.data,n=mx(e);return n!==e&&(t.data=n,!0)},hx=function(t,e){var n=e.data,r=Bl(e,n.length-1);return!(!lx(n,n.length-1)||fx(t,r))&&(e.data=n.slice(0,-1)+" ",!0)},vx=function(t,e){return W.some(e).filter(dx).bind((function(e){var n=e.container(),r=gx(t,n)||px(n)||hx(t,n);return r?W.some(e):W.none()}))},bx=function(t){var e=wn.fromDom(t.getBody());t.selection.isCollapsed()&&vx(e,Bl.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},yx=function(t,e,n){var r=ot(t,(function(r,o){return Op(o)||kp(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+su}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""});return r.str},wx=function(t,e,n){if(0!==n){var r=wn.fromDom(t),o=Ci(r,Ji).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&sx(o,Bl(t,t.data.length)),a=0===e&&ax(o,Bl(t,0));t.replaceData(e,n,yx(i,a,u))}},xx=function(t,e){var n=t.data.slice(e),r=n.length-de(n).length;wx(t,e,r)},Cx=function(t,e){var n=t.data.slice(0,e),r=n.length-me(n).length;wx(t,e-r,r)},Sx=function(t,e,n,r){void 0===r&&(r=!0);var o=me(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),Tr(wn.fromDom(u)),n&&xx(i,o),i},kx=function(t,e){var n=t.container(),r=t.offset();return!1===Bl.isTextPosition(t)&&n===e.parentNode&&r>Bl.before(e).offset()},Ox=function(t,e){return kx(e,t)?Bl(e.container(),e.offset()-1):e},Tx=function(t){return Zr(t)?Bl(t,0):Bl.before(t)},Ex=function(t){return Zr(t)?Bl(t,t.data.length):Bl.after(t)},_x=function(t){return zu(t.previousSibling)?W.some(Ex(t.previousSibling)):t.previousSibling?Qg(t.previousSibling):W.none()},Dx=function(t){return zu(t.nextSibling)?W.some(Tx(t.nextSibling)):t.nextSibling?Jg(t.nextSibling):W.none()},Ax=function(t,e){var n=Bl.before(e.previousSibling?e.previousSibling:e.parentNode);return Yg(t,n).fold((function(){return Xg(t,Bl.after(e))}),W.some)},Rx=function(t,e){return Xg(t,Bl.after(e)).fold((function(){return Yg(t,Bl.before(e))}),W.some)},Nx=function(t,e){return _x(e).orThunk((function(){return Dx(e)})).orThunk((function(){return Ax(t,e)}))},Bx=function(t,e){return Dx(e).orThunk((function(){return _x(e)})).orThunk((function(){return Rx(t,e)}))},Mx=function(t,e,n){return t?Bx(e,n):Nx(e,n)},Px=function(t,e,n){return Mx(t,e,n).map(B(Ox,n))},Ix=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},Lx=function(t){return function(e){return e.dom===t}},Fx=function(t,e){return e&&Nt(t.schema.getBlockElements(),Ln(e))},zx=function(t){if(na(t)){var e=wn.fromHtml('<br data-mce-bogus="1">');return Or(t),xr(t,e),W.some(Bl.before(e.dom))}return W.none()},Hx=function(t,e,n){var r=Zn(t).filter(Un),o=tr(t).filter(Un);return Tr(t),mo(r,o,e,(function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return Sx(o,i,n),r.container()===i?Bl(o,u):r})).orThunk((function(){return n&&(r.each((function(t){return Cx(t.dom,t.dom.length)})),o.each((function(t){return xx(t.dom,0)}))),e}))},Vx=function(t,e){return Nt(t.schema.getTextInlineElements(),Ln(e))},Ux=function(t,e,n,r){void 0===r&&(r=!0);var o=Px(e,t.getBody(),n.dom),i=Ci(n,B(Fx,t),Lx(t.getBody())),u=Hx(n,o,Vx(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):i.bind(zx).fold((function(){r&&Ix(t,e,u)}),(function(n){r&&Ix(t,e,W.some(n))}))},jx=function(t){return function(e){return Bn(t,e)}},Wx=function(t){return _f(t,"td,th")},qx=function(t,e){var n=function(t){return bh(wn.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),u=o.isSome(),a=lo(r,o,Bn).getOr(!1),c=!a&&i&&u;return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:u,isSameTable:a,isMultiTable:c}},$x=function(t,e){return{start:t,end:e}},Gx=function(t,e,n){return{rng:t,table:e,cells:n}},Kx=ti.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Xx=function(t,e){return _i(wn.fromDom(t),"td,th",e)},Yx=function(t){return!Bn(t.start,t.end)},Jx=function(t,e){return bh(t.start,e).bind((function(n){return bh(t.end,e).bind((function(t){return go(Bn(n,t),n)}))}))},Qx=function(t,e){return!Yx(t)&&Jx(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))},Zx=function(t,e){var n=Xx(t.startContainer,e),r=Xx(t.endContainer,e);return lo(n,r,$x)},tC=function(t){return function(e){return bh(e,t).bind((function(t){return vt(Wx(t)).map((function(t){return $x(e,t)}))}))}},eC=function(t){return function(e){return bh(e,t).bind((function(t){return ht(Wx(t)).map((function(t){return $x(t,e)}))}))}},nC=function(t){return function(e){return Jx(e,t).map((function(t){return Gx(e,t,Wx(t))}))}},rC=function(t,e,n,r){if(n.collapsed||!t.forall(Yx))return W.none();if(e.isSameTable){var o=t.bind(nC(r));return W.some({start:o,end:o})}var i=Xx(n.startContainer,r),u=Xx(n.endContainer,r),a=i.bind(tC(r)).bind(nC(r)),c=u.bind(eC(r)).bind(nC(r));return W.some({start:a,end:c})},oC=function(t,e){return at(t,(function(t){return Bn(t,e)}))},iC=function(t){return lo(oC(t.cells,t.rng.start),oC(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},uC=function(t,e,n){return t.exists((function(t){return Qx(t,n)&&Sh(t.start,e)}))},aC=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},cC=function(t,e,n,r){return rC(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=iC(t).getOr([]);if(r&&t.cells.length===o.length)return W.some(Kx.fullTable(t.table));if(o.length>0){if(r)return W.some(Kx.partialTable(o,W.none()));var i=aC(n,e);return W.some(Kx.partialTable(o,W.some(Wt(Wt({},e),{rng:i}))))}return W.none()}))},sC=function(t,e,n,r){return rC(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(iC).getOr([]),u=o.bind(iC).getOr([]);if(i.length>0&&u.length>0){var a=aC(n,e);return W.some(Kx.multiTable(i,u,a))}return W.none()}))},fC=function(t,e){var n=jx(t),r=Zx(e,n),o=qx(e,n);return uC(r,e,n)?r.map((function(t){return Kx.singleCellTable(e,t.start)})):o.isMultiTable?sC(r,o,e,n):cC(r,o,e,n)},lC=function(t){var e=Hn(t)?Zn(t):ur(t);return e.bind(lC).orThunk((function(){return W.some(t)}))},dC=function(t){return Z(t,(function(t){Co(t,"contenteditable"),Rw(t)}))},mC=function(t,e){return W.from(t.dom.getParent(e,t.dom.isBlock)).map(wn.fromDom)},gC=function(t,e,n){n.each((function(n){e?Tr(n):(Rw(n),t.selection.setCursorLocation(n.dom,0))}))},pC=function(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),yC(t,o,e,!1)},hC=function(t){var e=vh(t),n=wn.fromDom(t.selection.getNode());ao(n.dom)&&na(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&J(e,(function(t){return Bn(t,n)}))&&vo(n,"data-mce-selected","1")},vC=function(t,e,n){var r=t.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,u=mC(t,i?o.endContainer:o.startContainer);o.deleteContents(),gC(t,i,u.filter(na));var a=i?e[0]:e[e.length-1];return pC(t,a,r,i),na(a)?W.none():W.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return dC(o),hC(t),!0},bC=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],u=n[n.length-1];pC(t,i,o,!0),pC(t,u,o,!1);var a=na(i)?e:e.slice(1),c=na(u)?n:n.slice(0,-1);return dC(a.concat(c)),r.deleteContents(),hC(t),!0},yC=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o=lC(n).getOr(n),i=wn.fromDom(t.dom.getParent(o.dom,t.dom.isBlock));if(na(i)&&(Rw(i),r&&t.selection.setCursorLocation(i.dom,0)),!Bn(n,i)){var u=so(Yn(i),n)?[]:Qn(i);Z(u.concat(rr(n)),(function(t){Bn(t,i)||In(t,i)||!na(t)||Tr(t)}))}return!0},wC=function(t,e){return Ux(t,!1,e),!0},xC=function(t,e,n){return fC(e,n).map((function(e){return e.fold(B(yC,t),B(wC,t),B(vC,t),B(bC,t))}))},CC=function(t,e){return _C(t,e)},SC=function(t,e,n,r){return TC(e,r).fold((function(){return xC(t,e,n)}),(function(e){return CC(t,e)})).getOr(!1)},kC=function(t,e,n){var r=wn.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?vC(t,n,W.none()):SC(t,r,o,e)},OC=function(t,e){return ut(Iw(e,t),iu)},TC=function(t,e){return ut(Iw(e,t),qn("caption"))},EC=function(t,e,n,r,o){return $g(n,t.getBody(),o).bind((function(t){return OC(e,wn.fromDom(t.getNode())).map((function(t){return!1===Bn(t,r)}))}))},_C=function(t,e){return Rw(e),t.selection.setCursorLocation(e.dom,0),W.some(!0)},DC=function(t,e,n,r){return Jg(t.dom).bind((function(o){return Qg(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)},AC=function(t,e){return _C(t,e)},RC=function(t,e,n){return TC(t,wn.fromDom(n.getNode())).map((function(t){return!1===Bn(t,e)}))},NC=function(t,e,n,r,o){return $g(n,t.getBody(),o).bind((function(i){return DC(r,n,o,i)?AC(t,r):RC(e,r,i)})).or(W.some(!0))},BC=function(t,e,n,r){var o=Bl.fromRangeStart(t.selection.getRng());return OC(n,r).bind((function(r){return na(r)?_C(t,r):EC(t,n,e,r,o)})).getOr(!1)},MC=function(t,e,n,r){var o=Bl.fromRangeStart(t.selection.getRng());return na(r)?_C(t,r):NC(t,n,e,r,o)},PC=function(t,e){return t?Ow(e):Tw(e)},IC=function(t,e){var n=Bl.fromRangeStart(t.selection.getRng());return PC(e,n)||qg(e,t.getBody(),n).exists((function(t){return PC(e,t)}))},LC=function(t,e,n){var r=wn.fromDom(t.getBody());return TC(r,n).fold((function(){return BC(t,e,r,n)||IC(t,e)}),(function(n){return MC(t,e,r,n).getOr(!1)}))},FC=function(t,e){var n=wn.fromDom(t.selection.getStart(!0)),r=vh(t);return t.selection.isCollapsed()&&0===r.length?LC(t,e,n):kC(t,n,r)},zC=function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o},HC=function(t){var e=Bl.fromRangeStart(t),n=Bl.fromRangeEnd(t),r=t.commonAncestorContainer;return qg(!1,r,n).map((function(o){return!lg(e,n,r)&&lg(e,o,r)?zC(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},VC=function(t){return t.collapsed?t:HC(t)},UC=function(t){return t.firstChild&&t.firstChild===t.lastChild},jC=function(t){return"br"===t.name||t.value===su},WC=function(t,e){var n=t.getBlockElements();return n[e.name]&&UC(e)&&jC(e.firstChild)},qC=function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||WC(t,e))},$C=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),qC(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},GC=function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t},KC=function(t,e,n){var r=e.serialize(n),o=t.createFragment(r);return GC(o)},XC=function(t){return nt(t.childNodes,(function(t){return"LI"===t.nodeName}))},YC=function(t){return t.data===su||ro(t)},JC=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&YC(t.firstChild)},QC=function(t){return!t.firstChild||JC(t)},ZC=function(t){return t.length>0&&QC(t[t.length-1])?t.slice(0,-1):t},tS=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},eS=function(t,e){return!!tS(t,e)},nS=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]},rS=function(t,e){var n=Bl.before(t),r=Lg(e),o=r.next(n);return o?o.toRange():null},oS=function(t,e){var n=Bl.after(t),r=Lg(e),o=r.prev(n);return o?o.toRange():null},iS=function(t,e,n,r){var o=nS(t,r),i=t.parentNode;return i.insertBefore(o[0],t),gn.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),oS(e[e.length-1],n)},uS=function(t,e,n){var r=t.parentNode;return gn.each(e,(function(e){r.insertBefore(e,t)})),rS(t,n)},aS=function(t,e,n,r){return r.insertAfter(e.reverse(),t),oS(e[0],n)},cS=function(t,e,n,r){var o=KC(e,t,r),i=tS(e,n.startContainer),u=ZC(XC(o.firstChild)),a=1,c=2,s=e.getRoot(),f=function(t){var r=Bl.fromRangeStart(n),o=Lg(e.getRoot()),u=t===a?o.prev(r):o.next(r);return!u||tS(e,u.getNode())!==i};return f(a)?uS(i,u,s):f(c)?aS(i,u,s,e):iS(i,u,s,n)},sS=function(t,e,n){var r=wn.fromDom(t.getRoot());return n=ax(r,Bl.fromRangeStart(e))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),n=sx(r,Bl.fromRangeEnd(e))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," "),n},fS=ao,lS=function(t,e,n){if(null!==n){var r=t.getParent(e.endContainer,fS);return n===r&&Sh(wn.fromDom(n),e)}return!1},dS=function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}},mS=function(t,e){W.from(t.getParent(e,"td,th")).map(wn.fromDom).each(Nw)},gS=function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=rw(r);gn.each(r.select("*[data-mce-fragment]"),(function(t){var e=k(n[t.nodeName.toLowerCase()]);if(e&&lw(r,t))for(var u=t.parentNode;k(u)&&u!==o;u=u.parentNode){var a=mw(r,t,u);if(a)break;if(i.compare(u,t)){r.remove(t,!0);break}}}))}},pS=function(t){var e=t;while(e=e.walk())1===e.type&&e.attr("data-mce-fragment","1")},hS=function(t){gn.each(t.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")}))},vS=function(t){return!!t.getAttribute("data-mce-fragment")},bS=function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]},yS=function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=zh(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var u=r.createRng(),a=e.previousSibling;if(Zr(a)){if(u.setStart(a,a.nodeValue.length),!tn.ie){var c=e.nextSibling;Zr(c)&&(a.appendData(c.data),c.parentNode.removeChild(c))}}else u.setStartBefore(e),u.setEndBefore(e);var s=function(e){var n=Bl.fromRangeStart(e),r=Lg(t.getBody());if(n=r.next(n),n)return n.toRange()},f=r.getParent(e,r.isBlock);r.remove(e),f&&r.isEmpty(f)&&(t.$(f).empty(),u.setStart(f,0),u.setEnd(f,0),fS(f)||vS(f)||!(n=s(u))?r.add(f,r.create("br",{"data-mce-bogus":"1"})):(u=n,r.remove(f))),o.setRng(u)}},wS=function(t){var e=t.dom,n=VC(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,fS);lS(e,n,r)?yC(t,n,wn.fromDom(r)):t.getDoc().execCommand("Delete",!1,null)},xS=function(t,e,n){var r,o,i,u=t.selection,a=t.dom;/^ | $/.test(e)&&(e=sS(a,u.getRng(),e));var c=t.parser,s=n.merge,f=uw({validate:im(t)},t.schema),l='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{e=d.content,-1===e.indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,l),o=u.getRng();var m=o.startContainer||(o.parentElement?o.parentElement():null),g=t.getBody();m===g&&u.isCollapsed()&&a.isBlock(g.firstChild)&&bS(t,g.firstChild)&&a.isEmpty(g.firstChild)&&(o=a.createRng(),o.setStart(g.firstChild,0),o.setEnd(g.firstChild,0),u.setRng(o)),u.isCollapsed()||wS(t),r=u.getNode();var p={context:r.nodeName.toLowerCase(),data:n.data,insert:!0},h=c.parse(e,p);if(!0===n.paste&&$C(t.schema,h)&&eS(a,r))return o=cS(f,a,u.getRng(),h),u.setRng(o),void t.fire("SetContent",d);if(pS(h),i=h.lastChild,"mce_marker"===i.attr("id")){var v=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!a.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(v,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),p.invalid){t.selection.setContent(l),r=u.getNode();var b=t.getBody();9===r.nodeType?r=i=b:i=r;while(i!==b)r=i,i=i.parentNode;e=r===b?b.innerHTML:a.getOuterHTML(r),e=f.serialize(c.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return f.serialize(h)})))),r===b?a.setHTML(b,e):a.setOuterHTML(r,e)}else e=f.serialize(h),dS(t,e,r);gS(t,s),yS(t,a.get("mce_marker")),hS(t.getBody()),mS(a,u.getStart()),t.fire("SetContent",d),t.addVisual()}},CS=function(t,e){e(t),t.firstChild&&CS(t.firstChild,e),t.next&&CS(t.next,e)},SS=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&CS(n.firstChild,(function(n){Z(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),Z(e,(function(t){"string"===typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)Nt(r,u)&&i.push(r[u]);for(var a in o)Nt(o,a)&&i.push(o[a]);return i},kS=function(t,e,n){var r=SS(t,e,n);Z(r,(function(t){Z(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},OS="html",TS=function(t){return t instanceof Dy},ES=function(t){dy(t)&&Jg(t.getBody()).each((function(e){var n=e.getNode(),r=Yr(n)?Jg(n).getOr(e):e;t.selection.setRng(r.toRange())}))},_S=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&ES(t)},DS=function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===e.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+o+"</li>");var i=Od(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,Td(t),n)):n||(n='<br data-mce-bogus="1">'),_S(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=uw({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=uu(wn.fromDom(e))?n:gn.trim(n),_S(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content},AS=function(t,e,n,r){kS(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=uw({validate:t.validate},t.schema).serialize(n);return r.content=uu(wn.fromDom(e))?o:gn.trim(o),_S(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n},RS=function(t,e){return Wt(Wt({format:OS},t),{set:!0,content:TS(e)?"":e})},NS=function(t,e,n){var r=RS(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return TS(e)||(e=o.content),W.from(t.getBody()).fold(A(e),(function(n){return TS(e)?AS(t,n,e,o):DS(t,n,e,o)}))},BS=function(t,e){return ki(t,e).isSome()},MS=function(t){return O(t)?t:F},PS=function(t,e,n){var r=t.dom,o=MS(n);while(r.parentNode){r=r.parentNode;var i=wn.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return W.none()},IS=function(t,e,n){var r=e(t),o=MS(n);return r.orThunk((function(){return o(t)?W.none():PS(t,e,o)}))},LS=Ip,FS=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(Wp(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return!0}return!1},zS=function(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,(function(e){return!!FS(t,e,n)||(e.parentNode===i||!!US(t,e,n,r,!0))})),!!US(t,e,n,r,o))},HS=function(t,e,n){return!!LS(e,n.inline)||(!!LS(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},VS=function(t,e,n,r,o,i){var u=n[r];if(O(n.onmatch))return n.onmatch(e,n,r);if(u)if(C(u.length)){for(var a in u)if(Nt(u,a)){var c="attributes"===r?t.getAttrib(e,a):Fp(t,e,a),s=Pp(u[a],i),f=S(c)||pe(c);if(f&&S(s))continue;if(o&&f&&!n.exact)return!1;if((!o||n.exact)&&!LS(c,Lp(t,s,a)))return!1}}else for(var l=0;l<u.length;l++)if("attributes"===r?t.getAttrib(e,u[l]):Fp(t,e,u[l]))return!0;return!0},US=function(t,e,n,r,o){var i=t.formatter.get(n),u=t.dom;if(i&&e)for(var a=0;a<i.length;a++){var c=i[a];if(HS(t.dom,e,c)&&VS(u,e,c,"attributes",o,r)&&VS(u,e,c,"styles",o,r)){var s=c.classes;if(s)for(var f=0;f<s.length;f++)if(!t.dom.hasClass(e,Pp(s[f],r)))return;return c}}},jS=function(t,e,n,r,o){if(r)return zS(t,r,e,n,o);if(r=t.selection.getNode(),zS(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!zS(t,i,e,n,o))},WS=function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&US(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r},qS=function(t,e){var n=function(e){return Bn(e,wn.fromDom(t.getBody()))},r=function(e,n){return US(t,e.dom,n)?W.some(n):W.none()};return W.from(t.selection.getStart(!0)).bind((function(t){return IS(wn.fromDom(t),(function(t){return yt(e,(function(e){return r(t,e)}))}),n)})).getOrNull()},$S=function(t,e){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=t.selection.getStart(),i=Hp(r,o),u=n.length-1;u>=0;u--){var a=n[u];if(!Wp(a)||k(a.defaultBlock))return!0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],a.selector))return!0}return!1},GS=function(t,e,n){return ot(n,(function(n,r){var o=Vp(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},KS=du,XS="_mce_caret",YS=function(t,e){return t.importNode(e,!0)},JS=function(t){var e=[];while(t){if(3===t.nodeType&&t.nodeValue!==KS||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e},QS=function(t){return JS(t).length>0},ZS=function(t){if(t){var e=new Hi(t,t);for(t=e.current();t;t=e.next())if(Zr(t))return t}return null},tk=function(t){var e=wn.fromTag("span");return bo(e,{id:XS,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&xr(e,wn.fromText(KS)),e},ek=function(t){var e=ZS(t);return e&&e.nodeValue.charAt(0)===KS&&e.deleteData(0,1),e},nk=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(QS(e))Ux(t,!1,wn.fromDom(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,f=i.endOffset,l=ek(e);r.remove(e,!0),a===l&&c>0&&i.setStart(l,c-1),s===l&&f>0&&i.setEnd(l,f-1),u&&r.isEmpty(u)&&Rw(wn.fromDom(u)),o.setRng(i)}},rk=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)nk(t,e,n);else if(e=ep(t.getBody(),o.getStart()),!e)while(e=r.get(XS))nk(t,e,!1)},ok=function(t,e,n){var r=t.dom,o=r.getParent(n,B(Rp,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(Aw(wn.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))},ik=function(t,e){return t.appendChild(e),e},uk=function(t,e){var n=rt(t,(function(t,e){return ik(t,e.cloneNode(!1))}),e);return ik(n,n.ownerDocument.createTextNode(KS))},ak=function(t,e,n,r,o,i){var u=t.formatter,a=t.dom,c=nt(wt(u.get()),(function(t){return t!==r&&!ce(t,"removeformat")})),s=GS(t,n,c),f=nt(s,(function(e){return!Up(t,e,r)}));if(f.length>0){var l=n.cloneNode(!1);return a.add(e,l),u.remove(r,o,l,i),a.remove(l),W.some(l)}return W.none()},ck=function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer,s=c.nodeValue;r=ep(t.getBody(),i.getStart()),r&&(o=ZS(r));var f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(s&&a>0&&a<s.length&&f.test(s.charAt(a))&&f.test(s.charAt(a-1))){var l=i.getBookmark();u.collapse(!0);var d=sh(t,u,t.formatter.get(e));d=Sv(d),t.formatter.apply(e,n,d),i.moveToBookmark(l)}else r&&o.nodeValue===KS||(r=YS(t.getDoc(),tk(!0).dom),o=r.firstChild,u.insertNode(r),a=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,a)},sk=function(t,e,n,r){var o,i,u,a=t.dom,c=t.selection,s=[],f=c.getRng(),l=f.startContainer,d=f.startOffset;i=l,3===l.nodeType&&(d!==l.nodeValue.length&&(o=!0),i=i.parentNode);while(i){if(US(t,i,e,n,r)){u=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(u)if(o){var m=c.getBookmark();f.collapse(!0);var g=sh(t,f,t.formatter.get(e),!0);g=Sv(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var p=ep(t.getBody(),u),h=tk(!1).dom;ok(t,h,null!==p?p:u);var v=ak(t,h,u,e,n,r),b=uk(s.concat(v.toArray()),h);nk(t,p,!1),c.setCursorLocation(b,1),a.isEmpty(u)&&a.remove(u)}},fk=function(t,e){var n=t.selection,r=t.getBody();rk(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==KS||rk(t,ep(r,n.getStart())),37!==e&&39!==e||rk(t,ep(r,n.getStart()))},lk=function(t){t.on("mouseup keydown",(function(e){fk(t,e.keyCode)}))},dk=function(t,e){var n=tk(!1),r=uk(e,n.dom);return br(wn.fromDom(t),n),Tr(wn.fromDom(t)),Bl(r,0)},mk=function(t,e){var n=t.schema.getTextInlineElements();return Nt(n,Ln(e))&&!tp(e.dom)&&!Kr(e.dom)},gk=function(t){return tp(t.dom)&&QS(t.dom)},pk={},hk=zt,vk=Lt,bk=function(t,e){var n=pk[t];n||(pk[t]=[]),pk[t].push(e)},yk=function(t,e){vk(pk[t],(function(t){t(e)}))};bk("pre",(function(t){var e,n=t.selection.getRng(),r=function(t){return i(t.previousSibling)&&-1!==Ht(e,t.previousSibling)},o=function(t,e){Bs(e).remove(),Bs(t).append("<br><br>").append(e.childNodes)},i=Wr(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),vk(hk(hk(e,i),r),(function(t){o(t.previousSibling,t)})))}));var wk=gn.each,xk=function(t){return jr(t)&&!Cp(t)&&!tp(t)&&!Kr(t)},Ck=function(t,e){for(var n=t;n;n=n[e]){if(Zr(n)&&ge(n.data))return t;if(jr(n)&&!Cp(n))return n}return t},Sk=function(t,e,n){var r=rw(t);if(e&&n&&(e=Ck(e,"previousSibling"),n=Ck(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),gn.each(gn.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},kk=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=Sk(t,Ap(r),r);Sk(t,o,Ap(o,!0))}},Ok=function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";wk(t.select(r,n),(function(n){xk(n)&&wk(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}},Tk=function(t,e,n){wk(t.childNodes,(function(t){xk(t)&&(e(t)&&n(t),t.hasChildNodes()&&Tk(t,e,n))}))},Ek=function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)},_k=function(t,e){return function(n){return!(!n||!Fp(t,n,e))}},Dk=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),Ek(t,r)}},Ak=ti.generate([{keep:[]},{rename:["name"]},{removed:[]}]),Rk=/^(src|href|style)$/,Nk=gn.each,Bk=Ip,Mk=function(t){return/^(TR|TH|TD)$/.test(t.nodeName)},Pk=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Ik=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(jr(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Zr(r)&&n&&o>=r.nodeValue.length&&(r=new Hi(r,t.getBody()).next()||r),Zr(r)&&!n&&0===o&&(r=new Hi(r,t.getBody()).prev()||r),r},Lk=function(t,e){var n=e?"firstChild":"lastChild";if(Mk(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},Fk=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},zk=function(t,e,n,r,o){var i=wn.fromDom(e),u=wn.fromDom(t.create(r,o)),a=n?nr(i):er(i);return kr(u,a),n?(br(i,u),wr(u,i)):(yr(i,u),xr(u,i)),u.dom},Hk=function(t,e,n){return!(!qp(n)||!Bk(e,n.inline))||(!(!jp(n)||!Bk(e,n.block))||(Wp(n)?jr(e)&&t.is(e,n.selector):void 0))},Vk=function(t,e){return e.links&&"A"===t.nodeName},Uk=function(t,e,n,r){var o=Ap(e,n,r);return S(o)||"BR"===o.nodeName||t.isBlock(o)},jk=function(t,e,n){var r,o=e.parentNode,i=t.dom,u=Od(t);jp(n)&&(u?o===i.getRoot()&&(n.list_block&&Bk(e,n.list_block)||Z(bt(e.childNodes),(function(e){Np(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=Fk(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(Uk(i,e,!1)||Uk(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Uk(i,e,!0)||Uk(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),$p(n)&&!Bk(n.inline,e)||i.remove(e,!0)},Wk=function(t,e,n,r,o){var i,u=t.dom;if(!Hk(u,r,e)&&!Vk(r,e))return Ak.keep();var a=r;if(qp(e)&&"all"===e.remove&&y(e.preserve_attributes)){var c=nt(u.getAttribs(a),(function(t){return Y(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),Z(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return Ak.rename("span")}if("all"!==e.remove){Nk(e.styles,(function(t,r){t=Lp(u,Pp(t,n),r+""),T(r)&&(r=t,o=null),(e.remove_similar||!o||Bk(Fp(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),Nk(e.attributes,(function(t,r){var i;if(t=Pp(t,n),T(r)&&(r=t,o=null),e.remove_similar||!o||Bk(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r),t&&(i="",Z(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i)))return void u.setAttrib(a,r,i);if(Rk.test(r)&&a.removeAttribute("data-mce-"+r),"style"===r&&Wr(["li"])(a)&&"none"===u.getStyle(a,"list-style-type"))return a.removeAttribute(r),void u.setStyle(a,"list-style-type","none");"class"===r&&a.removeAttribute("className"),a.removeAttribute(r)}})),Nk(e.classes,(function(t){t=Pp(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),f=0;f<s.length;f++){var l=s[f].nodeName;if(0!==l.indexOf("_")&&0!==l.indexOf("data-"))return Ak.keep()}}return"none"!==e.remove?(jk(t,a,e),Ak.removed()):Ak.keep()},qk=function(t,e,n,r,o){return Wk(t,e,n,r,o).fold(F,(function(e){return t.dom.rename(r,e),!0}),z)},$k=function(t,e,n,r,o){var i;return Z(Hp(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=US(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i},Gk=function(t,e,n,r){return Wk(t,e,n,r,r).fold(A(r),(function(e){var n=t.dom.createFragment();return n.appendChild(r),t.dom.rename(r,e)}),A(null))},Kk=function(t,e,n,r,o,i,u,a){var c,s,f,l=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=l.clone(m,!1);for(var g=0;g<e.length;g++)if(c=Gk(t,e[g],a,c),null===c)break;c&&(s&&c.appendChild(s),f||(f=c),s=c)}!i||u.mixed&&l.isBlock(n)||(r=l.split(n,r)),s&&(o.parentNode.insertBefore(s,o),f.appendChild(o),qp(u)&&kk(l,u,a,s))}return r},Xk=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,f=function(r){var a=$k(t,r,e,n,o);return Kk(t,i,a,r,r,!0,u,n)},l=function(t){return Cp(t)&&jr(t)&&("_start"===t.id||"_end"===t.id)},d=function(e){return J(i,(function(r){return qk(t,r,n,e,e)}))},m=function(e){var n=!0,r=!1;jr(e)&&c.getContentEditable(e)&&(n=a,a="true"===c.getContentEditable(e),r=!0);var o=bt(e.childNodes);if(a&&!r){var s=d(e),f=s||J(i,(function(t){return HS(c,e,t)})),l=e.parentNode;!f&&k(l)&&Gp(u)&&d(l)}if(u.deep&&o.length){for(var g=0;g<o.length;g++)m(o[g]);r&&(a=n)}var p=["underline","line-through","overline"];Z(p,(function(n){jr(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&zp(c,e.parentNode)===n&&qk(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))},g=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return l(n)&&(n=n[t?"firstChild":"lastChild"]),Zr(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},p=function(e){var n,r,o=sh(t,e,i,e.collapsed);if(u.split){if(o=Sv(o),n=Ik(t,o,!0),r=Ik(t,o),n!==r){if(n=Lk(n,!0),r=Lk(r,!1),Pk(c,n,r)){var a=W.from(n.firstChild).getOr(n);return f(zk(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void g(!0)}if(Pk(c,r,n)){a=W.from(r.lastChild).getOr(r);return f(zk(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void g(!1)}n=Fk(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Fk(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),fh(c,s,(function(t){Z(t,(function(t){Cp(t)||Cp(t.parentNode)||f(t)}))})),f(n),f(r),n=g(!0),r=g()}else n=r=f(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}fh(c,o,(function(t){Z(t,m)}))};if(r){if(Ep(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),p(h)}else p(r);tv(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&qp(u)&&!vh(t).length?sk(t,e,n,o):(Eh(s,!0,(function(){Th(t,p)})),qp(u)&&jS(t,e,n,s.getStart())&&Dp(c,s,s.getRng()),t.nodeChanged()),tv(t,e,r,n);else{r=s.getNode();for(var v=0;v<i.length;v++)if(i[v].ceFalseOverride&&qk(t,i[v],n,r,r))break;tv(t,e,r,n)}},Yk=gn.each,Jk=function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=zp(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(gn.walk(r,o,"childNodes"),o(r))},Qk=function(t,e,n,r){e.styles&&e.styles.backgroundColor&&Tk(r,_k(t,"fontSize"),Dk(t,"backgroundColor",Pp(e.styles.backgroundColor,n)))},Zk=function(t,e,n,r){!qp(e)||"sub"!==e.inline&&"sup"!==e.inline||(Tk(r,_k(t,"fontSize"),Dk(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))},tO=function(t,e,n,r){Yk(e,(function(e){qp(e)&&Yk(t.dom.select(e.inline,r),(function(r){xk(r)&&qk(t,e,n,r,e.exact?r:null)})),Ok(t.dom,e,r)}))},eO=function(t,e,n,r,o){US(t,o.parentNode,n,r)&&qk(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(US(t,i,n,r))return qk(t,e,r,o),!0}))},nO=gn.each,rO=function(t){return jr(t)&&!Cp(t)&&!tp(t)&&!Kr(t)},oO=function(t,e,n,r){if(sm(t)&&qp(e)){var o=Fa(t.schema),i=BS(wn.fromDom(n),(function(t){return tp(t.dom)}));return Bt(o,r)&&na(wn.fromDom(n.parentNode),!1)&&!i}return!1},iO=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(void 0===e&&(e=i),O(e.onformat)&&e.onformat(t,e,n,r),nO(e.styles,(function(e,r){a.setStyle(t,r,Pp(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}nO(e.attributes,(function(e,r){a.setAttrib(t,r,Pp(e,n))})),nO(e.classes,(function(e){e=Pp(e,n),a.hasClass(t,e)||a.addClass(t,e)}))},f=function(t,e){var n=!1;return nO(t,(function(t){return!!Wp(t)&&(k(t.collapsed)&&t.collapsed!==u?void 0:a.is(e,t.selector)&&!tp(e)?(s(e,t),n=!0,!1):void 0)})),n},l=function(t){if(v(t)){var e=a.create(t);return s(e),e}return null},d=function(r,u,a){var c=[],d=!0,m=i.inline||i.block,g=l(m);fh(r,u,(function(u){var l,p=function(u){var h=!1,v=d,b=u.nodeName.toLowerCase(),y=u.parentNode,w=y.nodeName.toLowerCase();if(jr(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),h=!0),ro(u)&&!oO(t,i,u,w))return l=null,void(jp(i)&&r.remove(u));if(jp(i)&&i.wrapper&&US(t,u,e,n))l=null;else{if(d&&!h&&jp(i)&&!i.wrapper&&Rp(t,b)&&Np(t,w,m)){var x=r.rename(u,m);return s(x),c.push(x),void(l=null)}if(Wp(i)){var C=f(o,u);if(!C&&k(y)&&Gp(i)&&(C=f(o,y)),!qp(i)||C)return void(l=null)}!d||h||!Np(t,m,b)||!Np(t,w,m)||!a&&Zr(u)&&mu(u.data)||tp(u)||qp(i)&&r.isBlock(u)?(l=null,Z(bt(u.childNodes),p),h&&(d=v),l=null):(l||(l=r.clone(g,!1),u.parentNode.insertBefore(l,u),c.push(l)),l.appendChild(u))}};Z(u,p)})),!0===i.links&&Z(c,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),Z(bt(t.childNodes),e)};e(t)})),Z(c,(function(u){var a=function(t){var e=0;return Z(t.childNodes,(function(t){Mp(t)||Cp(t)||e++})),e},f=function(t){var e=ut(t.childNodes,rO).filter((function(t){return HS(r,t,i)}));return e.map((function(e){var n=r.clone(e,!1);return s(n),r.replace(n,t,!0),r.remove(e,!0),n})).getOr(t)},l=a(u);!(c.length>1)&&r.isBlock(u)||0!==l?(qp(i)||jp(i)&&i.wrapper)&&(i.exact||1!==l||(u=f(u)),tO(t,o,n,u),eO(t,i,e,n,u),Qk(r,i,n,u),Jk(r,i,n,u),Zk(r,i,n,u),kk(r,i,n,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(Ep(r)){if(!f(o,r)){var m=a.createRng();m.setStartBefore(r),m.setEndAfter(r),d(a,sh(t,m,o),!0)}}else d(a,r,!0);else if(u&&qp(i)&&!vh(t).length)ck(t,e,n);else{var g=c.getNode(),p=o[0];t.settings.forced_root_block||!p.defaultBlock||a.getParent(g,a.isBlock)||iO(t,p.defaultBlock),c.setRng(VC(c.getRng())),Eh(c,!0,(function(){Th(t,(function(e,n){var r=n?e:sh(t,e,o);d(a,r,!1)}))})),Dp(a,c,c.getRng()),t.nodeChanged()}yk(e,t)}Zh(t,e,r,n)}else{r=c.getNode();for(var h=0,b=o.length;h<b;h++){var y=o[h];if(y.ceFalseOverride&&Wp(y)&&a.is(r,y.selector)){s(r,y);break}}Zh(t,e,r,n)}},uO=function(t){return Nt(t,"vars")},aO=function(t,e){t.set({}),e.on("NodeChange",(function(n){lO(e,n.element,t.get())})),e.on("FormatApply FormatRemove",(function(n){var r=W.from(n.node).map((function(t){return Ep(t)?t:t.startContainer})).bind((function(t){return jr(t)?W.some(t):W.from(t.parentElement)})).getOrThunk((function(){return cO(e)}));lO(e,r,t.get())}))},cO=function(t){return t.selection.getStart()},sO=function(t,e,n,r,o){var i=function(e){var i=t.formatter.matchNode(e,n,null!==o&&void 0!==o?o:{},r);return!C(i)},u=function(e){return!!FS(t,e,n)||!r&&k(t.formatter.matchNode(e,n,o,!0))};return it(e,i,u)},fO=function(t,e){var n=null!==e&&void 0!==e?e:cO(t);return nt(Hp(t.dom,n),(function(t){return jr(t)&&!Kr(t)}))},lO=function(t,e,n){var r=fO(t,e);Ct(n,(function(n,o){var i=function(n){var i=sO(t,r,o,n.similar,uO(n)?n.vars:void 0),u=i.isSome();if(n.state.get()!==u){n.state.set(u);var a=i.getOr(e);uO(n)?n.callback(u,{node:a,format:o,parents:r}):Z(n.callbacks,(function(t){return t(u,{node:a,format:o,parents:r})}))}};Z([n.withSimilar,n.withoutSimilar],i),Z(n.withVars,i)}))},dO=function(t,e,n,r,o,i){var u=e.get();Z(n.split(","),(function(e){var n=Rt(u,e).getOrThunk((function(){var t={withSimilar:{state:Ys(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Ys(!1),similar:!1,callbacks:[]},withVars:[]};return u[e]=t,t})),a=function(){var n=fO(t);return sO(t,n,e,o,i).isSome()};if(C(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(a())}else n.withVars.push({state:Ys(a()),similar:o,vars:i,callback:r})})),e.set(u)},mO=function(t,e,n){var r=t.get();Z(e.split(","),(function(t){return Rt(r,t).each((function(e){r[t]={withSimilar:Wt(Wt({},e.withSimilar),{callbacks:nt(e.withSimilar.callbacks,(function(t){return t!==n}))}),withoutSimilar:Wt(Wt({},e.withoutSimilar),{callbacks:nt(e.withoutSimilar.callbacks,(function(t){return t!==n}))}),withVars:nt(e.withVars,(function(t){return t.callback!==n}))}}))})),t.set(r)},gO=function(t,e,n,r,o,i){return null===e.get()&&aO(e,t),dO(t,e,n,r,o,i),{unbind:function(){return mO(e,n,r)}}},pO=function(t,e,n,r){var o=t.formatter.get(e);!jS(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?iO(t,e,n,r):Xk(t,e,n,r)},hO=function(t,e){var n=e||document,r=n.createDocumentFragment();return Z(t,(function(t){r.appendChild(t.dom)})),wn.fromDom(r)},vO=function(t,e,n){return{element:t,width:e,rows:n}},bO=function(t,e){return{element:t,cells:e}},yO=function(t,e){return{x:t,y:e}},wO=function(t,e){var n=parseInt(yo(t,e),10);return isNaN(n)?1:n},xO=function(t,e,n,r,o){for(var i=wO(o,"rowspan"),u=wO(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=bO(Kf(r),[]));for(var s=e;s<e+u;s++){var f=a[c].cells;f[s]=c===n&&s===e?o:Gf(o)}}},CO=function(t,e,n){var r=t.rows,o=r[n]?r[n].cells:[];return!!o[e]},SO=function(t,e,n){while(CO(t,e,n))e++;return e},kO=function(t){return ot(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},OO=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Bn(o[i],e))return W.some(yO(i,r));return W.none()},TO=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(bO(u[a].element,s))}return i},EO=function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?TO(t,r,o,i,u):TO(t,r,u,i,o);return vO(t.element,kO(a),a)},_O=function(t,e){var n=Gf(t.element),r=wn.fromTag("tbody");return kr(r,e),xr(n,r),n},DO=function(t){return Q(t.rows,(function(t){var e=Q(t.cells,(function(t){var e=Kf(t);return Co(e,"colspan"),Co(e,"rowspan"),e})),n=Gf(t.element);return kr(n,e),n}))},AO=function(t){var e=vO(Gf(t),0,[]);return Z(_f(t,"tr"),(function(t,n){Z(_f(t,"td,th"),(function(r,o){xO(e,SO(e,o,n),n,t,r)}))})),vO(e.element,kO(e.rows),e.rows)},RO=function(t){return _O(t,DO(t))},NO=function(t,e,n){return OO(t,e).bind((function(e){return OO(t,n).map((function(n){return EO(t,e,n)}))}))},BO=function(t){return ut(t,(function(t){return"ul"===Ln(t)||"ol"===Ln(t)}))},MO=function(t,e){return ut(t,(function(t){return"li"===Ln(t)&&Sh(t,e)})).fold(A([]),(function(e){return BO(t).map((function(t){var e=wn.fromTag(Ln(t)),n=_t(Do(t),(function(t,e){return se(e,"list-style")}));return Oo(e,n),[wn.fromTag("li"),e]})).getOr([])}))},PO=function(t,e){var n=ot(e,(function(t,e){return xr(e,t),e}),t);return e.length>0?hO([n]):n},IO=function(t){return ru(t)?Yn(t).filter(nu).fold(A([]),(function(e){return[t,e]})):nu(t)?[t]:[]},LO=function(t,e){var n=wn.fromDom(e.commonAncestorContainer),r=Iw(n,t),o=nt(r,(function(t){return Zi(t)||Yi(t)})),i=MO(r,e),u=o.concat(i.length?i:IO(n));return Q(u,Gf)},FO=function(){return hO([])},zO=function(t,e){return PO(wn.fromDom(e.cloneContents()),LO(t,e))},HO=function(t,e){return Ti(e,"table",B(Bn,t))},VO=function(t,e){return HO(t,e[0]).bind((function(t){var n=e[0],r=e[e.length-1],o=AO(t);return NO(o,n,r).map((function(t){return hO([RO(t)])}))})).getOrThunk(FO)},UO=function(t,e){return e.length>0&&e[0].collapsed?FO():zO(t,e[0])},jO=function(t,e){var n=hh(e,t);return n.length>0?VO(t,n):UO(t,e)},WO=function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")},qO=function(t,e){return e>=0&&e<t.length&&Op(t.charAt(e))},$O=function(t,e){var n=gu(t.innerText);return e?WO(n):n},GO=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()},KO=function(t){return W.from(t.selection.getRng()).map((function(e){var n=W.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=GO(n),i=tn.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=$O(u,i),c=gu(u.textContent);if(t.dom.remove(u),qO(c,0)||qO(c,c.length-1)){var s=n.getOr(r),f=$O(s,i),l=f.indexOf(a);if(-1===l)return a;var d=qO(f,l-1),m=qO(f,l+a.length);return(d?" ":"")+a+(m?" ":"")}return a})).getOr("")},XO=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=ky(t,lh(o)),u=e.contextual?jO(wn.fromDom(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)},YO=function(t,e){return Wt(Wt({},t),{format:e,get:!0,selection:!0})},JO=function(t,e,n){void 0===n&&(n={});var r=YO(n,e),o=t.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return t.fire("GetContent",o),o.content;if("text"===o.format)return KO(t);o.getInner=!0;var i=XO(t,o);return"tree"===o.format?i:(o.content=t.selection.isCollapsed()?"":i,t.fire("GetContent",o),o.content)},QO=0,ZO=1,tT=2,eT=function(t,e){var n=t.length+e.length+2,r=new Array(n),o=new Array(n),i=function(t,e,n){return{start:t,end:e,diag:n}},u=function(n,r,o,i,a){var s=c(n,r,o,i);if(null===s||s.start===r&&s.diag===r-i||s.end===n&&s.diag===n-o){var f=n,l=o;while(f<r||l<i)f<r&&l<i&&t[f]===e[l]?(a.push([QO,t[f]]),++f,++l):r-n>i-o?(a.push([tT,t[f]]),++f):(a.push([ZO,e[l]]),++l)}else{u(n,s.start,o,s.start-s.diag,a);for(var d=s.start;d<s.end;++d)a.push([QO,t[d]]);u(s.end,r,s.end-s.diag,i,a)}},a=function(n,r,o,u){var a=n;while(a-r<u&&a<o&&t[a]===e[a-r])++a;return i(n,a,r)},c=function(n,i,u,c){var s=i-n,f=c-u;if(0===s||0===f)return null;var l,d,m,g,p,h=s-f,v=f+s,b=(v%2===0?v:v+1)/2;for(r[1+b]=n,o[1+b]=i+1,l=0;l<=b;++l){for(d=-l;d<=l;d+=2){m=d+b,d===-l||d!==l&&r[m-1]<r[m+1]?r[m]=r[m+1]:r[m]=r[m-1]+1,g=r[m],p=g-n+u-d;while(g<i&&p<c&&t[g]===e[p])r[m]=++g,++p;if(h%2!==0&&h-l<=d&&d<=h+l&&o[m-h]<=r[m])return a(o[m-h],d+n-u,i,c)}for(d=h-l;d<=h+l;d+=2){m=d+b-h,d===h-l||d!==h+l&&o[m+1]<=o[m-1]?o[m]=o[m+1]-1:o[m]=o[m-1],g=o[m]-1,p=g-n+u-d;while(g>=n&&p>=u&&t[g]===e[p])o[m]=g--,p--;if(h%2===0&&-l<=d&&d<=l&&o[m]<=r[m+h])return a(o[m],d+n-u,i,c)}}},s=[];return u(0,t.length,0,e.length,s),s},nT=function(t){return jr(t)?t.outerHTML:Zr(t)?_a.encodeRaw(t.data,!1):to(t)?"\x3c!--"+t.data+"--\x3e":""},rT=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();t&&(n.innerHTML=t);while(e=n.firstChild)r.appendChild(e);return r},oT=function(t,e,n){var r=rT(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},iT=function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}},uT=function(t,e){var n=0;Z(t,(function(t){t[0]===QO?n++:t[0]===ZO?(oT(e,t[1],n),n++):t[0]===tT&&iT(e,n)}))},aT=function(t){return nt(Q(bt(t.childNodes),nT),(function(t){return t.length>0}))},cT=function(t,e){var n=Q(bt(e.childNodes),nT);return uT(eT(n,t),e),e},sT=Gt((function(){return document.implementation.createHTMLDocument("undo")})),fT=function(t){return-1!==t.indexOf("</iframe>")},lT=function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}},dT=function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}},mT=function(t){var e=aT(t.getBody()),n=st(e,(function(e){var n=Yy(t.serializer,e);return n.length>0?[n]:[]})),r=n.join("");return fT(r)?lT(n):dT(r)},gT=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?cT(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!k(r)||!up(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},pT=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},hT=function(t){var e=wn.fromTag("body",sT());return qf(e,pT(t)),Z(_f(e,"*[data-mce-bogus]"),Er),Wf(e)},vT=function(t,e){return pT(t)===pT(e)},bT=function(t,e){return hT(t)===hT(e)},yT=function(t,e){return!(!t||!e)&&(!!vT(t,e)||bT(t,e))},wT=function(t){return 0===t.get()},xT=function(t,e,n){wT(n)&&(t.typing=e)},CT=function(t,e){t.typing&&(xT(t,!1,e),t.add())},ST=function(t){t.typing&&(t.typing=!1,t.add())},kT=function(t,e,n){wT(e)&&n.set(gd(t.selection))},OT=function(t,e,n,r,o,i,u){var a=mT(t);if(i=i||{},i=gn.extend(i,a),!1===wT(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&yT(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=ym(t);if(s&&e.data.length>s){for(var f=0;f<e.data.length-1;f++)e.data[f]=e.data[f+1];e.data.length--,n.set(e.data.length)}i.bookmark=gd(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var l={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",l),t.fire("change",l)):t.fire("AddUndo",l),i},TT=function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")},ET=function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];gT(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}},_T=function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],gT(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r},DT=function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,xT(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],gT(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o},AT=function(t){t.clear(),t.add()},RT=function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!yT(mT(t),e.data[0])},NT=function(t,e){return e.get()<t.data.length-1&&!t.typing},BT=function(t,e,n){return CT(t,e),t.beforeChange(),t.ignore(n),t.add()},MT=function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}},PT=function(t,e){var n=t.dom,r=k(e)?e:t.getBody();C(t.hasVisual)&&(t.hasVisual=Tm(t)),Z(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=Em(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=_m(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}break}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})},IT=function(t){return{undoManager:{beforeChange:function(e,n){return kT(t,e,n)},add:function(e,n,r,o,i,u){return OT(t,e,n,r,o,i,u)},undo:function(e,n,r){return DT(t,e,n,r)},redo:function(e,n){return _T(t,e,n)},clear:function(e,n){return TT(t,e,n)},reset:function(t){return AT(t)},hasUndo:function(e,n){return RT(t,e,n)},hasRedo:function(t,e){return NT(t,e)},transact:function(t,e,n){return BT(t,e,n)},ignore:function(t,e){return MT(t,e)},extra:function(e,n,r,o){return ET(t,e,n,r,o)}},formatter:{match:function(e,n,r,o){return jS(t,e,n,r,o)},matchAll:function(e,n){return WS(t,e,n)},matchNode:function(e,n,r,o){return US(t,e,n,r,o)},canApply:function(e){return $S(t,e)},closest:function(e){return qS(t,e)},apply:function(e,n,r){return iO(t,e,n,r)},remove:function(e,n,r,o){return Xk(t,e,n,r,o)},toggle:function(e,n,r){return pO(t,e,n,r)},formatChanged:function(e,n,r,o,i){return gO(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return ew(t,e,n)},setContent:function(e,n){return NS(t,e,n)},insertContent:function(e,n){return xS(t,e,n)},addVisual:function(e){return PT(t,e)}},selection:{getContent:function(e,n){return JO(t,e,n)}},raw:{getModel:function(){return W.none()}}}},LT=function(t){var e=function(t){return b(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,u=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return W.some(u.getRawModel())}}}},FT=function(){var t=A(null),e=A("");return{undoManager:{beforeChange:E,add:t,undo:t,redo:t,clear:E,reset:E,hasUndo:F,hasRedo:F,transact:t,ignore:E,extra:E},formatter:{match:F,matchAll:A([]),matchNode:A(void 0),canApply:F,closest:e,apply:E,remove:E,toggle:E,formatChanged:A({unbind:E})},editor:{getContent:e,setContent:e,insertContent:E,addVisual:E},selection:{getContent:e},raw:{getModel:A(W.none())}}},zT=function(t){return Nt(t.plugins,"rtc")},HT=function(t){return Rt(t.plugins,"rtc").bind((function(t){return W.from(t.setup)}))},VT=function(t){var e=t;return HT(t).fold((function(){return e.rtcInstance=IT(t),W.none()}),(function(t){return e.rtcInstance=FT(),W.some((function(){return t().then((function(t){return e.rtcInstance=LT(t),t.rtc.isRemote}))}))}))},UT=function(t){return t.rtcInstance?t.rtcInstance:IT(t)},jT=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},WT=function(t,e,n){jT(t).undoManager.beforeChange(e,n)},qT=function(t,e,n,r,o,i,u){return jT(t).undoManager.add(e,n,r,o,i,u)},$T=function(t,e,n,r){return jT(t).undoManager.undo(e,n,r)},GT=function(t,e,n){return jT(t).undoManager.redo(e,n)},KT=function(t,e,n){jT(t).undoManager.clear(e,n)},XT=function(t,e){jT(t).undoManager.reset(e)},YT=function(t,e,n){return jT(t).undoManager.hasUndo(e,n)},JT=function(t,e,n){return jT(t).undoManager.hasRedo(e,n)},QT=function(t,e,n,r){return jT(t).undoManager.transact(e,n,r)},ZT=function(t,e,n){jT(t).undoManager.ignore(e,n)},tE=function(t,e,n,r,o){jT(t).undoManager.extra(e,n,r,o)},eE=function(t,e,n,r,o){return jT(t).formatter.match(e,n,r,o)},nE=function(t,e,n){return jT(t).formatter.matchAll(e,n)},rE=function(t,e,n,r,o){return jT(t).formatter.matchNode(e,n,r,o)},oE=function(t,e){return jT(t).formatter.canApply(e)},iE=function(t,e){return jT(t).formatter.closest(e)},uE=function(t,e,n,r){jT(t).formatter.apply(e,n,r)},aE=function(t,e,n,r,o){jT(t).formatter.remove(e,n,r,o)},cE=function(t,e,n,r){jT(t).formatter.toggle(e,n,r)},sE=function(t,e,n,r,o,i){return jT(t).formatter.formatChanged(e,n,r,o,i)},fE=function(t,e,n){return UT(t).editor.getContent(e,n)},lE=function(t,e,n){return UT(t).editor.setContent(e,n)},dE=function(t,e,n){return UT(t).editor.insertContent(e,n)},mE=function(t,e,n){return jT(t).selection.getContent(e,n)},gE=function(t,e){return jT(t).editor.addVisual(e)},pE=function(t,e){void 0===e&&(e={});var n=e.format?e.format:"html";return mE(t,n,e)},hE=function(t){return 0===t.dom.length?(Tr(t),W.none()):W.some(t)},vE=function(t,e){return t.filter((function(t){return Fh.isBookmarkNode(t.dom)})).bind(e?tr:Zn)},bE=function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(Sx(o,i,!1,!r),n.setStart(i,u)):(Sx(i,o,!1,!r),n.setEnd(i,u))},yE=function(t,e){Yn(t).each((function(n){var r=t.dom;e&&ax(n,Bl(r,0))?xx(r,0):!e&&sx(n,Bl(r,r.length))&&Cx(r,r.length)}))},wE=function(t,e,n,r){t.bind((function(t){var o=r?Cx:xx;return o(t.dom,r?t.dom.length:0),e.filter(Un).map((function(e){return bE(t,e,n,r)}))})).orThunk((function(){var t=vE(e,r).or(e).filter(Un);return t.map((function(t){return yE(t,r)}))}))},xE=function(t,e){var n=W.from(e.firstChild).map(wn.fromDom),r=W.from(e.lastChild).map(wn.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Zn).filter(Un).bind(hE),i=r.bind(tr).filter(Un).bind(hE);wE(o,n,t,!0),wE(i,r,t,!1),t.collapse(!1)},CE=function(t,e){return Wt(Wt({format:"html"},t),{set:!0,selection:!0,content:e})},SE=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,Wt(Wt({isRootContent:!0,forced_root_block:!1},o),e));return uw({validate:t.validate},t.schema).serialize(i)}return e.content},kE=function(t,e,n){void 0===n&&(n={});var r=CE(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=SE(t,o);var u=t.selection.getRng();xE(u,u.createContextualFragment(o.content)),t.selection.setRng(u),nb(t,u),o.no_events||t.fire("SetContent",o)},OE=function(t,e,n){if(t&&Nt(t,e)){var r=nt(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};function TE(t,e){var n,r,o=function(e,n){return ut(n,(function(n){return t.is(n,e)}))},i=function(e){return t.getParents(e,null,t.getRoot())};return{selectorChangedWithUnbind:function(t,u){return n||(n={},r={},e.on("NodeChange",(function(t){var e=t.element,u=i(e),a={};gn.each(n,(function(t,e){o(e,u).each((function(n){r[e]||(Z(t,(function(t){t(!0,{node:n,selector:e,parents:u})})),r[e]=t),a[e]=t}))})),gn.each(r,(function(t,n){a[n]||(delete r[n],gn.each(t,(function(t){t(!1,{node:e,selector:n,parents:u})})))}))}))),n[t]||(n[t]=[]),n[t].push(u),o(t,i(e.selection.getStart())).each((function(){r[t]=n[t]})),{unbind:function(){OE(n,t,u),OE(r,t,u)}}}}}var EE=function(t){return!!t.select},_E=function(t){return!(!t||!t.ownerDocument)&&In(wn.fromDom(t.ownerDocument),wn.fromDom(t))},DE=function(t){return!!t&&(!!EE(t)||_E(t.startContainer)&&_E(t.endContainer))},AE=function(t,e,n,r){var o,i,u=TE(t,r).selectorChangedWithUnbind,a=function(e,n){var o=t.createRng();k(e)&&k(n)?(o.setStart(e,n),o.setEnd(e,n),y(o),h(!1)):(kh(t,o,r.getBody(),!0),y(o))},c=function(t){return pE(r,t)},s=function(t,e){return kE(r,t,e)},f=function(t){return by(r.getBody(),b(),t)},l=function(t){return yy(r.getBody(),b(),t)},d=function(t,e){return B.getBookmark(t,e)},m=function(t){return B.moveToBookmark(t)},g=function(e,n){return Sy(t,e,n).each(y),e},p=function(){var t=b(),e=v();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},h=function(t){var e=b();e.collapse(!!t),y(e)},v=function(){return e.getSelection?e.getSelection():e.document.selection},b=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(r){return-1}},s=e.document;if(void 0!==r.bookmark&&!1===dy(r)){var f=zb(r);if(f.isSome())return f.map((function(t){return ky(r,[t])[0]})).getOr(s.createRange())}try{(n=v())&&!Ur(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():s.createRange(),u=ky(r,[u])[0])}catch(l){}return u||(u=s.createRange?s.createRange():s.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},y=function(t,e){var n;if(DE(t)){var u=EE(t)?t:null;if(u){i=null;try{u.select()}catch(s){}}else{var a=v(),c=r.fire("SetSelectionRange",{range:t,forward:e});if(t=c.range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(s){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||tn.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset],n&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1))),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},w=function(e){return s(t.getOuterHTML(e)),e},x=function(){return xy(r.getBody(),b())},C=function(e,n){return Cy(t,b(),e,n)},S=function(){var e=v(),n=null===e||void 0===e?void 0:e.anchorNode,r=null===e||void 0===e?void 0:e.focusNode;if(!e||!n||!r||Ur(n)||Ur(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},O=function(){var e=b(),n=v();if(!mh(n)&&Oh(r)){var o=xv(t,e);return o.each((function(t){y(t,S())})),o.getOr(e)}return e},T=function(t,e){return u(t,e),N},E=function(){var e,n=t.getRoot();while(n&&"BODY"!==n.nodeName){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},_=function(t,e){k(t)?eb(r,t,e):nb(r,b(),e)},D=function(t,e){return y(cv(t,e,r.getDoc()))},A=function(){var t=b();return t.collapsed?Bl.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},R=function(){e=o=i=null,M.destroy()},N={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:h,setCursorLocation:a,getContent:c,setContent:s,getBookmark:d,moveToBookmark:m,select:g,isCollapsed:p,isForward:S,setNode:w,getNode:x,getSel:v,setRng:y,getRng:b,getStart:f,getEnd:l,getSelectedBlocks:C,normalize:O,selectorChanged:T,selectorChangedWithUnbind:u,getScrollContainer:E,scrollIntoView:_,placeCaretAt:D,getBoundingClientRect:A,destroy:R},B=Fh(N),M=rv(N,r);return N.bookmarkManager=B,N.controlSelection=M,N},RE=function(t,e){Z(e,(function(e){t.attr(e,null)}))},NE=function(t,e,n){t.addNodeFilter("font",(function(t){Z(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),RE(t,["color","face","size"])}))}))},BE=function(t,e){t.addNodeFilter("strike",(function(t){Z(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))},ME=function(t,e){var n=ja();e.convert_fonts_to_spans&&NE(t,n,gn.explode(e.font_size_legacy_values)),BE(t,n)},PE=function(t,e){e.inline_styles&&ME(t,e)},IE=function(t){return new Di((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===o.status?e(o.response):r()},o.onerror=r,o.send()}catch(i){r()}}))},LE=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},FE=function(t,e){var n;try{n=atob(e)}catch(bV){return W.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return W.some(new Blob([r],{type:t}))},zE=function(t){return new Di((function(e){var n=LE(t),r=n.type,o=n.data;FE(r,o).fold((function(){return e(new Blob([]))}),e)}))},HE=function(t){return 0===t.indexOf("blob:")?IE(t):0===t.indexOf("data:")?zE(t):null},VE=function(t){return new Di((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))},UE=0,jE=function(t){return(t||"blobid")+UE++},WE=function(t,e,n,r){var o,i;if(0===e.src.indexOf("blob:"))return i=t.getByUri(e.src),void(i?n({image:e,blobInfo:i}):HE(e.src).then((function(r){VE(r).then((function(u){o=LE(u).data,i=t.create(jE(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)})));var u=LE(e.src),a=u.data,c=u.type;o=a,i=t.getByData(o,c),i?n({image:e,blobInfo:i}):HE(e.src).then((function(r){i=t.create(jE(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))},qE=function(t){return t?bt(t.getElementsByTagName("img")):[]},$E=function(t,e){var n={},r=function(r,o){o||(o=z);var i=nt(qE(r),(function(e){var n=e.src;return!!tn.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===tn.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e)))))})),u=Q(i,(function(t){if(void 0!==n[t.src])return new Di((function(e){n[t.src].then((function(n){if("string"===typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Di((function(n,r){WE(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return Di.all(u)};return{findAll:r}},GE=function(t,e,n,r){var o=t.padd_empty_with_br||e.insert;o&&n[r.name]?r.empty().append(new Dy("br",1)).shortEnded=!0:r.empty().append(new Dy("#text",3)).value=su},KE=function(t){return XE(t,"#text")&&t.firstChild.value===su},XE=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},YE=function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty},JE=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return YE(t,e)}))},QE=function(t,e){return t&&(Nt(e,t.name)||"br"===t.name)},ZE=function(t){return k(t.attr("data-mce-bogus"))},t_=function(t){return t.attr("src")===tn.transparentSrc||k(t.attr("data-mce-placeholder"))},e_=function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),Ct(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0},n_=function(t,e){var n=e.blob_cache,r=function(t){var r=t.attr("src");t_(t)||ZE(t)||Ny(r).filter((function(){return e_(t,e)})).bind((function(t){var e=t.type,r=t.data;return W.from(n.getByData(r,e)).orThunk((function(){return FE(e,r).map((function(t){var e=n.create(jE(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return Z(t,r)}))},r_=function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,f,l,d,m=t.length,g=gn.extend({},n.getBlockElements()),p=n.getNonEmptyElements(),h=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(u=t[i],a=u.parent,g[u.parent.name]&&u===a.lastChild){s=u.prev;while(s){if(f=s.name,"span"!==f||"bookmark"!==s.attr("data-mce-type")){"br"===f&&(u=null);break}s=s.prev}u&&(u.remove(),JE(n,p,h,a)&&(l=n.getElementRule(a.name),l&&(l.removeEmpty?a.remove():l.paddEmpty&&GE(e,o,g,a))))}else{c=u;while(a&&a.firstChild===c&&a.lastChild===c){if(c=a,g[a.name])break;a=a.parent}c===a&&!0!==e.padd_empty_with_br&&(d=new Dy("#text",3),d.value=su,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n=t.length,r=function(t){var e=t.split(" ").filter((function(t){return t.length>0}));return e.concat(["noopener"]).sort().join(" ")},o=function(t){var e=t?gn.trim(t):"";return/\b(noopener)\b/g.test(e)?e:r(e)};if(!e.allow_unsafe_link_target)while(n--){var i=t[n];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",o(i.attr("rel")))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){var e,n,r,o,i=t.length;while(i--)if(o=t[i],"a"===o.name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){var e,n,r=t.length;while(r--)if(e=t[r],n=e.parent,"ul"===n.name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Dy("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){var e=n.getValidClasses(),r=t.length;while(r--){for(var o=t[r],i=o.attr("class").split(" "),u="",a=0;a<i.length;a++){var c=i[a],s=!1,f=e["*"];f&&f[c]&&(s=!0),f=e[o.name],!s&&f&&f[c]&&(s=!0),s&&(u&&(u+=" "),u+=c)}u.length||(u=null),o.attr("class",u)}})),n_(t,e)},o_=gn.makeMap,i_=gn.each,u_=gn.explode,a_=gn.extend,c_=function(t,e){void 0===e&&(e=Va());var n={},r=[],o={},i={};t=t||{},t.validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){for(var n=o_("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),u=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),u[t.name])t.empty().remove();else{for(var r=t.children(),o=0,i=r;o<i.length;o++){var a=i[o];e.isValidChild(n.name,a.name)||c(a,n)}t.unwrap()}},s=0;s<t.length;s++){var f=t[s],l=void 0,d=void 0,m=void 0;if(f.parent&&!f.fixed)if(i[f.name]&&"li"===f.parent.name){var g=f.next;while(g){if(!i[g.name])break;g.name="li",g.fixed=!0,f.parent.insert(g,f.parent),g=g.next}f.unwrap()}else{var p=[f];for(l=f.parent;l&&!e.isValidChild(l.name,f.name)&&!n[l.name];l=l.parent)p.push(l);if(l&&p.length>1)if(e.isValidChild(l.name,f.name)){p.reverse(),d=a(p[0].clone());for(var h=d,v=0;v<p.length-1;v++){e.isValidChild(h.name,p[v].name)?(m=a(p[v].clone()),h.append(m)):m=h;for(var b=p[v].firstChild;b&&b!==p[v+1];){var y=b.next;m.append(b),b=y}h=m}JE(e,r,o,d)?l.insert(f,p[0],!0):(l.insert(d,p[0],!0),l.insert(f,d)),l=p[0],(JE(e,r,o,l)||XE(l,"br"))&&l.empty().remove()}else c(f);else if(f.parent){if("li"===f.name){g=f.prev;if(g&&("ul"===g.name||"ol"===g.name)){g.append(f);continue}if(g=f.next,g&&("ul"===g.name||"ol"===g.name)){g.insert(f,g.firstChild,!0);continue}f.wrap(a(new Dy("ul",1)));continue}e.isValidChild(f.parent.name,"div")&&e.isValidChild("div",f.name)?f.wrap(a(new Dy("div",1))):c(f)}}}},a=function(t){var e=t.name;if(e in n){var u=o[e];u?u.push(t):o[e]=[t]}var a=r.length;while(a--){var c=r[a].name;if(c in t.attributes.map){u=i[c];u?u.push(t):i[c]=[t]}}return t},c=function(t,e){i_(u_(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},s=function(){var t=[];for(var e in n)Nt(n,e)&&t.push({name:e,callbacks:n[e]});return t},f=function(t,e){i_(u_(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},l=function(){return[].concat(r)},d=function(a,c){var s,f,l,d,m,g,p,h,v=[],b=function(t){return!1===t?"":!0===t?"p":t};c=c||{},o={},i={};var y=a_(o_("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=Fa(e),x=e.getNonEmptyElements(),C=e.children,S=t.validate,O="forced_root_block"in c?c.forced_root_block:t.forced_root_block,T=b(O),E=e.getWhiteSpaceElements(),_=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,A=/[ \t\r\n]+/g,R=/^[ \t\r\n]+$/,N=Nt(E,c.context)||Nt(E,t.root_name),B=function(){var n=z.firstChild,r=null,o=function(t){t&&(n=t.firstChild,n&&3===n.type&&(n.value=n.value.replace(_,"")),n=t.lastChild,n&&3===n.type&&(n.value=n.value.replace(D,"")))};if(e.isValidChild(z.name,T.toLowerCase())){while(n){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!y[n.name]&&!n.attr("data-mce-type")?(r||(r=M(T,1),r.attr(t.forced_root_block_attrs),z.insert(r,n)),r.append(n)):(o(r),r=null),n=i}o(r)}},M=function(t,e){var r,i=new Dy(t,e);return t in n&&(r=o[t],r?r.push(i):o[t]=[i]),i},P=function(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(D,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var u=r.prev;r.remove(),r=u}},I=function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e},L=function(t){var n=t;while(k(n)){if(n.name in w)return JE(e,x,E,n);n=n.parent}return!1},F=Ky({validate:S,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:I(e.getSelfClosingElements()),cdata:function(t){h.append(M("#cdata",4)).value=t},text:function(t,e){var n;N||(t=t.replace(A," "),QE(h.lastChild,y)&&(t=t.replace(_,""))),0!==t.length&&(n=M("#text",3),n.raw=!!e,h.append(n).value=t)},comment:function(t){h.append(M("#comment",8)).value=t},pi:function(t,e){h.append(M(t,7)).value=e,P(h)},doctype:function(t){var e=h.append(M("#doctype",10));e.value=t,P(h)},start:function(t,n,o){var u=S?e.getElementRule(t):{};if(u){var a=M(u.outputName||t,1);a.attributes=n,a.shortEnded=o,h.append(a);var c=C[h.name];c&&C[a.name]&&!c[a.name]&&v.push(a);var s=r.length;while(s--){var f=r[s].name;f in n.map&&(g=i[f],g?g.push(a):i[f]=[a])}y[t]&&P(a),o||(h=a),!N&&E[t]&&(N=!0)}},end:function(n){var r,o,i,u=S?e.getElementRule(n):{};if(u){if(y[n]&&!N){if(r=h.firstChild,r&&3===r.type)if(o=r.value.replace(_,""),o.length>0)r.value=o,r=r.next;else{i=r.next,r.remove(),r=i;while(r&&3===r.type)o=r.value,i=r.next,(0===o.length||R.test(o))&&(r.remove(),r=i),r=i}if(r=h.lastChild,r&&3===r.type)if(o=r.value.replace(D,""),o.length>0)r.value=o,r=r.prev;else{i=r.prev,r.remove(),r=i;while(r&&3===r.type)o=r.value,i=r.prev,(0===o.length||R.test(o))&&(r.remove(),r=i),r=i}}N&&E[n]&&(N=!1);var a=JE(e,x,E,h),s=h.parent;u.paddInEmptyBlock&&a&&L(h)?GE(t,c,y,h):u.removeEmpty&&a?y[h.name]?h.empty().remove():h.unwrap():u.paddEmpty&&(KE(h)||a)&&GE(t,c,y,h),h=s}}},e),z=h=new Dy(c.context||t.root_name,11);if(F.parse(a,c.format),S&&v.length&&(c.context?c.invalid=!0:u(v)),T&&("body"===z.name||c.isRootContent)&&B(),!c.invalid){for(p in o)if(Nt(o,p)){g=n[p],s=o[p],d=s.length;while(d--)s[d].parent||s.splice(d,1);for(f=0,l=g.length;f<l;f++)g[f](s,p,c)}for(f=0,l=r.length;f<l;f++)if(g=r[f],g.name in i){s=i[g.name],d=s.length;while(d--)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return z},m={schema:e,addAttributeFilter:f,getAttributeFilters:l,addNodeFilter:c,getNodeFilters:s,filterNode:a,parse:d};return r_(m,t),PE(m,t),m},s_=function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){var n=t.length;while(n--){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}})),t.addAttributeFilter("src,href,style",(function(t,r){var o="data-mce-"+r,i=e.url_converter,u=e.url_converter_scope,a=t.length;while(a--){var c=t[a],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(u,s,r,c.name)),c.attr(r,s.length>0?s:null))}})),t.addAttributeFilter("class",(function(t){var e=t.length;while(e--){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}})),t.addAttributeFilter("data-mce-type",(function(t,e,n){var r=t.length;while(r--){var o=t[r];if("bookmark"===o.attr("data-mce-type")&&!n.cleanup){var i=W.from(o.firstChild).exists((function(t){return!mu(t.value)}));i?o.unwrap():o.remove()}}})),t.addNodeFilter("noscript",(function(t){var e=t.length;while(e--){var n=t[e].firstChild;n&&(n.value=_a.decode(n.value))}})),t.addNodeFilter("script,style",(function(t,n){var r=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;while(o--){var i=t[o],u=i.firstChild?i.firstChild.value:"";if("script"===n){var a=i.attr("type");a&&i.attr("type","mce-no/type"===a?null:a.replace(/^mce\-/,"")),"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(u)+"\n// ]]>")}else"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="\x3c!--\n"+r(u)+"\n--\x3e")}})),t.addNodeFilter("#comment",(function(t){var r=t.length;while(r--){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}})),t.addNodeFilter("xml:namespace,input",(function(t,e){var n=t.length;while(n--){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),t.addAttributeFilter("data-mce-type",(function(e){Z(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){var n=t.length;while(n--)t[n].attr(e,null)}))},f_=function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}},l_=function(t,e,n){var r,o=t.dom,i=e.cloneNode(!0),u=document.implementation;if(u.createHTMLDocument){var a=u.createHTMLDocument("");gn.each("BODY"===i.nodeName?i.childNodes:[i],(function(t){a.body.appendChild(a.importNode(t,!0))})),i="BODY"!==i.nodeName?a.body.firstChild:a.body,r=o.doc,o.doc=a}return Vh(t,Wt(Wt({},n),{node:i})),r&&(o.doc=r),i},d_=function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events},m_=function(t,e,n){return d_(t,n)?l_(t,e,n):e},g_=function(t,e,n){-1===gn.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){var n=t.length;while(n--)t[n].attr(e,null)})),e.push(n))},p_=function(t,e,n){if(!e.no_events&&t){var r=Uh(t,Wt(Wt({},e),{content:n}));return r.content}return n},h_=function(t,e,n){var r=gu(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||uu(wn.fromDom(e))?r:gn.trim(r)},v_=function(t,e,n){var r=n.selection?Wt({forced_root_block:!1},n):n,o=t.parse(e,r);return f_(o),o},b_=function(t,e,n){var r=uw(t,e);return r.serialize(n)},y_=function(t,e,n,r,o){var i=b_(e,n,r);return p_(t,o,i)},w_=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:Vs.DOM,o=e&&e.schema?e.schema:Va(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=c_(t,o);s_(i,t,r);var u=function(n,u){void 0===u&&(u={});var a=Wt({format:"html"},u),c=m_(e,n,a),s=h_(r,c,a),f=v_(i,s,a);return"tree"===a.format?f:y_(e,t,o,f,a)};return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:u,addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:B(g_,i,n),getTempAttrs:A(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},x_=function(t,e){var n=w_(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},C_="html",S_=function(t,e){void 0===e&&(e={});var n=e.format?e.format:C_;return fE(t,e,n)},k_=function(t,e,n){return void 0===n&&(n={}),lE(t,e,n)},O_=Vs.DOM,T_=function(t){O_.setStyle(t.id,"display",t.orgDisplay)},E_=function(t){return W.from(t).each((function(t){return t.destroy()}))},__=function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)},D_=function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),O_.unbind(e,"submit reset",t.formEventDelegate))},A_=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&O_.remove(o.nextSibling),jh(t),t.editorManager.remove(t),!t.inline&&r&&T_(t),Wh(t),O_.remove(t.getContainer()),E_(e),E_(n),t.destroy()}},R_=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),E_(n),E_(r)),D_(t),__(t),t.destroyed=!0):t.remove())},N_=function(t,e){var n=b(t)&&b(e);return n?M_(t,e):e},B_=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)Nt(i,u)&&(r[u]=t(r[u],i[u]))}return r}},M_=B_(N_),P_="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),I_="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),L_="imagetools,toc".split(","),F_=function(t){var e=nt(P_,(function(e){return Nt(t,e)})),n=t.forced_root_block;return!1!==n&&""!==n||e.push("forced_root_block (false only)"),gt(e)},z_=function(t){var e=gn.makeMap(t.plugins," "),n=function(t){return Nt(e,t)},r=$t($t([],nt(I_,n),!0),st(L_,(function(t){return n(t)?[t+" (moving to premium)"]:[]})),!0);return gt(r)},H_=function(t,e){var n=F_(t),r=z_(e),o=r.length>0,i=n.length>0,u="mobile"===e.theme;if(o||i||u){var a="\n- ";o&&r.join(a),i&&n.join(a)}},V_=function(t,e){return{sections:A(t),settings:A(e)}},U_=qe().deviceType,j_=U_.isTouch(),W_=U_.isPhone(),q_=U_.isTablet(),$_=["lists","autolink","autosave"],G_={table_grid:!1,object_resizing:!1,resize:!1},K_=function(t){var e=y(t)?t.join(" "):t,n=Q(v(e)?e.split(" "):[],le);return nt(n,(function(t){return t.length>0}))},X_=function(t){return nt(t,B(Y,$_))},Y_=function(t,e){var n=Et(e,(function(e,n){return Y(t,n)}));return V_(n.t,n.f)},J_=function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=Rt(r,e).getOr({});return gn.extend({},n,o)},Q_=function(t,e){return Nt(t.sections(),e)},Z_=function(t,e,n){var r=t.sections();return Q_(t,e)&&r[e].theme===n},tD=function(t,e){return Q_(t,e)?t.sections()[e]:{}},eD=function(t,e){return Rt(t,"toolbar_mode").orThunk((function(){return Rt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},nD=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:eD(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Wt(Wt({},i),r?G_:{})},rD=function(t,e){var n={resize:!1,toolbar_mode:eD(t,"scrolling"),toolbar_sticky:!1},r={menubar:!1};return Wt(Wt(Wt({},G_),n),e?r:{})},oD=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?gn.extend({},t.external_plugins,n):n},iD=function(t,e){return[].concat(K_(t)).concat(K_(e))},uD=function(t,e,n,r){return t&&Z_(e,"mobile","mobile")?X_(r):t&&Q_(e,"mobile")?r:n},aD=function(t,e,n,r){var o=K_(n.forced_plugins),i=K_(r.plugins),u=tD(e,"mobile"),a=u.plugins?K_(u.plugins):i,c=uD(t,e,i,a),s=iD(o,c);if(tn.browser.isIE()&&Y(s,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return gn.extend(r,{plugins:s.join(" ")})},cD=function(t,e){return t&&Q_(e,"mobile")},sD=function(t,e,n,r,o){var i=t?{mobile:rD(o.mobile||{},e)}:{},u=Y_(["mobile"],M_(i,o)),a=gn.extend(n,r,u.settings(),cD(t,u)?J_(u,"mobile"):{},{validate:!0,external_plugins:oD(r,u.settings())});return aD(t,u,r,a)},fD=function(t,e,n,r,o){var i=nD(o,e,n,j_,t),u=sD(W_||q_,W_,i,r,o);return!1!==u.deprecation_warnings&&H_(o,u),u},lD=function(t,e,n){return W.from(e.settings[n]).filter(t)},dD=function(t){var e={};return"string"===typeof t?Z(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[gn.trim(n[0])]=gn.trim(n[1]):e[gn.trim(n[0])]=gn.trim(n[0])})):e=t,e},mD=function(t){return function(e){return y(e)&&ft(e,t)}},gD=function(t,e,n,r){var o=e in t.settings?t.settings[e]:n;return"hash"===r?dD(o):"string"===r?lD(v,t,e).getOr(n):"number"===r?lD(T,t,e).getOr(n):"boolean"===r?lD(x,t,e).getOr(n):"object"===r?lD(b,t,e).getOr(n):"array"===r?lD(y,t,e).getOr(n):"string[]"===r?lD(mD(v),t,e).getOr(n):"function"===r?lD(O,t,e).getOr(n):o},pD=function(){var t={},e=function(e,n){t[e]=n},n=function(e){return t[e]?t[e]:{icons:{}}},r=function(e){return Nt(t,e)};return{add:e,get:n,has:r}},hD=pD(),vD=function(t,e){var n=e.dom;return n[t]},bD=function(t,e){return parseInt(To(e,t),10)},yD=B(vD,"clientWidth"),wD=B(vD,"clientHeight"),xD=B(bD,"margin-top"),CD=B(bD,"margin-left"),SD=function(t){return t.dom.getBoundingClientRect()},kD=function(t,e,n){var r=yD(t),o=wD(t);return e>=0&&n>=0&&e<=r&&n<=o},OD=function(t,e,n,r){var o=SD(e),i=t?o.left+e.dom.clientLeft+CD(e):0,u=t?o.top+e.dom.clientTop+xD(e):0,a=n-i,c=r-u;return{x:a,y:c}},TD=function(t,e,n){var r=wn.fromDom(t.getBody()),o=t.inline?r:Kn(r),i=OD(t.inline,o,e,n);return kD(o,i.x,i.y)},ED=function(t){return W.from(t).map(wn.fromDom)},_D=function(t){var e=t.inline?t.getBody():t.getContentAreaContainer();return ED(e).map(_r).getOr(!1)},DD=function(){var t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:t,close:t,reposition:t,getArgs:t}},AD=function(t){var e=[],n=function(){var e=t.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():DD()},r=function(){return W.from(e[0])},o=function(t,e){return t.type===e.type&&t.text===e.text&&!t.progressBar&&!t.timeout&&!e.progressBar&&!e.timeout},i=function(){e.length>0&&n().reposition(e)},u=function(t){e.push(t)},a=function(t){at(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},c=function(c,s){if(void 0===s&&(s=!0),!t.removed&&_D(t))return s&&t.fire("BeforeOpenNotification",{notification:c}),ut(e,(function(t){return o(n().getArgs(t),c)})).getOrThunk((function(){t.editorManager.setActive(t);var e=n().open(c,(function(){a(e),i(),r().fold((function(){return t.focus()}),(function(t){return ob(wn.fromDom(t.getEl()))}))}));return u(e),i(),t.fire("OpenNotification",{notification:Wt({},e)}),e}))},s=function(){r().each((function(t){n().close(t),a(t),i()}))},f=A(e),l=function(t){t.on("SkinLoaded",(function(){var e=rm(t);e&&c({text:e,type:"warning",timeout:0},!1),i()})),t.on("show ResizeEditor ResizeWindow NodeChange",(function(){Ii.requestAnimationFrame(i)})),t.on("remove",(function(){Z(e.slice(),(function(t){n().close(t)}))}))};return l(t),{open:c,close:s,getNotifications:f}},RD=lf.PluginManager,ND=lf.ThemeManager;function BD(){var t=function(){throw new Error("Theme did not provide a WindowManager implementation.")};return{open:t,openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t}}var MD=function(t){var e=[],n=function(){var e=t.theme;return e&&e.getWindowManagerImpl?e.getWindowManagerImpl():BD()},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}},o=function(e){t.fire("OpenWindow",{dialog:e})},i=function(e){t.fire("CloseWindow",{dialog:e})},u=function(t){e.push(t),o(t)},a=function(n){i(n),e=nt(e,(function(t){return t!==n})),0===e.length&&t.focus()},c=function(){return W.from(e[e.length-1])},s=function(e){t.editorManager.setActive(t),Lb(t);var n=e();return u(n),n},f=function(t,e){return s((function(){return n().open(t,e,a)}))},l=function(t){return s((function(){return n().openUrl(t,a)}))},d=function(t,e,o){var i=n();i.alert(t,r(o||i,e))},m=function(t,e,o){var i=n();i.confirm(t,r(o||i,e))},g=function(){c().each((function(t){n().close(t),a(t)}))};return t.on("remove",(function(){Z(e,(function(t){n().close(t)}))})),{open:f,openUrl:l,alert:d,confirm:m,close:g}},PD=function(t,e){t.notificationManager.open({type:"error",text:e})},ID=function(t,e){t._skinLoaded?PD(t,e):t.on("SkinLoaded",(function(){PD(t,e)}))},LD=function(t,e){ID(t,ff.translate(["Failed to upload image: {0}",e]))},FD=function(t,e,n){Qh(t,e,{message:n})},zD=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},HD=function(t,e,n){FD(t,"PluginLoadError",zD("plugin",e,n))},VD=function(t,e,n){FD(t,"IconsLoadError",zD("icons",e,n))},UD=function(t,e,n){FD(t,"LanguageLoadError",zD("language",e,n))},jD=function(t,e,n){var r=ff.translate(["Failed to initialize plugin: {0}",e]);Qh(t,"PluginLoadError",{message:r}),WD(r,n),ID(t,r)},WD=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,$t([t],e,!1)):r.log.apply(r,$t([t],e,!1)))},qD=function(t){return/^[a-z0-9\-]+$/i.test(t)},$D=function(t){return KD(t,Xd(t))},GD=function(t){return KD(t,Yd(t))},KD=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r=t.editorManager.suffix,o="content"+r+".css",i=!0===t.inline;return Q(e,(function(e){return qD(e)&&!i?n+"/"+e+"/"+o:t.documentBaseURI.toAbsolute(e)}))},XD=function(t){t.contentCSS=t.contentCSS.concat($D(t),GD(t))},YD=function(){var t=1,e=2,n={},r=function(t,e){return{status:t,resultUri:e}},o=function(t){return t in n},i=function(t){var e=n[t];return e?e.resultUri:null},u=function(e){return!!o(e)&&n[e].status===t},a=function(t){return!!o(t)&&n[t].status===e},c=function(e){n[e]=r(t,null)},s=function(t,o){n[t]=r(e,o)},f=function(t){delete n[t]},l=function(){n={}};return{hasBlobUri:o,getResultUri:i,isPending:u,isUploaded:a,markPending:c,markUploaded:s,removeFailed:f,destroy:l}},JD=0,QD=function(){var t=function(){return Math.round(4294967295*Math.random()).toString(36)},e=(new Date).getTime();return"s"+e.toString(36)+t()+t()+t()},ZD=function(t){return t+JD+++QD()},tA=function(){var t=[],e=function(t){var e={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};return e[t.toLowerCase()]||"dat"},n=function(t,e,n,o,i){if(v(t)){var u=t;return r({id:u,name:o,filename:i,blob:e,base64:n})}if(b(t))return r(t);throw new Error("Unknown input type")},r=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var n=t.id||ZD("blobid"),r=t.name||n,o=t.blob;return{id:A(n),name:A(r),filename:A(t.filename||r+"."+e(o.type)),blob:A(o),base64:A(t.base64),blobUri:A(t.blobUri||URL.createObjectURL(o)),uri:A(t.uri)}},o=function(e){u(e.id())||t.push(e)},i=function(e){return ut(t,e).getOrUndefined()},u=function(t){return i((function(e){return e.id()===t}))},a=function(t){return i((function(e){return e.blobUri()===t}))},c=function(t,e){return i((function(n){return n.base64()===t&&n.blob().type===e}))},s=function(e){t=nt(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},f=function(){Z(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]};return{create:n,add:o,get:u,getByUri:a,getByData:c,findFirst:i,removeByUri:s,destroy:f}},eA=function(t,e){var n={},r=function(t,e){return t?t.replace(/\/$/,"")+"/"+e.replace(/^\//,""):e},o=function(t,n,o,i){var u=new XMLHttpRequest;u.open("POST",e.url),u.withCredentials=e.credentials,u.upload.onprogress=function(t){i(t.loaded/t.total*100)},u.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+u.status)},u.onload=function(){if(u.status<200||u.status>=300)o("HTTP Error: "+u.status);else{var t=JSON.parse(u.responseText);t&&"string"===typeof t.location?n(r(e.basePath,t.location)):o("Invalid JSON: "+u.responseText)}};var a=new FormData;a.append("file",t.blob(),t.filename()),u.send(a)},i=function(){return new Di((function(t){t([])}))},u=function(t,e){return{url:e,blobInfo:t,status:!0}},a=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},c=function(t,e){gn.each(n[t],(function(t){t(e)})),delete n[t]},s=function(e,n,r){return t.markPending(e.blobUri()),new Di((function(o){var i,s;try{var f=function(){i&&(i.close(),s=E)},l=function(n){f(),t.markUploaded(e.blobUri(),n),c(e.blobUri(),u(e,n)),o(u(e,n))},d=function(n,r){var i=r||{};f(),t.removeFailed(e.blobUri()),c(e.blobUri(),a(e,n,i)),o(a(e,n,i))};s=function(t){t<0||t>100||W.from(i).orThunk((function(){return W.from(r).map(I)})).each((function(e){i=e,e.progressBar.value(t)}))},n(e,l,d,s)}catch(m){o(a(e,m.message,{}))}}))},f=function(t){return t===o},l=function(t){var e=t.blobUri();return new Di((function(t){n[e]=n[e]||[],n[e].push(t)}))},d=function(n,r){return n=gn.grep(n,(function(e){return!t.isUploaded(e.blobUri())})),Di.all(gn.map(n,(function(n){return t.isPending(n.blobUri())?l(n):s(n,e.handler,r)})))},m=function(t,n){return!e.url&&f(e.handler)?i():d(t,n)};return!1===O(e.handler)&&(e.handler=o),{upload:m}},nA=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},rA=function(t,e){return eA(e,{url:zd(t),basePath:Hd(t),credentials:Vd(t),handler:Ud(t)})},oA=function(t){var e=YD(),n=rA(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?nA(t):void 0)}}},iA=function(t){var e=Ys(null);t.on("change AddUndo",(function(t){e.set(Wt({},t.level))}));var n=function(){var n=t.undoManager.data;vt(n).filter((function(t){return!yT(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:pt(n,n.length-2).getOrNull()})}))};return{fireIfChanged:n}},uA=function(t){var e,n,r=tA(),o=YD(),i=[],u=iA(t),a=function(e){return function(n){return t.selection?e(n):[]}},c=function(t){return t+(-1===t.indexOf("?")?"?":"&")+(new Date).getTime()},s=function(t,e,n){var r=0;do{r=t.indexOf(e,r),-1!==r&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},f=function(t,e,n){var r='src="'+n+'"'+(n===tn.transparentSrc?' data-mce-placeholder="1"':"");return t=s(t,'src="'+e+'"',r),t=s(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"'),t},l=function(e,n){Z(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=Q(t.fragments,(function(t){return f(t,e,n)})):t.content=f(t.content,e,n)}))},d=function(e,n){var r=t.convertURL(n,"src");l(e.src,n),t.$(e).attr({src:Pd(t)?c(n):n,"data-mce-src":r})},m=function(n){return e||(e=rA(t,o)),v().then(a((function(o){var i=Q(o,(function(t){return t.blobInfo}));return e.upload(i,nA(t)).then(a((function(e){var i=[],a=Q(e,(function(e,n){var u=o[n].blobInfo,a=o[n].image;return e.status&&Id(t)?(r.removeByUri(a.src),zT(t)||d(a,e.url)):e.error&&(e.error.options.remove&&(l(a.getAttribute("src"),tn.transparentSrc),i.push(a)),LD(t,e.error.message)),{element:a,status:e.status,uploadUri:e.url,blobInfo:u}}));return a.length>0&&u.fireIfChanged(),i.length>0&&(zT(t)||t.undoManager.transact((function(){Z(i,(function(e){t.dom.remove(e),r.removeByUri(e.src)}))}))),n&&n(a),a})))})))},g=function(e){if(Md(t))return m(e)},p=function(e){if(!1===ft(i,(function(t){return t(e)})))return!1;if(0===e.getAttribute("src").indexOf("data:")){var n=Bd(t);return n(e)}return!0},h=function(t){i.push(t)},v=function(){return n||(n=$E(o,r)),n.findAll(t.getBody(),p).then(a((function(e){return e=nt(e,(function(e){return"string"!==typeof e||(ID(t,e),!1)})),zT(t)||Z(e,(function(t){l(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},b=function(){r.destroy(),o.destroy(),n=e=null},y=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var i=o.getResultUri(n);if(i)return'src="'+i+'"';var u=r.getByUri(n);if(u||(u=ot(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),u){var a=u.blob();return'src="data:'+a.type+";base64,"+u.base64()+'"'}return e}))};return t.on("SetContent",(function(){Md(t)?g():v()})),t.on("RawSaveContent",(function(t){t.content=y(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=y(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){Z(t,(function(t){var e=t.attr("src");if(!r.getByUri(e)){var n=o.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:r,addFilter:h,uploadImages:m,uploadImagesAuto:g,scanForImages:v,destroy:b}},aA=function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return jr(t)&&t.hasAttribute("href")},onformat:function(e,n,r){gn.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null===t||void 0===t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return gn.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e},cA=function(t){var e={},n=function(t){return k(t)?e[t]:e},r=function(t){return Nt(e,t)},o=function(t,n){t&&(v(t)?(y(n)||(n=[n]),Z(n,(function(t){C(t.deep)&&(t.deep=!Wp(t)),C(t.split)&&(t.split=!Wp(t)||qp(t)),C(t.remove)&&Wp(t)&&!qp(t)&&(t.remove="none"),Wp(t)&&qp(t)&&(t.mixed=!0,t.block_expand=!0),v(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=n):Ct(t,(function(t,e){o(e,t)})))},i=function(t){return t&&e[t]&&delete e[t],e};return o(aA(t.dom)),o(am(t)),{get:n,has:r,register:o,unregister:i}},sA=gn.each,fA=Vs.DOM,lA=function(t,e){var n,r,o,i=e&&e.schema||Va({}),u=function(t,e){e.classes.length&&fA.addClass(t,e.classes.join(" ")),fA.setAttribs(t,e.attrs)},a=function(t){r="string"===typeof t?{name:t,classes:[],attrs:{}}:t;var e=fA.create(r.name);return u(e,r),e},c=function(t,e){var n="string"!==typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==gn.inArray(o,e)?e:o[0])},s=function(t,e,n){var r,o,i=e.length>0&&e[0],u=i&&i.name,f=c(t,u);if(f)u===f?(o=e[0],e=e.slice(1)):o=f;else if(i)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=a(o),r.appendChild(t)),n&&(r||(r=fA.create("div"),r.appendChild(t)),gn.each(n,(function(e){var n=a(e);r.insertBefore(n,t)}))),s(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=a(r),o=fA.create("div"),o.appendChild(s(n,t.slice(1),r.siblings)),o):""},dA=function(t){var e,n={classes:[],attrs:{}};return t=n.selector=gn.trim(t),"*"!==t&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==gn.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r);break}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},mA=function(t){return t&&"string"===typeof t?(t=t.split(/\s*,\s*/)[0],t=t.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),gn.map(t.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=gn.map(t.split(/(?:~\+|~|\+)/),dA),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[]},gA=function(t,e){var n,r,o,i="",u=cm(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"===typeof e){if(e=t.formatter.get(e),!e)return;e=e[0]}if("preview"in e){var c=Rt(e,"preview");if(so(c,!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s=mA(e.selector);s.length?(s[0].name||(s[0].name=n),n=e.selector,r=lA(s,t)):r=lA([n],t);var f=fA.select(n,r)[0]||r.firstChild;return sA(e.styles,(function(t,e){var n=a(t);n&&fA.setStyle(f,e,n)})),sA(e.attributes,(function(t,e){var n=a(t);n&&fA.setAttrib(f,e,n)})),sA(e.classes,(function(t){var e=a(t);fA.hasClass(f,e)||fA.addClass(f,e)})),t.fire("PreviewFormats"),fA.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=fA.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,sA(u.split(" "),(function(e){var n=fA.getStyle(f,e,!0);if(("background-color"!==e||!/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)||(n=fA.getStyle(t.getBody(),e,!0),"#ffffff"!==fA.toHex(n).toLowerCase()))&&("color"!==e||"#000000"!==fA.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;var r=parseFloat(n)/(/%$/.test(n)?100:1);n=r*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),fA.remove(r),i},pA=function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])},hA=function(t){var e=cA(t),n=Ys(null);return pA(t),lk(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){uE(t,e,n,r)},remove:function(e,n,r,o){aE(t,e,n,r,o)},toggle:function(e,n,r){cE(t,e,n,r)},match:function(e,n,r,o){return eE(t,e,n,r,o)},closest:function(e){return iE(t,e)},matchAll:function(e,n){return nE(t,e,n)},matchNode:function(e,n,r,o){return rE(t,e,n,r,o)},canApply:function(e){return oE(t,e)},formatChanged:function(e,r,o,i){return sE(t,n,e,r,o,i)},getCssText:B(gA,t)}},vA=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},bA=function(t,e,n){var r=Ys(!1),o=function(t){xT(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;vA(r)||(CT(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;vA(e)||o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===yT(mT(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),xT(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)}));var i=function(t){return"insertReplacementText"===t.inputType},u=function(t){return"insertText"===t.inputType&&null===t.data},a=function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType};t.on("input",(function(t){t.inputType&&(i(t)||u(t)||a(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))},yA=function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")},wA=function(t){var e=mf(),n=Ys(0),r=Ys(0),o={data:[],typing:!1,beforeChange:function(){WT(t,n,e)},add:function(i,u){return qT(t,o,r,n,e,i,u)},undo:function(){return $T(t,o,n,r)},redo:function(){return GT(t,r,o.data)},clear:function(){KT(t,o,r)},reset:function(){XT(t,o)},hasUndo:function(){return YT(t,o,r)},hasRedo:function(){return JT(t,o,r)},transact:function(e){return QT(t,o,n,e)},ignore:function(e){ZT(t,n,e)},extra:function(e,n){tE(t,o,r,e,n)}};return zT(t)||bA(t,o,n),yA(t),o},xA=[9,27,ev.HOME,ev.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,ev.DOWN,ev.UP,ev.LEFT,ev.RIGHT].concat(tn.browser.isFirefox()?[224]:[]),CA="data-mce-placeholder",SA=function(t){return"keydown"===t.type||"keyup"===t.type},kA=function(t){var e=t.keyCode;return e===ev.BACKSPACE||e===ev.DELETE},OA=function(t){if(SA(t)){var e=t.keyCode;return!kA(t)&&(ev.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||Y(xA,e))}return!1},TA=function(t){return SA(t)&&!(kA(t)||"keyup"===t.type&&229===t.keyCode)},EA=function(t,e,n){if(na(wn.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1},_A=function(t){var e=t.dom,n=Od(t),r=em(t),o=function(i,u){if(!OA(i)){var a=t.getBody(),c=!TA(i)&&EA(e,a,n),s=""!==e.getAttrib(a,CA);(s!==c||u)&&(e.setAttrib(a,CA,c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),Jh(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Ii.setEditorTimeout(t,(function(){return o(e)}))}))}))},DA=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,AA=function(t){return DA.test(t)},RA=function(t,e){return Dn(wn.fromDom(e),Qd(t))},NA=function(t){return"rtl"===Vs.DOM.getStyle(t,"direction",!0)||AA(t.textContent)},BA=function(t,e,n){return nt(Vs.DOM.getParents(n.container(),"*",e),t)},MA=function(t,e,n){var r=BA(t,e,n);return W.from(r[r.length-1])},PA=function(t,e,n){var r=fg(e,t),o=fg(n,t);return r&&r===o},IA=function(t){return Cu(t)||Su(t)},LA=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?bu(n)?Zr(n.nextSibling)?Bl(n.nextSibling,0):Bl.after(n):Cu(e)?Bl(n,r+1):e:bu(n)?Zr(n.previousSibling)?Bl(n.previousSibling,n.previousSibling.data.length):Bl.before(n):Su(e)?Bl(n,r-1):e},FA=B(LA,!0),zA=B(LA,!1),HA=function(t){return function(e){return Bn(t,wn.fromDom(e.dom.parentNode))}},VA=function(t){return eu(t)||ru(t)},UA=function(t,e){return In(t,e)?Si(e,VA,HA(t)):W.none()},jA=function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)},WA=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),jA(t))},qA=function(t,e,n){return lo(Jg(n),Qg(n),(function(r,o){var i=LA(!0,r),u=LA(!1,o),a=LA(!1,e);return t?Xg(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):Yg(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)},$A=function(t,e){return{block:t,position:e}},GA=function(t,e){return{from:t,to:e}},KA=function(t,e){var n=wn.fromDom(t),r=wn.fromDom(e.container());return UA(n,r).map((function(t){return $A(t,e)}))},XA=function(t){return!1===Bn(t.from.block,t.to.block)},YA=function(t){return Yn(t.from.block).bind((function(e){return Yn(t.to.block).filter((function(t){return Bn(e,t)}))})).isSome()},JA=function(t){return!1===uo(t.from.block.dom)&&!1===uo(t.to.block.dom)},QA=function(t,e,n){return ro(n.position.getNode())&&!1===na(n.block)?Kg(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?qg(e,t,r).bind((function(e){return KA(t,e)})):W.some(n)})).getOr(n):n},ZA=function(t,e,n){var r=KA(t,Bl.fromRangeStart(n)),o=r.bind((function(n){return qg(e,t,n.position).bind((function(n){return KA(t,n).map((function(n){return QA(t,e,n)}))}))}));return lo(r,o,GA).filter((function(t){return XA(t)&&YA(t)&&JA(t)}))},tR=function(t,e,n){return n.collapsed?ZA(t,e,n):W.none()},eR=function(t){var e=rr(t);return at(e,Ji).fold(A(e),(function(t){return e.slice(0,t)}))},nR=function(t){var e=eR(t);return Z(e,Tr),e},rR=function(t,e){var n=Iw(e,t);return ut(n.reverse(),(function(t){return na(t)})).each(Tr)},oR=function(t){return 0===nt(er(t),(function(t){return!na(t)})).length},iR=function(t,e,n,r){if(na(n))return Rw(n),Jg(n.dom);oR(r)&&na(e)&&br(r,wn.fromTag("br"));var o=Yg(n.dom,Bl.before(r.dom));return Z(nR(e),(function(t){br(r,t)})),rR(t,e),o},uR=function(t,e,n){if(na(n))return Tr(n),na(e)&&Rw(e),Jg(e.dom);var r=Qg(n.dom);return Z(nR(e),(function(t){xr(n,t)})),rR(t,e),r},aR=function(t,e){var n=Iw(e,t);return W.from(n[n.length-1])},cR=function(t,e){return In(e,t)?aR(e,t):W.none()},sR=function(t,e){Kg(t,e.dom).map((function(t){return t.getNode()})).map(wn.fromDom).filter(tu).each(Tr)},fR=function(t,e,n){return sR(!0,e),sR(!1,n),cR(e,n).fold(B(uR,t,e,n),B(iR,t,e,n))},lR=function(t,e,n,r){return e?fR(t,r,n):fR(t,n,r)},dR=function(t,e){var n=wn.fromDom(t.getBody()),r=tR(n.dom,e,t.selection.getRng()).bind((function(t){return lR(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},mR=function(t,e){var n=e.getRng();return lo(UA(t,wn.fromDom(n.startContainer)),UA(t,wn.fromDom(n.endContainer)),(function(r,o){return!1===Bn(r,o)&&(n.deleteContents(),lR(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)},gR=function(t,e){var n=wn.fromDom(e),r=B(Bn,t);return Ci(n,iu,r).isSome()},pR=function(t,e){return gR(t,e.startContainer)||gR(t,e.endContainer)},hR=function(t,e){var n=Yg(t.dom,Bl.fromRangeStart(e)).isNone(),r=Xg(t.dom,Bl.fromRangeEnd(e)).isNone();return!pR(t,e)&&n&&r},vR=function(t){return t.setContent(""),t.selection.setCursorLocation(),!0},bR=function(t){var e=wn.fromDom(t.getBody()),n=t.selection.getRng();return hR(e,n)?vR(t):mR(e,t.selection)},yR=function(t,e){return!t.selection.isCollapsed()&&bR(t)},wR=io,xR=uo,CR=function(t,e,n,r,o){return W.from(e._selectionOverrides.showCaret(t,n,r,o))},SR=function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e},kR=function(t,e){var n=t.fire("BeforeObjectSelected",{target:e});return n.isDefaultPrevented()?W.none():W.some(SR(e))},OR=function(t,e,n){var r=bg(1,t.getBody(),e),o=Bl.fromRangeStart(r),i=o.getNode();if(Jm(i))return CR(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(Jm(u))return CR(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return xR(t)||wR(t)}));return Jm(a)?CR(1,t,a,!1,n):W.none()},TR=function(t,e,n){return e.collapsed?OR(t,e,n).getOr(e):e},ER=function(t){return Ew(t)||Sw(t)},_R=function(t){return _w(t)||kw(t)},DR=function(t,e){Zr(e)&&0===e.data.length&&t.remove(e)},AR=function(t,e,n,r,o,i){return CR(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),DR(t.dom,n),!0},RR=function(t,e){var n=t.selection.getRng();if(!Zr(n.commonAncestorContainer))return!1;var r=e?Ml.Forwards:Ml.Backwards,o=Lg(t.getBody()),i=B(Sg,e?o.next:o.prev),u=e?ER:_R,a=wg(r,t.getBody(),n),c=LA(e,i(a));if(!c||!kg(a,c))return!1;if(u(c))return AR(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&kg(c,s))&&AR(t,n,a.getNode(),r,e,s)},NR=function(t,e){return RR(t,e)},BR=function(t){return iu(wn.fromDom(t))||ru(wn.fromDom(t))},MR=ti.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),PR=function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return jr(n)&&n.getAttribute("data-mce-caret")===r},IR=function(t,e,n,r){var o=function(e){return Zi(wn.fromDom(e))&&!lg(n,r,t)};return yg(!e,n).fold((function(){return yg(e,r).fold(F,o)}),o)},LR=function(t,e,n,r){var o=r.getNode(!1===e);return UA(wn.fromDom(t),wn.fromDom(n.getNode())).map((function(t){return na(t)?MR.remove(t.dom):MR.moveToElement(o)})).orThunk((function(){return W.some(MR.moveToElement(o))}))},FR=function(t,e,n){return qg(e,t,n).bind((function(r){return BR(r.getNode())||IR(t,e,n,r)?W.none():e&&uo(r.getNode())||!1===e&&uo(r.getNode(!0))?LR(t,e,n,r):e&&_w(n)||!1===e&&Ew(n)?W.some(MR.moveToPosition(r)):W.none()}))},zR=function(t,e){return t&&uo(e.nextSibling)?W.some(MR.moveToElement(e.nextSibling)):!1===t&&uo(e.previousSibling)?W.some(MR.moveToElement(e.previousSibling)):W.none()},HR=function(t,e,n){return n.fold((function(t){return W.some(MR.remove(t))}),(function(t){return W.some(MR.moveToElement(t))}),(function(n){return lg(e,n,t)?W.none():W.some(MR.moveToPosition(n))}))},VR=function(t,e,n){return PR(e,n)?zR(e,n.getNode(!1===e)).fold((function(){return FR(t,e,n)}),W.some):FR(t,e,n).bind((function(e){return HR(t,n,e)}))},UR=function(t,e,n){var r=bg(e?1:-1,t,n),o=Bl.fromRangeStart(r),i=wn.fromDom(t);return!1===e&&_w(o)?W.some(MR.remove(o.getNode(!0))):e&&Ew(o)?W.some(MR.remove(o.getNode())):!1===e&&Ew(o)&&Kw(i,o)?Xw(i,o).map((function(t){return MR.remove(t.getNode())})):e&&_w(o)&&Gw(i,o)?Yw(i,o).map((function(t){return MR.remove(t.getNode())})):VR(t,e,o)},jR=function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),Ux(t,e,wn.fromDom(n)),!0}},WR=function(t,e){return function(n){var r=e?Bl.before(n):Bl.after(n);return t.selection.setRng(r.toRange()),!0}},qR=function(t){return function(e){return t.selection.setRng(e.toRange()),!0}},$R=function(t,e){return W.from(zh(t.getBody(),e))},GR=function(t,e){var n=t.selection.getNode();return $R(t,n).filter(uo).fold((function(){return UR(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(jR(t,e),WR(t,e),qR(t))}))}),z)},KR=function(t){Z(_f(t,".mce-offscreen-selection"),Tr)},XR=function(t,e){var n=t.selection.getNode();if(uo(n)&&!ao(n)){var r=$R(t,n.parentNode).filter(uo);return r.fold((function(){return KR(wn.fromDom(t.getBody())),Ux(t,e,wn.fromDom(t.selection.getNode())),WA(t),!0}),z)}return!1},YR=function(t){var e=t.dom,n=t.selection,r=zh(t.getBody(),n.getNode());if(io(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(Bl.before(o).toRange())}return!0},JR=function(t,e){return t.selection.isCollapsed()?GR(t,e):XR(t,e)},QR=function(t,e){var n=Bl.fromRangeStart(t.selection.getRng());return qg(e,t.getBody(),n).filter((function(t){return e?xw(t):Cw(t)})).bind((function(t){return W.from(dg(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))},ZR=function(t,e){return!!t.selection.isCollapsed()&&QR(t,e)},tN=Zr,eN=function(t){return tN(t)&&t.data[0]===du},nN=function(t){return tN(t)&&t.data[t.data.length-1]===du},rN=function(t){return t.ownerDocument.createTextNode(du)},oN=function(t){if(tN(t.previousSibling))return nN(t.previousSibling)||t.previousSibling.appendData(du),t.previousSibling;if(tN(t))return eN(t)||t.insertData(0,du),t;var e=rN(t);return t.parentNode.insertBefore(e,t),e},iN=function(t){if(tN(t.nextSibling))return eN(t.nextSibling)||t.nextSibling.insertData(0,du),t.nextSibling;if(tN(t))return nN(t)||t.appendData(du),t;var e=rN(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e},uN=function(t,e){return t?oN(e):iN(e)},aN=B(uN,!0),cN=B(uN,!1),sN=function(t,e){return Zr(t.container())?uN(e,t.container()):uN(e,t.getNode())},fN=function(t,e){var n=e.get();return n&&t.container()===n&&bu(n)},lN=function(t,e){return e.fold((function(e){Vm(t.get());var n=aN(e);return t.set(n),W.some(Bl(n,n.length-1))}),(function(e){return Jg(e).map((function(e){if(fN(e,t))return Bl(t.get(),1);Vm(t.get());var n=sN(e,!0);return t.set(n),Bl(n,1)}))}),(function(e){return Qg(e).map((function(e){if(fN(e,t))return Bl(t.get(),t.get().length-1);Vm(t.get());var n=sN(e,!1);return t.set(n),Bl(n,n.length-1)}))}),(function(e){Vm(t.get());var n=cN(e);return t.set(n),W.some(Bl(n,1))}))},dN=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return W.none()},mN=ti.generate([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),gN=function(t,e){var n=fg(e,t);return n||t},pN=function(t,e,n){var r=FA(n),o=gN(e,r.container());return MA(t,o,r).fold((function(){return Xg(o,r).bind(B(MA,t,o)).map((function(t){return mN.before(t)}))}),W.none)},hN=function(t,e){return null===ep(t,e)},vN=function(t,e,n){return MA(t,e,n).filter(B(hN,e))},bN=function(t,e,n){var r=zA(n);return vN(t,e,r).bind((function(t){var e=Yg(t,r);return e.isNone()?W.some(mN.start(t)):W.none()}))},yN=function(t,e,n){var r=FA(n);return vN(t,e,r).bind((function(t){var e=Xg(t,r);return e.isNone()?W.some(mN.end(t)):W.none()}))},wN=function(t,e,n){var r=zA(n),o=gN(e,r.container());return MA(t,o,r).fold((function(){return Yg(o,r).bind(B(MA,t,o)).map((function(t){return mN.after(t)}))}),W.none)},xN=function(t){return!1===NA(SN(t))},CN=function(t,e,n){var r=dN([pN,bN,yN,wN],[t,e,n]);return r.filter(xN)},SN=function(t){return t.fold(R,R,R,R)},kN=function(t){return t.fold(A("before"),A("start"),A("end"),A("after"))},ON=function(t){return t.fold(mN.before,mN.before,mN.after,mN.after)},TN=function(t){return t.fold(mN.start,mN.start,mN.end,mN.end)},EN=function(t,e){return kN(t)===kN(e)&&SN(t)===SN(e)},_N=function(t,e,n,r,o,i){return lo(MA(e,n,r),MA(e,n,o),(function(e,r){return e!==r&&PA(n,e,r)?mN.after(t?e:r):i})).getOr(i)},DN=function(t,e){return t.fold(z,(function(t){return!EN(t,e)}))},AN=function(t,e,n,r,o){var i=LA(t,o),u=qg(t,n,i).map(B(LA,t)),a=u.fold((function(){return r.map(ON)}),(function(o){return CN(e,n,o).map(B(_N,t,e,n,i,o)).filter(B(DN,r))}));return a.filter(xN)},RN=function(t,e){return t?e.fold(_(W.some,mN.start),W.none,_(W.some,mN.after),W.none):e.fold(W.none,_(W.some,mN.before),W.none,_(W.some,mN.end))},NN=function(t,e,n,r){var o=LA(t,r),i=CN(e,n,o);return CN(e,n,o).bind(B(RN,t)).orThunk((function(){return AN(t,e,n,i,r)}))};B(NN,!1),B(NN,!0);var BN,MN=function(t){return O(t.selection.getSel().modify)},PN=function(t,e,n){var r=t?1:-1;return e.setRng(Bl(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},IN=function(t,e){var n=e.selection.getRng(),r=t?Bl.fromRangeEnd(n):Bl.fromRangeStart(n);return!!MN(e)&&(t&&Cu(r)?PN(!0,e.selection,r):!(t||!Su(r))&&PN(!1,e.selection,r))};(function(t){t[t["Br"]=0]="Br",t[t["Block"]=1]="Block",t[t["Wrap"]=2]="Wrap",t[t["Eol"]=3]="Eol"})(BN||(BN={}));var LN,FN=function(t,e){return t===Ml.Backwards?lt(e):e},zN=function(t,e,n){return t===Ml.Forwards?e.next(n):e.prev(n)},HN=function(t,e,n,r){return ro(r.getNode(e===Ml.Forwards))?BN.Br:!1===lg(n,r)?BN.Block:BN.Wrap},VN=function(t,e,n,r){var o=Lg(n),i=r,u=[];while(i){var a=zN(e,o,i);if(!a)break;if(ro(a.getNode(!1)))return e===Ml.Forwards?{positions:FN(e,u).concat([a]),breakType:BN.Br,breakAt:W.some(a)}:{positions:FN(e,u),breakType:BN.Br,breakAt:W.some(a)};if(a.isVisible()){if(t(i,a)){var c=HN(n,e,i,a);return{positions:FN(e,u),breakType:c,breakAt:W.some(a)}}u.push(a),i=a}else i=a}return{positions:FN(e,u),breakType:BN.Eol,breakAt:W.none()}},UN=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===Ml.Backwards?o.concat(r):[r].concat(o)})).getOr([])},jN=function(t,e){return ot(t,(function(t,n){return t.fold((function(){return W.some(n)}),(function(r){return lo(ht(r.getClientRects()),ht(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left),u=Math.abs(e-o.left);return u<=i?n:r})).or(t)}))}),W.none())},WN=function(t,e){return ht(e.getClientRects()).bind((function(e){return jN(t,e.left)}))},qN=B(VN,Bl.isAbove,-1),$N=B(VN,Bl.isBelow,1),GN=B(UN,-1,qN),KN=B(UN,1,$N),XN=function(t,e){return qN(t,e).breakAt.isNone()},YN=function(t,e){return $N(t,e).breakAt.isNone()},JN=function(t){return Jg(t).map((function(e){return[e].concat($N(t,e).positions)})).getOr([])},QN=function(t){return Qg(t).map((function(e){return qN(t,e).positions.concat(e)})).getOr([])},ZN=function(t){var e=function(e){return Q(e,(function(e){var n=Qf(e);return n.node=t,n}))};if(jr(t))return e(t.getClientRects());if(Zr(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},tB=function(t){return st(t,ZN)};(function(t){t[t["Up"]=-1]="Up",t[t["Down"]=1]="Down"})(LN||(LN={}));var eB,nB,rB=function(t,e,n,r){while(r=sg(r,t,qu,e))if(n(r))return},oB=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i=tB([r]);-1===t&&(i=i.reverse());for(var c=0;c<i.length;c++){var f=i[c];if(!n(f,s)){if(a.length>0&&e(f,jt(a))&&u++,f.line=u,o(f))return!0;a.push(f)}}},s=jt(i.getClientRects());if(!s)return a;var f=i.getNode();return c(f),rB(t,r,c,f),a},iB=function(t,e){return e.line>t},uB=function(t,e){return e.line===t},aB=B(oB,LN.Up,nl,rl),cB=B(oB,LN.Down,rl,nl),sB=function(t,e,n,r){var o,i,u,a,c=Lg(e),s=[],f=0,l=function(t){return jt(t.getClientRects())};1===t?(o=c.next,i=rl,u=nl,a=Bl.after(r)):(o=c.prev,i=nl,u=rl,a=Bl.before(r));var d=l(a);do{if(a.isVisible()){var m=l(a);if(!u(m,d)){s.length>0&&i(m,jt(s))&&f++;var g=Qf(m);if(g.position=a,g.line=f,n(g))return s;s.push(g)}}}while(a=o(a));return s},fB=function(t){return function(e){return iB(t,e)}},lB=function(t){return function(e){return uB(t,e)}},dB=uo,mB=sg,gB=function(t,e){return Math.abs(t.left-e)},pB=function(t,e){return Math.abs(t.right-e)},hB=function(t,e){return t>=e.left&&t<=e.right},vB=function(t,e){return t>=e.top&&t<=e.bottom},bB=function(t){return Bt(t,"node")},yB=function(t,e,n){return void 0===n&&(n=z),Vt(t,(function(t,r){if(hB(e,r))return n(r)?r:t;if(hB(e,t))return n(t)?t:r;var o=Math.min(gB(t,e),pB(t,e)),i=Math.min(gB(r,e),pB(r,e));return i===o&&bB(r)&&dB(r.node)||i<o?r:t}))},wB=function(t,e,n,r,o){var i=mB(r,t,qu,e,!o);do{if(!i||n(i))return}while(i=mB(i,t,qu,e))},xB=function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=nt(tB([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),wB(LN.Up,t,B(o,nl),e.node,n),wB(LN.Down,t,B(o,rl),e.node,n),r},CB=function(t){return nt(bt(t.getElementsByTagName("*")),Qm)},SB=function(t,e){return{node:t.node,before:gB(t,e)<pB(t,e)}},kB=function(t,e,n){var r=tB(CB(t)),o=nt(r,B(vB,n)),i=function(t){return!Yr(t.node)&&!co(t.node)},u=yB(o,e,i);if(u){var a=i(u);if(u=yB(xB(t,u,a),e,i),u&&Qm(u.node))return SB(u,e)}return null},OB=function(t,e){t.selection.setRng(e),nb(t,t.selection.getRng())},TB=function(t,e,n){return W.some(TR(t,e,n))},EB=function(t,e,n,r,o,i){var u=e===Ml.Forwards,a=Lg(t.getBody()),c=B(Sg,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var f=ul(n);if(i(f))return CR(e,t,f,e===Ml.Backwards,!1)}var l=wg(e,t.getBody(),n);if(s(l))return kR(t,l.getNode(!u));var d=LA(u,c(l)),m=Au(n);if(!d)return m?W.some(n):W.none();if(s(d))return CR(e,t,d.getNode(!u),u,!1);var g=c(d);return g&&s(g)&&kg(d,g)?CR(e,t,g.getNode(!u),u,!1):m?TB(t,d.toRange(),!1):W.none()},_B=function(t,e,n,r,o,i){var u=wg(e,t.getBody(),n),a=jt(u.getClientRects()),c=e===LN.Down;if(!a)return W.none();var s,f=c?cB:aB,l=f(t.getBody(),fB(1),u),d=nt(l,lB(1)),m=a.left,g=yB(d,m);if(g&&i(g.node)){var p=Math.abs(m-g.left),h=Math.abs(m-g.right);return CR(e,t,g.node,p<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):ul(n),s){var v=sB(e,t.getBody(),fB(1),s),b=yB(nt(v,lB(1)),m);if(b)return TB(t,b.position.toRange(),!1);if(b=jt(nt(v,lB(0))),b)return TB(t,b.position.toRange(),!1)}return 0===d.length?DB(t,c).filter(c?o:r).map((function(e){return TR(t,e.toRange(),!1)})):W.none()},DB=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=Bl.fromRangeEnd(n),i=$N(r,o);return vt(i.positions)}o=Bl.fromRangeStart(n),i=qN(r,o);return ht(i.positions)},AB=function(t,e,n){return DB(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},RB=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},NB=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},BB=function(t,e,n){return lN(e,n).map((function(e){return RB(t,e),n}))},MB=function(t,e,n){var r=t.getBody(),o=Bl.fromRangeStart(t.selection.getRng()),i=B(RA,t),u=NN(n,i,r,o);return u.bind((function(n){return BB(t,e,n)}))},PB=function(t,e,n){var r=Q(_f(wn.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=nt(r,t),i=nt(n,t);Z(dt(o,i),B(NB,!1)),Z(dt(i,o),B(NB,!0))},IB=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=Bl.fromRangeStart(t.selection.getRng());Bl.isTextPosition(n)&&!1===IA(n)&&(RB(t,Hm(e.get(),n)),e.set(null))}},LB=function(t,e,n,r){if(e.selection.isCollapsed()){var o=nt(r,t);Z(o,(function(r){var o=Bl.fromRangeStart(e.selection.getRng());CN(t,e.getBody(),o).bind((function(t){return BB(e,n,t)}))}))}},FB=function(t,e,n){return!!um(t)&&MB(t,e,n).isSome()},zB=function(t,e,n){return!!um(e)&&IN(t,e)},HB=function(t){var e=Ys(null),n=B(RA,t);return t.on("NodeChange",(function(r){!um(t)||tn.browser.isIE()&&r.initial||(PB(n,t.dom,r.parents),IB(t,e),LB(n,t,e,r.parents))})),e},VB=B(zB,!0),UB=B(zB,!1),jB=function(t,e,n){if(um(t)){var r=DB(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?Bl.fromRangeEnd(n):Bl.fromRangeStart(n)}));return CN(B(RA,t),t.getBody(),r).exists((function(e){var r=ON(e);return lN(n,r).exists((function(e){return RB(t,e),!0}))}))}return!1},WB=function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n},qB=function(t){return lo(Jg(t),Qg(t),(function(e,n){var r=LA(!0,e),o=LA(!1,n);return Xg(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)},$B=function(t,e){return function(n){return lN(e,n).exists((function(e){return RB(t,e),!0}))}},GB=function(t,e,n,r){var o=t.getBody(),i=B(RA,t);t.undoManager.ignore((function(){t.selection.setRng(WB(n,r)),t.execCommand("Delete"),CN(i,o,Bl.fromRangeStart(t.selection.getRng())).map(TN).map($B(t,e))})),t.nodeChanged()},KB=function(t,e){var n=fg(e,t);return n||t},XB=function(t,e,n,r){var o=KB(t.getBody(),r.container()),i=B(RA,t),u=CN(i,o,r);return u.bind((function(t){return n?t.fold(A(W.some(TN(t))),W.none,A(W.some(ON(t))),W.none):t.fold(W.none,A(W.some(ON(t))),W.none,A(W.some(TN(t))))})).map($B(t,e)).getOrThunk((function(){var a=$g(n,o,r),c=a.bind((function(t){return CN(i,o,t)}));return lo(u,c,(function(){return MA(i,o,r).exists((function(e){return!!qB(e)&&(Ux(t,n,wn.fromDom(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?GB(t,e,r,o):GB(t,e,o,r),!0}))}))})).getOr(!1)}))},YB=function(t,e,n){if(t.selection.isCollapsed()&&um(t)){var r=Bl.fromRangeStart(t.selection.getRng());return XB(t,e,n,r)}return!1},JB=function(t,e){var n=Iw(e,t);return at(n,Ji).fold(A(n),(function(t){return n.slice(0,t)}))},QB=function(t){return 1===ar(t)},ZB=function(t,e,n,r){var o=B(mk,e),i=Q(nt(r,o),(function(t){return t.dom}));if(0===i.length)Ux(e,t,n);else{var u=dk(n.dom,i);e.selection.setRng(u.toRange())}},tM=function(t,e){var n=wn.fromDom(t.getBody()),r=wn.fromDom(t.selection.getStart()),o=nt(JB(n,r),QB);return vt(o).exists((function(n){var r=Bl.fromRangeStart(t.selection.getRng());return!(!qA(e,r,n.dom)||gk(n))&&(ZB(e,t,n,o),!0)}))},eM=function(t,e){return!!t.selection.isCollapsed()&&tM(t,e)},nM=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),Ux(t,e,wn.fromDom(n)),!0},rM=function(t,e){var n=e?Sw:kw,r=e?Ml.Forwards:Ml.Backwards,o=wg(r,t.getBody(),t.selection.getRng());return n(o)?nM(t,e,o.getNode(!e)):W.from(LA(e,o)).filter((function(t){return n(t)&&kg(o,t)})).exists((function(n){return nM(t,e,n.getNode(!e))}))},oM=function(t,e){var n=t.selection.getNode();return!!co(n)&&nM(t,e,n)},iM=function(t,e){return t.selection.isCollapsed()?rM(t,e):oM(t,e)},uM=function(t){return Si(t,(function(t){return io(t.dom)||uo(t.dom)})).exists((function(t){return io(t.dom)}))},aM=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},cM=function(t,e){var n=t||Qi(e)?"margin":"padding",r="rtl"===To(e,"direction")?"-right":"-left";return n+r},sM=function(t,e,n,r,o,i){var u=cM(n,wn.fromDom(i));if("outdent"===e){var a=Math.max(0,aM(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else{a=aM(i.style[u])+r+o;t.setStyle(i,u,a)}},fM=function(t,e){return ft(e,(function(e){var n=cM(Gd(t),e),r=_o(e,n).map(aM).getOr(0),o=t.dom.getContentEditable(e.dom);return"false"!==o&&r>0}))},lM=function(t){var e=gM(t);return!t.mode.isReadOnly()&&(e.length>1||fM(t,e))},dM=function(t){return nu(t)||ru(t)},mM=function(t){return Yn(t).exists(dM)},gM=function(t){return nt(jf(t.selection.getSelectedBlocks()),(function(t){return!dM(t)&&!mM(t)&&uM(t)}))},pM=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=Kd(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=Gd(t),s=Od(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),Z(gM(t),(function(t){sM(n,e,c,a,u,t.dom)}))},hM=function(t,e){if(t.selection.isCollapsed()&&lM(t)){var n=t.dom,r=t.selection.getRng(),o=Bl.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Vw(wn.fromDom(i),o))return pM(t,"outdent"),!0}return!1},vM=function(t,e){t.getDoc().execCommand(e,!1,null)},bM=function(t,e){hM(t)||JR(t,!1)||NR(t,!1)||YB(t,e,!1)||dR(t,!1)||FC(t)||ZR(t,!1)||iM(t,!1)||yR(t)||eM(t,!1)||(vM(t,"Delete"),WA(t))},yM=function(t,e){JR(t,!0)||NR(t,!0)||YB(t,e,!0)||dR(t,!0)||FC(t)||ZR(t,!0)||iM(t,!0)||yR(t)||eM(t,!0)||vM(t,"ForwardDelete")},wM=function(t,e){t.addCommand("delete",(function(){bM(t,e)})),t.addCommand("forwardDelete",(function(){yM(t,e)}))},xM=5,CM=400,SM=function(t){return void 0===t.touches||1!==t.touches.length?W.none():W.some(t.touches[0])},kM=function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>xM||r>xM},OM=function(t){var e=mf(),n=Ys(!1),r=pf((function(e){t.fire("longpress",Wt(Wt({},e),{type:"longpress"})),n.set(!0)}),CM);t.on("touchstart",(function(t){SM(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)}))}),!0),t.on("touchmove",(function(o){r.cancel(),SM(o).each((function(r){e.on((function(o){kM(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Wt(Wt({},o),{type:"tap"}))}))}),!0)},TM=function(t,e){return Nt(t,e.nodeName)},EM=function(t,e){return!!Zr(e)||!!jr(e)&&(!TM(t,e)&&!Cp(e))},_M=function(t,e,n){return J(Pw(wn.fromDom(n),wn.fromDom(e)),(function(e){return TM(t,e.dom)}))},DM=function(t,e){if(Zr(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||TM(t,e.nextSibling)))return!0}return!1},AM=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),f=Od(t);if(c&&jr(c)&&f){var l=s.nodeName.toLowerCase();if(u.isValidChild(l,f.toLowerCase())&&!_M(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,p=d.endContainer,h=d.endOffset,v=dy(t);c=s.firstChild;while(c)if(EM(a,c)){if(DM(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(f,Td(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(p,h),i.setRng(d),t.nodeChanged())}}},RM=function(t){Od(t)&&t.on("NodeChange",B(AM,t))},NM=function(t){return Ei(wn.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull()},BM=function(t){t.selection.setRng(t.selection.getRng())},MM=function(t,e){e.hasAttribute("data-mce-caret")&&(Du(e),BM(t),t.selection.scrollIntoView(e))},PM=function(t,e){var n=NM(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void MM(t,n)):void(wu(n)&&(MM(t,n),t.undoManager.add()))},IM=function(t){t.on("keyup compositionstart",B(PM,t))},LM=uo,FM=function(t,e,n){return EB(e,t,n,Ew,_w,LM)},zM=function(t,e,n){var r=function(t){return Ew(t)||Ow(t)},o=function(t){return _w(t)||Tw(t)};return _B(e,t,n,r,o,LM)},HM=function(t){var e=t.dom.create(Od(t));return(!tn.ie||tn.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e},VM=function(t,e,n){var r=Lg(t.getBody()),o=B(Sg,1===e?r.next:r.prev);if(n.collapsed&&bm(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;var u=o(Bl.fromRangeStart(n));if(!u){var a=HM(t);1===e?t.$(i).after(a):t.$(i).before(a),t.selection.select(a,!0),t.selection.collapse()}}},UM=function(t,e){var n=e?Ml.Forwards:Ml.Backwards,r=t.selection.getRng();return FM(n,t,r).orThunk((function(){return VM(t,n,r),W.none()}))},jM=function(t,e){var n=e?1:-1,r=t.selection.getRng();return zM(n,t,r).orThunk((function(){return VM(t,n,r),W.none()}))},WM=function(t,e){return UM(t,e).exists((function(e){return OB(t,e),!0}))},qM=function(t,e){return jM(t,e).exists((function(e){return OB(t,e),!0}))},$M=function(t,e){var n=e?_w:Ew;return AB(t,e,n)},GM=function(t){return Y(["figcaption"],Ln(t))},KM=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},XM=function(t,e,n){n?xr(t,e):wr(t,e)},YM=function(t,e){var n=wn.fromTag("br");return XM(t,n,e),KM(n)},JM=function(t,e,n,r){var o=wn.fromTag(n),i=wn.fromTag("br");return bo(o,r),xr(o,i),XM(t,o,e),KM(i)},QM=function(t,e,n,r){return""===e?YM(t,r):JM(t,r,e,n)},ZM=function(t,e){var n=B(Bn,e);return Si(wn.fromDom(t.container()),Ji,n).filter(GM)},tP=function(t,e,n){return e?YN(t.dom,n):XN(t.dom,n)},eP=function(t,e){var n=wn.fromDom(t.getBody()),r=Bl.fromRangeStart(t.selection.getRng()),o=Od(t),i=Td(t);return ZM(r,n).exists((function(){if(tP(n,e,r)){var u=QM(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},nP=function(t,e){return!!t.selection.isCollapsed()&&eP(t,e)},rP=function(t){return Q(t,(function(t){return Wt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:E},t)}))},oP=function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey},iP=function(t,e){return st(rP(t),(function(t){return oP(t,e)?[t]:[]}))},uP=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},aP=function(t,e){return ut(iP(t,e),(function(t){return t.action()}))},cP=function(t,e){var n=e?Ml.Forwards:Ml.Backwards,r=t.selection.getRng();return EB(t,n,r,Sw,kw,co).exists((function(e){return OB(t,e),!0}))},sP=function(t,e){var n=e?1:-1,r=t.selection.getRng();return _B(t,n,r,Sw,kw,co).exists((function(e){return OB(t,e),!0}))},fP=function(t,e){var n=e?kw:Sw;return AB(t,e,n)},lP=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}},dP=function(t,e){return st(e,(function(e){var n=lP(Qf(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))},mP=function(t,e,n){return ot(t,(function(t,r){return t.fold((function(){return W.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return W.some(i<o?r:t)}))}),W.none())},gP=function(t,e,n,r,o){var i=_f(wn.fromDom(n),"td,th,caption").map((function(t){return t.dom})),u=nt(dP(t,i),(function(t){return e(t,o)}));return mP(u,r,o).map((function(t){return t.cell}))},pP=function(t){return t.bottom},hP=function(t){return t.top},vP=function(t,e){return t.y<e},bP=function(t,e){return t.y>e},yP=B(gP,pP,vP),wP=B(gP,hP,bP),xP=function(t,e){return ht(e.getClientRects()).bind((function(e){return yP(t,e.left,e.top)})).bind((function(t){return WN(QN(t),e)}))},CP=function(t,e){return vt(e.getClientRects()).bind((function(e){return wP(t,e.left,e.top)})).bind((function(t){return WN(JN(t),e)}))},SP=function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))},kP=function(t){return t.breakType===BN.Wrap&&0===t.positions.length},OP=function(t){return t.breakType===BN.Br&&1===t.positions.length},TP=function(t,e,n){var r=t(e,n);return kP(r)||!ro(n.getNode())&&OP(r)?!SP(t,e,r):r.breakAt.isNone()},EP=B(TP,qN),_P=B(TP,$N),DP=function(t,e,n){var r=Bl.fromRangeStart(e);return Kg(!t,n).exists((function(t){return t.isEqual(r)}))},AP=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Ym()||!DP(e,o,n))&&(CR(i,t,n,!e,!1).each((function(e){OB(t,e)})),!0)},RP=function(t,e,n){return xP(e,n).orThunk((function(){return ht(n.getClientRects()).bind((function(n){return jN(GN(t,Bl.before(e)),n.left)}))})).getOr(Bl.before(e))},NP=function(t,e,n){return CP(e,n).orThunk((function(){return ht(n.getClientRects()).bind((function(n){return jN(KN(t,Bl.after(e)),n.left)}))})).getOr(Bl.after(e))},BP=function(t,e){var n=e.getNode(t);return jr(n)&&"TABLE"===n.nodeName?W.some(n):W.none()},MP=function(t,e,n,r){var o=Od(e);o?e.undoManager.transact((function(){var r=wn.fromTag(o);bo(r,Td(e)),xr(r,wn.fromTag("br")),t?yr(wn.fromDom(n),r):br(wn.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),OB(e,i)})):OB(e,r.toRange())},PP=function(t,e,n){var r=BP(!!e,n),o=!1===e;r.fold((function(){return OB(t,n.toRange())}),(function(r){return Kg(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return OB(t,n.toRange())}),(function(o){return MP(e,t,r,n)}))}))},IP=function(t,e,n,r){var o=t.selection.getRng(),i=Bl.fromRangeStart(o),u=t.getBody();if(!e&&EP(r,i)){var a=RP(u,n,i);return PP(t,e,a),!0}if(e&&_P(r,i)){a=NP(u,n,i);return PP(t,e,a),!0}return!1},LP=function(t,e,n){return W.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return W.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},FP=function(t,e){return LP(t,e,AP)},zP=function(t,e){return LP(t,e,IP)},HP=function(t,e,n){var r=qe().os;aP([{keyCode:ev.RIGHT,action:uP(WM,t,!0)},{keyCode:ev.LEFT,action:uP(WM,t,!1)},{keyCode:ev.UP,action:uP(qM,t,!1)},{keyCode:ev.DOWN,action:uP(qM,t,!0)},{keyCode:ev.RIGHT,action:uP(FP,t,!0)},{keyCode:ev.LEFT,action:uP(FP,t,!1)},{keyCode:ev.UP,action:uP(zP,t,!1)},{keyCode:ev.DOWN,action:uP(zP,t,!0)},{keyCode:ev.RIGHT,action:uP(cP,t,!0)},{keyCode:ev.LEFT,action:uP(cP,t,!1)},{keyCode:ev.UP,action:uP(sP,t,!1)},{keyCode:ev.DOWN,action:uP(sP,t,!0)},{keyCode:ev.RIGHT,action:uP(FB,t,e,!0)},{keyCode:ev.LEFT,action:uP(FB,t,e,!1)},{keyCode:ev.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:uP(VB,t,e)},{keyCode:ev.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:uP(UB,t,e)},{keyCode:ev.UP,action:uP(nP,t,!1)},{keyCode:ev.DOWN,action:uP(nP,t,!0)}],n).each((function(t){n.preventDefault()}))},VP=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&HP(t,e,n)}))},UP=function(t,e,n){aP([{keyCode:ev.BACKSPACE,action:uP(hM,t,!1)},{keyCode:ev.BACKSPACE,action:uP(JR,t,!1)},{keyCode:ev.DELETE,action:uP(JR,t,!0)},{keyCode:ev.BACKSPACE,action:uP(NR,t,!1)},{keyCode:ev.DELETE,action:uP(NR,t,!0)},{keyCode:ev.BACKSPACE,action:uP(YB,t,e,!1)},{keyCode:ev.DELETE,action:uP(YB,t,e,!0)},{keyCode:ev.BACKSPACE,action:uP(FC,t,!1)},{keyCode:ev.DELETE,action:uP(FC,t,!0)},{keyCode:ev.BACKSPACE,action:uP(ZR,t,!1)},{keyCode:ev.DELETE,action:uP(ZR,t,!0)},{keyCode:ev.BACKSPACE,action:uP(iM,t,!1)},{keyCode:ev.DELETE,action:uP(iM,t,!0)},{keyCode:ev.BACKSPACE,action:uP(yR,t,!1)},{keyCode:ev.DELETE,action:uP(yR,t,!0)},{keyCode:ev.BACKSPACE,action:uP(dR,t,!1)},{keyCode:ev.DELETE,action:uP(dR,t,!0)},{keyCode:ev.BACKSPACE,action:uP(eM,t,!1)},{keyCode:ev.DELETE,action:uP(eM,t,!0)}],n).each((function(t){n.preventDefault()}))},jP=function(t,e){aP([{keyCode:ev.BACKSPACE,action:uP(YR,t)},{keyCode:ev.DELETE,action:uP(YR,t)}],e)},WP=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&UP(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&jP(t,e)}))},qP=function(t){while(t){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}},$P=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=qP(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(su),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){var c=new Hi(e,e);while(n=c.current()){if(Zr(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else ro(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),nb(t,a)}},GP=function(t,e){var n,r,o=t.getRoot();n=e;while(n!==o&&"false"!==t.getContentEditable(n))"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},KP=function(t){return W.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},XP=function(t){return KP(t).fold(A(""),(function(t){return t.nodeName.toUpperCase()}))},YP=function(t){return KP(t).filter((function(t){return ru(wn.fromDom(t))})).isSome()},JP=function(t,e){return t.firstChild&&t.firstChild.nodeName===e},QP=function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t},ZP=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},tI=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},eI=function(t){return tI(t)&&tI(t.parentNode)},nI=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},rI=function(t,e,n){var r=t[n?"firstChild":"lastChild"];while(r){if(jr(r))break;r=r[n?"nextSibling":"previousSibling"]}return r===e},oI=function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){eI(n)&&(o="LI");var a=o?e(o):i.create("BR");if(rI(n,r,!0)&&rI(n,r,!1))if(ZP(n,"LI")){var c=nI(n);i.insertAfter(a,c),QP(n)?i.remove(c):i.remove(n)}else i.replace(a,n);else if(rI(n,r,!0))ZP(n,"LI")?(i.insertAfter(a,nI(n)),a.appendChild(i.doc.createTextNode(" ")),a.appendChild(n)):n.parentNode.insertBefore(a,n),i.remove(r);else if(rI(n,r,!1))i.insertAfter(a,nI(n)),i.remove(r);else{n=nI(n);var s=u.cloneRange();s.setStartAfter(r),s.setEndAfter(n);var f=s.extractContents();"LI"===o&&JP(f,"LI")?(a=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(a,n)),i.remove(r)}$P(t,a)}},iI=function(t){Z(Ef(wn.fromDom(t),Un),(function(t){var e=t.dom;e.nodeValue=gu(e.nodeValue)}))},uI=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},aI=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},cI=function(t){t.innerHTML='<br data-mce-bogus="1">'},sI=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},fI=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},lI=function(t,e,n){var r,o=n,i=[];if(o){while(o=o.firstChild){if(t.isBlock(o))return;jr(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}r=i.length;while(r--)o=i[r],(!o.hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||uI(t,o))&&t.remove(o)}},dI=function(t,e,n){return!1===Zr(e)?n:t?1===n&&e.data.charAt(n-1)===du?0:n:n===e.data.length-1&&e.data.charAt(n)===du?e.data.length:n},mI=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,dI(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,dI(!1,t.endContainer,t.endOffset)),e},gI=function(t){do{Zr(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)},pI=function(t,e){var n,r,o=t.getRoot();n=e;while(n!==o&&"false"!==t.getContentEditable(n))"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},hI=function(t,e,n){var r=t.dom;W.from(n.style).map(r.parseStyle).each((function(t){var n=Do(wn.fromDom(e)),o=Wt(Wt({},n),t);r.setStyles(e,o)}));var o=W.from(n.class).map((function(t){return t.split(/\s+/)})),i=W.from(e.className).map((function(t){return nt(t.split(/\s+/),(function(t){return""!==t}))}));lo(o,i,(function(t,n){var o=nt(n,(function(e){return!Y(t,e)})),i=$t($t([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=_t(n,(function(t,e){return!Y(u,e)}));r.setAttribs(e,a)},vI=function(t,e){var n=Od(t);if(n&&n.toLowerCase()===e.tagName.toLowerCase()){var r=Td(t);hI(t,e,r)}},bI=function(t,e,n,r,o){var i,u,a,c,s,f,l=e||"P",d=t.dom,m=pI(d,r);if(u=d.getParent(r,d.isBlock),!u||!fI(d,u)){if(u=u||m,f=u===t.getBody()||aI(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(l),vI(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;c=r;while(c.parentNode!==u)c=c.parentNode;while(c&&!d.isBlock(c))a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(f,l.toLowerCase())){i=d.create(l),vI(t,i),a.parentNode.insertBefore(i,a),c=a;while(c&&!d.isBlock(c))s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r},yI=function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")},wI=function(t,e){var n,r,o,i,u,a,c,s,f,l,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),p=t.selection.getRng(),h=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(n=e||"TABLE"===s||"HR"===s?d.create(e||f):i.cloneNode(!1),u=n,!1===Dd(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(tp(a)||Cp(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return vI(t,n),cI(u),n},v=function(t){var e,n,u=dI(t,r,o);if(Zr(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&l&&!t)return!0;if(t&&jr(r)&&r===i.firstChild)return!0;if(sI(r,"TABLE")||sI(r,"HR"))return l&&!t||!l&&t;var a=new Hi(r,i);Zr(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());while(e=a.current()){if(jr(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Zr(e)&&!Gu(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?h(f):h(),Ad(t)&&fI(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),$P(t,u)};xv(d,p).each((function(t){p.setStart(t.startContainer,t.startOffset),p.setEnd(t.endContainer,t.endOffset)})),r=p.startContainer,o=p.startOffset,f=Od(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);jr(r)&&r.hasChildNodes()&&(l=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=l&&Zr(r)?r.nodeValue.length:0);var x=pI(d,r);if(x){(f&&!y||!f&&y)&&(r=bI(t,f,p,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?oI(t,h,c,i,f):f&&i===t.getBody()||(f=f||"P",vu(i)?(u=Du(i),d.isEmpty(i)&&cI(i),vI(t,u),$P(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(h(),i),$P(t,sI(i,"HR")?u:i)):(n=mI(p).cloneRange(),n.setEndAfter(i),a=n.extractContents(),iI(a),gI(a),u=a.firstChild,d.insertAfter(a,i),lI(d,g,u),yI(d,i),d.isEmpty(i)&&cI(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(vI(t,u),$P(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},xI=function(t,e,n){var r,o=new Hi(e,n),i=t.getNonEmptyElements();while(r=o.next())if(i[r.nodeName.toLowerCase()]||r.length>0)return!0},CI=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),nb(t,r)},SI=function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();xv(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var f=i.getParent(c,i.isBlock),l=f?i.getParent(f.parentNode,i.isBlock):null,d=l?l.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(f=l),c&&3===c.nodeType&&a>=c.nodeValue.length&&(xI(t.schema,c,f)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),Fl(i,u,n),CI(t,n,r),t.undoManager.add()},kI=function(t,e){var n=wn.fromTag("br");br(wn.fromDom(e),n),t.undoManager.add()},OI=function(t,e){EI(t.getBody(),e)||yr(wn.fromDom(e),wn.fromTag("br"));var n=wn.fromTag("br");yr(wn.fromDom(e),n),CI(t,n.dom,!1),t.undoManager.add()},TI=function(t){return ro(t.getNode())},EI=function(t,e){return!!TI(Bl.after(e))||Xg(t,Bl.after(e)).map((function(t){return ro(t.getNode())})).getOr(!1)},_I=function(t){return t&&"A"===t.nodeName&&"href"in t},DI=function(t){return t.fold(F,_I,_I,F)},AI=function(t){var e=B(RA,t),n=Bl.fromRangeStart(t.selection.getRng());return CN(e,t.getBody(),n).filter(DI)},RI=function(t,e){e.fold(E,B(kI,t),B(OI,t),E)},NI=function(t,e){var n=AI(t);n.isSome()?n.each(B(RI,t)):SI(t,e)},BI=function(t,e){return KP(t).filter((function(t){return e.length>0&&Dn(wn.fromDom(t),e)})).isSome()},MI=function(t){return BI(t,Ed(t))},PI=function(t){return BI(t,_d(t))},II=ti.generate([{br:[]},{block:[]},{none:[]}]),LI=function(t,e){return PI(t)},FI=function(t){return function(e,n){var r=""===Od(e);return r===t}},zI=function(t){return function(e,n){return YP(e)===t}},HI=function(t,e){return function(n,r){var o=XP(n)===t.toUpperCase();return o===e}},VI=function(t){return HI("pre",t)},UI=function(){return HI("summary",!0)},jI=function(t){return function(e,n){return kd(e)===t}},WI=function(t,e){return MI(t)},qI=function(t,e){return e},$I=function(t){var e=Od(t),n=GP(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},GI=function(t,e){return function(n,r){var o=ot(t,(function(t,e){return t&&e(n,r)}),!0);return o?W.some(e):W.none()}},KI=function(t,e){return dN([GI([LI],II.none()),GI([UI()],II.br()),GI([VI(!0),jI(!1),qI],II.br()),GI([VI(!0),jI(!1)],II.block()),GI([VI(!0),jI(!0),qI],II.block()),GI([VI(!0),jI(!0)],II.br()),GI([zI(!0),qI],II.br()),GI([zI(!0)],II.block()),GI([FI(!0),qI,$I],II.block()),GI([FI(!0)],II.br()),GI([WI],II.br()),GI([FI(!1),qI],II.br()),GI([$I],II.block())],[t,!(!e||!e.shiftKey)]).getOr(II.none())},XI=function(t,e){KI(t,e).fold((function(){NI(t,e)}),(function(){wI(t,e)}),E)},YI=function(t,e){e.isDefaultPrevented()||(e.preventDefault(),ST(t.undoManager),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),XI(t,e)})))},JI=function(t){t.on("keydown",(function(e){e.keyCode===ev.ENTER&&YI(t,e)}))},QI=function(t,e,n){aP([{keyCode:ev.END,action:uP($M,t,!0)},{keyCode:ev.HOME,action:uP($M,t,!1)},{keyCode:ev.END,action:uP(fP,t,!0)},{keyCode:ev.HOME,action:uP(fP,t,!1)},{keyCode:ev.END,action:uP(jB,t,!0,e)},{keyCode:ev.HOME,action:uP(jB,t,!1,e)}],n).each((function(t){n.preventDefault()}))},ZI=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&QI(t,e,n)}))},tL=qe().browser,eL=function(t){var e=gf((function(){t.composing||bx(t)}),0);tL.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))},nL=function(t){eL(t),t.on("input",(function(e){!1===e.isComposing&&bx(t)}))},rL=qe(),oL=function(t,e,n){aP([{keyCode:ev.PAGE_UP,action:uP(jB,t,!1,e)},{keyCode:ev.PAGE_DOWN,action:uP(jB,t,!0,e)}],n)},iL=function(t){return t.stopImmediatePropagation()},uL=function(t){return t.keyCode===ev.PAGE_UP||t.keyCode===ev.PAGE_DOWN},aL=function(t,e,n){n&&!t.get()?e.on("NodeChange",iL,!0):!n&&t.get()&&e.off("NodeChange",iL),t.set(n)},cL=function(t,e){if(!rL.os.isOSX()){var n=Ys(!1);t.on("keydown",(function(e){uL(e)&&aL(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&oL(t,e,r),uL(r)&&n.get()&&(aL(n,t,!1),t.nodeChanged())}))}},sL=function(t,e){var n=e.container(),r=e.offset();return Zr(n)?(n.insertData(r,t),W.some(Bl(n,r+t.length))):xg(e).map((function(n){var r=wn.fromText(t);return e.isAtEnd()?yr(n,r):br(n,r),Bl(r.dom,t.length)}))},fL=B(sL,su),lL=B(sL," "),dL=function(t){return function(e){return e.fold((function(e){return Yg(t.dom,Bl.before(e))}),(function(t){return Jg(t)}),(function(t){return Qg(t)}),(function(e){return Xg(t.dom,Bl.after(e))}))}},mL=function(t,e){return function(n){return ux(t,n)?fL(e):lL(e)}},gL=function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}},pL=function(t){var e=Bl.fromRangeStart(t.selection.getRng()),n=wn.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=B(RA,t),o=Bl.fromRangeStart(t.selection.getRng());return CN(r,t.getBody(),o).bind(dL(n)).bind(mL(n,e)).exists(gL(t))}return!1},hL=function(t,e){aP([{keyCode:ev.SPACEBAR,action:uP(pL,t)}],e).each((function(t){e.preventDefault()}))},vL=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&hL(t,e)}))},bL=function(t){var e=HB(t);return IM(t),VP(t,e),WP(t,e),JI(t),vL(t),nL(t),ZI(t,e),cL(t,e),e},yL=function(t){return zT(t)?Ys(null):bL(t)},wL=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&sv(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!tn.range&&t.selection.isCollapsed()||Oh(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Oh(t)&&("IMG"===t.selection.getNode().nodeName?Ii.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!wm(this.editor)&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),e=o.getStart(!0)||r,e.ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),t=t||{},t.element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0;e--)if(n[e]!==this.lastPath[e])break;if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),xL=function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))},CL=function(t){t.parser.addNodeFilter("details",(function(t){Z(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){Z(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",v(e)?e:null),t.attr("data-mce-open",null)}))}))},SL=function(t){xL(t),CL(t)},kL=function(t){return jr(t)&&eu(wn.fromDom(t))},OL=function(t){var e=t.selection.getRng(),n=Bl.fromRangeStart(e),r=Bl.fromRangeEnd(e);if(Bl.isElementPosition(n)){var o=n.container();kL(o)&&Jg(o).each((function(t){return e.setStart(t.container(),t.offset())}))}if(Bl.isElementPosition(r)){o=n.container();kL(o)&&Qg(o).each((function(t){return e.setEnd(t.container(),t.offset())}))}t.selection.setRng(VC(e))},TL=function(t){t.on("click",(function(e){e.detail>=3&&OL(t)}))},EL=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},_L=function(t){return t.inline?EL(t.getBody()):{left:0,top:0}},DL=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}},AL=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o},RL=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=EL(t.getContentAreaContainer()),r=AL(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}},NL=function(t,e,n){return{pageX:n.left-t.left+e.left,pageY:n.top-t.top+e.top}},BL=function(t,e){return NL(_L(t),DL(t),RL(t,e))},ML=uo,PL=io,IL=function(t,e){return ML(e)&&e!==t},LL=function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!ML(e)},FL=function(t){var e=t.cloneNode(!0);return e.removeAttribute("data-mce-selected"),e},zL=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},HL=function(t,e){t.parentNode!==e&&e.appendChild(t)},VL=function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"},UL=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},jL=function(t){return 0===t.button},WL=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}},qL=function(t,e){return function(n){if(jL(n)){var r=ut(e.dom.getParents(n.target),ll(ML,PL)).getOr(null);if(IL(e.getBody(),r)){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:zL(e,r,r.offsetWidth,r.offsetHeight)})}}}},$L=function(t,e){var n=Ii.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&o>10){var i=e.fire("dragstart",{target:t.element});if(i.isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var u=WL(t,BL(e,r));HL(t.ghost,e.getBody()),VL(t.ghost,u,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}},GL=function(t){var e=t.getSel().getRangeAt(0),n=e.startContainer;return 3===n.nodeType?n.parentNode:n},KL=function(t,e){return function(n){t.on((function(t){if(t.dragging){if(LL(e,GL(e.selection),t.element)){var r=FL(t.element),o=e.fire("drop",{clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||e.undoManager.transact((function(){UL(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}e.fire("dragend")}})),YL(t)}},XL=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),YL(t)}},YL=function(t){t.on((function(t){UL(t.ghost)})),t.clear()},JL=function(t){var e=mf(),n=Vs.DOM,r=document,o=qL(e,t),i=$L(e,t),u=KL(e,t),a=XL(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",u),n.bind(r,"mousemove",i),n.bind(r,"mouseup",a),t.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",a)})),t.on("keydown",(function(t){t.keyCode===ev.ESC&&a()}))},QL=function(t){t.on("drop",(function(e){var n="undefined"!==typeof e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(ML(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))},ZL=function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(Y(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&ID(t,"Dropped file type is not supported"))}},n=function(n){Qb(t,n.target)&&e(n)},r=function(){var r=Vs.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];Z(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){Z(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){Ii.setEditorTimeout(t,r,0)}))},tF=function(t){JL(t),QL(t),Om(t)&&ZL(t)},eF=function(t){var e=gf((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=TR(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))},nF=function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(co(n)){var r=zh(t.getBody(),n),o=uo(r)?r:n;t.selection.getNode()!==o&&kR(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))},rF=io,oF=uo,iF=function(t,e){return zh(t.getBody(),e)},uF=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=Xm(t,i,o,(function(){return dy(t)})),a="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return r.hasClass(t,"mce-offscreen-selection")},f=function(t){return t!==i&&(oF(t)||co(t))&&r.isChildOf(t,i)},l=function(t){return Ew(t)||_w(t)||Sw(t)||kw(t)},d=function(){var t=r.get(a);return t?t.getElementsByTagName("*")[0]:t},m=function(t){t&&n.setRng(t)},g=n.getRng,p=function(e,r,o,i){void 0===i&&(i=!0);var a=t.fire("ShowCaret",{target:r,direction:e,before:o});return a.isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},h=function(t){t.hasAttribute("data-mce-caret")&&(Du(t),m(g()),n.scrollIntoView(t))},v=function(){t.on("mouseup",(function(e){var n=g();n.collapsed&&TD(t,e.clientX,e.clientY)&&OR(t,n,!1).each(m)})),t.on("click",(function(e){var o=iF(t,e.target);o&&(oF(o)&&(e.preventDefault(),t.focus()),rF(o)&&r.isChildOf(o,n.getNode())&&O())})),t.on("blur NewBlock",O),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var a=function(t){var e=t.firstChild;if(S(e))return!1;var n=Bl.before(e);if(ro(n.getNode())&&1===t.childNodes.length)return!l(n);var r=Lg(t),o=r.next(n);return o&&!l(o)},c=function(t,e){var n=r.getParent(t,o),i=r.getParent(e,o);return n===i},h=function(e,n){var i=r.getParent(e,o),u=r.getParent(n,o);return!S(i)&&(!(e===u||!r.isChildOf(i,u)||!1!==oF(iF(t,i)))||!r.isChildOf(u,i)&&!c(i,u)&&a(i))};t.on("tap",(function(e){var n=e.target,r=iF(t,n);oF(r)?(e.preventDefault(),kR(t,r).each(k)):f(n)&&kR(t,n).each(k)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==TD(t,e.clientX,e.clientY)){var u=iF(t,o);if(u)oF(u)?(e.preventDefault(),kR(t,u).each(k)):(O(),rF(u)&&e.shiftKey||Hh(e.clientX,e.clientY,n.getRng())||(E(),n.placeCaretAt(e.clientX,e.clientY)));else if(f(o))kR(t,o).each(k);else if(!1===Qm(o)){O(),E();var a=kB(i,e.clientX,e.clientY);if(a&&!h(o,a.node)){e.preventDefault();var c=p(1,a.node,a.before,!1);m(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){ev.modifierPressed(t)||oF(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);n=n.cloneRange(),n.selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=w(t.range);var e=k(t.range,t.forward);e&&(t.range=e)}));var v=function(t){return"mcepastebin"===t.id};t.on("AfterSetSelectionRange",(function(t){var e=t.range,n=e.startContainer.parentNode;y(e)||v(n)||E(),s(n)||O()})),t.on("copy",(function(t){var e=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!tn.ie){var n=d();n&&(t.preventDefault(),e.clearData(),e.setData("text/html",n.outerHTML),e.setData("text/plain",n.outerText||n.innerText))}})),tF(t),eF(t),nF(t)},b=function(t){return yu(t)||Tu(t)||Eu(t)},y=function(t){return b(t.startContainer)||b(t.endContainer)},w=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return Nt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),Nt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o},x=function(e,o,i){var u=t.$,c=Ei(wn.fromDom(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a),c.appendTo(t.getBody()));var s=r.createRng();o===i&&tn.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(su).append(o).append(su),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var f=n.getSel();return f.removeAllRanges(),f.addRange(s),s},C=function(n){var o=n.cloneNode(!0),i=t.fire("ObjectSelected",{target:n,targetClone:o});if(i.isDefaultPrevented())return null;var u=x(n,i.targetClone,o),a=wn.fromDom(n);return Z(_f(wn.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Bn(a,t)||Co(t,c)})),r.getAttrib(n,c)||n.setAttribute(c,"1"),e=n,E(),u},k=function(t,e){if(!t)return null;if(t.collapsed){if(!y(t)){var n=e?1:-1,o=wg(n,i,t),u=o.getNode(!e);if(Qm(u))return p(n,u,!!e&&!o.isAtEnd(),!1);var a=o.getNode(e);if(Qm(a))return p(n,a,!e&&!o.isAtEnd(),!1)}return null}var c=t.startContainer,s=t.startOffset,l=t.endOffset;if(3===c.nodeType&&0===s&&oF(c.parentNode)&&(c=c.parentNode,s=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(l===s+1&&c===t.endContainer){var d=c.childNodes[s];if(f(d))return C(d)}return null},O=function(){e&&e.removeAttribute(c),Ei(wn.fromDom(t.getBody()),"#"+a).each(Tr),e=null},T=function(){u.destroy(),e=null},E=function(){u.hide()};return tn.ceFalse&&!zT(t)&&v(),{showCaret:p,showBlockCaretContainer:h,hideFakeCaret:E,destroy:T}},aF=function(t){var e=gn.each,n=ev.BACKSPACE,r=ev.DELETE,o=t.dom,i=t.selection,u=t.parser,a=tn.gecko,c=tn.ie,s=tn.webkit,f="data:text/mce-internal,",l=c?"Text":"URL",d=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(r){}},m=function(t){return t.isDefaultPrevented()},g=function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&i.select(e.target),n=t.selection.getContent(),n.length>0&&(r=f+escape(t.id)+","+escape(n),e.dataTransfer.setData(l,r)))},p=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(l),e&&e.indexOf(f)>=0)?(e=e.substr(f.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null},h=function(e,n){t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:e,internal:n}):t.execCommand("mceInsertContent",!1,e)},v=function(){var e=function(t){var e=o.create("body"),n=t.cloneContents();return e.appendChild(n),i.serializer.serialize(e,{format:"html"})},u=function(n){var r=e(n),i=o.createRng();i.selectNode(t.getBody());var u=e(i);return r===u};t.on("keydown",(function(e){var i,a,c=e.keyCode;if(!m(e)&&(c===r||c===n)){if(i=t.selection.isCollapsed(),a=t.getBody(),i&&!o.isEmpty(a))return;if(!i&&!u(t.selection.getRng()))return;e.preventDefault(),t.setContent(""),a.firstChild&&o.isBlock(a.firstChild)?t.selection.setCursorLocation(a.firstChild,0):t.selection.setCursorLocation(a,0),t.nodeChanged()}}))},b=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.inline||o.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=i.getRng(),t.getBody().focus(),"mousedown"===e.type){if(yu(n.startContainer))return;i.placeCaretAt(e.clientX,e.clientY)}else i.setRng(n)}))},w=function(){t.on("keydown",(function(e){if(!m(e)&&e.keyCode===n){if(!t.getBody().getElementsByTagName("hr").length)return;if(i.isCollapsed()&&0===i.getRng().startOffset){var r=i.getNode(),u=r.previousSibling;if("HR"===r.nodeName)return o.remove(r),void e.preventDefault();u&&u.nodeName&&"hr"===u.nodeName.toLowerCase()&&(o.remove(u),e.preventDefault())}}}))},x=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!m(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Ii.setEditorTimeout(t,(function(){n.focus()}))}}))},C=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==o.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&o.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),i.select(n))}))},S=function(){var n=function(){var n=o.getAttribs(i.getStart().cloneNode(!1));return function(){var r=i.getStart();r!==t.getBody()&&(o.setAttrib(r,"style",null),e(n,(function(t){r.setAttributeNode(t.cloneNode(!0))})))}},r=function(){return!i.isCollapsed()&&o.getParent(i.getStart(),o.isBlock)!==o.getParent(i.getEnd(),o.isBlock)};t.on("keypress",(function(e){var o;if(!m(e)&&(8===e.keyCode||46===e.keyCode)&&r())return o=n(),t.getDoc().execCommand("delete",!1,null),o(),e.preventDefault(),!1})),o.bind(t.getDoc(),"cut",(function(e){var o;!m(e)&&r()&&(o=n(),Ii.setEditorTimeout(t,(function(){o()})))}))},k=function(){t.on("keydown",(function(t){if(!m(t)&&t.keyCode===n&&i.isCollapsed()&&0===i.getRng().startOffset){var e=i.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},O=function(){t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===ev.BACKSPACE){n=i.getRng();var u=n.startContainer,a=n.startOffset,c=o.getRoot();if(r=u,n.collapsed&&0===a){while(r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),n=o.createRng(),n.setStart(u,0),n.setEnd(u,0),i.setRng(n))}}}))},T=function(){var e=function(){d("StyleWithCSS",!1),d("enableInlineTableEditing",!1),Zd(t)||d("enableObjectResizing",!1)};xm(t)||t.on("BeforeExecCommand mousedown",e)},_=function(){var n=function(){e(o.select("a"),(function(t){var e=t.parentNode,n=o.getRoot();if(e.lastChild===t){while(e&&!o.isBlock(e)){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}o.add(e,"br",{"data-mce-bogus":1})}}))};t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||n()}))},D=function(){Od(t)&&t.on("init",(function(){d("DefaultParagraphSeparator",Od(t))}))},A=function(){t.on("keyup focusin mouseup",(function(t){ev.modifierPressed(t)||i.normalize()}),!0)},R=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},N=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},B=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(tn.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},M=function(){tn.mac&&t.on("keydown",(function(e){if(ev.metaKeyPressed(e)&&!e.shiftKey&&(37===e.keyCode||39===e.keyCode)){e.preventDefault();var n=t.selection.getSel();n.modify("move",37===e.keyCode?"backward":"forward","lineboundary")}}))},P=function(){d("AutoUrlDetect",!1)},I=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},L=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},F=function(){u.addNodeFilter("br",(function(t){var e=t.length;while(e--)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()}))},z=function(){t.on("dragstart",(function(t){g(t)})),t.on("drop",(function(e){if(!m(e)){var n=p(e);if(n&&n.id!==t.id){e.preventDefault();var r=cv(e.x,e.y,t.getDoc());i.setRng(r),h(n.html,!0)}}}))},H=E,V=function(){if(!a||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount},U=function(){s&&(y(),C(),L(),b(),tn.iOS&&(N(),B(),I())),a&&(x(),T(),R(),M())},j=function(){O(),v(),tn.windowsPhone||A(),s&&(y(),C(),D(),L(),k(),F(),tn.iOS?(N(),B(),I()):b()),tn.ie>=11&&(B(),k()),tn.ie&&(b(),P(),z()),a&&(w(),x(),S(),T(),_(),R(),M(),k())};return zT(t)?U():j(),{refreshContentEditable:H,isHidden:V}},cF=Vs.DOM,sF=function(t,e){var n=wn.fromDom(t.getBody()),r=mr(dr(n)),o=wn.fromTag("style");vo(o,"type","text/css"),xr(o,wn.fromText(e)),xr(r,o),t.on("remove",(function(){Tr(o)}))},fF=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},lF=function(t){return _t(t,(function(t){return!1===C(t)}))},dF=function(t){var e=t.settings;return lF({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},mF=function(t){var e=t.settings,n=t.editorUpload.blobCache;return lF({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:fF(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},gF=function(t){var e=t.settings;return Wt(Wt(Wt({},mF(t)),dF(t)),lF({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))},pF=function(t){var e=c_(mF(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){var r,o,i=e.length,u=t.dom,a="data-mce-"+n;while(i--)if(r=e[i],o=r.attr(n),o&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?(o=u.serializeStyle(u.parseStyle(o),r.name),o.length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){var e=t.length;while(e--){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){var n=e.length;while(n--){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){var n=e.length,r=t.schema.getNonEmptyElements();while(n--){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Dy("br",1)).shortEnded=!0)}})),e},hF=function(t){t.settings.auto_focus&&Ii.setEditorTimeout(t,(function(){var e;e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus),e.destroyed||e.focus()}),100)},vF=function(t){var e=t.dom.getRoot();t.inline||Oh(t)&&t.selection.getStart(!0)!==e||Jg(e).each((function(e){var n=e.getNode(),r=Yr(n)?Jg(n).getOr(e):e;tn.browser.isIE()?Fb(t,r.toRange()):t.selection.setRng(r.toRange())}))},bF=function(t){t.bindPendingEventDelegates(),t.initialized=!0,Yh(t),t.focus(!0),vF(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),hF(t)},yF=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},wF=function(t,e,n){var r=[new Di((function(n,r){return yF(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new Di((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])},xF=function(t){var e=yF(t),n=Yd(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var u="";gn.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}var a=Di.all(wF(t,r,n)).then(i).catch(i);return t.settings.content_style&&sF(t,t.settings.content_style),a},CF=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();Kh(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,cF.setAttrib(r,"spellcheck","false")),t.quirks=aF(t),Xh(t);var o=Jd(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){gn.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},SF=function(t){zT(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})},kF=function(t){!0!==t.removed&&(SF(t),bF(t))},OF=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(cF.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===cF.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=uA(t),t.schema=Va(dF(t)),t.dom=Vs(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:jd(t),referrerPolicy:Wd(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=pF(t),t.serializer=x_(gF(t),t),t.selection=AE(t.dom,t.getWin(),t.serializer,t),t.annotator=Lh(t),t.formatter=hA(t),t.undoManager=wA(t),t._nodeChangeDispatcher=new wL(t),t._selectionOverrides=uF(t),OM(t),SL(t),zT(t)||TL(t);var u=yL(t);wM(t,u),RM(t),_A(t);var a=VT(t);CF(t),a.fold((function(){xF(t).then((function(){return kF(t)}))}),(function(e){t.setProgressState(!0),xF(t).then((function(){e().then((function(e){t.setProgressState(!1),kF(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),kF(t)}))}))}))},TF=Vs.DOM,EF=function(t,e){if(document.domain!==window.location.hostname&&tn.browser.isIE()){var n=ZD("mce");t[n]=function(){OF(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return TF.setAttrib(e,"src",r),!0}return!1},_F=function(t,e,n,r){var o=wn.fromTag("iframe");return bo(o,r),bo(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),Sf(o,"tox-edit-area__iframe"),o},DF=function(t){var e=yd(t)+"<html><head>";wd(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=xd(t),r=Cd(t),o=t.translate(Dm(t));return Sd(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Sd(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'" aria-label="'+o+'"><br></body></html>',e},AF=function(t,e){var n=t.translate("Rich Text Area"),r=_F(t.id,n,e.height,bd(t)).dom;r.onload=function(){r.onload=null,t.fire("load")};var o=EF(t,r);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=r,t.iframeHTML=DF(t),TF.add(e.iframeContainer,r),o},RF=function(t,e){var n=AF(t,e);e.editorContainer&&(TF.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=TF.isHidden(e.editorContainer)),t.getElement().style.display="none",TF.setAttrib(t.id,"aria-hidden","true"),n||OF(t)},NF=Vs.DOM,BF=function(t,e,n){var r=RD.get(n),o=RD.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=gn.trim(n),r&&-1===gn.inArray(e,n)){if(gn.each(RD.dependencies(n),(function(n){BF(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(bV){jD(t,n,bV)}}},MF=function(t){return t.replace(/^\-/,"")},PF=function(t){var e=[];gn.each(Sm(t).split(/[ ,]/),(function(n){BF(t,e,MF(n))}))},IF=function(t){var e=gn.trim(Ld(t)),n=t.ui.registry.getAll().icons,r=Wt(Wt({},hD.get("default").icons),hD.get(e).icons);Ct(r,(function(e,r){Nt(n,r)||t.ui.registry.addIcon(r,e)}))},LF=function(t){var e=om(t);if(v(e)){t.settings.theme=MF(e);var n=ND.get(e);t.theme=new n(t,ND.urls[e]),t.theme.init&&t.theme.init(t,ND.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}},FF=function(t){return t.theme.renderUI()},zF=function(t){var e=t.getElement(),n=om(t),r=n(t,e);return r.editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight?r.iframeHeight:e.offsetHeight,r},HF=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},VF=function(t){var e=NF.create("div");return NF.insertAfter(e,t),HF(e)},UF=function(t){var e=t.getElement();return t.inline?HF(null):VF(e)},jF=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,v(om(t))?FF(t):O(om(t))?zF(t):UF(t)},WF=function(t,e){var n={show:W.from(e.show).getOr(E),hide:W.from(e.hide).getOr(E),disable:W.from(e.disable).getOr(E),isDisabled:W.from(e.isDisabled).getOr(F),enable:function(){t.mode.isReadOnly()||W.from(e.enable).map(L)}};t.ui=Wt(Wt({},t.ui),n)},qF=function(t){t.fire("ScriptsLoaded"),IF(t),LF(t),PF(t);var e=jF(t);WF(t,W.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,XD(t),t.inline?OF(t):RF(t,n)},$F=Vs.DOM,GF=function(t){return"-"===t.charAt(0)},KF=function(t,e){var n=qd(e),r=$d(e);if(!1===ff.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,E,void 0,(function(){UD(e,o,n)}))}},XF=function(t,e,n,r){var o=om(e);if(v(o)){if(!GF(o)&&!Nt(ND.urls,o)){var i=lm(e);i?ND.load(o,e.documentBaseURI.toAbsolute(i)):ND.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){ND.waitFor(o,r)}))}else r()},YF=function(t){return W.from(Fd(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:W.none()}}))},JF=function(t,e,n){return W.from(e).filter((function(t){return t.length>0&&!hD.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:W.some(e)}}))},QF=function(t,e,n){var r=JF(e,"default",n),o=YF(e).orThunk((function(){return JF(e,Ld(e),"")}));Z(fo([r,o]),(function(n){t.add(n.url,E,void 0,(function(){VD(e,n.url,n.name.getOrUndefined())}))}))},ZF=function(t,e){gn.each(km(t),(function(e,n){RD.load(n,e,E,void 0,(function(){HD(t,e,n)})),t.settings.plugins+=" "+n})),gn.each(Sm(t).split(/[ ,]/),(function(n){if(n=gn.trim(n),n&&!RD.urls[n])if(GF(n)){n=n.substr(1,n.length);var r=RD.dependencies(n);gn.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=RD.createUrl(r,n);RD.load(o.resource,o,E,void 0,(function(){HD(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};RD.load(n,o,E,void 0,(function(){HD(t,o.prefix+o.resource+o.suffix,n)}))}}))},tz=function(t,e){var n=Xs.ScriptLoader;XF(n,t,e,(function(){KF(n,t),QF(n,t,e),ZF(t,e),n.loadQueue((function(){t.removed||qF(t)}),t,(function(){t.removed||qF(t)}))}))},ez=function(t,e){return zi.forElement(t,{contentCssCors:Cm(e),referrerPolicy:Wd(e)})},nz=function(t){var e=t.id;ff.setCode(qd(t));var n=function(){$F.unbind(window,"ready",n),t.render()};if(rc.Event.domLoaded){if(t.getElement()&&tn.contentEditable){var r=wn.fromDom(t.getElement()),o=So(r);t.on("remove",(function(){tt(r.dom.attributes,(function(t){return Co(r,t.name)})),bo(r,o)})),t.ui.styleSheetLoader=ez(r,t),dm(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||$F.getParent(e,"form");i&&(t.formElement=i,mm(t)&&!Qr(t.getElement())&&($F.insertAfter($F.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},$F.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!gm(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=MD(t),t.notificationManager=AD(t),pm(t)&&t.on("GetContent",(function(t){t.save&&(t.content=$F.encode(t.content))})),hm(t)&&t.on("submit",(function(){t.initialized&&t.save()})),vm(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),tz(t,t.suffix)}}else $F.bind(window,"ready",n)},rz=function(t,e){return gE(t,e)},oz={"font-size":"size","font-family":"face"},iz=function(t,e,n){var r=function(e){return _o(e,t).orThunk((function(){return"font"===Ln(e)?Rt(oz,t).bind((function(t){return wo(e,t)})):W.none()}))},o=function(t){return Bn(wn.fromDom(e),t)};return IS(wn.fromDom(n),(function(t){return r(t)}),o)},uz=function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},az=function(t,e){return W.from(Vs.DOM.getStyle(e,t,!0))},cz=function(t){return function(e,n){return W.from(n).map(wn.fromDom).filter(Vn).bind((function(n){return iz(t,e,n.dom).or(az(t,n.dom))})).getOr("")}},sz=cz("font-size"),fz=_(uz,cz("font-family")),lz=function(t){return Jg(t.getBody()).map((function(t){var e=t.container();return Zr(e)?e.parentNode:e}))},dz=function(t){return W.from(t.selection.getRng()).bind((function(e){var n=t.getBody(),r=e.startContainer===n&&0===e.startOffset;return r?W.none():W.from(t.selection.getStart(!0))}))},mz=function(t,e){return dz(t).orThunk(B(lz,t)).map(wn.fromDom).filter(Vn).bind(e)},gz=function(t,e){return mz(t,D(W.some,e))},pz=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=Rd(t),o=Nd(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},hz=function(t){var e=t.split(/\s*,\s*/);return Q(e,(function(t){return-1===t.indexOf(" ")||se(t,'"')||se(t,"'")?t:"'"+t+"'"})).join(",")},vz=function(t,e){var n=pz(t,e);t.formatter.toggle("fontname",{value:hz(n)}),t.nodeChanged()},bz=function(t){return gz(t,(function(e){return fz(t.getBody(),e.dom)})).getOr("")},yz=function(t,e){t.formatter.toggle("fontsize",{value:pz(t,e)}),t.nodeChanged()},wz=function(t){return gz(t,(function(e){return sz(t.getBody(),e.dom)})).getOr("")},xz=function(t){return gz(t,(function(e){var n=wn.fromDom(t.getBody()),r=IS(e,(function(t){return _o(t,"line-height")}),B(Bn,n)),o=function(){var t=parseFloat(To(e,"line-height")),n=parseFloat(To(e,"font-size"));return String(t/n)};return r.getOrThunk(o)})).getOr("")},Cz=function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()},Sz=function(t){if("string"!==typeof t){var e=gn.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}},kz=function(t,e){var n=Sz(e);dE(t,n.content,n.details)},Oz=gn.each,Tz=gn.map,Ez=gn.inArray,_z=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?Hb(u.editor):u.editor.focus()),r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n}),r.isDefaultPrevented())return!1;var a=t.toLowerCase();if(o=u.commands.exec[a])return o(a,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(Oz(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(c){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(n){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(n){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;Oz(t,(function(t,r){Oz(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(e){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":E,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){hy(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(u){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");tn.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),Oz("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){vz(t,r)},FontSize:function(e,n,r){yz(t,r)},LineHeight:function(e,n,r){Cz(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){kz(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){XI(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){pM(t,e)},mceRepaint:E,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"===typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),io);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return NI(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=Tz(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==Ez(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return lM(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return bz(t)}),this),e.addQueryValueHandler("FontSize",(function(){return wz(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return xz(t)}),this)},t}(),Dz="data-mce-contenteditable",Az=function(t,e,n){Tf(t,e)&&!1===n?Of(t,e):n&&Sf(t,e)},Rz=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(r){}},Nz=function(t,e){t.dom.contentEditable=e?"true":"false"},Bz=function(t){Z(_f(t,'*[contenteditable="true"]'),(function(t){vo(t,Dz,"true"),Nz(t,!1)}))},Mz=function(t){Z(_f(t,"*["+Dz+'="true"]'),(function(t){Co(t,Dz),Nz(t,!0)}))},Pz=function(t){W.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))},Iz=function(t){t.selection.setRng(t.selection.getRng())},Lz=function(t,e){var n=wn.fromDom(t.getBody());Az(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),Pz(t),t.readonly=!0,Nz(n,!1),Bz(n)):(t.readonly=!1,Nz(n,!0),Mz(n),Rz(t,"StyleWithCSS",!1),Rz(t,"enableInlineTableEditing",!1),Rz(t,"enableObjectResizing",!1),my(t)&&t.focus(),Iz(t),t.nodeChanged())},Fz=function(t){return t.readonly},zz=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){Fz(t)&&Z(e,(function(t){t.attr(Dz,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(Dz,(function(e){Fz(t)&&Z(e,(function(t){t.attr("contenteditable",t.attr(Dz))}))})),t.serializer.addTempAttr(Dz)},Hz=function(t){t.serializer?zz(t):t.on("PreInit",(function(){zz(t)}))},Vz=function(t){return"click"===t.type},Uz=function(t,e){var n=function(e){return Bn(e,wn.fromDom(t.getBody()))};return _i(e,"a",n).bind((function(t){return wo(t,"href")}))},jz=function(t,e){if(Vz(e)&&!ev.metaKeyPressed(e)){var n=wn.fromDom(e.target);Uz(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+ae(n,"#")+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}))}},Wz=function(t){t.on("ShowCaret",(function(e){Fz(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){Fz(t)&&e.preventDefault()}))},qz=gn.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),$z=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||F}return t.isNative=function(t){return!!qz[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Xa(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(!a.removed){if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=F),e){var o={func:e,removed:!1};r&&gn.extend(o,r);var i=t.toLowerCase().split(" "),u=i.length;while(u--){var a=i[u],c=this.bindings[a];c||(c=[],this.toggleEvent(a,!0)),c=n?$t([o],c,!0):$t($t([],c,!0),[o],!1),this.bindings[a]=c}}return this},t.prototype.off=function(t,e){var n=this;if(t){var r=t.toLowerCase().split(" "),o=r.length;while(o--){var i=r[o],u=this.bindings[i];if(!i)return Ct(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e){var a=et(u,(function(t){return t.func===e}));u=a.fail,this.bindings[i]=u,Z(a.pass,(function(t){t.removed=!0}))}else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}}else Ct(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),Gz=function(t){return t._eventDispatcher||(t._eventDispatcher=new $z({scope:t,toggleEvent:function(e,n){$z.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},Kz={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=Gz(r).fire(t,e);if(!1!==n&&r.parent){var i=r.parent();while(i&&!o.isPropagationStopped())i.fire(t,o,!1),i=i.parent()}return o},on:function(t,e,n){return Gz(this).on(t,e,n)},off:function(t,e){return Gz(this).off(t,e)},once:function(t,e){return Gz(this).once(t,e)},hasEventListeners:function(t){return Gz(this).has(t)}},Xz=Vs.DOM,Yz=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=nm(t);return n?(t.eventRoot||(t.eventRoot=Xz.select(n)[0]),t.eventRoot):t.getBody()},Jz=function(t){return!t.hidden&&!Fz(t)},Qz=function(t,e,n){Jz(t)?t.fire(e,n):Fz(t)&&jz(t,n)},Zz=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=Yz(t,e);if(nm(t)){if(eB||(eB={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||eB&&(Ct(eB,(function(e,n){t.dom.unbind(Yz(t,n))})),eB=null)}))),eB[e])return;n=function(n){var r=n.target,o=t.editorManager.get(),i=o.length;while(i--){var u=o[i].getBody();(u===r||Xz.isChildOf(r,u))&&Qz(o[i],e,n)}},eB[e]=n,Xz.bind(r,e,n)}else n=function(n){Qz(t,e,n)},Xz.bind(r,e,n),t.delegates[e]=n}},tH=Wt(Wt({},Kz),{bindPendingEventDelegates:function(){var t=this;gn.each(t._pendingNativeEvents,(function(e){Zz(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(n.removed||(e?n.initialized?Zz(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(Yz(n,t),t,n.delegates[t]),delete n.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(Ct(t.delegates,(function(e,n){t.dom.unbind(Yz(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),eH=["design","readonly"],nH=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(bV){return}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&Lz(t,i.editorReadOnly),e.set(r),qh(t,r)},rH=function(t,e,n,r){if(r!==n.get()){if(!Nt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?nH(t,n,e,r):t.on("init",(function(){return nH(t,n,e,r)}))}},oH=function(t,e,n){var r;if(Y(eH,e))throw new Error("Cannot override default mode "+e);return Wt(Wt({},t),(r={},r[e]=Wt(Wt({},n),{deactivate:function(){try{n.deactivate()}catch(bV){}}}),r))},iH=function(t){var e=Ys("design"),n=Ys({design:{activate:E,deactivate:E,editorReadOnly:!1},readonly:{activate:E,deactivate:E,editorReadOnly:!0}});return Hz(t),Wz(t),{isReadOnly:function(){return Fz(t)},set:function(r){return rH(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(oH(n.get(),t,e))}}},uH=gn.each,aH=gn.explode,cH={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},sH=gn.makeMap("alt,ctrl,shift,meta,access"),fH=function(t){var e,n={};uH(aH(t.toLowerCase(),"+"),(function(t){t in sH?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=cH[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in sH)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,tn.mac?n.ctrl=!0:n.shift=!0),n.meta&&(tn.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},lH=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(uH(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return uH(aH(gn.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"===typeof n?function(){e.editor.execCommand(n,!1,null)}:gn.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=gn.map(aH(t,">"),fH);return o[o.length-1]=gn.extend(o[o.length-1],{func:n,scope:r||this.editor}),gn.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),dH=function(){var t={},e={},n={},r={},o={},i={},u={},a=function(t,e){return function(n,r){return t[n.toLowerCase()]=Wt(Wt({},r),{type:e})}},c=function(t,e){return r[t.toLowerCase()]=e};return{addButton:a(t,"button"),addGroupToolbarButton:a(t,"grouptoolbarbutton"),addToggleButton:a(t,"togglebutton"),addMenuButton:a(t,"menubutton"),addSplitButton:a(t,"splitbutton"),addMenuItem:a(e,"menuitem"),addNestedMenuItem:a(e,"nestedmenuitem"),addToggleMenuItem:a(e,"togglemenuitem"),addAutocompleter:a(n,"autocompleter"),addContextMenu:a(o,"contextmenu"),addContextToolbar:a(i,"contexttoolbar"),addContextForm:a(i,"contextform"),addSidebar:a(u,"sidebar"),addIcon:c,getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:u}}}},mH=function(){var t=dH();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},gH=Vs.DOM,pH=gn.extend,hH=gn.each,vH=gn.resolve,bH=tn.ie,yH=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,pH(this,tH),this.settings=fD(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(Xs.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Vs.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),lf.languageLoad=this.settings.language_load,lf.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new Hy(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new lH(this),this.editorCommands=new _z(this),this.settings.cache_suffix&&(tn.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:mH(),styleSheetLoader:void 0,show:E,hide:E,enable:E,disable:E,isDisabled:F};var o=this,i=iH(o);this.mode=i,this.setMode=i.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Bs.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){nz(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return dy(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"===typeof i&&(r=i.replace(/\.\w+$/,""),r=r?vH(r):0,i=vH(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return ff.translate(t)},t.prototype.getParam=function(t,e,n){return gD(this,t,e,n)},t.prototype.hasPlugin=function(t,e){var n=Y(Sm(this).split(/[ ,]/),t);return!!n&&(!e||void 0!==RD.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(gH.show(t.getContainer()),gH.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(bH&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(gH.hide(t.getContainer()),gH.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){t=t||{},t.load=!0;var o=Qr(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return t=t||{},t.save=!0,t.element=o,e=t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Qr(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=gH.getParent(r.id,"form"))&&hH(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return k_(this,t,e)},t.prototype.getContent=function(t){return S_(this,t)},t.prototype.insertContent=function(t,e){e&&(t=pH({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?k_(this,this.startContent,{format:"raw"}):k_(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=gH.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=gH.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):(t=r.documentBaseURI.toAbsolute(t,o.remove_script_host),t)},t.prototype.addVisual=function(t){rz(this,t)},t.prototype.remove=function(){A_(this)},t.prototype.destroy=function(t){R_(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),wH=Vs.DOM,xH=gn.explode,CH=gn.each,SH=gn.extend,kH=0,OH=!1,TH=[],EH=[],_H=function(t){return"length"!==t},DH=function(t){var e=t.type;CH(MH.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t);break}}))},AH=function(t){t!==OH&&(t?Bs(window).on("resize scroll",DH):Bs(window).off("resize scroll",DH),OH=t)},RH=function(t){var e=EH;delete TH[t.id];for(var n=0;n<TH.length;n++)if(TH[n]===t){TH.splice(n,1);break}return EH=nt(EH,(function(e){return t!==e})),MH.activeEditor===t&&(MH.activeEditor=EH.length>0?EH[0]:null),MH.focusedEditor===t&&(MH.focusedEditor=null),e.length!==EH.length},NH=function(t){return t&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(RH(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null),t},BH="CSS1Compat"!==document.compatMode,MH=Wt(Wt({},Kz),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Bs,majorVersion:"5",minorVersion:"10.6",releaseDate:"2022-10-19",editors:TH,i18n:ff,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=Hy.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o=window.tinymce||window.tinyMCEPreInit;if(o)t=o.base||o.baseURL,r=o.suffix;else{for(var i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var a=i[u].src||"";if(""!==a){var c=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!==c.indexOf(".min")&&(r=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}}if(!t&&document.currentScript){a=document.currentScript.src;-1!==a.indexOf(".min")&&(r=".min"),t=a.substring(0,a.lastIndexOf("/"))}}n.baseURL=new Hy(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new Hy(n.baseURL),n.suffix=r,ny(n)},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&Ct(r,(function(t,e){lf.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=gn.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(t,e){return t.inline&&e.tagName.toLowerCase()in r},i=function(t){var e=t.id;return e||(e=Rt(t,"name").filter((function(t){return!wH.get(t)})).getOrThunk(wH.uniqueId),t.setAttribute("id",e)),e},u=function(e){var r=t[e];if(r)return r.apply(n,[])},a=function(t,e){return e.constructor===RegExp?e.test(t.className):wH.hasClass(t,e)},c=function(t){var e=[];if(tn.browser.isIE()&&tn.browser.version.major<11)return WD("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(BH)return WD("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return CH(t.types,(function(t){e=e.concat(wH.select(t.selector))})),e;if(t.selector)return wH.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&CH(xH(n),(function(t){var n=wH.get(t);n?e.push(n):CH(document.forms,(function(n){CH(n.elements,(function(n){n.name===t&&(t="mce_editor_"+kH++,wH.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":CH(wH.select("textarea"),(function(n){t.editor_deselector&&a(n,t.editor_deselector)||t.editor_selector&&!a(n,t.editor_selector)||e.push(n)}));break}return e},s=function(t){e=t},f=function(){var e,r=0,a=[],l=function(t,o,i){var u=new yH(t,o,n);a.push(u),u.on("init",(function(){++r===e.length&&s(a)})),u.targetElm=u.targetElm||i,u.render()};wH.unbind(window,"ready",f),u("onpageload"),e=Bs.unique(c(t)),t.types?CH(t.types,(function(n){gn.each(e,(function(e){return!wH.is(e,n.selector)||(l(i(e),SH({},t,n),e),!1)}))})):(gn.each(e,(function(t){NH(n.get(t.id))})),e=gn.grep(e,(function(t){return!n.get(t.id)})),0===e.length?s([]):CH(e,(function(e){o(t,e)?WD("Could not initialize inline editor on invalid inline target element",e):l(i(e),t,e)})))};return n.settings=t,wH.bind(window,"ready",f),new Di((function(t){e?t(e):s=function(e){t(e)}}))},get:function(t){return 0===arguments.length?EH.slice(0):v(t)?ut(EH,(function(e){return e.id===t})).getOr(null):T(t)&&EH[t]?EH[t]:null},add:function(t){var e=this,n=TH[t.id];return n===t||(null===e.get(t.id)&&(_H(t.id)&&(TH[t.id]=t),TH.push(t),EH.push(t)),AH(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),nB||(nB=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",nB))),t},createEditor:function(t,e){return this.add(new yH(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!v(t))return n=t,w(r.get(n.id))?null:(RH(n)&&r.fire("RemoveEditor",{editor:n}),0===EH.length&&window.removeEventListener("beforeunload",nB),n.remove(),AH(EH.length>0),n);CH(wH.select(t),(function(t){n=r.get(t.id),n&&r.remove(n)}))}else for(e=EH.length-1;e>=0;e--)r.remove(EH[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new yH(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){CH(EH,(function(t){t.save()}))},addI18n:function(t,e){ff.add(t,e)},translate:function(t){return ff.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new Hy(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Hy(this.baseURL)}});MH.setup();var PH,IH,LH=Math.min,FH=Math.max,zH=Math.round,HH=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=zH(c/2)),"c"===s[1]&&(r+=zH(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=zH(u/2)),"c"===s[4]&&(r-=zH(i/2)),qH(r,o,i,u)},VH=function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if(o=HH(t,e,r[i]),o.x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},UH=function(t,e,n){return qH(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},jH=function(t,e){var n=FH(t.x,e.x),r=FH(t.y,e.y),o=LH(t.x+t.w,e.x+e.w),i=LH(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:qH(n,r,o-n,i-r)},WH=function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=FH(0,e.x-r),f=FH(0,e.y-o),l=FH(0,i-a),d=FH(0,u-c);return r+=s,o+=f,n&&(i+=s,u+=f,r-=l,o-=d),i-=l,u-=d,qH(r,o,i-r,u-o)},qH=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},$H=function(t){return qH(t.left,t.top,t.width,t.height)},GH={inflate:UH,relativePosition:HH,findBestRelativePosition:VH,intersect:jH,clamp:WH,create:qH,fromClientRect:$H},KH=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e),c=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))};return{start:c,resolve:u,reject:a}},XH=function(){var t={},e={},n=function(n,r){var o='Script at URL "'+r+'" failed to load',i='Script at URL "'+r+"\" did not call `tinymce.Resource.add('"+n+"', data)` within 1 second";if(void 0!==t[n])return t[n];var u=new Di((function(t,u){var a=KH(t,u);e[n]=a.resolve,Xs.ScriptLoader.loadScript(r,(function(){return a.start(i)}),(function(){return a.reject(o)}))}));return t[n]=u,u},r=function(n,r){void 0!==e[n]&&(e[n](r),delete e[n]),t[n]=Di.resolve(r)};return{load:n,add:r}},YH=XH(),JH=gn.each,QH=gn.extend,ZH=function(){};ZH.extend=PH=function(t){var e=this,n=e.prototype,r=function(){var t,e,n,r=this;if(!IH&&(r.init&&r.init.apply(r,arguments),e=r.Mixins,e)){t=e.length;while(t--)n=e[t],n.init&&n.init.apply(r,arguments)}},o=function(){return this},i=function(t,e){return function(){var r=this,o=r._super;r._super=n[t];var i=e.apply(r,arguments);return r._super=o,i}};IH=!0;var u=new e;return IH=!1,t.Mixins&&(JH(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),n.Mixins&&(t.Mixins=n.Mixins.concat(t.Mixins))),t.Methods&&JH(t.Methods.split(","),(function(e){t[e]=o})),t.Properties&&JH(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&JH(t.Statics,(function(t,e){r[e]=t})),t.Defaults&&n.Defaults&&(t.Defaults=QH({},n.Defaults,t.Defaults)),Ct(t,(function(t,e){"function"===typeof t&&n[e]?u[e]=i(e,t):u[e]=t})),r.prototype=u,r.constructor=r,r.extend=PH,r};var tV,eV=Math.min,nV=Math.max,rV=Math.round,oV=function(t){var e={},n=0,r=0,o=0,i=function(t,e,n){var r,o,i;r=0,o=0,i=0,t/=255,e/=255,n/=255;var u=eV(t,eV(e,n)),a=nV(t,nV(e,n));if(u===a)return i=u,{h:0,s:0,v:100*i};var c=t===u?e-n:n===u?t-e:n-t;return r=t===u?3:n===u?1:5,r=60*(r-c/(a-u)),o=(a-u)/a,i=a,{h:rV(r),s:rV(100*o),v:rV(100*i)}},u=function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=nV(0,eV(e,1)),i=nV(0,eV(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=rV(255*(n+s)),r=rV(255*(r+s)),o=rV(255*(o+s))}else n=r=o=rV(255*i)},a=function(){var t=function(t){return t=parseInt(t,10).toString(16),t.length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},c=function(){return{r:n,g:r,b:o}},s=function(){return i(n,r,o)},f=function(t){var i;return"object"===typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&u(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&f(t),e.toRgb=c,e.toHsv=s,e.toHex=a,e.parse=f,e},iV=function(t){var e=JSON.stringify(t);return v(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},uV={serialize:iV,parse:function(t){try{return JSON.parse(t)}catch(e){}}},aV={callbacks:{},count:0,send:function(t){var e=this,n=Vs.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},cV=Wt(Wt({},Kz),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Ii.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",cV.fire("beforeInitialize",{settings:t}),e=new XMLHttpRequest,e.overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&gn.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e=cV.fire("beforeSend",{xhr:e,settings:t}).xhr,e.send(t.data),!t.async)return r();Ii.setTimeout(r,10)}}),sV=gn.extend,fV=function(){function t(t){this.settings=sV({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=sV(this.settings,t);r.success=function(t,o){t=uV.parse(t),"undefined"===typeof t&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=uV.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",cV.send(r)},t}(),lV=function(){return function(){var t={},e=[],n={getItem:function(e){var n=t[e];return n||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()};try{var dV="__storage_test__";tV=window.localStorage,tV.setItem(dV,dV),tV.removeItem(dV)}catch(bV){tV=lV()}var mV=tV,gV={geom:{Rect:GH},util:{Promise:Di,Delay:Ii,Tools:gn,VK:ev,URI:Hy,Class:ZH,EventDispatcher:$z,Observable:Kz,I18n:ff,XHR:cV,JSON:uV,JSONRequest:fV,JSONP:aV,LocalStorage:mV,Color:oV,ImageUploader:oA},dom:{EventUtils:rc,Sizzle:Vc,DomQuery:Bs,TreeWalker:Hi,TextSeeker:Yf,DOMUtils:Vs,ScriptLoader:Xs,RangeUtils:kv,Serializer:x_,StyleSheetLoader:Li,ControlSelection:rv,BookmarkManager:Fh,Selection:AE,Event:rc.Event},html:{Styles:ja,Entities:_a,Node:Dy,Schema:Va,SaxParser:Ky,DomParser:c_,Writer:iw,Serializer:uw},Env:tn,AddOnManager:lf,Annotator:Lh,Formatter:hA,UndoManager:wA,EditorCommands:_z,WindowManager:MD,NotificationManager:AD,EditorObservable:tH,Shortcuts:lH,Editor:yH,FocusManager:Ub,EditorManager:MH,DOM:Vs.DOM,ScriptLoader:Xs.ScriptLoader,PluginManager:RD,ThemeManager:ND,IconManager:hD,Resource:YH,trim:gn.trim,isArray:gn.isArray,is:gn.is,toArray:gn.toArray,makeMap:gn.makeMap,each:gn.each,map:gn.map,grep:gn.grep,inArray:gn.inArray,extend:gn.extend,create:gn.create,walk:gn.walk,createNS:gn.createNS,resolve:gn.resolve,explode:gn.explode,_addCacheSuffix:gn._addCacheSuffix,isOpera:tn.opera,isWebKit:tn.webkit,isIE:tn.ie,isGecko:tn.gecko,isMac:tn.mac},pV=gn.extend(MH,gV),hV=function(e){try{t.exports=e}catch(n){}},vV=function(t){window.tinymce=t,window.tinyMCE=t};vV(pV),hV(pV)})()}).call(this,n("c8ba"))},e8b0:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){return t},n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},r="\ufeff",o=function(t){return t.replace(/\uFEFF/g,"")},i=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},u="[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]",a={aletter:"[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]",midnumlet:"[-'\\.‘’․﹒'.]",midletter:"[:··״‧︓﹕:]",midnum:"[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",numeric:"[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",cr:"\\r",lf:"\\n",newline:"[\v\f…\u2028\u2029]",extend:"[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿‌‍⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",format:"[­؀-؃۝܏឴឵‎‏‪-‮⁠-⁤-\ufeff-]",katakana:"[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",extendnumlet:"[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",punctuation:u},c={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},s=[new RegExp(a.aletter),new RegExp(a.midnumlet),new RegExp(a.midletter),new RegExp(a.midnum),new RegExp(a.numeric),new RegExp(a.cr),new RegExp(a.lf),new RegExp(a.newline),new RegExp(a.extend),new RegExp(a.format),new RegExp(a.katakana),new RegExp(a.extendnumlet),new RegExp("@")],f="",l=new RegExp("^"+a.punctuation+"$"),d=/^\s+$/,m=s,g=c.OTHER,p=function(t){for(var e=g,n=m.length,r=0;r<n;++r){var o=m[r];if(o&&o.test(t)){e=r;break}}return e},h=function(t){var e={};return function(n){if(e[n])return e[n];var r=t(n);return e[n]=r,r}},v=function(t){var e=h(p);return i(t,e)},b=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(n===c.ALETTER&&r===c.ALETTER)return!1;var o=t[e+2];if(n===c.ALETTER&&(r===c.MIDLETTER||r===c.MIDNUMLET||r===c.AT)&&o===c.ALETTER)return!1;var i=t[e-1];return(n!==c.MIDLETTER&&n!==c.MIDNUMLET&&r!==c.AT||r!==c.ALETTER||i!==c.ALETTER)&&((n!==c.NUMERIC&&n!==c.ALETTER||r!==c.NUMERIC&&r!==c.ALETTER)&&((n!==c.MIDNUM&&n!==c.MIDNUMLET||r!==c.NUMERIC||i!==c.NUMERIC)&&((n!==c.NUMERIC||r!==c.MIDNUM&&r!==c.MIDNUMLET||o!==c.NUMERIC)&&(n!==c.EXTEND&&n!==c.FORMAT&&i!==c.EXTEND&&i!==c.FORMAT&&r!==c.EXTEND&&r!==c.FORMAT&&((n!==c.CR||r!==c.LF)&&(n===c.NEWLINE||n===c.CR||n===c.LF||(r===c.NEWLINE||r===c.CR||r===c.LF||(n!==c.KATAKANA||r!==c.KATAKANA)&&((r!==c.EXTENDNUMLET||n!==c.ALETTER&&n!==c.NUMERIC&&n!==c.KATAKANA&&n!==c.EXTENDNUMLET)&&((n!==c.EXTENDNUMLET||r!==c.ALETTER&&r!==c.NUMERIC&&r!==c.KATAKANA)&&n!==c.AT)))))))))},y=f,w=d,x=l,C=function(t){return"http"===t||"https"===t},S=function(t,e){var n;for(n=e;n<t.length;n++)if(w.test(t[n]))break;return n},k=function(t,e){var n=S(t,e+1),r=t.slice(e+1,n).join(y);return"://"===r.substr(0,3)?n:e},O=function(t,e,n,r){for(var o=[],i=[],u=0;u<n.length;++u)if(i.push(t[u]),b(n,u)){var a=e[u];if((r.includeWhitespace||!w.test(a))&&(r.includePunctuation||!x.test(a))){var c=u-i.length+1,s=u+1,f=e.slice(c,s).join(y);if(C(f)){var l=k(e,u),d=t.slice(s,l);Array.prototype.push.apply(i,d),u=l}o.push(i)}i=[]}return o},T=function(){return{includeWhitespace:!1,includePunctuation:!1}},E=function(t,e,o){o=n(n({},T()),o);for(var i=[],u=[],a=0;a<t.length;a++){var c=e(t[a]);c!==r&&(i.push(t[a]),u.push(c))}var s=v(u);return O(i,u,s,o)},_=E,D=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),A=function(t,e){var n=e.getBlockElements(),r=e.getShortEndedElements(),i=function(t){return n[t.nodeName]||r[t.nodeName]},u=[],a="",c=new D(t,t);while(t=c.next())3===t.nodeType?a+=o(t.data):i(t)&&a.length&&(u.push(a),a="");return a.length&&u.push(a),u},R=function(t){return t.replace(/\u200B/g,"")},N=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},B=function(t,n){var r=R(A(t,n).join("\n"));return _(r.split(""),e).length},M=function(t,e){var n=A(t,e).join("");return N(n)},P=function(t,e){var n=A(t,e).join("").replace(/\s/g,"");return N(n)},I=function(t,e){return function(){return e(t.getBody(),t.schema)}},L=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},F=function(t){return I(t,B)},z=function(t){return{body:{getWordCount:F(t),getCharacterCount:I(t,M),getCharacterCountWithoutSpaces:I(t,P)},selection:{getWordCount:L(t,B),getCharacterCount:L(t,M),getCharacterCountWithoutSpaces:L(t,P)},getCount:F(t)}},H=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},V=function(t,e){t.addCommand("mceWordCount",(function(){return H(t,e)}))},U=tinymce.util.Tools.resolve("tinymce.util.Delay"),j=function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})},W=function(t,e){j(t,e)},q=function(t,e,n){var r=U.debounce((function(){return W(t,e)}),n);t.on("init",(function(){W(t,e),U.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",r)}),0)}))},$=function(t){var e=function(){return t.execCommand("mceWordCount")};t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:e}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:e})};function G(e){void 0===e&&(e=300),t.add("wordcount",(function(t){var n=z(t);return V(t,n),$(t),q(t,n,e),n}))}G()})()},f034:function(t,e){(function(){"use strict";var t=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return{isFullscreen:function(){return null!==t.get()}}},r=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},o=function(t){return function(e){return r(e)===t}},i=function(t){return function(e){return typeof e===t}},u=o("string"),a=o("array"),c=i("boolean"),s=function(t){return null===t||void 0===t},f=function(t){return!s(t)},l=i("function"),d=i("number"),m=function(){},g=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},p=function(t,e){return function(n){return t(e(n))}},h=function(t){return function(){return t}},v=function(t){return t};function b(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var y=h(!1),w=h(!0),x=function(){return C},C=function(){var t=function(t){return t()},e=v,n={fold:function(t,e){return t()},isSome:y,isNone:w,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:e,orThunk:t,map:x,each:m,bind:x,exists:y,forall:w,filter:function(){return x()},toArray:function(){return[]},toString:h("none()")};return n}(),S=function(t){var e=h(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:w,isNone:y,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return S(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:C},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},k=function(t){return null===t||void 0===t?C:S(t)},O={some:S,none:x,from:k},T=function(){return T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},T.apply(this,arguments)},E=function(e){var n=t(O.none()),r=function(){return n.get().each(e)},o=function(){r(),n.set(O.none())},i=function(){return n.get().isSome()},u=function(){return n.get()},a=function(t){r(),n.set(O.some(t))};return{clear:o,isSet:i,get:u,set:a}},_=function(){return E((function(t){return t.unbind()}))},D=function(){var t=E(m),e=function(e){return t.get().each(e)};return T(T({},t),{on:e})},A=Array.prototype.push,R=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},N=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},B=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},M=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return O.some(i);if(n(i,r))break}return O.none()},P=function(t,e){return M(t,e,y)},I=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);A.apply(e,t[n])}return e},L=function(t,e){return I(R(t,e))},F=function(t,e){return e>=0&&e<t.length?O.some(t[e]):O.none()},z=function(t){return F(t,0)},H=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return O.none()},V=Object.keys,U=function(t,e){for(var n=V(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},j=function(t,e){return-1!==t.indexOf(e)},W=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},q=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return K(r.childNodes[0])},$=function(t,e){var n=e||document,r=n.createElement(t);return K(r)},G=function(t,e){var n=e||document,r=n.createTextNode(t);return K(r)},K=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},X=function(t,e,n){return O.from(t.dom.elementFromPoint(e,n)).map(K)},Y={fromHtml:q,fromTag:$,fromText:G,fromDom:K,fromPoint:X};"undefined"!==typeof window?window:Function("return this;")();var J=9,Q=11,Z=1,tt=3,et=function(t){return t.dom.nodeType},nt=function(t){return function(e){return et(e)===t}},rt=nt(Z),ot=nt(tt),it=nt(J),ut=nt(Q),at=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},ct=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),l=!s&&!c&&!f;return{isiPad:h(o),isiPhone:h(i),isTablet:h(c),isPhone:h(s),isTouch:h(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:h(f),isDesktop:h(l)}},st=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},ft=function(t,e){var n=st(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return mt(r(1),r(2))},lt=function(t,e){var n=String(e).toLowerCase();return 0===t.length?dt():ft(t,n)},dt=function(){return mt(0,0)},mt=function(t,e){return{major:t,minor:e}},gt={nu:mt,detect:lt,unknown:dt},pt=function(t,e){return H(e.brands,(function(e){var n=e.brand.toLowerCase();return P(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:gt.nu(parseInt(e.version,10),0)}}))}))},ht=function(t,e){var n=String(e).toLowerCase();return P(t,(function(t){return t.search(n)}))},vt=function(t,e){return ht(t,e).map((function(t){var n=gt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},bt=function(t,e){return ht(t,e).map((function(t){var n=gt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},yt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,wt=function(t){return function(e){return j(e,t)}},xt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return j(t,"edge/")&&j(t,"chrome")&&j(t,"safari")&&j(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,yt],search:function(t){return j(t,"chrome")&&!j(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return j(t,"msie")||j(t,"trident")}},{name:"Opera",versionRegexes:[yt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:wt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:wt("firefox")},{name:"Safari",versionRegexes:[yt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(j(t,"safari")||j(t,"mobile/"))&&j(t,"applewebkit")}}],Ct=[{name:"Windows",search:wt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return j(t,"iphone")||j(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:wt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:wt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:wt("linux"),versionRegexes:[]},{name:"Solaris",search:wt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:wt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:wt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],St={browsers:h(xt),oses:h(Ct)},kt="Edge",Ot="Chrome",Tt="IE",Et="Opera",_t="Firefox",Dt="Safari",At=function(){return Rt({current:void 0,version:gt.unknown()})},Rt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(kt),isChrome:r(Ot),isIE:r(Tt),isOpera:r(Et),isFirefox:r(_t),isSafari:r(Dt)}},Nt={unknown:At,nu:Rt,edge:h(kt),chrome:h(Ot),ie:h(Tt),opera:h(Et),firefox:h(_t),safari:h(Dt)},Bt="Windows",Mt="iOS",Pt="Android",It="Linux",Lt="OSX",Ft="Solaris",zt="FreeBSD",Ht="ChromeOS",Vt=function(){return Ut({current:void 0,version:gt.unknown()})},Ut=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Bt),isiOS:r(Mt),isAndroid:r(Pt),isOSX:r(Lt),isLinux:r(It),isSolaris:r(Ft),isFreeBSD:r(zt),isChromeOS:r(Ht)}},jt={unknown:Vt,nu:Ut,windows:h(Bt),ios:h(Mt),android:h(Pt),linux:h(It),osx:h(Lt),solaris:h(Ft),freebsd:h(zt),chromeos:h(Ht)},Wt=function(t,e,n){var r=St.browsers(),o=St.oses(),i=e.bind((function(t){return pt(r,t)})).orThunk((function(){return vt(r,t)})).fold(Nt.unknown,Nt.nu),u=bt(o,t).fold(jt.unknown,jt.nu),a=ct(u,i,t,n);return{browser:i,os:u,deviceType:a}},qt={detect:Wt},$t=function(t){return window.matchMedia(t).matches},Gt=at((function(){return qt.detect(navigator.userAgent,O.from(navigator.userAgentData),$t)})),Kt=function(){return Gt()},Xt=function(t,e){var n=t.dom;if(n.nodeType!==Z)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Yt=function(t){return t.nodeType!==Z&&t.nodeType!==J&&t.nodeType!==Q||0===t.childElementCount},Jt=function(t,e){var n=void 0===e?document:e.dom;return Yt(n)?[]:R(n.querySelectorAll(t),Y.fromDom)},Qt=function(t,e){return t.dom===e.dom},Zt=function(t){return Y.fromDom(t.dom.ownerDocument)},te=function(t){return it(t)?t:Zt(t)},ee=function(t){return O.from(t.dom.parentNode).map(Y.fromDom)},ne=function(t,e){var n=l(e)?e:y,r=t.dom,o=[];while(null!==r.parentNode&&void 0!==r.parentNode){var i=r.parentNode,u=Y.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},re=function(t){var e=function(e){return B(e,(function(e){return!Qt(t,e)}))};return ee(t).map(oe).map(e).getOr([])},oe=function(t){return R(t.dom.childNodes,Y.fromDom)},ie=function(t){return ut(t)&&f(t.dom.host)},ue=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),ae=h(ue),ce=ue?function(t){return Y.fromDom(t.dom.getRootNode())}:te,se=function(t){var e=ce(t);return ie(e)?O.some(e):O.none()},fe=function(t){return Y.fromDom(t.dom.host)},le=function(t){if(ae()&&f(t.target)){var e=Y.fromDom(t.target);if(rt(e)&&de(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return z(n)}}return O.from(t.target)},de=function(t){return f(t.dom.shadowRoot)},me=function(t){var e=ot(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return se(Y.fromDom(e)).fold((function(){return n.body.contains(e)}),p(me,fe))},ge=function(t){var e=t.dom.body;if(null===e||void 0===e)throw new Error("Body is not available yet");return Y.fromDom(e)},pe=function(t,e,n){if(!(u(n)||c(n)||d(n)))throw new Error("Attribute value was not simple");t.setAttribute(e,n+"")},he=function(t,e,n){pe(t.dom,e,n)},ve=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},be=function(t,e){t.dom.removeAttribute(e)},ye=function(t,e,n){if(!u(n))throw new Error("CSS value must be a string: "+n);W(t)&&t.style.setProperty(e,n)},we=function(t,e){var n=t.dom;U(e,(function(t,e){ye(n,e,t)}))},xe=function(t,e){var n=t.dom,r=window.getComputedStyle(n),o=r.getPropertyValue(e);return""!==o||me(t)?o:Ce(n,e)},Ce=function(t,e){return W(t)?t.style.getPropertyValue(e):""},Se=function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}},ke=function(t){var e=Y.fromDom(le(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=g(r,n);return Se(e,t.clientX,t.clientY,n,r,o,t)},Oe=function(t,e){return function(n){t(n)&&e(ke(n))}},Te=function(t,e,n,r,o){var i=Oe(n,r);return t.dom.addEventListener(e,i,o),{unbind:b(_e,t,e,i,o)}},Ee=function(t,e,n,r){return Te(t,e,n,r,!1)},_e=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},De=w,Ae=function(t,e,n){return Ee(t,e,De,n)},Re=function(t,e){var n=function(n,r){return Re(t+n,e+r)};return{left:t,top:e,translate:n}},Ne=Re,Be=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return Ne(n,r)},Me=function(t){var e=void 0===t?window:t;return Kt().browser.isFirefox()?O.none():O.from(e["visualViewport"])},Pe=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Ie=function(t){var e=void 0===t?window:t,n=e.document,r=Be(Y.fromDom(n));return Me(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Pe(r.left,r.top,n,o)}),(function(t){return Pe(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Le=function(t,e,n){return Me(n).map((function(n){var r=function(t){return e(ke(t))};return n.addEventListener(t,r),{unbind:function(){return n.removeEventListener(t,r)}}})).getOrThunk((function(){return{unbind:m}}))},Fe=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ze=tinymce.util.Tools.resolve("tinymce.Env"),He=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ve=function(t,e){t.fire("FullscreenStateChanged",{state:e}),t.fire("ResizeEditor")},Ue=function(t){return t.getParam("fullscreen_native",!1,"boolean")},je=function(t){var e=Y.fromDom(t.getElement());return se(e).map(fe).getOrThunk((function(){return ge(Zt(e))}))},We=function(t){return void 0!==t.fullscreenElement?t.fullscreenElement:void 0!==t.msFullscreenElement?t.msFullscreenElement:void 0!==t.webkitFullscreenElement?t.webkitFullscreenElement:null},qe=function(){return void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange"},$e=function(t){var e=t.dom;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()},Ge=function(t){var e=t.dom;e.exitFullscreen?e.exitFullscreen():e.msExitFullscreen?e.msExitFullscreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()},Ke=function(t){return t.dom===We(Zt(t).dom)},Xe=function(t,e,n){return B(ne(t,n),e)},Ye=function(t,e){return B(re(t),e)},Je=function(t){return Jt(t)},Qe=function(t,e,n){return Xe(t,(function(t){return Xt(t,e)}),n)},Ze=function(t,e){return Ye(t,(function(t){return Xt(t,e)}))},tn="data-ephox-mobile-fullscreen-style",en="display:none!important;",nn="position:absolute!important;",rn="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",on="background-color:rgb(255,255,255)!important;",un=ze.os.isAndroid(),an=function(t){var e=xe(t,"background-color");return void 0!==e&&""!==e?"background-color:"+e+"!important":on},cn=function(t,e,n){var r=function(t){return Ze(t,"*:not(.tox-silver-sink)")},o=function(e){return function(n){var r=ve(n,"style"),o=void 0===r?"no-styles":r.trim();o!==e&&(he(n,tn,o),we(n,t.parseStyle(e)))}},i=Qe(e,"*"),u=L(i,r),a=an(n);N(u,o(en)),N(i,o(nn+rn+a));var c=!0===un?"":nn;o(c+rn+a)(e)},sn=function(t){var e=Je("["+tn+"]");N(e,(function(e){var n=ve(e,tn);"no-styles"!==n?we(e,t.parseStyle(n)):be(e,"style"),be(e,tn)}))},fn=Fe.DOM,ln=function(){return Ie(window)},dn=function(t){return window.scrollTo(t.x,t.y)},mn=Me().fold((function(){return{bind:m,unbind:m}}),(function(t){var e=D(),n=_(),r=_(),o=function(){document.body.scrollTop=0,document.documentElement.scrollTop=0},i=function(){window.requestAnimationFrame((function(){e.on((function(e){return we(e,{top:t.offsetTop+"px",left:t.offsetLeft+"px",height:t.height+"px",width:t.width+"px"})}))}))},u=He.throttle((function(){o(),i()}),50),a=function(t){e.set(t),u(),n.set(Le("resize",u)),r.set(Le("scroll",u))},c=function(){e.on((function(){n.clear(),r.clear()})),e.clear()};return{bind:a,unbind:c}})),gn=function(t,e){var n=document.body,r=document.documentElement,o=t.getContainer(),i=Y.fromDom(o),u=je(t),a=e.get(),c=Y.fromDom(t.getBody()),s=ze.deviceType.isTouch(),f=o.style,l=t.iframeElement,d=l.style,m=function(t){t(n,"tox-fullscreen"),t(r,"tox-fullscreen"),t(o,"tox-fullscreen"),se(i).map((function(t){return fe(t).dom})).each((function(e){t(e,"tox-fullscreen"),t(e,"tox-shadowhost")}))},g=function(){s&&sn(t.dom),m(fn.removeClass),mn.unbind(),O.from(e.get()).each((function(t){return t.fullscreenChangeHandler.unbind()}))};if(a)a.fullscreenChangeHandler.unbind(),Ue(t)&&Ke(u)&&Ge(Zt(u)),d.width=a.iframeWidth,d.height=a.iframeHeight,f.width=a.containerWidth,f.height=a.containerHeight,f.top=a.containerTop,f.left=a.containerLeft,g(),dn(a.scrollPos),e.set(null),Ve(t,!1),t.off("remove",g);else{var p=Ae(Zt(u),qe(),(function(n){Ue(t)&&(Ke(u)||null===e.get()||gn(t,e))})),h={scrollPos:ln(),containerWidth:f.width,containerHeight:f.height,containerTop:f.top,containerLeft:f.left,iframeWidth:d.width,iframeHeight:d.height,fullscreenChangeHandler:p};s&&cn(t.dom,i,c),d.width=d.height="100%",f.width=f.height="",m(fn.addClass),mn.bind(i),t.on("remove",g),e.set(h),Ue(t)&&$e(u),Ve(t,!0)}},pn=function(t,e){t.addCommand("mceFullScreen",(function(){gn(t,e)}))},hn=function(t,e){return function(n){n.setActive(null!==e.get());var r=function(t){return n.setActive(t.state)};return t.on("FullscreenStateChanged",r),function(){return t.off("FullscreenStateChanged",r)}}},vn=function(t,e){var n=function(){return t.execCommand("mceFullScreen")};t.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:n,onSetup:hn(t,e)}),t.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:n,onSetup:hn(t,e)})};function bn(){e.add("fullscreen",(function(e){var r=t(null);return e.inline||(pn(e,r),vn(e,r),e.addShortcut("Meta+Shift+F","","mceFullScreen")),n(r)}))}bn()})()},f557:function(t,e,n){n("5e4c")}}]);