tinymce-rails 4.9.7.1 → 4.9.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 614ac01f6c433f0dbe49a668558b6fb352c55012a0b681761cefd1e14fbe27c7
|
4
|
+
data.tar.gz: be5da35dabf44055ec9de9830117efe3abb751bb0be8fdf391c9ecfce45be4ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 221cb26dbcf98c97d64111815485170c7a479c17b18ecdef45a86d86ae5be91808fcac9f1ab0a9ee8660479e08be2cb6351e7c1547e12fa3d7ca662f1252bb3d
|
7
|
+
data.tar.gz: b0039c6c13abfb9556126a0452bcee6b30375a95c2d1f492b8c4faa0a48bb6623cd8232be9c1c90a2863731a5f652b87ae01dcd95983cc2075c680fe6e5cce22
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// 4.9.
|
1
|
+
// 4.9.8 (2020-01-28)
|
2
2
|
(function () {
|
3
3
|
(function (domGlobals) {
|
4
4
|
'use strict';
|
@@ -17466,7 +17466,7 @@
|
|
17466
17466
|
return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
|
17467
17467
|
};
|
17468
17468
|
var trimComments = function (text) {
|
17469
|
-
return text.replace(
|
17469
|
+
return text.replace(/<!--|--!?>/g, '');
|
17470
17470
|
};
|
17471
17471
|
var isInvalidUri = function (settings, uri) {
|
17472
17472
|
if (settings.allow_html_data_urls) {
|
@@ -26267,8 +26267,8 @@
|
|
26267
26267
|
defaultSettings: {},
|
26268
26268
|
$: DomQuery,
|
26269
26269
|
majorVersion: '4',
|
26270
|
-
minorVersion: '9.
|
26271
|
-
releaseDate: '
|
26270
|
+
minorVersion: '9.8',
|
26271
|
+
releaseDate: '2020-01-28',
|
26272
26272
|
editors: legacyEditors,
|
26273
26273
|
i18n: I18n,
|
26274
26274
|
activeEditor: null,
|
@@ -1 +1 @@
|
|
1
|
-
!function(p){"use strict";var _=function(){},v=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},I=function(n){return function(){return n}},h=function(n){return n};function l(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var n,e,t,r,o,i,u,x=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}},c=function(n){return function(){throw new Error(n)}},a=function(n){return n()},s=I(!1),f=I(!0),d=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}},y=d("string"),m=d("object"),g=d("array"),b=d("boolean"),w=d("function"),T=d("number"),S=Object.prototype.hasOwnProperty,O=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)S.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},k=O(function(n,e){return m(n)&&m(e)?k(n,e):e}),C=O(function(n,e){return e}),E=function(){return D},D=(n=function(n){return n.isNone()},r={fold:function(n,e){return n()},is:s,isSome:s,isNone:f,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:I(null),getOrUndefined:I(undefined),or:t,orThunk:e,map:E,each:_,bind:E,exists:s,forall:f,filter:E,equals:n,equals_:n,toArray:function(){return[]},toString:I("none()")},Object.freeze&&Object.freeze(r),r),A=function(t){var n=I(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:f,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return A(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:D},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(s,function(n){return e(t,n)})}};return o},M={some:A,none:E,from:function(n){return null===n||n===undefined?D:A(n)}},F=Object.keys,R=function(n,e){for(var t=F(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i)}},B=function(n,t){return V(n,function(n,e){return{k:e,v:t(n,e)}})},V=function(n,r){var o={};return R(n,function(n,e){var t=r(n,e);o[t.k]=t.v}),o},N=function(n,t){var r=[];return R(n,function(n,e){r.push(t(n,e))}),r},j=I("touchstart"),H=I("touchmove"),z=I("touchend"),L=I("mousedown"),P=I("mousemove"),$=I("mouseup"),W=I("mouseover"),U=I("keydown"),G=I("input"),q=I("change"),Y=I("click"),K=I("transitionend"),X=I("selectstart"),J=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},Q=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return nn(r(1),r(2))},Z=function(){return nn(0,0)},nn=function(n,e){return{major:n,minor:e}},en={nu:nn,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Z():Q(n,t)},unknown:Z},tn="Firefox",rn=function(n,e){return function(){return e===n}},on=function(n){var e=n.current;return{current:e,version:n.version,isEdge:rn("Edge",e),isChrome:rn("Chrome",e),isIE:rn("IE",e),isOpera:rn("Opera",e),isFirefox:rn(tn,e),isSafari:rn("Safari",e)}},un={unknown:function(){return on({current:undefined,version:en.unknown()})},nu:on,edge:I("Edge"),chrome:I("Chrome"),ie:I("IE"),opera:I("Opera"),firefox:I(tn),safari:I("Safari")},cn="Windows",an="Android",sn="Solaris",fn="FreeBSD",ln=function(n,e){return function(){return e===n}},dn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:ln(cn,e),isiOS:ln("iOS",e),isAndroid:ln(an,e),isOSX:ln("OSX",e),isLinux:ln("Linux",e),isSolaris:ln(sn,e),isFreeBSD:ln(fn,e)}},mn={unknown:function(){return dn({current:undefined,version:en.unknown()})},nu:dn,windows:I(cn),ios:I("iOS"),android:I(an),linux:I("Linux"),osx:I("OSX"),solaris:I(sn),freebsd:I(fn)},gn=Array.prototype.slice,pn=Array.prototype.indexOf,vn=Array.prototype.push,hn=function(n,e){return t=n,r=e,-1<pn.call(t,r);var t,r},yn=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o)}return r},bn=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t)},wn=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r)&&t.push(i)}return t},xn=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t)}(n,function(n){t=e(t,n)}),t},Tn=function(n,e,t){return bn(n,function(n){t=e(t,n)}),t},Sn=function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t))return M.some(o)}return M.none()},On=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t))return M.some(t);return M.none()},kn=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!g(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);vn.apply(e,n[t])}return e},Cn=function(n,e){var t=yn(n,e);return kn(t)},En=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t))return!1;return!0},Dn=function(n){var e=gn.call(n,0);return e.reverse(),e},_n=function(n){return[n]},In=(w(Array.from)&&Array.from,function(n,e){var t=String(e).toLowerCase();return Sn(n,function(n){return n.search(t)})}),An=function(n,t){return In(n,t).map(function(n){var e=en.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Mn=function(n,t){return In(n,t).map(function(n){var e=en.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Fn=function(n,e){return-1!==n.indexOf(e)},Rn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Bn=function(e){return function(n){return Fn(n,e)}},Vn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Fn(n,"edge/")&&Fn(n,"chrome")&&Fn(n,"safari")&&Fn(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Rn],search:function(n){return Fn(n,"chrome")&&!Fn(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Fn(n,"msie")||Fn(n,"trident")}},{name:"Opera",versionRegexes:[Rn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Bn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Bn("firefox")},{name:"Safari",versionRegexes:[Rn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Fn(n,"safari")||Fn(n,"mobile/"))&&Fn(n,"applewebkit")}}],Nn=[{name:"Windows",search:Bn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Fn(n,"iphone")||Fn(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Bn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Bn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Bn("linux"),versionRegexes:[]},{name:"Solaris",search:Bn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Bn("freebsd"),versionRegexes:[]}],jn={browsers:I(Vn),oses:I(Nn)},Hn=function(n){var e,t,r,o,i,u,c,a,s,f,l,d=jn.browsers(),m=jn.oses(),g=An(d,n).fold(un.unknown,un.nu),p=Mn(m,n).fold(mn.unknown,mn.nu);return{browser:g,os:p,deviceType:(t=g,r=n,o=(e=p).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,c=e.isAndroid()&&4===e.version.major,a=o||u||c&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),f=s&&!a,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:I(o),isiPhone:I(i),isTablet:I(a),isPhone:I(f),isTouch:I(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:I(l)})}},zn={detect:J(function(){var n=p.navigator.userAgent;return Hn(n)})},Ln={tap:I("alloy.tap")},Pn=I("alloy.focus"),$n=I("alloy.blur.post"),Wn=I("alloy.receive"),Un=I("alloy.execute"),Gn=I("alloy.focus.item"),qn=Ln.tap,Yn=zn.detect().deviceType.isTouch()?Ln.tap:Y,Kn=I("alloy.longpress"),Xn=I("alloy.system.init"),Jn=I("alloy.system.scroll"),Qn=I("alloy.system.attached"),Zn=I("alloy.system.detached"),ne=function(n,e){oe(n,n.element(),e,{})},ee=function(n,e,t){oe(n,n.element(),e,t)},te=function(n){ne(n,Un())},re=function(n,e,t){oe(n,e,t,{})},oe=function(n,e,t,r){var o=k({target:e},r);n.getSystem().triggerEvent(t,e,B(o,I))},ie=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:I(n)}},ue={fromHtml:function(n,e){var t=(e||p.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw p.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return ie(t.childNodes[0])},fromTag:function(n,e){var t=(e||p.document).createElement(n);return ie(t)},fromText:function(n,e){var t=(e||p.document).createTextNode(n);return ie(t)},fromDom:ie,fromPoint:function(n,e,t){var r=n.dom();return M.from(r.elementFromPoint(e,t)).map(ie)}},ce=(p.Node.ATTRIBUTE_NODE,p.Node.CDATA_SECTION_NODE,p.Node.COMMENT_NODE,p.Node.DOCUMENT_NODE),ae=(p.Node.DOCUMENT_TYPE_NODE,p.Node.DOCUMENT_FRAGMENT_NODE,p.Node.ELEMENT_NODE),se=p.Node.TEXT_NODE,fe=(p.Node.PROCESSING_INSTRUCTION_NODE,p.Node.ENTITY_REFERENCE_NODE,p.Node.ENTITY_NODE,p.Node.NOTATION_NODE,"undefined"!=typeof p.window?p.window:Function("return this;")()),le=function(n,e){return function(n,e){for(var t=e!==undefined&&null!==e?e:fe,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t}(n.split("."),e)},de=function(n,e){var t=le(n,e);if(t===undefined||null===t)throw new Error(n+" not available on this browser");return t},me=function(n){return n.dom().nodeName.toLowerCase()},ge=function(e){return function(n){return n.dom().nodeType===e}},pe=ge(ae),ve=ge(se),he=function(n){var e=ve(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},ye=J(function(){return be(ue.fromDom(p.document))}),be=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return ue.fromDom(e)},we=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return bn(e,function(n,e){r[n]=I(t[e])}),r}},xe=function(n){return n.slice(0).sort()},Te=function(n,e){throw new Error("All required keys ("+xe(n).join(", ")+") were not specified. Specified keys were: "+xe(e).join(", ")+".")},Se=function(n){throw new Error("Unsupported keys for object: "+xe(n).join(", "))},Oe=function(e,n){if(!g(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");bn(n,function(n){if(!y(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},ke=function(n){var t=xe(n);Sn(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})},Ce=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Oe("required",o),Oe("optional",i),ke(u),function(e){var t=F(e);En(o,function(n){return hn(t,n)})||Te(o,t);var n=wn(t,function(n){return!hn(u,n)});0<n.length&&Se(n);var r={};return bn(o,function(n){r[n]=I(e[n])}),bn(i,function(n){r[n]=I(Object.prototype.hasOwnProperty.call(e,n)?M.some(e[n]):M.none())}),r}},Ee=ae,De=ce,_e=function(n,e){var t=n.dom();if(t.nodeType!==Ee)return!1;var r=t;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ie=function(n){return n.nodeType!==Ee&&n.nodeType!==De||0===n.childElementCount},Ae=function(n,e){var t=e===undefined?p.document:e.dom();return Ie(t)?[]:yn(t.querySelectorAll(n),ue.fromDom)},Me=function(n,e){var t=e===undefined?p.document:e.dom();return Ie(t)?M.none():M.from(t.querySelector(n)).map(ue.fromDom)},Fe=function(n,e){return n.dom()===e.dom()},Re=(zn.detect().browser.isIE(),function(n){return ue.fromDom(n.dom().ownerDocument)}),Be=function(n){return ue.fromDom(n.dom().ownerDocument.defaultView)},Ve=function(n){return M.from(n.dom().parentNode).map(ue.fromDom)},Ne=function(n){return yn(n.dom().childNodes,ue.fromDom)},je=function(n){return e=0,t=n.dom().childNodes,M.from(t[e]).map(ue.fromDom);var e,t},He=(we("element","offset"),function(e,t){je(e).fold(function(){ze(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})}),ze=function(n,e){n.dom().appendChild(e.dom())},Le=function(e,n){bn(n,function(n){ze(e,n)})},Pe=function(n){n.dom().textContent="",bn(Ne(n),function(n){$e(n)})},$e=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},We=function(n){ne(n,Zn());var e=n.components();bn(e,We)},Ue=function(n){var e=n.components();bn(e,Ue),ne(n,Qn())},Ge=function(n,e){qe(n,e,ze)},qe=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),he(n.element())&&Ue(e),n.syncComponents()},Ye=function(n){We(n),$e(n.element()),n.getSystem().removeFromWorld(n)},Ke=function(e){var n=Ve(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(M.none,M.some)});Ye(e),n.each(function(n){n.syncComponents()})},Xe=function(t){return{is:function(n){return t===n},isValue:f,isError:s,getOr:I(t),getOrThunk:I(t),getOrDie:I(t),or:function(n){return Xe(t)},orThunk:function(n){return Xe(t)},fold:function(n,e){return e(t)},map:function(n){return Xe(n(t))},mapError:function(n){return Xe(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return M.some(t)}}},Je=function(t){return{is:s,isValue:s,isError:f,getOr:h,getOrThunk:function(n){return n()},getOrDie:function(){return c(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return Je(t)},mapError:function(n){return Je(n(t))},each:_,bind:function(n){return Je(t)},exists:s,forall:f,toOption:M.none}},Qe={value:Xe,error:Je,fromOption:function(n,e){return n.fold(function(){return Je(e)},Xe)}},Ze=function(u){if(!g(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],t={};return bn(u,function(n,r){var e=F(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!g(i))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=F(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!En(c,function(n){return hn(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+c.join(", "));return n[o].apply(null,t)},log:function(n){p.console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},nt=Ze([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),et=function(n){return nt.defaultedThunk(I(n))},tt=nt.strict,rt=nt.asOption,ot=nt.defaultedThunk,it=nt.mergeWithThunk,ut=(Ze([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){var e=[],t=[];return bn(n,function(n){n.fold(function(n){e.push(n)},function(n){t.push(n)})}),{errors:e,values:t}}),ct=function(n){return v(Qe.error,kn)(n)},at=function(n,e){var t,r,o=ut(n);return 0<o.errors.length?ct(o.errors):(t=o.values,r=e,Qe.value(k.apply(undefined,[r].concat(t))))},st=function(n){var e=ut(n);return 0<e.errors.length?ct(e.errors):Qe.value(e.values)},ft=function(e){return function(n){return n.hasOwnProperty(e)?M.from(n[e]):M.none()}},lt=function(n,e){return ft(e)(n)},dt=function(n,e){var t={};return t[n]=e,t},mt=function(n,e){return t=n,r={},bn(e,function(n){t[n]!==undefined&&t.hasOwnProperty(n)&&(r[n]=t[n])}),r;var t,r},gt=function(n,e){return t=e,r={},R(n,function(n,e){hn(t,e)||(r[e]=n)}),r;var t,r},pt=function(n){return ft(n)},vt=function(n,e){return t=n,r=e,function(n){return ft(t)(n).getOr(r)};var t,r},ht=function(n,e){return lt(n,e)},yt=function(n,e){return dt(n,e)},bt=function(n){return e={},bn(n,function(n){e[n.key]=n.value}),e;var e},wt=function(n,e){return at(n,e)},xt=function(n,e){return r=e,(t=n).hasOwnProperty(r)&&t[r]!==undefined&&null!==t[r];var t,r},Tt=Ze([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),St=Ze([{field:["name","presence","type"]},{state:["name"]}]),Ot=function(){return de("JSON")},kt=function(n,e,t){return Ot().stringify(n,e,t)},Ct=function(n){return m(n)&&100<F(n).length?" removed due to size":kt(n,null,2)},Et=function(n,e){return Qe.error([{path:n,getErrorInfo:e}])},Dt=Ze([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),_t=function(t,r,o){return lt(r,o).fold(function(){return n=o,e=r,Et(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Ct(e)});var n,e},Qe.value)},It=function(n,e,t){var r=lt(n,e).fold(function(){return t(n)},h);return Qe.value(r)},At=function(o,c,n,a){return n.fold(function(i,e,n,t){var r=function(n){return t.extract(o.concat([i]),a,n).map(function(n){return dt(e,a(n))})},u=function(n){return n.fold(function(){var n=dt(e,a(M.none()));return Qe.value(n)},function(n){return t.extract(o.concat([i]),a,n).map(function(n){return dt(e,a(M.some(n)))})})};return n.fold(function(){return _t(o,c,i).bind(r)},function(n){return It(c,i,n).bind(r)},function(){return(n=c,e=i,Qe.value(lt(n,e))).bind(u);var n,e},function(n){return(e=c,t=i,r=n,o=lt(e,t).map(function(n){return!0===n?r(e):n}),Qe.value(o)).bind(u);var e,t,r,o},function(n){var e=n(c);return It(c,i,I({})).map(function(n){return k(e,n)}).bind(r)})},function(n,e){var t=e(c);return Qe.value(dt(n,a(t)))})},Mt=function(r){return{extract:function(t,n,e){return r(e,n).fold(function(n){return e=n,Et(t,function(){return e});var e},Qe.value)},toString:function(){return"val"},toDsl:function(){return Tt.itemOf(r)}}},Ft=function(n){var a=Rt(n),s=xn(n,function(e,n){return n.fold(function(n){return k(e,yt(n,!0))},I(e))},{});return{extract:function(n,e,t){var r,o,i,u=b(t)?[]:(o=F(r=t),wn(o,function(n){return xt(r,n)})),c=wn(u,function(n){return!xt(s,n)});return 0===c.length?a.extract(n,e,t):(i=c,Et(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:a.toString,toDsl:a.toDsl}},Rt=function(c){return{extract:function(n,e,t){return r=n,o=t,i=e,u=yn(c,function(n){return At(r,o,n,i)}),at(u,{});var r,o,i,u},toString:function(){return"obj{\n"+yn(c,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return Tt.objOf(yn(c,function(n){return n.fold(function(n,e,t,r){return St.field(n,t,r)},function(n,e){return St.state(n)})}))}}},Bt=function(t,i){var e=function(n,e){return(o=Mt(t),{extract:function(t,r,n){var e=yn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return st(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return Tt.arrOf(o)}}).extract(n,h,e);var o};return{extract:function(t,r,o){var n=F(o);return e(t,n).bind(function(n){var e=yn(n,function(n){return Dt.field(n,n,tt(),i)});return Rt(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return Tt.setOf(t,i)}}},Vt=I(Mt(Qe.value)),Nt=Dt.state,jt=Dt.field,Ht=function(t,e,r,o,i){return ht(o,i).fold(function(){return n=o,e=i,Et(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Ct(n)});var n,e},function(n){return Rt(n).extract(t.concat(["branch: "+i]),e,r)})},zt=function(o,i){return{extract:function(e,t,r){return ht(r,o).fold(function(){return n=o,Et(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Ht(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+F(i)},toDsl:function(){return Tt.choiceOf(o,i)}}},Lt=Mt(Qe.value),Pt=function(n,e,t,r){return e.extract([n],t,r).fold(function(n){return Qe.error({input:r,errors:n})},Qe.value)},$t=function(n,e,t){return Pt(n,e,I,t)},Wt=function(n){return n.fold(function(n){throw new Error(qt(n))},h)},Ut=function(n,e,t){return Wt(Pt(n,e,h,t))},Gt=function(n,e,t){return Wt($t(n,e,t))},qt=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,yn(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Ct(n.input);var e,t},Yt=function(n,e){return zt(n,e)},Kt=I(Lt),Xt=(o=w,i="function",Mt(function(n){var e=typeof n;return o(n)?Qe.value(n):Qe.error("Expected type: "+i+" but got: "+e)})),Jt=function(n){return jt(n,n,tt(),Vt())},Qt=function(n,e){return jt(n,n,tt(),e)},Zt=function(n){return Qt(n,Xt)},nr=function(n,e){return jt(n,n,tt(),Rt(e))},er=function(n){return jt(n,n,rt(),Vt())},tr=function(n,e){return jt(n,n,rt(),Rt(e))},rr=function(n,e){return jt(n,n,rt(),Ft(e))},or=function(n,e){return jt(n,n,et(e),Vt())},ir=function(n,e,t){return jt(n,n,et(e),t)},ur=function(n,e){return Nt(n,e)},cr=function(n){if(!xt(n,"can")&&!xt(n,"abort")&&!xt(n,"run"))throw new Error("EventHandler defined by: "+kt(n,null,2)+" does not have can, abort, or run!");return Ut("Extracting event.handler",Ft([or("can",I(!0)),or("abort",I(!1)),or("run",_)]),n)},ar=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return cr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];bn(t,function(n){n.run.apply(undefined,e)})}})},sr=function(n){return bt(n)},fr=function(n,e){return{key:n,value:cr({abort:e})}},lr=function(n,e){return{key:n,value:cr({run:e})}},dr=function(n,e,t){return{key:n,value:cr({run:function(n){e.apply(undefined,[n].concat(t))}})}},mr=function(n){return function(r){return{key:n,value:cr({run:function(n,e){var t;t=e,Fe(n.element(),t.event().target())&&r(n,e)}})}}},gr=function(n,e,t){var u,r,o=e.partUids()[t];return r=o,lr(u=n,function(n,i){n.getSystem().getByUid(r).each(function(n){var e,t,r,o;t=(e=n).element(),r=u,o=i,e.getSystem().triggerEvent(r,t,o.event())})})},pr=function(n){return lr(n,function(n,e){e.cut()})},vr=mr(Qn()),hr=mr(Zn()),yr=mr(Xn()),br=(u=Un(),function(n){return lr(u,n)}),wr=function(n){return yn(n,function(n){return r=e="/*",o=(t=n).length-e.length,""!==r&&(t.length<r.length||t.substr(o,o+r.length)!==r)?n:n.substring(0,n.length-"/*".length);var e,t,r,o})},xr=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:wr(i)}},n},Tr=Ce(["tag"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),Sr=function(n){return{tag:n.tag(),classes:n.classes().getOr([]),attributes:n.attributes().getOr({}),styles:n.styles().getOr({}),value:n.value().getOr("<none>"),innerHtml:n.innerHtml().getOr("<none>"),defChildren:n.defChildren().fold(function(){return"<none>"},function(n){return kt(n,null,2)}),domChildren:n.domChildren().fold(function(){return"<none>"},function(n){return 0===n.length?"0 children, but still specified":String(n.length)})}},Or=Ce([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),kr=function(e,n,t){return n.fold(function(){return t.fold(function(){return{}},function(n){return yt(e,n)})},function(n){return t.fold(function(){return yt(e,n)},function(n){return yt(e,n)})})},Cr=function(t,r,o){return yr(function(n,e){o(n,t,r)})},Er=function(n,e,t,r,o,i){var u,c,a=n,s=tr(e,[(u="config",c=n,jt(u,u,rt(),c))]);return Ir(a,s,e,t,r,o,i)},Dr=function(o,i,u){var n,e,t,r,c,a;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:I(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,c=t.indexOf("("),a=t.substring(c+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:wr(a.slice(0,1).concat(a.slice(3)))}},n},_r=function(n){return{key:n,value:undefined}},Ir=function(t,n,r,o,e,i,u){var c=function(n){return xt(n,r)?n[r]():M.none()},a=B(e,function(n,e){return Dr(r,n,e)}),s=B(i,function(n,e){return xr(n,e)}),f=k(s,a,{revoke:l(_r,r),config:function(n){var e=Gt(r+"-config",t,n);return{key:r,value:{config:e,me:f,configAsRaw:J(function(){return Ut(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return c(n).bind(function(e){return ht(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Or({}))},name:function(){return r},handlers:function(n){return c(n).bind(function(e){return ht(o,"events").map(function(n){return n(e.config,e.state)})}).getOr({})}});return f},Ar=function(n,e){return Mr(n,e,{validate:w,label:"function"})},Mr=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return Oe("required",o),ke(o),function(e){var t=F(e);En(o,function(n){return hn(t,n)})||Te(o,t),r(o,t);var n=wn(o,function(n){return!i.validate(e[n],n)});return 0<n.length&&function(n,e){throw new Error("All values need to be of type: "+e+". Keys ("+xe(n).join(", ")+") were not.")}(n,i.label),e}},Fr=function(e,n){var t=wn(n,function(n){return!hn(e,n)});0<t.length&&Se(t)},Rr=_,Br=function(n){return Ar(Fr,n)},Vr={init:function(){return Nr({readState:function(){return"No State required"}})}},Nr=function(n){return Ar(Rr,["readState"])(n),n},jr=function(n){return bt(n)},Hr=Ft([Jt("fields"),Jt("name"),or("active",{}),or("apis",{}),or("state",Vr),or("extra",{})]),zr=function(n){var e,t,r,o,i,u,c,a,s=Ut("Creating behaviour: "+n.name,Hr,n);return e=s.fields,t=s.name,r=s.active,o=s.apis,i=s.extra,u=s.state,c=Ft(e),a=tr(t,[rr("config",e)]),Ir(c,a,t,r,o,i,u)},Lr=Ft([Jt("branchKey"),Jt("branches"),Jt("name"),or("active",{}),or("apis",{}),or("state",Vr),or("extra",{})]),Pr=I(undefined),$r=function(n,e,t){if(!(y(t)||b(t)||T(t)))throw p.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},Wr=function(n,e,t){$r(n.dom(),e,t)},Ur=function(n,e){var t=n.dom();R(e,function(n,e){$r(t,e,n)})},Gr=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},qr=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},Yr=function(n,e){n.dom().removeAttribute(e)},Kr=function(n,e){var t=Gr(n,e);return t===undefined||""===t?[]:t.split(" ")},Xr=function(n){return n.dom().classList!==undefined},Jr=function(n){return Kr(n,"class")},Qr=function(n,e){return o=e,i=Kr(t=n,r="class").concat([o]),Wr(t,r,i.join(" ")),!0;var t,r,o,i},Zr=function(n,e){return o=e,0<(i=wn(Kr(t=n,r="class"),function(n){return n!==o})).length?Wr(t,r,i.join(" ")):Yr(t,r),!1;var t,r,o,i},no=function(n,e){Xr(n)?n.dom().classList.add(e):Qr(n,e)},eo=function(n,e){var t;Xr(n)?n.dom().classList.remove(e):Zr(n,e),0===(Xr(t=n)?t.dom().classList:Jr(t)).length&&Yr(t,"class")},to=function(n,e){return Xr(n)?n.dom().classList.toggle(e):(r=e,hn(Jr(t=n),r)?Zr(t,r):Qr(t,r));var t,r},ro=function(n,e){return Xr(n)&&n.dom().classList.contains(e)},oo=function(n,e,t){eo(n,t),no(n,e)},io=Object.freeze({__proto__:null,toAlpha:function(n,e,t){oo(n.element(),e.alpha(),e.omega())},toOmega:function(n,e,t){oo(n.element(),e.omega(),e.alpha())},isAlpha:function(n,e,t){return ro(n.element(),e.alpha())},isOmega:function(n,e,t){return ro(n.element(),e.omega())},clear:function(n,e,t){eo(n.element(),e.alpha()),eo(n.element(),e.omega())}}),uo=[Jt("alpha"),Jt("omega")],co=zr({fields:uo,name:"swapping",apis:io}),ao=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return ao(t())}}};function so(n,e,t,r,o){return n(t,r)?M.some(t):w(o)&&o(t)?M.none():e(t,r,o)}var fo=function(n,e,t){for(var r=n.dom(),o=w(t)?t:I(!1);r.parentNode;){r=r.parentNode;var i=ue.fromDom(r);if(e(i))return M.some(i);if(o(i))break}return M.none()},lo=function(n,e,t){return so(function(n,e){return e(n)},fo,n,e,t)},mo=function(n){n.dom().focus()},go=function(n){n.dom().blur()},po=function(n){var e=n!==undefined?n.dom():p.document;return M.from(e.activeElement).map(ue.fromDom)},vo=function(e){return po(Re(e)).filter(function(n){return e.dom().contains(n.dom())})},ho=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),yo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),bo=function(n){var e=p.document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=p.document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,p.window,0,0,0,0,0,!1,!1,!1,!1,0,null),p.document.body.appendChild(e),e.dispatchEvent(t),p.document.body.removeChild(e)},wo={formatChanged:I("formatChanged"),orientationChanged:I("orientationChanged"),dropupDismissed:I("dropupDismissed")},xo=function(n){return n.dom().innerHTML},To=function(n,e){var t,r,o=Re(n).dom(),i=ue.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||p.document).createElement("div")).innerHTML=t,Ne(ue.fromDom(r)));Le(i,u),Pe(n),ze(n,i)},So=function(n){return e=n,t=!1,ue.fromDom(e.dom().cloneNode(t));var e,t},Oo=function(n){var e,t,r,o=So(n);return e=o,t=ue.fromTag("div"),r=ue.fromDom(e.dom().cloneNode(!0)),ze(t,r),xo(t)},ko=function(n){return Oo(n)},Co=Object.freeze({__proto__:null,events:function(c){return sr([lr(Wn(),function(o,i){var n,e,u=c.channels(),t=F(u),r=(n=t,(e=i).universal()?n:wn(n,function(n){return hn(e.channels(),n)}));bn(r,function(n){var e=u[n](),t=e.schema(),r=Gt("channel["+n+"] data\nReceiver: "+ko(o.element()),t,i.data());e.onReceive()(o,r)})})])}}),Eo=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},Do="unknown",_o=[],Io=["alloy/data/Fields","alloy/debugging/Debugging"],Ao={logEventCut:_,logEventStopped:_,logNoParent:_,logEventNoHandlers:_,logEventResponse:_,write:_},Mo=function(n,e,t){var r,o="*"===_o||hn(_o,n)?(r=[],{logEventCut:function(n,e,t){r.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){r.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){r.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){r.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){r.push({outcome:"response",purpose:t,target:e})},write:function(){hn(["mousemove","mouseover","mouseout",Xn()],n)||p.console.log(n,{event:n,target:e.dom(),sequence:yn(r,function(n){return hn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+ko(n.target)+")":n.outcome})})}}):Ao,i=t(o);return o.write(),i},Fo=I([Jt("menu"),Jt("selectedMenu")]),Ro=I([Jt("item"),Jt("selectedItem")]),Bo=(I(Ft(Ro().concat(Fo()))),I(Ft(Ro()))),Vo=nr("initSize",[Jt("numColumns"),Jt("numRows")]),No=function(n,e,t){var r;return function(){var n=new Error;if(n.stack!==undefined){var e=n.stack.split("\n");Sn(e,function(e){return 0<e.indexOf("alloy")&&!function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t))return!0;return!1}(Io,function(n){return-1<e.indexOf(n)})}).getOr(Do)}}(),jt(e,e,t,(r=function(t){return Qe.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})},Mt(function(n){return r(n)})))},jo=function(n){return No(0,n,et(_))},Ho=function(n){return No(0,n,et(M.none))},zo=function(n){return No(0,n,tt())},Lo=function(n){return No(0,n,tt())},Po=function(n,e){return ur(n,I(e))},$o=function(n){return ur(n,h)},Wo=I(Vo),Uo=[Qt("channels",Bt(Qe.value,Ft([zo("onReceive"),or("schema",Kt())])))],Go=zr({fields:Uo,name:"receiving",active:Co}),qo=function(n,e){var t=Jo(n,e),r=e.aria();r.update()(n,r,t)},Yo=function(n,e,t){to(n.element(),e.toggleClass()),qo(n,e)},Ko=function(n,e,t){no(n.element(),e.toggleClass()),qo(n,e)},Xo=function(n,e,t){eo(n.element(),e.toggleClass()),qo(n,e)},Jo=function(n,e){return ro(n.element(),e.toggleClass())},Qo=function(n,e,t){(e.selected()?Ko:Xo)(n,e,t)},Zo=Object.freeze({__proto__:null,onLoad:Qo,toggle:Yo,isOn:Jo,on:Ko,off:Xo}),ni=Object.freeze({__proto__:null,exhibit:function(n,e,t){return Or({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=Yo,br(function(n){o(n,t,r)})),u=Cr(n,e,Qo);return sr(kn([n.toggleOnExecute()?[i]:[],[u]]))}}),ei=function(n,e,t){Wr(n.element(),"aria-expanded",t)},ti=[or("selected",!1),Jt("toggleClass"),or("toggleOnExecute",!0),ir("aria",{mode:"none"},Yt("mode",{pressed:[or("syncWithExpanded",!1),Po("update",function(n,e,t){Wr(n.element(),"aria-pressed",t),e.syncWithExpanded()&&ei(n,e,t)})],checked:[Po("update",function(n,e,t){Wr(n.element(),"aria-checked",t)})],expanded:[Po("update",ei)],selected:[Po("update",function(n,e,t){Wr(n.element(),"aria-selected",t)})],none:[Po("update",_)]}))],ri=zr({fields:ti,name:"toggling",active:ni,apis:Zo}),oi=function(t,r){return Go.config({channels:yt(wo.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},ii=function(n){return Go.config({channels:yt(wo.orientationChanged(),{onReceive:n})})},ui=function(n,e){return{key:n,value:{onReceive:e}}},ci="tinymce-mobile",ai={resolve:function(n){return ci+"-"+n},prefix:I(ci)},si=function(n,e){e.ignore()||(mo(n.element()),e.onFocus()(n))},fi=Object.freeze({__proto__:null,focus:si,blur:function(n,e){e.ignore()||go(n.element())},isFocused:function(n){return e=n.element(),t=Re(e).dom(),e.dom()===t.activeElement;var e,t}}),li=Object.freeze({__proto__:null,exhibit:function(n,e){return e.ignore()?Or({}):Or({attributes:{tabindex:"-1"}})},events:function(t){return sr([lr(Pn(),function(n,e){si(n,t),e.stop()})])}}),di=[jo("onFocus"),or("ignore",!1)],mi=zr({fields:di,name:"focusing",active:li,apis:fi}),gi=function(n){return n.style!==undefined&&w(n.style.getPropertyValue)},pi=function(n,e,t){if(!y(t))throw p.console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);gi(n)&&n.style.setProperty(e,t)},vi=function(n,e,t){var r=n.dom();pi(r,e,t)},hi=function(n,e){var t=n.dom();R(e,function(n,e){pi(t,e,n)})},yi=function(n,e){var t=n.dom(),r=p.window.getComputedStyle(t).getPropertyValue(e),o=""!==r||he(n)?r:bi(t,e);return null===o?undefined:o},bi=function(n,e){return gi(n)?n.style.getPropertyValue(e):""},wi=function(n,e){var t=n.dom(),r=bi(t,e);return M.from(r).filter(function(n){return 0<n.length})},xi=function(n,e){var t,r,o=n.dom();r=e,gi(t=o)&&t.style.removeProperty(r),qr(n,"style")&&""===Gr(n,"style").replace(/^\s+|\s+$/g,"")&&Yr(n,"style")},Ti=function(n){return n.dom().offsetWidth};function Si(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=yi(n,r);return parseFloat(t)||0}return e},i=function(o,n){return Tn(n,function(n,e){var t=yi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!T(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();gi(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var Oi,ki,Ci=Si("height",function(n){var e=n.dom();return he(n)?e.getBoundingClientRect().height:e.offsetHeight}),Ei=function(n){return Ci.get(n)},Di=function(n,e,t){return wn(function(n,e){for(var t=w(e)?e:s,r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=ue.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},_i=function(n,e){return wn(Ve(t=n).map(Ne).map(function(n){return wn(n,function(n){return!Fe(t,n)})}).getOr([]),e);var t},Ii=function(n,e){return Ae(e,n)},Ai=function(n){return Me(n)},Mi=function(n,e,t){return fo(n,function(n){return _e(n,e)},t)},Fi=function(n,e){return Me(e,n)},Ri=function(n,e,t){return so(_e,Mi,n,e,t)},Bi=function(n,e,t){var r=Dn(n.slice(0,e)),o=Dn(n.slice(e+1));return Sn(r.concat(o),t)},Vi=function(n,e,t){var r=Dn(n.slice(0,e));return Sn(r,t)},Ni=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return Sn(o.concat(r),t)},ji=function(n,e,t){var r=n.slice(e+1);return Sn(r,t)},Hi=function(t){return function(n){var e=n.raw();return hn(t,e.which)}},zi=function(n){return function(e){return En(n,function(n){return n(e)})}},Li=function(n){return!0===n.raw().shiftKey},Pi=function(n){return!0===n.raw().ctrlKey},$i=x(Li),Wi=function(n,e){return{matches:n,classification:e}},Ui=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},Gi=function(n,e,t){return n<=e?e:t<=n?t:n},qi=function(e,t,n){var r=Ii(e.element(),"."+t.highlightClass());bn(r,function(n){eo(n,t.highlightClass()),e.getSystem().getByDom(n).each(function(n){t.onDehighlight()(e,n)})})},Yi=function(n,e,t,r){var o=Ki(n,e,t,r);qi(n,e),no(r.element(),e.highlightClass()),o||e.onHighlight()(n,r)},Ki=function(n,e,t,r){return ro(r.element(),e.highlightClass())},Xi=function(n,e,t,r){var o=Ii(n.element(),"."+e.itemClass());return M.from(o[r]).fold(function(){return Qe.error("No element found with index "+r)},n.getSystem().getByDom)},Ji=function(e,n,t){return Fi(e.element(),"."+n.itemClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Qi=function(e,n,t){var r=Ii(e.element(),"."+n.itemClass());return(0<r.length?M.some(r[r.length-1]):M.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Zi=function(t,e,n,r){var o=Ii(t.element(),"."+e.itemClass());return On(o,function(n){return ro(n,e.highlightClass())}).bind(function(n){var e=Ui(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})},nu=Object.freeze({__proto__:null,dehighlightAll:qi,dehighlight:function(n,e,t,r){var o=Ki(n,e,t,r);eo(r.element(),e.highlightClass()),o&&e.onDehighlight()(n,r)},highlight:Yi,highlightFirst:function(e,t,r){Ji(e,t).each(function(n){Yi(e,t,r,n)})},highlightLast:function(e,t,r){Qi(e,t).each(function(n){Yi(e,t,r,n)})},highlightAt:function(e,t,r,n){Xi(e,t,r,n).fold(function(n){throw new Error(n)},function(n){Yi(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Ii(e.element(),"."+t.itemClass()),i=Eo(yn(o,function(n){return e.getSystem().getByDom(n).toOption()}));Sn(i,n).each(function(n){Yi(e,t,r,n)})},isHighlighted:Ki,getHighlighted:function(e,n,t){return Fi(e.element(),"."+n.highlightClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:Ji,getLast:Qi,getPrevious:function(n,e,t){return Zi(n,e,0,-1)},getNext:function(n,e,t){return Zi(n,e,0,1)}}),eu=[Jt("highlightClass"),Jt("itemClass"),jo("onHighlight"),jo("onDehighlight")],tu=zr({fields:eu,name:"highlighting",apis:nu}),ru=function(){return{get:function(n){return vo(n.element())},set:function(n,e){n.getSystem().triggerFocus(e,n.element())}}},ou=function(n,e,c,t,r,i){var u=function(e,t,r,o){var n,i,u=c(e,t,r,o);return(n=u,i=t.event(),Sn(n,function(n){return n.matches(i)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([or("focusManager",ru()),Po("handler",o),Po("state",e)])},processKey:u,toEvents:function(r,o){var n=t(r,o),e=sr(i.map(function(t){return lr(Pn(),function(n,e){t(n,r,o,e),e.stop()})}).toArray().concat([lr(U(),function(n,e){u(n,e,r,o).each(function(n){e.stop()})})]));return k(n,e)},toApis:r};return o},iu=function(n){var e=[er("onEscape"),er("onEnter"),or("selector",'[data-alloy-tabstop="true"]'),or("firstTabstop",0),or("useTabstopAt",I(!0)),er("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector().bind(function(n){return Ri(e,n)}).getOr(e);return 0<Ei(t)},c=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt()(t);var e,t}).fold(function(){return r.cyclic()?M.some(!0):M.none()},function(n){return r.focusManager().set(e,n),M.some(!0)})},i=function(e,n,t,r){var o,i,u=Ii(e.element(),t.selector());return(o=e,i=t,i.focusManager().get(o).bind(function(n){return Ri(n,i.selector())})).bind(function(n){return On(u,l(Fe,n)).bind(function(n){return c(e,u,n,t,r)})})},t=I([Wi(zi([Li,Hi([9])]),function(n,e,t,r){var o=t.cyclic()?Bi:Vi;return i(n,0,t,o)}),Wi(Hi([9]),function(n,e,t,r){var o=t.cyclic()?Ni:ji;return i(n,0,t,o)}),Wi(Hi([27]),function(e,t,n,r){return n.onEscape().bind(function(n){return n(e,t)})}),Wi(zi([$i,Hi([13])]),function(e,t,n,r){return n.onEnter().bind(function(n){return n(e,t)})})]),r=I({}),o=I({});return ou(e,Vr.init,t,r,o,M.some(function(e,t){var n,r,o,i;(n=e,r=t,o=Ii(n.element(),r.selector()),i=wn(o,function(n){return u(r,n)}),M.from(i[r.firstTabstop()])).each(function(n){t.focusManager().set(e,n)})}))},uu=iu(ur("cyclic",I(!1))),cu=iu(ur("cyclic",I(!0))),au=function(n){return"input"===me(n)&&"radio"!==Gr(n,"type")||"textarea"===me(n)},su=function(n,e,t){return au(t)&&Hi([32])(e.event())?M.none():(re(n,t,Un()),M.some(!0))},fu=[or("execute",su),or("useSpace",!1),or("useEnter",!0),or("useControlEnter",!1),or("useDown",!1)],lu=function(n,e,t){return t.execute()(n,e,n.element())},du=I({}),mu=I({}),gu=ou(fu,Vr.init,function(n,e,t,r){var o=t.useSpace()&&!au(n.element())?[32]:[],i=t.useEnter()?[13]:[],u=t.useDown()?[40]:[],c=o.concat(i).concat(u);return[Wi(Hi(c),lu)].concat(t.useControlEnter()?[Wi(zi([Pi,Hi([13])]),lu)]:[])},du,mu,M.none()),pu=function(n){var t=ao(M.none());return Nr({readState:I({}),setGridSize:function(n,e){t.set(M.some({numRows:I(n),numColumns:I(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},vu=Object.freeze({__proto__:null,flatgrid:pu,init:function(n){return n.state()(n)}}),hu=function(e,t){return function(n){return"rtl"===yu(n)?t:e}},yu=function(n){return"rtl"===yi(n,"direction")?"rtl":"ltr"},bu=function(i){return function(n,e,t,r){var o=i(n.element());return Su(o,n,e,t,r)}},wu=function(n,e){var t=hu(n,e);return bu(t)},xu=function(n,e){var t=hu(e,n);return bu(t)},Tu=function(o){return function(n,e,t,r){return Su(o,n,e,t,r)}},Su=function(e,t,n,r,o){return r.focusManager().get(t).bind(function(n){return e(t.element(),n,r,o)}).map(function(n){return r.focusManager().set(t,n),!0})},Ou=Tu,ku=Tu,Cu=Tu,Eu=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},Du=Ce(["index","candidates"],[]),_u=function(n,e,t){return Iu(n,e,t)},Iu=function(n,e,t,r){var o,i=l(Fe,e),u=Ii(n,t),c=wn(u,Eu);return On(o=c,i).map(function(n){return Du({index:n,candidates:o})})},Au=function(n,e){return On(n,function(n){return Fe(e,n)})},Mu=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row()*r+n.column();return 0<=e&&e<t.length?M.some(t[e]):M.none()})},Fu=function(o,n,i,u,c){return Mu(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=Ui(e,c,0,t-1);return M.some({row:I(n),column:I(r)})})},Ru=function(i,n,u,c,a){return Mu(i,n,c,function(n,e){var t=Ui(n,a,0,u-1),r=t===u-1?i.length-t*c:c,o=Gi(e,0,r-1);return M.some({row:I(t),column:I(o)})})},Bu=[Jt("selector"),or("execute",su),Ho("onEscape"),or("captureTab",!1),Wo()],Vu=function(o){return function(n,e,t,r){return _u(n,e,t.selector()).bind(function(n){return o(n.candidates(),n.index(),r.getNumRows().getOr(t.initSize().numRows()),r.getNumColumns().getOr(t.initSize().numColumns()))})}},Nu=function(n,e,t,r){return t.captureTab()?M.some(!0):M.none()},ju=Vu(function(n,e,t,r){return Fu(n,e,t,r,-1)}),Hu=Vu(function(n,e,t,r){return Fu(n,e,t,r,1)}),zu=Vu(function(n,e,t,r){return Ru(n,e,t,r,-1)}),Lu=Vu(function(n,e,t,r){return Ru(n,e,t,r,1)}),Pu=I([Wi(Hi([37]),wu(ju,Hu)),Wi(Hi([39]),xu(ju,Hu)),Wi(Hi([38]),Ou(zu)),Wi(Hi([40]),ku(Lu)),Wi(zi([Li,Hi([9])]),Nu),Wi(zi([$i,Hi([9])]),Nu),Wi(Hi([27]),function(n,e,t,r){return t.onEscape()(n,e)}),Wi(Hi([32].concat([13])),function(e,t,r,n){return(o=e,i=r,i.focusManager().get(o).bind(function(n){return Ri(n,i.selector())})).bind(function(n){return r.execute()(e,t,n)});var o,i})]),$u=I({}),Wu=ou(Bu,pu,Pu,$u,{},M.some(function(e,t,n){Fi(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Uu=function(n,e,t,o){return _u(n,t,e).bind(function(n){var e=n.index(),t=n.candidates(),r=Ui(e,o,0,t.length-1);return M.from(t[r])})},Gu=[Jt("selector"),or("getInitial",M.none),or("execute",su),or("executeOnMove",!1),or("allowVertical",!0)],qu=function(e,t,r){return(n=e,o=r,o.focusManager().get(n).bind(function(n){return Ri(n,o.selector())})).bind(function(n){return r.execute()(e,t,n)});var n,o},Yu=function(n,e,t){return Uu(n,t.selector(),e,-1)},Ku=function(n,e,t){return Uu(n,t.selector(),e,1)},Xu=function(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove()?qu(n,e,t):M.some(!0)})}},Ju=I({}),Qu=I({}),Zu=ou(Gu,Vr.init,function(n,e,t,r){var o=[37].concat(t.allowVertical()?[38]:[]),i=[39].concat(t.allowVertical()?[40]:[]);return[Wi(Hi(o),Xu(wu(Yu,Ku))),Wi(Hi(i),Xu(xu(Yu,Ku))),Wi(Hi([13]),qu),Wi(Hi([32]),qu)]},Ju,Qu,M.some(function(e,t){t.getInitial()(e).or(Fi(e.element(),t.selector())).each(function(n){t.focusManager().set(e,n)})})),nc=Ce(["rowIndex","columnIndex","cell"],[]),ec=function(n,e,t){return M.from(n[e]).bind(function(n){return M.from(n[t]).map(function(n){return nc({rowIndex:e,columnIndex:t,cell:n})})})},tc=function(n,e,t,r){var o=n[e].length,i=Ui(t,r,0,o-1);return ec(n,e,i)},rc=function(n,e,t,r){var o=Ui(t,r,0,n.length-1),i=n[o].length,u=Gi(e,0,i-1);return ec(n,o,u)},oc=function(n,e,t,r){var o=n[e].length,i=Gi(t+r,0,o-1);return ec(n,e,i)},ic=function(n,e,t,r){var o=Gi(t+r,0,n.length-1),i=n[o].length,u=Gi(e,0,i-1);return ec(n,o,u)},uc=[nr("selectors",[Jt("row"),Jt("cell")]),or("cycles",!0),or("previousSelector",M.none),or("execute",su)],cc=function(n,e){return function(t,r,i){var u=i.cycles()?n:e;return Ri(r,i.selectors().row()).bind(function(n){var e=Ii(n,i.selectors().cell());return Au(e,r).bind(function(r){var o=Ii(t,i.selectors().row());return Au(o,n).bind(function(n){var e,t=(e=i,yn(o,function(n){return Ii(n,e.selectors().cell())}));return u(t,n,r).map(function(n){return n.cell()})})})})}},ac=cc(function(n,e,t){return tc(n,e,t,-1)},function(n,e,t){return oc(n,e,t,-1)}),sc=cc(function(n,e,t){return tc(n,e,t,1)},function(n,e,t){return oc(n,e,t,1)}),fc=cc(function(n,e,t){return rc(n,t,e,-1)},function(n,e,t){return ic(n,t,e,-1)}),lc=cc(function(n,e,t){return rc(n,t,e,1)},function(n,e,t){return ic(n,t,e,1)}),dc=I([Wi(Hi([37]),wu(ac,sc)),Wi(Hi([39]),xu(ac,sc)),Wi(Hi([38]),Ou(fc)),Wi(Hi([40]),ku(lc)),Wi(Hi([32].concat([13])),function(e,t,r){return vo(e.element()).bind(function(n){return r.execute()(e,t,n)})})]),mc=I({}),gc=I({}),pc=ou(uc,Vr.init,dc,mc,gc,M.some(function(e,t){t.previousSelector()(e).orThunk(function(){var n=t.selectors();return Fi(e.element(),n.cell())}).each(function(n){t.focusManager().set(e,n)})})),vc=[Jt("selector"),or("execute",su),or("moveOnTab",!1)],hc=function(e,t,r){return r.focusManager().get(e).bind(function(n){return r.execute()(e,t,n)})},yc=function(n,e,t){return Uu(n,t.selector(),e,-1)},bc=function(n,e,t){return Uu(n,t.selector(),e,1)},wc=I([Wi(Hi([38]),Cu(yc)),Wi(Hi([40]),Cu(bc)),Wi(zi([Li,Hi([9])]),function(n,e,t){return t.moveOnTab()?Cu(yc)(n,e,t):M.none()}),Wi(zi([$i,Hi([9])]),function(n,e,t){return t.moveOnTab()?Cu(bc)(n,e,t):M.none()}),Wi(Hi([13]),hc),Wi(Hi([32]),hc)]),xc=I({}),Tc=I({}),Sc=ou(vc,Vr.init,wc,xc,Tc,M.some(function(e,t){Fi(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Oc=[Ho("onSpace"),Ho("onEnter"),Ho("onShiftEnter"),Ho("onLeft"),Ho("onRight"),Ho("onTab"),Ho("onShiftTab"),Ho("onUp"),Ho("onDown"),Ho("onEscape"),er("focusIn")],kc=ou(Oc,Vr.init,function(n,e,t){return[Wi(Hi([32]),t.onSpace()),Wi(zi([$i,Hi([13])]),t.onEnter()),Wi(zi([Li,Hi([13])]),t.onShiftEnter()),Wi(zi([Li,Hi([9])]),t.onShiftTab()),Wi(zi([$i,Hi([9])]),t.onTab()),Wi(Hi([38]),t.onUp()),Wi(Hi([40]),t.onDown()),Wi(Hi([37]),t.onLeft()),Wi(Hi([39]),t.onRight()),Wi(Hi([32]),t.onSpace()),Wi(Hi([27]),t.onEscape())]},function(){return{}},function(){return{}},M.some(function(e,t){return t.focusIn().bind(function(n){return n(e,t)})})),Cc=uu.schema(),Ec=cu.schema(),Dc=Zu.schema(),_c=Wu.schema(),Ic=pc.schema(),Ac=gu.schema(),Mc=Sc.schema(),Fc=kc.schema(),Rc=(ki=Ut("Creating behaviour: "+(Oi={branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Cc,cyclic:Ec,flow:Dc,flatgrid:_c,matrix:Ic,execution:Ac,menu:Mc,special:Fc}),name:"keying",active:{events:function(n,e){return n.handler().toEvents(n,e)}},apis:{focusIn:function(n){n.getSystem().triggerFocus(n.element(),n.element())},setGridSize:function(n,e,t,r,o){xt(t,"setGridSize")?t.setGridSize(r,o):p.console.error("Layout does not support setGridSize")}},state:vu}).name,Lr,Oi),Er(Yt(ki.branchKey,ki.branches),ki.name,ki.active,ki.apis,ki.extra,ki.state)),Bc=function(r,n){return e=r,t={},o=yn(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,jt(e,e,rt(),Mt(function(n){return Qe.error("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([ur("dump",h)]),jt(e,e,et(t),Rt(o));var e,t,o},Vc=function(n){return n.dump()},Nc="placeholder",jc=Ze([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Hc=function(n,e,t,r){return t.uiType===Nc?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?jc.single(!0,I(i)):ht(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+F(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+kt(i,null,2))},function(n){return n.replace()})):jc.single(!1,I(t));var o,i,u},zc=function(i,u,c,a){return Hc(i,0,c,a).fold(function(n,e){var t=e(u,c.config,c.validated),r=ht(t,"components").getOr([]),o=Cn(r,function(n){return zc(i,u,n,a)});return[k(t,{components:o})]},function(n,e){return e(u,c.config,c.validated)})},Lc=function(e,t,n,r){var o,i,u,c=B(r,function(n,e){return r=n,o=!1,{name:I(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(!0===o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),a=(o=e,i=t,u=c,Cn(n,function(n){return zc(o,i,n,u)}));return R(c,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+kt(t.components(),null,2))}),a},Pc=jc.single,$c=jc.multiple,Wc=I(Nc),Uc=0,Gc=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Uc+String(e)},qc=Ze([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Yc=or("factory",{sketch:h}),Kc=or("schema",[]),Xc=Jt("name"),Jc=jt("pname","pname",ot(function(n){return"<alloy."+Gc(n.name)+">"}),Kt()),Qc=or("defaults",I({})),Zc=or("overrides",I({})),na=Rt([Yc,Kc,Xc,Jc,Qc,Zc]),ea=Rt([Yc,Kc,Xc,Jc,Qc,Zc]),ta=Rt([Yc,Kc,Xc,Jt("unit"),Jc,Qc,Zc]),ra=function(n){var e=function(n){return n.name()};return n.fold(e,e,e,e)},oa=function(t,r){return function(n){var e=Gt("Converting part type",r,n);return t(e)}},ia=oa(qc.required,na),ua=oa(qc.optional,ea),ca=oa(qc.group,ta),aa=I("entirety"),sa=function(n,e,t,r){var o=t;return k(e.defaults()(n,t,r),t,{uid:n.partUids()[e.name()]},e.overrides()(n,t,r),{"debug.sketcher":yt("part-"+e.name(),o)})},fa=function(o,n){var i={};return bn(n,function(n){var e;(e=n,e.fold(M.some,M.none,M.some,M.some)).each(function(t){var r=la(o,t.pname());i[t.name()]=function(n){var e=Ut("Part: "+t.name()+" in "+o,Rt(t.schema()),n);return k(r,{config:n,validated:e})}})}),i},la=function(n,e){return{uiType:Wc(),owner:n,name:e}},da=function(n,e,t){return r=e,i={},o={},bn(t,function(n){n.fold(function(r){i[r.pname()]=Pc(!0,function(n,e,t){return r.factory().sketch(sa(n,r,e,t))})},function(n){var e=r.parts()[n.name()]();o[n.name()]=I(sa(r,n,e[aa()]()))},function(r){i[r.pname()]=Pc(!1,function(n,e,t){return r.factory().sketch(sa(n,r,e,t))})},function(o){i[o.pname()]=$c(!0,function(e,n,t){var r=e[o.name()]();return yn(r,function(n){return o.factory().sketch(k(o.defaults()(e,n),n,o.overrides()(e,n)))})})})}),{internals:I(i),externals:I(o)};var r,i,o},ma=function(n,e,t){return Lc(M.some(n),e,e.components(),t)},ga=function(n,e,t){var r=e.partUids()[t];return n.getSystem().getByUid(r).toOption()},pa=function(n,e,t){return ga(n,e,t).getOrDie("Could not find part: "+t)},va=function(e,n){var t=yn(n,ra);return bt(yn(t,function(n){return{key:n,value:e+"-"+n}}))},ha=function(e){return jt("partUids","partUids",it(function(n){return va(n.uid,e)}),Kt())},ya=Gc("alloy-premade"),ba=Gc("api"),wa=function(n){return yt(ya,n)},xa=function(o){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var r=n.config(ba);return o.apply(undefined,[r].concat([n].concat(e)))},e=o.toString(),t=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:wr(i.slice(1))}},n;var n,e,t,r,i},Ta=I(ba),Sa=I("alloy-id-"),Oa=I("data-alloy-id"),ka=Sa(),Ca=Oa(),Ea=function(n){var e=pe(n)?Gr(n,Ca):null;return M.from(e)},Da=function(n){return Gc(n)},_a=function(n,e,t,r,o){var i,u,c=(u=o,(0<(i=r).length?[nr("parts",i)]:[]).concat([Jt("uid"),or("dom",{}),or("components",[]),$o("originalSpec"),or("debug.sketcher",{})]).concat(u));return Gt(n+" [SpecSchema]",Ft(c.concat(e)),t)},Ia=function(n,e,t,r,o){var i=Aa(o),u=Cn(t,function(n){return n.fold(M.none,M.some,M.none,M.none).map(function(n){return nr(n.name(),n.schema().concat([$o(aa())]))}).toArray()}),c=ha(t),a=_a(n,e,i,u,[c]),s=da(0,a,t),f=ma(n,a,s.internals());return k(r(a,f,i,s.externals()),{"debug.sketcher":yt(n,o)})},Aa=function(n){return k({uid:Da("uid")},n)},Ma=Ft([Jt("name"),Jt("factory"),Jt("configFields"),or("apis",{}),or("extraApis",{})]),Fa=Ft([Jt("name"),Jt("factory"),Jt("configFields"),Jt("partFields"),or("apis",{}),or("extraApis",{})]),Ra=function(n){var c=Ut("Sketcher for "+n.name,Ma,n),e=B(c.apis,xa),t=B(c.extraApis,function(n,e){return xr(n,e)});return k({name:I(c.name),partFields:I([]),configFields:I(c.configFields),sketch:function(n){return e=c.name,t=c.configFields,r=c.factory,i=Aa(o=n),u=_a(e,t,i,[],[]),k(r(u,i),{"debug.sketcher":yt(e,o)});var e,t,r,o,i,u}},e,t)},Ba=function(n){var e=Ut("Sketcher for "+n.name,Fa,n),t=fa(e.name,e.partFields),r=B(e.apis,xa),o=B(e.extraApis,function(n,e){return xr(n,e)});return k({name:I(e.name),partFields:I(e.partFields),configFields:I(e.configFields),sketch:function(n){return Ia(e.name,e.configFields,e.partFields,e.factory,n)},parts:I(t)},r,o)},Va=Ra({name:"Button",factory:function(n){var e,t,r,o=(e=n.action(),t=function(n,e){e.stop(),te(n)},r=zn.detect().deviceType.isTouch()?[lr(qn(),t)]:[lr(Y(),t),lr(L(),function(n,e){e.cut()})],sr(kn([e.map(function(t){return lr(Un(),function(n,e){t(n),e.stop()})}).toArray(),r]))),i=ht(n.dom(),"attributes").bind(pt("type")),u=ht(n.dom(),"tag");return{uid:n.uid(),dom:n.dom(),components:n.components(),events:o,behaviours:k(jr([mi.config({}),Rc.config({mode:"execution",useSpace:!0,useEnter:!0})]),Vc(n.buttonBehaviours())),domModification:{attributes:k(i.fold(function(){return u.is("button")?{type:"button"}:{}},function(n){return{}}),{role:n.role().getOr("button")})},eventOrder:n.eventOrder()}},configFields:[or("uid",undefined),Jt("dom"),or("components",[]),Bc("buttonBehaviours",[mi,Rc]),er("action"),er("role"),or("eventOrder",{})]}),Na=zr({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(n){return sr([fr(X(),I(!0))])},exhibit:function(n,e){return Or({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),ja=function(n){var e,t,r,o=ue.fromHtml(n),i=Ne(o),u=(t=(e=o).dom().attributes!==undefined?e.dom().attributes:[],Tn(t,function(n,e){return"class"===e.name?n:k(n,yt(e.name,e.value))},{})),c=(r=o,Array.prototype.slice.call(r.dom().classList,0)),a=0===i.length?{}:{innerHtml:xo(o)};return k({tag:me(o),classes:c,attributes:u},a)},Ha=function(n){var e,o,t=(e=n,o={prefix:ai.prefix()},e.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r.toString():n}));return ja(t)},za=function(n){return{dom:Ha(n)}},La=function(n){return jr([ri.config({toggleClass:ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),oi(n,function(n,e){(e?ri.on:ri.off)(n)})])},Pa=function(n,e,t){return Va.sketch({dom:Ha('<span class="${prefix}-toolbar-button ${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:e,buttonBehaviours:k(jr([Na.config({})]),t)})},$a={forToolbar:Pa,forToolbarCommand:function(n,e){return Pa(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,r){var o=La(t);return Pa(e,r,o)},forToolbarStateCommand:function(n,e){var t=La(e);return Pa(e,function(){n.execCommand(e)},t)}},Wa=function(t,r){return{left:I(t),top:I(r),translate:function(n,e){return Wa(t+n,r+e)}}},Ua=Wa,Ga=function(n,e,t){return Math.max(e,Math.min(t,n))},qa=function(n,e,t,r,o,i,u){var c=t-e;if(r<n.left)return e-1;if(r>n.right)return t+1;var a,s,f,l,d=Math.min(n.right,Math.max(r,n.left))-n.left,m=Ga(d/n.width*c+e,e-1,t+1),g=Math.round(m);return i&&e<=m&&m<=t?(a=m,s=e,f=t,l=o,u.fold(function(){var n=a-s,e=Math.round(n/l)*l;return Ga(s+e,s-1,f+1)},function(n){var e=(a-n)%l,t=Math.round(e/l),r=Math.floor((a-n)/l),o=Math.floor((f-n)/l),i=n+Math.min(o,r+t)*l;return Math.max(n,i)})):g},Ya="slider.change.value",Ka=zn.detect().deviceType.isTouch(),Xa=function(n){return function(n){var e=n.event().raw();if(Ka){var t=e;return t.touches!==undefined&&1===t.touches.length?M.some(t.touches[0]).map(function(n){return Ua(n.clientX,n.clientY)}):M.none()}var r=e;return r.clientX!==undefined?M.some(r).map(function(n){return Ua(n.clientX,n.clientY)}):M.none()}(n).map(function(n){return n.left()})},Ja=function(n,e){ee(n,Ya,{value:e})},Qa=function(i,u,c,n){return Xa(n).map(function(n){var e,t,r,o;return e=i,r=n,o=qa(c,(t=u).min(),t.max(),r,t.stepSize(),t.snapToGrid(),t.snapStart()),Ja(e,o),n})},Za=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),t<r?t:o<t?o:t===r?r-1:Math.max(r,t-i));Ja(n,u)},ns=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),o<t?t:t<r?r:t===o?o+1:Math.min(o,t+i));Ja(n,u)},es=zn.detect().deviceType.isTouch(),ts=function(n,r){return ua({name:n+"-edge",overrides:function(n){var e=sr([dr(j(),r,[n])]),t=sr([dr(L(),r,[n]),dr(P(),function(n,e){e.mouseIsDown().get()&&r(n,e)},[n])]);return{events:es?e:t}}})},rs=[ts("left",function(n,e){Ja(n,e.min()-1)}),ts("right",function(n,e){Ja(n,e.max()+1)}),ia({name:"thumb",defaults:I({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:sr([gr(j(),n,"spectrum"),gr(H(),n,"spectrum"),gr(z(),n,"spectrum")])}}}),ia({schema:[ur("mouseIsDown",function(){return ao(!1)})],name:"spectrum",overrides:function(r){var t=function(n,e){var t=n.element().dom().getBoundingClientRect();Qa(n,r,t,e)},n=sr([lr(j(),t),lr(H(),t)]),e=sr([lr(L(),t),lr(P(),function(n,e){r.mouseIsDown().get()&&t(n,e)})]);return{behaviours:jr(es?[]:[Rc.config({mode:"special",onLeft:function(n){return Za(n,r),M.some(!0)},onRight:function(n){return ns(n,r),M.some(!0)}}),mi.config({})]),events:es?n:e}}})],os=function(n,e,t){e.store().manager().onLoad(n,e,t)},is=function(n,e,t){e.store().manager().onUnload(n,e,t)},us=Object.freeze({__proto__:null,onLoad:os,onUnload:is,setValue:function(n,e,t,r){e.store().manager().setValue(n,e,t,r)},getValue:function(n,e,t){return e.store().manager().getValue(n,e,t)}}),cs=Object.freeze({__proto__:null,events:function(t,r){var n=t.resetOnDom()?[vr(function(n,e){os(n,t,r)}),hr(function(n,e){is(n,t,r)})]:[Cr(t,r,os)];return sr(n)}}),as=function(){var n=ao(null);return Nr({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},ss=function(){var n=ao({});return Nr({readState:function(){return{mode:"dataset",dataset:n.get()}},set:n.set,get:n.get})},fs=Object.freeze({__proto__:null,memory:as,dataset:ss,manual:function(){return Nr({readState:function(){}})},init:function(n){return n.store().manager().state(n)}}),ls=function(n,e,t,r){e.store().getDataKey(),t.set({}),e.store().setData()(n,r),e.onSetValue()(n,r)},ds=[er("initialValue"),Jt("getFallbackEntry"),Jt("getDataKey"),Jt("setData"),Po("manager",{setValue:ls,getValue:function(n,e,t){var r=e.store().getDataKey()(n),o=t.get();return ht(o,r).fold(function(){return e.store().getFallbackEntry()(r)},function(n){return n})},onLoad:function(e,t,r){t.store().initialValue().each(function(n){ls(e,t,r,n)})},onUnload:function(n,e,t){t.set({})},state:ss})],ms=[Jt("getValue"),or("setValue",_),er("initialValue"),Po("manager",{setValue:function(n,e,t,r){e.store().setValue()(n,r),e.onSetValue()(n,r)},getValue:function(n,e,t){return e.store().getValue()(n)},onLoad:function(e,t,n){t.store().initialValue().each(function(n){t.store().setValue()(e,n)})},onUnload:_,state:Vr.init})],gs=[er("initialValue"),Po("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue()(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store().initialValue().each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:as})],ps=[ir("store",{mode:"memory"},Yt("mode",{memory:gs,manual:ms,dataset:ds})),jo("onSetValue"),or("resetOnDom",!1)],vs=zr({fields:ps,name:"representing",active:cs,apis:us,extra:{setValueFrom:function(n,e){var t=vs.getValue(e);vs.setValue(n,t)}},state:fs}),hs=zn.detect().deviceType.isTouch(),ys=[Jt("min"),Jt("max"),or("stepSize",1),or("onChange",_),or("onInit",_),or("onDragStart",_),or("onDragEnd",_),or("snapToGrid",!1),er("snapStart"),Jt("getInitialValue"),Bc("sliderBehaviours",[Rc,vs]),ur("value",function(n){return ao(n.min)})].concat(hs?[]:[ur("mouseIsDown",function(){return ao(!1)})]),bs=Si("width",function(n){return n.dom().offsetWidth}),ws=function(n,e){bs.set(n,e)},xs=function(n){return bs.get(n)},Ts=zn.detect().deviceType.isTouch(),Ss=Ba({name:"Slider",configFields:ys,partFields:rs,factory:function(a,n,e,t){var s=a.max()-a.min(),f=function(n){var e=n.element().dom().getBoundingClientRect();return(e.left+e.right)/2},o=function(n){return pa(n,a,"thumb")},i=function(n){var e,t,r,o,i=pa(n,a,"spectrum").element().dom().getBoundingClientRect(),u=n.element().dom().getBoundingClientRect(),c=(e=n,t=i,(o=(r=a).value().get())<r.min()?ga(e,r,"left-edge").fold(function(){return 0},function(n){return f(n)-t.left}):o>r.max()?ga(e,r,"right-edge").fold(function(){return t.width},function(n){return f(n)-t.left}):(r.value().get()-r.min())/s*t.width);return i.left-u.left+c},u=function(n){var e=i(n),t=o(n),r=xs(t.element())/2;vi(t.element(),"left",e-r+"px")},r=function(n,e){var t=a.value().get(),r=o(n);return t!==e||wi(r.element(),"left").isNone()?(a.value().set(e),u(n),a.onChange()(n,r,e),M.some(!0)):M.none()},c=Ts?[lr(j(),function(n,e){a.onDragStart()(n,o(n))}),lr(z(),function(n,e){a.onDragEnd()(n,o(n))})]:[lr(L(),function(n,e){e.stop(),a.onDragStart()(n,o(n)),a.mouseIsDown().set(!0)}),lr($(),function(n,e){a.onDragEnd()(n,o(n)),a.mouseIsDown().set(!1)})];return{uid:a.uid(),dom:a.dom(),components:n,behaviours:k(jr(kn([Ts?[]:[Rc.config({mode:"special",focusIn:function(n){return ga(n,a,"spectrum").map(Rc.focusIn).map(I(!0))}})],[vs.config({store:{mode:"manual",getValue:function(n){return a.value().get()}}})]])),Vc(a.sliderBehaviours())),events:sr([lr(Ya,function(n,e){r(n,e.event().value())}),vr(function(n,e){a.value().set(a.getInitialValue()());var t=o(n);u(n),a.onInit()(n,t,a.value().get())})].concat(c)),apis:{resetToMin:function(n){r(n,a.min())},resetToMax:function(n){r(n,a.max())},refresh:u},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Os=function(e,t,r){return $a.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{})},ks=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},Ss.sketch({dom:Ha('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Ss.parts()["left-edge"](za('<div class="${prefix}-hue-slider-black"></div>')),Ss.parts().spectrum({dom:Ha('<div class="${prefix}-slider-gradient-container"></div>'),components:[za('<div class="${prefix}-slider-gradient"></div>')],behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])}),Ss.parts()["right-edge"](za('<div class="${prefix}-hue-slider-white"></div>')),Ss.parts().thumb({dom:Ha('<div class="${prefix}-slider-thumb"></div>'),behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t);vi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){ri.on(e)},onDragEnd:function(n,e){ri.off(e)},onInit:function(n,e,t){var r=i(t);vi(e.element(),"background-color",r)},stepSize:10,min:0,max:360,getInitialValue:o.getInitialValue,sliderBehaviours:jr([ii(Ss.refresh)])}))];var o,i},Cs=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Os(n,"color",function(){return ks(e)})},Es=Ft([Jt("getInitialValue"),Jt("onChange"),Jt("category"),Jt("sizes")]),Ds=function(n){var o=Ut("SizeSlider",Es,n);return Ss.sketch({dom:{tag:"div",classes:[ai.resolve("slider-"+o.category+"-size-container"),ai.resolve("slider"),ai.resolve("slider-size-container")]},onChange:function(n,e,t){var r;0<=(r=t)&&r<o.sizes.length&&o.onChange(t)},onDragStart:function(n,e){ri.on(e)},onDragEnd:function(n,e){ri.off(e)},min:0,max:o.sizes.length-1,stepSize:1,getInitialValue:o.getInitialValue,snapToGrid:!0,sliderBehaviours:jr([ii(Ss.refresh)]),components:[Ss.parts().spectrum({dom:Ha('<div class="${prefix}-slider-size-container"></div>'),components:[za('<div class="${prefix}-slider-size-line"></div>')]}),Ss.parts().thumb({dom:Ha('<div class="${prefix}-slider-thumb"></div>'),behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])})]})},_s=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Is=function(n){var e,t,r=n.selection.getStart(),o=ue.fromDom(r),i=ue.fromDom(n.getBody()),u=(e=function(n){return Fe(i,n)},(pe(t=o)?M.some(t):Ve(t).filter(pe)).map(function(n){return lo(n,function(n){return wi(n,"font-size").isSome()},e).bind(function(n){return wi(n,"font-size")}).getOrThunk(function(){return yi(n,"font-size")})}).getOr(""));return Sn(_s,function(n){return u===n}).getOr("medium")},As={candidates:I(_s),get:function(n){var e,t=Is(n);return(e=t,On(_s,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,M.from(_s[e])).each(function(n){var e,t;t=n,Is(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},Ms=As.candidates(),Fs=function(n){return[za('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Ds({onChange:e.onChange,sizes:Ms,category:"font",getInitialValue:e.getInitialValue})),za('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},Rs=function(n){var e=n.uid!==undefined&&xt(n,"uid")?n.uid:Da("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(M.none,M.some)},asSpec:function(){return k(n,{uid:e})}}},Bs=window.Promise?window.Promise:function(){var i=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(n,r(o,this),r(c,this))},n=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){p.setTimeout(n,1)};function r(n,e){return function(){return n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function u(r){var o=this;null!==this._state?n(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void f(r(e,n),r(o,this),r(c,this))}this._state=!0,this._value=n,a.call(this)}catch(t){c.call(this,t)}}function c(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds;n<e.length;n++){var t=e[n];u.call(this,t)}this._deferreds=[]}function s(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function f(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}return i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(t,r){var o=this;return new i(function(n,e){u.call(o,new s(t,r,n,e))})},i.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=Array.prototype.slice.call(1===n.length&&t(n[0])?n[0]:n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(n){n(e)})},i.reject=function(t){return new i(function(n,e){e(t)})},i.race=function(o){return new i(function(n,e){for(var t=0,r=o;t<r.length;t++)r[t].then(n,e)})},i}();function Vs(n){return(t=n,new Bs(function(n){var e=new p.FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})).then(function(n){return n.split(",")[1]});var t}var Ns,js,Hs,zs,Ls,Ps,$s=function(o,i){var n;(n=i,Vs(n)).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Gc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})},Ws=function(i){var e=Rs({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:sr([pr(Y()),lr(q(),function(n,e){var t,r,o;(t=e,r=t.event(),o=r.raw().target.files||r.raw().dataTransfer.files,M.from(o[0])).each(function(n){$s(i,n)})})])});return Va.sketch({dom:Ha('<span class="${prefix}-toolbar-button ${prefix}-icon-image ${prefix}-icon"></span>'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},Us=function(n){return n.dom().textContent},Gs=function(n){return 0<n.length},qs=function(n){return n===undefined||null===n?"":n},Ys=function(e,t,n){return n.text.filter(Gs).fold(function(){return Gr(n=e,"href")===Us(n)?M.some(t):M.none();var n},M.some)},Ks=function(n){var e=ue.fromDom(n.selection.getStart());return Ri(e,"a")},Xs={getInfo:function(n){return Ks(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:M.none()}},function(n){return t=Us(e=n),r=Gr(e,"href"),o=Gr(e,"title"),i=Gr(e,"target"),{url:qs(r),text:t!==r?qs(t):"",title:qs(o),target:qs(i),link:M.some(e)};var e,t,r,o,i})},applyInfo:function(o,i){i.url.filter(Gs).fold(function(){var e;e=o,i.link.bind(h).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.filter(Gs).each(function(n){t.title=n}),n.target.filter(Gs).each(function(n){t.target=n}),t);i.link.bind(h).fold(function(){var n=i.text.filter(Gs).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=Ys(t,e,i);Ur(t,r),n.each(function(n){var e;e=n,t.dom().textContent=e})})})},query:Ks},Js=zn.detect(),Qs=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},Zs=function(n,e){(Js.os.isAndroid()?Qs:a)(e,n)},nf=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=sr(e),zr({fields:[Jt("enabled")],name:t,active:{events:I(r)}})),configAsRaw:I({}),initialConfig:{},state:Vr}}},ef=Object.freeze({__proto__:null,getCurrent:function(n,e,t){return e.find()(n)}}),tf=[Jt("find")],rf=zr({fields:tf,name:"composing",apis:ef}),of=Ra({name:"Container",factory:function(n){return{uid:n.uid(),dom:k({tag:"div",attributes:{role:"presentation"}},n.dom()),components:n.components(),behaviours:Vc(n.containerBehaviours()),events:n.events(),domModification:n.domModification(),eventOrder:n.eventOrder()}},configFields:[or("components",[]),Bc("containerBehaviours",[]),or("events",{}),or("domModification",{}),or("eventOrder",{})]}),uf=Ra({name:"DataField",factory:function(t){return{uid:t.uid(),dom:t.dom(),behaviours:k(jr([vs.config({store:{mode:"memory",initialValue:t.getInitialValue()()}}),rf.config({find:M.some})]),Vc(t.dataBehaviours())),events:sr([vr(function(n,e){vs.setValue(n,t.getInitialValue()())})])}},configFields:[Jt("uid"),Jt("dom"),Jt("getInitialValue"),Bc("dataBehaviours",[vs,rf])]}),cf=function(n){return n.dom().value},af=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},sf=I([er("data"),or("inputAttributes",{}),or("inputStyles",{}),or("type","input"),or("tag","input"),or("inputClasses",[]),jo("onSetValue"),or("styles",{}),er("placeholder"),or("eventOrder",{}),Bc("inputBehaviours",[vs,mi]),or("selectOnFocus",!0)]),ff=function(n){return k(jr([vs.config({store:{mode:"manual",initialValue:n.data().getOr(undefined),getValue:function(n){return cf(n.element())},setValue:function(n,e){cf(n.element())!==e&&af(n.element(),e)}},onSetValue:n.onSetValue()})]),(e=n,jr([mi.config({onFocus:!1===e.selectOnFocus()?_:function(n){var e=n.element(),t=cf(e);e.dom().setSelectionRange(0,t.length)}})])),Vc(n.inputBehaviours()));var e},lf=Ra({name:"Input",configFields:sf(),factory:function(n,e){return{uid:n.uid(),dom:(t=n,{tag:t.tag(),attributes:k(bt([{key:"type",value:t.type()}].concat(t.placeholder().map(function(n){return{key:"placeholder",value:n}}).toArray())),t.inputAttributes()),styles:t.inputStyles(),classes:t.inputClasses()}),components:[],behaviours:ff(n),eventOrder:n.eventOrder()};var t}}),df=Object.freeze({__proto__:null,exhibit:function(n,e){return Or({attributes:bt([{key:e.tabAttr(),value:"true"}])})}}),mf=[or("tabAttr","data-alloy-tabstop")],gf=zr({fields:mf,name:"tabstopping",active:df}),pf=function(n,e){var t=Rs(lf.sketch({placeholder:e,onSetValue:function(n,e){ne(n,G())},inputBehaviours:jr([rf.config({find:M.some}),gf.config({}),Rc.config({mode:"execution"})]),selectOnFocus:!1})),r=Rs(Va.sketch({dom:Ha('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);vs.setValue(e,"")}}));return{name:n,spec:of.sketch({dom:Ha('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:jr([ri.config({toggleClass:ai.resolve("input-container-empty")}),rf.config({find:function(n){return M.some(t.get(n))}}),nf("input-clearing",[lr(G(),function(n){var e=t.get(n);(0<vs.getValue(e).length?ri.off:ri.on)(n)})])])})}},vf=["input","button","textarea"],hf=function(n,e,t){e.disabled()&&Sf(n,e)},yf=function(n){return hn(vf,me(n.element()))},bf=function(n){Wr(n.element(),"disabled","disabled")},wf=function(n){Yr(n.element(),"disabled")},xf=function(n){Wr(n.element(),"aria-disabled","true")},Tf=function(n){Wr(n.element(),"aria-disabled","false")},Sf=function(e,n,t){n.disableClass().each(function(n){no(e.element(),n)}),(yf(e)?bf:xf)(e)},Of=function(n){return yf(n)?qr(n.element(),"disabled"):"true"===Gr(n.element(),"aria-disabled")},kf=Object.freeze({__proto__:null,enable:function(e,n,t){n.disableClass().each(function(n){eo(e.element(),n)}),(yf(e)?wf:Tf)(e)},disable:Sf,isDisabled:Of,onLoad:hf}),Cf=Object.freeze({__proto__:null,exhibit:function(n,e,t){return Or({classes:e.disabled()?e.disableClass().map(_n).getOr([]):[]})},events:function(n,e){return sr([fr(Un(),function(n,e){return Of(n)}),Cr(n,e,hf)])}}),Ef=[or("disabled",!1),er("disableClass")],Df=zr({fields:Ef,name:"disabling",active:Cf,apis:kf}),_f=[Bc("formBehaviours",[vs])],If=function(n){return"<alloy.field."+n+">"},Af=function(o,n,e){return k({"debug.sketcher":{Form:e},uid:o.uid(),dom:o.dom(),components:n,behaviours:k(jr([vs.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),B(e.partUids(),function(n,e){return I(t.getByUid(n))}));return B(r,function(n,e){return n().bind(rf.getCurrent).map(vs.getValue)})},setValue:function(t,n){R(n,function(e,n){ga(t,o,n).each(function(n){rf.getCurrent(n).each(function(n){vs.setValue(n,e)})})})}}})]),Vc(o.formBehaviours())),apis:{getField:function(n,e){return ga(n,o,e).bind(rf.getCurrent)}}})},Mf=(xa(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=If(n),o=e,{uiType:Wc(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=yn(r,function(n){return ia({name:n,pname:If(n)})});return Ia("form",_f,o,Af,t)}),Ff=function(){var e=ao(M.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(M.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(M.some(n))},run:function(n){e.get().each(n)}}},Rf=function(){var e=ao(M.none());return{clear:function(){e.set(M.none())},set:function(n){e.set(M.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Bf=function(n){return{xValue:n,points:[]}},Vf=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}},Nf=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},jf=function(n){var r="navigateEvent",e=Rt([Jt("fields"),or("maxFieldIndex",n.fields.length-1),Jt("onExecute"),Jt("getInitialValue"),ur("state",function(){return{dialogSwipeState:Rf(),currentScreen:ao(0)}})]),u=Ut("SerialisedDialog",e,n),o=function(e,n,t){return Va.sketch({dom:Ha('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ee(n,r,{direction:e})},buttonBehaviours:jr([Df.config({disableClass:ai.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=Ii(n.element(),"."+ai.resolve("serialised-dialog-screen"));Fi(n.element(),"."+ai.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(wi(r,"left").each(function(n){var e=parseInt(n,10),t=xs(i[0]);vi(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},c=function(r){var n=Ii(r.element(),"input");M.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=s.get(r);tu.highlightAt(e,u.state.currentScreen.get())},a=Rs(Mf(function(t){return{dom:Ha('<div class="${prefix}-serialised-dialog"></div>'),components:[of.sketch({dom:Ha('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:yn(u.fields,function(n,e){return e<=u.maxFieldIndex?of.sketch({dom:Ha('<div class="${prefix}-serialised-dialog-screen"></div>'),components:kn([[o(-1,"previous",0<e)],[t.field(n.name,n.spec)],[o(1,"next",e<u.maxFieldIndex)]])}):t.field(n.name,n.spec)})})],formBehaviours:jr([ii(function(n,e){var t;t=e,Fi(n.element(),"."+ai.resolve("serialised-dialog-chain")).each(function(n){vi(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),Rc.config({mode:"special",focusIn:function(n){c(n)},onTab:function(n){return i(n,1),M.some(!0)},onShiftTab:function(n){return i(n,-1),M.some(!0)}}),nf("form-events",[vr(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=s.get(e);tu.highlightFirst(t),u.getInitialValue(e).each(function(n){vs.setValue(e,n)})}),br(u.onExecute),lr(K(),function(n,e){"left"===e.event().raw().propertyName&&c(n)}),lr(r,function(n,e){var t=e.event().direction();i(n,t)})])])}})),s=Rs({dom:Ha('<div class="${prefix}-dot-container"></div>'),behaviours:jr([tu.config({highlightClass:ai.resolve("dot-active"),itemClass:ai.resolve("dot-item")})]),components:Cn(u.fields,function(n,e){return e<=u.maxFieldIndex?[za('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Ha('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),s.asSpec()],behaviours:jr([Rc.config({mode:"special",focusIn:function(n){var e=a.get(n);Rc.focusIn(e)}}),nf("serializer-wrapper-events",[lr(j(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(Bf(t.touches[0].clientX))}),lr(H(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(Vf(n,t.raw().touches[0].clientX))})}),lr(z(),function(r){u.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*Nf(n);i(e,t)})})])])}},Hf=J(function(t,r){return[{label:"the link group",items:[jf({fields:[pf("url","Type or paste URL"),pf("text","Link text"),pf("title","Link title"),pf("target","Link target"),(n="link",{name:n,spec:uf.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return M.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return M.some(Xs.getInfo(r))},onExecute:function(n){var e=vs.getValue(n);Xs.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),zf=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Lf=sr([(Ns=Pn(),js=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(Fe(t=o,n.element())&&!Fe(t,r)&&(p.console.warn(Pn()+" did not get interpreted by the desired target. \nOriginator: "+ko(o)+"\nTarget: "+ko(i)+"\nCheck the "+Pn()+" event handlers"),1))},{key:Ns,value:cr({can:js})})]),Pf=Object.freeze({__proto__:null,events:Lf}),$f=h,Wf=Br(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),Uf=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+ko(e().element())+" is not in context.")}};return Wf({debugInfo:I("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),isConnected:I(!1)})},Gf=function(n,o){var i={};return R(n,function(n,r){R(n,function(n,e){var t=vt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},qf=function(n,e){return 1<n.length?Qe.error('Multiple behaviours have tried to change DOM "'+e+'". The guilty behaviours are: '+kt(yn(n,function(n){return n.name()}))+". At this stage, this is not supported. Future releases might provide strategies for resolving this."):0===n.length?Qe.value({}):Qe.value(n[0].modification().fold(function(){return{}},function(n){return yt(e,n)}))},Yf=function(u,c){return Tn(u,function(n,e){var t=e.modification().getOr({});return n.bind(function(i){var n=N(t,function(n,e){return i[e]!==undefined?(t=c,r=e,o=u,Qe.error("Mulitple behaviours have tried to change the _"+r+'_ "'+t+'". The guilty behaviours are: '+kt(Cn(o,function(n){return n.modification().getOr({})[r]!==undefined?[n.name()]:[]}),null,2)+". This is not currently supported.")):Qe.value(yt(e,n));var t,r,o});return wt(n,i)})},Qe.value({})).map(function(n){return yt(c,n)})},Kf={classes:function(n,e){var t=Cn(n,function(n){return n.modification().getOr([])});return Qe.value(yt(e,t))},attributes:Yf,styles:Yf,domChildren:qf,defChildren:qf,innerHtml:qf,value:qf},Xf=function(n,e){return t=l.apply(undefined,[n.handler].concat(e)),r=n.purpose(),{cHandler:t,purpose:I(r)};var t,r},Jf=function(n){return n.cHandler},Qf=function(n,e){return{name:I(n),handler:I(e)}},Zf=function(n,e,t){var r,o,i=k(t,(r=n,o={},bn(e,function(n){o[n.name()]=n.handlers(r)}),o));return Gf(i,Qf)},nl=function(n){var e,i=w(e=n)?{can:I(!0),abort:I(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},el=function(n,e,t){var r,o,i=e[t];return i?function(u,c,n,a){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[c](),r=e[c](),o=a.indexOf(t),i=a.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+kt(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+kt(a,null,2));return o<i?-1:i<o?1:0});return Qe.value(t)}catch(r){return Qe.error([r])}}("Event: "+t,"name",n,i).map(function(n){var e=yn(n,function(n){return n.handler()});return ar(e)}):(r=t,o=n,Qe.error(["The event ("+r+') 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: '+kt(yn(o,function(n){return n.name()}),null,2)]))},tl=function(n,i){var e=N(n,function(r,o){return(1===r.length?Qe.value(r[0].handler()):el(r,i,o)).map(function(n){var e=nl(n),t=1<r.length?wn(i,function(e){return hn(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return yt(o,{handler:e,purpose:I(t)})})});return wt(e,{})},rl=function(n){return $t("custom.definition",Ft([jt("dom","dom",tt(),Ft([Jt("tag"),or("styles",{}),or("classes",[]),or("attributes",{}),er("value"),er("innerHtml")])),Jt("components"),Jt("uid"),or("events",{}),or("apis",I({})),jt("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"]},nt.mergeWithThunk(I(e))),Kt()),er("domModification"),$o("originalSpec"),or("debug.sketcher","unknown")]),n);var e},ol=function(n){var e,t={tag:n.dom().tag(),classes:n.dom().classes(),attributes:k((e=n,yt(Oa(),e.uid())),n.dom().attributes()),styles:n.dom().styles(),domChildren:yn(n.components(),function(n){return n.element()})};return Tr(k(t,n.dom().innerHtml().map(function(n){return yt("innerHtml",n)}).getOr({}),n.dom().value().map(function(n){return yt("value",n)}).getOr({})))},il=function(e,n){bn(n,function(n){no(e,n)})},ul=function(e,n){bn(n,function(n){eo(e,n)})},cl=function(e){if(e.domChildren().isSome()&&e.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(n=Sr(e),kt(n,null,2)));return e.domChildren().fold(function(){var n=e.defChildren().getOr([]);return yn(n,sl)},function(n){return n});var n},al=function(n){var e=ue.fromTag(n.tag());Ur(e,n.attributes().getOr({})),il(e,n.classes().getOr([])),hi(e,n.styles().getOr({})),To(e,n.innerHtml().getOr(""));var t=cl(n);return Le(e,t),n.value().each(function(n){af(e,n)}),e},sl=function(n){var e=Tr(n);return al(e)},fl=function(n,e){return t=n,o=yn(r=e,function(n){return tr(n.name(),[Jt("config"),or("state",Vr)])}),i=$t("component.behaviours",Rt(o),t.behaviours).fold(function(n){throw new Error(qt(n)+"\nComplete spec:\n"+kt(t,null,2))},function(n){return n}),{list:r,data:B(i,function(n){var e=n().map(function(n){return{config:n.config(),state:n.state().init(n.config())}});return function(){return e}})};var t,r,o,i},ll=function(n){var e,t,r=(e=ht(n,"behaviours").getOr({}),t=wn(F(e),function(n){return e[n]!==undefined}),yn(t,function(n){return e[n].me}));return fl(n,r)},dl=Br(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),ml=function(n,e,t){var r,o,i,u,c=ol(n),a=function(e,n,t,r){var o=k({},n);bn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=Gf(o,function(n,e){return{name:function(){return n},modification:e}}),u=B(i,function(n,e){return Cn(n,function(e){return e.modification().fold(function(){return[]},function(n){return[e]})})}),c=N(u,function(e,t){return ht(Kf,t).fold(function(){return Qe.error("Unknown field type: "+t)},function(n){return n(e,t)})});return wt(c,{}).map(Or)}(t,{"alloy.base.modification":(r=n,r.domModification().fold(function(){return Or({})},Or))},e,c).getOrDie();return i=a,u=k({tag:(o=c).tag(),classes:i.classes().getOr([]).concat(o.classes().getOr([])),attributes:C(o.attributes().getOr({}),i.attributes().getOr({})),styles:C(o.styles().getOr({}),i.styles().getOr({}))},i.innerHtml().or(o.innerHtml()).map(function(n){return yt("innerHtml",n)}).getOr({}),kr("domChildren",i.domChildren(),o.domChildren()),kr("defChildren",i.defChildren(),o.defChildren()),i.value().or(o.value()).map(function(n){return yt("value",n)}).getOr({})),Tr(u)},gl=function(n,e,t){var r,o,i,u,c,a,s={"alloy.base.behaviour":(r=n,r.events())};return(o=t,i=n.eventOrder(),u=e,c=s,a=Zf(o,u,c),tl(a,i)).getOrDie()},pl=function(n){var e,t,r,o,i,u,c,a,s,f,l,d,m,g,p=$f(n),v=(e=p,t=vt("components",[])(e),yn(t,yl)),h=k(Pf,p,yt("components",v));return Qe.value((r=h,i=ao(Uf(o=function(){return g})),u=Wt(rl(k(r,{behaviours:undefined}))),c=ll(r),a=c.list,s=c.data,f=ml(u,a,s),l=al(f),d=gl(u,a,s),m=ao(u.components()),g=dl({getSystem:i.get,config:function(n){if(n===Ta())return u.apis();if(y(n))throw new Error("Invalid input: only API constant is allowed");var e=s;return(w(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+kt(r,null,2))})()},hasConfigured:function(n){return w(s[n.name()])},spec:I(r),readState:function(n){return s[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},connect:function(n){i.set(n)},disconnect:function(){i.set(Uf(o))},element:I(l),syncComponents:function(){var n=Ne(l),e=Cn(n,function(n){return i.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});m.set(e)},components:m.get,events:I(d)})))},vl=function(n){var e=ue.fromText(n);return hl({element:e})},hl=function(n){var t=Gt("external.component",Ft([Jt("element"),er("uid")]),n),e=ao(Uf());t.uid().each(function(n){var e;e=t.element(),Wr(e,Ca,n)});var r=dl({getSystem:e.get,config:M.none,hasConfigured:I(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(Uf(function(){return r}))},element:I(t.element()),spec:I(n),readState:I("No state"),syncComponents:_,components:I([]),events:I({})});return wa(r)},yl=function(e){return(n=e,ht(n,ya)).fold(function(){var n=k({uid:Da("")},e);return pl(n).getOrDie()},function(n){return n});var n},bl=wa,wl="alloy.item-hover",xl="alloy.item-focus",Tl=function(n){(vo(n.element()).isNone()||mi.isFocused(n))&&(mi.isFocused(n)||mi.focus(n),ee(n,wl,{item:n}))},Sl=function(n){ee(n,xl,{item:n})},Ol=I(wl),kl=I(xl),Cl=[Jt("data"),Jt("components"),Jt("dom"),er("toggling"),or("itemBehaviours",{}),or("ignoreFocus",!1),or("domModification",{}),Po("builder",function(n){return{dom:k(n.dom(),{attributes:{role:n.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:k(jr([n.toggling().fold(ri.revoke,function(n){return ri.config(k({aria:{mode:"checked"}},n))}),mi.config({ignore:n.ignoreFocus(),onFocus:function(n){Sl(n)}}),Rc.config({mode:"execution"}),vs.config({store:{mode:"memory",initialValue:n.data()}})]),n.itemBehaviours()),events:sr([(e=Yn(),r=te,lr(e,function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){r(e,n,t)})})),pr(L()),lr(W(),Tl),lr(Gn(),mi.focus)]),components:n.components(),domModification:n.domModification(),eventOrder:n.eventOrder()};var e,r}),or("eventOrder",{})],El=[Jt("dom"),Jt("components"),Po("builder",function(n){return{dom:n.dom(),components:n.components(),events:sr([(e=Gn(),lr(e,function(n,e){e.stop()}))])};var e})],Dl=I([ia({name:"widget",overrides:function(e){return{behaviours:jr([vs.config({store:{mode:"manual",getValue:function(n){return e.data()},setValue:function(){}}})])}}})]),_l=[Jt("uid"),Jt("data"),Jt("components"),Jt("dom"),or("autofocus",!1),or("domModification",{}),ha(Dl()),Po("builder",function(t){var n=da(0,t,Dl()),e=ma("item-widget",t,n.internals()),r=function(n){return ga(n,t,"widget").map(function(n){return Rc.focusIn(n),n})},o=function(n,e){return au(e.event().target())||t.autofocus()&&e.setSource(n.element()),M.none()};return k({dom:t.dom(),components:e,domModification:t.domModification(),events:sr([br(function(n,e){r(n).each(function(n){e.stop()})}),lr(W(),Tl),lr(Gn(),function(n,e){t.autofocus()?r(n):mi.focus(n)})]),behaviours:jr([vs.config({store:{mode:"memory",initialValue:t.data()}}),mi.config({onFocus:function(n){Sl(n)}}),Rc.config({mode:"special",focusIn:t.autofocus()?function(n){r(n)}:Pr(),onLeft:o,onRight:o,onEscape:function(n,e){return mi.isFocused(n)||t.autofocus()?(t.autofocus()&&e.setSource(n.element()),M.none()):(mi.focus(n),M.some(!0))}})])})})],Il=Yt("type",{widget:_l,item:Cl,separator:El}),Al=I([ca({factory:{sketch:function(n){var e=Gt("menu.spec item",Il,n);return e.builder()(e)}},name:"items",unit:"item",defaults:function(n,e){var t=Da("");return k({uid:t},e)},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus(),domModification:{classes:[n.markers().item()]}}}})]),Ml=I([Jt("value"),Jt("items"),Jt("dom"),Jt("components"),or("eventOrder",{}),Bc("menuBehaviours",[tu,vs,rf,Rc]),ir("movement",{mode:"menu",moveOnTab:!0},Yt("mode",{grid:[Wo(),Po("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers().item(),initSize:{numColumns:e.initSize().numColumns(),numRows:e.initSize().numRows()},focusManager:n.focusManager()}})],menu:[or("moveOnTab",!0),Po("config",function(n,e){return{mode:"menu",selector:"."+n.markers().item(),moveOnTab:e.moveOnTab(),focusManager:n.focusManager()}})]})),Qt("markers",Bo()),or("fakeFocus",!1),or("focusManager",ru()),jo("onHighlight")]),Fl=I("alloy.menu-focus"),Rl=Ba({name:"Menu",configFields:Ml(),partFields:Al(),factory:function(n,e,t,r){return k({dom:k(n.dom(),{attributes:{role:"menu"}}),uid:n.uid(),behaviours:k(jr([tu.config({highlightClass:n.markers().selectedItem(),itemClass:n.markers().item(),onHighlight:n.onHighlight()}),vs.config({store:{mode:"memory",initialValue:n.value()}}),rf.config({find:M.some}),Rc.config(n.movement().config()(n,n.movement()))]),Vc(n.menuBehaviours())),events:sr([lr(kl(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){tu.highlight(e,n),t.stop(),ee(e,Fl(),{menu:e,item:n})})}),lr(Ol(),function(n,e){var t=e.event().item();tu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder()})}}),Bl=function(n,t){var r=Re(t),e=po(r).bind(function(e){var o,i,n=function(n){return Fe(e,n)};return n(t)?M.some(t):(o=n,(i=function(n){for(var e=0;e<n.childNodes.length;e++){var t=ue.fromDom(n.childNodes[e]);if(o(t))return M.some(t);var r=i(n.childNodes[e]);if(r.isSome())return r}return M.none()})(t.dom()))}),o=n(t);return e.each(function(e){po(r).filter(function(n){return Fe(n,e)}).fold(function(){mo(e)},_)}),o},Vl=function(n,e,t,r){var o=n.getSystem().build(r);qe(n,o,t)},Nl=function(n,e){return n.components()},jl=zr({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(n,e,t,r){Vl(n,0,ze,r)},prepend:function(n,e,t,r){Vl(n,0,He,r)},remove:function(n,e,t,r){var o=Nl(n);Sn(o,function(n){return Fe(r.element(),n.element())}).each(Ke)},set:function(e,n,t,r){var o,i;i=(o=e).components(),bn(i,Ye),Pe(o.element()),o.syncComponents(),Bl(function(){var n=yn(r,e.getSystem().build);bn(n,function(n){Ge(e,n)})},e.element())},contents:Nl})}),Hl=function(t,r,o,n){return ht(o,n).bind(function(n){return ht(t,n).bind(function(n){var e=Hl(t,r,o,n);return M.some([n].concat(e))})}).getOr([])},zl=function(n,e){var t={};R(n,function(n,e){bn(n,function(n){t[n]=e})});var r=e,o=V(e,function(n,e){return{k:n,v:e}}),i=B(o,function(n,e){return[e].concat(Hl(t,r,o,e))});return B(t,function(n){return ht(i,n).getOr([n])})},Ll=function(){var i=ao({}),u=ao({}),c=ao({}),a=ao(M.none()),s=ao({}),n=function(n){return ht(u.get(),n)};return{setContents:function(n,e,t,r){a.set(M.some(n)),i.set(t),u.set(e),s.set(r);var o=zl(r,t);c.set(o)},expand:function(t){return ht(i.get(),t).map(function(n){var e=ht(c.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return ht(c.get(),n)},collapse:function(n){return ht(c.get(),n).bind(function(n){return 1<n.length?M.some(n.slice(1)):M.none()})},lookupMenu:n,otherMenus:function(n){var e,t,r=s.get();return e=F(r),t=n,wn(e,function(n){return!hn(t,n)})},getPrimary:function(){return a.get().bind(n)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),c.set({}),a.set(M.none())},isClear:function(){return a.get().isNone()}}},Pl=I("collapse-item"),$l=Ra({name:"TieredMenu",configFields:[Lo("onExecute"),Lo("onEscape"),zo("onOpenMenu"),zo("onOpenSubmenu"),jo("onCollapseMenu"),or("openImmediately",!0),nr("data",[Jt("primary"),Jt("menus"),Jt("expansions")]),or("fakeFocus",!1),jo("onHighlight"),jo("onHover"),nr("markers",[Jt("backgroundMenu")].concat(Fo()).concat(Ro())),Jt("dom"),or("navigateOnHover",!0),or("stayInDom",!1),Bc("tmenuBehaviours",[Rc,tu,rf,jl]),or("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)}},factory:function(u,o){var i=function(r,n){return B(n,function(n,e){var t=Rl.sketch(k(n,{value:e,items:n.items,markers:mt(o.markers,["item","selectedItem"]),fakeFocus:u.fakeFocus(),onHighlight:u.onHighlight(),focusManager:u.fakeFocus()?{get:function(n){return tu.getHighlighted(n).map(function(n){return n.element()})},set:function(e,n){e.getSystem().getByDom(n).fold(_,function(n){tu.highlight(e,n)})}}:ru()}));return r.getSystem().build(t)})},c=Ll(),a=function(n){return vs.getValue(n).value},s=function(n){return B(u.data().menus(),function(n,e){return Cn(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},f=function(e,n){tu.highlight(e,n),tu.getHighlighted(n).orThunk(function(){return tu.getFirst(n)}).each(function(n){re(e,n.element(),Gn())})},l=function(n,e){return Eo(yn(e,n.lookupMenu))},d=function(r,o,i){return M.from(i[0]).bind(o.lookupMenu).map(function(n){var e=l(o,i.slice(1));bn(e,function(n){no(n.element(),u.markers().backgroundMenu())}),he(n.element())||jl.append(r,bl(n)),ul(n.element(),[u.markers().backgroundMenu()]),f(r,n);var t=l(o,o.otherMenus(i));return bn(t,function(n){ul(n.element(),[u.markers().backgroundMenu()]),u.stayInDom()||jl.remove(r,n)}),n})},m=function(e,t){var n=a(t);return c.expand(n).bind(function(n){return M.from(n[0]).bind(c.lookupMenu).each(function(n){he(n.element())||jl.append(e,bl(n)),u.onOpenSubmenu()(e,t,n),tu.highlightFirst(n)}),d(e,c,n)})},r=function(e,t){var n=a(t);return c.collapse(n).bind(function(n){return d(e,c,n).map(function(n){return u.onCollapseMenu()(e,t,n),n})})},n=function(t){return function(e,n){return Ri(n.getSource(),"."+u.markers().item()).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},e=sr([lr(Fl(),function(n,e){var t=e.event().menu();tu.highlight(n,t)}),br(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===a(n).indexOf("collapse-item")&&r(e,n),m(e,n).fold(function(){u.onExecute()(e,n)},function(){})})}),vr(function(e,n){var t,r,o;(t=e,r=i(t,u.data().menus()),o=s(),c.setContents(u.data().primary(),r,u.data().expansions(),o),c.getPrimary()).each(function(n){jl.append(e,bl(n)),u.openImmediately()&&(f(e,n),u.onOpenMenu()(e,n))})})].concat(u.navigateOnHover()?[lr(Ol(),function(n,e){var t,r,o=e.event().item();t=n,r=a(o),c.refresh(r).bind(function(n){return d(t,c,n)}),m(n,o),u.onHover()(n,o)})]:[]));return{uid:u.uid(),dom:u.dom(),behaviours:k(jr([Rc.config({mode:"special",onRight:n(function(n,e){return au(e.element())?M.none():m(n,e)}),onLeft:n(function(n,e){return au(e.element())?M.none():r(n,e)}),onEscape:n(function(n,e){return r(n,e).orThunk(function(){return u.onEscape()(n,e).map(function(){return n})})}),focusIn:function(e,n){c.getPrimary().each(function(n){re(e,n.element(),Gn())})}}),tu.config({highlightClass:u.markers().selectedMenu(),itemClass:u.markers().menu()}),rf.config({find:function(n){return tu.getHighlighted(n)}}),jl.config({})]),Vc(u.tmenuBehaviours())),eventOrder:u.eventOrder(),apis:{collapseMenu:function(e){tu.getHighlighted(e).each(function(n){tu.getHighlighted(n).each(function(n){r(e,n)})})}},events:e}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:yt(n,e),expansions:{}}},collapseItem:function(n){return{value:Gc(Pl()),text:n}}}}),Wl=function(n,e,t,r){return ht(e.routes(),r.start()).map(a).bind(function(n){return ht(n,r.destination()).map(a)})},Ul=function(n,e,t,r){return Wl(0,e,0,r).bind(function(e){return e.transition().map(function(n){return{transition:I(n),route:I(e)}})})},Gl=function(t,r,n){var e,o,i;(e=t,o=r,i=n,ql(e,o).bind(function(n){return Ul(e,o,i,n)})).each(function(n){var e=n.transition();eo(t.element(),e.transitionClass()),Yr(t.element(),r.destinationAttr())})},ql=function(n,e,t){var r=n.element();return qr(r,e.destinationAttr())?M.some({start:I(Gr(n.element(),e.stateAttr())),destination:I(Gr(n.element(),e.destinationAttr()))}):M.none()},Yl=function(n,e,t,r){Gl(n,e,t),qr(n.element(),e.stateAttr())&&Gr(n.element(),e.stateAttr())!==r&&e.onFinish()(n,r),Wr(n.element(),e.stateAttr(),r)},Kl=Object.freeze({__proto__:null,findRoute:Wl,disableTransition:Gl,getCurrentRoute:ql,jumpTo:Yl,progressTo:function(t,r,o,i){var n,e;e=r,qr((n=t).element(),e.destinationAttr())&&(Wr(n.element(),e.stateAttr(),Gr(n.element(),e.destinationAttr())),Yr(n.element(),e.destinationAttr()));var u,c,a=(u=r,c=i,{start:I(Gr(t.element(),u.stateAttr())),destination:I(c)});Ul(t,r,o,a).fold(function(){Yl(t,r,o,i)},function(n){Gl(t,r,o);var e=n.transition();no(t.element(),e.transitionClass()),Wr(t.element(),r.destinationAttr(),i)})},getState:function(n,e,t){var r=n.element();return qr(r,e.stateAttr())?M.some(Gr(r,e.stateAttr())):M.none()}}),Xl=Object.freeze({__proto__:null,events:function(o,i){return sr([lr(K(),function(t,n){var r=n.event().raw();ql(t,o).each(function(e){Wl(0,o,0,e).each(function(n){n.transition().each(function(n){r.propertyName===n.property()&&(Yl(t,o,i,e.destination()),o.onTransition()(t,e))})})})}),vr(function(n,e){Yl(n,o,i,o.initialState())})])}}),Jl=[or("destinationAttr","data-transitioning-destination"),or("stateAttr","data-transitioning-state"),Jt("initialState"),jo("onTransition"),jo("onFinish"),Qt("routes",Bt(Qe.value,Bt(Qe.value,Ft([rr("transition",[Jt("property"),Jt("transitionClass")])]))))],Ql=zr({fields:Jl,name:"transitioning",active:Xl,apis:Kl,extra:{createRoutes:function(n){var r={};return R(n,function(n,e){var t=e.split("<->");r[t[0]]=yt(t[1],n),r[t[1]]=yt(t[0],n)}),r},createBistate:function(n,e,t){return bt([{key:n,value:yt(e,t)},{key:e,value:yt(n,t)}])},createTristate:function(n,e,t,r){return bt([{key:n,value:bt([{key:e,value:r},{key:t,value:r}])},{key:e,value:bt([{key:n,value:r},{key:t,value:r}])},{key:t,value:bt([{key:n,value:r},{key:e,value:r}])}])}}}),Zl=ai.resolve("scrollable"),nd={register:function(n){no(n,Zl)},deregister:function(n){eo(n,Zl)},scrollable:I(Zl)},ed=function(n){return ht(n,"format").getOr(n.title)},td=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[ai.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:ai.resolve("format-matches"),selected:t},itemBehaviours:jr(o?[]:[oi(n,function(n,e){(e?ri.on:ri.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},rd=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Va.sketch({dom:{tag:"div",classes:[ai.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[ai.resolve("styles-collapse-icon")]}},vl(n)]:[vl(n)],action:function(n){if(r){var e=t().get(n);$l.collapseMenu(e)}}}),{dom:{tag:"div",classes:[ai.resolve("styles-menu-items-container")]},components:[Rl.parts().items({})],behaviours:jr([nf("adhoc-scrollable-menu",[vr(function(n,e){vi(n.element(),"overflow-y","auto"),vi(n.element(),"-webkit-overflow-scrolling","touch"),nd.register(n.element())}),hr(function(n){xi(n.element(),"overflow-y"),xi(n.element(),"-webkit-overflow-scrolling"),nd.deregister(n.element())})])])}],items:e,menuBehaviours:jr([Ql.config({initialState:"after",routes:Ql.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},od=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return c},n=rd("Styles",[].concat(yn(o.items,function(n){return td(ed(n),n.title,n.isSelected(),n.getPreview(),xt(o.expansions,ed(n)))})),i,!1),e=B(o.menus,function(n,e){var t=yn(n,function(n){return td(ed(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",xt(o.expansions,ed(n)))});return rd(e,t,i,!0)}),t=k(e,yt("styles",n)),{tmenu:$l.tieredData("styles",t,o.expansions)}),c=Rs($l.sketch({dom:{tag:"div",classes:[ai.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=vs.getValue(e);return r.handle(e,t.value),M.none()},onEscape:function(){return M.none()},onOpenMenu:function(n,e){var t=xs(n.element());ws(e.element(),t),Ql.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=xs(n.element()),o=Mi(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ws(t.element(),r),Ql.progressTo(i,"before"),Ql.jumpTo(t,"after"),Ql.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Mi(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();Ql.progressTo(o,"after"),Ql.progressTo(t,"current")},navigateOnHover:!1,openImmediately:!0,data:u.tmenu,markers:{backgroundMenu:ai.resolve("styles-background-menu"),menu:ai.resolve("styles-menu"),selectedMenu:ai.resolve("styles-selected-menu"),item:ai.resolve("styles-item"),selectedItem:ai.resolve("styles-selected-item")}}));return c.asSpec()},id=function(n){return xt(n,"items")?(t=k(gt(e=n,["items"]),{menu:!0}),r=ud(e.items),{item:t,menus:k(r.menus,yt(e.title,r.items)),expansions:k(r.expansions,yt(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},ud=function(n){return xn(n,function(n,e){var t=id(e);return{menus:k(n.menus,t.menus),items:[t.item].concat(n.items),expansions:k(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},cd={expand:ud},ad=function(u,n){var c=function(n){return function(){return u.formatter.match(n)}},a=function(n){return function(){return u.formatter.getCssText(n)}},e=ht(n,"style_formats").getOr(zf),s=function(n){return yn(n,function(n){if(xt(n,"items")){var e=s(n.items);return k(k(n,{isSelected:I(!1),getPreview:I("")}),{items:e})}return xt(n,"format")?k(i=n,{isSelected:c(i.format),getPreview:a(i.format)}):(r=Gc((t=n).title),o=k(t,{format:r,isSelected:c(r),getPreview:a(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return s(e)},sd=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Cn(n,function(n){return n.items!==undefined?0<o(n.items).length?[n]:[]:!xt(n,"format")||e.formatter.canApply(n.format)?[n]:[]})})(n),cd.expand(i));return od({formats:u,handle:function(n,e){t.undoManager.transact(function(){ri.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},fd=["undo","bold","italic","link","image","bullist","styleselect"],ld=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},dd=function(n){return Cn(n,function(n){return g(n)?dd(n):ld(n)})},md=function(n){var e=n.toolbar!==undefined?n.toolbar:fd;return g(e)?dd(e):ld(e)},gd=function(r,o){var n=function(n){return function(){return $a.forToolbarCommand(o,n)}},e=function(n){return function(){return $a.forToolbarStateCommand(o,n)}},t=function(n,e,t){return function(){return $a.forToolbarStateAction(o,n,e,t)}},i=n("undo"),u=n("redo"),c=e("bold"),a=e("italic"),s=e("underline"),f=n("removeformat"),l=t("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),m=t("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),g=ad(o,o.settings),p=function(){return sd(o,g,function(){o.fire("scrollIntoView")})},v=function(n,e){return{isSupported:function(){return n.forall(function(n){return xt(o.buttons,n)})},sketch:e}};return{undo:v(M.none(),i),redo:v(M.none(),u),bold:v(M.none(),c),italic:v(M.none(),a),underline:v(M.none(),s),removeformat:v(M.none(),f),link:v(M.none(),function(){return e=r,t=o,$a.forToolbarStateAction(t,"link","link",function(){var n=Hf(e,t);e.setContextToolbar(n),Zs(t,function(){e.focusToolbar()}),Xs.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:v(M.none(),l),image:v(M.none(),function(){return Ws(o)}),bullist:v(M.some("bullist"),d),numlist:v(M.some("numlist"),m),fontsizeselect:v(M.none(),function(){return e=o,n={onChange:function(n){As.apply(e,n)},getInitialValue:function(){return As.get(e)}},Os(r,"font-size",function(){return Fs(n)});var e,n}),forecolor:v(M.none(),function(){return Cs(r,o)}),styleselect:v(M.none(),function(){return $a.forToolbar("style-formats",function(n){o.fire("toReading"),r.dropup().appear(p,ri.on,n)},jr([ri.config({toggleClass:ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Go.config({channels:bt([ui(wo.orientationChanged(),ri.off),ui(wo.dropupDismissed(),ri.off)])})]))})}},pd=function(n,t){var e=md(n),r={};return Cn(e,function(n){var e=!xt(r,n)&&xt(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},vd=function(m,g){return function(n){if(m(n)){var e,t,r,o,i,u,c,a=ue.fromDom(n.target),s=function(){n.stopPropagation()},f=function(){n.preventDefault()},l=v(f,s),d=(e=a,t=n.clientX,r=n.clientY,o=s,i=f,u=l,c=n,{target:I(e),x:I(t),y:I(r),stop:o,prevent:i,kill:u,raw:I(c)});g(d)}}},hd=function(n,e,t,r,o){var i=vd(t,r);return n.dom().addEventListener(e,i,o),{unbind:l(yd,n,e,i,o)}},yd=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},bd=I(!0),wd=function(n,e,t){return hd(n,e,bd,t,!1)},xd=function(n,e,t){return hd(n,e,bd,t,!0)},Td=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:I(e)}},Sd=Td,Od=function(r,e){var n=ue.fromDom(r),o=null,t=wd(n,"orientationchange",function(){clearInterval(o);var n=Td(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(o);var e=r.innerHeight,t=0;o=setInterval(function(){e!==r.innerHeight?(clearInterval(o),n(M.some(r.innerHeight))):20<t&&(clearInterval(o),n(M.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},kd=function(n){var e=zn.detect().os.isiOS(),t=Td(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},Cd=function(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?M.none():M.some(e.touches[0])},Ed=function(t){var r,o,i,u=ao(M.none()),c=(r=function(n){u.set(M.none()),t.triggerEvent(Kn(),n)},o=400,i=null,{cancel:function(){null!==i&&(p.clearTimeout(i),i=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i=p.setTimeout(function(){r.apply(null,n),i=null},o)}}),a=bt([{key:j(),value:function(t){return Cd(t).each(function(n){c.cancel();var e={x:I(n.clientX),y:I(n.clientY),target:t.target};c.schedule(t),u.set(M.some(e))}),M.none()}},{key:H(),value:function(n){return c.cancel(),Cd(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x()),o=Math.abs(e.clientY-t.y()),(5<r||5<o)&&u.set(M.none())})}),M.none()}},{key:z(),value:function(e){return c.cancel(),u.get().filter(function(n){return Fe(n.target(),e.target())}).map(function(n){return t.triggerEvent(qn(),e)})}}]);return{fireIfReady:function(e,n){return ht(a,n).bind(function(n){return n(e)})}}},Dd=function(t){var e=Ed({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return wd(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return wd(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},_d=6<=zn.detect().os.version.major,Id=function(r,e,t){var o=Dd(r),i=Re(e),u=function(n){return!Fe(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||po(i).filter(function(n){return"input"===me(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?ri.on:ri.off)},c=[wd(r.body(),"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),wd(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){go(r.body())}),r.onToEditing(_),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===_d?[]:[wd(ue.fromDom(r.win()),"blur",function(){t.getByDom(e).each(ri.off)}),wd(i,"select",n),wd(r.doc(),"selectionchange",n)]);return{destroy:function(){bn(c,function(n){n.unbind()})}}},Ad=function(n,e){var t=parseInt(Gr(n,e),10);return isNaN(t)?0:t},Md=(Hs=ve,zs="text",{get:function(n){if(!Hs(n))throw new Error("Can only get "+zs+" value of a "+zs+" node");return Ls(n).getOr("")},getOption:Ls=function(n){return Hs(n)?M.from(n.dom().nodeValue):M.none()},set:function(n,e){if(!Hs(n))throw new Error("Can only set raw "+zs+" value of a "+zs+" node");n.dom().nodeValue=e}}),Fd=function(n){return"img"===me(n)?1:(e=n,Md.getOption(e)).fold(function(){return Ne(n).length},function(n){return n.length});var e},Rd={create:we("start","soffset","finish","foffset")},Bd=Ze([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Vd={before:Bd.before,on:Bd.on,after:Bd.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(h,h,h)}},Nd=Ze([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),jd={domRange:Nd.domRange,relative:Nd.relative,exact:Nd.exact,exactFromRange:function(n){return Nd.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var e=n.match({domRange:function(n){return ue.fromDom(n.startContainer)},relative:function(n,e){return Vd.getStart(n)},exact:function(n,e,t,r){return n}});return Be(e)},range:Rd.create},Hd=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},zd=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},Ld=function(n){return{left:I(n.left),top:I(n.top),right:I(n.right),bottom:I(n.bottom),width:I(n.width),height:I(n.height)}},Pd=Ze([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),$d=function(n,e,t){return e(ue.fromDom(t.startContainer),t.startOffset,ue.fromDom(t.endContainer),t.endOffset)},Wd=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:I(n),rtl:M.none}},relative:function(n,e){return{ltr:J(function(){return Hd(o,n,e)}),rtl:J(function(){return M.some(Hd(o,e,n))})}},exact:function(n,e,t,r){return{ltr:J(function(){return zd(o,n,e,t,r)}),rtl:J(function(){return M.some(zd(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Pd.rtl(ue.fromDom(n.endContainer),n.endOffset,ue.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return $d(0,Pd.ltr,r)}):$d(0,Pd.ltr,r)},Ud=function(n,e){var t=me(n);return"input"===t?Vd.after(n):hn(["br","img"],t)?0===e?Vd.before(n):Vd.after(n):Vd.on(n,e)},Gd=function(n,e,t,r){var o,i,u,c,a,s=(i=e,u=t,c=r,(a=Re(o=n).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=Fe(n,t)&&e===r;return s.collapsed&&!f},qd=function(n,e,t,r,o){var i,u,c=zd(n,e,t,r,o);i=n,u=c,M.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},Yd=function(n,e,t,r,o){var i,u,c,a,l,s=(i=r,u=o,c=Ud(e,t),a=Ud(i,u),jd.relative(c,a));Wd(l=n,s).match({ltr:function(n,e,t,r){qd(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,c,a,s=l.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(s.extend)try{i=n,u=e,c=t,a=r,(o=s).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){qd(l,t,r,n,e)}else qd(l,t,r,n,e)}})},Kd=function(n){var e=ue.fromDom(n.anchorNode),t=ue.fromDom(n.focusNode);return Gd(e,n.anchorOffset,t,n.focusOffset)?M.some(Rd.create(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return M.some(Rd.create(ue.fromDom(e.startContainer),e.startOffset,ue.fromDom(t.endContainer),t.endOffset))}return M.none()}(n)},Xd=function(n){return M.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(Kd)},Jd=function(n,e){var i,t,r,o,u=Wd(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(n.dom(),e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?M.some(o).map(Ld):M.none()},Qd=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:I(2),height:n.height}},Zd=function(n){return{left:I(n.left),top:I(n.top),right:I(n.right),bottom:I(n.bottom),width:I(n.width),height:I(n.height)}},nm=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?function(t){if(t.collapsed){var r=ue.fromDom(t.startContainer);return Ve(r).bind(function(n){var e=jd.exact(r,t.startOffset,n,Fd(n));return Jd(t.startContainer.ownerDocument.defaultView,e).map(Qd).map(_n)}).getOr([])}return yn(t.getClientRects(),Zd)}(e.getRangeAt(0)):[]},em=function(n){n.focus();var e=ue.fromDom(n.document.body);(po().exists(function(n){return hn(["input","textarea"],me(n))})?function(n){setTimeout(function(){n()},0)}:a)(function(){po().each(go),mo(e)})},tm="data-"+ai.resolve("last-outer-height"),rm=function(n,e){Wr(n,tm,e)},om=function(n){return{top:I(n.top()),bottom:I(n.top()+n.height())}},im=function(n,e){var t=Ad(e,tm),r=n.innerHeight;return r<t?M.some(t-r):M.none()},um=function(n,u){var e=ue.fromDom(u.document.body),t=wd(ue.fromDom(n),"resize",function(){im(n,e).each(function(i){var n,e;(n=u,e=nm(n),0<e.length?M.some(e[0]).map(om):M.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),rm(e,n.innerHeight)});return rm(e,n.innerHeight),{toEditing:function(){em(u)},destroy:function(){t.unbind()}}},cm=function(n){return M.some(ue.fromDom(n.dom().contentWindow.document.body))},am=function(n){return M.some(ue.fromDom(n.dom().contentWindow.document))},sm=function(n){return M.from(n.dom().contentWindow)},fm=function(n){return sm(n).bind(Xd)},lm=function(n){return n.getFrame()},dm=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=lm(e);return function(){return t(n)}})()}},mm=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return wd(e,r,n)}})},gm=function(n){return{left:I(n.left),top:I(n.top),right:I(n.right),bottom:I(n.bottom),width:I(n.width),height:I(n.height)}},pm={getBody:dm("getBody",cm),getDoc:dm("getDoc",am),getWin:dm("getWin",sm),getSelection:dm("getSelection",fm),getFrame:lm,getActiveApi:function(c){var a=lm(c);return cm(a).bind(function(u){return am(a).bind(function(i){return sm(a).map(function(o){var n=ue.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return(n=o,Xd(n).map(function(n){return jd.exact(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return Jd(o,n).orThunk(function(){return Xd(o).filter(function(n){return Fe(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?M.some(e).map(gm):M.none()})})});var n}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,r){Yd(o,n,e,t,r)}}),r=c.clearSelection.getOrThunk(function(){return function(){o.getSelection().removeAllRanges()}});return{body:I(u),doc:I(i),win:I(o),html:I(n),getSelection:l(fm,a),setSelection:t,clearSelection:r,frame:I(a),onKeyup:mm(c,i,"onKeyup","keyup"),onNodeChanged:mm(c,i,"onNodeChanged","selectionchange"),onDomChanged:c.onDomChanged,onScrollToCursor:c.onScrollToCursor,onScrollToElement:c.onScrollToElement,onToReading:c.onToReading,onToEditing:c.onToEditing,onToolbarScrollStart:c.onToolbarScrollStart,onTouchContent:c.onTouchContent,onTapContent:c.onTapContent,onTouchToolstrip:c.onTouchToolstrip,getCursorBox:e}})})})}},vm="data-ephox-mobile-fullscreen-style",hm="position:absolute!important;",ym="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",bm=zn.detect().os.isAndroid(),wm=function(n,e){var t,r,o,i=function(r){return function(n){var e=Gr(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(Wr(n,vm,t),Wr(n,"style",r))}},u=(t="*",Di(n,function(n){return _e(n,t)},r)),c=Cn(u,function(n){var e;return e="*",_i(n,function(n){return _e(n,e)})}),a=(o=yi(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";bn(c,i("display:none!important;")),bn(u,i(hm+ym+a)),i((!0===bm?"":hm)+ym+a)(n)},xm=function(){var n=Ae("["+vm+"]");bn(n,function(n){var e=Gr(n,vm);"no-styles"!==e?Wr(n,"style",e):Yr(n,"style"),Yr(n,vm)})},Tm=function(){var e=Ai("head").getOrDie(),n=Ai('meta[name="viewport"]').getOrThunk(function(){var n=ue.fromTag("meta");return Wr(n,"name","viewport"),ze(e,n),n}),t=Gr(n,"content");return{maximize:function(){Wr(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?Wr(n,"content",t):Wr(n,"content","user-scalable=yes")}}},Sm=function(e,n){var t=Tm(),r=Ff(),o=Ff();return{enter:function(){n.hide(),no(e.container,ai.resolve("fullscreen-maximized")),no(e.container,ai.resolve("android-maximized")),t.maximize(),no(e.body,ai.resolve("android-scroll-reload")),r.set(um(e.win,pm.getWin(e.editor).getOrDie("no"))),pm.getActiveApi(e.editor).each(function(n){wm(e.container,n.body()),o.set(Id(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),eo(e.container,ai.resolve("fullscreen-maximized")),eo(e.container,ai.resolve("android-maximized")),xm(),eo(e.body,ai.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Om=function(t,r){var o=null;return{cancel:function(){null!==o&&(p.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&p.clearTimeout(o),o=p.setTimeout(function(){t.apply(null,n),o=null},r)}}},km=function(n,e){var t,r,o,i=Rs(of.sketch({dom:Ha('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:jr([ri.config({toggleClass:ai.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(p.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=p.setTimeout(function(){t.apply(null,n),o=null},r))}});return of.sketch({dom:Ha('<div class="${prefix}-disabled-mask"></div>'),components:[of.sketch({dom:Ha('<div class="${prefix}-content-container"></div>'),components:[Va.sketch({dom:Ha('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:jr([ri.config({toggleClass:ai.resolve("mask-tap-icon-selected")})])})]})]})},Cm=Rt([nr("editor",[Jt("getFrame"),er("getBody"),er("getDoc"),er("getWin"),er("getSelection"),er("setSelection"),er("clearSelection"),er("cursorSaver"),er("onKeyup"),er("onNodeChanged"),er("getCursorBox"),Jt("onDomChanged"),or("onTouchContent",_),or("onTapContent",_),or("onTouchToolstrip",_),or("onScrollToCursor",I({unbind:_})),or("onScrollToElement",I({unbind:_})),or("onToEditing",I({unbind:_})),or("onToReading",I({unbind:_})),or("onToolbarScrollStart",h)]),Jt("socket"),Jt("toolstrip"),Jt("dropup"),Jt("toolbar"),Jt("container"),Jt("alloy"),ur("win",function(n){return Re(n.socket).dom().defaultView}),ur("body",function(n){return ue.fromDom(n.socket.dom().ownerDocument.body)}),or("translate",h),or("setReadOnly",_),or("readOnlyOnInit",I(!0))]),Em=function(n){var e=Ut("Getting AndroidWebapp schema",Cm,n);vi(e.toolstrip,"width","100%");var t=yl(km(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};ze(e.container,t.element());var o=Sm(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:_,enter:o.enter,exit:o.exit,destroy:_}},Dm=I([or("shell",!0),Bc("toolbarBehaviours",[jl])]),_m=I([ua({name:"groups",overrides:function(n){return{behaviours:jr([jl.config({})])}}})]),Im=Ba({name:"Toolbar",configFields:Dm(),partFields:_m(),factory:function(e,n,t,r){var o=function(n){return e.shell()?M.some(n):ga(n,e,"groups")},i=e.shell()?{behaviours:[jl.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid(),dom:e.dom(),components:i.components,behaviours:k(jr(i.behaviours),Vc(e.toolbarBehaviours())),apis:{setGroups:function(n,e){o(n).fold(function(){throw p.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){jl.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Am=I([Jt("items"),(Ps=["itemClass"],nr("markers",yn(Ps,Jt))),Bc("tgroupBehaviours",[Rc])]),Mm=I([ca({name:"items",unit:"item",overrides:function(n){return{domModification:{classes:[n.markers().itemClass()]}}}})]),Fm=Ba({name:"ToolbarGroup",configFields:Am(),partFields:Mm(),factory:function(n,e,t,r){return k({dom:{attributes:{role:"toolbar"}}},{uid:n.uid(),dom:n.dom(),components:e,behaviours:k(jr([Rc.config({mode:"flow",selector:"."+n.markers().itemClass()})]),Vc(n.tgroupBehaviours())),"debug.sketcher":t["debug.sketcher"]})}}),Rm="data-"+ai.resolve("horizontal-scroll"),Bm=function(n){return"true"===Gr(n,Rm)?0<(t=n).dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(t):0<(e=n).dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(e);var e,t},Vm={exclusive:function(n,e){return wd(n,"touchmove",function(n){Ri(n.target(),e).filter(Bm).fold(function(){n.raw().preventDefault()},_)})},markAsHorizontal:function(n){Wr(n,Rm,"true")}};function Nm(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Ha('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:jr([nf("adhoc-scrollable-toolbar",!0===n.scrollable?[yr(function(n,e){vi(n.element(),"overflow-x","auto"),Vm.markAsHorizontal(n.element()),nd.register(n.element())})]:[])]),components:[of.sketch({components:[Fm.parts().items({})]})],markers:{itemClass:ai.resolve("toolbar-group-item")},items:n.items}},t=yl(Im.sketch({dom:Ha('<div class="${prefix}-toolbar"></div>'),components:[Im.parts().groups({})],toolbarBehaviours:jr([ri.config({toggleClass:ai.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),Rc.config({mode:"cyclic"})]),shell:!0})),n=yl(of.sketch({dom:{classes:[ai.resolve("toolstrip")]},components:[bl(t)],containerBehaviours:jr([ri.config({toggleClass:ai.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){Im.setGroups(t,o.get()),ri.off(t)},o=ao([]);return{wrapper:I(n),toolbar:I(t),createGroups:function(n){return yn(n,v(Fm.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){ri.on(t),Im.setGroups(t,n)},restoreToolbar:function(){ri.isOn(t)&&r()},refresh:function(){},focus:function(){Rc.focusIn(t)}}}var jm=function(n,e){jl.append(n,bl(e))},Hm=function(n,e){jl.remove(n,e)},zm=function(n){return yl(Va.sketch({dom:Ha('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Lm=function(){return yl(of.sketch({dom:Ha('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:jr([jl.config({})])}))},Pm=function(n,e,t,r){(!0===t?co.toAlpha:co.toOmega)(r),(t?jm:Hm)(n,e)},$m=function(e,n){return n.getAnimationRoot().fold(function(){return e.element()},function(n){return n(e)})},Wm=function(n){return n.dimension().property()},Um=function(n,e){return n.dimension().getDimension()(e)},Gm=function(n,e){var t=$m(n,e);ul(t,[e.shrinkingClass(),e.growingClass()])},qm=function(n,e){eo(n.element(),e.openClass()),no(n.element(),e.closedClass()),vi(n.element(),Wm(e),"0px"),Ti(n.element())},Ym=function(n,e){eo(n.element(),e.closedClass()),no(n.element(),e.openClass()),xi(n.element(),Wm(e))},Km=function(n,e,t){t.setCollapsed(),vi(n.element(),Wm(e),Um(e,n.element())),Ti(n.element());var r=$m(n,e);no(r,e.shrinkingClass()),qm(n,e),e.onStartShrink()(n)},Xm=function(n,e,t){var r=function(n,e){Ym(n,e);var t=Um(e,n.element());return qm(n,e),t}(n,e),o=$m(n,e);no(o,e.growingClass()),Ym(n,e),vi(n.element(),Wm(e),r),t.setExpanded(),e.onStartGrow()(n)},Jm=function(n,e,t){var r=$m(n,e);return!0===ro(r,e.growingClass())},Qm=function(n,e,t){var r=$m(n,e);return!0===ro(r,e.shrinkingClass())},Zm=Object.freeze({__proto__:null,grow:function(n,e,t){t.isExpanded()||Xm(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&Km(n,e,t)},immediateShrink:function(n,e,t){var r,o;t.isExpanded()&&(r=n,o=e,t.setCollapsed(),vi(r.element(),Wm(o),Um(o,r.element())),Ti(r.element()),Gm(r,o),qm(r,o),o.onStartShrink()(r),o.onShrunk()(r))},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:Jm,isShrinking:Qm,isTransitioning:function(n,e,t){return!0===Jm(n,e)||!0===Qm(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?Km:Xm)(n,e,t)},disableTransitions:Gm}),ng=Object.freeze({__proto__:null,exhibit:function(n,e){var t=e.expanded();return Or(t?{classes:[e.openClass()],styles:{}}:{classes:[e.closedClass()],styles:yt(e.dimension().property(),"0px")})},events:function(t,r){return sr([lr(K(),function(n,e){e.event().raw().propertyName===t.dimension().property()&&(Gm(n,t),r.isExpanded()&&xi(n.element(),t.dimension().property()),(r.isExpanded()?t.onGrown():t.onShrunk())(n))})])}}),eg=[Jt("closedClass"),Jt("openClass"),Jt("shrinkingClass"),Jt("growingClass"),er("getAnimationRoot"),jo("onShrunk"),jo("onStartShrink"),jo("onGrown"),jo("onStartGrow"),or("expanded",!1),Qt("dimension",Yt("property",{width:[Po("property","width"),Po("getDimension",function(n){return xs(n)+"px"})],height:[Po("property","height"),Po("getDimension",function(n){return Ei(n)+"px"})]}))],tg=zr({fields:eg,name:"sliding",active:ng,apis:Zm,state:Object.freeze({__proto__:null,init:function(n){var e=ao(n.expanded());return Nr({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:l(e.set,!1),setExpanded:l(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),rg=function(e,t){var r=yl(of.sketch({dom:{tag:"div",classes:[ai.resolve("dropup")]},components:[],containerBehaviours:jr([jl.config({}),tg.config({closedClass:ai.resolve("dropup-closed"),openClass:ai.resolve("dropup-open"),shrinkingClass:ai.resolve("dropup-shrinking"),growingClass:ai.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),jl.set(n,[])},onGrown:function(n){e(),t()}}),ii(function(n,e){o(_)})])})),o=function(n){p.window.requestAnimationFrame(function(){n(),tg.shrink(r)})};return{appear:function(n,e,t){!0===tg.hasShrunk(r)&&!1===tg.isTransitioning(r)&&p.window.requestAnimationFrame(function(){e(t),jl.set(r,[n()]),tg.grow(r)})},disappear:o,component:I(r),element:r.element}},og=zn.detect().browser.isFirefox(),ig=Ft([Zt("triggerEvent"),Zt("broadcastEvent"),or("stopBackspace",!0)]),ug=function(e,n){var t,r,o,i,u=Ut("Getting GUI events settings",ig,n),c=zn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],a=Ed(u),s=yn(c.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]),function(n){return wd(e,n,function(e){a.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),f=wd(e,"keydown",function(n){var e;u.triggerEvent("keydown",n)?n.kill():!0!==u.stopBackspace||8!==(e=n).raw().which||hn(["input","textarea"],me(e.target()))||n.prevent()}),l=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},og?xd(t,"focus",r):wd(t,"focusin",r)),d=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),p.setTimeout(function(){u.triggerEvent($n(),n)},0)},og?xd(o,"blur",i):wd(o,"focusout",i)),m=Be(e),g=wd(m,"scroll",function(n){u.broadcastEvent(Jn(),n)&&n.kill()});return{unbind:function(){bn(s,function(n){n.unbind()}),f.unbind(),l.unbind(),d.unbind(),g.unbind()}}},cg=function(n,e){var t=ht(n,"target").map(function(n){return n()}).getOr(e);return ao(t)},ag=Ze([{stopped:[]},{resume:["element"]},{complete:[]}]),sg=function(n,r,e,t,o,i){var u,c,a,s,f=n(r,t),l=(u=e,c=o,a=ao(!1),s=ao(!1),{stop:function(){a.set(!0)},cut:function(){s.set(!0)},isStopped:a.get,isCut:s.get,event:I(u),setSource:c.set,getSource:c.get});return f.fold(function(){return i.logEventNoHandlers(r,t),ag.complete()},function(e){var t=e.descHandler();return Jf(t)(l),l.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),ag.stopped()):l.isCut()?(i.logEventCut(r,e.element(),t.purpose()),ag.complete()):Ve(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),ag.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),ag.resume(n)})})},fg=function(e,t,r,n,o,i){return sg(e,t,r,n,o,i).fold(function(){return!0},function(n){return fg(e,t,r,n,o,i)},function(){return!1})},lg=function(n,e,t){var r,o,i=(r=e,o=ao(!1),{stop:function(){o.set(!0)},cut:_,isStopped:o.get,isCut:I(!1),event:I(r),setSource:c("Cannot set source of a broadcasted event"),getSource:c("Cannot get source of a broadcasted event")});return bn(n,function(n){var e=n.descHandler();Jf(e)(i)}),i.isStopped()},dg=function(n,e,t,r,o){var i=cg(t,r);return fg(n,e,t,r,i,o)},mg=function(n,e,t){return lo(n,function(n){return e(n).isSome()},t).bind(e)},gg=we("element","descHandler"),pg=function(n,e){return{id:I(n),descHandler:I(e)}};function vg(){var i={};return{registerId:function(r,o,n){R(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=Xf(n,r),i[e]=t})},unregisterId:function(t){R(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return ht(i,n).map(function(n){return N(n,function(n,e){return pg(e,n)})}).getOr([])},find:function(n,e,t){var o=pt(e)(i);return mg(t,function(n){return t=o,Ea(r=n).fold(function(){return M.none()},function(n){var e=pt(n);return t.bind(e).map(function(n){return gg(r,n)})});var t,r},n)}}}function hg(){var r=vg(),o={},i=function(r){var n=r.element();return Ea(n).fold(function(){return n="uid-",e=r.element(),t=Gc(ka+n),Wr(e,Ca,t),t;var n,e,t},function(n){return n})},u=function(n){Ea(n.element()).each(function(n){o[n]=undefined,r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);xt(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+ko(t.element())+"\nCannot use it for: "+ko(n.element())+"\nThe conflicting element is"+(he(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events()),o[e]=n},unregister:u,getById:function(n){return pt(n)(o)}}}var yg=function(t){var r=function(e){return Ve(t.element()).fold(function(){return!0},function(n){return Fe(e,n)})},o=hg(),s=function(n,e){return o.find(r,n,e)},n=ug(t.element(),{triggerEvent:function(u,c){return Mo(u,c.target(),function(n){return e=s,t=u,o=n,i=(r=c).target(),dg(e,t,r,i,o);var e,t,r,o,i})},broadcastEvent:function(n,e){var t=o.filter(n);return lg(t,e)}}),i=Wf({debugInfo:I("real"),triggerEvent:function(e,t,r){Mo(e,t,function(n){dg(s,e,r,t,n)})},triggerFocus:function(c,a){Ea(c).fold(function(){mo(c)},function(n){Mo(Pn(),c,function(n){var e,t,r,o,i,u;e=s,t=Pn(),r={originator:I(a),kill:_,prevent:_,target:I(c)},i=n,u=cg(r,o=c),sg(e,t,r,o,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return m(n)},getByDom:function(n){return g(n)},build:yl,addToGui:function(n){c(n)},removeFromGui:function(n){a(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},isConnected:I(!0)}),e=function(n){n.connect(i),ve(n.element())||(o.register(n),bn(n.components(),e),i.triggerEvent(Xn(),n.element(),{target:I(n.element())}))},u=function(n){ve(n.element())||(bn(n.components(),u),o.unregister(n)),n.disconnect()},c=function(n){Ge(t,n)},a=function(n){Ke(n)},f=function(t){var n=o.filter(Wn());bn(n,function(n){var e=n.descHandler();Jf(e)(t)})},l=function(n){f({universal:I(!0),data:I(n)})},d=function(n,e){f({universal:I(!1),channels:I(n),data:I(e)})},m=function(n){return o.getById(n).fold(function(){return Qe.error(new Error('Could not find component with uid: "'+n+'" in system.'))},Qe.value)},g=function(n){var e=Ea(n).getOr("not found");return m(e)};return e(t),{root:I(t),element:t.element,destroy:function(){n.unbind(),$e(t.element())},add:c,remove:a,getByUid:m,getByDom:g,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d}},bg=I(ai.resolve("readonly-mode")),wg=I(ai.resolve("edit-mode"));function xg(n){var e=yl(of.sketch({dom:{classes:[ai.resolve("outer-container")].concat(n.classes)},containerBehaviours:jr([co.config({alpha:bg(),omega:wg()})])}));return yg(e)}var Tg,Sg,Og,kg,Cg=function(n,e){var t=ue.fromTag("input");hi(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),ze(n,t),mo(t),e(t),$e(t)},Eg=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),r=n.document.createRange();r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(r)}},Dg=function(n,e){po().each(function(n){Fe(n,e)||go(n)}),n.focus(),mo(ue.fromDom(n.document.body)),Eg(n)},_g={stubborn:function(n,e,t,r){var o=function(){Dg(e,r)},i=wd(t,"keydown",function(n){hn(["input","textarea"],me(n.target()))||o()});return{toReading:function(){Cg(n,go)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){var o=function(){go(r)};return{toReading:function(){o()},toEditing:function(){Dg(e,r)},onToolbarTouch:function(){o()},destroy:_}}},Ig=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},c=function(){r.run(function(n){n.clearSelection()})},a=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),r.run(function(n){n.syncHeight()})},s=Dd(t),f=Om(a,300),l=[t.onKeyup(function(){c(),f.throttle()}),t.onNodeChanged(u),t.onDomChanged(f.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),f.throttle()}),t.onScrollToElement(function(n){n.element(),e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),wd(t.doc(),"touchend",function(n){Fe(t.html(),n.target())||Fe(t.body(),n.target())}),wd(o,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Ei(o),r.run(function(n){n.setViewportOffset(e)}),u(),a())}),xd(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),wd(t.body(),"touchstart",function(n){c(),t.onTouchContent(),s.fireTouchstart(n)}),s.onTouchmove(),s.onTouchend(),wd(t.body(),"click",function(n){n.kill()}),wd(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){bn(l,function(n){n.unbind()})}}},Ag={},Mg={exports:Ag};Tg=undefined,Sg=Ag,Og=Mg,kg=undefined,function(n){"object"==typeof Sg&&void 0!==Og?Og.exports=n():"function"==typeof Tg&&Tg.amd?Tg([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function i(u,c,a){function s(e,n){if(!c[e]){if(!u[e]){var t="function"==typeof kg&&kg;if(!n&&t)return t(e,!0);if(f)return f(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=c[e]={exports:{}};u[e][0].call(o.exports,function(n){return s(u[e][1][n]||n)},o,o.exports,i,u,c,a)}return c[e].exports}for(var f="function"==typeof kg&&kg,n=0;n<a.length;n++)s(a[n]);return s}({1:[function(n,e,t){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(n){if(r===setTimeout)return setTimeout(n,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(e){try{return r.call(null,n,0)}catch(e){return r.call(this,n,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(n){o=c}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var n=a(m);l=!0;for(var e=f.length;e;){for(s=f,f=[];++d<e;)s&&s[d].run();d=-1,e=f.length}s=null,l=!1,function(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{o(n)}catch(e){try{return o.call(null,n)}catch(e){return o.call(this,n)}}}(n)}}function p(n,e){this.fun=n,this.array=e}function v(){}i.nextTick=function(n){var e=new Array(arguments.length-1);if(1<arguments.length)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];f.push(new p(n,e)),1!==f.length||l||a(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,l,e){(function(t){!function(n){var e=setTimeout;function r(){}function u(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,u._immediateFn(function(){var n=1===r._state?o.onFulfilled:o.onRejected;if(null!==n){var e;try{e=n(r._value)}catch(t){return void c(o.promise,t)}i(o.promise,e)}else(1===r._state?i:c)(o.promise,r._value)})):r._deferreds.push(o)}function i(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if(e instanceof u)return n._state=3,n._value=e,void a(n);if("function"==typeof t)return void f((r=t,o=e,function(){r.apply(o,arguments)}),n)}n._state=1,n._value=e,a(n)}catch(i){c(n,i)}var r,o}function c(n,e){n._state=2,n._value=e,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&u._immediateFn(function(){n._handled||u._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)o(n,n._deferreds[e]);n._deferreds=null}function s(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function f(n,e){var t=!1;try{n(function(n){t||(t=!0,i(e,n))},function(n){t||(t=!0,c(e,n))})}catch(r){if(t)return;t=!0,c(e,r)}}u.prototype["catch"]=function(n){return this.then(null,n)},u.prototype.then=function(n,e){var t=new this.constructor(r);return o(this,new s(n,e,t)),t},u.all=function(n){var a=Array.prototype.slice.call(n);return new u(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u(function(n){n(e)})},u.reject=function(t){return new u(function(n,e){e(t)})},u.race=function(o){return new u(function(n,e){for(var t=0,r=o.length;t<r;t++)o[t].then(n,e)})},u._immediateFn="function"==typeof t?function(n){t(n)}:function(n){e(n,0)},u._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},u._setImmediateFn=function(n){u._immediateFn=n},u._setUnhandledRejectionFn=function(n){u._unhandledRejectionFn=n},void 0!==l&&l.exports?l.exports=u:n.Promise||(n.Promise=u)}(this)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,s){(function(n,e){var r=a("process/browser.js").nextTick,t=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,e){this._id=n,this._clearFn=e}s.setTimeout=function(){return new c(t.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new c(t.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(n,e){clearTimeout(n._idleTimeoutId),n._idleTimeout=e},s.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},s._unrefActive=s.active=function(n){clearTimeout(n._idleTimeoutId);var e=n._idleTimeout;0<=e&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},e))},s.setImmediate="function"==typeof n?n:function(n){var e=u++,t=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(t?n.apply(null,t):n.call(null),s.clearImmediate(e))}),e},s.clearImmediate="function"==typeof e?e:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,e,t){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var Fg=Mg.exports.boltExport,Rg=function(n){var t=M.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){bn(n,u)},u=function(e){t.each(function(n){p.setTimeout(function(){e(n)},0)})};return n(function(n){t=M.some(n),i(e),e=[]}),{get:r,map:function(t){return Rg(function(e){r(function(n){e(t(n))})})},isReady:o}},Bg={nu:Rg,pure:function(e){return Rg(function(n){n(e)})}},Vg=function(n){p.setTimeout(function(){throw n},0)},Ng=function(t){var n=function(n){t().then(n,Vg)};return{map:function(n){return Ng(function(){return t().then(n)})},bind:function(e){return Ng(function(){return t().then(function(n){return e(n).toPromise()})})},anonBind:function(n){return Ng(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return Bg.nu(n)},toCached:function(){var n=null;return Ng(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},jg=function(n){return Ng(function(){return new Fg(n)})},Hg=function(n){return Ng(function(){return Fg.resolve(n)})},zg=function(n,e,t){return Math.abs(n-e)<=t?M.none():n<e?M.some(n+t):M.some(n-t)},Lg=function(){var s=null;return{animate:function(r,o,n,i,e,t){var u=!1,c=function(n){u=!0,e(n)};clearInterval(s);var a=function(n){clearInterval(s),c(n)};s=setInterval(function(){var t=r();zg(t,o,n).fold(function(){clearInterval(s),c(o)},function(n){if(i(n,a),!u){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(clearInterval(s),c(o))}})},t)}}},Pg=function(r,o){return function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return M.none()}([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e=r<=n.width&&o<=n.height,t=n.keyboard,e?M.some(t):M.none();var e,t}).getOr({portrait:o/5,landscape:r/4})},$g=function(n){var e,t=Sd(n).isPortrait(),r=Pg((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},Wg=function(n,e){var t=Re(n).dom().defaultView;return Ei(n)+Ei(e)-$g(t)},Ug=Wg,Gg=function(n,e,t){var r=Wg(e,t),o=Ei(e)+Ei(t)-r;vi(n,"padding-bottom",o+"px")},qg=Ze([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Yg="data-"+ai.resolve("position-y-fixed"),Kg="data-"+ai.resolve("y-property"),Xg="data-"+ai.resolve("scrolling"),Jg="data-"+ai.resolve("last-window-height"),Qg=function(n){return Ad(n,Yg)},Zg=function(n,e){var t=Gr(n,Kg);return qg.fixed(n,t,e)},np=function(n,e){return qg.scroller(n,e)},ep=function(n){var e=Qg(n);return("true"===Gr(n,Xg)?np:Zg)(n,e)},tp=function(n,e,t){var r=Re(n).dom().defaultView.innerHeight;return Wr(n,Jg,r+"px"),r-e-t},rp=function(n){var e=Ii(n,"["+Yg+"]");return yn(e,ep)},op=function(r,o,i,u){var n,e,t,c,a,s,f,l,d=Re(r).dom().defaultView,m=(l=Gr(f=i,"style"),hi(f,{position:"absolute",top:"0px"}),Wr(f,Yg,"0px"),Wr(f,Kg,"top"),{restore:function(){Wr(f,"style",l||""),Yr(f,Yg),Yr(f,Kg)}}),g=Ei(i),p=Ei(u),v=(c=tp(r,t=g,p),s=Gr(a=r,"style"),nd.register(a),hi(a,{position:"absolute",height:c+"px",width:"100%",top:t+"px"}),Wr(a,Yg,t+"px"),Wr(a,Xg,"true"),Wr(a,Kg,"top"),{restore:function(){nd.deregister(a),Wr(a,"style",s||""),Yr(a,Yg),Yr(a,Xg),Yr(a,Kg)}}),h=(e=Gr(n=u,"style"),hi(n,{position:"absolute",bottom:"0px"}),Wr(n,Yg,"0px"),Wr(n,Kg,"bottom"),{restore:function(){Wr(n,"style",e||""),Yr(n,Yg),Yr(n,Kg)}}),y=!0,b=function(){var n=d.innerHeight;return Ad(r,Jg)<n},w=function(){if(y){var n=Ei(i),e=Ei(u),t=tp(r,n,e);Wr(r,Yg,n+"px"),vi(r,"height",t+"px"),Gg(o,r,u)}};return Gg(o,r,u),{setViewportOffset:function(n){Wr(r,Yg,n+"px"),w()},isExpanding:b,isShrinking:x(b),refresh:w,restore:function(){y=!1,m.restore(),v.restore(),h.restore()}}},ip=Qg,up=Lg(),cp="data-"+ai.resolve("last-scroll-top"),ap=function(n){var e=wi(n,"top").getOr("0");return parseInt(e,10)},sp=function(n){return parseInt(n.dom().scrollTop,10)},fp=function(n,e){var t=e+ip(n)+"px";vi(n,"top",t)},lp=function(t,r,o){return jg(function(n){var e=l(sp,t);up.animate(e,r,15,function(n){t.dom().scrollTop=n,vi(t,"top",ap(t)+15+"px")},function(){t.dom().scrollTop=r,vi(t,"top",o+"px"),n(r)},10)})},dp=function(o,i){return jg(function(n){var e=l(sp,o);Wr(o,cp,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);up.animate(e,i,r,function(n,e){Ad(o,cp)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,Wr(o,cp,n))},function(){o.dom().scrollTop=i,Wr(o,cp,i),n(i)},10)})},mp=function(i,u){return jg(function(n){var e=l(ap,i),t=function(n){vi(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);up.animate(e,u,o,t,function(){t(u),n(u)},10)})},gp=function(e,t,r){var o=Re(e).dom().defaultView;return jg(function(n){fp(e,r),fp(t,r),o.scrollTo(0,r),n(r)})},pp=function(n,e,t,r,o){var i=Ug(e,t),u=l(Eg,n);i<r||i<o?dp(e,e.dom().scrollTop-i+o).get(u):r<0&&dp(e,e.dom().scrollTop+r).get(u)},vp=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):bn(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},hp=function(n,a){return n.fold(function(n,e,t){return vi(n,e,a+(r=t)+"px"),Hg(r);var r},function(n,e){return o=a+(r=e),i=wi(t=n,"top").getOr(r),u=o-parseInt(i,10),c=t.dom().scrollTop+u,lp(t,c,o);var t,r,o,i,u,c})},yp=function(n,e){var t=rp(n),r=yn(t,function(n){return hp(n,e)});return vp(r,jg)},bp=function(e,t,n,r,o,i){var u,c,a=(u=function(n){return gp(e,t,n)},c=ao(Bg.pure({})),{start:function(e){var n=Bg.nu(function(n){return u(e).get(n)});c.set(n)},idle:function(n){c.get().get(function(){n()})}}),s=Om(function(){a.idle(function(){yp(n,r.pageYOffset).get(function(){var n;(n=nm(i),M.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?M.some({top:I(e),bottom:I(e+n.height())}):M.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),a.start(0),o.refresh()})})},1e3),f=wd(ue.fromDom(r),"scroll",function(){r.pageYOffset<0||s.throttle()});return yp(n,r.pageYOffset).get(h),{unbind:f.unbind}},wp=function(n){var t=n.cWin(),e=n.ceBody(),r=n.socket(),o=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),c=n.keyboardType(),a=n.outerWindow(),s=n.dropup(),f=op(r,e,o,s),l=c(n.outerBody(),t,ye(),u,o,i),d=Od(a,{onChange:_,onReady:f.refresh});d.onAdjustment(function(){f.refresh()});var m=wd(ue.fromDom(a),"resize",function(){f.isExpanding()&&f.refresh()}),g=bp(o,r,n.outerBody(),a,f,t),p=function(t,e){var n=t.document,r=ue.fromTag("div");no(r,ai.resolve("unfocused-selections")),ze(ue.fromDom(n.documentElement),r);var o=wd(r,"touchstart",function(n){n.prevent(),Dg(t,e),u()}),i=function(n){var e=ue.fromTag("span");return il(e,[ai.resolve("layer-editor"),ai.resolve("unfocused-selection")]),hi(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Pe(r)};return{update:function(){u();var n=nm(t),e=yn(n,i);Le(r,e)},isActive:function(){return 0<Ne(r).length},destroy:function(){o.unbind(),$e(r)},clear:u}}(t,u),v=function(){p.clear()};return{toEditing:function(){l.toEditing(),v()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:v,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){pp(t,r,s,n,e)},updateToolbarPadding:_,setViewportOffset:function(n){f.setViewportOffset(n),mp(r,n).get(h)},syncHeight:function(){vi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:f.refresh,destroy:function(){f.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Cg(ye(),go)}}},xp=function(r,n){var o=Tm(),i=Rf(),u=Rf(),c=Ff(),a=Ff();return{enter:function(){n.hide();var t=ue.fromDom(p.document);pm.getActiveApi(r.editor).each(function(n){i.set({socketHeight:wi(r.socket,"height"),iframeHeight:wi(n.frame(),"height"),outerScroll:p.document.body.scrollTop}),u.set({exclusives:Vm.exclusive(t,"."+nd.scrollable())}),no(r.container,ai.resolve("fullscreen-maximized")),wm(r.container,n.body()),o.maximize(),vi(r.socket,"overflow","scroll"),vi(r.socket,"-webkit-overflow-scrolling","touch"),mo(n.body());var e=Ce(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);c.set(wp(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:_,outerBody:r.body,outerWindow:r.win,keyboardType:_g.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),c.run(function(n){n.syncHeight()}),a.set(Ig(n,c,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){c.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),a.clear(),c.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){vi(r.socket,"height",n)}),n.iframeHeight.each(function(n){vi(r.editor.getFrame(),"height",n)}),p.document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),eo(r.container,ai.resolve("fullscreen-maximized")),xm(),nd.deregister(r.toolbar),xi(r.socket,"overflow"),xi(r.socket,"-webkit-overflow-scrolling"),go(r.editor.getFrame()),pm.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Tp=function(n){var e=Ut("Getting IosWebapp schema",Cm,n);vi(e.toolstrip,"width","100%"),vi(e.container,"position","relative");var t=yl(km(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var r=xp(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:r.refreshStructure,enter:r.enter,exit:r.exit,destroy:_}},Sp=tinymce.util.Tools.resolve("tinymce.EditorManager"),Op=function(n){var e=ht(n.settings,"skin_url").fold(function(){return Sp.baseURL+"/skins/lightgray"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},kp=function(n,e,t){n.system().broadcastOn([wo.formatChanged()],{command:e,state:t})},Cp=function(r,n){var e=F(n.formatter.get());bn(e,function(e){n.formatter.formatChanged(e,function(n){kp(r,e,n)})}),bn(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){kp(r,t,n)})})},Ep=(I(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Dp=I("toReading"),_p=I("toEditing");yo.add("mobile",function(D){return{getNotificationManagerImpl:function(){return{open:I({progressBar:{value:_},close:_}),close:_,reposition:_,getArgs:h}},renderUI:function(n){var e=Op(D);0==(!1===D.settings.skin)?(D.contentCSS.push(e.content),ho.DOM.styleSheetLoader.load(e.ui,Ep(D))):Ep(D)();var t,r,o,i,u,c,a,s,f,l,d,m,g,p,v,h,y,b=function(){D.fire("scrollIntoView")},w=ue.fromTag("div"),x=zn.detect().os.isAndroid()?(s=b,f=xg({classes:[ai.resolve("android-container")]}),l=Nm(),d=Ff(),m=zm(d),g=Lm(),p=rg(_,s),f.add(l.wrapper()),f.add(g),f.add(p.component()),{system:I(f),element:f.element,init:function(n){d.set(Em(n))},exit:function(){d.run(function(n){n.exit(),jl.remove(g,m)})},setToolbarGroups:function(n){var e=l.createGroups(n);l.setGroups(e)},setContextToolbar:function(n){var e=l.createGroups(n);l.setContextToolbar(e)},focusToolbar:function(){l.focus()},restoreToolbar:function(){l.restoreToolbar()},updateMode:function(n){Pm(g,m,n,f.root())},socket:I(g),dropup:I(p)}):(t=b,r=xg({classes:[ai.resolve("ios-container")]}),o=Nm(),i=Ff(),u=zm(i),c=Lm(),a=rg(function(){i.run(function(n){n.refreshStructure()})},t),r.add(o.wrapper()),r.add(c),r.add(a.component()),{system:I(r),element:r.element,init:function(n){i.set(Tp(n))},exit:function(){i.run(function(n){jl.remove(c,u),n.exit()})},setToolbarGroups:function(n){var e=o.createGroups(n);o.setGroups(e)},setContextToolbar:function(n){var e=o.createGroups(n);o.setContextToolbar(e)},focusToolbar:function(){o.focus()},restoreToolbar:function(){o.restoreToolbar()},updateMode:function(n){Pm(c,u,n,r.root())},socket:I(c),dropup:I(a)}),T=ue.fromDom(n.targetNode);we("element","offset"),h=w,(y=v=T,M.from(y.dom().nextSibling).map(ue.fromDom)).fold(function(){Ve(v).each(function(n){ze(n,h)})},function(n){var e,t;t=h,Ve(e=n).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}),function(n,e){ze(n,e.element());var t=Ne(e.element());bn(t,function(n){e.getByDom(n).each(Ue)})}(w,x.system());var S=n.targetNode.ownerDocument.defaultView,O=Od(S,{onChange:function(){x.system().broadcastOn([wo.orientationChanged()],{width:kd(S)})},onReady:_}),k=function(n,e,t,r){!1===r&&D.selection.collapse();var o=C(n,e,t);x.setToolbarGroups(!0===r?o.readOnly:o.main),D.setMode(!0===r?"readonly":"design"),D.fire(!0===r?Dp():_p()),x.updateMode(r)},C=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},E=function(n,e){return D.on(n,e),{unbind:function(){D.off(n)}}};return D.on("init",function(){x.init({editor:{getFrame:function(){return ue.fromDom(D.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:_}},onToReading:function(n){return E(Dp(),n)},onToEditing:function(n){return E(_p(),n)},onScrollToCursor:function(e){return D.on("scrollIntoView",function(n){e(n)}),{unbind:function(){D.off("scrollIntoView"),O.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolbar")));(n=e,vo(n).bind(function(n){return x.system().getByDom(n).toOption()})).each(te),x.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===me(e)?(D.selection.select(e.dom()),n.kill()):"a"===me(e)&&x.system().getByDom(ue.fromDom(D.editorContainer)).each(function(n){co.isAlpha(n)&&bo(e.dom())})}},container:ue.fromDom(D.editorContainer),socket:ue.fromDom(D.contentAreaContainer),toolstrip:ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolstrip"))),toolbar:ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolbar"))),dropup:x.dropup(),alloy:x.system(),translate:_,setReadOnly:function(n){k(a,c,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){x.dropup().disappear(function(){x.system().broadcastOn([wo.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[$a.forToolbar("back",function(){D.selection.collapse(),x.exit()},{})]},e={label:"Back to read only",scrollable:!1,items:[$a.forToolbar("readonly-back",function(){k(a,c,u,!0)},{})]},r=gd(x,D),o=pd(D.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=ao([{label:"the action group",scrollable:!0,items:o},i]),c=ao([{label:"The read only mode group",scrollable:!0,items:[]},i]),a=ao({backToMask:[n],backToReadOnly:[e]});Cp(x,D)}),D.on("remove",function(){x.exit()}),D.on("detach",function(){var e,n;e=x.system(),n=Ne(e.element()),bn(n,function(n){e.getByDom(n).each(We)}),$e(e.element()),x.system().destroy(),$e(w)}),{iframeContainer:x.socket().element().dom(),editorContainer:x.element().dom()}}}})}(window);
|
1
|
+
!function(p){"use strict";var I=function(){},v=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},A=function(n){return function(){return n}},h=function(n){return n};function l(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var n,e,t,r,o,i,u,x=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}},c=function(n){return function(){throw new Error(n)}},a=function(n){return n()},s=A(!1),f=A(!0),d=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}},y=d("string"),m=d("object"),g=d("array"),b=d("boolean"),w=d("function"),T=d("number"),S=Object.prototype.hasOwnProperty,O=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)S.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},k=O(function(n,e){return m(n)&&m(e)?k(n,e):e}),C=O(function(n,e){return e}),E=function(){return D},D=(n=function(n){return n.isNone()},r={fold:function(n,e){return n()},is:s,isSome:s,isNone:f,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:A(null),getOrUndefined:A(undefined),or:t,orThunk:e,map:E,each:I,bind:E,exists:s,forall:f,filter:E,equals:n,equals_:n,toArray:function(){return[]},toString:A("none()")},Object.freeze&&Object.freeze(r),r),M=function(t){var n=A(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:f,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return M(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:D},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(s,function(n){return e(t,n)})}};return o},F={some:M,none:E,from:function(n){return null===n||n===undefined?D:M(n)}},R=Object.keys,B=function(n,e){for(var t=R(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i)}},V=function(n,t){return N(n,function(n,e){return{k:e,v:t(n,e)}})},N=function(n,r){var o={};return B(n,function(n,e){var t=r(n,e);o[t.k]=t.v}),o},_=function(n,t){var r=[];return B(n,function(n,e){r.push(t(n,e))}),r},j=A("touchstart"),H=A("touchmove"),z=A("touchend"),L=A("mousedown"),P=A("mousemove"),$=A("mouseup"),W=A("mouseover"),U=A("keydown"),G=A("input"),q=A("change"),Y=A("click"),K=A("transitionend"),X=A("selectstart"),J=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},Q=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return nn(r(1),r(2))},Z=function(){return nn(0,0)},nn=function(n,e){return{major:n,minor:e}},en={nu:nn,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Z():Q(n,t)},unknown:Z},tn="Firefox",rn=function(n,e){return function(){return e===n}},on=function(n){var e=n.current;return{current:e,version:n.version,isEdge:rn("Edge",e),isChrome:rn("Chrome",e),isIE:rn("IE",e),isOpera:rn("Opera",e),isFirefox:rn(tn,e),isSafari:rn("Safari",e)}},un={unknown:function(){return on({current:undefined,version:en.unknown()})},nu:on,edge:A("Edge"),chrome:A("Chrome"),ie:A("IE"),opera:A("Opera"),firefox:A(tn),safari:A("Safari")},cn="Windows",an="Android",sn="Solaris",fn="FreeBSD",ln=function(n,e){return function(){return e===n}},dn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:ln(cn,e),isiOS:ln("iOS",e),isAndroid:ln(an,e),isOSX:ln("OSX",e),isLinux:ln("Linux",e),isSolaris:ln(sn,e),isFreeBSD:ln(fn,e)}},mn={unknown:function(){return dn({current:undefined,version:en.unknown()})},nu:dn,windows:A(cn),ios:A("iOS"),android:A(an),linux:A("Linux"),osx:A("OSX"),solaris:A(sn),freebsd:A(fn)},gn=Array.prototype.slice,pn=Array.prototype.indexOf,vn=Array.prototype.push,hn=function(n,e){return t=n,r=e,-1<pn.call(t,r);var t,r},yn=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o)}return r},bn=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t)},wn=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r)&&t.push(i)}return t},xn=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t)}(n,function(n){t=e(t,n)}),t},Tn=function(n,e,t){return bn(n,function(n){t=e(t,n)}),t},Sn=function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t))return F.some(o)}return F.none()},On=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t))return F.some(t);return F.none()},kn=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!g(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);vn.apply(e,n[t])}return e},Cn=function(n,e){var t=yn(n,e);return kn(t)},En=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t))return!1;return!0},Dn=function(n){var e=gn.call(n,0);return e.reverse(),e},In=function(n){return[n]},An=(w(Array.from)&&Array.from,function(n,e){var t=String(e).toLowerCase();return Sn(n,function(n){return n.search(t)})}),Mn=function(n,t){return An(n,t).map(function(n){var e=en.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Fn=function(n,t){return An(n,t).map(function(n){var e=en.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Rn=function(n,e){return-1!==n.indexOf(e)},Bn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Vn=function(e){return function(n){return Rn(n,e)}},Nn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Rn(n,"edge/")&&Rn(n,"chrome")&&Rn(n,"safari")&&Rn(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Bn],search:function(n){return Rn(n,"chrome")&&!Rn(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Rn(n,"msie")||Rn(n,"trident")}},{name:"Opera",versionRegexes:[Bn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Vn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Vn("firefox")},{name:"Safari",versionRegexes:[Bn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Rn(n,"safari")||Rn(n,"mobile/"))&&Rn(n,"applewebkit")}}],_n=[{name:"Windows",search:Vn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Rn(n,"iphone")||Rn(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Vn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Vn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Vn("linux"),versionRegexes:[]},{name:"Solaris",search:Vn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Vn("freebsd"),versionRegexes:[]}],jn={browsers:A(Nn),oses:A(_n)},Hn=function(n){var e,t,r,o,i,u,c,a,s,f,l,d=jn.browsers(),m=jn.oses(),g=Mn(d,n).fold(un.unknown,un.nu),p=Fn(m,n).fold(mn.unknown,mn.nu);return{browser:g,os:p,deviceType:(t=g,r=n,o=(e=p).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,c=e.isAndroid()&&4===e.version.major,a=o||u||c&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),f=s&&!a,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:A(o),isiPhone:A(i),isTablet:A(a),isPhone:A(f),isTouch:A(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:A(l)})}},zn={detect:J(function(){var n=p.navigator.userAgent;return Hn(n)})},Ln={tap:A("alloy.tap")},Pn=A("alloy.focus"),$n=A("alloy.blur.post"),Wn=A("alloy.receive"),Un=A("alloy.execute"),Gn=A("alloy.focus.item"),qn=Ln.tap,Yn=zn.detect().deviceType.isTouch()?Ln.tap:Y,Kn=A("alloy.longpress"),Xn=A("alloy.system.init"),Jn=A("alloy.system.scroll"),Qn=A("alloy.system.attached"),Zn=A("alloy.system.detached"),ne=function(n,e){oe(n,n.element(),e,{})},ee=function(n,e,t){oe(n,n.element(),e,t)},te=function(n){ne(n,Un())},re=function(n,e,t){oe(n,e,t,{})},oe=function(n,e,t,r){var o=k({target:e},r);n.getSystem().triggerEvent(t,e,V(o,A))},ie=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:A(n)}},ue={fromHtml:function(n,e){var t=(e||p.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw p.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return ie(t.childNodes[0])},fromTag:function(n,e){var t=(e||p.document).createElement(n);return ie(t)},fromText:function(n,e){var t=(e||p.document).createTextNode(n);return ie(t)},fromDom:ie,fromPoint:function(n,e,t){var r=n.dom();return F.from(r.elementFromPoint(e,t)).map(ie)}},ce=(p.Node.ATTRIBUTE_NODE,p.Node.CDATA_SECTION_NODE,p.Node.COMMENT_NODE,p.Node.DOCUMENT_NODE),ae=(p.Node.DOCUMENT_TYPE_NODE,p.Node.DOCUMENT_FRAGMENT_NODE,p.Node.ELEMENT_NODE),se=p.Node.TEXT_NODE,fe=(p.Node.PROCESSING_INSTRUCTION_NODE,p.Node.ENTITY_REFERENCE_NODE,p.Node.ENTITY_NODE,p.Node.NOTATION_NODE,"undefined"!=typeof p.window?p.window:Function("return this;")()),le=function(n,e){return function(n,e){for(var t=e!==undefined&&null!==e?e:fe,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t}(n.split("."),e)},de=function(n,e){var t=le(n,e);if(t===undefined||null===t)throw new Error(n+" not available on this browser");return t},me=function(n){return n.dom().nodeName.toLowerCase()},ge=function(e){return function(n){return n.dom().nodeType===e}},pe=ge(ae),ve=ge(se),he=function(n){var e=ve(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},ye=J(function(){return be(ue.fromDom(p.document))}),be=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return ue.fromDom(e)},we=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return bn(e,function(n,e){r[n]=A(t[e])}),r}},xe=function(n){return n.slice(0).sort()},Te=function(n,e){throw new Error("All required keys ("+xe(n).join(", ")+") were not specified. Specified keys were: "+xe(e).join(", ")+".")},Se=function(n){throw new Error("Unsupported keys for object: "+xe(n).join(", "))},Oe=function(e,n){if(!g(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");bn(n,function(n){if(!y(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},ke=function(n){var t=xe(n);Sn(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})},Ce=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Oe("required",o),Oe("optional",i),ke(u),function(e){var t=R(e);En(o,function(n){return hn(t,n)})||Te(o,t);var n=wn(t,function(n){return!hn(u,n)});0<n.length&&Se(n);var r={};return bn(o,function(n){r[n]=A(e[n])}),bn(i,function(n){r[n]=A(Object.prototype.hasOwnProperty.call(e,n)?F.some(e[n]):F.none())}),r}},Ee=ae,De=ce,Ie=function(n,e){var t=n.dom();if(t.nodeType!==Ee)return!1;var r=t;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ae=function(n){return n.nodeType!==Ee&&n.nodeType!==De||0===n.childElementCount},Me=function(n,e){var t=e===undefined?p.document:e.dom();return Ae(t)?[]:yn(t.querySelectorAll(n),ue.fromDom)},Fe=function(n,e){var t=e===undefined?p.document:e.dom();return Ae(t)?F.none():F.from(t.querySelector(n)).map(ue.fromDom)},Re=function(n,e){return n.dom()===e.dom()},Be=(zn.detect().browser.isIE(),function(n){return ue.fromDom(n.dom().ownerDocument)}),Ve=function(n){return ue.fromDom(n.dom().ownerDocument.defaultView)},Ne=function(n){return F.from(n.dom().parentNode).map(ue.fromDom)},_e=function(n){return yn(n.dom().childNodes,ue.fromDom)},je=function(n){return e=0,t=n.dom().childNodes,F.from(t[e]).map(ue.fromDom);var e,t},He=(we("element","offset"),function(e,t){je(e).fold(function(){ze(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})}),ze=function(n,e){n.dom().appendChild(e.dom())},Le=function(e,n){bn(n,function(n){ze(e,n)})},Pe=function(n){n.dom().textContent="",bn(_e(n),function(n){$e(n)})},$e=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},We=function(n){ne(n,Zn());var e=n.components();bn(e,We)},Ue=function(n){var e=n.components();bn(e,Ue),ne(n,Qn())},Ge=function(n,e){qe(n,e,ze)},qe=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),he(n.element())&&Ue(e),n.syncComponents()},Ye=function(n){We(n),$e(n.element()),n.getSystem().removeFromWorld(n)},Ke=function(e){var n=Ne(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(F.none,F.some)});Ye(e),n.each(function(n){n.syncComponents()})},Xe=function(t){return{is:function(n){return t===n},isValue:f,isError:s,getOr:A(t),getOrThunk:A(t),getOrDie:A(t),or:function(n){return Xe(t)},orThunk:function(n){return Xe(t)},fold:function(n,e){return e(t)},map:function(n){return Xe(n(t))},mapError:function(n){return Xe(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return F.some(t)}}},Je=function(t){return{is:s,isValue:s,isError:f,getOr:h,getOrThunk:function(n){return n()},getOrDie:function(){return c(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return Je(t)},mapError:function(n){return Je(n(t))},each:I,bind:function(n){return Je(t)},exists:s,forall:f,toOption:F.none}},Qe={value:Xe,error:Je,fromOption:function(n,e){return n.fold(function(){return Je(e)},Xe)}},Ze=function(u){if(!g(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],t={};return bn(u,function(n,r){var e=R(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!g(i))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=R(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!En(c,function(n){return hn(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+c.join(", "));return n[o].apply(null,t)},log:function(n){p.console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},nt=Ze([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),et=function(n){return nt.defaultedThunk(A(n))},tt=nt.strict,rt=nt.asOption,ot=nt.defaultedThunk,it=nt.mergeWithThunk,ut=(Ze([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){var e=[],t=[];return bn(n,function(n){n.fold(function(n){e.push(n)},function(n){t.push(n)})}),{errors:e,values:t}}),ct=function(n){return v(Qe.error,kn)(n)},at=function(n,e){var t,r,o=ut(n);return 0<o.errors.length?ct(o.errors):(t=o.values,r=e,Qe.value(k.apply(undefined,[r].concat(t))))},st=function(n){var e=ut(n);return 0<e.errors.length?ct(e.errors):Qe.value(e.values)},ft=function(e){return function(n){return n.hasOwnProperty(e)?F.from(n[e]):F.none()}},lt=function(n,e){return ft(e)(n)},dt=function(n,e){var t={};return t[n]=e,t},mt=function(n,e){return t=n,r={},bn(e,function(n){t[n]!==undefined&&t.hasOwnProperty(n)&&(r[n]=t[n])}),r;var t,r},gt=function(n,e){return t=e,r={},B(n,function(n,e){hn(t,e)||(r[e]=n)}),r;var t,r},pt=function(n){return ft(n)},vt=function(n,e){return t=n,r=e,function(n){return ft(t)(n).getOr(r)};var t,r},ht=function(n,e){return lt(n,e)},yt=function(n,e){return dt(n,e)},bt=function(n){return e={},bn(n,function(n){e[n.key]=n.value}),e;var e},wt=function(n,e){return at(n,e)},xt=function(n,e){return r=e,(t=n).hasOwnProperty(r)&&t[r]!==undefined&&null!==t[r];var t,r},Tt=Ze([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),St=Ze([{field:["name","presence","type"]},{state:["name"]}]),Ot=function(){return de("JSON")},kt=function(n,e,t){return Ot().stringify(n,e,t)},Ct=function(n){return m(n)&&100<R(n).length?" removed due to size":kt(n,null,2)},Et=function(n,e){return Qe.error([{path:n,getErrorInfo:e}])},Dt=Ze([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),It=function(t,r,o){return lt(r,o).fold(function(){return n=o,e=r,Et(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Ct(e)});var n,e},Qe.value)},At=function(n,e,t){var r=lt(n,e).fold(function(){return t(n)},h);return Qe.value(r)},Mt=function(o,c,n,a){return n.fold(function(i,e,n,t){var r=function(n){return t.extract(o.concat([i]),a,n).map(function(n){return dt(e,a(n))})},u=function(n){return n.fold(function(){var n=dt(e,a(F.none()));return Qe.value(n)},function(n){return t.extract(o.concat([i]),a,n).map(function(n){return dt(e,a(F.some(n)))})})};return n.fold(function(){return It(o,c,i).bind(r)},function(n){return At(c,i,n).bind(r)},function(){return(n=c,e=i,Qe.value(lt(n,e))).bind(u);var n,e},function(n){return(e=c,t=i,r=n,o=lt(e,t).map(function(n){return!0===n?r(e):n}),Qe.value(o)).bind(u);var e,t,r,o},function(n){var e=n(c);return At(c,i,A({})).map(function(n){return k(e,n)}).bind(r)})},function(n,e){var t=e(c);return Qe.value(dt(n,a(t)))})},Ft=function(r){return{extract:function(t,n,e){return r(e,n).fold(function(n){return e=n,Et(t,function(){return e});var e},Qe.value)},toString:function(){return"val"},toDsl:function(){return Tt.itemOf(r)}}},Rt=function(n){var a=Bt(n),s=xn(n,function(e,n){return n.fold(function(n){return k(e,yt(n,!0))},A(e))},{});return{extract:function(n,e,t){var r,o,i,u=b(t)?[]:(o=R(r=t),wn(o,function(n){return xt(r,n)})),c=wn(u,function(n){return!xt(s,n)});return 0===c.length?a.extract(n,e,t):(i=c,Et(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:a.toString,toDsl:a.toDsl}},Bt=function(c){return{extract:function(n,e,t){return r=n,o=t,i=e,u=yn(c,function(n){return Mt(r,o,n,i)}),at(u,{});var r,o,i,u},toString:function(){return"obj{\n"+yn(c,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return Tt.objOf(yn(c,function(n){return n.fold(function(n,e,t,r){return St.field(n,t,r)},function(n,e){return St.state(n)})}))}}},Vt=function(t,i){var e=function(n,e){return(o=Ft(t),{extract:function(t,r,n){var e=yn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return st(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return Tt.arrOf(o)}}).extract(n,h,e);var o};return{extract:function(t,r,o){var n=R(o);return e(t,n).bind(function(n){var e=yn(n,function(n){return Dt.field(n,n,tt(),i)});return Bt(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return Tt.setOf(t,i)}}},Nt=A(Ft(Qe.value)),_t=Dt.state,jt=Dt.field,Ht=function(t,e,r,o,i){return ht(o,i).fold(function(){return n=o,e=i,Et(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Ct(n)});var n,e},function(n){return Bt(n).extract(t.concat(["branch: "+i]),e,r)})},zt=function(o,i){return{extract:function(e,t,r){return ht(r,o).fold(function(){return n=o,Et(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Ht(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+R(i)},toDsl:function(){return Tt.choiceOf(o,i)}}},Lt=Ft(Qe.value),Pt=function(n,e,t,r){return e.extract([n],t,r).fold(function(n){return Qe.error({input:r,errors:n})},Qe.value)},$t=function(n,e,t){return Pt(n,e,A,t)},Wt=function(n){return n.fold(function(n){throw new Error(qt(n))},h)},Ut=function(n,e,t){return Wt(Pt(n,e,h,t))},Gt=function(n,e,t){return Wt($t(n,e,t))},qt=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,yn(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Ct(n.input);var e,t},Yt=function(n,e){return zt(n,e)},Kt=A(Lt),Xt=(o=w,i="function",Ft(function(n){var e=typeof n;return o(n)?Qe.value(n):Qe.error("Expected type: "+i+" but got: "+e)})),Jt=function(n){return jt(n,n,tt(),Nt())},Qt=function(n,e){return jt(n,n,tt(),e)},Zt=function(n){return Qt(n,Xt)},nr=function(n,e){return jt(n,n,tt(),Bt(e))},er=function(n){return jt(n,n,rt(),Nt())},tr=function(n,e){return jt(n,n,rt(),Bt(e))},rr=function(n,e){return jt(n,n,rt(),Rt(e))},or=function(n,e){return jt(n,n,et(e),Nt())},ir=function(n,e,t){return jt(n,n,et(e),t)},ur=function(n,e){return _t(n,e)},cr=function(n){if(!xt(n,"can")&&!xt(n,"abort")&&!xt(n,"run"))throw new Error("EventHandler defined by: "+kt(n,null,2)+" does not have can, abort, or run!");return Ut("Extracting event.handler",Rt([or("can",A(!0)),or("abort",A(!1)),or("run",I)]),n)},ar=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return cr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];bn(t,function(n){n.run.apply(undefined,e)})}})},sr=function(n){return bt(n)},fr=function(n,e){return{key:n,value:cr({abort:e})}},lr=function(n,e){return{key:n,value:cr({run:e})}},dr=function(n,e,t){return{key:n,value:cr({run:function(n){e.apply(undefined,[n].concat(t))}})}},mr=function(n){return function(r){return{key:n,value:cr({run:function(n,e){var t;t=e,Re(n.element(),t.event().target())&&r(n,e)}})}}},gr=function(n,e,t){var u,r,o=e.partUids()[t];return r=o,lr(u=n,function(n,i){n.getSystem().getByUid(r).each(function(n){var e,t,r,o;t=(e=n).element(),r=u,o=i,e.getSystem().triggerEvent(r,t,o.event())})})},pr=function(n){return lr(n,function(n,e){e.cut()})},vr=mr(Qn()),hr=mr(Zn()),yr=mr(Xn()),br=(u=Un(),function(n){return lr(u,n)}),wr=function(n){return yn(n,function(n){return r=e="/*",o=(t=n).length-e.length,""!==r&&(t.length<r.length||t.substr(o,o+r.length)!==r)?n:n.substring(0,n.length-"/*".length);var e,t,r,o})},xr=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:wr(i)}},n},Tr=Ce(["tag"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),Sr=function(n){return{tag:n.tag(),classes:n.classes().getOr([]),attributes:n.attributes().getOr({}),styles:n.styles().getOr({}),value:n.value().getOr("<none>"),innerHtml:n.innerHtml().getOr("<none>"),defChildren:n.defChildren().fold(function(){return"<none>"},function(n){return kt(n,null,2)}),domChildren:n.domChildren().fold(function(){return"<none>"},function(n){return 0===n.length?"0 children, but still specified":String(n.length)})}},Or=Ce([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),kr=function(e,n,t){return n.fold(function(){return t.fold(function(){return{}},function(n){return yt(e,n)})},function(n){return t.fold(function(){return yt(e,n)},function(n){return yt(e,n)})})},Cr=function(t,r,o){return yr(function(n,e){o(n,t,r)})},Er=function(n,e,t,r,o,i){var u,c,a=n,s=tr(e,[(u="config",c=n,jt(u,u,rt(),c))]);return Ar(a,s,e,t,r,o,i)},Dr=function(o,i,u){var n,e,t,r,c,a;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:A(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,c=t.indexOf("("),a=t.substring(c+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:wr(a.slice(0,1).concat(a.slice(3)))}},n},Ir=function(n){return{key:n,value:undefined}},Ar=function(t,n,r,o,e,i,u){var c=function(n){return xt(n,r)?n[r]():F.none()},a=V(e,function(n,e){return Dr(r,n,e)}),s=V(i,function(n,e){return xr(n,e)}),f=k(s,a,{revoke:l(Ir,r),config:function(n){var e=Gt(r+"-config",t,n);return{key:r,value:{config:e,me:f,configAsRaw:J(function(){return Ut(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return c(n).bind(function(e){return ht(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Or({}))},name:function(){return r},handlers:function(n){return c(n).bind(function(e){return ht(o,"events").map(function(n){return n(e.config,e.state)})}).getOr({})}});return f},Mr=function(n,e){return Fr(n,e,{validate:w,label:"function"})},Fr=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return Oe("required",o),ke(o),function(e){var t=R(e);En(o,function(n){return hn(t,n)})||Te(o,t),r(o,t);var n=wn(o,function(n){return!i.validate(e[n],n)});return 0<n.length&&function(n,e){throw new Error("All values need to be of type: "+e+". Keys ("+xe(n).join(", ")+") were not.")}(n,i.label),e}},Rr=function(e,n){var t=wn(n,function(n){return!hn(e,n)});0<t.length&&Se(t)},Br=I,Vr=function(n){return Mr(Rr,n)},Nr={init:function(){return _r({readState:function(){return"No State required"}})}},_r=function(n){return Mr(Br,["readState"])(n),n},jr=function(n){return bt(n)},Hr=Rt([Jt("fields"),Jt("name"),or("active",{}),or("apis",{}),or("state",Nr),or("extra",{})]),zr=function(n){var e,t,r,o,i,u,c,a,s=Ut("Creating behaviour: "+n.name,Hr,n);return e=s.fields,t=s.name,r=s.active,o=s.apis,i=s.extra,u=s.state,c=Rt(e),a=tr(t,[rr("config",e)]),Ar(c,a,t,r,o,i,u)},Lr=Rt([Jt("branchKey"),Jt("branches"),Jt("name"),or("active",{}),or("apis",{}),or("state",Nr),or("extra",{})]),Pr=A(undefined),$r=function(n,e,t){if(!(y(t)||b(t)||T(t)))throw p.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},Wr=function(n,e,t){$r(n.dom(),e,t)},Ur=function(n,e){var t=n.dom();B(e,function(n,e){$r(t,e,n)})},Gr=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},qr=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},Yr=function(n,e){n.dom().removeAttribute(e)},Kr=function(n,e){var t=Gr(n,e);return t===undefined||""===t?[]:t.split(" ")},Xr=function(n){return n.dom().classList!==undefined},Jr=function(n){return Kr(n,"class")},Qr=function(n,e){return o=e,i=Kr(t=n,r="class").concat([o]),Wr(t,r,i.join(" ")),!0;var t,r,o,i},Zr=function(n,e){return o=e,0<(i=wn(Kr(t=n,r="class"),function(n){return n!==o})).length?Wr(t,r,i.join(" ")):Yr(t,r),!1;var t,r,o,i},no=function(n,e){Xr(n)?n.dom().classList.add(e):Qr(n,e)},eo=function(n,e){var t;Xr(n)?n.dom().classList.remove(e):Zr(n,e),0===(Xr(t=n)?t.dom().classList:Jr(t)).length&&Yr(t,"class")},to=function(n,e){return Xr(n)?n.dom().classList.toggle(e):(r=e,hn(Jr(t=n),r)?Zr(t,r):Qr(t,r));var t,r},ro=function(n,e){return Xr(n)&&n.dom().classList.contains(e)},oo=function(n,e,t){eo(n,t),no(n,e)},io=Object.freeze({toAlpha:function(n,e,t){oo(n.element(),e.alpha(),e.omega())},toOmega:function(n,e,t){oo(n.element(),e.omega(),e.alpha())},isAlpha:function(n,e,t){return ro(n.element(),e.alpha())},isOmega:function(n,e,t){return ro(n.element(),e.omega())},clear:function(n,e,t){eo(n.element(),e.alpha()),eo(n.element(),e.omega())}}),uo=[Jt("alpha"),Jt("omega")],co=zr({fields:uo,name:"swapping",apis:io}),ao=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return ao(t())}}};function so(n,e,t,r,o){return n(t,r)?F.some(t):w(o)&&o(t)?F.none():e(t,r,o)}var fo=function(n,e,t){for(var r=n.dom(),o=w(t)?t:A(!1);r.parentNode;){r=r.parentNode;var i=ue.fromDom(r);if(e(i))return F.some(i);if(o(i))break}return F.none()},lo=function(n,e,t){return so(function(n,e){return e(n)},fo,n,e,t)},mo=function(n){n.dom().focus()},go=function(n){n.dom().blur()},po=function(n){var e=n!==undefined?n.dom():p.document;return F.from(e.activeElement).map(ue.fromDom)},vo=function(e){return po(Be(e)).filter(function(n){return e.dom().contains(n.dom())})},ho=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),yo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),bo=function(n){var e=p.document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=p.document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,p.window,0,0,0,0,0,!1,!1,!1,!1,0,null),p.document.body.appendChild(e),e.dispatchEvent(t),p.document.body.removeChild(e)},wo={formatChanged:A("formatChanged"),orientationChanged:A("orientationChanged"),dropupDismissed:A("dropupDismissed")},xo=function(n){return n.dom().innerHTML},To=function(n,e){var t,r,o=Be(n).dom(),i=ue.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||p.document).createElement("div")).innerHTML=t,_e(ue.fromDom(r)));Le(i,u),Pe(n),ze(n,i)},So=function(n){return e=n,t=!1,ue.fromDom(e.dom().cloneNode(t));var e,t},Oo=function(n){var e,t,r,o=So(n);return e=o,t=ue.fromTag("div"),r=ue.fromDom(e.dom().cloneNode(!0)),ze(t,r),xo(t)},ko=function(n){return Oo(n)},Co=Object.freeze({events:function(c){return sr([lr(Wn(),function(o,i){var n,e,u=c.channels(),t=R(u),r=(n=t,(e=i).universal()?n:wn(n,function(n){return hn(e.channels(),n)}));bn(r,function(n){var e=u[n](),t=e.schema(),r=Gt("channel["+n+"] data\nReceiver: "+ko(o.element()),t,i.data());e.onReceive()(o,r)})})])}}),Eo=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},Do="unknown",Io=[],Ao=["alloy/data/Fields","alloy/debugging/Debugging"],Mo={logEventCut:I,logEventStopped:I,logNoParent:I,logEventNoHandlers:I,logEventResponse:I,write:I},Fo=function(n,e,t){var r,o="*"===Io||hn(Io,n)?(r=[],{logEventCut:function(n,e,t){r.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){r.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){r.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){r.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){r.push({outcome:"response",purpose:t,target:e})},write:function(){hn(["mousemove","mouseover","mouseout",Xn()],n)||p.console.log(n,{event:n,target:e.dom(),sequence:yn(r,function(n){return hn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+ko(n.target)+")":n.outcome})})}}):Mo,i=t(o);return o.write(),i},Ro=A([Jt("menu"),Jt("selectedMenu")]),Bo=A([Jt("item"),Jt("selectedItem")]),Vo=(A(Rt(Bo().concat(Ro()))),A(Rt(Bo()))),No=nr("initSize",[Jt("numColumns"),Jt("numRows")]),_o=function(n,e,t){var r;return function(){var n=new Error;if(n.stack!==undefined){var e=n.stack.split("\n");Sn(e,function(e){return 0<e.indexOf("alloy")&&!function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t))return!0;return!1}(Ao,function(n){return-1<e.indexOf(n)})}).getOr(Do)}}(),jt(e,e,t,(r=function(t){return Qe.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})},Ft(function(n){return r(n)})))},jo=function(n){return _o(0,n,et(I))},Ho=function(n){return _o(0,n,et(F.none))},zo=function(n){return _o(0,n,tt())},Lo=function(n){return _o(0,n,tt())},Po=function(n,e){return ur(n,A(e))},$o=function(n){return ur(n,h)},Wo=A(No),Uo=[Qt("channels",Vt(Qe.value,Rt([zo("onReceive"),or("schema",Kt())])))],Go=zr({fields:Uo,name:"receiving",active:Co}),qo=function(n,e){var t=Jo(n,e),r=e.aria();r.update()(n,r,t)},Yo=function(n,e,t){to(n.element(),e.toggleClass()),qo(n,e)},Ko=function(n,e,t){no(n.element(),e.toggleClass()),qo(n,e)},Xo=function(n,e,t){eo(n.element(),e.toggleClass()),qo(n,e)},Jo=function(n,e){return ro(n.element(),e.toggleClass())},Qo=function(n,e,t){(e.selected()?Ko:Xo)(n,e,t)},Zo=Object.freeze({onLoad:Qo,toggle:Yo,isOn:Jo,on:Ko,off:Xo}),ni=Object.freeze({exhibit:function(n,e,t){return Or({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=Yo,br(function(n){o(n,t,r)})),u=Cr(n,e,Qo);return sr(kn([n.toggleOnExecute()?[i]:[],[u]]))}}),ei=function(n,e,t){Wr(n.element(),"aria-expanded",t)},ti=[or("selected",!1),Jt("toggleClass"),or("toggleOnExecute",!0),ir("aria",{mode:"none"},Yt("mode",{pressed:[or("syncWithExpanded",!1),Po("update",function(n,e,t){Wr(n.element(),"aria-pressed",t),e.syncWithExpanded()&&ei(n,e,t)})],checked:[Po("update",function(n,e,t){Wr(n.element(),"aria-checked",t)})],expanded:[Po("update",ei)],selected:[Po("update",function(n,e,t){Wr(n.element(),"aria-selected",t)})],none:[Po("update",I)]}))],ri=zr({fields:ti,name:"toggling",active:ni,apis:Zo}),oi=function(t,r){return Go.config({channels:yt(wo.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},ii=function(n){return Go.config({channels:yt(wo.orientationChanged(),{onReceive:n})})},ui=function(n,e){return{key:n,value:{onReceive:e}}},ci="tinymce-mobile",ai={resolve:function(n){return ci+"-"+n},prefix:A(ci)},si=function(n,e){e.ignore()||(mo(n.element()),e.onFocus()(n))},fi=Object.freeze({focus:si,blur:function(n,e){e.ignore()||go(n.element())},isFocused:function(n){return e=n.element(),t=Be(e).dom(),e.dom()===t.activeElement;var e,t}}),li=Object.freeze({exhibit:function(n,e){return e.ignore()?Or({}):Or({attributes:{tabindex:"-1"}})},events:function(t){return sr([lr(Pn(),function(n,e){si(n,t),e.stop()})])}}),di=[jo("onFocus"),or("ignore",!1)],mi=zr({fields:di,name:"focusing",active:li,apis:fi}),gi=function(n){return n.style!==undefined&&w(n.style.getPropertyValue)},pi=function(n,e,t){if(!y(t))throw p.console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);gi(n)&&n.style.setProperty(e,t)},vi=function(n,e,t){var r=n.dom();pi(r,e,t)},hi=function(n,e){var t=n.dom();B(e,function(n,e){pi(t,e,n)})},yi=function(n,e){var t=n.dom(),r=p.window.getComputedStyle(t).getPropertyValue(e),o=""!==r||he(n)?r:bi(t,e);return null===o?undefined:o},bi=function(n,e){return gi(n)?n.style.getPropertyValue(e):""},wi=function(n,e){var t=n.dom(),r=bi(t,e);return F.from(r).filter(function(n){return 0<n.length})},xi=function(n,e){var t,r,o=n.dom();r=e,gi(t=o)&&t.style.removeProperty(r),qr(n,"style")&&""===Gr(n,"style").replace(/^\s+|\s+$/g,"")&&Yr(n,"style")},Ti=function(n){return n.dom().offsetWidth};function Si(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=yi(n,r);return parseFloat(t)||0}return e},i=function(o,n){return Tn(n,function(n,e){var t=yi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!T(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();gi(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var Oi,ki,Ci=Si("height",function(n){var e=n.dom();return he(n)?e.getBoundingClientRect().height:e.offsetHeight}),Ei=function(n){return Ci.get(n)},Di=function(n,e,t){return wn(function(n,e){for(var t=w(e)?e:s,r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=ue.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},Ii=function(n,e){return wn(Ne(t=n).map(_e).map(function(n){return wn(n,function(n){return!Re(t,n)})}).getOr([]),e);var t},Ai=function(n,e){return Me(e,n)},Mi=function(n){return Fe(n)},Fi=function(n,e,t){return fo(n,function(n){return Ie(n,e)},t)},Ri=function(n,e){return Fe(e,n)},Bi=function(n,e,t){return so(Ie,Fi,n,e,t)},Vi=function(n,e,t){var r=Dn(n.slice(0,e)),o=Dn(n.slice(e+1));return Sn(r.concat(o),t)},Ni=function(n,e,t){var r=Dn(n.slice(0,e));return Sn(r,t)},_i=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return Sn(o.concat(r),t)},ji=function(n,e,t){var r=n.slice(e+1);return Sn(r,t)},Hi=function(t){return function(n){var e=n.raw();return hn(t,e.which)}},zi=function(n){return function(e){return En(n,function(n){return n(e)})}},Li=function(n){return!0===n.raw().shiftKey},Pi=function(n){return!0===n.raw().ctrlKey},$i=x(Li),Wi=function(n,e){return{matches:n,classification:e}},Ui=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},Gi=function(n,e,t){return n<=e?e:t<=n?t:n},qi=function(e,t,n){var r=Ai(e.element(),"."+t.highlightClass());bn(r,function(n){eo(n,t.highlightClass()),e.getSystem().getByDom(n).each(function(n){t.onDehighlight()(e,n)})})},Yi=function(n,e,t,r){var o=Ki(n,e,t,r);qi(n,e),no(r.element(),e.highlightClass()),o||e.onHighlight()(n,r)},Ki=function(n,e,t,r){return ro(r.element(),e.highlightClass())},Xi=function(n,e,t,r){var o=Ai(n.element(),"."+e.itemClass());return F.from(o[r]).fold(function(){return Qe.error("No element found with index "+r)},n.getSystem().getByDom)},Ji=function(e,n,t){return Ri(e.element(),"."+n.itemClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Qi=function(e,n,t){var r=Ai(e.element(),"."+n.itemClass());return(0<r.length?F.some(r[r.length-1]):F.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Zi=function(t,e,n,r){var o=Ai(t.element(),"."+e.itemClass());return On(o,function(n){return ro(n,e.highlightClass())}).bind(function(n){var e=Ui(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})},nu=Object.freeze({dehighlightAll:qi,dehighlight:function(n,e,t,r){var o=Ki(n,e,t,r);eo(r.element(),e.highlightClass()),o&&e.onDehighlight()(n,r)},highlight:Yi,highlightFirst:function(e,t,r){Ji(e,t).each(function(n){Yi(e,t,r,n)})},highlightLast:function(e,t,r){Qi(e,t).each(function(n){Yi(e,t,r,n)})},highlightAt:function(e,t,r,n){Xi(e,t,r,n).fold(function(n){throw new Error(n)},function(n){Yi(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Ai(e.element(),"."+t.itemClass()),i=Eo(yn(o,function(n){return e.getSystem().getByDom(n).toOption()}));Sn(i,n).each(function(n){Yi(e,t,r,n)})},isHighlighted:Ki,getHighlighted:function(e,n,t){return Ri(e.element(),"."+n.highlightClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:Ji,getLast:Qi,getPrevious:function(n,e,t){return Zi(n,e,0,-1)},getNext:function(n,e,t){return Zi(n,e,0,1)}}),eu=[Jt("highlightClass"),Jt("itemClass"),jo("onHighlight"),jo("onDehighlight")],tu=zr({fields:eu,name:"highlighting",apis:nu}),ru=function(){return{get:function(n){return vo(n.element())},set:function(n,e){n.getSystem().triggerFocus(e,n.element())}}},ou=function(n,e,c,t,r,i){var u=function(e,t,r,o){var n,i,u=c(e,t,r,o);return(n=u,i=t.event(),Sn(n,function(n){return n.matches(i)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([or("focusManager",ru()),Po("handler",o),Po("state",e)])},processKey:u,toEvents:function(r,o){var n=t(r,o),e=sr(i.map(function(t){return lr(Pn(),function(n,e){t(n,r,o,e),e.stop()})}).toArray().concat([lr(U(),function(n,e){u(n,e,r,o).each(function(n){e.stop()})})]));return k(n,e)},toApis:r};return o},iu=function(n){var e=[er("onEscape"),er("onEnter"),or("selector",'[data-alloy-tabstop="true"]'),or("firstTabstop",0),or("useTabstopAt",A(!0)),er("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector().bind(function(n){return Bi(e,n)}).getOr(e);return 0<Ei(t)},c=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt()(t);var e,t}).fold(function(){return r.cyclic()?F.some(!0):F.none()},function(n){return r.focusManager().set(e,n),F.some(!0)})},i=function(e,n,t,r){var o,i,u=Ai(e.element(),t.selector());return(o=e,i=t,i.focusManager().get(o).bind(function(n){return Bi(n,i.selector())})).bind(function(n){return On(u,l(Re,n)).bind(function(n){return c(e,u,n,t,r)})})},t=A([Wi(zi([Li,Hi([9])]),function(n,e,t,r){var o=t.cyclic()?Vi:Ni;return i(n,0,t,o)}),Wi(Hi([9]),function(n,e,t,r){var o=t.cyclic()?_i:ji;return i(n,0,t,o)}),Wi(Hi([27]),function(e,t,n,r){return n.onEscape().bind(function(n){return n(e,t)})}),Wi(zi([$i,Hi([13])]),function(e,t,n,r){return n.onEnter().bind(function(n){return n(e,t)})})]),r=A({}),o=A({});return ou(e,Nr.init,t,r,o,F.some(function(e,t){var n,r,o,i;(n=e,r=t,o=Ai(n.element(),r.selector()),i=wn(o,function(n){return u(r,n)}),F.from(i[r.firstTabstop()])).each(function(n){t.focusManager().set(e,n)})}))},uu=iu(ur("cyclic",A(!1))),cu=iu(ur("cyclic",A(!0))),au=function(n){return"input"===me(n)&&"radio"!==Gr(n,"type")||"textarea"===me(n)},su=function(n,e,t){return au(t)&&Hi([32])(e.event())?F.none():(re(n,t,Un()),F.some(!0))},fu=[or("execute",su),or("useSpace",!1),or("useEnter",!0),or("useControlEnter",!1),or("useDown",!1)],lu=function(n,e,t){return t.execute()(n,e,n.element())},du=A({}),mu=A({}),gu=ou(fu,Nr.init,function(n,e,t,r){var o=t.useSpace()&&!au(n.element())?[32]:[],i=t.useEnter()?[13]:[],u=t.useDown()?[40]:[],c=o.concat(i).concat(u);return[Wi(Hi(c),lu)].concat(t.useControlEnter()?[Wi(zi([Pi,Hi([13])]),lu)]:[])},du,mu,F.none()),pu=function(n){var t=ao(F.none());return _r({readState:A({}),setGridSize:function(n,e){t.set(F.some({numRows:A(n),numColumns:A(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},vu=Object.freeze({flatgrid:pu,init:function(n){return n.state()(n)}}),hu=function(e,t){return function(n){return"rtl"===yu(n)?t:e}},yu=function(n){return"rtl"===yi(n,"direction")?"rtl":"ltr"},bu=function(i){return function(n,e,t,r){var o=i(n.element());return Su(o,n,e,t,r)}},wu=function(n,e){var t=hu(n,e);return bu(t)},xu=function(n,e){var t=hu(e,n);return bu(t)},Tu=function(o){return function(n,e,t,r){return Su(o,n,e,t,r)}},Su=function(e,t,n,r,o){return r.focusManager().get(t).bind(function(n){return e(t.element(),n,r,o)}).map(function(n){return r.focusManager().set(t,n),!0})},Ou=Tu,ku=Tu,Cu=Tu,Eu=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},Du=Ce(["index","candidates"],[]),Iu=function(n,e,t){return Au(n,e,t)},Au=function(n,e,t,r){var o,i=l(Re,e),u=Ai(n,t),c=wn(u,Eu);return On(o=c,i).map(function(n){return Du({index:n,candidates:o})})},Mu=function(n,e){return On(n,function(n){return Re(e,n)})},Fu=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row()*r+n.column();return 0<=e&&e<t.length?F.some(t[e]):F.none()})},Ru=function(o,n,i,u,c){return Fu(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=Ui(e,c,0,t-1);return F.some({row:A(n),column:A(r)})})},Bu=function(i,n,u,c,a){return Fu(i,n,c,function(n,e){var t=Ui(n,a,0,u-1),r=t===u-1?i.length-t*c:c,o=Gi(e,0,r-1);return F.some({row:A(t),column:A(o)})})},Vu=[Jt("selector"),or("execute",su),Ho("onEscape"),or("captureTab",!1),Wo()],Nu=function(o){return function(n,e,t,r){return Iu(n,e,t.selector()).bind(function(n){return o(n.candidates(),n.index(),r.getNumRows().getOr(t.initSize().numRows()),r.getNumColumns().getOr(t.initSize().numColumns()))})}},_u=function(n,e,t,r){return t.captureTab()?F.some(!0):F.none()},ju=Nu(function(n,e,t,r){return Ru(n,e,t,r,-1)}),Hu=Nu(function(n,e,t,r){return Ru(n,e,t,r,1)}),zu=Nu(function(n,e,t,r){return Bu(n,e,t,r,-1)}),Lu=Nu(function(n,e,t,r){return Bu(n,e,t,r,1)}),Pu=A([Wi(Hi([37]),wu(ju,Hu)),Wi(Hi([39]),xu(ju,Hu)),Wi(Hi([38]),Ou(zu)),Wi(Hi([40]),ku(Lu)),Wi(zi([Li,Hi([9])]),_u),Wi(zi([$i,Hi([9])]),_u),Wi(Hi([27]),function(n,e,t,r){return t.onEscape()(n,e)}),Wi(Hi([32].concat([13])),function(e,t,r,n){return(o=e,i=r,i.focusManager().get(o).bind(function(n){return Bi(n,i.selector())})).bind(function(n){return r.execute()(e,t,n)});var o,i})]),$u=A({}),Wu=ou(Vu,pu,Pu,$u,{},F.some(function(e,t,n){Ri(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Uu=function(n,e,t,o){return Iu(n,t,e).bind(function(n){var e=n.index(),t=n.candidates(),r=Ui(e,o,0,t.length-1);return F.from(t[r])})},Gu=[Jt("selector"),or("getInitial",F.none),or("execute",su),or("executeOnMove",!1),or("allowVertical",!0)],qu=function(e,t,r){return(n=e,o=r,o.focusManager().get(n).bind(function(n){return Bi(n,o.selector())})).bind(function(n){return r.execute()(e,t,n)});var n,o},Yu=function(n,e,t){return Uu(n,t.selector(),e,-1)},Ku=function(n,e,t){return Uu(n,t.selector(),e,1)},Xu=function(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove()?qu(n,e,t):F.some(!0)})}},Ju=A({}),Qu=A({}),Zu=ou(Gu,Nr.init,function(n,e,t,r){var o=[37].concat(t.allowVertical()?[38]:[]),i=[39].concat(t.allowVertical()?[40]:[]);return[Wi(Hi(o),Xu(wu(Yu,Ku))),Wi(Hi(i),Xu(xu(Yu,Ku))),Wi(Hi([13]),qu),Wi(Hi([32]),qu)]},Ju,Qu,F.some(function(e,t){t.getInitial()(e).or(Ri(e.element(),t.selector())).each(function(n){t.focusManager().set(e,n)})})),nc=Ce(["rowIndex","columnIndex","cell"],[]),ec=function(n,e,t){return F.from(n[e]).bind(function(n){return F.from(n[t]).map(function(n){return nc({rowIndex:e,columnIndex:t,cell:n})})})},tc=function(n,e,t,r){var o=n[e].length,i=Ui(t,r,0,o-1);return ec(n,e,i)},rc=function(n,e,t,r){var o=Ui(t,r,0,n.length-1),i=n[o].length,u=Gi(e,0,i-1);return ec(n,o,u)},oc=function(n,e,t,r){var o=n[e].length,i=Gi(t+r,0,o-1);return ec(n,e,i)},ic=function(n,e,t,r){var o=Gi(t+r,0,n.length-1),i=n[o].length,u=Gi(e,0,i-1);return ec(n,o,u)},uc=[nr("selectors",[Jt("row"),Jt("cell")]),or("cycles",!0),or("previousSelector",F.none),or("execute",su)],cc=function(n,e){return function(t,r,i){var u=i.cycles()?n:e;return Bi(r,i.selectors().row()).bind(function(n){var e=Ai(n,i.selectors().cell());return Mu(e,r).bind(function(r){var o=Ai(t,i.selectors().row());return Mu(o,n).bind(function(n){var e,t=(e=i,yn(o,function(n){return Ai(n,e.selectors().cell())}));return u(t,n,r).map(function(n){return n.cell()})})})})}},ac=cc(function(n,e,t){return tc(n,e,t,-1)},function(n,e,t){return oc(n,e,t,-1)}),sc=cc(function(n,e,t){return tc(n,e,t,1)},function(n,e,t){return oc(n,e,t,1)}),fc=cc(function(n,e,t){return rc(n,t,e,-1)},function(n,e,t){return ic(n,t,e,-1)}),lc=cc(function(n,e,t){return rc(n,t,e,1)},function(n,e,t){return ic(n,t,e,1)}),dc=A([Wi(Hi([37]),wu(ac,sc)),Wi(Hi([39]),xu(ac,sc)),Wi(Hi([38]),Ou(fc)),Wi(Hi([40]),ku(lc)),Wi(Hi([32].concat([13])),function(e,t,r){return vo(e.element()).bind(function(n){return r.execute()(e,t,n)})})]),mc=A({}),gc=A({}),pc=ou(uc,Nr.init,dc,mc,gc,F.some(function(e,t){t.previousSelector()(e).orThunk(function(){var n=t.selectors();return Ri(e.element(),n.cell())}).each(function(n){t.focusManager().set(e,n)})})),vc=[Jt("selector"),or("execute",su),or("moveOnTab",!1)],hc=function(e,t,r){return r.focusManager().get(e).bind(function(n){return r.execute()(e,t,n)})},yc=function(n,e,t){return Uu(n,t.selector(),e,-1)},bc=function(n,e,t){return Uu(n,t.selector(),e,1)},wc=A([Wi(Hi([38]),Cu(yc)),Wi(Hi([40]),Cu(bc)),Wi(zi([Li,Hi([9])]),function(n,e,t){return t.moveOnTab()?Cu(yc)(n,e,t):F.none()}),Wi(zi([$i,Hi([9])]),function(n,e,t){return t.moveOnTab()?Cu(bc)(n,e,t):F.none()}),Wi(Hi([13]),hc),Wi(Hi([32]),hc)]),xc=A({}),Tc=A({}),Sc=ou(vc,Nr.init,wc,xc,Tc,F.some(function(e,t){Ri(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Oc=[Ho("onSpace"),Ho("onEnter"),Ho("onShiftEnter"),Ho("onLeft"),Ho("onRight"),Ho("onTab"),Ho("onShiftTab"),Ho("onUp"),Ho("onDown"),Ho("onEscape"),er("focusIn")],kc=ou(Oc,Nr.init,function(n,e,t){return[Wi(Hi([32]),t.onSpace()),Wi(zi([$i,Hi([13])]),t.onEnter()),Wi(zi([Li,Hi([13])]),t.onShiftEnter()),Wi(zi([Li,Hi([9])]),t.onShiftTab()),Wi(zi([$i,Hi([9])]),t.onTab()),Wi(Hi([38]),t.onUp()),Wi(Hi([40]),t.onDown()),Wi(Hi([37]),t.onLeft()),Wi(Hi([39]),t.onRight()),Wi(Hi([32]),t.onSpace()),Wi(Hi([27]),t.onEscape())]},function(){return{}},function(){return{}},F.some(function(e,t){return t.focusIn().bind(function(n){return n(e,t)})})),Cc=uu.schema(),Ec=cu.schema(),Dc=Zu.schema(),Ic=Wu.schema(),Ac=pc.schema(),Mc=gu.schema(),Fc=Sc.schema(),Rc=kc.schema(),Bc=(ki=Ut("Creating behaviour: "+(Oi={branchKey:"mode",branches:Object.freeze({acyclic:Cc,cyclic:Ec,flow:Dc,flatgrid:Ic,matrix:Ac,execution:Mc,menu:Fc,special:Rc}),name:"keying",active:{events:function(n,e){return n.handler().toEvents(n,e)}},apis:{focusIn:function(n){n.getSystem().triggerFocus(n.element(),n.element())},setGridSize:function(n,e,t,r,o){xt(t,"setGridSize")?t.setGridSize(r,o):p.console.error("Layout does not support setGridSize")}},state:vu}).name,Lr,Oi),Er(Yt(ki.branchKey,ki.branches),ki.name,ki.active,ki.apis,ki.extra,ki.state)),Vc=function(r,n){return e=r,t={},o=yn(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,jt(e,e,rt(),Ft(function(n){return Qe.error("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([ur("dump",h)]),jt(e,e,et(t),Bt(o));var e,t,o},Nc=function(n){return n.dump()},_c="placeholder",jc=Ze([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Hc=function(n,e,t,r){return t.uiType===_c?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?jc.single(!0,A(i)):ht(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+R(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+kt(i,null,2))},function(n){return n.replace()})):jc.single(!1,A(t));var o,i,u},zc=function(i,u,c,a){return Hc(i,0,c,a).fold(function(n,e){var t=e(u,c.config,c.validated),r=ht(t,"components").getOr([]),o=Cn(r,function(n){return zc(i,u,n,a)});return[k(t,{components:o})]},function(n,e){return e(u,c.config,c.validated)})},Lc=function(e,t,n,r){var o,i,u,c=V(r,function(n,e){return r=n,o=!1,{name:A(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(!0===o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),a=(o=e,i=t,u=c,Cn(n,function(n){return zc(o,i,n,u)}));return B(c,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+kt(t.components(),null,2))}),a},Pc=jc.single,$c=jc.multiple,Wc=A(_c),Uc=0,Gc=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Uc+String(e)},qc=Ze([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Yc=or("factory",{sketch:h}),Kc=or("schema",[]),Xc=Jt("name"),Jc=jt("pname","pname",ot(function(n){return"<alloy."+Gc(n.name)+">"}),Kt()),Qc=or("defaults",A({})),Zc=or("overrides",A({})),na=Bt([Yc,Kc,Xc,Jc,Qc,Zc]),ea=Bt([Yc,Kc,Xc,Jc,Qc,Zc]),ta=Bt([Yc,Kc,Xc,Jt("unit"),Jc,Qc,Zc]),ra=function(n){var e=function(n){return n.name()};return n.fold(e,e,e,e)},oa=function(t,r){return function(n){var e=Gt("Converting part type",r,n);return t(e)}},ia=oa(qc.required,na),ua=oa(qc.optional,ea),ca=oa(qc.group,ta),aa=A("entirety"),sa=function(n,e,t,r){var o=t;return k(e.defaults()(n,t,r),t,{uid:n.partUids()[e.name()]},e.overrides()(n,t,r),{"debug.sketcher":yt("part-"+e.name(),o)})},fa=function(o,n){var i={};return bn(n,function(n){var e;(e=n,e.fold(F.some,F.none,F.some,F.some)).each(function(t){var r=la(o,t.pname());i[t.name()]=function(n){var e=Ut("Part: "+t.name()+" in "+o,Bt(t.schema()),n);return k(r,{config:n,validated:e})}})}),i},la=function(n,e){return{uiType:Wc(),owner:n,name:e}},da=function(n,e,t){return r=e,i={},o={},bn(t,function(n){n.fold(function(r){i[r.pname()]=Pc(!0,function(n,e,t){return r.factory().sketch(sa(n,r,e,t))})},function(n){var e=r.parts()[n.name()]();o[n.name()]=A(sa(r,n,e[aa()]()))},function(r){i[r.pname()]=Pc(!1,function(n,e,t){return r.factory().sketch(sa(n,r,e,t))})},function(o){i[o.pname()]=$c(!0,function(e,n,t){var r=e[o.name()]();return yn(r,function(n){return o.factory().sketch(k(o.defaults()(e,n),n,o.overrides()(e,n)))})})})}),{internals:A(i),externals:A(o)};var r,i,o},ma=function(n,e,t){return Lc(F.some(n),e,e.components(),t)},ga=function(n,e,t){var r=e.partUids()[t];return n.getSystem().getByUid(r).toOption()},pa=function(n,e,t){return ga(n,e,t).getOrDie("Could not find part: "+t)},va=function(e,n){var t=yn(n,ra);return bt(yn(t,function(n){return{key:n,value:e+"-"+n}}))},ha=function(e){return jt("partUids","partUids",it(function(n){return va(n.uid,e)}),Kt())},ya=Gc("alloy-premade"),ba=Gc("api"),wa=function(n){return yt(ya,n)},xa=function(o){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var r=n.config(ba);return o.apply(undefined,[r].concat([n].concat(e)))},e=o.toString(),t=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:wr(i.slice(1))}},n;var n,e,t,r,i},Ta=A(ba),Sa=A("alloy-id-"),Oa=A("data-alloy-id"),ka=Sa(),Ca=Oa(),Ea=function(n){var e=pe(n)?Gr(n,Ca):null;return F.from(e)},Da=function(n){return Gc(n)},Ia=function(n,e,t,r,o){var i,u,c=(u=o,(0<(i=r).length?[nr("parts",i)]:[]).concat([Jt("uid"),or("dom",{}),or("components",[]),$o("originalSpec"),or("debug.sketcher",{})]).concat(u));return Gt(n+" [SpecSchema]",Rt(c.concat(e)),t)},Aa=function(n,e,t,r,o){var i=Ma(o),u=Cn(t,function(n){return n.fold(F.none,F.some,F.none,F.none).map(function(n){return nr(n.name(),n.schema().concat([$o(aa())]))}).toArray()}),c=ha(t),a=Ia(n,e,i,u,[c]),s=da(0,a,t),f=ma(n,a,s.internals());return k(r(a,f,i,s.externals()),{"debug.sketcher":yt(n,o)})},Ma=function(n){return k({uid:Da("uid")},n)},Fa=Rt([Jt("name"),Jt("factory"),Jt("configFields"),or("apis",{}),or("extraApis",{})]),Ra=Rt([Jt("name"),Jt("factory"),Jt("configFields"),Jt("partFields"),or("apis",{}),or("extraApis",{})]),Ba=function(n){var c=Ut("Sketcher for "+n.name,Fa,n),e=V(c.apis,xa),t=V(c.extraApis,function(n,e){return xr(n,e)});return k({name:A(c.name),partFields:A([]),configFields:A(c.configFields),sketch:function(n){return e=c.name,t=c.configFields,r=c.factory,i=Ma(o=n),u=Ia(e,t,i,[],[]),k(r(u,i),{"debug.sketcher":yt(e,o)});var e,t,r,o,i,u}},e,t)},Va=function(n){var e=Ut("Sketcher for "+n.name,Ra,n),t=fa(e.name,e.partFields),r=V(e.apis,xa),o=V(e.extraApis,function(n,e){return xr(n,e)});return k({name:A(e.name),partFields:A(e.partFields),configFields:A(e.configFields),sketch:function(n){return Aa(e.name,e.configFields,e.partFields,e.factory,n)},parts:A(t)},r,o)},Na=Ba({name:"Button",factory:function(n){var e,t,r,o=(e=n.action(),t=function(n,e){e.stop(),te(n)},r=zn.detect().deviceType.isTouch()?[lr(qn(),t)]:[lr(Y(),t),lr(L(),function(n,e){e.cut()})],sr(kn([e.map(function(t){return lr(Un(),function(n,e){t(n),e.stop()})}).toArray(),r]))),i=ht(n.dom(),"attributes").bind(pt("type")),u=ht(n.dom(),"tag");return{uid:n.uid(),dom:n.dom(),components:n.components(),events:o,behaviours:k(jr([mi.config({}),Bc.config({mode:"execution",useSpace:!0,useEnter:!0})]),Nc(n.buttonBehaviours())),domModification:{attributes:k(i.fold(function(){return u.is("button")?{type:"button"}:{}},function(n){return{}}),{role:n.role().getOr("button")})},eventOrder:n.eventOrder()}},configFields:[or("uid",undefined),Jt("dom"),or("components",[]),Vc("buttonBehaviours",[mi,Bc]),er("action"),er("role"),or("eventOrder",{})]}),_a=zr({fields:[],name:"unselecting",active:Object.freeze({events:function(n){return sr([fr(X(),A(!0))])},exhibit:function(n,e){return Or({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),ja=function(n){var e,t,r,o=ue.fromHtml(n),i=_e(o),u=(t=(e=o).dom().attributes!==undefined?e.dom().attributes:[],Tn(t,function(n,e){return"class"===e.name?n:k(n,yt(e.name,e.value))},{})),c=(r=o,Array.prototype.slice.call(r.dom().classList,0)),a=0===i.length?{}:{innerHtml:xo(o)};return k({tag:me(o),classes:c,attributes:u},a)},Ha=function(n){var e,o,t=(e=n,o={prefix:ai.prefix()},e.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r.toString():n}));return ja(t)},za=function(n){return{dom:Ha(n)}},La=function(n){return jr([ri.config({toggleClass:ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),oi(n,function(n,e){(e?ri.on:ri.off)(n)})])},Pa=function(n,e,t){return Na.sketch({dom:Ha('<span class="${prefix}-toolbar-button ${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:e,buttonBehaviours:k(jr([_a.config({})]),t)})},$a={forToolbar:Pa,forToolbarCommand:function(n,e){return Pa(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,r){var o=La(t);return Pa(e,r,o)},forToolbarStateCommand:function(n,e){var t=La(e);return Pa(e,function(){n.execCommand(e)},t)}},Wa=function(t,r){return{left:A(t),top:A(r),translate:function(n,e){return Wa(t+n,r+e)}}},Ua=Wa,Ga=function(n,e,t){return Math.max(e,Math.min(t,n))},qa=function(n,e,t,r,o,i,u){var c=t-e;if(r<n.left)return e-1;if(r>n.right)return t+1;var a,s,f,l,d=Math.min(n.right,Math.max(r,n.left))-n.left,m=Ga(d/n.width*c+e,e-1,t+1),g=Math.round(m);return i&&e<=m&&m<=t?(a=m,s=e,f=t,l=o,u.fold(function(){var n=a-s,e=Math.round(n/l)*l;return Ga(s+e,s-1,f+1)},function(n){var e=(a-n)%l,t=Math.round(e/l),r=Math.floor((a-n)/l),o=Math.floor((f-n)/l),i=n+Math.min(o,r+t)*l;return Math.max(n,i)})):g},Ya="slider.change.value",Ka=zn.detect().deviceType.isTouch(),Xa=function(n){return function(n){var e=n.event().raw();if(Ka){var t=e;return t.touches!==undefined&&1===t.touches.length?F.some(t.touches[0]).map(function(n){return Ua(n.clientX,n.clientY)}):F.none()}var r=e;return r.clientX!==undefined?F.some(r).map(function(n){return Ua(n.clientX,n.clientY)}):F.none()}(n).map(function(n){return n.left()})},Ja=function(n,e){ee(n,Ya,{value:e})},Qa=function(i,u,c,n){return Xa(n).map(function(n){var e,t,r,o;return e=i,r=n,o=qa(c,(t=u).min(),t.max(),r,t.stepSize(),t.snapToGrid(),t.snapStart()),Ja(e,o),n})},Za=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),t<r?t:o<t?o:t===r?r-1:Math.max(r,t-i));Ja(n,u)},ns=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),o<t?t:t<r?r:t===o?o+1:Math.min(o,t+i));Ja(n,u)},es=zn.detect().deviceType.isTouch(),ts=function(n,r){return ua({name:n+"-edge",overrides:function(n){var e=sr([dr(j(),r,[n])]),t=sr([dr(L(),r,[n]),dr(P(),function(n,e){e.mouseIsDown().get()&&r(n,e)},[n])]);return{events:es?e:t}}})},rs=[ts("left",function(n,e){Ja(n,e.min()-1)}),ts("right",function(n,e){Ja(n,e.max()+1)}),ia({name:"thumb",defaults:A({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:sr([gr(j(),n,"spectrum"),gr(H(),n,"spectrum"),gr(z(),n,"spectrum")])}}}),ia({schema:[ur("mouseIsDown",function(){return ao(!1)})],name:"spectrum",overrides:function(r){var t=function(n,e){var t=n.element().dom().getBoundingClientRect();Qa(n,r,t,e)},n=sr([lr(j(),t),lr(H(),t)]),e=sr([lr(L(),t),lr(P(),function(n,e){r.mouseIsDown().get()&&t(n,e)})]);return{behaviours:jr(es?[]:[Bc.config({mode:"special",onLeft:function(n){return Za(n,r),F.some(!0)},onRight:function(n){return ns(n,r),F.some(!0)}}),mi.config({})]),events:es?n:e}}})],os=function(n,e,t){e.store().manager().onLoad(n,e,t)},is=function(n,e,t){e.store().manager().onUnload(n,e,t)},us=Object.freeze({onLoad:os,onUnload:is,setValue:function(n,e,t,r){e.store().manager().setValue(n,e,t,r)},getValue:function(n,e,t){return e.store().manager().getValue(n,e,t)}}),cs=Object.freeze({events:function(t,r){var n=t.resetOnDom()?[vr(function(n,e){os(n,t,r)}),hr(function(n,e){is(n,t,r)})]:[Cr(t,r,os)];return sr(n)}}),as=function(){var n=ao(null);return _r({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},ss=function(){var n=ao({});return _r({readState:function(){return{mode:"dataset",dataset:n.get()}},set:n.set,get:n.get})},fs=Object.freeze({memory:as,dataset:ss,manual:function(){return _r({readState:function(){}})},init:function(n){return n.store().manager().state(n)}}),ls=function(n,e,t,r){e.store().getDataKey(),t.set({}),e.store().setData()(n,r),e.onSetValue()(n,r)},ds=[er("initialValue"),Jt("getFallbackEntry"),Jt("getDataKey"),Jt("setData"),Po("manager",{setValue:ls,getValue:function(n,e,t){var r=e.store().getDataKey()(n),o=t.get();return ht(o,r).fold(function(){return e.store().getFallbackEntry()(r)},function(n){return n})},onLoad:function(e,t,r){t.store().initialValue().each(function(n){ls(e,t,r,n)})},onUnload:function(n,e,t){t.set({})},state:ss})],ms=[Jt("getValue"),or("setValue",I),er("initialValue"),Po("manager",{setValue:function(n,e,t,r){e.store().setValue()(n,r),e.onSetValue()(n,r)},getValue:function(n,e,t){return e.store().getValue()(n)},onLoad:function(e,t,n){t.store().initialValue().each(function(n){t.store().setValue()(e,n)})},onUnload:I,state:Nr.init})],gs=[er("initialValue"),Po("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue()(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store().initialValue().each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:as})],ps=[ir("store",{mode:"memory"},Yt("mode",{memory:gs,manual:ms,dataset:ds})),jo("onSetValue"),or("resetOnDom",!1)],vs=zr({fields:ps,name:"representing",active:cs,apis:us,extra:{setValueFrom:function(n,e){var t=vs.getValue(e);vs.setValue(n,t)}},state:fs}),hs=zn.detect().deviceType.isTouch(),ys=[Jt("min"),Jt("max"),or("stepSize",1),or("onChange",I),or("onInit",I),or("onDragStart",I),or("onDragEnd",I),or("snapToGrid",!1),er("snapStart"),Jt("getInitialValue"),Vc("sliderBehaviours",[Bc,vs]),ur("value",function(n){return ao(n.min)})].concat(hs?[]:[ur("mouseIsDown",function(){return ao(!1)})]),bs=Si("width",function(n){return n.dom().offsetWidth}),ws=function(n,e){bs.set(n,e)},xs=function(n){return bs.get(n)},Ts=zn.detect().deviceType.isTouch(),Ss=Va({name:"Slider",configFields:ys,partFields:rs,factory:function(a,n,e,t){var s=a.max()-a.min(),f=function(n){var e=n.element().dom().getBoundingClientRect();return(e.left+e.right)/2},o=function(n){return pa(n,a,"thumb")},i=function(n){var e,t,r,o,i=pa(n,a,"spectrum").element().dom().getBoundingClientRect(),u=n.element().dom().getBoundingClientRect(),c=(e=n,t=i,(o=(r=a).value().get())<r.min()?ga(e,r,"left-edge").fold(function(){return 0},function(n){return f(n)-t.left}):o>r.max()?ga(e,r,"right-edge").fold(function(){return t.width},function(n){return f(n)-t.left}):(r.value().get()-r.min())/s*t.width);return i.left-u.left+c},u=function(n){var e=i(n),t=o(n),r=xs(t.element())/2;vi(t.element(),"left",e-r+"px")},r=function(n,e){var t=a.value().get(),r=o(n);return t!==e||wi(r.element(),"left").isNone()?(a.value().set(e),u(n),a.onChange()(n,r,e),F.some(!0)):F.none()},c=Ts?[lr(j(),function(n,e){a.onDragStart()(n,o(n))}),lr(z(),function(n,e){a.onDragEnd()(n,o(n))})]:[lr(L(),function(n,e){e.stop(),a.onDragStart()(n,o(n)),a.mouseIsDown().set(!0)}),lr($(),function(n,e){a.onDragEnd()(n,o(n)),a.mouseIsDown().set(!1)})];return{uid:a.uid(),dom:a.dom(),components:n,behaviours:k(jr(kn([Ts?[]:[Bc.config({mode:"special",focusIn:function(n){return ga(n,a,"spectrum").map(Bc.focusIn).map(A(!0))}})],[vs.config({store:{mode:"manual",getValue:function(n){return a.value().get()}}})]])),Nc(a.sliderBehaviours())),events:sr([lr(Ya,function(n,e){r(n,e.event().value())}),vr(function(n,e){a.value().set(a.getInitialValue()());var t=o(n);u(n),a.onInit()(n,t,a.value().get())})].concat(c)),apis:{resetToMin:function(n){r(n,a.min())},resetToMax:function(n){r(n,a.max())},refresh:u},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Os=function(e,t,r){return $a.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{})},ks=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},Ss.sketch({dom:Ha('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Ss.parts()["left-edge"](za('<div class="${prefix}-hue-slider-black"></div>')),Ss.parts().spectrum({dom:Ha('<div class="${prefix}-slider-gradient-container"></div>'),components:[za('<div class="${prefix}-slider-gradient"></div>')],behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])}),Ss.parts()["right-edge"](za('<div class="${prefix}-hue-slider-white"></div>')),Ss.parts().thumb({dom:Ha('<div class="${prefix}-slider-thumb"></div>'),behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t);vi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){ri.on(e)},onDragEnd:function(n,e){ri.off(e)},onInit:function(n,e,t){var r=i(t);vi(e.element(),"background-color",r)},stepSize:10,min:0,max:360,getInitialValue:o.getInitialValue,sliderBehaviours:jr([ii(Ss.refresh)])}))];var o,i},Cs=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Os(n,"color",function(){return ks(e)})},Es=Rt([Jt("getInitialValue"),Jt("onChange"),Jt("category"),Jt("sizes")]),Ds=function(n){var o=Ut("SizeSlider",Es,n);return Ss.sketch({dom:{tag:"div",classes:[ai.resolve("slider-"+o.category+"-size-container"),ai.resolve("slider"),ai.resolve("slider-size-container")]},onChange:function(n,e,t){var r;0<=(r=t)&&r<o.sizes.length&&o.onChange(t)},onDragStart:function(n,e){ri.on(e)},onDragEnd:function(n,e){ri.off(e)},min:0,max:o.sizes.length-1,stepSize:1,getInitialValue:o.getInitialValue,snapToGrid:!0,sliderBehaviours:jr([ii(Ss.refresh)]),components:[Ss.parts().spectrum({dom:Ha('<div class="${prefix}-slider-size-container"></div>'),components:[za('<div class="${prefix}-slider-size-line"></div>')]}),Ss.parts().thumb({dom:Ha('<div class="${prefix}-slider-thumb"></div>'),behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])})]})},Is=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],As=function(n){var e,t,r=n.selection.getStart(),o=ue.fromDom(r),i=ue.fromDom(n.getBody()),u=(e=function(n){return Re(i,n)},(pe(t=o)?F.some(t):Ne(t).filter(pe)).map(function(n){return lo(n,function(n){return wi(n,"font-size").isSome()},e).bind(function(n){return wi(n,"font-size")}).getOrThunk(function(){return yi(n,"font-size")})}).getOr(""));return Sn(Is,function(n){return u===n}).getOr("medium")},Ms={candidates:A(Is),get:function(n){var e,t=As(n);return(e=t,On(Is,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,F.from(Is[e])).each(function(n){var e,t;t=n,As(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},Fs=Ms.candidates(),Rs=function(n){return[za('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Ds({onChange:e.onChange,sizes:Fs,category:"font",getInitialValue:e.getInitialValue})),za('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},Bs=function(n){var e=n.uid!==undefined&&xt(n,"uid")?n.uid:Da("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(F.none,F.some)},asSpec:function(){return k(n,{uid:e})}}},Vs=window.Promise?window.Promise:function(){var i=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(n,r(o,this),r(c,this))},n=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){p.setTimeout(n,1)};function r(n,e){return function(){return n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function u(r){var o=this;null!==this._state?n(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void f(r(e,n),r(o,this),r(c,this))}this._state=!0,this._value=n,a.call(this)}catch(t){c.call(this,t)}}function c(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds;n<e.length;n++){var t=e[n];u.call(this,t)}this._deferreds=[]}function s(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function f(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}return i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(t,r){var o=this;return new i(function(n,e){u.call(o,new s(t,r,n,e))})},i.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=Array.prototype.slice.call(1===n.length&&t(n[0])?n[0]:n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(n){n(e)})},i.reject=function(t){return new i(function(n,e){e(t)})},i.race=function(o){return new i(function(n,e){for(var t=0,r=o;t<r.length;t++)r[t].then(n,e)})},i}();function Ns(n){return(t=n,new Vs(function(n){var e=new p.FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})).then(function(n){return n.split(",")[1]});var t}var _s,js,Hs,zs,Ls,Ps,$s=function(o,i){var n;(n=i,Ns(n)).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Gc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})},Ws=function(i){var e=Bs({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:sr([pr(Y()),lr(q(),function(n,e){var t,r,o;(t=e,r=t.event(),o=r.raw().target.files||r.raw().dataTransfer.files,F.from(o[0])).each(function(n){$s(i,n)})})])});return Na.sketch({dom:Ha('<span class="${prefix}-toolbar-button ${prefix}-icon-image ${prefix}-icon"></span>'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},Us=function(n){return n.dom().textContent},Gs=function(n){return 0<n.length},qs=function(n){return n===undefined||null===n?"":n},Ys=function(e,t,n){return n.text.filter(Gs).fold(function(){return Gr(n=e,"href")===Us(n)?F.some(t):F.none();var n},F.some)},Ks=function(n){var e=ue.fromDom(n.selection.getStart());return Bi(e,"a")},Xs={getInfo:function(n){return Ks(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:F.none()}},function(n){return t=Us(e=n),r=Gr(e,"href"),o=Gr(e,"title"),i=Gr(e,"target"),{url:qs(r),text:t!==r?qs(t):"",title:qs(o),target:qs(i),link:F.some(e)};var e,t,r,o,i})},applyInfo:function(o,i){i.url.filter(Gs).fold(function(){var e;e=o,i.link.bind(h).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.filter(Gs).each(function(n){t.title=n}),n.target.filter(Gs).each(function(n){t.target=n}),t);i.link.bind(h).fold(function(){var n=i.text.filter(Gs).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=Ys(t,e,i);Ur(t,r),n.each(function(n){var e;e=n,t.dom().textContent=e})})})},query:Ks},Js=zn.detect(),Qs=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},Zs=function(n,e){(Js.os.isAndroid()?Qs:a)(e,n)},nf=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=sr(e),zr({fields:[Jt("enabled")],name:t,active:{events:A(r)}})),configAsRaw:A({}),initialConfig:{},state:Nr}}},ef=Object.freeze({getCurrent:function(n,e,t){return e.find()(n)}}),tf=[Jt("find")],rf=zr({fields:tf,name:"composing",apis:ef}),of=Ba({name:"Container",factory:function(n){return{uid:n.uid(),dom:k({tag:"div",attributes:{role:"presentation"}},n.dom()),components:n.components(),behaviours:Nc(n.containerBehaviours()),events:n.events(),domModification:n.domModification(),eventOrder:n.eventOrder()}},configFields:[or("components",[]),Vc("containerBehaviours",[]),or("events",{}),or("domModification",{}),or("eventOrder",{})]}),uf=Ba({name:"DataField",factory:function(t){return{uid:t.uid(),dom:t.dom(),behaviours:k(jr([vs.config({store:{mode:"memory",initialValue:t.getInitialValue()()}}),rf.config({find:F.some})]),Nc(t.dataBehaviours())),events:sr([vr(function(n,e){vs.setValue(n,t.getInitialValue()())})])}},configFields:[Jt("uid"),Jt("dom"),Jt("getInitialValue"),Vc("dataBehaviours",[vs,rf])]}),cf=function(n){return n.dom().value},af=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},sf=A([er("data"),or("inputAttributes",{}),or("inputStyles",{}),or("type","input"),or("tag","input"),or("inputClasses",[]),jo("onSetValue"),or("styles",{}),er("placeholder"),or("eventOrder",{}),Vc("inputBehaviours",[vs,mi]),or("selectOnFocus",!0)]),ff=function(n){return k(jr([vs.config({store:{mode:"manual",initialValue:n.data().getOr(undefined),getValue:function(n){return cf(n.element())},setValue:function(n,e){cf(n.element())!==e&&af(n.element(),e)}},onSetValue:n.onSetValue()})]),(e=n,jr([mi.config({onFocus:!1===e.selectOnFocus()?I:function(n){var e=n.element(),t=cf(e);e.dom().setSelectionRange(0,t.length)}})])),Nc(n.inputBehaviours()));var e},lf=Ba({name:"Input",configFields:sf(),factory:function(n,e){return{uid:n.uid(),dom:(t=n,{tag:t.tag(),attributes:k(bt([{key:"type",value:t.type()}].concat(t.placeholder().map(function(n){return{key:"placeholder",value:n}}).toArray())),t.inputAttributes()),styles:t.inputStyles(),classes:t.inputClasses()}),components:[],behaviours:ff(n),eventOrder:n.eventOrder()};var t}}),df=Object.freeze({exhibit:function(n,e){return Or({attributes:bt([{key:e.tabAttr(),value:"true"}])})}}),mf=[or("tabAttr","data-alloy-tabstop")],gf=zr({fields:mf,name:"tabstopping",active:df}),pf=function(n,e){var t=Bs(lf.sketch({placeholder:e,onSetValue:function(n,e){ne(n,G())},inputBehaviours:jr([rf.config({find:F.some}),gf.config({}),Bc.config({mode:"execution"})]),selectOnFocus:!1})),r=Bs(Na.sketch({dom:Ha('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);vs.setValue(e,"")}}));return{name:n,spec:of.sketch({dom:Ha('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:jr([ri.config({toggleClass:ai.resolve("input-container-empty")}),rf.config({find:function(n){return F.some(t.get(n))}}),nf("input-clearing",[lr(G(),function(n){var e=t.get(n);(0<vs.getValue(e).length?ri.off:ri.on)(n)})])])})}},vf=["input","button","textarea"],hf=function(n,e,t){e.disabled()&&Sf(n,e)},yf=function(n){return hn(vf,me(n.element()))},bf=function(n){Wr(n.element(),"disabled","disabled")},wf=function(n){Yr(n.element(),"disabled")},xf=function(n){Wr(n.element(),"aria-disabled","true")},Tf=function(n){Wr(n.element(),"aria-disabled","false")},Sf=function(e,n,t){n.disableClass().each(function(n){no(e.element(),n)}),(yf(e)?bf:xf)(e)},Of=function(n){return yf(n)?qr(n.element(),"disabled"):"true"===Gr(n.element(),"aria-disabled")},kf=Object.freeze({enable:function(e,n,t){n.disableClass().each(function(n){eo(e.element(),n)}),(yf(e)?wf:Tf)(e)},disable:Sf,isDisabled:Of,onLoad:hf}),Cf=Object.freeze({exhibit:function(n,e,t){return Or({classes:e.disabled()?e.disableClass().map(In).getOr([]):[]})},events:function(n,e){return sr([fr(Un(),function(n,e){return Of(n)}),Cr(n,e,hf)])}}),Ef=[or("disabled",!1),er("disableClass")],Df=zr({fields:Ef,name:"disabling",active:Cf,apis:kf}),If=[Vc("formBehaviours",[vs])],Af=function(n){return"<alloy.field."+n+">"},Mf=function(o,n,e){return k({"debug.sketcher":{Form:e},uid:o.uid(),dom:o.dom(),components:n,behaviours:k(jr([vs.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),V(e.partUids(),function(n,e){return A(t.getByUid(n))}));return V(r,function(n,e){return n().bind(rf.getCurrent).map(vs.getValue)})},setValue:function(t,n){B(n,function(e,n){ga(t,o,n).each(function(n){rf.getCurrent(n).each(function(n){vs.setValue(n,e)})})})}}})]),Nc(o.formBehaviours())),apis:{getField:function(n,e){return ga(n,o,e).bind(rf.getCurrent)}}})},Ff=(xa(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Af(n),o=e,{uiType:Wc(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=yn(r,function(n){return ia({name:n,pname:Af(n)})});return Aa("form",If,o,Mf,t)}),Rf=function(){var e=ao(F.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(F.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(F.some(n))},run:function(n){e.get().each(n)}}},Bf=function(){var e=ao(F.none());return{clear:function(){e.set(F.none())},set:function(n){e.set(F.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Vf=function(n){return{xValue:n,points:[]}},Nf=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}},_f=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},jf=function(n){var r="navigateEvent",e=Bt([Jt("fields"),or("maxFieldIndex",n.fields.length-1),Jt("onExecute"),Jt("getInitialValue"),ur("state",function(){return{dialogSwipeState:Bf(),currentScreen:ao(0)}})]),u=Ut("SerialisedDialog",e,n),o=function(e,n,t){return Na.sketch({dom:Ha('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ee(n,r,{direction:e})},buttonBehaviours:jr([Df.config({disableClass:ai.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=Ai(n.element(),"."+ai.resolve("serialised-dialog-screen"));Ri(n.element(),"."+ai.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(wi(r,"left").each(function(n){var e=parseInt(n,10),t=xs(i[0]);vi(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},c=function(r){var n=Ai(r.element(),"input");F.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=s.get(r);tu.highlightAt(e,u.state.currentScreen.get())},a=Bs(Ff(function(t){return{dom:Ha('<div class="${prefix}-serialised-dialog"></div>'),components:[of.sketch({dom:Ha('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:yn(u.fields,function(n,e){return e<=u.maxFieldIndex?of.sketch({dom:Ha('<div class="${prefix}-serialised-dialog-screen"></div>'),components:kn([[o(-1,"previous",0<e)],[t.field(n.name,n.spec)],[o(1,"next",e<u.maxFieldIndex)]])}):t.field(n.name,n.spec)})})],formBehaviours:jr([ii(function(n,e){var t;t=e,Ri(n.element(),"."+ai.resolve("serialised-dialog-chain")).each(function(n){vi(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),Bc.config({mode:"special",focusIn:function(n){c(n)},onTab:function(n){return i(n,1),F.some(!0)},onShiftTab:function(n){return i(n,-1),F.some(!0)}}),nf("form-events",[vr(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=s.get(e);tu.highlightFirst(t),u.getInitialValue(e).each(function(n){vs.setValue(e,n)})}),br(u.onExecute),lr(K(),function(n,e){"left"===e.event().raw().propertyName&&c(n)}),lr(r,function(n,e){var t=e.event().direction();i(n,t)})])])}})),s=Bs({dom:Ha('<div class="${prefix}-dot-container"></div>'),behaviours:jr([tu.config({highlightClass:ai.resolve("dot-active"),itemClass:ai.resolve("dot-item")})]),components:Cn(u.fields,function(n,e){return e<=u.maxFieldIndex?[za('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Ha('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),s.asSpec()],behaviours:jr([Bc.config({mode:"special",focusIn:function(n){var e=a.get(n);Bc.focusIn(e)}}),nf("serializer-wrapper-events",[lr(j(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(Vf(t.touches[0].clientX))}),lr(H(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(Nf(n,t.raw().touches[0].clientX))})}),lr(z(),function(r){u.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*_f(n);i(e,t)})})])])}},Hf=J(function(t,r){return[{label:"the link group",items:[jf({fields:[pf("url","Type or paste URL"),pf("text","Link text"),pf("title","Link title"),pf("target","Link target"),(n="link",{name:n,spec:uf.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return F.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return F.some(Xs.getInfo(r))},onExecute:function(n){var e=vs.getValue(n);Xs.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),zf=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Lf=sr([(_s=Pn(),js=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(Re(t=o,n.element())&&!Re(t,r)&&(p.console.warn(Pn()+" did not get interpreted by the desired target. \nOriginator: "+ko(o)+"\nTarget: "+ko(i)+"\nCheck the "+Pn()+" event handlers"),1))},{key:_s,value:cr({can:js})})]),Pf=Object.freeze({events:Lf}),$f=h,Wf=Vr(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),Uf=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+ko(e().element())+" is not in context.")}};return Wf({debugInfo:A("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),isConnected:A(!1)})},Gf=function(n,o){var i={};return B(n,function(n,r){B(n,function(n,e){var t=vt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},qf=function(n,e){return 1<n.length?Qe.error('Multiple behaviours have tried to change DOM "'+e+'". The guilty behaviours are: '+kt(yn(n,function(n){return n.name()}))+". At this stage, this is not supported. Future releases might provide strategies for resolving this."):0===n.length?Qe.value({}):Qe.value(n[0].modification().fold(function(){return{}},function(n){return yt(e,n)}))},Yf=function(u,c){return Tn(u,function(n,e){var t=e.modification().getOr({});return n.bind(function(i){var n=_(t,function(n,e){return i[e]!==undefined?(t=c,r=e,o=u,Qe.error("Mulitple behaviours have tried to change the _"+r+'_ "'+t+'". The guilty behaviours are: '+kt(Cn(o,function(n){return n.modification().getOr({})[r]!==undefined?[n.name()]:[]}),null,2)+". This is not currently supported.")):Qe.value(yt(e,n));var t,r,o});return wt(n,i)})},Qe.value({})).map(function(n){return yt(c,n)})},Kf={classes:function(n,e){var t=Cn(n,function(n){return n.modification().getOr([])});return Qe.value(yt(e,t))},attributes:Yf,styles:Yf,domChildren:qf,defChildren:qf,innerHtml:qf,value:qf},Xf=function(n,e){return t=l.apply(undefined,[n.handler].concat(e)),r=n.purpose(),{cHandler:t,purpose:A(r)};var t,r},Jf=function(n){return n.cHandler},Qf=function(n,e){return{name:A(n),handler:A(e)}},Zf=function(n,e,t){var r,o,i=k(t,(r=n,o={},bn(e,function(n){o[n.name()]=n.handlers(r)}),o));return Gf(i,Qf)},nl=function(n){var e,i=w(e=n)?{can:A(!0),abort:A(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},el=function(n,e,t){var r,o,i=e[t];return i?function(u,c,n,a){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[c](),r=e[c](),o=a.indexOf(t),i=a.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+kt(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+kt(a,null,2));return o<i?-1:i<o?1:0});return Qe.value(t)}catch(r){return Qe.error([r])}}("Event: "+t,"name",n,i).map(function(n){var e=yn(n,function(n){return n.handler()});return ar(e)}):(r=t,o=n,Qe.error(["The event ("+r+') 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: '+kt(yn(o,function(n){return n.name()}),null,2)]))},tl=function(n,i){var e=_(n,function(r,o){return(1===r.length?Qe.value(r[0].handler()):el(r,i,o)).map(function(n){var e=nl(n),t=1<r.length?wn(i,function(e){return hn(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return yt(o,{handler:e,purpose:A(t)})})});return wt(e,{})},rl=function(n){return $t("custom.definition",Rt([jt("dom","dom",tt(),Rt([Jt("tag"),or("styles",{}),or("classes",[]),or("attributes",{}),er("value"),er("innerHtml")])),Jt("components"),Jt("uid"),or("events",{}),or("apis",A({})),jt("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"]},nt.mergeWithThunk(A(e))),Kt()),er("domModification"),$o("originalSpec"),or("debug.sketcher","unknown")]),n);var e},ol=function(n){var e,t={tag:n.dom().tag(),classes:n.dom().classes(),attributes:k((e=n,yt(Oa(),e.uid())),n.dom().attributes()),styles:n.dom().styles(),domChildren:yn(n.components(),function(n){return n.element()})};return Tr(k(t,n.dom().innerHtml().map(function(n){return yt("innerHtml",n)}).getOr({}),n.dom().value().map(function(n){return yt("value",n)}).getOr({})))},il=function(e,n){bn(n,function(n){no(e,n)})},ul=function(e,n){bn(n,function(n){eo(e,n)})},cl=function(e){if(e.domChildren().isSome()&&e.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(n=Sr(e),kt(n,null,2)));return e.domChildren().fold(function(){var n=e.defChildren().getOr([]);return yn(n,sl)},function(n){return n});var n},al=function(n){var e=ue.fromTag(n.tag());Ur(e,n.attributes().getOr({})),il(e,n.classes().getOr([])),hi(e,n.styles().getOr({})),To(e,n.innerHtml().getOr(""));var t=cl(n);return Le(e,t),n.value().each(function(n){af(e,n)}),e},sl=function(n){var e=Tr(n);return al(e)},fl=function(n,e){return t=n,o=yn(r=e,function(n){return tr(n.name(),[Jt("config"),or("state",Nr)])}),i=$t("component.behaviours",Bt(o),t.behaviours).fold(function(n){throw new Error(qt(n)+"\nComplete spec:\n"+kt(t,null,2))},function(n){return n}),{list:r,data:V(i,function(n){var e=n().map(function(n){return{config:n.config(),state:n.state().init(n.config())}});return function(){return e}})};var t,r,o,i},ll=function(n){var e,t,r=(e=ht(n,"behaviours").getOr({}),t=wn(R(e),function(n){return e[n]!==undefined}),yn(t,function(n){return e[n].me}));return fl(n,r)},dl=Vr(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),ml=function(n,e,t){var r,o,i,u,c=ol(n),a=function(e,n,t,r){var o=k({},n);bn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=Gf(o,function(n,e){return{name:function(){return n},modification:e}}),u=V(i,function(n,e){return Cn(n,function(e){return e.modification().fold(function(){return[]},function(n){return[e]})})}),c=_(u,function(e,t){return ht(Kf,t).fold(function(){return Qe.error("Unknown field type: "+t)},function(n){return n(e,t)})});return wt(c,{}).map(Or)}(t,{"alloy.base.modification":(r=n,r.domModification().fold(function(){return Or({})},Or))},e,c).getOrDie();return i=a,u=k({tag:(o=c).tag(),classes:i.classes().getOr([]).concat(o.classes().getOr([])),attributes:C(o.attributes().getOr({}),i.attributes().getOr({})),styles:C(o.styles().getOr({}),i.styles().getOr({}))},i.innerHtml().or(o.innerHtml()).map(function(n){return yt("innerHtml",n)}).getOr({}),kr("domChildren",i.domChildren(),o.domChildren()),kr("defChildren",i.defChildren(),o.defChildren()),i.value().or(o.value()).map(function(n){return yt("value",n)}).getOr({})),Tr(u)},gl=function(n,e,t){var r,o,i,u,c,a,s={"alloy.base.behaviour":(r=n,r.events())};return(o=t,i=n.eventOrder(),u=e,c=s,a=Zf(o,u,c),tl(a,i)).getOrDie()},pl=function(n){var e,t,r,o,i,u,c,a,s,f,l,d,m,g,p=$f(n),v=(e=p,t=vt("components",[])(e),yn(t,yl)),h=k(Pf,p,yt("components",v));return Qe.value((r=h,i=ao(Uf(o=function(){return g})),u=Wt(rl(k(r,{behaviours:undefined}))),c=ll(r),a=c.list,s=c.data,f=ml(u,a,s),l=al(f),d=gl(u,a,s),m=ao(u.components()),g=dl({getSystem:i.get,config:function(n){if(n===Ta())return u.apis();if(y(n))throw new Error("Invalid input: only API constant is allowed");var e=s;return(w(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+kt(r,null,2))})()},hasConfigured:function(n){return w(s[n.name()])},spec:A(r),readState:function(n){return s[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},connect:function(n){i.set(n)},disconnect:function(){i.set(Uf(o))},element:A(l),syncComponents:function(){var n=_e(l),e=Cn(n,function(n){return i.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});m.set(e)},components:m.get,events:A(d)})))},vl=function(n){var e=ue.fromText(n);return hl({element:e})},hl=function(n){var t=Gt("external.component",Rt([Jt("element"),er("uid")]),n),e=ao(Uf());t.uid().each(function(n){var e;e=t.element(),Wr(e,Ca,n)});var r=dl({getSystem:e.get,config:F.none,hasConfigured:A(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(Uf(function(){return r}))},element:A(t.element()),spec:A(n),readState:A("No state"),syncComponents:I,components:A([]),events:A({})});return wa(r)},yl=function(e){return(n=e,ht(n,ya)).fold(function(){var n=k({uid:Da("")},e);return pl(n).getOrDie()},function(n){return n});var n},bl=wa,wl="alloy.item-hover",xl="alloy.item-focus",Tl=function(n){(vo(n.element()).isNone()||mi.isFocused(n))&&(mi.isFocused(n)||mi.focus(n),ee(n,wl,{item:n}))},Sl=function(n){ee(n,xl,{item:n})},Ol=A(wl),kl=A(xl),Cl=[Jt("data"),Jt("components"),Jt("dom"),er("toggling"),or("itemBehaviours",{}),or("ignoreFocus",!1),or("domModification",{}),Po("builder",function(n){return{dom:k(n.dom(),{attributes:{role:n.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:k(jr([n.toggling().fold(ri.revoke,function(n){return ri.config(k({aria:{mode:"checked"}},n))}),mi.config({ignore:n.ignoreFocus(),onFocus:function(n){Sl(n)}}),Bc.config({mode:"execution"}),vs.config({store:{mode:"memory",initialValue:n.data()}})]),n.itemBehaviours()),events:sr([(e=Yn(),r=te,lr(e,function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){r(e,n,t)})})),pr(L()),lr(W(),Tl),lr(Gn(),mi.focus)]),components:n.components(),domModification:n.domModification(),eventOrder:n.eventOrder()};var e,r}),or("eventOrder",{})],El=[Jt("dom"),Jt("components"),Po("builder",function(n){return{dom:n.dom(),components:n.components(),events:sr([(e=Gn(),lr(e,function(n,e){e.stop()}))])};var e})],Dl=A([ia({name:"widget",overrides:function(e){return{behaviours:jr([vs.config({store:{mode:"manual",getValue:function(n){return e.data()},setValue:function(){}}})])}}})]),Il=[Jt("uid"),Jt("data"),Jt("components"),Jt("dom"),or("autofocus",!1),or("domModification",{}),ha(Dl()),Po("builder",function(t){var n=da(0,t,Dl()),e=ma("item-widget",t,n.internals()),r=function(n){return ga(n,t,"widget").map(function(n){return Bc.focusIn(n),n})},o=function(n,e){return au(e.event().target())||t.autofocus()&&e.setSource(n.element()),F.none()};return k({dom:t.dom(),components:e,domModification:t.domModification(),events:sr([br(function(n,e){r(n).each(function(n){e.stop()})}),lr(W(),Tl),lr(Gn(),function(n,e){t.autofocus()?r(n):mi.focus(n)})]),behaviours:jr([vs.config({store:{mode:"memory",initialValue:t.data()}}),mi.config({onFocus:function(n){Sl(n)}}),Bc.config({mode:"special",focusIn:t.autofocus()?function(n){r(n)}:Pr(),onLeft:o,onRight:o,onEscape:function(n,e){return mi.isFocused(n)||t.autofocus()?(t.autofocus()&&e.setSource(n.element()),F.none()):(mi.focus(n),F.some(!0))}})])})})],Al=Yt("type",{widget:Il,item:Cl,separator:El}),Ml=A([ca({factory:{sketch:function(n){var e=Gt("menu.spec item",Al,n);return e.builder()(e)}},name:"items",unit:"item",defaults:function(n,e){var t=Da("");return k({uid:t},e)},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus(),domModification:{classes:[n.markers().item()]}}}})]),Fl=A([Jt("value"),Jt("items"),Jt("dom"),Jt("components"),or("eventOrder",{}),Vc("menuBehaviours",[tu,vs,rf,Bc]),ir("movement",{mode:"menu",moveOnTab:!0},Yt("mode",{grid:[Wo(),Po("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers().item(),initSize:{numColumns:e.initSize().numColumns(),numRows:e.initSize().numRows()},focusManager:n.focusManager()}})],menu:[or("moveOnTab",!0),Po("config",function(n,e){return{mode:"menu",selector:"."+n.markers().item(),moveOnTab:e.moveOnTab(),focusManager:n.focusManager()}})]})),Qt("markers",Vo()),or("fakeFocus",!1),or("focusManager",ru()),jo("onHighlight")]),Rl=A("alloy.menu-focus"),Bl=Va({name:"Menu",configFields:Fl(),partFields:Ml(),factory:function(n,e,t,r){return k({dom:k(n.dom(),{attributes:{role:"menu"}}),uid:n.uid(),behaviours:k(jr([tu.config({highlightClass:n.markers().selectedItem(),itemClass:n.markers().item(),onHighlight:n.onHighlight()}),vs.config({store:{mode:"memory",initialValue:n.value()}}),rf.config({find:F.some}),Bc.config(n.movement().config()(n,n.movement()))]),Nc(n.menuBehaviours())),events:sr([lr(kl(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){tu.highlight(e,n),t.stop(),ee(e,Rl(),{menu:e,item:n})})}),lr(Ol(),function(n,e){var t=e.event().item();tu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder()})}}),Vl=function(n,t){var r=Be(t),e=po(r).bind(function(e){var o,i,n=function(n){return Re(e,n)};return n(t)?F.some(t):(o=n,(i=function(n){for(var e=0;e<n.childNodes.length;e++){var t=ue.fromDom(n.childNodes[e]);if(o(t))return F.some(t);var r=i(n.childNodes[e]);if(r.isSome())return r}return F.none()})(t.dom()))}),o=n(t);return e.each(function(e){po(r).filter(function(n){return Re(n,e)}).fold(function(){mo(e)},I)}),o},Nl=function(n,e,t,r){var o=n.getSystem().build(r);qe(n,o,t)},_l=function(n,e){return n.components()},jl=zr({fields:[],name:"replacing",apis:Object.freeze({append:function(n,e,t,r){Nl(n,0,ze,r)},prepend:function(n,e,t,r){Nl(n,0,He,r)},remove:function(n,e,t,r){var o=_l(n);Sn(o,function(n){return Re(r.element(),n.element())}).each(Ke)},set:function(e,n,t,r){var o,i;i=(o=e).components(),bn(i,Ye),Pe(o.element()),o.syncComponents(),Vl(function(){var n=yn(r,e.getSystem().build);bn(n,function(n){Ge(e,n)})},e.element())},contents:_l})}),Hl=function(t,r,o,n){return ht(o,n).bind(function(n){return ht(t,n).bind(function(n){var e=Hl(t,r,o,n);return F.some([n].concat(e))})}).getOr([])},zl=function(n,e){var t={};B(n,function(n,e){bn(n,function(n){t[n]=e})});var r=e,o=N(e,function(n,e){return{k:n,v:e}}),i=V(o,function(n,e){return[e].concat(Hl(t,r,o,e))});return V(t,function(n){return ht(i,n).getOr([n])})},Ll=function(){var i=ao({}),u=ao({}),c=ao({}),a=ao(F.none()),s=ao({}),n=function(n){return ht(u.get(),n)};return{setContents:function(n,e,t,r){a.set(F.some(n)),i.set(t),u.set(e),s.set(r);var o=zl(r,t);c.set(o)},expand:function(t){return ht(i.get(),t).map(function(n){var e=ht(c.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return ht(c.get(),n)},collapse:function(n){return ht(c.get(),n).bind(function(n){return 1<n.length?F.some(n.slice(1)):F.none()})},lookupMenu:n,otherMenus:function(n){var e,t,r=s.get();return e=R(r),t=n,wn(e,function(n){return!hn(t,n)})},getPrimary:function(){return a.get().bind(n)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),c.set({}),a.set(F.none())},isClear:function(){return a.get().isNone()}}},Pl=A("collapse-item"),$l=Ba({name:"TieredMenu",configFields:[Lo("onExecute"),Lo("onEscape"),zo("onOpenMenu"),zo("onOpenSubmenu"),jo("onCollapseMenu"),or("openImmediately",!0),nr("data",[Jt("primary"),Jt("menus"),Jt("expansions")]),or("fakeFocus",!1),jo("onHighlight"),jo("onHover"),nr("markers",[Jt("backgroundMenu")].concat(Ro()).concat(Bo())),Jt("dom"),or("navigateOnHover",!0),or("stayInDom",!1),Vc("tmenuBehaviours",[Bc,tu,rf,jl]),or("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)}},factory:function(u,o){var i=function(r,n){return V(n,function(n,e){var t=Bl.sketch(k(n,{value:e,items:n.items,markers:mt(o.markers,["item","selectedItem"]),fakeFocus:u.fakeFocus(),onHighlight:u.onHighlight(),focusManager:u.fakeFocus()?{get:function(n){return tu.getHighlighted(n).map(function(n){return n.element()})},set:function(e,n){e.getSystem().getByDom(n).fold(I,function(n){tu.highlight(e,n)})}}:ru()}));return r.getSystem().build(t)})},c=Ll(),a=function(n){return vs.getValue(n).value},s=function(n){return V(u.data().menus(),function(n,e){return Cn(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},f=function(e,n){tu.highlight(e,n),tu.getHighlighted(n).orThunk(function(){return tu.getFirst(n)}).each(function(n){re(e,n.element(),Gn())})},l=function(n,e){return Eo(yn(e,n.lookupMenu))},d=function(r,o,i){return F.from(i[0]).bind(o.lookupMenu).map(function(n){var e=l(o,i.slice(1));bn(e,function(n){no(n.element(),u.markers().backgroundMenu())}),he(n.element())||jl.append(r,bl(n)),ul(n.element(),[u.markers().backgroundMenu()]),f(r,n);var t=l(o,o.otherMenus(i));return bn(t,function(n){ul(n.element(),[u.markers().backgroundMenu()]),u.stayInDom()||jl.remove(r,n)}),n})},m=function(e,t){var n=a(t);return c.expand(n).bind(function(n){return F.from(n[0]).bind(c.lookupMenu).each(function(n){he(n.element())||jl.append(e,bl(n)),u.onOpenSubmenu()(e,t,n),tu.highlightFirst(n)}),d(e,c,n)})},r=function(e,t){var n=a(t);return c.collapse(n).bind(function(n){return d(e,c,n).map(function(n){return u.onCollapseMenu()(e,t,n),n})})},n=function(t){return function(e,n){return Bi(n.getSource(),"."+u.markers().item()).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},e=sr([lr(Rl(),function(n,e){var t=e.event().menu();tu.highlight(n,t)}),br(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===a(n).indexOf("collapse-item")&&r(e,n),m(e,n).fold(function(){u.onExecute()(e,n)},function(){})})}),vr(function(e,n){var t,r,o;(t=e,r=i(t,u.data().menus()),o=s(),c.setContents(u.data().primary(),r,u.data().expansions(),o),c.getPrimary()).each(function(n){jl.append(e,bl(n)),u.openImmediately()&&(f(e,n),u.onOpenMenu()(e,n))})})].concat(u.navigateOnHover()?[lr(Ol(),function(n,e){var t,r,o=e.event().item();t=n,r=a(o),c.refresh(r).bind(function(n){return d(t,c,n)}),m(n,o),u.onHover()(n,o)})]:[]));return{uid:u.uid(),dom:u.dom(),behaviours:k(jr([Bc.config({mode:"special",onRight:n(function(n,e){return au(e.element())?F.none():m(n,e)}),onLeft:n(function(n,e){return au(e.element())?F.none():r(n,e)}),onEscape:n(function(n,e){return r(n,e).orThunk(function(){return u.onEscape()(n,e).map(function(){return n})})}),focusIn:function(e,n){c.getPrimary().each(function(n){re(e,n.element(),Gn())})}}),tu.config({highlightClass:u.markers().selectedMenu(),itemClass:u.markers().menu()}),rf.config({find:function(n){return tu.getHighlighted(n)}}),jl.config({})]),Nc(u.tmenuBehaviours())),eventOrder:u.eventOrder(),apis:{collapseMenu:function(e){tu.getHighlighted(e).each(function(n){tu.getHighlighted(n).each(function(n){r(e,n)})})}},events:e}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:yt(n,e),expansions:{}}},collapseItem:function(n){return{value:Gc(Pl()),text:n}}}}),Wl=function(n,e,t,r){return ht(e.routes(),r.start()).map(a).bind(function(n){return ht(n,r.destination()).map(a)})},Ul=function(n,e,t,r){return Wl(0,e,0,r).bind(function(e){return e.transition().map(function(n){return{transition:A(n),route:A(e)}})})},Gl=function(t,r,n){var e,o,i;(e=t,o=r,i=n,ql(e,o).bind(function(n){return Ul(e,o,i,n)})).each(function(n){var e=n.transition();eo(t.element(),e.transitionClass()),Yr(t.element(),r.destinationAttr())})},ql=function(n,e,t){var r=n.element();return qr(r,e.destinationAttr())?F.some({start:A(Gr(n.element(),e.stateAttr())),destination:A(Gr(n.element(),e.destinationAttr()))}):F.none()},Yl=function(n,e,t,r){Gl(n,e,t),qr(n.element(),e.stateAttr())&&Gr(n.element(),e.stateAttr())!==r&&e.onFinish()(n,r),Wr(n.element(),e.stateAttr(),r)},Kl=Object.freeze({findRoute:Wl,disableTransition:Gl,getCurrentRoute:ql,jumpTo:Yl,progressTo:function(t,r,o,i){var n,e;e=r,qr((n=t).element(),e.destinationAttr())&&(Wr(n.element(),e.stateAttr(),Gr(n.element(),e.destinationAttr())),Yr(n.element(),e.destinationAttr()));var u,c,a=(u=r,c=i,{start:A(Gr(t.element(),u.stateAttr())),destination:A(c)});Ul(t,r,o,a).fold(function(){Yl(t,r,o,i)},function(n){Gl(t,r,o);var e=n.transition();no(t.element(),e.transitionClass()),Wr(t.element(),r.destinationAttr(),i)})},getState:function(n,e,t){var r=n.element();return qr(r,e.stateAttr())?F.some(Gr(r,e.stateAttr())):F.none()}}),Xl=Object.freeze({events:function(o,i){return sr([lr(K(),function(t,n){var r=n.event().raw();ql(t,o).each(function(e){Wl(0,o,0,e).each(function(n){n.transition().each(function(n){r.propertyName===n.property()&&(Yl(t,o,i,e.destination()),o.onTransition()(t,e))})})})}),vr(function(n,e){Yl(n,o,i,o.initialState())})])}}),Jl=[or("destinationAttr","data-transitioning-destination"),or("stateAttr","data-transitioning-state"),Jt("initialState"),jo("onTransition"),jo("onFinish"),Qt("routes",Vt(Qe.value,Vt(Qe.value,Rt([rr("transition",[Jt("property"),Jt("transitionClass")])]))))],Ql=zr({fields:Jl,name:"transitioning",active:Xl,apis:Kl,extra:{createRoutes:function(n){var r={};return B(n,function(n,e){var t=e.split("<->");r[t[0]]=yt(t[1],n),r[t[1]]=yt(t[0],n)}),r},createBistate:function(n,e,t){return bt([{key:n,value:yt(e,t)},{key:e,value:yt(n,t)}])},createTristate:function(n,e,t,r){return bt([{key:n,value:bt([{key:e,value:r},{key:t,value:r}])},{key:e,value:bt([{key:n,value:r},{key:t,value:r}])},{key:t,value:bt([{key:n,value:r},{key:e,value:r}])}])}}}),Zl=ai.resolve("scrollable"),nd={register:function(n){no(n,Zl)},deregister:function(n){eo(n,Zl)},scrollable:A(Zl)},ed=function(n){return ht(n,"format").getOr(n.title)},td=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[ai.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:ai.resolve("format-matches"),selected:t},itemBehaviours:jr(o?[]:[oi(n,function(n,e){(e?ri.on:ri.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},rd=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Na.sketch({dom:{tag:"div",classes:[ai.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[ai.resolve("styles-collapse-icon")]}},vl(n)]:[vl(n)],action:function(n){if(r){var e=t().get(n);$l.collapseMenu(e)}}}),{dom:{tag:"div",classes:[ai.resolve("styles-menu-items-container")]},components:[Bl.parts().items({})],behaviours:jr([nf("adhoc-scrollable-menu",[vr(function(n,e){vi(n.element(),"overflow-y","auto"),vi(n.element(),"-webkit-overflow-scrolling","touch"),nd.register(n.element())}),hr(function(n){xi(n.element(),"overflow-y"),xi(n.element(),"-webkit-overflow-scrolling"),nd.deregister(n.element())})])])}],items:e,menuBehaviours:jr([Ql.config({initialState:"after",routes:Ql.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},od=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return c},n=rd("Styles",[].concat(yn(o.items,function(n){return td(ed(n),n.title,n.isSelected(),n.getPreview(),xt(o.expansions,ed(n)))})),i,!1),e=V(o.menus,function(n,e){var t=yn(n,function(n){return td(ed(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",xt(o.expansions,ed(n)))});return rd(e,t,i,!0)}),t=k(e,yt("styles",n)),{tmenu:$l.tieredData("styles",t,o.expansions)}),c=Bs($l.sketch({dom:{tag:"div",classes:[ai.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=vs.getValue(e);return r.handle(e,t.value),F.none()},onEscape:function(){return F.none()},onOpenMenu:function(n,e){var t=xs(n.element());ws(e.element(),t),Ql.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=xs(n.element()),o=Fi(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ws(t.element(),r),Ql.progressTo(i,"before"),Ql.jumpTo(t,"after"),Ql.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Fi(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();Ql.progressTo(o,"after"),Ql.progressTo(t,"current")},navigateOnHover:!1,openImmediately:!0,data:u.tmenu,markers:{backgroundMenu:ai.resolve("styles-background-menu"),menu:ai.resolve("styles-menu"),selectedMenu:ai.resolve("styles-selected-menu"),item:ai.resolve("styles-item"),selectedItem:ai.resolve("styles-selected-item")}}));return c.asSpec()},id=function(n){return xt(n,"items")?(t=k(gt(e=n,["items"]),{menu:!0}),r=ud(e.items),{item:t,menus:k(r.menus,yt(e.title,r.items)),expansions:k(r.expansions,yt(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},ud=function(n){return xn(n,function(n,e){var t=id(e);return{menus:k(n.menus,t.menus),items:[t.item].concat(n.items),expansions:k(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},cd={expand:ud},ad=function(u,n){var c=function(n){return function(){return u.formatter.match(n)}},a=function(n){return function(){return u.formatter.getCssText(n)}},e=ht(n,"style_formats").getOr(zf),s=function(n){return yn(n,function(n){if(xt(n,"items")){var e=s(n.items);return k(k(n,{isSelected:A(!1),getPreview:A("")}),{items:e})}return xt(n,"format")?k(i=n,{isSelected:c(i.format),getPreview:a(i.format)}):(r=Gc((t=n).title),o=k(t,{format:r,isSelected:c(r),getPreview:a(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return s(e)},sd=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Cn(n,function(n){return n.items!==undefined?0<o(n.items).length?[n]:[]:!xt(n,"format")||e.formatter.canApply(n.format)?[n]:[]})})(n),cd.expand(i));return od({formats:u,handle:function(n,e){t.undoManager.transact(function(){ri.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},fd=["undo","bold","italic","link","image","bullist","styleselect"],ld=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},dd=function(n){return Cn(n,function(n){return g(n)?dd(n):ld(n)})},md=function(n){var e=n.toolbar!==undefined?n.toolbar:fd;return g(e)?dd(e):ld(e)},gd=function(r,o){var n=function(n){return function(){return $a.forToolbarCommand(o,n)}},e=function(n){return function(){return $a.forToolbarStateCommand(o,n)}},t=function(n,e,t){return function(){return $a.forToolbarStateAction(o,n,e,t)}},i=n("undo"),u=n("redo"),c=e("bold"),a=e("italic"),s=e("underline"),f=n("removeformat"),l=t("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),m=t("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),g=ad(o,o.settings),p=function(){return sd(o,g,function(){o.fire("scrollIntoView")})},v=function(n,e){return{isSupported:function(){return n.forall(function(n){return xt(o.buttons,n)})},sketch:e}};return{undo:v(F.none(),i),redo:v(F.none(),u),bold:v(F.none(),c),italic:v(F.none(),a),underline:v(F.none(),s),removeformat:v(F.none(),f),link:v(F.none(),function(){return e=r,t=o,$a.forToolbarStateAction(t,"link","link",function(){var n=Hf(e,t);e.setContextToolbar(n),Zs(t,function(){e.focusToolbar()}),Xs.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:v(F.none(),l),image:v(F.none(),function(){return Ws(o)}),bullist:v(F.some("bullist"),d),numlist:v(F.some("numlist"),m),fontsizeselect:v(F.none(),function(){return e=o,n={onChange:function(n){Ms.apply(e,n)},getInitialValue:function(){return Ms.get(e)}},Os(r,"font-size",function(){return Rs(n)});var e,n}),forecolor:v(F.none(),function(){return Cs(r,o)}),styleselect:v(F.none(),function(){return $a.forToolbar("style-formats",function(n){o.fire("toReading"),r.dropup().appear(p,ri.on,n)},jr([ri.config({toggleClass:ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Go.config({channels:bt([ui(wo.orientationChanged(),ri.off),ui(wo.dropupDismissed(),ri.off)])})]))})}},pd=function(n,t){var e=md(n),r={};return Cn(e,function(n){var e=!xt(r,n)&&xt(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},vd=function(m,g){return function(n){if(m(n)){var e,t,r,o,i,u,c,a=ue.fromDom(n.target),s=function(){n.stopPropagation()},f=function(){n.preventDefault()},l=v(f,s),d=(e=a,t=n.clientX,r=n.clientY,o=s,i=f,u=l,c=n,{target:A(e),x:A(t),y:A(r),stop:o,prevent:i,kill:u,raw:A(c)});g(d)}}},hd=function(n,e,t,r,o){var i=vd(t,r);return n.dom().addEventListener(e,i,o),{unbind:l(yd,n,e,i,o)}},yd=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},bd=A(!0),wd=function(n,e,t){return hd(n,e,bd,t,!1)},xd=function(n,e,t){return hd(n,e,bd,t,!0)},Td=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:A(e)}},Sd=Td,Od=function(r,e){var n=ue.fromDom(r),o=null,t=wd(n,"orientationchange",function(){clearInterval(o);var n=Td(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(o);var e=r.innerHeight,t=0;o=setInterval(function(){e!==r.innerHeight?(clearInterval(o),n(F.some(r.innerHeight))):20<t&&(clearInterval(o),n(F.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},kd=function(n){var e=zn.detect().os.isiOS(),t=Td(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},Cd=function(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?F.none():F.some(e.touches[0])},Ed=function(t){var r,o,i,u=ao(F.none()),c=(r=function(n){u.set(F.none()),t.triggerEvent(Kn(),n)},o=400,i=null,{cancel:function(){null!==i&&(p.clearTimeout(i),i=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i=p.setTimeout(function(){r.apply(null,n),i=null},o)}}),a=bt([{key:j(),value:function(t){return Cd(t).each(function(n){c.cancel();var e={x:A(n.clientX),y:A(n.clientY),target:t.target};c.schedule(t),u.set(F.some(e))}),F.none()}},{key:H(),value:function(n){return c.cancel(),Cd(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x()),o=Math.abs(e.clientY-t.y()),(5<r||5<o)&&u.set(F.none())})}),F.none()}},{key:z(),value:function(e){return c.cancel(),u.get().filter(function(n){return Re(n.target(),e.target())}).map(function(n){return t.triggerEvent(qn(),e)})}}]);return{fireIfReady:function(e,n){return ht(a,n).bind(function(n){return n(e)})}}},Dd=function(t){var e=Ed({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return wd(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return wd(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},Id=6<=zn.detect().os.version.major,Ad=function(r,e,t){var o=Dd(r),i=Be(e),u=function(n){return!Re(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||po(i).filter(function(n){return"input"===me(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?ri.on:ri.off)},c=[wd(r.body(),"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),wd(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){go(r.body())}),r.onToEditing(I),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===Id?[]:[wd(ue.fromDom(r.win()),"blur",function(){t.getByDom(e).each(ri.off)}),wd(i,"select",n),wd(r.doc(),"selectionchange",n)]);return{destroy:function(){bn(c,function(n){n.unbind()})}}},Md=function(n,e){var t=parseInt(Gr(n,e),10);return isNaN(t)?0:t},Fd=(Hs=ve,zs="text",{get:function(n){if(!Hs(n))throw new Error("Can only get "+zs+" value of a "+zs+" node");return Ls(n).getOr("")},getOption:Ls=function(n){return Hs(n)?F.from(n.dom().nodeValue):F.none()},set:function(n,e){if(!Hs(n))throw new Error("Can only set raw "+zs+" value of a "+zs+" node");n.dom().nodeValue=e}}),Rd=function(n){return"img"===me(n)?1:(e=n,Fd.getOption(e)).fold(function(){return _e(n).length},function(n){return n.length});var e},Bd={create:we("start","soffset","finish","foffset")},Vd=Ze([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Nd={before:Vd.before,on:Vd.on,after:Vd.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(h,h,h)}},_d=Ze([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),jd={domRange:_d.domRange,relative:_d.relative,exact:_d.exact,exactFromRange:function(n){return _d.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var e=n.match({domRange:function(n){return ue.fromDom(n.startContainer)},relative:function(n,e){return Nd.getStart(n)},exact:function(n,e,t,r){return n}});return Ve(e)},range:Bd.create},Hd=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},zd=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},Ld=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},Pd=Ze([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),$d=function(n,e,t){return e(ue.fromDom(t.startContainer),t.startOffset,ue.fromDom(t.endContainer),t.endOffset)},Wd=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:A(n),rtl:F.none}},relative:function(n,e){return{ltr:J(function(){return Hd(o,n,e)}),rtl:J(function(){return F.some(Hd(o,e,n))})}},exact:function(n,e,t,r){return{ltr:J(function(){return zd(o,n,e,t,r)}),rtl:J(function(){return F.some(zd(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Pd.rtl(ue.fromDom(n.endContainer),n.endOffset,ue.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return $d(0,Pd.ltr,r)}):$d(0,Pd.ltr,r)},Ud=function(n,e){var t=me(n);return"input"===t?Nd.after(n):hn(["br","img"],t)?0===e?Nd.before(n):Nd.after(n):Nd.on(n,e)},Gd=function(n,e,t,r){var o,i,u,c,a,s=(i=e,u=t,c=r,(a=Be(o=n).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=Re(n,t)&&e===r;return s.collapsed&&!f},qd=function(n,e,t,r,o){var i,u,c=zd(n,e,t,r,o);i=n,u=c,F.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},Yd=function(n,e,t,r,o){var i,u,c,a,l,s=(i=r,u=o,c=Ud(e,t),a=Ud(i,u),jd.relative(c,a));Wd(l=n,s).match({ltr:function(n,e,t,r){qd(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,c,a,s=l.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(s.extend)try{i=n,u=e,c=t,a=r,(o=s).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){qd(l,t,r,n,e)}else qd(l,t,r,n,e)}})},Kd=function(n){var e=ue.fromDom(n.anchorNode),t=ue.fromDom(n.focusNode);return Gd(e,n.anchorOffset,t,n.focusOffset)?F.some(Bd.create(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return F.some(Bd.create(ue.fromDom(e.startContainer),e.startOffset,ue.fromDom(t.endContainer),t.endOffset))}return F.none()}(n)},Xd=function(n){return F.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(Kd)},Jd=function(n,e){var i,t,r,o,u=Wd(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(n.dom(),e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?F.some(o).map(Ld):F.none()},Qd=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:A(2),height:n.height}},Zd=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},nm=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?function(t){if(t.collapsed){var r=ue.fromDom(t.startContainer);return Ne(r).bind(function(n){var e=jd.exact(r,t.startOffset,n,Rd(n));return Jd(t.startContainer.ownerDocument.defaultView,e).map(Qd).map(In)}).getOr([])}return yn(t.getClientRects(),Zd)}(e.getRangeAt(0)):[]},em=function(n){n.focus();var e=ue.fromDom(n.document.body);(po().exists(function(n){return hn(["input","textarea"],me(n))})?function(n){setTimeout(function(){n()},0)}:a)(function(){po().each(go),mo(e)})},tm="data-"+ai.resolve("last-outer-height"),rm=function(n,e){Wr(n,tm,e)},om=function(n){return{top:A(n.top()),bottom:A(n.top()+n.height())}},im=function(n,e){var t=Md(e,tm),r=n.innerHeight;return r<t?F.some(t-r):F.none()},um=function(n,u){var e=ue.fromDom(u.document.body),t=wd(ue.fromDom(n),"resize",function(){im(n,e).each(function(i){var n,e;(n=u,e=nm(n),0<e.length?F.some(e[0]).map(om):F.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),rm(e,n.innerHeight)});return rm(e,n.innerHeight),{toEditing:function(){em(u)},destroy:function(){t.unbind()}}},cm=function(n){return F.some(ue.fromDom(n.dom().contentWindow.document.body))},am=function(n){return F.some(ue.fromDom(n.dom().contentWindow.document))},sm=function(n){return F.from(n.dom().contentWindow)},fm=function(n){return sm(n).bind(Xd)},lm=function(n){return n.getFrame()},dm=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=lm(e);return function(){return t(n)}})()}},mm=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return wd(e,r,n)}})},gm=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},pm={getBody:dm("getBody",cm),getDoc:dm("getDoc",am),getWin:dm("getWin",sm),getSelection:dm("getSelection",fm),getFrame:lm,getActiveApi:function(c){var a=lm(c);return cm(a).bind(function(u){return am(a).bind(function(i){return sm(a).map(function(o){var n=ue.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return(n=o,Xd(n).map(function(n){return jd.exact(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return Jd(o,n).orThunk(function(){return Xd(o).filter(function(n){return Re(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?F.some(e).map(gm):F.none()})})});var n}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,r){Yd(o,n,e,t,r)}}),r=c.clearSelection.getOrThunk(function(){return function(){o.getSelection().removeAllRanges()}});return{body:A(u),doc:A(i),win:A(o),html:A(n),getSelection:l(fm,a),setSelection:t,clearSelection:r,frame:A(a),onKeyup:mm(c,i,"onKeyup","keyup"),onNodeChanged:mm(c,i,"onNodeChanged","selectionchange"),onDomChanged:c.onDomChanged,onScrollToCursor:c.onScrollToCursor,onScrollToElement:c.onScrollToElement,onToReading:c.onToReading,onToEditing:c.onToEditing,onToolbarScrollStart:c.onToolbarScrollStart,onTouchContent:c.onTouchContent,onTapContent:c.onTapContent,onTouchToolstrip:c.onTouchToolstrip,getCursorBox:e}})})})}},vm="data-ephox-mobile-fullscreen-style",hm="position:absolute!important;",ym="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",bm=zn.detect().os.isAndroid(),wm=function(n,e){var t,r,o,i=function(r){return function(n){var e=Gr(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(Wr(n,vm,t),Wr(n,"style",r))}},u=(t="*",Di(n,function(n){return Ie(n,t)},r)),c=Cn(u,function(n){var e;return e="*",Ii(n,function(n){return Ie(n,e)})}),a=(o=yi(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";bn(c,i("display:none!important;")),bn(u,i(hm+ym+a)),i((!0===bm?"":hm)+ym+a)(n)},xm=function(){var n=Me("["+vm+"]");bn(n,function(n){var e=Gr(n,vm);"no-styles"!==e?Wr(n,"style",e):Yr(n,"style"),Yr(n,vm)})},Tm=function(){var e=Mi("head").getOrDie(),n=Mi('meta[name="viewport"]').getOrThunk(function(){var n=ue.fromTag("meta");return Wr(n,"name","viewport"),ze(e,n),n}),t=Gr(n,"content");return{maximize:function(){Wr(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?Wr(n,"content",t):Wr(n,"content","user-scalable=yes")}}},Sm=function(e,n){var t=Tm(),r=Rf(),o=Rf();return{enter:function(){n.hide(),no(e.container,ai.resolve("fullscreen-maximized")),no(e.container,ai.resolve("android-maximized")),t.maximize(),no(e.body,ai.resolve("android-scroll-reload")),r.set(um(e.win,pm.getWin(e.editor).getOrDie("no"))),pm.getActiveApi(e.editor).each(function(n){wm(e.container,n.body()),o.set(Ad(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),eo(e.container,ai.resolve("fullscreen-maximized")),eo(e.container,ai.resolve("android-maximized")),xm(),eo(e.body,ai.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Om=function(t,r){var o=null;return{cancel:function(){null!==o&&(p.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&p.clearTimeout(o),o=p.setTimeout(function(){t.apply(null,n),o=null},r)}}},km=function(n,e){var t,r,o,i=Bs(of.sketch({dom:Ha('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:jr([ri.config({toggleClass:ai.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(p.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=p.setTimeout(function(){t.apply(null,n),o=null},r))}});return of.sketch({dom:Ha('<div class="${prefix}-disabled-mask"></div>'),components:[of.sketch({dom:Ha('<div class="${prefix}-content-container"></div>'),components:[Na.sketch({dom:Ha('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:jr([ri.config({toggleClass:ai.resolve("mask-tap-icon-selected")})])})]})]})},Cm=Bt([nr("editor",[Jt("getFrame"),er("getBody"),er("getDoc"),er("getWin"),er("getSelection"),er("setSelection"),er("clearSelection"),er("cursorSaver"),er("onKeyup"),er("onNodeChanged"),er("getCursorBox"),Jt("onDomChanged"),or("onTouchContent",I),or("onTapContent",I),or("onTouchToolstrip",I),or("onScrollToCursor",A({unbind:I})),or("onScrollToElement",A({unbind:I})),or("onToEditing",A({unbind:I})),or("onToReading",A({unbind:I})),or("onToolbarScrollStart",h)]),Jt("socket"),Jt("toolstrip"),Jt("dropup"),Jt("toolbar"),Jt("container"),Jt("alloy"),ur("win",function(n){return Be(n.socket).dom().defaultView}),ur("body",function(n){return ue.fromDom(n.socket.dom().ownerDocument.body)}),or("translate",h),or("setReadOnly",I),or("readOnlyOnInit",A(!0))]),Em=function(n){var e=Ut("Getting AndroidWebapp schema",Cm,n);vi(e.toolstrip,"width","100%");var t=yl(km(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};ze(e.container,t.element());var o=Sm(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:I,enter:o.enter,exit:o.exit,destroy:I}},Dm=A([or("shell",!0),Vc("toolbarBehaviours",[jl])]),Im=A([ua({name:"groups",overrides:function(n){return{behaviours:jr([jl.config({})])}}})]),Am=Va({name:"Toolbar",configFields:Dm(),partFields:Im(),factory:function(e,n,t,r){var o=function(n){return e.shell()?F.some(n):ga(n,e,"groups")},i=e.shell()?{behaviours:[jl.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid(),dom:e.dom(),components:i.components,behaviours:k(jr(i.behaviours),Nc(e.toolbarBehaviours())),apis:{setGroups:function(n,e){o(n).fold(function(){throw p.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){jl.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Mm=A([Jt("items"),(Ps=["itemClass"],nr("markers",yn(Ps,Jt))),Vc("tgroupBehaviours",[Bc])]),Fm=A([ca({name:"items",unit:"item",overrides:function(n){return{domModification:{classes:[n.markers().itemClass()]}}}})]),Rm=Va({name:"ToolbarGroup",configFields:Mm(),partFields:Fm(),factory:function(n,e,t,r){return k({dom:{attributes:{role:"toolbar"}}},{uid:n.uid(),dom:n.dom(),components:e,behaviours:k(jr([Bc.config({mode:"flow",selector:"."+n.markers().itemClass()})]),Nc(n.tgroupBehaviours())),"debug.sketcher":t["debug.sketcher"]})}}),Bm="data-"+ai.resolve("horizontal-scroll"),Vm=function(n){return"true"===Gr(n,Bm)?0<(t=n).dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(t):0<(e=n).dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(e);var e,t},Nm={exclusive:function(n,e){return wd(n,"touchmove",function(n){Bi(n.target(),e).filter(Vm).fold(function(){n.raw().preventDefault()},I)})},markAsHorizontal:function(n){Wr(n,Bm,"true")}};function _m(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Ha('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:jr([nf("adhoc-scrollable-toolbar",!0===n.scrollable?[yr(function(n,e){vi(n.element(),"overflow-x","auto"),Nm.markAsHorizontal(n.element()),nd.register(n.element())})]:[])]),components:[of.sketch({components:[Rm.parts().items({})]})],markers:{itemClass:ai.resolve("toolbar-group-item")},items:n.items}},t=yl(Am.sketch({dom:Ha('<div class="${prefix}-toolbar"></div>'),components:[Am.parts().groups({})],toolbarBehaviours:jr([ri.config({toggleClass:ai.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),Bc.config({mode:"cyclic"})]),shell:!0})),n=yl(of.sketch({dom:{classes:[ai.resolve("toolstrip")]},components:[bl(t)],containerBehaviours:jr([ri.config({toggleClass:ai.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){Am.setGroups(t,o.get()),ri.off(t)},o=ao([]);return{wrapper:A(n),toolbar:A(t),createGroups:function(n){return yn(n,v(Rm.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){ri.on(t),Am.setGroups(t,n)},restoreToolbar:function(){ri.isOn(t)&&r()},refresh:function(){},focus:function(){Bc.focusIn(t)}}}var jm=function(n,e){jl.append(n,bl(e))},Hm=function(n,e){jl.remove(n,e)},zm=function(n){return yl(Na.sketch({dom:Ha('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Lm=function(){return yl(of.sketch({dom:Ha('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:jr([jl.config({})])}))},Pm=function(n,e,t,r){(!0===t?co.toAlpha:co.toOmega)(r),(t?jm:Hm)(n,e)},$m=function(e,n){return n.getAnimationRoot().fold(function(){return e.element()},function(n){return n(e)})},Wm=function(n){return n.dimension().property()},Um=function(n,e){return n.dimension().getDimension()(e)},Gm=function(n,e){var t=$m(n,e);ul(t,[e.shrinkingClass(),e.growingClass()])},qm=function(n,e){eo(n.element(),e.openClass()),no(n.element(),e.closedClass()),vi(n.element(),Wm(e),"0px"),Ti(n.element())},Ym=function(n,e){eo(n.element(),e.closedClass()),no(n.element(),e.openClass()),xi(n.element(),Wm(e))},Km=function(n,e,t){t.setCollapsed(),vi(n.element(),Wm(e),Um(e,n.element())),Ti(n.element());var r=$m(n,e);no(r,e.shrinkingClass()),qm(n,e),e.onStartShrink()(n)},Xm=function(n,e,t){var r=function(n,e){Ym(n,e);var t=Um(e,n.element());return qm(n,e),t}(n,e),o=$m(n,e);no(o,e.growingClass()),Ym(n,e),vi(n.element(),Wm(e),r),t.setExpanded(),e.onStartGrow()(n)},Jm=function(n,e,t){var r=$m(n,e);return!0===ro(r,e.growingClass())},Qm=function(n,e,t){var r=$m(n,e);return!0===ro(r,e.shrinkingClass())},Zm=Object.freeze({grow:function(n,e,t){t.isExpanded()||Xm(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&Km(n,e,t)},immediateShrink:function(n,e,t){var r,o;t.isExpanded()&&(r=n,o=e,t.setCollapsed(),vi(r.element(),Wm(o),Um(o,r.element())),Ti(r.element()),Gm(r,o),qm(r,o),o.onStartShrink()(r),o.onShrunk()(r))},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:Jm,isShrinking:Qm,isTransitioning:function(n,e,t){return!0===Jm(n,e)||!0===Qm(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?Km:Xm)(n,e,t)},disableTransitions:Gm}),ng=Object.freeze({exhibit:function(n,e){var t=e.expanded();return Or(t?{classes:[e.openClass()],styles:{}}:{classes:[e.closedClass()],styles:yt(e.dimension().property(),"0px")})},events:function(t,r){return sr([lr(K(),function(n,e){e.event().raw().propertyName===t.dimension().property()&&(Gm(n,t),r.isExpanded()&&xi(n.element(),t.dimension().property()),(r.isExpanded()?t.onGrown():t.onShrunk())(n))})])}}),eg=[Jt("closedClass"),Jt("openClass"),Jt("shrinkingClass"),Jt("growingClass"),er("getAnimationRoot"),jo("onShrunk"),jo("onStartShrink"),jo("onGrown"),jo("onStartGrow"),or("expanded",!1),Qt("dimension",Yt("property",{width:[Po("property","width"),Po("getDimension",function(n){return xs(n)+"px"})],height:[Po("property","height"),Po("getDimension",function(n){return Ei(n)+"px"})]}))],tg=zr({fields:eg,name:"sliding",active:ng,apis:Zm,state:Object.freeze({init:function(n){var e=ao(n.expanded());return _r({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:l(e.set,!1),setExpanded:l(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),rg=function(e,t){var r=yl(of.sketch({dom:{tag:"div",classes:[ai.resolve("dropup")]},components:[],containerBehaviours:jr([jl.config({}),tg.config({closedClass:ai.resolve("dropup-closed"),openClass:ai.resolve("dropup-open"),shrinkingClass:ai.resolve("dropup-shrinking"),growingClass:ai.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),jl.set(n,[])},onGrown:function(n){e(),t()}}),ii(function(n,e){o(I)})])})),o=function(n){p.window.requestAnimationFrame(function(){n(),tg.shrink(r)})};return{appear:function(n,e,t){!0===tg.hasShrunk(r)&&!1===tg.isTransitioning(r)&&p.window.requestAnimationFrame(function(){e(t),jl.set(r,[n()]),tg.grow(r)})},disappear:o,component:A(r),element:r.element}},og=zn.detect().browser.isFirefox(),ig=Rt([Zt("triggerEvent"),Zt("broadcastEvent"),or("stopBackspace",!0)]),ug=function(e,n){var t,r,o,i,u=Ut("Getting GUI events settings",ig,n),c=zn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],a=Ed(u),s=yn(c.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]),function(n){return wd(e,n,function(e){a.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),f=wd(e,"keydown",function(n){var e;u.triggerEvent("keydown",n)?n.kill():!0!==u.stopBackspace||8!==(e=n).raw().which||hn(["input","textarea"],me(e.target()))||n.prevent()}),l=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},og?xd(t,"focus",r):wd(t,"focusin",r)),d=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),p.setTimeout(function(){u.triggerEvent($n(),n)},0)},og?xd(o,"blur",i):wd(o,"focusout",i)),m=Ve(e),g=wd(m,"scroll",function(n){u.broadcastEvent(Jn(),n)&&n.kill()});return{unbind:function(){bn(s,function(n){n.unbind()}),f.unbind(),l.unbind(),d.unbind(),g.unbind()}}},cg=function(n,e){var t=ht(n,"target").map(function(n){return n()}).getOr(e);return ao(t)},ag=Ze([{stopped:[]},{resume:["element"]},{complete:[]}]),sg=function(n,r,e,t,o,i){var u,c,a,s,f=n(r,t),l=(u=e,c=o,a=ao(!1),s=ao(!1),{stop:function(){a.set(!0)},cut:function(){s.set(!0)},isStopped:a.get,isCut:s.get,event:A(u),setSource:c.set,getSource:c.get});return f.fold(function(){return i.logEventNoHandlers(r,t),ag.complete()},function(e){var t=e.descHandler();return Jf(t)(l),l.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),ag.stopped()):l.isCut()?(i.logEventCut(r,e.element(),t.purpose()),ag.complete()):Ne(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),ag.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),ag.resume(n)})})},fg=function(e,t,r,n,o,i){return sg(e,t,r,n,o,i).fold(function(){return!0},function(n){return fg(e,t,r,n,o,i)},function(){return!1})},lg=function(n,e,t){var r,o,i=(r=e,o=ao(!1),{stop:function(){o.set(!0)},cut:I,isStopped:o.get,isCut:A(!1),event:A(r),setSource:c("Cannot set source of a broadcasted event"),getSource:c("Cannot get source of a broadcasted event")});return bn(n,function(n){var e=n.descHandler();Jf(e)(i)}),i.isStopped()},dg=function(n,e,t,r,o){var i=cg(t,r);return fg(n,e,t,r,i,o)},mg=function(n,e,t){return lo(n,function(n){return e(n).isSome()},t).bind(e)},gg=we("element","descHandler"),pg=function(n,e){return{id:A(n),descHandler:A(e)}};function vg(){var i={};return{registerId:function(r,o,n){B(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=Xf(n,r),i[e]=t})},unregisterId:function(t){B(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return ht(i,n).map(function(n){return _(n,function(n,e){return pg(e,n)})}).getOr([])},find:function(n,e,t){var o=pt(e)(i);return mg(t,function(n){return t=o,Ea(r=n).fold(function(){return F.none()},function(n){var e=pt(n);return t.bind(e).map(function(n){return gg(r,n)})});var t,r},n)}}}function hg(){var r=vg(),o={},i=function(r){var n=r.element();return Ea(n).fold(function(){return n="uid-",e=r.element(),t=Gc(ka+n),Wr(e,Ca,t),t;var n,e,t},function(n){return n})},u=function(n){Ea(n.element()).each(function(n){o[n]=undefined,r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);xt(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+ko(t.element())+"\nCannot use it for: "+ko(n.element())+"\nThe conflicting element is"+(he(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events()),o[e]=n},unregister:u,getById:function(n){return pt(n)(o)}}}var yg=function(t){var r=function(e){return Ne(t.element()).fold(function(){return!0},function(n){return Re(e,n)})},o=hg(),s=function(n,e){return o.find(r,n,e)},n=ug(t.element(),{triggerEvent:function(u,c){return Fo(u,c.target(),function(n){return e=s,t=u,o=n,i=(r=c).target(),dg(e,t,r,i,o);var e,t,r,o,i})},broadcastEvent:function(n,e){var t=o.filter(n);return lg(t,e)}}),i=Wf({debugInfo:A("real"),triggerEvent:function(e,t,r){Fo(e,t,function(n){dg(s,e,r,t,n)})},triggerFocus:function(c,a){Ea(c).fold(function(){mo(c)},function(n){Fo(Pn(),c,function(n){var e,t,r,o,i,u;e=s,t=Pn(),r={originator:A(a),kill:I,prevent:I,target:A(c)},i=n,u=cg(r,o=c),sg(e,t,r,o,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return m(n)},getByDom:function(n){return g(n)},build:yl,addToGui:function(n){c(n)},removeFromGui:function(n){a(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},isConnected:A(!0)}),e=function(n){n.connect(i),ve(n.element())||(o.register(n),bn(n.components(),e),i.triggerEvent(Xn(),n.element(),{target:A(n.element())}))},u=function(n){ve(n.element())||(bn(n.components(),u),o.unregister(n)),n.disconnect()},c=function(n){Ge(t,n)},a=function(n){Ke(n)},f=function(t){var n=o.filter(Wn());bn(n,function(n){var e=n.descHandler();Jf(e)(t)})},l=function(n){f({universal:A(!0),data:A(n)})},d=function(n,e){f({universal:A(!1),channels:A(n),data:A(e)})},m=function(n){return o.getById(n).fold(function(){return Qe.error(new Error('Could not find component with uid: "'+n+'" in system.'))},Qe.value)},g=function(n){var e=Ea(n).getOr("not found");return m(e)};return e(t),{root:A(t),element:t.element,destroy:function(){n.unbind(),$e(t.element())},add:c,remove:a,getByUid:m,getByDom:g,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d}},bg=A(ai.resolve("readonly-mode")),wg=A(ai.resolve("edit-mode"));function xg(n){var e=yl(of.sketch({dom:{classes:[ai.resolve("outer-container")].concat(n.classes)},containerBehaviours:jr([co.config({alpha:bg(),omega:wg()})])}));return yg(e)}var Tg,Sg,Og,kg,Cg=function(n,e){var t=ue.fromTag("input");hi(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),ze(n,t),mo(t),e(t),$e(t)},Eg=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),r=n.document.createRange();r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(r)}},Dg=function(n,e){po().each(function(n){Re(n,e)||go(n)}),n.focus(),mo(ue.fromDom(n.document.body)),Eg(n)},Ig={stubborn:function(n,e,t,r){var o=function(){Dg(e,r)},i=wd(t,"keydown",function(n){hn(["input","textarea"],me(n.target()))||o()});return{toReading:function(){Cg(n,go)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){var o=function(){go(r)};return{toReading:function(){o()},toEditing:function(){Dg(e,r)},onToolbarTouch:function(){o()},destroy:I}}},Ag=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},c=function(){r.run(function(n){n.clearSelection()})},a=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),r.run(function(n){n.syncHeight()})},s=Dd(t),f=Om(a,300),l=[t.onKeyup(function(){c(),f.throttle()}),t.onNodeChanged(u),t.onDomChanged(f.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),f.throttle()}),t.onScrollToElement(function(n){n.element(),e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),wd(t.doc(),"touchend",function(n){Re(t.html(),n.target())||Re(t.body(),n.target())}),wd(o,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Ei(o),r.run(function(n){n.setViewportOffset(e)}),u(),a())}),xd(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),wd(t.body(),"touchstart",function(n){c(),t.onTouchContent(),s.fireTouchstart(n)}),s.onTouchmove(),s.onTouchend(),wd(t.body(),"click",function(n){n.kill()}),wd(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){bn(l,function(n){n.unbind()})}}},Mg={},Fg={exports:Mg};Tg=undefined,Sg=Mg,Og=Fg,kg=undefined,function(n){"object"==typeof Sg&&void 0!==Og?Og.exports=n():"function"==typeof Tg&&Tg.amd?Tg([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function i(u,c,a){function s(e,n){if(!c[e]){if(!u[e]){var t="function"==typeof kg&&kg;if(!n&&t)return t(e,!0);if(f)return f(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=c[e]={exports:{}};u[e][0].call(o.exports,function(n){return s(u[e][1][n]||n)},o,o.exports,i,u,c,a)}return c[e].exports}for(var f="function"==typeof kg&&kg,n=0;n<a.length;n++)s(a[n]);return s}({1:[function(n,e,t){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(n){if(r===setTimeout)return setTimeout(n,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(e){try{return r.call(null,n,0)}catch(e){return r.call(this,n,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(n){o=c}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var n=a(m);l=!0;for(var e=f.length;e;){for(s=f,f=[];++d<e;)s&&s[d].run();d=-1,e=f.length}s=null,l=!1,function(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{o(n)}catch(e){try{return o.call(null,n)}catch(e){return o.call(this,n)}}}(n)}}function p(n,e){this.fun=n,this.array=e}function v(){}i.nextTick=function(n){var e=new Array(arguments.length-1);if(1<arguments.length)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];f.push(new p(n,e)),1!==f.length||l||a(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,l,e){(function(t){!function(n){var e=setTimeout;function r(){}function u(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,u._immediateFn(function(){var n=1===r._state?o.onFulfilled:o.onRejected;if(null!==n){var e;try{e=n(r._value)}catch(t){return void c(o.promise,t)}i(o.promise,e)}else(1===r._state?i:c)(o.promise,r._value)})):r._deferreds.push(o)}function i(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if(e instanceof u)return n._state=3,n._value=e,void a(n);if("function"==typeof t)return void f((r=t,o=e,function(){r.apply(o,arguments)}),n)}n._state=1,n._value=e,a(n)}catch(i){c(n,i)}var r,o}function c(n,e){n._state=2,n._value=e,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&u._immediateFn(function(){n._handled||u._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)o(n,n._deferreds[e]);n._deferreds=null}function s(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function f(n,e){var t=!1;try{n(function(n){t||(t=!0,i(e,n))},function(n){t||(t=!0,c(e,n))})}catch(r){if(t)return;t=!0,c(e,r)}}u.prototype["catch"]=function(n){return this.then(null,n)},u.prototype.then=function(n,e){var t=new this.constructor(r);return o(this,new s(n,e,t)),t},u.all=function(n){var a=Array.prototype.slice.call(n);return new u(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u(function(n){n(e)})},u.reject=function(t){return new u(function(n,e){e(t)})},u.race=function(o){return new u(function(n,e){for(var t=0,r=o.length;t<r;t++)o[t].then(n,e)})},u._immediateFn="function"==typeof t?function(n){t(n)}:function(n){e(n,0)},u._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},u._setImmediateFn=function(n){u._immediateFn=n},u._setUnhandledRejectionFn=function(n){u._unhandledRejectionFn=n},void 0!==l&&l.exports?l.exports=u:n.Promise||(n.Promise=u)}(this)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,s){(function(n,e){var r=a("process/browser.js").nextTick,t=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,e){this._id=n,this._clearFn=e}s.setTimeout=function(){return new c(t.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new c(t.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(n,e){clearTimeout(n._idleTimeoutId),n._idleTimeout=e},s.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},s._unrefActive=s.active=function(n){clearTimeout(n._idleTimeoutId);var e=n._idleTimeout;0<=e&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},e))},s.setImmediate="function"==typeof n?n:function(n){var e=u++,t=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(t?n.apply(null,t):n.call(null),s.clearImmediate(e))}),e},s.clearImmediate="function"==typeof e?e:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,e,t){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var Rg=Fg.exports.boltExport,Bg=function(n){var t=F.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){bn(n,u)},u=function(e){t.each(function(n){p.setTimeout(function(){e(n)},0)})};return n(function(n){t=F.some(n),i(e),e=[]}),{get:r,map:function(t){return Bg(function(e){r(function(n){e(t(n))})})},isReady:o}},Vg={nu:Bg,pure:function(e){return Bg(function(n){n(e)})}},Ng=function(n){p.setTimeout(function(){throw n},0)},_g=function(t){var n=function(n){t().then(n,Ng)};return{map:function(n){return _g(function(){return t().then(n)})},bind:function(e){return _g(function(){return t().then(function(n){return e(n).toPromise()})})},anonBind:function(n){return _g(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return Vg.nu(n)},toCached:function(){var n=null;return _g(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},jg=function(n){return _g(function(){return new Rg(n)})},Hg=function(n){return _g(function(){return Rg.resolve(n)})},zg=function(n,e,t){return Math.abs(n-e)<=t?F.none():n<e?F.some(n+t):F.some(n-t)},Lg=function(){var s=null;return{animate:function(r,o,n,i,e,t){var u=!1,c=function(n){u=!0,e(n)};clearInterval(s);var a=function(n){clearInterval(s),c(n)};s=setInterval(function(){var t=r();zg(t,o,n).fold(function(){clearInterval(s),c(o)},function(n){if(i(n,a),!u){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(clearInterval(s),c(o))}})},t)}}},Pg=function(r,o){return function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return F.none()}([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e=r<=n.width&&o<=n.height,t=n.keyboard,e?F.some(t):F.none();var e,t}).getOr({portrait:o/5,landscape:r/4})},$g=function(n){var e,t=Sd(n).isPortrait(),r=Pg((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},Wg=function(n,e){var t=Be(n).dom().defaultView;return Ei(n)+Ei(e)-$g(t)},Ug=Wg,Gg=function(n,e,t){var r=Wg(e,t),o=Ei(e)+Ei(t)-r;vi(n,"padding-bottom",o+"px")},qg=Ze([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Yg="data-"+ai.resolve("position-y-fixed"),Kg="data-"+ai.resolve("y-property"),Xg="data-"+ai.resolve("scrolling"),Jg="data-"+ai.resolve("last-window-height"),Qg=function(n){return Md(n,Yg)},Zg=function(n,e){var t=Gr(n,Kg);return qg.fixed(n,t,e)},np=function(n,e){return qg.scroller(n,e)},ep=function(n){var e=Qg(n);return("true"===Gr(n,Xg)?np:Zg)(n,e)},tp=function(n,e,t){var r=Be(n).dom().defaultView.innerHeight;return Wr(n,Jg,r+"px"),r-e-t},rp=function(n){var e=Ai(n,"["+Yg+"]");return yn(e,ep)},op=function(r,o,i,u){var n,e,t,c,a,s,f,l,d=Be(r).dom().defaultView,m=(l=Gr(f=i,"style"),hi(f,{position:"absolute",top:"0px"}),Wr(f,Yg,"0px"),Wr(f,Kg,"top"),{restore:function(){Wr(f,"style",l||""),Yr(f,Yg),Yr(f,Kg)}}),g=Ei(i),p=Ei(u),v=(c=tp(r,t=g,p),s=Gr(a=r,"style"),nd.register(a),hi(a,{position:"absolute",height:c+"px",width:"100%",top:t+"px"}),Wr(a,Yg,t+"px"),Wr(a,Xg,"true"),Wr(a,Kg,"top"),{restore:function(){nd.deregister(a),Wr(a,"style",s||""),Yr(a,Yg),Yr(a,Xg),Yr(a,Kg)}}),h=(e=Gr(n=u,"style"),hi(n,{position:"absolute",bottom:"0px"}),Wr(n,Yg,"0px"),Wr(n,Kg,"bottom"),{restore:function(){Wr(n,"style",e||""),Yr(n,Yg),Yr(n,Kg)}}),y=!0,b=function(){var n=d.innerHeight;return Md(r,Jg)<n},w=function(){if(y){var n=Ei(i),e=Ei(u),t=tp(r,n,e);Wr(r,Yg,n+"px"),vi(r,"height",t+"px"),Gg(o,r,u)}};return Gg(o,r,u),{setViewportOffset:function(n){Wr(r,Yg,n+"px"),w()},isExpanding:b,isShrinking:x(b),refresh:w,restore:function(){y=!1,m.restore(),v.restore(),h.restore()}}},ip=Qg,up=Lg(),cp="data-"+ai.resolve("last-scroll-top"),ap=function(n){var e=wi(n,"top").getOr("0");return parseInt(e,10)},sp=function(n){return parseInt(n.dom().scrollTop,10)},fp=function(n,e){var t=e+ip(n)+"px";vi(n,"top",t)},lp=function(t,r,o){return jg(function(n){var e=l(sp,t);up.animate(e,r,15,function(n){t.dom().scrollTop=n,vi(t,"top",ap(t)+15+"px")},function(){t.dom().scrollTop=r,vi(t,"top",o+"px"),n(r)},10)})},dp=function(o,i){return jg(function(n){var e=l(sp,o);Wr(o,cp,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);up.animate(e,i,r,function(n,e){Md(o,cp)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,Wr(o,cp,n))},function(){o.dom().scrollTop=i,Wr(o,cp,i),n(i)},10)})},mp=function(i,u){return jg(function(n){var e=l(ap,i),t=function(n){vi(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);up.animate(e,u,o,t,function(){t(u),n(u)},10)})},gp=function(e,t,r){var o=Be(e).dom().defaultView;return jg(function(n){fp(e,r),fp(t,r),o.scrollTo(0,r),n(r)})},pp=function(n,e,t,r,o){var i=Ug(e,t),u=l(Eg,n);i<r||i<o?dp(e,e.dom().scrollTop-i+o).get(u):r<0&&dp(e,e.dom().scrollTop+r).get(u)},vp=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):bn(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},hp=function(n,a){return n.fold(function(n,e,t){return vi(n,e,a+(r=t)+"px"),Hg(r);var r},function(n,e){return o=a+(r=e),i=wi(t=n,"top").getOr(r),u=o-parseInt(i,10),c=t.dom().scrollTop+u,lp(t,c,o);var t,r,o,i,u,c})},yp=function(n,e){var t=rp(n),r=yn(t,function(n){return hp(n,e)});return vp(r,jg)},bp=function(e,t,n,r,o,i){var u,c,a=(u=function(n){return gp(e,t,n)},c=ao(Vg.pure({})),{start:function(e){var n=Vg.nu(function(n){return u(e).get(n)});c.set(n)},idle:function(n){c.get().get(function(){n()})}}),s=Om(function(){a.idle(function(){yp(n,r.pageYOffset).get(function(){var n;(n=nm(i),F.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?F.some({top:A(e),bottom:A(e+n.height())}):F.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),a.start(0),o.refresh()})})},1e3),f=wd(ue.fromDom(r),"scroll",function(){r.pageYOffset<0||s.throttle()});return yp(n,r.pageYOffset).get(h),{unbind:f.unbind}},wp=function(n){var t=n.cWin(),e=n.ceBody(),r=n.socket(),o=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),c=n.keyboardType(),a=n.outerWindow(),s=n.dropup(),f=op(r,e,o,s),l=c(n.outerBody(),t,ye(),u,o,i),d=Od(a,{onChange:I,onReady:f.refresh});d.onAdjustment(function(){f.refresh()});var m=wd(ue.fromDom(a),"resize",function(){f.isExpanding()&&f.refresh()}),g=bp(o,r,n.outerBody(),a,f,t),p=function(t,e){var n=t.document,r=ue.fromTag("div");no(r,ai.resolve("unfocused-selections")),ze(ue.fromDom(n.documentElement),r);var o=wd(r,"touchstart",function(n){n.prevent(),Dg(t,e),u()}),i=function(n){var e=ue.fromTag("span");return il(e,[ai.resolve("layer-editor"),ai.resolve("unfocused-selection")]),hi(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Pe(r)};return{update:function(){u();var n=nm(t),e=yn(n,i);Le(r,e)},isActive:function(){return 0<_e(r).length},destroy:function(){o.unbind(),$e(r)},clear:u}}(t,u),v=function(){p.clear()};return{toEditing:function(){l.toEditing(),v()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:v,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){pp(t,r,s,n,e)},updateToolbarPadding:I,setViewportOffset:function(n){f.setViewportOffset(n),mp(r,n).get(h)},syncHeight:function(){vi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:f.refresh,destroy:function(){f.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Cg(ye(),go)}}},xp=function(r,n){var o=Tm(),i=Bf(),u=Bf(),c=Rf(),a=Rf();return{enter:function(){n.hide();var t=ue.fromDom(p.document);pm.getActiveApi(r.editor).each(function(n){i.set({socketHeight:wi(r.socket,"height"),iframeHeight:wi(n.frame(),"height"),outerScroll:p.document.body.scrollTop}),u.set({exclusives:Nm.exclusive(t,"."+nd.scrollable())}),no(r.container,ai.resolve("fullscreen-maximized")),wm(r.container,n.body()),o.maximize(),vi(r.socket,"overflow","scroll"),vi(r.socket,"-webkit-overflow-scrolling","touch"),mo(n.body());var e=Ce(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);c.set(wp(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:I,outerBody:r.body,outerWindow:r.win,keyboardType:Ig.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),c.run(function(n){n.syncHeight()}),a.set(Ag(n,c,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){c.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),a.clear(),c.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){vi(r.socket,"height",n)}),n.iframeHeight.each(function(n){vi(r.editor.getFrame(),"height",n)}),p.document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),eo(r.container,ai.resolve("fullscreen-maximized")),xm(),nd.deregister(r.toolbar),xi(r.socket,"overflow"),xi(r.socket,"-webkit-overflow-scrolling"),go(r.editor.getFrame()),pm.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Tp=function(n){var e=Ut("Getting IosWebapp schema",Cm,n);vi(e.toolstrip,"width","100%"),vi(e.container,"position","relative");var t=yl(km(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var r=xp(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:r.refreshStructure,enter:r.enter,exit:r.exit,destroy:I}},Sp=tinymce.util.Tools.resolve("tinymce.EditorManager"),Op=function(n){var e=ht(n.settings,"skin_url").fold(function(){return Sp.baseURL+"/skins/lightgray"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},kp=function(n,e,t){n.system().broadcastOn([wo.formatChanged()],{command:e,state:t})},Cp=function(r,n){var e=R(n.formatter.get());bn(e,function(e){n.formatter.formatChanged(e,function(n){kp(r,e,n)})}),bn(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){kp(r,t,n)})})},Ep=(A(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Dp=A("toReading"),Ip=A("toEditing");yo.add("mobile",function(D){return{getNotificationManagerImpl:function(){return{open:A({progressBar:{value:I},close:I}),close:I,reposition:I,getArgs:h}},renderUI:function(n){var e=Op(D);0==(!1===D.settings.skin)?(D.contentCSS.push(e.content),ho.DOM.styleSheetLoader.load(e.ui,Ep(D))):Ep(D)();var t,r,o,i,u,c,a,s,f,l,d,m,g,p,v,h,y,b=function(){D.fire("scrollIntoView")},w=ue.fromTag("div"),x=zn.detect().os.isAndroid()?(s=b,f=xg({classes:[ai.resolve("android-container")]}),l=_m(),d=Rf(),m=zm(d),g=Lm(),p=rg(I,s),f.add(l.wrapper()),f.add(g),f.add(p.component()),{system:A(f),element:f.element,init:function(n){d.set(Em(n))},exit:function(){d.run(function(n){n.exit(),jl.remove(g,m)})},setToolbarGroups:function(n){var e=l.createGroups(n);l.setGroups(e)},setContextToolbar:function(n){var e=l.createGroups(n);l.setContextToolbar(e)},focusToolbar:function(){l.focus()},restoreToolbar:function(){l.restoreToolbar()},updateMode:function(n){Pm(g,m,n,f.root())},socket:A(g),dropup:A(p)}):(t=b,r=xg({classes:[ai.resolve("ios-container")]}),o=_m(),i=Rf(),u=zm(i),c=Lm(),a=rg(function(){i.run(function(n){n.refreshStructure()})},t),r.add(o.wrapper()),r.add(c),r.add(a.component()),{system:A(r),element:r.element,init:function(n){i.set(Tp(n))},exit:function(){i.run(function(n){jl.remove(c,u),n.exit()})},setToolbarGroups:function(n){var e=o.createGroups(n);o.setGroups(e)},setContextToolbar:function(n){var e=o.createGroups(n);o.setContextToolbar(e)},focusToolbar:function(){o.focus()},restoreToolbar:function(){o.restoreToolbar()},updateMode:function(n){Pm(c,u,n,r.root())},socket:A(c),dropup:A(a)}),T=ue.fromDom(n.targetNode);we("element","offset"),h=w,(y=v=T,F.from(y.dom().nextSibling).map(ue.fromDom)).fold(function(){Ne(v).each(function(n){ze(n,h)})},function(n){var e,t;t=h,Ne(e=n).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}),function(n,e){ze(n,e.element());var t=_e(e.element());bn(t,function(n){e.getByDom(n).each(Ue)})}(w,x.system());var S=n.targetNode.ownerDocument.defaultView,O=Od(S,{onChange:function(){x.system().broadcastOn([wo.orientationChanged()],{width:kd(S)})},onReady:I}),k=function(n,e,t,r){!1===r&&D.selection.collapse();var o=C(n,e,t);x.setToolbarGroups(!0===r?o.readOnly:o.main),D.setMode(!0===r?"readonly":"design"),D.fire(!0===r?Dp():Ip()),x.updateMode(r)},C=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},E=function(n,e){return D.on(n,e),{unbind:function(){D.off(n)}}};return D.on("init",function(){x.init({editor:{getFrame:function(){return ue.fromDom(D.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:I}},onToReading:function(n){return E(Dp(),n)},onToEditing:function(n){return E(Ip(),n)},onScrollToCursor:function(e){return D.on("scrollIntoView",function(n){e(n)}),{unbind:function(){D.off("scrollIntoView"),O.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolbar")));(n=e,vo(n).bind(function(n){return x.system().getByDom(n).toOption()})).each(te),x.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===me(e)?(D.selection.select(e.dom()),n.kill()):"a"===me(e)&&x.system().getByDom(ue.fromDom(D.editorContainer)).each(function(n){co.isAlpha(n)&&bo(e.dom())})}},container:ue.fromDom(D.editorContainer),socket:ue.fromDom(D.contentAreaContainer),toolstrip:ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolstrip"))),toolbar:ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolbar"))),dropup:x.dropup(),alloy:x.system(),translate:I,setReadOnly:function(n){k(a,c,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){x.dropup().disappear(function(){x.system().broadcastOn([wo.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[$a.forToolbar("back",function(){D.selection.collapse(),x.exit()},{})]},e={label:"Back to read only",scrollable:!1,items:[$a.forToolbar("readonly-back",function(){k(a,c,u,!0)},{})]},r=gd(x,D),o=pd(D.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=ao([{label:"the action group",scrollable:!0,items:o},i]),c=ao([{label:"The read only mode group",scrollable:!0,items:[]},i]),a=ao({backToMask:[n],backToReadOnly:[e]});Cp(x,D)}),D.on("remove",function(){x.exit()}),D.on("detach",function(){var e,n;e=x.system(),n=_e(e.element()),bn(n,function(n){e.getByDom(n).each(We)}),$e(e.element()),x.system().destroy(),$e(w)}),{iframeContainer:x.socket().element().dom(),editorContainer:x.element().dom()}}}})}(window);
|
@@ -1,2 +1,2 @@
|
|
1
|
-
// 4.9.
|
2
|
-
!function(j){"use strict";var o=function(){},H=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},q=function(e){return function(){return e}},$=function(e){return e};function d(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,a,u,s,c,l,f,m,g,p,h,v,y=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},b=q(!1),C=q(!0),x=function(){return w},w=(e=function(e){return e.isNone()},r={fold:function(e,t){return e()},is:b,isSome:b,isNone:C,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:q(null),getOrUndefined:q(undefined),or:n,orThunk:t,map:x,each:o,bind:x,exists:b,forall:C,filter:x,equals:e,equals_:e,toArray:function(){return[]},toString:q("none()")},Object.freeze&&Object.freeze(r),r),N=function(n){var e=q(n),t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:C,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return N(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:w},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(b,function(e){return t(n,e)})}};return o},_={some:N,none:x,from:function(e){return null===e||e===undefined?w:N(e)}},E=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},S=E("string"),T=E("object"),k=E("array"),A=E("null"),R=E("boolean"),D=E("function"),O=E("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(e,t){return P.call(e,t)},F=function(e,t){return-1<L(e,t)},M=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},W=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},z=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},K=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}},U=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},V=function(e,t,n){return z(e,function(e){n=t(n,e)}),n},X=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return _.some(o)}return _.none()},Y=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return _.some(n);return _.none()},G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!k(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);I.apply(t,e[n])}return t}(W(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},Q=function(e,t){return U(e,function(e){return!F(t,e)})},Z=function(e){return 0===e.length?_.none():_.some(e[0])},ee=function(e){return 0===e.length?_.none():_.some(e[e.length-1])},te=D(Array.from)?Array.from:function(e){return B.call(e)},ne="undefined"!=typeof j.window?j.window:Function("return this;")(),re=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:ne,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},oe={getOrDie:function(e,t){var n=re(e,t);if(n===undefined||null===n)throw new Error(e+" not available on this browser");return n}},ie=function(){return oe.getOrDie("URL")},ae={createObjectURL:function(e){return ie().createObjectURL(e)},revokeObjectURL:function(e){ie().revokeObjectURL(e)}},ue=j.navigator,se=ue.userAgent,ce=function(e){return"matchMedia"in j.window&&j.matchMedia(e).matches};m=/Android/.test(se),a=(a=!(i=/WebKit/.test(se))&&/MSIE/gi.test(se)&&/Explorer/gi.test(ue.appName))&&/MSIE (\w+)\./.exec(se)[1],u=-1!==se.indexOf("Trident/")&&(-1!==se.indexOf("rv:")||-1!==ue.appName.indexOf("Netscape"))&&11,s=-1!==se.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(se),l=-1!==se.indexOf("Mac"),f=/(iPad|iPhone)/.test(se),g="FormData"in j.window&&"FileReader"in j.window&&"URL"in j.window&&!!ae.createObjectURL,p=ce("only screen and (max-device-width: 480px)")&&(m||f),h=ce("only screen and (min-width: 800px)")&&(m||f),v=-1!==se.indexOf("Windows Phone"),s&&(i=!1);var le,fe={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:m,contentEditable:!f||g||534<=parseInt(se.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:j.window.getSelection&&"Range"in j.window,documentMode:a&&!s?j.document.documentMode||7:10,fileApi:g,ceFalse:!1===a||8<a,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!p&&!h,windowsPhone:v},de=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),me=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},ge=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},pe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=me(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},he={requestAnimationFrame:function(e,t){le?le.then(e):le=new de(function(e){t||(t=j.document.body),function(e,t){var n,r=j.window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=j.window[o[n]+"RequestAnimationFrame"];r||(r=function(e){j.window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:me,setInterval:ge,setEditorTimeout:function(e,t,n){return me(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=ge(function(){e.removed?clearInterval(r):t()},n)},debounce:pe,throttle:pe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},ve=/^(?:mouse|contextmenu)|click/,ye={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},be=function(){return!1},Ce=function(){return!0},xe=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},we=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Ne=function(e,t){var n,r,o=t||{};for(n in e)ye[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||j.document),fe.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&ve.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||j.document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Ce,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Ce,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Ce,o.stopPropagation()})==((r=o).isDefaultPrevented===Ce||r.isDefaultPrevented===be)&&(o.isDefaultPrevented=be,o.isPropagationStopped=be,o.isImmediatePropagationStopped=be),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},Ee=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(we(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void he.setTimeout(s)}a()};!r.addEventListener||fe.ie&&fe.ie<11?(xe(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():xe(e,"DOMContentLoaded",a),xe(e,"load",a)}},Se=function(){var m,g,p,h,v,y=this,b={};g="mce-data-"+(+new Date).toString(32),h="onmouseenter"in j.document.documentElement,p="onfocusin"in j.document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,y.domLoaded=!1,y.events=b;var C=function(e,t){var n,r,o,i,a=b[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};y.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=j.window,d=function(e){C(Ne(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,b[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),y.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Ne({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Ne(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=Ne(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=b[o][u])?"ready"===u&&y.domLoaded?n({type:u}):i.push({func:n,scope:r}):(b[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?Ee(e,c,y):xe(e,s||u,c,l)));return e=i=0,n}},y.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return y;if(r=e[g]){if(s=b[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],we(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],we(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return y;delete b[r];try{delete e[g]}catch(d){e[g]=null}}return y},y.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return y;for((n=Ne(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return y},y.clean=function(e){var t,n,r=y.unbind;if(!e||3===e.nodeType||8===e.nodeType)return y;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return y},y.destroy=function(){b={}},y.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};Se.Event=new Se,Se.Event.bind(j.window,"ready",function(){});var Te,ke,_e,Ae,Re,De,Oe,Be,Pe,Ie,Le,Fe,Me,ze,Ue,Ve,je,He,qe="sizzle"+-new Date,$e=j.window.document,We=0,Ke=0,Xe=Tt(),Ye=Tt(),Ge=Tt(),Je=function(e,t){return e===t&&(Le=!0),0},Qe=typeof undefined,Ze={}.hasOwnProperty,et=[],tt=et.pop,nt=et.push,rt=et.push,ot=et.slice,it=et.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},at="[\\x20\\t\\r\\n\\f]",ut="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",st="\\["+at+"*("+ut+")(?:"+at+"*([*^$|!~]?=)"+at+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ut+"))|)"+at+"*\\]",ct=":("+ut+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+st+")*)|.*)\\)|)",lt=new RegExp("^"+at+"+|((?:^|[^\\\\])(?:\\\\.)*)"+at+"+$","g"),ft=new RegExp("^"+at+"*,"+at+"*"),dt=new RegExp("^"+at+"*([>+~]|"+at+")"+at+"*"),mt=new RegExp("="+at+"*([^\\]'\"]*?)"+at+"*\\]","g"),gt=new RegExp(ct),pt=new RegExp("^"+ut+"$"),ht={ID:new RegExp("^#("+ut+")"),CLASS:new RegExp("^\\.("+ut+")"),TAG:new RegExp("^("+ut+"|[*])"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+ct),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+at+"*(even|odd|(([+-]|)(\\d*)n|)"+at+"*(?:([+-]|)"+at+"*(\\d+)|))"+at+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+at+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+at+"*((?:-\\d)?\\d*)"+at+"*\\)|)(?=[^-]|$)","i")},vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/^[^{]+\{\s*\[native \w/,Ct=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,wt=/'|\\/g,Nt=new RegExp("\\\\([\\da-f]{1,6}"+at+"?|("+at+")|.)","ig"),Et=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{rt.apply(et=ot.call($e.childNodes),$e.childNodes),et[$e.childNodes.length].nodeType}catch(nE){rt={apply:et.length?function(e,t){nt.apply(e,ot.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var St=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:$e)!==Me&&Fe(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Me).nodeType)&&9!==u)return[];if(Ue&&!r){if(o=Ct.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&He(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return rt.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ke.getElementsByClassName)return rt.apply(n,t.getElementsByClassName(a)),n}if(ke.qsa&&(!Ve||!Ve.test(e))){if(f=l=qe,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=De(e),(l=t.getAttribute("id"))?f=l.replace(wt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Pt(c[s]);d=xt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return rt.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return Be(e.replace(lt,"$1"),t,n,r)};function Tt(){var r=[];return function e(t,n){return r.push(t+" ")>_e.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function kt(e){return e[qe]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function At(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Rt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Dt(a){return kt(function(i){return i=+i,kt(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Qe&&e}for(Te in ke=St.support={},Re=St.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Fe=St.setDocument=function(e){var t,s=e?e.ownerDocument||e:$e,n=s.defaultView;return s!==Me&&9===s.nodeType&&s.documentElement?(ze=(Me=s).documentElement,Ue=!Re(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Fe()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Fe()})),ke.attributes=!0,ke.getElementsByTagName=!0,ke.getElementsByClassName=bt.test(s.getElementsByClassName),ke.getById=!0,_e.find.ID=function(e,t){if(typeof t.getElementById!==Qe&&Ue){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_e.filter.ID=function(e){var t=e.replace(Nt,Et);return function(e){return e.getAttribute("id")===t}},_e.find.TAG=ke.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Qe)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},_e.find.CLASS=ke.getElementsByClassName&&function(e,t){if(Ue)return t.getElementsByClassName(e)},je=[],Ve=[],ke.disconnectedMatch=!0,Ve=Ve.length&&new RegExp(Ve.join("|")),je=je.length&&new RegExp(je.join("|")),t=bt.test(ze.compareDocumentPosition),He=t||bt.test(ze.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Je=t?function(e,t){if(e===t)return Le=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ke.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===$e&&He($e,e)?-1:t===s||t.ownerDocument===$e&&He($e,t)?1:Ie?it.call(Ie,e)-it.call(Ie,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Le=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:Ie?it.call(Ie,e)-it.call(Ie,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===$e?-1:u[r]===$e?1:0},s):Me},St.matches=function(e,t){return St(e,null,null,t)},St.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Me&&Fe(e),t=t.replace(mt,"='$1']"),ke.matchesSelector&&Ue&&(!je||!je.test(t))&&(!Ve||!Ve.test(t)))try{var n=(void 0).call(e,t);if(n||ke.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(nE){}return 0<St(t,Me,null,[e]).length},St.contains=function(e,t){return(e.ownerDocument||e)!==Me&&Fe(e),He(e,t)},St.attr=function(e,t){(e.ownerDocument||e)!==Me&&Fe(e);var n=_e.attrHandle[t.toLowerCase()],r=n&&Ze.call(_e.attrHandle,t.toLowerCase())?n(e,t,!Ue):undefined;return r!==undefined?r:ke.attributes||!Ue?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},St.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},St.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Le=!ke.detectDuplicates,Ie=!ke.sortStable&&e.slice(0),e.sort(Je),Le){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Ie=null,e},Ae=St.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=Ae(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Ae(t);return n},(_e=St.selectors={cacheLength:50,createPseudo:kt,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Nt,Et),e[3]=(e[3]||e[4]||e[5]||"").replace(Nt,Et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||St.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&St.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ht.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&>.test(n)&&(t=De(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Nt,Et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Xe[e+" "];return t||(t=new RegExp("(^|"+at+")"+e+"("+at+"|$)"))&&Xe(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Qe&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=St.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),y="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=y&&e.nodeName.toLowerCase(),d=!n&&!y;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(y?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[qe]||(l[qe]={}))[m]||[])[0]===We&&r[1],a=r[0]===We&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[We,u,a];break}}else if(d&&(r=(e[qe]||(e[qe]={}))[m])&&r[0]===We)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((y?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[qe]||(i[qe]={}))[m]=[We,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=_e.pseudos[e]||_e.setFilters[e.toLowerCase()]||St.error("unsupported pseudo: "+e);return a[qe]?a(i):1<a.length?(t=[e,e,"",i],_e.setFilters.hasOwnProperty(e.toLowerCase())?kt(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=it.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:kt(function(e){var r=[],o=[],u=Oe(e.replace(lt,"$1"));return u[qe]?kt(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:kt(function(t){return function(e){return 0<St(t,e).length}}),contains:kt(function(t){return t=t.replace(Nt,Et),function(e){return-1<(e.textContent||e.innerText||Ae(e)).indexOf(t)}}),lang:kt(function(n){return pt.test(n||"")||St.error("unsupported lang: "+n),n=n.replace(Nt,Et).toLowerCase(),function(e){var t;do{if(t=Ue?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=j.window.location&&j.window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===ze},focus:function(e){return e===Me.activeElement&&(!Me.hasFocus||Me.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!_e.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Dt(function(){return[0]}),last:Dt(function(e,t){return[t-1]}),eq:Dt(function(e,t,n){return[n<0?n+t:n]}),even:Dt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Dt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Dt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Dt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=_e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_e.pseudos[Te]=At(Te);for(Te in{submit:!0,reset:!0})_e.pseudos[Te]=Rt(Te);function Bt(){}function Pt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function It(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Ke++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[We,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[qe]||(e[qe]={}))[u])&&r[0]===We&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Lt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Mt(m,g,p,h,v,e){return h&&!h[qe]&&(h=Mt(h)),v&&!v[qe]&&(v=Mt(v,e)),kt(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)St(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:Ft(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=Ft(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?it.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):rt.apply(t,d)})}function zt(e){for(var r,t,n,o=e.length,i=_e.relative[e[0].type],a=i||_e.relative[" "],u=i?1:0,s=It(function(e){return e===r},a,!0),c=It(function(e){return-1<it.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Pe)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=_e.relative[e[u].type])l=[It(Lt(l),t)];else{if((t=_e.filter[e[u].type].apply(null,e[u].matches))[qe]){for(n=++u;n<o&&!_e.relative[e[n].type];n++);return Mt(1<u&&Lt(l),1<u&&Pt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(lt,"$1"),t,u<n&&zt(e.slice(u,n)),n<o&&zt(e=e.slice(n)),n<o&&Pt(e))}l.push(t)}return Lt(l)}Bt.prototype=_e.filters=_e.pseudos,_e.setFilters=new Bt,De=St.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ye[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=_e.preFilter;a;){for(i in n&&!(r=ft.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=dt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(lt," ")}),a=a.slice(n.length)),_e.filter)!(r=ht[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?St.error(e):Ye(e,u).slice(0)},Oe=St.compile=function(e,t){var n,h,v,y,b,r,o=[],i=[],a=Ge[e+" "];if(!a){for(t||(t=De(e)),n=t.length;n--;)(a=zt(t[n]))[qe]?o.push(a):i.push(a);(a=Ge(e,(h=i,y=0<(v=o).length,b=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Pe,m=e||b&&_e.find.TAG("*",o),g=We+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Pe=t!==Me&&t);c!==p&&null!=(i=m[c]);c++){if(b&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(We=g)}y&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,y&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=tt.call(r));f=Ft(f)}rt.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&St.uniqueSort(r)}return o&&(We=g,Pe=d),l},y?kt(r):r))).selector=e}return a},Be=St.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&De(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&ke.getById&&9===t.nodeType&&Ue&&_e.relative[i[1].type]){if(!(t=(_e.find.ID(a.matches[0].replace(Nt,Et),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ht.needsContext.test(e)?0:i.length;o--&&(a=i[o],!_e.relative[u=a.type]);)if((s=_e.find[u])&&(r=s(a.matches[0].replace(Nt,Et),xt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Pt(i)))return rt.apply(n,r),n;break}}return(c||Oe(e,l))(r,t,!Ue,n,xt.test(e)&&Ot(t.parentNode)||t),n},ke.sortStable=qe.split("").sort(Je).join("")===qe,ke.detectDuplicates=!!Le,Fe(),ke.sortDetached=!0;var Ut=Array.isArray,Vt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},jt=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},Ht={isArray:Ut,toArray:function(e){var t,n,r=e;if(!Ut(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:Vt,map:function(n,r){var o=[];return Vt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return Vt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:jt,find:function(e,t,n){var r=jt(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},qt=/^\s*|\s*$/g,$t=function(e){return null===e||e===undefined?"":(""+e).replace(qt,"")},Wt=function(e,t){return t?!("array"!==t||!Ht.isArray(e))||typeof e===t:e!==undefined},Kt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),Ht.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Kt(e,n,r,o)}))},Xt={trim:$t,isArray:Ht.isArray,is:Wt,toArray:Ht.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:Ht.each,map:Ht.map,grep:Ht.filter,inArray:Ht.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Kt,createNS:function(e,t){var n,r;for(t=t||j.window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||j.window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Wt(e,"array")?e:Ht.map(e.split(t||","),$t)},_addCacheSuffix:function(e){var t=fe.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Yt=j.document,Gt=Array.prototype.push,Jt=Array.prototype.slice,Qt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Zt=Se.Event,en=Xt.makeMap("children,contents,next,prev"),tn=function(e){return void 0!==e},nn=function(e){return"string"==typeof e},rn=function(e,t){var n,r,o;for(o=(t=t||Yt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},on=function(e,t,n,r){var o;if(nn(t))t=rn(t,bn(e[0]));else if(t.length&&!t.nodeType){if(t=gn.makeArray(t),r)for(o=t.length-1;0<=o;o--)on(e,t[o],n,r);else for(o=0;o<t.length;o++)on(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},an=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},un=function(e,t,n){var r,o;return t=gn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},sn=Xt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),cn=Xt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ln={"for":"htmlFor","class":"className",readonly:"readOnly"},fn={"float":"cssFloat"},dn={},mn={},gn=function(e,t){return new gn.fn.init(e,t)},pn=/^\s*|\s*$/g,hn=function(e){return null===e||e===undefined?"":(""+e).replace(pn,"")},vn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return vn(e,function(e,t){n(t,e)&&r.push(t)}),r},bn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Yt};gn.fn=gn.prototype={constructor:gn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return gn(e).attr(t);o.context=t=j.document}if(nn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Qt.exec(e)))return gn(t).find(e);if(n[1])for(r=rn(e,bn(t)).firstChild;r;)Gt.call(o,r),r=r.nextSibling;else{if(!(r=bn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Xt.toArray(this)},add:function(e,t){var n,r,o=this;if(nn(e))return o.add(gn(e));if(!1!==t)for(n=gn.unique(o.toArray().concat(gn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Gt.apply(o,gn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)vn(t,function(e,t){r.attr(e,t)});else{if(!tn(n)){if(r[0]&&1===r[0].nodeType){if((e=dn[t])&&e.get)return e.get(r[0],t);if(cn[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=dn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=ln[e]||e))vn(e,function(e,t){n.prop(e,t)});else{if(!tn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)vn(n,function(e,t){i.css(e,t)});else if(tn(r))n=t(n),"number"!=typeof r||sn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=mn[n])&&o.set)o.set(this,r);else{try{this.style[fn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=mn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],Zt.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(tn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){gn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(tn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return on(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return on(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?on(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?on(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return gn(e).append(this),this},prependTo:function(e){return gn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return un(this,e)},wrapAll:function(e){return un(this,e,!0)},wrapInner:function(e){return this.each(function(){gn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){gn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),gn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?vn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=an(t,o))!==i&&(n=t.className,r?t.className=hn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return an(this[0],e)},each:function(e){return vn(this,e)},on:function(e,t){return this.each(function(){Zt.bind(this,e,t)})},off:function(e,t){return this.each(function(){Zt.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Zt.fire(this,e.type,e):Zt.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new gn(Jt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)gn.find(e,this[t],r);return gn(r)},filter:function(n){return gn("function"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):gn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof gn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&gn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),gn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Gt,sort:[].sort,splice:[].splice},Xt.extend(gn,{extend:Xt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Xt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Xt.isArray,each:vn,trim:hn,grep:yn,find:St,expr:St.selectors,unique:St.uniqueSort,text:St.getText,contains:St.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?gn.find.matchesSelector(t[0],e)?[t[0]]:[]:gn.find.matches(e,t)}});var Cn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof gn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&gn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},xn=function(e,t,n,r){var o=[];for(r instanceof gn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&gn(e).is(r))break}o.push(e)}return o},wn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};vn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Cn(e,"parentNode")},next:function(e){return wn(e,"nextSibling",1)},prev:function(e){return wn(e,"previousSibling",1)},children:function(e){return xn(e.firstChild,"nextSibling",1)},contents:function(e){return Xt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){gn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(gn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(en[e]||(n=gn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=gn(n),t?n.filter(t):n}}),vn({parentsUntil:function(e,t){return Cn(e,"parentNode",t)},nextUntil:function(e,t){return xn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return xn(e,"previousSibling",1,t).slice(1)}},function(r,o){gn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(gn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=gn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=gn(n),e?n.filter(e):n}}),gn.fn.is=function(e){return!!e&&0<this.filter(e).length},gn.fn.init.prototype=gn.fn,gn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return gn.extend(o,this),o};var Nn=function(n,r,e){vn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};fe.ie&&fe.ie<8&&(Nn(dn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),Nn(dn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),fe.ie&&fe.ie<9&&(fn["float"]="styleFloat",Nn(mn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),gn.attrHooks=dn,gn.cssHooks=mn;var En,Sn,Tn,kn,_n,An,Rn,Dn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Bn(r(1),r(2))},On=function(){return Bn(0,0)},Bn=function(e,t){return{major:e,minor:t}},Pn={nu:Bn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?On():Dn(e,n)},unknown:On},In="Firefox",Ln=function(e,t){return function(){return t===e}},Fn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ln("Edge",t),isChrome:Ln("Chrome",t),isIE:Ln("IE",t),isOpera:Ln("Opera",t),isFirefox:Ln(In,t),isSafari:Ln("Safari",t)}},Mn={unknown:function(){return Fn({current:undefined,version:Pn.unknown()})},nu:Fn,edge:q("Edge"),chrome:q("Chrome"),ie:q("IE"),opera:q("Opera"),firefox:q(In),safari:q("Safari")},zn="Windows",Un="Android",Vn="Solaris",jn="FreeBSD",Hn=function(e,t){return function(){return t===e}},qn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Hn(zn,t),isiOS:Hn("iOS",t),isAndroid:Hn(Un,t),isOSX:Hn("OSX",t),isLinux:Hn("Linux",t),isSolaris:Hn(Vn,t),isFreeBSD:Hn(jn,t)}},$n={unknown:function(){return qn({current:undefined,version:Pn.unknown()})},nu:qn,windows:q(zn),ios:q("iOS"),android:q(Un),linux:q("Linux"),osx:q("OSX"),solaris:q(Vn),freebsd:q(jn)},Wn=function(e,t){var n=String(t).toLowerCase();return X(e,function(e){return e.search(n)})},Kn=function(e,n){return Wn(e,n).map(function(e){var t=Pn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Xn=function(e,n){return Wn(e,n).map(function(e){var t=Pn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Yn=function(e,t){return-1!==e.indexOf(t)},Gn=function(e){return e.replace(/^\s+|\s+$/g,"")},Jn=function(e){return e.replace(/\s+$/g,"")},Qn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Zn=function(t){return function(e){return Yn(e,t)}},er=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Yn(e,"edge/")&&Yn(e,"chrome")&&Yn(e,"safari")&&Yn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qn],search:function(e){return Yn(e,"chrome")&&!Yn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Yn(e,"msie")||Yn(e,"trident")}},{name:"Opera",versionRegexes:[Qn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Zn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Zn("firefox")},{name:"Safari",versionRegexes:[Qn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Yn(e,"safari")||Yn(e,"mobile/"))&&Yn(e,"applewebkit")}}],tr=[{name:"Windows",search:Zn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Yn(e,"iphone")||Yn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Zn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Zn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Zn("linux"),versionRegexes:[]},{name:"Solaris",search:Zn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Zn("freebsd"),versionRegexes:[]}],nr={browsers:q(er),oses:q(tr)},rr=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=nr.browsers(),m=nr.oses(),g=Kn(d,e).fold(Mn.unknown,Mn.nu),p=Xn(m,e).fold($n.unknown,$n.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:q(o),isiPhone:q(i),isTablet:q(s),isPhone:q(l),isTouch:q(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:q(f)})}},or={detect:(En=function(){var e=j.navigator.userAgent;return rr(e)},Tn=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn||(Tn=!0,Sn=En.apply(null,e)),Sn})},ir=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:q(e)}},ar={fromHtml:function(e,t){var n=(t||j.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw j.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ir(n.childNodes[0])},fromTag:function(e,t){var n=(t||j.document).createElement(e);return ir(n)},fromText:function(e,t){var n=(t||j.document).createTextNode(e);return ir(n)},fromDom:ir,fromPoint:function(e,t,n){var r=e.dom();return _.from(r.elementFromPoint(t,n)).map(ir)}},ur=(j.Node.ATTRIBUTE_NODE,j.Node.CDATA_SECTION_NODE,j.Node.COMMENT_NODE,j.Node.DOCUMENT_NODE),sr=(j.Node.DOCUMENT_TYPE_NODE,j.Node.DOCUMENT_FRAGMENT_NODE,j.Node.ELEMENT_NODE),cr=j.Node.TEXT_NODE,lr=(j.Node.PROCESSING_INSTRUCTION_NODE,j.Node.ENTITY_REFERENCE_NODE,j.Node.ENTITY_NODE,j.Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),fr=function(t){return function(e){return e.dom().nodeType===t}},dr=fr(sr),mr=fr(cr),gr=Object.keys,pr=Object.hasOwnProperty,hr=function(e,t){for(var n=gr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},vr=function(e,r){var o={};return hr(e,function(e,t){var n=r(e,t);o[n.k]=n.v}),o},yr=function(e){return e.style!==undefined&&D(e.style.getPropertyValue)},br=function(e,t,n){if(!(S(n)||R(n)||O(n)))throw j.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Cr=function(e,t,n){br(e.dom(),t,n)},xr=function(e,t){var n=e.dom();hr(t,function(e,t){br(n,t,e)})},wr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},Nr=function(e,t){e.dom().removeAttribute(t)},Er=function(e,t){var n=e.dom();hr(t,function(e,t){!function(e,t,n){if(!S(n))throw j.console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);yr(e)&&e.style.setProperty(t,n)}(n,t,e)})},Sr=function(e,t){var n,r,o=e.dom(),i=j.window.getComputedStyle(o).getPropertyValue(t),a=""!==i||(r=mr(n=e)?n.dom().parentNode:n.dom())!==undefined&&null!==r&&r.ownerDocument.body.contains(r)?i:Tr(o,t);return null===a?undefined:a},Tr=function(e,t){return yr(e)?e.style.getPropertyValue(t):""},kr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return z(t,function(e,t){r[e]=q(n[t])}),r}},_r=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},Ar=function(){return oe.getOrDie("Node")},Rr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Dr=function(e,t){return Rr(e,t,Ar().DOCUMENT_POSITION_CONTAINED_BY)},Or=sr,Br=ur,Pr=function(e,t){var n=e.dom();if(n.nodeType!==Or)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Ir=function(e){return e.nodeType!==Or&&e.nodeType!==Br||0===e.childElementCount},Lr=function(e,t){return e.dom()===t.dom()},Fr=or.detect().browser.isIE()?function(e,t){return Dr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Mr=function(e){return ar.fromDom(e.dom().ownerDocument)},zr=function(e){return ar.fromDom(e.dom().ownerDocument.defaultView)},Ur=function(e){return _.from(e.dom().parentNode).map(ar.fromDom)},Vr=function(e){return _.from(e.dom().previousSibling).map(ar.fromDom)},jr=function(e){return _.from(e.dom().nextSibling).map(ar.fromDom)},Hr=function(e){return t=_r(e,Vr),(n=B.call(t,0)).reverse(),n;var t,n},qr=function(e){return _r(e,jr)},$r=function(e){return W(e.dom().childNodes,ar.fromDom)},Wr=function(e,t){var n=e.dom().childNodes;return _.from(n[t]).map(ar.fromDom)},Kr=function(e){return Wr(e,0)},Xr=function(e){return Wr(e,e.dom().childNodes.length-1)},Yr=(kr("element","offset"),or.detect().browser),Gr=function(e){return X(e,dr)},Jr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Sr(ar.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=ar.fromDom(t),Yr.isFirefox()&&"table"===lr(i)?Gr($r(i)).filter(function(e){return"caption"===lr(e)}).bind(function(o){return Gr(qr(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Qr={},Zr={exports:Qr};kn=undefined,_n=Qr,An=Zr,Rn=undefined,function(e){"object"==typeof _n&&void 0!==An?An.exports=e():"function"==typeof kn&&kn.amd?kn([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=e()}(function(){return function i(a,u,s){function c(t,e){if(!u[t]){if(!a[t]){var n="function"==typeof Rn&&Rn;if(!e&&n)return n(t,!0);if(l)return l(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};a[t][0].call(o.exports,function(e){return c(a[t][1][e]||e)},o,o.exports,i,a,u,s)}return u[t].exports}for(var l="function"==typeof Rn&&Rn,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,n){var r,o,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(nE){try{return r.call(null,e,0)}catch(nE){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(nE){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(nE){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&g())}function g(){if(!f){var e=s(m);f=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(nE){try{return o.call(null,e)}catch(nE){return o.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||f||s(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(e,f,t){(function(n){!function(e){var t=setTimeout;function r(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(e,this)}function o(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e=1===n._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(n._value)}catch(nE){return void u(r.promise,nE)}a(r.promise,t)}else(1===n._state?a:u)(r.promise,n._value)})):n._deferreds.push(r)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(nE){u(e,nE)}var r,o}function u(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,u(t,e))})}catch(r){if(n)return;n=!0,u(t,r)}}i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(r);return o(this,new c(e,t,n)),n},i.all=function(e){var s=Array.prototype.slice.call(e);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof n?function(e){n(e)}:function(e){t(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==f&&f.exports?f.exports=i:e.Promise||(e.Promise=i)}(this)}).call(this,e("timers").setImmediate)},{timers:3}],3:[function(s,e,c){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},a=0;function u(e,t){this._id=e,this._clearFn=t}c.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(e){e.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},c.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},c._unrefActive=c.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},c.setImmediate="function"==typeof e?e:function(e){var t=a++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),c.clearImmediate(t))}),t},c.clearImmediate="function"==typeof t?t:function(e){delete i[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(e,t,n){var r=e("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var eo=Zr.exports.boltExport,to=function(e){var n=_.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){z(e,a)},a=function(t){n.each(function(e){j.setTimeout(function(){t(e)},0)})};return e(function(e){n=_.some(e),i(t),t=[]}),{get:r,map:function(n){return to(function(t){r(function(e){t(n(e))})})},isReady:o}},no={nu:to,pure:function(t){return to(function(e){e(t)})}},ro=function(e){j.setTimeout(function(){throw e},0)},oo=function(n){var e=function(e){n().then(e,ro)};return{map:function(e){return oo(function(){return n().then(e)})},bind:function(t){return oo(function(){return n().then(function(e){return t(e).toPromise()})})},anonBind:function(e){return oo(function(){return n().then(function(){return e.toPromise()})})},toLazy:function(){return no.nu(e)},toCached:function(){var e=null;return oo(function(){return null===e&&(e=n()),e})},toPromise:n,get:e}},io={nu:function(e){return oo(function(){return new eo(e)})},pure:function(e){return oo(function(){return eo.resolve(e)})}},ao=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):z(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},uo=function(e){return ao(e,io.nu)},so=function(n){return{is:function(e){return n===e},isValue:C,isError:b,getOr:q(n),getOrThunk:q(n),getOrDie:q(n),or:function(e){return so(n)},orThunk:function(e){return so(n)},fold:function(e,t){return t(n)},map:function(e){return so(e(n))},mapError:function(e){return so(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return _.some(n)}}},co=function(n){return{is:b,isValue:b,isError:C,getOr:$,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return co(n)},mapError:function(e){return co(e(n))},each:o,bind:function(e){return co(n)},exists:b,forall:C,toOption:_.none}},lo={value:so,error:co,fromOption:function(e,t){return e.fold(function(){return co(t)},so)}};function fo(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var mo,go,po,ho=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,q(!0))).hasOwnProperty(lr(e))}},vo=ho(["h1","h2","h3","h4","h5","h6"]),yo=ho(["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"]),bo=function(e){return dr(e)&&!yo(e)},Co=function(e){return dr(e)&&"br"===lr(e)},xo=ho(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),wo=ho(["ul","ol","dl"]),No=ho(["li","dd","dt"]),Eo=ho(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),So=ho(["thead","tbody","tfoot"]),To=ho(["td","th"]),ko=ho(["pre","script","textarea","style"]),_o=function(t){return function(e){return!!e&&e.nodeType===t}},Ao=_o(1),Ro=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},Do=function(t){return function(e){if(Ao(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Oo=_o(3),Bo=_o(8),Po=_o(9),Io=_o(11),Lo=Ro("br"),Fo=Do("true"),Mo=Do("false"),zo={isText:Oo,isElement:Ao,isComment:Bo,isDocument:Po,isDocumentFragment:Io,isBr:Lo,isContentEditableTrue:Fo,isContentEditableFalse:Mo,isRestrictedNode:function(e){return!!e&&!Object.getPrototypeOf(e)},matchNodeNames:Ro,hasPropValue:function(t,n){return function(e){return Ao(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return Ao(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return Ao(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(Ao(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return Ao(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return Ao(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return Ao(e)&&"TABLE"===e.tagName}},Uo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Vo=function(e,t){var n,r=t.childNodes;if(!zo.isElement(t)||!Uo(t)){for(n=r.length-1;0<=n;n--)Vo(e,r[n]);if(!1===zo.isDocument(t)){if(zo.isText(t)&&0<t.nodeValue.length){var o=Xt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(zo.isElement(t)&&(1===(r=t.childNodes).length&&Uo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||Eo(ar.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},jo={trimNode:Vo},Ho=Xt.makeMap,qo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$o=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\"\']/g,Ko=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Xo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};go={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},po={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Yo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),go[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};mo=Yo("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);var Go=function(e,t){return e.replace(t?qo:$o,function(e){return go[e]||e})},Jo=function(e,t){return e.replace(t?qo:$o,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":go[e]||"&#"+e.charCodeAt(0)+";"})},Qo=function(e,t,n){return n=n||mo,e.replace(t?qo:$o,function(e){return go[e]||n[e]||e})},Zo={encodeRaw:Go,encodeAllRaw:function(e){return(""+e).replace(Wo,function(e){return go[e]||e})},encodeNumeric:Jo,encodeNamed:Qo,getEncodeFunc:function(e,t){var n=Yo(t)||mo,r=Ho(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?qo:$o,function(e){return go[e]!==undefined?go[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return Qo(e,t,n)}:Qo:r.numeric?Jo:Go},decode:function(e){return e.replace(Ko,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Xo[t]||String.fromCharCode(t):po[e]||mo[e]||(n=e,(r=ar.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},ei={},ti={},ni=Xt.makeMap,ri=Xt.each,oi=Xt.extend,ii=Xt.explode,ai=Xt.inArray,ui=function(e,t){return(e=Xt.trim(e))?e.split(t||" "):[]},si=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=ui(n)),r=(e=ui(e)).length;r--;)i={attributes:a(o=ui([u,t].join(" "))),attributesOrder:o,children:a(n,ti)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=ui(e)).length,t=ui(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return ei[e]?ei[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="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"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure main header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),ri(ui(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),ri(ui(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("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","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("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"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside main header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),ri(ui("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,ei[e]=s)},ci=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),ri(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?ni(e,/[, ]/):ii(e,/[, ]/)})),r};function li(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=ni(r,/[, ]/,ni(r.toUpperCase(),/[, ]/)):(r=ei[e])||(r=ni(t," ",ni(t.toUpperCase()," ")),r=oi(r,n),ei[e]=r),r};n=si((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ci(i.valid_styles),t=ci(i.invalid_styles,"map"),s=ci(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("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"),c=v("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",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),ri((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},y=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,y,b,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=ui(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(y in h)d[y]=h[y];m.push.apply(m,v)}if(s)for(r=0,o=(s=ui(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(ai(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),u.defaultValue=b),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),u.forcedValue=b),"<"===g&&(u.validValues=ni(b,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},b=function(e){N={},E=[],y(e),ri(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(ei.text_block_elements=ei.block_elements=null,ri(ui(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=oi({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}ri(g,function(e,t){e[r]&&(g[t]=e=oi({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;ei[i.schema]=null,e&&ri(ui(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],ri(ui(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?b(i.valid_elements):(ri(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&ri(ui("strong/b em/i"),function(e){e=ui(e,"/"),N[e[1]].outputName=e[0]}),ri(ui("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),ri(ui("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),ri(ui("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),y(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),ri({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(e,t){N[t]&&(N[t].parentsRequired=ui(e))}),i.invalid_elements&&ri(ii(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||y("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:y,setValidElements:b,addCustomElements:C,addValidChildren:x}}var fi=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function di(b,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},T="\ufeff";for(b=b||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+T).split(" "),C=0;C<t.length;C++)S[t[C]]=T+C,S[T+C]=t[C];return{toHex:function(e){return e.replace(x,fi)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=b.url_converter,f=b.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e){return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},y=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\\'")+"'";if(t=p(t||n||r),!b.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!b.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(T)||-1!==n.indexOf('"'))continue;if(!b.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,fi)).replace(w,y),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var mi,gi=Xt.each,pi=Xt.grep,hi=fe.ie,vi=/^([a-z0-9],?)+$/i,yi=/^[ \t\r\n]*$/,bi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},Ci=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},xi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function wi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=j.window,o={},t=0,e=function(m,g){void 0===g&&(g={});var p,h=0,v={};p=g.maxLoadTime||5e3;var y=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(e,t){e()||((new Date).getTime()-i<p?he.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=Xt._addCacheSuffix(e),v[e]?a=v[e]:(a={passed:[],failed:[]},v[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+h++,o.async=!1,o.defer=!1,i=(new Date).getTime(),g.contentCssCors&&(o.crossOrigin="anonymous"),"onload"in o&&!((d=j.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<j.navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void y(r);l()}var d;y(o),o.href=e}else s();else u()},t=function(t){return io.nu(function(e){n(t,H(e,q(lo.value(t))),H(e,q(lo.error(t))))})},o=function(e){return e.fold($,$)};return{load:n,loadAll:function(e,n,r){uo(W(e,t)).get(function(e){var t=K(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a,{contentCssCors:u.contentCssCors}),l=[],f=u.schema?u.schema:li({}),d=di({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new Se(u.proxy):Se.Event,n=f.getBlockElements(),g=gn.overrideDefaults(function(){return{context:a,element:V.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},y=function(e){var t=p(e);return t?t.attributes:[]},b=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Jr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=fe.ie&&fe.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(vi.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<St(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Xt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},k=function(e,n,r){var o,t="string"==typeof e?p(e):e;if(!t)return!1;if(Xt.isArray(t)&&(t.length||0===t.length))return o=[],gi(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},_=function(e,t){h(e).each(function(e,n){gi(t,function(e,t){b(n,t,e)})})},A=function(e,r){var t=h(e);hi?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){gn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},R=function(e,n,r,o,i){return k(e,function(e){var t="string"==typeof n?a.createElement(n):n;return _(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&A(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},O=Zo.decode,B=Zo.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},I=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&gn(this).attr("class",null)})},L=function(t,e,n){return k(e,function(e){return Xt.is(e,"array")&&(t=t.cloneNode(!0)),n&&gi(pi(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},F=function(){return a.createRange()},M=function(e,t,n,r){if(Xt.isArray(e)){for(var o=e.length;o--;)e[o]=M(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||V)},z=function(e,t,n){var r;if(Xt.isArray(e)){for(r=e.length;r--;)e[r]=z(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},U=function(e){if(e&&zo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$:h,root:null,clone:function(t,e){if(!hi||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return gi(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document.documentElement;return{x:t.pageXOffset||n.scrollLeft,y:t.pageYOffset||n.scrollTop,w:t.innerWidth||n.clientWidth,h:t.innerHeight||n.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return T(e,t,"nextSibling")},getPrev:function(e,t){return T(e,t,"previousSibling")},select:function(e,t){return St(e,p(t)||u.root_element||a,[])},is:E,add:R,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+B(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&Ci(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&Ci(d,n)},removeAllAttribs:function(e){return k(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:b,setAttribs:_,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(V!==wi.DOM&&a===j.document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;V===wi.DOM||a!==j.document?(e||(e=""),n=a.getElementsByTagName("head")[0],gi(e.split(","),function(e){var t;e=Xt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):wi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){I(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:I,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:A,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return zo.isElement(t)?t.outerHTML:gn("<div></div>").append(gn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(gn(this).html(t),!0)})},decode:O,encode:B,insertAfter:function(e,t){var r=p(t);return k(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:L,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),gi(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),L(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Xt.trim(e))},run:k,getAttribs:y,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new fo(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,zo.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=y(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!yi.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&yi.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:F,nodeIndex:xi,split:function(e,t,n){var r,o,i,a=F();if(e&&t)return a.setStart(e.parentNode,xi(e)),a.setEnd(t.parentNode,xi(t)),r=a.extractContents(),(a=F()).setStart(t.parentNode,xi(t)+1),a.setEnd(e.parentNode,xi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(jo.trimNode(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(jo.trimNode(V,o),e),P(e),n||t},bind:M,unbind:z,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:U,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=U(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}St.setDocument&&St.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=bi(d,u,function(){return V}),V}(mi=wi||(wi={})).DOM=mi(j.document),mi.nodeIndex=xi;var Ni=wi,Ei=Ni.DOM,Si=Xt.each,Ti=Xt.grep,ki=function(e){return"function"==typeof e},_i=function(){var l={},o=[],i={},a=[],f=0;this.isDone=function(e){return 2===l[e]},this.markDone=function(e){l[e]=2},this.add=this.load=function(e,t,n,r){l[e]===undefined&&(o.push(e),l[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete l[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var u,s=[],c=function(t,e){Si(i[e],function(e){ki(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(u=function(){var e=Ti(n);if(n.length=0,Si(e,function(e){var t,n,r,o,i,a;2!==l[e]?3!==l[e]?1!==l[e]&&(l[e]=1,f++,t=e,n=function(){l[e]=2,f--,c("success",e),u()},r=function(){l[e]=3,f--,s.push(e),c("failure",e),u()},i=(a=Ei).uniqueId(),(o=j.document.createElement("script")).id=i,o.type="text/javascript",o.src=Xt._addCacheSuffix(t),o.onload=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},o.onerror=function(){ki(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(j.document.getElementsByTagName("head")[0]||j.document.body).appendChild(o)):c("failure",e):c("success",e)}),!f){var t=a.slice(0);a.length=0,Si(t,function(e){0===s.length?ki(e.success)&&e.success.call(e.scope):ki(e.failure)&&e.failure.call(e.scope,s)})}})()}};_i.ScriptLoader=new _i;var Ai,Ri=Xt.each;function Di(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s(e);Ri(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(_i))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Di.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(e,t,n,r):_i.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Di.language;if(n&&!1!==Di.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;_i.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=K(i,function(e){return e.name===t});return i=r.fail,Ri(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];Ri(t,function(e){_i.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(Ai=Di||(Di={})).PluginManager=Ai(),Ai.ThemeManager=Ai();var Oi=function(t,n){Ur(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Bi=function(e,t){jr(e).fold(function(){Ur(e).each(function(e){Ii(e,t)})},function(e){Oi(e,t)})},Pi=function(t,n){Kr(t).fold(function(){Ii(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Ii=function(e,t){e.dom().appendChild(t.dom())},Li=function(t,e){z(e,function(e){Ii(t,e)})},Fi=function(e){e.dom().textContent="",z($r(e),function(e){Mi(e)})},Mi=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},zi=function(e){var t,n=$r(e);0<n.length&&(t=e,z(n,function(e){Oi(t,e)})),Mi(e)},Ui=function(n,r){var o=null;return{cancel:function(){null!==o&&(j.clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=j.setTimeout(function(){n.apply(null,e),o=null},r))}}},Vi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Vi(n())}}},ji=function(e,t){var n=wr(e,t);return n===undefined||""===n?[]:n.split(" ")},Hi=function(e){return e.dom().classList!==undefined},qi=function(e,t){return o=t,i=ji(n=e,r="class").concat([o]),Cr(n,r,i.join(" ")),!0;var n,r,o,i},$i=function(e,t){return o=t,0<(i=U(ji(n=e,r="class"),function(e){return e!==o})).length?Cr(n,r,i.join(" ")):Nr(n,r),!1;var n,r,o,i},Wi=function(e,t){Hi(e)?e.dom().classList.add(t):qi(e,t)},Ki=function(e){0===(Hi(e)?e.dom().classList:ji(e,"class")).length&&Nr(e,"class")},Xi=function(e,t){return Hi(e)&&e.dom().classList.contains(t)},Yi=function(e,t){var n=[];return z($r(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Yi(e,t))}),n},Gi=function(e,t){return n=t,o=(r=e)===undefined?j.document:r.dom(),Ir(o)?[]:W(o.querySelectorAll(n),ar.fromDom);var n,r,o};function Ji(e,t,n,r,o){return e(n,r)?_.some(n):D(o)&&o(n)?_.none():t(n,r,o)}var Qi,Zi=function(e,t,n){for(var r=e.dom(),o=D(n)?n:q(!1);r.parentNode;){r=r.parentNode;var i=ar.fromDom(r);if(t(i))return _.some(i);if(o(i))break}return _.none()},ea=function(e,t,n){return Ji(function(e,t){return t(e)},Zi,e,t,n)},ta=function(e,t,n){return Zi(e,function(e){return Pr(e,t)},n)},na=function(e,t){return n=t,o=(r=e)===undefined?j.document:r.dom(),Ir(o)?_.none():_.from(o.querySelector(n)).map(ar.fromDom);var n,r,o},ra=function(e,t,n){return Ji(Pr,ta,e,t,n)},oa=q("mce-annotation"),ia=q("data-mce-annotation"),aa=q("data-mce-annotation-uid"),ua=function(r,e){var t=r.selection.getRng(),n=ar.fromDom(t.startContainer),o=ar.fromDom(r.getBody()),i=e.fold(function(){return"."+oa()},function(e){return"["+ia()+'="'+e+'"]'}),a=Wr(n,t.startOffset).getOr(n),u=ra(a,i,function(e){return Lr(e,o)}),s=function(e,t){return n=t,(r=e.dom())&&r.hasAttribute&&r.hasAttribute(n)?_.some(wr(e,t)):_.none();var n,r};return u.bind(function(e){return s(e,""+aa()).bind(function(n){return s(e,""+ia()).map(function(e){var t=sa(r,n);return{uid:n,name:e,elements:t}})})})},sa=function(e,t){var n=ar.fromDom(e.getBody());return Gi(n,"["+aa()+'="'+t+'"]')},ca=function(i,e){var n,r,o,a=Vi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Vi(_.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=gr(r),(n=B.call(e,0)).sort(t),n);z(o,function(e){u(e,function(u){var s=u.previous.get();return ua(i,_.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){z(e.listeners,function(e){return e(!1,t)})}),u.previous.set(_.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){z(e.listeners,function(e){return e(!0,t,{uid:n,nodes:W(r,function(e){return e.dom()})})})}),u.previous.set(_.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(j.clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&j.clearTimeout(o),o=j.setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},la=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){z(e,function(t){var e;(e=t,_.from(e.attributes.map[ia()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},fa=0,da=function(e,t){return ar.fromDom(e.dom().cloneNode(t))},ma=function(e){return da(e,!1)},ga=function(e){return da(e,!0)},pa=function(e,t){var n,r,o=Mr(e).dom(),i=ar.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||j.document).createElement("div")).innerHTML=n,$r(ar.fromDom(r)));Li(i,a),Fi(e),Ii(e,i)},ha="\ufeff",va=function(e){return e===ha},ya=ha,ba=function(e){return e.replace(new RegExp(ha,"g"),"")},Ca=zo.isElement,xa=zo.isText,wa=function(e){return xa(e)&&(e=e.parentNode),Ca(e)&&e.hasAttribute("data-mce-caret")},Na=function(e){return xa(e)&&va(e.data)},Ea=function(e){return wa(e)||Na(e)},Sa=function(e){return e.firstChild!==e.lastChild||!zo.isBr(e.firstChild)},Ta=function(e){var t=e.container();return!(!e||!zo.isText(t))&&(t.data.charAt(e.offset())===ya||e.isAtStart()&&Na(t.previousSibling))},ka=function(e){var t=e.container();return!(!e||!zo.isText(t))&&(t.data.charAt(e.offset()-1)===ya||e.isAtEnd()&&Na(t.nextSibling))},_a=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=j.document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Aa=function(e){return xa(e)&&e.data[0]===ya},Ra=function(e){return xa(e)&&e.data[e.data.length-1]===ya},Da=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],zo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Oa=zo.isContentEditableTrue,Ba=zo.isContentEditableFalse,Pa=zo.isBr,Ia=zo.isText,La=zo.matchNodeNames("script style textarea"),Fa=zo.matchNodeNames("img input textarea hr iframe video audio object"),Ma=zo.matchNodeNames("table"),za=Ea,Ua=function(e){return!za(e)&&(Ia(e)?!La(e.parentNode):Fa(e)||Pa(e)||Ma(e)||Va(e))},Va=function(e){return!1===(t=e,zo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&Ba(e);var t},ja=function(e,t){return Ua(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Va(e))return!1;if(Oa(e))return!0}return!0}(e,t)},Ha=Math.round,qa=function(e){return e?{left:Ha(e.left),top:Ha(e.top),bottom:Ha(e.bottom),right:Ha(e.right),width:Ha(e.width),height:Ha(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},$a=function(e,t){return e=qa(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},Wa=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},Ka=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&Wa(t.top-e.bottom,e,t)},Xa=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Wa(t.bottom-e.top,e,t)},Ya=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Ga=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},Ja=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},Qa=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),Za=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&Qa.test(e)},eu=function(e,t,n){return e.isSome()&&t.isSome()?_.some(n(e.getOrDie(),t.getOrDie())):_.none()},tu=[].slice,nu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=tu.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},ru=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=tu.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},ou=zo.isElement,iu=Ua,au=zo.matchStyleValues("display","block table"),uu=zo.matchStyleValues("float","left right"),su=nu(ou,iu,y(uu)),cu=y(zo.matchStyleValues("white-space","pre pre-line pre-wrap")),lu=zo.isText,fu=zo.isBr,du=Ni.nodeIndex,mu=Ja,gu=function(e){return"createRange"in e?e.createRange():Ni.DOM.createRng()},pu=function(e){return e&&/[\r\n\t ]/.test(e)},hu=function(e){return!!e.setStart&&!!e.setEnd},vu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(pu(e.toString())&&cu(n.parentNode)&&zo.isText(n)&&(t=n.data,pu(t[r-1])||pu(t[r+1])))},yu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},bu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?qa(n[0]):qa(e.getBoundingClientRect()),!hu(e)&&fu(e)&&yu(t)?(i=(r=e).ownerDocument,a=gu(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=qa(a.getBoundingClientRect()),s.removeChild(u),o):yu(t)&&hu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&zo.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),bu(i)}return null}(e):t},Cu=function(e,t){var n=$a(e,t);return n.width=1,n.right=n.left+1,n},xu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=gu(e.ownerDocument);if(t<e.data.length){if(Za(e.data[t]))return r;if(Za(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!vu(n)))return o(Cu(bu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),vu(n)||o(Cu(bu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),vu(n)||o(Cu(bu(n),!0)))};if(lu(e.container()))return i(e.container(),e.offset()),r;if(ou(e.container()))if(e.isAtEnd())n=mu(e.container(),e.offset()),lu(n)&&i(n,n.data.length),su(n)&&!fu(n)&&o(Cu(bu(n),!1));else{if(n=mu(e.container(),e.offset()),lu(n)&&i(n,0),su(n)&&e.isAtEnd())return o(Cu(bu(n),!1)),r;t=mu(e.container(),e.offset()-1),su(t)&&!fu(t)&&(au(t)||au(n)||!su(n))&&o(Cu(bu(t),!1)),su(n)&&o(Cu(bu(n),!0))}return r};function wu(t,n,e){var r=function(){return e||(e=xu(wu(t,n))),e};return{container:q(t),offset:q(n),toRange:function(){var e;return(e=gu(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return lu(t),0===n},isAtEnd:function(){return lu(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return mu(t,e?n-1:n)}}}(Qi=wu||(wu={})).fromRangeStart=function(e){return Qi(e.startContainer,e.startOffset)},Qi.fromRangeEnd=function(e){return Qi(e.endContainer,e.endOffset)},Qi.after=function(e){return Qi(e.parentNode,du(e)+1)},Qi.before=function(e){return Qi(e.parentNode,du(e))},Qi.isAbove=function(e,t){return eu(Z(t.getClientRects()),ee(e.getClientRects()),Ka).getOr(!1)},Qi.isBelow=function(e,t){return eu(ee(t.getClientRects()),Z(e.getClientRects()),Xa).getOr(!1)},Qi.isAtStart=function(e){return!!e&&e.isAtStart()},Qi.isAtEnd=function(e){return!!e&&e.isAtEnd()},Qi.isTextPosition=function(e){return!!e&&zo.isText(e.container())},Qi.isElementPosition=function(e){return!1===Qi.isTextPosition(e)};var Nu,Eu,Su=wu,Tu=zo.isText,ku=zo.isBogus,_u=Ni.nodeIndex,Au=function(e){var t=e.parentNode;return ku(t)?Au(t):t},Ru=function(e){return e?Ht.reduce(e.childNodes,function(e,t){return ku(t)&&"BR"!==t.nodeName?e=e.concat(Ru(t)):e.push(t),e},[]):[]},Du=function(t){return function(e){return t===e}},Ou=function(e){var t,r,n,o;return(Tu(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Ru(Au(t=e)),n=Ht.findIndex(r,Du(t),t),r=r.slice(0,n+1),o=Ht.reduce(r,function(e,t,n){return Tu(t)&&Tu(r[n-1])&&e++,e},0),r=Ht.filter(r,zo.matchNodeNames(t.nodeName)),(n=Ht.findIndex(r,Du(t),t))-o)+"]"},Bu=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Tu(n)?o=function(e,t){for(;(e=e.previousSibling)&&Tu(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Ou(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=Ht.filter(a,y(zo.isBogus)),(u=u.concat(Ht.map(a,function(e){return Ou(e)}))).reverse().join("/")+","+o},Pu=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=Ht.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Ru(n),i=Ht.filter(i,function(e,t){return!Tu(e)||!Tu(i[t-1])}),(i=Ht.filter(i,zo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?Tu(r)?function(e,t){for(var n,r=e,o=0;Tu(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!Tu(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return Tu(e)&&t>e.data.length&&(t=e.data.length),Su(e,t)}(r,parseInt(o,10)):(o="after"===o?_u(r)+1:_u(r),Su(r.parentNode,o)):null):null},Iu=function(e,t){zo.isText(t)&&0===t.data.length&&e.remove(t)},Lu=function(e,t,n){var r,o,i,a,u,s,c;zo.isDocumentFragment(n)?(i=e,a=t,u=n,s=_.from(u.firstChild),c=_.from(u.lastChild),a.insertNode(u),s.each(function(e){return Iu(i,e.previousSibling)}),c.each(function(e){return Iu(i,e.nextSibling)})):(r=e,o=n,t.insertNode(o),Iu(r,o.previousSibling),Iu(r,o.nextSibling))},Fu=zo.isContentEditableFalse,Mu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(zo.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&zo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},zu=function(e,t,n){var r=0;return Xt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Uu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],zo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},Vu=function(e){return Uu(e,!0),Uu(e,!1),e},ju=function(e,t){var n;if(zo.isElement(e)&&(e=Ja(e,t),Fu(e)))return e;if(Ea(e)){if(zo.isText(e)&&wa(e)&&(e=e.parentNode),n=e.previousSibling,Fu(n))return n;if(n=e.nextSibling,Fu(n))return n}},Hu=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Fu(r)||"IMG"===o)return{name:o,index:zu(n.dom,o,r)};var a,u,s,c,l,f,d,m=ju((a=i).startContainer,a.startOffset)||ju(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:zu(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=Mu(f,u,c,l,!0),s.isCollapsed()||(d.end=Mu(f,u,c,l,!1)),d)},qu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},$u=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:zu(n,u,a)};var s=Vu(r.cloneRange());if(!i){s.collapse(!1);var c=qu(n,o+"_end",t);Lu(n,s,c)}(r=Vu(r)).collapse(!0);var l=qu(n,o+"_start",t);return Lu(n,r,l),e.moveToBookmark({id:o,keep:1}),{id:o}},Wu={getBookmark:function(e,t,n){return 2===t?Hu(ba,n,e):3===t?(o=(r=e).getRng(),{start:Bu(r.dom.getRoot(),Su.fromRangeStart(o)),end:Bu(r.dom.getRoot(),Su.fromRangeEnd(o))}):t?{rng:e.getRng()}:$u(e,!1);var r,o},getUndoBookmark:d(Hu,$,!0),getPersistentBookmark:$u},Ku="_mce_caret",Xu=function(e){return zo.isElement(e)&&e.id===Ku},Yu=function(e,t){for(;t&&t!==e;){if(t.id===Ku)return t;t=t.parentNode}return null},Gu=zo.isElement,Ju=zo.isText,Qu=function(e){var t=e.parentNode;t&&t.removeChild(e)},Zu=function(e,t){0===t.length?Qu(e):e.nodeValue=t},es=function(e){var t=ba(e);return{count:e.length-t.length,text:t}},ts=function(e,t){return os(e),t},ns=function(e,t){var n,r,o,i=t.container(),a=(n=te(i.childNodes),r=e,o=L(n,r),-1===o?_.none():_.some(o)).map(function(e){return e<t.offset()?Su(i,t.offset()-1):t}).getOr(t);return os(e),a},rs=function(e,t){return Ju(e)&&t.container()===e?(r=t,o=es((n=e).data.substr(0,r.offset())),i=es(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(Zu(n,a),Su(n,r.offset()-o.count)):r):ts(e,t);var n,r,o,i,a},os=function(e){if(Gu(e)&&Ea(e)&&(Sa(e)?e.removeAttribute("data-mce-caret"):Qu(e)),Ju(e)){var t=ba(function(e){try{return e.nodeValue}catch(t){return""}}(e));Zu(e,t)}},is={removeAndReposition:function(e,t){return Su.isTextPosition(t)?rs(e,t):(n=e,(r=t).container()===n.parentNode?ns(n,r):ts(n,r));var n,r},remove:os},as=or.detect().browser,us=zo.isContentEditableFalse,ss=function(e,t,n){var r,o,i,a,u,s=$a(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},cs=function(a,u,e){var t,s,c=Vi(_.none()),l=function(){!function(e){var t,n,r,o,i;for(t=gn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Ra(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Aa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(is.remove(s),s=null),c.get().each(function(e){gn(e.caret).remove(),c.set(_.none())}),clearInterval(t)},f=function(){t=he.setInterval(function(){e()?gn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):gn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,zo.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(ya),o=e.parentNode,t){if(n=e.previousSibling,xa(n)){if(Ea(n))return n;if(Ra(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,xa(n)){if(Ea(n))return n;if(Aa(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),us(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=_a("p",e,t),n=ss(a,e,t),gn(s).css("top",n.top);var i=gn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(_.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&gn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss: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;}"},reposition:function(){c.get().each(function(e){var t=ss(a,e.element,e.before);gn(e.caret).css(t)})},destroy:function(){return he.clearInterval(t)}}},ls=function(){return as.isIE()||as.isEdge()||as.isFirefox()},fs=function(e){return us(e)||zo.isTable(e)&&ls()},ds=zo.isContentEditableFalse,ms=zo.matchStyleValues("display","block table table-cell table-caption list-item"),gs=Ea,ps=wa,hs=zo.isElement,vs=Ua,ys=function(e){return 0<e},bs=function(e){return e<0},Cs=function(e,t){for(var n;n=e(t);)if(!ps(n))return n;return null},xs=function(e,t,n,r,o){var i=new fo(e,r);if(bs(t)){if((ds(e)||ps(e))&&n(e=Cs(i.prev,!0)))return e;for(;e=Cs(i.prev,o);)if(n(e))return e}if(ys(t)){if((ds(e)||ps(e))&&n(e=Cs(i.next,!0)))return e;for(;e=Cs(i.next,o);)if(n(e))return e}return null},ws=function(e,t){for(;e&&e!==t;){if(ms(e))return e;e=e.parentNode}return null},Ns=function(e,t,n){return ws(e.container(),n)===ws(t.container(),n)},Es=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),hs(n)?n.childNodes[r+e]:null):null},Ss=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Ts=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],gs(r)&&(r=r[o]),ds(r)){if(a=n,ws(r,i=t)===ws(a,i))return r;break}if(vs(r))break;n=n.parentNode}return null},ks=d(Ss,!0),_s=d(Ss,!1),As=function(e,t,n){var r,o,i,a,u=d(Ts,!0,t),s=d(Ts,!1,t);if(o=n.startContainer,i=n.startOffset,wa(o)){if(hs(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,fs(r)))return ks(r);if("after"===a&&(r=o.previousSibling,fs(r)))return _s(r)}if(!n.collapsed)return n;if(zo.isText(o)){if(gs(o)){if(1===e){if(r=s(o))return ks(r);if(r=u(o))return _s(r)}if(-1===e){if(r=u(o))return _s(r);if(r=s(o))return ks(r)}return n}if(Ra(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?ks(r):n;if(Aa(o)&&i<=1)return-1===e&&(r=u(o))?_s(r):n;if(i===o.data.length)return(r=s(o))?ks(r):n;if(0===i)return(r=u(o))?_s(r):n}return n},Rs=function(e,t){return _.from(Es(e?0:-1,t)).filter(ds)},Ds=function(e,t,n){var r=As(e,t,n);return-1===e?wu.fromRangeStart(r):wu.fromRangeEnd(r)},Os=function(e){return _.from(e.getNode()).map(ar.fromDom)},Bs=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Ps=function(e,t){var n=Ns(e,t);return!(n||!zo.isBr(e.getNode()))||n};(Eu=Nu||(Nu={}))[Eu.Backwards=-1]="Backwards",Eu[Eu.Forwards=1]="Forwards";var Is,Ls,Fs,Ms=zo.isContentEditableFalse,zs=zo.isText,Us=zo.isElement,Vs=zo.isBr,js=Ua,Hs=function(e){return Fa(e)||!!Va(t=e)&&!0!==V(te(t.getElementsByTagName("*")),function(e,t){return e||Oa(t)},!1);var t},qs=ja,$s=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ws=function(e,t){if(ys(e)){if(js(t.previousSibling)&&!zs(t.previousSibling))return Su.before(t);if(zs(t))return Su(t,0)}if(bs(e)){if(js(t.nextSibling)&&!zs(t.nextSibling))return Su.after(t);if(zs(t))return Su(t,t.data.length)}return bs(e)?Vs(t)?Su.before(t):Su.after(t):Su.before(t)},Ks=function(e,t,n){var r,o,i,a,u;if(!Us(n)||!t)return null;if(t.isEqual(Su.after(n))&&n.lastChild){if(u=Su.after(n.lastChild),bs(e)&&js(n.lastChild)&&Us(n.lastChild))return Vs(n.lastChild)?Su.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(zs(f)){if(bs(e)&&0<d)return Su(f,--d);if(ys(e)&&d<f.length)return Su(f,++d);r=f}else{if(bs(e)&&0<d&&(o=$s(f,d-1),js(o)))return!Hs(o)&&(i=xs(o,e,qs,o))?zs(i)?Su(i,i.data.length):Su.after(i):zs(o)?Su(o,o.data.length):Su.before(o);if(ys(e)&&d<f.childNodes.length&&(o=$s(f,d),js(o)))return Vs(o)?(s=n,(l=(c=o).nextSibling)&&js(l)?zs(l)?Su(l,0):Su.before(l):Ks(Nu.Forwards,Su.after(c),s)):!Hs(o)&&(i=xs(o,e,qs,o))?zs(i)?Su(i,0):Su.before(i):zs(o)?Su(o,0):Su.after(o);r=o||u.getNode()}return(ys(e)&&u.isAtEnd()||bs(e)&&u.isAtStart())&&(r=xs(r,e,q(!0),n,!0),qs(r,n))?Ws(e,r):(o=xs(r,e,qs,n),!(a=Ht.last(U(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),Ms)))||o&&a.contains(o)?o?Ws(e,o):null:u=ys(e)?Su.after(a):Su.before(a))},Xs=function(t){return{next:function(e){return Ks(Nu.Forwards,e,t)},prev:function(e){return Ks(Nu.Backwards,e,t)}}},Ys=function(e){return Su.isTextPosition(e)?0===e.offset():Ua(e.getNode())},Gs=function(e){if(Su.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Ua(e.getNode(!0))},Js=function(e,t){return!Su.isTextPosition(e)&&!Su.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Qs=function(e,t,n){return e?!Js(t,n)&&(r=t,!(!Su.isTextPosition(r)&&zo.isBr(r.getNode())))&&Gs(t)&&Ys(n):!Js(n,t)&&Ys(t)&&Gs(n);var r},Zs=function(e,t,n){var r=Xs(t);return _.from(e?r.next(n):r.prev(n))},ec=function(t,n,r){return Zs(t,n,r).bind(function(e){return Ns(r,e,n)&&Qs(t,r,e)?Zs(t,n,e):_.some(e)})},tc=function(t,n,e,r){return ec(t,n,e).bind(function(e){return r(e)?tc(t,n,e,r):_.some(e)})},nc=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return zo.isText(u)?_.some(Su(u,e?0:u.data.length)):u?Ua(u)?_.some(e?Su.before(u):(a=u,zo.isBr(a)?Su.before(a):Su.after(a))):(r=t,o=u,i=(n=e)?Su.before(o):Su.after(o),Zs(n,r,i)):_.none()},rc=d(Zs,!0),oc=d(Zs,!1),ic={fromPosition:Zs,nextPosition:rc,prevPosition:oc,navigate:ec,navigateIgnore:tc,positionIn:nc,firstPositionIn:d(nc,!0),lastPositionIn:d(nc,!1)},ac=function(e,t){return zo.isElement(t)&&e.isBlock(t)&&!t.innerHTML&&!fe.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},uc=function(e,t){return ic.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},sc=function(e,t,n){return!(!1!==t.hasChildNodes()||!Yu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(ya),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},cc=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,sc(c,i,r))return!0;if(s[o]>u.length-1)return!!sc(c,i,r)||uc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},lc=function(e){return zo.isText(e)&&0<e.data.length},fc=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):lc(c.nextSibling)?(r=c.nextSibling,o=0):lc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):lc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Xt.each(Xt.grep(c.childNodes),function(e){zo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&zo.isText(a)&&!fe.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return _.some(Su(u,s))}return _.none()},dc=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,y=e.dom;if(t){if(v=t,Xt.isArray(v.start))return p=t,h=(g=y).createRng(),cc(g,!0,p,h)&&cc(g,!1,p,h)?_.some(h):_.none();if("string"==typeof t.start)return _.some((f=t,d=(l=y).createRng(),m=Pu(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Pu(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=fc(o=y,"start",i=t),c=fc(o,"end",i),eu(s,(u=s,(a=c).isSome()?a:u),function(e,t){var n=o.createRng();return n.setStart(ac(o,e.container()),e.offset()),n.setEnd(ac(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=y,r=t,_.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return _.some(t.rng)}return _.none()},mc=function(e,t,n){return Wu.getBookmark(e,t,n)},gc=function(t,e){dc(t,e).each(function(e){t.setRng(e)})},pc=function(e){return zo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},hc=function(e){return e&&/^(IMG)$/.test(e.nodeName)},vc=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},yc=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},bc={isInlineBlock:hc,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!hc(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new fo(u=i[a],e.getParent(u,e.isBlock)):(r=new fo(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!vc(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!vc(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:vc,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:yc,getStyle:function(e,t,n){return yc(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Cc=pc,xc=bc.getParents,wc=bc.isWhiteSpaceNode,Nc=bc.isTextBlock,Ec=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Sc=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Tc=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1!==(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)&&!t&&(o<r||!e)&&o<=a.length&&o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},kc=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Tc(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new fo(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||Cc(u.parentNode)){if(e.isBlock(u)||bc.isEq(u,"BR"))break}else if(-1!==(s=Tc(o,i,c=u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},_c=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=xc(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Ac=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&Nc(t,e)},u)}if(o&&e[0].wrapper&&(o=xc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!bc.isEq(o,"br")););return o||n},Rc=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!wc(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!Cc(c)&&!wc(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Dc=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=Ja(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=Ja(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Sc(c,i),u=Sc(c,u),(Cc(i.parentNode)||Cc(i))&&(i=Cc(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(Cc(u.parentNode)||Cc(u))&&(u=Cc(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=kc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=kc(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=Ec(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Ec(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Rc(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Rc(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=_c(c,n,t,i,"previousSibling"),u=_c(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Ac(e,n,i,"previousSibling"),u=Ac(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Rc(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Rc(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Oc=Xt.each,Bc=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Oc(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},y=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},b=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=y(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=b(l,n)||l,i=b(d,n)||d,C(l,r,!0),(s=y(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Pc=(Is=mr,Ls="text",{get:function(e){if(!Is(e))throw new Error("Can only get "+Ls+" value of a "+Ls+" node");return Fs(e).getOr("")},getOption:Fs=function(e){return Is(e)?_.from(e.dom().nodeValue):_.none()},set:function(e,t){if(!Is(e))throw new Error("Can only set raw "+Ls+" value of a "+Ls+" node");e.dom().nodeValue=t}}),Ic=function(e){return Pc.get(e)},Lc=function(r,o,i,a){return Ur(o).fold(function(){return"skipping"},function(e){return"br"===a||mr(n=o)&&"\ufeff"===Ic(n)?"valid":dr(t=o)&&Xi(t,oa())?"existing":Xu(o)?"caret":bc.isValid(r,i,a)&&bc.isValid(r,lr(e),i)?"valid":"invalid-child";var t,n})},Fc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++fa+String(i)):a,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),c=ar.fromTag("span",e);Wi(c,oa()),Cr(c,""+aa(),u),Cr(c,""+ia(),n);var l,f=r(u,s),d=f.attributes,m=void 0===d?{}:d,g=f.classes,p=void 0===g?[]:g;return xr(c,m),l=c,z(p,function(e){Wi(l,e)}),c},Mc=function(i,e,t,n,r){var a=[],u=Fc(i.getDoc(),r,t,n),s=Vi(_.none()),c=function(){s.set(_.none())},l=function(e){z(e,o)},o=function(e){var t,n;switch(Lc(i,e,"span",lr(e))){case"invalid-child":c();var r=$r(e);l(r),c();break;case"valid":var o=s.get().getOrThunk(function(){var e=ma(u);return a.push(e),s.set(_.some(e)),e});Oi(t=e,n=o),Ii(n,t)}};return Bc(i.dom,e,function(e){var t;c(),t=W(e,ar.fromDom),l(t)}),a},zc=function(s,c,l,f){s.undoManager.transact(function(){var e,t,n,r,o=s.selection.getRng();if(o.collapsed&&(r=Dc(e=s,t=o,[{inline:!0}],3===(n=t).startContainer.nodeType&&n.startContainer.nodeValue.length>=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Fc(s.getDoc(),f,c,l.decorate);pa(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=Wu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();Mc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Uc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?_.from(n[e]).map(function(e){return e.settings}):_.none()}});la(s,r);var o=ca(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){zc(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ua(s,_.some(e)).each(function(e){var t=e.elements;z(t,zi)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=ar.fromDom(t.getBody()),o=Gi(r,"["+ia()+'="'+n+'"]'),i={},z(o,function(e){var t=wr(e,aa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return W(e,function(e){return e.dom()})},vr(u,function(e,t){return{k:t,v:a(e,t)}})}}}var Vc=function(e){return Xt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},jc=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||zo.isBr(t));var t},Hc=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||jc(t))?e.slice(0,-1):e;var t},qc=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},$c=function(e,t){var n=Su.after(e),r=Xs(t).prev(n);return r?r.toRange():null},Wc=function(t,e,n){var r,o,i,a,u=t.parentNode;return Xt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=Su.before(r),(a=Xs(o).next(i))?a.toRange():null},Kc=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},Xc=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,y,b,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=qc(o,i.startContainer),S=Hc(Vc(N.firstChild)),T=o.getRoot(),k=function(e){var t=Su.fromRangeStart(i),n=Xs(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||qc(o,r.getNode())!==E};return k(1)?Wc(E,S,T):k(2)?(f=E,d=S,m=T,o.insertAfter(d.reverse(),f),$c(d[0],m)):(p=S,h=T,v=g=E,b=(y=i).cloneRange(),C=y.cloneRange(),b.setStartBefore(v),C.setEndAfter(v),x=[b.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Xt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),$c(p[p.length-1],h))},Yc=function(e,t){return!!qc(e,t)},Gc=Xt.each,Jc=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Gc(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||pc(e)||pc(t))}},Qc=function(e){var t=Gi(e,"br"),n=U(function(e){for(var t=[],n=e.dom();n;)t.push(ar.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Co);t.length===n.length&&z(n,Mi)},Zc=function(e){Fi(e),Ii(e,ar.fromHtml('<br data-mce-bogus="1">'))},el=function(n){Xr(n).each(function(t){Vr(t).each(function(e){yo(n)&&Co(t)&&yo(e)&&Mi(t)})})},tl=Xt.makeMap;function nl(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=tl(e.indent_before||""),c=tl(e.indent_after||""),l=Zo.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function rl(t,g){void 0===g&&(g=li());var p=nl(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var ol,il=function(a){var u=Su.fromRangeStart(a),s=Su.fromRangeEnd(a),c=a.commonAncestorContainer;return ic.fromPosition(!1,c,s).map(function(e){return!Ns(u,s,c)&&Ns(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=j.document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},al=function(e){return e.collapsed?e:il(e)},ul=zo.matchNodeNames("td th"),sl=function(e,t){var n,r,o=e.selection.getRng(),i=o.startContainer,a=o.startOffset;o.collapsed&&(n=i,r=a,zo.isText(n)&&"\xa0"===n.nodeValue[r-1])&&zo.isText(i)&&(i.insertData(a-1," "),i.deleteData(a,1),o.setStart(i,a),o.setEnd(i,a),e.selection.setRng(o)),e.selection.setContent(t)},cl=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=e.selection,p=e.dom;if(/^ | $/.test(t)&&(t=function(e,t){var n,r;n=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?t=t.replace(/^ /," "):o("previousSibling")||(t=t.replace(/^ /," ")),r<n.length?t=t.replace(/ (<br>|)$/," "):o("nextSibling")||(t=t.replace(/( | )(<br>|)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=rl({validate:e.settings.validate},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">​</span>',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,x,w=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(al(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),y=e.selection.getRng(),b=t,C=y.startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(b)||(b+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var E,S,T,k={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Kc(e.schema,u)&&Yc(p,i))return l=Xc(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(sl(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):sl(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Jc(r);Xt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),fe.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),ul(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=Su.fromRangeStart(e);if(t=Xs(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Xt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,T=e.selection.getStart(),_.from(S.getParent(T,"td,th")).map(ar.fromDom).each(el),e.fire("SetContent",s),e.addVisual()}},ll=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Xt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};cl(e,o.content,o.details)},fl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,dl=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},ml=function(e){return e.getParam("iframe_attrs",{})},gl=function(e){return e.getParam("doctype","<!DOCTYPE html>")},pl=function(e){return e.getParam("document_base_url","")},hl=function(e){return dl(e,"body_id","tinymce")},vl=function(e){return dl(e,"body_class","")},yl=function(e){return e.getParam("content_security_policy","")},bl=function(e){return e.getParam("br_in_pre",!0)},Cl=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},xl=function(e){return e.getParam("forced_root_block_attrs",{})},wl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Nl=function(e){return e.getParam("no_newline_selector","")},El=function(e){return e.getParam("keep_styles",!0)},Sl=function(e){return e.getParam("end_container_on_empty_block",!1)},Tl=function(e){return Xt.explode(e.getParam("font_size_style_values",""))},kl=function(e){return Xt.explode(e.getParam("font_size_classes",""))},_l=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},Al=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Rl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Dl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Ol=function(e){return e.getParam("images_upload_url","","string")},Bl=function(e){return e.getParam("images_upload_base_path","","string")},Pl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Il=function(e){return e.getParam("images_upload_handler",null,"function")},Ll=function(e){return e.getParam("content_css_cors",!1,"boolean")},Fl=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},Ml=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Na(n)?zo.isText(n.nextSibling)?Su(n.nextSibling,0):Su.after(n):Ta(t)?Su(n,r+1):t:Na(n)?zo.isText(n.previousSibling)?Su(n.previousSibling,n.previousSibling.data.length):Su.before(n):ka(t)?Su(n,r-1):t},zl={isInlineTarget:function(e,t){return Pr(ar.fromDom(t),Fl(e))},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(Ni.DOM.getParents(i.container(),"*",o),r));return _.from(a[a.length-1])},isRtl:function(e){return"rtl"===Ni.DOM.getStyle(e,"direction",!0)||(t=e.textContent,fl.test(t));var t},isAtZwsp:function(e){return Ta(e)||ka(e)},normalizePosition:Ml,normalizeForwards:d(Ml,!0),normalizeBackwards:d(Ml,!1),hasSameParentBlock:function(e,t,n){var r=ws(t,e),o=ws(n,e);return r&&r===o}},Ul=function(e,t){return Fr(e,t)?ea(t,function(e){return xo(e)||No(e)},(n=e,function(e){return Lr(n,ar.fromDom(e.dom().parentNode))})):_.none();var n},Vl=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},jl=function(i,a,u){return eu(ic.firstPositionIn(u),ic.lastPositionIn(u),function(e,t){var n=zl.normalizePosition(!0,e),r=zl.normalizePosition(!1,t),o=zl.normalizePosition(!1,a);return i?ic.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):ic.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Hl=function(e,t){var n,r,o,i=ar.fromDom(e),a=ar.fromDom(t);return n=a,r="pre,code",o=d(Lr,i),ta(n,r,o).isSome()},ql=function(e,t){return Ua(t)&&!1===(r=e,o=t,zo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Hl(r,o))||(n=t,zo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||$l(t);var n,r,o},$l=zo.hasAttribute("data-mce-bookmark"),Wl=zo.hasAttribute("data-mce-bogus"),Kl=zo.hasAttributeValue("data-mce-bogus","all"),Xl=function(e){return function(e){var t,n,r=0;if(ql(e,e))return!1;if(!(n=e.firstChild))return!0;t=new fo(n,e);do{if(Kl(n))n=t.next(!0);else if(Wl(n))n=t.next();else if(zo.isBr(n))r++,n=t.next();else{if(ql(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Yl=kr("block","position"),Gl=kr("from","to"),Jl=function(e,t){var n=ar.fromDom(e),r=ar.fromDom(t.container());return Ul(n,r).map(function(e){return Yl(e,t)})},Ql=function(o,i,e){var t=Jl(o,Su.fromRangeStart(e)),n=t.bind(function(e){return ic.fromPosition(i,o,e.position()).bind(function(e){return Jl(o,e).map(function(e){return t=o,n=i,r=e,zo.isBr(r.position().getNode())&&!1===Xl(r.block())?ic.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?ic.fromPosition(n,t,e).bind(function(e){return Jl(t,e)}):_.some(r)}).getOr(r):r;var t,n,r})})});return eu(t,n,Gl).filter(function(e){return!1===Lr((r=e).from().block(),r.to().block())&&Ur((n=e).from().block()).bind(function(t){return Ur(n.to().block()).filter(function(e){return Lr(t,e)})}).isSome()&&(t=e,!1===zo.isContentEditableFalse(t.from().block().dom())&&!1===zo.isContentEditableFalse(t.to().block().dom()));var t,n,r})},Zl=function(e,t,n){return n.collapsed?Ql(e,t,n):_.none()},ef=function(e,t,n){return Fr(t,e)?function(e,t){for(var n=D(t)?t:b,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=ar.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Lr(e,t)}).slice(0,-1):[]},tf=function(e,t){return ef(e,t,q(!1))},nf=tf,rf=function(e,t){return[e].concat(tf(e,t))},of=function(e){var t,n=(t=$r(e),Y(t,yo).fold(function(){return t},function(e){return t.slice(0,e)}));return z(n,Mi),n},af=function(e,t){var n=rf(t,e);return X(n.reverse(),Xl).each(Mi)},uf=function(e,t,n,r){if(Xl(n))return Zc(n),ic.firstPositionIn(n.dom());0===U(Hr(r),function(e){return!Xl(e)}).length&&Xl(t)&&Oi(r,ar.fromTag("br"));var o=ic.prevPosition(n.dom(),Su.before(r.dom()));return z(of(t),function(e){Oi(r,e)}),af(e,t),o},sf=function(e,t,n){if(Xl(n))return Mi(n),Xl(t)&&Zc(t),ic.firstPositionIn(t.dom());var r=ic.lastPositionIn(n.dom());return z(of(t),function(e){Ii(n,e)}),af(e,t),r},cf=function(e,t){return Fr(t,e)?(n=rf(e,t),_.from(n[n.length-1])):_.none();var n},lf=function(e,t){ic.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(ar.fromDom).filter(Co).each(Mi)},ff=function(e,t,n){return lf(!0,t),lf(!1,n),cf(t,n).fold(d(sf,e,t,n),d(uf,e,t,n))},df=function(e,t,n,r){return t?ff(e,r,n):ff(e,n,r)},mf=function(t,n){var e,r=ar.fromDom(t.getBody());return(e=Zl(r.dom(),n,t.selection.getRng()).bind(function(e){return df(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},gf=function(e,t){var n=ar.fromDom(t),r=d(Lr,e);return Zi(n,To,r).isSome()},pf=function(e,t){var n,r,o=ic.prevPosition(e.dom(),Su.fromRangeStart(t)).isNone(),i=ic.nextPosition(e.dom(),Su.fromRangeEnd(t)).isNone();return!(gf(n=e,(r=t).startContainer)||gf(n,r.endContainer))&&o&&i},hf=function(e){var n,r,o,t,i=ar.fromDom(e.getBody()),a=e.selection.getRng();return pf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),eu(Ul(n,ar.fromDom(o.startContainer)),Ul(n,ar.fromDom(o.endContainer)),function(e,t){return!1===Lr(e,t)&&(o.deleteContents(),df(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},vf=function(e,t){return!e.selection.isCollapsed()&&hf(e)},yf=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=gr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=gr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return F(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){j.console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},bf=function(e){return Os(e).exists(Co)},Cf=function(e,t,n){var r=U(rf(ar.fromDom(n.container()),t),yo),o=Z(r).getOr(t);return ic.fromPosition(e,o.dom(),n).filter(bf)},xf=function(e,t){return Os(t).exists(Co)||Cf(!0,e,t).isSome()},wf=function(e,t){return(n=t,_.from(n.getNode(!0)).map(ar.fromDom)).exists(Co)||Cf(!1,e,t).isSome();var n},Nf=d(Cf,!1),Ef=d(Cf,!0),Sf=(ol="\xa0",function(e){return ol===e}),Tf=function(e){return/^[\r\n\t ]$/.test(e)},kf=function(e){return!Tf(e)&&!Sf(e)},_f=function(n,r,o){return _.from(o.container()).filter(zo.isText).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Af=d(_f,!0,Tf),Rf=d(_f,!1,Tf),Df=function(e){var t=e.container();return zo.isText(t)&&0===t.data.length},Of=function(e,t){var n=Es(e,t);return zo.isContentEditableFalse(n)&&!zo.isBogusAll(n)},Bf=d(Of,0),Pf=d(Of,-1),If=function(e,t){return zo.isTable(Es(e,t))},Lf=d(If,0),Ff=d(If,-1),Mf=yf([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),zf=function(e,t,n,r){var o=r.getNode(!1===t);return Ul(ar.fromDom(e),ar.fromDom(n.getNode())).map(function(e){return Xl(e)?Mf.remove(e.dom()):Mf.moveToElement(o)}).orThunk(function(){return _.some(Mf.moveToElement(o))})},Uf=function(u,s,c){return ic.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),To(ar.fromDom(a))||No(ar.fromDom(a))?_.none():(t=u,o=e,i=function(e){return bo(ar.fromDom(e))&&!Ns(r,o,t)},Rs(!(n=s),r=c).fold(function(){return Rs(n,o).fold(q(!1),i)},i)?_.none():s&&zo.isContentEditableFalse(e.getNode())?zf(u,s,c,e):!1===s&&zo.isContentEditableFalse(e.getNode(!0))?zf(u,s,c,e):s&&Pf(c)?_.some(Mf.moveToPosition(e)):!1===s&&Bf(c)?_.some(Mf.moveToPosition(e)):_.none());var t,n,r,o,i,a})},Vf=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",zo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&zo.isContentEditableFalse(n.nextSibling)?_.some(Mf.moveToElement(n.nextSibling)):!1===t&&zo.isContentEditableFalse(n.previousSibling)?_.some(Mf.moveToElement(n.previousSibling)):_.none()).fold(function(){return Uf(r,e,o)},_.some):Uf(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return _.some(Mf.remove(e))},function(e){return _.some(Mf.moveToElement(e))},function(e){return Ns(n,e,t)?_.none():_.some(Mf.moveToPosition(e))});var t,n});var t,n,i,a,u},jf=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,V((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},Hf=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return jf(e,t,o)},qf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Su.isTextPosition(n)&&o===r.parentNode&&i>Su.before(r).offset()?Su(t.container(),t.offset()-1):t;var n,r,o,i},$f=function(e){return Ua(e.previousSibling)?_.some((t=e.previousSibling,zo.isText(t)?Su(t,t.data.length):Su.after(t))):e.previousSibling?ic.lastPositionIn(e.previousSibling):_.none();var t},Wf=function(e){return Ua(e.nextSibling)?_.some((t=e.nextSibling,zo.isText(t)?Su(t,0):Su.before(t))):e.nextSibling?ic.firstPositionIn(e.nextSibling):_.none();var t},Kf=function(r,o){return $f(o).orThunk(function(){return Wf(o)}).orThunk(function(){return e=r,t=o,n=Su.before(t.previousSibling?t.previousSibling:t.parentNode),ic.prevPosition(e,n).fold(function(){return ic.nextPosition(e,Su.after(t))},_.some);var e,t,n})},Xf=function(n,r){return Wf(r).orThunk(function(){return $f(r)}).orThunk(function(){return e=n,t=r,ic.nextPosition(e,Su.after(t)).fold(function(){return ic.prevPosition(e,Su.before(t))},_.some);var e,t})},Yf=function(e,t,n){return(r=e,o=t,i=n,r?Xf(o,i):Kf(o,i)).map(d(qf,n));var r,o,i},Gf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},Jf=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(lr(t))},Qf=function(e){if(Xl(e)){var t=ar.fromHtml('<br data-mce-bogus="1">');return Fi(e),Ii(e,t),_.some(Su.before(t.dom()))}return _.none()},Zf=function(e,t,l){var n,r,o,i,a=Vr(e).filter(mr),u=jr(e).filter(mr);return Mi(e),(n=a,r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Jn((r=u).data).length,r.appendData(o.data),Mi(ar.fromDom(o)),i&&Hf(r,a),n.container()===s?Su(u,c):n},n.isSome()&&r.isSome()&&o.isSome()?_.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):_.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Jn(r).length,jf(t,n-o,o);var t,n,r,o}),u.each(function(e){return Hf(e.dom(),0)})),t})},ed=function(e,t){return n=e.schema.getTextInlineElements(),r=lr(t),pr.call(n,r);var n,r},td=function(t,n,e,r){void 0===r&&(r=!0);var o,i=Yf(n,t.getBody(),e.dom()),a=Zi(e,d(Jf,t),(o=t.getBody(),function(e){return e.dom()===o})),u=Zf(e,i,ed(t,e));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(Qf).fold(function(){r&&Gf(t,n,u)},function(e){r&&Gf(t,n,_.some(e))})},nd=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=As(t?1:-1,e,n),o=Su.fromRangeStart(r),i=ar.fromDom(e),!1===t&&Pf(o)?_.some(Mf.remove(o.getNode(!0))):t&&Bf(o)?_.some(Mf.remove(o.getNode())):!1===t&&Bf(o)&&wf(i,o)?Nf(i,o).map(function(e){return Mf.remove(e.getNode())}):t&&Pf(o)&&xf(i,o)?Ef(i,o).map(function(e){return Mf.remove(e.getNode())}):Vf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),td(o,i,ar.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Su.before(e):Su.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},rd=function(e,t){var n,r=e.selection.getNode();return!!zo.isContentEditableFalse(r)&&(n=ar.fromDom(e.getBody()),z(Gi(n,".mce-offscreen-selection"),Mi),td(e,t,ar.fromDom(e.selection.getNode())),Vl(e),!0)},od=function(e,t){return e.selection.isCollapsed()?nd(e,t):rd(e,t)},id=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(zo.isContentEditableTrue(t)||zo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return zo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Su.before(t).toRange())),!0},ad=zo.isText,ud=function(e){return ad(e)&&e.data[0]===ya},sd=function(e){return ad(e)&&e.data[e.data.length-1]===ya},cd=function(e){return e.ownerDocument.createTextNode(ya)},ld=function(e,t){return e?function(e){if(ad(e.previousSibling))return sd(e.previousSibling)||e.previousSibling.appendData(ya),e.previousSibling;if(ad(e))return ud(e)||e.insertData(0,ya),e;var t=cd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(ad(e.nextSibling))return ud(e.nextSibling)||e.nextSibling.insertData(0,ya),e.nextSibling;if(ad(e))return sd(e)||e.appendData(ya),e;var t=cd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},fd=d(ld,!0),dd=d(ld,!1),md=function(e,t){return zo.isText(e.container())?ld(t,e.container()):ld(t,e.getNode())},gd=function(e,t){var n=t.get();return n&&e.container()===n&&Na(n)},pd=function(n,e){return e.fold(function(e){is.remove(n.get());var t=fd(e);return n.set(t),_.some(Su(t,t.length-1))},function(e){return ic.firstPositionIn(e).map(function(e){if(gd(e,n))return Su(n.get(),1);is.remove(n.get());var t=md(e,!0);return n.set(t),Su(t,1)})},function(e){return ic.lastPositionIn(e).map(function(e){if(gd(e,n))return Su(n.get(),n.get().length-1);is.remove(n.get());var t=md(e,!1);return n.set(t),Su(t,t.length-1)})},function(e){is.remove(n.get());var t=dd(e);return n.set(t),_.some(Su(t,1))})},hd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return _.none()},vd=yf([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),yd=function(e,t){var n=ws(t,e);return n||e},bd=function(e,t,n){var r=zl.normalizeForwards(n),o=yd(t,r.container());return zl.findRootInline(e,o,r).fold(function(){return ic.nextPosition(o,r).bind(d(zl.findRootInline,e,o)).map(function(e){return vd.before(e)})},_.none)},Cd=function(e,t){return null===Yu(e,t)},xd=function(e,t,n){return zl.findRootInline(e,t,n).filter(d(Cd,t))},wd=function(e,t,n){var r=zl.normalizeBackwards(n);return xd(e,t,r).bind(function(e){return ic.prevPosition(e,r).isNone()?_.some(vd.start(e)):_.none()})},Nd=function(e,t,n){var r=zl.normalizeForwards(n);return xd(e,t,r).bind(function(e){return ic.nextPosition(e,r).isNone()?_.some(vd.end(e)):_.none()})},Ed=function(e,t,n){var r=zl.normalizeBackwards(n),o=yd(t,r.container());return zl.findRootInline(e,o,r).fold(function(){return ic.prevPosition(o,r).bind(d(zl.findRootInline,e,o)).map(function(e){return vd.after(e)})},_.none)},Sd=function(e){return!1===zl.isRtl(kd(e))},Td=function(e,t,n){return hd([bd,wd,Nd,Ed],[e,t,n]).filter(Sd)},kd=function(e){return e.fold($,$,$,$)},_d=function(e){return e.fold(q("before"),q("start"),q("end"),q("after"))},Ad=function(e){return e.fold(vd.before,vd.before,vd.after,vd.after)},Rd=function(n,e,r,t,o,i){return eu(zl.findRootInline(e,r,t),zl.findRootInline(e,r,o),function(e,t){return e!==t&&zl.hasSameParentBlock(r,e,t)?vd.after(n?e:t):i}).getOr(i)},Dd=function(e,r){return e.fold(q(!0),function(e){return n=r,!(_d(t=e)===_d(n)&&kd(t)===kd(n));var t,n})},Od=function(e,t){return e?t.fold(H(_.some,vd.start),_.none,H(_.some,vd.after),_.none):t.fold(_.none,H(_.some,vd.before),_.none,H(_.some,vd.end))},Bd=function(a,u,s,c){var e=zl.normalizePosition(a,c),l=Td(u,s,e);return Td(u,s,e).bind(d(Od,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=zl.normalizePosition(t,e),ic.fromPosition(t,r,i).map(d(zl.normalizePosition,t)).fold(function(){return o.map(Ad)},function(e){return Td(n,r,e).map(d(Rd,t,n,r,i,e)).filter(d(Dd,o))}).filter(Sd);var t,n,r,o,e,i})},Pd=Td,Id=Bd,Ld=(d(Bd,!1),d(Bd,!0),Ad),Fd=function(e){return e.fold(vd.start,vd.start,vd.end,vd.end)},Md=function(e){return D(e.selection.getSel().modify)},zd=function(e,t,n){var r=e?1:-1;return t.setRng(Su(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Ud=function(e,t){var n=t.selection.getRng(),r=e?Su.fromRangeEnd(n):Su.fromRangeStart(n);return!!Md(t)&&(e&&Ta(r)?zd(!0,t.selection,r):!(e||!ka(r))&&zd(!1,t.selection,r))},Vd=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},jd=function(e){return!1!==e.settings.inline_boundaries},Hd=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},qd=function(t,e,n){return pd(e,n).map(function(e){return Vd(t,e),n})},$d=function(e,t,n){return function(){return!!jd(t)&&Ud(e,t)}},Wd={move:function(a,u,s){return function(){return!!jd(a)&&(t=a,n=u,e=s,r=t.getBody(),o=Su.fromRangeStart(t.selection.getRng()),i=d(zl.isInlineTarget,t),Id(e,i,r,o).bind(function(e){return qd(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:d($d,!0),movePrevWord:d($d,!1),setupSelectedState:function(a){var u=Vi(null),s=d(zl.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;jd(a)&&(t=s,n=a.dom,r=e.parents,o=U(n.select('*[data-mce-selected="inline-boundary"]'),t),i=U(r,t),z(Q(o,i),d(Hd,!1)),z(Q(i,o),d(Hd,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Su.fromRangeStart(e.selection.getRng());Su.isTextPosition(n)&&!1===zl.isAtZwsp(n)&&(Vd(e,is.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=U(e,n);z(t,function(e){var t=Su.fromRangeStart(r.selection.getRng());Pd(n,r.getBody(),t).bind(function(e){return qd(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:Vd},Kd=function(t,n){return function(e){return pd(n,e).map(function(e){return Wd.setCaretPosition(t,e),!0}).getOr(!1)}},Xd=function(r,o,i,a){var u=r.getBody(),s=d(zl.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=j.document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),Pd(s,u,Su.fromRangeStart(r.selection.getRng())).map(Fd).map(Kd(r,o))}),r.nodeChanged()},Yd=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),ws(t,e)||e),u=d(zl.isInlineTarget,n),s=Pd(u,a,o);return s.bind(function(e){return i?e.fold(q(_.some(Fd(e))),_.none,q(_.some(Ld(e))),_.none):e.fold(_.none,q(_.some(Ld(e))),_.none,q(_.some(Fd(e))))}).map(Kd(n,r)).getOrThunk(function(){var t=ic.navigate(i,a,o),e=t.bind(function(e){return Pd(u,a,e)});return s.isSome()&&e.isSome()?zl.findRootInline(u,a,o).map(function(e){return o=e,!!eu(ic.firstPositionIn(o),ic.lastPositionIn(o),function(e,t){var n=zl.normalizePosition(!0,e),r=zl.normalizePosition(!1,t);return ic.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(td(n,i,ar.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?Xd(n,r,o,e):Xd(n,r,e,o),!0})}).getOr(!1)})},Gd=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=Su.fromRangeStart(e.selection.getRng());return Yd(e,t,n,r)}return!1},Jd=kr("start","end"),Qd=kr("rng","table","cells"),Zd=yf([{removeTable:["element"]},{emptyCells:["cells"]}]),em=function(e,t){return ra(ar.fromDom(e),"td,th",t)},tm=function(e,t){return ta(e,"table",t)},nm=function(e){return!1===Lr(e.start(),e.end())},rm=function(e,n){return tm(e.start(),n).bind(function(t){return tm(e.end(),n).bind(function(e){return Lr(t,e)?_.some(t):_.none()})})},om=function(e){return Gi(e,"td,th")},im=function(r,e){var t=em(e.startContainer,r),n=em(e.endContainer,r);return e.collapsed?_.none():eu(t,n,Jd).fold(function(){return t.fold(function(){return n.bind(function(t){return tm(t,r).bind(function(e){return Z(om(e)).map(function(e){return Jd(e,t)})})})},function(t){return tm(t,r).bind(function(e){return ee(om(e)).map(function(e){return Jd(t,e)})})})},function(e){return am(r,e)?_.none():(n=r,tm((t=e).start(),n).bind(function(e){return ee(om(e)).map(function(e){return Jd(t.start(),e)})}));var t,n})},am=function(e,t){return rm(t,e).isSome()},um=function(e,t){var n,r,o,i,a=d(Lr,e);return(n=t,r=a,o=em(n.startContainer,r),i=em(n.endContainer,r),eu(o,i,Jd).filter(nm).filter(function(e){return am(r,e)}).orThunk(function(){return im(r,n)})).bind(function(e){return rm(t=e,a).map(function(e){return Qd(t,e,om(e))});var t})},sm=function(e,t){return Y(e,function(e){return Lr(e,t)})},cm=function(n){return(r=n,eu(sm(r.cells(),r.rng().start()),sm(r.cells(),r.rng().end()),function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?Zd.removeTable(n.table()):Zd.emptyCells(e)});var r},lm=function(e,t){return um(e,t).bind(cm)},fm=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},dm=fm,mm=function(e){return G(e,function(e){var t=Ga(e);return t?[ar.fromDom(t)]:[]})},gm=function(e){return 1<fm(e).length},pm=function(e){return U(mm(e),To)},hm=function(e){return Gi(e,"td[data-mce-selected],th[data-mce-selected]")},vm=function(e,t){var n=hm(t),r=pm(e);return 0<n.length?n:r},ym=vm,bm=function(e){return vm(dm(e.selection.getSel()),ar.fromDom(e.getBody()))},Cm=function(e,t){return z(t,Zc),e.selection.setCursorLocation(t[0].dom(),0),!0},xm=function(e,t){return td(e,!1,t),!0},wm=function(n,e,r,t){return Em(e,t).fold(function(){return t=n,lm(e,r).map(function(e){return e.fold(d(xm,t),d(Cm,t))});var t},function(e){return Sm(n,e)}).getOr(!1)},Nm=function(e,t){return X(rf(t,e),To)},Em=function(e,t){return X(rf(t,e),function(e){return"caption"===lr(e)})},Sm=function(e,t){return Zc(t),e.selection.setCursorLocation(t.dom(),0),_.some(!0)},Tm=function(u,s,c,l,f){return ic.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,ic.firstPositionIn(r.dom()).bind(function(t){return ic.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Sm(u,l):(t=l,n=e,Em(s,ar.fromDom(n.getNode())).map(function(e){return!1===Lr(e,t)}));var t,n,r,o,i,a}).or(_.some(!0))},km=function(a,u,s,e){var c=Su.fromRangeStart(a.selection.getRng());return Nm(s,e).bind(function(e){return Xl(e)?Sm(a,e):(t=a,n=s,r=u,o=e,i=c,ic.navigate(r,t.getBody(),i).bind(function(e){return Nm(n,ar.fromDom(e.getNode())).map(function(e){return!1===Lr(e,o)})}));var t,n,r,o,i})},_m=function(a,u,e){var s=ar.fromDom(a.getBody());return Em(s,e).fold(function(){return km(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=Su.fromRangeStart(t.selection.getRng()),Xl(o)?Sm(t,o):Tm(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},Am=function(e,t){var n,r,o,i,a,u=ar.fromDom(e.selection.getStart(!0)),s=bm(e);return e.selection.isCollapsed()&&0===s.length?_m(e,t,u):(n=e,r=u,o=ar.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=bm(n)).length?Cm(n,a):wm(n,o,i,r))},Rm=bc.isEq,Dm=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},Om=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!Dm(t,e,n)||e.parentNode===o||!!Im(t,e,n,r,!0)}),Im(t,e,n,r))},Bm=function(e,t,n){return!!Rm(t,n.inline)||!!Rm(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Pm=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):bc.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Rm(u,bc.normalizeStyleValue(e,bc.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):bc.getStyle(e,t,c[s]))return n;return n},Im=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],Bm(e.dom,t,i)&&Pm(l,t,i,"attributes",o,r)&&Pm(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Lm={matchNode:Im,matchName:Bm,match:function(e,t,n,r){var o;return r?Om(e,r,t,n):(r=e.selection.getNode(),!!Om(e,r,t,n)||!((o=e.selection.getStart())===r||!Om(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&Im(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=bc.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:Dm},Fm=function(e,t){return e.splitText(t)},Mm=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&zo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=Fm(t,n)).previousSibling,n<o?(t=r=Fm(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(zo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=Fm(t,n),n=0),zo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=Fm(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},zm=ya,Um="_mce_caret",Vm=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==zm||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},jm=function(e){var t;if(e)for(e=(t=new fo(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Hm=function(e){var t=ar.fromTag("span");return xr(t,{id:Um,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Ii(t,ar.fromText(zm)),t},qm=function(e,t,n){void 0===n&&(n=!0);var r,o=e.dom,i=e.selection;if(Vm(t))td(e,!1,ar.fromDom(t),n);else{var a=i.getRng(),u=o.getParent(t,o.isBlock),s=((r=jm(t))&&r.nodeValue.charAt(0)===zm&&r.deleteData(0,1),r);a.startContainer===s&&0<a.startOffset&&a.setStart(s,a.startOffset-1),a.endContainer===s&&0<a.endOffset&&a.setEnd(s,a.endOffset-1),o.remove(t,!0),u&&o.isEmpty(u)&&Zc(ar.fromDom(u)),i.setRng(a)}},$m=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)qm(e,t,n);else if(!(t=Yu(e.getBody(),o.getStart())))for(;t=r.get(Um);)qm(e,t,!1)},Wm=function(e,t,n){var r=e.dom,o=r.getParent(n,d(bc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Qc(ar.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},Km=function(e,t){return e.appendChild(t),t},Xm=function(e,t){var n,r,o=(n=function(e,t){return Km(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}(e,function(e){r=n(r,e)}),r);return Km(o,o.ownerDocument.createTextNode(zm))},Ym=function(i){i.on("mouseup keydown",function(e){var t,n,r,o;t=i,n=e.keyCode,r=t.selection,o=t.getBody(),$m(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==zm||$m(t,Yu(o,r.getStart())),37!==n&&39!==n||$m(t,Yu(o,r.getStart()))})},Gm=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(lr(t))&&!Xu(t.dom())&&!zo.isBogus(t.dom())},Jm=function(e){return 1===$r(e).length},Qm=function(e,t,n,r){var o,i,a,u,s=d(Gm,t),c=W(U(r,s),function(e){return e.dom()});if(0===c.length)td(t,e,n);else{var l=(o=n.dom(),i=c,a=Hm(!1),u=Xm(i,a.dom()),Oi(ar.fromDom(o),a),Mi(ar.fromDom(o)),Su(u,0));t.selection.setRng(l.toRange())}},Zm=function(r,o){var t,e=ar.fromDom(r.getBody()),n=ar.fromDom(r.selection.getStart()),i=U((t=rf(n,e),Y(t,yo).fold(q(t),function(e){return t.slice(0,e)})),Jm);return ee(i).map(function(e){var t,n=Su.fromRangeStart(r.selection.getRng());return!(!jl(o,n,e.dom())||Xu((t=e).dom())&&Vm(t.dom())||(Qm(o,r,e,i),0))}).getOr(!1)},eg=function(e,t){return!!e.selection.isCollapsed()&&Zm(e,t)},tg=zo.isContentEditableTrue,ng=zo.isContentEditableFalse,rg=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},og=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},ig=function(e,t,n){var r=As(1,e.getBody(),t),o=Su.fromRangeStart(r),i=o.getNode();if(ng(i))return rg(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(ng(a))return rg(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return ng(e)||tg(e)});return ng(u)?rg(1,e,u,!1,n):null},ag=function(e,t,n){if(!t||!t.collapsed)return t;var r=ig(e,t,n);return r||t},ug=function(e,t,n,r,o,i){var a,u,s=rg(r,e,i.getNode(!o),o,!0);if(t.collapsed){var c=t.cloneRange();o?c.setEnd(s.startContainer,s.startOffset):c.setStart(s.endContainer,s.endOffset),c.deleteContents()}else t.deleteContents();return e.selection.setRng(s),a=e.dom,u=n,zo.isText(u)&&0===u.data.length&&a.remove(u),!0},sg=function(e,t){return function(e,t){var n=e.selection.getRng();if(!zo.isText(n.commonAncestorContainer))return!1;var r=t?Nu.Forwards:Nu.Backwards,o=Xs(e.getBody()),i=d(Bs,o.next),a=d(Bs,o.prev),u=t?i:a,s=t?Bf:Pf,c=Ds(r,e.getBody(),n),l=zl.normalizePosition(t,u(c));if(!l)return!1;if(s(l))return ug(e,n,c.getNode(),r,t,l);var f=u(l);return!!(f&&s(f)&&Ps(l,f))&&ug(e,n,c.getNode(),r,t,f)}(e,t)},cg=function(e,t){e.getDoc().execCommand(t,!1,null)},lg=function(e){od(e,!1)||sg(e,!1)||Gd(e,!1)||mf(e,!1)||Am(e)||vf(e,!1)||eg(e,!1)||(cg(e,"Delete"),Vl(e))},fg=function(e){od(e,!0)||sg(e,!0)||Gd(e,!0)||mf(e,!0)||Am(e)||vf(e,!0)||eg(e,!0)||cg(e,"ForwardDelete")},dg=function(o,t,e){var n=function(e){return t=o,n=e.dom(),r=Tr(n,t),_.from(r).filter(function(e){return 0<e.length});var t,n,r};return ea(ar.fromDom(e),function(e){return n(e).isSome()},function(e){return Lr(ar.fromDom(t),e)}).bind(n)},mg=function(o){return function(r,e){return _.from(e).map(ar.fromDom).filter(dr).bind(function(e){return dg(o,r,e.dom()).or((t=o,n=e.dom(),_.from(Ni.DOM.getStyle(n,t,!0))));var t,n}).getOr("")}},gg={getFontSize:mg("font-size"),getFontFamily:H(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},mg("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},pg=function(e){return ic.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return zo.isText(t)?t.parentNode:t})},hg=function(o){return _.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?_.none():_.from(o.selection.getStart(!0))})},vg=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=Tl(e),o=kl(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},yg=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},bg=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},Cg=function(e,t,n){return bg(e,t,function(e){return e.nodeName===n})},xg=function(e){return e&&"TABLE"===e.nodeName},wg=function(e,t,n){for(var r=new fo(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(zo.isBr(t))return!0},Ng=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&zo.isBr(o)&&t&&e.isEmpty(u))return _.some(wu(o.parentNode,e.nodeIndex(o)));for(i=new fo(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,Ea(c=s)&&!1===bg(c,l,Xu)))return _.none();if(zo.isText(s)&&0<s.nodeValue.length)return!1===Cg(s,f,"A")?_.some(wu(s,r?s.nodeValue.length:0)):_.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return _.none();a=s}return n&&a?_.some(wu(a,0)):_.none()},Eg=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=zo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,Ea(o))return _.none();if(zo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),zo.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(Ea(u))return _.none();if(s[u.nodeName]||xg(u))return _.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=zo.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&xg(o))return _.none();if(function(e,t){for(;t&&t!==e;){if(zo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||Ea(o))return _.none();if(o.hasChildNodes()&&!1===xg(o)){a=new fo(u=o,g);do{if(zo.isContentEditableFalse(u)||Ea(u)){p=!1;break}if(zo.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(zo.isText(o)&&0===i&&Ng(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),zo.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!zo.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||wg(e,u,!1)||wg(e,u,!0)||Ng(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&zo.isText(o)&&i===o.nodeValue.length&&Ng(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?_.some(wu(o,i)):_.none()},Sg=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=wu.fromRangeStart(t);return Eg(e,n,!0,r).each(function(e){n&&wu.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Eg(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),yg(t,r)?_.none():_.some(r)},Tg=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},kg=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},_g=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Sg(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new fo(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Lu(i,a,n),Tg(i,o,n),kg(i,o,n,r),e.undoManager.add()},Ag=function(e,t){var n=ar.fromTag("br");Oi(ar.fromDom(t),n),e.undoManager.add()},Rg=function(e,t){Dg(e.getBody(),t)||Bi(ar.fromDom(t),ar.fromTag("br"));var n=ar.fromTag("br");Bi(ar.fromDom(t),n),Tg(e.dom,e.selection,n.dom()),kg(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},Dg=function(e,t){return n=Su.after(t),!!zo.isBr(n.getNode())||ic.nextPosition(e,Su.after(t)).map(function(e){return zo.isBr(e.getNode())}).getOr(!1);var n},Og=function(e){return e&&"A"===e.nodeName&&"href"in e},Bg=function(e){return e.fold(q(!1),Og,Og,q(!1))},Pg=function(e,t){t.fold(o,d(Ag,e),d(Rg,e),o)},Ig=function(e,t){var n,r,o,i=(n=e,r=d(zl.isInlineTarget,n),o=Su.fromRangeStart(n.selection.getRng()),Pd(r,n.getBody(),o).filter(Bg));i.isSome()?i.each(d(Pg,e)):_g(e,t)},Lg={create:kr("start","soffset","finish","foffset")},Fg=yf([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Mg=(Fg.before,Fg.on,Fg.after,function(e){return e.fold($,$,$)}),zg=yf([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ug={domRange:zg.domRange,relative:zg.relative,exact:zg.exact,exactFromRange:function(e){return zg.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=e.match({domRange:function(e){return ar.fromDom(e.startContainer)},relative:function(e,t){return Mg(e)},exact:function(e,t,n,r){return e}});return zr(t)},range:Lg.create},Vg=or.detect().browser,jg=function(e,t){var n=mr(t)?Ic(t).length:$r(t).length+1;return n<e?n:e<0?0:e},Hg=function(e){return Ug.range(e.start(),jg(e.soffset(),e.start()),e.finish(),jg(e.foffset(),e.finish()))},qg=function(e,t){return!zo.isRestrictedNode(t.dom())&&(Fr(e,t)||Lr(e,t))},$g=function(t){return function(e){return qg(t,e.start())&&qg(t,e.finish())}},Wg=function(e){return!0===e.inline||Vg.isIE()},Kg=function(e){return Ug.range(ar.fromDom(e.startContainer),e.startOffset,ar.fromDom(e.endContainer),e.endOffset)},Xg=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?_.from(t.getRangeAt(0)):_.none()).map(Kg)},Yg=function(e){var t=zr(e);return Xg(t.dom()).filter($g(e))},Gg=function(e,t){return _.from(t).filter($g(e)).map(Hg)},Jg=function(e){var t=j.document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),_.some(t)}catch(n){return _.none()}},Qg=function(e){return(e.bookmark?e.bookmark:_.none()).bind(d(Gg,ar.fromDom(e.getBody()))).bind(Jg)},Zg=function(e){var t=Wg(e)?Yg(ar.fromDom(e.getBody())):_.none();e.bookmark=t.isSome()?t:e.bookmark},ep=function(t){Qg(t).each(function(e){t.selection.setRng(e)})},tp=Qg,np=function(e){return wo(e)||No(e)},rp=function(e){return U(W(e.selection.getSelectedBlocks(),ar.fromDom),function(e){return!np(e)&&!Ur(e).map(np).getOr(!1)})},op=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),z(rp(e),function(e){!function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e.dom())})},ip=Xt.each,ap=Xt.extend,up=Xt.map,sp=Xt.inArray;function cp(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",ip(e,function(t,e){ip(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};ap(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?ep(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(ip(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},m=function(e){t=i.getBookmark(e)},g=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");fe.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),ip("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),g()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:vg(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:vg(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),g())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){ll(s,n)},mceInsertRawHTML:function(e,t,n){i.setContent("tiny_mce_marker");var r=s.getContent();s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){op(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),zo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){lg(s)},forwardDelete:function(){fg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return Ig(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=up(e,function(e){return!!a.matchNode(e,n)});return-1!==sp(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return hg(t=s).fold(function(){return pg(t).map(function(e){return gg.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return gg.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return hg(t=s).fold(function(){return pg(t).map(function(e){return gg.getFontSize(t.getBody(),e)}).getOr("")},function(e){return gg.getFontSize(t.getBody(),e)});var t},this)}var lp=Xt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),fp=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Xt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};fp.isNative=function(e){return!!lp[e.toLowerCase()]};var dp,mp=function(n){return n._eventDispatcher||(n._eventDispatcher=new fp({scope:n,toggleEvent:function(e,t){fp.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},gp={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;if(t=mp(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return mp(this).on(e,t,n)},off:function(e,t){return mp(this).off(e,t)},once:function(e,t){return mp(this).once(e,t)},hasEventListeners:function(e){return mp(this).has(e)}},pp=function(e,t){return e.fire("PreProcess",t)},hp=function(e,t){return e.fire("PostProcess",t)},vp=function(e){return e.fire("remove")},yp=function(e){return e.fire("detach")},bp=function(e,t){return e.fire("SwitchMode",{mode:t})},Cp=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},xp=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},wp=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},Np=function(e,t,n){var r,o;Xi(e,t)&&!1===n?(o=t,Hi(r=e)?r.dom().classList.remove(o):$i(r,o),Ki(r)):n&&Wi(e,t)},Ep=function(e,t){Np(ar.fromDom(e.getBody()),"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",wp(e,"StyleWithCSS",!1),wp(e,"enableInlineTableEditing",!1),wp(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},Sp=function(e){return e.readonly?"readonly":"design"},Tp=Ni.DOM,kp=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=Tp.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},_p=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},Ap=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=kp(i,a),i.settings.event_root){if(dp||(dp={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&dp){for(e in dp)i.dom.unbind(kp(i,e));dp=null}})),dp[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||Tp.isChildOf(t,o))&&_p(n[r],a,e)}},dp[a]=t,Tp.bind(e,a,t)}else t=function(e){_p(i,a,e)},Tp.bind(e,a,t),i.delegates[a]=t},Rp={bindPendingEventDelegates:function(){var t=this;Xt.each(t._pendingNativeEvents,function(e){Ap(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?Ap(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(kp(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(kp(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},Dp=Rp=Xt.extend({},gp,Rp),Op=kr("sections","settings"),Bp=or.detect().deviceType.isTouch(),Pp=["lists","autolink","autosave"],Ip={theme:"mobile"},Lp=function(e){var t=k(e)?e.join(" "):e,n=W(S(t)?t.split(" "):[],Gn);return U(n,function(e){return 0<e.length})},Fp=function(n,e){var r,o,i,t=(r=function(e,t){return F(n,t)},o={},i={},hr(e,function(e,t){(r(e,t)?o:i)[t]=e}),{t:o,f:i});return Op(t.t,t.f)},Mp=function(e,t){return e.sections().hasOwnProperty(t)},zp=function(e,t,n,r){var o,i=Lp(n.forced_plugins),a=Lp(r.plugins),u=e&&Mp(t,"mobile")?U(a,d(F,Pp)):a,s=(o=u,[].concat(Lp(i)).concat(Lp(o)));return Xt.extend(r,{plugins:s.join(" ")})},Up=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=Fp(["mobile"],r),p=Xt.extend(t,n,g.settings(),(f=e,m=(d=g).settings().inline,f&&Mp(d,"mobile")&&!m?(u="mobile",s=Ip,c=g.sections(),l=c.hasOwnProperty(u)?c[u]:{},Xt.extend({},s,l)):{}),{validate:!0,content_editable:g.settings().inline,external_plugins:(o=n,i=g.settings(),a=i.external_plugins?i.external_plugins:{},o&&o.external_plugins?Xt.extend({},o.external_plugins,a):a)});return zp(e,g,n,p)},Vp=function(e,t,n){return _.from(t.settings[n]).filter(e)},jp=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?z(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Xt.trim(t[0])]=Xt.trim(t[1]):a[Xt.trim(t[0])]=Xt.trim(t)}):a=i,a):"string"===r?Vp(S,e,t).getOr(n):"number"===r?Vp(O,e,t).getOr(n):"boolean"===r?Vp(R,e,t).getOr(n):"object"===r?Vp(T,e,t).getOr(n):"array"===r?Vp(k,e,t).getOr(n):"string[]"===r?Vp((o=S,function(e){return k(e)&&J(e,o)}),e,t).getOr(n):"function"===r?Vp(D,e,t).getOr(n):u},Hp=Xt.each,qp=Xt.explode,$p={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},Wp=Xt.makeMap("alt,ctrl,shift,meta,access");function Kp(i){var a={},r=[],u=function(e){var t,n,r={};for(n in Hp(qp(e,"+"),function(e){e in Wp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=$p[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Wp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,fe.mac?r.ctrl=!0:r.shift=!0),r.meta&&(fe.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Xt.map(qp(e,">"),u))[o.length-1]=Xt.extend(o[o.length-1],{func:n,scope:r||i}),Xt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Hp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Xt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Hp(qp(Xt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Xp=function(e){var t=Mr(e).dom();return e.dom()===t.activeElement},Yp=function(t){return(e=Mr(t),n=e!==undefined?e.dom():j.document,_.from(n.activeElement).map(ar.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},Gp=function(t,e){return(n=e,n.collapsed?_.from(Ja(n.startContainer,n.startOffset)).map(ar.fromDom):_.none()).bind(function(e){return So(e)?_.some(e):!1===Fr(t,e)?_.some(t):_.none()});var n},Jp=function(t,e){Gp(ar.fromDom(t.getBody()),e).bind(function(e){return ic.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Qp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Zp=function(e){var t,n=e.getBody();return n&&(t=ar.fromDom(n),Xp(t)||Yp(t).isSome())},eh=function(e){return e.inline?Zp(e):(t=e).iframeElement&&Xp(ar.fromDom(t.iframeElement));var t},th=function(e){return e.editorManager.setActive(e)},nh=function(e,t){e.removed||(t?th(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return Qp(u),Jp(t,o),th(t);t.bookmark!==undefined&&!1===eh(t)&&tp(t).each(function(e){t.selection.setRng(e),o=e}),n||(fe.opera||Qp(r),t.getWin().focus()),(fe.gecko||n)&&(Qp(r),Jp(t,o)),th(t)}(e))},rh=eh,oh=function(e,t){return t.dom()[e]},ih=function(e,t){return parseInt(Sr(t,e),10)},ah=d(oh,"clientWidth"),uh=d(oh,"clientHeight"),sh=d(ih,"margin-top"),ch=d(ih,"margin-left"),lh=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=ar.fromDom(e.getBody()),p=e.inline?g:(r=g,ar.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+ch(i):0),y:u-(o?s.top+i.dom().clientTop+sh(i):0)});return l=h.x,f=h.y,d=ah(c=p),m=uh(c),0<=l&&0<=f&&l<=d&&f<=m},fh=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,_.from(t).map(ar.fromDom)).map(function(e){return Fr(Mr(e),e)}).getOr(!1)};function dh(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){Y(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&fh(n))return X(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){he.requestAnimationFrame(a)}),t.on("remove",function(){z(o.slice(),function(e){i().close(e)})}),{open:r,close:function(){_.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function mh(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){Y(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return _.from(o[o.length-1])};return r.on("remove",function(){z(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),Zg(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var gh={},ph="en",hh={setCode:function(e){e&&(ph=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return ph},rtl:!1,add:function(e,t){var n=gh[e];for(var r in n||(gh[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=gh[ph]||{},n=function(e){return Xt.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Xt.is(e,"undefined")},o=function(e){return e=n(e),Xt.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Xt.is(e,"object")&&Xt.hasOwn(e,"raw"))return n(e.raw);if(Xt.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Xt.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:gh},vh=Di.PluginManager,yh=function(e,t){var n=function(e,t){for(var n in vh.urls)if(vh.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?hh.translate(["Failed to load plugin: {0} from url {1}",n,t]):hh.translate(["Failed to load plugin url: {0}",t])},bh=function(e,t){e.notificationManager.open({type:"error",text:t})},Ch=function(e,t){e._skinLoaded?bh(e,t):e.on("SkinLoaded",function(){bh(e,t)})},xh=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=j.window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},wh={pluginLoadError:function(e,t){Ch(e,yh(e,t))},pluginInitError:function(e,t,n){var r=hh.translate(["Failed to initialize plugin: {0}",t]);xh(r,n),Ch(e,r)},uploadError:function(e,t){Ch(e,hh.translate(["Failed to upload image: {0}",t]))},displayError:Ch,initError:xh},Nh=Di.PluginManager,Eh=Di.ThemeManager;function Sh(){return new(oe.getOrDie("XMLHttpRequest"))}function Th(u,s){var r={},n=function(e,r,o,t){var i,n;(i=Sh()).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new j.FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Xt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Xt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),de.all(Xt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new de(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new de(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return!1===D(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new de(function(e){e([])})}}}var kh=function(e){return oe.getOrDie("atob")(e)},_h=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},Ah=function(a){return new de(function(e){var t,n,r,o,i=_h(a);try{t=kh(i.data)}catch(nE){return void e(new j.Blob([]))}for(o=t.length,n=new(oe.getOrDie("Uint8Array"))(o),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new j.Blob([n],{type:i.type}))})},Rh=function(e){return 0===e.indexOf("blob:")?(i=e,new de(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=Sh();r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?Ah(e):null;var i},Dh=function(n){return new de(function(e){var t=new(oe.getOrDie("FileReader"));t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},Oh=_h,Bh=0,Ph=function(e){return(e||"blobid")+Bh++},Ih=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=Oh(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):Rh(r.src).then(function(e){a=n.create(Ph(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):Rh(r.src).then(function(t){Dh(t).then(function(e){i=Oh(e).data,a=n.create(Ph(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},Lh=function(e){return e?te(e.getElementsByTagName("img")):[]},Fh=0,Mh={uuid:function(e){return e+Fh+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function zh(u){var n,o,t,e,i,r,a,s,c,l=(n=[],o=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||Mh.uuid("blobid"),n=e.name||t,{id:q(t),name:q(n),filename:q(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:q(e.blob),base64:q(e.base64),blobUri:q(e.blobUri||ae.createObjectURL(e.blob)),uri:q(e.uri)}},{create:function(e,t,n,r){if(S(e))return o({id:e,name:r,blob:t,base64:n});if(T(e))return o(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return U(n,e)[0]},removeByUri:function(t){n=U(n,function(e){return e.blobUri()!==t||(ae.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){z(n,function(e){ae.revokeObjectURL(e.blobUri())}),n=[]}}),f=(a={},s=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:c=function(e){return e in a},getResultUri:function(e){var t=a[e];return t?t.resultUri:null},isPending:function(e){return!!c(e)&&1===a[e].status},isUploaded:function(e){return!!c(e)&&2===a[e].status},markPending:function(e){a[e]=s(1,null)},markUploaded:function(e,t){a[e]=s(2,t)},removeFailed:function(e){delete a[e]},destroy:function(){a={}}}),d=[],m=function(t){return function(e){return u.selection?t(e):[]}},g=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},p=function(e,t,n){return e=g(e,'src="'+t+'"','src="'+n+'"'),e=g(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},h=function(t,n){z(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=W(e.fragments,function(e){return p(e,t,n)}):e.content=p(e.content,t,n)})},v=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},y=function(e,t){l.removeByUri(e.src),h(e.src,t),u.$(e).attr({src:Rl(u)?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},b=function(n){return i||(i=Th(f,{url:Ol(u),basePath:Bl(u),credentials:Pl(u),handler:Il(u)})),w().then(m(function(r){var e;return e=W(r,function(e){return e.blobInfo}),i.upload(e,v).then(m(function(e){var t=W(e,function(e,t){var n=r[t].image;return e.status&&Dl(u)?y(n,e.url):e.error&&wh.uploadError(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},C=function(e){if(Al(u))return b(e)},x=function(t){return!1!==J(d,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||_l(u)(t))},w=function(){var o,i,a;return r||(o=f,i=l,a={},r={findAll:function(e,n){var t;n||(n=q(!0)),t=U(Lh(e),function(e){var t=e.src;return!!fe.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===fe.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=W(t,function(n){if(a[n.src])return new de(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new de(function(e,t){Ih(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return de.all(r)}}),r.findAll(u.getBody(),x).then(m(function(e){return e=U(e,function(e){return"string"!=typeof e||(wh.displayError(u,e),!1)}),z(e,function(e){h(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},N=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=f.getResultUri(n);if(t)return'src="'+t+'"';var r=l.getByUri(n);return r||(r=V(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){Al(u)?C():w()}),u.on("RawSaveContent",function(e){e.content=N(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=N(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){z(e,function(e){var t=e.attr("src");if(!l.getByUri(t)){var n=f.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:l,addFilter:function(e){d.push(e)},uploadImages:b,uploadImagesAuto:C,scanForImages:w,destroy:function(){l.destroy(),f.destroy(),r=i=null}}}var Uh=function(e,t){return e.hasOwnProperty(t.nodeName)},Vh=function(e,t){if(zo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Uh(e,t.nextSibling)))return!0}return!1},jh=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,g=e.selection,p=e.schema,h=p.getBlockElements(),v=g.getStart(),y=e.getBody();if(f=d.forced_root_block,v&&zo.isElement(v)&&f&&(l=y.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&(b=h,C=y,x=v,!M(nf(ar.fromDom(x),ar.fromDom(C)),function(e){return Uh(b,e.dom())})))){var b,C,x,w,N;for(n=(t=g.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=rh(e),v=y.firstChild;v;)if(w=h,N=v,zo.isText(N)||zo.isElement(N)&&!Uh(w,N)&&!pc(N)){if(Vh(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),g.setRng(t),e.nodeChanged())}},Hh=function(e){e.settings.forced_root_block&&e.on("NodeChange",d(jh,e))},qh=function(t){return Kr(t).fold(q([t]),function(e){return[t].concat(qh(e))})},$h=function(t){return Xr(t).fold(q([t]),function(e){return"br"===lr(e)?Vr(e).map(function(e){return[t].concat($h(e))}).getOr([]):[t].concat($h(e))})},Wh=function(o,e){return eu((i=e,a=i.startContainer,u=i.startOffset,zo.isText(a)?0===u?_.some(ar.fromDom(a)):_.none():_.from(a.childNodes[u]).map(ar.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,zo.isText(n)?r===n.data.length?_.some(ar.fromDom(n)):_.none():_.from(n.childNodes[r-1]).map(ar.fromDom)),function(e,t){var n=X(qh(o),d(Lr,e)),r=X($h(o),d(Lr,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},Kh=function(e,t,n,r){var o=n,i=new fo(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Xt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(fe.ie&&fe.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},Xh=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Yh(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&yg(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!fe.range&&i.selection.isCollapsed()||Xh(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&Xh(i)&&("IMG"===i.selection.getNode().nodeName?he.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Gh,Jh,Qh=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Zh=function(e,t){return n=(u=e).inline?Qh(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Qh(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},ev=zo.isContentEditableFalse,tv=zo.isContentEditableTrue,nv=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},rv=function(u,s){return function(e){if(0===e.button){var t=X(s.dom.getParents(e.target),ru(ev,tv)).getOr(null);if(i=s.getBody(),ev(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},ov=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!ev(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){nv(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;iv(l)}},iv=function(e){e.dragging=!1,e.element=null,nv(e.ghost)},av=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=Ni.DOM,a=j.document,n=rv(c,e),p=c,h=e,v=he.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).isDefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=Zh(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=ov(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),iv(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},uv=function(e){var n;av(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(ev(t)||ev(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},sv=function(e){return V(e,function(e,t){return e.concat(function(t){var e=function(e){return W(e,function(e){return(e=qa(e)).node=t,e})};if(zo.isElement(t))return e(t.getClientRects());if(zo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Jh=Gh||(Gh={}))[Jh.Up=-1]="Up",Jh[Jh.Down=1]="Down";var cv=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=sv([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,Ht.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=Ht.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=xs(r,e,ja,t);)if(n(r))return}(o,e,r,n)),l},lv=d(cv,Gh.Up,Ka,Xa),fv=d(cv,Gh.Down,Xa,Ka),dv=function(n){return function(e){return t=n,e.line>t;var t}},mv=function(n){return function(e){return t=n,e.line===t;var t}},gv=zo.isContentEditableFalse,pv=xs,hv=function(e,t){return Math.abs(e.left-t)},vv=function(e,t){return Math.abs(e.right-t)},yv=function(e,t){return e>=t.left&&e<=t.right},bv=function(e,o){return Ht.reduce(e,function(e,t){var n,r;return n=Math.min(hv(e,o),vv(e,o)),r=Math.min(hv(t,o),vv(t,o)),yv(o,t)?t:yv(o,e)?e:r===n&&gv(t.node)?t:r<n?t:e})},Cv=function(e,t,n,r){for(;r=pv(r,e,ja,t);)if(n(r))return},xv=function(e,t,n){var r,o,i,a,u,s,c,l=sv(U(te(e.getElementsByTagName("*")),fs)),f=U(l,function(e){return n>=e.top&&n<=e.bottom});return(r=bv(f,t))&&(r=bv((a=e,c=function(t,e){var n;return n=U(sv([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),Cv(Gh.Up,a,d(c,Ka),u.node),Cv(Gh.Down,a,d(c,Xa),u.node),s),t))&&fs(r.node)?(i=t,{node:(o=r).node,before:hv(o,i)<vv(o,i)}):null},wv=function(t,n,e){if(e.collapsed)return!1;if(fe.ie&&fe.ie<=11&&e.startOffset===e.endOffset-1&&e.startContainer===e.endContainer){var r=e.startContainer.childNodes[e.startOffset];if(zo.isElement(r))return M(r.getClientRects(),function(e){return Ya(e,t,n)})}return M(e.getClientRects(),function(e){return Ya(e,t,n)})},Nv=function(t){var e=Ui(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ag(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Ev={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return fe.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Sv=zo.isContentEditableTrue,Tv=zo.isContentEditableFalse,kv=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Sv(t)||Tv(t))return t;t=t.parentNode}return null},_v=function(g){var p,e,t,a=g.getBody(),o=cs(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return rh(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=As(e,a,t),-1===e?Su.fromRangeStart(t):Su.fromRangeEnd(t)},n=function(e){return Ea(e)||Aa(e)||Ra(e)},b=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),fs(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(fs(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),fs(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(fs(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Tv(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),Tv(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=na(ar.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&fe.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),z(Gi(ar.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){Nr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),na(ar.fromDom(g.getBody()),"#"+h).each(Mi),p=null),na(ar.fromDom(g.getBody()),"#"+h).each(Mi),p=null},C=function(){o.hide()};return fe.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&lh(g,e.clientX,e.clientY)&&u(ig(g,t,!1))}),g.on("click",function(e){var t;(t=kv(g,e.target))&&(Tv(t)&&(e.preventDefault(),g.focus()),Sv(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Tv(kv(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Xs(e);if(!e.firstChild)return!1;var n=Su.before(e.firstChild),r=t.next(n);return r&&!Bf(r)&&!Pf(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=kv(n,e.target);Tv(t)&&(r||(e.preventDefault(),c(og(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==lh(g,e.clientX,e.clientY))if(t=kv(g,n))Tv(t)?(e.preventDefault(),c(og(g,t))):(l(),Sv(t)&&e.shiftKey||wv(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===fs(n)){l(),C();var r=xv(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Ev.modifierPressed(e)||(e.keyCode,Tv(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!fe.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),uv(g),Nv(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Da(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Av=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},Rv=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function Dv(z,U){void 0===U&&(U=li());var e=function(){};!1!==(z=z||{}).fix_self_closing&&(z.fix_self_closing=!0);var V=z.comment?z.comment:e,j=z.cdata?z.cdata:e,H=z.text?z.text:e,q=z.start?z.start:e,$=z.end?z.end:e,W=z.pi?z.pi:e,K=z.doctype?z.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,y,b,C,x,w,N,E,S,T,k,_,A,R=0,D=[],O=0,B=Zo.decode,P=Xt.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&$(e.name);D.length=t}},F=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:B(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=y[t])&&b){for(a=b.length;a--&&!(i=b[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!z.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(I.test(l))return;if(c=l,!(s=z).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),T=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=z.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=z.validate,u=z.remove_internals,A=z.fix_self_closing,k=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(R<t.index&&H(B(e.substr(R,t.index-R))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),L(n);else if(n=t[7]){if(t.index+t[0].length>e.length){H(B(e.substr(t.index))),R=t.index+t[0].length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,A&&E[n]&&0<D.length&&D[D.length-1].name===n&&L(n);var M=Rv(T,t[8]);if(null!==M){if("all"===M){R=Av(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}if(!p||(l=U.getElementRule(n))){if(f=!0,p&&(y=l.attributes,b=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(T,F)):(d=[]).map={},p&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(_=h.value)&&(_="mce_"+O++),d.map[a]=_,d.push({name:a,value:_});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(_=h.value)&&(_="mce_"+O++),d.map[a]=_,d.push({name:a,value:_}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){R=Av(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}}f&&q(n,d,c)}else f=!1;if(r=k[n]){r.lastIndex=R=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(R,t.index-R)),R=t.index+t[0].length):(i=e.substr(R),R=e.length),f&&(0<i.length&&H(i,!0),$(n)),S.lastIndex=R;continue}c||(v&&v.indexOf("/")===v.length-1?f&&$(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),z.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),V(n)):(n=t[2])?j(n.replace(/<!--|-->/g,"")):(n=t[3])?K(n):(n=t[4])&&W(n,t[5]);R=t.index+t[0].length}for(R<e.length&&H(B(e.substr(R))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&$(n.name)}}}(Dv||(Dv={})).findEndTag=Av;var Ov=Dv,Bv=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:Ov.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return ba(l)},Pv={trimExternal:Bv,trimInternal:Bv},Iv=0,Lv=2,Fv=1,Mv=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},y=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return y(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return y(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},zv=function(e){return zo.isElement(e)?e.outerHTML:zo.isText(e)?Zo.encodeRaw(e.data,!1):zo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Uv=function(e,t,n){var r=function(e){var t,n,r;for(r=j.document.createElement("div"),t=j.document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Vv=function(e){return U(W(te(e.childNodes),zv),function(e){return 0<e.length})},jv=function(e,t){var n,r,o,i=W(te(t.childNodes),zv);return n=Mv(i,e),r=t,o=0,z(n,function(e){e[0]===Iv?o++:e[0]===Fv?(Uv(r,e[1],o),o++):e[0]===Lv&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Hv=Vi(_.none()),qv=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},$v=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Wv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Kv=function(e){var t=ar.fromTag("body",Hv.get().getOrThunk(function(){var e=j.document.implementation.createHTMLDocument("undo");return Hv.set(_.some(e)),e}));return pa(t,Wv(e)),z(Gi(t,"*[data-mce-bogus]"),zi),t.dom().innerHTML},Xv=function(n){var e,t,r;return e=Vv(n.getBody()),-1!==(t=(r=G(e,function(e){var t=Pv.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?qv(r):$v(t)},Yv=function(e,t,n){"fragmented"===t.type?jv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Gv=function(e,t){return!(!e||!t)&&(r=t,Wv(e)===Wv(r)||(n=t,Kv(e)===Kv(n)));var n,r};function Jv(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===Gv(Xv(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=Wu.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=Xv(u),e=e||{},e=Xt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&Gv(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=Wu.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],Yv(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],Yv(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!Gv(Xv(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],Yv(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var Qv,Zv,ey={},ty=Ht.filter,ny=Ht.each;Zv=function(e){var t,n,r=e.selection.getRng();t=zo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),ny(ty(ty(n,t),function(e){return t(e.previousSibling)&&-1!==Ht.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,gn(n=e).remove(),gn(t).append("<br><br>").append(n.childNodes)}))},ey[Qv="pre"]||(ey[Qv]=[]),ey[Qv].push(Zv);var ry=function(e,t){ny(ey[e],function(e){e(t)})},oy=/^(src|href|style)$/,iy=Xt.each,ay=bc.isEq,uy=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},sy=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],zo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),zo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new fo(r,e.getBody()).next()||r),zo.isText(r)&&!n&&0===o&&(r=new fo(r,e.getBody()).prev()||r),r},cy=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},ly=function(e,t,n,r,o){var i=ar.fromDom(t),a=ar.fromDom(e.create(r,o)),u=n?qr(i):Hr(i);return Li(a,u),n?(Oi(i,a),Pi(a,i)):(Bi(i,a),Ii(a,i)),a.dom()},fy=function(e,t,n,r){return!(t=bc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},dy=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,y,b=e.dom;if(c=b,!(ay(l=o,(f=n).inline)||ay(l,f.block)||(f.selector?zo.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(iy(n.styles,function(e,t){e=bc.normalizeStyleValue(b,bc.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||ay(bc.getStyle(b,i,t),e))&&b.setStyle(o,t,""),u=1}),u&&""===b.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),iy(n.attributes,function(e,t){var n;if(e=bc.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||ay(b.getAttrib(i,t),e)){if("class"===t&&(e=b.getAttrib(o,t))&&(n="",iy(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void b.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),oy.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),iy(n.classes,function(e){e=bc.replaceVars(e,r),i&&!b.hasClass(i,e)||b.removeClass(o,e)}),a=b.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,y=d.settings.forced_root_block,g.block&&(y?h===v.getRoot()&&(g.list_block&&ay(m,g.list_block)||iy(Xt.grep(m.childNodes),function(e){bc.isValid(d,y,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=cy(v,e,y),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(fy(v,m,!1)||fy(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),fy(v,m,!0)||fy(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!ay(g.inline,m)||v.remove(m,1),!0):void 0},my=dy,gy=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,iy(bc.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=Lm.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(dy(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(zo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Xt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!dy(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)g(t[n]);i&&(a=o)}},p=function(e){var t,n=u.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return pc(t=r)&&zo.isElement(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),zo.isText(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),u.remove(n,!0),r},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Dc(s,e,d,!0),m.split){if(e=Mm(e),(t=sy(s,e,!0))!==(n=sy(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),uy(u,t,n)){var o=_.from(t.firstChild).getOr(t);return i(ly(u,o,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void p(!0)}if(uy(u,n,t))return o=_.from(n.lastChild).getOr(n),i(ly(u,o,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void p(!1);t=cy(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=cy(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=p(!0),n=p()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Bc(u,e,function(e){iy(e,function(e){g(e),zo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===bc.getTextDecoration(u,e.parentNode)&&dy(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.startContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Lm.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Dc(e,g,e.formatter.get(t),!0);p=Mm(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=Yu(e.getBody(),c);var h=Hm(!1).dom(),v=Xm(m,h);Wm(e,h,l||c),qm(e,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=Wu.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),m.inline&&Lm.match(s,c,l,r.getStart())&&bc.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!dy(s,d[h],l,e,e));h++);}},py=Xt.each,hy=function(e){return e&&1===e.nodeType&&!pc(e)&&!Xu(e)&&!zo.isBogus(e)},vy=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!pc(n))return n}return e},yy=function(e,t,n){var r,o,i=new Jc(e);if(t&&n&&(t=vy(t,"previousSibling"),n=vy(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Xt.each(Xt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},by=function(e,t,n){py(e.childNodes,function(e){hy(e)&&(t(e)&&n(e),e.hasChildNodes()&&by(e,t,n))})},Cy=function(n,e){return d(function(e,t){return!(!t||!bc.getStyle(n,t,e))},e)},xy=function(r,e,t){return d(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),wy(r,n)},e,t)},wy=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},Ny=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=bc.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},Ey=function(n,e,r,o){py(e,function(t){py(n.dom.select(t.inline,o),function(e){hy(e)&&my(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";py(r.select(n,t),function(n){hy(n)&&py(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},Sy=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Xt.walk(r,d(Ny,e),"childNodes"),Ny(e,r))},Ty=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&by(r,Cy(e,"fontSize"),xy(e,"backgroundColor",bc.replaceVars(t.styles.backgroundColor,n)))},ky=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(by(r,Cy(e,"fontSize"),xy(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},_y=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=yy(e,bc.getNonWhiteSpaceSibling(r),r),r=yy(e,r,bc.getNonWhiteSpaceSibling(r,!0)))},Ay=function(t,n,r,o,i){Lm.matchNode(t,i.parentNode,r,o)&&my(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(Lm.matchNode(t,e,r,o))return my(t,n,o,i),!0})},Ry=Xt.each,Dy=function(g,p,h,r){var e,t,v=g.formatter.get(p),y=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,b=function(n,e){if(e=e||y,n){if(e.onformat&&e.onformat(n,e,h,r),Ry(e.styles,function(e,t){i.setStyle(n,t,bc.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}Ry(e.attributes,function(e,t){i.setAttrib(n,t,bc.replaceVars(e,h))}),Ry(e.classes,function(e){e=bc.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!y.selector&&(Ry(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Xu(t)?(b(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=y.inline||y.block,f=s.create(l),b(f),Bc(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),bc.isEq(t,"br"))return a=0,void(y.block&&s.remove(e));if(y.wrapper&&Lm.matchNode(g,e,p,h))a=0;else{if(m&&!r&&y.block&&!y.wrapper&&bc.isTextBlock(g,t)&&bc.isValid(g,n,l))return e=s.rename(e,l),b(e),d.push(e),void(a=0);if(y.selector){var i=C(v,e);if(!y.inline||i)return void(a=0)}!m||r||!bc.isValid(g,l,t)||!bc.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Xu(e)||y.inline&&s.isBlock(e)?(a=0,Ry(Xt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};Ry(e,u)}),!0===y.links&&Ry(d,function(e){var t=function(e){"A"===e.nodeName&&b(e,y),Ry(Xt.grep(e.childNodes),t)};t(e)}),Ry(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return Ry(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!pc(t)&&!Xu(t)&&!zo.isBogus(t))return n=e,!1;var t}),n};n=0,Ry(e.childNodes,function(e){bc.isWhiteSpaceNode(e)||pc(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(y.inline||y.wrapper)&&(y.exact||1!==t||((o=a(r=e))&&!pc(o)&&Lm.matchName(s,o,y)&&(i=s.clone(o,!1),b(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),Ey(g,v,h,e),Ay(g,y,p,h,e),Ty(s,y,h,e),ky(s,y,h,e),_y(s,y,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(y){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Dc(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&y.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Yu(e.getBody(),c.getStart()))&&(i=jm(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Dc(e,r,e.formatter.get(t)),r=Mm(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===zm||(l=e.getDoc(),f=Hm(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||Dy(g,v[0].defaultBlock),g.selection.setRng(al(g.selection.getRng())),e=Wu.getPersistentBookmark(g.selection,!0),a(i,Dc(g,n.getRng(),v)),y.styles&&Sy(i,y,h,u),n.moveToBookmark(e),bc.moveStart(i,n,n.getRng()),g.nodeChanged()}ry(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void b(r,v[s])}},Oy={applyFormat:Dy},By=Xt.each,Py=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=bc.getParents(a.dom,n.element),o={};r=Xt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),By(i.get(),function(e,n){By(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(By(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!Lm.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),By(u,function(e,t){o[t]||(delete u[t],By(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),By(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},Iy={get:function(r){var t={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",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",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",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"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],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},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(n,e,t){Xt.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 Xt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},Ly=Xt.each,Fy=Ni.DOM,My=function(e,t){var n,o,r,m=t&&t.schema||li({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Fy.create(o.name),n=t,(r=o).classes.length&&Fy.addClass(n,r.classes.join(" ")),Fy.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==Xt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=Fy.create("div")).appendChild(n),Xt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=Fy.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},zy=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Xt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Xt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Uy=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Xt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Xt.map(e.split(/(?:~\+|~|\+)/),zy),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},Vy=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=Uy(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=My(i,n)):r=My([t],n),o=Fy.select(t,r)[0]||r.firstChild,Ly(e.styles,function(e,t){(e=c(e))&&Fy.setStyle(o,t,e)}),Ly(e.attributes,function(e,t){(e=c(e))&&Fy.setAttrib(o,t,e)}),Ly(e.classes,function(e){e=c(e),Fy.hasClass(o,e)||Fy.addClass(o,e)}),n.fire("PreviewFormats"),Fy.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=Fy.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Ly(u.split(" "),function(e){var t=Fy.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Fy.getStyle(n.getBody(),e,!0),"#ffffff"===Fy.toHex(t).toLowerCase())||"color"===e&&"#000000"===Fy.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Fy.remove(r),s)},jy=function(e,t,n,r,o){var i=t.get(n);!Lm.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Oy.applyFormat(e,n,r,o):gy(e,n,r,o)},Hy=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function qy(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Xt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Xt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(Iy.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Vi(null);return Hy(e),Ym(e),{get:o.get,register:o.register,unregister:o.unregister,apply:d(Oy.applyFormat,e),remove:d(gy,e),toggle:d(jy,e,o),match:d(Lm.match,e),matchAll:d(Lm.matchAll,e),matchNode:d(Lm.matchNode,e),canApply:d(Lm.canApply,e),formatChanged:d(Py,e,i),getCssText:d(Vy,e)}}var $y,Wy=Object.prototype.hasOwnProperty,Ky=($y=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Wy.call(o,i)&&(n[i]=$y(n[i],o[i]))}return n}),Xy={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||(_.from(r.firstChild).exists(function(e){return!va(e.value)})?r.unwrap():r.remove())}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Zo.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.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,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.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",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},Yy={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=j.document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Xt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),pp(r,Ky(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Gy=function(e,a,u){e.addNodeFilter("font",function(e){z(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,z(["color","face","size"],function(e){t.attr(e,null)})})})},Jy=function(e,t){var n,r=di();t.convert_fonts_to_spans&&Gy(e,r,Xt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){z(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Qy={register:function(e,t){t.inline_styles&&Jy(e,t)}},Zy=/^[ \t\r\n]*$/,eb={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},tb=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},nb=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,eb[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=tb(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=tb(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Zy.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Zy.test(i.value))return!1;if(n&&n(i))return!1}while(i=tb(i,this));return!0},a.prototype.walk=function(e){return tb(this,null,e)},a}(),rb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new nb("br",1)).shortEnded=!0:r.empty().append(new nb("#text",3)).value="\xa0"},ob=function(e){return ib(e,"#text")&&"\xa0"===e.firstChild.value},ib=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},ab=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},ub=function(e,t){return e&&(t[e.name]||"br"===e.name)},sb=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Xt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),ab(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&rb(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new nb("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Xt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new nb("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},cb=Xt.makeMap,lb=Xt.each,fb=Xt.explode,db=Xt.extend;function mb(T,k){void 0===k&&(k=li());var _={},A=[],R={},D={};(T=T||{}).validate=!("validate"in T)||T.validate,T.root_name=T.root_name||"body";var O=function(e){var t,n,r;(n=e.name)in _&&((r=R[n])?r.push(e):R[n]=[e]),t=A.length;for(;t--;)(n=A[t].name)in e.attributes.map&&((r=D[n])?r.push(e):D[n]=[e]);return e},e={schema:k,addAttributeFilter:function(e,n){lb(fb(e),function(e){var t;for(t=0;t<A.length;t++)if(A[t].name===e)return void A[t].callbacks.push(n);A.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(A)},addNodeFilter:function(e,n){lb(fb(e),function(e){var t=_[e];t||(_[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in _)_.hasOwnProperty(t)&&e.push({name:t,callbacks:_[t]});return e},filterNode:O,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},R={},D={},l=db(cb("script,style,head,html,body,title,meta,param"),k.getBlockElements());var g=k.getNonEmptyElements(),p=k.children,h=T.validate,v="forced_root_block"in a?a.forced_root_block:T.forced_root_block,y=k.getWhiteSpaceElements(),b=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=y.hasOwnProperty(a.context)||y.hasOwnProperty(T.root_name);var N=function(e,t){var n,r=new nb(e,t);return e in _&&((n=R[e])?n.push(r):R[e]=[r]),r},E=function(e){var t,n,r,o,i=k.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=Ov({validate:h,allow_script_urls:T.allow_script_urls,allow_conditional_comments:T.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(k.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),ub(d.lastChild,l)&&(e=e.replace(b,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?k.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&!u[r.name]&&m.push(r),o=A.length;o--;)(a=A[o].name)in t.map&&((s=D[a])?s.push(r):D[a]=[r]);l[e]&&E(r),n||(d=r),!f&&y[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?k.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(b,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&y[e]&&(f=!1),n.removeEmpty&&ab(k,g,y,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(ob(d)||ab(k,g,y,d))&&rb(T,a,l,d),d=d.parent}}},k);var S=d=new nb(a.context||T.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=cb("tr,td,th,tbody,thead,tfoot,table"),l=k.getNonEmptyElements(),f=k.getWhiteSpaceElements(),m=k.getTextBlockElements(),g=k.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!k.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=O(o[0].clone()),c=0;c<o.length-1;c++){for(k.isValidChild(a.name,o[c].name)?(u=O(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}ab(k,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(ab(k,l,f,r)||ib(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChild,!0);continue}n.wrap(O(new nb("ul",1)));continue}k.isValidChild(n.parent.name,"div")&&k.isValidChild("div",n.name)?n.wrap(O(new nb("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(b,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(k.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=N(v,1)).attr(T.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in R){for(s=_[c],i=(n=R[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=A.length;r<o;r++)if((s=A[r]).name in D){for(i=(n=D[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return sb(e,T),Qy.register(e,T),e}var gb=function(e,t,n){-1===Xt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},pb=function(e,t,n){var r=ba(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||ko(ar.fromDom(t))?r:Xt.trim(r)},hb=function(e,t,n){var r=n.selection?Ky({forced_root_block:!1},n):n,o=e.parse(t,r);return Xy.trimTrailingBr(o),o},vb=function(e,t,n,r,o){var i,a,u,s,c=(i=r,rl(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?hp(a,Ky(u,{content:s})).content:s};function yb(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:Ni.DOM,c=u&&u.schema?u.schema:li(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=mb(a,c),Xy.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=Ky({format:"html"},t||{}),r=Yy.process(u,e,n),o=pb(s,r,n),i=hb(l,o,n);return"tree"===n.format?i:vb(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:d(gb,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function bb(e){return{getBookmark:d(mc,e),moveToBookmark:d(gc,e)}}(bb||(bb={})).isBookmarkNode=pc;var Cb,xb,wb=bb,Nb=zo.isContentEditableFalse,Eb=zo.isContentEditableTrue,Sb=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,y,i,b,C,x,w,N=a.dom,E=Xt.each,S=a.getDoc(),T=j.document,k=Math.abs,_=Math.round,A=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-content-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(fe.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var R=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!R(t.target)||wv(t.clientX,t.clientY,n)||e.isDefaultPrevented()||a.selection.select(r)},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},O=function(e){var t=a.settings.object_resizing;return!1!==t&&!fe.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Pr(ar.fromDom(e),t))},B=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,b=t*f[2]+h,C=n*f[3]+v,b=b<5?5:b,C=C<5?5:C,(R(u)&&!1!==a.settings.resize_img_proportional?!Ev.modifierPressed(e):Ev.modifierPressed(e)||R(u)&&f[2]*f[3]!=0)&&(k(t)>k(n)?(C=_(b*y),b=_(C/y)):(b=_(C/y),C=_(b*y))),N.setStyles(D(s),{width:b,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=b+" × "+C,f[2]<0&&s.clientWidth<=b&&N.setStyle(s,"left",g+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=A.scrollWidth-x)+(n=A.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Cp(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",B),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",B),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),xp(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;I(),M(),t=N.getPos(e,A),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,b=C=0),n=a.fire("ObjectSelected",{target:e}),O(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===fe.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=A.scrollWidth,w=A.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),A.appendChild(s),N.bind(S,"mousemove",B),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",B),N.bind(T,"mouseup",P)),c=N.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):I(),u.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in M(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},L=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):I())},F=function(e){return Nb(function(e,t){for(;t&&t!==e;){if(Eb(t)||Nb(t))return t;t=t.parentNode}return null}(a.getBody(),e))},M=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),fe.ie&&11<=fe.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(A,"mscontrolselect",function(e){var t=function(e){he.setEditorTimeout(a,function(){a.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=he.throttle(function(e){a.composing||L(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",I),a.on("contextmenu",n)}),a.on("remove",M),{isResizable:O,showResizeRect:o,hideResizeRect:I,updateResizeRect:L,destroy:function(){u=s=null}}},Tb=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},kb=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&zo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=Tb(t).y-Tb(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},_b=function(d,e){Z(wu.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},Ab=function(e){return zo.isContentEditableTrue(e)||zo.isContentEditableFalse(e)},Rb=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Xt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,zo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Ab))?null:i}return r},Db=function(n,e){return W(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Ob=function(e,t){var n=(t||j.document).createDocumentFragment();return z(e,function(e){n.appendChild(e.dom())}),ar.fromDom(n)},Bb=kr("element","width","rows"),Pb=kr("element","cells"),Ib=kr("x","y"),Lb=function(e,t){var n=parseInt(wr(e,t),10);return isNaN(n)?1:n},Fb=function(e){return V(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},Mb=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Lr(o[i],t))return _.some(Ib(i,r));return _.none()},zb=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(Pb(a[u].element(),c))}return i},Ub=function(e){var o=Bb(ma(e),0,[]);return z(Gi(e,"tr"),function(n,r){z(Gi(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=Lb(o,"rowspan"),a=Lb(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=Pb(ga(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:ma(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),Bb(o.element(),Fb(o.rows()),o.rows())},Vb=function(e){return n=W((t=e).rows(),function(e){var t=W(e.cells(),function(e){var t=ga(e);return Nr(t,"colspan"),Nr(t,"rowspan"),t}),n=ma(e.element());return Li(n,t),n}),r=ma(t.element()),o=ar.fromTag("tbody"),Li(o,n),Ii(r,o),r;var t,n,r,o},jb=function(l,e,t){return Mb(l,e).bind(function(c){return Mb(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?zb(t,o,i,a,u):zb(t,o,u,a,i),Bb(t.element(),Fb(s),s);var t,n,r,o,i,a,u,s})})},Hb=function(n,t){return X(n,function(e){return"li"===lr(e)&&Wh(e,t)}).fold(q([]),function(e){return(t=n,X(t,function(e){return"ul"===lr(e)||"ol"===lr(e)})).map(function(e){return[ar.fromTag("li"),ar.fromTag(lr(e))]}).getOr([]);var t})},qb=function(e,t){var n,r=ar.fromDom(t.commonAncestorContainer),o=rf(r,e),i=U(o,function(e){return bo(e)||vo(e)}),a=Hb(o,t),u=i.concat(a.length?a:No(n=r)?Ur(n).filter(wo).fold(q([]),function(e){return[n,e]}):wo(n)?[n]:[]);return W(u,ma)},$b=function(){return Ob([])},Wb=function(e,t){return n=ar.fromDom(t.cloneContents()),r=qb(e,t),o=V(r,function(e,t){return Ii(t,e),t},n),0<r.length?Ob([o]):o;var n,r,o},Kb=function(e,o){return(t=e,n=o[0],ta(n,"table",d(Lr,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=Ub(e);return jb(r,t,n).map(function(e){return Ob([Vb(e)])})}).getOrThunk($b);var t,n},Xb=function(e,t){var n,r,o=ym(t,e);return 0<o.length?Kb(e,o):(n=e,0<(r=t).length&&r[0].collapsed?$b():Wb(n,r[0]))},Yb=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return c=e,_.from(c.selection.getRng()).map(function(e){var t=c.dom.add(c.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),n=ba(t.innerText);return c.dom.remove(t),n}).getOr("");t.getInner=!0;var n,r,o,i,a,u,s,c,l=(r=t,i=(n=e).selection.getRng(),a=n.dom.create("body"),u=n.selection.getSel(),s=Db(n,dm(u)),(o=r.contextual?Xb(ar.fromDom(n.getBody()),s).dom():i.cloneContents())&&a.appendChild(o),n.selection.serializer.serialize(a,r));return"tree"===t.format?l:(t.content=e.selection.isCollapsed()?"":l,e.fire("GetContent",t),t.content)},Gb=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Jb=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return _.from(i).map(ar.fromDom).map(function(e){return r&&t.collapsed?e:Wr(e,o(e,a)).getOr(e)}).bind(function(e){return dr(e)?_.some(e):Ur(e)}).map(function(e){return e.dom()}).getOr(e)},Qb=function(e,t,n){return Jb(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},Zb=function(e,t,n){return Jb(e,t,!1,n,function(e,t){return 0<t?t-1:t})},eC=function(e,t){for(var n=e;e&&zo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},tC=Xt.each,nC=function(e){return!!e.select},rC=function(e){return!(!e||!e.ownerDocument)&&Fr(ar.fromDom(e.ownerDocument),ar.fromDom(e))},oC=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return Gb(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===rh(c)){var i=tp(c);if(i.isSome())return i.map(function(e){return Db(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&!zo.isRestrictedNode(e.anchorNode)&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=Db(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(nC(o)||rC(o.startContainer)&&rC(o.endContainer))){var o,i=nC(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||fe.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(Kh(u,n,c.getBody(),!0),i(n))},getContent:function(e){return Yb(c,e)},setContent:r,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,_.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Kh(r,n,e,!0),Kh(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?eC(r.nextSibling,!0):r.parentNode,o=0===a?eC(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return Qb(c.getBody(),m(),e)},getEnd:function(e){return Zb(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Qb(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Zb(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new fo(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!gm(t)&&Xh(c)){var n=Sg(u,e);return n.each(function(e){i(e,g())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};tC(a,function(e,n){tC(r,function(t){if(u.is(t,n))return i[n]||(tC(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),tC(i,function(e,t){o[t]||(delete i[t],tC(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),p},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return kb(c,e,t)},placeCaretAt:function(e,t){return i(Rb(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?Su.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=wb(p),t=Sb(p,c),p.bookmarkManager=n,p.controlSelection=t,p};(xb=Cb||(Cb={}))[xb.Br=0]="Br",xb[xb.Block=1]="Block",xb[xb.Wrap=2]="Wrap",xb[xb.Eol=3]="Eol";var iC=function(e,t){return e===Nu.Backwards?t.reverse():t},aC=function(e,t,n,r){for(var o,i,a,u,s,c,l=Xs(n),f=r,d=[];f&&(s=l,c=f,o=t===Nu.Forwards?s.next(c):s.prev(c));){if(zo.isBr(o.getNode(!1)))return t===Nu.Forwards?{positions:iC(t,d).concat([o]),breakType:Cb.Br,breakAt:_.some(o)}:{positions:iC(t,d),breakType:Cb.Br,breakAt:_.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,zo.isBr(u.getNode(i===Nu.Forwards))?Cb.Br:!1===Ns(a,u)?Cb.Block:Cb.Wrap);return{positions:iC(t,d),breakType:m,breakAt:_.some(o)}}d.push(o),f=o}else f=o}return{positions:iC(t,d),breakType:Cb.Eol,breakAt:_.none()}},uC=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Nu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},sC=function(e,i){return V(e,function(e,o){return e.fold(function(){return _.some(o)},function(r){return eu(Z(r.getClientRects()),Z(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},_.none())},cC=function(t,e){return Z(e.getClientRects()).bind(function(e){return sC(t,e.left)})},lC=d(aC,wu.isAbove,-1),fC=d(aC,wu.isBelow,1),dC=d(uC,-1,lC),mC=d(uC,1,fC),gC=zo.isContentEditableFalse,pC=Ga,hC=function(e,t,n,r){var o=e===Nu.Forwards,i=o?Bf:Pf;if(!r.collapsed){var a=pC(r);if(gC(a))return rg(e,t,a,e===Nu.Backwards,!0)}var u=wa(r.startContainer),s=Ds(e,t.getBody(),r);if(i(s))return og(t,s.getNode(!o));var c=zl.normalizePosition(o,n(s));if(!c)return u?r:null;if(i(c))return rg(e,t,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&Ps(c,l)?rg(e,t,l.getNode(!o),o,!0):u?ag(t,c.toRange(),!0):null},vC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=pC(r),o=Ds(e,t.getBody(),r),i=n(t.getBody(),dv(1),o),a=U(i,mv(1)),s=Ht.last(o.getClientRects()),(Bf(o)||Lf(o))&&(d=o.getNode()),(Pf(o)||Ff(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=bv(a,c))&&gC(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),rg(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Xs(t),f=[],d=0,m=function(e){return Ht.last(e.getClientRects())};1===e?(o=l.next,i=Xa,a=Ka,u=Su.after(r)):(o=l.prev,i=Ka,a=Xa,u=Su.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,Ht.last(f))&&d++,(s=qa(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),dv(1),d);if(u=bv(U(m,mv(1)),c))return ag(t,u.position.toRange(),!0);if(u=Ht.last(U(m,mv(0))))return ag(t,u.position.toRange(),!0)}},yC=function(e,t,n){var r,o,i,a,u=Xs(e.getBody()),s=d(Bs,u.next),c=d(Bs,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(Su.fromRangeStart(n)):c(Su.fromRangeStart(n)))||(a=(i=e).dom.create(Cl(i)),(!fe.ie||11<=fe.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},bC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Xs((e=l).getBody()),o=d(Bs,r.next),i=d(Bs,r.prev),a=t?Nu.Forwards:Nu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=hC(a,e,u,s))?n:(n=yC(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},CC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?fv:lv,i=(e=u).selection.getRng(),(n=vC(r,e,o,i))?n:(n=yC(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},xC=function(r,o){return function(){var t,e=o?Su.fromRangeEnd(r.selection.getRng()):Su.fromRangeStart(r.selection.getRng()),n=o?fC(r.getBody(),e):lC(r.getBody(),e);return(o?ee(n.positions):Z(n.positions)).filter((t=o,function(e){return t?Pf(e):Bf(e)})).fold(q(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},wC=function(e,t,n,r,o){var i,a,u,s,c=Gi(ar.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=qa(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,V(a,function(e,r){return e.fold(function(){return _.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return _.some(n<t?r:e)})},_.none())).map(function(e){return e.cell})},NC=d(wC,function(e){return e.bottom},function(e,t){return e.y<t}),EC=d(wC,function(e){return e.top},function(e,t){return e.y>t}),SC=function(t,n){return Z(n.getClientRects()).bind(function(e){return NC(t,e.left,e.top)}).bind(function(e){return cC((t=e,ic.lastPositionIn(t).map(function(e){return lC(t,e).positions.concat(e)}).getOr([])),n);var t})},TC=function(t,n){return ee(n.getClientRects()).bind(function(e){return EC(t,e.left,e.top)}).bind(function(e){return cC((t=e,ic.firstPositionIn(t).map(function(e){return[e].concat(fC(t,e).positions)}).getOr([])),n);var t})},kC=function(e,t){e.selection.setRng(t),_b(e,t)},_C=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===Cb.Wrap&&0===a.positions.length||!zo.isBr(n.getNode())&&(i=u).breakType===Cb.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},AC=d(_C,lC),RC=d(_C,fC),DC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(ls()&&(o=t,i=s,a=n,u=Su.fromRangeStart(i),ic.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=rg(c,e,n,!t,!0);return kC(e,l),!0}return!1},OC=function(e,t){var n=t.getNode(e);return zo.isElement(n)&&"TABLE"===n.nodeName?_.some(n):_.none()},BC=function(u,s,c){var e=OC(!!s,c),t=!1===s;e.fold(function(){return kC(u,c.toRange())},function(a){return ic.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return kC(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Cl(r=u))?r.undoManager.transact(function(){var e=ar.fromTag(i);xr(e,xl(r)),Ii(e,ar.fromTag("br")),n?Bi(ar.fromDom(o),e):Oi(ar.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),kC(r,t)}):kC(r,t.toRange()));var n,r,o,t,i})})},PC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Su.fromRangeStart(l),d=e.getBody();if(!t&&AC(r,f)){var m=(u=d,SC(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return sC(dC(u,Su.before(s)),e.left)})}).getOr(Su.before(s)));return BC(e,t,m),!0}return!(!t||!RC(r,f))&&(o=d,m=TC(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return sC(mC(o,Su.after(i)),e.left)})}).getOr(Su.after(i)),BC(e,t,m),!0)},IC=function(t,n){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return _.from(t.dom.getParent(e,"table")).map(function(e){return DC(t,n,e)})}).getOr(!1)}},LC=function(n,r){return function(){return _.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return _.from(n.dom.getParent(t,"table")).map(function(e){return PC(n,r,e,t)})}).getOr(!1)}},FC=function(e){return F(["figcaption"],lr(e))},MC=function(e){var t=j.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},zC=function(e,t,n){n?Ii(e,t):Pi(e,t)},UC=function(e,t,n,r){return""===t?(l=e,f=r,d=ar.fromTag("br"),zC(l,d,f),MC(d)):(o=e,i=r,a=t,u=n,s=ar.fromTag(a),c=ar.fromTag("br"),xr(s,u),Ii(s,c),zC(o,s,i),MC(c));var o,i,a,u,s,c,l,f,d},VC=function(e,t,n){return t?(o=e.dom(),fC(o,n).breakAt.isNone()):(r=e.dom(),lC(r,n).breakAt.isNone());var r,o},jC=function(t,n){var e,r,o,i=ar.fromDom(t.getBody()),a=Su.fromRangeStart(t.selection.getRng()),u=Cl(t),s=xl(t);return(e=a,r=i,o=d(Lr,r),ea(ar.fromDom(e.container()),yo,o).filter(FC)).exists(function(){if(VC(i,n,a)){var e=UC(i,u,s,n);return t.selection.setRng(e),!0}return!1})},HC=function(e,t){return function(){return!!e.selection.isCollapsed()&&jC(e,t)}},qC=function(e,r){return G(W(e,function(e){return Ky({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},$C=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},WC=function(e,t){return X(qC(e,t),function(e){return e.action()})},KC=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=or.detect().os,WC([{keyCode:Ev.RIGHT,action:bC(t,!0)},{keyCode:Ev.LEFT,action:bC(t,!1)},{keyCode:Ev.UP,action:CC(t,!1)},{keyCode:Ev.DOWN,action:CC(t,!0)},{keyCode:Ev.RIGHT,action:IC(t,!0)},{keyCode:Ev.LEFT,action:IC(t,!1)},{keyCode:Ev.UP,action:LC(t,!1)},{keyCode:Ev.DOWN,action:LC(t,!0)},{keyCode:Ev.RIGHT,action:Wd.move(t,n,!0)},{keyCode:Ev.LEFT,action:Wd.move(t,n,!1)},{keyCode:Ev.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Wd.moveNextWord(t,n)},{keyCode:Ev.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Wd.movePrevWord(t,n)},{keyCode:Ev.UP,action:HC(t,!1)},{keyCode:Ev.DOWN,action:HC(t,!0)}],r).each(function(e){r.preventDefault()}))})},XC=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,WC([{keyCode:Ev.BACKSPACE,action:$C(od,t,!1)},{keyCode:Ev.DELETE,action:$C(od,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(sg,t,!1)},{keyCode:Ev.DELETE,action:$C(sg,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(Gd,t,n,!1)},{keyCode:Ev.DELETE,action:$C(Gd,t,n,!0)},{keyCode:Ev.BACKSPACE,action:$C(Am,t,!1)},{keyCode:Ev.DELETE,action:$C(Am,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(vf,t,!1)},{keyCode:Ev.DELETE,action:$C(vf,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(mf,t,!1)},{keyCode:Ev.DELETE,action:$C(mf,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(eg,t,!1)},{keyCode:Ev.DELETE,action:$C(eg,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,WC([{keyCode:Ev.BACKSPACE,action:$C(id,t)},{keyCode:Ev.DELETE,action:$C(id,t)}],n))})},YC=function(e){return _.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},GC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new fo(t,t);r=n.current();){if(zo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else zo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},JC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},QC=YC,ZC=function(e){return YC(e).fold(q(""),function(e){return e.nodeName.toUpperCase()})},ex=function(e){return YC(e).filter(function(e){return No(ar.fromDom(e))}).isSome()},tx=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},nx=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},rx=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},ox=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!zo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},ix=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;nx(u=n)&&nx(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(ox(n,r,!0)&&ox(n,r,!1))tx(n,"LI")?i.insertAfter(l,rx(n)):i.replace(l,n);else if(ox(n,r,!0))tx(n,"LI")?(i.insertAfter(l,rx(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(ox(n,r,!1))i.insertAfter(l,rx(n));else{n=rx(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),GC(e,l)}},ax=function(e){e.innerHTML='<br data-mce-bogus="1">'},ux=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},sx=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},cx=function(e,t,n){return!1===zo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===ya?0:n:n===t.data.length-1&&t.data.charAt(n)===ya?t.data.length:n},lx=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},fx=function(e,t){var n=Cl(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,xl(e))},dx=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,y,b,C,x=a.dom,w=a.schema,N=w.getNonEmptyElements(),E=a.selection.getRng(),S=function(e){var t,n,r,o=s,i=w.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=x.create(e||m),fx(a,t)):t=c.cloneNode(!1),r=t,!1===El(a))x.setAttrib(t,"style",null),x.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Xu(o)||pc(o))continue;n=o.cloneNode(!1),x.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return ax(r),t},T=function(e){var t,n,r,o;if(o=cx(e,s,i),zo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&zo.isElement(s)&&s===c.firstChild)return!0;if(ux(s,"TABLE")||ux(s,"HR"))return g&&!e||!g&&e;for(t=new fo(s,c),zo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(zo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),N[r]&&"br"!==r))return!1}else if(zo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},k=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?S(m):S(),Sl(a)&&sx(x,l)&&x.isEmpty(c)?r=x.split(l,c):x.insertAfter(r,c),GC(a,r)};Sg(x,E).each(function(e){E.setStart(e.startContainer,e.startOffset),E.setEnd(e.endContainer,e.endOffset)}),s=E.startContainer,i=E.startOffset,m=Cl(a),n=e.shiftKey,zo.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&zo.isText(s)?s.nodeValue.length:0),(u=lx(x,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=lx(m,r);if(!(a=m.getParent(r,m.isBlock))||!sx(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),fx(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),fx(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,E,s,i)),c=x.getParent(s,x.isBlock),l=c?x.getParent(c.parentNode,x.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&x.isEmpty(c)?ix(a,S,l,c,m):m&&c===a.getBody()||(m=m||"P",wa(c)?(r=Da(c),x.isEmpty(c)&&ax(c),GC(a,r)):T()?k():T(!0)?(r=c.parentNode.insertBefore(S(),c),GC(a,ux(c,"HR")?r:c)):((t=(b=E,C=b.cloneRange(),C.setStart(b.startContainer,cx(!0,b.startContainer,b.startOffset)),C.setEnd(b.endContainer,cx(!1,b.endContainer,b.endOffset)),C).cloneRange()).setEndAfter(c),o=t.extractContents(),y=o,z(Yi(ar.fromDom(y),mr),function(e){var t=e.dom();t.nodeValue=ba(t.nodeValue)}),function(e){for(;zo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,x.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;zo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(x,N,r),p=x,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),x.isEmpty(c)&&ax(c),r.normalize(),x.isEmpty(r)?(x.remove(r),k()):GC(a,r)),x.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},mx=function(e,t){return QC(e).filter(function(e){return 0<t.length&&Pr(ar.fromDom(e),t)}).isSome()},gx=function(e){return mx(e,wl(e))},px=function(e){return mx(e,Nl(e))},hx=yf([{br:[]},{block:[]},{none:[]}]),vx=function(e,t){return px(e)},yx=function(n){return function(e,t){return""===Cl(e)===n}},bx=function(n){return function(e,t){return ex(e)===n}},Cx=function(n,r){return function(e,t){return ZC(e)===n.toUpperCase()===r}},xx=function(e){return Cx("pre",e)},wx=function(n){return function(e,t){return bl(e)===n}},Nx=function(e,t){return gx(e)},Ex=function(e,t){return t},Sx=function(e){var t=Cl(e),n=JC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},Tx=function(e,t){return function(n,r){return V(e,function(e,t){return e&&t(n,r)},!0)?_.some(t):_.none()}},kx=function(e,t){return hd([Tx([vx],hx.none()),Tx([Cx("summary",!0)],hx.br()),Tx([xx(!0),wx(!1),Ex],hx.br()),Tx([xx(!0),wx(!1)],hx.block()),Tx([xx(!0),wx(!0),Ex],hx.block()),Tx([xx(!0),wx(!0)],hx.br()),Tx([bx(!0),Ex],hx.br()),Tx([bx(!0)],hx.block()),Tx([yx(!0),Ex,Sx],hx.block()),Tx([yx(!0)],hx.br()),Tx([Nx],hx.br()),Tx([yx(!1),Ex],hx.br()),Tx([Sx],hx.block())],[e,t.shiftKey]).getOr(hx.none())},_x=function(e,t){kx(e,t).fold(function(){Ig(e,t)},function(){dx(e,t)},o)},Ax=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===Ev.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),_x(t,n)})))})},Rx=function(n,r){var e=r.container(),t=r.offset();return zo.isText(e)?(e.insertData(t,n),_.some(wu(e,t+n.length))):Os(r).map(function(e){var t=ar.fromText(n);return r.isAtEnd()?Bi(e,t):Oi(e,t),wu(t.dom(),n.length)})},Dx=d(Rx,"\xa0"),Ox=d(Rx," "),Bx=function(e,t,n){return ic.navigateIgnore(e,t,n,Df)},Px=function(e,t){return X(rf(ar.fromDom(t.container()),e),yo)},Ix=function(e,n,r){return Bx(e,n.dom(),r).forall(function(t){return Px(n,r).fold(function(){return!1===Ns(t,r,n.dom())},function(e){return!1===Ns(t,r,n.dom())&&Fr(e,ar.fromDom(t.container()))})})},Lx=function(t,n,r){return Px(n,r).fold(function(){return Bx(t,n.dom(),r).forall(function(e){return!1===Ns(e,r,n.dom())})},function(e){return Bx(t,e.dom(),r).isNone()})},Fx=d(Lx,!1),Mx=d(Lx,!0),zx=d(Ix,!1),Ux=d(Ix,!0),Vx=function(e){return wu.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},jx=function(e,t){var n=U(rf(ar.fromDom(t.container()),e),yo);return Z(n).getOr(e)},Hx=function(e,t){return Vx(t)?Rf(t):Rf(t)||ic.prevPosition(jx(e,t).dom(),t).exists(Rf)},qx=function(e,t){return Vx(t)?Af(t):Af(t)||ic.nextPosition(jx(e,t).dom(),t).exists(Af)},$x=function(e){return Os(e).bind(function(e){return ea(e,dr)}).exists(function(e){return t=Sr(e,"white-space"),F(["pre","pre-wrap"],t);var t})},Wx=function(e,t){return o=e,i=t,ic.prevPosition(o.dom(),i).isNone()||(n=e,r=t,ic.nextPosition(n.dom(),r).isNone())||Fx(e,t)||Mx(e,t)||wf(e,t)||xf(e,t);var n,r,o,i},Kx=function(e,t){var n,r,o,i=(r=(n=t).container(),o=n.offset(),zo.isText(r)&&o<r.data.length?wu(r,o+1):n);return!$x(i)&&(Mx(e,i)||Ux(e,i)||xf(e,i)||qx(e,i))},Xx=function(e,t){return n=e,!$x(r=t)&&(Fx(n,r)||zx(n,r)||wf(n,r)||Hx(n,r))||Kx(e,t);var n,r},Yx=function(e,t){return Sf(e.charAt(t))},Gx=function(e){var t=e.container();return zo.isText(t)&&Yn(t.data,"\xa0")},Jx=function(e){var n,t=e.data,r=(n=t.split(""),W(n,function(e,t){return Sf(e)&&0<t&&t<n.length-1&&kf(n[t-1])&&kf(n[t+1])?" ":e}).join(""));return r!==t&&(e.data=r,!0)},Qx=function(l,e){return _.some(e).filter(Gx).bind(function(e){var t,n,r,o,i,a,u,s,c=e.container();return i=l,u=(a=c).data,s=wu(a,0),Yx(u,0)&&!Xx(i,s)&&(a.data=" "+u.slice(1),1)||Jx(c)||(t=l,r=(n=c).data,o=wu(n,r.length-1),Yx(r,r.length-1)&&!Xx(t,o)&&(n.data=r.slice(0,-1)+" ",1))?_.some(e):_.none()})},Zx=function(t){var e=ar.fromDom(t.getBody());t.selection.isCollapsed()&&Qx(e,wu.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},ew=function(r,o){return function(e){return t=r,!$x(n=e)&&(Wx(t,n)||Hx(t,n)||qx(t,n))?Dx(o):Ox(o);var t,n}},tw=function(e){var t,n,r=Su.fromRangeStart(e.selection.getRng()),o=ar.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=d(zl.isInlineTarget,e),a=Su.fromRangeStart(e.selection.getRng());return Pd(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return ic.prevPosition(n.dom(),Su.before(e))},function(e){return ic.firstPositionIn(e)},function(e){return ic.lastPositionIn(e)},function(e){return ic.nextPosition(n.dom(),Su.after(e))})})).bind(ew(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1},nw=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,WC([{keyCode:Ev.SPACEBAR,action:$C(tw,t)}],n).each(function(e){n.preventDefault()}))})},rw=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(Da(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},ow=function(e,t){var n,r=(n=e,na(ar.fromDom(n.getBody()),"*[data-mce-caret]").fold(q(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void rw(e,r)):void(Sa(r)&&(rw(e,r),e.undoManager.add()))},iw=function(e){e.on("keyup compositionstart",d(ow,e))},aw=or.detect().browser,uw=function(t){var e,n;e=t,n=Ui(function(){e.composing||Zx(e)},0),aw.isIE()&&(e.on("keypress",function(e){n.throttle()}),e.on("remove",function(e){n.cancel()})),t.on("input",function(e){!1===e.isComposing&&Zx(t)})},sw=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,WC([{keyCode:Ev.END,action:xC(t,!0)},{keyCode:Ev.HOME,action:xC(t,!1)}],n).each(function(e){n.preventDefault()}))})},cw=function(e){var t=Wd.setupSelectedState(e);iw(e),KC(e,t),XC(e,t),Ax(e),nw(e),uw(e),sw(e)};function lw(u){var s,n,r,o=Xt.each,c=Ev.BACKSPACE,l=Ev.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=fe.gecko,a=fe.ie,m=fe.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},y=function(){u.shortcuts.add("meta+a",null,"SelectAll")},b=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<fe.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===Ev.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),fe.windowsPhone||u.on("keyup focusin mouseup",function(e){Ev.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(Ea(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),b(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),fe.iOS?(u.inline||u.on("keydown",function(){j.document.activeElement===j.document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):y()),11<=fe.ie&&(C(),b()),fe.ie&&(y(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=Rb(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),j.Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),he.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),he.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),fe.mac&&u.on("keydown",function(e){!Ev.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),b()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var fw=function(e){return zo.isElement(e)&&xo(ar.fromDom(e))},dw=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=wu.fromRangeStart(t),r=wu.fromRangeEnd(t);if(wu.isElementPosition(n)){var o=n.container();fw(o)&&ic.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}wu.isElementPosition(r)&&(o=n.container(),fw(o)&&ic.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(al(t))}(t)})},mw=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){z(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){z(e,function(e){var t=e.attr("data-mce-open");e.attr("open",S(t)?t:null),e.attr("data-mce-open",null)})})},gw=Ni.DOM,pw=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&he.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},hw=function(t,e){var n,r,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||f.content_editable||(m.open(),m.write(t.iframeHTML),m.close()),f.content_editable&&(t.on("remove",function(){var e=this.getBody();gw.removeClass(e,"mce-content-body"),gw.removeClass(e,"mce-edit-focus"),gw.setAttrib(e,"contentEditable",null)}),gw.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||j.document,t.contentWindow=f.content_window||j.window,t.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===gw.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=zh(t),t.schema=li(f),t.dom=Ni(m,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:f.content_editable,schema:t.schema,contentCssCors:Ll(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=mb((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new nb("br",1)).shortEnded=!0)}),o),t.serializer=yb(f,t),t.selection=oC(t.dom,t.getWin(),t.serializer,t),t.annotator=Uc(t),t.formatter=qy(t),t.undoManager=Jv(t),t._nodeChangeDispatcher=new Yh(t),t._selectionOverrides=_v(t),mw(t),dw(t),cw(t),Hh(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,gw.setAttrib(n,"spellcheck","false")),t.quirks=lw(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){Xt.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Xt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?gw.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){pw(t)},function(e){pw(t)}),f.content_style&&(a=t,s=f.content_style,c=ar.fromDom(a.getDoc().head),l=ar.fromTag("style"),Cr(l,"type","text/css"),Ii(l,ar.fromText(s)),Ii(c,l))},vw=Ni.DOM,yw=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=ml(e),s=ar.fromTag("iframe"),xr(s,i),xr(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Er(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,g,p=function(e,t){if(j.document.domain!==j.window.location.hostname&&fe.ie&&fe.ie<12){var n=Mh.uuid("mce");e[n]=function(){hw(e)};var r='javascript:(function(){document.open();document.domain="'+j.document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return vw.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(g=gl(f=e)+"<html><head>",pl(f)!==f.documentBaseUrl&&(g+='<base href="'+f.documentBaseURI.getURI()+'" />'),g+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=hl(f),m=vl(f),yl(f)&&(g+='<meta http-equiv="Content-Security-Policy" content="'+yl(f)+'" />'),g+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),vw.add(t.iframeContainer,l),p},bw=function(e,t){var n=yw(e,t);t.editorContainer&&(vw.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=vw.isHidden(t.editorContainer)),e.getElement().style.display="none",vw.setAttrib(e.id,"aria-hidden","true"),n||hw(e)},Cw=Ni.DOM,xw=function(t,n,e){var r=Nh.get(e),o=Nh.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Xt.trim(e),r&&-1===Xt.inArray(n,e)){if(Xt.each(Nh.dependencies(e),function(e){xw(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(nE){wh.pluginInitError(t,e,nE)}}},ww=function(e){return e.replace(/^\-/,"")},Nw=function(e){return{editorContainer:e,iframeContainer:e}},Ew=function(e){var t,n,r=e.getElement();return e.inline?Nw(null):(t=r,n=Cw.create("div"),Cw.insertAfter(n,t),Nw(n))},Sw=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,S(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Cw.getStyle(f,"width")||"100%",a=l.height||Cw.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<u&&(a=u),c.height=a,c):D(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:r.offsetHeight,n):Ew(e)},Tw=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||Cw.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,S(o)?(n.settings.theme=ww(o),r=Eh.get(o),n.theme=new r(n,Eh.urls[o]),n.theme.init&&n.theme.init(n,Eh.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],Xt.each(i.settings.plugins.split(/[ ,]/),function(e){xw(i,a,ww(e))}),e=Sw(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&Xt.each(Xt.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?hw(t):bw(t,e)},kw=Ni.DOM,_w=function(e){return"-"===e.charAt(0)},Aw=function(i,a){var u=_i.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(S(i)){if(!_w(i)&&!Eh.urls.hasOwnProperty(i)){var a=o.theme_url;a?Eh.load(i,t.documentBaseURI.toAbsolute(a)):Eh.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Eh.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,Xt.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),Xt.each(r.external_plugins,function(e,t){Nh.load(t,e),r.plugins+=" "+t}),Xt.each(r.plugins.split(/[ ,]/),function(e){if((e=Xt.trim(e))&&!Nh.urls[e])if(_w(e)){e=e.substr(1,e.length);var t=Nh.dependencies(e);Xt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=Nh.createUrl(t,e),Nh.load(e.resource,e)})}else Nh.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||Tw(i)},i,function(e){wh.pluginLoadError(i,e[0]),i.removed||Tw(i)})})},Rw=function(t){var e=t.settings,n=t.id,r=function(){kw.unbind(j.window,"ready",r),t.render()};if(Se.Event.domLoaded){if(t.getElement()&&fe.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||kw.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(kw.insertAfter(kw.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},kw.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=mh(t),t.notificationManager=dh(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=kw.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(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),Aw(t,t.suffix)}}else kw.bind(j.window,"ready",r)},Dw=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},Ow=Xt.each,Bw=Xt.trim,Pw="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Iw={ftp:21,http:80,https:443,mailto:25},Lw=function(r,e){var t,n,o=this;if(r=Bw(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new Lw(j.document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),Ow(Pw,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};Lw.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new Lw(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new Lw(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Iw[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),Ow(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},Lw.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},Lw.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var Fw=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Xt.trim(Pv.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=ba(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=Cl(o),u=new RegExp("^(<"+a+"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||ko(ar.fromDom(n))?t.content=r:t.content=Xt.trim(r),t.no_events||e.fire("GetContent",t),t.content},Mw=function(e,t){t(e),e.firstChild&&Mw(e.firstChild,t),e.next&&Mw(e.next,t)},zw=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Mw(t.firstChild,function(t){z(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),z(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);z(r,function(t){z(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Uw=function(e){return e instanceof nb},Vw=function(e,t){var r;e.dom.setHTML(e.getBody(),t),rh(r=e)&&ic.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=zo.isTable(t)?ic.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},jw=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Uw(s)?"":s,Uw(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),_.from(u.getBody()).fold(q(s),function(e){return Uw(s)?function(e,t,n,r){zw(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=rl({validate:e.validate},e.schema).serialize(n);return r.content=ko(ar.fromDom(t))?o:Xt.trim(o),Vw(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=Cl(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),Vw(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=rl({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=ko(ar.fromDom(n))?r:Xt.trim(r),Vw(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Hw=Ni.DOM,qw=function(e){return _.from(e).each(function(e){return e.destroy()})},$w=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Hw.remove(o.nextSibling),vp(e),e.editorManager.remove(e),!e.inline&&r&&(i=e,Hw.setStyle(i.id,"display",i.orgDisplay)),yp(e),Hw.remove(e.getContainer()),qw(t),qw(n),e.destroy()}var i},Ww=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),qw(i),qw(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Hw.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Kw=Ni.DOM,Xw=Xt.extend,Yw=Xt.each,Gw=Xt.resolve,Jw=fe.ie,Qw=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,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_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",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:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=Up(Bp,c,a,u),l.settings=t,Di.language=t.language||"en",Di.languageLoad=t.language_load,Di.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new Lw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Kp(l),l.loadedCSS={},l.editorCommands=new cp(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(fe.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(fe.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=gn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Xw(Qw.prototype={render:function(){Rw(this)},focus:function(e){nh(this,e)},hasFocus:function(){return rh(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Gw(r):0,o=Gw(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Xt.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return jp(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return Dw(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:Mh.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(Kw.show(this.getContainer()),Kw.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Jw&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(Kw.hide(e.getContainer()),Kw.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=Kw.getParent(r.id,"form"))&&Yw(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return jw(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),_.from(t.getBody()).fold(q("tree"===n.format?new nb("body",11):""),function(e){return Fw(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Xw({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==Sp(t=this)&&(t.initialized?Ep(t,"readonly"===n):t.on("init",function(){Ep(t,"readonly"===n)}),bp(t,n))},getContainer:function(){return this.container||(this.container=Kw.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=Kw.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Yw(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){$w(this)},destroy:function(e){Ww(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},Dp);var Zw,eN,tN,nN={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},rN=function(n,e){var t,r;or.detect().browser.isIE()?(r=n).on("focusout",function(){Zg(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Zg(n)})},oN=function(e){var t,n,r,o=Ui(function(){Zg(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},Ni.DOM.bind(j.document,"mouseup",r),t.on("remove",function(){Ni.DOM.unbind(j.document,"mouseup",r)})),e.on("init",function(){rN(e,o)}),e.on("remove",function(){o.cancel()})},iN=Ni.DOM,aN=function(e){return nN.isEditorUIElement(e)},uN=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==iN.getParent(e,function(e){return aN(e)||!!n&&t.dom.is(e,n)})},sN=function(r,e){var t=e.editor;oN(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;he.setEditorTimeout(t,function(){var e=r.focusedEditor;uN(t,function(){try{return j.document.activeElement}catch(e){return j.document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Zw||(Zw=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===j.document&&(t===j.document.body||uN(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},iN.bind(j.document,"focusin",Zw))},cN=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(iN.unbind(j.document,"focusin",Zw),Zw=null)},lN=function(e){e.on("AddEditor",d(sN,e)),e.on("RemoveEditor",d(cN,e))},fN=Ni.DOM,dN=Xt.explode,mN=Xt.each,gN=Xt.extend,pN=0,hN=!1,vN=[],yN=[],bN=function(t){var n=t.type;mN(tN.get(),function(e){switch(n){case"scroll":e.fire("ScrollWindow",t);break;case"resize":e.fire("ResizeWindow",t)}})},CN=function(e){e!==hN&&(e?gn(window).on("resize scroll",bN):gn(window).off("resize scroll",bN),hN=e)},xN=function(t){var e=yN;delete vN[t.id];for(var n=0;n<vN.length;n++)if(vN[n]===t){vN.splice(n,1);break}return yN=U(yN,function(e){return t!==e}),tN.activeEditor===t&&(tN.activeEditor=0<yN.length?yN[0]:null),tN.focusedEditor===t&&(tN.focusedEditor=null),e.length!==yN.length};gN(tN={defaultSettings:{},$:gn,majorVersion:"4",minorVersion:"9.7",releaseDate:"2019-12-19",editors:vN,i18n:hh,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=Lw.getDocumentBaseUrl(j.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=j.document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&j.document.currentScript&&(-1!==(r=j.document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new Lw(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new Lw(this.baseURL),this.suffix=o,lN(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new Lw(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Lw(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Di.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Xt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!fN.get(t)?e.name:fN.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):fN.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Qw(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};fN.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=gn.unique(function(t){var e,n=[];if(fe.ie&&fe.ie<11)return wh.initError("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(t.types)return mN(t.types,function(e){n=n.concat(fN.select(e.selector))}),n;if(t.selector)return fN.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&mN(dN(e),function(t){var e;(e=fN.get(t))?n.push(e):mN(j.document.forms,function(e){mN(e.elements,function(e){e.name===t&&(t="mce_editor_"+pN++,fN.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":mN(fN.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?mN(r.types,function(t){Xt.each(o,function(e){return!fN.is(e,t.selector)||(n(c(e),gN({},r,t),e),!1)})}):(Xt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(xN(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Xt.grep(o,function(e){return!s.get(e.id)})).length?f([]):mN(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?wh.initError("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,fN.bind(window,"ready",e),new de(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?yN.slice(0):S(t)?X(yN,function(e){return e.id===t}).getOr(null):O(t)&&yN[t]?yN[t]:null},add:function(e){var t=this;return vN[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(vN[e.id]=e),vN.push(e),yN.push(e)),CN(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),eN||(eN=function(){t.fire("BeforeUnload")},fN.bind(window,"beforeunload",eN))),e},createEditor:function(e,t){return this.add(new Qw(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!S(e))return n=e,A(r.get(n.id))?null:(xN(n)&&r.fire("RemoveEditor",{editor:n}),0===yN.length&&fN.unbind(window,"beforeunload",eN),n.remove(),CN(0<yN.length),n);mN(fN.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=yN.length-1;0<=t;t--)r.remove(yN[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Qw(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){mN(yN,function(e){e.save()})},addI18n:function(e,t){hh.add(e,t)},translate:function(e){return hh.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},gp),tN.setup();var wN,NN=tN;function EN(n){return{walk:function(e,t){return Bc(n,e,t)},split:Mm,normalize:function(t){return Sg(n,t).fold(q(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(wN=EN||(EN={})).compareRanges=yg,wN.getCaretRangeFromPoint=Rb,wN.getSelectedNode=Ga,wN.getNode=Ja;var SN,TN,kN=EN,_N=Math.min,AN=Math.max,RN=Math.round,DN=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=RN(s/2)),"c"===n[1]&&(r+=RN(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=RN(a/2)),"c"===n[4]&&(r-=RN(i/2)),ON(r,o,i,a)},ON=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},BN={inflate:function(e,t,n){return ON(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:DN,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=DN(e,t,r[i])).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},intersect:function(e,t){var n,r,o,i;return n=AN(e.x,t.x),r=AN(e.y,t.y),o=_N(e.x+e.w,t.x+t.w),i=_N(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:ON(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=AN(0,t.x-u),o=AN(0,t.y-s),i=AN(0,c-f),a=AN(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),ON(u,s,(c-=i)-u,(l-=a)-s)},create:ON,fromClientRect:function(e){return ON(e.left,e.top,e.width,e.height)}},PN={},IN={add:function(e,t){PN[e.toLowerCase()]=t},has:function(e){return!!PN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=PN.hasOwnProperty(t)?PN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=PN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},LN=Xt.each,FN=Xt.extend,MN=function(){};MN.extend=SN=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!TN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in TN=!0,e=new this,TN=!1,n.Mixins&&(LN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&LN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&LN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&LN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=FN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=SN,i};var zN=Math.min,UN=Math.max,VN=Math.round,jN=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+jN(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+jN(e[i],n):"");return o+"}"}return""+e},HN={serialize:jN,parse:function(e){try{return JSON.parse(e)}catch(t){}}},qN={callbacks:{},count:0,send:function(t){var n=this,r=Ni.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},$N={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",$N.fire("beforeInitialize",{settings:e}),t=Sh()){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Xt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=$N.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Xt.extend($N,gp);var WN,KN,XN,YN,GN=Xt.extend,JN=function(e){this.settings=GN({},e),this.count=0};JN.sendRPC=function(e){return(new JN).send(e)},JN.prototype={send:function(n){var r=n.error,o=n.success;(n=GN(this.settings,n)).success=function(e,t){void 0===(e=HN.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=HN.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",$N.send(n)}};try{WN=j.window.localStorage}catch(nE){KN={},XN=[],YN={getItem:function(e){var t=KN[e];return t||null},setItem:function(e,t){XN.push(e),KN[e]=String(t)},key:function(e){return XN[e]},removeItem:function(t){XN=XN.filter(function(e){return e===t}),delete KN[t]},clear:function(){XN=[],KN={}},length:0},Object.defineProperty(YN,"length",{get:function(){return XN.length},configurable:!1,enumerable:!1}),WN=YN}var QN,ZN=NN,eE={geom:{Rect:BN},util:{Promise:de,Delay:he,Tools:Xt,VK:Ev,URI:Lw,Class:MN,EventDispatcher:fp,Observable:gp,I18n:hh,XHR:$N,JSON:HN,JSONRequest:JN,JSONP:qN,LocalStorage:WN,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=UN(0,zN(t,1)),n=UN(0,zN(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=VN(255*(u+a)),s=VN(255*(s+a)),c=VN(255*(c+a))}else u=s=c=VN(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=zN(e/=255,zN(t/=255,n/=255)))===(a=UN(e,UN(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:VN(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:VN(100*r),v:VN(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:Se,Sizzle:St,DomQuery:gn,TreeWalker:fo,DOMUtils:Ni,ScriptLoader:_i,RangeUtils:kN,Serializer:yb,ControlSelection:Sb,BookmarkManager:wb,Selection:oC,Event:Se.Event},html:{Styles:di,Entities:Zo,Node:nb,Schema:li,SaxParser:Ov,DomParser:mb,Writer:nl,Serializer:rl},ui:{Factory:IN},Env:fe,AddOnManager:Di,Annotator:Uc,Formatter:qy,UndoManager:Jv,EditorCommands:cp,WindowManager:mh,NotificationManager:dh,EditorObservable:Dp,Shortcuts:Kp,Editor:Qw,FocusManager:nN,EditorManager:NN,DOM:Ni.DOM,ScriptLoader:_i.ScriptLoader,PluginManager:Di.PluginManager,ThemeManager:Di.ThemeManager,trim:Xt.trim,isArray:Xt.isArray,is:Xt.is,toArray:Xt.toArray,makeMap:Xt.makeMap,each:Xt.each,map:Xt.map,grep:Xt.grep,inArray:Xt.inArray,extend:Xt.extend,create:Xt.create,walk:Xt.walk,createNS:Xt.createNS,resolve:Xt.resolve,explode:Xt.explode,_addCacheSuffix:Xt._addCacheSuffix,isOpera:fe.opera,isWebKit:fe.webkit,isIE:fe.ie,isGecko:fe.gecko,isMac:fe.mac},tE=ZN=Xt.extend(ZN,eE);QN=tE,window.tinymce=QN,window.tinyMCE=QN,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(tE)}(window);
|
1
|
+
// 4.9.8 (2020-01-28)
|
2
|
+
!function(j){"use strict";var o=function(){},H=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},q=function(e){return function(){return e}},$=function(e){return e};function d(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,a,u,s,c,l,f,m,g,p,h,v,y=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},b=q(!1),C=q(!0),x=function(){return w},w=(e=function(e){return e.isNone()},r={fold:function(e,t){return e()},is:b,isSome:b,isNone:C,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:q(null),getOrUndefined:q(undefined),or:n,orThunk:t,map:x,each:o,bind:x,exists:b,forall:C,filter:x,equals:e,equals_:e,toArray:function(){return[]},toString:q("none()")},Object.freeze&&Object.freeze(r),r),N=function(n){var e=q(n),t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:C,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return N(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:w},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(b,function(e){return t(n,e)})}};return o},_={some:N,none:x,from:function(e){return null===e||e===undefined?w:N(e)}},E=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},S=E("string"),T=E("object"),k=E("array"),A=E("null"),R=E("boolean"),D=E("function"),O=E("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(e,t){return P.call(e,t)},F=function(e,t){return-1<L(e,t)},M=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},W=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},z=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},K=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}},U=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},V=function(e,t,n){return z(e,function(e){n=t(n,e)}),n},X=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return _.some(o)}return _.none()},Y=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return _.some(n);return _.none()},G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!k(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);I.apply(t,e[n])}return t}(W(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},Q=function(e,t){return U(e,function(e){return!F(t,e)})},Z=function(e){return 0===e.length?_.none():_.some(e[0])},ee=function(e){return 0===e.length?_.none():_.some(e[e.length-1])},te=D(Array.from)?Array.from:function(e){return B.call(e)},ne="undefined"!=typeof j.window?j.window:Function("return this;")(),re=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:ne,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},oe={getOrDie:function(e,t){var n=re(e,t);if(n===undefined||null===n)throw new Error(e+" not available on this browser");return n}},ie=function(){return oe.getOrDie("URL")},ae={createObjectURL:function(e){return ie().createObjectURL(e)},revokeObjectURL:function(e){ie().revokeObjectURL(e)}},ue=j.navigator,se=ue.userAgent,ce=function(e){return"matchMedia"in j.window&&j.matchMedia(e).matches};m=/Android/.test(se),a=(a=!(i=/WebKit/.test(se))&&/MSIE/gi.test(se)&&/Explorer/gi.test(ue.appName))&&/MSIE (\w+)\./.exec(se)[1],u=-1!==se.indexOf("Trident/")&&(-1!==se.indexOf("rv:")||-1!==ue.appName.indexOf("Netscape"))&&11,s=-1!==se.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(se),l=-1!==se.indexOf("Mac"),f=/(iPad|iPhone)/.test(se),g="FormData"in j.window&&"FileReader"in j.window&&"URL"in j.window&&!!ae.createObjectURL,p=ce("only screen and (max-device-width: 480px)")&&(m||f),h=ce("only screen and (min-width: 800px)")&&(m||f),v=-1!==se.indexOf("Windows Phone"),s&&(i=!1);var le,fe={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:m,contentEditable:!f||g||534<=parseInt(se.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:j.window.getSelection&&"Range"in j.window,documentMode:a&&!s?j.document.documentMode||7:10,fileApi:g,ceFalse:!1===a||8<a,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!p&&!h,windowsPhone:v},de=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),me=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},ge=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},pe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=me(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},he={requestAnimationFrame:function(e,t){le?le.then(e):le=new de(function(e){t||(t=j.document.body),function(e,t){var n,r=j.window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=j.window[o[n]+"RequestAnimationFrame"];r||(r=function(e){j.window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:me,setInterval:ge,setEditorTimeout:function(e,t,n){return me(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=ge(function(){e.removed?clearInterval(r):t()},n)},debounce:pe,throttle:pe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},ve=/^(?:mouse|contextmenu)|click/,ye={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},be=function(){return!1},Ce=function(){return!0},xe=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},we=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Ne=function(e,t){var n,r,o=t||{};for(n in e)ye[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||j.document),fe.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&ve.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||j.document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Ce,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Ce,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Ce,o.stopPropagation()})==((r=o).isDefaultPrevented===Ce||r.isDefaultPrevented===be)&&(o.isDefaultPrevented=be,o.isPropagationStopped=be,o.isImmediatePropagationStopped=be),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},Ee=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(we(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void he.setTimeout(s)}a()};!r.addEventListener||fe.ie&&fe.ie<11?(xe(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():xe(e,"DOMContentLoaded",a),xe(e,"load",a)}},Se=function(){var m,g,p,h,v,y=this,b={};g="mce-data-"+(+new Date).toString(32),h="onmouseenter"in j.document.documentElement,p="onfocusin"in j.document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,y.domLoaded=!1,y.events=b;var C=function(e,t){var n,r,o,i,a=b[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};y.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=j.window,d=function(e){C(Ne(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,b[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),y.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Ne({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Ne(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=Ne(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=b[o][u])?"ready"===u&&y.domLoaded?n({type:u}):i.push({func:n,scope:r}):(b[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?Ee(e,c,y):xe(e,s||u,c,l)));return e=i=0,n}},y.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return y;if(r=e[g]){if(s=b[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],we(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],we(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return y;delete b[r];try{delete e[g]}catch(d){e[g]=null}}return y},y.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return y;for((n=Ne(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return y},y.clean=function(e){var t,n,r=y.unbind;if(!e||3===e.nodeType||8===e.nodeType)return y;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return y},y.destroy=function(){b={}},y.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};Se.Event=new Se,Se.Event.bind(j.window,"ready",function(){});var Te,ke,_e,Ae,Re,De,Oe,Be,Pe,Ie,Le,Fe,Me,ze,Ue,Ve,je,He,qe="sizzle"+-new Date,$e=j.window.document,We=0,Ke=0,Xe=Tt(),Ye=Tt(),Ge=Tt(),Je=function(e,t){return e===t&&(Le=!0),0},Qe=typeof undefined,Ze={}.hasOwnProperty,et=[],tt=et.pop,nt=et.push,rt=et.push,ot=et.slice,it=et.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},at="[\\x20\\t\\r\\n\\f]",ut="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",st="\\["+at+"*("+ut+")(?:"+at+"*([*^$|!~]?=)"+at+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ut+"))|)"+at+"*\\]",ct=":("+ut+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+st+")*)|.*)\\)|)",lt=new RegExp("^"+at+"+|((?:^|[^\\\\])(?:\\\\.)*)"+at+"+$","g"),ft=new RegExp("^"+at+"*,"+at+"*"),dt=new RegExp("^"+at+"*([>+~]|"+at+")"+at+"*"),mt=new RegExp("="+at+"*([^\\]'\"]*?)"+at+"*\\]","g"),gt=new RegExp(ct),pt=new RegExp("^"+ut+"$"),ht={ID:new RegExp("^#("+ut+")"),CLASS:new RegExp("^\\.("+ut+")"),TAG:new RegExp("^("+ut+"|[*])"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+ct),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+at+"*(even|odd|(([+-]|)(\\d*)n|)"+at+"*(?:([+-]|)"+at+"*(\\d+)|))"+at+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+at+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+at+"*((?:-\\d)?\\d*)"+at+"*\\)|)(?=[^-]|$)","i")},vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/^[^{]+\{\s*\[native \w/,Ct=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,wt=/'|\\/g,Nt=new RegExp("\\\\([\\da-f]{1,6}"+at+"?|("+at+")|.)","ig"),Et=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{rt.apply(et=ot.call($e.childNodes),$e.childNodes),et[$e.childNodes.length].nodeType}catch(nE){rt={apply:et.length?function(e,t){nt.apply(e,ot.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var St=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:$e)!==Me&&Fe(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Me).nodeType)&&9!==u)return[];if(Ue&&!r){if(o=Ct.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&He(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return rt.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ke.getElementsByClassName)return rt.apply(n,t.getElementsByClassName(a)),n}if(ke.qsa&&(!Ve||!Ve.test(e))){if(f=l=qe,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=De(e),(l=t.getAttribute("id"))?f=l.replace(wt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Pt(c[s]);d=xt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return rt.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return Be(e.replace(lt,"$1"),t,n,r)};function Tt(){var r=[];return function e(t,n){return r.push(t+" ")>_e.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function kt(e){return e[qe]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function At(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Rt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Dt(a){return kt(function(i){return i=+i,kt(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Qe&&e}for(Te in ke=St.support={},Re=St.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Fe=St.setDocument=function(e){var t,s=e?e.ownerDocument||e:$e,n=s.defaultView;return s!==Me&&9===s.nodeType&&s.documentElement?(ze=(Me=s).documentElement,Ue=!Re(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Fe()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Fe()})),ke.attributes=!0,ke.getElementsByTagName=!0,ke.getElementsByClassName=bt.test(s.getElementsByClassName),ke.getById=!0,_e.find.ID=function(e,t){if(typeof t.getElementById!==Qe&&Ue){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_e.filter.ID=function(e){var t=e.replace(Nt,Et);return function(e){return e.getAttribute("id")===t}},_e.find.TAG=ke.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Qe)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},_e.find.CLASS=ke.getElementsByClassName&&function(e,t){if(Ue)return t.getElementsByClassName(e)},je=[],Ve=[],ke.disconnectedMatch=!0,Ve=Ve.length&&new RegExp(Ve.join("|")),je=je.length&&new RegExp(je.join("|")),t=bt.test(ze.compareDocumentPosition),He=t||bt.test(ze.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Je=t?function(e,t){if(e===t)return Le=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ke.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===$e&&He($e,e)?-1:t===s||t.ownerDocument===$e&&He($e,t)?1:Ie?it.call(Ie,e)-it.call(Ie,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Le=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:Ie?it.call(Ie,e)-it.call(Ie,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===$e?-1:u[r]===$e?1:0},s):Me},St.matches=function(e,t){return St(e,null,null,t)},St.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Me&&Fe(e),t=t.replace(mt,"='$1']"),ke.matchesSelector&&Ue&&(!je||!je.test(t))&&(!Ve||!Ve.test(t)))try{var n=(void 0).call(e,t);if(n||ke.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(nE){}return 0<St(t,Me,null,[e]).length},St.contains=function(e,t){return(e.ownerDocument||e)!==Me&&Fe(e),He(e,t)},St.attr=function(e,t){(e.ownerDocument||e)!==Me&&Fe(e);var n=_e.attrHandle[t.toLowerCase()],r=n&&Ze.call(_e.attrHandle,t.toLowerCase())?n(e,t,!Ue):undefined;return r!==undefined?r:ke.attributes||!Ue?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},St.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},St.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Le=!ke.detectDuplicates,Ie=!ke.sortStable&&e.slice(0),e.sort(Je),Le){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Ie=null,e},Ae=St.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=Ae(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Ae(t);return n},(_e=St.selectors={cacheLength:50,createPseudo:kt,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Nt,Et),e[3]=(e[3]||e[4]||e[5]||"").replace(Nt,Et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||St.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&St.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ht.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&>.test(n)&&(t=De(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Nt,Et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Xe[e+" "];return t||(t=new RegExp("(^|"+at+")"+e+"("+at+"|$)"))&&Xe(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Qe&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=St.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),y="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=y&&e.nodeName.toLowerCase(),d=!n&&!y;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(y?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[qe]||(l[qe]={}))[m]||[])[0]===We&&r[1],a=r[0]===We&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[We,u,a];break}}else if(d&&(r=(e[qe]||(e[qe]={}))[m])&&r[0]===We)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((y?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[qe]||(i[qe]={}))[m]=[We,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=_e.pseudos[e]||_e.setFilters[e.toLowerCase()]||St.error("unsupported pseudo: "+e);return a[qe]?a(i):1<a.length?(t=[e,e,"",i],_e.setFilters.hasOwnProperty(e.toLowerCase())?kt(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=it.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:kt(function(e){var r=[],o=[],u=Oe(e.replace(lt,"$1"));return u[qe]?kt(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:kt(function(t){return function(e){return 0<St(t,e).length}}),contains:kt(function(t){return t=t.replace(Nt,Et),function(e){return-1<(e.textContent||e.innerText||Ae(e)).indexOf(t)}}),lang:kt(function(n){return pt.test(n||"")||St.error("unsupported lang: "+n),n=n.replace(Nt,Et).toLowerCase(),function(e){var t;do{if(t=Ue?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=j.window.location&&j.window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===ze},focus:function(e){return e===Me.activeElement&&(!Me.hasFocus||Me.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!_e.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Dt(function(){return[0]}),last:Dt(function(e,t){return[t-1]}),eq:Dt(function(e,t,n){return[n<0?n+t:n]}),even:Dt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Dt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Dt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Dt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=_e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_e.pseudos[Te]=At(Te);for(Te in{submit:!0,reset:!0})_e.pseudos[Te]=Rt(Te);function Bt(){}function Pt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function It(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Ke++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[We,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[qe]||(e[qe]={}))[u])&&r[0]===We&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Lt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Mt(m,g,p,h,v,e){return h&&!h[qe]&&(h=Mt(h)),v&&!v[qe]&&(v=Mt(v,e)),kt(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)St(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:Ft(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=Ft(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?it.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):rt.apply(t,d)})}function zt(e){for(var r,t,n,o=e.length,i=_e.relative[e[0].type],a=i||_e.relative[" "],u=i?1:0,s=It(function(e){return e===r},a,!0),c=It(function(e){return-1<it.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Pe)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=_e.relative[e[u].type])l=[It(Lt(l),t)];else{if((t=_e.filter[e[u].type].apply(null,e[u].matches))[qe]){for(n=++u;n<o&&!_e.relative[e[n].type];n++);return Mt(1<u&&Lt(l),1<u&&Pt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(lt,"$1"),t,u<n&&zt(e.slice(u,n)),n<o&&zt(e=e.slice(n)),n<o&&Pt(e))}l.push(t)}return Lt(l)}Bt.prototype=_e.filters=_e.pseudos,_e.setFilters=new Bt,De=St.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ye[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=_e.preFilter;a;){for(i in n&&!(r=ft.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=dt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(lt," ")}),a=a.slice(n.length)),_e.filter)!(r=ht[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?St.error(e):Ye(e,u).slice(0)},Oe=St.compile=function(e,t){var n,h,v,y,b,r,o=[],i=[],a=Ge[e+" "];if(!a){for(t||(t=De(e)),n=t.length;n--;)(a=zt(t[n]))[qe]?o.push(a):i.push(a);(a=Ge(e,(h=i,y=0<(v=o).length,b=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Pe,m=e||b&&_e.find.TAG("*",o),g=We+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Pe=t!==Me&&t);c!==p&&null!=(i=m[c]);c++){if(b&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(We=g)}y&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,y&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=tt.call(r));f=Ft(f)}rt.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&St.uniqueSort(r)}return o&&(We=g,Pe=d),l},y?kt(r):r))).selector=e}return a},Be=St.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&De(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&ke.getById&&9===t.nodeType&&Ue&&_e.relative[i[1].type]){if(!(t=(_e.find.ID(a.matches[0].replace(Nt,Et),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ht.needsContext.test(e)?0:i.length;o--&&(a=i[o],!_e.relative[u=a.type]);)if((s=_e.find[u])&&(r=s(a.matches[0].replace(Nt,Et),xt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Pt(i)))return rt.apply(n,r),n;break}}return(c||Oe(e,l))(r,t,!Ue,n,xt.test(e)&&Ot(t.parentNode)||t),n},ke.sortStable=qe.split("").sort(Je).join("")===qe,ke.detectDuplicates=!!Le,Fe(),ke.sortDetached=!0;var Ut=Array.isArray,Vt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},jt=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},Ht={isArray:Ut,toArray:function(e){var t,n,r=e;if(!Ut(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:Vt,map:function(n,r){var o=[];return Vt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return Vt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:jt,find:function(e,t,n){var r=jt(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},qt=/^\s*|\s*$/g,$t=function(e){return null===e||e===undefined?"":(""+e).replace(qt,"")},Wt=function(e,t){return t?!("array"!==t||!Ht.isArray(e))||typeof e===t:e!==undefined},Kt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),Ht.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Kt(e,n,r,o)}))},Xt={trim:$t,isArray:Ht.isArray,is:Wt,toArray:Ht.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:Ht.each,map:Ht.map,grep:Ht.filter,inArray:Ht.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Kt,createNS:function(e,t){var n,r;for(t=t||j.window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||j.window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Wt(e,"array")?e:Ht.map(e.split(t||","),$t)},_addCacheSuffix:function(e){var t=fe.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Yt=j.document,Gt=Array.prototype.push,Jt=Array.prototype.slice,Qt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Zt=Se.Event,en=Xt.makeMap("children,contents,next,prev"),tn=function(e){return void 0!==e},nn=function(e){return"string"==typeof e},rn=function(e,t){var n,r,o;for(o=(t=t||Yt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},on=function(e,t,n,r){var o;if(nn(t))t=rn(t,bn(e[0]));else if(t.length&&!t.nodeType){if(t=gn.makeArray(t),r)for(o=t.length-1;0<=o;o--)on(e,t[o],n,r);else for(o=0;o<t.length;o++)on(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},an=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},un=function(e,t,n){var r,o;return t=gn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},sn=Xt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),cn=Xt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ln={"for":"htmlFor","class":"className",readonly:"readOnly"},fn={"float":"cssFloat"},dn={},mn={},gn=function(e,t){return new gn.fn.init(e,t)},pn=/^\s*|\s*$/g,hn=function(e){return null===e||e===undefined?"":(""+e).replace(pn,"")},vn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return vn(e,function(e,t){n(t,e)&&r.push(t)}),r},bn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Yt};gn.fn=gn.prototype={constructor:gn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return gn(e).attr(t);o.context=t=j.document}if(nn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Qt.exec(e)))return gn(t).find(e);if(n[1])for(r=rn(e,bn(t)).firstChild;r;)Gt.call(o,r),r=r.nextSibling;else{if(!(r=bn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Xt.toArray(this)},add:function(e,t){var n,r,o=this;if(nn(e))return o.add(gn(e));if(!1!==t)for(n=gn.unique(o.toArray().concat(gn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Gt.apply(o,gn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)vn(t,function(e,t){r.attr(e,t)});else{if(!tn(n)){if(r[0]&&1===r[0].nodeType){if((e=dn[t])&&e.get)return e.get(r[0],t);if(cn[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=dn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=ln[e]||e))vn(e,function(e,t){n.prop(e,t)});else{if(!tn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)vn(n,function(e,t){i.css(e,t)});else if(tn(r))n=t(n),"number"!=typeof r||sn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=mn[n])&&o.set)o.set(this,r);else{try{this.style[fn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=mn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],Zt.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(tn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){gn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(tn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return on(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return on(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?on(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?on(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return gn(e).append(this),this},prependTo:function(e){return gn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return un(this,e)},wrapAll:function(e){return un(this,e,!0)},wrapInner:function(e){return this.each(function(){gn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){gn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),gn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?vn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=an(t,o))!==i&&(n=t.className,r?t.className=hn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return an(this[0],e)},each:function(e){return vn(this,e)},on:function(e,t){return this.each(function(){Zt.bind(this,e,t)})},off:function(e,t){return this.each(function(){Zt.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Zt.fire(this,e.type,e):Zt.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new gn(Jt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)gn.find(e,this[t],r);return gn(r)},filter:function(n){return gn("function"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):gn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof gn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&gn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),gn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Gt,sort:[].sort,splice:[].splice},Xt.extend(gn,{extend:Xt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Xt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Xt.isArray,each:vn,trim:hn,grep:yn,find:St,expr:St.selectors,unique:St.uniqueSort,text:St.getText,contains:St.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?gn.find.matchesSelector(t[0],e)?[t[0]]:[]:gn.find.matches(e,t)}});var Cn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof gn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&gn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},xn=function(e,t,n,r){var o=[];for(r instanceof gn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&gn(e).is(r))break}o.push(e)}return o},wn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};vn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Cn(e,"parentNode")},next:function(e){return wn(e,"nextSibling",1)},prev:function(e){return wn(e,"previousSibling",1)},children:function(e){return xn(e.firstChild,"nextSibling",1)},contents:function(e){return Xt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){gn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(gn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(en[e]||(n=gn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=gn(n),t?n.filter(t):n}}),vn({parentsUntil:function(e,t){return Cn(e,"parentNode",t)},nextUntil:function(e,t){return xn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return xn(e,"previousSibling",1,t).slice(1)}},function(r,o){gn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(gn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=gn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=gn(n),e?n.filter(e):n}}),gn.fn.is=function(e){return!!e&&0<this.filter(e).length},gn.fn.init.prototype=gn.fn,gn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return gn.extend(o,this),o};var Nn=function(n,r,e){vn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};fe.ie&&fe.ie<8&&(Nn(dn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),Nn(dn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),fe.ie&&fe.ie<9&&(fn["float"]="styleFloat",Nn(mn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),gn.attrHooks=dn,gn.cssHooks=mn;var En,Sn,Tn,kn,_n,An,Rn,Dn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Bn(r(1),r(2))},On=function(){return Bn(0,0)},Bn=function(e,t){return{major:e,minor:t}},Pn={nu:Bn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?On():Dn(e,n)},unknown:On},In="Firefox",Ln=function(e,t){return function(){return t===e}},Fn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ln("Edge",t),isChrome:Ln("Chrome",t),isIE:Ln("IE",t),isOpera:Ln("Opera",t),isFirefox:Ln(In,t),isSafari:Ln("Safari",t)}},Mn={unknown:function(){return Fn({current:undefined,version:Pn.unknown()})},nu:Fn,edge:q("Edge"),chrome:q("Chrome"),ie:q("IE"),opera:q("Opera"),firefox:q(In),safari:q("Safari")},zn="Windows",Un="Android",Vn="Solaris",jn="FreeBSD",Hn=function(e,t){return function(){return t===e}},qn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Hn(zn,t),isiOS:Hn("iOS",t),isAndroid:Hn(Un,t),isOSX:Hn("OSX",t),isLinux:Hn("Linux",t),isSolaris:Hn(Vn,t),isFreeBSD:Hn(jn,t)}},$n={unknown:function(){return qn({current:undefined,version:Pn.unknown()})},nu:qn,windows:q(zn),ios:q("iOS"),android:q(Un),linux:q("Linux"),osx:q("OSX"),solaris:q(Vn),freebsd:q(jn)},Wn=function(e,t){var n=String(t).toLowerCase();return X(e,function(e){return e.search(n)})},Kn=function(e,n){return Wn(e,n).map(function(e){var t=Pn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Xn=function(e,n){return Wn(e,n).map(function(e){var t=Pn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Yn=function(e,t){return-1!==e.indexOf(t)},Gn=function(e){return e.replace(/^\s+|\s+$/g,"")},Jn=function(e){return e.replace(/\s+$/g,"")},Qn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Zn=function(t){return function(e){return Yn(e,t)}},er=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Yn(e,"edge/")&&Yn(e,"chrome")&&Yn(e,"safari")&&Yn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qn],search:function(e){return Yn(e,"chrome")&&!Yn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Yn(e,"msie")||Yn(e,"trident")}},{name:"Opera",versionRegexes:[Qn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Zn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Zn("firefox")},{name:"Safari",versionRegexes:[Qn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Yn(e,"safari")||Yn(e,"mobile/"))&&Yn(e,"applewebkit")}}],tr=[{name:"Windows",search:Zn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Yn(e,"iphone")||Yn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Zn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Zn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Zn("linux"),versionRegexes:[]},{name:"Solaris",search:Zn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Zn("freebsd"),versionRegexes:[]}],nr={browsers:q(er),oses:q(tr)},rr=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=nr.browsers(),m=nr.oses(),g=Kn(d,e).fold(Mn.unknown,Mn.nu),p=Xn(m,e).fold($n.unknown,$n.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:q(o),isiPhone:q(i),isTablet:q(s),isPhone:q(l),isTouch:q(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:q(f)})}},or={detect:(En=function(){var e=j.navigator.userAgent;return rr(e)},Tn=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn||(Tn=!0,Sn=En.apply(null,e)),Sn})},ir=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:q(e)}},ar={fromHtml:function(e,t){var n=(t||j.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw j.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ir(n.childNodes[0])},fromTag:function(e,t){var n=(t||j.document).createElement(e);return ir(n)},fromText:function(e,t){var n=(t||j.document).createTextNode(e);return ir(n)},fromDom:ir,fromPoint:function(e,t,n){var r=e.dom();return _.from(r.elementFromPoint(t,n)).map(ir)}},ur=(j.Node.ATTRIBUTE_NODE,j.Node.CDATA_SECTION_NODE,j.Node.COMMENT_NODE,j.Node.DOCUMENT_NODE),sr=(j.Node.DOCUMENT_TYPE_NODE,j.Node.DOCUMENT_FRAGMENT_NODE,j.Node.ELEMENT_NODE),cr=j.Node.TEXT_NODE,lr=(j.Node.PROCESSING_INSTRUCTION_NODE,j.Node.ENTITY_REFERENCE_NODE,j.Node.ENTITY_NODE,j.Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),fr=function(t){return function(e){return e.dom().nodeType===t}},dr=fr(sr),mr=fr(cr),gr=Object.keys,pr=Object.hasOwnProperty,hr=function(e,t){for(var n=gr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},vr=function(e,r){var o={};return hr(e,function(e,t){var n=r(e,t);o[n.k]=n.v}),o},yr=function(e){return e.style!==undefined&&D(e.style.getPropertyValue)},br=function(e,t,n){if(!(S(n)||R(n)||O(n)))throw j.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Cr=function(e,t,n){br(e.dom(),t,n)},xr=function(e,t){var n=e.dom();hr(t,function(e,t){br(n,t,e)})},wr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},Nr=function(e,t){e.dom().removeAttribute(t)},Er=function(e,t){var n=e.dom();hr(t,function(e,t){!function(e,t,n){if(!S(n))throw j.console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);yr(e)&&e.style.setProperty(t,n)}(n,t,e)})},Sr=function(e,t){var n,r,o=e.dom(),i=j.window.getComputedStyle(o).getPropertyValue(t),a=""!==i||(r=mr(n=e)?n.dom().parentNode:n.dom())!==undefined&&null!==r&&r.ownerDocument.body.contains(r)?i:Tr(o,t);return null===a?undefined:a},Tr=function(e,t){return yr(e)?e.style.getPropertyValue(t):""},kr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return z(t,function(e,t){r[e]=q(n[t])}),r}},_r=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},Ar=function(){return oe.getOrDie("Node")},Rr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Dr=function(e,t){return Rr(e,t,Ar().DOCUMENT_POSITION_CONTAINED_BY)},Or=sr,Br=ur,Pr=function(e,t){var n=e.dom();if(n.nodeType!==Or)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Ir=function(e){return e.nodeType!==Or&&e.nodeType!==Br||0===e.childElementCount},Lr=function(e,t){return e.dom()===t.dom()},Fr=or.detect().browser.isIE()?function(e,t){return Dr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Mr=function(e){return ar.fromDom(e.dom().ownerDocument)},zr=function(e){return ar.fromDom(e.dom().ownerDocument.defaultView)},Ur=function(e){return _.from(e.dom().parentNode).map(ar.fromDom)},Vr=function(e){return _.from(e.dom().previousSibling).map(ar.fromDom)},jr=function(e){return _.from(e.dom().nextSibling).map(ar.fromDom)},Hr=function(e){return t=_r(e,Vr),(n=B.call(t,0)).reverse(),n;var t,n},qr=function(e){return _r(e,jr)},$r=function(e){return W(e.dom().childNodes,ar.fromDom)},Wr=function(e,t){var n=e.dom().childNodes;return _.from(n[t]).map(ar.fromDom)},Kr=function(e){return Wr(e,0)},Xr=function(e){return Wr(e,e.dom().childNodes.length-1)},Yr=(kr("element","offset"),or.detect().browser),Gr=function(e){return X(e,dr)},Jr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Sr(ar.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=ar.fromDom(t),Yr.isFirefox()&&"table"===lr(i)?Gr($r(i)).filter(function(e){return"caption"===lr(e)}).bind(function(o){return Gr(qr(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Qr={},Zr={exports:Qr};kn=undefined,_n=Qr,An=Zr,Rn=undefined,function(e){"object"==typeof _n&&void 0!==An?An.exports=e():"function"==typeof kn&&kn.amd?kn([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=e()}(function(){return function i(a,u,s){function c(t,e){if(!u[t]){if(!a[t]){var n="function"==typeof Rn&&Rn;if(!e&&n)return n(t,!0);if(l)return l(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};a[t][0].call(o.exports,function(e){return c(a[t][1][e]||e)},o,o.exports,i,a,u,s)}return u[t].exports}for(var l="function"==typeof Rn&&Rn,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,n){var r,o,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(nE){try{return r.call(null,e,0)}catch(nE){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(nE){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(nE){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&g())}function g(){if(!f){var e=s(m);f=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(nE){try{return o.call(null,e)}catch(nE){return o.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||f||s(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(e,f,t){(function(n){!function(e){var t=setTimeout;function r(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(e,this)}function o(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e=1===n._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(n._value)}catch(nE){return void u(r.promise,nE)}a(r.promise,t)}else(1===n._state?a:u)(r.promise,n._value)})):n._deferreds.push(r)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(nE){u(e,nE)}var r,o}function u(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,u(t,e))})}catch(r){if(n)return;n=!0,u(t,r)}}i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(r);return o(this,new c(e,t,n)),n},i.all=function(e){var s=Array.prototype.slice.call(e);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof n?function(e){n(e)}:function(e){t(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==f&&f.exports?f.exports=i:e.Promise||(e.Promise=i)}(this)}).call(this,e("timers").setImmediate)},{timers:3}],3:[function(s,e,c){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},a=0;function u(e,t){this._id=e,this._clearFn=t}c.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(e){e.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},c.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},c._unrefActive=c.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},c.setImmediate="function"==typeof e?e:function(e){var t=a++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),c.clearImmediate(t))}),t},c.clearImmediate="function"==typeof t?t:function(e){delete i[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(e,t,n){var r=e("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var eo=Zr.exports.boltExport,to=function(e){var n=_.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){z(e,a)},a=function(t){n.each(function(e){j.setTimeout(function(){t(e)},0)})};return e(function(e){n=_.some(e),i(t),t=[]}),{get:r,map:function(n){return to(function(t){r(function(e){t(n(e))})})},isReady:o}},no={nu:to,pure:function(t){return to(function(e){e(t)})}},ro=function(e){j.setTimeout(function(){throw e},0)},oo=function(n){var e=function(e){n().then(e,ro)};return{map:function(e){return oo(function(){return n().then(e)})},bind:function(t){return oo(function(){return n().then(function(e){return t(e).toPromise()})})},anonBind:function(e){return oo(function(){return n().then(function(){return e.toPromise()})})},toLazy:function(){return no.nu(e)},toCached:function(){var e=null;return oo(function(){return null===e&&(e=n()),e})},toPromise:n,get:e}},io={nu:function(e){return oo(function(){return new eo(e)})},pure:function(e){return oo(function(){return eo.resolve(e)})}},ao=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):z(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},uo=function(e){return ao(e,io.nu)},so=function(n){return{is:function(e){return n===e},isValue:C,isError:b,getOr:q(n),getOrThunk:q(n),getOrDie:q(n),or:function(e){return so(n)},orThunk:function(e){return so(n)},fold:function(e,t){return t(n)},map:function(e){return so(e(n))},mapError:function(e){return so(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return _.some(n)}}},co=function(n){return{is:b,isValue:b,isError:C,getOr:$,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return co(n)},mapError:function(e){return co(e(n))},each:o,bind:function(e){return co(n)},exists:b,forall:C,toOption:_.none}},lo={value:so,error:co,fromOption:function(e,t){return e.fold(function(){return co(t)},so)}};function fo(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var mo,go,po,ho=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,q(!0))).hasOwnProperty(lr(e))}},vo=ho(["h1","h2","h3","h4","h5","h6"]),yo=ho(["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"]),bo=function(e){return dr(e)&&!yo(e)},Co=function(e){return dr(e)&&"br"===lr(e)},xo=ho(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),wo=ho(["ul","ol","dl"]),No=ho(["li","dd","dt"]),Eo=ho(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),So=ho(["thead","tbody","tfoot"]),To=ho(["td","th"]),ko=ho(["pre","script","textarea","style"]),_o=function(t){return function(e){return!!e&&e.nodeType===t}},Ao=_o(1),Ro=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},Do=function(t){return function(e){if(Ao(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Oo=_o(3),Bo=_o(8),Po=_o(9),Io=_o(11),Lo=Ro("br"),Fo=Do("true"),Mo=Do("false"),zo={isText:Oo,isElement:Ao,isComment:Bo,isDocument:Po,isDocumentFragment:Io,isBr:Lo,isContentEditableTrue:Fo,isContentEditableFalse:Mo,isRestrictedNode:function(e){return!!e&&!Object.getPrototypeOf(e)},matchNodeNames:Ro,hasPropValue:function(t,n){return function(e){return Ao(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return Ao(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return Ao(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(Ao(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return Ao(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return Ao(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return Ao(e)&&"TABLE"===e.tagName}},Uo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Vo=function(e,t){var n,r=t.childNodes;if(!zo.isElement(t)||!Uo(t)){for(n=r.length-1;0<=n;n--)Vo(e,r[n]);if(!1===zo.isDocument(t)){if(zo.isText(t)&&0<t.nodeValue.length){var o=Xt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(zo.isElement(t)&&(1===(r=t.childNodes).length&&Uo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||Eo(ar.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},jo={trimNode:Vo},Ho=Xt.makeMap,qo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$o=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\"\']/g,Ko=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Xo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};go={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},po={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Yo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),go[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};mo=Yo("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);var Go=function(e,t){return e.replace(t?qo:$o,function(e){return go[e]||e})},Jo=function(e,t){return e.replace(t?qo:$o,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":go[e]||"&#"+e.charCodeAt(0)+";"})},Qo=function(e,t,n){return n=n||mo,e.replace(t?qo:$o,function(e){return go[e]||n[e]||e})},Zo={encodeRaw:Go,encodeAllRaw:function(e){return(""+e).replace(Wo,function(e){return go[e]||e})},encodeNumeric:Jo,encodeNamed:Qo,getEncodeFunc:function(e,t){var n=Yo(t)||mo,r=Ho(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?qo:$o,function(e){return go[e]!==undefined?go[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return Qo(e,t,n)}:Qo:r.numeric?Jo:Go},decode:function(e){return e.replace(Ko,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Xo[t]||String.fromCharCode(t):po[e]||mo[e]||(n=e,(r=ar.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},ei={},ti={},ni=Xt.makeMap,ri=Xt.each,oi=Xt.extend,ii=Xt.explode,ai=Xt.inArray,ui=function(e,t){return(e=Xt.trim(e))?e.split(t||" "):[]},si=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=ui(n)),r=(e=ui(e)).length;r--;)i={attributes:a(o=ui([u,t].join(" "))),attributesOrder:o,children:a(n,ti)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=ui(e)).length,t=ui(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return ei[e]?ei[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="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"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure main header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),ri(ui(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),ri(ui(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("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","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("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"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside main header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),ri(ui("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,ei[e]=s)},ci=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),ri(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?ni(e,/[, ]/):ii(e,/[, ]/)})),r};function li(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=ni(r,/[, ]/,ni(r.toUpperCase(),/[, ]/)):(r=ei[e])||(r=ni(t," ",ni(t.toUpperCase()," ")),r=oi(r,n),ei[e]=r),r};n=si((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ci(i.valid_styles),t=ci(i.invalid_styles,"map"),s=ci(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("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"),c=v("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",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),ri((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},y=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,y,b,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=ui(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(y in h)d[y]=h[y];m.push.apply(m,v)}if(s)for(r=0,o=(s=ui(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(ai(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),u.defaultValue=b),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),u.forcedValue=b),"<"===g&&(u.validValues=ni(b,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},b=function(e){N={},E=[],y(e),ri(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(ei.text_block_elements=ei.block_elements=null,ri(ui(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=oi({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}ri(g,function(e,t){e[r]&&(g[t]=e=oi({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;ei[i.schema]=null,e&&ri(ui(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],ri(ui(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?b(i.valid_elements):(ri(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&ri(ui("strong/b em/i"),function(e){e=ui(e,"/"),N[e[1]].outputName=e[0]}),ri(ui("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),ri(ui("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),ri(ui("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),y(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),ri({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(e,t){N[t]&&(N[t].parentsRequired=ui(e))}),i.invalid_elements&&ri(ii(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||y("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:y,setValidElements:b,addCustomElements:C,addValidChildren:x}}var fi=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function di(b,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},T="\ufeff";for(b=b||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+T).split(" "),C=0;C<t.length;C++)S[t[C]]=T+C,S[T+C]=t[C];return{toHex:function(e){return e.replace(x,fi)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=b.url_converter,f=b.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e){return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},y=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\\'")+"'";if(t=p(t||n||r),!b.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!b.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(T)||-1!==n.indexOf('"'))continue;if(!b.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,fi)).replace(w,y),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var mi,gi=Xt.each,pi=Xt.grep,hi=fe.ie,vi=/^([a-z0-9],?)+$/i,yi=/^[ \t\r\n]*$/,bi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},Ci=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},xi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function wi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=j.window,o={},t=0,e=function(m,g){void 0===g&&(g={});var p,h=0,v={};p=g.maxLoadTime||5e3;var y=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(e,t){e()||((new Date).getTime()-i<p?he.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=Xt._addCacheSuffix(e),v[e]?a=v[e]:(a={passed:[],failed:[]},v[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+h++,o.async=!1,o.defer=!1,i=(new Date).getTime(),g.contentCssCors&&(o.crossOrigin="anonymous"),"onload"in o&&!((d=j.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<j.navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void y(r);l()}var d;y(o),o.href=e}else s();else u()},t=function(t){return io.nu(function(e){n(t,H(e,q(lo.value(t))),H(e,q(lo.error(t))))})},o=function(e){return e.fold($,$)};return{load:n,loadAll:function(e,n,r){uo(W(e,t)).get(function(e){var t=K(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a,{contentCssCors:u.contentCssCors}),l=[],f=u.schema?u.schema:li({}),d=di({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new Se(u.proxy):Se.Event,n=f.getBlockElements(),g=gn.overrideDefaults(function(){return{context:a,element:V.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},y=function(e){var t=p(e);return t?t.attributes:[]},b=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Jr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=fe.ie&&fe.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(vi.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<St(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Xt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},k=function(e,n,r){var o,t="string"==typeof e?p(e):e;if(!t)return!1;if(Xt.isArray(t)&&(t.length||0===t.length))return o=[],gi(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},_=function(e,t){h(e).each(function(e,n){gi(t,function(e,t){b(n,t,e)})})},A=function(e,r){var t=h(e);hi?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){gn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},R=function(e,n,r,o,i){return k(e,function(e){var t="string"==typeof n?a.createElement(n):n;return _(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&A(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},O=Zo.decode,B=Zo.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},I=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&gn(this).attr("class",null)})},L=function(t,e,n){return k(e,function(e){return Xt.is(e,"array")&&(t=t.cloneNode(!0)),n&&gi(pi(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},F=function(){return a.createRange()},M=function(e,t,n,r){if(Xt.isArray(e)){for(var o=e.length;o--;)e[o]=M(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||V)},z=function(e,t,n){var r;if(Xt.isArray(e)){for(r=e.length;r--;)e[r]=z(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},U=function(e){if(e&&zo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$:h,root:null,clone:function(t,e){if(!hi||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return gi(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document.documentElement;return{x:t.pageXOffset||n.scrollLeft,y:t.pageYOffset||n.scrollTop,w:t.innerWidth||n.clientWidth,h:t.innerHeight||n.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return T(e,t,"nextSibling")},getPrev:function(e,t){return T(e,t,"previousSibling")},select:function(e,t){return St(e,p(t)||u.root_element||a,[])},is:E,add:R,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+B(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&Ci(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&Ci(d,n)},removeAllAttribs:function(e){return k(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:b,setAttribs:_,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(V!==wi.DOM&&a===j.document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;V===wi.DOM||a!==j.document?(e||(e=""),n=a.getElementsByTagName("head")[0],gi(e.split(","),function(e){var t;e=Xt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):wi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){I(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:I,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:A,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return zo.isElement(t)?t.outerHTML:gn("<div></div>").append(gn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(gn(this).html(t),!0)})},decode:O,encode:B,insertAfter:function(e,t){var r=p(t);return k(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:L,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),gi(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),L(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Xt.trim(e))},run:k,getAttribs:y,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new fo(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,zo.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=y(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!yi.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&yi.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:F,nodeIndex:xi,split:function(e,t,n){var r,o,i,a=F();if(e&&t)return a.setStart(e.parentNode,xi(e)),a.setEnd(t.parentNode,xi(t)),r=a.extractContents(),(a=F()).setStart(t.parentNode,xi(t)+1),a.setEnd(e.parentNode,xi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(jo.trimNode(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(jo.trimNode(V,o),e),P(e),n||t},bind:M,unbind:z,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:U,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=U(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}St.setDocument&&St.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=bi(d,u,function(){return V}),V}(mi=wi||(wi={})).DOM=mi(j.document),mi.nodeIndex=xi;var Ni=wi,Ei=Ni.DOM,Si=Xt.each,Ti=Xt.grep,ki=function(e){return"function"==typeof e},_i=function(){var l={},o=[],i={},a=[],f=0;this.isDone=function(e){return 2===l[e]},this.markDone=function(e){l[e]=2},this.add=this.load=function(e,t,n,r){l[e]===undefined&&(o.push(e),l[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete l[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var u,s=[],c=function(t,e){Si(i[e],function(e){ki(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(u=function(){var e=Ti(n);if(n.length=0,Si(e,function(e){var t,n,r,o,i,a;2!==l[e]?3!==l[e]?1!==l[e]&&(l[e]=1,f++,t=e,n=function(){l[e]=2,f--,c("success",e),u()},r=function(){l[e]=3,f--,s.push(e),c("failure",e),u()},i=(a=Ei).uniqueId(),(o=j.document.createElement("script")).id=i,o.type="text/javascript",o.src=Xt._addCacheSuffix(t),o.onload=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},o.onerror=function(){ki(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(j.document.getElementsByTagName("head")[0]||j.document.body).appendChild(o)):c("failure",e):c("success",e)}),!f){var t=a.slice(0);a.length=0,Si(t,function(e){0===s.length?ki(e.success)&&e.success.call(e.scope):ki(e.failure)&&e.failure.call(e.scope,s)})}})()}};_i.ScriptLoader=new _i;var Ai,Ri=Xt.each;function Di(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s(e);Ri(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(_i))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Di.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(e,t,n,r):_i.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Di.language;if(n&&!1!==Di.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;_i.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=K(i,function(e){return e.name===t});return i=r.fail,Ri(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];Ri(t,function(e){_i.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(Ai=Di||(Di={})).PluginManager=Ai(),Ai.ThemeManager=Ai();var Oi=function(t,n){Ur(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Bi=function(e,t){jr(e).fold(function(){Ur(e).each(function(e){Ii(e,t)})},function(e){Oi(e,t)})},Pi=function(t,n){Kr(t).fold(function(){Ii(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Ii=function(e,t){e.dom().appendChild(t.dom())},Li=function(t,e){z(e,function(e){Ii(t,e)})},Fi=function(e){e.dom().textContent="",z($r(e),function(e){Mi(e)})},Mi=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},zi=function(e){var t,n=$r(e);0<n.length&&(t=e,z(n,function(e){Oi(t,e)})),Mi(e)},Ui=function(n,r){var o=null;return{cancel:function(){null!==o&&(j.clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=j.setTimeout(function(){n.apply(null,e),o=null},r))}}},Vi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Vi(n())}}},ji=function(e,t){var n=wr(e,t);return n===undefined||""===n?[]:n.split(" ")},Hi=function(e){return e.dom().classList!==undefined},qi=function(e,t){return o=t,i=ji(n=e,r="class").concat([o]),Cr(n,r,i.join(" ")),!0;var n,r,o,i},$i=function(e,t){return o=t,0<(i=U(ji(n=e,r="class"),function(e){return e!==o})).length?Cr(n,r,i.join(" ")):Nr(n,r),!1;var n,r,o,i},Wi=function(e,t){Hi(e)?e.dom().classList.add(t):qi(e,t)},Ki=function(e){0===(Hi(e)?e.dom().classList:ji(e,"class")).length&&Nr(e,"class")},Xi=function(e,t){return Hi(e)&&e.dom().classList.contains(t)},Yi=function(e,t){var n=[];return z($r(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Yi(e,t))}),n},Gi=function(e,t){return n=t,o=(r=e)===undefined?j.document:r.dom(),Ir(o)?[]:W(o.querySelectorAll(n),ar.fromDom);var n,r,o};function Ji(e,t,n,r,o){return e(n,r)?_.some(n):D(o)&&o(n)?_.none():t(n,r,o)}var Qi,Zi=function(e,t,n){for(var r=e.dom(),o=D(n)?n:q(!1);r.parentNode;){r=r.parentNode;var i=ar.fromDom(r);if(t(i))return _.some(i);if(o(i))break}return _.none()},ea=function(e,t,n){return Ji(function(e,t){return t(e)},Zi,e,t,n)},ta=function(e,t,n){return Zi(e,function(e){return Pr(e,t)},n)},na=function(e,t){return n=t,o=(r=e)===undefined?j.document:r.dom(),Ir(o)?_.none():_.from(o.querySelector(n)).map(ar.fromDom);var n,r,o},ra=function(e,t,n){return Ji(Pr,ta,e,t,n)},oa=q("mce-annotation"),ia=q("data-mce-annotation"),aa=q("data-mce-annotation-uid"),ua=function(r,e){var t=r.selection.getRng(),n=ar.fromDom(t.startContainer),o=ar.fromDom(r.getBody()),i=e.fold(function(){return"."+oa()},function(e){return"["+ia()+'="'+e+'"]'}),a=Wr(n,t.startOffset).getOr(n),u=ra(a,i,function(e){return Lr(e,o)}),s=function(e,t){return n=t,(r=e.dom())&&r.hasAttribute&&r.hasAttribute(n)?_.some(wr(e,t)):_.none();var n,r};return u.bind(function(e){return s(e,""+aa()).bind(function(n){return s(e,""+ia()).map(function(e){var t=sa(r,n);return{uid:n,name:e,elements:t}})})})},sa=function(e,t){var n=ar.fromDom(e.getBody());return Gi(n,"["+aa()+'="'+t+'"]')},ca=function(i,e){var n,r,o,a=Vi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Vi(_.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=gr(r),(n=B.call(e,0)).sort(t),n);z(o,function(e){u(e,function(u){var s=u.previous.get();return ua(i,_.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){z(e.listeners,function(e){return e(!1,t)})}),u.previous.set(_.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){z(e.listeners,function(e){return e(!0,t,{uid:n,nodes:W(r,function(e){return e.dom()})})})}),u.previous.set(_.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(j.clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&j.clearTimeout(o),o=j.setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},la=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){z(e,function(t){var e;(e=t,_.from(e.attributes.map[ia()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},fa=0,da=function(e,t){return ar.fromDom(e.dom().cloneNode(t))},ma=function(e){return da(e,!1)},ga=function(e){return da(e,!0)},pa=function(e,t){var n,r,o=Mr(e).dom(),i=ar.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||j.document).createElement("div")).innerHTML=n,$r(ar.fromDom(r)));Li(i,a),Fi(e),Ii(e,i)},ha="\ufeff",va=function(e){return e===ha},ya=ha,ba=function(e){return e.replace(new RegExp(ha,"g"),"")},Ca=zo.isElement,xa=zo.isText,wa=function(e){return xa(e)&&(e=e.parentNode),Ca(e)&&e.hasAttribute("data-mce-caret")},Na=function(e){return xa(e)&&va(e.data)},Ea=function(e){return wa(e)||Na(e)},Sa=function(e){return e.firstChild!==e.lastChild||!zo.isBr(e.firstChild)},Ta=function(e){var t=e.container();return!(!e||!zo.isText(t))&&(t.data.charAt(e.offset())===ya||e.isAtStart()&&Na(t.previousSibling))},ka=function(e){var t=e.container();return!(!e||!zo.isText(t))&&(t.data.charAt(e.offset()-1)===ya||e.isAtEnd()&&Na(t.nextSibling))},_a=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=j.document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Aa=function(e){return xa(e)&&e.data[0]===ya},Ra=function(e){return xa(e)&&e.data[e.data.length-1]===ya},Da=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],zo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Oa=zo.isContentEditableTrue,Ba=zo.isContentEditableFalse,Pa=zo.isBr,Ia=zo.isText,La=zo.matchNodeNames("script style textarea"),Fa=zo.matchNodeNames("img input textarea hr iframe video audio object"),Ma=zo.matchNodeNames("table"),za=Ea,Ua=function(e){return!za(e)&&(Ia(e)?!La(e.parentNode):Fa(e)||Pa(e)||Ma(e)||Va(e))},Va=function(e){return!1===(t=e,zo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&Ba(e);var t},ja=function(e,t){return Ua(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Va(e))return!1;if(Oa(e))return!0}return!0}(e,t)},Ha=Math.round,qa=function(e){return e?{left:Ha(e.left),top:Ha(e.top),bottom:Ha(e.bottom),right:Ha(e.right),width:Ha(e.width),height:Ha(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},$a=function(e,t){return e=qa(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},Wa=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},Ka=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&Wa(t.top-e.bottom,e,t)},Xa=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Wa(t.bottom-e.top,e,t)},Ya=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Ga=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},Ja=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},Qa=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),Za=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&Qa.test(e)},eu=function(e,t,n){return e.isSome()&&t.isSome()?_.some(n(e.getOrDie(),t.getOrDie())):_.none()},tu=[].slice,nu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=tu.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},ru=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=tu.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},ou=zo.isElement,iu=Ua,au=zo.matchStyleValues("display","block table"),uu=zo.matchStyleValues("float","left right"),su=nu(ou,iu,y(uu)),cu=y(zo.matchStyleValues("white-space","pre pre-line pre-wrap")),lu=zo.isText,fu=zo.isBr,du=Ni.nodeIndex,mu=Ja,gu=function(e){return"createRange"in e?e.createRange():Ni.DOM.createRng()},pu=function(e){return e&&/[\r\n\t ]/.test(e)},hu=function(e){return!!e.setStart&&!!e.setEnd},vu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(pu(e.toString())&&cu(n.parentNode)&&zo.isText(n)&&(t=n.data,pu(t[r-1])||pu(t[r+1])))},yu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},bu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?qa(n[0]):qa(e.getBoundingClientRect()),!hu(e)&&fu(e)&&yu(t)?(i=(r=e).ownerDocument,a=gu(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=qa(a.getBoundingClientRect()),s.removeChild(u),o):yu(t)&&hu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&zo.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),bu(i)}return null}(e):t},Cu=function(e,t){var n=$a(e,t);return n.width=1,n.right=n.left+1,n},xu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=gu(e.ownerDocument);if(t<e.data.length){if(Za(e.data[t]))return r;if(Za(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!vu(n)))return o(Cu(bu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),vu(n)||o(Cu(bu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),vu(n)||o(Cu(bu(n),!0)))};if(lu(e.container()))return i(e.container(),e.offset()),r;if(ou(e.container()))if(e.isAtEnd())n=mu(e.container(),e.offset()),lu(n)&&i(n,n.data.length),su(n)&&!fu(n)&&o(Cu(bu(n),!1));else{if(n=mu(e.container(),e.offset()),lu(n)&&i(n,0),su(n)&&e.isAtEnd())return o(Cu(bu(n),!1)),r;t=mu(e.container(),e.offset()-1),su(t)&&!fu(t)&&(au(t)||au(n)||!su(n))&&o(Cu(bu(t),!1)),su(n)&&o(Cu(bu(n),!0))}return r};function wu(t,n,e){var r=function(){return e||(e=xu(wu(t,n))),e};return{container:q(t),offset:q(n),toRange:function(){var e;return(e=gu(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return lu(t),0===n},isAtEnd:function(){return lu(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return mu(t,e?n-1:n)}}}(Qi=wu||(wu={})).fromRangeStart=function(e){return Qi(e.startContainer,e.startOffset)},Qi.fromRangeEnd=function(e){return Qi(e.endContainer,e.endOffset)},Qi.after=function(e){return Qi(e.parentNode,du(e)+1)},Qi.before=function(e){return Qi(e.parentNode,du(e))},Qi.isAbove=function(e,t){return eu(Z(t.getClientRects()),ee(e.getClientRects()),Ka).getOr(!1)},Qi.isBelow=function(e,t){return eu(ee(t.getClientRects()),Z(e.getClientRects()),Xa).getOr(!1)},Qi.isAtStart=function(e){return!!e&&e.isAtStart()},Qi.isAtEnd=function(e){return!!e&&e.isAtEnd()},Qi.isTextPosition=function(e){return!!e&&zo.isText(e.container())},Qi.isElementPosition=function(e){return!1===Qi.isTextPosition(e)};var Nu,Eu,Su=wu,Tu=zo.isText,ku=zo.isBogus,_u=Ni.nodeIndex,Au=function(e){var t=e.parentNode;return ku(t)?Au(t):t},Ru=function(e){return e?Ht.reduce(e.childNodes,function(e,t){return ku(t)&&"BR"!==t.nodeName?e=e.concat(Ru(t)):e.push(t),e},[]):[]},Du=function(t){return function(e){return t===e}},Ou=function(e){var t,r,n,o;return(Tu(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Ru(Au(t=e)),n=Ht.findIndex(r,Du(t),t),r=r.slice(0,n+1),o=Ht.reduce(r,function(e,t,n){return Tu(t)&&Tu(r[n-1])&&e++,e},0),r=Ht.filter(r,zo.matchNodeNames(t.nodeName)),(n=Ht.findIndex(r,Du(t),t))-o)+"]"},Bu=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Tu(n)?o=function(e,t){for(;(e=e.previousSibling)&&Tu(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Ou(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=Ht.filter(a,y(zo.isBogus)),(u=u.concat(Ht.map(a,function(e){return Ou(e)}))).reverse().join("/")+","+o},Pu=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=Ht.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Ru(n),i=Ht.filter(i,function(e,t){return!Tu(e)||!Tu(i[t-1])}),(i=Ht.filter(i,zo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?Tu(r)?function(e,t){for(var n,r=e,o=0;Tu(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!Tu(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return Tu(e)&&t>e.data.length&&(t=e.data.length),Su(e,t)}(r,parseInt(o,10)):(o="after"===o?_u(r)+1:_u(r),Su(r.parentNode,o)):null):null},Iu=function(e,t){zo.isText(t)&&0===t.data.length&&e.remove(t)},Lu=function(e,t,n){var r,o,i,a,u,s,c;zo.isDocumentFragment(n)?(i=e,a=t,u=n,s=_.from(u.firstChild),c=_.from(u.lastChild),a.insertNode(u),s.each(function(e){return Iu(i,e.previousSibling)}),c.each(function(e){return Iu(i,e.nextSibling)})):(r=e,o=n,t.insertNode(o),Iu(r,o.previousSibling),Iu(r,o.nextSibling))},Fu=zo.isContentEditableFalse,Mu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(zo.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&zo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},zu=function(e,t,n){var r=0;return Xt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Uu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],zo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},Vu=function(e){return Uu(e,!0),Uu(e,!1),e},ju=function(e,t){var n;if(zo.isElement(e)&&(e=Ja(e,t),Fu(e)))return e;if(Ea(e)){if(zo.isText(e)&&wa(e)&&(e=e.parentNode),n=e.previousSibling,Fu(n))return n;if(n=e.nextSibling,Fu(n))return n}},Hu=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Fu(r)||"IMG"===o)return{name:o,index:zu(n.dom,o,r)};var a,u,s,c,l,f,d,m=ju((a=i).startContainer,a.startOffset)||ju(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:zu(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=Mu(f,u,c,l,!0),s.isCollapsed()||(d.end=Mu(f,u,c,l,!1)),d)},qu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},$u=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:zu(n,u,a)};var s=Vu(r.cloneRange());if(!i){s.collapse(!1);var c=qu(n,o+"_end",t);Lu(n,s,c)}(r=Vu(r)).collapse(!0);var l=qu(n,o+"_start",t);return Lu(n,r,l),e.moveToBookmark({id:o,keep:1}),{id:o}},Wu={getBookmark:function(e,t,n){return 2===t?Hu(ba,n,e):3===t?(o=(r=e).getRng(),{start:Bu(r.dom.getRoot(),Su.fromRangeStart(o)),end:Bu(r.dom.getRoot(),Su.fromRangeEnd(o))}):t?{rng:e.getRng()}:$u(e,!1);var r,o},getUndoBookmark:d(Hu,$,!0),getPersistentBookmark:$u},Ku="_mce_caret",Xu=function(e){return zo.isElement(e)&&e.id===Ku},Yu=function(e,t){for(;t&&t!==e;){if(t.id===Ku)return t;t=t.parentNode}return null},Gu=zo.isElement,Ju=zo.isText,Qu=function(e){var t=e.parentNode;t&&t.removeChild(e)},Zu=function(e,t){0===t.length?Qu(e):e.nodeValue=t},es=function(e){var t=ba(e);return{count:e.length-t.length,text:t}},ts=function(e,t){return os(e),t},ns=function(e,t){var n,r,o,i=t.container(),a=(n=te(i.childNodes),r=e,o=L(n,r),-1===o?_.none():_.some(o)).map(function(e){return e<t.offset()?Su(i,t.offset()-1):t}).getOr(t);return os(e),a},rs=function(e,t){return Ju(e)&&t.container()===e?(r=t,o=es((n=e).data.substr(0,r.offset())),i=es(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(Zu(n,a),Su(n,r.offset()-o.count)):r):ts(e,t);var n,r,o,i,a},os=function(e){if(Gu(e)&&Ea(e)&&(Sa(e)?e.removeAttribute("data-mce-caret"):Qu(e)),Ju(e)){var t=ba(function(e){try{return e.nodeValue}catch(t){return""}}(e));Zu(e,t)}},is={removeAndReposition:function(e,t){return Su.isTextPosition(t)?rs(e,t):(n=e,(r=t).container()===n.parentNode?ns(n,r):ts(n,r));var n,r},remove:os},as=or.detect().browser,us=zo.isContentEditableFalse,ss=function(e,t,n){var r,o,i,a,u,s=$a(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},cs=function(a,u,e){var t,s,c=Vi(_.none()),l=function(){!function(e){var t,n,r,o,i;for(t=gn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Ra(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Aa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(is.remove(s),s=null),c.get().each(function(e){gn(e.caret).remove(),c.set(_.none())}),clearInterval(t)},f=function(){t=he.setInterval(function(){e()?gn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):gn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,zo.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(ya),o=e.parentNode,t){if(n=e.previousSibling,xa(n)){if(Ea(n))return n;if(Ra(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,xa(n)){if(Ea(n))return n;if(Aa(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),us(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=_a("p",e,t),n=ss(a,e,t),gn(s).css("top",n.top);var i=gn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(_.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&gn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss: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;}"},reposition:function(){c.get().each(function(e){var t=ss(a,e.element,e.before);gn(e.caret).css(t)})},destroy:function(){return he.clearInterval(t)}}},ls=function(){return as.isIE()||as.isEdge()||as.isFirefox()},fs=function(e){return us(e)||zo.isTable(e)&&ls()},ds=zo.isContentEditableFalse,ms=zo.matchStyleValues("display","block table table-cell table-caption list-item"),gs=Ea,ps=wa,hs=zo.isElement,vs=Ua,ys=function(e){return 0<e},bs=function(e){return e<0},Cs=function(e,t){for(var n;n=e(t);)if(!ps(n))return n;return null},xs=function(e,t,n,r,o){var i=new fo(e,r);if(bs(t)){if((ds(e)||ps(e))&&n(e=Cs(i.prev,!0)))return e;for(;e=Cs(i.prev,o);)if(n(e))return e}if(ys(t)){if((ds(e)||ps(e))&&n(e=Cs(i.next,!0)))return e;for(;e=Cs(i.next,o);)if(n(e))return e}return null},ws=function(e,t){for(;e&&e!==t;){if(ms(e))return e;e=e.parentNode}return null},Ns=function(e,t,n){return ws(e.container(),n)===ws(t.container(),n)},Es=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),hs(n)?n.childNodes[r+e]:null):null},Ss=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Ts=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],gs(r)&&(r=r[o]),ds(r)){if(a=n,ws(r,i=t)===ws(a,i))return r;break}if(vs(r))break;n=n.parentNode}return null},ks=d(Ss,!0),_s=d(Ss,!1),As=function(e,t,n){var r,o,i,a,u=d(Ts,!0,t),s=d(Ts,!1,t);if(o=n.startContainer,i=n.startOffset,wa(o)){if(hs(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,fs(r)))return ks(r);if("after"===a&&(r=o.previousSibling,fs(r)))return _s(r)}if(!n.collapsed)return n;if(zo.isText(o)){if(gs(o)){if(1===e){if(r=s(o))return ks(r);if(r=u(o))return _s(r)}if(-1===e){if(r=u(o))return _s(r);if(r=s(o))return ks(r)}return n}if(Ra(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?ks(r):n;if(Aa(o)&&i<=1)return-1===e&&(r=u(o))?_s(r):n;if(i===o.data.length)return(r=s(o))?ks(r):n;if(0===i)return(r=u(o))?_s(r):n}return n},Rs=function(e,t){return _.from(Es(e?0:-1,t)).filter(ds)},Ds=function(e,t,n){var r=As(e,t,n);return-1===e?wu.fromRangeStart(r):wu.fromRangeEnd(r)},Os=function(e){return _.from(e.getNode()).map(ar.fromDom)},Bs=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Ps=function(e,t){var n=Ns(e,t);return!(n||!zo.isBr(e.getNode()))||n};(Eu=Nu||(Nu={}))[Eu.Backwards=-1]="Backwards",Eu[Eu.Forwards=1]="Forwards";var Is,Ls,Fs,Ms=zo.isContentEditableFalse,zs=zo.isText,Us=zo.isElement,Vs=zo.isBr,js=Ua,Hs=function(e){return Fa(e)||!!Va(t=e)&&!0!==V(te(t.getElementsByTagName("*")),function(e,t){return e||Oa(t)},!1);var t},qs=ja,$s=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ws=function(e,t){if(ys(e)){if(js(t.previousSibling)&&!zs(t.previousSibling))return Su.before(t);if(zs(t))return Su(t,0)}if(bs(e)){if(js(t.nextSibling)&&!zs(t.nextSibling))return Su.after(t);if(zs(t))return Su(t,t.data.length)}return bs(e)?Vs(t)?Su.before(t):Su.after(t):Su.before(t)},Ks=function(e,t,n){var r,o,i,a,u;if(!Us(n)||!t)return null;if(t.isEqual(Su.after(n))&&n.lastChild){if(u=Su.after(n.lastChild),bs(e)&&js(n.lastChild)&&Us(n.lastChild))return Vs(n.lastChild)?Su.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(zs(f)){if(bs(e)&&0<d)return Su(f,--d);if(ys(e)&&d<f.length)return Su(f,++d);r=f}else{if(bs(e)&&0<d&&(o=$s(f,d-1),js(o)))return!Hs(o)&&(i=xs(o,e,qs,o))?zs(i)?Su(i,i.data.length):Su.after(i):zs(o)?Su(o,o.data.length):Su.before(o);if(ys(e)&&d<f.childNodes.length&&(o=$s(f,d),js(o)))return Vs(o)?(s=n,(l=(c=o).nextSibling)&&js(l)?zs(l)?Su(l,0):Su.before(l):Ks(Nu.Forwards,Su.after(c),s)):!Hs(o)&&(i=xs(o,e,qs,o))?zs(i)?Su(i,0):Su.before(i):zs(o)?Su(o,0):Su.after(o);r=o||u.getNode()}return(ys(e)&&u.isAtEnd()||bs(e)&&u.isAtStart())&&(r=xs(r,e,q(!0),n,!0),qs(r,n))?Ws(e,r):(o=xs(r,e,qs,n),!(a=Ht.last(U(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),Ms)))||o&&a.contains(o)?o?Ws(e,o):null:u=ys(e)?Su.after(a):Su.before(a))},Xs=function(t){return{next:function(e){return Ks(Nu.Forwards,e,t)},prev:function(e){return Ks(Nu.Backwards,e,t)}}},Ys=function(e){return Su.isTextPosition(e)?0===e.offset():Ua(e.getNode())},Gs=function(e){if(Su.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Ua(e.getNode(!0))},Js=function(e,t){return!Su.isTextPosition(e)&&!Su.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Qs=function(e,t,n){return e?!Js(t,n)&&(r=t,!(!Su.isTextPosition(r)&&zo.isBr(r.getNode())))&&Gs(t)&&Ys(n):!Js(n,t)&&Ys(t)&&Gs(n);var r},Zs=function(e,t,n){var r=Xs(t);return _.from(e?r.next(n):r.prev(n))},ec=function(t,n,r){return Zs(t,n,r).bind(function(e){return Ns(r,e,n)&&Qs(t,r,e)?Zs(t,n,e):_.some(e)})},tc=function(t,n,e,r){return ec(t,n,e).bind(function(e){return r(e)?tc(t,n,e,r):_.some(e)})},nc=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return zo.isText(u)?_.some(Su(u,e?0:u.data.length)):u?Ua(u)?_.some(e?Su.before(u):(a=u,zo.isBr(a)?Su.before(a):Su.after(a))):(r=t,o=u,i=(n=e)?Su.before(o):Su.after(o),Zs(n,r,i)):_.none()},rc=d(Zs,!0),oc=d(Zs,!1),ic={fromPosition:Zs,nextPosition:rc,prevPosition:oc,navigate:ec,navigateIgnore:tc,positionIn:nc,firstPositionIn:d(nc,!0),lastPositionIn:d(nc,!1)},ac=function(e,t){return zo.isElement(t)&&e.isBlock(t)&&!t.innerHTML&&!fe.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},uc=function(e,t){return ic.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},sc=function(e,t,n){return!(!1!==t.hasChildNodes()||!Yu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(ya),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},cc=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,sc(c,i,r))return!0;if(s[o]>u.length-1)return!!sc(c,i,r)||uc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},lc=function(e){return zo.isText(e)&&0<e.data.length},fc=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):lc(c.nextSibling)?(r=c.nextSibling,o=0):lc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):lc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Xt.each(Xt.grep(c.childNodes),function(e){zo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&zo.isText(a)&&!fe.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return _.some(Su(u,s))}return _.none()},dc=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,y=e.dom;if(t){if(v=t,Xt.isArray(v.start))return p=t,h=(g=y).createRng(),cc(g,!0,p,h)&&cc(g,!1,p,h)?_.some(h):_.none();if("string"==typeof t.start)return _.some((f=t,d=(l=y).createRng(),m=Pu(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Pu(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=fc(o=y,"start",i=t),c=fc(o,"end",i),eu(s,(u=s,(a=c).isSome()?a:u),function(e,t){var n=o.createRng();return n.setStart(ac(o,e.container()),e.offset()),n.setEnd(ac(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=y,r=t,_.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return _.some(t.rng)}return _.none()},mc=function(e,t,n){return Wu.getBookmark(e,t,n)},gc=function(t,e){dc(t,e).each(function(e){t.setRng(e)})},pc=function(e){return zo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},hc=function(e){return e&&/^(IMG)$/.test(e.nodeName)},vc=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},yc=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},bc={isInlineBlock:hc,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!hc(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new fo(u=i[a],e.getParent(u,e.isBlock)):(r=new fo(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!vc(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!vc(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:vc,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:yc,getStyle:function(e,t,n){return yc(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Cc=pc,xc=bc.getParents,wc=bc.isWhiteSpaceNode,Nc=bc.isTextBlock,Ec=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Sc=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Tc=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1!==(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)&&!t&&(o<r||!e)&&o<=a.length&&o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},kc=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Tc(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new fo(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||Cc(u.parentNode)){if(e.isBlock(u)||bc.isEq(u,"BR"))break}else if(-1!==(s=Tc(o,i,c=u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},_c=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=xc(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Ac=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&Nc(t,e)},u)}if(o&&e[0].wrapper&&(o=xc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!bc.isEq(o,"br")););return o||n},Rc=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!wc(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!Cc(c)&&!wc(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Dc=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=Ja(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=Ja(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Sc(c,i),u=Sc(c,u),(Cc(i.parentNode)||Cc(i))&&(i=Cc(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(Cc(u.parentNode)||Cc(u))&&(u=Cc(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=kc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=kc(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=Ec(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Ec(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Rc(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Rc(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=_c(c,n,t,i,"previousSibling"),u=_c(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Ac(e,n,i,"previousSibling"),u=Ac(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Rc(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Rc(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Oc=Xt.each,Bc=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Oc(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},y=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},b=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=y(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=b(l,n)||l,i=b(d,n)||d,C(l,r,!0),(s=y(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Pc=(Is=mr,Ls="text",{get:function(e){if(!Is(e))throw new Error("Can only get "+Ls+" value of a "+Ls+" node");return Fs(e).getOr("")},getOption:Fs=function(e){return Is(e)?_.from(e.dom().nodeValue):_.none()},set:function(e,t){if(!Is(e))throw new Error("Can only set raw "+Ls+" value of a "+Ls+" node");e.dom().nodeValue=t}}),Ic=function(e){return Pc.get(e)},Lc=function(r,o,i,a){return Ur(o).fold(function(){return"skipping"},function(e){return"br"===a||mr(n=o)&&"\ufeff"===Ic(n)?"valid":dr(t=o)&&Xi(t,oa())?"existing":Xu(o)?"caret":bc.isValid(r,i,a)&&bc.isValid(r,lr(e),i)?"valid":"invalid-child";var t,n})},Fc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++fa+String(i)):a,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),c=ar.fromTag("span",e);Wi(c,oa()),Cr(c,""+aa(),u),Cr(c,""+ia(),n);var l,f=r(u,s),d=f.attributes,m=void 0===d?{}:d,g=f.classes,p=void 0===g?[]:g;return xr(c,m),l=c,z(p,function(e){Wi(l,e)}),c},Mc=function(i,e,t,n,r){var a=[],u=Fc(i.getDoc(),r,t,n),s=Vi(_.none()),c=function(){s.set(_.none())},l=function(e){z(e,o)},o=function(e){var t,n;switch(Lc(i,e,"span",lr(e))){case"invalid-child":c();var r=$r(e);l(r),c();break;case"valid":var o=s.get().getOrThunk(function(){var e=ma(u);return a.push(e),s.set(_.some(e)),e});Oi(t=e,n=o),Ii(n,t)}};return Bc(i.dom,e,function(e){var t;c(),t=W(e,ar.fromDom),l(t)}),a},zc=function(s,c,l,f){s.undoManager.transact(function(){var e,t,n,r,o=s.selection.getRng();if(o.collapsed&&(r=Dc(e=s,t=o,[{inline:!0}],3===(n=t).startContainer.nodeType&&n.startContainer.nodeValue.length>=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Fc(s.getDoc(),f,c,l.decorate);pa(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=Wu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();Mc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Uc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?_.from(n[e]).map(function(e){return e.settings}):_.none()}});la(s,r);var o=ca(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){zc(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ua(s,_.some(e)).each(function(e){var t=e.elements;z(t,zi)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=ar.fromDom(t.getBody()),o=Gi(r,"["+ia()+'="'+n+'"]'),i={},z(o,function(e){var t=wr(e,aa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return W(e,function(e){return e.dom()})},vr(u,function(e,t){return{k:t,v:a(e,t)}})}}}var Vc=function(e){return Xt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},jc=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||zo.isBr(t));var t},Hc=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||jc(t))?e.slice(0,-1):e;var t},qc=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},$c=function(e,t){var n=Su.after(e),r=Xs(t).prev(n);return r?r.toRange():null},Wc=function(t,e,n){var r,o,i,a,u=t.parentNode;return Xt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=Su.before(r),(a=Xs(o).next(i))?a.toRange():null},Kc=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},Xc=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,y,b,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=qc(o,i.startContainer),S=Hc(Vc(N.firstChild)),T=o.getRoot(),k=function(e){var t=Su.fromRangeStart(i),n=Xs(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||qc(o,r.getNode())!==E};return k(1)?Wc(E,S,T):k(2)?(f=E,d=S,m=T,o.insertAfter(d.reverse(),f),$c(d[0],m)):(p=S,h=T,v=g=E,b=(y=i).cloneRange(),C=y.cloneRange(),b.setStartBefore(v),C.setEndAfter(v),x=[b.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Xt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),$c(p[p.length-1],h))},Yc=function(e,t){return!!qc(e,t)},Gc=Xt.each,Jc=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Gc(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||pc(e)||pc(t))}},Qc=function(e){var t=Gi(e,"br"),n=U(function(e){for(var t=[],n=e.dom();n;)t.push(ar.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Co);t.length===n.length&&z(n,Mi)},Zc=function(e){Fi(e),Ii(e,ar.fromHtml('<br data-mce-bogus="1">'))},el=function(n){Xr(n).each(function(t){Vr(t).each(function(e){yo(n)&&Co(t)&&yo(e)&&Mi(t)})})},tl=Xt.makeMap;function nl(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=tl(e.indent_before||""),c=tl(e.indent_after||""),l=Zo.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function rl(t,g){void 0===g&&(g=li());var p=nl(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var ol,il=function(a){var u=Su.fromRangeStart(a),s=Su.fromRangeEnd(a),c=a.commonAncestorContainer;return ic.fromPosition(!1,c,s).map(function(e){return!Ns(u,s,c)&&Ns(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=j.document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},al=function(e){return e.collapsed?e:il(e)},ul=zo.matchNodeNames("td th"),sl=function(e,t){var n,r,o=e.selection.getRng(),i=o.startContainer,a=o.startOffset;o.collapsed&&(n=i,r=a,zo.isText(n)&&"\xa0"===n.nodeValue[r-1])&&zo.isText(i)&&(i.insertData(a-1," "),i.deleteData(a,1),o.setStart(i,a),o.setEnd(i,a),e.selection.setRng(o)),e.selection.setContent(t)},cl=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=e.selection,p=e.dom;if(/^ | $/.test(t)&&(t=function(e,t){var n,r;n=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?t=t.replace(/^ /," "):o("previousSibling")||(t=t.replace(/^ /," ")),r<n.length?t=t.replace(/ (<br>|)$/," "):o("nextSibling")||(t=t.replace(/( | )(<br>|)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=rl({validate:e.settings.validate},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">​</span>',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,x,w=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(al(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),y=e.selection.getRng(),b=t,C=y.startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(b)||(b+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var E,S,T,k={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Kc(e.schema,u)&&Yc(p,i))return l=Xc(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(sl(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):sl(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Jc(r);Xt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),fe.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),ul(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=Su.fromRangeStart(e);if(t=Xs(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Xt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,T=e.selection.getStart(),_.from(S.getParent(T,"td,th")).map(ar.fromDom).each(el),e.fire("SetContent",s),e.addVisual()}},ll=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Xt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};cl(e,o.content,o.details)},fl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,dl=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},ml=function(e){return e.getParam("iframe_attrs",{})},gl=function(e){return e.getParam("doctype","<!DOCTYPE html>")},pl=function(e){return e.getParam("document_base_url","")},hl=function(e){return dl(e,"body_id","tinymce")},vl=function(e){return dl(e,"body_class","")},yl=function(e){return e.getParam("content_security_policy","")},bl=function(e){return e.getParam("br_in_pre",!0)},Cl=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},xl=function(e){return e.getParam("forced_root_block_attrs",{})},wl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Nl=function(e){return e.getParam("no_newline_selector","")},El=function(e){return e.getParam("keep_styles",!0)},Sl=function(e){return e.getParam("end_container_on_empty_block",!1)},Tl=function(e){return Xt.explode(e.getParam("font_size_style_values",""))},kl=function(e){return Xt.explode(e.getParam("font_size_classes",""))},_l=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},Al=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Rl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Dl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Ol=function(e){return e.getParam("images_upload_url","","string")},Bl=function(e){return e.getParam("images_upload_base_path","","string")},Pl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Il=function(e){return e.getParam("images_upload_handler",null,"function")},Ll=function(e){return e.getParam("content_css_cors",!1,"boolean")},Fl=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},Ml=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Na(n)?zo.isText(n.nextSibling)?Su(n.nextSibling,0):Su.after(n):Ta(t)?Su(n,r+1):t:Na(n)?zo.isText(n.previousSibling)?Su(n.previousSibling,n.previousSibling.data.length):Su.before(n):ka(t)?Su(n,r-1):t},zl={isInlineTarget:function(e,t){return Pr(ar.fromDom(t),Fl(e))},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(Ni.DOM.getParents(i.container(),"*",o),r));return _.from(a[a.length-1])},isRtl:function(e){return"rtl"===Ni.DOM.getStyle(e,"direction",!0)||(t=e.textContent,fl.test(t));var t},isAtZwsp:function(e){return Ta(e)||ka(e)},normalizePosition:Ml,normalizeForwards:d(Ml,!0),normalizeBackwards:d(Ml,!1),hasSameParentBlock:function(e,t,n){var r=ws(t,e),o=ws(n,e);return r&&r===o}},Ul=function(e,t){return Fr(e,t)?ea(t,function(e){return xo(e)||No(e)},(n=e,function(e){return Lr(n,ar.fromDom(e.dom().parentNode))})):_.none();var n},Vl=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},jl=function(i,a,u){return eu(ic.firstPositionIn(u),ic.lastPositionIn(u),function(e,t){var n=zl.normalizePosition(!0,e),r=zl.normalizePosition(!1,t),o=zl.normalizePosition(!1,a);return i?ic.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):ic.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Hl=function(e,t){var n,r,o,i=ar.fromDom(e),a=ar.fromDom(t);return n=a,r="pre,code",o=d(Lr,i),ta(n,r,o).isSome()},ql=function(e,t){return Ua(t)&&!1===(r=e,o=t,zo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Hl(r,o))||(n=t,zo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||$l(t);var n,r,o},$l=zo.hasAttribute("data-mce-bookmark"),Wl=zo.hasAttribute("data-mce-bogus"),Kl=zo.hasAttributeValue("data-mce-bogus","all"),Xl=function(e){return function(e){var t,n,r=0;if(ql(e,e))return!1;if(!(n=e.firstChild))return!0;t=new fo(n,e);do{if(Kl(n))n=t.next(!0);else if(Wl(n))n=t.next();else if(zo.isBr(n))r++,n=t.next();else{if(ql(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Yl=kr("block","position"),Gl=kr("from","to"),Jl=function(e,t){var n=ar.fromDom(e),r=ar.fromDom(t.container());return Ul(n,r).map(function(e){return Yl(e,t)})},Ql=function(o,i,e){var t=Jl(o,Su.fromRangeStart(e)),n=t.bind(function(e){return ic.fromPosition(i,o,e.position()).bind(function(e){return Jl(o,e).map(function(e){return t=o,n=i,r=e,zo.isBr(r.position().getNode())&&!1===Xl(r.block())?ic.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?ic.fromPosition(n,t,e).bind(function(e){return Jl(t,e)}):_.some(r)}).getOr(r):r;var t,n,r})})});return eu(t,n,Gl).filter(function(e){return!1===Lr((r=e).from().block(),r.to().block())&&Ur((n=e).from().block()).bind(function(t){return Ur(n.to().block()).filter(function(e){return Lr(t,e)})}).isSome()&&(t=e,!1===zo.isContentEditableFalse(t.from().block().dom())&&!1===zo.isContentEditableFalse(t.to().block().dom()));var t,n,r})},Zl=function(e,t,n){return n.collapsed?Ql(e,t,n):_.none()},ef=function(e,t,n){return Fr(t,e)?function(e,t){for(var n=D(t)?t:b,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=ar.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Lr(e,t)}).slice(0,-1):[]},tf=function(e,t){return ef(e,t,q(!1))},nf=tf,rf=function(e,t){return[e].concat(tf(e,t))},of=function(e){var t,n=(t=$r(e),Y(t,yo).fold(function(){return t},function(e){return t.slice(0,e)}));return z(n,Mi),n},af=function(e,t){var n=rf(t,e);return X(n.reverse(),Xl).each(Mi)},uf=function(e,t,n,r){if(Xl(n))return Zc(n),ic.firstPositionIn(n.dom());0===U(Hr(r),function(e){return!Xl(e)}).length&&Xl(t)&&Oi(r,ar.fromTag("br"));var o=ic.prevPosition(n.dom(),Su.before(r.dom()));return z(of(t),function(e){Oi(r,e)}),af(e,t),o},sf=function(e,t,n){if(Xl(n))return Mi(n),Xl(t)&&Zc(t),ic.firstPositionIn(t.dom());var r=ic.lastPositionIn(n.dom());return z(of(t),function(e){Ii(n,e)}),af(e,t),r},cf=function(e,t){return Fr(t,e)?(n=rf(e,t),_.from(n[n.length-1])):_.none();var n},lf=function(e,t){ic.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(ar.fromDom).filter(Co).each(Mi)},ff=function(e,t,n){return lf(!0,t),lf(!1,n),cf(t,n).fold(d(sf,e,t,n),d(uf,e,t,n))},df=function(e,t,n,r){return t?ff(e,r,n):ff(e,n,r)},mf=function(t,n){var e,r=ar.fromDom(t.getBody());return(e=Zl(r.dom(),n,t.selection.getRng()).bind(function(e){return df(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},gf=function(e,t){var n=ar.fromDom(t),r=d(Lr,e);return Zi(n,To,r).isSome()},pf=function(e,t){var n,r,o=ic.prevPosition(e.dom(),Su.fromRangeStart(t)).isNone(),i=ic.nextPosition(e.dom(),Su.fromRangeEnd(t)).isNone();return!(gf(n=e,(r=t).startContainer)||gf(n,r.endContainer))&&o&&i},hf=function(e){var n,r,o,t,i=ar.fromDom(e.getBody()),a=e.selection.getRng();return pf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),eu(Ul(n,ar.fromDom(o.startContainer)),Ul(n,ar.fromDom(o.endContainer)),function(e,t){return!1===Lr(e,t)&&(o.deleteContents(),df(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},vf=function(e,t){return!e.selection.isCollapsed()&&hf(e)},yf=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=gr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=gr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return F(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){j.console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},bf=function(e){return Os(e).exists(Co)},Cf=function(e,t,n){var r=U(rf(ar.fromDom(n.container()),t),yo),o=Z(r).getOr(t);return ic.fromPosition(e,o.dom(),n).filter(bf)},xf=function(e,t){return Os(t).exists(Co)||Cf(!0,e,t).isSome()},wf=function(e,t){return(n=t,_.from(n.getNode(!0)).map(ar.fromDom)).exists(Co)||Cf(!1,e,t).isSome();var n},Nf=d(Cf,!1),Ef=d(Cf,!0),Sf=(ol="\xa0",function(e){return ol===e}),Tf=function(e){return/^[\r\n\t ]$/.test(e)},kf=function(e){return!Tf(e)&&!Sf(e)},_f=function(n,r,o){return _.from(o.container()).filter(zo.isText).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Af=d(_f,!0,Tf),Rf=d(_f,!1,Tf),Df=function(e){var t=e.container();return zo.isText(t)&&0===t.data.length},Of=function(e,t){var n=Es(e,t);return zo.isContentEditableFalse(n)&&!zo.isBogusAll(n)},Bf=d(Of,0),Pf=d(Of,-1),If=function(e,t){return zo.isTable(Es(e,t))},Lf=d(If,0),Ff=d(If,-1),Mf=yf([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),zf=function(e,t,n,r){var o=r.getNode(!1===t);return Ul(ar.fromDom(e),ar.fromDom(n.getNode())).map(function(e){return Xl(e)?Mf.remove(e.dom()):Mf.moveToElement(o)}).orThunk(function(){return _.some(Mf.moveToElement(o))})},Uf=function(u,s,c){return ic.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),To(ar.fromDom(a))||No(ar.fromDom(a))?_.none():(t=u,o=e,i=function(e){return bo(ar.fromDom(e))&&!Ns(r,o,t)},Rs(!(n=s),r=c).fold(function(){return Rs(n,o).fold(q(!1),i)},i)?_.none():s&&zo.isContentEditableFalse(e.getNode())?zf(u,s,c,e):!1===s&&zo.isContentEditableFalse(e.getNode(!0))?zf(u,s,c,e):s&&Pf(c)?_.some(Mf.moveToPosition(e)):!1===s&&Bf(c)?_.some(Mf.moveToPosition(e)):_.none());var t,n,r,o,i,a})},Vf=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",zo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&zo.isContentEditableFalse(n.nextSibling)?_.some(Mf.moveToElement(n.nextSibling)):!1===t&&zo.isContentEditableFalse(n.previousSibling)?_.some(Mf.moveToElement(n.previousSibling)):_.none()).fold(function(){return Uf(r,e,o)},_.some):Uf(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return _.some(Mf.remove(e))},function(e){return _.some(Mf.moveToElement(e))},function(e){return Ns(n,e,t)?_.none():_.some(Mf.moveToPosition(e))});var t,n});var t,n,i,a,u},jf=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,V((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},Hf=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return jf(e,t,o)},qf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Su.isTextPosition(n)&&o===r.parentNode&&i>Su.before(r).offset()?Su(t.container(),t.offset()-1):t;var n,r,o,i},$f=function(e){return Ua(e.previousSibling)?_.some((t=e.previousSibling,zo.isText(t)?Su(t,t.data.length):Su.after(t))):e.previousSibling?ic.lastPositionIn(e.previousSibling):_.none();var t},Wf=function(e){return Ua(e.nextSibling)?_.some((t=e.nextSibling,zo.isText(t)?Su(t,0):Su.before(t))):e.nextSibling?ic.firstPositionIn(e.nextSibling):_.none();var t},Kf=function(r,o){return $f(o).orThunk(function(){return Wf(o)}).orThunk(function(){return e=r,t=o,n=Su.before(t.previousSibling?t.previousSibling:t.parentNode),ic.prevPosition(e,n).fold(function(){return ic.nextPosition(e,Su.after(t))},_.some);var e,t,n})},Xf=function(n,r){return Wf(r).orThunk(function(){return $f(r)}).orThunk(function(){return e=n,t=r,ic.nextPosition(e,Su.after(t)).fold(function(){return ic.prevPosition(e,Su.before(t))},_.some);var e,t})},Yf=function(e,t,n){return(r=e,o=t,i=n,r?Xf(o,i):Kf(o,i)).map(d(qf,n));var r,o,i},Gf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},Jf=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(lr(t))},Qf=function(e){if(Xl(e)){var t=ar.fromHtml('<br data-mce-bogus="1">');return Fi(e),Ii(e,t),_.some(Su.before(t.dom()))}return _.none()},Zf=function(e,t,l){var n,r,o,i,a=Vr(e).filter(mr),u=jr(e).filter(mr);return Mi(e),(n=a,r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Jn((r=u).data).length,r.appendData(o.data),Mi(ar.fromDom(o)),i&&Hf(r,a),n.container()===s?Su(u,c):n},n.isSome()&&r.isSome()&&o.isSome()?_.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):_.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Jn(r).length,jf(t,n-o,o);var t,n,r,o}),u.each(function(e){return Hf(e.dom(),0)})),t})},ed=function(e,t){return n=e.schema.getTextInlineElements(),r=lr(t),pr.call(n,r);var n,r},td=function(t,n,e,r){void 0===r&&(r=!0);var o,i=Yf(n,t.getBody(),e.dom()),a=Zi(e,d(Jf,t),(o=t.getBody(),function(e){return e.dom()===o})),u=Zf(e,i,ed(t,e));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(Qf).fold(function(){r&&Gf(t,n,u)},function(e){r&&Gf(t,n,_.some(e))})},nd=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=As(t?1:-1,e,n),o=Su.fromRangeStart(r),i=ar.fromDom(e),!1===t&&Pf(o)?_.some(Mf.remove(o.getNode(!0))):t&&Bf(o)?_.some(Mf.remove(o.getNode())):!1===t&&Bf(o)&&wf(i,o)?Nf(i,o).map(function(e){return Mf.remove(e.getNode())}):t&&Pf(o)&&xf(i,o)?Ef(i,o).map(function(e){return Mf.remove(e.getNode())}):Vf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),td(o,i,ar.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Su.before(e):Su.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},rd=function(e,t){var n,r=e.selection.getNode();return!!zo.isContentEditableFalse(r)&&(n=ar.fromDom(e.getBody()),z(Gi(n,".mce-offscreen-selection"),Mi),td(e,t,ar.fromDom(e.selection.getNode())),Vl(e),!0)},od=function(e,t){return e.selection.isCollapsed()?nd(e,t):rd(e,t)},id=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(zo.isContentEditableTrue(t)||zo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return zo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Su.before(t).toRange())),!0},ad=zo.isText,ud=function(e){return ad(e)&&e.data[0]===ya},sd=function(e){return ad(e)&&e.data[e.data.length-1]===ya},cd=function(e){return e.ownerDocument.createTextNode(ya)},ld=function(e,t){return e?function(e){if(ad(e.previousSibling))return sd(e.previousSibling)||e.previousSibling.appendData(ya),e.previousSibling;if(ad(e))return ud(e)||e.insertData(0,ya),e;var t=cd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(ad(e.nextSibling))return ud(e.nextSibling)||e.nextSibling.insertData(0,ya),e.nextSibling;if(ad(e))return sd(e)||e.appendData(ya),e;var t=cd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},fd=d(ld,!0),dd=d(ld,!1),md=function(e,t){return zo.isText(e.container())?ld(t,e.container()):ld(t,e.getNode())},gd=function(e,t){var n=t.get();return n&&e.container()===n&&Na(n)},pd=function(n,e){return e.fold(function(e){is.remove(n.get());var t=fd(e);return n.set(t),_.some(Su(t,t.length-1))},function(e){return ic.firstPositionIn(e).map(function(e){if(gd(e,n))return Su(n.get(),1);is.remove(n.get());var t=md(e,!0);return n.set(t),Su(t,1)})},function(e){return ic.lastPositionIn(e).map(function(e){if(gd(e,n))return Su(n.get(),n.get().length-1);is.remove(n.get());var t=md(e,!1);return n.set(t),Su(t,t.length-1)})},function(e){is.remove(n.get());var t=dd(e);return n.set(t),_.some(Su(t,1))})},hd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return _.none()},vd=yf([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),yd=function(e,t){var n=ws(t,e);return n||e},bd=function(e,t,n){var r=zl.normalizeForwards(n),o=yd(t,r.container());return zl.findRootInline(e,o,r).fold(function(){return ic.nextPosition(o,r).bind(d(zl.findRootInline,e,o)).map(function(e){return vd.before(e)})},_.none)},Cd=function(e,t){return null===Yu(e,t)},xd=function(e,t,n){return zl.findRootInline(e,t,n).filter(d(Cd,t))},wd=function(e,t,n){var r=zl.normalizeBackwards(n);return xd(e,t,r).bind(function(e){return ic.prevPosition(e,r).isNone()?_.some(vd.start(e)):_.none()})},Nd=function(e,t,n){var r=zl.normalizeForwards(n);return xd(e,t,r).bind(function(e){return ic.nextPosition(e,r).isNone()?_.some(vd.end(e)):_.none()})},Ed=function(e,t,n){var r=zl.normalizeBackwards(n),o=yd(t,r.container());return zl.findRootInline(e,o,r).fold(function(){return ic.prevPosition(o,r).bind(d(zl.findRootInline,e,o)).map(function(e){return vd.after(e)})},_.none)},Sd=function(e){return!1===zl.isRtl(kd(e))},Td=function(e,t,n){return hd([bd,wd,Nd,Ed],[e,t,n]).filter(Sd)},kd=function(e){return e.fold($,$,$,$)},_d=function(e){return e.fold(q("before"),q("start"),q("end"),q("after"))},Ad=function(e){return e.fold(vd.before,vd.before,vd.after,vd.after)},Rd=function(n,e,r,t,o,i){return eu(zl.findRootInline(e,r,t),zl.findRootInline(e,r,o),function(e,t){return e!==t&&zl.hasSameParentBlock(r,e,t)?vd.after(n?e:t):i}).getOr(i)},Dd=function(e,r){return e.fold(q(!0),function(e){return n=r,!(_d(t=e)===_d(n)&&kd(t)===kd(n));var t,n})},Od=function(e,t){return e?t.fold(H(_.some,vd.start),_.none,H(_.some,vd.after),_.none):t.fold(_.none,H(_.some,vd.before),_.none,H(_.some,vd.end))},Bd=function(a,u,s,c){var e=zl.normalizePosition(a,c),l=Td(u,s,e);return Td(u,s,e).bind(d(Od,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=zl.normalizePosition(t,e),ic.fromPosition(t,r,i).map(d(zl.normalizePosition,t)).fold(function(){return o.map(Ad)},function(e){return Td(n,r,e).map(d(Rd,t,n,r,i,e)).filter(d(Dd,o))}).filter(Sd);var t,n,r,o,e,i})},Pd=Td,Id=Bd,Ld=(d(Bd,!1),d(Bd,!0),Ad),Fd=function(e){return e.fold(vd.start,vd.start,vd.end,vd.end)},Md=function(e){return D(e.selection.getSel().modify)},zd=function(e,t,n){var r=e?1:-1;return t.setRng(Su(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Ud=function(e,t){var n=t.selection.getRng(),r=e?Su.fromRangeEnd(n):Su.fromRangeStart(n);return!!Md(t)&&(e&&Ta(r)?zd(!0,t.selection,r):!(e||!ka(r))&&zd(!1,t.selection,r))},Vd=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},jd=function(e){return!1!==e.settings.inline_boundaries},Hd=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},qd=function(t,e,n){return pd(e,n).map(function(e){return Vd(t,e),n})},$d=function(e,t,n){return function(){return!!jd(t)&&Ud(e,t)}},Wd={move:function(a,u,s){return function(){return!!jd(a)&&(t=a,n=u,e=s,r=t.getBody(),o=Su.fromRangeStart(t.selection.getRng()),i=d(zl.isInlineTarget,t),Id(e,i,r,o).bind(function(e){return qd(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:d($d,!0),movePrevWord:d($d,!1),setupSelectedState:function(a){var u=Vi(null),s=d(zl.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;jd(a)&&(t=s,n=a.dom,r=e.parents,o=U(n.select('*[data-mce-selected="inline-boundary"]'),t),i=U(r,t),z(Q(o,i),d(Hd,!1)),z(Q(i,o),d(Hd,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Su.fromRangeStart(e.selection.getRng());Su.isTextPosition(n)&&!1===zl.isAtZwsp(n)&&(Vd(e,is.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=U(e,n);z(t,function(e){var t=Su.fromRangeStart(r.selection.getRng());Pd(n,r.getBody(),t).bind(function(e){return qd(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:Vd},Kd=function(t,n){return function(e){return pd(n,e).map(function(e){return Wd.setCaretPosition(t,e),!0}).getOr(!1)}},Xd=function(r,o,i,a){var u=r.getBody(),s=d(zl.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=j.document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),Pd(s,u,Su.fromRangeStart(r.selection.getRng())).map(Fd).map(Kd(r,o))}),r.nodeChanged()},Yd=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),ws(t,e)||e),u=d(zl.isInlineTarget,n),s=Pd(u,a,o);return s.bind(function(e){return i?e.fold(q(_.some(Fd(e))),_.none,q(_.some(Ld(e))),_.none):e.fold(_.none,q(_.some(Ld(e))),_.none,q(_.some(Fd(e))))}).map(Kd(n,r)).getOrThunk(function(){var t=ic.navigate(i,a,o),e=t.bind(function(e){return Pd(u,a,e)});return s.isSome()&&e.isSome()?zl.findRootInline(u,a,o).map(function(e){return o=e,!!eu(ic.firstPositionIn(o),ic.lastPositionIn(o),function(e,t){var n=zl.normalizePosition(!0,e),r=zl.normalizePosition(!1,t);return ic.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(td(n,i,ar.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?Xd(n,r,o,e):Xd(n,r,e,o),!0})}).getOr(!1)})},Gd=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=Su.fromRangeStart(e.selection.getRng());return Yd(e,t,n,r)}return!1},Jd=kr("start","end"),Qd=kr("rng","table","cells"),Zd=yf([{removeTable:["element"]},{emptyCells:["cells"]}]),em=function(e,t){return ra(ar.fromDom(e),"td,th",t)},tm=function(e,t){return ta(e,"table",t)},nm=function(e){return!1===Lr(e.start(),e.end())},rm=function(e,n){return tm(e.start(),n).bind(function(t){return tm(e.end(),n).bind(function(e){return Lr(t,e)?_.some(t):_.none()})})},om=function(e){return Gi(e,"td,th")},im=function(r,e){var t=em(e.startContainer,r),n=em(e.endContainer,r);return e.collapsed?_.none():eu(t,n,Jd).fold(function(){return t.fold(function(){return n.bind(function(t){return tm(t,r).bind(function(e){return Z(om(e)).map(function(e){return Jd(e,t)})})})},function(t){return tm(t,r).bind(function(e){return ee(om(e)).map(function(e){return Jd(t,e)})})})},function(e){return am(r,e)?_.none():(n=r,tm((t=e).start(),n).bind(function(e){return ee(om(e)).map(function(e){return Jd(t.start(),e)})}));var t,n})},am=function(e,t){return rm(t,e).isSome()},um=function(e,t){var n,r,o,i,a=d(Lr,e);return(n=t,r=a,o=em(n.startContainer,r),i=em(n.endContainer,r),eu(o,i,Jd).filter(nm).filter(function(e){return am(r,e)}).orThunk(function(){return im(r,n)})).bind(function(e){return rm(t=e,a).map(function(e){return Qd(t,e,om(e))});var t})},sm=function(e,t){return Y(e,function(e){return Lr(e,t)})},cm=function(n){return(r=n,eu(sm(r.cells(),r.rng().start()),sm(r.cells(),r.rng().end()),function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?Zd.removeTable(n.table()):Zd.emptyCells(e)});var r},lm=function(e,t){return um(e,t).bind(cm)},fm=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},dm=fm,mm=function(e){return G(e,function(e){var t=Ga(e);return t?[ar.fromDom(t)]:[]})},gm=function(e){return 1<fm(e).length},pm=function(e){return U(mm(e),To)},hm=function(e){return Gi(e,"td[data-mce-selected],th[data-mce-selected]")},vm=function(e,t){var n=hm(t),r=pm(e);return 0<n.length?n:r},ym=vm,bm=function(e){return vm(dm(e.selection.getSel()),ar.fromDom(e.getBody()))},Cm=function(e,t){return z(t,Zc),e.selection.setCursorLocation(t[0].dom(),0),!0},xm=function(e,t){return td(e,!1,t),!0},wm=function(n,e,r,t){return Em(e,t).fold(function(){return t=n,lm(e,r).map(function(e){return e.fold(d(xm,t),d(Cm,t))});var t},function(e){return Sm(n,e)}).getOr(!1)},Nm=function(e,t){return X(rf(t,e),To)},Em=function(e,t){return X(rf(t,e),function(e){return"caption"===lr(e)})},Sm=function(e,t){return Zc(t),e.selection.setCursorLocation(t.dom(),0),_.some(!0)},Tm=function(u,s,c,l,f){return ic.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,ic.firstPositionIn(r.dom()).bind(function(t){return ic.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Sm(u,l):(t=l,n=e,Em(s,ar.fromDom(n.getNode())).map(function(e){return!1===Lr(e,t)}));var t,n,r,o,i,a}).or(_.some(!0))},km=function(a,u,s,e){var c=Su.fromRangeStart(a.selection.getRng());return Nm(s,e).bind(function(e){return Xl(e)?Sm(a,e):(t=a,n=s,r=u,o=e,i=c,ic.navigate(r,t.getBody(),i).bind(function(e){return Nm(n,ar.fromDom(e.getNode())).map(function(e){return!1===Lr(e,o)})}));var t,n,r,o,i})},_m=function(a,u,e){var s=ar.fromDom(a.getBody());return Em(s,e).fold(function(){return km(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=Su.fromRangeStart(t.selection.getRng()),Xl(o)?Sm(t,o):Tm(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},Am=function(e,t){var n,r,o,i,a,u=ar.fromDom(e.selection.getStart(!0)),s=bm(e);return e.selection.isCollapsed()&&0===s.length?_m(e,t,u):(n=e,r=u,o=ar.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=bm(n)).length?Cm(n,a):wm(n,o,i,r))},Rm=bc.isEq,Dm=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},Om=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!Dm(t,e,n)||e.parentNode===o||!!Im(t,e,n,r,!0)}),Im(t,e,n,r))},Bm=function(e,t,n){return!!Rm(t,n.inline)||!!Rm(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Pm=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):bc.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Rm(u,bc.normalizeStyleValue(e,bc.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):bc.getStyle(e,t,c[s]))return n;return n},Im=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],Bm(e.dom,t,i)&&Pm(l,t,i,"attributes",o,r)&&Pm(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Lm={matchNode:Im,matchName:Bm,match:function(e,t,n,r){var o;return r?Om(e,r,t,n):(r=e.selection.getNode(),!!Om(e,r,t,n)||!((o=e.selection.getStart())===r||!Om(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&Im(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=bc.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:Dm},Fm=function(e,t){return e.splitText(t)},Mm=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&zo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=Fm(t,n)).previousSibling,n<o?(t=r=Fm(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(zo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=Fm(t,n),n=0),zo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=Fm(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},zm=ya,Um="_mce_caret",Vm=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==zm||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},jm=function(e){var t;if(e)for(e=(t=new fo(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Hm=function(e){var t=ar.fromTag("span");return xr(t,{id:Um,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Ii(t,ar.fromText(zm)),t},qm=function(e,t,n){void 0===n&&(n=!0);var r,o=e.dom,i=e.selection;if(Vm(t))td(e,!1,ar.fromDom(t),n);else{var a=i.getRng(),u=o.getParent(t,o.isBlock),s=((r=jm(t))&&r.nodeValue.charAt(0)===zm&&r.deleteData(0,1),r);a.startContainer===s&&0<a.startOffset&&a.setStart(s,a.startOffset-1),a.endContainer===s&&0<a.endOffset&&a.setEnd(s,a.endOffset-1),o.remove(t,!0),u&&o.isEmpty(u)&&Zc(ar.fromDom(u)),i.setRng(a)}},$m=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)qm(e,t,n);else if(!(t=Yu(e.getBody(),o.getStart())))for(;t=r.get(Um);)qm(e,t,!1)},Wm=function(e,t,n){var r=e.dom,o=r.getParent(n,d(bc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Qc(ar.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},Km=function(e,t){return e.appendChild(t),t},Xm=function(e,t){var n,r,o=(n=function(e,t){return Km(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}(e,function(e){r=n(r,e)}),r);return Km(o,o.ownerDocument.createTextNode(zm))},Ym=function(i){i.on("mouseup keydown",function(e){var t,n,r,o;t=i,n=e.keyCode,r=t.selection,o=t.getBody(),$m(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==zm||$m(t,Yu(o,r.getStart())),37!==n&&39!==n||$m(t,Yu(o,r.getStart()))})},Gm=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(lr(t))&&!Xu(t.dom())&&!zo.isBogus(t.dom())},Jm=function(e){return 1===$r(e).length},Qm=function(e,t,n,r){var o,i,a,u,s=d(Gm,t),c=W(U(r,s),function(e){return e.dom()});if(0===c.length)td(t,e,n);else{var l=(o=n.dom(),i=c,a=Hm(!1),u=Xm(i,a.dom()),Oi(ar.fromDom(o),a),Mi(ar.fromDom(o)),Su(u,0));t.selection.setRng(l.toRange())}},Zm=function(r,o){var t,e=ar.fromDom(r.getBody()),n=ar.fromDom(r.selection.getStart()),i=U((t=rf(n,e),Y(t,yo).fold(q(t),function(e){return t.slice(0,e)})),Jm);return ee(i).map(function(e){var t,n=Su.fromRangeStart(r.selection.getRng());return!(!jl(o,n,e.dom())||Xu((t=e).dom())&&Vm(t.dom())||(Qm(o,r,e,i),0))}).getOr(!1)},eg=function(e,t){return!!e.selection.isCollapsed()&&Zm(e,t)},tg=zo.isContentEditableTrue,ng=zo.isContentEditableFalse,rg=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},og=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},ig=function(e,t,n){var r=As(1,e.getBody(),t),o=Su.fromRangeStart(r),i=o.getNode();if(ng(i))return rg(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(ng(a))return rg(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return ng(e)||tg(e)});return ng(u)?rg(1,e,u,!1,n):null},ag=function(e,t,n){if(!t||!t.collapsed)return t;var r=ig(e,t,n);return r||t},ug=function(e,t,n,r,o,i){var a,u,s=rg(r,e,i.getNode(!o),o,!0);if(t.collapsed){var c=t.cloneRange();o?c.setEnd(s.startContainer,s.startOffset):c.setStart(s.endContainer,s.endOffset),c.deleteContents()}else t.deleteContents();return e.selection.setRng(s),a=e.dom,u=n,zo.isText(u)&&0===u.data.length&&a.remove(u),!0},sg=function(e,t){return function(e,t){var n=e.selection.getRng();if(!zo.isText(n.commonAncestorContainer))return!1;var r=t?Nu.Forwards:Nu.Backwards,o=Xs(e.getBody()),i=d(Bs,o.next),a=d(Bs,o.prev),u=t?i:a,s=t?Bf:Pf,c=Ds(r,e.getBody(),n),l=zl.normalizePosition(t,u(c));if(!l)return!1;if(s(l))return ug(e,n,c.getNode(),r,t,l);var f=u(l);return!!(f&&s(f)&&Ps(l,f))&&ug(e,n,c.getNode(),r,t,f)}(e,t)},cg=function(e,t){e.getDoc().execCommand(t,!1,null)},lg=function(e){od(e,!1)||sg(e,!1)||Gd(e,!1)||mf(e,!1)||Am(e)||vf(e,!1)||eg(e,!1)||(cg(e,"Delete"),Vl(e))},fg=function(e){od(e,!0)||sg(e,!0)||Gd(e,!0)||mf(e,!0)||Am(e)||vf(e,!0)||eg(e,!0)||cg(e,"ForwardDelete")},dg=function(o,t,e){var n=function(e){return t=o,n=e.dom(),r=Tr(n,t),_.from(r).filter(function(e){return 0<e.length});var t,n,r};return ea(ar.fromDom(e),function(e){return n(e).isSome()},function(e){return Lr(ar.fromDom(t),e)}).bind(n)},mg=function(o){return function(r,e){return _.from(e).map(ar.fromDom).filter(dr).bind(function(e){return dg(o,r,e.dom()).or((t=o,n=e.dom(),_.from(Ni.DOM.getStyle(n,t,!0))));var t,n}).getOr("")}},gg={getFontSize:mg("font-size"),getFontFamily:H(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},mg("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},pg=function(e){return ic.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return zo.isText(t)?t.parentNode:t})},hg=function(o){return _.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?_.none():_.from(o.selection.getStart(!0))})},vg=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=Tl(e),o=kl(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},yg=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},bg=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},Cg=function(e,t,n){return bg(e,t,function(e){return e.nodeName===n})},xg=function(e){return e&&"TABLE"===e.nodeName},wg=function(e,t,n){for(var r=new fo(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(zo.isBr(t))return!0},Ng=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&zo.isBr(o)&&t&&e.isEmpty(u))return _.some(wu(o.parentNode,e.nodeIndex(o)));for(i=new fo(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,Ea(c=s)&&!1===bg(c,l,Xu)))return _.none();if(zo.isText(s)&&0<s.nodeValue.length)return!1===Cg(s,f,"A")?_.some(wu(s,r?s.nodeValue.length:0)):_.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return _.none();a=s}return n&&a?_.some(wu(a,0)):_.none()},Eg=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=zo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,Ea(o))return _.none();if(zo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),zo.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(Ea(u))return _.none();if(s[u.nodeName]||xg(u))return _.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=zo.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&xg(o))return _.none();if(function(e,t){for(;t&&t!==e;){if(zo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||Ea(o))return _.none();if(o.hasChildNodes()&&!1===xg(o)){a=new fo(u=o,g);do{if(zo.isContentEditableFalse(u)||Ea(u)){p=!1;break}if(zo.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(zo.isText(o)&&0===i&&Ng(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),zo.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!zo.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||wg(e,u,!1)||wg(e,u,!0)||Ng(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&zo.isText(o)&&i===o.nodeValue.length&&Ng(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?_.some(wu(o,i)):_.none()},Sg=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=wu.fromRangeStart(t);return Eg(e,n,!0,r).each(function(e){n&&wu.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Eg(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),yg(t,r)?_.none():_.some(r)},Tg=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},kg=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},_g=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Sg(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new fo(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Lu(i,a,n),Tg(i,o,n),kg(i,o,n,r),e.undoManager.add()},Ag=function(e,t){var n=ar.fromTag("br");Oi(ar.fromDom(t),n),e.undoManager.add()},Rg=function(e,t){Dg(e.getBody(),t)||Bi(ar.fromDom(t),ar.fromTag("br"));var n=ar.fromTag("br");Bi(ar.fromDom(t),n),Tg(e.dom,e.selection,n.dom()),kg(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},Dg=function(e,t){return n=Su.after(t),!!zo.isBr(n.getNode())||ic.nextPosition(e,Su.after(t)).map(function(e){return zo.isBr(e.getNode())}).getOr(!1);var n},Og=function(e){return e&&"A"===e.nodeName&&"href"in e},Bg=function(e){return e.fold(q(!1),Og,Og,q(!1))},Pg=function(e,t){t.fold(o,d(Ag,e),d(Rg,e),o)},Ig=function(e,t){var n,r,o,i=(n=e,r=d(zl.isInlineTarget,n),o=Su.fromRangeStart(n.selection.getRng()),Pd(r,n.getBody(),o).filter(Bg));i.isSome()?i.each(d(Pg,e)):_g(e,t)},Lg={create:kr("start","soffset","finish","foffset")},Fg=yf([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Mg=(Fg.before,Fg.on,Fg.after,function(e){return e.fold($,$,$)}),zg=yf([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ug={domRange:zg.domRange,relative:zg.relative,exact:zg.exact,exactFromRange:function(e){return zg.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=e.match({domRange:function(e){return ar.fromDom(e.startContainer)},relative:function(e,t){return Mg(e)},exact:function(e,t,n,r){return e}});return zr(t)},range:Lg.create},Vg=or.detect().browser,jg=function(e,t){var n=mr(t)?Ic(t).length:$r(t).length+1;return n<e?n:e<0?0:e},Hg=function(e){return Ug.range(e.start(),jg(e.soffset(),e.start()),e.finish(),jg(e.foffset(),e.finish()))},qg=function(e,t){return!zo.isRestrictedNode(t.dom())&&(Fr(e,t)||Lr(e,t))},$g=function(t){return function(e){return qg(t,e.start())&&qg(t,e.finish())}},Wg=function(e){return!0===e.inline||Vg.isIE()},Kg=function(e){return Ug.range(ar.fromDom(e.startContainer),e.startOffset,ar.fromDom(e.endContainer),e.endOffset)},Xg=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?_.from(t.getRangeAt(0)):_.none()).map(Kg)},Yg=function(e){var t=zr(e);return Xg(t.dom()).filter($g(e))},Gg=function(e,t){return _.from(t).filter($g(e)).map(Hg)},Jg=function(e){var t=j.document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),_.some(t)}catch(n){return _.none()}},Qg=function(e){return(e.bookmark?e.bookmark:_.none()).bind(d(Gg,ar.fromDom(e.getBody()))).bind(Jg)},Zg=function(e){var t=Wg(e)?Yg(ar.fromDom(e.getBody())):_.none();e.bookmark=t.isSome()?t:e.bookmark},ep=function(t){Qg(t).each(function(e){t.selection.setRng(e)})},tp=Qg,np=function(e){return wo(e)||No(e)},rp=function(e){return U(W(e.selection.getSelectedBlocks(),ar.fromDom),function(e){return!np(e)&&!Ur(e).map(np).getOr(!1)})},op=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),z(rp(e),function(e){!function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e.dom())})},ip=Xt.each,ap=Xt.extend,up=Xt.map,sp=Xt.inArray;function cp(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",ip(e,function(t,e){ip(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};ap(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?ep(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(ip(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},m=function(e){t=i.getBookmark(e)},g=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");fe.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),ip("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),g()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:vg(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:vg(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),g())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){ll(s,n)},mceInsertRawHTML:function(e,t,n){i.setContent("tiny_mce_marker");var r=s.getContent();s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){op(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),zo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){lg(s)},forwardDelete:function(){fg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return Ig(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=up(e,function(e){return!!a.matchNode(e,n)});return-1!==sp(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return hg(t=s).fold(function(){return pg(t).map(function(e){return gg.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return gg.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return hg(t=s).fold(function(){return pg(t).map(function(e){return gg.getFontSize(t.getBody(),e)}).getOr("")},function(e){return gg.getFontSize(t.getBody(),e)});var t},this)}var lp=Xt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),fp=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Xt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};fp.isNative=function(e){return!!lp[e.toLowerCase()]};var dp,mp=function(n){return n._eventDispatcher||(n._eventDispatcher=new fp({scope:n,toggleEvent:function(e,t){fp.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},gp={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;if(t=mp(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return mp(this).on(e,t,n)},off:function(e,t){return mp(this).off(e,t)},once:function(e,t){return mp(this).once(e,t)},hasEventListeners:function(e){return mp(this).has(e)}},pp=function(e,t){return e.fire("PreProcess",t)},hp=function(e,t){return e.fire("PostProcess",t)},vp=function(e){return e.fire("remove")},yp=function(e){return e.fire("detach")},bp=function(e,t){return e.fire("SwitchMode",{mode:t})},Cp=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},xp=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},wp=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},Np=function(e,t,n){var r,o;Xi(e,t)&&!1===n?(o=t,Hi(r=e)?r.dom().classList.remove(o):$i(r,o),Ki(r)):n&&Wi(e,t)},Ep=function(e,t){Np(ar.fromDom(e.getBody()),"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",wp(e,"StyleWithCSS",!1),wp(e,"enableInlineTableEditing",!1),wp(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},Sp=function(e){return e.readonly?"readonly":"design"},Tp=Ni.DOM,kp=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=Tp.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},_p=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},Ap=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=kp(i,a),i.settings.event_root){if(dp||(dp={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&dp){for(e in dp)i.dom.unbind(kp(i,e));dp=null}})),dp[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||Tp.isChildOf(t,o))&&_p(n[r],a,e)}},dp[a]=t,Tp.bind(e,a,t)}else t=function(e){_p(i,a,e)},Tp.bind(e,a,t),i.delegates[a]=t},Rp={bindPendingEventDelegates:function(){var t=this;Xt.each(t._pendingNativeEvents,function(e){Ap(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?Ap(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(kp(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(kp(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},Dp=Rp=Xt.extend({},gp,Rp),Op=kr("sections","settings"),Bp=or.detect().deviceType.isTouch(),Pp=["lists","autolink","autosave"],Ip={theme:"mobile"},Lp=function(e){var t=k(e)?e.join(" "):e,n=W(S(t)?t.split(" "):[],Gn);return U(n,function(e){return 0<e.length})},Fp=function(n,e){var r,o,i,t=(r=function(e,t){return F(n,t)},o={},i={},hr(e,function(e,t){(r(e,t)?o:i)[t]=e}),{t:o,f:i});return Op(t.t,t.f)},Mp=function(e,t){return e.sections().hasOwnProperty(t)},zp=function(e,t,n,r){var o,i=Lp(n.forced_plugins),a=Lp(r.plugins),u=e&&Mp(t,"mobile")?U(a,d(F,Pp)):a,s=(o=u,[].concat(Lp(i)).concat(Lp(o)));return Xt.extend(r,{plugins:s.join(" ")})},Up=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=Fp(["mobile"],r),p=Xt.extend(t,n,g.settings(),(f=e,m=(d=g).settings().inline,f&&Mp(d,"mobile")&&!m?(u="mobile",s=Ip,c=g.sections(),l=c.hasOwnProperty(u)?c[u]:{},Xt.extend({},s,l)):{}),{validate:!0,content_editable:g.settings().inline,external_plugins:(o=n,i=g.settings(),a=i.external_plugins?i.external_plugins:{},o&&o.external_plugins?Xt.extend({},o.external_plugins,a):a)});return zp(e,g,n,p)},Vp=function(e,t,n){return _.from(t.settings[n]).filter(e)},jp=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?z(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Xt.trim(t[0])]=Xt.trim(t[1]):a[Xt.trim(t[0])]=Xt.trim(t)}):a=i,a):"string"===r?Vp(S,e,t).getOr(n):"number"===r?Vp(O,e,t).getOr(n):"boolean"===r?Vp(R,e,t).getOr(n):"object"===r?Vp(T,e,t).getOr(n):"array"===r?Vp(k,e,t).getOr(n):"string[]"===r?Vp((o=S,function(e){return k(e)&&J(e,o)}),e,t).getOr(n):"function"===r?Vp(D,e,t).getOr(n):u},Hp=Xt.each,qp=Xt.explode,$p={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},Wp=Xt.makeMap("alt,ctrl,shift,meta,access");function Kp(i){var a={},r=[],u=function(e){var t,n,r={};for(n in Hp(qp(e,"+"),function(e){e in Wp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=$p[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Wp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,fe.mac?r.ctrl=!0:r.shift=!0),r.meta&&(fe.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Xt.map(qp(e,">"),u))[o.length-1]=Xt.extend(o[o.length-1],{func:n,scope:r||i}),Xt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Hp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Xt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Hp(qp(Xt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Xp=function(e){var t=Mr(e).dom();return e.dom()===t.activeElement},Yp=function(t){return(e=Mr(t),n=e!==undefined?e.dom():j.document,_.from(n.activeElement).map(ar.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},Gp=function(t,e){return(n=e,n.collapsed?_.from(Ja(n.startContainer,n.startOffset)).map(ar.fromDom):_.none()).bind(function(e){return So(e)?_.some(e):!1===Fr(t,e)?_.some(t):_.none()});var n},Jp=function(t,e){Gp(ar.fromDom(t.getBody()),e).bind(function(e){return ic.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Qp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Zp=function(e){var t,n=e.getBody();return n&&(t=ar.fromDom(n),Xp(t)||Yp(t).isSome())},eh=function(e){return e.inline?Zp(e):(t=e).iframeElement&&Xp(ar.fromDom(t.iframeElement));var t},th=function(e){return e.editorManager.setActive(e)},nh=function(e,t){e.removed||(t?th(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return Qp(u),Jp(t,o),th(t);t.bookmark!==undefined&&!1===eh(t)&&tp(t).each(function(e){t.selection.setRng(e),o=e}),n||(fe.opera||Qp(r),t.getWin().focus()),(fe.gecko||n)&&(Qp(r),Jp(t,o)),th(t)}(e))},rh=eh,oh=function(e,t){return t.dom()[e]},ih=function(e,t){return parseInt(Sr(t,e),10)},ah=d(oh,"clientWidth"),uh=d(oh,"clientHeight"),sh=d(ih,"margin-top"),ch=d(ih,"margin-left"),lh=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=ar.fromDom(e.getBody()),p=e.inline?g:(r=g,ar.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+ch(i):0),y:u-(o?s.top+i.dom().clientTop+sh(i):0)});return l=h.x,f=h.y,d=ah(c=p),m=uh(c),0<=l&&0<=f&&l<=d&&f<=m},fh=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,_.from(t).map(ar.fromDom)).map(function(e){return Fr(Mr(e),e)}).getOr(!1)};function dh(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){Y(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&fh(n))return X(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){he.requestAnimationFrame(a)}),t.on("remove",function(){z(o.slice(),function(e){i().close(e)})}),{open:r,close:function(){_.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function mh(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){Y(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return _.from(o[o.length-1])};return r.on("remove",function(){z(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),Zg(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var gh={},ph="en",hh={setCode:function(e){e&&(ph=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return ph},rtl:!1,add:function(e,t){var n=gh[e];for(var r in n||(gh[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=gh[ph]||{},n=function(e){return Xt.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Xt.is(e,"undefined")},o=function(e){return e=n(e),Xt.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Xt.is(e,"object")&&Xt.hasOwn(e,"raw"))return n(e.raw);if(Xt.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Xt.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:gh},vh=Di.PluginManager,yh=function(e,t){var n=function(e,t){for(var n in vh.urls)if(vh.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?hh.translate(["Failed to load plugin: {0} from url {1}",n,t]):hh.translate(["Failed to load plugin url: {0}",t])},bh=function(e,t){e.notificationManager.open({type:"error",text:t})},Ch=function(e,t){e._skinLoaded?bh(e,t):e.on("SkinLoaded",function(){bh(e,t)})},xh=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=j.window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},wh={pluginLoadError:function(e,t){Ch(e,yh(e,t))},pluginInitError:function(e,t,n){var r=hh.translate(["Failed to initialize plugin: {0}",t]);xh(r,n),Ch(e,r)},uploadError:function(e,t){Ch(e,hh.translate(["Failed to upload image: {0}",t]))},displayError:Ch,initError:xh},Nh=Di.PluginManager,Eh=Di.ThemeManager;function Sh(){return new(oe.getOrDie("XMLHttpRequest"))}function Th(u,s){var r={},n=function(e,r,o,t){var i,n;(i=Sh()).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new j.FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Xt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Xt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),de.all(Xt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new de(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new de(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return!1===D(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new de(function(e){e([])})}}}var kh=function(e){return oe.getOrDie("atob")(e)},_h=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},Ah=function(a){return new de(function(e){var t,n,r,o,i=_h(a);try{t=kh(i.data)}catch(nE){return void e(new j.Blob([]))}for(o=t.length,n=new(oe.getOrDie("Uint8Array"))(o),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new j.Blob([n],{type:i.type}))})},Rh=function(e){return 0===e.indexOf("blob:")?(i=e,new de(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=Sh();r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?Ah(e):null;var i},Dh=function(n){return new de(function(e){var t=new(oe.getOrDie("FileReader"));t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},Oh=_h,Bh=0,Ph=function(e){return(e||"blobid")+Bh++},Ih=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=Oh(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):Rh(r.src).then(function(e){a=n.create(Ph(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):Rh(r.src).then(function(t){Dh(t).then(function(e){i=Oh(e).data,a=n.create(Ph(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},Lh=function(e){return e?te(e.getElementsByTagName("img")):[]},Fh=0,Mh={uuid:function(e){return e+Fh+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function zh(u){var n,o,t,e,i,r,a,s,c,l=(n=[],o=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||Mh.uuid("blobid"),n=e.name||t,{id:q(t),name:q(n),filename:q(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:q(e.blob),base64:q(e.base64),blobUri:q(e.blobUri||ae.createObjectURL(e.blob)),uri:q(e.uri)}},{create:function(e,t,n,r){if(S(e))return o({id:e,name:r,blob:t,base64:n});if(T(e))return o(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return U(n,e)[0]},removeByUri:function(t){n=U(n,function(e){return e.blobUri()!==t||(ae.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){z(n,function(e){ae.revokeObjectURL(e.blobUri())}),n=[]}}),f=(a={},s=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:c=function(e){return e in a},getResultUri:function(e){var t=a[e];return t?t.resultUri:null},isPending:function(e){return!!c(e)&&1===a[e].status},isUploaded:function(e){return!!c(e)&&2===a[e].status},markPending:function(e){a[e]=s(1,null)},markUploaded:function(e,t){a[e]=s(2,t)},removeFailed:function(e){delete a[e]},destroy:function(){a={}}}),d=[],m=function(t){return function(e){return u.selection?t(e):[]}},g=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},p=function(e,t,n){return e=g(e,'src="'+t+'"','src="'+n+'"'),e=g(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},h=function(t,n){z(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=W(e.fragments,function(e){return p(e,t,n)}):e.content=p(e.content,t,n)})},v=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},y=function(e,t){l.removeByUri(e.src),h(e.src,t),u.$(e).attr({src:Rl(u)?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},b=function(n){return i||(i=Th(f,{url:Ol(u),basePath:Bl(u),credentials:Pl(u),handler:Il(u)})),w().then(m(function(r){var e;return e=W(r,function(e){return e.blobInfo}),i.upload(e,v).then(m(function(e){var t=W(e,function(e,t){var n=r[t].image;return e.status&&Dl(u)?y(n,e.url):e.error&&wh.uploadError(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},C=function(e){if(Al(u))return b(e)},x=function(t){return!1!==J(d,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||_l(u)(t))},w=function(){var o,i,a;return r||(o=f,i=l,a={},r={findAll:function(e,n){var t;n||(n=q(!0)),t=U(Lh(e),function(e){var t=e.src;return!!fe.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===fe.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=W(t,function(n){if(a[n.src])return new de(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new de(function(e,t){Ih(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return de.all(r)}}),r.findAll(u.getBody(),x).then(m(function(e){return e=U(e,function(e){return"string"!=typeof e||(wh.displayError(u,e),!1)}),z(e,function(e){h(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},N=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=f.getResultUri(n);if(t)return'src="'+t+'"';var r=l.getByUri(n);return r||(r=V(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){Al(u)?C():w()}),u.on("RawSaveContent",function(e){e.content=N(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=N(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){z(e,function(e){var t=e.attr("src");if(!l.getByUri(t)){var n=f.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:l,addFilter:function(e){d.push(e)},uploadImages:b,uploadImagesAuto:C,scanForImages:w,destroy:function(){l.destroy(),f.destroy(),r=i=null}}}var Uh=function(e,t){return e.hasOwnProperty(t.nodeName)},Vh=function(e,t){if(zo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Uh(e,t.nextSibling)))return!0}return!1},jh=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,g=e.selection,p=e.schema,h=p.getBlockElements(),v=g.getStart(),y=e.getBody();if(f=d.forced_root_block,v&&zo.isElement(v)&&f&&(l=y.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&(b=h,C=y,x=v,!M(nf(ar.fromDom(x),ar.fromDom(C)),function(e){return Uh(b,e.dom())})))){var b,C,x,w,N;for(n=(t=g.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=rh(e),v=y.firstChild;v;)if(w=h,N=v,zo.isText(N)||zo.isElement(N)&&!Uh(w,N)&&!pc(N)){if(Vh(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),g.setRng(t),e.nodeChanged())}},Hh=function(e){e.settings.forced_root_block&&e.on("NodeChange",d(jh,e))},qh=function(t){return Kr(t).fold(q([t]),function(e){return[t].concat(qh(e))})},$h=function(t){return Xr(t).fold(q([t]),function(e){return"br"===lr(e)?Vr(e).map(function(e){return[t].concat($h(e))}).getOr([]):[t].concat($h(e))})},Wh=function(o,e){return eu((i=e,a=i.startContainer,u=i.startOffset,zo.isText(a)?0===u?_.some(ar.fromDom(a)):_.none():_.from(a.childNodes[u]).map(ar.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,zo.isText(n)?r===n.data.length?_.some(ar.fromDom(n)):_.none():_.from(n.childNodes[r-1]).map(ar.fromDom)),function(e,t){var n=X(qh(o),d(Lr,e)),r=X($h(o),d(Lr,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},Kh=function(e,t,n,r){var o=n,i=new fo(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Xt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(fe.ie&&fe.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},Xh=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Yh(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&yg(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!fe.range&&i.selection.isCollapsed()||Xh(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&Xh(i)&&("IMG"===i.selection.getNode().nodeName?he.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Gh,Jh,Qh=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Zh=function(e,t){return n=(u=e).inline?Qh(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Qh(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},ev=zo.isContentEditableFalse,tv=zo.isContentEditableTrue,nv=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},rv=function(u,s){return function(e){if(0===e.button){var t=X(s.dom.getParents(e.target),ru(ev,tv)).getOr(null);if(i=s.getBody(),ev(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},ov=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!ev(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){nv(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;iv(l)}},iv=function(e){e.dragging=!1,e.element=null,nv(e.ghost)},av=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=Ni.DOM,a=j.document,n=rv(c,e),p=c,h=e,v=he.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).isDefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=Zh(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=ov(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),iv(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},uv=function(e){var n;av(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(ev(t)||ev(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},sv=function(e){return V(e,function(e,t){return e.concat(function(t){var e=function(e){return W(e,function(e){return(e=qa(e)).node=t,e})};if(zo.isElement(t))return e(t.getClientRects());if(zo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Jh=Gh||(Gh={}))[Jh.Up=-1]="Up",Jh[Jh.Down=1]="Down";var cv=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=sv([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,Ht.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=Ht.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=xs(r,e,ja,t);)if(n(r))return}(o,e,r,n)),l},lv=d(cv,Gh.Up,Ka,Xa),fv=d(cv,Gh.Down,Xa,Ka),dv=function(n){return function(e){return t=n,e.line>t;var t}},mv=function(n){return function(e){return t=n,e.line===t;var t}},gv=zo.isContentEditableFalse,pv=xs,hv=function(e,t){return Math.abs(e.left-t)},vv=function(e,t){return Math.abs(e.right-t)},yv=function(e,t){return e>=t.left&&e<=t.right},bv=function(e,o){return Ht.reduce(e,function(e,t){var n,r;return n=Math.min(hv(e,o),vv(e,o)),r=Math.min(hv(t,o),vv(t,o)),yv(o,t)?t:yv(o,e)?e:r===n&&gv(t.node)?t:r<n?t:e})},Cv=function(e,t,n,r){for(;r=pv(r,e,ja,t);)if(n(r))return},xv=function(e,t,n){var r,o,i,a,u,s,c,l=sv(U(te(e.getElementsByTagName("*")),fs)),f=U(l,function(e){return n>=e.top&&n<=e.bottom});return(r=bv(f,t))&&(r=bv((a=e,c=function(t,e){var n;return n=U(sv([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),Cv(Gh.Up,a,d(c,Ka),u.node),Cv(Gh.Down,a,d(c,Xa),u.node),s),t))&&fs(r.node)?(i=t,{node:(o=r).node,before:hv(o,i)<vv(o,i)}):null},wv=function(t,n,e){if(e.collapsed)return!1;if(fe.ie&&fe.ie<=11&&e.startOffset===e.endOffset-1&&e.startContainer===e.endContainer){var r=e.startContainer.childNodes[e.startOffset];if(zo.isElement(r))return M(r.getClientRects(),function(e){return Ya(e,t,n)})}return M(e.getClientRects(),function(e){return Ya(e,t,n)})},Nv=function(t){var e=Ui(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ag(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Ev={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return fe.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Sv=zo.isContentEditableTrue,Tv=zo.isContentEditableFalse,kv=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Sv(t)||Tv(t))return t;t=t.parentNode}return null},_v=function(g){var p,e,t,a=g.getBody(),o=cs(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return rh(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=As(e,a,t),-1===e?Su.fromRangeStart(t):Su.fromRangeEnd(t)},n=function(e){return Ea(e)||Aa(e)||Ra(e)},b=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),fs(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(fs(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),fs(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(fs(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Tv(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),Tv(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=na(ar.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&fe.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),z(Gi(ar.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){Nr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),na(ar.fromDom(g.getBody()),"#"+h).each(Mi),p=null),na(ar.fromDom(g.getBody()),"#"+h).each(Mi),p=null},C=function(){o.hide()};return fe.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&lh(g,e.clientX,e.clientY)&&u(ig(g,t,!1))}),g.on("click",function(e){var t;(t=kv(g,e.target))&&(Tv(t)&&(e.preventDefault(),g.focus()),Sv(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Tv(kv(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Xs(e);if(!e.firstChild)return!1;var n=Su.before(e.firstChild),r=t.next(n);return r&&!Bf(r)&&!Pf(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=kv(n,e.target);Tv(t)&&(r||(e.preventDefault(),c(og(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==lh(g,e.clientX,e.clientY))if(t=kv(g,n))Tv(t)?(e.preventDefault(),c(og(g,t))):(l(),Sv(t)&&e.shiftKey||wv(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===fs(n)){l(),C();var r=xv(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Ev.modifierPressed(e)||(e.keyCode,Tv(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!fe.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),uv(g),Nv(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Da(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Av=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},Rv=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function Dv(z,U){void 0===U&&(U=li());var e=function(){};!1!==(z=z||{}).fix_self_closing&&(z.fix_self_closing=!0);var V=z.comment?z.comment:e,j=z.cdata?z.cdata:e,H=z.text?z.text:e,q=z.start?z.start:e,$=z.end?z.end:e,W=z.pi?z.pi:e,K=z.doctype?z.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,y,b,C,x,w,N,E,S,T,k,_,A,R=0,D=[],O=0,B=Zo.decode,P=Xt.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&$(e.name);D.length=t}},F=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:B(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=y[t])&&b){for(a=b.length;a--&&!(i=b[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!z.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(I.test(l))return;if(c=l,!(s=z).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),T=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=z.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=z.validate,u=z.remove_internals,A=z.fix_self_closing,k=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(R<t.index&&H(B(e.substr(R,t.index-R))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),L(n);else if(n=t[7]){if(t.index+t[0].length>e.length){H(B(e.substr(t.index))),R=t.index+t[0].length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,A&&E[n]&&0<D.length&&D[D.length-1].name===n&&L(n);var M=Rv(T,t[8]);if(null!==M){if("all"===M){R=Av(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}if(!p||(l=U.getElementRule(n))){if(f=!0,p&&(y=l.attributes,b=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(T,F)):(d=[]).map={},p&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(_=h.value)&&(_="mce_"+O++),d.map[a]=_,d.push({name:a,value:_});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(_=h.value)&&(_="mce_"+O++),d.map[a]=_,d.push({name:a,value:_}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){R=Av(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}}f&&q(n,d,c)}else f=!1;if(r=k[n]){r.lastIndex=R=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(R,t.index-R)),R=t.index+t[0].length):(i=e.substr(R),R=e.length),f&&(0<i.length&&H(i,!0),$(n)),S.lastIndex=R;continue}c||(v&&v.indexOf("/")===v.length-1?f&&$(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),z.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),V(n)):(n=t[2])?j(n.replace(/<!--|--!?>/g,"")):(n=t[3])?K(n):(n=t[4])&&W(n,t[5]);R=t.index+t[0].length}for(R<e.length&&H(B(e.substr(R))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&$(n.name)}}}(Dv||(Dv={})).findEndTag=Av;var Ov=Dv,Bv=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:Ov.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return ba(l)},Pv={trimExternal:Bv,trimInternal:Bv},Iv=0,Lv=2,Fv=1,Mv=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},y=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return y(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return y(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},zv=function(e){return zo.isElement(e)?e.outerHTML:zo.isText(e)?Zo.encodeRaw(e.data,!1):zo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Uv=function(e,t,n){var r=function(e){var t,n,r;for(r=j.document.createElement("div"),t=j.document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Vv=function(e){return U(W(te(e.childNodes),zv),function(e){return 0<e.length})},jv=function(e,t){var n,r,o,i=W(te(t.childNodes),zv);return n=Mv(i,e),r=t,o=0,z(n,function(e){e[0]===Iv?o++:e[0]===Fv?(Uv(r,e[1],o),o++):e[0]===Lv&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Hv=Vi(_.none()),qv=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},$v=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Wv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Kv=function(e){var t=ar.fromTag("body",Hv.get().getOrThunk(function(){var e=j.document.implementation.createHTMLDocument("undo");return Hv.set(_.some(e)),e}));return pa(t,Wv(e)),z(Gi(t,"*[data-mce-bogus]"),zi),t.dom().innerHTML},Xv=function(n){var e,t,r;return e=Vv(n.getBody()),-1!==(t=(r=G(e,function(e){var t=Pv.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?qv(r):$v(t)},Yv=function(e,t,n){"fragmented"===t.type?jv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Gv=function(e,t){return!(!e||!t)&&(r=t,Wv(e)===Wv(r)||(n=t,Kv(e)===Kv(n)));var n,r};function Jv(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===Gv(Xv(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=Wu.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=Xv(u),e=e||{},e=Xt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&Gv(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=Wu.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],Yv(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],Yv(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!Gv(Xv(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],Yv(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var Qv,Zv,ey={},ty=Ht.filter,ny=Ht.each;Zv=function(e){var t,n,r=e.selection.getRng();t=zo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),ny(ty(ty(n,t),function(e){return t(e.previousSibling)&&-1!==Ht.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,gn(n=e).remove(),gn(t).append("<br><br>").append(n.childNodes)}))},ey[Qv="pre"]||(ey[Qv]=[]),ey[Qv].push(Zv);var ry=function(e,t){ny(ey[e],function(e){e(t)})},oy=/^(src|href|style)$/,iy=Xt.each,ay=bc.isEq,uy=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},sy=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],zo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),zo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new fo(r,e.getBody()).next()||r),zo.isText(r)&&!n&&0===o&&(r=new fo(r,e.getBody()).prev()||r),r},cy=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},ly=function(e,t,n,r,o){var i=ar.fromDom(t),a=ar.fromDom(e.create(r,o)),u=n?qr(i):Hr(i);return Li(a,u),n?(Oi(i,a),Pi(a,i)):(Bi(i,a),Ii(a,i)),a.dom()},fy=function(e,t,n,r){return!(t=bc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},dy=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,y,b=e.dom;if(c=b,!(ay(l=o,(f=n).inline)||ay(l,f.block)||(f.selector?zo.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(iy(n.styles,function(e,t){e=bc.normalizeStyleValue(b,bc.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||ay(bc.getStyle(b,i,t),e))&&b.setStyle(o,t,""),u=1}),u&&""===b.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),iy(n.attributes,function(e,t){var n;if(e=bc.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||ay(b.getAttrib(i,t),e)){if("class"===t&&(e=b.getAttrib(o,t))&&(n="",iy(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void b.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),oy.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),iy(n.classes,function(e){e=bc.replaceVars(e,r),i&&!b.hasClass(i,e)||b.removeClass(o,e)}),a=b.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,y=d.settings.forced_root_block,g.block&&(y?h===v.getRoot()&&(g.list_block&&ay(m,g.list_block)||iy(Xt.grep(m.childNodes),function(e){bc.isValid(d,y,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=cy(v,e,y),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(fy(v,m,!1)||fy(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),fy(v,m,!0)||fy(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!ay(g.inline,m)||v.remove(m,1),!0):void 0},my=dy,gy=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,iy(bc.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=Lm.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(dy(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(zo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Xt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!dy(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)g(t[n]);i&&(a=o)}},p=function(e){var t,n=u.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return pc(t=r)&&zo.isElement(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),zo.isText(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),u.remove(n,!0),r},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Dc(s,e,d,!0),m.split){if(e=Mm(e),(t=sy(s,e,!0))!==(n=sy(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),uy(u,t,n)){var o=_.from(t.firstChild).getOr(t);return i(ly(u,o,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void p(!0)}if(uy(u,n,t))return o=_.from(n.lastChild).getOr(n),i(ly(u,o,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void p(!1);t=cy(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=cy(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=p(!0),n=p()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Bc(u,e,function(e){iy(e,function(e){g(e),zo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===bc.getTextDecoration(u,e.parentNode)&&dy(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.startContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Lm.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Dc(e,g,e.formatter.get(t),!0);p=Mm(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=Yu(e.getBody(),c);var h=Hm(!1).dom(),v=Xm(m,h);Wm(e,h,l||c),qm(e,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=Wu.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),m.inline&&Lm.match(s,c,l,r.getStart())&&bc.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!dy(s,d[h],l,e,e));h++);}},py=Xt.each,hy=function(e){return e&&1===e.nodeType&&!pc(e)&&!Xu(e)&&!zo.isBogus(e)},vy=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!pc(n))return n}return e},yy=function(e,t,n){var r,o,i=new Jc(e);if(t&&n&&(t=vy(t,"previousSibling"),n=vy(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Xt.each(Xt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},by=function(e,t,n){py(e.childNodes,function(e){hy(e)&&(t(e)&&n(e),e.hasChildNodes()&&by(e,t,n))})},Cy=function(n,e){return d(function(e,t){return!(!t||!bc.getStyle(n,t,e))},e)},xy=function(r,e,t){return d(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),wy(r,n)},e,t)},wy=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},Ny=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=bc.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},Ey=function(n,e,r,o){py(e,function(t){py(n.dom.select(t.inline,o),function(e){hy(e)&&my(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";py(r.select(n,t),function(n){hy(n)&&py(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},Sy=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Xt.walk(r,d(Ny,e),"childNodes"),Ny(e,r))},Ty=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&by(r,Cy(e,"fontSize"),xy(e,"backgroundColor",bc.replaceVars(t.styles.backgroundColor,n)))},ky=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(by(r,Cy(e,"fontSize"),xy(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},_y=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=yy(e,bc.getNonWhiteSpaceSibling(r),r),r=yy(e,r,bc.getNonWhiteSpaceSibling(r,!0)))},Ay=function(t,n,r,o,i){Lm.matchNode(t,i.parentNode,r,o)&&my(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(Lm.matchNode(t,e,r,o))return my(t,n,o,i),!0})},Ry=Xt.each,Dy=function(g,p,h,r){var e,t,v=g.formatter.get(p),y=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,b=function(n,e){if(e=e||y,n){if(e.onformat&&e.onformat(n,e,h,r),Ry(e.styles,function(e,t){i.setStyle(n,t,bc.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}Ry(e.attributes,function(e,t){i.setAttrib(n,t,bc.replaceVars(e,h))}),Ry(e.classes,function(e){e=bc.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!y.selector&&(Ry(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Xu(t)?(b(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=y.inline||y.block,f=s.create(l),b(f),Bc(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),bc.isEq(t,"br"))return a=0,void(y.block&&s.remove(e));if(y.wrapper&&Lm.matchNode(g,e,p,h))a=0;else{if(m&&!r&&y.block&&!y.wrapper&&bc.isTextBlock(g,t)&&bc.isValid(g,n,l))return e=s.rename(e,l),b(e),d.push(e),void(a=0);if(y.selector){var i=C(v,e);if(!y.inline||i)return void(a=0)}!m||r||!bc.isValid(g,l,t)||!bc.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Xu(e)||y.inline&&s.isBlock(e)?(a=0,Ry(Xt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};Ry(e,u)}),!0===y.links&&Ry(d,function(e){var t=function(e){"A"===e.nodeName&&b(e,y),Ry(Xt.grep(e.childNodes),t)};t(e)}),Ry(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return Ry(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!pc(t)&&!Xu(t)&&!zo.isBogus(t))return n=e,!1;var t}),n};n=0,Ry(e.childNodes,function(e){bc.isWhiteSpaceNode(e)||pc(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(y.inline||y.wrapper)&&(y.exact||1!==t||((o=a(r=e))&&!pc(o)&&Lm.matchName(s,o,y)&&(i=s.clone(o,!1),b(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),Ey(g,v,h,e),Ay(g,y,p,h,e),Ty(s,y,h,e),ky(s,y,h,e),_y(s,y,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(y){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Dc(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&y.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Yu(e.getBody(),c.getStart()))&&(i=jm(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Dc(e,r,e.formatter.get(t)),r=Mm(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===zm||(l=e.getDoc(),f=Hm(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||Dy(g,v[0].defaultBlock),g.selection.setRng(al(g.selection.getRng())),e=Wu.getPersistentBookmark(g.selection,!0),a(i,Dc(g,n.getRng(),v)),y.styles&&Sy(i,y,h,u),n.moveToBookmark(e),bc.moveStart(i,n,n.getRng()),g.nodeChanged()}ry(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void b(r,v[s])}},Oy={applyFormat:Dy},By=Xt.each,Py=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=bc.getParents(a.dom,n.element),o={};r=Xt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),By(i.get(),function(e,n){By(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(By(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!Lm.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),By(u,function(e,t){o[t]||(delete u[t],By(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),By(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},Iy={get:function(r){var t={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",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",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",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"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],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},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(n,e,t){Xt.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 Xt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},Ly=Xt.each,Fy=Ni.DOM,My=function(e,t){var n,o,r,m=t&&t.schema||li({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Fy.create(o.name),n=t,(r=o).classes.length&&Fy.addClass(n,r.classes.join(" ")),Fy.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==Xt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=Fy.create("div")).appendChild(n),Xt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=Fy.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},zy=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Xt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Xt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Uy=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Xt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Xt.map(e.split(/(?:~\+|~|\+)/),zy),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},Vy=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=Uy(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=My(i,n)):r=My([t],n),o=Fy.select(t,r)[0]||r.firstChild,Ly(e.styles,function(e,t){(e=c(e))&&Fy.setStyle(o,t,e)}),Ly(e.attributes,function(e,t){(e=c(e))&&Fy.setAttrib(o,t,e)}),Ly(e.classes,function(e){e=c(e),Fy.hasClass(o,e)||Fy.addClass(o,e)}),n.fire("PreviewFormats"),Fy.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=Fy.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Ly(u.split(" "),function(e){var t=Fy.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Fy.getStyle(n.getBody(),e,!0),"#ffffff"===Fy.toHex(t).toLowerCase())||"color"===e&&"#000000"===Fy.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Fy.remove(r),s)},jy=function(e,t,n,r,o){var i=t.get(n);!Lm.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Oy.applyFormat(e,n,r,o):gy(e,n,r,o)},Hy=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function qy(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Xt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Xt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(Iy.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Vi(null);return Hy(e),Ym(e),{get:o.get,register:o.register,unregister:o.unregister,apply:d(Oy.applyFormat,e),remove:d(gy,e),toggle:d(jy,e,o),match:d(Lm.match,e),matchAll:d(Lm.matchAll,e),matchNode:d(Lm.matchNode,e),canApply:d(Lm.canApply,e),formatChanged:d(Py,e,i),getCssText:d(Vy,e)}}var $y,Wy=Object.prototype.hasOwnProperty,Ky=($y=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Wy.call(o,i)&&(n[i]=$y(n[i],o[i]))}return n}),Xy={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||(_.from(r.firstChild).exists(function(e){return!va(e.value)})?r.unwrap():r.remove())}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Zo.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.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,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.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",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},Yy={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=j.document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Xt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),pp(r,Ky(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Gy=function(e,a,u){e.addNodeFilter("font",function(e){z(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,z(["color","face","size"],function(e){t.attr(e,null)})})})},Jy=function(e,t){var n,r=di();t.convert_fonts_to_spans&&Gy(e,r,Xt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){z(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Qy={register:function(e,t){t.inline_styles&&Jy(e,t)}},Zy=/^[ \t\r\n]*$/,eb={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},tb=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},nb=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,eb[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=tb(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=tb(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Zy.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Zy.test(i.value))return!1;if(n&&n(i))return!1}while(i=tb(i,this));return!0},a.prototype.walk=function(e){return tb(this,null,e)},a}(),rb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new nb("br",1)).shortEnded=!0:r.empty().append(new nb("#text",3)).value="\xa0"},ob=function(e){return ib(e,"#text")&&"\xa0"===e.firstChild.value},ib=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},ab=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},ub=function(e,t){return e&&(t[e.name]||"br"===e.name)},sb=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Xt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),ab(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&rb(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new nb("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Xt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new nb("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},cb=Xt.makeMap,lb=Xt.each,fb=Xt.explode,db=Xt.extend;function mb(T,k){void 0===k&&(k=li());var _={},A=[],R={},D={};(T=T||{}).validate=!("validate"in T)||T.validate,T.root_name=T.root_name||"body";var O=function(e){var t,n,r;(n=e.name)in _&&((r=R[n])?r.push(e):R[n]=[e]),t=A.length;for(;t--;)(n=A[t].name)in e.attributes.map&&((r=D[n])?r.push(e):D[n]=[e]);return e},e={schema:k,addAttributeFilter:function(e,n){lb(fb(e),function(e){var t;for(t=0;t<A.length;t++)if(A[t].name===e)return void A[t].callbacks.push(n);A.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(A)},addNodeFilter:function(e,n){lb(fb(e),function(e){var t=_[e];t||(_[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in _)_.hasOwnProperty(t)&&e.push({name:t,callbacks:_[t]});return e},filterNode:O,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},R={},D={},l=db(cb("script,style,head,html,body,title,meta,param"),k.getBlockElements());var g=k.getNonEmptyElements(),p=k.children,h=T.validate,v="forced_root_block"in a?a.forced_root_block:T.forced_root_block,y=k.getWhiteSpaceElements(),b=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=y.hasOwnProperty(a.context)||y.hasOwnProperty(T.root_name);var N=function(e,t){var n,r=new nb(e,t);return e in _&&((n=R[e])?n.push(r):R[e]=[r]),r},E=function(e){var t,n,r,o,i=k.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=Ov({validate:h,allow_script_urls:T.allow_script_urls,allow_conditional_comments:T.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(k.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),ub(d.lastChild,l)&&(e=e.replace(b,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?k.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&!u[r.name]&&m.push(r),o=A.length;o--;)(a=A[o].name)in t.map&&((s=D[a])?s.push(r):D[a]=[r]);l[e]&&E(r),n||(d=r),!f&&y[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?k.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(b,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&y[e]&&(f=!1),n.removeEmpty&&ab(k,g,y,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(ob(d)||ab(k,g,y,d))&&rb(T,a,l,d),d=d.parent}}},k);var S=d=new nb(a.context||T.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=cb("tr,td,th,tbody,thead,tfoot,table"),l=k.getNonEmptyElements(),f=k.getWhiteSpaceElements(),m=k.getTextBlockElements(),g=k.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!k.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=O(o[0].clone()),c=0;c<o.length-1;c++){for(k.isValidChild(a.name,o[c].name)?(u=O(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}ab(k,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(ab(k,l,f,r)||ib(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChild,!0);continue}n.wrap(O(new nb("ul",1)));continue}k.isValidChild(n.parent.name,"div")&&k.isValidChild("div",n.name)?n.wrap(O(new nb("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(b,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(k.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=N(v,1)).attr(T.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in R){for(s=_[c],i=(n=R[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=A.length;r<o;r++)if((s=A[r]).name in D){for(i=(n=D[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return sb(e,T),Qy.register(e,T),e}var gb=function(e,t,n){-1===Xt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},pb=function(e,t,n){var r=ba(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||ko(ar.fromDom(t))?r:Xt.trim(r)},hb=function(e,t,n){var r=n.selection?Ky({forced_root_block:!1},n):n,o=e.parse(t,r);return Xy.trimTrailingBr(o),o},vb=function(e,t,n,r,o){var i,a,u,s,c=(i=r,rl(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?hp(a,Ky(u,{content:s})).content:s};function yb(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:Ni.DOM,c=u&&u.schema?u.schema:li(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=mb(a,c),Xy.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=Ky({format:"html"},t||{}),r=Yy.process(u,e,n),o=pb(s,r,n),i=hb(l,o,n);return"tree"===n.format?i:vb(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:d(gb,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function bb(e){return{getBookmark:d(mc,e),moveToBookmark:d(gc,e)}}(bb||(bb={})).isBookmarkNode=pc;var Cb,xb,wb=bb,Nb=zo.isContentEditableFalse,Eb=zo.isContentEditableTrue,Sb=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,y,i,b,C,x,w,N=a.dom,E=Xt.each,S=a.getDoc(),T=j.document,k=Math.abs,_=Math.round,A=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-content-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(fe.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var R=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!R(t.target)||wv(t.clientX,t.clientY,n)||e.isDefaultPrevented()||a.selection.select(r)},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},O=function(e){var t=a.settings.object_resizing;return!1!==t&&!fe.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Pr(ar.fromDom(e),t))},B=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,b=t*f[2]+h,C=n*f[3]+v,b=b<5?5:b,C=C<5?5:C,(R(u)&&!1!==a.settings.resize_img_proportional?!Ev.modifierPressed(e):Ev.modifierPressed(e)||R(u)&&f[2]*f[3]!=0)&&(k(t)>k(n)?(C=_(b*y),b=_(C/y)):(b=_(C/y),C=_(b*y))),N.setStyles(D(s),{width:b,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=b+" × "+C,f[2]<0&&s.clientWidth<=b&&N.setStyle(s,"left",g+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=A.scrollWidth-x)+(n=A.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Cp(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",B),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",B),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),xp(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;I(),M(),t=N.getPos(e,A),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,b=C=0),n=a.fire("ObjectSelected",{target:e}),O(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===fe.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=A.scrollWidth,w=A.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),A.appendChild(s),N.bind(S,"mousemove",B),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",B),N.bind(T,"mouseup",P)),c=N.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):I(),u.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in M(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},L=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):I())},F=function(e){return Nb(function(e,t){for(;t&&t!==e;){if(Eb(t)||Nb(t))return t;t=t.parentNode}return null}(a.getBody(),e))},M=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),fe.ie&&11<=fe.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(A,"mscontrolselect",function(e){var t=function(e){he.setEditorTimeout(a,function(){a.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=he.throttle(function(e){a.composing||L(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",I),a.on("contextmenu",n)}),a.on("remove",M),{isResizable:O,showResizeRect:o,hideResizeRect:I,updateResizeRect:L,destroy:function(){u=s=null}}},Tb=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},kb=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&zo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=Tb(t).y-Tb(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},_b=function(d,e){Z(wu.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},Ab=function(e){return zo.isContentEditableTrue(e)||zo.isContentEditableFalse(e)},Rb=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Xt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,zo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Ab))?null:i}return r},Db=function(n,e){return W(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Ob=function(e,t){var n=(t||j.document).createDocumentFragment();return z(e,function(e){n.appendChild(e.dom())}),ar.fromDom(n)},Bb=kr("element","width","rows"),Pb=kr("element","cells"),Ib=kr("x","y"),Lb=function(e,t){var n=parseInt(wr(e,t),10);return isNaN(n)?1:n},Fb=function(e){return V(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},Mb=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Lr(o[i],t))return _.some(Ib(i,r));return _.none()},zb=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(Pb(a[u].element(),c))}return i},Ub=function(e){var o=Bb(ma(e),0,[]);return z(Gi(e,"tr"),function(n,r){z(Gi(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=Lb(o,"rowspan"),a=Lb(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=Pb(ga(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:ma(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),Bb(o.element(),Fb(o.rows()),o.rows())},Vb=function(e){return n=W((t=e).rows(),function(e){var t=W(e.cells(),function(e){var t=ga(e);return Nr(t,"colspan"),Nr(t,"rowspan"),t}),n=ma(e.element());return Li(n,t),n}),r=ma(t.element()),o=ar.fromTag("tbody"),Li(o,n),Ii(r,o),r;var t,n,r,o},jb=function(l,e,t){return Mb(l,e).bind(function(c){return Mb(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?zb(t,o,i,a,u):zb(t,o,u,a,i),Bb(t.element(),Fb(s),s);var t,n,r,o,i,a,u,s})})},Hb=function(n,t){return X(n,function(e){return"li"===lr(e)&&Wh(e,t)}).fold(q([]),function(e){return(t=n,X(t,function(e){return"ul"===lr(e)||"ol"===lr(e)})).map(function(e){return[ar.fromTag("li"),ar.fromTag(lr(e))]}).getOr([]);var t})},qb=function(e,t){var n,r=ar.fromDom(t.commonAncestorContainer),o=rf(r,e),i=U(o,function(e){return bo(e)||vo(e)}),a=Hb(o,t),u=i.concat(a.length?a:No(n=r)?Ur(n).filter(wo).fold(q([]),function(e){return[n,e]}):wo(n)?[n]:[]);return W(u,ma)},$b=function(){return Ob([])},Wb=function(e,t){return n=ar.fromDom(t.cloneContents()),r=qb(e,t),o=V(r,function(e,t){return Ii(t,e),t},n),0<r.length?Ob([o]):o;var n,r,o},Kb=function(e,o){return(t=e,n=o[0],ta(n,"table",d(Lr,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=Ub(e);return jb(r,t,n).map(function(e){return Ob([Vb(e)])})}).getOrThunk($b);var t,n},Xb=function(e,t){var n,r,o=ym(t,e);return 0<o.length?Kb(e,o):(n=e,0<(r=t).length&&r[0].collapsed?$b():Wb(n,r[0]))},Yb=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return c=e,_.from(c.selection.getRng()).map(function(e){var t=c.dom.add(c.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),n=ba(t.innerText);return c.dom.remove(t),n}).getOr("");t.getInner=!0;var n,r,o,i,a,u,s,c,l=(r=t,i=(n=e).selection.getRng(),a=n.dom.create("body"),u=n.selection.getSel(),s=Db(n,dm(u)),(o=r.contextual?Xb(ar.fromDom(n.getBody()),s).dom():i.cloneContents())&&a.appendChild(o),n.selection.serializer.serialize(a,r));return"tree"===t.format?l:(t.content=e.selection.isCollapsed()?"":l,e.fire("GetContent",t),t.content)},Gb=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Jb=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return _.from(i).map(ar.fromDom).map(function(e){return r&&t.collapsed?e:Wr(e,o(e,a)).getOr(e)}).bind(function(e){return dr(e)?_.some(e):Ur(e)}).map(function(e){return e.dom()}).getOr(e)},Qb=function(e,t,n){return Jb(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},Zb=function(e,t,n){return Jb(e,t,!1,n,function(e,t){return 0<t?t-1:t})},eC=function(e,t){for(var n=e;e&&zo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},tC=Xt.each,nC=function(e){return!!e.select},rC=function(e){return!(!e||!e.ownerDocument)&&Fr(ar.fromDom(e.ownerDocument),ar.fromDom(e))},oC=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return Gb(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===rh(c)){var i=tp(c);if(i.isSome())return i.map(function(e){return Db(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&!zo.isRestrictedNode(e.anchorNode)&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=Db(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(nC(o)||rC(o.startContainer)&&rC(o.endContainer))){var o,i=nC(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||fe.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(Kh(u,n,c.getBody(),!0),i(n))},getContent:function(e){return Yb(c,e)},setContent:r,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,_.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Kh(r,n,e,!0),Kh(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?eC(r.nextSibling,!0):r.parentNode,o=0===a?eC(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return Qb(c.getBody(),m(),e)},getEnd:function(e){return Zb(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Qb(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Zb(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new fo(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!gm(t)&&Xh(c)){var n=Sg(u,e);return n.each(function(e){i(e,g())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};tC(a,function(e,n){tC(r,function(t){if(u.is(t,n))return i[n]||(tC(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),tC(i,function(e,t){o[t]||(delete i[t],tC(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),p},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return kb(c,e,t)},placeCaretAt:function(e,t){return i(Rb(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?Su.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=wb(p),t=Sb(p,c),p.bookmarkManager=n,p.controlSelection=t,p};(xb=Cb||(Cb={}))[xb.Br=0]="Br",xb[xb.Block=1]="Block",xb[xb.Wrap=2]="Wrap",xb[xb.Eol=3]="Eol";var iC=function(e,t){return e===Nu.Backwards?t.reverse():t},aC=function(e,t,n,r){for(var o,i,a,u,s,c,l=Xs(n),f=r,d=[];f&&(s=l,c=f,o=t===Nu.Forwards?s.next(c):s.prev(c));){if(zo.isBr(o.getNode(!1)))return t===Nu.Forwards?{positions:iC(t,d).concat([o]),breakType:Cb.Br,breakAt:_.some(o)}:{positions:iC(t,d),breakType:Cb.Br,breakAt:_.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,zo.isBr(u.getNode(i===Nu.Forwards))?Cb.Br:!1===Ns(a,u)?Cb.Block:Cb.Wrap);return{positions:iC(t,d),breakType:m,breakAt:_.some(o)}}d.push(o),f=o}else f=o}return{positions:iC(t,d),breakType:Cb.Eol,breakAt:_.none()}},uC=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Nu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},sC=function(e,i){return V(e,function(e,o){return e.fold(function(){return _.some(o)},function(r){return eu(Z(r.getClientRects()),Z(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},_.none())},cC=function(t,e){return Z(e.getClientRects()).bind(function(e){return sC(t,e.left)})},lC=d(aC,wu.isAbove,-1),fC=d(aC,wu.isBelow,1),dC=d(uC,-1,lC),mC=d(uC,1,fC),gC=zo.isContentEditableFalse,pC=Ga,hC=function(e,t,n,r){var o=e===Nu.Forwards,i=o?Bf:Pf;if(!r.collapsed){var a=pC(r);if(gC(a))return rg(e,t,a,e===Nu.Backwards,!0)}var u=wa(r.startContainer),s=Ds(e,t.getBody(),r);if(i(s))return og(t,s.getNode(!o));var c=zl.normalizePosition(o,n(s));if(!c)return u?r:null;if(i(c))return rg(e,t,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&Ps(c,l)?rg(e,t,l.getNode(!o),o,!0):u?ag(t,c.toRange(),!0):null},vC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=pC(r),o=Ds(e,t.getBody(),r),i=n(t.getBody(),dv(1),o),a=U(i,mv(1)),s=Ht.last(o.getClientRects()),(Bf(o)||Lf(o))&&(d=o.getNode()),(Pf(o)||Ff(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=bv(a,c))&&gC(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),rg(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Xs(t),f=[],d=0,m=function(e){return Ht.last(e.getClientRects())};1===e?(o=l.next,i=Xa,a=Ka,u=Su.after(r)):(o=l.prev,i=Ka,a=Xa,u=Su.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,Ht.last(f))&&d++,(s=qa(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),dv(1),d);if(u=bv(U(m,mv(1)),c))return ag(t,u.position.toRange(),!0);if(u=Ht.last(U(m,mv(0))))return ag(t,u.position.toRange(),!0)}},yC=function(e,t,n){var r,o,i,a,u=Xs(e.getBody()),s=d(Bs,u.next),c=d(Bs,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(Su.fromRangeStart(n)):c(Su.fromRangeStart(n)))||(a=(i=e).dom.create(Cl(i)),(!fe.ie||11<=fe.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},bC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Xs((e=l).getBody()),o=d(Bs,r.next),i=d(Bs,r.prev),a=t?Nu.Forwards:Nu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=hC(a,e,u,s))?n:(n=yC(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},CC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?fv:lv,i=(e=u).selection.getRng(),(n=vC(r,e,o,i))?n:(n=yC(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},xC=function(r,o){return function(){var t,e=o?Su.fromRangeEnd(r.selection.getRng()):Su.fromRangeStart(r.selection.getRng()),n=o?fC(r.getBody(),e):lC(r.getBody(),e);return(o?ee(n.positions):Z(n.positions)).filter((t=o,function(e){return t?Pf(e):Bf(e)})).fold(q(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},wC=function(e,t,n,r,o){var i,a,u,s,c=Gi(ar.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=qa(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,V(a,function(e,r){return e.fold(function(){return _.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return _.some(n<t?r:e)})},_.none())).map(function(e){return e.cell})},NC=d(wC,function(e){return e.bottom},function(e,t){return e.y<t}),EC=d(wC,function(e){return e.top},function(e,t){return e.y>t}),SC=function(t,n){return Z(n.getClientRects()).bind(function(e){return NC(t,e.left,e.top)}).bind(function(e){return cC((t=e,ic.lastPositionIn(t).map(function(e){return lC(t,e).positions.concat(e)}).getOr([])),n);var t})},TC=function(t,n){return ee(n.getClientRects()).bind(function(e){return EC(t,e.left,e.top)}).bind(function(e){return cC((t=e,ic.firstPositionIn(t).map(function(e){return[e].concat(fC(t,e).positions)}).getOr([])),n);var t})},kC=function(e,t){e.selection.setRng(t),_b(e,t)},_C=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===Cb.Wrap&&0===a.positions.length||!zo.isBr(n.getNode())&&(i=u).breakType===Cb.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},AC=d(_C,lC),RC=d(_C,fC),DC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(ls()&&(o=t,i=s,a=n,u=Su.fromRangeStart(i),ic.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=rg(c,e,n,!t,!0);return kC(e,l),!0}return!1},OC=function(e,t){var n=t.getNode(e);return zo.isElement(n)&&"TABLE"===n.nodeName?_.some(n):_.none()},BC=function(u,s,c){var e=OC(!!s,c),t=!1===s;e.fold(function(){return kC(u,c.toRange())},function(a){return ic.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return kC(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Cl(r=u))?r.undoManager.transact(function(){var e=ar.fromTag(i);xr(e,xl(r)),Ii(e,ar.fromTag("br")),n?Bi(ar.fromDom(o),e):Oi(ar.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),kC(r,t)}):kC(r,t.toRange()));var n,r,o,t,i})})},PC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Su.fromRangeStart(l),d=e.getBody();if(!t&&AC(r,f)){var m=(u=d,SC(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return sC(dC(u,Su.before(s)),e.left)})}).getOr(Su.before(s)));return BC(e,t,m),!0}return!(!t||!RC(r,f))&&(o=d,m=TC(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return sC(mC(o,Su.after(i)),e.left)})}).getOr(Su.after(i)),BC(e,t,m),!0)},IC=function(t,n){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return _.from(t.dom.getParent(e,"table")).map(function(e){return DC(t,n,e)})}).getOr(!1)}},LC=function(n,r){return function(){return _.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return _.from(n.dom.getParent(t,"table")).map(function(e){return PC(n,r,e,t)})}).getOr(!1)}},FC=function(e){return F(["figcaption"],lr(e))},MC=function(e){var t=j.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},zC=function(e,t,n){n?Ii(e,t):Pi(e,t)},UC=function(e,t,n,r){return""===t?(l=e,f=r,d=ar.fromTag("br"),zC(l,d,f),MC(d)):(o=e,i=r,a=t,u=n,s=ar.fromTag(a),c=ar.fromTag("br"),xr(s,u),Ii(s,c),zC(o,s,i),MC(c));var o,i,a,u,s,c,l,f,d},VC=function(e,t,n){return t?(o=e.dom(),fC(o,n).breakAt.isNone()):(r=e.dom(),lC(r,n).breakAt.isNone());var r,o},jC=function(t,n){var e,r,o,i=ar.fromDom(t.getBody()),a=Su.fromRangeStart(t.selection.getRng()),u=Cl(t),s=xl(t);return(e=a,r=i,o=d(Lr,r),ea(ar.fromDom(e.container()),yo,o).filter(FC)).exists(function(){if(VC(i,n,a)){var e=UC(i,u,s,n);return t.selection.setRng(e),!0}return!1})},HC=function(e,t){return function(){return!!e.selection.isCollapsed()&&jC(e,t)}},qC=function(e,r){return G(W(e,function(e){return Ky({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},$C=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},WC=function(e,t){return X(qC(e,t),function(e){return e.action()})},KC=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=or.detect().os,WC([{keyCode:Ev.RIGHT,action:bC(t,!0)},{keyCode:Ev.LEFT,action:bC(t,!1)},{keyCode:Ev.UP,action:CC(t,!1)},{keyCode:Ev.DOWN,action:CC(t,!0)},{keyCode:Ev.RIGHT,action:IC(t,!0)},{keyCode:Ev.LEFT,action:IC(t,!1)},{keyCode:Ev.UP,action:LC(t,!1)},{keyCode:Ev.DOWN,action:LC(t,!0)},{keyCode:Ev.RIGHT,action:Wd.move(t,n,!0)},{keyCode:Ev.LEFT,action:Wd.move(t,n,!1)},{keyCode:Ev.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Wd.moveNextWord(t,n)},{keyCode:Ev.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Wd.movePrevWord(t,n)},{keyCode:Ev.UP,action:HC(t,!1)},{keyCode:Ev.DOWN,action:HC(t,!0)}],r).each(function(e){r.preventDefault()}))})},XC=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,WC([{keyCode:Ev.BACKSPACE,action:$C(od,t,!1)},{keyCode:Ev.DELETE,action:$C(od,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(sg,t,!1)},{keyCode:Ev.DELETE,action:$C(sg,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(Gd,t,n,!1)},{keyCode:Ev.DELETE,action:$C(Gd,t,n,!0)},{keyCode:Ev.BACKSPACE,action:$C(Am,t,!1)},{keyCode:Ev.DELETE,action:$C(Am,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(vf,t,!1)},{keyCode:Ev.DELETE,action:$C(vf,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(mf,t,!1)},{keyCode:Ev.DELETE,action:$C(mf,t,!0)},{keyCode:Ev.BACKSPACE,action:$C(eg,t,!1)},{keyCode:Ev.DELETE,action:$C(eg,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,WC([{keyCode:Ev.BACKSPACE,action:$C(id,t)},{keyCode:Ev.DELETE,action:$C(id,t)}],n))})},YC=function(e){return _.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},GC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new fo(t,t);r=n.current();){if(zo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else zo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},JC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},QC=YC,ZC=function(e){return YC(e).fold(q(""),function(e){return e.nodeName.toUpperCase()})},ex=function(e){return YC(e).filter(function(e){return No(ar.fromDom(e))}).isSome()},tx=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},nx=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},rx=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},ox=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!zo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},ix=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;nx(u=n)&&nx(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(ox(n,r,!0)&&ox(n,r,!1))tx(n,"LI")?i.insertAfter(l,rx(n)):i.replace(l,n);else if(ox(n,r,!0))tx(n,"LI")?(i.insertAfter(l,rx(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(ox(n,r,!1))i.insertAfter(l,rx(n));else{n=rx(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),GC(e,l)}},ax=function(e){e.innerHTML='<br data-mce-bogus="1">'},ux=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},sx=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},cx=function(e,t,n){return!1===zo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===ya?0:n:n===t.data.length-1&&t.data.charAt(n)===ya?t.data.length:n},lx=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},fx=function(e,t){var n=Cl(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,xl(e))},dx=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,y,b,C,x=a.dom,w=a.schema,N=w.getNonEmptyElements(),E=a.selection.getRng(),S=function(e){var t,n,r,o=s,i=w.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=x.create(e||m),fx(a,t)):t=c.cloneNode(!1),r=t,!1===El(a))x.setAttrib(t,"style",null),x.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Xu(o)||pc(o))continue;n=o.cloneNode(!1),x.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return ax(r),t},T=function(e){var t,n,r,o;if(o=cx(e,s,i),zo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&zo.isElement(s)&&s===c.firstChild)return!0;if(ux(s,"TABLE")||ux(s,"HR"))return g&&!e||!g&&e;for(t=new fo(s,c),zo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(zo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),N[r]&&"br"!==r))return!1}else if(zo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},k=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?S(m):S(),Sl(a)&&sx(x,l)&&x.isEmpty(c)?r=x.split(l,c):x.insertAfter(r,c),GC(a,r)};Sg(x,E).each(function(e){E.setStart(e.startContainer,e.startOffset),E.setEnd(e.endContainer,e.endOffset)}),s=E.startContainer,i=E.startOffset,m=Cl(a),n=e.shiftKey,zo.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&zo.isText(s)?s.nodeValue.length:0),(u=lx(x,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=lx(m,r);if(!(a=m.getParent(r,m.isBlock))||!sx(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),fx(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),fx(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,E,s,i)),c=x.getParent(s,x.isBlock),l=c?x.getParent(c.parentNode,x.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&x.isEmpty(c)?ix(a,S,l,c,m):m&&c===a.getBody()||(m=m||"P",wa(c)?(r=Da(c),x.isEmpty(c)&&ax(c),GC(a,r)):T()?k():T(!0)?(r=c.parentNode.insertBefore(S(),c),GC(a,ux(c,"HR")?r:c)):((t=(b=E,C=b.cloneRange(),C.setStart(b.startContainer,cx(!0,b.startContainer,b.startOffset)),C.setEnd(b.endContainer,cx(!1,b.endContainer,b.endOffset)),C).cloneRange()).setEndAfter(c),o=t.extractContents(),y=o,z(Yi(ar.fromDom(y),mr),function(e){var t=e.dom();t.nodeValue=ba(t.nodeValue)}),function(e){for(;zo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,x.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;zo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(x,N,r),p=x,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),x.isEmpty(c)&&ax(c),r.normalize(),x.isEmpty(r)?(x.remove(r),k()):GC(a,r)),x.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},mx=function(e,t){return QC(e).filter(function(e){return 0<t.length&&Pr(ar.fromDom(e),t)}).isSome()},gx=function(e){return mx(e,wl(e))},px=function(e){return mx(e,Nl(e))},hx=yf([{br:[]},{block:[]},{none:[]}]),vx=function(e,t){return px(e)},yx=function(n){return function(e,t){return""===Cl(e)===n}},bx=function(n){return function(e,t){return ex(e)===n}},Cx=function(n,r){return function(e,t){return ZC(e)===n.toUpperCase()===r}},xx=function(e){return Cx("pre",e)},wx=function(n){return function(e,t){return bl(e)===n}},Nx=function(e,t){return gx(e)},Ex=function(e,t){return t},Sx=function(e){var t=Cl(e),n=JC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},Tx=function(e,t){return function(n,r){return V(e,function(e,t){return e&&t(n,r)},!0)?_.some(t):_.none()}},kx=function(e,t){return hd([Tx([vx],hx.none()),Tx([Cx("summary",!0)],hx.br()),Tx([xx(!0),wx(!1),Ex],hx.br()),Tx([xx(!0),wx(!1)],hx.block()),Tx([xx(!0),wx(!0),Ex],hx.block()),Tx([xx(!0),wx(!0)],hx.br()),Tx([bx(!0),Ex],hx.br()),Tx([bx(!0)],hx.block()),Tx([yx(!0),Ex,Sx],hx.block()),Tx([yx(!0)],hx.br()),Tx([Nx],hx.br()),Tx([yx(!1),Ex],hx.br()),Tx([Sx],hx.block())],[e,t.shiftKey]).getOr(hx.none())},_x=function(e,t){kx(e,t).fold(function(){Ig(e,t)},function(){dx(e,t)},o)},Ax=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===Ev.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),_x(t,n)})))})},Rx=function(n,r){var e=r.container(),t=r.offset();return zo.isText(e)?(e.insertData(t,n),_.some(wu(e,t+n.length))):Os(r).map(function(e){var t=ar.fromText(n);return r.isAtEnd()?Bi(e,t):Oi(e,t),wu(t.dom(),n.length)})},Dx=d(Rx,"\xa0"),Ox=d(Rx," "),Bx=function(e,t,n){return ic.navigateIgnore(e,t,n,Df)},Px=function(e,t){return X(rf(ar.fromDom(t.container()),e),yo)},Ix=function(e,n,r){return Bx(e,n.dom(),r).forall(function(t){return Px(n,r).fold(function(){return!1===Ns(t,r,n.dom())},function(e){return!1===Ns(t,r,n.dom())&&Fr(e,ar.fromDom(t.container()))})})},Lx=function(t,n,r){return Px(n,r).fold(function(){return Bx(t,n.dom(),r).forall(function(e){return!1===Ns(e,r,n.dom())})},function(e){return Bx(t,e.dom(),r).isNone()})},Fx=d(Lx,!1),Mx=d(Lx,!0),zx=d(Ix,!1),Ux=d(Ix,!0),Vx=function(e){return wu.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},jx=function(e,t){var n=U(rf(ar.fromDom(t.container()),e),yo);return Z(n).getOr(e)},Hx=function(e,t){return Vx(t)?Rf(t):Rf(t)||ic.prevPosition(jx(e,t).dom(),t).exists(Rf)},qx=function(e,t){return Vx(t)?Af(t):Af(t)||ic.nextPosition(jx(e,t).dom(),t).exists(Af)},$x=function(e){return Os(e).bind(function(e){return ea(e,dr)}).exists(function(e){return t=Sr(e,"white-space"),F(["pre","pre-wrap"],t);var t})},Wx=function(e,t){return o=e,i=t,ic.prevPosition(o.dom(),i).isNone()||(n=e,r=t,ic.nextPosition(n.dom(),r).isNone())||Fx(e,t)||Mx(e,t)||wf(e,t)||xf(e,t);var n,r,o,i},Kx=function(e,t){var n,r,o,i=(r=(n=t).container(),o=n.offset(),zo.isText(r)&&o<r.data.length?wu(r,o+1):n);return!$x(i)&&(Mx(e,i)||Ux(e,i)||xf(e,i)||qx(e,i))},Xx=function(e,t){return n=e,!$x(r=t)&&(Fx(n,r)||zx(n,r)||wf(n,r)||Hx(n,r))||Kx(e,t);var n,r},Yx=function(e,t){return Sf(e.charAt(t))},Gx=function(e){var t=e.container();return zo.isText(t)&&Yn(t.data,"\xa0")},Jx=function(e){var n,t=e.data,r=(n=t.split(""),W(n,function(e,t){return Sf(e)&&0<t&&t<n.length-1&&kf(n[t-1])&&kf(n[t+1])?" ":e}).join(""));return r!==t&&(e.data=r,!0)},Qx=function(l,e){return _.some(e).filter(Gx).bind(function(e){var t,n,r,o,i,a,u,s,c=e.container();return i=l,u=(a=c).data,s=wu(a,0),Yx(u,0)&&!Xx(i,s)&&(a.data=" "+u.slice(1),1)||Jx(c)||(t=l,r=(n=c).data,o=wu(n,r.length-1),Yx(r,r.length-1)&&!Xx(t,o)&&(n.data=r.slice(0,-1)+" ",1))?_.some(e):_.none()})},Zx=function(t){var e=ar.fromDom(t.getBody());t.selection.isCollapsed()&&Qx(e,wu.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},ew=function(r,o){return function(e){return t=r,!$x(n=e)&&(Wx(t,n)||Hx(t,n)||qx(t,n))?Dx(o):Ox(o);var t,n}},tw=function(e){var t,n,r=Su.fromRangeStart(e.selection.getRng()),o=ar.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=d(zl.isInlineTarget,e),a=Su.fromRangeStart(e.selection.getRng());return Pd(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return ic.prevPosition(n.dom(),Su.before(e))},function(e){return ic.firstPositionIn(e)},function(e){return ic.lastPositionIn(e)},function(e){return ic.nextPosition(n.dom(),Su.after(e))})})).bind(ew(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1},nw=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,WC([{keyCode:Ev.SPACEBAR,action:$C(tw,t)}],n).each(function(e){n.preventDefault()}))})},rw=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(Da(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},ow=function(e,t){var n,r=(n=e,na(ar.fromDom(n.getBody()),"*[data-mce-caret]").fold(q(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void rw(e,r)):void(Sa(r)&&(rw(e,r),e.undoManager.add()))},iw=function(e){e.on("keyup compositionstart",d(ow,e))},aw=or.detect().browser,uw=function(t){var e,n;e=t,n=Ui(function(){e.composing||Zx(e)},0),aw.isIE()&&(e.on("keypress",function(e){n.throttle()}),e.on("remove",function(e){n.cancel()})),t.on("input",function(e){!1===e.isComposing&&Zx(t)})},sw=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,WC([{keyCode:Ev.END,action:xC(t,!0)},{keyCode:Ev.HOME,action:xC(t,!1)}],n).each(function(e){n.preventDefault()}))})},cw=function(e){var t=Wd.setupSelectedState(e);iw(e),KC(e,t),XC(e,t),Ax(e),nw(e),uw(e),sw(e)};function lw(u){var s,n,r,o=Xt.each,c=Ev.BACKSPACE,l=Ev.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=fe.gecko,a=fe.ie,m=fe.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},y=function(){u.shortcuts.add("meta+a",null,"SelectAll")},b=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<fe.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===Ev.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),fe.windowsPhone||u.on("keyup focusin mouseup",function(e){Ev.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(Ea(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),b(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),fe.iOS?(u.inline||u.on("keydown",function(){j.document.activeElement===j.document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):y()),11<=fe.ie&&(C(),b()),fe.ie&&(y(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=Rb(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),j.Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),he.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),he.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),fe.mac&&u.on("keydown",function(e){!Ev.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),b()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var fw=function(e){return zo.isElement(e)&&xo(ar.fromDom(e))},dw=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=wu.fromRangeStart(t),r=wu.fromRangeEnd(t);if(wu.isElementPosition(n)){var o=n.container();fw(o)&&ic.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}wu.isElementPosition(r)&&(o=n.container(),fw(o)&&ic.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(al(t))}(t)})},mw=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){z(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){z(e,function(e){var t=e.attr("data-mce-open");e.attr("open",S(t)?t:null),e.attr("data-mce-open",null)})})},gw=Ni.DOM,pw=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&he.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},hw=function(t,e){var n,r,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||f.content_editable||(m.open(),m.write(t.iframeHTML),m.close()),f.content_editable&&(t.on("remove",function(){var e=this.getBody();gw.removeClass(e,"mce-content-body"),gw.removeClass(e,"mce-edit-focus"),gw.setAttrib(e,"contentEditable",null)}),gw.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||j.document,t.contentWindow=f.content_window||j.window,t.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===gw.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=zh(t),t.schema=li(f),t.dom=Ni(m,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:f.content_editable,schema:t.schema,contentCssCors:Ll(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=mb((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new nb("br",1)).shortEnded=!0)}),o),t.serializer=yb(f,t),t.selection=oC(t.dom,t.getWin(),t.serializer,t),t.annotator=Uc(t),t.formatter=qy(t),t.undoManager=Jv(t),t._nodeChangeDispatcher=new Yh(t),t._selectionOverrides=_v(t),mw(t),dw(t),cw(t),Hh(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,gw.setAttrib(n,"spellcheck","false")),t.quirks=lw(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){Xt.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Xt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?gw.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){pw(t)},function(e){pw(t)}),f.content_style&&(a=t,s=f.content_style,c=ar.fromDom(a.getDoc().head),l=ar.fromTag("style"),Cr(l,"type","text/css"),Ii(l,ar.fromText(s)),Ii(c,l))},vw=Ni.DOM,yw=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=ml(e),s=ar.fromTag("iframe"),xr(s,i),xr(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Er(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,g,p=function(e,t){if(j.document.domain!==j.window.location.hostname&&fe.ie&&fe.ie<12){var n=Mh.uuid("mce");e[n]=function(){hw(e)};var r='javascript:(function(){document.open();document.domain="'+j.document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return vw.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(g=gl(f=e)+"<html><head>",pl(f)!==f.documentBaseUrl&&(g+='<base href="'+f.documentBaseURI.getURI()+'" />'),g+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=hl(f),m=vl(f),yl(f)&&(g+='<meta http-equiv="Content-Security-Policy" content="'+yl(f)+'" />'),g+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),vw.add(t.iframeContainer,l),p},bw=function(e,t){var n=yw(e,t);t.editorContainer&&(vw.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=vw.isHidden(t.editorContainer)),e.getElement().style.display="none",vw.setAttrib(e.id,"aria-hidden","true"),n||hw(e)},Cw=Ni.DOM,xw=function(t,n,e){var r=Nh.get(e),o=Nh.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Xt.trim(e),r&&-1===Xt.inArray(n,e)){if(Xt.each(Nh.dependencies(e),function(e){xw(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(nE){wh.pluginInitError(t,e,nE)}}},ww=function(e){return e.replace(/^\-/,"")},Nw=function(e){return{editorContainer:e,iframeContainer:e}},Ew=function(e){var t,n,r=e.getElement();return e.inline?Nw(null):(t=r,n=Cw.create("div"),Cw.insertAfter(n,t),Nw(n))},Sw=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,S(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Cw.getStyle(f,"width")||"100%",a=l.height||Cw.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<u&&(a=u),c.height=a,c):D(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:r.offsetHeight,n):Ew(e)},Tw=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||Cw.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,S(o)?(n.settings.theme=ww(o),r=Eh.get(o),n.theme=new r(n,Eh.urls[o]),n.theme.init&&n.theme.init(n,Eh.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],Xt.each(i.settings.plugins.split(/[ ,]/),function(e){xw(i,a,ww(e))}),e=Sw(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&Xt.each(Xt.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?hw(t):bw(t,e)},kw=Ni.DOM,_w=function(e){return"-"===e.charAt(0)},Aw=function(i,a){var u=_i.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(S(i)){if(!_w(i)&&!Eh.urls.hasOwnProperty(i)){var a=o.theme_url;a?Eh.load(i,t.documentBaseURI.toAbsolute(a)):Eh.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Eh.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,Xt.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),Xt.each(r.external_plugins,function(e,t){Nh.load(t,e),r.plugins+=" "+t}),Xt.each(r.plugins.split(/[ ,]/),function(e){if((e=Xt.trim(e))&&!Nh.urls[e])if(_w(e)){e=e.substr(1,e.length);var t=Nh.dependencies(e);Xt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=Nh.createUrl(t,e),Nh.load(e.resource,e)})}else Nh.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||Tw(i)},i,function(e){wh.pluginLoadError(i,e[0]),i.removed||Tw(i)})})},Rw=function(t){var e=t.settings,n=t.id,r=function(){kw.unbind(j.window,"ready",r),t.render()};if(Se.Event.domLoaded){if(t.getElement()&&fe.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||kw.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(kw.insertAfter(kw.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},kw.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=mh(t),t.notificationManager=dh(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=kw.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(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),Aw(t,t.suffix)}}else kw.bind(j.window,"ready",r)},Dw=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},Ow=Xt.each,Bw=Xt.trim,Pw="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Iw={ftp:21,http:80,https:443,mailto:25},Lw=function(r,e){var t,n,o=this;if(r=Bw(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new Lw(j.document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),Ow(Pw,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};Lw.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new Lw(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new Lw(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Iw[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),Ow(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},Lw.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},Lw.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var Fw=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Xt.trim(Pv.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=ba(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=Cl(o),u=new RegExp("^(<"+a+"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||ko(ar.fromDom(n))?t.content=r:t.content=Xt.trim(r),t.no_events||e.fire("GetContent",t),t.content},Mw=function(e,t){t(e),e.firstChild&&Mw(e.firstChild,t),e.next&&Mw(e.next,t)},zw=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Mw(t.firstChild,function(t){z(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),z(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);z(r,function(t){z(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Uw=function(e){return e instanceof nb},Vw=function(e,t){var r;e.dom.setHTML(e.getBody(),t),rh(r=e)&&ic.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=zo.isTable(t)?ic.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},jw=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Uw(s)?"":s,Uw(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),_.from(u.getBody()).fold(q(s),function(e){return Uw(s)?function(e,t,n,r){zw(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=rl({validate:e.validate},e.schema).serialize(n);return r.content=ko(ar.fromDom(t))?o:Xt.trim(o),Vw(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=Cl(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),Vw(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=rl({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=ko(ar.fromDom(n))?r:Xt.trim(r),Vw(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Hw=Ni.DOM,qw=function(e){return _.from(e).each(function(e){return e.destroy()})},$w=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Hw.remove(o.nextSibling),vp(e),e.editorManager.remove(e),!e.inline&&r&&(i=e,Hw.setStyle(i.id,"display",i.orgDisplay)),yp(e),Hw.remove(e.getContainer()),qw(t),qw(n),e.destroy()}var i},Ww=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),qw(i),qw(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Hw.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Kw=Ni.DOM,Xw=Xt.extend,Yw=Xt.each,Gw=Xt.resolve,Jw=fe.ie,Qw=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,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_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",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:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=Up(Bp,c,a,u),l.settings=t,Di.language=t.language||"en",Di.languageLoad=t.language_load,Di.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new Lw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Kp(l),l.loadedCSS={},l.editorCommands=new cp(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(fe.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(fe.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=gn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Xw(Qw.prototype={render:function(){Rw(this)},focus:function(e){nh(this,e)},hasFocus:function(){return rh(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Gw(r):0,o=Gw(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Xt.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return jp(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return Dw(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:Mh.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(Kw.show(this.getContainer()),Kw.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Jw&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(Kw.hide(e.getContainer()),Kw.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=Kw.getParent(r.id,"form"))&&Yw(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return jw(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),_.from(t.getBody()).fold(q("tree"===n.format?new nb("body",11):""),function(e){return Fw(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Xw({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==Sp(t=this)&&(t.initialized?Ep(t,"readonly"===n):t.on("init",function(){Ep(t,"readonly"===n)}),bp(t,n))},getContainer:function(){return this.container||(this.container=Kw.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=Kw.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Yw(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){$w(this)},destroy:function(e){Ww(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},Dp);var Zw,eN,tN,nN={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},rN=function(n,e){var t,r;or.detect().browser.isIE()?(r=n).on("focusout",function(){Zg(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Zg(n)})},oN=function(e){var t,n,r,o=Ui(function(){Zg(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},Ni.DOM.bind(j.document,"mouseup",r),t.on("remove",function(){Ni.DOM.unbind(j.document,"mouseup",r)})),e.on("init",function(){rN(e,o)}),e.on("remove",function(){o.cancel()})},iN=Ni.DOM,aN=function(e){return nN.isEditorUIElement(e)},uN=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==iN.getParent(e,function(e){return aN(e)||!!n&&t.dom.is(e,n)})},sN=function(r,e){var t=e.editor;oN(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;he.setEditorTimeout(t,function(){var e=r.focusedEditor;uN(t,function(){try{return j.document.activeElement}catch(e){return j.document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Zw||(Zw=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===j.document&&(t===j.document.body||uN(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},iN.bind(j.document,"focusin",Zw))},cN=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(iN.unbind(j.document,"focusin",Zw),Zw=null)},lN=function(e){e.on("AddEditor",d(sN,e)),e.on("RemoveEditor",d(cN,e))},fN=Ni.DOM,dN=Xt.explode,mN=Xt.each,gN=Xt.extend,pN=0,hN=!1,vN=[],yN=[],bN=function(t){var n=t.type;mN(tN.get(),function(e){switch(n){case"scroll":e.fire("ScrollWindow",t);break;case"resize":e.fire("ResizeWindow",t)}})},CN=function(e){e!==hN&&(e?gn(window).on("resize scroll",bN):gn(window).off("resize scroll",bN),hN=e)},xN=function(t){var e=yN;delete vN[t.id];for(var n=0;n<vN.length;n++)if(vN[n]===t){vN.splice(n,1);break}return yN=U(yN,function(e){return t!==e}),tN.activeEditor===t&&(tN.activeEditor=0<yN.length?yN[0]:null),tN.focusedEditor===t&&(tN.focusedEditor=null),e.length!==yN.length};gN(tN={defaultSettings:{},$:gn,majorVersion:"4",minorVersion:"9.8",releaseDate:"2020-01-28",editors:vN,i18n:hh,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=Lw.getDocumentBaseUrl(j.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=j.document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&j.document.currentScript&&(-1!==(r=j.document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new Lw(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new Lw(this.baseURL),this.suffix=o,lN(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new Lw(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Lw(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Di.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Xt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!fN.get(t)?e.name:fN.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):fN.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Qw(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};fN.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=gn.unique(function(t){var e,n=[];if(fe.ie&&fe.ie<11)return wh.initError("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(t.types)return mN(t.types,function(e){n=n.concat(fN.select(e.selector))}),n;if(t.selector)return fN.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&mN(dN(e),function(t){var e;(e=fN.get(t))?n.push(e):mN(j.document.forms,function(e){mN(e.elements,function(e){e.name===t&&(t="mce_editor_"+pN++,fN.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":mN(fN.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?mN(r.types,function(t){Xt.each(o,function(e){return!fN.is(e,t.selector)||(n(c(e),gN({},r,t),e),!1)})}):(Xt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(xN(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Xt.grep(o,function(e){return!s.get(e.id)})).length?f([]):mN(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?wh.initError("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,fN.bind(window,"ready",e),new de(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?yN.slice(0):S(t)?X(yN,function(e){return e.id===t}).getOr(null):O(t)&&yN[t]?yN[t]:null},add:function(e){var t=this;return vN[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(vN[e.id]=e),vN.push(e),yN.push(e)),CN(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),eN||(eN=function(){t.fire("BeforeUnload")},fN.bind(window,"beforeunload",eN))),e},createEditor:function(e,t){return this.add(new Qw(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!S(e))return n=e,A(r.get(n.id))?null:(xN(n)&&r.fire("RemoveEditor",{editor:n}),0===yN.length&&fN.unbind(window,"beforeunload",eN),n.remove(),CN(0<yN.length),n);mN(fN.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=yN.length-1;0<=t;t--)r.remove(yN[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Qw(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){mN(yN,function(e){e.save()})},addI18n:function(e,t){hh.add(e,t)},translate:function(e){return hh.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},gp),tN.setup();var wN,NN=tN;function EN(n){return{walk:function(e,t){return Bc(n,e,t)},split:Mm,normalize:function(t){return Sg(n,t).fold(q(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(wN=EN||(EN={})).compareRanges=yg,wN.getCaretRangeFromPoint=Rb,wN.getSelectedNode=Ga,wN.getNode=Ja;var SN,TN,kN=EN,_N=Math.min,AN=Math.max,RN=Math.round,DN=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=RN(s/2)),"c"===n[1]&&(r+=RN(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=RN(a/2)),"c"===n[4]&&(r-=RN(i/2)),ON(r,o,i,a)},ON=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},BN={inflate:function(e,t,n){return ON(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:DN,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=DN(e,t,r[i])).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},intersect:function(e,t){var n,r,o,i;return n=AN(e.x,t.x),r=AN(e.y,t.y),o=_N(e.x+e.w,t.x+t.w),i=_N(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:ON(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=AN(0,t.x-u),o=AN(0,t.y-s),i=AN(0,c-f),a=AN(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),ON(u,s,(c-=i)-u,(l-=a)-s)},create:ON,fromClientRect:function(e){return ON(e.left,e.top,e.width,e.height)}},PN={},IN={add:function(e,t){PN[e.toLowerCase()]=t},has:function(e){return!!PN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=PN.hasOwnProperty(t)?PN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=PN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},LN=Xt.each,FN=Xt.extend,MN=function(){};MN.extend=SN=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!TN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in TN=!0,e=new this,TN=!1,n.Mixins&&(LN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&LN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&LN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&LN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=FN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=SN,i};var zN=Math.min,UN=Math.max,VN=Math.round,jN=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+jN(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+jN(e[i],n):"");return o+"}"}return""+e},HN={serialize:jN,parse:function(e){try{return JSON.parse(e)}catch(t){}}},qN={callbacks:{},count:0,send:function(t){var n=this,r=Ni.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},$N={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",$N.fire("beforeInitialize",{settings:e}),t=Sh()){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Xt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=$N.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Xt.extend($N,gp);var WN,KN,XN,YN,GN=Xt.extend,JN=function(e){this.settings=GN({},e),this.count=0};JN.sendRPC=function(e){return(new JN).send(e)},JN.prototype={send:function(n){var r=n.error,o=n.success;(n=GN(this.settings,n)).success=function(e,t){void 0===(e=HN.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=HN.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",$N.send(n)}};try{WN=j.window.localStorage}catch(nE){KN={},XN=[],YN={getItem:function(e){var t=KN[e];return t||null},setItem:function(e,t){XN.push(e),KN[e]=String(t)},key:function(e){return XN[e]},removeItem:function(t){XN=XN.filter(function(e){return e===t}),delete KN[t]},clear:function(){XN=[],KN={}},length:0},Object.defineProperty(YN,"length",{get:function(){return XN.length},configurable:!1,enumerable:!1}),WN=YN}var QN,ZN=NN,eE={geom:{Rect:BN},util:{Promise:de,Delay:he,Tools:Xt,VK:Ev,URI:Lw,Class:MN,EventDispatcher:fp,Observable:gp,I18n:hh,XHR:$N,JSON:HN,JSONRequest:JN,JSONP:qN,LocalStorage:WN,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=UN(0,zN(t,1)),n=UN(0,zN(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=VN(255*(u+a)),s=VN(255*(s+a)),c=VN(255*(c+a))}else u=s=c=VN(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=zN(e/=255,zN(t/=255,n/=255)))===(a=UN(e,UN(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:VN(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:VN(100*r),v:VN(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:Se,Sizzle:St,DomQuery:gn,TreeWalker:fo,DOMUtils:Ni,ScriptLoader:_i,RangeUtils:kN,Serializer:yb,ControlSelection:Sb,BookmarkManager:wb,Selection:oC,Event:Se.Event},html:{Styles:di,Entities:Zo,Node:nb,Schema:li,SaxParser:Ov,DomParser:mb,Writer:nl,Serializer:rl},ui:{Factory:IN},Env:fe,AddOnManager:Di,Annotator:Uc,Formatter:qy,UndoManager:Jv,EditorCommands:cp,WindowManager:mh,NotificationManager:dh,EditorObservable:Dp,Shortcuts:Kp,Editor:Qw,FocusManager:nN,EditorManager:NN,DOM:Ni.DOM,ScriptLoader:_i.ScriptLoader,PluginManager:Di.PluginManager,ThemeManager:Di.ThemeManager,trim:Xt.trim,isArray:Xt.isArray,is:Xt.is,toArray:Xt.toArray,makeMap:Xt.makeMap,each:Xt.each,map:Xt.map,grep:Xt.grep,inArray:Xt.inArray,extend:Xt.extend,create:Xt.create,walk:Xt.walk,createNS:Xt.createNS,resolve:Xt.resolve,explode:Xt.explode,_addCacheSuffix:Xt._addCacheSuffix,isOpera:fe.opera,isWebKit:fe.webkit,isIE:fe.ie,isGecko:fe.gecko,isMac:fe.mac},tE=ZN=Xt.extend(ZN,eE);QN=tE,window.tinymce=QN,window.tinyMCE=QN,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(tE)}(window);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinymce-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.9.
|
4
|
+
version: 4.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Pohlenz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|