/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=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)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.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)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.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+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,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(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===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]||oe.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]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(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(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),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!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.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:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))w.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=J.get(e,"fxshow");n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w});
-//= require jquery/dist/jquery.min.js
-
-var selected_url = null;
-
-function fileSelected(event) {
- event.preventDefault();
-
- var row = $(this).closest('tr');
- var url = row.data('url');
- var filename = row.data('name');
-
- selected_url = url;
- $('.file-selected').show();
- $('.select-and-close').removeAttr('disabled');
- $('#id_old_name').val(filename);
- $('#id_old_name2').val(filename);
- $('#id_new_name').val(filename);
-
- if (row.hasClass('image')) {
- var img = $('#pic img');
- img.attr('src', url);
- img.show();
- } else {
- $('#pic img').hide();
+/* flatpickr v4.5.0,, @license MIT */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.flatpickr=t()}(this,function(){"use strict";var Q=function(e){return("0"+e).slice(-2)},X=function(e){return!0===e?1:0};function ee(n,a,i){var o;return void 0===i&&(i=!1),function(){var e=this,t=arguments;null!==o&&clearTimeout(o),o=window.setTimeout(function(){o=null,i||n.apply(e,t)},a),i&&!o&&n.apply(e,t)}}var te=function(e){return e instanceof Array?e:[e]},e=function(){},ne=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},D={D:e,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*X(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t){var n=parseInt(t);return new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0)},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:e,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},w:e,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},ae={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},c={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[c.w(e,t,n)]},F:function(e,t,n){return ne(c.n(e,t,n)-1,!1,t)},G:function(e,t,n){return Q(c.h(e,t,n))},H:function(e){return Q(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[X(11<e.getHours())]},M:function(e,t){return ne(e.getMonth(),!0,t)},S:function(e){return Q(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return Q(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return Q(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return Q(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},ie={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(3<t&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},oe=function(e){var t=e.config,o=void 0===t?w:t,n=e.l10n,r=void 0===n?ie:n;return function(a,e,t){if(void 0!==o.formatDate)return o.formatDate(a,e);var i=t||r;return e.split("").map(function(e,t,n){return c[e]&&"\\"!==n[t-1]?c[e](a,i,o):"\\"!==e?e:""}).join("")}},re=function(e){var t=e.config,h=void 0===t?w:t,n=e.l10n,v=void 0===n?ie:n;return function(e,t,n){if(0===e||e){var a,i=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var o=t||(h||w).dateFormat,r=String(e).trim();if("today"===r)a=new Date,n=!0;else if(/Z$/.test(r)||/GMT$/.test(r))a=new Date(e);else if(h&&h.parseDate)a=h.parseDate(e,o);else{a=h&&h.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var c,l=[],d=0,s=0,u="";d<o.length;d++){var f=o[d],m="\\"===f,g="\\"===o[d-1]||m;if(ae[f]&&!g){u+=ae[f];var p=new RegExp(u).exec(e);p&&(c=!0)&&l["Y"!==f?"push":"unshift"]({fn:D[f],val:p[++s]})}else m||(u+=".");l.forEach(function(e){var t=e.fn,n=e.val;return a=t(a,n,v)||a})}a=c?a:void 0}}if(a instanceof Date&&!isNaN(a.getTime()))return!0===n&&a.setHours(0,0,0,0),a;h.errorHandler(new Error("Invalid date provided: "+i))}}};function ce(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var le=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},de={DAY:864e5},w={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};function se(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function ue(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function fe(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function me(e,t){var n=ue("div","numInputWrapper"),a=ue("input","numInput "+e),i=ue("span","arrowUp"),o=ue("span","arrowDown");if(a.type="text",a.pattern="\\d*",void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}"function"!=typeof Object.assign&&(Object.assign=function(n){if(!n)throw TypeError("Cannot convert undefined or null to object");for(var e=arguments.length,a=new Array(1<e?e-1:0),t=1;t<e;t++)a[t-1]=arguments[t];for(var i=function(){var t=a[o];t&&Object.keys(t).forEach(function(e){return n[e]=t[e]})},o=0;o<a.length;o++)i();return n});var ge=300;function r(u,f){var p={config:Object.assign({},pe.defaultConfig),l10n:ie};function m(e){return e.bind(p)}function t(){var t=p.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame(function(){if(p.calendarContainer.style.visibility="hidden",p.calendarContainer.style.display="block",void 0!==p.daysContainer){var e=(p.days.offsetWidth+1)*t.showMonths;p.daysContainer.style.width=e+"px",p.calendarContainer.style.width=e+(void 0!==p.weekWrapper?p.weekWrapper.offsetWidth:0)+"px",p.calendarContainer.style.removeProperty("visibility"),p.calendarContainer.style.removeProperty("display")}})}function g(e){0!==p.selectedDates.length&&(void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,n=e.target;void 0!==p.amPM&&e.target===p.amPM&&(p.amPM.textContent=p.l10n.amPM[X(p.amPM.textContent===p.l10n.amPM[0])]);var a=parseFloat(n.getAttribute("data-min")),i=parseFloat(n.getAttribute("data-max")),o=parseFloat(n.getAttribute("data-step")),r=parseInt(n.value,10),c=e.delta||(t?38===e.which?1:-1:0),l=r+o*c;if(void 0!==n.value&&2===n.value.length){var d=n===p.hourElement,s=n===p.minuteElement;l<a?(l=i+l+X(!d)+(X(d)&&X(!p.amPM)),s&&v(void 0,-1,p.hourElement)):i<l&&(l=n===p.hourElement?l-i-X(!p.amPM):a,s&&v(void 0,1,p.hourElement)),p.amPM&&d&&(1===o?l+r===23:Math.abs(l-r)>o)&&(p.amPM.textContent=p.l10n.amPM[X(p.amPM.textContent===p.l10n.amPM[0])]),n.value=Q(l)}}(e),h(),V(),p._debouncedChange())}function h(){if(void 0!==p.hourElement&&void 0!==p.minuteElement){var e,t,n=(parseInt(p.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(p.minuteElement.value,10)||0)%60,i=void 0!==p.secondElement?(parseInt(p.secondElement.value,10)||0)%60:0;void 0!==p.amPM&&(e=n,t=p.amPM.textContent,n=e%12+12*X(t===p.l10n.amPM[1]));var o=void 0!==p.config.minTime||p.config.minDate&&p.minDateHasTime&&p.latestSelectedDateObj&&0===ce(p.latestSelectedDateObj,p.config.minDate,!0);if(void 0!==p.config.maxTime||p.config.maxDate&&p.maxDateHasTime&&p.latestSelectedDateObj&&0===ce(p.latestSelectedDateObj,p.config.maxDate,!0)){var r=void 0!==p.config.maxTime?p.config.maxTime:p.config.maxDate;(n=Math.min(n,r.getHours()))===r.getHours()&&(a=Math.min(a,r.getMinutes())),a===r.getMinutes()&&(i=Math.min(i,r.getSeconds()))}if(o){var c=void 0!==p.config.minTime?p.config.minTime:p.config.minDate;(n=Math.max(n,c.getHours()))===c.getHours()&&(a=Math.max(a,c.getMinutes())),a===c.getMinutes()&&(i=Math.max(i,c.getSeconds()))}l(n,a,i)}}function i(e){var t=e||p.latestSelectedDateObj;t&&l(t.getHours(),t.getMinutes(),t.getSeconds())}function d(){var e=p.config.defaultHour,t=p.config.defaultMinute,n=p.config.defaultSeconds;if(void 0!==p.config.minDate){var a=p.config.minDate.getHours(),i=p.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=p.config.minDate.getSeconds())}if(void 0!==p.config.maxDate){var o=p.config.maxDate.getHours(),r=p.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=p.config.maxDate.getSeconds())}l(e,t,n)}function l(e,t,n){void 0!==p.latestSelectedDateObj&&p.latestSelectedDateObj.setHours(e%24,t,n||0,0),p.hourElement&&p.minuteElement&&!p.isMobile&&(p.hourElement.value=Q(p.config.time_24hr?e:(12+e)%12+12*X(e%12==0)),p.minuteElement.value=Q(t),void 0!==p.amPM&&(p.amPM.textContent=p.l10n.amPM[X(12<=e)]),void 0!==p.secondElement&&(p.secondElement.value=Q(n)))}function n(e){var t=parseInt(e.target.value)+(e.delta||0);(1<t/1e3||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&_(t)}function o(t,n,a,i){return n instanceof Array?n.forEach(function(e){return o(t,e,a,i)}):t instanceof Array?t.forEach(function(e){return o(e,n,a,i)}):(t.addEventListener(n,a,i),void p._handlers.push({element:t,event:n,handler:a,options:i}))}function a(t){return function(e){1===e.which&&t(e)}}function s(){q("onChange")}function r(e){var t=void 0!==e?p.parseDate(e):p.latestSelectedDateObj||(p.config.minDate&&p.config.minDate>p.now?p.config.minDate:p.config.maxDate&&p.config.maxDate<p.now?p.config.maxDate:p.now);try{void 0!==t&&(p.currentYear=t.getFullYear(),p.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,p.config.errorHandler(e)}p.redraw()}function c(e){~e.target.className.indexOf("arrow")&&v(e,e.target.classList.contains("arrowUp")?1:-1)}function v(e,t,n){var a=e&&e.target,i=n||a&&a.parentNode&&a.parentNode.firstChild,o=$("increment");o.delta=t,i&&i.dispatchEvent(o)}function D(e,t,n,a){var i,o=F(t,!0),r=ue("span","flatpickr-day "+e,t.getDate().toString());return r.dateObj=t,r.$i=a,r.setAttribute("aria-label",p.formatDate(t,p.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===ce(t,p.now)&&((p.todayDateElem=r).classList.add("today"),r.setAttribute("aria-current","date")),o?(r.tabIndex=-1,z(t)&&(r.classList.add("selected"),p.selectedDateElem=r,"range"===p.config.mode&&(se(r,"startRange",p.selectedDates[0]&&0===ce(t,p.selectedDates[0],!0)),se(r,"endRange",p.selectedDates[1]&&0===ce(t,p.selectedDates[1],!0)),"nextMonthDay"===e&&r.classList.add("inRange")))):r.classList.add("disabled"),"range"===p.config.mode&&(i=t,!("range"!==p.config.mode||p.selectedDates.length<2)&&0<=ce(i,p.selectedDates[0])&&ce(i,p.selectedDates[1])<=0&&!z(t)&&r.classList.add("inRange")),p.weekNumbers&&1===p.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&p.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+p.config.getWeek(t)+"</span>"),q("onDayCreate",r),r}function w(e){e.focus(),"range"===p.config.mode&&P(e)}function b(e){for(var t=0<e?0:p.config.showMonths-1,n=0<e?p.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=p.daysContainer.children[a],o=0<e?0:i.children.length-1,r=0<e?i.children.length:-1,c=o;c!=r;c+=e){var l=i.children[c];if(-1===l.className.indexOf("hidden")&&F(l.dateObj))return l}}function M(e,t){var n=A(document.activeElement),a=void 0!==e?e:n?document.activeElement:void 0!==p.selectedDateElem&&A(p.selectedDateElem)?p.selectedDateElem:void 0!==p.todayDateElem&&A(p.todayDateElem)?p.todayDateElem:b(0<t?1:-1);return void 0===a?p._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():p.currentMonth,a=0<t?p.config.showMonths:-1,i=0<t?1:-1,o=n-p.currentMonth;o!=a;o+=i)for(var r=p.daysContainer.children[o],c=n-p.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,l=r.children.length,d=c;0<=d&&d<l&&d!=(0<t?l:-1);d+=i){var s=r.children[d];if(-1===s.className.indexOf("hidden")&&F(s.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return w(s)}p.changeMonth(i),M(b(i),0)}(a,t):w(a)}function y(e,t){for(var n=(new Date(e,t,1).getDay()-p.l10n.firstDayOfWeek+7)%7,a=p.utils.getDaysInMonth((t-1+12)%12),i=p.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=1<p.config.showMonths,c=r?"prevMonthDay hidden":"prevMonthDay",l=r?"nextMonthDay hidden":"nextMonthDay",d=a+1-n,s=0;d<=a;d++,s++)o.appendChild(D(c,new Date(e,t-1,d),d,s));for(d=1;d<=i;d++,s++)o.appendChild(D("",new Date(e,t,d),d,s));for(var u=i+1;u<=42-n&&(1===p.config.showMonths||s%7!=0);u++,s++)o.appendChild(D(l,new Date(e,t+1,u%i),u,s));var f=ue("div","dayContainer");return f.appendChild(o),f}function C(){if(void 0!==p.daysContainer){fe(p.daysContainer),p.weekNumbers&&fe(p.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<p.config.showMonths;t++){var n=new Date(p.currentYear,p.currentMonth,1);n.setMonth(p.currentMonth+t),e.appendChild(y(n.getFullYear(),n.getMonth()))}p.daysContainer.appendChild(e),p.days=p.daysContainer.firstChild}}function x(){var e=ue("div","flatpickr-month"),t=window.document.createDocumentFragment(),n=ue("span","cur-month");n.title=p.l10n.scrollTitle;var a=me("cur-year",{tabindex:"-1"}),i=a.childNodes[0];i.title=p.l10n.scrollTitle,i.setAttribute("aria-label",p.l10n.yearAriaLabel),p.config.minDate&&i.setAttribute("data-min",p.config.minDate.getFullYear().toString()),p.config.maxDate&&(i.setAttribute("data-max",p.config.maxDate.getFullYear().toString()),i.disabled=!!p.config.minDate&&p.config.minDate.getFullYear()===p.config.maxDate.getFullYear());var o=ue("div","flatpickr-current-month");return o.appendChild(n),o.appendChild(a),t.appendChild(o),e.appendChild(t),{container:e,yearElement:i,monthElement:n}}function E(){fe(p.monthNav),p.monthNav.appendChild(p.prevMonthNav);for(var e=p.config.showMonths;e--;){var t=x();p.yearElements.push(t.yearElement),p.monthElements.push(t.monthElement),p.monthNav.appendChild(t.container)}p.monthNav.appendChild(p.nextMonthNav)}function T(){p.weekdayContainer?fe(p.weekdayContainer):p.weekdayContainer=ue("div","flatpickr-weekdays");for(var e=p.config.showMonths;e--;){var t=ue("div","flatpickr-weekdaycontainer");p.weekdayContainer.appendChild(t)}return k(),p.weekdayContainer}function k(){var e=p.l10n.firstDayOfWeek,t=p.l10n.weekdays.shorthand.concat();0<e&&e<t.length&&(t=t.splice(e,t.length).concat(t.splice(0,e)));for(var n=p.config.showMonths;n--;)p.weekdayContainer.children[n].innerHTML="\n <span class=flatpickr-weekday>\n "+t.join("</span><span class=flatpickr-weekday>")+"\n </span>\n "}function I(e,t){void 0===t&&(t=!0);var n=t?e:e-p.currentMonth;n<0&&!0===p._hidePrevMonthArrow||0<n&&!0===p._hideNextMonthArrow||(p.currentMonth+=n,(p.currentMonth<0||11<p.currentMonth)&&(p.currentYear+=11<p.currentMonth?1:-1,p.currentMonth=(p.currentMonth+12)%12,q("onYearChange")),C(),q("onMonthChange"),G())}function O(e){return!(!p.config.appendTo||!p.config.appendTo.contains(e))||p.calendarContainer.contains(e)}function S(t){if(p.isOpen&&!p.config.inline){var e=O(t.target),n=t.target===p.input||t.target===p.altInput||p.element.contains(t.target)||t.path&&t.path.indexOf&&(~t.path.indexOf(p.input)||~t.path.indexOf(p.altInput)),a="blur"===t.type?n&&t.relatedTarget&&!O(t.relatedTarget):!n&&!e,i=!p.config.ignoredFocusElements.some(function(e){return e.contains(t.target)});a&&i&&(p.close(),"range"===p.config.mode&&1===p.selectedDates.length&&(p.clear(!1),p.redraw()))}}function _(e){if(!(!e||p.config.minDate&&e<p.config.minDate.getFullYear()||p.config.maxDate&&e>p.config.maxDate.getFullYear())){var t=e,n=p.currentYear!==t;p.currentYear=t||p.currentYear,p.config.maxDate&&p.currentYear===p.config.maxDate.getFullYear()?p.currentMonth=Math.min(p.config.maxDate.getMonth(),p.currentMonth):p.config.minDate&&p.currentYear===p.config.minDate.getFullYear()&&(p.currentMonth=Math.max(p.config.minDate.getMonth(),p.currentMonth)),n&&(p.redraw(),q("onYearChange"))}}function F(e,t){void 0===t&&(t=!0);var n=p.parseDate(e,void 0,t);if(p.config.minDate&&n&&ce(n,p.config.minDate,void 0!==t?t:!p.minDateHasTime)<0||p.config.maxDate&&n&&0<ce(n,p.config.maxDate,void 0!==t?t:!p.maxDateHasTime))return!1;if(0===p.config.enable.length&&0===p.config.disable.length)return!0;if(void 0===n)return!1;for(var a,i=0<p.config.enable.length,o=i?p.config.enable:p.config.disable,r=0;r<o.length;r++){if("function"==typeof(a=o[r])&&a(n))return i;if(a instanceof Date&&void 0!==n&&a.getTime()===n.getTime())return i;if("string"==typeof a&&void 0!==n){var c=p.parseDate(a,void 0,!0);return c&&c.getTime()===n.getTime()?i:!i}if("object"==typeof a&&void 0!==n&&a.from&&a.to&&n.getTime()>=a.from.getTime()&&n.getTime()<=a.to.getTime())return i}return!i}function A(e){return void 0!==p.daysContainer&&(-1===e.className.indexOf("hidden")&&p.daysContainer.contains(e))}function N(e){var t=e.target===p._input,n=p.config.allowInput,a=p.isOpen&&(!n||!t),i=p.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return p.setDate(p._input.value,!0,e.target===p.altInput?p.config.altFormat:p.config.dateFormat),e.target.blur();p.open()}else if(O(e.target)||a||i){var o=!!p.timeContainer&&p.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?g():K(e);break;case 27:e.preventDefault(),R();break;case 8:case 46:t&&!p.config.allowInput&&(e.preventDefault(),p.clear());break;case 37:case 39:if(o)p.hourElement&&p.hourElement.focus();else if(e.preventDefault(),void 0!==p.daysContainer&&(!1===n||A(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(I(r),M(b(1),0)):M(void 0,r)}break;case 38:case 40:e.preventDefault();var c=40===e.keyCode?1:-1;p.daysContainer?e.ctrlKey?(_(p.currentYear-c),M(b(1),0)):o||M(void 0,7*c):p.config.enableTime&&(!o&&p.hourElement&&p.hourElement.focus(),g(e),p._debouncedChange());break;case 9:if(!o)break;var l=[p.hourElement,p.minuteElement,p.secondElement,p.amPM].filter(function(e){return e}),d=l.indexOf(e.target);if(-1!==d){var s=l[d+(e.shiftKey?-1:1)];void 0!==s&&(e.preventDefault(),s.focus())}}}if(void 0!==p.amPM&&e.target===p.amPM)switch(e.key){case p.l10n.amPM[0].charAt(0):case p.l10n.amPM[0].charAt(0).toLowerCase():p.amPM.textContent=p.l10n.amPM[0],h(),V();break;case p.l10n.amPM[1].charAt(0):case p.l10n.amPM[1].charAt(0).toLowerCase():p.amPM.textContent=p.l10n.amPM[1],h(),V()}q("onKeyDown",e)}function P(o){if(1===p.selectedDates.length&&o.classList.contains("flatpickr-day")&&!o.classList.contains("disabled")){for(var r=o.dateObj.getTime(),c=p.parseDate(p.selectedDates[0],void 0,!0).getTime(),e=Math.min(r,p.selectedDates[0].getTime()),t=Math.max(r,p.selectedDates[0].getTime()),l=!1,d=0,s=0,n=e;n<t;n+=de.DAY)F(new Date(n),!0)||(l=l||e<n&&n<t,n<c&&(!d||d<n)?d=n:c<n&&(!s||n<s)&&(s=n));for(var u=0;u<p.config.showMonths;u++)for(var f=p.daysContainer.children[u],m=p.daysContainer.children[u-1],a=function(e,t){var n=f.children[e],a=n.dateObj.getTime(),i=0<d&&a<d||0<s&&s<a;return i?(n.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){n.classList.remove(e)}),"continue"):l&&!i?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){n.classList.remove(e)}),o.classList.add(r<p.selectedDates[0].getTime()?"startRange":"endRange"),void(!f.contains(o)&&0<u&&m&&m.lastChild.dateObj.getTime()>=a||(c<r&&a===c?n.classList.add("startRange"):r<c&&a===c&&n.classList.add("endRange"),d<=a&&(0===s||a<=s)&&le(a,c,r)&&n.classList.add("inRange"))))},i=0,g=f.children.length;i<g;i++)a(i)}}function Y(){!p.isOpen||p.config.static||p.config.inline||L()}function j(a){return function(e){var t=p.config["_"+a+"Date"]=p.parseDate(e,p.config.dateFormat),n=p.config["_"+("min"===a?"max":"min")+"Date"];void 0!==t&&(p["min"===a?"minDateHasTime":"maxDateHasTime"]=0<t.getHours()||0<t.getMinutes()||0<t.getSeconds()),p.selectedDates&&(p.selectedDates=p.selectedDates.filter(function(e){return F(e)}),p.selectedDates.length||"min"!==a||i(t),V()),p.daysContainer&&(W(),void 0!==t?p.currentYearElement[a]=t.getFullYear().toString():p.currentYearElement.removeAttribute(a),p.currentYearElement.disabled=!!n&&void 0!==t&&n.getFullYear()===t.getFullYear())}}function H(){"object"!=typeof p.config.locale&&void 0===pe.l10ns[p.config.locale]&&p.config.errorHandler(new Error("flatpickr: invalid locale "+p.config.locale)),p.l10n=Object.assign({},pe.l10ns.default,"object"==typeof p.config.locale?p.config.locale:"default"!==p.config.locale?pe.l10ns[p.config.locale]:void 0),ae.K="("+p.l10n.amPM[0]+"|"+p.l10n.amPM[1]+"|"+p.l10n.amPM[0].toLowerCase()+"|"+p.l10n.amPM[1].toLowerCase()+")",p.formatDate=oe(p)}function L(e){if(void 0!==p.calendarContainer){q("onPreCalendarPosition");var t=e||p._positionElement,n=Array.prototype.reduce.call(p.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=p.calendarContainer.offsetWidth,i=p.config.position.split(" "),o=i[0],r=1<i.length?i[1]:null,c=t.getBoundingClientRect(),l=window.innerHeight-c.bottom,d="above"===o||"below"!==o&&l<n&&c.top>n,s=window.pageYOffset+c.top+(d?-n-2:t.offsetHeight+2);if(se(p.calendarContainer,"arrowTop",!d),se(p.calendarContainer,"arrowBottom",d),!p.config.inline){var u=window.pageXOffset+c.left-(null!=r&&"center"===r?(a-c.width)/2:0),f=window.document.body.offsetWidth-c.right,m=u+a>window.document.body.offsetWidth;se(p.calendarContainer,"rightMost",m),p.config.static||(p.calendarContainer.style.top=s+"px",m?(p.calendarContainer.style.left="auto",p.calendarContainer.style.right=f+"px"):(p.calendarContainer.style.left=u+"px",p.calendarContainer.style.right="auto"))}}}function W(){p.config.noCalendar||p.isMobile||(G(),C())}function R(){p._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(p.close,0):p.close()}function K(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=p.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()<p.currentMonth||a.getMonth()>p.currentMonth+p.config.showMonths-1)&&"range"!==p.config.mode;if(p.selectedDateElem=n,"single"===p.config.mode)p.selectedDates=[a];else if("multiple"===p.config.mode){var o=z(a);o?p.selectedDates.splice(parseInt(o),1):p.selectedDates.push(a)}else"range"===p.config.mode&&(2===p.selectedDates.length&&p.clear(!1),p.selectedDates.push(a),0!==ce(a,p.selectedDates[0],!0)&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(h(),i){var r=p.currentYear!==a.getFullYear();p.currentYear=a.getFullYear(),p.currentMonth=a.getMonth(),r&&q("onYearChange"),q("onMonthChange")}if(G(),C(),d(),V(),p.config.enableTime&&setTimeout(function(){return p.showTimeInput=!0},50),"range"===p.config.mode&&(1===p.selectedDates.length?P(n):G()),i||"range"===p.config.mode||1!==p.config.showMonths?p.selectedDateElem&&p.selectedDateElem.focus():w(n),void 0!==p.hourElement&&setTimeout(function(){return void 0!==p.hourElement&&p.hourElement.select()},451),p.config.closeOnSelect){var c="single"===p.config.mode&&!p.config.enableTime,l="range"===p.config.mode&&2===p.selectedDates.length&&!p.config.enableTime;(c||l)&&R()}s()}}p.parseDate=re({config:p.config,l10n:p.l10n}),p._handlers=[],p._bind=o,p._setHoursFromDate=i,p._positionCalendar=L,p.changeMonth=I,p.changeYear=_,p.clear=function(e){void 0===e&&(e=!0);p.input.value="",void 0!==p.altInput&&(p.altInput.value="");void 0!==p.mobileInput&&(p.mobileInput.value="");p.selectedDates=[],p.latestSelectedDateObj=void 0,!(p.showTimeInput=!1)===p.config.enableTime&&d();p.redraw(),e&&q("onChange")},p.close=function(){p.isOpen=!1,p.isMobile||(p.calendarContainer.classList.remove("open"),p._input.classList.remove("active"));q("onClose")},p._createElement=ue,p.destroy=function(){void 0!==p.config&&q("onDestroy");for(var e=p._handlers.length;e--;){var t=p._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}p._handlers=[],p.mobileInput?(p.mobileInput.parentNode&&p.mobileInput.parentNode.removeChild(p.mobileInput),p.mobileInput=void 0):p.calendarContainer&&p.calendarContainer.parentNode&&p.calendarContainer.parentNode.removeChild(p.calendarContainer);p.altInput&&(p.input.type="text",p.altInput.parentNode&&p.altInput.parentNode.removeChild(p.altInput),delete p.altInput);p.input&&(p.input.type=p.input._type,p.input.classList.remove("flatpickr-input"),p.input.removeAttribute("readonly"),p.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete p[e]}catch(e){}})},p.isEnabled=F,p.jumpToDate=r,p.open=function(e,t){void 0===t&&(t=p._input);if(!0===p.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),setTimeout(function(){void 0!==p.mobileInput&&p.mobileInput.focus()},0),void q("onOpen");if(p._input.disabled||p.config.inline)return;var n=p.isOpen;p.isOpen=!0,n||(p.calendarContainer.classList.add("open"),p._input.classList.add("active"),q("onOpen"),L(t));!0===p.config.enableTime&&!0===p.config.noCalendar&&(0===p.selectedDates.length&&(p.setDate(void 0!==p.config.minDate?new Date(p.config.minDate.getTime()):new Date,!1),d(),V()),!1!==p.config.allowInput||void 0!==e&&p.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return p.hourElement.select()},50))},p.redraw=W,p.set=function(e,t){null!==e&&"object"==typeof e?Object.assign(p.config,e):(p.config[e]=t,void 0!==J[e]&&J[e].forEach(function(e){return e()}));p.redraw(),r()},p.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=p.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return p.clear(t);B(e,n),p.showTimeInput=0<p.selectedDates.length,p.latestSelectedDateObj=p.selectedDates[0],p.redraw(),r(),i(),V(t),t&&q("onChange")},p.toggle=function(e){if(!0===p.isOpen)return p.close();p.open(e)};var J={locale:[H,k],showMonths:[E,t,T]};function B(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return p.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[p.parseDate(e,t)];else if("string"==typeof e)switch(p.config.mode){case"single":case"time":n=[p.parseDate(e,t)];break;case"multiple":n=e.split(p.config.conjunction).map(function(e){return p.parseDate(e,t)});break;case"range":n=e.split(p.l10n.rangeSeparator).map(function(e){return p.parseDate(e,t)})}else p.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));p.selectedDates=n.filter(function(e){return e instanceof Date&&F(e,!1)}),"range"===p.config.mode&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function U(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?p.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:p.parseDate(e.from,void 0),to:p.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function q(e,t){var n=p.config[e];if(void 0!==n&&0<n.length)for(var a=0;n[a]&&a<n.length;a++)n[a](p.selectedDates,p.input.value,p,t);"onChange"===e&&(p.input.dispatchEvent($("change")),p.input.dispatchEvent($("input")))}function $(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function z(e){for(var t=0;t<p.selectedDates.length;t++)if(0===ce(p.selectedDates[t],e))return""+t;return!1}function G(){p.config.noCalendar||p.isMobile||!p.monthNav||(p.yearElements.forEach(function(e,t){var n=new Date(p.currentYear,p.currentMonth,1);n.setMonth(p.currentMonth+t),p.monthElements[t].textContent=ne(n.getMonth(),p.config.shorthandCurrentMonth,p.l10n)+" ",e.value=n.getFullYear().toString()}),p._hidePrevMonthArrow=void 0!==p.config.minDate&&(p.currentYear===p.config.minDate.getFullYear()?p.currentMonth<=p.config.minDate.getMonth():p.currentYear<p.config.minDate.getFullYear()),p._hideNextMonthArrow=void 0!==p.config.maxDate&&(p.currentYear===p.config.maxDate.getFullYear()?p.currentMonth+1>p.config.maxDate.getMonth():p.currentYear>p.config.maxDate.getFullYear()))}function V(e){if(void 0===e&&(e=!0),0===p.selectedDates.length)return p.clear(e);void 0!==p.mobileInput&&p.mobileFormatStr&&(p.mobileInput.value=void 0!==p.latestSelectedDateObj?p.formatDate(p.latestSelectedDateObj,p.mobileFormatStr):"");var t="range"!==p.config.mode?p.config.conjunction:p.l10n.rangeSeparator;p.input.value=p.selectedDates.map(function(e){return p.formatDate(e,p.config.dateFormat)}).join(t),void 0!==p.altInput&&(p.altInput.value=p.selectedDates.map(function(e){return p.formatDate(e,p.config.altFormat)}).join(t)),!1!==e&&q("onValueUpdate")}function Z(e){e.preventDefault();var t=p.prevMonthNav.contains(e.target),n=p.nextMonthNav.contains(e.target);t||n?I(t?-1:1):0<=p.yearElements.indexOf(e.target)?e.target.select():e.target.classList.contains("arrowUp")?p.changeYear(p.currentYear+1):e.target.classList.contains("arrowDown")&&p.changeYear(p.currentYear-1)}return function(){p.element=p.input=u,p.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n=Object.assign({},f,JSON.parse(JSON.stringify(u.dataset||{}))),a={};p.config.parseDate=n.parseDate,p.config.formatDate=n.formatDate,Object.defineProperty(p.config,"enable",{get:function(){return p.config._enable},set:function(e){p.config._enable=U(e)}}),Object.defineProperty(p.config,"disable",{get:function(){return p.config._disable},set:function(e){p.config._disable=U(e)}});var i="time"===n.mode;n.dateFormat||!n.enableTime&&!i||(a.dateFormat=n.noCalendar||i?"H:i"+(n.enableSeconds?":S":""):pe.defaultConfig.dateFormat+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&(n.enableTime||i)&&!n.altFormat&&(a.altFormat=n.noCalendar||i?"h:i"+(n.enableSeconds?":S K":" K"):pe.defaultConfig.altFormat+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(p.config,"minDate",{get:function(){return p.config._minDate},set:j("min")}),Object.defineProperty(p.config,"maxDate",{get:function(){return p.config._maxDate},set:j("max")});var o=function(t){return function(e){p.config["min"===t?"_minTime":"_maxTime"]=p.parseDate(e,"H:i")}};Object.defineProperty(p.config,"minTime",{get:function(){return p.config._minTime},set:o("min")}),Object.defineProperty(p.config,"maxTime",{get:function(){return p.config._maxTime},set:o("max")}),"time"===n.mode&&(p.config.noCalendar=!0,p.config.enableTime=!0),Object.assign(p.config,a,n);for(var r=0;r<e.length;r++)p.config[e[r]]=!0===p.config[e[r]]||"true"===p.config[e[r]];for(var c=t.length;c--;)void 0!==p.config[t[c]]&&(p.config[t[c]]=te(p.config[t[c]]||[]).map(m));p.isMobile=!p.config.disableMobile&&!p.config.inline&&"single"===p.config.mode&&!p.config.disable.length&&!p.config.enable.length&&!p.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var l=0;l<p.config.plugins.length;l++){var d=p.config.plugins[l](p)||{};for(var s in d)~t.indexOf(s)?p.config[s]=te(d[s]).map(m).concat(p.config[s]):void 0===n[s]&&(p.config[s]=d[s])}q("onParseConfig")}(),H(),function(){if(p.input=p.config.wrap?u.querySelector("[data-input]"):u,!p.input)return p.config.errorHandler(new Error("Invalid input element specified"));p.input._type=p.input.type,p.input.type="text",p.input.classList.add("flatpickr-input"),p._input=p.input,p.config.altInput&&(p.altInput=ue(p.input.nodeName,p.input.className+" "+p.config.altInputClass),p._input=p.altInput,p.altInput.placeholder=p.input.placeholder,p.altInput.disabled=p.input.disabled,p.altInput.required=p.input.required,p.altInput.tabIndex=p.input.tabIndex,p.altInput.type="text",p.input.setAttribute("type","hidden"),!p.config.static&&p.input.parentNode&&p.input.parentNode.insertBefore(p.altInput,p.input.nextSibling)),p.config.allowInput||p._input.setAttribute("readonly","readonly"),p._positionElement=p.config.positionElement||p._input}(),function(){p.selectedDates=[],p.now=p.parseDate(p.config.now)||new Date;var e=p.config.defaultDate||(0<p.input.placeholder.length&&p.input.value===p.input.placeholder?null:p.input.value);e&&B(e,p.config.dateFormat);var t=0<p.selectedDates.length?p.selectedDates[0]:p.config.minDate&&p.config.minDate.getTime()>p.now.getTime()?p.config.minDate:p.config.maxDate&&p.config.maxDate.getTime()<p.now.getTime()?p.config.maxDate:p.now;p.currentYear=t.getFullYear(),p.currentMonth=t.getMonth(),0<p.selectedDates.length&&(p.latestSelectedDateObj=p.selectedDates[0]),void 0!==p.config.minTime&&(p.config.minTime=p.parseDate(p.config.minTime,"H:i")),void 0!==p.config.maxTime&&(p.config.maxTime=p.parseDate(p.config.maxTime,"H:i")),p.minDateHasTime=!!p.config.minDate&&(0<p.config.minDate.getHours()||0<p.config.minDate.getMinutes()||0<p.config.minDate.getSeconds()),p.maxDateHasTime=!!p.config.maxDate&&(0<p.config.maxDate.getHours()||0<p.config.maxDate.getMinutes()||0<p.config.maxDate.getSeconds()),Object.defineProperty(p,"showTimeInput",{get:function(){return p._showTimeInput},set:function(e){p._showTimeInput=e,p.calendarContainer&&se(p.calendarContainer,"showTimeInput",e),p.isOpen&&L()}})}(),p.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=p.currentMonth),void 0===t&&(t=p.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:p.l10n.daysInMonth[e]}},p.isMobile||function(){var e=window.document.createDocumentFragment();if(p.calendarContainer=ue("div","flatpickr-calendar"),p.calendarContainer.tabIndex=-1,!p.config.noCalendar){if(e.appendChild((p.monthNav=ue("div","flatpickr-months"),p.yearElements=[],p.monthElements=[],p.prevMonthNav=ue("span","flatpickr-prev-month"),p.prevMonthNav.innerHTML=p.config.prevArrow,p.nextMonthNav=ue("span","flatpickr-next-month"),p.nextMonthNav.innerHTML=p.config.nextArrow,E(),Object.defineProperty(p,"_hidePrevMonthArrow",{get:function(){return p.__hidePrevMonthArrow},set:function(e){p.__hidePrevMonthArrow!==e&&(se(p.prevMonthNav,"disabled",e),p.__hidePrevMonthArrow=e)}}),Object.defineProperty(p,"_hideNextMonthArrow",{get:function(){return p.__hideNextMonthArrow},set:function(e){p.__hideNextMonthArrow!==e&&(se(p.nextMonthNav,"disabled",e),p.__hideNextMonthArrow=e)}}),p.currentYearElement=p.yearElements[0],G(),p.monthNav)),p.innerContainer=ue("div","flatpickr-innerContainer"),p.config.weekNumbers){var t=function(){p.calendarContainer.classList.add("hasWeeks");var e=ue("div","flatpickr-weekwrapper");e.appendChild(ue("span","flatpickr-weekday",p.l10n.weekAbbreviation));var t=ue("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,a=t.weekNumbers;p.innerContainer.appendChild(n),p.weekNumbers=a,p.weekWrapper=n}p.rContainer=ue("div","flatpickr-rContainer"),p.rContainer.appendChild(T()),p.daysContainer||(p.daysContainer=ue("div","flatpickr-days"),p.daysContainer.tabIndex=-1),C(),p.rContainer.appendChild(p.daysContainer),p.innerContainer.appendChild(p.rContainer),e.appendChild(p.innerContainer)}p.config.enableTime&&e.appendChild(function(){p.calendarContainer.classList.add("hasTime"),p.config.noCalendar&&p.calendarContainer.classList.add("noCalendar"),p.timeContainer=ue("div","flatpickr-time"),p.timeContainer.tabIndex=-1;var e=ue("span","flatpickr-time-separator",":"),t=me("flatpickr-hour");p.hourElement=t.childNodes[0];var n=me("flatpickr-minute");if(p.minuteElement=n.childNodes[0],p.hourElement.tabIndex=p.minuteElement.tabIndex=-1,p.hourElement.value=Q(p.latestSelectedDateObj?p.latestSelectedDateObj.getHours():p.config.time_24hr?p.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(p.config.defaultHour)),p.minuteElement.value=Q(p.latestSelectedDateObj?p.latestSelectedDateObj.getMinutes():p.config.defaultMinute),p.hourElement.setAttribute("data-step",p.config.hourIncrement.toString()),p.minuteElement.setAttribute("data-step",p.config.minuteIncrement.toString()),p.hourElement.setAttribute("data-min",p.config.time_24hr?"0":"1"),p.hourElement.setAttribute("data-max",p.config.time_24hr?"23":"12"),p.minuteElement.setAttribute("data-min","0"),p.minuteElement.setAttribute("data-max","59"),p.timeContainer.appendChild(t),p.timeContainer.appendChild(e),p.timeContainer.appendChild(n),p.config.time_24hr&&p.timeContainer.classList.add("time24hr"),p.config.enableSeconds){p.timeContainer.classList.add("hasSeconds");var a=me("flatpickr-second");p.secondElement=a.childNodes[0],p.secondElement.value=Q(p.latestSelectedDateObj?p.latestSelectedDateObj.getSeconds():p.config.defaultSeconds),p.secondElement.setAttribute("data-step",p.minuteElement.getAttribute("data-step")),p.secondElement.setAttribute("data-min",p.minuteElement.getAttribute("data-min")),p.secondElement.setAttribute("data-max",p.minuteElement.getAttribute("data-max")),p.timeContainer.appendChild(ue("span","flatpickr-time-separator",":")),p.timeContainer.appendChild(a)}return p.config.time_24hr||(p.amPM=ue("span","flatpickr-am-pm",p.l10n.amPM[X(11<(p.latestSelectedDateObj?p.hourElement.value:p.config.defaultHour))]),p.amPM.title=p.l10n.toggleTitle,p.amPM.tabIndex=-1,p.timeContainer.appendChild(p.amPM)),p.timeContainer}()),se(p.calendarContainer,"rangeMode","range"===p.config.mode),se(p.calendarContainer,"animate",!0===p.config.animate),se(p.calendarContainer,"multiMonth",1<p.config.showMonths),p.calendarContainer.appendChild(e);var i=void 0!==p.config.appendTo&&void 0!==p.config.appendTo.nodeType;if((p.config.inline||p.config.static)&&(p.calendarContainer.classList.add(p.config.inline?"inline":"static"),p.config.inline&&(!i&&p.element.parentNode?p.element.parentNode.insertBefore(p.calendarContainer,p._input.nextSibling):void 0!==p.config.appendTo&&p.config.appendTo.appendChild(p.calendarContainer)),p.config.static)){var o=ue("div","flatpickr-wrapper");p.element.parentNode&&p.element.parentNode.insertBefore(o,p.element),o.appendChild(p.element),p.altInput&&o.appendChild(p.altInput),o.appendChild(p.calendarContainer)}p.config.static||p.config.inline||(void 0!==p.config.appendTo?p.config.appendTo:window.document.body).appendChild(p.calendarContainer)}(),function(){if(p.config.wrap&&["open","close","toggle","clear"].forEach(function(t){Array.prototype.forEach.call(p.element.querySelectorAll("[data-"+t+"]"),function(e){return o(e,"click",p[t])})}),p.isMobile)return function(){var e=p.config.enableTime?p.config.noCalendar?"time":"datetime-local":"date";p.mobileInput=ue("input",p.input.className+" flatpickr-mobile"),p.mobileInput.step=p.input.getAttribute("step")||"any",p.mobileInput.tabIndex=1,p.mobileInput.type=e,p.mobileInput.disabled=p.input.disabled,p.mobileInput.required=p.input.required,p.mobileInput.placeholder=p.input.placeholder,p.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",0<p.selectedDates.length&&(p.mobileInput.defaultValue=p.mobileInput.value=p.formatDate(p.selectedDates[0],p.mobileFormatStr)),p.config.minDate&&(p.mobileInput.min=p.formatDate(p.config.minDate,"Y-m-d")),p.config.maxDate&&(p.mobileInput.max=p.formatDate(p.config.maxDate,"Y-m-d")),p.input.type="hidden",void 0!==p.altInput&&(p.altInput.type="hidden");try{p.input.parentNode&&p.input.parentNode.insertBefore(p.mobileInput,p.input.nextSibling)}catch(e){}o(p.mobileInput,"change",function(e){p.setDate(e.target.value,!1,p.mobileFormatStr),q("onChange"),q("onClose")})}();var e=ee(Y,50);p._debouncedChange=ee(s,ge),p.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&o(p.daysContainer,"mouseover",function(e){"range"===p.config.mode&&P(e.target)}),o(window.document.body,"keydown",N),p.config.static||o(p._input,"keydown",N),p.config.inline||p.config.static||o(window,"resize",e),void 0!==window.ontouchstart?o(window.document,"click",S):o(window.document,"mousedown",a(S)),o(window.document,"focus",S,{capture:!0}),!0===p.config.clickOpens&&(o(p._input,"focus",p.open),o(p._input,"mousedown",a(p.open))),void 0!==p.daysContainer&&(o(p.monthNav,"mousedown",a(Z)),o(p.monthNav,["keyup","increment"],n),o(p.daysContainer,"mousedown",a(K))),void 0!==p.timeContainer&&void 0!==p.minuteElement&&void 0!==p.hourElement&&(o(p.timeContainer,["increment"],g),o(p.timeContainer,"blur",g,{capture:!0}),o(p.timeContainer,"mousedown",a(c)),o([p.hourElement,p.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==p.secondElement&&o(p.secondElement,"focus",function(){return p.secondElement&&p.secondElement.select()}),void 0!==p.amPM&&o(p.amPM,"mousedown",a(function(e){g(e),s()})))}(),(p.selectedDates.length||p.config.noCalendar)&&(p.config.enableTime&&i(p.config.noCalendar?p.latestSelectedDateObj||p.config.minDate:void 0),V(!1)),t(),p.showTimeInput=0<p.selectedDates.length||p.config.noCalendar;var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!p.isMobile&&e&&L(),q("onReady")}(),p}function n(e,t){for(var n=Array.prototype.slice.call(e),a=[],i=0;i<n.length;i++){var o=n[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=r(o,t||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return n(this,e)},HTMLElement.prototype.flatpickr=function(e){return n([this],e)});var pe=function(e,t){return e instanceof NodeList?n(e,t):n("string"==typeof e?window.document.querySelectorAll(e):[e],t)};return pe.defaultConfig=w,pe.l10ns={en:Object.assign({},ie),default:Object.assign({},ie)},pe.localize=function(e){pe.l10ns.default=Object.assign({},pe.l10ns.default,e)},pe.setDefaults=function(e){pe.defaultConfig=Object.assign({},pe.defaultConfig,e)},pe.parseDate=re({}),pe.formatDate=oe({}),pe.compareDates=ce,"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(e){return n(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=pe),pe});/*! jquery.tablednd.js 30-12-2017 */
+!function(a,b,c,d){var e="touchstart mousedown",f="touchmove mousemove",g="touchend mouseup";a(c).ready(function(){function b(a){for(var b={},c=a.match(/([^;:]+)/g)||[];c.length;)b[c.shift()]=c.shift().trim();return b}a("table").each(function(){"dnd"===a(this).data("table")&&a(this).tableDnD({onDragStyle:a(this).data("ondragstyle")&&b(a(this).data("ondragstyle"))||null,onDropStyle:a(this).data("ondropstyle")&&b(a(this).data("ondropstyle"))||null,onDragClass:a(this).data("ondragclass")===d&&"tDnD_whileDrag"||a(this).data("ondragclass"),onDrop:a(this).data("ondrop")&&new Function("table","row",a(this).data("ondrop")),onDragStart:a(this).data("ondragstart")&&new Function("table","row",a(this).data("ondragstart")),onDragStop:a(this).data("ondragstop")&&new Function("table","row",a(this).data("ondragstop")),scrollAmount:a(this).data("scrollamount")||5,sensitivity:a(this).data("sensitivity")||10,hierarchyLevel:a(this).data("hierarchylevel")||0,indentArtifact:a(this).data("indentartifact")||'<div class="indent"> </div>',autoWidthAdjust:a(this).data("autowidthadjust")||!0,autoCleanRelations:a(this).data("autocleanrelations")||!0,jsonPretifySeparator:a(this).data("jsonpretifyseparator")||"\t",serializeRegexp:a(this).data("serializeregexp")&&new RegExp(a(this).data("serializeregexp"))||/[^\-]*$/,serializeParamName:a(this).data("serializeparamname")||!1,dragHandle:a(this).data("draghandle")||null})})}),jQuery.tableDnD={currentTable:null,dragObject:null,mouseOffset:null,oldX:0,oldY:0,build:function(b){return this.each(function(){this.tableDnDConfig=a.extend({onDragStyle:null,onDropStyle:null,onDragClass:"tDnD_whileDrag",onDrop:null,onDragStart:null,onDragStop:null,scrollAmount:5,sensitivity:10,hierarchyLevel:0,indentArtifact:'<div class="indent"> </div>',autoWidthAdjust:!0,autoCleanRelations:!0,jsonPretifySeparator:"\t",serializeRegexp:/[^\-]*$/,serializeParamName:!1,dragHandle:null},b||{}),a.tableDnD.makeDraggable(this),this.tableDnDConfig.hierarchyLevel&&a.tableDnD.makeIndented(this)}),this},makeIndented:function(b){var c,d,e=b.tableDnDConfig,f=b.rows,g=a(f).first().find("td:first")[0],h=0,i=0;if(a(b).hasClass("indtd"))return null;d=a(b).addClass("indtd").attr("style"),a(b).css({whiteSpace:"nowrap"});for(var j=0;j<f.length;j++)i<a(f[j]).find("td:first").text().length&&(i=a(f[j]).find("td:first").text().length,c=j);for(a(g).css({width:"auto"}),j=0;j<e.hierarchyLevel;j++)a(f[c]).find("td:first").prepend(e.indentArtifact);for(g&&a(g).css({width:g.offsetWidth}),d&&a(b).css(d),j=0;j<e.hierarchyLevel;j++)a(f[c]).find("td:first").children(":first").remove();return e.hierarchyLevel&&a(f).each(function(){(h=a(this).data("level")||0)<=e.hierarchyLevel&&a(this).data("level",h)||a(this).data("level",0);for(var b=0;b<a(this).data("level");b++)a(this).find("td:first").prepend(e.indentArtifact)}),this},makeDraggable:function(b){var c=b.tableDnDConfig;c.dragHandle&&a(c.dragHandle,b).each(function(){a(this).bind(e,function(d){return a.tableDnD.initialiseDrag(a(this).parents("tr")[0],b,this,d,c),!1})})||a(b.rows).each(function(){a(this).hasClass("nodrag")?a(this).css("cursor",""):a(this).bind(e,function(d){if("TD"===d.target.tagName)return a.tableDnD.initialiseDrag(this,b,this,d,c),!1}).css("cursor","move")})},currentOrder:function(){var b=this.currentTable.rows;return a.map(b,function(b){return(a(b).data("level")+b.id).replace(/\s/g,"")}).join("")},initialiseDrag:function(b,d,e,h,i){this.dragObject=b,this.currentTable=d,this.mouseOffset=this.getMouseOffset(e,h),this.originalOrder=this.currentOrder(),a(c).bind(f,this.mousemove).bind(g,this.mouseup),i.onDragStart&&i.onDragStart(d,e)},updateTables:function(){this.each(function(){this.tableDnDConfig&&a.tableDnD.makeDraggable(this)})},mouseCoords:function(a){return a.originalEvent.changedTouches?{x:a.originalEvent.changedTouches[0].clientX,y:a.originalEvent.changedTouches[0].clientY}:a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+c.body.scrollLeft-c.body.clientLeft,y:a.clientY+c.body.scrollTop-c.body.clientTop}},getMouseOffset:function(a,c){var d,e;return c=c||b.event,e=this.getPosition(a),d=this.mouseCoords(c),{x:d.x-e.x,y:d.y-e.y}},getPosition:function(a){var b=0,c=0;for(0===a.offsetHeight&&(a=a.firstChild);a.offsetParent;)b+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;return b+=a.offsetLeft,c+=a.offsetTop,{x:b,y:c}},autoScroll:function(a){var d=this.currentTable.tableDnDConfig,e=b.pageYOffset,f=b.innerHeight?b.innerHeight:c.documentElement.clientHeight?c.documentElement.clientHeight:c.body.clientHeight;c.all&&(void 0!==c.compatMode&&"BackCompat"!==c.compatMode?e=c.documentElement.scrollTop:void 0!==c.body&&(e=c.body.scrollTop)),a.y-e<d.scrollAmount&&b.scrollBy(0,-d.scrollAmount)||f-(a.y-e)<d.scrollAmount&&b.scrollBy(0,d.scrollAmount)},moveVerticle:function(a,b){0!==a.vertical&&b&&this.dragObject!==b&&this.dragObject.parentNode===b.parentNode&&(0>a.vertical&&this.dragObject.parentNode.insertBefore(this.dragObject,b.nextSibling)||0<a.vertical&&this.dragObject.parentNode.insertBefore(this.dragObject,b))},moveHorizontal:function(b,c){var d,e=this.currentTable.tableDnDConfig;if(!e.hierarchyLevel||0===b.horizontal||!c||this.dragObject!==c)return null;d=a(c).data("level"),0<b.horizontal&&d>0&&a(c).find("td:first").children(":first").remove()&&a(c).data("level",--d),0>b.horizontal&&d<e.hierarchyLevel&&a(c).prev().data("level")>=d&&a(c).children(":first").prepend(e.indentArtifact)&&a(c).data("level",++d)},mousemove:function(b){var c,d,e,f,g,h=a(a.tableDnD.dragObject),i=a.tableDnD.currentTable.tableDnDConfig;return b&&b.preventDefault(),!!a.tableDnD.dragObject&&("touchmove"===b.type&&event.preventDefault(),i.onDragClass&&h.addClass(i.onDragClass)||h.css(i.onDragStyle),d=a.tableDnD.mouseCoords(b),f=d.x-a.tableDnD.mouseOffset.x,g=d.y-a.tableDnD.mouseOffset.y,a.tableDnD.autoScroll(d),c=a.tableDnD.findDropTargetRow(h,g),e=a.tableDnD.findDragDirection(f,g),a.tableDnD.moveVerticle(e,c),a.tableDnD.moveHorizontal(e,c),!1)},findDragDirection:function(a,b){var c=this.currentTable.tableDnDConfig.sensitivity,d=this.oldX,e=this.oldY,f=d-c,g=d+c,h=e-c,i=e+c,j={horizontal:a>=f&&a<=g?0:a>d?-1:1,vertical:b>=h&&b<=i?0:b>e?-1:1};return 0!==j.horizontal&&(this.oldX=a),0!==j.vertical&&(this.oldY=b),j},findDropTargetRow:function(b,c){for(var d=0,e=this.currentTable.rows,f=this.currentTable.tableDnDConfig,g=0,h=null,i=0;i<e.length;i++)if(h=e[i],g=this.getPosition(h).y,d=parseInt(h.offsetHeight)/2,0===h.offsetHeight&&(g=this.getPosition(h.firstChild).y,d=parseInt(h.firstChild.offsetHeight)/2),c>g-d&&c<g+d)return b.is(h)||f.onAllowDrop&&!f.onAllowDrop(b,h)||a(h).hasClass("nodrop")?null:h;return null},processMouseup:function(){if(!this.currentTable||!this.dragObject)return null;var b=this.currentTable.tableDnDConfig,d=this.dragObject,e=0,h=0;a(c).unbind(f,this.mousemove).unbind(g,this.mouseup),b.hierarchyLevel&&b.autoCleanRelations&&a(this.currentTable.rows).first().find("td:first").children().each(function(){(h=a(this).parents("tr:first").data("level"))&&a(this).parents("tr:first").data("level",--h)&&a(this).remove()})&&b.hierarchyLevel>1&&a(this.currentTable.rows).each(function(){if((h=a(this).data("level"))>1)for(e=a(this).prev().data("level");h>e+1;)a(this).find("td:first").children(":first").remove(),a(this).data("level",--h)}),b.onDragClass&&a(d).removeClass(b.onDragClass)||a(d).css(b.onDropStyle),this.dragObject=null,b.onDrop&&this.originalOrder!==this.currentOrder()&&a(d).hide().fadeIn("fast")&&b.onDrop(this.currentTable,d),b.onDragStop&&b.onDragStop(this.currentTable,d),this.currentTable=null},mouseup:function(b){return b&&b.preventDefault(),a.tableDnD.processMouseup(),!1},jsonize:function(a){var b=this.currentTable;return a?JSON.stringify(this.tableData(b),null,b.tableDnDConfig.jsonPretifySeparator):JSON.stringify(this.tableData(b))},serialize:function(){return a.param(this.tableData(this.currentTable))},serializeTable:function(a){for(var b="",c=a.tableDnDConfig.serializeParamName||a.id,d=a.rows,e=0;e<d.length;e++){b.length>0&&(b+="&");var f=d[e].id;f&&a.tableDnDConfig&&a.tableDnDConfig.serializeRegexp&&(f=f.match(a.tableDnDConfig.serializeRegexp)[0],b+=c+"[]="+f)}return b},serializeTables:function(){var b=[];return a("table").each(function(){this.id&&b.push(a.param(a.tableDnD.tableData(this)))}),b.join("&")},tableData:function(b){var c,d,e,f,g=b.tableDnDConfig,h=[],i=0,j=0,k=null,l={};if(b||(b=this.currentTable),!b||!b.rows||!b.rows.length)return{error:{code:500,message:"Not a valid table."}};if(!b.id&&!g.serializeParamName)return{error:{code:500,message:"No serializable unique id provided."}};f=g.autoCleanRelations&&b.rows||a.makeArray(b.rows),d=g.serializeParamName||b.id,e=d,c=function(a){return a&&g&&g.serializeRegexp?a.match(g.serializeRegexp)[0]:a},l[e]=[],!g.autoCleanRelations&&a(f[0]).data("level")&&f.unshift({id:"undefined"});for(var m=0;m<f.length;m++)if(g.hierarchyLevel){if(0===(j=a(f[m]).data("level")||0))e=d,h=[];else if(j>i)h.push([e,i]),e=c(f[m-1].id);else if(j<i)for(var n=0;n<h.length;n++)h[n][1]===j&&(e=h[n][0]),h[n][1]>=i&&(h[n][1]=0);i=j,a.isArray(l[e])||(l[e]=[]),k=c(f[m].id),k&&l[e].push(k)}else(k=c(f[m].id))&&l[e].push(k);return l}},jQuery.fn.extend({tableDnD:a.tableDnD.build,tableDnDUpdate:a.tableDnD.updateTables,tableDnDSerialize:a.proxy(a.tableDnD.serialize,a.tableDnD),tableDnDSerializeAll:a.tableDnD.serializeTables,tableDnDData:a.proxy(a.tableDnD.tableData,a.tableDnD)})}(jQuery,window,window.document);// 4.7.13 (2018-05-16)
+!function(){"use strict";var e,t,n,r,o,i,a,u,s,c,l,f,d,m,p,g,h,v=function(e){return function(){return e}},y=v(!1),b=v(!0),V={noop:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},noarg:function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n()}},compose:function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},constant:v,identity:function(e){return e},tripleEquals:function(e,t){return e===t},curry:function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=a.concat(n);return i.apply(null,o)}},not:function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,arguments)}},die:function(e){return function(){throw new Error(e)}},apply:function(e){return e()},call:function(e){e()},never:y,always:b},C=V.never,x=V.always,w=function(){return N},N=(r={fold:function(e,t){return e()},is:C,isSome:C,isNone:x,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},or:n,orThunk:t,map:w,ap:w,each:function(){},bind:w,flatten:w,exists:C,forall:x,filter:w,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:V.constant("none()")},Object.freeze&&Object.freeze(r),r),E=function(n){var e=function(){return 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:x,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,or:t,orThunk:t,map:function(e){return E(e(n))},ap:function(e){return e.fold(w,function(e){return E(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:N},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(C,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:E,none:w,from:function(e){return null===e||e===undefined?N:E(e)}},S=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},k={isString:S("string"),isObject:S("object"),isArray:S("array"),isNull:S("null"),isBoolean:S("boolean"),isUndefined:S("undefined"),isFunction:S("function"),isNumber:S("number")},T=(o=Array.prototype.indexOf)===undefined?function(e,t){return L(e,t)}:function(e,t){return o.call(e,t)},R=function(e,t){return-1<T(e,t)},_=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,e)}return r},B=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},D=function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)},O=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return A.some(n);return A.none()},L=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},I=Array.prototype.push,M=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);I.apply(t,e[n])}return t},F=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},z=Array.prototype.slice,U=k.isFunction(Array.from)?Array.from:function(e){return z.call(e)},H={map:_,each:B,eachr:D,partition:function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},filter:O,groupBy:function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var u=e[i],s=t(u);s!==n&&(r.push(o),o=[]),n=s,o.push(u)}return 0!==o.length&&r.push(o),r},indexOf:function(e,t){var n=T(e,t);return-1===n?A.none():A.some(n)},foldr:function(e,t,n){return D(e,function(e){n=t(n,e)}),n},foldl:function(e,t,n){return B(e,function(e){n=t(n,e)}),n},find:function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()},findIndex:P,flatten:M,bind:function(e,t){var n=_(e,t);return M(n)},forall:F,exists:function(e,t){return P(e,t).isSome()},contains:R,equal:function(e,n){return e.length===n.length&&F(e,function(e,t){return e===n[t]})},reverse:function(e){var t=z.call(e,0);return t.reverse(),t},chunk:function(e,t){for(var n=[],r=0;r<e.length;r+=t){var o=e.slice(r,r+t);n.push(o)}return n},difference:function(e,t){return O(e,function(e){return!R(t,e)})},mapToObject: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},pure:function(e){return[e]},sort:function(e,t){var n=z.call(e,0);return n.sort(t),n},range:function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},head:function(e){return 0===e.length?A.none():A.some(e[0])},last:function(e){return 0===e.length?A.none():A.some(e[e.length-1])},from:U},q="undefined"!=typeof window?window:Function("return this;")(),j=function(e,t){for(var n=t!==undefined&&null!==t?t:q,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n},$=function(e,t){var n=e.split(".");return j(n,t)},W={getOrDie:function(e,t){var n=$(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},K=function(){return W.getOrDie("URL")},X={createObjectURL:function(e){return K().createObjectURL(e)},revokeObjectURL:function(e){K().revokeObjectURL(e)}},Y=navigator,G=Y.userAgent,J=function(e){return"matchMedia"in window&&matchMedia(e).matches};d=/Android/.test(G),a=(a=!(i=/WebKit/.test(G))&&/MSIE/gi.test(G)&&/Explorer/gi.test(Y.appName))&&/MSIE (\w+)\./.exec(G)[1],u=-1!==G.indexOf("Trident/")&&(-1!==G.indexOf("rv:")||-1!==Y.appName.indexOf("Netscape"))&&11,s=-1!==G.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(G),l=-1!==G.indexOf("Mac"),f=/(iPad|iPhone)/.test(G),m="FormData"in window&&"FileReader"in window&&"URL"in window&&!!X.createObjectURL,p=J("only screen and (max-device-width: 480px)")&&(d||f),g=J("only screen and (min-width: 800px)")&&(d||f),h=-1!==G.indexOf("Windows Phone"),s&&(i=!1);var Q,Z,ee,te,ne,re,oe,ie,ae,ue,se,ce,le,fe,de,me,pe,ge,he,ve={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:d,contentEditable:!f||m||534<=parseInt(G.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:window.getSelection&&"Range"in window,documentMode:a&&!s?document.documentMode||7:10,fileApi:m,ceFalse:!1===a||8<a,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!p&&!g,windowsPhone:h},ye=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}(),be=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},Ce=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},xe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=be(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},we={requestAnimationFrame:function(e,t){Q?Q.then(e):Q=new ye(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:be,setInterval:Ce,setEditorTimeout:function(e,t,n){return be(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=Ce(function(){e.removed?clearInterval(r):t()},n)},debounce:xe,throttle:xe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Ne=/^(?:mouse|contextmenu)|click/,Ee={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},Se=function(){return!1},ke=function(){return!0},Te=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ae=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Re=function(e,t){var n,r,o,i,a,u,s=t||{};for(n in e)Ee[n]||(s[n]=e[n]);if(s.target||(s.target=s.srcElement||document),ve.experimentalShadowDom&&(s.target=(r=e,o=s.target,a=o,(i=r.path)&&0<i.length&&(a=i[0]),r.composedPath&&(i=r.composedPath())&&0<i.length&&(a=i[0]),a)),e&&Ne.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var c=s.target.ownerDocument||document,l=c.documentElement,f=c.body;s.pageX=e.clientX+(l&&l.scrollLeft||f&&f.scrollLeft||0)-(l&&l.clientLeft||f&&f.clientLeft||0),s.pageY=e.clientY+(l&&l.scrollTop||f&&f.scrollTop||0)-(l&&l.clientTop||f&&f.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=ke,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=ke,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=ke,s.stopPropagation()})==((u=s).isDefaultPrevented===ke||u.isDefaultPrevented===Se)&&(s.isDefaultPrevented=Se,s.isPropagationStopped=Se,s.isImmediatePropagationStopped=Se),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s},_e=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()&&(Ae(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void we.setTimeout(s)}a()};!r.addEventListener||ve.ie&&ve.ie<11?(Te(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():Te(e,"DOMContentLoaded",a),Te(e,"load",a)}},Be=function(){var m,p,g,h,v,y=this,b={};p="mce-data-"+(+new Date).toString(32),h="onmouseenter"in document.documentElement,g="onfocusin"in 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=window,d=function(e){C(Re(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[p]?o=e[p]:(o=m++,e[p]=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,Re({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=Re(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),g||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=Re(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?_e(e,c,y):Te(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[p]){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],Ae(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ae(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return y;delete b[r];try{delete e[p]}catch(d){e[p]=null}}return y},y.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return y;for((n=Re(null,n)).type=t,n.target=e;(r=e[p])&&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[p]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[p]&&r(e);return y},y.destroy=function(){b={}},y.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};Be.Event=new Be,Be.Event.bind(window,"ready",function(){});var De="sizzle"+-new Date,Oe=window.document,Pe=0,Le=0,Ie=pt(),Me=pt(),Fe=pt(),ze=function(e,t){return e===t&&(ce=!0),0},Ue=typeof undefined,qe={}.hasOwnProperty,Ve=[],He=Ve.pop,je=Ve.push,$e=Ve.push,We=Ve.slice,Ke=Ve.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},Xe="[\\x20\\t\\r\\n\\f]",Ye="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Ge="\\["+Xe+"*("+Ye+")(?:"+Xe+"*([*^$|!~]?=)"+Xe+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Ye+"))|)"+Xe+"*\\]",Je=":("+Ye+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Ge+")*)|.*)\\)|)",Qe=new RegExp("^"+Xe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Xe+"+$","g"),Ze=new RegExp("^"+Xe+"*,"+Xe+"*"),et=new RegExp("^"+Xe+"*([>+~]|"+Xe+")"+Xe+"*"),tt=new RegExp("="+Xe+"*([^\\]'\"]*?)"+Xe+"*\\]","g"),nt=new RegExp(Je),rt=new RegExp("^"+Ye+"$"),ot={ID:new RegExp("^#("+Ye+")"),CLASS:new RegExp("^\\.("+Ye+")"),TAG:new RegExp("^("+Ye+"|[*])"),ATTR:new RegExp("^"+Ge),PSEUDO:new RegExp("^"+Je),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Xe+"*(even|odd|(([+-]|)(\\d*)n|)"+Xe+"*(?:([+-]|)"+Xe+"*(\\d+)|))"+Xe+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Xe+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Xe+"*((?:-\\d)?\\d*)"+Xe+"*\\)|)(?=[^-]|$)","i")},it=/^(?:input|select|textarea|button)$/i,at=/^h\d$/i,ut=/^[^{]+\{\s*\[native \w/,st=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ct=/[+~]/,lt=/'|\\/g,ft=new RegExp("\\\\([\\da-f]{1,6}"+Xe+"?|("+Xe+")|.)","ig"),dt=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{$e.apply(Ve=We.call(Oe.childNodes),Oe.childNodes),Ve[Oe.childNodes.length].nodeType}catch(Dw){$e={apply:Ve.length?function(e,t){je.apply(e,We.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var mt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:Oe)!==fe&&le(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||fe).nodeType)&&9!==u)return[];if(me&&!r){if(o=st.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 $e.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ee.getElementsByClassName)return $e.apply(n,t.getElementsByClassName(a)),n}if(ee.qsa&&(!pe||!pe.test(e))){if(f=l=De,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=oe(e),(l=t.getAttribute("id"))?f=l.replace(lt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+wt(c[s]);d=ct.test(e)&&Ct(t.parentNode)||t,m=c.join(",")}if(m)try{return $e.apply(n,d.querySelectorAll(m)),n}catch(p){}finally{l||t.removeAttribute("id")}}}return ae(e.replace(Qe,"$1"),t,n,r)};function pt(){var r=[];return function e(t,n){return r.push(t+" ")>te.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function gt(e){return e[De]=!0,e}function ht(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 vt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function yt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function bt(a){return gt(function(i){return i=+i,gt(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 Ct(e){return e&&typeof e.getElementsByTagName!==Ue&&e}for(Z in ee=mt.support={},re=mt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},le=mt.setDocument=function(e){var t,s=e?e.ownerDocument||e:Oe,n=s.defaultView;return s!==fe&&9===s.nodeType&&s.documentElement?(de=(fe=s).documentElement,me=!re(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){le()},!1):n.attachEvent&&n.attachEvent("onunload",function(){le()})),ee.attributes=!0,ee.getElementsByTagName=!0,ee.getElementsByClassName=ut.test(s.getElementsByClassName),ee.getById=!0,te.find.ID=function(e,t){if(typeof t.getElementById!==Ue&&me){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},te.filter.ID=function(e){var t=e.replace(ft,dt);return function(e){return e.getAttribute("id")===t}},te.find.TAG=ee.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ue)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},te.find.CLASS=ee.getElementsByClassName&&function(e,t){if(me)return t.getElementsByClassName(e)},ge=[],pe=[],ee.disconnectedMatch=!0,pe=pe.length&&new RegExp(pe.join("|")),ge=ge.length&&new RegExp(ge.join("|")),t=ut.test(de.compareDocumentPosition),he=t||ut.test(de.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},ze=t?function(e,t){if(e===t)return ce=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ee.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===Oe&&he(Oe,e)?-1:t===s||t.ownerDocument===Oe&&he(Oe,t)?1:se?Ke.call(se,e)-Ke.call(se,t):0:4&n?-1:1)}:function(e,t){if(e===t)return ce=!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:se?Ke.call(se,e)-Ke.call(se,t):0;if(o===i)return ht(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?ht(a[r],u[r]):a[r]===Oe?-1:u[r]===Oe?1:0},s):fe},mt.matches=function(e,t){return mt(e,null,null,t)},mt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==fe&&le(e),t=t.replace(tt,"='$1']"),ee.matchesSelector&&me&&(!ge||!ge.test(t))&&(!pe||!pe.test(t)))try{var n=(void 0).call(e,t);if(n||ee.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(Dw){}return 0<mt(t,fe,null,[e]).length},mt.contains=function(e,t){return(e.ownerDocument||e)!==fe&&le(e),he(e,t)},mt.attr=function(e,t){(e.ownerDocument||e)!==fe&&le(e);var n=te.attrHandle[t.toLowerCase()],r=n&&qe.call(te.attrHandle,t.toLowerCase())?n(e,t,!me):undefined;return r!==undefined?r:ee.attributes||!me?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},mt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},mt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(ce=!ee.detectDuplicates,se=!ee.sortStable&&e.slice(0),e.sort(ze),ce){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return se=null,e},ne=mt.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+=ne(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=ne(t);return n},(te=mt.selectors={cacheLength:50,createPseudo:gt,match:ot,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(ft,dt),e[3]=(e[3]||e[4]||e[5]||"").replace(ft,dt),"~="===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]||mt.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]&&mt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ot.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&nt.test(n)&&(t=oe(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(ft,dt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ie[e+" "];return t||(t=new RegExp("(^|"+Xe+")"+e+"("+Xe+"|$)"))&&Ie(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ue&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=mt.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,p,g){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),y="of-type"===e;return 1===p&&0===g?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[De]||(l[De]={}))[m]||[])[0]===Pe&&r[1],a=r[0]===Pe&&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]=[Pe,u,a];break}}else if(d&&(r=(e[De]||(e[De]={}))[m])&&r[0]===Pe)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[De]||(i[De]={}))[m]=[Pe,a]),i!==e)););return(a-=g)===p||a%p==0&&0<=a/p}}},PSEUDO:function(e,i){var t,a=te.pseudos[e]||te.setFilters[e.toLowerCase()]||mt.error("unsupported pseudo: "+e);return a[De]?a(i):1<a.length?(t=[e,e,"",i],te.setFilters.hasOwnProperty(e.toLowerCase())?gt(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=Ke.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:gt(function(e){var r=[],o=[],u=ie(e.replace(Qe,"$1"));return u[De]?gt(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:gt(function(t){return function(e){return 0<mt(t,e).length}}),contains:gt(function(t){return t=t.replace(ft,dt),function(e){return-1<(e.textContent||e.innerText||ne(e)).indexOf(t)}}),lang:gt(function(n){return rt.test(n||"")||mt.error("unsupported lang: "+n),n=n.replace(ft,dt).toLowerCase(),function(e){var t;do{if(t=me?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=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===de},focus:function(e){return e===fe.activeElement&&(!fe.hasFocus||fe.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!te.pseudos.empty(e)},header:function(e){return at.test(e.nodeName)},input:function(e){return it.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:bt(function(){return[0]}),last:bt(function(e,t){return[t-1]}),eq:bt(function(e,t,n){return[n<0?n+t:n]}),even:bt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:bt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:bt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:bt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=te.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})te.pseudos[Z]=vt(Z);for(Z in{submit:!0,reset:!0})te.pseudos[Z]=yt(Z);function xt(){}function wt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Nt(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Le++;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=[Pe,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[De]||(e[De]={}))[u])&&r[0]===Pe&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Et(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 St(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 kt(m,p,g,h,v,e){return h&&!h[De]&&(h=kt(h)),v&&!v[De]&&(v=kt(v,e)),gt(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++)mt(e,t[r],n);return n}(p||"*",n.nodeType?[n]:n,[]),f=!m||!e&&p?l:St(l,u,m,n,r),d=g?v||(e?m:c||h)?[]:t:f;if(g&&g(f,d,n,r),h)for(o=St(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?Ke.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=St(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):$e.apply(t,d)})}function Tt(e){for(var r,t,n,o=e.length,i=te.relative[e[0].type],a=i||te.relative[" "],u=i?1:0,s=Nt(function(e){return e===r},a,!0),c=Nt(function(e){return-1<Ke.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==ue)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=te.relative[e[u].type])l=[Nt(Et(l),t)];else{if((t=te.filter[e[u].type].apply(null,e[u].matches))[De]){for(n=++u;n<o&&!te.relative[e[n].type];n++);return kt(1<u&&Et(l),1<u&&wt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(Qe,"$1"),t,u<n&&Tt(e.slice(u,n)),n<o&&Tt(e=e.slice(n)),n<o&&wt(e))}l.push(t)}return Et(l)}xt.prototype=te.filters=te.pseudos,te.setFilters=new xt,oe=mt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Me[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=te.preFilter;a;){for(i in n&&!(r=Ze.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=et.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Qe," ")}),a=a.slice(n.length)),te.filter)!(r=ot[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?mt.error(e):Me(e,u).slice(0)},ie=mt.compile=function(e,t){var n,h,v,y,b,r,o=[],i=[],a=Fe[e+" "];if(!a){for(t||(t=oe(e)),n=t.length;n--;)(a=Tt(t[n]))[De]?o.push(a):i.push(a);(a=Fe(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=ue,m=e||b&&te.find.TAG("*",o),p=Pe+=null==d?1:Math.random()||.1,g=m.length;for(o&&(ue=t!==fe&&t);c!==g&&null!=(i=m[c]);c++){if(b&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Pe=p)}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]=He.call(r));f=St(f)}$e.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&mt.uniqueSort(r)}return o&&(Pe=p,ue=d),l},y?gt(r):r))).selector=e}return a},ae=mt.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&oe(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&&ee.getById&&9===t.nodeType&&me&&te.relative[i[1].type]){if(!(t=(te.find.ID(a.matches[0].replace(ft,dt),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ot.needsContext.test(e)?0:i.length;o--&&(a=i[o],!te.relative[u=a.type]);)if((s=te.find[u])&&(r=s(a.matches[0].replace(ft,dt),ct.test(i[0].type)&&Ct(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&wt(i)))return $e.apply(n,r),n;break}}return(c||ie(e,l))(r,t,!me,n,ct.test(e)&&Ct(t.parentNode)||t),n},ee.sortStable=De.split("").sort(ze).join("")===De,ee.detectDuplicates=!!ce,le(),ee.sortDetached=!0;var At=Array.isArray,Rt=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},_t=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},Bt={isArray:At,toArray:function(e){var t,n,r=e;if(!At(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:Rt,map:function(n,r){var o=[];return Rt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return Rt(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:_t,find:function(e,t,n){var r=_t(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},Dt=/^\s*|\s*$/g,Ot=function(e){return null===e||e===undefined?"":(""+e).replace(Dt,"")},Pt=function(e,t){return t?!("array"!==t||!Bt.isArray(e))||typeof e===t:e!==undefined},Lt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),Bt.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Lt(e,n,r,o)}))},It={trim:Ot,isArray:Bt.isArray,is:Pt,toArray:Bt.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:Bt.each,map:Bt.map,grep:Bt.filter,inArray:Bt.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:Lt,createNS:function(e,t){var n,r;for(t=t||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||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Pt(e,"array")?e:Bt.map(e.split(t||","),Ot)},_addCacheSuffix:function(e){var t=ve.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Mt=document,Ft=Array.prototype.push,zt=Array.prototype.slice,Ut=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,qt=Be.Event,Vt=It.makeMap("children,contents,next,prev"),Ht=function(e){return void 0!==e},jt=function(e){return"string"==typeof e},$t=function(e,t){var n,r,o;for(o=(t=t||Mt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},Wt=function(e,t,n,r){var o;if(jt(t))t=$t(t,un(e[0]));else if(t.length&&!t.nodeType){if(t=tn.makeArray(t),r)for(o=t.length-1;0<=o;o--)Wt(e,t[o],n,r);else for(o=0;o<t.length;o++)Wt(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},Kt=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},Xt=function(e,t,n){var r,o;return t=tn(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},Yt=It.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Gt=It.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Jt={"for":"htmlFor","class":"className",readonly:"readOnly"},Qt={"float":"cssFloat"},Zt={},en={},tn=function(e,t){return new tn.fn.init(e,t)},nn=/^\s*|\s*$/g,rn=function(e){return null===e||e===undefined?"":(""+e).replace(nn,"")},on=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},an=function(e,n){var r=[];return on(e,function(e,t){n(t,e)&&r.push(t)}),r},un=function(e){return e?9===e.nodeType?e:e.ownerDocument:Mt};tn.fn=tn.prototype={constructor:tn,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 tn(e).attr(t);o.context=t=document}if(jt(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Ut.exec(e)))return tn(t).find(e);if(n[1])for(r=$t(e,un(t)).firstChild;r;)Ft.call(o,r),r=r.nextSibling;else{if(!(r=un(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 It.toArray(this)},add:function(e,t){var n,r,o=this;if(jt(e))return o.add(tn(e));if(!1!==t)for(n=tn.unique(o.toArray().concat(tn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Ft.apply(o,tn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)on(t,function(e,t){r.attr(e,t)});else{if(!Ht(n)){if(r[0]&&1===r[0].nodeType){if((e=Zt[t])&&e.get)return e.get(r[0],t);if(Gt[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=Zt[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=Jt[e]||e))on(e,function(e,t){n.prop(e,t)});else{if(!Ht(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)on(n,function(e,t){i.css(e,t)});else if(Ht(r))n=t(n),"number"!=typeof r||Yt[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=en[n])&&o.set)o.set(this,r);else{try{this.style[Qt[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=en[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],qt.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(Ht(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){tn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(Ht(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 Wt(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return Wt(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?Wt(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?Wt(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return tn(e).append(this),this},prependTo:function(e){return tn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Xt(this,e)},wrapAll:function(e){return Xt(this,e,!0)},wrapInner:function(e){return this.each(function(){tn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){tn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),tn(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(" ")?on(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=Kt(t,o))!==i&&(n=t.className,r?t.className=rn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return Kt(this[0],e)},each:function(e){return on(this,e)},on:function(e,t){return this.each(function(){qt.bind(this,e,t)})},off:function(e,t){return this.each(function(){qt.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?qt.fire(this,e.type,e):qt.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new tn(zt.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++)tn.find(e,this[t],r);return tn(r)},filter:function(n){return tn("function"==typeof n?an(this.toArray(),function(e,t){return n(t,e)}):tn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof tn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&tn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),tn(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:Ft,sort:[].sort,splice:[].splice},It.extend(tn,{extend:It.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:It.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:It.isArray,each:on,trim:rn,grep:an,find:mt,expr:mt.selectors,unique:mt.uniqueSort,text:mt.getText,contains:mt.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?tn.find.matchesSelector(t[0],e)?[t[0]]:[]:tn.find.matches(e,t)}});var sn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof tn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&tn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},cn=function(e,t,n,r){var o=[];for(r instanceof tn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&tn(e).is(r))break}o.push(e)}return o},ln=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};on({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return sn(e,"parentNode")},next:function(e){return ln(e,"nextSibling",1)},prev:function(e){return ln(e,"previousSibling",1)},children:function(e){return cn(e.firstChild,"nextSibling",1)},contents:function(e){return It.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){tn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(tn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(Vt[e]||(n=tn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=tn(n),t?n.filter(t):n}}),on({parentsUntil:function(e,t){return sn(e,"parentNode",t)},nextUntil:function(e,t){return cn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return cn(e,"previousSibling",1,t).slice(1)}},function(r,o){tn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(tn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=tn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=tn(n),e?n.filter(e):n}}),tn.fn.is=function(e){return!!e&&0<this.filter(e).length},tn.fn.init.prototype=tn.fn,tn.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 tn.extend(o,this),o};var fn=function(n,r,e){on(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};ve.ie&&ve.ie<8&&(fn(Zt,"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}}),fn(Zt,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),ve.ie&&ve.ie<9&&(Qt["float"]="styleFloat",fn(en,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),tn.attrHooks=Zt,tn.cssHooks=en;var dn,mn=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(null,arguments)),t}},pn=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 hn(r(1),r(2))},gn=function(){return hn(0,0)},hn=function(e,t){return{major:e,minor:t}},vn={nu:hn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?gn():pn(e,n)},unknown:gn},yn="Firefox",bn=function(e,t){return function(){return t===e}},Cn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:bn("Edge",t),isChrome:bn("Chrome",t),isIE:bn("IE",t),isOpera:bn("Opera",t),isFirefox:bn(yn,t),isSafari:bn("Safari",t)}},xn={unknown:function(){return Cn({current:undefined,version:vn.unknown()})},nu:Cn,edge:V.constant("Edge"),chrome:V.constant("Chrome"),ie:V.constant("IE"),opera:V.constant("Opera"),firefox:V.constant(yn),safari:V.constant("Safari")},wn="Windows",Nn="Android",En="Solaris",Sn="FreeBSD",kn=function(e,t){return function(){return t===e}},Tn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:kn(wn,t),isiOS:kn("iOS",t),isAndroid:kn(Nn,t),isOSX:kn("OSX",t),isLinux:kn("Linux",t),isSolaris:kn(En,t),isFreeBSD:kn(Sn,t)}},An={unknown:function(){return Tn({current:undefined,version:vn.unknown()})},nu:Tn,windows:V.constant(wn),ios:V.constant("iOS"),android:V.constant(Nn),linux:V.constant("Linux"),osx:V.constant("OSX"),solaris:V.constant(En),freebsd:V.constant(Sn)},Rn=function(e,t){var n=String(t).toLowerCase();return H.find(e,function(e){return e.search(n)})},_n=function(e,n){return Rn(e,n).map(function(e){var t=vn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Bn=function(e,n){return Rn(e,n).map(function(e){var t=vn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Dn=function(e,t){return-1!==e.indexOf(t)},On=function(e){return e.replace(/^\s+|\s+$/g,"")},Pn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ln=function(t){return function(e){return Dn(e,t)}},In=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Dn(e,"edge/")&&Dn(e,"chrome")&&Dn(e,"safari")&&Dn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pn],search:function(e){return Dn(e,"chrome")&&!Dn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Dn(e,"msie")||Dn(e,"trident")}},{name:"Opera",versionRegexes:[Pn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ln("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ln("firefox")},{name:"Safari",versionRegexes:[Pn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Dn(e,"safari")||Dn(e,"mobile/"))&&Dn(e,"applewebkit")}}],Mn=[{name:"Windows",search:Ln("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Dn(e,"iphone")||Dn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ln("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ln("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ln("linux"),versionRegexes:[]},{name:"Solaris",search:Ln("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ln("freebsd"),versionRegexes:[]}],Fn={browsers:V.constant(In),oses:V.constant(Mn)},zn=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=Fn.browsers(),m=Fn.oses(),p=_n(d,e).fold(xn.unknown,xn.nu),g=Bn(m,e).fold(An.unknown,An.nu);return{browser:p,os:g,deviceType:(n=p,r=e,o=(t=g).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:V.constant(o),isiPhone:V.constant(i),isTablet:V.constant(s),isPhone:V.constant(l),isTouch:V.constant(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:V.constant(f)})}},Un={detect:mn(function(){var e=navigator.userAgent;return zn(e)})},qn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:V.constant(e)}},Vn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return qn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return qn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return qn(n)},fromDom:qn,fromPoint:function(e,t,n){return A.from(e.dom().elementFromPoint(t,n)).map(qn)}},Hn=8,jn=9,$n=1,Wn=3,Kn=function(e){return e.dom().nodeName.toLowerCase()},Xn=function(e){return e.dom().nodeType},Yn=function(t){return function(e){return Xn(e)===t}},Gn=Yn($n),Jn=Yn(Wn),Qn=Yn(jn),Zn={name:Kn,type:Xn,value:function(e){return e.dom().nodeValue},isElement:Gn,isText:Jn,isDocument:Qn,isComment:function(e){return Xn(e)===Hn||"#comment"===Kn(e)}},er=(dn=Object.keys)===undefined?function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}:dn,tr=function(e,t){for(var n=er(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},nr=function(r,o){var i={};return tr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},rr=function(e,n){var r=[];return tr(e,function(e,t){r.push(n(e,t))}),r},or=function(e){return rr(e,function(e){return e})},ir={bifilter:function(e,n){var r={},o={};return tr(e,function(e,t){(n(e,t)?r:o)[t]=e}),{t:r,f:o}},each:tr,map:function(e,r){return nr(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},mapToArray:rr,tupleMap:nr,find:function(e,t){for(var n=er(e),r=0,o=n.length;r<o;r++){var i=n[r],a=e[i];if(t(a,i,e))return A.some(a)}return A.none()},keys:er,values:or,size:function(e){return or(e).length}},ar=function(e,t,n){if(!(k.isString(n)||k.isBoolean(n)||k.isNumber(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},ur=function(e,t,n){ar(e.dom(),t,n)},sr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},cr=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},lr={clone:function(e){return H.foldl(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:ur,setAll:function(e,t){var n=e.dom();ir.each(t,function(e,t){ar(n,t,e)})},get:sr,has:cr,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(o,i,e){Zn.isElement(o)&&Zn.isElement(i)&&H.each(e,function(e){var t,n,r;n=i,cr(t=o,r=e)&&!cr(n,r)&&ur(n,r,sr(t,r))})}},fr=mn(function(){return dr(Vn.fromDom(document))}),dr=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return Vn.fromDom(t)},mr={body:fr,getBody:dr,inBody:function(e){var t=Zn.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},pr=function(e){return e.style!==undefined},gr=function(e,t,n){if(!k.isString(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);pr(e)&&e.style.setProperty(t,n)},hr=function(e,t){return pr(e)?e.style.getPropertyValue(t):""},vr=function(e,t){var n=e.dom(),r=hr(n,t);return A.from(r).filter(function(e){return 0<e.length})},yr=function(e,t){var n=e.dom();ir.each(t,function(e,t){gr(n,t,e)})},br=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||mr.inBody(e)?r:hr(n,t);return null===o?undefined:o},Cr=vr,xr=function(e){return e.slice(0).sort()},wr=function(e,t){throw new Error("All required keys ("+xr(e).join(", ")+") were not specified. Specified keys were: "+xr(t).join(", ")+".")},Nr=function(e){throw new Error("Unsupported keys for object: "+xr(e).join(", "))},Er=function(t,e){if(!k.isArray(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");H.each(e,function(e){if(!k.isString(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},Sr=function(e){var n=xr(e);H.find(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},kr={immutable: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 H.each(t,function(e,t){r[e]=V.constant(n[t])}),r}},immutableBag:function(o,i){var a=o.concat(i);if(0===a.length)throw new Error("You must specify at least one required or optional field.");return Er("required",o),Er("optional",i),Sr(a),function(t){var n=ir.keys(t);H.forall(o,function(e){return H.contains(n,e)})||wr(o,n);var e=H.filter(n,function(e){return!H.contains(a,e)});0<e.length&&Nr(e);var r={};return H.each(o,function(e){r[e]=V.constant(t[e])}),H.each(i,function(e){r[e]=V.constant(Object.prototype.hasOwnProperty.call(t,e)?A.some(t[e]):A.none())}),r}}},Tr=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 W.getOrDie("Node")},Rr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},_r=function(e,t){return Rr(e,t,Ar().DOCUMENT_POSITION_CONTAINED_BY)},Br=$n,Dr=jn,Or=function(e){return e.nodeType!==Br&&e.nodeType!==Dr||0===e.childElementCount},Pr={all:function(e,t){var n=t===undefined?document:t.dom();return Or(n)?[]:H.map(n.querySelectorAll(e),Vn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==Br)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Or(n)?A.none():A.from(n.querySelector(e)).map(Vn.fromDom)}},Lr=function(e,t){return e.dom()===t.dom()},Ir=Un.detect().browser.isIE()?function(e,t){return _r(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Mr={eq:Lr,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return H.exists(t,V.curry(Lr,e))},contains:Ir,is:Pr.is},Fr=function(e){return Vn.fromDom(e.dom().ownerDocument)},zr=function(e){var t=e.dom();return A.from(t.parentNode).map(Vn.fromDom)},Ur=function(e){var t=e.dom();return A.from(t.previousSibling).map(Vn.fromDom)},qr=function(e){var t=e.dom();return A.from(t.nextSibling).map(Vn.fromDom)},Vr=function(e){var t=e.dom();return H.map(t.childNodes,Vn.fromDom)},Hr=function(e,t){var n=e.dom().childNodes;return A.from(n[t]).map(Vn.fromDom)},jr=kr.immutable("element","offset"),$r={owner:Fr,defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return Vn.fromDom(t)},documentElement:function(e){var t=Fr(e);return Vn.fromDom(t.dom().documentElement)},parent:zr,findIndex:function(n){return zr(n).bind(function(e){var t=Vr(e);return H.findIndex(t,function(e){return Mr.eq(n,e)})})},parents:function(e,t){for(var n=k.isFunction(t)?t:V.constant(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Vn.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},siblings:function(t){return zr(t).map(Vr).map(function(e){return H.filter(e,function(e){return!Mr.eq(t,e)})}).getOr([])},prevSibling:Ur,offsetParent:function(e){var t=e.dom();return A.from(t.offsetParent).map(Vn.fromDom)},prevSiblings:function(e){return H.reverse(Tr(e,Ur))},nextSibling:qr,nextSiblings:function(e){return Tr(e,qr)},children:Vr,child:Hr,firstChild:function(e){return Hr(e,0)},lastChild:function(e){return Hr(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=Vr(e);return 0<n.length&&t<n.length?jr(n[t],0):jr(e,t)}},Wr=Un.detect().browser,Kr=function(e){return H.find(e,Zn.isElement)},Xr={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"===br(Vn.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=Vn.fromDom(t),Wr.isFirefox()&&"table"===Zn.name(i)?Kr($r.children(i)).filter(function(e){return"caption"===Zn.name(e)}).bind(function(o){return Kr($r.nextSiblings(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}}},Yr=function(e){var n=A.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){H.each(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=A.some(e),i(t),t=[]}),{get:r,map:function(n){return Yr(function(t){r(function(e){t(n(e))})})},isReady:o}},Gr={nu:Yr,pure:function(t){return Yr(function(e){e(t)})}},Jr=function(n){return function(){var e=Array.prototype.slice.call(arguments),t=this;setTimeout(function(){n.apply(t,e)},0)}},Qr=function(t){var e=function(e){t(Jr(e))};return{map:function(r){return Qr(function(n){e(function(e){var t=r(e);n(t)})})},bind:function(n){return Qr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Qr(function(t){e(function(e){n.get(t)})})},toLazy:function(){return Gr.nu(e)},get:e}},Zr={nu:Qr,pure:function(t){return Qr(function(e){e(t)})}},eo=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):H.each(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},to=function(e){return eo(e,Zr.nu)},no={par:to,mapM:function(e,t){var n=H.map(e,t);return to(n)},compose:function(t,n){return function(e){return n(e).bind(t)}}},ro=function(n){return{is:function(e){return n===e},isValue:V.always,isError:V.never,getOr:V.constant(n),getOrThunk:V.constant(n),getOrDie:V.constant(n),or:function(e){return ro(n)},orThunk:function(e){return ro(n)},fold:function(e,t){return t(n)},map:function(e){return ro(e(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 A.some(n)}}},oo=function(n){return{is:V.never,isValue:V.never,isError:V.always,getOr:V.identity,getOrThunk:function(e){return e()},getOrDie:function(){return V.die(String(n))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return oo(n)},each:V.noop,bind:function(e){return oo(n)},exists:V.never,forall:V.always,toOption:A.none}},io={value:ro,error:oo};function ao(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 uo,so,co,lo=function(t){var n;return function(e){return(n=n||H.mapToObject(t,V.constant(!0))).hasOwnProperty(Zn.name(e))}},fo=lo(["h1","h2","h3","h4","h5","h6"]),mo=lo(["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"]),po=function(e){return Zn.isElement(e)&&!mo(e)},go=function(e){return Zn.isElement(e)&&"br"===Zn.name(e)},ho=lo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),vo=lo(["ul","ol","dl"]),yo=lo(["li","dd","dt"]),bo=lo(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),Co=lo(["thead","tbody","tfoot"]),xo=lo(["td","th"]),wo=lo(["pre","script","textarea","style"]),No=function(t){return function(e){return!!e&&e.nodeType===t}},Eo=No(1),So=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}},ko=function(t){return function(e){if(Eo(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},To=No(3),Ao=No(8),Ro=No(9),_o=So("br"),Bo=ko("true"),Do=ko("false"),Oo={isText:To,isElement:Eo,isComment:Ao,isDocument:Ro,isBr:_o,isContentEditableTrue:Bo,isContentEditableFalse:Do,matchNodeNames:So,hasPropValue:function(t,n){return function(e){return Eo(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return Eo(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return Eo(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(Eo(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 Eo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return Eo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return Eo(e)&&"TABLE"===e.tagName}},Po=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Lo=function(e,t){var n,r=t.childNodes;if(!Oo.isElement(t)||!Po(t)){for(n=r.length-1;0<=n;n--)Lo(e,r[n]);if(!1===Oo.isDocument(t)){if(Oo.isText(t)&&0<t.nodeValue.length){var o=It.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(Oo.isElement(t)&&(1===(r=t.childNodes).length&&Po(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||bo(Vn.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Io={trimNode:Lo},Mo=It.makeMap,Fo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Uo=/[<>&\"\']/g,qo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Vo={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"};so={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},co={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Ho=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)),so[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};uo=Ho("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 jo=function(e,t){return e.replace(t?Fo:zo,function(e){return so[e]||e})},$o=function(e,t){return e.replace(t?Fo:zo,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":so[e]||"&#"+e.charCodeAt(0)+";"})},Wo=function(e,t,n){return n=n||uo,e.replace(t?Fo:zo,function(e){return so[e]||n[e]||e})},Ko={encodeRaw:jo,encodeAllRaw:function(e){return(""+e).replace(Uo,function(e){return so[e]||e})},encodeNumeric:$o,encodeNamed:Wo,getEncodeFunc:function(e,t){var n=Ho(t)||uo,r=Mo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Fo:zo,function(e){return so[e]!==undefined?so[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 Wo(e,t,n)}:Wo:r.numeric?$o:jo},decode:function(e){return e.replace(qo,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))):Vo[t]||String.fromCharCode(t):co[e]||uo[e]||(n=e,(r=Vn.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Xo={},Yo={},Go=It.makeMap,Jo=It.each,Qo=It.extend,Zo=It.explode,ei=It.inArray,ti=function(e,t){return(e=It.trim(e))?e.split(t||" "):[]},ni=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=ti(n)),r=(e=ti(e)).length;r--;)i={attributes:a(o=ti([u,t].join(" "))),attributesOrder:o,children:a(n,Yo)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=ti(e)).length,t=ti(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 Xo[e]?Xo[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 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(" "),Jo(ti(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Jo(ti(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 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")),Jo(ti("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,Xo[e]=s)},ri=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),Jo(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Go(e,/[, ]/):Zo(e,/[, ]/)})),r};function oi(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},p={},E=[],g={},h={},v=function(e,t,n){var r=i[e];return r?r=Go(r,/[, ]/,Go(r.toUpperCase(),/[, ]/)):(r=Xo[e])||(r=Go(t," ",Go(t.toUpperCase()," ")),r=Qo(r,n),Xo[e]=r),r};n=ni((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ri(i.valid_styles),t=ri(i.invalid_styles,"map"),s=ri(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 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"),Jo((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,p,g,h,v,y,b,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=ti(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(p=i[1],c=i[2],g=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===p&&(a.paddEmpty=!0),"-"===p&&(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=ti(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),p=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(ei(m,l),1);continue}p&&("="===p&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),u.defaultValue=b),":"===p&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),u.forcedValue=b),"<"===p&&(u.validValues=Go(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),g&&(a.outputName=c,N[g]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},b=function(e){N={},E=[],y(e),Jo(n,function(e,t){p[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(Xo.text_block_elements=Xo.block_elements=null,Jo(ti(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(p[o]=p[r],g[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=Qo({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}Jo(p,function(e,t){e[r]&&(p[t]=e=Qo({},p[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Xo[i.schema]=null,e&&Jo(ti(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?p[r[2]]:p[r[2]]={"#comment":{}},t=p[r[2]],Jo(ti(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):(Jo(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},p[t]=e.children}),"html5"!==i.schema&&Jo(ti("strong/b em/i"),function(e){e=ti(e,"/"),N[e[1]].outputName=e[0]}),Jo(ti("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Jo(ti("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),Jo(ti("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]"),Jo({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=ti(e))}),i.invalid_elements&&Jo(Zo(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||y("span[!data-mce-type|*]"),{children:p,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=p[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 g},addValidElements:y,setValidElements:b,addCustomElements:C,addValidChildren:x}}var ii=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 ai(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={},k="\ufeff";for(b=b||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+k).split(" "),C=0;C<t.length;C++)S[t[C]]=k+C,S[k+C]=t[C];return{toHex:function(e){return e.replace(x,ii)},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}},p=function(e){return o=!0,S[e]},g=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=g(o)).replace(/\'/g,"\\'")+"'";if(t=g(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,p).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,p)});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(k)||-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,ii)).replace(w,y),c[n]=o?g(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 ui,si=It.each,ci=It.grep,li=ve.ie,fi=/^([a-z0-9],?)+$/i,di=/^[ \t\r\n]*$/,mi=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},pi=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)},gi=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 hi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=window,o={},t=0,e=function(m,e){var p,g=0,h={};p=(e=e||{}).maxLoadTime||5e3;var v=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?we.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=It._addCacheSuffix(e),h[e]?a=h[e]:(a={passed:[],failed:[]},h[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"+g++,o.async=!1,o.defer=!1,i=(new Date).getTime(),"onload"in o&&!((d=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void v(r);l()}var d;v(o),o.href=e}else s();else u()},t=function(t){return Zr.nu(function(e){n(t,V.compose(e,V.constant(io.value(t))),V.compose(e,V.constant(io.error(t))))})},o=function(e){return e.fold(V.identity,V.identity)};return{load:n,loadAll:function(e,n,r){no.par(H.map(e,t)).get(function(e){var t=H.partition(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a),l=[],f=u.schema?u.schema:oi({}),d=ai({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new Be(u.proxy):Be.Event,n=f.getBlockElements(),p=tn.overrideDefaults(function(){return{context:a,element:q.getRoot()}}),g=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=g(e)),p(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=g(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 Xr.getPos(a.body,g(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=ve.ie&&ve.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=g(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(fi.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<mt(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=g(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),It.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},k=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},T=function(e,n,r){var o,t="string"==typeof e?g(e):e;if(!t)return!1;if(It.isArray(t)&&(t.length||0===t.length))return o=[],si(t,function(e,t){e&&("string"==typeof e&&(e=g(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},A=function(e,t){h(e).each(function(e,n){si(t,function(e,t){b(n,t,e)})})},R=function(e,r){var t=h(e);li?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){tn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},_=function(e,n,r,o,i){return T(e,function(e){var t="string"==typeof n?a.createElement(n):n;return A(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&R(t,o)),i?t:e.appendChild(t)})},B=function(e,t,n){return _(a.createElement(e),e,t,n,!0)},D=Ko.decode,O=Ko.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]},L=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&tn(this).attr("class",null)})},I=function(t,e,n){return T(e,function(e){return It.is(e,"array")&&(t=t.cloneNode(!0)),n&&si(ci(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},M=function(){return a.createRange()},F=function(e,t,n,r){if(It.isArray(e)){for(var o=e.length;o--;)e[o]=F(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||q)},z=function(e,t,n){var r;if(It.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&&Oo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},q={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},$:p,$$:h,root:null,clone:function(t,e){if(!li||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return si(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,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=g(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:g,getNext:function(e,t){return k(e,t,"nextSibling")},getPrev:function(e,t){return k(e,t,"previousSibling")},select:function(e,t){return mt(e,g(t)||u.root_element||a,[])},is:E,add:_,create:B,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+'="'+O(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&&pi(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&pi(d,n)},removeAllAttribs:function(e){return T(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:b,setAttribs:A,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(q!==hi.DOM&&a===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;q===hi.DOM||a!==document?(e||(e=""),n=a.getElementsByTagName("head")[0],si(e.split(","),function(e){var t;e=It._addCacheSuffix(e),o[e]||(o[e]=!0,t=B("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):hi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){L(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:L,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:R,getOuterHTML:function(e){var t="string"==typeof e?g(e):e;return Oo.isElement(t)?t.outerHTML:tn("<div></div>").append(tn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(tn(this).html(t),!0)})},decode:D,encode:O,insertAfter:function(e,t){var r=g(t);return T(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=B(e),si(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),I(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(It.trim(e))},run:T,getAttribs:y,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new ao(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Oo.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&&!di.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&di.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:M,nodeIndex:gi,split:function(e,t,n){var r,o,i,a=M();if(e&&t)return a.setStart(e.parentNode,gi(e)),a.setEnd(t.parentNode,gi(t)),r=a.extractContents(),(a=M()).setStart(t.parentNode,gi(t)+1),a.setEnd(e.parentNode,gi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Io.trimNode(q,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Io.trimNode(q,o),e),P(e),n||t},bind:F,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])}mt.setDocument&&mt.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=mi(d,u,function(){return q}),q}(ui=hi||(hi={})).DOM=ui(document),ui.nodeIndex=gi;var vi=hi,yi=vi.DOM,bi=It.each,Ci=It.grep,xi=function(e){return"function"==typeof e},wi=function(){var f={},o=[],i={},a=[],d=0;this.isDone=function(e){return 2===f[e]},this.markDone=function(e){f[e]=2},this.add=this.load=function(e,t,n,r){f[e]===undefined&&(o.push(e),f[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete f[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var s,c=[],l=function(t,e){bi(i[e],function(e){xi(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(s=function(){var e=Ci(n);if(n.length=0,bi(e,function(e){var t,n,r,o,i,a,u;2!==f[e]?3!==f[e]?1!==f[e]&&(f[e]=1,d++,t=e,n=function(){f[e]=2,d--,l("success",e),s()},r=function(){f[e]=3,d--,c.push(e),l("failure",e),s()},u=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},i=(a=yi).uniqueId(),(o=document.createElement("script")).id=i,o.type="text/javascript",o.src=It._addCacheSuffix(t),"onreadystatechange"in o?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&u()}:o.onload=u,o.onerror=function(){xi(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(o)):l("failure",e):l("success",e)}),!d){var t=a.slice(0);a.length=0,bi(t,function(e){0===c.length?xi(e.success)&&e.success.call(e.scope):xi(e.failure)&&e.failure.call(e.scope,c)})}})()}};wi.ScriptLoader=new wi;var Ni,Ei=It.each;function Si(){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(n,e,t){var r=s(name);Ei(r,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),e&&(t?e.call(t):e.call(wi))},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=Si.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(t,n,r):wi.ScriptLoader.add(i,function(){return l(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=Si.language;if(n&&!1!==Si.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;wi.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=H.partition(i,function(e){return e.name===t});return i=r.fail,Ei(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];Ei(t,function(e){wi.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(Ni=Si||(Si={})).PluginManager=Ni(),Ni.ThemeManager=Ni();var ki,Ti="\ufeff",Ai=function(e){return e===Ti},Ri=Ti,_i=function(e){return e.replace(new RegExp(Ti,"g"),"")},Bi=Oo.isElement,Di=Oo.isText,Oi=function(e){return Di(e)&&(e=e.parentNode),Bi(e)&&e.hasAttribute("data-mce-caret")},Pi=function(e){return Di(e)&&Ai(e.data)},Li=function(e){return Oi(e)||Pi(e)},Ii=function(e){return e.firstChild!==e.lastChild||!Oo.isBr(e.firstChild)},Mi=function(e){var t=e.container();return e&&Oo.isText(t)&&t.data.charAt(e.offset())===Ri},Fi=function(e){var t=e.container();return e&&Oo.isText(t)&&t.data.charAt(e.offset()-1)===Ri},zi=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=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},Ui=function(e){return Di(e)&&e.data[0]===Ri},qi=function(e){return Di(e)&&e.data[e.data.length-1]===Ri},Vi=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Oo.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},Hi=Oo.isContentEditableTrue,ji=Oo.isContentEditableFalse,$i=Oo.isBr,Wi=Oo.isText,Ki=Oo.matchNodeNames("script style textarea"),Xi=Oo.matchNodeNames("img input textarea hr iframe video audio object"),Yi=Oo.matchNodeNames("table"),Gi=Li,Ji=function(e){return!Gi(e)&&(Wi(e)?!Ki(e.parentNode):Xi(e)||$i(e)||Yi(e)||Qi(e))},Qi=function(e){return!1===(t=e,Oo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&ji(e);var t},Zi=function(e,t){return Ji(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Qi(e))return!1;if(Hi(e))return!0}return!0}(e,t)},ea=Math.round,ta=function(e){return e?{left:ea(e.left),top:ea(e.top),bottom:ea(e.bottom),right:ea(e.right),width:ea(e.width),height:ea(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},na=function(e,t){return e=ta(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},ra=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},oa=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&ra(t.top-e.bottom,e,t)},ia=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&ra(t.bottom-e.top,e,t)},aa=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},ua=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},sa=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]"),ca=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&sa.test(e)},la=[].slice,fa=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=la.call(arguments);return r.length-1>=e.length?e.apply(this,r.slice(1)):function(){var e=r.concat([].slice.call(arguments));return fa.apply(this,e)}},da={constant:function(e){return function(){return e}},negate:function(t){return function(e){return!t(e)}},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=la.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=la.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},curry:fa,compose:function(t,n){return function(e){return t(n(e))}},noop:function(){}},ma=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return A.none();n.push(o.getOrDie())}return A.some(t.apply(null,n))},pa=Oo.isElement,ga=Ji,ha=Oo.matchStyleValues("display","block table"),va=Oo.matchStyleValues("float","left right"),ya=da.and(pa,ga,da.negate(va)),ba=da.negate(Oo.matchStyleValues("white-space","pre pre-line pre-wrap")),Ca=Oo.isText,xa=Oo.isBr,wa=vi.nodeIndex,Na=ua,Ea=function(e){return"createRange"in e?e.createRange():vi.DOM.createRng()},Sa=function(e){return e&&/[\r\n\t ]/.test(e)},ka=function(e){return!!e.setStart&&!!e.setEnd},Ta=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(Sa(e.toString())&&ba(n.parentNode)&&Oo.isText(n)&&(t=n.data,Sa(t[r-1])||Sa(t[r+1])))},Aa=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},Ra=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?ta(n[0]):ta(e.getBoundingClientRect()),!ka(e)&&xa(e)&&Aa(t)?(i=(r=e).ownerDocument,a=Ea(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=ta(a.getBoundingClientRect()),s.removeChild(u),o):Aa(t)&&ka(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Oo.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),Ra(i)}return null}(e):t},_a=function(e,t){var n=na(e,t);return n.width=1,n.right=n.left+1,n},Ba=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=Ea(e.ownerDocument);if(t<e.data.length){if(ca(e.data[t]))return r;if(ca(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!Ta(n)))return o(_a(Ra(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),Ta(n)||o(_a(Ra(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),Ta(n)||o(_a(Ra(n),!0)))};if(Ca(e.container()))return i(e.container(),e.offset()),r;if(pa(e.container()))if(e.isAtEnd())n=Na(e.container(),e.offset()),Ca(n)&&i(n,n.data.length),ya(n)&&!xa(n)&&o(_a(Ra(n),!1));else{if(n=Na(e.container(),e.offset()),Ca(n)&&i(n,0),ya(n)&&e.isAtEnd())return o(_a(Ra(n),!1)),r;t=Na(e.container(),e.offset()-1),ya(t)&&!xa(t)&&(ha(t)||ha(n)||!ya(n))&&o(_a(Ra(t),!1)),ya(n)&&o(_a(Ra(n),!0))}return r};function Da(t,n,e){var r=function(){return e||(e=Ba(Da(t,n))),e};return{container:da.constant(t),offset:da.constant(n),toRange:function(){var e;return(e=Ea(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return Ca(t),0===n},isAtEnd:function(){return Ca(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return Na(t,e?n-1:n)}}}(ki=Da||(Da={})).fromRangeStart=function(e){return ki(e.startContainer,e.startOffset)},ki.fromRangeEnd=function(e){return ki(e.endContainer,e.endOffset)},ki.after=function(e){return ki(e.parentNode,wa(e)+1)},ki.before=function(e){return ki(e.parentNode,wa(e))},ki.isAbove=function(e,t){return ma([H.head(t.getClientRects()),H.last(e.getClientRects())],oa).getOr(!1)},ki.isBelow=function(e,t){return ma([H.last(t.getClientRects()),H.head(e.getClientRects())],ia).getOr(!1)},ki.isAtStart=function(e){return!!e&&e.isAtStart()},ki.isAtEnd=function(e){return!!e&&e.isAtEnd()},ki.isTextPosition=function(e){return!!e&&Oo.isText(e.container())},ki.isElementPosition=function(e){return!1===ki.isTextPosition(e)};var Oa,Pa,La=Da,Ia=Oo.isElement,Ma=Oo.isText,Fa=function(e){var t=e.parentNode;t&&t.removeChild(e)},za=function(e,t){0===t.length?Fa(e):e.nodeValue=t},Ua=function(e){var t=_i(e);return{count:e.length-t.length,text:t}},qa=function(e,t){return ja(e),t},Va=function(e,t){return Ma(e)&&t.container()===e?(r=t,o=Ua((n=e).data.substr(0,r.offset())),i=Ua(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(za(n,a),La(n,r.offset()-o.count)):r):qa(e,t);var n,r,o,i,a},Ha=function(e,t){return t.container()===e.parentNode?(n=e,o=(r=t).container(),i=H.indexOf(H.from(o.childNodes),n).map(function(e){return e<r.offset()?La(o,r.offset()-1):r}).getOr(r),ja(n),i):qa(e,t);var n,r,o,i},ja=function(e){if(Ia(e)&&Li(e)&&(Ii(e)?e.removeAttribute("data-mce-caret"):Fa(e)),Ma(e)){var t=_i(function(e){try{return e.nodeValue}catch(t){return""}}(e));za(e,t)}},$a={removeAndReposition:function(e,t){return La.isTextPosition(t)?Va(e,t):Ha(e,t)},remove:ja},Wa=function(e){return La.isTextPosition(e)?0===e.offset():Ji(e.getNode())},Ka=function(e){if(La.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Ji(e.getNode(!0))},Xa=function(e,t){return!La.isTextPosition(e)&&!La.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Ya=function(e,t,n){return e?!Xa(t,n)&&(r=t,!(!La.isTextPosition(r)&&Oo.isBr(r.getNode())))&&Ka(t)&&Wa(n):!Xa(n,t)&&Wa(t)&&Ka(n);var r},Ga=function(e,t,n){var r=Ys(t);return A.from(e?r.next(n):r.prev(n))},Ja=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Oo.isText(u)?A.some(La(u,e?0:u.data.length)):u?Ji(u)?A.some(e?La.before(u):(a=u,Oo.isBr(a)?La.before(a):La.after(a))):(r=t,o=u,i=(n=e)?La.before(o):La.after(o),Ga(n,r,i)):A.none()},Qa={fromPosition:Ga,nextPosition:V.curry(Ga,!0),prevPosition:V.curry(Ga,!1),navigate:function(t,n,r){return Ga(t,n,r).bind(function(e){return bs(r,e,n)&&Ya(t,r,e)?Ga(t,n,e):A.some(e)})},positionIn:Ja,firstPositionIn:V.curry(Ja,!0),lastPositionIn:V.curry(Ja,!1)},Za=Oo.isContentEditableTrue,eu=Oo.isContentEditableFalse,tu=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},nu=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},ru=function(e,t,n){var r=Ss(1,e.getBody(),t),o=La.fromRangeStart(r),i=o.getNode();if(eu(i))return tu(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(eu(a))return tu(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return eu(e)||Za(e)});return eu(u)?tu(1,e,u,!1,n):null},ou=function(e,t,n){if(!t||!t.collapsed)return t;var r=ru(e,t,n);return r||t};(Pa=Oa||(Oa={}))[Pa.Br=0]="Br",Pa[Pa.Block=1]="Block",Pa[Pa.Wrap=2]="Wrap",Pa[Pa.Eol=3]="Eol";var iu,au,uu=function(e,t){return e===iu.Backwards?t.reverse():t},su=function(e,t,n,r){for(var o,i,a,u,s,c,l=Ys(n),f=r,d=[];f&&(s=l,c=f,o=t===iu.Forwards?s.next(c):s.prev(c));){if(Oo.isBr(o.getNode(!1)))return t===iu.Forwards?{positions:uu(t,d).concat([o]),breakType:Oa.Br,breakAt:A.some(o)}:{positions:uu(t,d),breakType:Oa.Br,breakAt:A.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,Oo.isBr(u.getNode(i===iu.Forwards))?Oa.Br:!1===bs(a,u)?Oa.Block:Oa.Wrap);return{positions:uu(t,d),breakType:m,breakAt:A.some(o)}}d.push(o),f=o}else f=o}return{positions:uu(t,d),breakType:Oa.Eol,breakAt:A.none()}},cu=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===iu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},lu=function(e,i){return H.foldl(e,function(e,o){return e.fold(function(){return A.some(o)},function(r){return ma([H.head(r.getClientRects()),H.head(o.getClientRects())],function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},A.none())},fu=function(t,e){return H.head(e.getClientRects()).bind(function(e){return lu(t,e.left)})},du=V.curry(su,Da.isAbove,-1),mu=V.curry(su,Da.isBelow,1),pu=V.curry(cu,-1,du),gu=V.curry(cu,1,mu),hu=function(e,t){return Pr.all(t,e)},vu=function(e,t,n,r,o){var i,a,u,s,c,l=hu(Vn.fromDom(n),"td,th").map(function(e){return e.dom()}),f=H.filter((i=e,a=l,H.bind(a,function(e){var t,n,r=(t=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(u=f,s=r,c=o,H.foldl(u,function(e,r){return e.fold(function(){return A.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-s)+Math.abs(e.y-c)),n=Math.sqrt(Math.abs(r.x-s)+Math.abs(r.y-c));return A.some(n<t?r:e)})},A.none())).map(function(e){return e.cell})},yu=V.curry(vu,function(e){return e.bottom},function(e,t){return e.y<t}),bu=V.curry(vu,function(e){return e.top},function(e,t){return e.y>t}),Cu=function(t,n){return H.head(n.getClientRects()).bind(function(e){return yu(t,e.left,e.top)}).bind(function(e){return fu((t=e,Qa.lastPositionIn(t).map(function(e){return du(t,e).positions.concat(e)}).getOr([])),n);var t})},xu=function(t,n){return H.last(n.getClientRects()).bind(function(e){return bu(t,e.left,e.top)}).bind(function(e){return fu((t=e,Qa.firstPositionIn(t).map(function(e){return[e].concat(mu(t,e).positions)}).getOr([])),n);var t})},wu=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}},Nu=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()&&Oo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=wu(t).y-wu(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)}},Eu=function(d,e){H.head(Da.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)})},Su=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},ku=function(e){return e.getParam("iframe_attrs",{})},Tu=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Au=function(e){return e.getParam("document_base_url","")},Ru=function(e){return Su(e,"body_id","tinymce")},_u=function(e){return Su(e,"body_class","")},Bu=function(e){return e.getParam("content_security_policy","")},Du=function(e){return e.getParam("br_in_pre",!0)},Ou=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},Pu=function(e){return e.getParam("forced_root_block_attrs",{})},Lu=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Iu=function(e){return e.getParam("no_newline_selector","")},Mu=function(e){return e.getParam("keep_styles",!0)},Fu=function(e){return e.getParam("end_container_on_empty_block",!1)},zu=function(e){return It.explode(e.getParam("font_size_style_values",""))},Uu=function(e){return It.explode(e.getParam("font_size_classes",""))},qu=function(t,n){$r.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Vu=function(e,t){e.dom().appendChild(t.dom())},Hu={before:qu,after:function(e,t){$r.nextSibling(e).fold(function(){$r.parent(e).each(function(e){Vu(e,t)})},function(e){qu(e,t)})},prepend:function(t,n){$r.firstChild(t).fold(function(){Vu(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:Vu,appendAt:function(e,t,n){$r.child(e,n).fold(function(){Vu(e,t)},function(e){qu(e,t)})},wrap:function(e,t){qu(e,t),Vu(t,e)}},ju=Un.detect().browser,$u=function(){return ju.isIE()||ju.isEdge()||ju.isFirefox()},Wu=function(e,t){e.selection.setRng(t),Eu(e,t)},Ku=function(t,n,e){var r=t(n,e);return r.breakType===Oa.Wrap&&0===r.positions.length?r.breakAt.map(function(e){return t(n,e).breakAt.isNone()}).getOr(!0):r.breakAt.isNone()},Xu=da.curry(Ku,du),Yu=da.curry(Ku,mu),Gu=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if($u()&&(o=t,i=s,a=n,u=La.fromRangeStart(i),Qa.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=tu(c,e,n,!t,!0);return Wu(e,l),!0}return!1},Ju=function(e,t){var n=t.getNode(e);return Oo.isElement(n)&&"TABLE"===n.nodeName?A.some(n):A.none()},Qu=function(u,s,c){var e=Ju(!!s,c),t=!1===s;e.fold(function(){return Wu(u,c.toRange())},function(a){return Qa.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return Wu(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Ou(r=u))?r.undoManager.transact(function(){var e=Vn.fromTag(i);lr.setAll(e,Pu(r)),Hu.append(e,Vn.fromTag("br")),n?Hu.after(Vn.fromDom(o),e):Hu.before(Vn.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),Wu(r,t)}):Wu(r,t.toRange()));var n,r,o,t,i})})},Zu=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=La.fromRangeStart(l),d=e.getBody();if(!t&&Xu(r,f)){var m=(u=d,Cu(s=n,c=f).orThunk(function(){return H.head(c.getClientRects()).bind(function(e){return lu(pu(u,La.before(s)),e.left)})}).getOr(La.before(s)));return Qu(e,t,m),!0}return!(!t||!Yu(r,f))&&(o=d,m=xu(i=n,a=f).orThunk(function(){return H.head(a.getClientRects()).bind(function(e){return lu(gu(o,La.after(i)),e.left)})}).getOr(La.after(i)),Qu(e,t,m),!0)},es=function(t,n){return function(){return A.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return A.from(t.dom.getParent(e,"table")).map(function(e){return Gu(t,n,e)})}).getOr(!1)}},ts=function(n,r){return function(){return A.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return A.from(n.dom.getParent(t,"table")).map(function(e){return Zu(n,r,e,t)})}).getOr(!1)}},ns=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return ns(n())}}},rs=Oo.isContentEditableFalse,os=function(e,t,n){var r,o,i,a,u,s=na(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},is=function(a,u,e){var t,s,c=ns(A.none()),l=function(){!function(e){var t,n,r,o,i;for(t=tn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,qi(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Ui(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&($a.remove(s),s=null),c.get().each(function(e){tn(e.caret).remove(),c.set(A.none())}),clearInterval(t)},f=function(){t=we.setInterval(function(){e()?tn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):tn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,Oo.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(Ri),o=e.parentNode,t){if(n=e.previousSibling,Di(n)){if(Li(n))return n;if(qi(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,Di(n)){if(Li(n))return n;if(Ui(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),rs(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=zi("p",e,t),n=os(a,e,t),tn(s).css("top",n.top);var i=tn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&tn(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=os(a,e.element,e.before);tn(e.caret).css(t)})},destroy:function(){return we.clearInterval(t)}}},as=function(e){return rs(e)||Oo.isTable(e)&&$u()},us=Oo.isContentEditableFalse,ss=Oo.matchStyleValues("display","block table table-cell table-caption list-item"),cs=Li,ls=Oi,fs=da.curry,ds=Oo.isElement,ms=Ji,ps=function(e){return 0<e},gs=function(e){return e<0},hs=function(e,t){for(var n;n=e(t);)if(!ls(n))return n;return null},vs=function(e,t,n,r,o){var i=new ao(e,r);if(gs(t)){if((us(e)||ls(e))&&n(e=hs(i.prev,!0)))return e;for(;e=hs(i.prev,o);)if(n(e))return e}if(ps(t)){if((us(e)||ls(e))&&n(e=hs(i.next,!0)))return e;for(;e=hs(i.next,o);)if(n(e))return e}return null},ys=function(e,t){for(;e&&e!==t;){if(ss(e))return e;e=e.parentNode}return null},bs=function(e,t,n){return ys(e.container(),n)===ys(t.container(),n)},Cs=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),ds(n)?n.childNodes[r+e]:null):null},xs=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},ws=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],cs(r)&&(r=r[o]),us(r)){if(a=n,ys(r,i=t)===ys(a,i))return r;break}if(ms(r))break;n=n.parentNode}return null},Ns=fs(xs,!0),Es=fs(xs,!1),Ss=function(e,t,n){var r,o,i,a,u=fs(ws,!0,t),s=fs(ws,!1,t);if(o=n.startContainer,i=n.startOffset,Oi(o)){if(ds(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,as(r)))return Ns(r);if("after"===a&&(r=o.previousSibling,as(r)))return Es(r)}if(!n.collapsed)return n;if(Oo.isText(o)){if(cs(o)){if(1===e){if(r=s(o))return Ns(r);if(r=u(o))return Es(r)}if(-1===e){if(r=u(o))return Es(r);if(r=s(o))return Ns(r)}return n}if(qi(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Ns(r):n;if(Ui(o)&&i<=1)return-1===e&&(r=u(o))?Es(r):n;if(i===o.data.length)return(r=s(o))?Ns(r):n;if(0===i)return(r=u(o))?Es(r):n}return n},ks=function(e,t){var n=Cs(e,t);return us(n)&&!Oo.isBogusAll(n)},Ts=function(e,t){return Oo.isTable(Cs(e,t))},As=function(e,t){return A.from(Cs(e?0:-1,t)).filter(us)},Rs=function(e,t,n){var r=Ss(e,t,n);return-1===e?Da.fromRangeStart(r):Da.fromRangeEnd(r)},_s=fs(ks,0),Bs=fs(ks,-1),Ds=fs(Ts,0),Os=fs(Ts,-1);(au=iu||(iu={}))[au.Backwards=-1]="Backwards",au[au.Forwards=1]="Forwards";var Ps,Ls,Is,Ms,Fs,zs=Oo.isContentEditableFalse,Us=Oo.isText,qs=Oo.isElement,Vs=Oo.isBr,Hs=Ji,js=function(e){return Xi(e)||!!Qi(t=e)&&!0!==Bt.reduce(t.getElementsByTagName("*"),function(e,t){return e||Hi(t)},!1);var t},$s=Zi,Ws=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ks=function(e,t){if(ps(e)){if(Hs(t.previousSibling)&&!Us(t.previousSibling))return La.before(t);if(Us(t))return La(t,0)}if(gs(e)){if(Hs(t.nextSibling)&&!Us(t.nextSibling))return La.after(t);if(Us(t))return La(t,t.data.length)}return gs(e)?Vs(t)?La.before(t):La.after(t):La.before(t)},Xs=function(e,t,n){var r,o,i,a,u;if(!qs(n)||!t)return null;if(t.isEqual(La.after(n))&&n.lastChild){if(u=La.after(n.lastChild),gs(e)&&Hs(n.lastChild)&&qs(n.lastChild))return Vs(n.lastChild)?La.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(Us(f)){if(gs(e)&&0<d)return La(f,--d);if(ps(e)&&d<f.length)return La(f,++d);r=f}else{if(gs(e)&&0<d&&(o=Ws(f,d-1),Hs(o)))return!js(o)&&(i=vs(o,e,$s,o))?Us(i)?La(i,i.data.length):La.after(i):Us(o)?La(o,o.data.length):La.before(o);if(ps(e)&&d<f.childNodes.length&&(o=Ws(f,d),Hs(o)))return Vs(o)&&n.lastChild===o?null:(s=o,c=n,Oo.isBr(s)&&(l=Xs(1,La.after(s),c))&&!bs(La.before(s),La.before(l),c)?Xs(e,La.after(o),n):!js(o)&&(i=vs(o,e,$s,o))?Us(i)?La(i,0):La.before(i):Us(o)?La(o,0):La.after(o));r=o||u.getNode()}return(ps(e)&&u.isAtEnd()||gs(e)&&u.isAtStart())&&(r=vs(r,e,da.constant(!0),n,!0),$s(r,n))?Ks(e,r):(o=vs(r,e,$s,n),!(a=Bt.last(Bt.filter(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),zs)))||o&&a.contains(o)?o?Ks(e,o):null:u=ps(e)?La.after(a):La.before(a))},Ys=function(t){return{next:function(e){return Xs(iu.Forwards,e,t)},prev:function(e){return Xs(iu.Backwards,e,t)}}},Gs=function(e){return It.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Js=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||Oo.isBr(t));var t},Qs=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Js(t))?e.slice(0,-1):e;var t},Zs=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},ec=function(e,t){var n=La.after(e),r=Ys(t).prev(n);return r?r.toRange():null},tc=function(t,e,n){var r,o,i,a,u=t.parentNode;return It.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=La.before(r),(a=Ys(o).next(i))?a.toRange():null},nc=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)},rc=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,p,g,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=Zs(o,i.startContainer),S=Qs(Gs(N.firstChild)),k=o.getRoot(),T=function(e){var t=La.fromRangeStart(i),n=Ys(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Zs(o,r.getNode())!==E};return T(1)?tc(E,S,k):T(2)?(f=E,d=S,m=k,o.insertAfter(d.reverse(),f),ec(d[0],m)):(g=S,h=k,v=p=E,b=(y=i).cloneRange(),C=y.cloneRange(),b.setStartBefore(v),C.setEndAfter(v),x=[b.cloneContents(),C.cloneContents()],(w=p.parentNode).insertBefore(x[0],p),It.each(g,function(e){w.insertBefore(e,p)}),w.insertBefore(x[1],p),w.removeChild(p),ec(g[g.length-1],h))},oc=function(e,t){return!!Zs(e,t)},ic=Oo.isText,ac=Oo.isBogus,uc=vi.nodeIndex,sc=function(e){var t=e.parentNode;return ac(t)?sc(t):t},cc=function(e){return e?Bt.reduce(e.childNodes,function(e,t){return ac(t)&&"BR"!==t.nodeName?e=e.concat(cc(t)):e.push(t),e},[]):[]},lc=function(t){return function(e){return t===e}},fc=function(e){var t,r,n,o;return(ic(e)?"text()":e.nodeName.toLowerCase())+"["+(r=cc(sc(t=e)),n=Bt.findIndex(r,lc(t),t),r=r.slice(0,n+1),o=Bt.reduce(r,function(e,t,n){return ic(t)&&ic(r[n-1])&&e++,e},0),r=Bt.filter(r,Oo.matchNodeNames(t.nodeName)),(n=Bt.findIndex(r,lc(t),t))-o)+"]"},dc=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),ic(n)?o=function(e,t){for(;(e=e.previousSibling)&&ic(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(fc(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=Bt.filter(a,da.negate(Oo.isBogus)),(u=u.concat(Bt.map(a,function(e){return fc(e)}))).reverse().join("/")+","+o},mc=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=Bt.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=cc(n),i=Bt.filter(i,function(e,t){return!ic(e)||!ic(i[t-1])}),(i=Bt.filter(i,Oo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?ic(r)?function(e,t){for(var n,r=e,o=0;ic(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!ic(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return ic(e)&&t>e.data.length&&(t=e.data.length),La(e,t)}(r,parseInt(o,10)):(o="after"===o?uc(r)+1:uc(r),La(r.parentNode,o)):null):null},pc=Oo.isContentEditableFalse,gc=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(Oo.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&&Oo.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},hc=function(e){Oo.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},vc=function(e,t,n){var r=0;return It.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},yc=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Oo.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))},bc=function(e){return yc(e,!0),yc(e,!1),e},Cc=function(e,t){var n;if(Oo.isElement(e)&&(e=ua(e,t),pc(e)))return e;if(Li(e)){if(Oo.isText(e)&&Oi(e)&&(e=e.parentNode),n=e.previousSibling,pc(n))return n;if(n=e.nextSibling,pc(n))return n}},xc=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(pc(r)||"IMG"===o)return{name:o,index:vc(n.dom,o,r)};var a,u,s,c,l,f,d,m=Cc((a=i).startContainer,a.startOffset)||Cc(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:vc(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=gc(f,u,c,l,!0),s.isCollapsed()||(d.end=gc(f,u,c,l,!1)),d)},wc=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)},Nc=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:vc(n,u,a)};var s=bc(r.cloneRange());if(!i){s.collapse(!1);var c=wc(n,o+"_end",t);s.insertNode(c),hc(c.nextSibling)}(r=bc(r)).collapse(!0);var l=wc(n,o+"_start",t);return r.insertNode(l),hc(l.previousSibling),e.moveToBookmark({id:o,keep:1}),{id:o}},Ec={getBookmark:function(e,t,n){return 2===t?xc(_i,n,e):3===t?(o=(r=e).getRng(),{start:dc(r.dom.getRoot(),La.fromRangeStart(o)),end:dc(r.dom.getRoot(),La.fromRangeEnd(o))}):t?{rng:e.getRng()}:Nc(e,!1);var r,o},getUndoBookmark:V.curry(xc,V.identity,!0),getPersistentBookmark:Nc},Sc="_mce_caret",kc=function(e){return Oo.isElement(e)&&e.id===Sc},Tc=function(e,t){for(;t&&t!==e;){if(t.id===Sc)return t;t=t.parentNode}return null},Ac=function(e,t){return!e.isBlock(t)||t.innerHTML||ve.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},Rc=function(e,t){return Qa.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},_c=function(e,t,n){return!(!1!==t.hasChildNodes()||!Tc(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(Ri),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},Bc=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,_c(c,i,r))return!0;if(s[o]>u.length-1)return!!_c(c,i,r)||Rc(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},Dc=function(e){return Oo.isText(e)&&0<e.data.length},Oc=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):Dc(c.nextSibling)?(r=c.nextSibling,o=0):Dc(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):Dc(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,It.each(It.grep(c.childNodes),function(e){Oo.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&&Oo.isText(a)&&!ve.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return A.some(La(u,s))}return A.none()},Pc=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,p,g,h,v,y=e.dom;if(t){if(v=t,It.isArray(v.start))return g=t,h=(p=y).createRng(),Bc(p,!0,g,h)&&Bc(p,!1,g,h)?A.some(h):A.none();if("string"==typeof t.start)return A.some((f=t,d=(l=y).createRng(),m=mc(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=mc(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=Oc(o=y,"start",i=t),c=Oc(o,"end",i),ma([s,(a=c,u=s,a.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,A.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return A.some(t.rng)}return A.none()},Lc=function(e,t,n){return Ec.getBookmark(e,t,n)},Ic=function(t,e){Pc(t,e).each(function(e){t.setRng(e)})},Mc=function(e){return Oo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Fc=It.each,zc=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Fc(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")))||Mc(e)||Mc(t))}},Uc=function(t,e){H.each(e,function(e){Hu.before(t,e)})},qc=function(t,e){H.each(e,function(e){Hu.append(t,e)})},Vc=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Hc={empty:function(e){e.dom().textContent="",H.each($r.children(e),function(e){Vc(e)})},remove:Vc,unwrap:function(e){var t=$r.children(e);0<t.length&&Uc(e,t),Vc(e)}},jc=(Ps=Zn.isText,Ls="text",Is=function(e){return Ps(e)?A.from(e.dom().nodeValue):A.none()},Ms=Un.detect().browser,{get:function(e){if(!Ps(e))throw new Error("Can only get "+Ls+" value of a "+Ls+" node");return Fs(e).getOr("")},getOption:Fs=Ms.isIE()&&10===Ms.version.major?function(e){try{return Is(e)}catch(Dw){return A.none()}}:Is,set:function(e,t){if(!Ps(e))throw new Error("Can only set raw "+Ls+" value of a "+Ls+" node");e.dom().nodeValue=t}}),$c=function(e){return jc.get(e)},Wc=function(e){var t=hu(e,"br"),n=H.filter(function(e){for(var t=[],n=e.dom();n;)t.push(Vn.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),go);t.length===n.length&&H.each(n,Hc.remove)},Kc=function(e){Hc.empty(e),Hu.append(e,Vn.fromHtml('<br data-mce-bogus="1">'))},Xc=function(n){$r.lastChild(n).each(function(t){$r.prevSibling(t).each(function(e){mo(n)&&go(t)&&mo(e)&&Hc.remove(t)})})},Yc=It.makeMap;function Gc(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=Yc(e.indent_before||""),c=Yc(e.indent_after||""),l=Ko.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 Jc(t,p){void 0===p&&(p=oi());var g=Gc(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},g.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=p.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(g.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);g.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),g.getContent()}}}var Qc=function(a){var u=La.fromRangeStart(a),s=La.fromRangeEnd(a),c=a.commonAncestorContainer;return Qa.fromPosition(!1,c,s).map(function(e){return!bs(u,s,c)&&bs(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},Zc=function(e){return e.collapsed?e:Qc(e)},el=Oo.matchNodeNames("td th"),tl=function(o,e,t){var n,r,i,a,u,s,c,l,f,d,m,p,g=o.schema.getTextInlineElements(),h=o.selection,v=o.dom;if(/^ | $/.test(e)&&(e=function(e){var t,n,r;t=h.getRng(),n=t.startContainer,r=t.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?e=e.replace(/^ /," "):o("previousSibling")||(e=e.replace(/^ /," ")),r<n.length?e=e.replace(/ (<br>|)$/," "):o("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}(e)),n=o.parser,p=t.merge,r=Jc({validate:o.settings.validate},o.schema),m='<span id="mce_marker" data-mce-type="bookmark">​</span>',s={content:e,format:"html",selection:!0,paste:t.paste},(s=o.fire("BeforeSetContent",s)).isDefaultPrevented())o.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:t.paste});else{-1===(e=s.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,m);var y,b,C,x,w=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=o.getBody();w===N&&h.isCollapsed()&&v.isBlock(N.firstChild)&&(y=N.firstChild)&&!o.schema.getShortEndedElements()[y.nodeName]&&v.isEmpty(N.firstChild)&&((l=v.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),h.setRng(l)),h.isCollapsed()||(o.selection.setRng(Zc(o.selection.getRng())),o.getDoc().execCommand("Delete",!1,null),C=(b=h.getRng()).startContainer,x=b.startOffset,3===C.nodeType&&b.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(e)||(e+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))));var E,S,k,T={context:(i=h.getNode()).nodeName.toLowerCase(),data:t.data,insert:!0};if(u=n.parse(e,T),!0===t.paste&&nc(o.schema,u)&&oc(v,i))return l=rc(r,v,o.selection.getRng(),u),o.selection.setRng(l),void o.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||!v.isBlock(f.name)){o.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(o._selectionOverrides.showBlockCaretContainer(i),T.invalid){for(h.setContent(m),i=h.getNode(),a=o.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;e=i===a?a.innerHTML:v.getOuterHTML(i),e=r.serialize(n.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return r.serialize(u)}))),i===a?v.setHTML(a,e):v.setOuterHTML(i,e)}else e=r.serialize(u),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):e.selection.setContent(t)}}(o,e,i);!function(){if(p){var n=o.getBody(),r=new zc(v);It.each(v.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==n;t=t.parentNode)g[e.nodeName.toLowerCase()]&&r.compare(t,e)&&v.remove(e,!0)})}}(),function(e){var t,n,r;if(e){if(h.scrollIntoView(e),t=function(e){for(var t=o.getBody();e&&e!==t;e=e.parentNode)if("false"===o.dom.getContentEditable(e))return e;return null}(e))return v.remove(e),h.select(t);l=v.createRng(),(f=e.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),ve.ie||(d=e.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(e),l.setEndBefore(e)),n=v.getParent(e,v.isBlock),v.remove(e),n&&v.isEmpty(n)&&(o.$(n).empty(),l.setStart(n,0),l.setEnd(n,0),el(n)||n.getAttribute("data-mce-fragment")||!(r=function(e){var t=La.fromRangeStart(e);if(t=Ys(o.getBody()).next(t))return t.toRange()}(l))?v.add(n,v.create("br",{"data-mce-bogus":"1"})):(l=r,v.remove(n))),h.setRng(l)}}(v.get("mce_marker")),E=o.getBody(),It.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=o.dom,k=o.selection.getStart(),A.from(S.getParent(k,"td,th")).map(Vn.fromDom).each(Xc),o.fire("SetContent",s),o.addVisual()}},nl=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=It.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};tl(e,o.content,o.details)};function rl(e,t,n,r,o){return e(n,r)?A.some(n):k.isFunction(o)&&o(n)?A.none():t(n,r,o)}var ol=function(e,t,n){for(var r=e.dom(),o=k.isFunction(n)?n:V.constant(!1);r.parentNode;){r=r.parentNode;var i=Vn.fromDom(r);if(t(i))return A.some(i);if(o(i))break}return A.none()},il=function(e,t){return H.find(e.dom().childNodes,V.compose(t,Vn.fromDom)).map(Vn.fromDom)},al=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(Vn.fromDom(e.childNodes[t])))return A.some(Vn.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return A.none()};return o(e.dom())},ul={first:function(e){return al(mr.body(),e)},ancestor:ol,closest:function(e,t,n){return rl(function(e){return t(e)},ol,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?il(Vn.fromDom(e.parentNode),function(e){return!Mr.eq(t,e)&&n(e)}):A.none()},child:il,descendant:al},sl=kr.immutable("sections","settings"),cl=Un.detect().deviceType.isTouch(),ll=["lists","autolink","autosave"],fl={theme:"mobile"},dl=function(e){var t=k.isArray(e)?e.join(" "):e,n=H.map(k.isString(t)?t.split(" "):[],On);return H.filter(n,function(e){return 0<e.length})},ml=function(e,t){return e.sections().hasOwnProperty(t)},pl=function(e,t,n,r){var o,i,a=dl(n.forced_plugins),u=dl(r.plugins),s=e&&ml(t,"mobile")?(o=u,H.filter(o,V.curry(H.contains,ll))):u,c=(i=s,[].concat(dl(a)).concat(dl(i)));return It.extend(r,{plugins:c.join(" ")})},gl=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,p,g,h,v=(o=["mobile"],i=r,a=ir.bifilter(i,function(e,t){return H.contains(o,t)}),sl(a.t,a.f)),y=It.extend(t,n,v.settings(),(p=e,h=(g=v).settings().inline,p&&ml(g,"mobile")&&!h?(l="mobile",f=fl,d=v.sections(),m=d.hasOwnProperty(l)?d[l]:{},It.extend({},f,m)):{}),{validate:!0,content_editable:v.settings().inline,external_plugins:(u=n,s=v.settings(),c=s.external_plugins?s.external_plugins:{},u&&u.external_plugins?It.extend({},u.external_plugins,c):c)});return pl(e,v,n,y)},hl=function(e,t,n){return A.from(t.settings[n]).filter(e)},vl=V.curry(hl,k.isString),yl=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)?H.each(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[It.trim(t[0])]=It.trim(t[1]):a[It.trim(t[0])]=It.trim(t)}):a=i,a):"string"===r?hl(k.isString,e,t).getOr(n):"number"===r?hl(k.isNumber,e,t).getOr(n):"boolean"===r?hl(k.isBoolean,e,t).getOr(n):"object"===r?hl(k.isObject,e,t).getOr(n):"array"===r?hl(k.isArray,e,t).getOr(n):"string[]"===r?hl((o=k.isString,function(e){return k.isArray(e)&&H.forall(e,o)}),e,t).getOr(n):"function"===r?hl(k.isFunction,e,t).getOr(n):u},bl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Cl=function(e,t){var n=t.container(),r=t.offset();return e?Pi(n)?Oo.isText(n.nextSibling)?La(n.nextSibling,0):La.after(n):Mi(t)?La(n,r+1):t:Pi(n)?Oo.isText(n.previousSibling)?La(n.previousSibling,n.previousSibling.data.length):La.before(n):Fi(t)?La(n,r-1):t},xl={isInlineTarget:function(e,t){var n=vl(e,"inline_boundaries_selector").getOr("a[href],code");return Pr.is(Vn.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,H.filter(vi.DOM.getParents(i.container(),"*",o),r));return A.from(a[a.length-1])},isRtl:function(e){return"rtl"===vi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,bl.test(t));var t},isAtZwsp:function(e){return Mi(e)||Fi(e)},normalizePosition:Cl,normalizeForwards:V.curry(Cl,!0),normalizeBackwards:V.curry(Cl,!1),hasSameParentBlock:function(e,t,n){var r=ys(t,e),o=ys(n,e);return r&&r===o}},wl=function(e,t){return Mr.contains(e,t)?ul.closest(t,function(e){return ho(e)||yo(e)},(n=e,function(e){return Mr.eq(n,Vn.fromDom(e.dom().parentNode))})):A.none();var n},Nl=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))},El=function(i,a,u){return ma([Qa.firstPositionIn(u),Qa.lastPositionIn(u)],function(e,t){var n=xl.normalizePosition(!0,e),r=xl.normalizePosition(!1,t),o=xl.normalizePosition(!1,a);return i?Qa.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):Qa.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Sl=function(e,t,n){return ul.ancestor(e,function(e){return Pr.is(e,t)},n)},kl=Sl,Tl=function(e,t){return Pr.one(t,e)},Al=function(e,t,n){return rl(Pr.is,Sl,e,t,n)},Rl=function(e,t,n){return kl(e,t,n).isSome()},_l=function(e,t){return Oo.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===(n=e,r=t,o=Vn.fromDom(n),i=Vn.fromDom(r),Rl(i,"pre,code",V.curry(Mr.eq,o)));var n,r,o,i},Bl=function(e,t){return Ji(t)&&!1===_l(e,t)||(n=t,Oo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Dl(t);var n},Dl=Oo.hasAttribute("data-mce-bookmark"),Ol=Oo.hasAttribute("data-mce-bogus"),Pl=Oo.hasAttributeValue("data-mce-bogus","all"),Ll=function(e){return function(e){var t,n,r=0;if(Bl(e,e))return!1;if(!(n=e.firstChild))return!0;t=new ao(n,e);do{if(Pl(n))n=t.next(!0);else if(Ol(n))n=t.next();else if(Oo.isBr(n))r++,n=t.next();else{if(Bl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Il=kr.immutable("block","position"),Ml=kr.immutable("from","to"),Fl=function(e,t){var n=Vn.fromDom(e),r=Vn.fromDom(t.container());return wl(n,r).map(function(e){return Il(e,t)})},zl=function(o,i,e){var t=Fl(o,La.fromRangeStart(e)),n=t.bind(function(e){return Qa.fromPosition(i,o,e.position()).bind(function(e){return Fl(o,e).map(function(e){return t=o,n=i,r=e,Oo.isBr(r.position().getNode())&&!1===Ll(r.block())?Qa.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?Qa.fromPosition(n,t,e).bind(function(e){return Fl(t,e)}):A.some(r)}).getOr(r):r;var t,n,r})})});return ma([t,n],Ml).filter(function(e){return r=e,!1===Mr.eq(r.from().block(),r.to().block())&&(n=e,$r.parent(n.from().block()).bind(function(t){return $r.parent(n.to().block()).filter(function(e){return Mr.eq(t,e)})}).isSome())&&(t=e,!1===Oo.isContentEditableFalse(t.from().block())&&!1===Oo.isContentEditableFalse(t.to().block()));var t,n,r})},Ul=function(e,t,n){return n.collapsed?zl(e,t,n):A.none()},ql=function(e,t,n){return Mr.contains(t,e)?$r.parents(e,function(e){return n(e)||Mr.eq(e,t)}).slice(0,-1):[]},Vl=function(e,t){return ql(e,t,V.constant(!1))},Hl=Vl,jl=function(e,t){return[e].concat(Vl(e,t))},$l=function(e){var t,n,r=(t=e,n=$r.children(t),H.findIndex(n,mo).fold(function(){return n},function(e){return n.slice(0,e)}));return H.each(r,function(e){Hc.remove(e)}),r},Wl=function(e,t){Qa.positionIn(e,t.dom()).each(function(e){var t=e.getNode();Oo.isBr(t)&&Hc.remove(Vn.fromDom(t))})},Kl=function(e,t){var n=jl(t,e);return H.find(n.reverse(),Ll).each(Hc.remove)},Xl=function(o,i){return Mr.contains(i,o)?$r.parent(o).bind(function(e){return Mr.eq(e,i)?A.some(o):(t=i,n=o,r=$r.parents(n,function(e){return Mr.eq(e,t)}),A.from(r[r.length-2]));var t,n,r}):A.none()},Yl=function(n,r,o){if(Ll(o))return Hc.remove(o),Ll(r)&&Kc(r),Qa.firstPositionIn(r.dom());Wl(!0,r),Wl(!1,o);var i=$l(r);return Xl(r,o).fold(function(){Kl(n,r);var e=Qa.lastPositionIn(o.dom());return H.each(i,function(e){Hu.append(o,e)}),e},function(t){var e=Qa.prevPosition(o.dom(),La.before(t.dom()));return H.each(i,function(e){Hu.before(t,e)}),Kl(n,r),e})},Gl=function(e,t,n,r){return t?Yl(e,r,n):Yl(e,n,r)},Jl=function(t,n){var e,r=Vn.fromDom(t.getBody());return(e=Ul(r.dom(),n,t.selection.getRng()).bind(function(e){return Gl(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},Ql=function(e,t){var n=Vn.fromDom(t),r=V.curry(Mr.eq,e);return ul.ancestor(n,xo,r).isSome()},Zl=function(e,t){var n,r,o=Qa.prevPosition(e.dom(),La.fromRangeStart(t)).isNone(),i=Qa.nextPosition(e.dom(),La.fromRangeEnd(t)).isNone();return!(Ql(n=e,(r=t).startContainer)||Ql(n,r.endContainer))&&o&&i},ef=function(e){var n,r,o,t,i=Vn.fromDom(e.getBody()),a=e.selection.getRng();return Zl(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ma([wl(n,Vn.fromDom(o.startContainer)),wl(n,Vn.fromDom(o.endContainer))],function(e,t){return!1===Mr.eq(e,t)&&(o.deleteContents(),Gl(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},tf=function(e,t){return!e.selection.isCollapsed()&&ef(e)},nf=function(a){if(!k.isArray(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 H.each(a,function(e,r){var t=ir.keys(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.isArray(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=ir.keys(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!H.forall(u,function(e){return H.contains(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){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},rf=nf([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),of=function(e,t,n,r){var o=r.getNode(!1===t);return wl(Vn.fromDom(e),Vn.fromDom(n.getNode())).map(function(e){return Ll(e)?rf.remove(e.dom()):rf.moveToElement(o)}).orThunk(function(){return A.some(rf.moveToElement(o))})},af=function(u,s,c){return Qa.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),xo(Vn.fromDom(a))||yo(Vn.fromDom(a))?A.none():(t=u,o=e,i=function(e){return po(Vn.fromDom(e))&&!bs(r,o,t)},As(!(n=s),r=c).fold(function(){return As(n,o).fold(V.constant(!1),i)},i)?A.none():s&&Oo.isContentEditableFalse(e.getNode())?of(u,s,c,e):!1===s&&Oo.isContentEditableFalse(e.getNode(!0))?of(u,s,c,e):s&&Bs(c)?A.some(rf.moveToPosition(e)):!1===s&&_s(c)?A.some(rf.moveToPosition(e)):A.none());var t,n,r,o,i,a})},uf=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",Oo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&Oo.isContentEditableFalse(n.nextSibling)?A.some(rf.moveToElement(n.nextSibling)):!1===t&&Oo.isContentEditableFalse(n.previousSibling)?A.some(rf.moveToElement(n.previousSibling)):A.none()).fold(function(){return af(r,e,o)},A.some):af(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return A.some(rf.remove(e))},function(e){return A.some(rf.moveToElement(e))},function(e){return bs(n,e,t)?A.none():A.some(rf.moveToPosition(e))});var t,n});var t,n,i,a,u},sf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===La.isTextPosition(n)&&o===r.parentNode&&i>La.before(r).offset()?La(t.container(),t.offset()-1):t;var n,r,o,i},cf=function(e){return Ji(e.previousSibling)?A.some((t=e.previousSibling,Oo.isText(t)?La(t,t.data.length):La.after(t))):e.previousSibling?Qa.lastPositionIn(e.previousSibling):A.none();var t},lf=function(e){return Ji(e.nextSibling)?A.some((t=e.nextSibling,Oo.isText(t)?La(t,0):La.before(t))):e.nextSibling?Qa.firstPositionIn(e.nextSibling):A.none();var t},ff=function(r,o){return cf(o).orThunk(function(){return lf(o)}).orThunk(function(){return e=r,t=o,n=La.before(t.previousSibling?t.previousSibling:t.parentNode),Qa.prevPosition(e,n).fold(function(){return Qa.nextPosition(e,La.after(t))},A.some);var e,t,n})},df=function(n,r){return lf(r).orThunk(function(){return cf(r)}).orThunk(function(){return e=n,t=r,Qa.nextPosition(e,La.after(t)).fold(function(){return Qa.prevPosition(e,La.before(t))},A.some);var e,t})},mf=function(e,t,n){return(r=e,o=t,i=n,r?df(o,i):ff(o,i)).map(V.curry(sf,n));var r,o,i},pf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},gf=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Zn.name(t))},hf=function(e){if(Ll(e)){var t=Vn.fromHtml('<br data-mce-bogus="1">');return Hc.empty(e),Hu.append(e,t),A.some(La.before(t.dom()))}return A.none()},vf=function(t,n,e){var r,a,o,i=mf(n,t.getBody(),e.dom()),u=ul.ancestor(e,V.curry(gf,t),(r=t.getBody(),function(e){return e.dom()===r})),s=(a=e,o=i,ma([$r.prevSibling(a),$r.nextSibling(a),o],function(e,t,n){var r,o=e.dom(),i=t.dom();return Oo.isText(o)&&Oo.isText(i)?(r=o.data.length,o.appendData(i.data),Hc.remove(t),Hc.remove(a),n.container()===i?La(o,r):n):(Hc.remove(a),n)}).orThunk(function(){return Hc.remove(a),o}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(hf).fold(function(){pf(t,n,s)},function(e){pf(t,n,A.some(e))})},yf=function(a,u){var e,t,n,r,o;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Ss(t?1:-1,e,n),o=La.fromRangeStart(r),!1===t&&Bs(o)?A.some(rf.remove(o.getNode(!0))):t&&_s(o)?A.some(rf.remove(o.getNode())):uf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),vf(o,i,Vn.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?La.before(e):La.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)},bf=function(e,t){var n,r=e.selection.getNode();return!!Oo.isContentEditableFalse(r)&&(n=Vn.fromDom(e.getBody()),H.each(hu(n,".mce-offscreen-selection"),Hc.remove),vf(e,t,Vn.fromDom(e.selection.getNode())),Nl(e),!0)},Cf=function(e,t){return e.selection.isCollapsed()?yf(e,t):bf(e,t)},xf=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Oo.isContentEditableTrue(t)||Oo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Oo.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(La.before(t).toRange())),!0},wf=Oo.isText,Nf=function(e){return wf(e)&&e.data[0]===Ri},Ef=function(e){return wf(e)&&e.data[e.data.length-1]===Ri},Sf=function(e){return e.ownerDocument.createTextNode(Ri)},kf=function(e,t){return e?function(e){if(wf(e.previousSibling))return Ef(e.previousSibling)||e.previousSibling.appendData(Ri),e.previousSibling;if(wf(e))return Nf(e)||e.insertData(0,Ri),e;var t=Sf(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(wf(e.nextSibling))return Nf(e.nextSibling)||e.nextSibling.insertData(0,Ri),e.nextSibling;if(wf(e))return Ef(e)||e.appendData(Ri),e;var t=Sf(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Tf=V.curry(kf,!0),Af=V.curry(kf,!1),Rf=function(e,t){return Oo.isText(e.container())?kf(t,e.container()):kf(t,e.getNode())},_f=function(e,t){var n=t.get();return n&&e.container()===n&&Pi(n)},Bf=function(n,e){return e.fold(function(e){$a.remove(n.get());var t=Tf(e);return n.set(t),A.some(La(t,t.length-1))},function(e){return Qa.firstPositionIn(e).map(function(e){if(_f(e,n))return La(n.get(),1);$a.remove(n.get());var t=Rf(e,!0);return n.set(t),La(t,1)})},function(e){return Qa.lastPositionIn(e).map(function(e){if(_f(e,n))return La(n.get(),n.get().length-1);$a.remove(n.get());var t=Rf(e,!1);return n.set(t),La(t,t.length-1)})},function(e){$a.remove(n.get());var t=Af(e);return n.set(t),A.some(La(t,1))})},Df=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return A.none()},Of=nf([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Pf=function(e,t){var n=ys(t,e);return n||e},Lf=function(e,t,n){var r=xl.normalizeForwards(n),o=Pf(t,r.container());return xl.findRootInline(e,o,r).fold(function(){return Qa.nextPosition(o,r).bind(V.curry(xl.findRootInline,e,o)).map(function(e){return Of.before(e)})},A.none)},If=function(e,t){return null===Tc(e,t)},Mf=function(e,t,n){return xl.findRootInline(e,t,n).filter(V.curry(If,t))},Ff=function(e,t,n){var r=xl.normalizeBackwards(n);return Mf(e,t,r).bind(function(e){return Qa.prevPosition(e,r).isNone()?A.some(Of.start(e)):A.none()})},zf=function(e,t,n){var r=xl.normalizeForwards(n);return Mf(e,t,r).bind(function(e){return Qa.nextPosition(e,r).isNone()?A.some(Of.end(e)):A.none()})},Uf=function(e,t,n){var r=xl.normalizeBackwards(n),o=Pf(t,r.container());return xl.findRootInline(e,o,r).fold(function(){return Qa.prevPosition(o,r).bind(V.curry(xl.findRootInline,e,o)).map(function(e){return Of.after(e)})},A.none)},qf=function(e){return!1===xl.isRtl(Hf(e))},Vf=function(e,t,n){return Df([Lf,Ff,zf,Uf],[e,t,n]).filter(qf)},Hf=function(e){return e.fold(V.identity,V.identity,V.identity,V.identity)},jf=function(e){return e.fold(V.constant("before"),V.constant("start"),V.constant("end"),V.constant("after"))},$f=function(e){return e.fold(Of.before,Of.before,Of.after,Of.after)},Wf=function(n,e,r,t,o,i){return ma([xl.findRootInline(e,r,t),xl.findRootInline(e,r,o)],function(e,t){return e!==t&&xl.hasSameParentBlock(r,e,t)?Of.after(n?e:t):i}).getOr(i)},Kf=function(e,r){return e.fold(V.constant(!0),function(e){return n=r,!(jf(t=e)===jf(n)&&Hf(t)===Hf(n));var t,n})},Xf=function(e,t){return e?t.fold(V.compose(A.some,Of.start),A.none,V.compose(A.some,Of.after),A.none):t.fold(A.none,V.compose(A.some,Of.before),A.none,V.compose(A.some,Of.end))},Yf=function(a,u,s,c){var e=xl.normalizePosition(a,c),l=Vf(u,s,e);return Vf(u,s,e).bind(V.curry(Xf,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=xl.normalizePosition(t,e),Qa.fromPosition(t,r,i).map(V.curry(xl.normalizePosition,t)).fold(function(){return o.map($f)},function(e){return Vf(n,r,e).map(V.curry(Wf,t,n,r,i,e)).filter(V.curry(Kf,o))}).filter(qf);var t,n,r,o,e,i})},Gf=Vf,Jf=Yf,Qf=(V.curry(Yf,!1),V.curry(Yf,!0),$f),Zf=function(e){return e.fold(Of.start,Of.start,Of.end,Of.end)},ed=function(e){return k.isFunction(e.selection.getSel().modify)},td=function(e,t,n){var r=e?1:-1;return t.setRng(La(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},nd=function(e,t){var n=t.selection.getRng(),r=e?La.fromRangeEnd(n):La.fromRangeStart(n);return!!ed(t)&&(e&&Mi(r)?td(!0,t.selection,r):!(e||!Fi(r))&&td(!1,t.selection,r))},rd=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},od=function(e){return!1!==e.settings.inline_boundaries},id=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},ad=function(t,e,n){return Bf(e,n).map(function(e){return rd(t,e),n})},ud=function(e,t,n){return function(){return!!od(t)&&nd(e,t)}},sd={move:function(a,u,s){return function(){return!!od(a)&&(t=a,n=u,e=s,r=t.getBody(),o=La.fromRangeStart(t.selection.getRng()),i=V.curry(xl.isInlineTarget,t),Jf(e,i,r,o).bind(function(e){return ad(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:V.curry(ud,!0),movePrevWord:V.curry(ud,!1),setupSelectedState:function(a){var u=ns(null),s=V.curry(xl.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;od(a)&&(t=s,n=a.dom,r=e.parents,o=H.filter(n.select('*[data-mce-selected="inline-boundary"]'),t),i=H.filter(r,t),H.each(H.difference(o,i),V.curry(id,!1)),H.each(H.difference(i,o),V.curry(id,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=La.fromRangeStart(e.selection.getRng());La.isTextPosition(n)&&!1===xl.isAtZwsp(n)&&(rd(e,$a.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=H.filter(e,n);H.each(t,function(e){var t=La.fromRangeStart(r.selection.getRng());Gf(n,r.getBody(),t).bind(function(e){return ad(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:rd},cd=function(t,n){return function(e){return Bf(n,e).map(function(e){return sd.setCaretPosition(t,e),!0}).getOr(!1)}},ld=function(r,o,i,a){var u=r.getBody(),s=V.curry(xl.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),Gf(s,u,La.fromRangeStart(r.selection.getRng())).map(Zf).map(cd(r,o))}),r.nodeChanged()},fd=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),ys(t,e)||e),u=V.curry(xl.isInlineTarget,n),s=Gf(u,a,o);return s.bind(function(e){return i?e.fold(V.constant(A.some(Zf(e))),A.none,V.constant(A.some(Qf(e))),A.none):e.fold(A.none,V.constant(A.some(Qf(e))),A.none,V.constant(A.some(Zf(e))))}).map(cd(n,r)).getOrThunk(function(){var t=Qa.navigate(i,a,o),e=t.bind(function(e){return Gf(u,a,e)});return s.isSome()&&e.isSome()?xl.findRootInline(u,a,o).map(function(e){return o=e,!!ma([Qa.firstPositionIn(o),Qa.lastPositionIn(o)],function(e,t){var n=xl.normalizePosition(!0,e),r=xl.normalizePosition(!1,t);return Qa.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(vf(n,i,Vn.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?ld(n,r,o,e):ld(n,r,e,o),!0})}).getOr(!1)})},dd=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=La.fromRangeStart(e.selection.getRng());return fd(e,t,n,r)}return!1},md=kr.immutable("start","end"),pd=kr.immutable("rng","table","cells"),gd=nf([{removeTable:["element"]},{emptyCells:["cells"]}]),hd=function(e,t){return Al(Vn.fromDom(e),"td,th",t)},vd=function(e,t){return kl(e,"table",t)},yd=function(e){return!1===Mr.eq(e.start(),e.end())},bd=function(e,n){return vd(e.start(),n).bind(function(t){return vd(e.end(),n).bind(function(e){return Mr.eq(t,e)?A.some(t):A.none()})})},Cd=function(e){return hu(e,"td,th")},xd=function(r,e){var t=hd(e.startContainer,r),n=hd(e.endContainer,r);return e.collapsed?A.none():ma([t,n],md).fold(function(){return t.fold(function(){return n.bind(function(t){return vd(t,r).bind(function(e){return H.head(Cd(e)).map(function(e){return md(e,t)})})})},function(t){return vd(t,r).bind(function(e){return H.last(Cd(e)).map(function(e){return md(t,e)})})})},function(e){return wd(r,e)?A.none():(n=r,vd((t=e).start(),n).bind(function(e){return H.last(Cd(e)).map(function(e){return md(t.start(),e)})}));var t,n})},wd=function(e,t){return bd(t,e).isSome()},Nd=function(e,t){var n,r,o,i,a,u=(n=e,V.curry(Mr.eq,n));return(r=t,o=u,i=hd(r.startContainer,o),a=hd(r.endContainer,o),ma([i,a],md).filter(yd).filter(function(e){return wd(o,e)}).orThunk(function(){return xd(o,r)})).bind(function(e){return bd(t=e,u).map(function(e){return pd(t,e,Cd(e))});var t})},Ed=function(e,t){return H.findIndex(e,function(e){return Mr.eq(e,t)})},Sd=function(n){return(r=n,ma([Ed(r.cells(),r.rng().start()),Ed(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?gd.removeTable(n.table()):gd.emptyCells(e)});var r},kd=function(e,t){return Nd(e,t).bind(Sd)},Td=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Ad=Td,Rd=function(e){return H.bind(e,function(e){var t=aa(e);return t?[Vn.fromDom(t)]:[]})},_d=function(e){return 1<Td(e).length},Bd=function(e){return H.filter(Rd(e),xo)},Dd=function(e){return hu(e,"td[data-mce-selected],th[data-mce-selected]")},Od=function(e,t){var n=Dd(t),r=Bd(e);return 0<n.length?n:r},Pd=Od,Ld=function(e){return Od(Ad(e.selection.getSel()),Vn.fromDom(e.getBody()))},Id=function(e,t){return H.each(t,Kc),e.selection.setCursorLocation(t[0].dom(),0),!0},Md=function(e,t){return vf(e,!1,t),!0},Fd=function(n,e,r,t){return Ud(e,t).fold(function(){return t=n,kd(e,r).map(function(e){return e.fold(V.curry(Md,t),V.curry(Id,t))});var t},function(e){return qd(n,e)}).getOr(!1)},zd=function(e,t){return H.find(jl(t,e),xo)},Ud=function(e,t){return H.find(jl(t,e),function(e){return"caption"===Zn.name(e)})},qd=function(e,t){return Kc(t),e.selection.setCursorLocation(t.dom(),0),A.some(!0)},Vd=function(u,s,c,l,f){return Qa.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,Qa.firstPositionIn(r.dom()).bind(function(t){return Qa.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?qd(u,l):(t=l,n=e,Ud(s,Vn.fromDom(n.getNode())).map(function(e){return!1===Mr.eq(e,t)}));var t,n,r,o,i,a}).or(A.some(!0))},Hd=function(a,u,s,e){var c=La.fromRangeStart(a.selection.getRng());return zd(s,e).bind(function(e){return Ll(e)?qd(a,e):(t=a,n=s,r=u,o=e,i=c,Qa.navigate(r,t.getBody(),i).bind(function(e){return zd(n,Vn.fromDom(e.getNode())).map(function(e){return!1===Mr.eq(e,o)})}));var t,n,r,o,i})},jd=function(a,u,e){var s=Vn.fromDom(a.getBody());return Ud(s,e).fold(function(){return Hd(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=La.fromRangeStart(t.selection.getRng()),Ll(o)?qd(t,o):Vd(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},$d=function(e,t){var n,r,o,i,a,u=Vn.fromDom(e.selection.getStart(!0)),s=Ld(e);return e.selection.isCollapsed()&&0===s.length?jd(e,t,u):(n=e,r=u,o=Vn.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Ld(n)).length?Id(n,a):Fd(n,o,i,r))},Wd=function(e,t){e.getDoc().execCommand(t,!1,null)},Kd=function(e){Cf(e,!1)||dd(e,!1)||Jl(e,!1)||$d(e)||tf(e,!1)||(Wd(e,"Delete"),Nl(e))},Xd=function(e){Cf(e,!0)||dd(e,!0)||Jl(e,!0)||$d(e)||tf(e,!0)||Wd(e,"ForwardDelete")},Yd=function(s){return function(u,e){return A.from(e).map(Vn.fromDom).filter(Zn.isElement).bind(function(e){return(r=s,o=u,i=e.dom(),a=function(e){return Cr(e,r)},ul.closest(Vn.fromDom(i),function(e){return a(e).isSome()},function(e){return Mr.eq(Vn.fromDom(o),e)}).bind(a)).or((t=s,n=e.dom(),A.from(vi.DOM.getStyle(n,t,!0))));var t,n,r,o,i,a}).getOr("")}},Gd={getFontSize:Yd("font-size"),getFontFamily:V.compose(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},Yd("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}},Jd=function(e){return Qa.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return Oo.isText(t)?t.parentNode:t})},Qd=function(o){return A.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?A.none():A.from(o.selection.getStart(!0))})},Zd=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=zu(e),o=Uu(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},em=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},tm=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)},nm=function(e,t,n){return tm(e,t,function(e){return e.nodeName===n})},rm=function(e){return e&&"TABLE"===e.nodeName},om=function(e,t,n){for(var r=new ao(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Oo.isBr(t))return!0},im=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&&Oo.isBr(o)&&t&&e.isEmpty(u))return A.some(Da(o.parentNode,e.nodeIndex(o)));for(i=new ao(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,Li(c=s)&&!1===tm(c,l,kc)))return A.none();if(Oo.isText(s)&&0<s.nodeValue.length)return!1===nm(s,f,"A")?A.some(Da(s,r?s.nodeValue.length:0)):A.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return A.none();a=s}return n&&a?A.some(Da(a,0)):A.none()},am=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,p=e.getRoot(),g=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=Oo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,Li(o))return A.none();if(Oo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),Oo.isDocument(o)&&(o=p,i=0),o===p){if(c&&(u=o.childNodes[0<i?i-1:0])){if(Li(u))return A.none();if(s[u.nodeName]||rm(u))return A.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Oo.isText(o)&&l?o.data.length:0,!t&&o===p.lastChild&&rm(o))return A.none();if(function(e,t){for(;t&&t!==e;){if(Oo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(p,o)||Li(o))return A.none();if(o.hasChildNodes()&&!1===rm(o)){a=new ao(u=o,p);do{if(Oo.isContentEditableFalse(u)||Li(u)){g=!1;break}if(Oo.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,g=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,g=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(Oo.isText(o)&&0===i&&im(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),Oo.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Oo.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||om(e,u,!1)||om(e,u,!0)||im(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),g=!0}))),c&&!t&&Oo.isText(o)&&i===o.nodeValue.length&&im(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),g?A.some(Da(o,i)):A.none()},um=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Da.fromRangeStart(t);return am(e,n,!0,r).each(function(e){n&&Da.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||am(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),em(t,r)?A.none():A.some(r)},sm=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},cm=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)},lm=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();um(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 ao(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"),a.insertNode(n),sm(i,o,n),cm(i,o,n,r),e.undoManager.add()},fm=function(e,t){var n=Vn.fromTag("br");Hu.before(Vn.fromDom(t),n),e.undoManager.add()},dm=function(e,t){mm(e.getBody(),t)||Hu.after(Vn.fromDom(t),Vn.fromTag("br"));var n=Vn.fromTag("br");Hu.after(Vn.fromDom(t),n),sm(e.dom,e.selection,n.dom()),cm(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},mm=function(e,t){return n=La.after(t),!!Oo.isBr(n.getNode())||Qa.nextPosition(e,La.after(t)).map(function(e){return Oo.isBr(e.getNode())}).getOr(!1);var n},pm=function(e){return e&&"A"===e.nodeName&&"href"in e},gm=function(e){return e.fold(V.constant(!1),pm,pm,V.constant(!1))},hm=function(e,t){t.fold(V.noop,V.curry(fm,e),V.curry(dm,e),V.noop)},vm=function(e,t){var n,r,o,i=(n=e,r=V.curry(xl.isInlineTarget,n),o=La.fromRangeStart(n.selection.getRng()),Gf(r,n.getBody(),o).filter(gm));i.isSome()?i.each(V.curry(hm,e)):lm(e,t)},ym=nf([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bm=(ym.before,ym.on,ym.after,function(e){return e.fold(V.identity,V.identity,V.identity)}),Cm=nf([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),xm=kr.immutable("start","soffset","finish","foffset"),wm={domRange:Cm.domRange,relative:Cm.relative,exact:Cm.exact,exactFromRange:function(e){return Cm.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:xm,getWin:function(e){var t=e.match({domRange:function(e){return Vn.fromDom(e.startContainer)},relative:function(e,t){return bm(e)},exact:function(e,t,n,r){return e}});return $r.defaultView(t)}},Nm=Un.detect().browser,Em=function(e,t){var n=Zn.isText(t)?$c(t).length:$r.children(t).length+1;return n<e?n:e<0?0:e},Sm=function(e){return wm.range(e.start(),Em(e.soffset(),e.start()),e.finish(),Em(e.foffset(),e.finish()))},km=function(e,t){return Mr.contains(e,t)||Mr.eq(e,t)},Tm=function(t){return function(e){return km(t,e.start())&&km(t,e.finish())}},Am=function(e){return!0===e.inline||Nm.isIE()},Rm=function(e){return wm.range(Vn.fromDom(e.startContainer),e.startOffset,Vn.fromDom(e.endContainer),e.endOffset)},_m=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?A.from(t.getRangeAt(0)):A.none()).map(Rm)},Bm=function(e){var t=$r.defaultView(e);return _m(t.dom()).filter(Tm(e))},Dm=function(e,t){return A.from(t).filter(Tm(e)).map(Sm)},Om=function(e){var t=document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),A.some(t)}catch(n){return A.none()}},Pm=function(e){return(e.bookmark?e.bookmark:A.none()).bind(V.curry(Dm,Vn.fromDom(e.getBody()))).bind(Om)},Lm=function(e){var t=Am(e)?Bm(Vn.fromDom(e.getBody())):A.none();e.bookmark=t.isSome()?t:e.bookmark},Im=function(t){Pm(t).each(function(e){t.selection.setRng(e)})},Mm=Pm,Fm=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"),H.each(o.getSelectedBlocks(),function(e){return function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)&&"LI"!==i.nodeName){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)}))},zm=It.each,Um=It.extend,qm=It.map,Vm=It.inArray;function Hm(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",zm(e,function(t,e){zm(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)}};Um(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?Im(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(zm(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)},p=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.");ve.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"),zm("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),p()))},"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:Zd(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:Zd(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),p())},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){nl(s,n)},mceInsertRawHTML:function(e,t,n){var r=s.getContent();i.setContent("tiny_mce_marker"),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){Fm(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(),Oo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){Kd(s)},forwardDelete:function(){Xd(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return vm(s,n),!0}});var g=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=qm(e,function(e){return!!a.matchNode(e,n)});return-1!==Vm(t,!0)}};e({JustifyLeft:g("alignleft"),JustifyCenter:g("aligncenter"),JustifyRight:g("alignright"),JustifyFull:g("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 Qd(t=s).fold(function(){return Jd(t).map(function(e){return Gd.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return Gd.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return Qd(t=s).fold(function(){return Jd(t).map(function(e){return Gd.getFontSize(t.getBody(),e)}).getOr("")},function(e){return Gd.getFontSize(t.getBody(),e)});var t},this)}var jm=It.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"," "),$m=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&&It.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)}};$m.isNative=function(e){return!!jm[e.toLowerCase()]};var Wm,Km=function(n){return n._eventDispatcher||(n._eventDispatcher=new $m({scope:n,toggleEvent:function(e,t){$m.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},Xm={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=Km(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 Km(this).on(e,t,n)},off:function(e,t){return Km(this).off(e,t)},once:function(e,t){return Km(this).once(e,t)},hasEventListeners:function(e){return Km(this).has(e)}},Ym=function(e,t){var n=lr.get(e,t);return n===undefined||""===n?[]:n.split(" ")},Gm=Ym,Jm=function(e,t,n){var r=Ym(e,t).concat([n]);lr.set(e,t,r.join(" "))},Qm=function(e,t,n){var r=H.filter(Ym(e,t),function(e){return e!==n});0<r.length?lr.set(e,t,r.join(" ")):lr.remove(e,t)},Zm=function(e){return Gm(e,"class")},ep=function(e,t){return Jm(e,"class",t)},tp=function(e,t){return Qm(e,"class",t)},np=Zm,rp=ep,op=tp,ip=function(e,t){H.contains(Zm(e),t)?tp(e,t):ep(e,t)},ap=function(e){return e.dom().classList!==undefined},up=function(e,t){return ap(e)&&e.dom().classList.contains(t)},sp={add:function(e,t){ap(e)?e.dom().classList.add(t):rp(e,t)},remove:function(e,t){var n;ap(e)?e.dom().classList.remove(t):op(e,t),0===(ap(n=e)?n.dom().classList:np(n)).length&&lr.remove(n,"class")},toggle:function(e,t){return ap(e)?e.dom().classList.toggle(t):ip(e,t)},toggler:function(e,t){var n,r,o,i,a,u,s=ap(e),c=e.dom().classList;return n=function(){s?c.remove(t):op(e,t)},r=function(){s?c.add(t):rp(e,t)},o=up(e,t),i=o||!1,{on:a=function(){r(),i=!0},off:u=function(){n(),i=!1},toggle:function(){(i?u:a)()},isOn:function(){return i}}},has:up},cp=function(e,t){return e.fire("PreProcess",t)},lp=function(e,t){return e.fire("PostProcess",t)},fp=function(e){return e.fire("remove")},dp=function(e,t){return e.fire("SwitchMode",{mode:t})},mp=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},pp=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},gp=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},hp=function(e,t){var n,r,o;n=Vn.fromDom(e.getBody()),r="mce-content-readonly",o=t,sp.has(n,r)&&!1===o?sp.remove(n,r):o&&sp.add(n,r),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",gp(e,"StyleWithCSS",!1),gp(e,"enableInlineTableEditing",!1),gp(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},vp=function(e){return e.readonly?"readonly":"design"},yp=vi.DOM,bp=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=yp.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},Cp=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},xp=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=bp(i,a),i.settings.event_root){if(Wm||(Wm={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&Wm){for(e in Wm)i.dom.unbind(bp(i,e));Wm=null}})),Wm[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||yp.isChildOf(t,o))&&Cp(n[r],a,e)}},Wm[a]=t,yp.bind(e,a,t)}else t=function(e){Cp(i,a,e)},yp.bind(e,a,t),i.delegates[a]=t},wp={bindPendingEventDelegates:function(){var t=this;It.each(t._pendingNativeEvents,function(e){xp(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?xp(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(bp(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(bp(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()))}},Np=wp=It.extend({},Xm,wp),Ep=It.each,Sp=It.explode,kp={f9:120,f10:121,f11:122},Tp=It.makeMap("alt,ctrl,shift,meta,access");function Ap(i){var a={},r=[],u=function(e){var t,n,r={};for(n in Ep(Sp(e,"+"),function(e){e in Tp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=kp[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Tp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,ve.mac?r.ctrl=!0:r.shift=!0),r.meta&&(ve.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=It.map(Sp(e,">"),u))[o.length-1]=It.extend(o[o.length-1],{func:n,scope:r||i}),It.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()&&(Ep(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)}:It.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Ep(Sp(It.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 Rp=function(e){var t=e!==undefined?e.dom():document;return A.from(t.activeElement).map(Vn.fromDom)},_p=function(e){var t=$r.owner(e).dom();return e.dom()===t.activeElement},Bp=function(t){return Rp($r.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},Dp=function(t,e){return(n=e,n.collapsed?A.from(ua(n.startContainer,n.startOffset)).map(Vn.fromDom):A.none()).bind(function(e){return Co(e)?A.some(e):!1===Mr.contains(t,e)?A.some(t):A.none()});var n},Op=function(t,e){Dp(Vn.fromDom(t.getBody()),e).bind(function(e){return Qa.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Pp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Lp=function(e){var t,n=e.getBody();return n&&(t=Vn.fromDom(n),_p(t)||Bp(t).isSome())},Ip=function(e){return e.inline?Lp(e):(t=e).iframeElement&&_p(Vn.fromDom(t.iframeElement));var t},Mp=function(e){return e.editorManager.setActive(e)},Fp=function(e,t){e.removed||(t?Mp(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 Pp(u),Op(t,o),Mp(t);t.bookmark!==undefined&&!1===Ip(t)&&Mm(t).each(function(e){t.selection.setRng(e),o=e}),n||(ve.opera||Pp(r),t.getWin().focus()),(ve.gecko||n)&&(Pp(r),Op(t,o)),Mp(t)}(e))},zp=Ip,Up=function(e,t){return t.dom()[e]},qp=function(e,t){return parseInt(br(t,e),10)},Vp=V.curry(Up,"clientWidth"),Hp=V.curry(Up,"clientHeight"),jp=V.curry(qp,"margin-top"),$p=V.curry(qp,"margin-left"),Wp=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m=Vn.fromDom(e.getBody()),p=e.inline?m:$r.documentElement(m),g=(r=e.inline,i=t,a=n,u=(o=p).dom().getBoundingClientRect(),{x:i-(r?u.left+o.dom().clientLeft+$p(o):0),y:a-(r?u.top+o.dom().clientTop+jp(o):0)});return c=g.x,l=g.y,f=Vp(s=p),d=Hp(s),0<=c&&0<=l&&c<=f&&l<=d},Kp=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(Vn.fromDom)).map(function(e){return Mr.contains($r.owner(e),e)}).getOr(!1)};function Xp(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){H.findIndex(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&Kp(n))return H.find(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(){we.requestAnimationFrame(a)}),t.on("remove",function(){H.each(o,function(e){i().close(e)})}),{open:r,close:function(){A.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function Yp(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){H.findIndex(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 A.from(o[o.length-1])};return r.on("remove",function(){H.each(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),Lm(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 Gp=Si.PluginManager,Jp=function(e,t){var n=function(e,t){for(var n in Gp.urls)if(Gp.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},Qp=function(e,t){e.notificationManager.open({type:"error",text:t})},Zp=function(e,t){e._skinLoaded?Qp(e,t):e.on("SkinLoaded",function(){Qp(e,t)})},eg=function(e,t){Zp(e,Jp(e,t))},tg=function(e,t){Zp(e,"Failed to upload image: "+t)},ng=Zp,rg=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},og=Si.PluginManager,ig=Si.ThemeManager;function ag(){return new(W.getOrDie("XMLHttpRequest"))}function ug(u,s){var r={},n=function(e,r,o,t){var i,n;(i=new ag).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 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){It.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=It.grep(e,function(e){return!u.isUploaded(e.blobUri())}),ye.all(It.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new ye(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new ye(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 s=It.extend({credentials:!1,handler:n},s),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new ye(function(e){e([])})}}}function sg(e,t){return new(W.getOrDie("Blob"))(e,t)}function cg(){return new(W.getOrDie("FileReader"))}function lg(e){return new(W.getOrDie("Uint8Array"))(e)}var fg=function(e){return W.getOrDie("atob")(e)},dg=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},mg=function(e){return 0===e.indexOf("blob:")?(i=e,new ye(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=new ag;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:")?(o=e,new ye(function(e){var t,n,r;o=dg(o);try{t=fg(o.data)}catch(Dw){return void e(new sg([]))}for(n=new lg(t.length),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new sg([n],{type:o.type}))})):null;var i,o},pg=function(n){return new ye(function(e){var t=new cg;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},gg=dg,hg=0,vg=function(e){return(e||"blobid")+hg++},yg=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=gg(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):mg(r.src).then(function(e){a=n.create(vg(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):mg(r.src).then(function(t){pg(t).then(function(e){i=gg(e).data,a=n.create(vg(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},bg=function(e){return e?e.getElementsByTagName("img"):[]},Cg=0,xg={uuid:function(e){return e+Cg+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function wg(u){var n,o,i,t,e,a,r,s,c,l,f=(n=[],o=da.constant,i=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||xg.uuid("blobid"),n=e.name||t,{id:o(t),name:o(n),filename:o(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:o(e.blob),base64:o(e.base64),blobUri:o(e.blobUri||X.createObjectURL(e.blob)),uri:o(e.uri)}},{create:function(e,t,n,r){return i("object"==typeof e?e:{id:e,name:r,blob:t,base64:n})},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 Bt.filter(n,e)[0]},removeByUri:function(t){n=Bt.filter(n,function(e){return e.blobUri()!==t||(X.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){Bt.each(n,function(e){X.revokeObjectURL(e.blobUri())}),n=[]}}),d=u.settings,m=(s={},c=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:l=function(e){return e in s},getResultUri:function(e){var t=s[e];return t?t.resultUri:null},isPending:function(e){return!!l(e)&&1===s[e].status},isUploaded:function(e){return!!l(e)&&2===s[e].status},markPending:function(e){s[e]=c(1,null)},markUploaded:function(e,t){s[e]=c(2,t)},removeFailed:function(e){delete s[e]},destroy:function(){s={}}}),p=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},h=function(e,t,n){return e=g(e,'src="'+t+'"','src="'+n+'"'),e=g(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},v=function(t,n){Bt.each(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=Bt.map(e.fragments,function(e){return h(e,t,n)}):e.content=h(e.content,t,n)})},y=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},b=function(e,t){f.removeByUri(e.src),v(e.src,t),u.$(e).attr({src:d.images_reuse_filename?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},C=function(n){return a||(a=ug(m,{url:d.images_upload_url,basePath:d.images_upload_base_path,credentials:d.images_upload_credentials,handler:d.images_upload_handler})),N().then(p(function(r){var e;return e=Bt.map(r,function(e){return e.blobInfo}),a.upload(e,y).then(p(function(e){var t=Bt.map(e,function(e,t){var n=r[t].image;return e.status&&!1!==u.settings.images_replace_blob_uris?b(n,e.url):e.error&&tg(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},x=function(e){if(!1!==d.automatic_uploads)return C(e)},w=function(e){return!d.images_dataimg_filter||d.images_dataimg_filter(e)},N=function(){var o,i,a;return r||(o=m,i=f,a={},r={findAll:function(e,n){var t;n||(n=da.constant(!0)),t=Bt.filter(bg(e),function(e){var t=e.src;return!!ve.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===ve.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t):0===t.indexOf("data:")&&n(e))});var r=Bt.map(t,function(n){if(a[n.src])return new ye(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new ye(function(e,t){yg(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 ye.all(r)}}),r.findAll(u.getBody(),w).then(p(function(e){return e=Bt.filter(e,function(e){return"string"!=typeof e||(ng(u,e),!1)}),Bt.each(e,function(e){v(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},E=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=m.getResultUri(n);if(t)return'src="'+t+'"';var r=f.getByUri(n);return r||(r=Bt.reduce(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(){!1!==u.settings.automatic_uploads?x():N()}),u.on("RawSaveContent",function(e){e.content=E(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=E(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){Bt.each(e,function(e){var t=e.attr("src");if(!f.getByUri(t)){var n=m.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:f,uploadImages:C,uploadImagesAuto:x,scanForImages:N,destroy:function(){f.destroy(),m.destroy(),r=a=null}}}var Ng=function(e,t){return e.hasOwnProperty(t.nodeName)},Eg=function(e,t){if(Oo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Ng(e,t.nextSibling)))return!0}return!1},Sg=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,p=e.selection,g=e.schema,h=g.getBlockElements(),v=p.getStart(),y=e.getBody();if(f=d.forced_root_block,v&&Oo.isElement(v)&&f&&(l=y.nodeName.toLowerCase(),g.isValidChild(l,f.toLowerCase())&&(b=h,C=y,x=v,!H.exists(Hl(Vn.fromDom(x),Vn.fromDom(C)),function(e){return Ng(b,e.dom())})))){var b,C,x,w,N;for(n=(t=p.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=zp(e),v=y.firstChild;v;)if(w=h,N=v,Oo.isText(N)||Oo.isElement(N)&&!Ng(w,N)&&!Mc(N)){if(Eg(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),p.setRng(t),e.nodeChanged())}},kg=function(e){e.settings.forced_root_block&&e.on("NodeChange",V.curry(Sg,e))},Tg=function(t){return $r.firstChild(t).fold(V.constant([t]),function(e){return[t].concat(Tg(e))})},Ag=function(t){return $r.lastChild(t).fold(V.constant([t]),function(e){return"br"===Zn.name(e)?$r.prevSibling(e).map(function(e){return[t].concat(Ag(e))}).getOr([]):[t].concat(Ag(e))})},Rg=function(o,e){return ma([(i=e,a=i.startContainer,u=i.startOffset,Oo.isText(a)?0===u?A.some(Vn.fromDom(a)):A.none():A.from(a.childNodes[u]).map(Vn.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,Oo.isText(n)?r===n.data.length?A.some(Vn.fromDom(n)):A.none():A.from(n.childNodes[r-1]).map(Vn.fromDom))],function(e,t){var n=H.find(Tg(o),V.curry(Mr.eq,e)),r=H.find(Ag(o),V.curry(Mr.eq,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},_g=function(e,t,n,r){var o=n,i=new ao(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==It.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(ve.ie&&ve.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))},Bg=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Dg(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&&em(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||!ve.range&&i.selection.isCollapsed()||Bg(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()&&Bg(i)&&("IMG"===i.selection.getNode().nodeName?we.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 Og,Pg,Lg=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}},Ig=function(e,t){return n=(u=e).inline?Lg(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=Lg(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},Mg=Oo.isContentEditableFalse,Fg=Oo.isContentEditableTrue,zg=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Ug=function(u,s){return function(e){if(0===e.button){var t=Bt.find(s.dom.getParents(e.target),da.or(Mg,Fg));if(i=s.getBody(),Mg(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}},qg=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)&&!Mg(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(){zg(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;Vg(l)}},Vg=function(e){e.dragging=!1,e.element=null,zg(e.ghost)},Hg=function(e){var t,n,r,o,i,a,g,h,v,u,s,c={};t=vi.DOM,a=document,n=Ug(c,e),g=c,h=e,v=we.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-g.screenX),Math.abs(e.screenY-g.screenY));if(g.element&&!g.dragging&&10<m){if(h.fire("dragstart",{target:g.element}).isDefaultPrevented())return;g.dragging=!0,h.focus()}if(g.dragging){var p=(f=g,{pageX:(d=Ig(h,e)).pageX-f.relX,pageY:d.pageY+5});c=g.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=g.ghost,n=p,r=g.width,o=g.height,i=g.maxX,a=g.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=qg(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Vg(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)})},jg=function(e){var n;Hg(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Mg(t)||Mg(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},$g=function(e){return Bt.reduce(e,function(e,t){return e.concat(function(t){var e=function(e){return Bt.map(e,function(e){return(e=ta(e)).node=t,e})};if(Oo.isElement(t))return e(t.getClientRects());if(Oo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Pg=Og||(Og={}))[Pg.Up=-1]="Up",Pg[Pg.Down=1]="Down";var Wg=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=$g([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,Bt.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=Bt.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=vs(r,e,Zi,t);)if(n(r))return}(o,e,r,n)),l},Kg=V.curry(Wg,Og.Up,oa,ia),Xg=V.curry(Wg,Og.Down,ia,oa),Yg=function(n){return function(e){return t=n,e.line>t;var t}},Gg=function(n){return function(e){return t=n,e.line===t;var t}},Jg=Oo.isContentEditableFalse,Qg=vs,Zg=function(e,t){return Math.abs(e.left-t)},eh=function(e,t){return Math.abs(e.right-t)},th=function(e,t){return e>=t.left&&e<=t.right},nh=function(e,o){return Bt.reduce(e,function(e,t){var n,r;return n=Math.min(Zg(e,o),eh(e,o)),r=Math.min(Zg(t,o),eh(t,o)),th(o,t)?t:th(o,e)?e:r===n&&Jg(t.node)?t:r<n?t:e})},rh=function(e,t,n,r){for(;r=Qg(r,e,Zi,t);)if(n(r))return},oh=function(e,t,n){var r,o,i,a,u,s,c,l,f=$g((o=e,Bt.filter(Bt.toArray(o.getElementsByTagName("*")),as))),d=Bt.filter(f,function(e){return n>=e.top&&n<=e.bottom});return(r=nh(d,t))&&(r=nh((u=e,l=function(t,e){var n;return n=Bt.filter($g([e]),function(e){return!t(e,s)}),c=c.concat(n),0===n.length},(c=[]).push(s=r),rh(Og.Up,u,V.curry(l,oa),s.node),rh(Og.Down,u,V.curry(l,ia),s.node),c),t))&&as(r.node)?(a=t,{node:(i=r).node,before:Zg(i,a)<eh(i,a)}):null},ih=function(i,a,e){return!e.collapsed&&H.foldl(e.getClientRects(),function(e,t){return e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},ah=function(t,n){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){var e=arguments;null===r&&(r=setTimeout(function(){t.apply(null,e),e=r=null},n))}}},uh=function(t){var e=ah(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ou(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},sh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return ve.mac?e.metaKey:e.ctrlKey&&!e.altKey}},ch=Oo.isContentEditableTrue,lh=Oo.isContentEditableFalse,fh=Bs,dh=_s,mh=function(e,t){for(var n=e.getBody();t&&t!==n;){if(ch(t)||lh(t))return t;t=t.parentNode}return null},ph=function(p){var g,e,t,a=p.getBody(),o=is(p.getBody(),function(e){return p.dom.isBlock(e)},function(){return zp(p)}),h="sel-"+p.dom.uniqueId(),u=function(e){e&&p.selection.setRng(e)},s=function(){return p.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),p.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&p.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=Ss(e,a,t),-1===e?La.fromRangeStart(t):La.fromRangeEnd(t)},n=function(e){return Li(e)||Ui(e)||qi(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=p.$,m=p.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),as(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(as(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),as(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(as(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&&lh(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),lh(n)?(l=f=n.cloneNode(!0),(s=p.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=Tl(Vn.fromDom(p.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(p.getBody()),e=p.dom.createRng(),l===f&&ve.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,p.getBody()).y}),r[0].focus(),(o=p.selection.getSel()).removeAllRanges(),o.addRange(e),H.each(hu(Vn.fromDom(p.getBody()),"*[data-mce-selected]"),function(e){lr.remove(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),g=n,C(),e)):null)},l=function(){g&&g.removeAttribute("data-mce-selected"),Tl(Vn.fromDom(p.getBody()),"#"+h).each(Hc.remove),g=null},C=function(){o.hide()};return ve.ceFalse&&(function(){p.on("mouseup",function(e){var t=s();t.collapsed&&Wp(p,e.clientX,e.clientY)&&u(ru(p,t,!1))}),p.on("click",function(e){var t;(t=mh(p,e.target))&&(lh(t)&&(e.preventDefault(),p.focus()),ch(t)&&p.dom.isChildOf(t,p.selection.getNode())&&l())}),p.on("blur NewBlock",function(){l()}),p.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=p.dom.getParent(e,p.dom.isBlock),i=p.dom.getParent(t,p.dom.isBlock);return!(!o||!p.dom.isChildOf(o,i)||!1!==lh(mh(p,o)))||o&&(n=o,r=i,!(p.dom.getParent(n,p.dom.isBlock)===p.dom.getParent(r,p.dom.isBlock)))&&function(e){var t=Ys(e);if(!e.firstChild)return!1;var n=La.before(e.firstChild),r=t.next(n);return r&&!dh(r)&&!fh(r)}(o)};r=!1,(n=p).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=mh(n,e.target);lh(t)&&(r||(e.preventDefault(),c(nu(n,t))))}),p.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||p.dom.isChildOf(n,a))&&!1!==Wp(p,e.clientX,e.clientY))if(t=mh(p,n))lh(t)?(e.preventDefault(),c(nu(p,t))):(l(),ch(t)&&e.shiftKey||ih(e.clientX,e.clientY,p.selection.getRng())||(C(),p.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===as(n)){l(),C();var r=oh(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);p.getBody().focus(),u(o)}}}),p.on("keypress",function(e){sh.modifierPressed(e)||(e.keyCode,lh(p.selection.getNode())&&e.preventDefault())}),p.on("getSelectionRange",function(e){var t=e.range;if(g){if(!g.parentNode)return void(g=null);(t=t.cloneRange()).selectNode(g),e.range=t}}),p.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),p.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||C(),t=n.startContainer.parentNode,p.dom.hasClass(t,"mce-offscreen-selection")||l()}),p.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!ve.ie){var r=(t=p.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),jg(p),uh(p)}(),e=p.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")&&(Vi(e),u(s()),p.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),g=null}}},gh=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};function hh(F,z){void 0===z&&(z=oi());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var U=F.comment?F.comment:e,q=F.cdata?F.cdata:e,V=F.text?F.text:e,H=F.start?F.start:e,j=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,p,c,g,l,f,h,v,y,b,C,x,w,N,E,S,k,T,A,R,_=0,B=[],D=0,O=Ko.decode,P=It.makeMap("src,href,data,background,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,I=function(e){var t,n;for(t=B.length;t--&&B[t].name!==e;);if(0<=t){for(n=B.length-1;t<=n;n--)(e=B[n]).valid&&j(e.name);B.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in p?t:O(n||r||o||""),g&&!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]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(L.test(l))return;if(c=l,!(s=F).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]*?)--\x3e)|(?:!\\[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"),k=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=z.getShortEndedElements(),E=F.self_closing_elements||z.getSelfClosingElements(),p=z.getBoolAttrs(),g=F.validate,u=F.remove_internals,R=F.fix_self_closing,T=z.getSpecialElements(),N=e+">";t=S.exec(N);){if(_<t.index&&V(O(e.substr(_,t.index-_))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),I(n);else if(n=t[7]){if(t.index+t[0].length>e.length){V(O(e.substr(t.index))),_=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,R&&E[n]&&0<B.length&&B[B.length-1].name===n&&I(n),!g||(l=z.getElementRule(n))){if(f=!0,g&&(y=l.attributes,b=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(k,M)):(d=[]).map={},g&&!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}"===(A=h.value)&&(A="mce_"+D++),d.map[a]=A,d.push({name:a,value:A});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(A=h.value)&&(A="mce_"+D++),d.map[a]=A,d.push({name:a,value:A}));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){_=gh(z,e,S.lastIndex),S.lastIndex=_;continue}f=!1}}f&&H(n,d,c)}else f=!1;if(r=T[n]){r.lastIndex=_=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(_,t.index-_)),_=t.index+t[0].length):(i=e.substr(_),_=e.length),f&&(0<i.length&&V(i,!0),j(n)),S.lastIndex=_;continue}c||(v&&v.indexOf("/")===v.length-1?f&&j(n):B.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),U(n)):(n=t[2])?q(n.replace(/<!--|-->/g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);_=t.index+t[0].length}for(_<e.length&&V(O(e.substr(_))),o=B.length-1;0<=o;o--)(n=B[o]).valid&&j(n.name)}}}(hh||(hh={})).findEndTag=gh;var vh=hh,yh=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:vh.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return _i(l)},bh={trimExternal:yh,trimInternal:yh},Ch=0,xh=2,wh=1,Nh=function(p,g){var e=p.length+g.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&&p[a]===g[u]?(o.push([0,p[a]]),++a,++u):r-n<t-e?(o.push([2,p[a]]),++a):(o.push([1,g[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,p[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&&p[o]===g[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&&p[c]===g[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&&p[c]===g[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,p.length,0,g.length,t),t},Eh=function(e){return Oo.isElement(e)?e.outerHTML:Oo.isText(e)?Ko.encodeRaw(e.data,!1):Oo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Sh=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=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)},kh=function(e){return Bt.filter(Bt.map(e.childNodes,Eh),function(e){return 0<e.length})},Th=function(e,t){var n,r,o,i=Bt.map(t.childNodes,Eh);return n=Nh(i,e),r=t,o=0,Bt.each(n,function(e){e[0]===Ch?o++:e[0]===wh?(Sh(r,e[1],o),o++):e[0]===xh&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Ah=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,$r.children(Vn.fromDom(n))},Rh=function(e){return e.dom().innerHTML},_h=Rh,Bh=function(e,t){var n=$r.owner(e).dom(),r=Vn.fromDom(n.createDocumentFragment()),o=Ah(t,n);qc(r,o),Hc.empty(e),Hu.append(e,r)},Dh=ns(A.none()),Oh=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Ph=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Lh=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Ih=function(e){var t=Vn.fromTag("body",Dh.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return Dh.set(A.some(e)),e}));return Bh(t,Lh(e)),H.each(hu(t,"*[data-mce-bogus]"),Hc.unwrap),_h(t)},Mh=function(n){var e,t,r;return e=kh(n.getBody()),-1!==(t=(r=H.bind(e,function(e){var t=bh.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?Oh(r):Ph(t)},Fh=function(e,t,n){"fragmented"===t.type?Th(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},zh=function(e,t){return!(!e||!t)&&(r=t,Lh(e)===Lh(r)||(n=t,Ih(e)===Ih(n)));var n,r};function Uh(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===zh(Mh(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=Ec.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=Mh(u),e=e||{},e=It.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&&zh(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=Ec.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],Fh(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],Fh(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]&&!zh(Mh(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],Fh(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var qh,Vh,Hh=function(e){return e&&/^(IMG)$/.test(e.nodeName)},jh=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},$h=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},Wh={isInlineBlock:Hh,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!Hh(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new ao(u=i[a],e.getParent(u,e.isBlock)):(r=new ao(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!jh(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||!jh(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:jh,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:$h,getStyle:function(e,t,n){return $h(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())}},Kh=Mc,Xh=Wh.getParents,Yh=Wh.isWhiteSpaceNode,Gh=Wh.isTextBlock,Jh=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}},Qh=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},Zh=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++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},ev=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Zh(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new ao(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3===u.nodeType){if(-1!==(s=Zh(o,i,c=u)))return{container:u,offset:s}}else if(e.isBlock(u))break;if(c)return{container:c,offset:r=o?0:c.length}},tv=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=Xh(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},nv=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&&Gh(t,e)},u)}if(o&&e[0].wrapper&&(o=Xh(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Wh.isEq(o,"br")););return o||n},rv=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&&!Yh(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(!Kh(c)&&!Yh(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},ov=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=ua(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=ua(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Qh(c,i),u=Qh(c,u),(Kh(i.parentNode)||Kh(i))&&3===(i=(i=Kh(i)?i:i.parentNode).nextSibling||i).nodeType&&(a=0),(Kh(u.parentNode)||Kh(u))&&3===(u=(u=Kh(u)?u:u.parentNode).previousSibling||u).nodeType&&(s=u.length),n[0].inline&&(t.collapsed&&((o=ev(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=ev(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),u=r?u:function(e,t){var n=Jh(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Jh(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=rv(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=rv(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=tv(c,n,t,i,"previousSibling"),u=tv(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=nv(e,n,i,"previousSibling"),u=nv(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=rv(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=rv(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}},iv=Wh.isEq,av=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},uv=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!av(t,e,n)||e.parentNode===o||!!lv(t,e,n,r,!0)}),lv(t,e,n,r))},sv=function(e,t,n){return!!iv(t,n.inline)||!!iv(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},cv=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):Wh.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!iv(u,Wh.normalizeStyleValue(e,Wh.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):Wh.getStyle(e,t,c[s]))return n;return n},lv=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],sv(e.dom,t,i)&&cv(l,t,i,"attributes",o,r)&&cv(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}},fv={matchNode:lv,matchName:sv,match:function(e,t,n,r){var o;return r?uv(e,r,t,n):(r=e.selection.getNode(),!!uv(e,r,t,n)||!((o=e.selection.getStart())===r||!uv(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]&&lv(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=Wh.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:av},dv=function(e,t){return e.splitText(t)},mv=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Oo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=dv(t,n)).previousSibling,n<o?(t=r=dv(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Oo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=dv(t,n),n=0),Oo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=dv(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},pv=Ri,gv="_mce_caret",hv=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==pv||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},vv=function(e){var t;if(e)for(e=(t=new ao(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},yv=function(e){var t=Vn.fromTag("span");return lr.setAll(t,{id:gv,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Hu.append(t,Vn.fromText(pv)),t},bv=function(e,t,n,r){var o,i,a,u;o=t.getRng(!0),i=e.getParent(n,e.isBlock),hv(n)?(!1!==r&&(o.setStartBefore(n),o.setEndBefore(n)),e.remove(n)):((u=vv(n))&&u.nodeValue.charAt(0)===pv&&u.deleteData(0,1),a=u,o.startContainer===a&&0<o.startOffset&&o.setStart(a,o.startOffset-1),o.endContainer===a&&0<o.endOffset&&o.setEnd(a,o.endOffset-1),e.remove(n,!0)),i&&e.isEmpty(i)&&Kc(Vn.fromDom(i)),t.setRng(o)},Cv=function(e,t,n,r,o){if(r)bv(t,n,r,o);else if(!(r=Tc(e,n.getStart())))for(;r=t.get(gv);)bv(t,n,r,!1)},xv=function(e,t,n){var r=e.dom,o=r.getParent(n,da.curry(Wh.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Wc(Vn.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},wv=function(e,t){return e.appendChild(t),t},Nv=function(e,t){var n=H.foldr(e,function(e,t){return wv(e,t.cloneNode(!1))},t);return wv(n,n.ownerDocument.createTextNode(pv))},Ev=function(e){var i=e.dom,a=e.selection,u=e.getBody();e.on("mouseup keydown",function(e){var t,n,r,o;t=u,n=i,r=a,o=e.keyCode,Cv(t,n,r,null,!1),8===o&&r.isCollapsed()&&r.getStart().innerHTML===pv&&Cv(t,n,r,Tc(t,r.getStart())),37!==o&&39!==o||Cv(t,n,r,Tc(t,r.getStart()))})},Sv=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(Zn.name(t))&&!kc(t.dom())&&!Oo.isBogus(t.dom())},kv={},Tv=Bt.filter,Av=Bt.each;Vh=function(e){var t,n,r=e.selection.getRng();t=Oo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),Av(Tv(Tv(n,t),function(e){return t(e.previousSibling)&&-1!==Bt.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,tn(n=e).remove(),tn(t).append("<br><br>").append(n.childNodes)}))},kv[qh="pre"]||(kv[qh]=[]),kv[qh].push(Vh);var Rv=function(e,t){Av(kv[e],function(e){e(t)})},_v=It.each,Bv=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)_v(c,function(e){o([e])});else{var p,g,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()&&(g=m,h=(p=d).childNodes,--g>h.length-1?g=h.length-1:g<0&&(g=0),d=h[g]||p),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)}},Dv=/^(src|href|style)$/,Ov=It.each,Pv=Wh.isEq,Lv=function(e){return/^(TH|TD)$/.test(e.nodeName)},Iv=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Oo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),Oo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new ao(r,e.getBody()).next()||r),Oo.isText(r)&&!n&&0===o&&(r=new ao(r,e.getBody()).prev()||r),r},Mv=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Fv=function(e,t,n,r){return!(t=Wh.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},zv=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,p,g,h,v,y,b=e.dom;if(c=b,!(Pv(l=o,(f=n).inline)||Pv(l,f.block)||(f.selector?Oo.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(Ov(n.styles,function(e,t){e=Wh.normalizeStyleValue(b,Wh.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||Pv(Wh.getStyle(b,i,t),e))&&b.setStyle(o,t,""),u=1}),u&&""===b.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),Ov(n.attributes,function(e,t){var n;if(e=Wh.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||Pv(b.getAttrib(i,t),e)){if("class"===t&&(e=b.getAttrib(o,t))&&(n="",Ov(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"),Dv.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),Ov(n.classes,function(e){e=Wh.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,p=n,h=(m=o).parentNode,v=d.dom,y=d.settings.forced_root_block,p.block&&(y?h===v.getRoot()&&(p.list_block&&Pv(m,p.list_block)||Ov(It.grep(m.childNodes),function(e){Wh.isValid(d,y,e.nodeName.toLowerCase())?g?g.appendChild(e):(g=Mv(v,e,y),v.setAttribs(g,d.settings.forced_root_block_attrs)):g=0})):v.isBlock(m)&&!v.isBlock(h)&&(Fv(v,m,!1)||Fv(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),Fv(v,m,!0)||Fv(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),p.selector&&p.inline&&!Pv(p.inline,m)||v.remove(m,1),!0):void 0},Uv=zv,qv=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,o=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,Ov(Wh.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=fv.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,p=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=p.clone(s,!1),d=0;d<t.length;d++)if(zv(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&p.isBlock(n)||(r=p.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},p=function(e){var t,n,r,o,i;if(Oo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=It.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!zv(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)p(t[n]);i&&(a=o)}},i=function(e){var t=u.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return Mc(n)&&(n=n[e?"firstChild":"lastChild"]),Oo.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),u.remove(t,!0),n},g=function(e){var t,n,r=e.commonAncestorContainer;if(e=ov(s,e,d,!0),m.split){if((t=Iv(s,e,!0))!==(n=Iv(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)&&Lv(n)&&n.firstChild&&(n=n.firstChild||n),u.isChildOf(t,n)&&t!==n&&!u.isBlock(n)&&!Lv(t)&&!Lv(n))return t=Mv(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),o(t),void(t=i(!0));t=Mv(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=Mv(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),o(t),o(n),t=i(!0),n=i()}else t=n=o(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}Bv(u,e,function(e){Ov(e,function(e){p(e),Oo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===Wh.getTextDecoration(u,e.parentNode)&&zv(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),g(n)):g(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=[],p=d.getRng();for(o=p.startContainer,i=p.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(fv.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(),p.collapse(!0);var g=ov(e,p,e.formatter.get(t),!0);g=mv(g),e.formatter.remove(t,n,g),d.moveToBookmark(a)}else{l=Tc(e.getBody(),c);var h=yv(!1).dom(),v=Nv(m,h);xv(e,h,l||c),bv(f,d,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=Ec.getPersistentBookmark(s.selection,!0),g(r.getRng()),r.moveToBookmark(t),m.inline&&fv.match(s,c,l,r.getStart())&&Wh.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!zv(s,d[h],l,e,e));h++);}},Vv=It.each,Hv=function(e){return e&&1===e.nodeType&&!Mc(e)&&!kc(e)&&!Oo.isBogus(e)},jv=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&&!Mc(n))return n}return e},$v=function(e,t,n){var r,o,i=new zc(e);if(t&&n&&(t=jv(t,"previousSibling"),n=jv(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),It.each(It.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Wv=function(e,t,n){Vv(e.childNodes,function(e){Hv(e)&&(t(e)&&n(e),e.hasChildNodes()&&Wv(e,t,n))})},Kv=function(n,e){return V.curry(function(e,t){return!(!t||!Wh.getStyle(n,t,e))},e)},Xv=function(r,e,t){return V.curry(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),Yv(r,n)},e,t)},Yv=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},Gv=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=Wh.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))},Jv=function(n,e,r,o){Vv(e,function(t){Vv(n.dom.select(t.inline,o),function(e){Hv(e)&&Uv(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";Vv(r.select(n,t),function(n){Hv(n)&&Vv(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},Qv=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(It.walk(r,V.curry(Gv,e),"childNodes"),Gv(e,r))},Zv=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Wv(r,Kv(e,"fontSize"),Xv(e,"backgroundColor",Wh.replaceVars(t.styles.backgroundColor,n)))},ey=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(Wv(r,Kv(e,"fontSize"),Xv(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},ty=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=$v(e,Wh.getNonWhiteSpaceSibling(r),r),r=$v(e,r,Wh.getNonWhiteSpaceSibling(r,!0)))},ny=function(t,n,r,o,i){fv.matchNode(t,i.parentNode,r,o)&&Uv(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(fv.matchNode(t,e,r,o))return Uv(t,n,o,i),!0})},ry=It.each,oy=function(p,g,h,r){var e,t,v=p.formatter.get(g),y=v[0],o=!r&&p.selection.isCollapsed(),i=p.dom,n=p.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,Wh.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,Wh.replaceVars(e,h))}),ry(e.classes,function(e){e=Wh.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)&&!kc(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),Bv(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),Wh.isEq(t,"br"))return a=0,void(y.block&&s.remove(e));if(y.wrapper&&fv.matchNode(p,e,g,h))a=0;else{if(m&&!r&&y.block&&!y.wrapper&&Wh.isTextBlock(p,t)&&Wh.isValid(p,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||!Wh.isValid(p,l,t)||!Wh.isValid(p,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||kc(e)||y.inline&&s.isBlock(e)?(a=0,ry(It.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(It.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&&!Mc(t)&&!kc(t)&&!Oo.isBogus(t))return n=e,!1;var t}),n};n=0,ry(e.childNodes,function(e){Wh.isWhiteSpaceNode(e)||Mc(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(y.inline||y.wrapper)&&(y.exact||1!==t||((o=a(r=e))&&!Mc(o)&&fv.matchName(s,o,y)&&(i=s.clone(o,!1),b(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),Jv(p,v,h,e),ny(p,y,g,h,e),Zv(s,y,h,e),ey(s,y,h,e),ty(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,ov(p,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=Tc(e.getBody(),c.getStart()))&&(i=vv(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=ov(e,r,e.formatter.get(t)),r=mv(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===pv||(l=e.getDoc(),f=yv(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(p,g,h);else{var u=p.selection.getNode();p.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||oy(p,v[0].defaultBlock),p.selection.setRng(Zc(p.selection.getRng())),e=Ec.getPersistentBookmark(p.selection,!0),a(i,ov(p,n.getRng(),v)),y.styles&&Qv(i,y,h,u),n.moveToBookmark(e),Wh.moveStart(i,n,n.getRng()),p.nodeChanged()}Rv(g,p)}}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])}},iy={applyFormat:oy},ay=It.each,uy=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=Wh.getParents(a.dom,n.element),o={};r=It.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),ay(i.get(),function(e,n){ay(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(ay(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!fv.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),ay(u,function(e,t){o[t]||(delete u[t],ay(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),ay(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},sy={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){It.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 It.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}},cy=It.each,ly=vi.DOM,fy=function(e,t){var n,o,r,m=t&&t.schema||oi({}),p=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=ly.create(o.name),n=t,(r=o).classes.length&&ly.addClass(n,r.classes.join(" ")),ly.setAttribs(n,r.attrs),t},g=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!==It.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=p(o)).appendChild(n),t&&(r||(r=ly.create("div")).appendChild(n),It.each(t,function(e){var t=p(e);r.insertBefore(t,n)})),g(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=p(o),(r=ly.create("div")).appendChild(g(n,e.slice(1),o.siblings)),r):""},dy=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=It.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!==It.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},my=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),It.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=It.map(e.split(/(?:~\+|~|\+)/),dy),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},py=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=my(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=fy(i,n)):r=fy([t],n),o=ly.select(t,r)[0]||r.firstChild,cy(e.styles,function(e,t){(e=c(e))&&ly.setStyle(o,t,e)}),cy(e.attributes,function(e,t){(e=c(e))&&ly.setAttrib(o,t,e)}),cy(e.classes,function(e){e=c(e),ly.hasClass(o,e)||ly.addClass(o,e)}),n.fire("PreviewFormats"),ly.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=ly.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,cy(u.split(" "),function(e){var t=ly.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=ly.getStyle(n.getBody(),e,!0),"#ffffff"===ly.toHex(t).toLowerCase())||"color"===e&&"#000000"===ly.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"),ly.remove(r),s)},gy=function(e,t,n,r,o){var i=t.get(n);!fv.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?iy.applyFormat(e,n,r,o):qv(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 vy(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?It.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],It.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))})(sy.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=ns(null);return hy(e),Ev(e),{get:o.get,register:o.register,unregister:o.unregister,apply:V.curry(iy.applyFormat,e),remove:V.curry(qv,e),toggle:V.curry(gy,e,o),match:V.curry(fv.match,e),matchAll:V.curry(fv.matchAll,e),matchNode:V.curry(fv.matchNode,e),canApply:V.curry(fv.canApply,e),formatChanged:V.curry(uy,e,i),getCssText:V.curry(py,e)}}var yy=function(a){return 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)o.hasOwnProperty(i)&&(n[i]=a(n[i],o[i]))}return n}},by=yy(function(e,t){return k.isObject(e)&&k.isObject(t)?by(e,t):t}),Cy=yy(function(e,t){return t}),xy={deepMerge:by,merge:Cy},wy={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||r.remove()}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Ko.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){H.each(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())}},Ny={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=document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),It.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),cp(r,xy.merge(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Ey=function(e,u,s){e.addNodeFilter("font",function(e){H.each(e,function(e){var t,n,r=u.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=s[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",u.serialize(r)),t=e,n=["color","face","size"],H.each(n,function(e){t.attr(e,null)})})})},Sy=function(e,t){var n,r=ai();t.convert_fonts_to_spans&&Ey(e,r,It.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){H.each(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},ky={register:function(e,t){t.inline_styles&&Sy(e,t)}},Ty=/^[ \t\r\n]*$/,Ay={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Ry=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}},_y=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,Ay[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=Ry(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=Ry(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&&!Ty.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Ty.test(i.value))return!1;if(n&&n(i))return!1}while(i=Ry(i,this));return!0},a.prototype.walk=function(e){return Ry(this,null,e)},a}(),By=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new _y("br",1)).shortEnded=!0:r.empty().append(new _y("#text",3)).value="\xa0"},Dy=function(e){return Oy(e,"#text")&&"\xa0"===e.firstChild.value},Oy=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Py=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})},Ly=function(e,t){return e&&(t[e.name]||"br"===e.name)},Iy=function(e,g){var h=e.schema;g.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=It.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),p=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(),Py(h,m,p,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&By(g,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==g.padd_empty_with_br&&((l=new _y("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!g.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?It.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),g.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;);}),g.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 _y("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),g.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)}})},My=It.makeMap,Fy=It.each,zy=It.explode,Uy=It.extend;function qy(k,T){void 0===T&&(T=oi());var A={},R=[],_={},B={};(k=k||{}).validate=!("validate"in k)||k.validate,k.root_name=k.root_name||"body";var D=function(e){var t,n,r;n in A&&((r=_[n])?r.push(e):_[n]=[e]),t=R.length;for(;t--;)(n=R[t].name)in e.attributes.map&&((r=B[n])?r.push(e):B[n]=[e]);return e},e={schema:T,addAttributeFilter:function(e,n){Fy(zy(e),function(e){var t;for(t=0;t<R.length;t++)if(R[t].name===e)return void R[t].callbacks.push(n);R.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(R)},addNodeFilter:function(e,n){Fy(zy(e),function(e){var t=A[e];t||(A[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in A)A.hasOwnProperty(t)&&e.push({name:t,callbacks:A[t]});return e},filterNode:D,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},_={},B={},l=Uy(My("script,style,head,html,body,title,meta,param"),T.getBlockElements());var p=T.getNonEmptyElements(),g=T.children,h=k.validate,v="forced_root_block"in a?a.forced_root_block:k.forced_root_block,y=T.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(k.root_name);var N=function(e,t){var n,r=new _y(e,t);return e in A&&((n=_[e])?n.push(r):_[e]=[r]),r},E=function(e){var t,n,r,o,i=T.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=vh({validate:h,allow_script_urls:k.allow_script_urls,allow_conditional_comments:k.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}(T.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),Ly(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?T.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=g[d.name])&&g[r.name]&&!u[r.name]&&m.push(r),o=R.length;o--;)(a=R[o].name)in t.map&&((s=B[a])?s.push(r):B[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?T.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&&Py(T,p,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&&(Dy(d)||Py(T,p,y,d))&&By(k,a,l,d),d=d.parent}}},T);var S=d=new _y(a.context||k.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,p,g,h;for(d=My("tr,td,th,tbody,thead,tfoot,table"),l=T.getNonEmptyElements(),f=T.getWhiteSpaceElements(),m=T.getTextBlockElements(),p=T.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(g=n.next;g&&m[g.name];)g.name="li",g.fixed=!0,n.parent.insert(g,n.parent),g=g.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!T.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=D(o[0].clone()),c=0;c<o.length-1;c++){for(T.isValidChild(a.name,o[c].name)?(u=D(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}Py(T,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(Py(T,l,f,r)||Oy(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((g=n.prev)&&("ul"===g.name||"ul"===g.name)){g.append(n);continue}if((g=n.next)&&("ul"===g.name||"ul"===g.name)){g.insert(n,g.firstChild,!0);continue}n.wrap(D(new _y("ul",1)));continue}T.isValidChild(n.parent.name,"div")&&T.isValidChild("div",n.name)?n.wrap(D(new _y("div",1))):p[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(T.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(k.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in _){for(s=A[c],i=(n=_[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=R.length;r<o;r++)if((s=R[r]).name in B){for(i=(n=B[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 Iy(e,k),ky.register(e,k),e}var Vy=function(e,t,n){-1===It.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},Hy=function(e,t,n){var r=_i(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||wo(Vn.fromDom(t))?r:It.trim(r)},jy=function(e,t,n){var r=n.selection?xy.merge({forced_root_block:!1},n):n,o=e.parse(t,r);return wy.trimTrailingBr(o),o},$y=function(e,t,n,r,o){var i,a,u,s,c=(i=r,Jc(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?lp(a,xy.merge(u,{content:s})).content:s};function Wy(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:vi.DOM,c=u&&u.schema?u.schema:oi(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=qy(a,c),wy.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=xy.merge({format:"html"},t||{}),r=Ny.process(u,e,n),o=Hy(s,r,n),i=jy(l,o,n);return"tree"===n.format?i:$y(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:V.curry(Vy,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 Ky(e){return{getBookmark:V.curry(Lc,e),moveToBookmark:V.curry(Ic,e)}}(Ky||(Ky={})).isBookmarkNode=Mc;var Xy=Ky,Yy=Oo.isContentEditableFalse,Gy=Oo.isContentEditableTrue,Jy=function(r,a){var u,s,c,l,f,d,m,p,g,h,v,y,i,b,C,x,w,N=a.dom,E=It.each,S=a.getDoc(),k=document,T=Math.abs,A=Math.round,R=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;"+(ve.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 _=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(),!_(t.target)||ih(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},B=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},D=function(e){var t=a.settings.object_resizing;return!1!==t&&!ve.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Pr.is(Vn.fromDom(e),t))},O=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,(_(u)&&!1!==a.settings.resize_img_proportional?!sh.modifierPressed(e):sh.modifierPressed(e)||_(u)&&f[2]*f[3]!=0)&&(T(t)>T(n)?(C=A(b*y),b=A(C/y)):(b=A(C/y),C=A(b*y))),N.setStyles(B(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",p+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",g+(v-C)),(t=R.scrollWidth-x)+(n=R.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(mp(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(B(u),e,t):N.setAttrib(B(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",O),N.unbind(S,"mouseup",P),k!==S&&(N.unbind(k,"mousemove",O),N.unbind(k,"mouseup",P)),N.remove(s),N.remove(c),o(u),pp(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;L(),F(),t=N.getPos(e,R),p=t.x,g=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}),D(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(R,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===ve.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=B(u).clientWidth,v=B(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+p,y:o*n[1]+g},x=R.scrollWidth,w=R.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:p,top:g,margin:0}),s.removeAttribute("data-mce-selected"),R.appendChild(s),N.bind(S,"mousemove",O),N.bind(S,"mouseup",P),k!==S&&(N.bind(k,"mousemove",O),N.bind(k,"mouseup",P)),c=N.add(R,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+p-t.offsetWidth/2,top:o*n[1]+g-t.offsetHeight/2})}):L(),u.setAttribute("data-mce-selected","1")},L=function(){var e,t;for(e in F(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},I=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],R)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):L())},M=function(e){return Yy(function(e,t){for(;t&&t!==e;){if(Gy(t)||Yy(t))return t;t=t.parentNode}return null}(a.getBody(),e))},F=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(),ve.ie&&11<=ve.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||M(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(R,"mscontrolselect",function(e){var t=function(e){we.setEditorTimeout(a,function(){a.selection.select(e)})};if(M(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=we.throttle(function(e){a.composing||I(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",L),a.on("contextmenu",n)}),a.on("remove",F),{isResizable:D,showResizeRect:o,hideResizeRect:L,updateResizeRect:I,destroy:function(){u=s=null}}},Qy=function(e){return Oo.isContentEditableTrue(e)||Oo.isContentEditableFalse(e)},Zy=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=It.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,Oo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Qy))?null:i}return r},eb=function(n,e){return H.map(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},tb=function(e,t){return Vn.fromDom(e.dom().cloneNode(t))},nb=function(e){return tb(e,!0)},rb=function(e){return tb(e,!1)},ob=nb,ib=function(e,t){var n=(t||document).createDocumentFragment();return H.each(e,function(e){n.appendChild(e.dom())}),Vn.fromDom(n)},ab=kr.immutable("element","width","rows"),ub=kr.immutable("element","cells"),sb=kr.immutable("x","y"),cb=function(e,t){var n=parseInt(lr.get(e,t),10);return isNaN(n)?1:n},lb=function(e){return H.foldl(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},fb=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(Mr.eq(o[i],t))return A.some(sb(i,r));return A.none()},db=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(ub(a[u].element(),c))}return i},mb=function(e){var o=ab(rb(e),0,[]);return H.each(hu(e,"tr"),function(n,r){H.each(hu(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=cb(o,"rowspan"),a=cb(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=ub(ob(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:rb(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)})}),ab(o.element(),lb(o.rows()),o.rows())},pb=function(e){return i=t=e,n=H.map(i.rows(),function(e){var t=H.map(e.cells(),function(e){var t=ob(e);return lr.remove(t,"colspan"),lr.remove(t,"rowspan"),t}),n=rb(e.element());return qc(n,t),n}),r=rb(t.element()),o=Vn.fromTag("tbody"),qc(o,n),Hu.append(r,o),r;var t,n,r,o,i},gb=function(l,e,t){return fb(l,e).bind(function(c){return fb(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?db(t,o,i,a,u):db(t,o,u,a,i),ab(t.element(),lb(s),s);var t,n,r,o,i,a,u,s})})},hb=function(n,t){return H.find(n,function(e){return"li"===Zn.name(e)&&Rg(e,t)}).fold(V.constant([]),function(e){return(t=n,H.find(t,function(e){return"ul"===Zn.name(e)||"ol"===Zn.name(e)})).map(function(e){return[Vn.fromTag("li"),Vn.fromTag(Zn.name(e))]}).getOr([]);var t})},vb=function(e,t){var n,r=Vn.fromDom(t.commonAncestorContainer),o=jl(r,e),i=H.filter(o,function(e){return po(e)||fo(e)}),a=hb(o,t),u=i.concat(a.length?a:yo(n=r)?$r.parent(n).filter(vo).fold(V.constant([]),function(e){return[n,e]}):vo(n)?[n]:[]);return H.map(u,rb)},yb=function(){return ib([])},bb=function(e,t){return n=Vn.fromDom(t.cloneContents()),r=vb(e,t),o=H.foldl(r,function(e,t){return Hu.append(t,e),t},n),0<r.length?ib([o]):o;var n,r,o},Cb=function(e,o){return(t=e,n=o[0],kl(n,"table",V.curry(Mr.eq,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=mb(e);return gb(r,t,n).map(function(e){return ib([pb(e)])})}).getOrThunk(yb);var t,n},xb=function(e,t){var n,r,o=Pd(t,e);return 0<o.length?Cb(e,o):(n=e,0<(r=t).length&&r[0].collapsed?yb():bb(n,r[0]))},wb=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=eb(e,Ad(i));if((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 e.selection.isCollapsed()?"":_i(r.text||(i.toString?i.toString():""));r.cloneContents?(n=t.contextual?xb(Vn.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n):r.item!==undefined||r.htmlText!==undefined?(o.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var u=e.selection.serializer.serialize(o,t);return"tree"===t.format?u:(t.content=e.selection.isCollapsed()?"":u,e.fire("GetContent",t),t.content)},Nb=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)},Eb=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(Vn.fromDom).map(function(e){return r&&t.collapsed?e:$r.child(e,o(e,a)).getOr(e)}).bind(function(e){return Zn.isElement(e)?A.some(e):$r.parent(e)}).map(function(e){return e.dom()}).getOr(e)},Sb=function(e,t,n){return Eb(e,t,!0,n,function(e,t){return Math.min($r.childNodesCount(e),t)})},kb=function(e,t,n){return Eb(e,t,!1,n,function(e,t){return 0<t?t-1:t})},Tb=function(e,t){for(var n=e;e&&Oo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Ab=It.each,Rb=function(e){return!!e.select},_b=function(e){return!(!e||!e.ownerDocument)&&Mr.contains(Vn.fromDom(e.ownerDocument),Vn.fromDom(e))},Bb=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return Nb(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===zp(c)){var i=Mm(c);if(i.isSome())return i.map(function(e){return eb(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=eb(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)&&(Rb(o)||_b(o.startContainer)&&_b(o.endContainer))){var o,i=Rb(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||ve.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})}}},p=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)},g={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)):(_g(u,n,c.getBody(),!0),i(n))},getContent:function(e){return wb(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,A.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&&(_g(r,n,e,!0),_g(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:p,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?Tb(r.nextSibling,!0):r.parentNode,o=0===a?Tb(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 Sb(c.getBody(),m(),e)},getEnd:function(e){return kb(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||Sb(i,t,!1),e.isBlock),r=e.getParent(r||kb(i,t,!1),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new ao(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(!_d(t)&&Bg(c)){var n=um(u,e);return n.each(function(e){i(e,p())}),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={};Ab(a,function(e,n){Ab(r,function(t){if(u.is(t,n))return i[n]||(Ab(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),Ab(i,function(e,t){o[t]||(delete i[t],Ab(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),g},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 Nu(c,e,t)},placeCaretAt:function(e,t){return i(Zy(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?La.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=Xy(g),t=Jy(g,c),g.bookmarkManager=n,g.controlSelection=t,g},Db=Oo.isContentEditableFalse,Ob=aa,Pb=Bs,Lb=_s,Ib=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Mb=function(e,t,n,r){var o,i,a,u,s,c,l=e===iu.Forwards,f=l?Lb:Pb;return!r.collapsed&&(o=Ob(r),Db(o))?tu(e,t,o,e===iu.Backwards,!0):(u=Oi(r.startContainer),f(i=Rs(e,t.getBody(),r))?nu(t,i.getNode(!l)):(i=n(i))?f(i)?tu(e,t,i.getNode(!l),l,!0):f(a=n(i))&&(!(c=bs(s=i,a))&&Oo.isBr(s.getNode())||c)?tu(e,t,a.getNode(!l),l,!0):u?ou(t,i.toRange(),!0):null:u?r:null)},Fb=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=Ob(r),o=Rs(e,t.getBody(),r),i=n(t.getBody(),Yg(1),o),a=Bt.filter(i,Gg(1)),s=Bt.last(o.getClientRects()),(Lb(o)||Ds(o))&&(d=o.getNode()),(Pb(o)||Os(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=nh(a,c))&&Db(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),tu(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Ys(t),f=[],d=0,m=function(e){return Bt.last(e.getClientRects())};1===e?(o=l.next,i=ia,a=oa,u=La.after(r)):(o=l.prev,i=oa,a=ia,u=La.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,Bt.last(f))&&d++,(s=ta(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),Yg(1),d);if(u=nh(Bt.filter(m,Gg(1)),c))return ou(t,u.position.toRange(),!0);if(u=Bt.last(Bt.filter(m,Gg(0))))return ou(t,u.position.toRange(),!0)}},zb=function(e,t,n){var r,o,i,a,u=Ys(e.getBody()),s=da.curry(Ib,u.next),c=da.curry(Ib,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(La.fromRangeStart(n)):c(La.fromRangeStart(n)))||(a=(i=e).dom.create(i.settings.forced_root_block),(!ve.ie||11<=ve.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())}},Ub=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Ys((e=l).getBody()),o=da.curry(Ib,r.next),i=da.curry(Ib,r.prev),a=t?iu.Forwards:iu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Mb(a,e,u,s))?n:(n=zb(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},qb=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Xg:Kg,i=(e=u).selection.getRng(),(n=Fb(r,e,o,i))?n:(n=zb(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},Vb=function(e,r){return H.bind((t=e,H.map(t,function(e){return xy.merge({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:V.noop},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});var t},Hb=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)}},jb=function(e,t){return H.find(Vb(e,t),function(e){return e.action()})},$b=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=Un.detect().os,jb([{keyCode:sh.RIGHT,action:Ub(t,!0)},{keyCode:sh.LEFT,action:Ub(t,!1)},{keyCode:sh.UP,action:qb(t,!1)},{keyCode:sh.DOWN,action:qb(t,!0)},{keyCode:sh.RIGHT,action:es(t,!0)},{keyCode:sh.LEFT,action:es(t,!1)},{keyCode:sh.UP,action:ts(t,!1)},{keyCode:sh.DOWN,action:ts(t,!0)},{keyCode:sh.RIGHT,action:sd.move(t,n,!0)},{keyCode:sh.LEFT,action:sd.move(t,n,!1)},{keyCode:sh.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:sd.moveNextWord(t,n)},{keyCode:sh.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:sd.movePrevWord(t,n)}],r).each(function(e){r.preventDefault()}))})},Wb=function(e){return 1===$r.children(e).length},Kb=function(e,t,n,r){var o,i,a,u,s=V.curry(Sv,t),c=H.map(H.filter(r,s),function(e){return e.dom()});if(0===c.length)vf(t,e,n);else{var l=(o=n.dom(),i=c,a=yv(!1),u=Nv(i,a.dom()),Hu.before(Vn.fromDom(o),a),Hc.remove(Vn.fromDom(o)),La(u,0));t.selection.setRng(l.toRange())}},Xb=function(n,r){var t,e=Vn.fromDom(n.getBody()),o=Vn.fromDom(n.selection.getStart()),i=H.filter((t=jl(o,e),H.findIndex(t,mo).fold(V.constant(t),function(e){return t.slice(0,e)})),Wb);return H.last(i).map(function(e){var t=La.fromRangeStart(n.selection.getRng());return!!El(r,t,e.dom())&&(Kb(r,n,e,i),!0)}).getOr(!1)},Yb=function(e,t){return!!e.selection.isCollapsed()&&Xb(e,t)},Gb=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,jb([{keyCode:sh.BACKSPACE,action:Hb(Cf,t,!1)},{keyCode:sh.DELETE,action:Hb(Cf,t,!0)},{keyCode:sh.BACKSPACE,action:Hb(dd,t,n,!1)},{keyCode:sh.DELETE,action:Hb(dd,t,n,!0)},{keyCode:sh.BACKSPACE,action:Hb(tf,t,!1)},{keyCode:sh.DELETE,action:Hb(tf,t,!0)},{keyCode:sh.BACKSPACE,action:Hb(Jl,t,!1)},{keyCode:sh.DELETE,action:Hb(Jl,t,!0)},{keyCode:sh.BACKSPACE,action:Hb($d,t,!1)},{keyCode:sh.DELETE,action:Hb($d,t,!0)},{keyCode:sh.BACKSPACE,action:Hb(Yb,t,!1)},{keyCode:sh.DELETE,action:Hb(Yb,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,jb([{keyCode:sh.BACKSPACE,action:Hb(xf,t)},{keyCode:sh.DELETE,action:Hb(xf,t)}],n))})},Jb=function(e){return A.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},Qb=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 ao(t,t);r=n.current();){if(Oo.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 Oo.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)}},Zb=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},eC=Jb,tC=function(e){return Jb(e).fold(V.constant(""),function(e){return e.nodeName.toUpperCase()})},nC=function(e){return Jb(e).filter(function(e){return yo(Vn.fromDom(e))}).isSome()},rC=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},oC=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},iC=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},aC=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Oo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},uC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;oC(u=n)&&oC(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(aC(n,r,!0)&&aC(n,r,!1))rC(n,"LI")?i.insertAfter(l,iC(n)):i.replace(l,n);else if(aC(n,r,!0))rC(n,"LI")?(i.insertAfter(l,iC(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(aC(n,r,!1))i.insertAfter(l,iC(n));else{n=iC(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),Qb(e,l)}},sC=function(e){e.innerHTML='<br data-mce-bogus="1">'},cC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},lC=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)},fC=function(e,t,n){return!1===Oo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===Ri?0:n:n===t.data.length-1&&t.data.charAt(n)===Ri?t.data.length:n},dC=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},mC=function(e,t){var n=Ou(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,Pu(e))},pC=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,p,g,h,v,y,b,C=a.dom,x=a.schema,w=x.getNonEmptyElements(),N=a.selection.getRng(),E=function(e){var t,n,r,o=s,i=x.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=C.create(e||m),mC(a,t)):t=c.cloneNode(!1),r=t,!1===Mu(a))C.setAttrib(t,"style",null),C.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(kc(o))continue;n=o.cloneNode(!1),C.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return sC(r),t},S=function(e){var t,n,r,o;if(o=fC(e,s,i),Oo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&p&&!e)return!0;if(e&&Oo.isElement(s)&&s===c.firstChild)return!0;if(cC(s,"TABLE")||cC(s,"HR"))return p&&!e||!p&&e;for(t=new ao(s,c),Oo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(Oo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),w[r]&&"br"!==r))return!1}else if(Oo.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?E(m):E(),Fu(a)&&lC(C,l)&&C.isEmpty(c)?r=C.split(l,c):C.insertAfter(r,c),Qb(a,r)};um(C,N).each(function(e){N.setStart(e.startContainer,e.startOffset),N.setEnd(e.endContainer,e.endOffset)}),s=N.startContainer,i=N.startOffset,m=Ou(a),n=e.shiftKey,Oo.isElement(s)&&s.hasChildNodes()&&(p=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=p&&Oo.isText(s)?s.nodeValue.length:0),(u=dC(C,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,p=dC(m,r);if(!(a=m.getParent(r,m.isBlock))||!lC(m,a)){if(l=(a=a||p)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),mC(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),mC(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,N,s,i)),c=C.getParent(s,C.isBlock),l=c?C.getParent(c.parentNode,C.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)&&C.isEmpty(c)?uC(a,E,l,c,m):m&&c===a.getBody()||(m=m||"P",Oi(c)?(r=Vi(c),C.isEmpty(c)&&sC(c),Qb(a,r)):S()?k():S(!0)?(r=c.parentNode.insertBefore(E(),c),Qb(a,cC(c,"HR")?r:c)):((t=(y=N,b=y.cloneRange(),b.setStart(y.startContainer,fC(!0,y.startContainer,y.startOffset)),b.setEnd(y.endContainer,fC(!1,y.endContainer,y.endOffset)),b).cloneRange()).setEndAfter(c),function(e){for(;Oo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o=t.extractContents()),r=o.firstChild,C.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Oo.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=o)&&"A"===a.nodeName&&0===It.trim(_i(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,r),g=C,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(g.getStyle(v,"float",!0))||g.add(h,"br"),C.isEmpty(c)&&sC(c),r.normalize(),C.isEmpty(r)?(C.remove(r),k()):Qb(a,r)),C.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},gC=function(e,t){return eC(e).filter(function(e){return 0<t.length&&Pr.is(Vn.fromDom(e),t)}).isSome()},hC=function(e){return gC(e,Lu(e))},vC=function(e){return gC(e,Iu(e))},yC=nf([{br:[]},{block:[]},{none:[]}]),bC=function(e,t){return vC(e)},CC=function(n){return function(e,t){return""===Ou(e)===n}},xC=function(n){return function(e,t){return nC(e)===n}},wC=function(n,r){return function(e,t){return tC(e)===n.toUpperCase()===r}},NC=function(e){return wC("pre",e)},EC=function(n){return function(e,t){return Du(e)===n}},SC=function(e,t){return hC(e)},kC=function(e,t){return t},TC=function(e){var t=Ou(e),n=Zb(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},AC=function(e,t){return function(n,r){return H.foldl(e,function(e,t){return e&&t(n,r)},!0)?A.some(t):A.none()}},RC=function(e,t){return Df([AC([bC],yC.none()),AC([wC("summary",!0)],yC.br()),AC([NC(!0),EC(!1),kC],yC.br()),AC([NC(!0),EC(!1)],yC.block()),AC([NC(!0),EC(!0),kC],yC.block()),AC([NC(!0),EC(!0)],yC.br()),AC([xC(!0),kC],yC.br()),AC([xC(!0)],yC.block()),AC([CC(!0),kC,TC],yC.block()),AC([CC(!0)],yC.br()),AC([SC],yC.br()),AC([CC(!1),kC],yC.br()),AC([TC],yC.block())],[e,t.shiftKey]).getOr(yC.none())},_C=function(e,t){RC(e,t).fold(function(){vm(e,t)},function(){pC(e,t)},V.noop)},BC=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===sh.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"),_C(t,n)})))})},DC=function(e,t,n){return u=t,!(!OC(n)||!Oo.isText(u.container())||(r=e,i=(o=t).container(),a=o.offset(),i.insertData(a,"\xa0"),r.selection.setCursorLocation(i,a+1),0));var r,o,i,a,u},OC=function(e){return e.fold(V.constant(!1),V.constant(!0),V.constant(!0),V.constant(!1))},PC=function(e){return!!e.selection.isCollapsed()&&(t=e,n=V.curry(xl.isInlineTarget,t),r=La.fromRangeStart(t.selection.getRng()),Gf(n,t.getBody(),r).map(V.curry(DC,t,r)).getOr(!1));var t,n,r},LC=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,jb([{keyCode:sh.SPACEBAR,action:Hb(PC,t)}],n).each(function(e){n.preventDefault()}))})},IC=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(Vi(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},MC=function(e,t){var n,r=(n=e,Tl(Vn.fromDom(n.getBody()),"*[data-mce-caret]").fold(V.constant(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void IC(e,r)):void(Ii(r)&&(IC(e,r),e.undoManager.add()))},FC=function(e){e.on("keyup compositionstart",V.curry(MC,e))},zC=function(e){var t=sd.setupSelectedState(e);FC(e),$b(e,t),Gb(e,t),BC(e),LC(e)};function UC(u){var s,n,r,o=It.each,c=sh.BACKSPACE,l=sh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=ve.gecko,a=ve.ie,m=ve.webkit,p="data:text/mce-internal,",g=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<ve.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===sh.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()}}),ve.windowsPhone||u.on("keyup focusin mouseup",function(e){sh.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(Li(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()}),ve.iOS?(u.inline||u.on("keydown",function(){document.activeElement===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<=ve.ie&&(C(),b()),ve.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=p+escape(u.id)+","+escape(n),t.dataTransfer.setData(g,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(g))&&0<=a.indexOf(p)?(a=a.substr(p.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=Zy(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())}}}),Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),we.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(),we.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}"),ve.mac&&u.on("keydown",function(e){!sh.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 qC=function(e){return Oo.isElement(e)&&ho(Vn.fromDom(e))},VC=function(t){t.on("click",function(e){3===e.detail&&function(e){var t=e.selection.getRng(),n=Da.fromRangeStart(t),r=Da.fromRangeEnd(t);if(Da.isElementPosition(n)){var o=n.container();qC(o)&&Qa.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}Da.isElementPosition(r)&&(o=n.container(),qC(o)&&Qa.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(Zc(t))}(t)})},HC=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){H.each(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){H.each(e,function(e){var t=e.attr("data-mce-open");e.attr("open",k.isString(t)?t:null),e.attr("data-mce-open",null)})})},jC=vi.DOM,$C=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&&we.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},WC=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();jC.removeClass(e,"mce-content-body"),jC.removeClass(e,"mce-edit-focus"),jC.setAttrib(e,"contentEditable",null)}),jC.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||document,t.contentWindow=f.content_window||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"===jC.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=wg(t),t.schema=oi(f),t.dom=vi(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,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=qy((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 _y("br",1)).shortEnded=!0)}),o),t.serializer=Wy(f,t),t.selection=Bb(t.dom,t.getWin(),t.serializer,t),t.formatter=vy(t),t.undoManager=Uh(t),t._nodeChangeDispatcher=new Dg(t),t._selectionOverrides=ph(t),HC(t),VC(t),zC(t),kg(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,jC.setAttrib(n,"spellcheck","false")),t.quirks=UC(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){It.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="",It.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?jC.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){$C(t)},function(e){$C(t)}),f.content_style&&(a=t,s=f.content_style,c=Vn.fromDom(a.getDoc().head),l=Vn.fromTag("style"),lr.set(l,"type","text/css"),Hu.append(l,Vn.fromText(s)),Hu.append(c,l))},KC=vi.DOM,XC=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=ku(e),s=Vn.fromTag("iframe"),lr.setAll(s,i),lr.setAll(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),yr(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,p,g=function(e,t){if(document.domain!==window.location.hostname&&ve.ie&&ve.ie<12){var n=xg.uuid("mce");e[n]=function(){WC(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return KC.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(p=Tu(f=e)+"<html><head>",Au(f)!==f.documentBaseUrl&&(p+='<base href="'+f.documentBaseURI.getURI()+'" />'),p+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=Ru(f),m=_u(f),Bu(f)&&(p+='<meta http-equiv="Content-Security-Policy" content="'+Bu(f)+'" />'),p+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),KC.add(t.iframeContainer,l),g},YC=function(e,t){var n=XC(e,t);t.editorContainer&&(KC.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=KC.isHidden(t.editorContainer)),e.getElement().style.display="none",KC.setAttrib(e.id,"aria-hidden","true"),n||WC(e)},GC=vi.DOM,JC=function(t,n,e){var r,o,i=og.get(e);if(r=og.urls[e]||t.documentBaseUrl.replace(/\/$/,""),e=It.trim(e),i&&-1===It.inArray(n,e)){if(It.each(og.dependencies(e),function(e){JC(t,n,e)}),t.plugins[e])return;o=new i(t,r,t.$),(t.plugins[e]=o).init&&(o.init(t,r),n.push(e))}},QC=function(e){return e.replace(/^\-/,"")},ZC=function(e){return{editorContainer:e,iframeContainer:e}},ex=function(e){var t,n,r=e.getElement();return e.inline?ZC(null):(t=r,n=GC.create("div"),GC.insertAfter(n,t),ZC(n))},tx=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,k.isString(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||GC.getStyle(f,"width")||"100%",a=l.height||GC.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):k.isFunction(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):ex(e)},nx=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||GC.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,k.isString(o)?(n.settings.theme=QC(o),r=ig.get(o),n.theme=new r(n,ig.urls[o]),n.theme.init&&n.theme.init(n,ig.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],It.each(i.settings.plugins.split(/[ ,]/),function(e){JC(i,a,QC(e))}),e=tx(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&It.each(It.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?WC(t):YC(t,e)},rx=vi.DOM,ox=function(e){return"-"===e.charAt(0)},ix=function(i,a){var u=wi.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(k.isString(i)){if(!ox(i)&&!ig.urls.hasOwnProperty(i)){var a=o.theme_url;a?ig.load(i,t.documentBaseURI.toAbsolute(a)):ig.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){ig.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,It.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),It.each(r.external_plugins,function(e,t){og.load(t,e),r.plugins+=" "+t}),It.each(r.plugins.split(/[ ,]/),function(e){if((e=It.trim(e))&&!og.urls[e])if(ox(e)){e=e.substr(1,e.length);var t=og.dependencies(e);It.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=og.createUrl(t,e),og.load(e.resource,e)})}else og.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||nx(i)},i,function(e){eg(i,e[0]),i.removed||nx(i)})})},ax=function(t){var e=t.settings,n=t.id,r=function(){rx.unbind(window,"ready",r),t.render()};if(Be.Event.domLoaded){if(t.getElement()&&ve.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||rx.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(rx.insertAfter(rx.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},rx.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=Yp(t),t.notificationManager=Xp(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=rx.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),ix(t,t.suffix)}}else rx.bind(window,"ready",r)},ux=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},sx=It.each,cx=It.trim,lx="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),fx={ftp:21,http:80,https:443,mailto:25},dx=function(r,e){var t,n,o=this;if(r=cx(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 dx(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),sx(lx,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="")}};dx.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 dx(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 dx(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=fx[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("/"),sx(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}},dx.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},dx.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 mx=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=It.trim(bh.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=_i(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=Ou(o),u=new RegExp("^(<"+a+"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||wo(Vn.fromDom(n))?t.content=r:t.content=It.trim(r),t.no_events||e.fire("GetContent",t),t.content},px=function(e,t){t(e),e.firstChild&&px(e.firstChild,t),e.next&&px(e.next,t)},gx=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&px(t.firstChild,function(t){H.each(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),H.each(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 u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(e,t,n);H.each(r,function(t){H.each(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},hx=function(e){return e instanceof _y},vx=function(e,t){var r;e.dom.setHTML(e.getBody(),t),zp(r=e)&&Qa.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Oo.isTable(t)?Qa.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},yx=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=hx(s)?"":s,hx(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(V.constant(s),function(e){return hx(s)?function(e,t,n,r){gx(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Jc({validate:e.validate},e.schema).serialize(n);return r.content=wo(Vn.fromDom(t))?o:It.trim(o),vx(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=Ou(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">'),vx(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=Jc({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=wo(Vn.fromDom(n))?r:It.trim(r),vx(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},bx=vi.DOM,Cx=function(e){return A.from(e).each(function(e){return e.destroy()})},xx=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save(),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&bx.remove(o.nextSibling),!e.inline&&r&&(i=e,bx.setStyle(i.id,"display",i.orgDisplay)),fp(e),e.editorManager.remove(e),bx.remove(e.getContainer()),Cx(t),Cx(n),e.destroy()}var i},wx=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(),Cx(i),Cx(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),bx.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())},Nx=vi.DOM,Ex=It.extend,Sx=It.each,kx=It.resolve,Tx=ve.ie,Ax=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:"30px",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=gl(cl,c,a,u),l.settings=t,Si.language=t.language||"en",Si.languageLoad=t.language_load,Si.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new dx(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Ap(l),l.loadedCSS={},l.editorCommands=new Hm(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(ve.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(ve.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=tn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Ex(Ax.prototype={render:function(){ax(this)},focus:function(e){Fp(this,e)},hasFocus:function(){return zp(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+$/,""))?kx(r):0,o=kx(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&&It.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 yl(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),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return ux(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,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:xg.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:(Nx.show(this.getContainer()),Nx.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Tx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(Nx.hide(e.getContainer()),Nx.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:(r.inline||(o.innerHTML=t),(n=Nx.getParent(r.id,"form"))&&Sx(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 yx(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),A.from(t.getBody()).fold(V.constant("tree"===n.format?new _y("body",11):""),function(e){return mx(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Ex({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)!==vp(t=this)&&(t.initialized?hp(t,"readonly"===n):t.on("init",function(){hp(t,"readonly"===n)}),dp(t,n))},getContainer:function(){return this.container||(this.container=Nx.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=Nx.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),Sx(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(){xx(this)},destroy:function(e){wx(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},Np);var Rx,_x,Bx,Dx={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},Ox=function(n,e){var t,r;Un.detect().browser.isIE()?(r=n).on("focusout",function(){Lm(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||Lm(n)})},Px=function(e){var t,n,r,o=ah(function(){Lm(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},vi.DOM.bind(document,"mouseup",r),t.on("remove",function(){vi.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){Ox(e,o)}),e.on("remove",function(){o.cancel()})},Lx=vi.DOM,Ix=function(e){return Dx.isEditorUIElement(e)},Mx=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==Lx.getParent(e,function(e){return Ix(e)||!!n&&t.dom.is(e,n)})},Fx=function(r,e){var t=e.editor;Px(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;we.setEditorTimeout(t,function(){var e=r.focusedEditor;Mx(t,function(){try{return document.activeElement}catch(e){return document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Rx||(Rx=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===document&&(t===document.body||Mx(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},Lx.bind(document,"focusin",Rx))},zx=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(Lx.unbind(document,"focusin",Rx),Rx=null)},Ux=function(e){e.on("AddEditor",V.curry(Fx,e)),e.on("RemoveEditor",V.curry(zx,e))},qx={},Vx="en",Hx={setCode:function(e){e&&(Vx=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return Vx},rtl:!1,add:function(e,t){var n=qx[e];for(var r in n||(qx[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=qx[Vx]||{},n=function(e){return It.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||It.is(e,"undefined")},o=function(e){return e=n(e),It.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(It.is(e,"object")&&It.hasOwn(e,"raw"))return n(e.raw);if(It.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return It.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:qx},jx=vi.DOM,$x=It.explode,Wx=It.each,Kx=It.extend,Xx=0,Yx=!1,Gx=[],Jx=[],Qx=function(t){Wx(Bx.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})},Zx=function(e){e!==Yx&&(e?tn(window).on("resize scroll",Qx):tn(window).off("resize scroll",Qx),Yx=e)},ew=function(t){var e=Jx;delete Gx[t.id];for(var n=0;n<Gx.length;n++)if(Gx[n]===t){Gx.splice(n,1);break}return Jx=H.filter(Jx,function(e){return t!==e}),Bx.activeEditor===t&&(Bx.activeEditor=0<Jx.length?Jx[0]:null),Bx.focusedEditor===t&&(Bx.focusedEditor=null),e.length!==Jx.length};Kx(Bx={defaultSettings:{},$:tn,majorVersion:"4",minorVersion:"7.13",releaseDate:"2018-05-16",editors:Gx,i18n:Hx,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=dx.getDocumentBaseUrl(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=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&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new dx(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new dx(this.baseURL),this.suffix=o,Ux(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new dx(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new dx(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Si.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=It.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)&&!jx.get(t)?e.name:jx.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):jx.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Ax(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};jx.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=tn.unique(function(t){var e,n=[];if(ve.ie&&ve.ie<11)return rg("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 Wx(t.types,function(e){n=n.concat(jx.select(e.selector))}),n;if(t.selector)return jx.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&Wx($x(e),function(t){var e;(e=jx.get(t))?n.push(e):Wx(document.forms,function(e){Wx(e.elements,function(e){e.name===t&&(t="mce_editor_"+Xx++,jx.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":Wx(jx.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?Wx(r.types,function(t){It.each(o,function(e){return!jx.is(e,t.selector)||(n(c(e),Kx({},r,t),e),!1)})}):(It.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(ew(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=It.grep(o,function(e){return!s.get(e.id)})).length?f([]):Wx(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?rg("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,jx.bind(window,"ready",e),new ye(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?Jx.slice(0):k.isString(t)?H.find(Jx,function(e){return e.id===t}).getOr(null):k.isNumber(t)&&Jx[t]?Jx[t]:null},add:function(e){var t=this;return Gx[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(Gx[e.id]=e),Gx.push(e),Jx.push(e)),Zx(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),_x||(_x=function(){t.fire("BeforeUnload")},jx.bind(window,"beforeunload",_x))),e},createEditor:function(e,t){return this.add(new Ax(e,t,this))},remove:function(e){var t,n,r=this;if(e)return k.isString(e)?(e=e.selector||e,void Wx(jx.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})):(n=e,k.isNull(r.get(n.id))?null:(ew(n)&&r.fire("RemoveEditor",{editor:n}),0===Jx.length&&jx.unbind(window,"beforeunload",_x),n.remove(),Zx(0<Jx.length),n));for(t=Jx.length-1;0<=t;t--)r.remove(Jx[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Ax(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(){Wx(Jx,function(e){e.save()})},addI18n:function(e,t){Hx.add(e,t)},translate:function(e){return Hx.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}},Xm),Bx.setup();var tw,nw=Bx;function rw(n){return{walk:function(e,t){return Bv(n,e,t)},split:mv,normalize:function(t){return um(n,t).fold(V.constant(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(tw=rw||(rw={})).compareRanges=em,tw.getCaretRangeFromPoint=Zy,tw.getSelectedNode=aa,tw.getNode=ua;var ow,iw,aw=rw,uw=Math.min,sw=Math.max,cw=Math.round,lw=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+=cw(s/2)),"c"===n[1]&&(r+=cw(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=cw(a/2)),"c"===n[4]&&(r-=cw(i/2)),fw(r,o,i,a)},fw=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},dw={inflate:function(e,t,n){return fw(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:lw,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=lw(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=sw(e.x,t.x),r=sw(e.y,t.y),o=uw(e.x+e.w,t.x+t.w),i=uw(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:fw(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=sw(0,t.x-u),o=sw(0,t.y-s),i=sw(0,c-f),a=sw(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),fw(u,s,(c-=i)-u,(l-=a)-s)},create:fw,fromClientRect:function(e){return fw(e.left,e.top,e.width,e.height)}},mw={},pw={add:function(e,t){mw[e.toLowerCase()]=t},has:function(e){return!!mw[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=mw.hasOwnProperty(t)?mw[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=mw[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},gw=It.each,hw=It.extend,vw=function(){};vw.extend=ow=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!iw&&(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 iw=!0,e=new this,iw=!1,n.Mixins&&(gw(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&&gw(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&gw(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&gw(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=hw({},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=ow,i};var yw=Math.min,bw=Math.max,Cw=Math.round,xw=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?",":"")+xw(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+":"+xw(e[i],n):"");return o+"}"}return""+e},ww={serialize:xw,parse:function(e){try{return JSON.parse(e)}catch(t){}}},Nw={callbacks:{},count:0,send:function(t){var n=this,r=vi.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++}},Ew={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||"",Ew.fire("beforeInitialize",{settings:e}),t=new ag){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&&It.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=Ew.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};It.extend(Ew,Xm);var Sw=It.extend,kw=function(e){this.settings=Sw({},e),this.count=0};kw.sendRPC=function(e){return(new kw).send(e)},kw.prototype={send:function(n){var r=n.error,o=n.success;(n=Sw(this.settings,n)).success=function(e,t){void 0===(e=ww.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=ww.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",Ew.send(n)}};var Tw,Aw=window.localStorage,Rw=nw,_w={geom:{Rect:dw},util:{Promise:ye,Delay:we,Tools:It,VK:sh,URI:dx,Class:vw,EventDispatcher:$m,Observable:Xm,I18n:Hx,XHR:Ew,JSON:ww,JSONRequest:kw,JSONP:Nw,LocalStorage:Aw,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=bw(0,yw(t,1)),n=bw(0,yw(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=Cw(255*(u+a)),s=Cw(255*(s+a)),c=Cw(255*(c+a))}else u=s=c=Cw(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=yw(e/=255,yw(t/=255,n/=255)))===(a=bw(e,bw(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:Cw(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:Cw(100*r),v:Cw(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:Be,Sizzle:mt,DomQuery:tn,TreeWalker:ao,DOMUtils:vi,ScriptLoader:wi,RangeUtils:aw,Serializer:Wy,ControlSelection:Jy,BookmarkManager:Xy,Selection:Bb,Event:Be.Event},html:{Styles:ai,Entities:Ko,Node:_y,Schema:oi,SaxParser:vh,DomParser:qy,Writer:Gc,Serializer:Jc},ui:{Factory:pw},Env:ve,AddOnManager:Si,Formatter:vy,UndoManager:Uh,EditorCommands:Hm,WindowManager:Yp,NotificationManager:Xp,EditorObservable:Np,Shortcuts:Ap,Editor:Ax,FocusManager:Dx,EditorManager:nw,DOM:vi.DOM,ScriptLoader:wi.ScriptLoader,PluginManager:Si.PluginManager,ThemeManager:Si.ThemeManager,trim:It.trim,isArray:It.isArray,is:It.is,toArray:It.toArray,makeMap:It.makeMap,each:It.each,map:It.map,grep:It.grep,inArray:It.inArray,extend:It.extend,create:It.create,walk:It.walk,createNS:It.createNS,resolve:It.resolve,explode:It.explode,_addCacheSuffix:It._addCacheSuffix,isOpera:ve.opera,isWebKit:ve.webkit,isIE:ve.ie,isGecko:ve.gecko,isMac:ve.mac},Bw=Rw=It.extend(Rw,_w);Tw=Bw,window.tinymce=Tw,window.tinyMCE=Tw,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(Bw)}();!function(){"use strict";var e,t,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),l=tinymce.util.Tools.resolve("tinymce.EditorManager"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return!1!==c(e)},c=function(e){return e.getParam("menubar")},f=function(e){return e.getParam("toolbar_items_size")},h=function(e){return e.getParam("menu")},m=function(e){return!1===e.settings.skin},g=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},p=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),v=tinymce.util.Tools.resolve("tinymce.ui.Factory"),b=tinymce.util.Tools.resolve("tinymce.util.I18n"),s=function(e){return e.fire("SkinLoaded")},y=function(e){return e.fire("ResizeEditor")},x=function(e){return e.fire("BeforeRenderUI")},a=function(t,n){return function(){var e=t.find(n)[0];e&&e.focus(!0)}},_=function(e,t){e.shortcuts.add("Alt+F9","",a(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",a(t,"toolbar")),e.shortcuts.add("Alt+F11","",a(t,"elementpath")),t.on("cancel",function(){e.focus()})},R=tinymce.util.Tools.resolve("tinymce.geom.Rect"),u=tinymce.util.Tools.resolve("tinymce.util.Delay"),C=function(e){return function(){return e}},k=C(!1),E=C(!0),H={noop:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},noarg:function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n()}},compose:function(n,i){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(i.apply(null,arguments))}},constant:C,identity:function(e){return e},tripleEquals:function(e,t){return e===t},curry:function(o){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var s=new Array(arguments.length-1),n=1;n<arguments.length;n++)s[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var r=s.concat(n);return o.apply(null,r)}},not:function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,arguments)}},die:function(e){return function(){throw new Error(e)}},apply:function(e){return e()},call:function(e){e()},never:k,always:E},S=H.never,M=H.always,T=function(){return P},P=(i={fold:function(e,t){return e()},is:S,isSome:S,isNone:M,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},or:n,orThunk:t,map:T,ap:T,each:function(){},bind:T,flatten:T,exists:S,forall:M,filter:T,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:H.constant("none()")},Object.freeze&&Object.freeze(i),i),W=function(n){var e=function(){return n},t=function(){return r},i=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:M,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,or:t,orThunk:t,map:function(e){return W(e(n))},ap:function(e){return e.fold(T,function(e){return W(e(n))})},each:function(e){e(n)},bind:i,flatten:e,exists:i,forall:i,filter:function(e){return e(n)?r:P},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(S,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},N={some:W,none:T,from:function(e){return null===e||e===undefined?P:W(e)}},D=function(e){return e?e.getRoot().uiContainer:null},A={getUiContainerDelta:function(e){var t=D(e);if(t&&"static"!==p.DOM.getStyle(t,"position",!0)){var n=p.DOM.getPos(t),i=t.scrollLeft-n.x,r=t.scrollTop-n.y;return N.some({x:i,y:r})}return N.none()},setUiContainer:function(e,t){var n=p.DOM.select(e.settings.ui_container)[0];t.getRoot().uiContainer=n},getUiContainer:D,inheritUiContainer:function(e,t){return t.uiContainer=D(e)}},B=function(i,e,r){var o,s=[];if(e)return w.each(e.split(/[ ,]/),function(t){var e,n=function(){var e=i.selection;t.settings.stateSelector&&e.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&e.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})};"|"===t?o=null:(o||(o={type:"buttongroup",items:[]},s.push(o)),i.buttons[t]&&(e=t,"function"==typeof(t=i.buttons[e])&&(t=t()),t.type=t.type||"button",t.size=r,t=v.create(t),o.items.push(t),i.initialized?n():i.on("init",n)))}),{type:"toolbar",layout:"flow",items:s}},O=B,z=function(n,i){var e,t,r=[];if(w.each(!1===(t=(e=n).getParam("toolbar"))?[]:w.isArray(t)?w.grep(t,function(e){return 0<e.length}):function(e,t){for(var n=[],i=1;i<10;i++){var r=e["toolbar"+i];if(!r)break;n.push(r)}var o=e.toolbar?[e.toolbar]:[t];return 0<n.length?n:o}(e.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"),function(e){var t;(t=e)&&r.push(B(n,t,i))}),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}},L=p.DOM,I=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},F=function(e,t){e.moveTo(t.left,t.top)},U=function(e,t,n,i,r,o){return o=I({x:t,y:n,w:o.w,h:o.h}),e&&(o=e({elementRect:I(i),contentAreaRect:I(r),panelRect:o})),o},V=function(x){var i,o=function(){return x.contextToolbars||[]},n=function(e,t){var n,i,r,o,s,a,l,u=x.getParam("inline_toolbar_position_handler");if(!x.removed){if(!e||!e.toolbar.panel)return c=x,void w.each(c.contextToolbars,function(e){e.panel&&e.panel.hide()});var c,d,f,h,m;l=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],s=e.toolbar.panel,t&&s.show(),d=e.element,f=L.getPos(x.getContentAreaContainer()),h=x.dom.getRect(d),"BODY"===(m=x.dom.getRoot()).nodeName&&(h.x-=m.ownerDocument.documentElement.scrollLeft||m.scrollLeft,h.y-=m.ownerDocument.documentElement.scrollTop||m.scrollTop),h.x+=f.x,h.y+=f.y,r=h,i=L.getRect(s.getEl()),o=L.getRect(x.getContentAreaContainer()||x.getBody());var g,p,v,b=A.getUiContainerDelta(s).getOr({x:0,y:0});if(r.x+=b.x,r.y+=b.y,i.x+=b.x,i.y+=b.y,o.x+=b.x,o.y+=b.y,"inline"!==L.getStyle(e.element,"display",!0)){var y=e.element.getBoundingClientRect();r.w=y.width,r.h=y.height}x.inline||(o.w=x.getDoc().documentElement.offsetWidth),x.selection.controlSelection.isResizable(e.element)&&r.w<25&&(r=R.inflate(r,0,8)),n=R.findBestRelativePosition(i,r,o,l),r=R.clamp(r,o),n?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):(o.h+=i.h,(r=R.intersect(o,r))?(n=R.findBestRelativePosition(i,r,o,["bc-tc","bl-tl","br-tr"]))?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):F(s,U(u,r.x,r.y,r,o,i)):s.hide()),g=s,v=function(e,t){return e===t},p=(p=n)?p.substr(0,2):"",w.each({t:"down",b:"up"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(0,1)))}),w.each({l:"left",r:"right"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(1,1)))})}},r=function(e){return function(){u.requestAnimationFrame(function(){x.selection&&n(a(x.selection.getNode()),e)})}},t=function(e){var t;if(e.toolbar.panel)return e.toolbar.panel.show(),void n(e);t=v.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:O(x,e.toolbar.items),oncancel:function(){x.focus()}}),A.setUiContainer(x,t),function(e){if(!i){var t=r(!0),n=A.getUiContainer(e);i=x.selection.getScrollContainer()||x.getWin(),L.bind(i,"scroll",t),L.bind(n,"scroll",t),x.on("remove",function(){L.unbind(i,"scroll",t),L.unbind(n,"scroll",t)})}}(t),(e.toolbar.panel=t).renderTo().reflow(),n(e)},s=function(){w.each(o(),function(e){e.panel&&e.panel.hide()})},a=function(e){var t,n,i,r=o();for(t=(i=x.$(e).parents().add(e)).length-1;0<=t;t--)for(n=r.length-1;0<=n;n--)if(r[n].predicate(i[t]))return{toolbar:r[n],element:i[t]};return null};x.on("click keyup setContent ObjectResized",function(e){("setcontent"!==e.type||e.selection)&&u.setEditorTimeout(x,function(){var e;(e=a(x.selection.getNode()))?(s(),t(e)):s()})}),x.on("blur hide contextmenu",s),x.on("ObjectResizeStart",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.hide()}),x.on("ResizeEditor ResizeWindow",r(!0)),x.on("nodeChange",r(!1)),x.on("remove",function(){w.each(o(),function(e){e.panel&&e.panel.remove()}),x.contextToolbars={}}),x.shortcuts.add("ctrl+shift+e > ctrl+shift+p","",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.items()[0].focus()})},j=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},q={isString:j("string"),isObject:j("object"),isArray:j("array"),isNull:j("null"),isBoolean:j("boolean"),isUndefined:j("undefined"),isFunction:j("function"),isNumber:j("number")},Y=(r=Array.prototype.indexOf)===undefined?function(e,t){return Q(e,t)}:function(e,t){return r.call(e,t)},$=function(e,t){return-1<Y(e,t)},X=function(e,t){for(var n=e.length,i=new Array(n),r=0;r<n;r++){var o=e[r];i[r]=t(o,r,e)}return i},J=function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n,e)},G=function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)},K=function(e,t){for(var n=[],i=0,r=e.length;i<r;i++){var o=e[i];t(o,i,e)&&n.push(o)}return n},Z=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n,e))return N.some(n);return N.none()},Q=function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return n;return-1},ee=Array.prototype.push,te=function(e){for(var t=[],n=0,i=e.length;n<i;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);ee.apply(t,e[n])}return t},ne=function(e,t){for(var n=0,i=e.length;n<i;++n)if(!0!==t(e[n],n,e))return!1;return!0},ie=Array.prototype.slice,re=q.isFunction(Array.from)?Array.from:function(e){return ie.call(e)},oe={map:X,each:J,eachr:G,partition:function(e,t){for(var n=[],i=[],r=0,o=e.length;r<o;r++){var s=e[r];(t(s,r,e)?n:i).push(s)}return{pass:n,fail:i}},filter:K,groupBy:function(e,t){if(0===e.length)return[];for(var n=t(e[0]),i=[],r=[],o=0,s=e.length;o<s;o++){var a=e[o],l=t(a);l!==n&&(i.push(r),r=[]),n=l,r.push(a)}return 0!==r.length&&i.push(r),i},indexOf:function(e,t){var n=Y(e,t);return-1===n?N.none():N.some(n)},foldr:function(e,t,n){return G(e,function(e){n=t(n,e)}),n},foldl:function(e,t,n){return J(e,function(e){n=t(n,e)}),n},find:function(e,t){for(var n=0,i=e.length;n<i;n++){var r=e[n];if(t(r,n,e))return N.some(r)}return N.none()},findIndex:Z,flatten:te,bind:function(e,t){var n=X(e,t);return te(n)},forall:ne,exists:function(e,t){return Z(e,t).isSome()},contains:$,equal:function(e,n){return e.length===n.length&&ne(e,function(e,t){return e===n[t]})},reverse:function(e){var t=ie.call(e,0);return t.reverse(),t},chunk:function(e,t){for(var n=[],i=0;i<e.length;i+=t){var r=e.slice(i,i+t);n.push(r)}return n},difference:function(e,t){return K(e,function(e){return!$(t,e)})},mapToObject:function(e,t){for(var n={},i=0,r=e.length;i<r;i++){var o=e[i];n[String(o)]=t(o,i)}return n},pure:function(e){return[e]},sort:function(e,t){var n=ie.call(e,0);return n.sort(t),n},range:function(e,t){for(var n=[],i=0;i<e;i++)n.push(t(i));return n},head:function(e){return 0===e.length?N.none():N.some(e[0])},last:function(e){return 0===e.length?N.none():N.some(e[e.length-1])},from:re},se={file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table"},help:{title:"Help"}},ae=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},le=function(e){return e&&"|"===e.item.text},ue=function(n,e,t,r){var i,o,s,a,l,u,c,d;return e?(o=e[r],a=!0):o=se[r],o&&(i={text:o.title},s=[],w.each((o.items||"").split(/[ ,]/),function(e){var t=ae(e,n[e]);t&&s.push(t)}),a||w.each(n,function(e,t){var n,i;e.context!==r||(n=s,i=t,oe.findIndex(n,function(e){return e.name===i}).isSome())||("before"===e.separator&&s.push({name:"|",item:{text:"|"}}),e.prependToContext?s.unshift(ae(t,e)):s.push(ae(t,e)),"after"===e.separator&&s.push({name:"|",item:{text:"|"}}))}),i.menu=oe.map((l=s,u=t,c=oe.filter(l,function(e){return!1===u.hasOwnProperty(e.name)}),d=oe.filter(c,function(e,t,n){return!le(e)||!le(n[t-1])}),oe.filter(d,function(e,t,n){return!le(e)||0<t&&t<n.length-1})),function(e){return e.item}),!i.menu.length)?null:i},ce=function(e){for(var t,n=[],i=function(e){var t,n=[],i=h(e);if(i)for(t in i)n.push(t);else for(t in se)n.push(t);return n}(e),r=w.makeMap((t=e,t.getParam("removed_menuitems","")).split(/[ ,]/)),o=c(e),s="string"==typeof o?o.split(/[ ,]/):i,a=0;a<s.length;a++){var l=s[a],u=ue(e.menuItems,h(e),r,l);u&&n.push(u)}return n},de=p.DOM,fe=function(e){return{width:e.clientWidth,height:e.clientHeight}},he=function(e,t,n){var i,r,o,s;i=e.getContainer(),r=e.getContentAreaContainer().firstChild,o=fe(i),s=fe(r),null!==t&&(t=Math.max(e.getParam("min_width",100,"number"),t),t=Math.min(e.getParam("max_width",65535,"number"),t),de.setStyle(i,"width",t+(o.width-s.width)),de.setStyle(r,"width",t)),n=Math.max(e.getParam("min_height",100,"number"),n),n=Math.min(e.getParam("max_height",65535,"number"),n),de.setStyle(r,"height",n),y(e)},me=he,ge=function(e,t,n){var i=e.getContentAreaContainer();he(e,i.clientWidth+t,i.clientHeight+n)},pe=tinymce.util.Tools.resolve("tinymce.Env"),ve=function(e,t,n){var i,r=e.settings[n];r&&r((i=t.getEl("body"),{element:function(){return i}}))},be=function(c,d,f){return function(e){var t,n,i,r,o,s=e.control,a=s.parents().filter("panel")[0],l=a.find("#"+d)[0],u=(t=f,n=d,w.grep(t,function(e){return e.name===n})[0]);i=d,r=a,o=f,w.each(o,function(e){var t=r.items().filter("#"+e.name)[0];t&&t.visible()&&e.name!==i&&(ve(e,t,"onhide"),t.visible(!1))}),s.parent().items().each(function(e){e.active(!1)}),l&&l.visible()?(ve(u,l,"onhide"),l.hide(),s.active(!1)):(l?l.show():(l=v.create({type:"container",name:d,layout:"stack",classes:"sidebar-panel",html:""}),a.prepend(l),ve(u,l,"onrender")),ve(u,l,"onshow"),s.active(!0)),y(c)}},ye=function(e){return!(pe.ie&&!(11<=pe.ie)||!e.sidebars)&&0<e.sidebars.length},xe=function(n){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes:"sidebar-toolbar",items:w.map(n.sidebars,function(e){var t=e.settings;return{type:"button",icon:t.icon,image:t.image,tooltip:t.tooltip,onclick:be(n,e.name,n.sidebars)}})}]}},we=function(e){var t=function(){e._skinLoaded=!0,s(e)};return function(){e.initialized?t():e.on("init",t)}},_e=p.DOM,Re=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},Ce=function(t,e,n){var i,r,o,s,a;if(!1===m(t)&&n.skinUiCss?_e.styleSheetLoader.load(n.skinUiCss,we(t)):we(t)(),i=e.panel=v.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===d(t)?null:{type:"menubar",border:"0 0 1 0",items:ce(t)},z(t,f(t))]},ye(t)?(s=t,{type:"panel",layout:"stack",classes:"edit-aria-container",border:"1 0 0 0",items:[Re("0"),xe(s)]}):Re("1 0 0 0")]}),A.setUiContainer(t,i),"none"!==g(t)&&(r={type:"resizehandle",direction:g(t),onResizeStart:function(){var e=t.getContentAreaContainer().firstChild;o={width:e.clientWidth,height:e.clientHeight}},onResize:function(e){"both"===g(t)?me(t,o.width+e.deltaX,o.height+e.deltaY):me(t,null,o.height+e.deltaY)}}),t.getParam("statusbar",!0,"boolean")){var l=b.translate(["Powered by {0}",'<a href="https://www.tinymce.com/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">tinymce</a>']),u=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+l}:null;i.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:t},r,u]})}return x(t),t.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&_e.setStyle(i.getEl(),"width",n.width),t.on("remove",function(){i.remove(),i=null}),_(t,i),V(t),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},ke=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Ee=0,He={id:function(){return"mceu_"+Ee++},create:function(e,t,n){var i=document.createElement(e);return p.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:w.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return p.DOM.createFragment(e)},getWindowSize:function(){return p.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBoundingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return p.DOM.getPos(e,t||He.getContainer())},getContainer:function(){return pe.container?pe.container:document.body},getViewPort:function(e){return p.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return p.DOM.addClass(e,t)},removeClass:function(e,t){return p.DOM.removeClass(e,t)},hasClass:function(e,t){return p.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return p.DOM.toggleClass(e,t,n)},css:function(e,t,n){return p.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return p.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return p.DOM.bind(e,t,n,i)},off:function(e,t,n){return p.DOM.unbind(e,t,n)},fire:function(e,t,n){return p.DOM.fire(e,t,n)},innerHtml:function(e,t){p.DOM.setHTML(e,t)}},Se=function(e){return"static"===He.getRuntimeStyle(e,"position")},Me=function(e){return e.state.get("fixed")};function Te(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=Pe(),o=(r=He.getPos(t,A.getUiContainer(e))).x,s=r.y,Me(e)&&Se(document.body)&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=He.getSize(i)).width,l=f.height,u=(f=He.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var Pe=function(){var e=window,t=Math.max(e.pageXOffset,document.body.scrollLeft,document.documentElement.scrollLeft),n=Math.max(e.pageYOffset,document.body.scrollTop,document.documentElement.scrollTop);return{x:t,y:n,w:t+(e.innerWidth||document.documentElement.clientWidth),h:n+(e.innerHeight||document.documentElement.clientHeight)}},We=function(e){var t,n=A.getUiContainer(e);return n&&!Me(e)?{x:0,y:0,w:(t=n).scrollWidth-1,h:t.scrollHeight-1}:Pe()},Ne={testMoveRel:function(e,t){for(var n=We(this),i=0;i<t.length;i++){var r=Te(this,e,t[i]);if(Me(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return t[i]}else if(r.x>n.x&&r.x+r.w<n.w&&r.y>n.y&&r.y+r.h<n.h)return t[i]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=Te(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){var n=this;function i(e,t,n){return e<0?0:t<e+n&&(e=t-n)<0?0:e}if(n.settings.constrainToViewport){var r=We(this),o=n.layoutRect();e=i(e,r.w,o.w),t=i(t,r.h,o.h)}var s=A.getUiContainer(n);return s&&Se(s)&&!Me(n)&&(e-=s.scrollLeft,t-=s.scrollTop),s&&(e+=1,t+=1),n.state.get("rendered")?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}},De=tinymce.util.Tools.resolve("tinymce.util.Class"),Ae=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Be=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},Oe=function(i,e){function t(e){var t=parseFloat(function(e){var t=i.ownerDocument.defaultView;if(t){var n=t.getComputedStyle(i,null);return n?(e=e.replace(/[A-Z]/g,function(e){return"-"+e}),n.getPropertyValue(e)):null}return i.currentStyle[e]}(e));return isNaN(t)?0:t}return{top:t(e+"TopWidth"),right:t(e+"RightWidth"),bottom:t(e+"BottomWidth"),left:t(e+"LeftWidth")}};function ze(){}function Le(e){this.cls=[],this.cls._map={},this.onchange=e||ze,this.prefix=""}w.extend(Le.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),Le.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)0<t&&(e+=" "),e+=this.prefix+this.cls[t];return e};var Ie,Fe,Ue,Ve=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,je=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,qe=/^\s*|\s*$/g,Ye=De.extend({init:function(e){var o=this.match;function s(e,t,n){var i;function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((i=Ve.exec(e.replace(qe,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(i[2])),r(function(n){if(n)return n=n.split("."),function(e){for(var t=n.length;t--;)if(!e.classes.contains(n[t]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(e){var t=e[n]?e[n]():"";return i?"="===i?t===r:"*="===i?0<=t.indexOf(r):"~="===i?0<=(" "+t+" ").indexOf(" "+r+" "):"!="===i?t!==r:"^="===i?0===t.indexOf(r):"$="===i&&t.substr(t.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var t;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(t=a(i[1],[]),function(e){return!o(e,t)}):(i=i[2],function(e,t,n){return"first"===i?0===t:"last"===i?t===n-1:"even"===i?t%2==0:"odd"===i?t%2==1:!!e[i]&&e[i]()})}(i[7])),t.pseudo=!!i[7],t.direct=n,t}function a(e,t){var n,i,r,o=[];do{if(je.exec(""),(i=je.exec(e))&&(e=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,t),e=[],r=0;r<o.length;r++)">"!==o[r]&&e.push(s(o[r],[],">"===o[r-1]));return t.push(e),t}this._selectors=a(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;n<i;n++){for(m=e,h=0,r=(o=(s=t[n]).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(e){var t,n,u=[],i=this._selectors;function c(e,t,n){var i,r,o,s,a,l=t[n];for(i=0,r=e.length;i<r;i++){for(a=e[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===t.length-1?u.push(a):a.items&&c(a.items(),t,n+1);else if(l.direct)return;a.items&&c(a.items(),t,n)}}if(e.items){for(t=0,n=i.length;t<n;t++)c(e.items(),i[t],0);1<n&&(u=function(e){for(var t,n=[],i=e.length;i--;)(t=e[i]).__checked||(n.push(t),t.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(u))}return Ie||(Ie=Ye.Collection),new Ie(u)}}),$e=Array.prototype.push,Xe=Array.prototype.slice;Ue={length:0,init:function(e){e&&this.add(e)},add:function(e){return w.isArray(e)?$e.apply(this,e):e instanceof Fe?this.add(e.toArray()):$e.call(this,e),this},set:function(e){var t,n=this,i=n.length;for(n.length=0,n.add(e),t=n.length;t<i;t++)delete n[t];return n},filter:function(t){var e,n,i,r,o=[];for("string"==typeof t?(t=new Ye(t),r=function(e){return t.match(e)}):r=t,e=0,n=this.length;e<n;e++)r(i=this[e])&&o.push(i);return new Fe(o)},slice:function(){return new Fe(Xe.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return w.each(this,e),this},toArray:function(){return w.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Fe(w.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(t,n){var e;return n!==undefined?(this.each(function(e){e[t]&&e[t](n)}),this):(e=this[0])&&e[t]?e[t]():void 0},exec:function(t){var n=w.toArray(arguments).slice(1);return this.each(function(e){e[t]&&e[t].apply(e,n)}),this},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(t){return this.each(function(e){e.classes.add(t)})},removeClass:function(t){return this.each(function(e){e.classes.remove(t)})}},w.each("fire on off show hide append prepend before after reflow".split(" "),function(n){Ue[n]=function(){var t=w.toArray(arguments);return this.each(function(e){n in e&&e[n].apply(e,t)}),this}}),w.each("text name disabled active selected checked visible parent value data".split(" "),function(t){Ue[t]=function(e){return this.prop(t,e)}}),Fe=De.extend(Ue);var Je=Ye.Collection=Fe,Ge=function(e){this.create=e.create};Ge.create=function(r,o){return new Ge({create:function(t,n){var i,e=function(e){t.set(n,e.value)};return t.on("change:"+n,function(e){r.set(o,e.value)}),r.on("change:"+o,e),(i=t._bindings)||(i=t._bindings=[],t.on("destroy",function(){for(var e=i.length;e--;)i[e]()})),i.push(function(){r.off("change:"+o,e)}),r.get(o)}})};var Ke=tinymce.util.Tools.resolve("tinymce.util.Observable");function Ze(e){return 0<e.nodeType}var Qe,et,tt=De.extend({Mixins:[Ke],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof Ge&&(e[t]=n.create(this,t));this.data=e},set:function(t,n){var i,r,o=this.data[t];if(n instanceof Ge&&(n=n.create(this,t)),"object"==typeof t){for(i in t)this.set(i,t[i]);return this}return function e(t,n){var i,r;if(t===n)return!0;if(null===t||null===n)return t===n;if("object"!=typeof t||"object"!=typeof n)return t===n;if(w.isArray(n)){if(t.length!==n.length)return!1;for(i=t.length;i--;)if(!e(t[i],n[i]))return!1}if(Ze(t)||Ze(n))return t===n;for(i in r={},n){if(!e(t[i],n[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&!e(t[i],n[i]))return!1;return!0}(o,n)||(this.data[t]=n,r={target:this,name:t,value:n,oldValue:o},this.fire("change:"+t,r),this.fire("change",r)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(e){return Ge.create(this,e)},destroy:function(){this.fire("destroy")}}),nt={},it={add:function(e){var t=e.parent();if(t){if(!t._layout||t._layout.isNative())return;nt[t._id]||(nt[t._id]=t),Qe||(Qe=!0,u.requestAnimationFrame(function(){var e,t;for(e in Qe=!1,nt)(t=nt[e]).state.get("rendered")&&t.reflow();nt={}},document.body))}},remove:function(e){nt[e._id]&&delete nt[e._id]}},rt="onmousewheel"in document,ot=!1,st=0,at={Statics:{classPrefix:"mce-"},isRtl:function(){return et.rtl},classPrefix:"mce-",init:function(t){var e,n,i=this;function r(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}i.settings=t=w.extend({},i.Defaults,t),i._id=t.id||"mceu_"+st++,i._aria={role:t.role},i._elmCache={},i.$=ke,i.state=new tt({visible:!0,active:!1,disabled:!1,value:""}),i.data=new tt(t.data),i.classes=new Le(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(e=t.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&e!==n&&r(n),r(e)),w.each("title text name visible disabled active value".split(" "),function(e){e in t&&i[e](t[e])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=t,i.borderBox=Be(t.border),i.paddingBox=Be(t.padding),i.marginBox=Be(t.margin),t.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var e=A.getUiContainer(this);return e||He.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();e=c.borderBox=c.borderBox||Oe(f,"border"),c.paddingBox=c.paddingBox||Oe(f,"padding"),c.marginBox=c.marginBox||Oe(f,"margin"),u=He.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=e.left+e.right,m=e.top+e.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=t={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},t},layoutRect:function(e){var t,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),e?(i=a.deltaW,r=a.deltaH,e.x!==undefined&&(a.x=e.x),e.y!==undefined&&(a.y=e.y),e.minW!==undefined&&(a.minW=e.minW),e.minH!==undefined&&(a.minH=e.minH),(n=e.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=et.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),e.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((t=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,He.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return lt(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return lt(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=lt(this).fire(e,t),!1!==n&&this.parent)for(var i=this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return lt(this).has(e)},parents:function(e){var t,n=new Je;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new Je(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=ke("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return et.translate?et.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var t,e,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(e=o.length;e--;)o[e].remove()}r&&r.items&&(t=[],r.items().each(function(e){e!==n&&t.push(e)}),r.items().set(t),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&ke(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return ke(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return ke(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=ke(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}ut(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.border&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),it.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),t=(e=t).parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){it.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function lt(n){return n._eventDispatcher||(n._eventDispatcher=new Ae({scope:n,toggleEvent:function(e,t){t&&Ae.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered")&&ut(n))}})),n._eventDispatcher}function ut(a){var e,t,n,l,i,r;function o(e){var t=a.getParentCtrl(e.target);t&&t.fire(e.type,e)}function s(){var e=l._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),l._lastHoverCtrl=null)}function u(e){var t,n,i,r=a.getParentCtrl(e.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(t=i.length-1;s<=t;t--)(o=i[t]).fire("mouseleave",{target:o.getEl()})}for(t=s;t<n.length;t++)(r=n[t]).fire("mouseenter",{target:r.getEl()})}}function c(e){e.preventDefault(),"mousewheel"===e.type?(e.deltaY=-.025*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-.025*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=a.fire("wheel",e)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),e=0,t=n.length;!l&&e<t;e++)l=n[e]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,t=e,e=0;e<t;e++)n[e]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l._delegates={}),i){if(!i)return!1;"wheel"!==r||ot?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(ke(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(ke(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):rt?ke(a.getEl()).on("mousewheel",c):ke(a.getEl()).on("DOMMouseScroll",c)}}}w.each("text title visible disabled active value".split(" "),function(t){at[t]=function(e){return 0===arguments.length?this.state.get(t):(void 0!==e&&this.state.set(t,e),this)}});var ct=et=De.extend(at),dt=function(e){return!!e.getAttribute("data-mce-tabstop")};function ft(e){var o,r,n=e.root;function i(e){return e&&1===e.nodeType}try{o=document.activeElement}catch(t){o=document.body}function s(e){return i(e=e||o)?e.getAttribute("role"):null}function a(e){for(var t,n=e||o;n=n.parentNode;)if(t=s(n))return t}function l(e){var t=o;if(i(t))return t.getAttribute("aria-"+e)}function u(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}function c(t){var r=[];return function e(t){if(1===t.nodeType&&"none"!==t.style.display&&!t.disabled){var n;(u(n=t)&&!n.hidden||dt(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(t);for(var i=0;i<t.childNodes.length;i++)e(t.childNodes[i])}}(t||n.getEl()),r}function d(e){var t,n;(n=(e=e||r).parents().toArray()).unshift(e);for(var i=0;i<n.length&&!(t=n[i]).settings.ariaRoot;i++);return t}function f(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function h(e,t){var n=-1,i=d();t=t||c(i.getEl());for(var r=0;r<t.length;r++)t[r]===o&&(n=r);n+=e,i.lastAriaIndex=f(n,t)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var e=s(),t=a();"tablist"===t?h(1,c(o.parentNode)):"menuitem"===e&&"menu"===t&&l("haspopup")?y():h(1)}function p(){h(-1)}function v(){var e=s(),t=a();"menuitem"===e&&"menubar"===t?y():"button"===e&&l("haspopup")?y({key:"down"}):h(1)}function b(){r.fire("cancel")}function y(e){e=e||{},r.fire("click",{target:o,aria:e})}return r=n.getParentCtrl(o),n.on("keydown",function(e){function t(e,t){u(o)||dt(o)||"slider"!==s(o)&&!1!==t(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,m);break;case 39:t(e,g);break;case 38:t(e,p);break;case 40:t(e,v);break;case 27:b();break;case 14:case 13:case 32:t(e,y);break;case 9:!function(e){if("tablist"===a()){var t=c(r.getEl("body"))[0];t&&t.focus()}else h(e.shiftKey?-1:1)}(e),e.preventDefault()}}),n.on("focusin",function(e){o=e.target,r=e.control}),{focusFirst:function(e){var t=d(e),n=c(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?f(t.lastAriaIndex,n):f(0,n)}}}var ht={},mt=ct.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new Je,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new Le(function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())}),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=v.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=ht[e]=ht[e]||new Ye(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,i,r=this;if(!e||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)}),t&&t.focus(),r;n.focusFirst(r)},replace:function(e,t){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===e){i[r]=t;break}0<=r&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,i=[];return w.isArray(e)||(e=[e]),w.each(e,function(e){e&&(e instanceof ct||("string"==typeof e&&(e={type:e}),t=w.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=v.create(t)),i.push(e))}),i},renderNew:function(){var i=this;return i.items().each(function(e,t){var n;e.parent(i),e.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&t<=n.childNodes.length-1?ke(n.childNodes[t]).before(e.renderHtml()):ke(n).append(e.renderHtml()),e.postRender(),it.add(e))}),i._layout.applyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var i,r,o;return e=this.create(e),i=this.items(),!n&&t<i.length-1&&(t+=1),0<=t&&t<i.length&&(r=i.slice(0,t).toArray(),o=i.slice(t).toArray(),i.set(r.concat(e,o))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var i={};return this.find("*").each(function(e){var t=e.name(),n=e.value();t&&void 0!==n&&(i[t]=n)}),i},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=ft({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(it.remove(this),this.visible()){for(ct.repaintControls=[],ct.repaintControls.map={},this.recalc(),e=ct.repaintControls.length;e--;)ct.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),ct.repaintControls=[]}return this}});function gt(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function pt(e,h){var m,g,t,p,v,b,y,x=h.document||document;h=h||{};var w=x.getElementById(h.handle||e);t=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=(t=x,u=Math.max,n=t.documentElement,i=t.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});gt(e),e.preventDefault(),g=e.button,c=w,b=e.screenX,y=e.screenY,d=window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=ke("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),ke(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(e)},v=function(e){if(gt(e),e.button!==g)return p(e);e.deltaX=e.screenX-b,e.deltaY=e.screenY-y,e.preventDefault(),h.drag(e)},p=function(e){gt(e),ke(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(e)},this.destroy=function(){ke(w).off()},ke(w).on("mousedown touchstart",t)}var vt,bt,yt,xt,wt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this;function n(){var m,g,e;function t(e,t,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+e)){if(f=t.toLowerCase(),h=n.toLowerCase(),ke(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void ke(a).css("display","none");ke(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+e+"t"),u=s["client"+n]-4,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+t]+2,d[h]=u,ke(a).css(d),(d={})[f]=s["scroll"+t]*c,d[h]=u*c,ke(l).css(d)}}e=p.getEl("body"),m=e.scrollWidth>e.clientWidth,g=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",m,"Height"),t("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function e(s,a,l,u,c){var d,e=p._id+"-scroll"+s,t=p.classPrefix;ke(p.getEl()).append('<div id="'+e+'" class="'+t+"scrollbar "+t+"scrollbar-"+s+'"><div id="'+e+'t" class="'+t+'scrollbar-thumb"></div></div>'),p.draghelper=new pt(e+"t",{start:function(){d=p.getEl("body")["scroll"+a],ke("#"+e).addClass(t+"active")},drag:function(e){var t,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-4,t=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+e["delta"+u]/t},stop:function(){ke("#"+e).removeClass(t+"active")}})}p.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height")}(),p.on("wheel",function(e){var t=p.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),ke(p.getEl("body")).on("scroll",n)),n())}},_t=mt.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[wt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}}),Rt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=He.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},Ct=[],kt=[];function Et(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function Ht(){vt||(vt=function(e){2!==e.button&&function(e){for(var t=Ct.length;t--;){var n=Ct[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(Et(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},ke(document).on("click touchstart",vt))}function St(r){var e=He.getViewPort().y;function t(e,t){for(var n,i=0;i<Ct.length;i++)if(Ct[i]!==r)for(n=Ct[i].parent();n&&(n=n.parent());)n===r&&Ct[i].fixed(e).moveBy(0,t).repaint()}r.settings.autofix&&(r.state.get("fixed")?r._autoFixY>e&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),t(!1,r._autoFixY-e)):(r._autoFixY=r.layoutRect().y,r._autoFixY<e&&(r.fixed(!0).layoutRect({y:0}).repaint(),t(!0,e-r._autoFixY))))}function Mt(e,t){var n,i,r=Tt.zIndex||65535;if(e)kt.push(t);else for(n=kt.length;n--;)kt[n]===t&&kt.splice(n,1);if(kt.length)for(n=0;n<kt.length;n++)kt[n].modal&&(r++,i=kt[n]),kt[n].getEl().style.zIndex=r,kt[n].zIndex=r,r++;var o=ke("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];i?ke(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),xt=!1),Tt.currentZIndex=r}var Tt=_t.extend({Mixins:[Ne,Rt],init:function(e){var i=this;i._super(e),(i._eventsRoot=i).classes.add("floatpanel"),e.autohide&&(Ht(),function(){if(!yt){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;yt=function(){document.all&&t===e.clientWidth&&n===e.clientHeight||(t=e.clientWidth,n=e.clientHeight,Tt.hideAll())},ke(window).on("resize",yt)}}(),Ct.push(i)),e.autofix&&(bt||(bt=function(){var e;for(e=Ct.length;e--;)St(Ct[e])},ke(window).on("scroll",bt)),i.on("move",function(){St(this)})),i.on("postrender show",function(e){if(e.control===i){var t,n=i.classPrefix;i.modal&&!xt&&((t=ke("#"+n+"modal-block",i.getContainerElm()))[0]||(t=ke('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),ke(i.getEl()).addClass(n+"in")}),xt=!0),Mt(!0,i)}}),i.on("show",function(){i.parents().each(function(e){if(e.state.get("fixed"))return i.fixed(!0),!1})}),e.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",e.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("rendered")){var n=He.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e,t=this._super();for(e=Ct.length;e--&&Ct[e]!==this;);return-1===e&&Ct.push(this),t},hide:function(){return Pt(this),Mt(!1,this),this._super()},hideAll:function(){Tt.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Mt(!1,this)),this},remove:function(){Pt(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Pt(e){var t;for(t=Ct.length;t--;)Ct[t]===e&&Ct.splice(t,1);for(t=kt.length;t--;)kt[t]===e&&kt.splice(t,1)}Tt.hideAll=function(){for(var e=Ct.length;e--;){var t=Ct[e];t&&t.settings.autohide&&(t.hide(),Ct.splice(e,1))}};var Wt=function(e,t){return!(!e||t.settings.ui_container)},Nt=function(s,e,t){var a,n,l=p.DOM,i=s.getParam("fixed_toolbar_container");i&&(n=l.select(i)[0]);var r=function(){if(a&&a.moveRel&&a.visible()&&!a._fixed){var e=s.selection.getScrollContainer(),t=s.getBody(),n=0,i=0;if(e){var r=l.getPos(t),o=l.getPos(e);n=Math.max(0,o.x-r.x),i=Math.max(0,o.y-r.y)}a.fixed(!1).moveRel(t,s.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(n,i)}},o=function(){a&&(a.show(),r(),l.addClass(s.getBody(),"mce-edit-focus"))},u=function(){a&&(a.hide(),Tt.hideAll(),l.removeClass(s.getBody(),"mce-edit-focus"))},c=function(){a?a.visible()||o():(a=e.panel=v.create({type:n?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:Wt(n,s),fixed:Wt(n,s),border:1,items:[!1===d(s)?null:{type:"menubar",border:"0 0 1 0",items:ce(s)},z(s,f(s))]}),A.setUiContainer(s,a),x(s),n?a.renderTo(n).reflow():a.renderTo().reflow(),_(s,a),o(),V(s),s.on("nodeChange",r),s.on("ResizeWindow",r),s.on("activate",o),s.on("deactivate",u),s.nodeChanged())};return s.settings.content_editable=!0,s.on("focus",function(){!1===m(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,c,c):c()}),s.on("blur hide",u),s.on("remove",function(){a&&(a.remove(),a=null)}),!1===m(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,we(s)):we(s)(),{}};function Dt(i,r){var o,s,a=this,l=ct.classPrefix;a.show=function(e,t){function n(){o&&(ke(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'),t&&t())}return a.hide(),o=!0,e?s=u.setTimeout(n,e):n(),a},a.hide=function(){var e=i.lastChild;return u.clearTimeout(s),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,a}}var At=function(e,t){var n;e.on("ProgressState",function(e){n=n||new Dt(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Bt=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):l.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),At(e,t),e.getParam("inline",!1,"boolean")?Nt(e,t,n):Ce(e,t,n)},Ot=ct.extend({Mixins:[Ne],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().lastChild.innerHTML=t.encode(e.value)}),t._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),zt=ct.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==zt.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);if(e.control===r){var n=t.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===n),t.classes.toggle("tooltip-nw","bc-tl"===n),t.classes.toggle("tooltip-ne","bc-tr"===n),t.moveRel(r.getEl(),n)}else t.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new Ot({type:"tooltip"}),A.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function i(e){t.aria("pressed",e),t.classes.toggle("active",e)}return t.state.on("change:disabled",function(e){n(e.value)}),t.state.on("change:active",function(e){i(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&i(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Lt=zt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var t=this;function n(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}return t.state.on("change:value",function(e){n(e.value)}),n(t.state.get("value")),t._super()}}),It=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},Ft=ct.extend({Mixins:[Ne],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||0<e.timeout)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Lt),t.on("click",function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e,t=this,n=t.classPrefix,i="",r="",o="";return t.icon&&(i='<i class="'+n+"ico "+n+"i-"+t.icon+'"></i>'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),t.progressBar&&(o=t.progressBar.renderHtml()),'<div id="'+t._id+'" class="'+t.classes+'"'+e+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+t.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),It(e,e.state.get("text"))},100),e._super()},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().firstChild.innerHTML=e.value,It(t,e.value)}),t.progressBar&&(t.progressBar.bindStates(),t.progressBar.state.on("change:value",function(e){It(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Ut(o){var s=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var n,i=w.extend(e,{maxWidth:(n=s(o),He.getSize(n).width)}),r=new Ft(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),t()},i.timeout)),r.on("close",function(){t()}),r.renderTo(),r},close:function(e){e.close()},reposition:function(e){var t;t=e,oe.each(t,function(e){e.moveTo(0,0)}),function(n){if(0<n.length){var e=n.slice(0,1)[0],t=s(o);e.moveRel(t,"tc-tc"),oe.each(n,function(e,t){0<t&&e.moveRel(n[t-1].getEl(),"bc-tc")})}}(e)},getArgs:function(e){return e.args}}}var Vt=[],jt="";function qt(e){var t,n=ke("meta[name=viewport]")[0];!1!==pe.overrideViewPort&&(n||((n=document.createElement("meta")).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(t=n.getAttribute("content"))&&void 0!==jt&&(jt=t),n.setAttribute("content",e?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":jt))}function Yt(e,t){(function(){for(var e=0;e<Vt.length;e++)if(Vt[e]._fullscreen)return!0;return!1})()&&!1===t&&ke([document.documentElement,document.body]).removeClass(e+"fullscreen")}var $t=Tt.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),e.buttons&&(n.statusbar=new _t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(e){var t=n.classPrefix+"close";(He.hasClass(e.target,t)||He.hasClass(e.target.parentNode,t))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(e){e.control===n&&Tt.hideAll()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e,t,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(He.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),e=r.layoutRect(),r.settings.title&&!r._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),r.layoutRect({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=He.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=He.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+e.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(e){var n,t,i=this,r=document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(ke(window).on("resize",function(){var e;if(i._fullscreen)if(n)i._timer||(i._timer=u.setTimeout(function(){var e=He.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var t=He.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)}}),t=i.layoutRect(),i._fullscreen=e){i._initial={x:t.x,y:t.y,w:t.w,h:t.h},i.borderBox=Be("0"),i.getEl("head").style.display="none",t.deltaH-=t.headerH+2,ke([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=He.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Be(i.settings.border),i.getEl("head").style.display="",t.deltaH+=t.headerH,ke([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var t,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new pt(n._id+"-dragh",{start:function(){t={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(e){n.moveTo(t.x+e.deltaX,t.y+e.deltaY)}}),n.on("submit",function(e){e.isDefaultPrevented()||n.close()}),Vt.push(n),qt(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),Yt(t.classPrefix,!1),e=Vt.length;e--;)Vt[e]===t&&Vt.splice(e,1);qt(0<Vt.length)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!pe.desktop){var n={w:window.innerWidth,h:window.innerHeight};u.setInterval(function(){var e=window.innerWidth,t=window.innerHeight;n.w===e&&n.h===t||(n={w:e,h:t},ke(window).trigger("resize"))},100)}ke(window).on("resize",function(){var e,t,n=He.getWindowSize();for(e=0;e<Vt.length;e++)t=Vt[e].layoutRect(),Vt[e].moveTo(Vt[e].settings.x||Math.max(0,n.w/2-t.w/2),Vt[e].settings.y||Math.max(0,n.h/2-t.h/2))})}();var Xt,Jt=$t.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(e){var t,i=e.callback||function(){};function n(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),i(t)}}}switch(e.buttons){case Jt.OK_CANCEL:t=[n("Ok",!0,!0),n("Cancel",!1)];break;case Jt.YES_NO:case Jt.YES_NO_CANCEL:t=[n("Yes",1,!0),n("No",0)],e.buttons===Jt.YES_NO_CANCEL&&t.push(n("Cancel",-1));break;default:t=[n("Ok",!0,!0)]}return new $t({padding:20,x:e.x,y:e.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:t,title:e.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:e.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:e.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,Jt.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=Jt.OK_CANCEL,Jt.msgBox(e)}}}),Gt=function(n){return{renderUI:function(e){return Bt(n,this,e)},resizeTo:function(e,t){return me(n,e,t)},resizeBy:function(e,t){return ge(n,e,t)},getNotificationManagerImpl:function(){return Ut(n)},getWindowManagerImpl:function(){return{open:function(n,e,t){var i;return n.title=n.title||" ",n.url=n.url||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new $t(n)).on("close",function(){t(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(e){var t=e.name();t in n.data&&e.value(n.data[t])})}),i.features=n||{},i.params=e||{},i=i.renderTo(document.body).reflow()},alert:function(e,t,n){var i;return(i=Jt.alert(e,function(){t()})).on("close",function(){n(i)}),i},confirm:function(e,t,n){var i;return(i=Jt.confirm(e,function(e){t(e)})).on("close",function(){n(i)}),i},close:function(e){e.close()},getParams:function(e){return e.params},setParams:function(e,t){e.params=t}}}}},Kt=De.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=w.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,i,r,o=this.settings;t=o.firstControlClass,n=o.lastControlClass,e.each(function(e){e.classes.remove(t).remove(n).add(o.controlClass),e.visible()&&(i||(i=e),r=e)}),i&&i.classes.add(t),r&&r.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each(function(e){t+=e.renderHtml()}),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),Zt=Kt.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),Qt=zt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+t+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(e){var t=n("span."+i,o.getEl());e?(t[0]||(n("button:first",o.getEl()).append('<span class="'+i+'"></span>'),t=n("span."+i,o.getEl())),t.html(o.encode(e))):t.remove(),o.classes.toggle("btn-has-text",!!e)}return o.state.on("change:text",function(e){s(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),en=Qt.extend({init:function(e){e=w.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,t=He.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),ke(t).on("change",function(e){var t=e.target.files;n.value=function(){return t.length?n.settings.multiple?t:t[0]:null},e.preventDefault(),t.length&&n.fire("change",e)}),ke(t).on("click",function(e){e.stopPropagation()}),ke(n.getEl("button")).on("click",function(e){e.stopPropagation(),t.click()}),n.getEl().appendChild(t)},remove:function(){ke(this.getEl("button")).off(),ke(this.getEl("input")).off(),this._super()}}),tn=mt.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),nn=zt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){var o=this;function t(e){o.classes.toggle("checked",e),o.aria("checked",e)}return o.state.on("change:text",function(e){o.getEl("al").firstChild.data=o.translate(e.value)}),o.state.on("change:checked change:value",function(e){o.fire("change"),t(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;if(void 0===t)return o.settings.icon;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r)}),o.state.get("checked")&&t(!0),o._super()}}),rn=tinymce.util.Tools.resolve("tinymce.util.VK"),on=zt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(e){var t=e.target,n=r.getEl();if(ke.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),e.aria&&r.menu.items()[0].focus())),t=t.parentNode}),r.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),r.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),r.fire("submit",{data:t.toJSON()}))}),r.on("keyup",function(e){if("INPUT"===e.target.nodeName){var t=r.state.get("value"),n=e.target.value;n!==t&&(r.state.set("value",n),r.fire("autocomplete",e))}}),r.on("mouseover",function(e){var t=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==e.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=t.text(n).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===i),t.classes.toggle("tooltip-nw","bc-tl"===i),t.classes.toggle("tooltip-ne","bc-tr"===i),t.moveRel(e.target,i)}})},statusLevel:function(e){return 0<arguments.length&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return 0<arguments.length&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=v.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control===t.menu&&t.focus()}),t.menu.on("show hide",function(e){e.control.items().each(function(e){e.active(e.value()===t.value())})}).fire("show"),t.menu.on("select",function(e){t.value(e.control.value())}),t.on("focusin",function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()}),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e,t,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(He.getRuntimeStyle(a,"padding-right"),10)-parseInt(He.getRuntimeStyle(a,"padding-left"),10)),e=r?o.w-He.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(t=n.layoutRect().h-2+"px"),ke(a).css({width:e-s,lineHeight:t}),n._super(),n},postRender:function(){var t=this;return ke(this.getEl("inp")).on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)}),t._super()},renderHtml:function(){var e,t,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=s+"ico "+s+"i-"+o.icon),t=i.state.get("text"),(e||t)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+s+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,i){var r=this;if(0!==e.length){r.menu?r.menu.items().remove():r.menu=v.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),w.each(e,function(e){var t,n;r.menu.add({text:e.title,url:e.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(t=e.value,n=e.title,function(){r.fire("selectitem",{title:n,value:t})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(e){e.control.parent()===r.menu&&(e.stopPropagation(),r.focus(),r.hideMenu())}),r.menu.on("select",function(){r.focus()});var t=r.layoutRect().w;r.menu.layoutRect({w:t,minW:0,maxW:t}),r.menu.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(e){r.getEl("inp").value!==e.value&&(r.getEl("inp").value=e.value)}),r.state.on("change:disabled",function(e){r.getEl("inp").disabled=e.value}),r.state.on("change:statusLevel",function(e){var t=r.getEl("status"),n=r.classPrefix,i=e.value;He.css(t,"display","none"===i?"none":""),He.toggleClass(t,n+"i-checkmark","ok"===i),He.toggleClass(t,n+"i-warning","warn"===i),He.toggleClass(t,n+"i-error","error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),He.on(r.getEl("status"),"mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(e){r.menu&&r.menu.visible()&&(e.stopPropagation(),r.hideMenu())});var n=function(e,t){t&&0<t.items().length&&t.items().eq(e)[0].focus()};return r.on("keydown",function(e){var t=e.keyCode;"INPUT"===e.target.nodeName&&(t===rn.DOWN?(e.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):t===rn.UP&&(e.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){ke(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),sn=on.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(i){}},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.state.get("rendered")&&t.repaintColor(e.value)}),t._super()}}),an=Qt.extend({showPanel:function(){var t=this,e=t.settings;if(t.classes.add("opened"),t.panel)t.panel.show();else{var n=e.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,t.panel=new Tt(n).on("hide",function(){t.classes.remove("opened")}).on("cancel",function(e){e.stopPropagation(),t.focus(),t.hidePanel()}).parent(t).renderTo(t.getContainerElm()),t.panel.fire("show"),t.panel.reflow()}var i=t.panel.testMoveRel(t.getEl(),e.popoverAlign||(t.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));t.panel.classes.toggle("start","l"===i.substr(-1)),t.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);t.panel.classes.toggle("bottom",!r),t.panel.classes.toggle("top",r),t.panel.moveRel(t.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var t=this;return t.aria("haspopup",!0),t.on("click",function(e){e.control===t&&(t.panel&&t.panel.visible()?t.hidePanel():(t.showPanel(),t.panel.focus(!!e.aria)))}),t._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),ln=p.DOM,un=an.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,i=e.state.get("text"),r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",s="";return i&&(e.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+e.encode(i)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var t=this,n=t.settings.onclick;return t.on("click",function(e){e.aria&&"down"===e.aria.key||e.control!==t||ln.getParent(e.target,"."+t.classPrefix+"open")||(e.stopImmediatePropagation(),n.call(t,e))}),delete t.settings.onclick,t._super()}}),cn=tinymce.util.Tools.resolve("tinymce.util.Color"),dn=zt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(e,t){var n,i,r=He.getPos(e);return n=t.pageX-r.x,i=t.pageY-r.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:i=Math.max(0,Math.min(i/e.clientHeight,1))}}function c(e,t){var n=(360-e.h)/360;He.css(r,{top:100*n+"%"}),t||He.css(s,{left:e.s+"%",top:100-e.v+"%"}),o.style.background=cn({s:100,v:100,h:e.h}).toHex(),a.color().parse({s:e.s,v:e.v,h:e.h})}function e(e){var t;t=u(o,e),n.s=100*t.x,n.v=100*(1-t.y),c(n),a.fire("change")}function t(e){var t;t=u(i,e),(n=l.toHsv()).h=360*(1-t.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new pt(a._id+"-sv",{start:e,drag:e}),a._hdraghelper=new pt(a._id+"-h",{start:t,drag:t}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){if(!arguments.length)return this.color().toHex();this.color().parse(e),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=cn()),this._color},renderHtml:function(){var e,t=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+o+'colorpicker-h" style="background: -ms-linear-gradient(top,#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000);background: linear-gradient(to bottom,#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000);">'+function(){var e,t,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",e=0,t=(i=s.split(",")).length-1;e<t;e++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100/t+"%;"+n+i[e]+",endColorstr="+i[e+1]+");-ms-"+n+i[e]+",endColorstr="+i[e+1]+')"></div>';return r}()+'<div id="'+t+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),fn=zt.extend({init:function(e){e=w.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=He.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&He.css(t,"height",n.height+"px"),n.width&&He.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var i=this,e=function(e){e.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(e){e.preventDefault()}),i.$el.on("dragenter",e),i.$el.on("dragleave",e),i.$el.on("drop",function(e){if(e.preventDefault(),!i.state.get("disabled")){var t=function(e){var t=i.settings.accept;if("string"!=typeof t)return e;var n=new RegExp("("+t.split(/\s*,\s*/).join("|")+")$","i");return w.grep(e,function(e){return n.test(e.name)})}(e.dataTransfer.files);i.value=function(){return t.length?i.settings.multiple?t:t[0]:null},t.length&&i.fire("change",e)}})},remove:function(){this.$el.off(),this._super()}}),hn=zt.extend({init:function(e){var n=this;e.delimiter||(e.delimiter="\xbb"),n._super(e),n.classes.add("path"),n.canFocus=!0,n.on("click",function(e){var t;(t=e.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[t],index:t})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtml:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t<n;t++)r+=(0<t?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(t===n-1?" "+o+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+i[t].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),mn=hn.extend({postRender:function(){var o=this,s=o.settings.editor;function a(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(e){s.focus(),s.selection.select(this.row()[e.index].element),s.nodeChanged()}),s.on("nodeChange",function(e){for(var t=[],n=e.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||t.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(t)})),o._super()}}),gn=mt.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),pn=mt.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,e=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t,n=e.settings.label;n&&((t=new gn(w.extend({items:{type:"label",id:e._id+"-l",text:n,flex:0,forId:e._id,disabled:e.disabled()}},i.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),"undefined"==typeof e.settings.flex&&(e.settings.flex=1),i.replace(e,t),t.add(e))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function e(){var e,t,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=i<n?n:i,r.push(t)}),t=n.settings.labelGap||0,e=r.length;e--;)r[e].settings.minWidth=i+t}n._super(),n.on("show",e),e()}}),vn=pn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}}),bn=0,yn=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++bn+String(t)},xn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:H.constant(e)}},wn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return xn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return xn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return xn(n)},fromDom:xn,fromPoint:function(e,t,n){return N.from(e.dom().elementFromPoint(t,n)).map(xn)}},_n=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(null,arguments)),t}},Rn=9,Cn=1,kn=3,En=function(e){return e.dom().nodeType},Hn=function(t){return function(e){return En(e)===t}},Sn=(Hn(Cn),Hn(kn),Hn(Rn),_n(function(){return Sn(wn.fromDom(document))}),function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return wn.fromDom(t)}),Mn=(Xt=Object.keys)===undefined?function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}:Xt,Tn=function(e,t){for(var n=Mn(e),i=0,r=n.length;i<r;i++){var o=n[i];t(e[o],o,e)}},Pn=function(i,r){var o={};return Tn(i,function(e,t){var n=r(e,t,i);o[n.k]=n.v}),o},Wn=function(e,n){var i=[];return Tn(e,function(e,t){i.push(n(e,t))}),i},Nn=function(e){return Wn(e,function(e){return e})},Dn={bifilter:function(e,n){var i={},r={};return Tn(e,function(e,t){(n(e,t)?i:r)[t]=e}),{t:i,f:r}},each:Tn,map:function(e,i){return Pn(e,function(e,t,n){return{k:t,v:i(e,t,n)}})},mapToArray:Wn,tupleMap:Pn,find:function(e,t){for(var n=Mn(e),i=0,r=n.length;i<r;i++){var o=n[i],s=e[o];if(t(s,o,e))return N.some(s)}return N.none()},keys:Mn,values:Nn,size:function(e){return Nn(e).length}},An=function(e){return e.slice(0).sort()},Bn=function(e,t){throw new Error("All required keys ("+An(e).join(", ")+") were not specified. Specified keys were: "+An(t).join(", ")+".")},On=function(e){throw new Error("Unsupported keys for object: "+An(e).join(", "))},zn=function(t,e){if(!q.isArray(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");oe.each(e,function(e){if(!q.isString(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},Ln=function(e){var n=An(e);oe.find(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},In={immutable: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 i={};return oe.each(t,function(e,t){i[e]=H.constant(n[t])}),i}},immutableBag:function(r,o){var s=r.concat(o);if(0===s.length)throw new Error("You must specify at least one required or optional field.");return zn("required",r),zn("optional",o),Ln(s),function(t){var n=Dn.keys(t);oe.forall(r,function(e){return oe.contains(n,e)})||Bn(r,n);var e=oe.filter(n,function(e){return!oe.contains(s,e)});0<e.length&&On(e);var i={};return oe.each(r,function(e){i[e]=H.constant(t[e])}),oe.each(o,function(e){i[e]=H.constant(Object.prototype.hasOwnProperty.call(t,e)?N.some(t[e]):N.none())}),i}}},Fn=("undefined"!=typeof window?window:Function("return this;")(),function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.test(t))return i}return undefined}(e,t);if(!n)return{major:0,minor:0};var i=function(e){return Number(t.replace(n,"$"+e))};return Vn(i(1),i(2))}),Un=function(){return Vn(0,0)},Vn=function(e,t){return{major:e,minor:t}},jn={nu:Vn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Un():Fn(e,n)},unknown:Un},qn="Firefox",Yn=function(e,t){return function(){return t===e}},$n=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Yn("Edge",t),isChrome:Yn("Chrome",t),isIE:Yn("IE",t),isOpera:Yn("Opera",t),isFirefox:Yn(qn,t),isSafari:Yn("Safari",t)}},Xn={unknown:function(){return $n({current:undefined,version:jn.unknown()})},nu:$n,edge:H.constant("Edge"),chrome:H.constant("Chrome"),ie:H.constant("IE"),opera:H.constant("Opera"),firefox:H.constant(qn),safari:H.constant("Safari")},Jn="Windows",Gn="Android",Kn="Solaris",Zn="FreeBSD",Qn=function(e,t){return function(){return t===e}},ei=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Qn(Jn,t),isiOS:Qn("iOS",t),isAndroid:Qn(Gn,t),isOSX:Qn("OSX",t),isLinux:Qn("Linux",t),isSolaris:Qn(Kn,t),isFreeBSD:Qn(Zn,t)}},ti={unknown:function(){return ei({current:undefined,version:jn.unknown()})},nu:ei,windows:H.constant(Jn),ios:H.constant("iOS"),android:H.constant(Gn),linux:H.constant("Linux"),osx:H.constant("OSX"),solaris:H.constant(Kn),freebsd:H.constant(Zn)},ni=function(e,t){var n=String(t).toLowerCase();return oe.find(e,function(e){return e.search(n)})},ii=function(e,n){return ni(e,n).map(function(e){var t=jn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},ri=function(e,n){return ni(e,n).map(function(e){var t=jn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},oi=function(e,t){return-1!==e.indexOf(t)},si=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ai=function(t){return function(e){return oi(e,t)}},li=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return oi(e,"edge/")&&oi(e,"chrome")&&oi(e,"safari")&&oi(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,si],search:function(e){return oi(e,"chrome")&&!oi(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return oi(e,"msie")||oi(e,"trident")}},{name:"Opera",versionRegexes:[si,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ai("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ai("firefox")},{name:"Safari",versionRegexes:[si,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(oi(e,"safari")||oi(e,"mobile/"))&&oi(e,"applewebkit")}}],ui=[{name:"Windows",search:ai("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return oi(e,"iphone")||oi(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ai("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ai("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ai("linux"),versionRegexes:[]},{name:"Solaris",search:ai("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ai("freebsd"),versionRegexes:[]}],ci={browsers:H.constant(li),oses:H.constant(ui)},di=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=ci.browsers(),h=ci.oses(),m=ii(f,e).fold(Xn.unknown,Xn.nu),g=ri(h,e).fold(ti.unknown,ti.nu);return{browser:m,os:g,deviceType:(n=m,i=e,r=(t=g).isiOS()&&!0===/ipad/i.test(i),o=t.isiOS()&&!r,s=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=t.isiOS()||t.isAndroid(),c=u&&!l,d=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(i),{isiPad:H.constant(r),isiPhone:H.constant(o),isTablet:H.constant(l),isPhone:H.constant(c),isTouch:H.constant(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:H.constant(d)})}},fi=_n(function(){var e=navigator.userAgent;return di(e)}),hi=Cn,mi=Rn,gi=function(e){return e.nodeType!==hi&&e.nodeType!==mi||0===e.childElementCount},pi={all:function(e,t){var n=t===undefined?document:t.dom();return gi(n)?[]:oe.map(n.querySelectorAll(e),wn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==hi)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return gi(n)?N.none():N.from(n.querySelector(e)).map(wn.fromDom)}},vi=(fi().browser.isIE(),In.immutable("element","offset"),function(e,t){return pi.all(t,e)}),bi=w.trim,yi=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},xi=yi("true"),wi=yi("false"),_i=function(e,t,n,i,r){return{type:e,title:t,url:n,level:i,attach:r}},Ri=function(e){return e.innerText||e.textContent},Ci=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&Ei(e);var t},ki=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},Ei=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return xi(e)}return!1}(e)&&!wi(e)},Hi=function(e){return ki(e)&&Ei(e)},Si=function(e){var t,n,i=(t=e).id?t.id:yn("h");return _i("header",Ri(e),"#"+i,ki(n=e)?parseInt(n.nodeName.substr(1),10):0,function(){e.id=i})},Mi=function(e){var t=e.id||e.name,n=Ri(e);return _i("anchor",n||"#"+t,"#"+t,0,H.noop)},Ti=function(e){var t,n;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,oe.map(vi(wn.fromDom(n),t),function(e){return e.dom()})},Pi=function(e){return 0<bi(e.title).length},Wi=function(e){var t,n,i=Ti(e);return oe.filter((n=i,oe.map(oe.filter(n,Hi),Si)).concat((t=i,oe.map(oe.filter(t,Ci),Mi))),Pi)},Ni={},Di=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},Ai=function(e,t){return{title:e,value:{title:e,url:t,attach:H.noop}}},Bi=function(e,t,n){var i=t in e?e[t]:n;return!1===i?null:i},Oi=function(e,i,r,t){var n,o,s,a,l={title:"-"},u=function(e){var t=e.hasOwnProperty(r)?e[r]:[],n=oe.filter(t,function(e){return t=e,n=i,!oe.exists(n,function(e){return e.url===t});var t,n});return w.map(n,function(e){return{title:e,value:{title:e,url:e,attach:H.noop}}})},c=function(t){var e,n=oe.filter(i,function(e){return e.type===t});return e=n,w.map(e,Di)};return!1===t.typeahead_urls?[]:"file"===r?(n=[zi(e,u(Ni)),zi(e,c("header")),zi(e,(o=c("anchor"),s=Bi(t,"anchor_top","#top"),a=Bi(t,"anchor_bottom","#bottom"),null!==s&&o.unshift(Ai("<top>",s)),null!==a&&o.push(Ai("<bottom>",a)),o))],oe.foldl(n,function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(l,t)},[])):zi(e,u(Ni))},zi=function(e,t){var n=e.toLowerCase(),i=w.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},Li=function(r,i,o,s){var t=function(e){var t=Wi(o),n=Oi(e,t,s,i);r.showAutoComplete(n,e)};r.on("autocomplete",function(){t(r.value())}),r.on("selectitem",function(e){var t=e.value;r.value(t.url);var n,i=(n=t.title).raw?n.raw:n;"image"===s?r.fire("change",{meta:{alt:i,attach:t.attach}}):r.fire("change",{meta:{text:i,attach:t.attach}}),r.focus()}),r.on("click",function(e){0===r.value().length&&"INPUT"===e.target.nodeName&&t("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(e){var t,n,i;e.isDefaultPrevented()||(t=r.value(),i=Ni[n=s],/^https?/.test(t)&&(i?oe.indexOf(i,t).isNone()&&(Ni[n]=i.slice(0,5).concat(t)):Ni[n]=[t]))})})},Ii=function(o,e,n){var i=e.filepicker_validator_handler;i&&o.state.on("change:value",function(e){var t;0!==(t=e.value).length?i({url:t,type:n},function(e){var t,n,i,r=(n=(t=e).status,i=t.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},Fi=on.extend({Statics:{clearHistory:function(){Ni={}}},init:function(e){var t,n,i,r=this,o=window.tinymce?window.tinymce.activeEditor:l.activeEditor,s=o.settings,a=e.filetype;e.spellcheck=!1,(i=s.file_picker_types||s.file_browser_callback_types)&&(i=w.makeMap(i,/[, ]/)),i&&!i[a]||(!(n=s.file_picker_callback)||i&&!i[a]?!(n=s.file_browser_callback)||i&&!i[a]||(t=function(){n(r.getEl("inp").id,r.value(),a,window)}):t=function(){var e=r.fire("beforecall").meta;e=w.extend({filetype:a},e),n.call(o,function(e,t){r.value(e).fire("change",{meta:t})},r.value(),e)}),t&&(e.icon="browse",e.onaction=t),r._super(e),r.classes.add("filepicker"),Li(r,s,o.getBody(),a),Ii(r,s,a)}}),Ui=Zt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),Vi=Zt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,k,E,H,S,M,T,P,W,N,D,A,B,O,z=[],L=Math.max,I=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(C="y",_="h",R="minH",k="maxH",H="innerH",E="top",S="deltaH",M="contentH",D="left",W="w",T="x",P="innerW",N="minW",A="right",B="deltaW",O="contentW"):(C="x",_="w",R="minW",k="maxW",H="innerW",E="left",S="deltaW",M="contentW",D="top",W="h",T="y",P="innerH",N="minH",A="bottom",B="deltaH",O="contentH"),d=r[H]-o[E]-o[E],w=c=0,t=0,n=i.length;t<n;t++)m=(h=i[t]).layoutRect(),d-=t<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[k]&&z.push(h),m.flex=g),d-=m[R],w<(p=o[D]+m[N]+o[A])&&(w=p);if((y={})[R]=d<0?r[R]-d+r[S]:r[H]-d+r[S],y[N]=w+r[B],y[M]=r[H]-d,y[O]=w,y.minW=I(y.minW,r.maxW),y.minH=I(y.minH,r.maxH),y.minW=L(y.minW,r.startMinWidth),y.minH=L(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,t=0,n=z.length;t<n;t++)(v=(m=(h=z[t]).layoutRect())[k])<(p=m[R]+m.flex*b)?(d-=m[k]-m[R],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[E],y={},0===c&&("end"===l?x=d+o[E]:"center"===l?(x=Math.round(r[H]/2-(r[H]-d)/2)+o[E])<0&&(x=o[E]):"justify"===l&&(x=o[E],u=Math.floor(d/(i.length-1)))),y[T]=o[D],t=0,n=i.length;t<n;t++)p=(m=(h=i[t]).layoutRect()).maxFlexSize||m[R],"center"===a?y[T]=Math.round(r[P]/2-m[W]/2):"stretch"===a?(y[W]=L(m[N]||0,r[P]-o[D]-o[A]),y[T]=o[D]):"end"===a&&(y[T]=r[P]-m[W]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[C]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var F=e.parent();F&&(F._lastRect=null,F.recalc())}}}),ji=Kt.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}}),qi=function(e,t){return pi.one(t,e)},Yi=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},$i=function(e,t,n){var i=function(e){n(e,t)};e.formatter?e.formatter.formatChanged(t,i):e.on("init",function(){e.formatter.formatChanged(t,i)})},Xi=function(e,n){return function(t){$i(e,n,function(e){t.control.active(e)})}},Ji=function(i){var t=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft",e=[{text:"Left",icon:"alignleft",onclick:Yi(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:Yi(i,"aligncenter")},{text:"Right",icon:"alignright",onclick:Yi(i,"alignright")},{text:"Justify",icon:"alignjustify",onclick:Yi(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:e}),i.addButton("align",{type:"menubutton",icon:r,menu:e,onShowMenu:function(e){var n=e.control.menu;w.each(t,function(t,e){n.items().eq(e).each(function(e){return e.active(i.formatter.match(t))})})},onPostRender:function(e){var n=e.control;w.each(t,function(t,e){$i(i,t,function(e){n.icon(r),e&&n.icon(t)})})}}),w.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(e,t){i.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Xi(i,t)})})},Gi=function(e){return e?e.split(",")[0]:""},Ki=function(l,u){return function(){var a=this;l.on("init nodeChange",function(e){var t,n,i,r,o=l.queryCommandValue("FontName"),s=(t=u,r=(n=o)?n.toLowerCase():"",w.each(t,function(e){e.value.toLowerCase()===r&&(i=e.value)}),w.each(t,function(e){i||Gi(e.value).toLowerCase()!==Gi(r).toLowerCase()||(i=e.value)}),i);a.value(s||null),!s&&o&&a.text(Gi(o))})}},Zi=function(n){n.addButton("fontselect",function(){var e,t=(e=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(n.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),w.map(e,function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:Ki(n,t),onselect:function(e){e.control.settings.value&&n.execCommand("FontName",!1,e.control.settings.value)}}})},Qi=function(e){Zi(e)},er=function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,i=t||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):e;var n,i,r},tr=function(e,t,n){var i;return w.each(e,function(e){e.value===n?i=n:e.value===t&&(i=t)}),i},nr=function(n){n.addButton("fontsizeselect",function(){var e,s,a,t=(e=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",w.map(e.split(" "),function(e){var t=e,n=e,i=e.split("=");return 1<i.length&&(t=i[0],n=i[1]),{text:t,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:(s=n,a=t,function(){var o=this;s.on("init nodeChange",function(e){var t,n,i,r;if(t=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=er(t,i),r=tr(a,n,t);o.value(r||null),r||o.text(n)})}),onclick:function(e){e.control.settings.value&&n.execCommand("FontSize",!1,e.control.settings.value)}}})},ir=function(e){nr(e)},rr=function(n,e){var i=e.length;return w.each(e,function(e){e.menu&&(e.hidden=0===rr(n,e.menu));var t=e.format;t&&(e.hidden=!n.formatter.canApply(t)),e.hidden&&i--}),i},or=function(n,e){var i=e.items().length;return e.items().each(function(e){e.menu&&e.visible(0<or(n,e.menu)),!e.menu&&e.settings.menu&&e.visible(0<rr(n,e.settings.menu));var t=e.settings.format;t&&e.visible(n.formatter.canApply(t)),e.visible()||i--}),i},sr=function(e){var i,r,o,t,s,n,a,l,u=(r=0,o=[],t=[{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"}]}],s=function(e){var i=[];if(e)return w.each(e,function(e){var t={text:e.title,icon:e.icon};if(e.items)t.menu=s(e.items);else{var n=e.format||"custom"+r++;e.format||(e.name=n,o.push(e)),t.format=n,t.cmd=e.cmd}i.push(t)}),i},(i=e).on("init",function(){w.each(o,function(e){i.formatter.register(e.name,e)})}),{type:"menu",items:i.settings.style_formats_merge?i.settings.style_formats?s(t.concat(i.settings.style_formats)):s(t):s(i.settings.style_formats||t),onPostRender:function(e){i.fire("renderFormatsMenu",{control:e.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var e,t;(e=n.settings.format)&&(n.disabled(!i.formatter.canApply(e)),n.active(i.formatter.match(e))),(t=n.settings.cmd)&&n.active(i.queryCommandState(t))})},onclick:function(){this.settings.format&&Yi(i,this.settings.format)(),this.settings.cmd&&i.execCommand(this.settings.cmd)}}});n=u,e.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=e).addButton("styleselect",{type:"menubutton",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&or(a,this.menu)}})},ar=function(n,e){return function(){var r,o,s,t=[];return w.each(e,function(e){t.push({text:e[0],value:e[1],textStyle:function(){return n.formatter.getCssText(e[1])}})}),{type:"listbox",text:e[0][0],values:t,fixedWidth:!0,onselect:function(e){if(e.control){var t=e.control.value();Yi(n,t)()}},onPostRender:(r=n,o=t,function(){var t=this;r.on("nodeChange",function(e){var n=r.formatter,i=null;w.each(e.parents,function(t){if(w.each(o,function(e){if(s?n.matchNode(t,s,{value:e.value})&&(i=e.value):n.matchNode(t,e.value)&&(i=e.value),i)return!1}),i)return!1}),t.value(i)})})}}},lr=function(e){var t,n,i=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:(t=e,n=i,w.map(n,function(e){return{text:e[0],onclick:Yi(t,e[1]),textStyle:function(){return t.formatter.getCssText(e[1])}}}))}),e.addButton("formatselect",ar(e,i))},ur=function(t,e){var n,i;if("string"==typeof e)i=e.split(" ");else if(w.isArray(e))return oe.flatten(w.map(e,function(e){return ur(t,e)}));return n=w.grep(i,function(e){return"|"===e||e in t.menuItems}),w.map(n,function(e){return"|"===e?{text:"-"}:t.menuItems[e]})},cr=function(e){return e&&"-"===e.text},dr=function(e){var t=oe.filter(e,function(e,t,n){return!cr(e)||!cr(n[t-1])});return oe.filter(t,function(e,t,n){return!cr(e)||0<t&&t<n.length-1})},fr=function(e){var t,n,i,r,o=e.settings.insert_button_items;return dr(o?ur(e,o):(t=e,n="insert",i=[{text:"-"}],r=w.grep(t.menuItems,function(e){return e.context===n}),w.each(r,function(e){"before"===e.separator&&i.push({text:"|"}),e.prependToContext?i.unshift(e):i.push(e),"after"===e.separator&&i.push({text:"|"})}),i))},hr=function(e){var t;(t=e).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(fr(t)),this.menu.renderNew()}})},mr=function(e){var n,i,r;n=e,w.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,t){n.addButton(t,{active:!1,tooltip:e,onPostRender:Xi(n,t),onclick:Yi(n,t)})}),i=e,w.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(e,t){i.addButton(t,{tooltip:e[0],cmd:e[1]})}),r=e,w.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(e,t){r.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Xi(r,t)})})},gr=function(e){var n;mr(e),n=e,w.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(e,t){n.addMenuItem(t,{text:e[0],icon:t,shortcut:e[2],cmd:e[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:Yi(n,"code")})},pr=function(n,i){return function(){var e=this,t=function(){var e="redo"===i?"hasRedo":"hasUndo";return!!n.undoManager&&n.undoManager[e]()};e.disabled(!t()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){e.disabled(n.readonly||!t())})}},vr=function(e){var t,n;(t=e).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:pr(t,"undo"),cmd:"undo"}),t.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:pr(t,"redo"),cmd:"redo"}),(n=e).addButton("undo",{tooltip:"Undo",onPostRender:pr(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:pr(n,"redo"),cmd:"redo"})},br=function(e){var t,n;(t=e).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=t,function(){var t=this;n.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},yr={setup:function(e){var t;e.rtl&&(ct.rtl=!0),e.on("mousedown",function(){Tt.hideAll()}),(t=e).settings.ui_container&&(pe.container=qi(wn.fromDom(document.body),t.settings.ui_container).fold(H.constant(null),function(e){return e.dom()})),zt.tooltips=!pe.iOS,ct.translate=function(e){return l.translate(e)},lr(e),Ji(e),gr(e),vr(e),ir(e),Qi(e),sr(e),br(e),hr(e)}},xr=Zt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,k,E,H,S,M=[],T=[];t=e.settings,r=e.items().filter(":visible"),o=e.layoutRect(),i=t.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,x=t.alignH||t.align,w=t.alignV||t.align,p=e.paddingBox,S="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)M.push(0);for(f=0;f<n;f++)T.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)C=(u=c.layoutRect()).minW,k=u.minH,M[d]=C>M[d]?C:M[d],T[f]=k>T[f]?k:T[f];for(E=o.innerW-p.left-p.right,d=_=0;d<i;d++)_+=M[d]+(0<d?b:0),E-=(0<d?b:0)+M[d];for(H=o.innerH-p.top-p.bottom,f=R=0;f<n;f++)R+=T[f]+(0<f?y:0),H-=(0<f?y:0)+T[f];if(_+=p.left+p.right,R+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=R+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var P;o.autoResize&&((l=e.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),P="start"===t.packV?0:0<H?Math.floor(H/n):0;var W=0,N=t.flexWidths;if(N)for(d=0;d<N.length;d++)W+=N[d];else W=i;var D=E/W;for(d=0;d<i;d++)M[d]+=N?N[d]*D:D;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=T[f]+P,d=0;d<i&&(c=r[S?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(M[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var A=e.parent();A&&(A._lastRect=null,A.recalc())}}}),wr=zt.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),_r=zt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl("body").firstChild.data=t.encode(e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t.state.on("change:help",function(e){t.classes.toggle("has-help",e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),Rr=zt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(He.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,He.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.innerHtml(t.encode(e.value)),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),Cr=mt.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("toolbar-item")}),this._super()}}),kr=Cr.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),Er=Qt.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=v.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(e){e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e,t=this,n=t._id,i=t.classPrefix,r=t.settings.icon,o=t.state.get("text"),s="";return(e=t.settings.image)?(r="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o&&(t.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+t.encode(o)+"</span>"),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof kr?"menuitem":"button"),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+e+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(e.target,r.getEl())&&(r.focus(),r.showMenu(!e.aria),e.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(e){var t,n=e.control,i=r.parent();n&&i&&n instanceof Er&&n.parent()===i&&(i.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==n&&(e.menu&&e.menu.visible()&&(t=!0),e.hideMenu())}),t&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),Hr=Tt.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=w.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==pe.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var t,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Dt(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0!==e.length?n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(e){var t=e.settings;if(t.icon||t.image||t.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(e){e.control===n&&("show"===e.type?u.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),Sr=Er.extend({init:function(i){var t,r,o,n,s=this;s._super(i),i=s.settings,s._values=t=i.values,t&&("undefined"!=typeof i.value&&function e(t){for(var n=0;n<t.length;n++){if(r=t[n].selected||i.value===t[n].value)return o=o||t[n].text,s.state.set("value",t[n].value),!0;if(t[n].menu&&e(t[n].menu))return!0}}(t),!r&&0<t.length&&(o=t[0].text,s.state.set("value",t[0].value)),s.state.set("menu",t)),s.state.set("text",i.text||o),s.classes.add("listbox"),s.on("select",function(e){var t=e.control;n&&(e.lastControl=n),i.multiple?t.active(!t.active()):s.value(e.control.value()),n=t})},value:function(t){return 0===arguments.length?this.state.get("value"):(void 0===t||(this.settings.values?0<w.grep(this.settings.values,function(e){return e.value===t}).length?this.state.set("value",t):null===t&&this.state.set("value",null):this.state.set("value",t)),this)},bindStates:function(){var i=this;return i.on("show",function(e){var t,n;t=e.control,n=i.value(),t instanceof Hr&&t.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}),i.state.on("change:value",function(t){var n=function e(t,n){var i;if(t)for(var r=0;r<t.length;r++){if(t[r].value===n)return t[r];if(t[r].menu&&(i=e(t[r].menu,n)))return i}}(i.state.get("menu"),t.value);n?i.text(n.text):i.text(i.settings.text)}),i._super()}}),Mr=zt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t,n=this;n._super(e),e=n.settings,n.classes.add("menu-item"),e.menu&&n.classes.add("menu-item-expand"),e.preview&&n.classes.add("menu-item-preview"),"-"!==(t=n.state.get("text"))&&"|"!==t||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),e.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var t,n=this,e=n.settings,i=n.parent();if(i.items().each(function(e){e!==n&&e.hideMenu()}),e.menu){(t=n.menu)?t.show():((t=e.menu).length?t={type:"menu",items:t}:t.type=t.type||"menu",i.settings.itemDefaults&&(t.itemDefaults=i.settings.itemDefaults),(t=n.menu=v.create(t).parent(n).renderTo()).reflow(),t.on("cancel",function(e){e.stopPropagation(),n.focus(),t.hide()}),t.on("show hide",function(e){e.control.items&&e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),t.on("hide",function(e){e.control===t&&n.classes.remove("selected")}),t.submenu=!0),t._parentMenu=i,t.classes.add("menu-sub");var r=t.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);t.moveRel(n.getEl(),r),r="menu-sub-"+(t.rel=r),t.classes.remove(t._lastRel).add(r),t._lastRel=r,n.classes.add("selected"),n.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e,t=this,n=t._id,i=t.settings,r=t.classPrefix,o=t.state.get("text"),s=t.settings.icon,a="",l=i.shortcut,u=t.encode(i.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){var t=i.match||"";return t?e.replace(new RegExp(c(t),"gi"),function(e){return"!mce~match["+e+"]mce~match!"}):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t,n,i={};for(i=pe.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=i[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(l)),s=r+"ico "+r+"i-"+(t.settings.icon||"none"),e="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1">'+e+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var t=this,n=t.settings,e=n.textStyle;if("function"==typeof e&&(e=e.call(this)),e){var i=t.getEl("text");i&&(i.setAttribute("style",e),t._textStyle=e)}return t.on("mouseenter click",function(e){e.control===t&&(n.menu||"click"!==e.type?(t.showMenu(),e.aria&&t.menu.focus(!0)):(t.fire("select"),u.requestAnimationFrame(function(){t.parent().hideAll()})))}),t._super(),t},hover:function(){return this.parent().items().each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),Tr=nn.extend({Defaults:{classes:"radio",role:"radio"}}),Pr=zt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new pt(this._id,{start:function(){t.fire("ResizeStart")},drag:function(e){"both"!==t.settings.direction&&(e.deltaX=0),t.fire("Resize",e)},stop:function(){t.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function Wr(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}var Nr=zt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var n=this;n._super(e),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=Wr(t._options),t.size&&(n=' size = "'+t.size+'"'),'<select id="'+t._id+'" class="'+t.classes+'"'+n+">"+e+"</select>"},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=Wr(e.value)}),t._super()}});function Dr(e,t,n){return e<t&&(e=t),n<e&&(e=n),e}function Ar(e,t,n){e.setAttribute("aria-"+t,n)}function Br(e,t){var n,i,r,o,s;"v"===e.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=e.getEl("handle"),o=((e.layoutRect()[n]||100)-He.getSize(s)[i])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",s.style[r]=o,s.style.height=e.layoutRect().h+"px",Ar(s,"valuenow",t),Ar(s,"valuetext",""+e.settings.previewFilter(t)),Ar(s,"valuemin",e._minValue),Ar(s,"valuemax",e._maxValue)}var Or=zt.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"===e.orientation&&t.classes.add("vertical"),t._minValue=q.isNumber(e.minValue)?e.minValue:0,t._maxValue=q.isNumber(e.maxValue)?e.maxValue:100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function t(e){var t,n,i,r;t=Dr(t=(((t=m.value())+(r=n=o))/((i=s)-r)+.05*e)*(i-n)-n,o,s),m.value(t),m.fire("dragstart",{value:t}),m.fire("drag",{value:t}),m.fire("dragend",{value:t})}m.on("keydown",function(e){switch(e.keyCode){case 37:case 38:t(-1);break;case 39:case 40:t(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new pt(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-He.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=Dr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),Br(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){Br(t,e.value)}),t._super()}}),zr=zt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),Lr=Er.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,ke(e).css({width:i.w-He.getSize(t).width,height:i.h-2}),ke(t).css({height:i.h-2}),this},activeMenu:function(e){ke(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),t="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+t+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(e){var t=e.target;if(e.control===this)for(;t;){if(e.aria&&"down"!==e.aria.key||"BUTTON"===t.nodeName&&-1===t.className.indexOf("open"))return e.stopImmediatePropagation(),void(n&&n.call(this,e));t=t.parentNode}}),delete this.settings.onclick,this._super()}}),Ir=ji.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),Fr=_t.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),ke(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true"),ke(e).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(e,t){n!==t&&e.hide()})},renderHtml:function(){var i=this,e=i._layout,r="",o=i.classPrefix;return i.preRender(),e.preRender(i),i.items().each(function(e,t){var n=i._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labelledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+e._id+'" aria-selected="false" tabIndex="-1">'+i.encode(e.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+e.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===i._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&i.activateTab(n)})},initLayoutRect:function(){var e,t,n,i=this;t=(t=He.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=He.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),Ur=zt.extend({init:function(e){var n=this;n._super(e),n.classes.add("textbox"),e.multiline?n.classes.add("multiline"):(n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))}),n.on("keyup",function(e){n.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var t,e,n=this,i=n.settings;return t={id:n._id,hidefocus:"1"},w.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){t[e]=i[e]}),n.disabled()&&(t.disabled="disabled"),i.subtype&&(t.type=i.subtype),(e=He.create(i.multiline?"textarea":"input",t)).value=n.state.get("value"),e.className=n.classes.toString(),e.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var t=this;t.getEl().value=t.state.get("value"),t._super(),t.$el.on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)})},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.getEl().value!==e.value&&(t.getEl().value=e.value)}),t.state.on("change:disabled",function(e){t.getEl().disabled=e.value}),t._super()},remove:function(){this.$el.off(),this._super()}}),Vr=function(){return{Selector:Ye,Collection:Je,ReflowQueue:it,Control:ct,Factory:v,KeyboardNavigation:ft,Container:mt,DragHelper:pt,Scrollable:wt,Panel:_t,Movable:Ne,Resizable:Rt,FloatPanel:Tt,Window:$t,MessageBox:Jt,Tooltip:Ot,Widget:zt,Progress:Lt,Notification:Ft,Layout:Kt,AbsoluteLayout:Zt,Button:Qt,ButtonGroup:tn,Checkbox:nn,ComboBox:on,ColorBox:sn,PanelButton:an,ColorButton:un,ColorPicker:dn,Path:hn,ElementPath:mn,FormItem:gn,Form:pn,FieldSet:vn,FilePicker:Fi,FitLayout:Ui,FlexLayout:Vi,FlowLayout:ji,FormatControls:yr,GridLayout:xr,Iframe:wr,InfoBox:_r,Label:Rr,Toolbar:Cr,MenuBar:kr,MenuButton:Er,MenuItem:Mr,Throbber:Dt,Menu:Hr,ListBox:Sr,Radio:Tr,ResizeHandle:Pr,SelectBox:Nr,Slider:Or,Spacer:zr,SplitButton:Lr,StackLayout:Ir,TabPanel:Fr,TextBox:Ur,DropZone:fn,BrowseButton:en}},jr=function(n){n.ui?w.each(Vr(),function(e,t){n.ui[t]=e}):n.ui=Vr()};w.each(Vr(),function(e,t){v.add(t,e)}),jr(window.tinymce?window.tinymce:{}),o.add("modern",function(e){return yr.setup(e),Gt(e)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},i=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},n=function(r){var t=e(r);r.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:t},onsubmit:function(t){var e,n,o=t.data.id;e=r,(a(n=o)?(i(e,n),0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&t.preventDefault()}})},o=function(t){t.addCommand("mceAnchor",function(){n(t)})},r=function(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",r("false")),t.serializer.addNodeFilter("a",r(null))})},d=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};t.add("anchor",function(t){c(t),o(t),d(t)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){return e.fire("insertCustomChar",{chr:t})},l=function(e,t){var a=i(e,t).chr;e.execCommand("mceInsertContent",!1,a)},a=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){return e.settings.charmap},n=function(e){return e.settings.charmap_append},o=a.isArray,c=function(e){return o(e)?[].concat((t=e,a.grep(t,function(e){return o(e)&&2===e.length}))):"function"==typeof e?e():[];var t},s=function(e){return function(e,t){var a=r(e);a&&(t=c(a));var i=n(e);return i?[].concat(t).concat(c(i)):t}(e,[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]])},t=function(t){return{getCharMap:function(){return s(t)},insertChar:function(e){l(t,e)}}},u=function(e){var t,a,i,r=Math.min(e.length,25),n=Math.ceil(e.length/r);for(t='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>',i=0;i<n;i++){for(t+="<tr>",a=0;a<r;a++){var o=i*r+a;if(o<e.length){var l=e[o],c=parseInt(l[0],10),s=l?String.fromCharCode(c):" ";t+='<td title="'+l[1]+'"><div tabindex="-1" title="'+l[1]+'" role="button" data-chr="'+c+'">'+s+"</div></td>"}else t+="<td />"}t+="</tr>"}return t+="</tbody></table>"},d=function(e){for(;e;){if("TD"===e.nodeName)return e;e=e.parentNode}},m=function(n){var o,e={type:"container",html:u(s(n)),onclick:function(e){var t=e.target;if(/^(TD|DIV)$/.test(t.nodeName)){var a=d(t).firstChild;if(a&&a.hasAttribute("data-chr")){var i=a.getAttribute("data-chr"),r=parseInt(i,10);isNaN(r)||l(n,String.fromCharCode(r)),e.ctrlKey||o.close()}}},onmouseover:function(e){var t=d(e.target);t&&t.firstChild?(o.find("#preview").text(t.firstChild.firstChild.data),o.find("#previewTitle").text(t.title)):(o.find("#preview").text(" "),o.find("#previewTitle").text(" "))}};o=n.windowManager.open({title:"Special character",spacing:10,padding:10,items:[e,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){o.close()}}]})},g=function(e){e.addCommand("mceShowCharmap",function(){m(e)})},p=function(e){e.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})};e.add("charmap",function(e){return g(e),p(e),t(e)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Color"),a=function(e,n){e.find("#preview")[0].getEl().style.background=n},o=function(e,n){var i=l(n),t=i.toRgb();e.fromJSON({r:t.r,g:t.g,b:t.b,hex:i.toHex().substr(1)}),a(e,i.toHex())},t=function(e,n,i){var t=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:i,onchange:function(){var e=this.rgb();t&&(t.find("#r").value(e.r),t.find("#g").value(e.g),t.find("#b").value(e.b),t.find("#hex").value(this.value().substr(1)),a(t,this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,i=t.find("colorpicker")[0];if(e=this.name(),n=this.value(),"hex"===e)return o(t,n="#"+n),void i.value(n);n={r:t.find("#r").value(),g:t.find("#g").value(),b:t.find("#b").value()},i.value(n),o(t,n)}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+t.toJSON().hex)}});o(t,i)};e.add("colorpicker",function(i){i.settings.color_picker_callback||(i.settings.color_picker_callback=function(e,n){t(i,e,n)})})}();!function(){"use strict";var o=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return o(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return{isContextMenuVisible:function(){return t.get()}}},r=function(t){return t.settings.contextmenu_never_use_native},u=function(t){return t.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=function(t){return l.DOM.select(t.settings.ui_container)[0]},a=function(t,n){return{x:t,y:n}},f=function(t,n,e){return a(t.x+n,t.y+e)},m=function(t,n){if(t&&"static"!==l.DOM.getStyle(t,"position",!0)){var e=l.DOM.getPos(t),o=e.x-t.scrollLeft,i=e.y-t.scrollTop;return f(n,-o,-i)}return f(n,0,0)},c=function(t,n){if(t.inline)return m(s(t),a((u=n).pageX,u.pageY));var e,o,i,r,u,c=(e=t.getContentAreaContainer(),o=a((r=n).clientX,r.clientY),i=l.DOM.getPos(e),f(o,i.x,i.y));return m(s(t),c)},g=tinymce.util.Tools.resolve("tinymce.ui.Factory"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=function(t,n,e,o){null===o.get()?o.set(function(e,n){var t,o,i=[];o=u(e),v.each(o.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"===t&&(n={text:t}),n&&(n.shortcut="",i.push(n))});for(var r=0;r<i.length;r++)"|"===i[r].text&&(0!==r&&r!==i.length-1||i.splice(r,1));return(t=g.create("menu",{items:i,context:"contextmenu",classes:"contextmenu"})).uiContainer=s(e),t.renderTo(s(e)),t.on("hide",function(t){t.control===this&&n.set(!1)}),e.on("remove",function(){t.remove(),t=null}),t}(t,e)):o.get().show(),o.get().moveTo(n.x,n.y),e.set(!0)},x=function(e,o,i){e.on("contextmenu",function(t){var n;n=e,(!t.ctrlKey||r(n))&&(t.preventDefault(),y(e,c(e,t),o,i))})};t.add("contextmenu",function(t){var n=o(null),e=o(!1);return x(t,e,n),i(e)})}();!function(){"use strict";var i=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return{isFullscreen:function(){return null!==e.get()}}},n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=function(e,n){e.fire("FullscreenStateChanged",{state:n})},g=n.DOM,r=function(e,n){var t,r,l,i,o,c,s=document.body,u=document.documentElement,d=n.get(),a=function(){var e,n,t,i;g.setStyle(l,"height",(t=window,i=document.body,i.offsetWidth&&(e=i.offsetWidth,n=i.offsetHeight),t.innerWidth&&t.innerHeight&&(e=t.innerWidth,n=t.innerHeight),{w:e,h:n}).h-(r.clientHeight-l.clientHeight))},h=function(){g.unbind(window,"resize",a)};if(t=(r=e.getContainer()).style,i=(l=e.getContentAreaContainer().firstChild).style,d)i.width=d.iframeWidth,i.height=d.iframeHeight,d.containerWidth&&(t.width=d.containerWidth),d.containerHeight&&(t.height=d.containerHeight),g.removeClass(s,"mce-fullscreen"),g.removeClass(u,"mce-fullscreen"),g.removeClass(r,"mce-fullscreen"),o=d.scrollPos,window.scrollTo(o.x,o.y),g.unbind(window,"resize",d.resizeHandler),e.off("remove",d.removeHandler),n.set(null),m(e,!1);else{var f={scrollPos:(c=g.getViewPort(),{x:c.x,y:c.y}),containerWidth:t.width,containerHeight:t.height,iframeWidth:i.width,iframeHeight:i.height,resizeHandler:a,removeHandler:h};i.width=i.height="100%",t.width=t.height="",g.addClass(s,"mce-fullscreen"),g.addClass(u,"mce-fullscreen"),g.addClass(r,"mce-fullscreen"),g.bind(window,"resize",a),e.on("remove",h),a(),n.set(f),m(e,!0)}},l=function(e,n){e.addCommand("mceFullScreen",function(){r(e,n)})},o=function(t){return function(e){var n=e.control;t.on("FullscreenStateChanged",function(e){n.active(e.state)})}},c=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:o(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:o(e)})};e.add("fullscreen",function(e){var n=i(null);return e.settings.inline||(l(e,n),c(e),e.addShortcut("Ctrl+Shift+F","","mceFullScreen")),t(n)})}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(e){return!1!==e.settings.image_dimensions},a=function(e){return!0===e.settings.image_advtab},f=function(e){return e.getParam("image_prepend_url","")},n=function(e){return e.getParam("image_class_list")},r=function(e){return!1!==e.settings.image_description},i=function(e){return!0===e.settings.image_title},o=function(e){return!0===e.settings.image_caption},l=function(e){return e.getParam("image_list",!1)},u=function(e){return e.getParam("images_upload_url",!1)},c=function(e){return e.getParam("images_upload_handler",!1)},s=function(e){return e.getParam("images_upload_url")},g=function(e){return e.getParam("images_upload_handler")},m=function(e){return e.getParam("images_upload_base_path")},p=function(e){return e.getParam("images_upload_credentials")},h="undefined"!=typeof window?window:Function("return this;")(),v=function(e,t){for(var n=t!==undefined&&null!==t?t:h,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n},b=function(e,t){var n=e.split(".");return v(n,t)},t={getOrDie:function(e,t){var n=b(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}};function y(){return new(t.getOrDie("FileReader"))}var x=tinymce.util.Tools.resolve("tinymce.util.Promise"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=tinymce.util.Tools.resolve("tinymce.util.XHR"),N=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},C=function(e,n){var r=document.createElement("img");function t(e,t){r.parentNode&&r.parentNode.removeChild(r),n({width:e,height:t})}r.onload=function(){t(N(r.width,r.clientWidth),N(r.height,r.clientHeight))},r.onerror=function(){t(0,0)};var i=r.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",document.body.appendChild(r),r.src=e},A=function(e,i,t){return function n(e,r){return r=r||[],w.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=n(e.menu):(t.value=e.value,i(t)),r.push(t)}),r}(e,t||[])},_=function(e){return e&&(e=e.replace(/px$/,"")),e},T=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},O=function(e){if(e.margin){var t=e.margin.split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},R=function(e,t){var n=l(e);"string"==typeof n?S.send({url:n,success:function(e){t(JSON.parse(e))}}):"function"==typeof n?n(t):t(n)},P=function(e,t,n){function r(){n.onload=n.onerror=null,e.selection&&(e.selection.select(n),e.nodeChanged())}n.onload=function(){t.width||t.height||!d(e)||e.dom.setAttribs(n,{width:n.clientWidth,height:n.clientHeight}),r()},n.onerror=r},I=function(r){return new x(function(e,t){var n=new y;n.onload=function(){e(n.result)},n.onerror=function(){t(y.error.message)},n.readAsDataURL(r)})},L=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),U=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},E={isString:U("string"),isObject:U("object"),isArray:U("array"),isNull:U("null"),isBoolean:U("boolean"),isUndefined:U("undefined"),isFunction:U("function"),isNumber:U("number")},M=function(a){return 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 i=e[r];for(var o in i)i.hasOwnProperty(o)&&(n[o]=a(n[o],i[o]))}return n}},j=M(function(e,t){return E.isObject(e)&&E.isObject(t)?j(e,t):t}),k=M(function(e,t){return t}),D={deepMerge:j,merge:k},z=L.DOM,B=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?_(e.style.marginLeft):""},H=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?_(e.style.marginTop):""},F=function(e){return e.style.borderWidth?_(e.style.borderWidth):""},W=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},J=function(e,t){return e.style[t]?e.style[t]:""},V=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},G=function(e,t,n){e.setAttribute(t,n)},$=function(e){var t,n,r,i;V(e)?(i=(r=e).parentNode,z.insertAfter(r,i),z.remove(i)):(t=e,n=z.create("figure",{"class":"image"}),z.insertAfter(n,t),n.appendChild(t),n.appendChild(z.create("figcaption",{contentEditable:!0},"Caption")),n.contentEditable="false")},X=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},q=function(e,r){return function(e,t,n){e.style[t]?(e.style[t]=T(n),X(e,r)):G(e,t,n)}},K=function(e,t){return e.style[t]?_(e.style[t]):W(e,t)},Q=function(e,t){var n=T(t);e.style.marginLeft=n,e.style.marginRight=n},Y=function(e,t){var n=T(t);e.style.marginTop=n,e.style.marginBottom=n},Z=function(e,t){var n=T(t);e.style.borderWidth=n},ee=function(e,t){e.style.borderStyle=t},te=function(e){return"FIGURE"===e.nodeName},ne=function(e,t){var n=document.createElement("img");return G(n,"style",t.style),(B(n)||""!==t.hspace)&&Q(n,t.hspace),(H(n)||""!==t.vspace)&&Y(n,t.vspace),(F(n)||""!==t.border)&&Z(n,t.border),(J(n,"borderStyle")||""!==t.borderStyle)&&ee(n,t.borderStyle),e(n.getAttribute("style"))},re=function(e,t){return{src:W(t,"src"),alt:W(t,"alt"),title:W(t,"title"),width:K(t,"width"),height:K(t,"height"),"class":W(t,"class"),style:e(W(t,"style")),caption:V(t),hspace:B(t),vspace:H(t),border:F(t),borderStyle:J(t,"borderStyle")}},ie=function(e,t,n,r,i){n[r]!==t[r]&&i(e,r,n[r])},oe=function(r,i){return function(e,t,n){r(e,n),X(e,i)}},ae=function(e,t,n){var r=re(e,n);ie(n,r,t,"caption",function(e,t,n){return $(e)}),ie(n,r,t,"src",G),ie(n,r,t,"alt",G),ie(n,r,t,"title",G),ie(n,r,t,"width",q(0,e)),ie(n,r,t,"height",q(0,e)),ie(n,r,t,"class",G),ie(n,r,t,"style",oe(function(e,t){return G(e,"style",t)},e)),ie(n,r,t,"hspace",oe(Q,e)),ie(n,r,t,"vspace",oe(Y,e)),ie(n,r,t,"border",oe(Z,e)),ie(n,r,t,"borderStyle",oe(ee,e))},le=function(e,t){var n=e.dom.styles.parse(t),r=O(n),i=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(i)},ue=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute("data-mce-placeholder"))?null:t},ce=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,function(e){return t.schema.getTextBlockElements()[e.nodeName]});return r?n.split(r,e):e},se=function(t){var e=ue(t);return e?re(function(e){return le(t,e)},e):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}},de=function(t,e){var n=function(e,t){var n=document.createElement("img");if(ae(e,D.merge(t,{caption:!1}),n),G(n,"alt",t.alt),t.caption){var r=z.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(z.create("figcaption",{contentEditable:!0},"Caption")),r.contentEditable="false",r}return n}(function(e){return le(t,e)},e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),te(r)){var i=ce(t,r);t.selection.select(i)}else t.selection.select(r)},fe=function(e,t){var n=ue(e);n?t.src?function(t,e){var n,r=ue(t);if(ae(function(e){return le(t,e)},e,r),n=r,t.dom.setAttrib(n,"src",n.getAttribute("src")),te(r.parentNode)){var i=r.parentNode;ce(t,i),t.selection.select(r.parentNode)}else t.selection.select(r),P(t,e,r)}(e,t):function(e,t){if(t){var n=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(n),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,n):t.src&&de(e,t)},ge=function(n,r){r.find("#style").each(function(e){var t=ne(function(e){return le(n,e)},D.merge({src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},r.toJSON()));e.value(t)})},me=function(t){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:(o=t,function(e){var t=o.dom,n=e.control.rootControl;if(a(o)){var r=n.toJSON(),i=t.parseStyle(r.style);n.find("#vspace").value(""),n.find("#hspace").value(""),((i=O(i))["margin-top"]&&i["margin-bottom"]||i["margin-right"]&&i["margin-left"])&&(i["margin-top"]===i["margin-bottom"]?n.find("#vspace").value(_(i["margin-top"])):n.find("#vspace").value(""),i["margin-right"]===i["margin-left"]?n.find("#hspace").value(_(i["margin-right"])):n.find("#hspace").value("")),i["border-width"]?n.find("#border").value(_(i["border-width"])):n.find("#border").value(""),i["border-style"]?n.find("#borderStyle").value(i["border-style"]):n.find("#borderStyle").value(""),n.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(i))))}})},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,defaults:{type:"textbox",maxWidth:50,onchange:function(e){ge(t,e.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Border width",name:"border"},{label:"Horizontal space",name:"hspace"},{label:"Border style",type:"listbox",name:"borderStyle",width:90,maxWidth:90,onselect:function(e){ge(t,e.control.rootControl)},values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]};var o},pe=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},he=function(e,t){var n=e.find("#width")[0],r=e.find("#height")[0],i=e.find("#constrain")[0];n&&r&&i&&t(n,r,i.checked())},ve=function(e,t,n){var r=e.state.get("oldVal"),i=t.state.get("oldVal"),o=e.value(),a=t.value();n&&r&&i&&o&&a&&(o!==r?(a=Math.round(o/r*a),isNaN(a)||t.value(a)):(o=Math.round(a/i*o),isNaN(o)||e.value(o))),pe(e,t)},be=function(e){he(e,ve)},ye=function(){var e=function(e){be(e.control.rootControl)};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}},xe=function(e){he(e,pe)},we=be,Se=function(e){e.meta=e.control.rootControl.toJSON()},Ne=function(s,e){var t=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(e){var t,n,r,i,o,a,l,u,c;n=s,a=(t=e).meta||{},l=t.control,u=l.rootControl,(c=u.find("#image-list")[0])&&c.value(n.convertURL(l.value(),"src")),w.each(a,function(e,t){u.find("#"+t).value(e)}),a.width||a.height||(r=n.convertURL(l.value(),"src"),i=f(n),o=new RegExp("^(?:[a-z]+:)?//","i"),i&&!o.test(r)&&r.substring(0,i.length)!==i&&(r=i+r),l.value(r),C(n.documentBaseURI.toAbsolute(l.value()),function(e){e.width&&e.height&&d(n)&&(u.find("#width").value(e.width),u.find("#height").value(e.height),xe(u))}))},onbeforecall:Se},e];return r(s)&&t.push({name:"alt",type:"textbox",label:"Image description"}),i(s)&&t.push({name:"title",type:"textbox",label:"Image Title"}),d(s)&&t.push(ye()),n(s)&&t.push({name:"class",type:"listbox",label:"Class",values:A(n(s),function(e){e.value&&(e.textStyle=function(){return s.formatter.getCssText({inline:"img",classes:[e.value]})})})}),o(s)&&t.push({name:"caption",type:"checkbox",label:"Caption"}),t},Ce=function(e,t){return{title:"General",type:"form",items:Ne(e,t)}},Ae=Ne,_e=function(){return t.getOrDie("URL")},Te=function(e){return _e().createObjectURL(e)},Oe=function(e){_e().revokeObjectURL(e)},Re=tinymce.util.Tools.resolve("tinymce.ui.Factory");function Pe(){return new(t.getOrDie("XMLHttpRequest"))}var Ie=function(){};function Le(a){var t=function(e,r,i,t){var o,n;(o=new Pe).open("POST",a.url),o.withCredentials=a.credentials,o.upload.onprogress=function(e){t(e.loaded/e.total*100)},o.onerror=function(){i("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var e,t,n;o.status<200||300<=o.status?i("HTTP Error: "+o.status):(e=JSON.parse(o.responseText))&&"string"==typeof e.location?r((t=a.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):i("Invalid JSON: "+o.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),o.send(n)};return a=w.extend({credentials:!1,handler:t},a),{upload:function(e){return a.url||a.handler!==t?(r=e,i=a.handler,new x(function(e,t){try{i(r,e,t,Ie)}catch(n){t(n.message)}})):x.reject("Upload url missing from the settings.");var r,i}}}var Ue=function(u){return function(e){var t=Re.get("Throbber"),n=e.control.rootControl,r=new t(n.getEl()),i=e.control.value(),o=Te(i),a=Le({url:s(u),basePath:m(u),credentials:p(u),handler:g(u)}),l=function(){r.hide(),Oe(o)};return r.show(),I(i).then(function(e){var t=u.editorUpload.blobCache.create({blob:i,blobUri:o,name:i.name?i.name.replace(/\.[^\.]+$/,""):null,base64:e.split(",")[1]});return a.upload(t).then(function(e){var t=n.find("#src");return t.value(e),n.find("tabpanel")[0].activateTab(0),t.fire("change"),l(),e})})["catch"](function(e){u.windowManager.alert(e),l()})}},Ee=".jpg,.jpeg,.png,.gif",Me=function(e){return{title:"Upload",type:"form",layout:"flex",direction:"column",align:"stretch",padding:"20 20 20 20",items:[{type:"container",layout:"flex",direction:"column",align:"center",spacing:10,items:[{text:"Browse for an image",type:"browsebutton",accept:Ee,onchange:Ue(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:Ee,height:100,onchange:Ue(e)}]}},je=function(e){return function(){return e}},ke=(je(!1),je(!0),function(o){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var i=a.concat(n);return o.apply(null,i)}}),De=function(t,e){var n=e.control.getRoot();we(n),t.undoManager.transact(function(){var e=D.merge(se(t),n.toJSON());fe(t,e)}),t.editorUpload.uploadImagesAuto()};function ze(o){function e(e){var n,t,r=se(o);if(e&&(t={type:"listbox",label:"Image list",name:"image-list",values:A(e,function(e){e.value=o.convertURL(e.value||e.url,"src")},[{text:"None",value:""}]),value:r.src&&o.convertURL(r.src,"src"),onselect:function(e){var t=n.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),n.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){t=this}}),a(o)||u(o)||c(o)){var i=[Ce(o,t)];a(o)&&i.push(me(o)),(u(o)||c(o))&&i.push(Me(o)),n=o.windowManager.open({title:"Insert/edit image",data:r,bodyType:"tabpanel",body:i,onSubmit:ke(De,o)})}else n=o.windowManager.open({title:"Insert/edit image",data:r,body:Ae(o,t),onSubmit:ke(De,o)});xe(n)}return{open:function(){R(o,e)}}}var Be=function(e){e.addCommand("mceImage",ze(e).open)},He=function(o){return function(e){for(var t,n,r=e.length,i=function(e){e.attr("contenteditable",o?"true":null)};r--;)t=e[r],(n=t.attr("class"))&&/\bimage\b/.test(n)&&(t.attr("contenteditable",o?"false":null),w.each(t.getAll("figcaption"),i))}},Fe=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",He(!0)),e.serializer.addNodeFilter("figure",He(!1))})},We=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:ze(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"Image",onclick:ze(e).open,context:"insert",prependToContext:!0})};e.add("image",function(e){Fe(e),We(e),Be(e)})}();!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},a=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},i=n,o=a,u=function(e){var t=a(e);return 0<t.length?t[0]:n(e)},m=function(e){return e.getParam("insertdatetime_element",!1)},c="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),d="January February March April May June July August September October November December".split(" "),p=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},f=function(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",p(n.getMonth()+1,2))).replace("%d",p(n.getDate(),2))).replace("%H",""+p(n.getHours(),2))).replace("%M",""+p(n.getMinutes(),2))).replace("%S",""+p(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(d[n.getMonth()]))).replace("%b",""+e.translate(s[n.getMonth()]))).replace("%A",""+e.translate(l[n.getDay()]))).replace("%a",""+e.translate(c[n.getDay()]))).replace("%%","%")},g=function(e,t){if(m(e)){var n=f(e,t),r=void 0;r=/%[HMSIp]/.test(t)?f(e,"%Y-%m-%dT%H:%M"):f(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,c=n,l=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(l,o),i.dom.remove(o),i.selection.select(l,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(f(e,t));var i,o,u,c,l},y=f,M=function(e){e.addCommand("mceInsertDate",function(){g(e,t(e))}),e.addCommand("mceInsertTime",function(){g(e,i(e))})},v=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(t,n){var r,a,e,i=(a=n,e=o(r=t),v.map(e,function(e){return{text:y(r,e),onclick:function(){a.set(e),g(r,e)}}}));t.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",menu:i,onclick:function(){var e=n.get();g(t,e||u(t))}}),t.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:i,context:"insert"})};e.add("insertdatetime",function(e){var t=r(null);M(e),S(e,t)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),e=function(t){return t.target_list},o=function(t){return t.rel_list},i=function(t){return t.link_class_list},p=function(t){return"boolean"==typeof t.link_assume_external_targets&&t.link_assume_external_targets},a=function(t){return"boolean"==typeof t.link_context_toolbar&&t.link_context_toolbar},r=function(t){return t.link_list},k=function(t){return"string"==typeof t.default_link_target},y=function(t){return t.default_link_target},b=e,_=function(t,e){t.settings.target_list=e},w=function(t){return!1!==e(t)},T=o,C=function(t){return o(t)!==undefined},M=i,O=function(t){return i(t)!==undefined},R=function(t){return!1!==t.link_title},N=function(t){return"boolean"==typeof t.allow_unsafe_link_target&&t.allow_unsafe_link_target},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),u=tinymce.util.Tools.resolve("tinymce.Env"),c=function(t){if(!u.ie||10<u.ie){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r=e,a=n,document.body.appendChild(r),r.dispatchEvent(a),document.body.removeChild(r)}else{var o=window.open("","_blank");if(o){o.opener=null;var i=o.document;i.open(),i.write('<meta http-equiv="refresh" content="0; url='+l.DOM.encode(t)+'">'),i.close()}}var r,a},A=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(t,e){var n,o,i=["noopener"],r=t?t.split(/\s+/):[],a=function(t){return t.filter(function(t){return-1===A.inArray(i,t)})};return(r=e?(n=a(n=r)).length?n.concat(i):i:a(r)).length?(o=r,A.trim(o.sort().join(" "))):null},f=function(t,e){return e=e||t.selection.getNode(),m(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},d=function(t){return t&&"A"===t.nodeName&&t.href},m=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},v=function(t,e){var n,o;(o=t.dom.select("img",e)[0])&&(n=t.dom.getParents(o,"a[href]",e)[0])&&(n.parentNode.insertBefore(o,n),t.dom.remove(n))},g=function(t,e,n){var o,i;(i=t.dom.select("img",e)[0])&&(o=t.dom.create("a",n),i.parentNode.insertBefore(o,i),o.appendChild(i))},L=function(i,r){return function(o){i.undoManager.transact(function(){var t=i.selection.getNode(),e=f(i,t),n={href:o.href,target:o.target?o.target:null,rel:o.rel?o.rel:null,"class":o["class"]?o["class"]:null,title:o.title?o.title:null};C(i.settings)||!1!==N(i.settings)||(n.rel=s(n.rel,"_blank"===n.target)),o.href===r.href&&(r.attach(),r={}),e?(i.focus(),o.hasOwnProperty("text")&&("innerText"in e?e.innerText=o.text:e.textContent=o.text),i.dom.setAttribs(e,n),i.selection.select(e),i.undoManager.add()):m(t)?g(i,t,n):o.hasOwnProperty("text")?i.insertContent(i.dom.createHTML("a",n,i.dom.encode(o.text))):i.execCommand("mceInsertLink",!1,n)})}},P=function(e){return function(){e.undoManager.transact(function(){var t=e.selection.getNode();m(t)?v(e,t):e.execCommand("unlink")})}},h=d,x=function(t){return 0<A.grep(t,d).length},E=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},S=f,I=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return n.replace(/\uFEFF/g,"")},K=s,U=tinymce.util.Tools.resolve("tinymce.util.Delay"),D=tinymce.util.Tools.resolve("tinymce.util.XHR"),B={},F=function(t,o,e){var i=function(t,n){return n=n||[],A.each(t,function(t){var e={text:t.text||t.title};t.menu?e.menu=i(t.menu):(e.value=t.value,o&&o(e)),n.push(e)}),n};return i(t,e||[])},q=function(e,t,n){var o=e.selection.getRng();U.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),n(t)})})},V=function(a,t){var e,l,o,u,n,i,r,c,s,f,d,m={},v=a.selection,g=a.dom,h=function(t){var e=o.find("#text");(!e.value()||t.lastControl&&e.value()===t.lastControl.text())&&e.value(t.control.text()),o.find("#href").value(t.control.value())},x=function(){l||!u||m.text||this.parent().parent().find("#text")[0].value(this.value())};u=E(v.getContent()),e=S(a),m.text=l=I(a.selection,e),m.href=e?g.getAttrib(e,"href"):"",e?m.target=g.getAttrib(e,"target"):k(a.settings)&&(m.target=y(a.settings)),(d=g.getAttrib(e,"rel"))&&(m.rel=d),(d=g.getAttrib(e,"class"))&&(m["class"]=d),(d=g.getAttrib(e,"title"))&&(m.title=d),u&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){m.text=this.value()}}),t&&(i={type:"listbox",label:"Link list",values:F(t,function(t){t.value=a.convertURL(t.value||t.url,"href")},[{text:"None",value:""}]),onselect:h,value:a.convertURL(m.href,"href"),onPostRender:function(){i=this}}),w(a.settings)&&(b(a.settings)===undefined&&_(a,[{text:"None",value:""},{text:"New window",value:"_blank"}]),c={name:"target",type:"listbox",label:"Target",values:F(b(a.settings))}),C(a.settings)&&(r={name:"rel",type:"listbox",label:"Rel",values:F(T(a.settings),function(t){!1===N(a.settings)&&(t.value=K(t.value,"_blank"===m.target))})}),O(a.settings)&&(s={name:"class",type:"listbox",label:"Class",values:F(M(a.settings),function(t){t.value&&(t.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[t.value]})})})}),R(a.settings)&&(f={name:"title",type:"textbox",label:"Title",value:m.title}),o=a.windowManager.open({title:"Insert link",data:m,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:function(t){var e=t.meta||{};i&&i.value(a.convertURL(this.value(),"href")),A.each(t.meta,function(t,e){var n=o.find("#"+e);"text"===e?0===l.length&&(n.value(t),m.text=t):n.value(t)}),e.attach&&(B={href:this.value(),attach:e.attach}),e.text||x.call(this)},onkeyup:x,onpaste:x,onbeforecall:function(t){t.meta=o.toJSON()}},n,f,function(n){var o=[];if(A.each(a.dom.select("a:not([href])"),function(t){var e=t.name||t.id;e&&o.push({text:e,value:"#"+e,selected:-1!==n.indexOf("#"+e)})}),o.length)return o.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:o,onselect:h}}(m.href),i,r,c,s],onSubmit:function(t){var e=p(a.settings),n=L(a,B),o=P(a),i=A.extend({},m,t.data),r=i.href;r?(u&&i.text!==l||delete i.text,0<r.indexOf("@")&&-1===r.indexOf("//")&&-1===r.indexOf("mailto:")?q(a,"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(i.href="mailto:"+r),n(i)}):!0===e&&!/^\w+:/i.test(r)||!1===e&&/^\s*www[\.|\d\.]/i.test(r)?q(a,"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(i.href="http://"+r),n(i)}):n(i)):o()}})},z=function(t){var e,n,o;n=V,"string"==typeof(o=r((e=t).settings))?D.send({url:o,success:function(t){n(e,JSON.parse(t))}}):"function"==typeof o?o(function(t){n(e,t)}):n(e,o)},H=function(t,e){return t.dom.getParent(e,"a[href]")},J=function(t){return H(t,t.selection.getStart())},$=function(t,e){if(e){var n=(i=e).getAttribute("data-mce-href")||i.getAttribute("href");if(/^#/.test(n)){var o=t.$(n);o.length&&t.selection.scrollIntoView(o[0],!0)}else c(e.href)}var i},j=function(t){return function(){z(t)}},G=function(t){return function(){$(t,J(t))}},X=function(r){return function(t){var e,n,o,i;return!!(a(r.settings)&&(!(i=r.plugins.contextmenu)||!i.isContextMenuVisible())&&h(t)&&3===(o=(n=(e=r.selection).getRng()).startContainer).nodeType&&e.isCollapsed()&&0<n.startOffset&&n.startOffset<o.data.length)}},Q=function(o){o.on("click",function(t){var e=H(o,t.target);e&&n.metaKeyPressed(t)&&(t.preventDefault(),$(o,e))}),o.on("keydown",function(t){var e,n=J(o);n&&13===t.keyCode&&!0===(e=t).altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey&&(t.preventDefault(),$(o,n))})},W=function(n){return function(){var e=this;n.on("nodechange",function(t){e.active(!n.readonly&&!!S(n,t.element))})}},Y=function(n){return function(){var e=this,t=function(t){x(t.parents)?e.show():e.hide()};x(n.dom.getParents(n.selection.getStart()))||e.hide(),n.on("nodechange",t),e.on("remove",function(){n.off("nodechange",t)})}},Z=function(t){t.addCommand("mceLink",j(t))},tt=function(t){t.addShortcut("Meta+K","",j(t))},et=function(t){t.addButton("link",{active:!1,icon:"link",tooltip:"Insert/edit link",onclick:j(t),onpostrender:W(t)}),t.addButton("unlink",{active:!1,icon:"unlink",tooltip:"Remove link",onclick:P(t),onpostrender:W(t)}),t.addContextToolbar&&t.addButton("openlink",{icon:"newtab",tooltip:"Open link",onclick:G(t)})},nt=function(t){t.addMenuItem("openlink",{text:"Open link",icon:"newtab",onclick:G(t),onPostRender:Y(t),prependToContext:!0}),t.addMenuItem("link",{icon:"link",text:"Link",shortcut:"Meta+K",onclick:j(t),stateSelector:"a[href]",context:"insert",prependToContext:!0}),t.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onclick:P(t),stateSelector:"a[href]"})},ot=function(t){t.addContextToolbar&&t.addContextToolbar(X(t),"openlink | link unlink")};t.add("link",function(t){et(t),nt(t),ot(t),Q(t),Z(t),tt(t)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),l=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(e){return e&&"BR"===e.nodeName},r=function(e){return e&&3===e.nodeType},h=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},i=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},a=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},C=o,s=function(e){return e.parentNode.firstChild===e},c=function(e){return e.parentNode.lastChild===e},y=function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},f=function(e,t){return e&&e.nodeName in t},u=function(e,t){return!!o(t)&&!(!e.isBlock(t.nextSibling)||o(t.previousSibling))},m=function(e,t,n){var o=e.isEmpty(t);return!(n&&0<e.select("span[data-mce-type=bookmark]",t).length)&&o},g=function(e,t){return e.isChildOf(t,e.getRoot())},N=function(e,t){var n=d.getNode(e,t);return i(e)&&r(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:{container:e,offset:t}},L=function(e){var t=e.cloneRange(),n=N(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var o=N(e.endContainer,e.endOffset);return t.setEnd(o.container,o.offset),t},S=t.DOM,b=function(r){var i={},e=function(e){var t,n,o;n=r[e?"startContainer":"endContainer"],o=r[e?"startOffset":"endOffset"],1===n.nodeType&&(t=S.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(o=Math.min(o,n.childNodes.length-1),e?n.insertBefore(t,n.childNodes[o]):S.insertAfter(t,n.childNodes[o])):n.appendChild(t),n=t,o=0),i[e?"startContainer":"endContainer"]=n,i[e?"startOffset":"endOffset"]=o};return e(!0),r.collapsed||e(),i},D=function(r){function e(e){var t,n,o;t=o=r[e?"startContainer":"endContainer"],n=r[e?"startOffset":"endOffset"],t&&(1===t.nodeType&&(n=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(t),t=t.parentNode,S.remove(o),!t.hasChildNodes()&&S.isBlock(t)&&t.appendChild(S.create("br"))),r[e?"startContainer":"endContainer"]=t,r[e?"startOffset":"endOffset"]=n)}e(!0),e();var t=S.createRng();return t.setStart(r.startContainer,r.startOffset),r.endContainer&&t.setEnd(r.endContainer,r.endOffset),L(t)},k=t.DOM,T=function(e,t){var n,o=t.parentNode;"LI"===o.nodeName&&o.firstChild===t&&((n=o.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),m(e,o)&&k.remove(o)):k.setStyle(o,"listStyleType","none")),h(o)&&(n=o.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)},I=function(t,e){v.each(v.grep(t.select("ol,ul",e)),function(e){T(t,e)})},B=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),R=function(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",O(e,t))},O=function(e,t){var n=e.dom.getParents(t,"TD,TH");return 0<n.length?n[0]:e.getBody()},E={getParentList:R,getSelectedSubLists:function(e){var t,n,o,r=R(e),i=e.selection.getSelectedBlocks();return o=i,(n=r)&&1===o.length&&o[0]===n?(t=r,v.grep(t.querySelectorAll("ol,ul,dl"),function(e){return h(e)})):v.grep(i,function(e){return h(e)&&r!==e})},getSelectedListItems:function(e){var n,t,o,r=e.selection.getSelectedBlocks();return v.grep((n=e,t=r,o=v.map(t,function(e){var t=n.dom.getParent(e,"li,dd,dt",O(n,e));return t||e}),B.unique(o)),function(e){return i(e)})},getClosestListRootElm:O},A=tinymce.util.Tools.resolve("tinymce.Env"),P=t.DOM,x=function(e,t,n){var o,r,i,a=P.createFragment(),s=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&((r=P.create(n)).tagName===e.settings.forced_root_block&&P.setAttribs(r,e.settings.forced_root_block_attrs),f(t.firstChild,s)||a.appendChild(r)),t)for(;o=t.firstChild;){var d=o.nodeName;i||"SPAN"===d&&"bookmark"===o.getAttribute("data-mce-type")||(i=!0),f(o,s)?(a.appendChild(o),r=null):n?(r||(r=P.create(n),a.appendChild(r)),r.appendChild(o)):a.appendChild(o)}return e.settings.forced_root_block?i||A.ie&&!(10<A.ie)||r.appendChild(P.create("br",{"data-mce-bogus":"1"})):a.appendChild(P.create("br")),a},_=t.DOM,M=function(e,t,n,o){var r,i,a,s,d;for(a=_.select('span[data-mce-type="bookmark"]',t),o=o||x(e,n),(r=_.createRng()).setStartAfter(n),r.setEndAfter(t),s=(i=r.extractContents()).firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&e.dom.isEmpty(s)){_.remove(s);break}e.dom.isEmpty(i)||_.insertAfter(i,t),_.insertAfter(o,t),m(e.dom,n.parentNode)&&(d=n.parentNode,v.each(a,function(e){d.parentNode.insertBefore(e,n.parentNode)}),_.remove(d)),_.remove(n),m(e.dom,t)&&_.remove(t)},U=t.DOM,H=function(e,t){m(e,t)&&U.remove(t)},$=function(e,t){var n,o,r=t.parentNode;return r?(n=r.parentNode,r===e.getBody()||("DD"===t.nodeName?U.rename(t,"DT"):s(t)&&c(t)?"LI"===n.nodeName?(U.insertAfter(t,n),H(e.dom,n),U.remove(r)):h(n)?U.remove(r,!0):(n.insertBefore(x(e,t),r),U.remove(r)):s(t)?"LI"===n.nodeName?(U.insertAfter(t,n),t.appendChild(r),H(e.dom,n)):h(n)?n.insertBefore(t,r):(n.insertBefore(x(e,t),r),U.remove(t)):c(t)?"LI"===n.nodeName?U.insertAfter(t,n):h(n)?U.insertAfter(t,r):(U.insertAfter(x(e,t),r),U.remove(t)):("LI"===n.nodeName?(r=n,o=x(e,t,"LI")):o=h(n)?x(e,t,"LI"):x(e,t),M(e,r,t,o),I(e.dom,r.parentNode)))):H(e.dom,t),!0},w=$,K=function(e){var t=E.getSelectedListItems(e);if(t.length){var n=b(e.selection.getRng()),o=void 0,r=void 0,i=E.getClosestListRootElm(e,e.selection.getStart(!0));for(o=t.length;o--;)for(var a=t[o].parentNode;a&&a!==i;){for(r=t.length;r--;)if(t[r]===a){t.splice(o,1);break}a=a.parentNode}for(o=0;o<t.length&&($(e,t[o])||0!==o);o++);return e.selection.setRng(D(n)),e.nodeChanged(),!0}},Q=function(n,e){v.each(e,function(e,t){n.setAttribute(t,e)})},W=function(e,t,n){var o,r,i,a,s,d,l;o=e,r=t,a=(i=n)["list-style-type"]?i["list-style-type"]:null,o.setStyle(r,"list-style-type",a),s=e,Q(d=t,(l=n)["list-attributes"]),v.each(s.select("li",d),function(e){Q(e,l["list-item-attributes"])})},j=function(e,t,n,o){var r,i;for(r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===r.nodeType&&(r=r.childNodes[Math.min(i,r.childNodes.length-1)]||r),!n&&C(r.nextSibling)&&(r=r.nextSibling);r.parentNode!==o;){if(y(e,r))return r;if(/^(TD|TH)$/.test(r.parentNode.nodeName))return r;r=r.parentNode}return r},q=function(c,f,u){void 0===u&&(u={});var e,t=c.selection.getRng(!0),m="LI",n=E.getClosestListRootElm(c,c.selection.getStart(!0)),g=c.dom;"false"!==g.getContentEditable(c.selection.getNode())&&("DL"===(f=f.toUpperCase())&&(m="DT"),e=b(t),v.each(function(n,e,o){for(var r,i=[],a=n.dom,t=j(n,e,!0,o),s=j(n,e,!1,o),d=[],l=t;l&&(d.push(l),l!==s);l=l.nextSibling);return v.each(d,function(e){if(y(n,e))return i.push(e),void(r=null);if(a.isBlock(e)||C(e))return C(e)&&a.remove(e),void(r=null);var t=e.nextSibling;p.isBookmarkNode(e)&&(y(n,t)||!t&&e.parentNode===o)?r=null:(r||(r=a.create("p"),e.parentNode.insertBefore(r,e),i.push(r)),r.appendChild(e))}),i}(c,t,n),function(e){var t,n,o,r,i,a,s,d,l;(n=e.previousSibling)&&h(n)&&n.nodeName===f&&(o=n,r=u,i=g.getStyle(o,"list-style-type"),a=r?r["list-style-type"]:"",i===(a=null===a?"":a))?(t=n,e=g.rename(e,m),n.appendChild(e)):(t=g.create(f),e.parentNode.insertBefore(t,e),t.appendChild(e),e=g.rename(e,m)),s=g,d=e,l=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(l,function(e){return s.setStyle(d,((t={})[e]="",t));var t}),W(g,t,u),z(c.dom,t)}),c.selection.setRng(D(e)))},F=function(o){var e=b(o.selection.getRng(!0)),r=E.getClosestListRootElm(o,o.selection.getStart(!0)),t=E.getSelectedListItems(o),n=v.grep(t,function(e){return o.dom.isEmpty(e)});t=v.grep(t,function(e){return!o.dom.isEmpty(e)}),v.each(n,function(e){m(o.dom,e)&&w(o,e)}),v.each(t,function(e){var t,n;if(e.parentNode!==o.getBody()){for(t=e;t&&t!==r;t=t.parentNode)h(t)&&(n=t);M(o,n,e),I(o.dom,n.parentNode)}}),o.selection.setRng(D(e))},V=function(e,t,n){return d=n,(s=t)&&d&&h(s)&&s.nodeName===d.nodeName&&(i=t,a=n,(r=e).getStyle(i,"list-style-type",!0)===r.getStyle(a,"list-style-type",!0))&&(o=n,t.className===o.className);var o,r,i,a,s,d},z=function(e,t){var n,o;if(n=t.nextSibling,V(e,t,n)){for(;o=n.firstChild;)t.appendChild(o);e.remove(n)}if(n=t.previousSibling,V(e,t,n)){for(;o=n.lastChild;)t.insertBefore(o,t.firstChild);e.remove(n)}},G=function(t,e,n,o,r){if(e.nodeName!==o||J(r)){var i=b(t.selection.getRng(!0));v.each([e].concat(n),function(e){!function(e,t,n,o){if(t.nodeName!==n){var r=e.rename(t,n);W(e,r,o)}else W(e,t,o)}(t.dom,e,o,r)}),t.selection.setRng(D(i))}else F(t)},J=function(e){return"list-style-type"in e},X={toggleList:function(e,t,n){var o=E.getParentList(e),r=E.getSelectedSubLists(e);n=n||{},o&&0<r.length?G(e,o,r,t,n):function(e,t,n,o){if(t!==e.getBody())if(t)if(t.nodeName!==n||J(o)){var r=b(e.selection.getRng(!0));W(e.dom,t,o),z(e.dom,e.dom.rename(t,n)),e.selection.setRng(D(r))}else F(e);else q(e,n,o)}(e,o,t,n)},removeList:F,mergeWithAdjacentLists:z},Y=function(e,t,n,o){var r,i,a=t.startContainer,s=t.startOffset;if(3===a.nodeType&&(n?s<a.data.length:0<s))return a;for(r=e.schema.getNonEmptyElements(),1===a.nodeType&&(a=d.getNode(a,s)),i=new l(a,o),n&&u(e.dom,a)&&i.next();a=i[n?"next":"prev2"]();){if("LI"===a.nodeName&&!a.hasChildNodes())return a;if(r[a.nodeName])return a;if(3===a.nodeType&&0<a.data.length)return a}},Z=function(e,t){var n=t.childNodes;return 1===n.length&&!h(n[0])&&e.isBlock(n[0])},ee=function(e,t,n){var o,r,i,a;if(r=Z(e,n)?n.firstChild:n,Z(i=e,a=t)&&i.remove(a.firstChild,!0),!m(e,t,!0))for(;o=t.firstChild;)r.appendChild(o)},te=function(e,t,n){var o,r,i=t.parentNode;g(e,t)&&g(e,n)&&(h(n.lastChild)&&(r=n.lastChild),i===n.lastChild&&C(i.previousSibling)&&e.remove(i.previousSibling),(o=n.lastChild)&&C(o)&&t.hasChildNodes()&&e.remove(o),m(e,n,!0)&&e.$(n).empty(),ee(e,t,n),r&&n.appendChild(r),e.remove(t),m(e,i)&&i!==e.getRoot()&&e.remove(i))},ne=function(e,t,n,o){var r,i,a,s=e.dom;if(s.isEmpty(o))i=n,a=o,(r=e).dom.$(a).empty(),te(r.dom,i,a),r.selection.setCursorLocation(a);else{var d=b(t);te(s,n,o),e.selection.setRng(D(d))}},oe=function(e,t){var n,o,r,i=e.dom,a=e.selection,s=a.getStart(),d=E.getClosestListRootElm(e,s),l=i.getParent(a.getStart(),"LI",d);if(l){if((n=l.parentNode)===e.getBody()&&m(i,n))return!0;if(o=L(a.getRng(!0)),(r=i.getParent(Y(e,o,t,d),"LI",d))&&r!==l)return t?ne(e,o,r,l):function(e,t,n,o){var r=b(t);te(e.dom,n,o);var i=D(r);e.selection.setRng(i)}(e,o,l,r),!0;if(!r&&!t&&X.removeList(e))return!0}return!1},re=function(e,t){return oe(e,t)||function(r,i){var a=r.dom,e=r.selection.getStart(),s=E.getClosestListRootElm(r,e),d=a.getParent(e,a.isBlock,s);if(d&&a.isEmpty(d)){var t=L(r.selection.getRng(!0)),l=a.getParent(Y(r,t,i,s),"LI",s);if(l)return r.undoManager.transact(function(){var e,t,n,o;t=d,n=s,o=(e=a).getParent(t.parentNode,e.isBlock,n),e.remove(t),o&&e.isEmpty(o)&&e.remove(o),X.mergeWithAdjacentLists(a,l.parentNode),r.selection.select(l,!0),r.selection.collapse(i)}),!0}return!1}(e,t)},ie=function(e,t){return e.selection.isCollapsed()?re(e,t):(o=(n=e).selection.getStart(),r=E.getClosestListRootElm(n,o),!!(n.dom.getParent(o,"LI,DT,DD",r)||0<E.getSelectedListItems(n).length)&&(n.undoManager.transact(function(){n.execCommand("Delete"),I(n.dom,n.getBody())}),!0));var n,o,r},ae=function(t){t.on("keydown",function(e){e.keyCode===n.BACKSPACE?ie(t,!1)&&e.preventDefault():e.keyCode===n.DELETE&&ie(t,!0)&&e.preventDefault()})},se=ie,de=function(t){return{backspaceDelete:function(e){se(t,e)}}},le=t.DOM,ce=function(e,t){var n;if(h(e)){for(;n=e.firstChild;)t.appendChild(n);le.remove(e)}},fe=function(e){var t,n,o,r,i=E.getSelectedListItems(e);if(i.length){for(var a=b(e.selection.getRng(!0)),s=0;s<i.length&&(t=i[s],r=o=n=void 0,("DT"===t.nodeName?(le.rename(t,"DD"),1):(n=t.previousSibling)&&h(n)?(n.appendChild(t),1):n&&"LI"===n.nodeName&&h(n.lastChild)?(n.lastChild.appendChild(t),ce(t.lastChild,n.lastChild),1):(n=t.nextSibling)&&h(n)?(n.insertBefore(t,n.firstChild),1):(n=t.previousSibling)&&"LI"===n.nodeName&&(o=le.create(t.parentNode.nodeName),(r=le.getStyle(t.parentNode,"listStyleType"))&&le.setStyle(o,"listStyleType",r),n.appendChild(o),o.appendChild(t),ce(t.lastChild,o),1))||0!==s);s++);return e.selection.setRng(D(a)),e.nodeChanged(),!0}},ue=function(t,n){return function(){var e=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===n}},me=function(o){o.on("BeforeExecCommand",function(e){var t,n=e.command.toLowerCase();if("indent"===n?fe(o)&&(t=!0):"outdent"===n&&K(o)&&(t=!0),t)return o.fire("ExecCommand",{command:e.command}),e.preventDefault(),!0}),o.addCommand("InsertUnorderedList",function(e,t){X.toggleList(o,"UL",t)}),o.addCommand("InsertOrderedList",function(e,t){X.toggleList(o,"OL",t)}),o.addCommand("InsertDefinitionList",function(e,t){X.toggleList(o,"DL",t)}),o.addQueryStateHandler("InsertUnorderedList",ue(o,"UL")),o.addQueryStateHandler("InsertOrderedList",ue(o,"OL")),o.addQueryStateHandler("InsertDefinitionList",ue(o,"DL"))},ge=function(e){return e.getParam("lists_indent_on_tab",!0)},pe=function(e){var t;ge(e)&&(t=e).on("keydown",function(e){e.keyCode!==n.TAB||n.metaKeyPressed(e)||t.dom.getParent(t.selection.getStart(),"LI,DT,DD")&&(e.preventDefault(),e.shiftKey?K(t):fe(t))}),ae(e)},ve=function(t,i){return function(e){var r=e.control;t.on("NodeChange",function(e){var t=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(e.parents,a),n=-1!==t?e.parents.slice(0,t):e.parents,o=v.grep(n,h);r.active(0<o.length&&o[0].nodeName===i)})}},he=function(e){var t,n,o,r;n="advlist",o=(t=e).settings.plugins?t.settings.plugins:"",-1===v.inArray(o.split(/[ ,]/),n)&&(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:ve(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:ve(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:(r=e,function(e){var n=e.control;r.on("nodechange",function(){var e=E.getSelectedListItems(r),t=0<e.length&&s(e[0]);n.disabled(t)})})})};e.add("lists",function(e){return pe(e),he(e),me(e),de(e)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),w=function(e){return e.getParam("media_scripts")},b=function(e){return e.getParam("audio_template_callback")},y=function(e){return e.getParam("video_template_callback")},n=function(e){return e.getParam("media_live_embeds",!0)},t=function(e){return e.getParam("media_filter_html",!0)},s=function(e){return e.getParam("media_url_resolver")},m=function(e){return e.getParam("media_alt_source",!0)},d=function(e){return e.getParam("media_poster",!0)},h=function(e){return e.getParam("media_dimensions",!0)},p=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},i=function(t){return function(e){return e?e.style[t].replace(/px$/,""):""}},a=function(i){return function(e,t){var r;e&&(e.style[i]=/^[0-9.]+$/.test(r=t)?r+"px":r)}},f={getMaxWidth:i("maxWidth"),getMaxHeight:i("maxHeight"),setMaxWidth:a("maxWidth"),setMaxHeight:a("maxHeight")},u=r.DOM,l=function(e){return u.getAttrib(e,"data-ephox-embed-iri")},j=function(e,t){return c=t,s=u.createFragment(c),""!==l(s.firstChild)?(o=t,n=u.createFragment(o).firstChild,{type:"ephox-embed-iri",source1:l(n),source2:"",poster:"",width:f.getMaxWidth(n),height:f.getMaxHeight(n)}):(i=e,r=t,p({validate:(a={},!1),allow_conditional_comments:!0,special:"script,noscript",start:function(e,t){if(a.source1||"param"!==e||(a.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(a.type||(a.type=e),a=v.extend(t.map,a)),"script"===e){var r=x(i,t.map.src);if(!r)return;a={type:"script",source1:t.map.src,width:r.width,height:r.height}}"source"===e&&(a.source1?a.source2||(a.source2=t.map.src):a.source1=t.map.src),"img"!==e||a.poster||(a.poster=t.map.src)}}).parse(r),a.source1=a.source1||a.src||a.data,a.source2=a.source2||"",a.poster=a.poster||"",a);var i,r,a,o,n,c,s},g=tinymce.util.Tools.resolve("tinymce.util.Promise"),M=function(e){var t={mp3:"audio/mpeg",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},_=tinymce.util.Tools.resolve("tinymce.html.Writer"),C=tinymce.util.Tools.resolve("tinymce.html.Schema"),S=r.DOM,F=function(e,t){var r,i,a,o;for(r in t)if(a=""+t[r],e.map[r])for(i=e.length;i--;)(o=e[i]).name===r&&(a?(e.map[r]=a,o.value=a):(delete e.map[r],e.splice(i,1)));else a&&(e.push({name:r,value:a}),e.map[r]=a)},k=function(e,t){var r,i,a=S.createFragment(e).firstChild;return f.setMaxWidth(a,t.width),f.setMaxHeight(a,t.height),r=a.outerHTML,i=_(),p(i).parse(r),i.getContent()},A=function(e,t,r){return u=e,l=S.createFragment(u),""!==S.getAttrib(l.firstChild,"data-ephox-embed-iri")?k(e,t):(i=e,a=t,o=r,c=_(),p({validate:!1,allow_conditional_comments:!(s=0),special:"script,noscript",comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){switch(e){case"video":case"object":case"embed":case"img":case"iframe":a.height!==undefined&&a.width!==undefined&&F(t,{width:a.width,height:a.height})}if(o)switch(e){case"video":F(t,{poster:a.poster,src:""}),a.source2&&F(t,{src:""});break;case"iframe":F(t,{src:a.source1});break;case"source":if(++s<=2&&(F(t,{src:a["source"+s],type:a["source"+s+"mime"]}),!a["source"+s]))return;break;case"img":if(!a.poster)return;n=!0}c.start(e,t,r)},end:function(e){if("video"===e&&o)for(var t=1;t<=2;t++)if(a["source"+t]){var r=[];r.map={},s<t&&(F(r,{src:a["source"+t],type:a["source"+t+"mime"]}),c.start("source",r,!0))}if(a.poster&&"object"===e&&o&&!n){var i=[];i.map={},F(i,{src:a.poster,width:a.width,height:a.height}),c.start("img",i,!0)}c.end(e)}},C({})).parse(i),c.getContent());var i,a,o,n,c,s,u,l},N=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],c=function(r,e){var i=v.extend({},e);if(!i.source1&&(v.extend(i,j(w(r),i.embed)),!i.source1))return"";i.source2||(i.source2=""),i.poster||(i.poster=""),i.source1=r.convertURL(i.source1,"source"),i.source2=r.convertURL(i.source2,"source"),i.source1mime=M(i.source1),i.source2mime=M(i.source2),i.poster=r.convertURL(i.poster,"poster");var t,a,o=(t=i.source1,0<(a=N.filter(function(e){return e.regex.test(t)})).length?v.extend({},a[0],{url:function(e,t){for(var r=e.regex.exec(t),i=e.url,a=function(e){i=i.replace("$"+e,function(){return r[e]?r[e]:""})},o=0;o<r.length;o++)a(o);return i.replace(/\?$/,"")}(a[0],t)}):null);if(o&&(i.source1=o.url,i.type=o.type,i.allowFullscreen=o.allowFullscreen,i.width=i.width||o.w,i.height=i.height||o.h),i.embed)return A(i.embed,i,!0);var n=x(w(r),i.source1);n&&(i.type="script",i.width=n.width,i.height=n.height);var c,s,u,l,m,d,h,p,f=b(r),g=y(r);return i.width=i.width||300,i.height=i.height||150,v.each(i,function(e,t){i[t]=r.dom.encode(e)}),"iframe"===i.type?(p=(h=i).allowFullscreen?' allowFullscreen="1"':"",'<iframe src="'+h.source1+'" width="'+h.width+'" height="'+h.height+'"'+p+"></iframe>"):"application/x-shockwave-flash"===i.source1mime?(d='<object data="'+(m=i).source1+'" width="'+m.width+'" height="'+m.height+'" type="application/x-shockwave-flash">',m.poster&&(d+='<img src="'+m.poster+'" width="'+m.width+'" height="'+m.height+'" />'),d+="</object>"):-1!==i.source1mime.indexOf("audio")?(u=i,(l=f)?l(u):'<audio controls="controls" src="'+u.source1+'">'+(u.source2?'\n<source src="'+u.source2+'"'+(u.source2mime?' type="'+u.source2mime+'"':"")+" />\n":"")+"</audio>"):"script"===i.type?'<script src="'+i.source1+'"><\/script>':(c=i,(s=g)?s(c):'<video width="'+c.width+'" height="'+c.height+'"'+(c.poster?' poster="'+c.poster+'"':"")+' controls="controls">\n<source src="'+c.source1+'"'+(c.source1mime?' type="'+c.source1mime+'"':"")+" />\n"+(c.source2?'<source src="'+c.source2+'"'+(c.source2mime?' type="'+c.source2mime+'"':"")+" />\n":"")+"</video>")},O={},P=function(t){return function(e){return c(t,e)}},T=function(e,t){var r,i,a,o,n,c=s(e);return c?(a=t,o=P(e),n=c,new g(function(t,e){var r=function(e){return e.html&&(O[a.source1]=e),t({url:a.source1,html:e.html?e.html:o(a)})};O[a.source1]?r(O[a.source1]):n({url:a.source1},r,e)})):(r=t,i=P(e),new g(function(e){e({html:i(r),url:r.source1})}))},$=function(e){return O.hasOwnProperty(e)},z=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},L=function(e,t){var r=e.find("#width")[0],i=e.find("#height")[0],a=e.find("#constrain")[0];r&&i&&a&&t(r,i,a.checked())},H=function(e,t,r){var i=e.state.get("oldVal"),a=t.state.get("oldVal"),o=e.value(),n=t.value();r&&i&&a&&o&&n&&(o!==i?(n=Math.round(o/i*n),isNaN(n)||t.value(n)):(o=Math.round(n/a*o),isNaN(o)||e.value(o))),z(e,t)},W=function(e){L(e,H)},J=function(e){var t=function(){e(function(e){W(e)})};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:t,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:t,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}},R=function(e){L(e,z)},D=W,E=o.ie&&o.ie<=8?"onChange":"onInput",I=function(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}},U=function(a,o){return function(e){var t=e.html,r=a.find("#embed")[0],i=v.extend(j(w(o),t),{source1:e.url});a.fromJSON(i),r&&(r.value(t),D(a))}},V=function(e,t){var r=e.dom.select("img[data-mce-object]");e.insertContent(t),function(e,t){var r,i,a=e.dom.select("img[data-mce-object]");for(r=0;r<t.length;r++)for(i=a.length-1;0<=i;i--)t[r]===a[i]&&a.splice(i,1);e.selection.select(a[0])}(e,r),e.nodeChanged()},B=function(i){var a,t,e,r,o,n=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onpaste:function(){setTimeout(function(){T(i,a.toJSON()).then(U(a,i))["catch"](I(i))},1)},onchange:function(e){var r,t;T(i,a.toJSON()).then(U(a,i))["catch"](I(i)),r=a,t=e.meta,v.each(t,function(e,t){r.find("#"+t).value(e)})},onbeforecall:function(e){e.meta=a.toJSON()}}],c=[];if(m(i)&&c.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),d(i)&&c.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),h(i)){var s=J(function(e){e(a),t=a.toJSON(),a.find("#embed").value(A(t.embed,t))});n.push(s)}r=(e=i).selection.getNode(),o=r.getAttribute("data-ephox-embed-iri"),t=o?{source1:o,"data-ephox-embed-iri":o,width:f.getMaxWidth(r),height:f.getMaxHeight(r)}:r.getAttribute("data-mce-object")?j(w(e),e.serializer.serialize(r,{selection:!0})):{};var u={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:function(e){var t=e.selection.getNode();if(t.getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri"))return e.selection.getContent()}(i),multiline:!0,rows:5,label:"Source"};u[E]=function(){t=v.extend({},j(w(i),this.value())),this.parent().parent().fromJSON(t)};var l=[{title:"General",type:"form",items:n},{title:"Embed",type:"container",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},u]}];0<c.length&&l.push({title:"Advanced",type:"form",items:c}),a=i.windowManager.open({title:"Insert/edit media",data:t,bodyType:"tabpanel",body:l,onSubmit:function(){var t,e;D(a),t=i,(e=a.toJSON()).embed=A(e.embed,e),e.embed&&$(e.source1)?V(t,e.embed):T(t,e).then(function(e){V(t,e.html)})["catch"](I(t))}}),R(a)},G=function(e){return{showDialog:function(){B(e)}}},q=function(e){e.addCommand("mceMedia",function(){B(e)})},K=tinymce.util.Tools.resolve("tinymce.html.Node"),Q=function(a,e){if(!1===t(a))return e;var o,n=_();return p({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(e){n.comment(e)},cdata:function(e){n.cdata(e)},text:function(e,t){n.text(e,t)},start:function(e,t,r){if(o=!0,"script"!==e&&"noscript"!==e){for(var i=0;i<t.length;i++){if(0===t[i].name.indexOf("on"))return;"style"===t[i].name&&(t[i].value=a.dom.serializeStyle(a.dom.parseStyle(t[i].value),e))}n.start(e,t,r),o=!1}},end:function(e){o||n.end(e)}},C({})).parse(e),n.getContent()},X=function(e,t){var r,i=t.name;return(r=new K("img",1)).shortEnded=!0,Z(e,t,r),r.attr({width:t.attr("width")||"300",height:t.attr("height")||("audio"===i?"30":"150"),style:t.attr("style"),src:o.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),r},Y=function(e,t){var r,i,a,o=t.name;return(r=new K("span",1)).attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":o,"class":"mce-preview-object mce-object-"+o}),Z(e,t,r),(i=new K(o,1)).attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),"class":t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"}),(a=new K("span",1)).attr("class","mce-shim"),r.append(i),r.append(a),r},Z=function(e,t,r){var i,a,o,n,c;for(n=(o=t.attributes).length;n--;)i=o[n].name,a=o[n].value,"width"!==i&&"height"!==i&&"style"!==i&&("data"!==i&&"src"!==i||(a=e.convertURL(a,i)),r.attr("data-mce-p-"+i,a));(c=t.firstChild&&t.firstChild.value)&&(r.attr("data-mce-html",escape(Q(e,c))),r.firstChild=null)},ee=function(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri"))return!0;return!1},te=function(a){return function(e){for(var t,r,i=e.length;i--;)(t=e[i]).parent&&(t.parent.attr("data-mce-object")||("script"!==t.name||(r=x(w(a),t.attr("src"))))&&(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),"iframe"===t.name&&n(a)&&o.ceFalse?ee(t)||t.replace(Y(a,t)):ee(t)||t.replace(X(a,t))))}},re=function(d){d.on("preInit",function(){var t=d.schema.getSpecialElements();v.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var r=d.schema.getBoolAttrs();v.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",te(d)),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,i,a,o,n,c,s,u,l=e.length;l--;)if((r=e[l]).parent){for(s=r.attr(t),i=new K(s,1),"audio"!==s&&"script"!==s&&((u=r.attr("class"))&&-1!==u.indexOf("mce-preview-object")?i.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):i.attr({width:r.attr("width"),height:r.attr("height")})),i.attr({style:r.attr("style")}),a=(o=r.attributes).length;a--;){var m=o[a].name;0===m.indexOf("data-mce-p-")&&i.attr(m.substr(11),o[a].value)}"script"===s&&i.attr("type","text/javascript"),(n=r.attr("data-mce-html"))&&((c=new K("#text",3)).raw=!0,c.value=Q(d,unescape(n)),i.append(c)),r.replace(i)}})}),d.on("setContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim",t).length&&r.append('<span class="mce-shim"></span>')})})},ie=function(e){e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)})},ae=function(t){t.on("click keyup",function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),t.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");"audio"!==t&&"script"!==t||e.preventDefault()}),t.on("objectResized",function(e){var t,r=e.target;r.getAttribute("data-mce-object")&&(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(A(t,{width:e.width,height:e.height}))))})},oe=function(e){e.addButton("media",{tooltip:"Insert/edit media",cmd:"mceMedia",stateSelector:["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"]}),e.addMenuItem("media",{icon:"media",text:"Media",cmd:"mceMedia",context:"insert",prependToContext:!0})};e.add("media",function(e){return q(e),oe(e),ie(e),re(e),ae(e),G(e)})}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){var t,i=(t=n).plugins.visualchars&&t.plugins.visualchars.isEnabled()?'<span class="mce-nbsp"> </span>':" ";n.insertContent(function(n,e){for(var t="",i=0;i<e;i++)t+=n;return t}(i,e)),n.dom.setAttrib(n.dom.select("span.mce-nbsp"),"data-mce-bogus","1")},e=function(n){n.addCommand("mceNonBreaking",function(){i(n,1)})},o=tinymce.util.Tools.resolve("tinymce.util.VK"),a=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},t=function(e){var t=a(e);0<t&&e.on("keydown",function(n){if(n.keyCode===o.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),i(e,t)}})},r=function(n){n.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),n.addMenuItem("nonbreaking",{icon:"nonbreaking",text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"})};n.add("nonbreaking",function(n){e(n),r(n),t(n)})}();!function(){"use strict";var u=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return u(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.settings.plugins)||!t.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},s=function(e,t){return{clipboard:e,quirks:t}},f=function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})},d=function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})},l=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},n=function(e,t){return e.fire("paste",{ieFake:t})},m={shouldPlainTextInform:function(e){return e.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(e){return e.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(e){return e.getParam("paste_data_images",!1)},shouldFilterDrop:function(e){return e.getParam("paste_filter_drop",!0)},getPreProcess:function(e){return e.getParam("paste_preprocess")},getPostProcess:function(e){return e.getParam("paste_postprocess")},getWebkitStyles:function(e){return e.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(e){return e.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(e){return e.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(e){return e.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(e){return e.getParam("paste_as_text",!1)},getRetainStyleProps:function(e){return e.getParam("paste_retain_style_properties")},getWordValidElements:function(e){return e.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(e){return e.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(e){return e.getParam("paste_enable_default_filters",!0)}},r=function(e,t,n){var r,a,i;"text"===t.pasteFormat.get()?(t.pasteFormat.set("html"),l(e,!1)):(t.pasteFormat.set("text"),l(e,!0),i=e,!1===n.get()&&m.shouldPlainTextInform(i)&&(a="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=e).notificationManager.open({text:r.translate(a),type:"info"}),n.set(!0))),e.focus()},c=function(e,n,t){e.addCommand("mceTogglePlainTextPaste",function(){r(e,n,t)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&n.pasteHtml(t.content,t.internal),t.text&&n.pasteText(t.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),b=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=tinymce.util.Tools.resolve("tinymce.util.VK"),e="x-tinymce/html",i="\x3c!-- "+e+" --\x3e",p=function(e){return i+e},g=function(e){return e.replace(i,"")},y=function(e){return-1!==e.indexOf(i)},x=function(){return e},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),w=function(e){return e.replace(/\r?\n/g,"<br>")},_=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRaw(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),i="</"+t+">",o=b.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===o.length?o[0]:b.map(o,function(e){return a+e+i}).join("")},D=function(e){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e)},T=function(e,t,n){return t?_(e,t,n):w(e)},C=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),R=tinymce.util.Tools.resolve("tinymce.html.Schema"),F=tinymce.util.Tools.resolve("tinymce.html.Serializer");function E(t,e){return b.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}var S={filter:E,innerText:function(t){var n=R(),r=C({},n),a="",i=n.getShortEndedElements(),o=b.makeMap("script noscript style textarea video audio iframe object"," "),s=n.getBlockElements();return t=E(t,[/<!\[[^\]]+\]>/g]),function e(t){var n=t.name,r=t;if("br"!==n)if(i[n]&&(a+=" "),o[n])a+=" ";else{if(3===t.type&&(a+=t.value),!t.shortEnded&&(t=t.firstChild))for(;e(t),t=t.next;);s[n]&&r.next&&(a+="\n","p"===n&&(a+="\n"))}else a+="\n"}(r.parse(t)),a},trimHtml:function(e){return e=E(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(e){var t=0;return function(){return e+t++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}};function I(t){var n,e;return e=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],t=t.replace(/^[\u00a0 ]+/,""),b.each(e,function(e){if(e.test(t))return!(n=!0)}),n}function M(e){var i,o,s=1;function n(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)for(;t+=n(e),e=e.next;);return t}function l(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!l(e,t))return!1}while(e=e.next);return!0}function t(t,n,r){var a=t._listLevel||s;a!==s&&(a<s?i&&(i=i.parent.parent):(o=i,i=null)),i&&i.name===n?i.append(t):(o=o||i,i=new k(n,1),1<r&&i.attr("start",""+r),t.wrap(i)),t.name="li",s<a&&o&&o.lastChild.append(i),s=a,function e(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;e(t),t=t.next;);}(t),l(t,/^\u00a0+/),l(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),l(t,/^\u00a0+/)}for(var r=[],a=e.firstChild;null!=a;)if(r.push(a),null!==(a=a.walk()))for(;void 0!==a&&a.parent!==e;)a=a.walk();for(var u=0;u<r.length;u++)if("p"===(e=r[u]).name&&e.firstChild){var c=n(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){t(e,"ul");continue}if(I(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),t(e,"ol",d);continue}if(e._listLevel){t(e,"ul",1);continue}i=null}else o=i,i=null}function O(n,r,a,i){var o,s={},e=n.dom.parseStyle(i);return b.each(e,function(e,t){switch(t){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(i))&&(a._listLevel=parseInt(o[1],10)),/Ignore/i.test(e)&&a.firstChild&&(a._listIgnore=!0,a.firstChild._listIgnore=!0);break;case"horiz-align":t="text-align";break;case"vert-align":t="vertical-align";break;case"font-color":case"mso-foreground":t="color";break;case"mso-background":case"mso-highlight":t="background";break;case"font-weight":case"font-style":return void("normal"!==e&&(s[t]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void a.remove()}0!==t.indexOf("mso-comment")?0!==t.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[t])&&(s[t]=e):a.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],a.wrap(new k("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],a.wrap(new k("i",1))),(s=n.dom.serializeStyle(s,a.name))||null}var A={preProcess:function(e,t){return m.shouldUseDefaultFilters(e)?function(r,e){var t,a;(t=m.getRetainStyleProps(r))&&(a=b.makeMap(t.split(/[, ]/))),e=S.filter(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return 0<t.length?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=R({valid_elements:n,valid_children:"-li[p]"});b.each(i.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var o=C({},i);o.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)(t=e[n]).attr("style",O(r,a,t,t.attr("style"))),"span"===t.name&&t.parent&&!t.attributes.length&&t.unwrap()}),o.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),o.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),o.addNodeFilter("a",function(e){for(var t,n,r,a=e.length;a--;)if(n=(t=e[a]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var s=o.parse(e);return m.shouldConvertWordFakeLists(r)&&M(s),e=F({validate:r.settings.validate},i).serialize(s)}(e,t):t},isWordContent:function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}},H=function(e,t){return{content:e,cancelled:t}},B=function(e,t,n,r){var a,i,o,s,l,u,c=f(e,t,n,r);return e.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(a=e,i=c.content,o=n,s=r,l=a.dom.create("div",{style:"display:none"},i),u=d(a,l,o,s),H(u.node.innerHTML,u.isDefaultPrevented())):H(c.content,c.isDefaultPrevented())},L=function(e,t,n){var r=A.isWordContent(t),a=r?A.preProcess(e,t):t;return B(e,a,n,r)},$=function(e,t){return e.insertContent(t,{merge:m.shouldMergeFormats(e),paste:!0}),!0},j=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},W=function(e){return j(e)&&/.(gif|jpe?g|png)$/.test(e)},N=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!j(t)||(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.execCommand("mceInsertLink",!1,a)}),0));var r,a,i},V=function(e,t,n){return!!W(t)&&(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.insertContent('<img src="'+a+'">')}),!0);var r,a,i},z=function(e,t){var n,r;!1===m.isSmartPasteEnabled(e)?$(e,t):(n=e,r=t,b.each([N,V,$],function(e){return!0!==e(n,r,$)}))},K=function(e,t,n){var r=n||y(t),a=L(e,g(t),r);!1===a.cancelled&&z(e,a.content)},U=function(e,t){t=e.dom.encode(t).replace(/\r\n/g,"\n"),t=T(t,e.settings.forced_root_block,e.settings.forced_root_block_attrs),K(e,t,!1)},G=function(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var a=e.types[r];try{t[a]=e.getData(a)}catch(i){t[a]=""}}}return t},X=function(e,t){return t in e&&0<e[t].length},q=function(e){return X(e,"text/html")||X(e,"text/plain")},Y=S.createIdGenerator("mceclip"),Z=function(e,t,n,r){t&&(e.selection.setRng(t),t=null);var a,i,o,s,l,u,c,f=n.result,d=-1!==(i=(a=f).indexOf(","))?a.substr(i+1):null,m=Y(),p=e.settings.images_reuse_filename&&r.name?(o=e,s=r.name,(l=s.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(l[1]):null):m,g=new Image;if(g.src=f,u=e.settings,c=g,!u.images_dataimg_filter||u.images_dataimg_filter(c)){var v,h=e.editorUpload.blobCache,b=void 0;(v=h.findFirst(function(e){return e.base64()===d}))?b=v:(b=h.create(m,r,d,p),h.add(b)),K(e,'<img src="'+b.blobUri()+'">',!1)}else K(e,'<img src="'+f+'">',!1)},J=function(o,s,l){var e="paste"===s.type?s.clipboardData:s.dataTransfer;function t(e){var t,n,r,a=!1;if(e)for(t=0;t<e.length;t++)if(n=e[t],/^image\/(jpeg|png|gif|bmp)$/.test(n.type)){var i=n.getAsFile?n.getAsFile():n;(r=new window.FileReader).onload=Z.bind(null,o,l,r,i),r.readAsDataURL(i),s.preventDefault(),a=!0}return a}if(o.settings.paste_data_images&&e)return t(e.items)||t(e.files)},Q=function(e){return a.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode},ee=function(c,f,d){var m,p=0;function g(e,t,n,r){var a,i;X(e,"text/html")?a=e["text/html"]:(a=f.getHtml(),r=r||y(a),f.isDefaultContent(a)&&(n=!0)),a=S.trimHtml(a),f.remove(),i=!1===r&&D(a),a.length&&!i||(n=!0),n&&(a=X(e,"text/plain")&&i?e["text/plain"]:S.innerText(a)),f.isDefaultContent(a)?t||c.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?U(c,a):K(c,a,r)}c.on("keydown",function(e){function t(e){Q(e)&&!e.isDefaultPrevented()&&f.remove()}if(Q(e)&&!e.isDefaultPrevented()){if((m=e.shiftKey&&86===e.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(e.stopImmediatePropagation(),p=(new Date).getTime(),v.ie&&m)return e.preventDefault(),void n(c,!0);f.remove(),f.create(),c.once("keyup",t),c.once("paste",function(){c.off("keyup",t)})}}),c.on("paste",function(e){var t,n,r,a=(new Date).getTime(),i=(t=c,n=G(e.clipboardData||t.getDoc().dataTransfer),S.isMsEdge()?b.extend(n,{"text/html":""}):n),o=(new Date).getTime()-a,s=(new Date).getTime()-p-o<1e3,l="text"===d.get()||m,u=X(i,x());m=!1,e.isDefaultPrevented()||(r=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?f.remove():q(i)||!J(c,e,f.getLastRng()||c.selection.getRng())?(s||e.preventDefault(),!v.ie||s&&!e.ieFake||X(i,"text/html")||(f.create(),c.dom.bind(f.getEl(),"paste",function(e){e.stopPropagation()}),c.getDoc().execCommand("Paste",!1,null),i["text/html"]=f.getHtml()),X(i,"text/html")?(e.preventDefault(),u||(u=y(i["text/html"])),g(i,s,l,u)):h.setEditorTimeout(c,function(){g(i,s,l,u)},0)):f.remove()})},te=function(e){return v.ie&&e.inline?document.body:e.getBody()},ne=function(t,e){var n;te(n=t)!==n.getBody()&&t.dom.bind(e,"paste keyup",function(e){setTimeout(function(){t.fire("paste")},0)})},re=function(e){return e.dom.get("mcepastebin")},ae=function(e,t){return t===e},ie=function(o){var s=u(null),l="%MCEPASTEBIN%";return{create:function(){return t=s,n=l,a=(e=o).dom,i=e.getBody(),t.set(e.selection.getRng()),r=e.dom.add(te(e),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(v.ie||v.gecko)&&a.setStyle(r,"left","rtl"===a.getStyle(i,"direction",!0)?65535:-65535),a.bind(r,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),ne(e,r),r.focus(),void e.selection.select(r,!0);var e,t,n,r,a,i},remove:function(){return function(e,t){if(re(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(o,s)},getEl:function(){return re(o)},getHtml:function(){return function(n){var t,e,r,a,i,o=function(e,t){e.appendChild(t),n.dom.remove(t,!0)};for(e=b.grep(te(n).childNodes,function(e){return"mcepastebin"===e.id}),t=e.shift(),b.each(e,function(e){o(t,e)}),r=(a=n.dom.select("div[id=mcepastebin]",t)).length-1;0<=r;r--)i=n.dom.create("div"),t.insertBefore(i,a[r]),o(i,a[r]);return t?t.innerHTML:""}(o)},getLastRng:function(){return s.get()},isDefault:function(){return e=l,n=re(o),(t=n)&&"mcepastebin"===t.id&&ae(e,n.innerHTML);var e,t,n},isDefaultContent:function(e){return ae(l,e)}}},oe=function(n,e){var t=ie(n);return n.on("preInit",function(){return ee(o=n,t,e),void o.parser.addNodeFilter("img",function(e,t,n){var r,a=function(e){e.attr("data-mce-object")||s===v.transparentSrc||e.remove()};if(!o.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=e.length;i--;)(s=e[i].attributes.map.src)&&(0===s.indexOf("webkit-fake-url")?a(e[i]):o.settings.allow_html_data_urls||0!==s.indexOf("data:")||a(e[i]))});var o,s}),{pasteFormat:e,pasteHtml:function(e,t){return K(n,e,t)},pasteText:function(e){return U(n,e)},pasteImageData:function(e,t){return J(n,e,t)},getDataTransferItems:G,hasHtmlOrText:q,hasContentType:X}},se=function(){},le=function(e,t,n){if(r=e,!1!==v.iOS||r===undefined||"function"!=typeof r.setData||!0===S.isMsEdge())return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(x(),t),!0}catch(a){return!1}var r},ue=function(e,t,n,r){le(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},ce=function(s){return function(e,t){var n=p(e),r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(a),s.dom.add(s.getBody(),r);var i=s.selection.getRng();a.focus();var o=s.dom.createRng();o.selectNodeContents(a),s.selection.setRng(o),setTimeout(function(){s.selection.setRng(i),r.parentNode.removeChild(r),t()},0)}},fe=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},de=function(e){var t,n;e.on("cut",(t=e,function(e){!1===t.selection.isCollapsed()&&ue(e,fe(t),ce(t),function(){setTimeout(function(){t.execCommand("Delete")},0)})})),e.on("copy",(n=e,function(e){!1===n.selection.isCollapsed()&&ue(e,fe(n),ce(n),se)}))},me=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),pe=function(e,t){return me.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},ge=function(e,t){e.focus(),e.selection.setRng(t)},ve=function(o,s,l){m.shouldBlockDrop(o)&&o.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),m.shouldPasteDataImages(o)||o.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0<t.files.length&&e.preventDefault()}),o.on("drop",function(e){var t,n;if(n=pe(o,e),!e.isDefaultPrevented()&&!l.get()){t=s.getDataTransferItems(e.dataTransfer);var r,a=s.hasContentType(t,x());if((s.hasHtmlOrText(t)&&(!(r=t["text/plain"])||0!==r.indexOf("file://"))||!s.pasteImageData(e,n))&&n&&m.shouldFilterDrop(o)){var i=t["mce-internal"]||t["text/html"]||t["text/plain"];i&&(e.preventDefault(),h.setEditorTimeout(o,function(){o.undoManager.transact(function(){t["mce-internal"]&&o.execCommand("Delete"),ge(o,n),i=S.trimHtml(i),t["text/html"]?s.pasteHtml(i,a):s.pasteText(i)})}))}}}),o.on("dragstart",function(e){l.set(!0)}),o.on("dragover dragend",function(e){m.shouldPasteDataImages(o)&&!1===l.get()&&(e.preventDefault(),ge(o,pe(o,e))),"dragend"===e.type&&l.set(!1)})},he=function(e){var t=e.plugins.paste,n=m.getPreProcess(e);n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=m.getPostProcess(e);r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})};function be(t,n){t.on("PastePreProcess",function(e){e.content=n(t,e.content,e.internal,e.wordContent)})}function ye(e,t){if(!A.isWordContent(t))return t;var n=[];b.each(e.schema.getBlockElements(),function(e,t){n.push(t)});var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return t=S.filter(t,[[r,"$1"]]),t=S.filter(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function xe(e,t,n,r){if(r||n)return t;var u,a=m.getWebkitStyles(e);if(!1===m.shouldRemoveWebKitStyles(e)||"all"===a)return t;if(a&&(u=a.split(/[, ]/)),u){var c=e.dom,f=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var a=c.parseStyle(c.decode(n)),i={};if("none"===u)return t+r;for(var o=0;o<u.length;o++){var s=a[u[o]],l=c.getStyle(f,u[o],!0);/color/.test(u[o])&&(s=c.toHex(s),l=c.toHex(l)),l!==s&&(i[u[o]]=s)}return(i=c.serializeStyle(i,"span"))?t+' style="'+i+'"'+r:t+r})}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function Pe(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}var we=function(e){var t,n;v.webkit&&be(e,xe),v.ie&&(be(e,ye),n=Pe,(t=e).on("PastePostProcess",function(e){n(t,e.node)}))},_e=function(e){return function(){return e}},De=(_e(!1),_e(!0),function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var o=new Array(arguments.length-1),n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var a=o.concat(n);return i.apply(null,a)}}),Te=function(e,t,n){var r=n.control;r.active("text"===t.pasteFormat.get()),e.on("PastePlainTextToggle",function(e){r.active(e.state)})},Ce=function(e,t){var n=De(Te,e,t);e.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:t.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})};t.add("paste",function(e){if(!1===o(e)){var t=u(!1),n=u(!1),r=u(m.isPasteAsTextEnabled(e)?"text":"html"),a=oe(e,r),i=we(e);return Ce(e,a),c(e,a,t),he(e),de(e),ve(e,a,n),s(a,i)}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.Env"),c=function(e){return parseInt(e.getParam("plugin_preview_width","650"),10)},a=function(e){return parseInt(e.getParam("plugin_preview_height","500"),10)},s=function(e){return e.getParam("content_style","")},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){var n="",i=t.dom.encode,e=s(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>"),d.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'">'});var o=t.settings.body_id||"tinymce";-1!==o.indexOf("=")&&(o=(o=t.getParam("body_id","","hash"))[t.id]||o);var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var c=t.settings.directionality?' dir="'+t.settings.directionality+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(o)+'" class="mce-content-body '+i(r)+'"'+i(c)+">"+t.getContent()+'<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);<\/script> </body></html>'},m=function(e,t,n){var i=l(e);if(n)t.src="data:text/html;charset=utf-8,"+encodeURIComponent(i);else{var o=t.contentWindow.document;o.open(),o.write(i),o.close()}},t=function(n){var i=!r.ie,e='<iframe src="" frameborder="0"'+(i?' sandbox="allow-scripts"':"")+"></iframe>",t=c(n),o=a(n);n.windowManager.open({title:"Preview",width:t,height:o,html:e,buttons:{text:"Close",onclick:function(e){e.control.parent().parent().close()}},onPostRender:function(e){var t=e.control.getEl("body").firstChild;m(n,t,i)}})},n=function(e){e.addCommand("mcePreview",function(){t(e)})},i=function(e){e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})};e.add("preview",function(e){n(e),i(e)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){t.addCommand("mcePrint",function(){t.getWin().print()})},i=function(t){t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print"})};t.add("print",function(t){n(t),i(t),t.addShortcut("Meta+P","","mcePrint")})}();!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");function h(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var u={findAndReplaceDOMText:function(t,n,r,a,i){var o,d,v,f,p,g,c=[],l=0;function s(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(v=n.ownerDocument,f=i.getBlockElements(),p=i.getWhiteSpaceElements(),g=i.getShortEndedElements(),d=function e(t){var n;if(3===t.nodeType)return t.data;if(p[t.nodeName]&&!f[t.nodeName])return"";if(n="",h(t))return"\n";if((f[t.nodeName]||g[t.nodeName])&&(n+="\n"),t=t.firstChild)for(;n+=e(t),t=t.nextSibling;);return n}(n)){if(t.global)for(;o=t.exec(d);)c.push(s(o,a));else o=d.match(t),c.push(s(o,a));return c.length&&(l=c.length,function(e,t,n){var r,a,i,o,d=[],c=0,l=e,s=t.shift(),u=0;e:for(;;){if((f[l.nodeName]||g[l.nodeName]||h(l))&&c++,3===l.nodeType&&(!a&&l.length+c>=s[1]?(a=l,o=s[1]-c):r&&d.push(l),!r&&l.length+c>s[0]&&(r=l,i=s[0]-c),c+=l.length),r&&a){if(l=n({startNode:r,startNodeIndex:i,endNode:a,endNodeIndex:o,innerNodes:d,match:s[2],matchIndex:u}),c-=a.length-o,a=r=null,d=[],u++,!(s=t.shift()))break}else if(p[l.nodeName]&&!f[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!h(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(n,c,function(e){var m;if("function"!=typeof e){var r=e.nodeType?e:v.createElement(e);m=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(v.createTextNode(e)),n}}else m=e;return function(e){var t,n,r,a=e.startNode,i=e.endNode,o=e.matchIndex;if(a===i){var d=a;r=d.parentNode,0<e.startNodeIndex&&(t=v.createTextNode(d.data.substring(0,e.startNodeIndex)),r.insertBefore(t,d));var c=m(e.match[0],o);return r.insertBefore(c,d),e.endNodeIndex<d.length&&(n=v.createTextNode(d.data.substring(e.endNodeIndex)),r.insertBefore(n,d)),d.parentNode.removeChild(d),c}t=v.createTextNode(a.data.substring(0,e.startNodeIndex)),n=v.createTextNode(i.data.substring(e.endNodeIndex));for(var l=m(a.data.substring(e.startNodeIndex),o),s=[],u=0,f=e.innerNodes.length;u<f;++u){var p=e.innerNodes[u],g=m(p.data,o);p.parentNode.replaceChild(g,p),s.push(g)}var h=m(i.data.substring(0,e.endNodeIndex),o);return(r=a.parentNode).insertBefore(t,a),r.insertBefore(l,a),r.removeChild(a),(r=i.parentNode).insertBefore(h,i),r.insertBefore(n,i),r.removeChild(i),h}}(r))),l}}},g=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},m=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},o=function(e,t){var n,r=[];if((n=p.toArray(e.getBody().getElementsByTagName("span"))).length)for(var a=0;a<n.length;a++){var i=g(n[a]);null!==i&&i.length&&i===t.toString()&&r.push(n[a])}return r},f=function(e,t,n){var r=t.get(),a=e.dom;(n=!1!==n)?r++:r--,a.removeClass(o(e,t.get()),"mce-match-marker-selected");var i=o(e,r);return i.length?(a.addClass(o(e,r),"mce-match-marker-selected"),e.selection.scrollIntoView(i[0]),r):-1},v=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},x=function(e,t){var n=f(e,t,!0);-1!==n&&t.set(n)},b=function(e,t){var n=f(e,t,!1);-1!==n&&t.set(n)},N=function(e){var t=g(e);return null!==t&&0<t.length},y=function(e,t,n){var r,a,i,o;for(a=p.toArray(e.getBody().getElementsByTagName("span")),r=0;r<a.length;r++){var d=g(a[r]);null!==d&&d.length&&(d===t.get().toString()&&(i||(i=a[r].firstChild),o=a[r].firstChild),m(a[r]))}if(i&&o){var c=e.dom.createRng();return c.setStart(i,0),c.setEnd(o,o.data.length),!1!==n&&e.selection.setRng(c),c}},k=function(e,t){return 0<o(e,t.get()+1).length},C=function(e,t){return 0<o(e,t.get()-1).length},T={done:y,find:function(e,t,n,r,a){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"\\s"),n=a?"\\b"+n+"\\b":n;var i,o,d,c,l,s=(i=e,o=t,d=new RegExp(n,r?"g":"gi"),(l=i.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",c=i.getBody(),y(i,o,!1),u.findAndReplaceDOMText(d,c,l,!1,i.schema));return s&&(t.set(-1),t.set(f(e,t,!0))),s},next:x,prev:b,replace:function(e,t,n,r,a){var i,o,d,c,l,s,u=t.get();for(r=!1!==r,d=e.getBody(),o=p.grep(p.toArray(d.getElementsByTagName("span")),N),i=0;i<o.length;i++){var f=g(o[i]);if(c=l=parseInt(f,10),a||c===t.get()){for(n.length?(o[i].firstChild.nodeValue=n,m(o[i])):v(e.dom,o[i]);o[++i];){if((c=parseInt(g(o[i]),10))!==l){i--;break}v(e.dom,o[i])}r&&u--}else l>t.get()&&o[i].setAttribute("data-mce-index",l-1)}return t.set(u),r?(s=k(e,t),x(e,t)):(s=C(e,t),b(e,t)),!a&&s},hasNext:k,hasPrev:C},n=function(r,a){return{done:function(e){return T.done(r,a,e)},find:function(e,t,n){return T.find(r,a,e,t,n)},next:function(){return T.next(r,a)},prev:function(){return T.prev(r,a)},replace:function(e,t,n){return T.replace(r,a,e,t,n)}}},a=function(i,o){var e,d={};function c(){s.statusbar.find("#next").disabled(!1===T.hasNext(i,o)),s.statusbar.find("#prev").disabled(!1===T.hasPrev(i,o))}function l(){i.windowManager.alert("Could not find the specified string.",function(){s.find("#find")[0].focus()})}i.undoManager.add(),e=p.trim(i.selection.getContent({format:"text"}));var s=i.windowManager.open({layout:"flex",pack:"center",align:"center",onClose:function(){i.focus(),T.done(i,o),i.undoManager.add()},onSubmit:function(e){var t,n,r,a;return e.preventDefault(),n=s.find("#case").checked(),a=s.find("#words").checked(),(r=s.find("#find").value()).length?d.text===r&&d.caseState===n&&d.wholeWord===a?T.hasNext(i,o)?(T.next(i,o),void c()):void l():((t=T.find(i,o,r,n,a))||l(),s.statusbar.items().slice(1).disabled(0===t),c(),void(d={text:r,caseState:n,wholeWord:a})):(T.done(i,o,!1),void s.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){s.submit()}},{text:"Replace",disabled:!0,onclick:function(){T.replace(i,o,s.find("#replace").value())||(s.statusbar.items().slice(1).disabled(!0),o.set(-1),d={})}},{text:"Replace all",disabled:!0,onclick:function(){T.replace(i,o,s.find("#replace").value(),!0,!0),s.statusbar.items().slice(1).disabled(!0),d={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){T.prev(i,o),c()}},{text:"Next",name:"next",disabled:!0,onclick:function(){T.next(i,o),c()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:e},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}})},i=function(e,t){e.addCommand("SearchReplace",function(){a(e,t)})},d=function(e,t){return function(){a(e,t)}},c=function(e,t){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:d(e,t),separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",onclick:d(e,t)}),e.shortcuts.add("Meta+F","",d(e,t))};e.add("searchreplace",function(e){var t=r(-1);return i(e,t),c(e,t),n(e,t)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),s=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==f.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=y.explode(d(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):m.get(e[0]):":next"===e[1]?u(1):m.get(e[1]))){var t=c.get(o.id||o.name);o.id&&t?t.focus():a.setTimeout(function(){s.webkit||window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(t){return/INPUT|TEXTAREA|BUTTON/.test(t.tagName)&&c.get(n.id)&&-1!==t.tabIndex&&function e(t){return"BODY"===t.nodeName||"hidden"!==t.type&&"none"!==t.style.display&&"hidden"!==t.style.visibility&&e(t.parentNode)}(t)}if(o=m.select(":input:enabled,*[tabindex]:not(iframe)"),y.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&m.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),s.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}();!function(){"use strict";var n,e,t,r,o,i,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n){return function(){return n}},c=a(!1),l=a(!0),y={noop:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e]},noarg:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t()}},compose:function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,arguments))}},constant:a,identity:function(n){return n},tripleEquals:function(n,e){return n===e},curry:function(i){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var u=new Array(arguments.length-1),t=1;t<arguments.length;t++)u[t-1]=arguments[t];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=new Array(arguments.length),r=0;r<t.length;r++)t[r]=arguments[r];var o=u.concat(t);return i.apply(null,o)}},not:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,arguments)}},die:function(n){return function(){throw new Error(n)}},apply:function(n){return n()},call:function(n){n()},never:c,always:l},s=y.never,f=y.always,d=function(){return m},m=(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.")},or:t,orThunk:e,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:s,forall:f,filter:d,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:y.constant("none()")},Object.freeze&&Object.freeze(r),r),g=function(t){var n=function(){return 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,or:e,orThunk:e,map:function(n){return g(n(t))},ap:function(n){return n.fold(d,function(n){return g(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:m},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(s,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:g,none:d,from:function(n){return null===n||n===undefined?m:g(n)}},h=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===e}},p={isString:h("string"),isObject:h("object"),isArray:h("array"),isNull:h("null"),isBoolean:h("boolean"),isUndefined:h("undefined"),isFunction:h("function"),isNumber:h("number")},v=(o=Array.prototype.indexOf)===undefined?function(n,e){return D(n,e)}:function(n,e){return o.call(n,e)},b=function(n,e){return-1<v(n,e)},w=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,n)}return r},C=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t,n)},R=function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t,n)},S=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r,n)&&t.push(i)}return t},T=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t,n))return x.some(t);return x.none()},D=function(n,e){for(var t=0,r=n.length;t<r;++t)if(n[t]===e)return t;return-1},k=Array.prototype.push,A=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!Array.prototype.isPrototypeOf(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);k.apply(e,n[t])}return e},O=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t,n))return!1;return!0},N=Array.prototype.slice,E=p.isFunction(Array.from)?Array.from:function(n){return N.call(n)},P={map:w,each:C,eachr:R,partition:function(n,e){for(var t=[],r=[],o=0,i=n.length;o<i;o++){var u=n[o];(e(u,o,n)?t:r).push(u)}return{pass:t,fail:r}},filter:S,groupBy:function(n,e){if(0===n.length)return[];for(var t=e(n[0]),r=[],o=[],i=0,u=n.length;i<u;i++){var a=n[i],c=e(a);c!==t&&(r.push(o),o=[]),t=c,o.push(a)}return 0!==o.length&&r.push(o),r},indexOf:function(n,e){var t=v(n,e);return-1===t?x.none():x.some(t)},foldr:function(n,e,t){return R(n,function(n){t=e(t,n)}),t},foldl:function(n,e,t){return C(n,function(n){t=e(t,n)}),t},find:function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t,n))return x.some(o)}return x.none()},findIndex:T,flatten:A,bind:function(n,e){var t=w(n,e);return A(t)},forall:O,exists:function(n,e){return T(n,e).isSome()},contains:b,equal:function(n,t){return n.length===t.length&&O(n,function(n,e){return n===t[e]})},reverse:function(n){var e=N.call(n,0);return e.reverse(),e},chunk:function(n,e){for(var t=[],r=0;r<n.length;r+=e){var o=n.slice(r,r+e);t.push(o)}return t},difference:function(n,e){return S(n,function(n){return!b(e,n)})},mapToObject:function(n,e){for(var t={},r=0,o=n.length;r<o;r++){var i=n[r];t[String(i)]=e(i,r)}return t},pure:function(n){return[n]},sort:function(n,e){var t=N.call(n,0);return t.sort(e),t},range:function(n,e){for(var t=[],r=0;r<n;r++)t.push(e(r));return t},head:function(n){return 0===n.length?x.none():x.some(n[0])},last:function(n){return 0===n.length?x.none():x.some(n[n.length-1])},from:E},B=(i=Object.keys)===undefined?function(n){var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(t);return e}:i,I=function(n,e){for(var t=B(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i,n)}},W=function(r,o){var i={};return I(r,function(n,e){var t=o(n,e,r);i[t.k]=t.v}),i},M=function(n,t){var r=[];return I(n,function(n,e){r.push(t(n,e))}),r},L=function(n){return M(n,function(n){return n})},q={bifilter:function(n,t){var r={},o={};return I(n,function(n,e){(t(n,e)?r:o)[e]=n}),{t:r,f:o}},each:I,map:function(n,r){return W(n,function(n,e,t){return{k:e,v:r(n,e,t)}})},mapToArray:M,tupleMap:W,find:function(n,e){for(var t=B(n),r=0,o=t.length;r<o;r++){var i=t[r],u=n[i];if(e(u,i,n))return x.some(u)}return x.none()},keys:B,values:L,size:function(n){return L(n).length}},j=function(n){return n.slice(0).sort()},_=function(n,e){throw new Error("All required keys ("+j(n).join(", ")+") were not specified. Specified keys were: "+j(e).join(", ")+".")},z=function(n){throw new Error("Unsupported keys for object: "+j(n).join(", "))},H=function(e,n){if(!p.isArray(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");P.each(n,function(n){if(!p.isString(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},F=function(n,e){throw new Error("All values need to be of type: "+e+". Keys ("+j(n).join(", ")+") were not.")},U=function(n){var t=j(n);P.find(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(", ")+"].")})},V={immutable: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 P.each(e,function(n,e){r[n]=y.constant(t[e])}),r}},immutableBag: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 H("required",o),H("optional",i),U(u),function(e){var t=q.keys(e);P.forall(o,function(n){return P.contains(t,n)})||_(o,t);var n=P.filter(t,function(n){return!P.contains(u,n)});0<n.length&&z(n);var r={};return P.each(o,function(n){r[n]=y.constant(e[n])}),P.each(i,function(n){r[n]=y.constant(Object.prototype.hasOwnProperty.call(e,n)?x.some(e[n]):x.none())}),r}}},G=V.immutable("width","height"),X=V.immutable("rows","columns"),Y=V.immutable("row","column"),K=V.immutable("x","y"),$=V.immutable("element","rowspan","colspan"),J=V.immutable("element","rowspan","colspan","isNew"),Q={dimensions:G,grid:X,address:Y,coords:K,extended:V.immutable("element","rowspan","colspan","row","column"),detail:$,detailnew:J,rowdata:V.immutable("element","cells","section"),elementnew:V.immutable("element","isNew"),rowdatanew:V.immutable("element","cells","section","isNew"),rowcells:V.immutable("cells","section"),rowdetails:V.immutable("details","section"),bounds:V.immutable("startRow","startCol","finishRow","finishCol")},Z=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:y.constant(n)}},nn={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),"HTML must have a single root node";return Z(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return Z(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return Z(t)},fromDom:Z,fromPoint:function(n,e,t){return x.from(n.dom().elementFromPoint(e,t)).map(Z)}},en=8,tn=9,rn=1,on=3,un=rn,an=tn,cn=function(n){return n.nodeType!==un&&n.nodeType!==an||0===n.childElementCount},ln={all:function(n,e){var t=e===undefined?document:e.dom();return cn(t)?[]:P.map(t.querySelectorAll(n),nn.fromDom)},is:function(n,e){var t=n.dom();if(t.nodeType!==un)return!1;if(t.matches!==undefined)return t.matches(e);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(e);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(e);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},one:function(n,e){var t=e===undefined?document:e.dom();return cn(t)?x.none():x.from(t.querySelector(n)).map(nn.fromDom)}},sn=function(n,e){for(var t=[],r=function(n){return t.push(n),e(n)},o=e(n);(o=o.bind(r)).isSome(););return t},fn="undefined"!=typeof window?window:Function("return this;")(),dn=function(n,e){for(var t=e!==undefined&&null!==e?e:fn,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t},mn=function(n,e){var t=n.split(".");return dn(t,e)},gn=function(n,e){var t=mn(n,e);if(t===undefined||null===t)throw n+" not available on this browser";return t},hn=function(){return gn("Node")},pn=function(n,e,t){return 0!=(n.compareDocumentPosition(e)&t)},vn=function(n,e){return pn(n,e,hn().DOCUMENT_POSITION_CONTAINED_BY)},bn=function(n){var e,t=!1;return function(){return t||(t=!0,e=n.apply(null,arguments)),e}},wn=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 xn(r(1),r(2))},yn=function(){return xn(0,0)},xn=function(n,e){return{major:n,minor:e}},Cn={nu:xn,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?yn():wn(n,t)},unknown:yn},Rn="Firefox",Sn=function(n,e){return function(){return e===n}},Tn=function(n){var e=n.current;return{current:e,version:n.version,isEdge:Sn("Edge",e),isChrome:Sn("Chrome",e),isIE:Sn("IE",e),isOpera:Sn("Opera",e),isFirefox:Sn(Rn,e),isSafari:Sn("Safari",e)}},Dn={unknown:function(){return Tn({current:undefined,version:Cn.unknown()})},nu:Tn,edge:y.constant("Edge"),chrome:y.constant("Chrome"),ie:y.constant("IE"),opera:y.constant("Opera"),firefox:y.constant(Rn),safari:y.constant("Safari")},kn="Windows",An="Android",On="Solaris",Nn="FreeBSD",En=function(n,e){return function(){return e===n}},Pn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:En(kn,e),isiOS:En("iOS",e),isAndroid:En(An,e),isOSX:En("OSX",e),isLinux:En("Linux",e),isSolaris:En(On,e),isFreeBSD:En(Nn,e)}},Bn={unknown:function(){return Pn({current:undefined,version:Cn.unknown()})},nu:Pn,windows:y.constant(kn),ios:y.constant("iOS"),android:y.constant(An),linux:y.constant("Linux"),osx:y.constant("OSX"),solaris:y.constant(On),freebsd:y.constant(Nn)},In=function(n,e){var t=String(e).toLowerCase();return P.find(n,function(n){return n.search(t)})},Wn=function(n,t){return In(n,t).map(function(n){var e=Cn.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Mn=function(n,t){return In(n,t).map(function(n){var e=Cn.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Ln=function(n,e){return e+n},qn=function(n,e){return n+e},jn=function(n,e){return n.substring(e)},_n=function(n,e){return n.substring(0,n.length-e)},zn=function(n){return""===n?x.none():x.some(n.substr(0,1))},Hn=function(n){return""===n?x.none():x.some(n.substring(1))},Fn=function(n,e,t){return""===e||!(n.length<e.length)&&n.substr(t,t+e.length)===e},Un=function(n,e){return Fn(n,e,0)},Vn=function(n,e){return Fn(n,e,n.length-e.length)},Gn={supplant:function(n,o){return n.replace(/\${([^{}]*)}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r:n})},startsWith:Un,removeLeading:function(n,e){return Un(n,e)?jn(n,e.length):n},removeTrailing:function(n,e){return Vn(n,e)?_n(n,e.length):n},ensureLeading:function(n,e){return Un(n,e)?n:Ln(n,e)},ensureTrailing:function(n,e){return Vn(n,e)?n:qn(n,e)},endsWith:Vn,contains:function(n,e){return-1!==n.indexOf(e)},trim:function(n){return n.replace(/^\s+|\s+$/g,"")},lTrim:function(n){return n.replace(/^\s+/g,"")},rTrim:function(n){return n.replace(/\s+$/g,"")},capitalize:function(n){return zn(n).bind(function(e){return Hn(n).map(function(n){return e.toUpperCase()+n})}).getOr(n)}},Xn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Yn=function(e){return function(n){return Gn.contains(n,e)}},Kn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Gn.contains(n,"edge/")&&Gn.contains(n,"chrome")&&Gn.contains(n,"safari")&&Gn.contains(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Xn],search:function(n){return Gn.contains(n,"chrome")&&!Gn.contains(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Gn.contains(n,"msie")||Gn.contains(n,"trident")}},{name:"Opera",versionRegexes:[Xn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Yn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Yn("firefox")},{name:"Safari",versionRegexes:[Xn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Gn.contains(n,"safari")||Gn.contains(n,"mobile/"))&&Gn.contains(n,"applewebkit")}}],$n=[{name:"Windows",search:Yn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Gn.contains(n,"iphone")||Gn.contains(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Yn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Yn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Yn("linux"),versionRegexes:[]},{name:"Solaris",search:Yn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Yn("freebsd"),versionRegexes:[]}],Jn={browsers:y.constant(Kn),oses:y.constant($n)},Qn=function(n){var e,t,r,o,i,u,a,c,l,s,f,d=Jn.browsers(),m=Jn.oses(),g=Wn(d,n).fold(Dn.unknown,Dn.nu),h=Mn(m,n).fold(Bn.unknown,Bn.nu);return{browser:g,os:h,deviceType:(t=g,r=n,o=(e=h).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=e.isiOS()||e.isAndroid(),s=l&&!c,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:y.constant(o),isiPhone:y.constant(i),isTablet:y.constant(c),isPhone:y.constant(s),isTouch:y.constant(l),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:y.constant(f)})}},Zn={detect:bn(function(){var n=navigator.userAgent;return Qn(n)})},ne=function(n,e){return n.dom()===e.dom()},ee=Zn.detect().browser.isIE()?function(n,e){return vn(n.dom(),e.dom())}:function(n,e){var t=n.dom(),r=e.dom();return t!==r&&t.contains(r)},te={eq:ne,isEqualNode:function(n,e){return n.dom().isEqualNode(e.dom())},member:function(n,e){return P.exists(e,y.curry(ne,n))},contains:ee,is:ln.is},re=function(n){return nn.fromDom(n.dom().ownerDocument)},oe=function(n){var e=n.dom();return x.from(e.parentNode).map(nn.fromDom)},ie=function(n){var e=n.dom();return x.from(e.previousSibling).map(nn.fromDom)},ue=function(n){var e=n.dom();return x.from(e.nextSibling).map(nn.fromDom)},ae=function(n){var e=n.dom();return P.map(e.childNodes,nn.fromDom)},ce=function(n,e){var t=n.dom().childNodes;return x.from(t[e]).map(nn.fromDom)},le=V.immutable("element","offset"),se={owner:re,defaultView:function(n){var e=n.dom().ownerDocument.defaultView;return nn.fromDom(e)},documentElement:function(n){var e=re(n);return nn.fromDom(e.dom().documentElement)},parent:oe,findIndex:function(t){return oe(t).bind(function(n){var e=ae(n);return P.findIndex(e,function(n){return te.eq(t,n)})})},parents:function(n,e){for(var t=p.isFunction(e)?e:y.constant(!1),r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=nn.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o},siblings:function(e){return oe(e).map(ae).map(function(n){return P.filter(n,function(n){return!te.eq(e,n)})}).getOr([])},prevSibling:ie,offsetParent:function(n){var e=n.dom();return x.from(e.offsetParent).map(nn.fromDom)},prevSiblings:function(n){return P.reverse(sn(n,ie))},nextSibling:ue,nextSiblings:function(n){return sn(n,ue)},children:ae,child:ce,firstChild:function(n){return ce(n,0)},lastChild:function(n){return ce(n,n.dom().childNodes.length-1)},childNodesCount:function(n){return n.dom().childNodes.length},hasChildNodes:function(n){return n.dom().hasChildNodes()},leaf:function(n,e){var t=ae(n);return 0<t.length&&e<t.length?le(t[e],0):le(n,e)}},fe=function(n,e,t){return P.bind(se.children(n),function(n){return ln.is(n,e)?t(n)?[n]:[]:fe(n,e,t)})},de={firstLayer:function(n,e){return fe(n,e,y.constant(!0))},filterFirstLayer:fe},me=function(n){return n.dom().nodeName.toLowerCase()},ge=function(n){return n.dom().nodeType},he=function(e){return function(n){return ge(n)===e}},pe=he(rn),ve=he(on),be=he(tn),we={name:me,type:ge,value:function(n){return n.dom().nodeValue},isElement:pe,isText:ve,isDocument:be,isComment:function(n){return ge(n)===en||"#comment"===me(n)}},ye=function(n,e,t){if(!(p.isString(t)||p.isBoolean(t)||p.isNumber(t)))throw console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},xe=function(n,e,t){ye(n.dom(),e,t)},Ce=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},Re=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},Se={clone:function(n){return P.foldl(n.dom().attributes,function(n,e){return n[e.name]=e.value,n},{})},set:xe,setAll:function(n,e){var t=n.dom();q.each(e,function(n,e){ye(t,e,n)})},get:Ce,has:Re,remove:function(n,e){n.dom().removeAttribute(e)},hasNone:function(n){var e=n.dom().attributes;return e===undefined||null===e||0===e.length},transfer:function(o,i,n){we.isElement(o)&&we.isElement(i)&&P.each(n,function(n){var e,t,r;t=i,Re(e=o,r=n)&&!Re(t,r)&&xe(t,r,Ce(e,r))})}},Te=bn(function(){return De(nn.fromDom(document))}),De=function(n){var e=n.dom().body;if(null===e||e===undefined)throw"Body is not available yet";return nn.fromDom(e)},ke={body:Te,getBody:De,inBody:function(n){var e=we.isText(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)}},Ae=function(n,e){var t=[];return P.each(se.children(n),function(n){e(n)&&(t=t.concat([n])),t=t.concat(Ae(n,e))}),t},Oe={all:function(n){return Ae(ke.body(),n)},ancestors:function(n,e,t){return P.filter(se.parents(n,t),e)},siblings:function(n,e){return P.filter(se.siblings(n),e)},children:function(n,e){return P.filter(se.children(n),e)},descendants:Ae},Ne={all:function(n){return ln.all(n)},ancestors:function(n,e,t){return Oe.ancestors(n,function(n){return ln.is(n,e)},t)},siblings:function(n,e){return Oe.siblings(n,function(n){return ln.is(n,e)})},children:function(n,e){return Oe.children(n,function(n){return ln.is(n,e)})},descendants:function(n,e){return ln.all(e,n)}};function Ee(n,e,t,r,o){return n(t,r)?x.some(t):p.isFunction(o)&&o(t)?x.none():e(t,r,o)}var Pe,Be,Ie,We,Me,Le=function(n,e,t){for(var r=n.dom(),o=p.isFunction(t)?t:y.constant(!1);r.parentNode;){r=r.parentNode;var i=nn.fromDom(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},qe=function(n,e){return P.find(n.dom().childNodes,y.compose(e,nn.fromDom)).map(nn.fromDom)},je=function(n,r){var o=function(n){for(var e=0;e<n.childNodes.length;e++){if(r(nn.fromDom(n.childNodes[e])))return x.some(nn.fromDom(n.childNodes[e]));var t=o(n.childNodes[e]);if(t.isSome())return t}return x.none()};return o(n.dom())},_e={first:function(n){return je(ke.body(),n)},ancestor:Le,closest:function(n,e,t){return Ee(function(n){return e(n)},Le,n,e,t)},sibling:function(e,t){var n=e.dom();return n.parentNode?qe(nn.fromDom(n.parentNode),function(n){return!te.eq(e,n)&&t(n)}):x.none()},child:qe,descendant:je},ze=function(n,e,t){return _e.ancestor(n,function(n){return ln.is(n,e)},t)},He={first:function(n){return ln.one(n)},ancestor:ze,sibling:function(n,e){return _e.sibling(n,function(n){return ln.is(n,e)})},child:function(n,e){return _e.child(n,function(n){return ln.is(n,e)})},descendant:function(n,e){return ln.one(e,n)},closest:function(n,e,t){return Ee(ln.is,ze,n,e,t)}},Fe=function(n,e,t){var r=t!==undefined?t:y.constant(!1);return r(e)?x.none():P.contains(n,we.name(e))?x.some(e):He.ancestor(e,n.join(","),function(n){return ln.is(n,"table")||r(n)})},Ue=function(e,n){return se.parent(n).map(function(n){return Ne.children(n,e)})},Ve=y.curry(Ue,"th,td"),Ge=y.curry(Ue,"tr"),Xe=function(n,e){return parseInt(Se.get(n,e),10)},Ye={cell:function(n,e){return Fe(["td","th"],n,e)},firstCell:function(n){return He.descendant(n,"th,td")},cells:function(n){return de.firstLayer(n,"th,td")},neighbourCells:Ve,table:function(n,e){return He.closest(n,"table",e)},row:function(n,e){return Fe(["tr"],n,e)},rows:function(n){return de.firstLayer(n,"tr")},notCell:function(n,e){return Fe(["caption","tr","tbody","tfoot","thead"],n,e)},neighbourRows:Ge,attr:Xe,grid:function(n,e,t){var r=Xe(n,e),o=Xe(n,t);return Q.grid(r,o)}},Ke=function(n){var e=Ye.rows(n);return P.map(e,function(n){var e=n,t=se.parent(e).bind(function(n){var e=we.name(n);return"tfoot"===e||"thead"===e||"tbody"===e?e:"tbody"}),r=P.map(Ye.cells(n),function(n){var e=Se.has(n,"rowspan")?parseInt(Se.get(n,"rowspan"),10):1,t=Se.has(n,"colspan")?parseInt(Se.get(n,"colspan"),10):1;return Q.detail(n,e,t)});return Q.rowdata(e,r,t)})},$e=function(n,t){return P.map(n,function(n){var e=P.map(Ye.cells(n),function(n){var e=Se.has(n,"rowspan")?parseInt(Se.get(n,"rowspan"),10):1,t=Se.has(n,"colspan")?parseInt(Se.get(n,"colspan"),10):1;return Q.detail(n,e,t)});return Q.rowdata(n,e,t.section())})},Je=function(n,e){return n+","+e},Qe=function(n,e){var t=P.bind(n.all(),function(n){return n.cells()});return P.filter(t,e)},Ze={generate:function(n){var s={},e=[],t=n.length,f=0;P.each(n,function(n,c){var l=[];P.each(n.cells(),function(n,e){for(var t=0;s[Je(c,t)]!==undefined;)t++;for(var r=Q.extended(n.element(),n.rowspan(),n.colspan(),c,t),o=0;o<n.colspan();o++)for(var i=0;i<n.rowspan();i++){var u=t+o,a=Je(c+i,u);s[a]=r,f=Math.max(f,u+1)}l.push(r)}),e.push(Q.rowdata(n.element(),l,n.section()))});var r=Q.grid(t,f);return{grid:y.constant(r),access:y.constant(s),all:y.constant(e)}},getAt:function(n,e,t){var r=n.access()[Je(e,t)];return r!==undefined?x.some(r):x.none()},findItem:function(n,e,t){var r=Qe(n,function(n){return t(e,n.element())});return 0<r.length?x.some(r[0]):x.none()},filterItems:Qe,justCells:function(n){var e=P.map(n.all(),function(n){return n.cells()});return P.flatten(e)}},nt=function(n){return n.style!==undefined},et=function(n,e,t){if(!p.isString(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);nt(n)&&n.style.setProperty(e,t)},tt=function(n,e){nt(n)&&n.style.removeProperty(e)},rt=function(n,e,t){var r=n.dom();et(r,e,t)},ot=function(n,e){return nt(n)?n.style.getPropertyValue(e):""},it=function(n,e){var t=n.dom(),r=ot(t,e);return x.from(r).filter(function(n){return 0<n.length})},ut={copy:function(n,e){var t=n.dom(),r=e.dom();nt(t)&&nt(r)&&(r.style.cssText=t.style.cssText)},set:rt,preserve:function(n,e){var t=Se.get(n,"style"),r=e(n);return(t===undefined?Se.remove:Se.set)(n,"style",t),r},setAll:function(n,e){var t=n.dom();q.each(e,function(n,e){et(t,e,n)})},setOptions:function(n,e){var t=n.dom();q.each(e,function(n,e){n.fold(function(){tt(t,e)},function(n){et(t,e,n)})})},remove:function(n,e){var t=n.dom();tt(t,e),Se.has(n,"style")&&""===Gn.trim(Se.get(n,"style"))&&Se.remove(n,"style")},get:function(n,e){var t=n.dom(),r=window.getComputedStyle(t).getPropertyValue(e),o=""!==r||ke.inBody(n)?r:ot(t,e);return null===o?undefined:o},getRaw:it,getAllRaw:function(n){var e={},t=n.dom();if(nt(t))for(var r=0;r<t.style.length;r++){var o=t.style.item(r);e[o]=t.style[o]}return e},isValidValue:function(n,e,t){var r=nn.fromTag(n);return rt(r,e,t),it(r,e).isSome()},reflow:function(n){return n.dom().offsetWidth},transfer:function(r,o,n){we.isElement(r)&&we.isElement(o)&&P.each(n,function(n){var e,t;e=o,it(r,t=n).each(function(n){it(e,t).isNone()&&rt(e,t,n)})})}},at=function(e,t){se.parent(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})},ct=function(n,e){n.dom().appendChild(e.dom())},lt={before:at,after:function(n,e){se.nextSibling(n).fold(function(){se.parent(n).each(function(n){ct(n,e)})},function(n){at(n,e)})},prepend:function(e,t){se.firstChild(e).fold(function(){ct(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},append:ct,appendAt:function(n,e,t){se.child(n,t).fold(function(){ct(n,e)},function(n){at(n,e)})},wrap:function(n,e){at(n,e),ct(e,n)}},st={before:function(e,n){P.each(n,function(n){lt.before(e,n)})},after:function(r,o){P.each(o,function(n,e){var t=0===e?r:o[e-1];lt.after(t,n)})},prepend:function(e,n){P.each(n.slice().reverse(),function(n){lt.prepend(e,n)})},append:function(e,n){P.each(n,function(n){lt.append(e,n)})}},ft=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},dt={empty:function(n){n.dom().textContent="",P.each(se.children(n),function(n){ft(n)})},remove:ft,unwrap:function(n){var e=se.children(n);0<e.length&&st.before(n,e),ft(n)}},mt=V.immutable("minRow","minCol","maxRow","maxCol"),gt=function(n,e){var t,i,r,u,a,c,l,o,s,f,d=function(n){return ln.is(n.element(),e)},m=Ke(n),g=Ze.generate(m),h=(i=d,r=(t=g).grid().columns(),u=t.grid().rows(),a=r,l=c=0,q.each(t.access(),function(n){if(i(n)){var e=n.row(),t=e+n.rowspan()-1,r=n.column(),o=r+n.colspan()-1;e<u?u=e:c<t&&(c=t),r<a?a=r:l<o&&(l=o)}}),mt(u,a,c,l)),p="th:not("+e+"),td:not("+e+")",v=de.filterFirstLayer(n,"th,td",function(n){return ln.is(n,p)});return P.each(v,dt.remove),function(n,e,t,r){for(var o,i,u,a=e.grid().columns(),c=e.grid().rows(),l=0;l<c;l++)for(var s=!1,f=0;f<a;f++)l<t.minRow()||l>t.maxRow()||f<t.minCol()||f>t.maxCol()||(Ze.getAt(e,l,f).filter(r).isNone()?(o=s,i=n[l].element(),u=nn.fromTag("td"),lt.append(u,nn.fromTag("br")),(o?lt.append:lt.prepend)(i,u)):s=!0)}(m,g,h,d),o=n,s=h,f=P.filter(de.firstLayer(o,"tr"),function(n){return 0===n.dom().childElementCount}),P.each(f,dt.remove),s.minCol()!==s.maxCol()&&s.minRow()!==s.maxRow()||P.each(de.firstLayer(o,"th,td"),function(n){Se.remove(n,"rowspan"),Se.remove(n,"colspan")}),Se.remove(o,"width"),Se.remove(o,"height"),ut.remove(o,"width"),ut.remove(o,"height"),n},ht=function(n,e){return nn.fromDom(n.dom().cloneNode(e))},pt=function(n){return ht(n,!0)},vt=function(n,e){var t=nn.fromTag(e),r=Se.clone(n);return Se.setAll(t,r),t},bt=function(n){return ht(n,!1)},wt=pt,yt=function(n,e){var t=vt(n,e),r=se.children(pt(n));return st.append(t,r),t},xt=(Pe=we.isText,Be="text",Ie=function(n){return Pe(n)?x.from(n.dom().nodeValue):x.none()},We=Zn.detect().browser,{get:function(n){if(!Pe(n))throw new Error("Can only get "+Be+" value of a "+Be+" node");return Me(n).getOr("")},getOption:Me=We.isIE()&&10===We.version.major?function(n){try{return Ie(n)}catch(e){return x.none()}}:Ie,set:function(n,e){if(!Pe(n))throw new Error("Can only set raw "+Be+" value of a "+Be+" node");n.dom().nodeValue=e}}),Ct={get:function(n){return xt.get(n)},getOption:function(n){return xt.getOption(n)},set:function(n,e){xt.set(n,e)}},Rt=function(n){return"img"===we.name(n)?1:Ct.getOption(n).fold(function(){return se.children(n).length},function(n){return n.length})},St=["img","br"],Tt=Rt,Dt=function(n){return Ct.getOption(n).filter(function(n){return 0!==n.trim().length||-1<n.indexOf("\xa0")}).isSome()||P.contains(St,we.name(n))},kt=function(n,i){var u=function(n){for(var e=se.children(n),t=e.length-1;0<=t;t--){var r=e[t];if(i(r))return x.some(r);var o=u(r);if(o.isSome())return o}return x.none()};return u(n)},At={first:function(n){return _e.descendant(n,Dt)},last:function(n){return kt(n,Dt)}},Ot=function(){var n=nn.fromTag("td");return lt.append(n,nn.fromTag("br")),n},Nt=function(n,e,t){var r=yt(n,e);return q.each(t,function(n,e){null===n?Se.remove(r,e):Se.set(r,e,n)}),r},Et=function(n){return n},Pt=function(n){return function(){return nn.fromTag("tr",n.dom())}},Bt=function(c,n,l){return{row:Pt(n),cell:function(n){var r,o,i,e=se.owner(n.element()),t=nn.fromTag(we.name(n.element()),e.dom()),u=l.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=0<u.length?(r=n.element(),o=t,i=u,At.first(r).map(function(n){var e=i.join(","),t=Ne.ancestors(n,e,function(n){return te.eq(n,r)});return P.foldr(t,function(n,e){var t=bt(e);return lt.append(n,t),t},o)}).getOr(o)):t;return lt.append(a,nn.fromTag("br")),ut.copy(n.element(),t),ut.remove(t,"height"),1!==n.colspan()&&ut.remove(n.element(),"width"),c(n.element(),t),t},replace:Nt,gap:Ot}},It=function(n){return{row:Pt(n),cell:Ot,replace:Et,gap:Ot}},Wt=function(n,e){var t=(e||document).createElement("div");return t.innerHTML=n,se.children(nn.fromDom(t))},Mt=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Lt(){return{up:y.constant({selector:He.ancestor,closest:He.closest,predicate:_e.ancestor,all:se.parents}),down:y.constant({selector:Ne.descendants,predicate:Oe.descendants}),styles:y.constant({get:ut.get,getRaw:ut.getRaw,set:ut.set,remove:ut.remove}),attrs:y.constant({get:Se.get,set:Se.set,remove:Se.remove,copyTo:function(n,e){var t=Se.clone(n);Se.setAll(e,t)}}),insert:y.constant({before:lt.before,after:lt.after,afterAll:st.after,append:lt.append,appendAll:st.append,prepend:lt.prepend,wrap:lt.wrap}),remove:y.constant({unwrap:dt.unwrap,remove:dt.remove}),create:y.constant({nu:nn.fromTag,clone:function(n){return nn.fromDom(n.dom().cloneNode(!1))},text:nn.fromText}),query:y.constant({comparePosition:function(n,e){return n.dom().compareDocumentPosition(e.dom())},prevSibling:se.prevSibling,nextSibling:se.nextSibling}),property:y.constant({children:se.children,name:we.name,parent:se.parent,isText:we.isText,isComment:we.isComment,isElement:we.isElement,getText:Ct.get,setText:Ct.set,isBoundary:function(n){return!!we.isElement(n)&&("body"===we.name(n)||P.contains(Mt,we.name(n)))},isEmptyTag:function(n){return!!we.isElement(n)&&P.contains(["br","img","hr","input"],we.name(n))}}),eq:te.eq,is:te.is}}var qt=V.immutable("left","right"),jt=function(n,e,t){var r=n.property().children(e);return P.findIndex(r,y.curry(n.eq,t)).map(function(n){return{before:y.constant(r.slice(0,n)),after:y.constant(r.slice(n+1))}})},_t=function(t,r,o){return jt(t,r,o).map(function(n){var e=t.create().clone(r);return t.insert().appendAll(e,n.before().concat([o])),t.insert().appendAll(r,n.after()),t.insert().before(r,e),qt(e,r)})},zt=function(t,r,n){return jt(t,r,n).map(function(n){var e=t.create().clone(r);return t.insert().appendAll(e,n.after()),t.insert().after(r,e),qt(r,e)})},Ht=function(i,n,u,a){var r=V.immutable("first","second","splits"),c=function(n,e,o){var t=r(n,x.none(),o);return u(n)?r(n,e,o):i.property().parent(n).bind(function(r){return a(i,r,n).map(function(n){var e=[{first:n.left,second:n.right}],t=u(r)?r:n.left();return c(t,x.some(n.right()),o.concat(e))}).getOr(t)})};return c(n,x.none(),[])},Ft=function(r,o,n,e){var t=o(r,n);return P.foldr(e,function(n,e){var t=o(r,e);return Ut(r,n,t)},t)},Ut=function(e,n,t){return n.bind(function(n){return t.filter(y.curry(e.eq,n))})},Vt=function(n,e,t){return 0<t.length?Ft(n,e,(r=t)[0],r.slice(1)):x.none();var r},Gt=function(n,e){return y.curry(n.eq,e)},Xt=function(e,n,t,r){var o=r!==undefined?r:y.constant(!1),i=[n].concat(e.up().all(n)),u=[t].concat(e.up().all(t)),a=function(e){return P.findIndex(e,o).fold(function(){return e},function(n){return e.slice(0,n+1)})},c=a(i),l=a(u),s=P.find(c,function(n){return P.exists(l,Gt(e,n))});return{firstpath:y.constant(c),secondpath:y.constant(l),shared:y.constant(s)}},Yt=function(e,n,t){var r=Xt(e,n,t);return r.shared().bind(function(n){return function(o,i,n,e){var u=o.property().children(i);if(o.eq(i,n[0]))return x.some([n[0]]);if(o.eq(i,e[0]))return x.some([e[0]]);var t=function(n){var e=P.reverse(n),t=P.findIndex(e,Gt(o,i)).getOr(-1),r=t<e.length-1?e[t+1]:e[t];return P.findIndex(u,Gt(o,r))},r=t(n),a=t(e);return r.bind(function(r){return a.map(function(n){var e=Math.min(r,n),t=Math.max(r,n);return u.slice(e,t+1)})})}(e,n,r.firstpath(),r.secondpath())})},Kt=Xt,$t=function(n,e,t){return Vt(n,e,t)},Jt=function(n,e,t){return Yt(n,e,t)},Qt=function(n,e,t,r){return Kt(n,e,t,r)},Zt=function(n,e,t){return _t(n,e,t)},nr=function(n,e,t){return zt(n,e,t)},er=function(n,e,t,r){return Ht(n,e,t,r)},tr=Lt(),rr={sharedOne:function(t,n){return $t(tr,function(n,e){return t(e)},n)},subset:function(n,e){return Jt(tr,n,e)},ancestors:function(n,e,t){return Qt(tr,n,e,t)},breakToLeft:function(n,e){return Zt(tr,n,e)},breakToRight:function(n,e){return nr(tr,n,e)},breakPath:function(n,e,r){return er(tr,n,e,function(n,e,t){return r(e,t)})}},or=function(n,e){return e.column()>=n.startCol()&&e.column()+e.colspan()-1<=n.finishCol()&&e.row()>=n.startRow()&&e.row()+e.rowspan()-1<=n.finishRow()},ir=function(n,e){var t=e.column(),r=e.column()+e.colspan()-1,o=e.row(),i=e.row()+e.rowspan()-1;return t<=n.finishCol()&&r>=n.startCol()&&o<=n.finishRow()&&i>=n.startRow()},ur=function(n,e){for(var t=!0,r=y.curry(or,e),o=e.startRow();o<=e.finishRow();o++)for(var i=e.startCol();i<=e.finishCol();i++)t=t&&Ze.getAt(n,o,i).exists(r);return t?x.some(e):x.none()},ar=function(n,e,t){var r=Ze.findItem(n,e,te.eq),o=Ze.findItem(n,t,te.eq);return r.bind(function(r){return o.map(function(n){return e=r,t=n,Q.bounds(Math.min(e.row(),t.row()),Math.min(e.column(),t.column()),Math.max(e.row()+e.rowspan()-1,t.row()+t.rowspan()-1),Math.max(e.column()+e.colspan()-1,t.column()+t.colspan()-1));var e,t})})},cr=ar,lr=function(e,n,t){return ar(e,n,t).bind(function(n){return ur(e,n)})},sr=function(r,n,o,i){return Ze.findItem(r,n,te.eq).bind(function(n){var e=0<o?n.row()+n.rowspan()-1:n.row(),t=0<i?n.column()+n.colspan()-1:n.column();return Ze.getAt(r,e+o,t+i).map(function(n){return n.element()})})},fr=function(t,n,e){return cr(t,n,e).map(function(n){var e=Ze.filterItems(t,y.curry(ir,n));return P.map(e,function(n){return n.element()})})},dr=function(n,e){return Ze.findItem(n,e,function(n,e){return te.contains(e,n)}).bind(function(n){return n.element()})},mr=function(n){var e=Ke(n);return Ze.generate(e)},gr=function(t,r,o){return Ye.table(t).bind(function(n){var e=mr(n);return sr(e,t,r,o)})},hr=function(n,e,t){var r=mr(n);return fr(r,e,t)},pr=function(n,e,t,r,o){var i=mr(n),u=te.eq(n,t)?e:dr(i,e),a=te.eq(n,o)?r:dr(i,r);return fr(i,u,a)},vr=function(n,e,t){var r=mr(n);return lr(r,e,t)},br=function(n,e){return He.ancestor(n,"table")},wr=V.immutableBag(["boxes","start","finish"],[]),yr=function(a,c,r){var l=function(e){return function(n){return r(n)||te.eq(n,e)}};return te.eq(a,c)?x.some(wr({boxes:x.some([a]),start:a,finish:c})):br(a).bind(function(u){return br(c).bind(function(i){if(te.eq(u,i))return x.some(wr({boxes:hr(u,a,c),start:a,finish:c}));if(te.contains(u,i)){var n=0<(e=Ne.ancestors(c,"td,th",l(u))).length?e[e.length-1]:c;return x.some(wr({boxes:pr(u,a,u,c,i),start:a,finish:n}))}if(te.contains(i,u)){var e,t=0<(e=Ne.ancestors(a,"td,th",l(i))).length?e[e.length-1]:a;return x.some(wr({boxes:pr(i,a,u,c,i),start:a,finish:t}))}return rr.ancestors(a,c).shared().bind(function(n){return He.closest(n,"table",r).bind(function(n){var e=Ne.ancestors(c,"td,th",l(n)),t=0<e.length?e[e.length-1]:c,r=Ne.ancestors(a,"td,th",l(n)),o=0<r.length?r[r.length-1]:a;return x.some(wr({boxes:pr(n,a,u,c,i),start:o,finish:t}))})})})})},xr=yr,Cr=function(n,e){var t=Ne.descendants(n,e);return 0<t.length?x.some(t):x.none()},Rr=function(n,e,t,r,o){return(i=n,u=o,P.find(i,function(n){return ln.is(n,u)})).bind(function(n){return gr(n,e,t).bind(function(n){return e=n,t=r,He.ancestor(e,"table").bind(function(n){return He.descendant(n,t).bind(function(n){return yr(n,e).bind(function(e){return e.boxes().map(function(n){return{boxes:y.constant(n),start:y.constant(e.start()),finish:y.constant(e.finish())}})})})});var e,t})});var i,u},Sr=function(n,e,r){return He.descendant(n,e).bind(function(t){return He.descendant(n,r).bind(function(e){return rr.sharedOne(br,[t,e]).map(function(n){return{first:y.constant(t),last:y.constant(e),table:y.constant(n)}})})})},Tr=function(n,e){return Cr(n,e)},Dr=function(o,n,e){return Sr(o,n,e).bind(function(t){var n=function(n){return te.eq(o,n)},e=He.ancestor(t.first(),"thead,tfoot,tbody,table",n),r=He.ancestor(t.last(),"thead,tfoot,tbody,table",n);return e.bind(function(e){return r.bind(function(n){return te.eq(e,n)?vr(t.table(),t.first(),t.last()):x.none()})})})},kr="data-mce-selected",Ar="data-mce-first-selected",Or="data-mce-last-selected",Nr={selected:y.constant(kr),selectedSelector:y.constant("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:y.constant("[data-mce-selected]"),firstSelected:y.constant(Ar),firstSelectedSelector:y.constant("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:y.constant(Or),lastSelectedSelector:y.constant("td[data-mce-last-selected],th[data-mce-last-selected]")},Er=function(u){if(!p.isArray(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],t={};return P.each(u,function(n,r){var e=q.keys(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(!p.isArray(i))throw new Error("case arguments must be an array");a.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=q.keys(n);if(a.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+e.join(","));if(!P.forall(a,function(n){return P.contains(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+a.join(", "));return n[o].apply(null,t)},log:function(n){console.log(n,{constructors:a,constructor:o,params:t})}}}}),t},Pr=Er([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Br={cata:function(n,e,t,r){return n.fold(e,t,r)},none:Pr.none,multiple:Pr.multiple,single:Pr.single},Ir=function(n,e){return Br.cata(e.get(),y.constant([]),y.identity,y.constant([n]))},Wr=function(t,n){return Br.cata(n.get(),x.none,function(e,n){return 0===e.length?x.none():Dr(t,Nr.firstSelectedSelector(),Nr.lastSelectedSelector()).bind(function(n){return 1<e.length?x.some({bounds:y.constant(n),cells:y.constant(e)}):x.none()})},x.none)},Mr=function(n,e){var t=Ir(n,e);return 0<t.length&&P.forall(t,function(n){return Se.has(n,"rowspan")&&1<parseInt(Se.get(n,"rowspan"),10)||Se.has(n,"colspan")&&1<parseInt(Se.get(n,"colspan"),10)})?x.some(t):x.none()},Lr=Ir,qr=function(n){return{element:y.constant(n),mergable:x.none,unmergable:x.none,selection:y.constant([n])}},jr=V.immutable("element","clipboard","generators"),_r={noMenu:qr,forMenu:function(n,e,t){return{element:y.constant(t),mergable:y.constant(Wr(e,n)),unmergable:y.constant(Mr(t,n)),selection:y.constant(Lr(t,n))}},notCell:function(n){return qr(n)},paste:jr,pasteRows:function(n,e,t,r,o){return{element:y.constant(t),mergable:x.none,unmergable:x.none,selection:y.constant(Lr(t,n)),clipboard:y.constant(r),generators:y.constant(o)}}},zr=function(a,n,c,l){a.on("BeforeGetContent",function(t){!0===t.selection&&Br.cata(n.get(),y.noop,function(n){var e;t.preventDefault(),(e=n,Ye.table(e[0]).map(wt).map(function(n){return[gt(n,Nr.attributeSelector())]})).each(function(n){t.content=P.map(n,function(n){return e=n,a.selection.serializer.serialize(e.dom(),{});var e}).join("")})},y.noop)}),a.on("BeforeSetContent",function(u){!0===u.selection&&!0===u.paste&&x.from(a.dom.getParent(a.selection.getStart(),"th,td")).each(function(n){var i=nn.fromDom(n);Ye.table(i).bind(function(e){var n=P.filter(Wt(u.content),function(n){return"meta"!==we.name(n)});if(1===n.length&&"table"===we.name(n[0])){u.preventDefault();var t=nn.fromDom(a.getDoc()),r=It(t),o=_r.paste(i,n[0],r);c.pasteCells(e,o).each(function(n){a.selection.setRng(n),a.focus(),l.clear(e)})}})})})};function Hr(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=ut.get(n,r);return parseFloat(t)||0}return e},i=function(o,n){return P.foldl(n,function(n,e){var t=ut.get(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!p.isNumber(e)&&!e.match(/^[0-9]+$/))throw r+".set accepts only positive integer values. Value was "+e;var t=n.dom();nt(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 Fr=Hr("height",function(n){return ke.inBody(n)?n.dom().getBoundingClientRect().height:n.dom().offsetHeight}),Ur=function(n){return Fr.get(n)},Vr=function(n){return Fr.getOuter(n)},Gr=Hr("width",function(n){return n.dom().offsetWidth}),Xr=function(n){return Gr.get(n)},Yr=function(n){return Gr.getOuter(n)},Kr=Zn.detect(),$r=function(n,e,t){return r=ut.get(n,e),o=t,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Jr=function(n){return Kr.browser.isIE()||Kr.browser.isEdge()?(t=$r(e=n,"padding-top",0),r=$r(e,"padding-bottom",0),o=$r(e,"border-top-width",0),i=$r(e,"border-bottom-width",0),u=e.dom().getBoundingClientRect().height,"border-box"===ut.get(e,"box-sizing")?u:u-t-r-(o+i)):$r(n,"height",Ur(n));var e,t,r,o,i,u},Qr=/(\d+(\.\d+)?)(\w|%)*/,Zr=/(\d+(\.\d+)?)%/,no=/(\d+(\.\d+)?)px|em/,eo=function(n,e){ut.set(n,"height",e+"px")},to=function(n,e,t,r){var o,i,u,a,c,l=parseInt(n,10);return Gn.endsWith(n,"%")&&"table"!==we.name(e)?(o=e,i=l,u=t,a=r,c=Ye.table(o).map(function(n){var e=u(n);return Math.floor(i/100*e)}).getOr(i),a(o,c),c):l},ro=function(n){var e,t=(e=n,ut.getRaw(e,"height").getOrThunk(function(){return Jr(e)+"px"}));return t?to(t,n,Ur,eo):Ur(n)},oo=function(n,e){return Se.has(n,e)?parseInt(Se.get(n,e),10):1},io=function(n){return ut.getRaw(n,"width").fold(function(){return x.from(Se.get(n,"width"))},function(n){return x.some(n)})},uo=function(n,e){return n/e.pixelWidth()*100},ao={percentageBasedSizeRegex:y.constant(Zr),pixelBasedSizeRegex:y.constant(no),setPixelWidth:function(n,e){ut.set(n,"width",e+"px")},setPercentageWidth:function(n,e){ut.set(n,"width",e+"%")},setHeight:eo,getPixelWidth:function(e,t){return io(e).fold(function(){var n=Xr(e);return parseInt(n,10)},function(n){return function(n,e,t){if(no.test(e)){var r=no.exec(e);return parseInt(r[1],10)}if(Zr.test(e)){var o=Zr.exec(e),i=parseFloat(o[1]);return i/100*t.pixelWidth()}var u=Xr(n);return parseInt(u,10)}(e,n,t)})},getPercentageWidth:function(t,r){return io(t).fold(function(){var n=Xr(t),e=parseInt(n,10);return uo(e,r)},function(n){return function(n,e,t){if(Zr.test(e)){var r=Zr.exec(e);return parseFloat(r[1])}var o=Xr(n),i=parseInt(o,10);return uo(i,t)}(t,n,r)})},getGenericWidth:function(n){return io(n).bind(function(n){if(Qr.test(n)){var e=Qr.exec(n);return x.some({width:y.constant(e[1]),unit:y.constant(e[3])})}return x.none()})},setGenericWidth:function(n,e,t){ut.set(n,"width",e+t)},getHeight:function(n){return t="rowspan",ro(e=n)/oo(e,t);var e,t},getRawWidth:io},co=function(t,r){ao.getGenericWidth(t).each(function(n){var e=n.width()/2;ao.setGenericWidth(t,e,n.unit()),ao.setGenericWidth(r,e,n.unit())})},lo=function(n,e){var t=e||nn.fromDom(document.documentElement);return _e.ancestor(n,y.curry(te.eq,t)).isSome()},so=function(n){var e=n.dom();return e===e.window?n:we.isDocument(n)?e.defaultView||e.parentWindow:null},fo=function(t,r){return{left:y.constant(t),top:y.constant(r),translate:function(n,e){return fo(t+n,r+e)}}},mo=function(n,e){return n!==undefined?n:e!==undefined?e:0},go=function(n){var e,t=n.dom(),r=t.ownerDocument,o=r.body,i=nn.fromDom(r.documentElement);return o===t?fo(o.offsetLeft,o.offsetTop):lo(n,i)?(e=t.getBoundingClientRect(),fo(e.left,e.top)):fo(0,0)},ho=function(n){var e=n.dom().ownerDocument,t=e.body,r=so(nn.fromDom(e)),o=e.documentElement,i=mo(r.pageYOffset,o.scrollTop),u=mo(r.pageXOffset,o.scrollLeft),a=mo(o.clientTop,t.clientTop),c=mo(o.clientLeft,t.clientLeft);return go(n).translate(u-c,i-a)},po=V.immutable("row","y"),vo=V.immutable("col","x"),bo=function(n){return ho(n).left()+Yr(n)},wo=function(n){return ho(n).left()},yo=function(n,e){return vo(n,wo(e))},xo=function(n,e){return vo(n,bo(e))},Co=function(n){return ho(n).top()},Ro=function(t,e,r){if(0===r.length)return[];var n=P.map(r.slice(1),function(n,e){return n.map(function(n){return t(e,n)})}),o=r[r.length-1].map(function(n){return e(r.length-1,n)});return n.concat([o])},So={delta:y.identity,positions:y.curry(Ro,function(n,e){return po(n,Co(e))},function(n,e){return po(n,Co(e)+Vr(e))}),edge:Co},To={delta:y.identity,edge:wo,positions:y.curry(Ro,yo,xo)},Do={height:So,rtl:{delta:function(n,e){return-n},edge:bo,positions:y.curry(Ro,xo,yo)},ltr:To},ko={ltr:Do.ltr,rtl:Do.rtl};function Ao(e){var t=function(n){return e(n).isRtl()?ko.rtl:ko.ltr};return{delta:function(n,e){return t(e).delta(n,e)},edge:function(n){return t(n).edge(n)},positions:function(n,e){return t(e).positions(n,e)}}}var Oo=function(n){var e=Ke(n);return Ze.generate(e).grid()},No=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return No(t())}}},Eo=function(n,e){return Po(n,e,{validate:p.isFunction,label:"function"})},Po=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return H("required",o),U(o),function(e){var t=q.keys(e);P.forall(o,function(n){return P.contains(t,n)})||_(o,t),r(o,t);var n=P.filter(o,function(n){return!i.validate(e[n],n)});return 0<n.length&&F(n,i.label),e}},Bo=y.noop,Io={exactly:y.curry(Eo,function(e,n){var t=P.filter(n,function(n){return!P.contains(e,n)});0<t.length&&z(t)}),ensure:y.curry(Eo,Bo),ensureWith:y.curry(Po,Bo)},Wo=function(n){var e=Se.has(n,"colspan")?parseInt(Se.get(n,"colspan"),10):1,t=Se.has(n,"rowspan")?parseInt(Se.get(n,"rowspan"),10):1;return{element:y.constant(n),colspan:y.constant(e),rowspan:y.constant(t)}},Mo=Io.exactly(["cell","row","replace","gap"]),Lo=function(r,n){Mo(r);var t=No(x.none()),o=n!==undefined?n:Wo,i=function(n){var e,t=o(n);return e=t,r.cell(e)},u=function(n){var e=i(n);return t.get().isNone()&&t.set(x.some(e)),a=x.some({item:n,replacement:e}),e},a=x.none();return{getOrInit:function(e,t){return a.fold(function(){return u(e)},function(n){return t(e,n.item)?n.replacement:u(e)})},cursor:t.get}},qo=function(o,a){return function(t){var r=No(x.none());Mo(t);var i=[],u=function(n){var e=t.replace(n,a,{scope:o});return i.push({item:n,sub:e}),r.get().isNone()&&r.set(x.some(e)),e};return{replaceOrInit:function(e,t){return(r=e,o=t,P.find(i,function(n){return o(n.item,r)})).fold(function(){return u(e)},function(n){return t(e,n.item)?n.sub:u(e)});var r,o},cursor:r.get}}},jo=function(t){Mo(t);var n=No(x.none());return{combine:function(e){return n.get().isNone()&&n.set(x.some(e)),function(){var n=t.cell({element:y.constant(e),colspan:y.constant(1),rowspan:y.constant(1)});return ut.remove(n,"width"),ut.remove(e,"width"),n}},cursor:n.get}},_o=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],zo=function(n,e){var t=n.property().name(e);return P.contains(_o,t)},Ho=function(n,e){return P.contains(["br","img","hr","input"],n.property().name(e))},Fo=zo,Uo=function(n,e){var t=n.property().name(e);return P.contains(["ol","ul"],t)},Vo=Ho,Go=Lt(),Xo=function(n){return Fo(Go,n)},Yo=function(n){return Uo(Go,n)},Ko=function(n){return Vo(Go,n)},$o=function(n){var e,i=function(n){return"br"===we.name(n)},r=function(o){return At.last(o).bind(function(t){var n,r=(n=t,se.nextSibling(n).map(function(n){return!!Xo(n)||(Ko(n)?"img"!==we.name(n):void 0)}).getOr(!1));return se.parent(t).map(function(n){return!0===r||(e=n,"li"===we.name(e)||_e.ancestor(e,Yo).isSome())||i(t)||Xo(n)&&!te.eq(o,n)?[]:[nn.fromTag("br")];var e})}).getOr([])},t=0===(e=P.bind(n,function(n){var e,t=se.children(n);return e=t,P.forall(e,function(n){return i(n)||we.isText(n)&&0===Ct.get(n).trim().length})?[]:t.concat(r(n))})).length?[nn.fromTag("br")]:e;dt.empty(n[0]),st.append(n[0],t)},Jo=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)o.hasOwnProperty(i)&&(t[i]=u(t[i],o[i]))}return t}},Qo=Jo(function(n,e){return p.isObject(n)&&p.isObject(e)?Qo(n,e):e}),Zo=Jo(function(n,e){return e}),ni={deepMerge:Qo,merge:Zo},ei=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},ti=function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return x.none()},ri=function(n,e){return Q.rowcells(e,n.section())},oi=function(n,e){return n.cells()[e]},ii={addCell:function(n,e,t){var r=n.cells(),o=r.slice(0,e),i=r.slice(e),u=o.concat([t]).concat(i);return ri(n,u)},setCells:ri,mutateCell:function(n,e,t){n.cells()[e]=t},getCell:oi,getCellElement:function(n,e){return oi(n,e).element()},mapCells:function(n,e){var t=n.cells(),r=P.map(t,e);return Q.rowcells(r,n.section())},cellLength:function(n){return n.cells().length}},ui=function(n,e){if(0===n.length)return 0;var t=n[0];return P.findIndex(n,function(n){return!e(t.element(),n.element())}).fold(function(){return n.length},function(n){return n})},ai=function(n,e,t,r){var o,i,u,a,c=(o=n,i=e,o[i]).cells().slice(t),l=ui(c,r),s=(u=n,a=t,P.map(u,function(n){return ii.getCell(n,a)})).slice(e),f=ui(s,r);return{colspan:y.constant(l),rowspan:y.constant(f)}},ci=function(o,i){var u=P.map(o,function(n,e){return P.map(n.cells(),function(n,e){return!1})});return P.map(o,function(n,r){var e=P.bind(n.cells(),function(n,e){if(!1===u[r][e]){var t=ai(o,r,e,i);return function(n,e,t,r){for(var o=n;o<n+t;o++)for(var i=e;i<e+r;i++)u[o][i]=!0}(r,e,t.rowspan(),t.colspan()),[Q.detailnew(n.element(),t.rowspan(),t.colspan(),n.isNew())]}return[]});return Q.rowdetails(e,n.section())})},li=function(n,e,t){for(var r=[],o=0;o<n.grid().rows();o++){for(var i=[],u=0;u<n.grid().columns();u++){var a=Ze.getAt(n,o,u).map(function(n){return Q.elementnew(n.element(),t)}).getOrThunk(function(){return Q.elementnew(e.gap(),!0)});i.push(a)}var c=Q.rowcells(i,n.all()[o].section());r.push(c)}return r},si=function(n,e,t,r){t===r?Se.remove(n,e):Se.set(n,e,t)},fi=function(o,n){var i=[],u=[],e=function(n,e){var t;0<n.length?function(n,e){var t=He.child(o,e).getOrThunk(function(){var n=nn.fromTag(e,se.owner(o).dom());return lt.append(o,n),n});dt.empty(t);var r=P.map(n,function(n){n.isNew()&&i.push(n.element());var e=n.element();return dt.empty(e),P.each(n.cells(),function(n){n.isNew()&&u.push(n.element()),si(n.element(),"colspan",n.colspan(),1),si(n.element(),"rowspan",n.rowspan(),1),lt.append(e,n.element())}),e});st.append(t,r)}(n,e):(t=e,He.child(o,t).bind(dt.remove))},t=[],r=[],a=[];return P.each(n,function(n){switch(n.section()){case"thead":t.push(n);break;case"tbody":r.push(n);break;case"tfoot":a.push(n)}}),e(t,"thead"),e(r,"tbody"),e(a,"tfoot"),{newRows:y.constant(i),newCells:y.constant(u)}},di=function(n){return P.map(n,function(n){var t=bt(n.element());return P.each(n.cells(),function(n){var e=wt(n.element());si(e,"colspan",n.colspan(),1),si(e,"rowspan",n.rowspan(),1),lt.append(t,e)}),t})},mi=function(n,e){for(var t=[],r=0;r<n;r++)t.push(e(r));return t},gi=function(n,e){for(var t=[],r=n;r<e;r++)t.push(r);return t},hi=function(e,t){if(t<0||t>=e.length-1)return x.none();var n=e[t].fold(function(){var n=P.reverse(e.slice(0,t));return ti(n,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return x.some({value:n,delta:0})}),r=e[t+1].fold(function(){var n=e.slice(t+1);return ti(n,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return x.some({value:n,delta:1})});return n.bind(function(t){return r.map(function(n){var e=n.delta+t.delta;return Math.abs(n.value-t.value)/e})})},pi=function(n,e,t){var r=n();return P.find(r,e).orThunk(function(){return x.from(r[0]).orThunk(t)}).map(function(n){return n.element()})},vi=function(t){var n=t.grid(),e=gi(0,n.columns()),r=gi(0,n.rows());return P.map(e,function(e){return pi(function(){return P.bind(r,function(n){return Ze.getAt(t,n,e).filter(function(n){return n.column()===e}).fold(y.constant([]),function(n){return[n]})})},function(n){return 1===n.colspan()},function(){return Ze.getAt(t,0,e)})})},bi=function(t){var n=t.grid(),e=gi(0,n.rows()),r=gi(0,n.columns());return P.map(e,function(e){return pi(function(){return P.bind(r,function(n){return Ze.getAt(t,e,n).filter(function(n){return n.row()===e}).fold(y.constant([]),function(n){return[n]})})},function(n){return 1===n.rowspan()},function(){return Ze.getAt(t,e,0)})})},wi=function(n,e,t,r,o){var i=nn.fromTag("div");return ut.setAll(i,{position:"absolute",left:e-r/2+"px",top:t+"px",height:o+"px",width:r+"px"}),Se.setAll(i,{"data-column":n,role:"presentation"}),i},yi=function(n,e,t,r,o){var i=nn.fromTag("div");return ut.setAll(i,{position:"absolute",left:e+"px",top:t-o/2+"px",height:o+"px",width:r+"px"}),Se.setAll(i,{"data-row":n,role:"presentation"}),i},xi=function(n){var e=n.replace(/\./g,"-");return{resolve:function(n){return e+"-"+n}}},Ci={resolve:xi("ephox-snooker").resolve},Ri=function(n,e){var t=Se.get(n,e);return t===undefined||""===t?[]:t.split(" ")},Si=Ri,Ti=function(n,e,t){var r=Ri(n,e).concat([t]);Se.set(n,e,r.join(" "))},Di=function(n,e,t){var r=P.filter(Ri(n,e),function(n){return n!==t});0<r.length?Se.set(n,e,r.join(" ")):Se.remove(n,e)},ki=function(n){return Si(n,"class")},Ai=function(n,e){return Ti(n,"class",e)},Oi=function(n,e){return Di(n,"class",e)},Ni=ki,Ei=Ai,Pi=Oi,Bi=function(n,e){P.contains(ki(n),e)?Oi(n,e):Ai(n,e)},Ii=function(n){return n.dom().classList!==undefined},Wi=function(n,e){return Ii(n)&&n.dom().classList.contains(e)},Mi={add:function(n,e){Ii(n)?n.dom().classList.add(e):Ei(n,e)},remove:function(n,e){var t;Ii(n)?n.dom().classList.remove(e):Pi(n,e),0===(Ii(t=n)?t.dom().classList:Ni(t)).length&&Se.remove(t,"class")},toggle:function(n,e){return Ii(n)?n.dom().classList.toggle(e):Bi(n,e)},toggler:function(n,e){var t,r,o,i,u,a,c=Ii(n),l=n.dom().classList;return t=function(){c?l.remove(e):Pi(n,e)},r=function(){c?l.add(e):Ei(n,e)},o=Wi(n,e),i=o||!1,{on:u=function(){r(),i=!0},off:a=function(){t(),i=!1},toggle:function(){(i?a:u)()},isOn:function(){return i}}},has:Wi},Li=Ci.resolve("resizer-bar"),qi=Ci.resolve("resizer-rows"),ji=Ci.resolve("resizer-cols"),_i=function(n){var e=Ne.descendants(n.parent(),"."+Li);P.each(e,dt.remove)},zi=function(t,n,r){var o=t.origin();P.each(n,function(n,e){n.each(function(n){var e=r(o,n);Mi.add(e,Li),lt.append(t.parent(),e)})})},Hi=function(n,e,t,r,o,i){var u,a,c,l,s=ho(e),f=0<t.length?o.positions(t,e):[];u=n,a=f,c=s,l=Yr(e),zi(u,a,function(n,e){var t=yi(e.row(),c.left()-n.left(),e.y()-n.top(),l,7);return Mi.add(t,qi),t});var d,m,g,h,p=0<r.length?i.positions(r,e):[];d=n,m=p,g=s,h=Vr(e),zi(d,m,function(n,e){var t=wi(e.col(),e.x()-n.left(),g.top()-n.top(),7,h);return Mi.add(t,ji),t})},Fi=function(n,e){var t=Ne.descendants(n.parent(),"."+Li);P.each(t,e)},Ui={refresh:function(n,e,t,r){_i(n);var o=Ke(e),i=Ze.generate(o),u=bi(i),a=vi(i);Hi(n,e,u,a,t,r)},hide:function(n){Fi(n,function(n){ut.set(n,"display","none")})},show:function(n){Fi(n,function(n){ut.set(n,"display","block")})},destroy:_i,isRowBar:function(n){return Mi.has(n,qi)},isColBar:function(n){return Mi.has(n,ji)}},Vi=function(n,r){return P.map(n,function(n){var e,t=(e=n.details(),ti(e,function(n){return se.parent(n.element()).map(function(n){var e=se.parent(n).isNone();return Q.elementnew(n,e)})}).getOrThunk(function(){return Q.elementnew(r.row(),!0)}));return Q.rowdatanew(t.element(),n.details(),n.section(),t.isNew())})},Gi=function(n,e){var t=ci(n,te.eq);return Vi(t,e)},Xi=function(n,e){var t=P.flatten(P.map(n.all(),function(n){return n.cells()}));return P.find(t,function(n){return te.eq(e,n.element())})},Yi=function(a,c,l,s,f){return function(t,r,n,o,i){var e=Ke(r),u=Ze.generate(e);return c(u,n).map(function(n){var e=li(u,o,!1),t=a(e,n,te.eq,f(o)),r=Gi(t.grid(),o);return{grid:y.constant(r),cursor:t.cursor}}).fold(function(){return x.none()},function(n){var e=fi(r,n.grid());return l(r,n.grid(),i),s(r),Ui.refresh(t,r,Do.height,i),x.some({cursor:n.cursor,newRows:e.newRows,newCells:e.newCells})})}},Ki=Gi,$i=function(e,n){return Ye.cell(n.element()).bind(function(n){return Xi(e,n)})},Ji=function(e,n){var t=P.map(n.selection(),function(n){return Ye.cell(n).bind(function(n){return Xi(e,n)})}),r=ei(t);return 0<r.length?x.some(r):x.none()},Qi=function(e,t){return Ye.cell(t.element()).bind(function(n){return Xi(e,n).map(function(n){return ni.merge(n,{generators:t.generators,clipboard:t.clipboard})})})},Zi=function(e,n){var t=P.map(n.selection(),function(n){return Ye.cell(n).bind(function(n){return Xi(e,n)})}),r=ei(t);return 0<r.length?x.some(ni.merge({cells:r},{generators:n.generators,clipboard:n.clipboard})):x.none()},nu=function(n,e){return e.mergable()},eu=function(n,e){return e.unmergable()},tu=function(t){return{is:function(n){return t===n},isValue:y.always,isError:y.never,getOr:y.constant(t),getOrThunk:y.constant(t),getOrDie:y.constant(t),or:function(n){return tu(t)},orThunk:function(n){return tu(t)},fold:function(n,e){return e(t)},map:function(n){return tu(n(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 x.some(t)}}},ru=function(t){return{is:y.never,isValue:y.never,isError:y.always,getOr:y.identity,getOrThunk:function(n){return n()},getOrDie:function(){return y.die(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return ru(t)},each:y.noop,bind:function(n){return ru(t)},exists:y.never,forall:y.always,toOption:x.none}},ou={value:tu,error:ru},iu=function(n,e){return P.map(n,function(){return Q.elementnew(e.cell(),!0)})},uu=function(e,n,t){return e.concat(mi(n,function(n){return ii.setCells(e[e.length-1],iu(e[e.length-1].cells(),t))}))},au=function(n,e,t){return P.map(n,function(n){return ii.setCells(n,n.cells().concat(iu(gi(0,e),t)))})},cu=function(n,e,t){if(n.row()>=e.length||n.column()>ii.cellLength(e[0]))return ou.error("invalid start address out of table bounds, row: "+n.row()+", column: "+n.column());var r=e.slice(n.row()),o=r[0].cells().slice(n.column()),i=ii.cellLength(t[0]),u=t.length;return ou.value({rowDelta:y.constant(r.length-u),colDelta:y.constant(o.length-i)})},lu=function(n,e){var t=ii.cellLength(n[0]),r=ii.cellLength(e[0]);return{rowDelta:y.constant(0),colDelta:y.constant(t-r)}},su=function(n,e,t){var r=e.colDelta()<0?au:y.identity;return(e.rowDelta()<0?uu:y.identity)(r(n,Math.abs(e.colDelta()),t),Math.abs(e.rowDelta()),t)},fu=function(n,e,t,r){if(0===n.length)return n;for(var o=e.startRow();o<=e.finishRow();o++)for(var i=e.startCol();i<=e.finishCol();i++)ii.mutateCell(n[o],i,Q.elementnew(r(),!1));return n},du=function(n,e,t,r){for(var o=!0,i=0;i<n.length;i++)for(var u=0;u<ii.cellLength(n[0]);u++){var a=t(ii.getCellElement(n[i],u),e);!0===a&&!1===o?ii.mutateCell(n[i],u,Q.elementnew(r(),!0)):!0===a&&(o=!1)}return n},mu=function(i,u,a,c){if(0<u&&u<i.length){var n=i[u-1].cells(),e=(t=n,r=a,P.foldl(t,function(n,e){return P.exists(n,function(n){return r(n.element(),e.element())})?n:n.concat([e])},[]));P.each(e,function(n){for(var e=x.none(),t=u;t<i.length;t++)for(var r=0;r<ii.cellLength(i[0]);r++){var o=i[t].cells()[r];a(o.element(),n.element())&&(e.isNone()&&(e=x.some(c())),e.each(function(n){ii.mutateCell(i[t],r,Q.elementnew(n,!0))}))}})}var t,r;return i},gu=function(t,r,o,i,u){return cu(t,r,o).map(function(n){var e=su(r,n,i);return function(n,e,t,r,o){for(var i,u,a,c,l,s,f,d=n.row(),m=n.column(),g=d+t.length,h=m+ii.cellLength(t[0]),p=d;p<g;p++)for(var v=m;v<h;v++){i=e,u=p,a=v,c=o,s=l=void 0,l=ii.getCell(i[u],a),s=y.curry(c,l.element()),f=i[u],1<i.length&&1<ii.cellLength(f)&&(0<a&&s(ii.getCellElement(f,a-1))||a<f.length-1&&s(ii.getCellElement(f,a+1))||0<u&&s(ii.getCellElement(i[u-1],a))||u<i.length-1&&s(ii.getCellElement(i[u+1],a)))&&du(e,ii.getCellElement(e[p],v),o,r.cell);var b=ii.getCellElement(t[p-d],v-m),w=r.replace(b);ii.mutateCell(e[p],v,Q.elementnew(w,!0))}return e}(t,e,o,i,u)})},hu=function(n,e,t,r,o){mu(e,n,o,r.cell);var i=lu(t,e),u=su(t,i,r),a=lu(e,u),c=su(e,a,r);return c.slice(0,n).concat(u).concat(c.slice(n,c.length))},pu=function(t,r,n,o,i){var e=t.slice(0,r),u=t.slice(r),a=ii.mapCells(t[n],function(n,e){return 0<r&&r<t.length&&o(ii.getCellElement(t[r-1],e),ii.getCellElement(t[r],e))?ii.getCell(t[r],e):Q.elementnew(i(n.element(),o),!0)});return e.concat([a]).concat(u)},vu=function(n,t,r,o,i){return P.map(n,function(n){var e=0<t&&t<ii.cellLength(n)&&o(ii.getCellElement(n,t-1),ii.getCellElement(n,t))?ii.getCell(n,t):Q.elementnew(i(ii.getCellElement(n,r),o),!0);return ii.addCell(n,t,e)})},bu=function(n,r,o,i,u){var a=o+1;return P.map(n,function(n,e){var t=e===r?Q.elementnew(u(ii.getCellElement(n,o),i),!0):ii.getCell(n,o);return ii.addCell(n,a,t)})},wu=function(n,e,t,r,o){var i=e+1,u=n.slice(0,i),a=n.slice(i),c=ii.mapCells(n[e],function(n,e){return e===t?Q.elementnew(o(n.element(),r),!0):n});return u.concat([c]).concat(a)},yu=function(n,e,t){return n.slice(0,e).concat(n.slice(t+1))},xu=function(n,t,r){var e=P.map(n,function(n){var e=n.cells().slice(0,t).concat(n.cells().slice(r+1));return Q.rowcells(e,n.section())});return P.filter(e,function(n){return 0<n.cells().length})},Cu=function(n,t,r,o){return P.map(n,function(n){return ii.mapCells(n,function(n){return e=n,P.exists(t,function(n){return r(e.element(),n.element())})?Q.elementnew(o(n.element(),r),!0):n;var e})})},Ru=function(n,e,t,r){return ii.getCellElement(n[e],t)!==undefined&&0<e&&r(ii.getCellElement(n[e-1],t),ii.getCellElement(n[e],t))},Su=function(n,e,t){return 0<e&&t(ii.getCellElement(n,e-1),ii.getCellElement(n,e))},Tu=function(t,r,o,n){var e=P.bind(t,function(n,e){return Ru(t,e,r,o)||Su(n,r,o)?[]:[ii.getCell(n,r)]});return Cu(t,e,o,n)},Du=function(t,r,o,n){var i=t[r],e=P.bind(i.cells(),function(n,e){return Ru(t,r,e,o)||Su(i,e,o)?[]:[n]});return Cu(t,e,o,n)},ku=function(n){return{fold:n}},Au=function(){return ku(function(n,e,t,r,o){return n()})},Ou=function(i){return ku(function(n,e,t,r,o){return e(i)})},Nu=function(i,u){return ku(function(n,e,t,r,o){return t(i,u)})},Eu=function(i,u,a){return ku(function(n,e,t,r,o){return r(i,u,a)})},Pu=function(i,u){return ku(function(n,e,t,r,o){return o(i,u)})},Bu=function(n,e,i,u){var t,r,a=n.slice(0),o=(r=e,0===(t=n).length?Au():1===t.length?Ou(0):0===r?Nu(0,1):r===t.length-1?Pu(r-1,r):0<r&&r<t.length-1?Eu(r-1,r,r+1):Au()),c=function(n){return P.map(n,y.constant(0))},l=y.constant(c(a)),s=function(n,e){if(0<=i){var t=Math.max(u.minCellWidth(),a[e]-i);return c(a.slice(0,n)).concat([i,t-a[e]]).concat(c(a.slice(e+1)))}var r=Math.max(u.minCellWidth(),a[n]+i),o=a[n]-r;return c(a.slice(0,n)).concat([r-a[n],o]).concat(c(a.slice(e+1)))},f=s;return o.fold(l,function(n){return u.singleColumnWidth(a[n],i)},f,function(n,e,t){return s(e,t)},function(n,e){if(0<=i)return c(a.slice(0,e)).concat([i]);var t=Math.max(u.minCellWidth(),a[e]+i);return c(a.slice(0,e)).concat([t-a[e]])})},Iu=function(n,e){return Se.has(n,e)&&1<parseInt(Se.get(n,e),10)},Wu={hasColspan:function(n){return Iu(n,"colspan")},hasRowspan:function(n){return Iu(n,"rowspan")},minWidth:y.constant(10),minHeight:y.constant(10),getInt:function(n,e){return parseInt(ut.get(n,e),10)}},Mu=function(n,e,t){return ut.getRaw(n,e).fold(function(){return t(n)+"px"},function(n){return n})},Lu=function(n){return Mu(n,"width",ao.getPixelWidth)},qu=function(n){return Mu(n,"height",ao.getHeight)},ju=function(n,e,t,r,o){var i=vi(n),u=P.map(i,function(n){return n.map(e.edge)});return P.map(i,function(n,e){return n.filter(y.not(Wu.hasColspan)).fold(function(){var n=hi(u,e);return r(n)},function(n){return t(n,o)})})},_u=function(n){return n.map(function(n){return n+"px"}).getOr("")},zu=function(n,e,t,r){var o=bi(n),i=P.map(o,function(n){return n.map(e.edge)});return P.map(o,function(n,e){return n.filter(y.not(Wu.hasRowspan)).fold(function(){var n=hi(i,e);return r(n)},function(n){return t(n)})})},Hu={getRawWidths:function(n,e){return ju(n,e,Lu,_u)},getPixelWidths:function(n,e,t){return ju(n,e,ao.getPixelWidth,function(n){return n.getOrThunk(t.minCellWidth)},t)},getPercentageWidths:function(n,e,t){return ju(n,e,ao.getPercentageWidth,function(n){return n.fold(function(){return t.minCellWidth()},function(n){return n/t.pixelWidth()*100})},t)},getPixelHeights:function(n,e){return zu(n,e,ao.getHeight,function(n){return n.getOrThunk(Wu.minHeight)})},getRawHeights:function(n,e){return zu(n,e,qu,_u)}},Fu=function(n,e,t){for(var r=0,o=n;o<e;o++)r+=t[o]!==undefined?t[o]:0;return r},Uu=function(n,t){var e=Ze.justCells(n);return P.map(e,function(n){var e=Fu(n.column(),n.column()+n.colspan(),t);return{element:n.element,width:y.constant(e),colspan:n.colspan}})},Vu=function(n,t){var e=Ze.justCells(n);return P.map(e,function(n){var e=Fu(n.row(),n.row()+n.rowspan(),t);return{element:n.element,height:y.constant(e),rowspan:n.rowspan}})},Gu=function(n,t){return P.map(n.all(),function(n,e){return{element:n.element,height:y.constant(t[e])}})},Xu=function(n){var e=parseInt(n,10),t=y.identity;return{width:y.constant(e),pixelWidth:y.constant(e),getWidths:Hu.getPixelWidths,getCellDelta:t,singleColumnWidth:function(n,e){return[Math.max(Wu.minWidth(),n+e)-n]},minCellWidth:Wu.minWidth,setElementWidth:ao.setPixelWidth,setTableWidth:function(n,e,t){var r=P.foldr(e,function(n,e){return n+e},0);ao.setPixelWidth(n,r)}}},Yu=function(n,e){if(ao.percentageBasedSizeRegex().test(e)){var t=ao.percentageBasedSizeRegex().exec(e);return o=t[1],i=n,u=parseFloat(o),a=Xr(i),{width:y.constant(u),pixelWidth:y.constant(a),getWidths:Hu.getPercentageWidths,getCellDelta:function(n){return n/a*100},singleColumnWidth:function(n,e){return[100-n]},minCellWidth:function(){return Wu.minWidth()/a*100},setElementWidth:ao.setPercentageWidth,setTableWidth:function(n,e,t){var r=u+t;ao.setPercentageWidth(n,r)}}}if(ao.pixelBasedSizeRegex().test(e)){var r=ao.pixelBasedSizeRegex().exec(e);return Xu(r[1])}var o,i,u,a,c=Xr(n);return Xu(c)},Ku=function(e){return ao.getRawWidth(e).fold(function(){var n=Xr(e);return Xu(n)},function(n){return Yu(e,n)})},$u=function(n){return Ze.generate(n)},Ju=function(n){var e=Ke(n);return $u(e)},Qu=function(n,e,t,r){var o=Ku(n),i=o.getCellDelta(e),u=Ju(n),a=o.getWidths(u,r,o),c=Bu(a,t,i,o),l=P.map(c,function(n,e){return n+a[e]}),s=Uu(u,l);P.each(s,function(n){o.setElementWidth(n.element(),n.width())}),t===u.grid().columns()-1&&o.setTableWidth(n,l,i)},Zu=function(n,t,r,e){var o=Ju(n),i=Hu.getPixelHeights(o,e),u=P.map(i,function(n,e){return r===e?Math.max(t+n,Wu.minHeight()):n}),a=Vu(o,u),c=Gu(o,u);P.each(c,function(n){ao.setHeight(n.element(),n.height())}),P.each(a,function(n){ao.setHeight(n.element(),n.height())});var l,s=(l=u,P.foldr(l,function(n,e){return n+e},0));ao.setHeight(n,s)},na=function(n,e,t){var r=Ku(n),o=$u(e),i=r.getWidths(o,t,r),u=Uu(o,i);P.each(u,function(n){r.setElementWidth(n.element(),n.width())});var a=P.foldr(i,function(n,e){return e+n},0);0<u.length&&r.setElementWidth(n,a)},ea=function(n){0===Ye.cells(n).length&&dt.remove(n)},ta=V.immutable("grid","cursor"),ra=function(n,e,t){return oa(n,e,t).orThunk(function(){return oa(n,0,0)})},oa=function(n,e,t){return x.from(n[e]).bind(function(n){return x.from(n.cells()[t]).bind(function(n){return x.from(n.element())})})},ia=function(n,e,t){return ta(n,oa(n,e,t))},ua=function(n){return P.foldl(n,function(n,e){return P.exists(n,function(n){return n.row()===e.row()})?n:n.concat([e])},[]).sort(function(n,e){return n.row()-e.row()})},aa=function(n){return P.foldl(n,function(n,e){return P.exists(n,function(n){return n.column()===e.column()})?n:n.concat([e])},[]).sort(function(n,e){return n.column()-e.column()})},ca=function(n,e,t){var r=$e(n,t),o=Ze.generate(r);return li(o,e,!0)},la=na,sa={insertRowBefore:Yi(function(n,e,t,r){var o=e.row(),i=e.row(),u=pu(n,i,o,t,r.getOrInit);return ia(u,i,e.column())},$i,y.noop,y.noop,Lo),insertRowsBefore:Yi(function(n,e,t,r){var o=e[0].row(),i=e[0].row(),u=ua(e),a=P.foldl(u,function(n,e){return pu(n,i,o,t,r.getOrInit)},n);return ia(a,i,e[0].column())},Ji,y.noop,y.noop,Lo),insertRowAfter:Yi(function(n,e,t,r){var o=e.row(),i=e.row()+e.rowspan(),u=pu(n,i,o,t,r.getOrInit);return ia(u,i,e.column())},$i,y.noop,y.noop,Lo),insertRowsAfter:Yi(function(n,e,t,r){var o=ua(e),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=P.foldl(o,function(n,e){return pu(n,u,i,t,r.getOrInit)},n);return ia(a,u,e[0].column())},Ji,y.noop,y.noop,Lo),insertColumnBefore:Yi(function(n,e,t,r){var o=e.column(),i=e.column(),u=vu(n,i,o,t,r.getOrInit);return ia(u,e.row(),i)},$i,la,y.noop,Lo),insertColumnsBefore:Yi(function(n,e,t,r){var o=aa(e),i=o[0].column(),u=o[0].column(),a=P.foldl(o,function(n,e){return vu(n,u,i,t,r.getOrInit)},n);return ia(a,e[0].row(),u)},Ji,la,y.noop,Lo),insertColumnAfter:Yi(function(n,e,t,r){var o=e.column(),i=e.column()+e.colspan(),u=vu(n,i,o,t,r.getOrInit);return ia(u,e.row(),i)},$i,la,y.noop,Lo),insertColumnsAfter:Yi(function(n,e,t,r){var o=e[e.length-1].column(),i=e[e.length-1].column()+e[e.length-1].colspan(),u=aa(e),a=P.foldl(u,function(n,e){return vu(n,i,o,t,r.getOrInit)},n);return ia(a,e[0].row(),i)},Ji,la,y.noop,Lo),splitCellIntoColumns:Yi(function(n,e,t,r){var o=bu(n,e.row(),e.column(),t,r.getOrInit);return ia(o,e.row(),e.column())},$i,la,y.noop,Lo),splitCellIntoRows:Yi(function(n,e,t,r){var o=wu(n,e.row(),e.column(),t,r.getOrInit);return ia(o,e.row(),e.column())},$i,y.noop,y.noop,Lo),eraseColumns:Yi(function(n,e,t,r){var o=aa(e),i=xu(n,o[0].column(),o[o.length-1].column()),u=ra(i,e[0].row(),e[0].column());return ta(i,u)},Ji,la,ea,Lo),eraseRows:Yi(function(n,e,t,r){var o=ua(e),i=yu(n,o[0].row(),o[o.length-1].row()),u=ra(i,e[0].row(),e[0].column());return ta(i,u)},Ji,y.noop,ea,Lo),makeColumnHeader:Yi(function(n,e,t,r){var o=Tu(n,e.column(),t,r.replaceOrInit);return ia(o,e.row(),e.column())},$i,y.noop,y.noop,qo("row","th")),unmakeColumnHeader:Yi(function(n,e,t,r){var o=Tu(n,e.column(),t,r.replaceOrInit);return ia(o,e.row(),e.column())},$i,y.noop,y.noop,qo(null,"td")),makeRowHeader:Yi(function(n,e,t,r){var o=Du(n,e.row(),t,r.replaceOrInit);return ia(o,e.row(),e.column())},$i,y.noop,y.noop,qo("col","th")),unmakeRowHeader:Yi(function(n,e,t,r){var o=Du(n,e.row(),t,r.replaceOrInit);return ia(o,e.row(),e.column())},$i,y.noop,y.noop,qo(null,"td")),mergeCells:Yi(function(n,e,t,r){var o=e.cells();$o(o);var i=fu(n,e.bounds(),t,y.constant(o[0]));return ta(i,x.from(o[0]))},nu,y.noop,y.noop,jo),unmergeCells:Yi(function(n,e,t,r){var o=P.foldr(e,function(n,e){return du(n,e,t,r.combine(e))},n);return ta(o,x.from(e[0]))},eu,la,y.noop,jo),pasteCells:Yi(function(n,t,e,r){var o,i,u,a,c=(o=t.clipboard(),i=t.generators(),u=Ke(o),a=Ze.generate(u),li(a,i,!0)),l=Q.address(t.row(),t.column());return gu(l,n,c,t.generators(),e).fold(function(){return ta(n,x.some(t.element()))},function(n){var e=ra(n,t.row(),t.column());return ta(n,e)})},Qi,la,y.noop,Lo),pasteRowsBefore:Yi(function(n,e,t,r){var o=n[e.cells[0].row()],i=e.cells[0].row(),u=ca(e.clipboard(),e.generators(),o),a=hu(i,n,u,e.generators(),t),c=ra(a,e.cells[0].row(),e.cells[0].column());return ta(a,c)},Zi,y.noop,y.noop,Lo),pasteRowsAfter:Yi(function(n,e,t,r){var o=n[e.cells[0].row()],i=e.cells[e.cells.length-1].row()+e.cells[e.cells.length-1].rowspan(),u=ca(e.clipboard(),e.generators(),o),a=hu(i,n,u,e.generators(),t),c=ra(a,e.cells[0].row(),e.cells[0].column());return ta(a,c)},Zi,y.noop,y.noop,Lo)},fa=function(n){return nn.fromDom(n.getBody())},da=function(n){return n.getBoundingClientRect().width},ma=function(n){return n.getBoundingClientRect().height},ga=function(e){return function(n){return te.eq(n,fa(e))}},ha=function(n){return/^[0-9]+$/.test(n)&&(n+="px"),n},pa=function(n){var e=Ne.descendants(n,"td[data-mce-style],th[data-mce-style]");Se.remove(n,"data-mce-style"),P.each(e,function(n){Se.remove(n,"data-mce-style")})},va=function(n){return"rtl"===ut.get(n,"direction")?"rtl":"ltr"},ba={onDirection:function(e,t){return function(n){return"rtl"===va(n)?t:e}},getDirection:va},wa={isRtl:y.constant(!1)},ya={isRtl:y.constant(!0)},xa={directionAt:function(n){return"rtl"===ba.getDirection(n)?ya:wa}},Ca=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],Ra={"border-collapse":"collapse",width:"100%"},Sa={border:"1"},Ta=function(n){return n.getParam("table_cell_advtab",!0,"boolean")},Da=function(n){return n.getParam("table_row_advtab",!0,"boolean")},ka=function(n){return n.getParam("table_advtab",!0,"boolean")},Aa=function(n){return n.getParam("table_style_by_css",!1,"boolean")},Oa=function(n){return n.getParam("table_cell_class_list",[],"array")},Na=function(n){return n.getParam("table_row_class_list",[],"array")},Ea=function(n){return n.getParam("table_class_list",[],"array")},Pa=function(n){return!1===n.getParam("table_responsive_width")},Ba=function(n,e){return n.fire("newrow",{node:e})},Ia=function(n,e){return n.fire("newcell",{node:e})},Wa=function(n,e,t,r){n.fire("ObjectResizeStart",{target:e,width:t,height:r})},Ma=function(n,e,t,r){n.fire("ObjectResized",{target:e,width:t,height:r})},La=function(s,n){var e,t=function(n){return"table"===we.name(fa(n))},f=(e=s.getParam("table_clone_elements"),p.isString(e)?x.some(e.split(/[ ,]/)):Array.isArray(e)?x.some(e):x.none()),r=function(u,a,c,l){return function(n,e){pa(n);var t=l(),r=nn.fromDom(s.getDoc()),o=Ao(xa.directionAt),i=Bt(c,r,f);return a(n)?u(t,n,e,i,o).bind(function(n){return P.each(n.newRows(),function(n){Ba(s,n.dom())}),P.each(n.newCells(),function(n){Ia(s,n.dom())}),n.cursor().map(function(n){var e=s.dom.createRng();return e.setStart(n.dom(),0),e.setEnd(n.dom(),0),e})}):x.none()}};return{deleteRow:r(sa.eraseRows,function(n){var e=Oo(n);return!1===t(s)||1<e.rows()},y.noop,n),deleteColumn:r(sa.eraseColumns,function(n){var e=Oo(n);return!1===t(s)||1<e.columns()},y.noop,n),insertRowsBefore:r(sa.insertRowsBefore,y.always,y.noop,n),insertRowsAfter:r(sa.insertRowsAfter,y.always,y.noop,n),insertColumnsBefore:r(sa.insertColumnsBefore,y.always,co,n),insertColumnsAfter:r(sa.insertColumnsAfter,y.always,co,n),mergeCells:r(sa.mergeCells,y.always,y.noop,n),unmergeCells:r(sa.unmergeCells,y.always,y.noop,n),pasteRowsBefore:r(sa.pasteRowsBefore,y.always,y.noop,n),pasteRowsAfter:r(sa.pasteRowsAfter,y.always,y.noop,n),pasteCells:r(sa.pasteCells,y.always,y.noop,n)}},qa=function(n,e,r){var t=Ke(n),o=Ze.generate(t);return Ji(o,e).map(function(n){var e=li(o,r,!1).slice(n[0].row(),n[n.length-1].row()+n[n.length-1].rowspan()),t=Ki(e,r);return di(t)})},ja=tinymce.util.Tools.resolve("tinymce.util.Tools"),_a=function(n,e,t){t&&n.formatter.apply("align"+t,{},e)},za=function(n,e,t){t&&n.formatter.apply("valign"+t,{},e)},Ha=function(e,t){ja.each("left center right".split(" "),function(n){e.formatter.remove("align"+n,{},t)})},Fa=function(e,t){ja.each("top middle bottom".split(" "),function(n){e.formatter.remove("valign"+n,{},t)})},Ua=function(o,n,i){var e;return e=function(n,e){for(var t=0;t<e.length;t++){var r=o.getStyle(e[t],i);if(void 0===n&&(n=r),n!==r)return""}return n}(e,o.select("td,th",n))},Va=function(n,e){var t=n.dom,r=e.control.rootControl,o=r.toJSON(),i=t.parseStyle(o.style);"style"===e.control.name()?(r.find("#borderStyle").value(i["border-style"]||"")[0].fire("select"),r.find("#borderColor").value(i["border-color"]||"")[0].fire("change"),r.find("#backgroundColor").value(i["background-color"]||"")[0].fire("change"),r.find("#width").value(i.width||"").fire("change"),r.find("#height").value(i.height||"").fire("change")):(i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?ha(o.width):"",i.height=o.height?ha(o.height):""),r.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(i))))},Ga=function(t){var n=function(){var n=t.getParam("color_picker_callback");if(n)return function(e){return n.call(t,function(n){e.control.value(n).fire("change")},e.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:y.curry(Va,t)},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:y.curry(Va,t),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:n()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:n()}]}]}},Xa=function(n,r,e){var o=function(n,t){return t=t||[],ja.each(n,function(n){var e={text:n.text||n.title};n.menu?e.menu=o(n.menu):(e.value=n.value,r&&r(e)),t.push(e)}),t};return o(n,e||[])},Ya=Va,Ka=function(n,e){var t=n.parseStyle(n.getAttrib(e,"style")),r={};return t["border-style"]&&(r.borderStyle=t["border-style"]),t["border-color"]&&(r.borderColor=t["border-color"]),t["background-color"]&&(r.backgroundColor=t["background-color"]),r.style=n.serializeStyle(t),r},$a=function(r,o,n){var i,u=r.dom;function a(n,e,t){t&&u.setAttrib(n,e,t)}function c(n,e,t){t&&u.setStyle(n,e,t)}Ya(r,n),i=n.control.rootControl.toJSON(),r.undoManager.transact(function(){ja.each(o,function(n){var e,t;a(n,"scope",i.scope),1===o.length?a(n,"style",i.style):(e=n,t=i.style,delete e.dataset.mceStyle,e.style.cssText+=";"+t),a(n,"class",i["class"]),c(n,"width",ha(i.width)),c(n,"height",ha(i.height)),i.type&&n.nodeName.toLowerCase()!==i.type&&(n=u.rename(n,i.type)),1===o.length&&(Ha(r,n),Fa(r,n)),i.align&&_a(r,n,i.align),i.valign&&za(r,n,i.valign)}),r.focus()})},Ja=function(e){var n,t,r,o=[];if(o=e.dom.select("td[data-mce-selected],th[data-mce-selected]"),n=e.dom.getParent(e.selection.getStart(),"td,th"),!o.length&&n&&o.push(n),n=n||o[0]){var i,u,a,c;1<o.length?t={width:"",height:"",scope:"","class":"",align:"",valign:"",style:"",type:n.nodeName.toLowerCase()}:(u=n,a=(i=e).dom,c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class"),type:u.nodeName.toLowerCase(),style:"",align:"",valign:""},ja.each("left center right".split(" "),function(n){i.formatter.matchNode(u,"align"+n)&&(c.align=n)}),ja.each("top middle bottom".split(" "),function(n){i.formatter.matchNode(u,"valign"+n)&&(c.valign=n)}),Ta(i)&&ja.extend(c,Ka(a,u)),t=c),0<Oa(e).length&&(r={name:"class",type:"listbox",label:"Class",values:Xa(Oa(e),function(n){n.value&&(n.textStyle=function(){return e.formatter.getCssText({block:"td",classes:[n.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:y.curry(Ya,e)},{label:"Height",name:"height",onchange:y.curry(Ya,e)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};Ta(e)?e.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:t,body:[{title:"General",type:"form",items:l},Ga(e)],onsubmit:y.curry($a,e,o)}):e.windowManager.open({title:"Cell properties",data:t,body:l,onsubmit:y.curry($a,e,o)})}};function Qa(s,n,f,e){var d=s.dom;function m(n,e,t){t&&d.setAttrib(n,e,t)}Ya(s,e);var g=e.control.rootControl.toJSON();s.undoManager.transact(function(){ja.each(n,function(n){var e,t,r,o,i,u,a,c,l;m(n,"scope",g.scope),m(n,"style",g.style),m(n,"class",g["class"]),e=n,t="height",(r=ha(g.height))&&d.setStyle(e,t,r),g.type!==n.parentNode.nodeName.toLowerCase()&&(o=s.dom,i=n,u=g.type,a=o.getParent(i,"table"),c=i.parentNode,(l=o.select(u,a)[0])||(l=o.create(u),a.firstChild?"CAPTION"===a.firstChild.nodeName?o.insertAfter(l,a.firstChild):a.insertBefore(l,a.firstChild):a.appendChild(l)),l.appendChild(i),c.hasChildNodes()||o.remove(c)),g.align!==f.align&&(Ha(s,n),_a(s,n,g.align))}),s.focus()})}var Za=function(e){var n,t,r,o,i,u,a,c,l,s,f=e.dom,d=[];n=f.getParent(e.selection.getStart(),"table"),t=f.getParent(e.selection.getStart(),"td,th"),ja.each(n.rows,function(e){ja.each(e.cells,function(n){if(f.getAttrib(n,"data-mce-selected")||n===t)return d.push(e),!1})}),(r=d[0])&&(1<d.length?i={height:"",scope:"",style:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=e).dom,s={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class"),align:"",style:"",type:c.parentNode.nodeName.toLowerCase()},ja.each("left center right".split(" "),function(n){a.formatter.matchNode(c,"align"+n)&&(s.align=n)}),Da(a)&&ja.extend(s,Ka(l,c)),i=s),0<Na(e).length&&(o={name:"class",type:"listbox",label:"Class",values:Xa(Na(e),function(n){n.value&&(n.textStyle=function(){return e.formatter.getCssText({block:"tr",classes:[n.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},Da(e)?e.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Ga(e)],onsubmit:y.curry(Qa,e,d,i)}):e.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:y.curry(Qa,e,d,i)}))},nc=tinymce.util.Tools.resolve("tinymce.Env"),ec={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},tc=function(n,e,t,r,o){void 0===o&&(o=ec);var i=nn.fromTag("table");ut.setAll(i,o.styles),Se.setAll(i,o.attributes);var u=nn.fromTag("tbody");lt.append(i,u);for(var a=[],c=0;c<n;c++){for(var l=nn.fromTag("tr"),s=0;s<e;s++){var f=c<t||s<r?nn.fromTag("th"):nn.fromTag("td");s<r&&Se.set(f,"scope","row"),c<t&&Se.set(f,"scope","col"),lt.append(f,nn.fromTag("br")),o.percentages&&ut.set(f,"width",100/e+"%"),lt.append(l,f)}a.push(l)}return st.append(u,a),i},rc=function(n){return n.dom().innerHTML},oc=function(n){var e=nn.fromTag("div"),t=nn.fromDom(n.dom().cloneNode(!0));return lt.append(e,t),rc(e)},ic=function(n,e){n.selection.select(e.dom(),!0),n.selection.collapse(!0)},uc=function(i,n,e){var t,r,o=i.getParam("table_default_styles",Ra,"object"),u={styles:o,attributes:(r=i,r.getParam("table_default_attributes",Sa,"object")),percentages:(t=o.width,p.isString(t)&&-1!==t.indexOf("%")&&!Pa(i))},a=tc(e,n,0,0,u);Se.set(a,"data-mce-id","__mce");var c=oc(a);return i.insertContent(c),He.descendant(fa(i),'table[data-mce-id="__mce"]').map(function(n){var e,t,r,o;return Pa(i)&&ut.set(n,"width",ut.get(n,"width")),Se.remove(n,"data-mce-id"),e=i,t=n,P.each(Ne.descendants(t,"tr"),function(n){Ba(e,n.dom()),P.each(Ne.descendants(n,"th,td"),function(n){Ia(e,n.dom())})}),r=i,o=n,He.descendant(o,"td,th").each(y.curry(ic,r)),n.dom()}).getOr(null)};function ac(n,e,t,r){if("TD"===e.tagName||"TH"===e.tagName)n.setStyle(e,t,r);else if(e.children)for(var o=0;o<e.children.length;o++)ac(n,e.children[o],t,r)}var cc=function(n,e,t){var r,o,i=n.dom;Ya(n,t),!1===(o=t.control.rootControl.toJSON())["class"]&&delete o["class"],n.undoManager.transact(function(){e||(e=uc(n,o.cols||1,o.rows||1)),function(n,e,t){var r,o=n.dom,i={},u={};if(i["class"]=t["class"],u.height=ha(t.height),o.getAttrib(e,"width")&&!Aa(n)?i.width=(r=t.width)?r.replace(/px$/,""):"":u.width=ha(t.width),Aa(n)?(u["border-width"]=ha(t.border),u["border-spacing"]=ha(t.cellspacing),ja.extend(i,{"data-mce-border-color":t.borderColor,"data-mce-cell-padding":t.cellpadding,"data-mce-border":t.border})):ja.extend(i,{border:t.border,cellpadding:t.cellpadding,cellspacing:t.cellspacing}),Aa(n)&&e.children)for(var a=0;a<e.children.length;a++)ac(o,e.children[a],{"border-width":ha(t.border),"border-color":t.borderColor,padding:ha(t.cellpadding)});t.style?ja.extend(u,o.parseStyle(t.style)):u=ja.extend({},o.parseStyle(o.getAttrib(e,"style")),u),i.style=o.serializeStyle(u),o.setAttribs(e,i)}(n,e,o),(r=i.select("caption",e)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=nc.ie?"\xa0":'<br data-mce-bogus="1"/>',e.insertBefore(r,e.firstChild)),Ha(n,e),o.align&&_a(n,e,o.align),n.focus(),n.addVisual()})},lc=function(e,n){var t,r,o,i,u,a,c,l,s,f,d=e.dom,m={};!0===n?(t=d.getParent(e.selection.getStart(),"table"))&&(c=t,l=(a=e).dom,s={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||Ua(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||Ua(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},ja.each("left center right".split(" "),function(n){a.formatter.matchNode(c,"align"+n)&&(s.align=n)}),ka(a)&&ja.extend(s,Ka(l,c)),m=s):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),0<Ea(e).length&&(m["class"]&&(m["class"]=m["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:Xa(Ea(e),function(n){n.value&&(n.textStyle=function(){return e.formatter.getCssText({block:"table",classes:[n.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:(f=e,f.getParam("table_appearance_options",!0,"boolean")?[r,o,{label:"Width",name:"width",onchange:y.curry(Ya,e)},{label:"Height",name:"height",onchange:y.curry(Ya,e)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:y.curry(Ya,e)},{label:"Height",name:"height",onchange:y.curry(Ya,e)}])},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},ka(e)?e.windowManager.open({title:"Table properties",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Ga(e)],onsubmit:y.curry(cc,e,t)}):e.windowManager.open({title:"Table properties",data:m,body:u,onsubmit:y.curry(cc,e,t)})},sc=ja.each,fc=function(a,e,c,l,t){var r=ga(a),s=function(){return nn.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"))},f=function(n){return Ye.table(n,r)},d=function(n){return{width:da(n.dom()),height:da(n.dom())}},o=function(e){var t=s();f(t).each(function(i){var n=_r.forMenu(l,i,t),u=d(i);e(i,n).each(function(n){var e,t,r,o;e=a,t=u,o=d(r=i),t.width===o.width&&t.height===o.height||(Wa(e,r.dom(),t.width,t.height),Ma(e,r.dom(),o.width,o.height)),a.selection.setRng(n),a.focus(),c.clear(i),pa(i)})})},i=function(n){var o=s();return f(o).bind(function(n){var e=nn.fromDom(a.getDoc()),t=_r.forMenu(l,n,o),r=Bt(y.noop,e,x.none());return qa(n,t,r)})},u=function(u){t.get().each(function(n){var o=P.map(n,function(n){return wt(n)}),i=s();f(i).bind(function(e){var n=nn.fromDom(a.getDoc()),t=It(n),r=_r.pasteRows(l,e,i,o,t);u(e,r).each(function(n){a.selection.setRng(n),a.focus(),c.clear(e)})})})};sc({mceTableSplitCells:function(){o(e.unmergeCells)},mceTableMergeCells:function(){o(e.mergeCells)},mceTableInsertRowBefore:function(){o(e.insertRowsBefore)},mceTableInsertRowAfter:function(){o(e.insertRowsAfter)},mceTableInsertColBefore:function(){o(e.insertColumnsBefore)},mceTableInsertColAfter:function(){o(e.insertColumnsAfter)},mceTableDeleteCol:function(){o(e.deleteColumn)},mceTableDeleteRow:function(){o(e.deleteRow)},mceTableCutRow:function(n){t.set(i()),o(e.deleteRow)},mceTableCopyRow:function(n){t.set(i())},mceTablePasteRowBefore:function(n){u(e.pasteRowsBefore)},mceTablePasteRowAfter:function(n){u(e.pasteRowsAfter)},mceTableDelete:function(){var n=nn.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"));Ye.table(n,r).filter(y.not(r)).each(function(n){var e=nn.fromText("");lt.after(n,e),dt.remove(n);var t=a.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),a.selection.setRng(t)})}},function(n,e){a.addCommand(e,n)}),sc({mceInsertTable:y.curry(lc,a),mceTableProps:y.curry(lc,a,!0),mceTableRowProps:y.curry(Za,a),mceTableCellProps:y.curry(Ja,a)},function(t,n){a.addCommand(n,function(n,e){t(e)})})},dc=function(n){var e=x.from(n.dom().documentElement).map(nn.fromDom).getOr(n);return{parent:y.constant(e),view:y.constant(n),origin:y.constant(fo(0,0))}},mc=function(n,e){return{parent:y.constant(e),view:y.constant(n),origin:y.constant(fo(0,0))}};function gc(n){var t=V.immutable.apply(null,n),r=[];return{bind:function(n){if(n===undefined)throw"Event bind error: undefined handler";r.push(n)},unbind:function(e){r=P.filter(r,function(n){return n!==e})},trigger:function(){var e=t.apply(null,arguments);P.each(r,function(n){n(e)})}}}var hc={create:function(n){return{registry:q.map(n,function(n){return{bind:n.bind,unbind:n.unbind}}),trigger:q.map(n,function(n){return n.trigger})}}},pc={mode:Io.exactly(["compare","extract","mutate","sink"]),sink:Io.exactly(["element","start","stop","destroy"]),api:Io.exactly(["forceDrop","drop","move","delayDrop"])},vc={resolve:xi("ephox-dragster").resolve},bc=function(m,g){return function(n){if(m(n)){var e,t,r,o,i,u,a,c=nn.fromDom(n.target),l=function(){n.stopPropagation()},s=function(){n.preventDefault()},f=y.compose(s,l),d=(e=c,t=n.clientX,r=n.clientY,o=l,i=s,u=f,a=n,{target:y.constant(e),x:y.constant(t),y:y.constant(r),stop:o,prevent:i,kill:u,raw:y.constant(a)});g(d)}}},wc=function(n,e,t,r,o){var i=bc(t,r);return n.dom().addEventListener(e,i,o),{unbind:y.curry(yc,n,e,i,o)}},yc=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},xc=function(n,e,t,r){return wc(n,e,t,r,!1)},Cc=function(n,e,t,r){return wc(n,e,t,r,!0)},Rc=y.constant(!0),Sc={bind:function(n,e,t){return xc(n,e,Rc,t)},capture:function(n,e,t){return Cc(n,e,Rc,t)}},Tc=pc.mode({compare:function(n,e){return fo(e.left()-n.left(),e.top()-n.top())},extract:function(n){return x.some(fo(n.x(),n.y()))},sink:function(n,e){var t,r,o,i=(t=e,r=ni.merge({layerClass:vc.resolve("blocker")},t),o=nn.fromTag("div"),Se.set(o,"role","presentation"),ut.setAll(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Mi.add(o,vc.resolve("blocker")),Mi.add(o,r.layerClass),{element:function(){return o},destroy:function(){dt.remove(o)}}),u=Sc.bind(i.element(),"mousedown",n.forceDrop),a=Sc.bind(i.element(),"mouseup",n.drop),c=Sc.bind(i.element(),"mousemove",n.move),l=Sc.bind(i.element(),"mouseout",n.delayDrop);return pc.sink({element:i.element,start:function(n){lt.append(n,i.element())},stop:function(){dt.remove(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(n,e){n.mutate(e.left(),e.top())}});function Dc(){var i=x.none(),u=hc.create({move:gc(["info"])});return{onEvent:function(n,o){o.extract(n).each(function(n){var e,t,r;(e=o,t=n,r=i.map(function(n){return e.compare(n,t)}),i=x.some(t),r).each(function(n){u.trigger.move(n)})})},reset:function(){i=x.none()},events:u.registry}}function kc(){var n={onEvent:function(n,e){},reset:y.noop},e=Dc(),t=n;return{on:function(){t.reset(),t=e},off:function(){t.reset(),t=n},isOn:function(){return t===e},onEvent:function(n,e){t.onEvent(n,e)},events:e.events}}var Ac=function(e,t){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){var n=arguments;null!==r&&clearTimeout(r),r=setTimeout(function(){e.apply(null,n),n=r=null},t)}}},Oc=function(e,t,n){var r=!1,o=hc.create({start:gc([]),stop:gc([])}),i=kc(),u=function(){l.stop(),i.isOn()&&(i.off(),o.trigger.stop())},a=Ac(u,200);i.events.move.bind(function(n){t.mutate(e,n.info())});var c=function(e){return function(){var n=Array.prototype.slice.call(arguments,0);if(r)return e.apply(null,n)}},l=t.sink(pc.api({forceDrop:u,drop:c(u),move:c(function(n,e){a.cancel(),i.onEvent(n,t)}),delayDrop:c(a.throttle)}),n);return{element:l.element,go:function(n){l.start(n),i.on(),o.trigger.start()},on:function(){r=!0},off:function(){r=!1},destroy:function(){l.destroy()},events:o.registry}},Nc={transform:function(n,e){var t=e!==undefined?e:{},r=t.mode!==undefined?t.mode:Tc;return Oc(n,r,e)}};function Ec(){var t,r=hc.create({drag:gc(["xDelta","yDelta","target"])}),o=x.none(),n={mutate:function(n,e){t.trigger.drag(n,e)},events:(t=hc.create({drag:gc(["xDelta","yDelta"])})).registry};return n.events.drag.bind(function(e){o.each(function(n){r.trigger.drag(e.xDelta(),e.yDelta(),n)})}),{assign:function(n){o=x.some(n)},get:function(){return o},mutate:n.mutate,events:r.registry}}var Pc={any:function(n){return He.first(n).isSome()},ancestor:function(n,e,t){return He.ancestor(n,e,t).isSome()},sibling:function(n,e){return He.sibling(n,e).isSome()},child:function(n,e){return He.child(n,e).isSome()},descendant:function(n,e){return He.descendant(n,e).isSome()},closest:function(n,e,t){return He.closest(n,e,t).isSome()}},Bc=Ci.resolve("resizer-bar-dragging");function Ic(n,t){var r=Do.height,e=function(o,e,i){var t=Ec(),r=Nc.transform(t,{}),u=x.none(),n=function(n,e){return x.from(Se.get(n,e))};t.events.drag.bind(function(t){n(t.target(),"data-row").each(function(n){var e=Wu.getInt(t.target(),"top");ut.set(t.target(),"top",e+t.yDelta()+"px")}),n(t.target(),"data-column").each(function(n){var e=Wu.getInt(t.target(),"left");ut.set(t.target(),"left",e+t.xDelta()+"px")})});var a=function(n,e){return Wu.getInt(n,e)-parseInt(Se.get(n,"data-initial-"+e),10)};r.events.stop.bind(function(){t.get().each(function(r){u.each(function(t){n(r,"data-row").each(function(n){var e=a(r,"top");Se.remove(r,"data-initial-top"),d.trigger.adjustHeight(t,e,parseInt(n,10))}),n(r,"data-column").each(function(n){var e=a(r,"left");Se.remove(r,"data-initial-left"),d.trigger.adjustWidth(t,e,parseInt(n,10))}),Ui.refresh(o,t,i,e)})})});var c=function(n,e){d.trigger.startAdjust(),t.assign(n),Se.set(n,"data-initial-"+e,parseInt(ut.get(n,e),10)),Mi.add(n,Bc),ut.set(n,"opacity","0.2"),r.go(o.parent())},l=Sc.bind(o.parent(),"mousedown",function(n){Ui.isRowBar(n.target())&&c(n.target(),"top"),Ui.isColBar(n.target())&&c(n.target(),"left")}),s=function(n){return te.eq(n,o.view())},f=Sc.bind(o.view(),"mouseover",function(n){"table"===we.name(n.target())||Pc.closest(n.target(),"table",s)?(u="table"===we.name(n.target())?x.some(n.target()):He.ancestor(n.target(),"table",s)).each(function(n){Ui.refresh(o,n,i,e)}):ke.inBody(n.target())&&Ui.destroy(o)}),d=hc.create({adjustHeight:gc(["table","delta","row"]),adjustWidth:gc(["table","delta","column"]),startAdjust:gc([])});return{destroy:function(){l.unbind(),f.unbind(),r.destroy(),Ui.destroy(o)},refresh:function(n){Ui.refresh(o,n,i,e)},on:r.on,off:r.off,hideBars:y.curry(Ui.hide,o),showBars:y.curry(Ui.show,o),events:d.registry}}(n,t,r),o=hc.create({beforeResize:gc(["table"]),afterResize:gc(["table"]),startDrag:gc([])});return e.events.adjustHeight.bind(function(n){o.trigger.beforeResize(n.table());var e=r.delta(n.delta(),n.table());Zu(n.table(),e,n.row(),r),o.trigger.afterResize(n.table())}),e.events.startAdjust.bind(function(n){o.trigger.startDrag()}),e.events.adjustWidth.bind(function(n){o.trigger.beforeResize(n.table());var e=t.delta(n.delta(),n.table());Qu(n.table(),e,n.column(),t),o.trigger.afterResize(n.table())}),{on:e.on,off:e.off,hideBars:e.hideBars,showBars:e.showBars,destroy:e.destroy,events:o.registry}}var Wc=function(n,e){return n.inline?mc(fa(n),(t=nn.fromTag("div"),ut.setAll(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),lt.append(ke.body(),t),t)):dc(nn.fromDom(n.getDoc()));var t},Mc=function(n,e){n.inline&&dt.remove(e.parent())},Lc=function(u){var a,c,o=x.none(),i=x.none(),l=x.none(),s=/(\d+(\.\d+)?)%/,f=function(n){return"TABLE"===n.nodeName};return u.on("init",function(){var n,e=Ao(xa.directionAt),t=Wc(u);if(l=x.some(t),("table"===(n=u.getParam("object_resizing",!0))||n)&&u.getParam("table_resize_bars",!0,"boolean")){var r=Ic(t,e);r.on(),r.events.startDrag.bind(function(n){o=x.some(u.selection.getRng())}),r.events.beforeResize.bind(function(n){var e=n.table().dom();Wa(u,e,da(e),ma(e))}),r.events.afterResize.bind(function(n){var e=n.table(),t=e.dom();pa(e),o.each(function(n){u.selection.setRng(n),u.focus()}),Ma(u,t,da(t),ma(t)),u.undoManager.add()}),i=x.some(r)}}),u.on("ObjectResizeStart",function(n){var e,t=n.target;f(t)&&(a=n.width,e=t,c=u.dom.getStyle(e,"width")||u.dom.getAttrib(e,"width"))}),u.on("ObjectResized",function(n){var e=n.target;if(f(e)){var t=e;if(s.test(c)){var r=parseFloat(s.exec(c)[1]),o=n.width*r/a;u.dom.setStyle(t,"width",o+"%")}else{var i=[];ja.each(t.rows,function(n){ja.each(n.cells,function(n){var e=u.dom.getStyle(n,"width",!0);i.push({cell:n,width:e})})}),ja.each(i,function(n){u.dom.setStyle(n.cell,"width",n.width),u.dom.setAttrib(n.cell,"width",null)})}}}),{lazyResize:function(){return i},lazyWire:function(){return l.getOr(dc(nn.fromDom(u.getBody())))},destroy:function(){i.each(function(n){n.destroy()}),l.each(function(n){Mc(u,n)})}}},qc=function(n){return{fold:n}},jc=function(o){return qc(function(n,e,t,r){return n(o)})},_c=function(o){return qc(function(n,e,t,r){return e(o)})},zc=function(o,i){return qc(function(n,e,t,r){return t(o,i)})},Hc=function(o){return qc(function(n,e,t,r){return r(o)})},Fc=function(t,n){return Ye.table(t,n).bind(function(n){var e=Ye.cells(n);return P.findIndex(e,function(n){return te.eq(t,n)}).map(function(n){return{index:y.constant(n),all:y.constant(e)}})})},Uc=function(e,n){return Fc(e,n).fold(function(){return jc(e)},function(n){return n.index()+1<n.all().length?zc(e,n.all()[n.index()+1]):Hc(e)})},Vc=function(e,n){return Fc(e,n).fold(function(){return jc()},function(n){return 0<=n.index()-1?zc(e,n.all()[n.index()-1]):_c(e)})},Gc=Er([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xc={before:Gc.before,on:Gc.on,after:Gc.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(y.identity,y.identity,y.identity)}},Yc=Er([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Kc=V.immutable("start","soffset","finish","foffset"),$c={domRange:Yc.domRange,relative:Yc.relative,exact:Yc.exact,exactFromRange:function(n){return Yc.exact(n.start(),n.soffset(),n.finish(),n.foffset())},range:Kc,getWin:function(n){var e=n.match({domRange:function(n){return nn.fromDom(n.startContainer)},relative:function(n,e){return Xc.getStart(n)},exact:function(n,e,t,r){return n}});return se.defaultView(e)}},Jc=function(n,e,t,r){var o=se.owner(n).dom().createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},Qc=function(n,e,t,r){var o=Jc(n,e,t,r),i=te.eq(n,t)&&e===r;return o.collapsed&&!i},Zc=function(n,e){n.selectNodeContents(e.dom())},nl=function(n){n.deleteContents()},el=function(n){return{left:y.constant(n.left),top:y.constant(n.top),right:y.constant(n.right),bottom:y.constant(n.bottom),width:y.constant(n.width),height:y.constant(n.height)}},tl={create:function(n){return n.document.createRange()},replaceWith:function(n,e){nl(n),n.insertNode(e.dom())},selectNodeContents:function(n,e){var t=n.document.createRange();return Zc(t,e),t},selectNodeContentsUsing:Zc,relativeToNative: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},exactToNative:function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},deleteContents:nl,cloneFragment:function(n){var e=n.cloneContents();return nn.fromDom(e)},getFirstRect:function(n){var e=n.getClientRects(),t=0<e.length?e[0]:n.getBoundingClientRect();return 0<t.width||0<t.height?x.some(t).map(el):x.none()},getBounds:function(n){var e=n.getBoundingClientRect();return 0<e.width||0<e.height?x.some(e).map(el):x.none()},isWithin:function(n,e){return e.compareBoundaryPoints(n.END_TO_START,n)<1&&-1<e.compareBoundaryPoints(n.START_TO_END,n)},toString:function(n){return n.toString()}},rl=Er([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ol=function(n,e,t){return e(nn.fromDom(t.startContainer),t.startOffset,nn.fromDom(t.endContainer),t.endOffset)},il=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:y.constant(n),rtl:x.none}},relative:function(n,e){return{ltr:bn(function(){return tl.relativeToNative(o,n,e)}),rtl:bn(function(){return x.some(tl.relativeToNative(o,e,n))})}},exact:function(n,e,t,r){return{ltr:bn(function(){return tl.exactToNative(o,n,e,t,r)}),rtl:bn(function(){return x.some(tl.exactToNative(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return rl.rtl(nn.fromDom(n.endContainer),n.endOffset,nn.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return ol(0,rl.ltr,r)}):ol(0,rl.ltr,r)},ul={ltr:rl.ltr,rtl:rl.rtl,diagnose:il,asLtrRange:function(i,n){return il(i,n).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}})}},al=function(n,e,t){return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom},cl=function(n,e,t,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var a=n(u),c=Math.abs(e-a.left);if(t>a.bottom);else{if(t<a.top||i<c)return u-1;i=c}}return 0},ll={locate:function(l,s,f,d){var n=l.dom().createRange();n.selectNode(s.dom());var e=n.getClientRects();return ti(e,function(n){return al(n,f,d)?x.some(n):x.none()}).map(function(n){return t=l,e=f,o=d,i=n,u=function(n){var e=t.dom().createRange();return e.setStart(r.dom(),n),e.collapse(!0),e},a=Ct.get(r=s).length,c=cl(function(n){return u(n).getBoundingClientRect()},e,o,i.right,a),u(c);var t,r,e,o,i,u,a,c})}},sl=function(e,n,t,r){var o=e.dom().createRange(),i=se.children(n);return ti(i,function(n){return o.selectNode(n.dom()),al(o.getBoundingClientRect(),t,r)?fl(e,n,t,r):x.none()})},fl=function(n,e,t,r){return(we.isText(e)?ll.locate:sl)(n,e,t,r)},dl=function(n,e,t,r){var o=n.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,t)),a=Math.max(i.top,Math.min(i.bottom,r));return fl(n,e,u,a)},ml=function(n,e){return e-n.left<n.right-e},gl=function(n,e,t){var r=n.dom().createRange();return r.selectNode(e.dom()),r.collapse(t),r},hl=function(e,n,t){var r=e.dom().createRange();r.selectNode(n.dom());var o=r.getBoundingClientRect(),i=ml(o,t);return(!0===i?At.first:At.last)(n).map(function(n){return gl(e,n,i)})},pl=function(n,e,t){var r=e.dom().getBoundingClientRect(),o=ml(r,t);return x.some(gl(n,e,o))},vl=function(n,e,t){return(0===se.children(e).length?pl:hl)(n,e,t)},bl=document.caretPositionFromPoint?function(t,n,e){return x.from(t.dom().caretPositionFromPoint(n,e)).bind(function(n){if(null===n.offsetNode)return x.none();var e=t.dom().createRange();return e.setStart(n.offsetNode,n.offset),e.collapse(),x.some(e)})}:document.caretRangeFromPoint?function(n,e,t){return x.from(n.dom().caretRangeFromPoint(e,t))}:function(t,r,o){return nn.fromPoint(t,r,o).bind(function(n){var e=function(){return vl(t,n,r)};return 0===se.children(n).length?e():function(n,e,t,r){var o=n.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,t)),a=Math.max(i.top,Math.min(i.bottom,r));return dl(n,e,u,a)}(t,n,r,o).orThunk(e)})},wl=function(n,e,t){var r=nn.fromDom(n.document);return bl(r,e,t).map(function(n){return $c.range(nn.fromDom(n.startContainer),n.startOffset,nn.fromDom(n.endContainer),n.endOffset)})},yl=function(n,e){var t=we.name(n);return"input"===t?Xc.after(n):P.contains(["br","img"],t)?0===e?Xc.before(n):Xc.after(n):Xc.on(n,e)},xl=function(n,e){var t=n.fold(Xc.before,yl,Xc.after),r=e.fold(Xc.before,yl,Xc.after);return $c.relative(t,r)},Cl=function(n,e,t,r){var o=yl(n,e),i=yl(t,r);return $c.relative(o,i)},Rl=function(n){return n.match({domRange:function(n){var e=nn.fromDom(n.startContainer),t=nn.fromDom(n.endContainer);return Cl(e,n.startOffset,t,n.endOffset)},relative:xl,exact:Cl})},Sl=xl,Tl=Cl,Dl=function(n,e){x.from(n.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(e)})},kl=function(n,e,t,r,o){var i=tl.exactToNative(n,e,t,r,o);Dl(n,i)},Al=function(i,n){return ul.diagnose(i,n).match({ltr:function(n,e,t,r){kl(i,n,e,t,r)},rtl:function(n,e,t,r){var o=i.getSelection();o.setBaseAndExtent?o.setBaseAndExtent(n.dom(),e,t.dom(),r):o.extend?(o.collapse(n.dom(),e),o.extend(t.dom(),r)):kl(i,t,r,n,e)}})},Ol=function(n){var e=nn.fromDom(n.anchorNode),t=nn.fromDom(n.focusNode);return Qc(e,n.anchorOffset,t,n.focusOffset)?x.some($c.range(nn.fromDom(n.anchorNode),n.anchorOffset,nn.fromDom(n.focusNode),n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return x.some($c.range(nn.fromDom(e.startContainer),e.startOffset,nn.fromDom(t.endContainer),t.endOffset))}return x.none()}(n)},Nl=function(n){return x.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(Ol)},El=function(n,e,t,r,o){var i=Tl(e,t,r,o);Al(n,i)},Pl=function(n){return Nl(n).map(function(n){return $c.exact(n.start(),n.soffset(),n.finish(),n.foffset())})},Bl=function(n,e,t){var r=Sl(e,t);Al(n,r)},Il=function(n){var o=$c.getWin(n).dom(),e=function(n,e,t,r){return tl.exactToNative(o,n,e,t,r)},t=Rl(n);return ul.diagnose(o,t).match({ltr:e,rtl:e})},Wl=function(n,e){var t=tl.selectNodeContents(n,e);Dl(n,t)},Ml=function(n){n.getSelection().removeAllRanges()},Ll=function(n,e){var t=ul.asLtrRange(n,e);return tl.getFirstRect(t)},ql=function(n,e,t){return wl(n,e,t)},jl=tinymce.util.Tools.resolve("tinymce.util.VK"),_l=function(n,e,t,r){return Fl(n,e,Uc(t),r)},zl=function(n,e,t,r){return Fl(n,e,Vc(t),r)},Hl=function(n,e){var t=$c.exact(e,0,e,0);return Il(t)},Fl=function(o,n,e,i,t){return e.fold(x.none,x.none,function(n,e){return At.first(e).map(function(n){return Hl(0,n)})},function(r){return Ye.table(r,n).bind(function(n){var e,t=_r.noMenu(r);return o.undoManager.transact(function(){i.insertRowsAfter(n,t)}),e=Ne.descendants(n,"tr"),P.last(e).bind(function(n){return He.descendant(n,"td,th").map(function(n){return Hl(0,n)})})})})},Ul=["table","li","dl"],Vl=function(e,t,r,o){if(e.keyCode===jl.TAB){var i=fa(t),u=function(n){var e=we.name(n);return te.eq(n,i)||P.contains(Ul,e)},n=t.selection.getRng();if(n.collapsed){var a=nn.fromDom(n.startContainer);Ye.cell(a,u).each(function(n){e.preventDefault(),(e.shiftKey?zl:_l)(t,u,n,r,o).each(function(n){t.selection.setRng(n)})})}}},Gl={response:V.immutable("selection","kill")},Xl=function(e){return function(n){return n===e}},Yl=Xl(38),Kl=Xl(40),$l={ltr:{isBackward:Xl(37),isForward:Xl(39)},rtl:{isBackward:Xl(39),isForward:Xl(37)},isUp:Yl,isDown:Kl,isNavigation:function(n){return 37<=n&&n<=40}},Jl=function(n,e){var t=ul.asLtrRange(n,e);return{start:y.constant(nn.fromDom(t.startContainer)),soffset:y.constant(t.startOffset),finish:y.constant(nn.fromDom(t.endContainer)),foffset:y.constant(t.endOffset)}},Ql=function(n,e,t,r){return{start:y.constant(Xc.on(n,e)),finish:y.constant(Xc.on(t,r))}},Zl=(Zn.detect().browser.isSafari(),function(n){var e=n!==undefined?n.dom():document,t=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return fo(t,r)}),ns=Zl,es=function(n,e,t){(t!==undefined?t.dom():document).defaultView.scrollBy(n,e)};function ts(i){return{elementFromPoint:function(n,e){return nn.fromPoint(nn.fromDom(i.document),n,e)},getRect:function(n){return n.dom().getBoundingClientRect()},getRangedRect:function(n,e,t,r){var o=$c.exact(n,e,t,r);return Ll(i,o).map(function(n){return q.map(n,y.apply)})},getSelection:function(){return Pl(i).map(function(n){return Jl(i,n)})},fromSitus:function(n){var e=$c.relative(n.start(),n.finish());return Jl(i,e)},situsFromPoint:function(n,e){return ql(i,n,e).map(function(n){return{start:y.constant(Xc.on(n.start(),n.soffset())),finish:y.constant(Xc.on(n.finish(),n.foffset()))}})},clearSelection:function(){Ml(i)},setSelection:function(n){El(i,n.start(),n.soffset(),n.finish(),n.foffset())},setRelativeSelection:function(n,e){Bl(i,n,e)},selectContents:function(n){Wl(i,n)},getInnerHeight:function(){return i.innerHeight},getScrollY:function(){return ns(nn.fromDom(i.document)).top()},scrollBy:function(n,e){es(n,e,nn.fromDom(i.document))}}}var rs=function(t,n,r,e,o){return te.eq(r,e)?x.none():xr(r,e,n).bind(function(n){var e=n.boxes().getOr([]);return 0<e.length?(o(t,e,n.start(),n.finish()),x.some(Gl.response(x.some(Ql(r,0,r,Tt(r))),!0))):x.none()})},os={sync:function(t,r,n,e,o,i,u){return te.eq(n,o)&&e===i?x.none():He.closest(n,"td,th",r).bind(function(e){return He.closest(o,"td,th",r).bind(function(n){return rs(t,r,e,n,u)})})},detect:rs,update:function(n,e,t,r,o){return Rr(r,n,e,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(n){return o.clear(t),o.selectRange(t,n.boxes(),n.start(),n.finish()),n.boxes()})}},is=V.immutableBag(["left","top","right","bottom"],[]),us={nu:is,moveUp:function(n,e){return is({left:n.left(),top:n.top()-e,right:n.right(),bottom:n.bottom()-e})},moveDown:function(n,e){return is({left:n.left(),top:n.top()+e,right:n.right(),bottom:n.bottom()+e})},moveBottomTo:function(n,e){var t=n.bottom()-n.top();return is({left:n.left(),top:e-t,right:n.right(),bottom:e})},moveTopTo:function(n,e){var t=n.bottom()-n.top();return is({left:n.left(),top:e,right:n.right(),bottom:e+t})},getTop:function(n){return n.top()},getBottom:function(n){return n.bottom()},translate:function(n,e,t){return is({left:n.left()+e,top:n.top()+t,right:n.right()+e,bottom:n.bottom()+t})},toString:function(n){return"("+n.left()+", "+n.top()+") -> ("+n.right()+", "+n.bottom()+")"}},as=function(n){return us.nu({left:n.left,top:n.top,right:n.right,bottom:n.bottom})},cs=function(n,e){return x.some(n.getRect(e))},ls=function(n,e,t){return we.isElement(e)?cs(n,e).map(as):we.isText(e)?(r=n,o=e,i=t,0<=i&&i<Tt(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):x.none()).map(as):x.none();var r,o,i},ss=function(n,e){return we.isElement(e)?cs(n,e).map(as):we.isText(e)?n.getRangedRect(e,0,e,Tt(e)).map(as):x.none()},fs=V.immutable("item","mode"),ds=function(n,e,t,r){var o=r!==undefined?r:ms;return n.property().parent(e).map(function(n){return fs(n,o)})},ms=function(n,e,t,r){var o=r!==undefined?r:gs;return t.sibling(n,e).map(function(n){return fs(n,o)})},gs=function(n,e,t,r){var o=r!==undefined?r:gs,i=n.property().children(e);return t.first(i).map(function(n){return fs(n,o)})},hs=[{current:ds,next:ms,fallback:x.none()},{current:ms,next:gs,fallback:x.some(ds)},{current:gs,next:gs,fallback:x.some(ms)}],ps=function(e,t,r,o,n){return n=n!==undefined?n:hs,P.find(n,function(n){return n.current===r}).bind(function(n){return n.current(e,t,o,n.next).orThunk(function(){return n.fallback.bind(function(n){return ps(e,t,n,o)})})})},vs={backtrack:ds,sidestep:ms,advance:gs,go:ps},bs={left:function(){return{sibling:function(n,e){return n.query().prevSibling(e)},first:function(n){return 0<n.length?x.some(n[n.length-1]):x.none()}}},right:function(){return{sibling:function(n,e){return n.query().nextSibling(e)},first:function(n){return 0<n.length?x.some(n[0]):x.none()}}}},ws=function(e,n,t,r,o,i){return vs.go(e,n,r,o).bind(function(n){return i(n.item())?x.none():t(n.item())?x.some(n.item()):ws(e,n.item(),t,n.mode(),o,i)})},ys=function(n,e,t,r){return ws(n,e,t,vs.sidestep,bs.left(),r)},xs=function(n,e,t,r){return ws(n,e,t,vs.sidestep,bs.right(),r)},Cs=function(n,e){return 0===n.property().children(e).length},Rs=function(n,e,t,r){return ys(n,e,t,r)},Ss=function(n,e,t,r){return xs(n,e,t,r)},Ts={before:function(n,e,t){return Rs(n,e,y.curry(Cs,n),t)},after:function(n,e,t){return Ss(n,e,y.curry(Cs,n),t)},seekLeft:Rs,seekRight:Ss,walkers:function(){return{left:bs.left,right:bs.right}},walk:function(n,e,t,r,o){return vs.go(n,e,t,r,o)},backtrack:vs.backtrack,sidestep:vs.sidestep,advance:vs.advance},Ds=Lt(),ks={gather:function(n,e,t){return Ts.gather(Ds,n,e,t)},before:function(n,e){return Ts.before(Ds,n,e)},after:function(n,e){return Ts.after(Ds,n,e)},seekLeft:function(n,e,t){return Ts.seekLeft(Ds,n,e,t)},seekRight:function(n,e,t){return Ts.seekRight(Ds,n,e,t)},walkers:function(){return Ts.walkers()},walk:function(n,e,t,r){return Ts.walk(Ds,n,e,t,r)}},As=Er([{none:[]},{retry:["caret"]}]),Os=function(e,n,r){return _e.closest(n,Xo).fold(y.constant(!1),function(n){return ss(e,n).exists(function(n){return t=n,(e=r).left()<t.left()||Math.abs(t.right()-e.left())<1||e.left()>t.right();var e,t})})},Ns={point:us.getTop,adjuster:function(n,e,t,r,o){var i=us.moveUp(o,5);return Math.abs(t.top()-r.top())<1?As.retry(i):t.bottom()<o.top()?As.retry(i):t.bottom()===o.top()?As.retry(us.moveUp(o,1)):Os(n,e,o)?As.retry(us.translate(i,5,0)):As.none()},move:us.moveUp,gather:ks.before},Es={point:us.getBottom,adjuster:function(n,e,t,r,o){var i=us.moveDown(o,5);return Math.abs(t.bottom()-r.bottom())<1?As.retry(i):t.top()>o.bottom()?As.retry(i):t.top()===o.bottom()?As.retry(us.moveDown(o,1)):Os(n,e,o)?As.retry(us.translate(i,5,0)):As.none()},move:us.moveDown,gather:ks.after},Ps=function(t,r,o,i,u){return 0===u?x.some(i):(c=t,l=i.left(),s=r.point(i),c.elementFromPoint(l,s).filter(function(n){return"table"===we.name(n)}).isSome()?(e=i,a=u-1,Ps(t,n=r,o,n.move(e,5),a)):t.situsFromPoint(i.left(),r.point(i)).bind(function(n){return n.start().fold(x.none,function(e,n){return ss(t,e,n).bind(function(n){return r.adjuster(t,e,n,o,i).fold(x.none,function(n){return Ps(t,r,o,n,u-1)})}).orThunk(function(){return x.some(i)})},x.none)}));var n,e,a,c,l,s},Bs=function(e,t,n){var r,o,i,u=e.move(n,5),a=Ps(t,e,n,u,100).getOr(u);return(r=e,o=a,i=t,r.point(o)>i.getInnerHeight()?x.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?x.some(-r.point(o)):x.none()).fold(function(){return t.situsFromPoint(a.left(),e.point(a))},function(n){return t.scrollBy(0,n),t.situsFromPoint(a.left(),e.point(a)-n)})},Is={tryUp:y.curry(Bs,Ns),tryDown:y.curry(Bs,Es),ieTryUp:function(n,e){return n.situsFromPoint(e.left(),e.top()-5)},ieTryDown:function(n,e){return n.situsFromPoint(e.left(),e.bottom()+5)},getJumpSize:y.constant(5)},Ws=Er([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Ms=function(n){return He.closest(n,"tr")},Ls={verify:function(a,n,e,t,r,c,o){return He.closest(t,"td,th",o).bind(function(u){return He.closest(n,"td,th",o).map(function(i){return te.eq(u,i)?te.eq(t,u)&&Tt(u)===r?c(i):Ws.none("in same cell"):rr.sharedOne(Ms,[u,i]).fold(function(){return e=i,t=u,r=(n=a).getRect(e),(o=n.getRect(t)).right>r.left&&o.left<r.right?Ws.success():c(i);var n,e,t,r,o},function(n){return c(i)})})}).getOr(Ws.none("default"))},cata:function(n,e,t,r,o){return n.fold(e,t,r,o)},adt:Ws},qs={point:V.immutable("element","offset"),delta:V.immutable("element","deltaOffset"),range:V.immutable("element","start","finish"),points:V.immutable("begin","end"),text:V.immutable("element","text")},js=(V.immutable("ancestor","descendants","element","index"),V.immutable("parent","children","element","index")),_s=function(n,e){return P.findIndex(n,y.curry(te.eq,e))},zs=function(r){return se.parent(r).bind(function(e){var t=se.children(e);return _s(t,r).map(function(n){return js(e,t,r,n)})})},Hs=function(n){return"br"===we.name(n)},Fs=function(n,e,t){return e(n,t).bind(function(n){return we.isText(n)&&0===Ct.get(n).trim().length?Fs(n,e,t):x.some(n)})},Us=function(e,n,t,r){return(o=n,i=t,se.child(o,i).filter(Hs).orThunk(function(){return se.child(o,i-1).filter(Hs)})).bind(function(n){return r.traverse(n).fold(function(){return Fs(n,r.gather,e).map(r.relative)},function(n){return zs(n).map(function(n){return Xc.on(n.parent(),n.index())})})});var o,i},Vs=function(n,e,t,r){var o,i,u;return(Hs(e)?(o=n,i=e,(u=r).traverse(i).orThunk(function(){return Fs(i,u.gather,o)}).map(u.relative)):Us(n,e,t,r)).map(function(n){return{start:y.constant(n),finish:y.constant(n)}})},Gs=function(n){return Ls.cata(n,function(n){return x.none()},function(){return x.none()},function(n){return x.some(qs.point(n,0))},function(n){return x.some(qs.point(n,Tt(n)))})},Xs=Zn.detect(),Ys=function(r,o,i,u,a,c){return 0===c?x.none():Js(r,o,i,u,a).bind(function(n){var e=r.fromSitus(n),t=Ls.verify(r,i,u,e.finish(),e.foffset(),a.failure,o);return Ls.cata(t,function(){return x.none()},function(){return x.some(n)},function(n){return te.eq(i,n)&&0===u?Ks(r,i,u,us.moveUp,a):Ys(r,o,n,0,a,c-1)},function(n){return te.eq(i,n)&&u===Tt(n)?Ks(r,i,u,us.moveDown,a):Ys(r,o,n,Tt(n),a,c-1)})})},Ks=function(e,n,t,r,o){return ls(e,n,t).bind(function(n){return $s(e,o,r(n,Is.getJumpSize()))})},$s=function(n,e,t){return Xs.browser.isChrome()||Xs.browser.isSafari()||Xs.browser.isFirefox()||Xs.browser.isEdge()?e.otherRetry(n,t):Xs.browser.isIE()?e.ieRetry(n,t):x.none()},Js=function(e,n,t,r,o){return ls(e,t,r).bind(function(n){return $s(e,o,n)})},Qs=function(e,t,r){return(o=e,i=t,u=r,o.getSelection().bind(function(r){return Vs(i,r.finish(),r.foffset(),u).fold(function(){return x.some(qs.point(r.finish(),r.foffset()))},function(n){var e=o.fromSitus(n),t=Ls.verify(o,r.finish(),r.foffset(),e.finish(),e.foffset(),u.failure,i);return Gs(t)})})).bind(function(n){return Ys(e,t,n.element(),n.offset(),r,20).map(e.fromSitus)});var o,i,u},Zs=function(n,e,t){return _e.ancestor(n,e,t).isSome()},nf=Zn.detect(),ef=function(r,o,i,n,u){return He.closest(n,"td,th",o).bind(function(t){return He.closest(t,"table",o).bind(function(n){return e=n,Zs(u,function(n){return se.parent(n).exists(function(n){return te.eq(n,e)})})?Qs(r,o,i).bind(function(e){return He.closest(e.finish(),"td,th",o).map(function(n){return{start:y.constant(t),finish:y.constant(n),range:y.constant(e)}})}):x.none();var e})})},tf=function(n,e,t,r,o,i){return nf.browser.isIE()?x.none():i(r,e).orThunk(function(){return ef(n,e,t,r,o).map(function(n){var e=n.range();return Gl.response(x.some(Ql(e.start(),e.soffset(),e.finish(),e.foffset())),!0)})})},rf=function(n,e,t,r,o,i,u){return ef(n,t,r,o,i).bind(function(n){return os.detect(e,t,n.start(),n.finish(),u)})},of=function(n,r){return He.closest(n,"tr",r).bind(function(t){return He.closest(t,"table",r).bind(function(n){var e=Ne.descendants(n,"tr");return te.eq(t,e[0])?ks.seekLeft(n,function(n){return At.last(n).isSome()},r).map(function(n){var e=Tt(n);return Gl.response(x.some(Ql(n,e,n,e)),!0)}):x.none()})})},uf=function(n,r){return He.closest(n,"tr",r).bind(function(t){return He.closest(t,"table",r).bind(function(n){var e=Ne.descendants(n,"tr");return te.eq(t,e[e.length-1])?ks.seekRight(n,function(n){return At.first(n).isSome()},r).map(function(n){return Gl.response(x.some(Ql(n,0,n,0)),!0)}):x.none()})})},af=function(n,e){return He.closest(n,"td,th",e)},cf={down:{traverse:se.nextSibling,gather:ks.after,relative:Xc.before,otherRetry:Is.tryDown,ieRetry:Is.ieTryDown,failure:Ls.adt.failedDown},up:{traverse:se.prevSibling,gather:ks.before,relative:Xc.before,otherRetry:Is.tryUp,ieRetry:Is.ieTryUp,failure:Ls.adt.failedUp}},lf=V.immutable("rows","cols"),sf={mouse:function(n,e,t,r){var o,i,u,a,c,l,s=ts(n),f=(o=s,i=e,u=t,a=r,c=x.none(),l=function(){c=x.none()},{mousedown:function(n){a.clear(i),c=af(n.target(),u)},mouseover:function(n){c.each(function(r){a.clear(i),af(n.target(),u).each(function(t){xr(r,t,u).each(function(n){var e=n.boxes().getOr([]);(1<e.length||1===e.length&&!te.eq(r,t))&&(a.selectRange(i,e,n.start(),n.finish()),o.selectContents(t))})})})},mouseup:function(){c.each(l)}});return{mousedown:f.mousedown,mouseover:f.mouseover,mouseup:f.mouseup}},keyboard:function(n,c,l,s){var f=ts(n),d=function(){return s.clear(c),x.none()};return{keydown:function(n,e,t,r,o,i){var u=n.raw().which,a=!0===n.raw().shiftKey;return Cr(c,s.selectedSelector()).fold(function(){return $l.isDown(u)&&a?y.curry(rf,f,c,l,cf.down,r,e,s.selectRange):$l.isUp(u)&&a?y.curry(rf,f,c,l,cf.up,r,e,s.selectRange):$l.isDown(u)?y.curry(tf,f,l,cf.down,r,e,uf):$l.isUp(u)?y.curry(tf,f,l,cf.up,r,e,of):x.none},function(e){var n=function(n){return function(){return ti(n,function(n){return os.update(n.rows(),n.cols(),c,e,s)}).fold(function(){return Sr(c,s.firstSelectedSelector(),s.lastSelectedSelector()).map(function(n){var e=$l.isDown(u)||i.isForward(u)?Xc.after:Xc.before;return f.setRelativeSelection(Xc.on(n.first(),0),e(n.table())),s.clear(c),Gl.response(x.none(),!0)})},function(n){return x.some(Gl.response(x.none(),!0))})}};return $l.isDown(u)&&a?n([lf(1,0)]):$l.isUp(u)&&a?n([lf(-1,0)]):i.isBackward(u)&&a?n([lf(0,-1),lf(-1,0)]):i.isForward(u)&&a?n([lf(0,1),lf(1,0)]):$l.isNavigation(u)&&!1===a?d:x.none})()},keyup:function(e,t,r,o,i){return Cr(c,s.selectedSelector()).fold(function(){var n=e.raw().which;return 0==(!0===e.raw().shiftKey)?x.none():$l.isNavigation(n)?os.sync(c,l,t,r,o,i,s.selectRange):x.none()},x.none)}}}},ff=function(e,n){P.each(n,function(n){Mi.remove(e,n)})},df=function(e){return function(n){Mi.add(n,e)}},mf=function(e){return function(n){ff(n,e)}},gf={byClass:function(o){var i=df(o.selected()),t=mf([o.selected(),o.lastSelected(),o.firstSelected()]),u=function(n){var e=Ne.descendants(n,o.selectedSelector());P.each(e,t)};return{clear:u,selectRange:function(n,e,t,r){u(n),P.each(e,i),Mi.add(t,o.firstSelected()),Mi.add(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var t=function(n){Se.remove(n,o.selected()),Se.remove(n,o.firstSelected()),Se.remove(n,o.lastSelected())},i=function(n){Se.set(n,o.selected(),"1")},u=function(n){var e=Ne.descendants(n,o.selectedSelector());P.each(e,t)};return{clear:u,selectRange:function(n,e,t,r){u(n),P.each(e,i),Se.set(t,o.firstSelected(),"1"),Se.set(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},hf=function(n){return!1===Mi.has(nn.fromDom(n.target),"ephox-snooker-resizer-bar")};function pf(h,p){var v=V.immutableBag(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=x.none(),w=gf.byAttr(Nr);return h.on("init",function(n){var r=h.getWin(),o=fa(h),e=ga(h),t=sf.mouse(r,o,e,w),a=sf.keyboard(r,o,e,w),c=function(n,e){!0===n.raw().shiftKey&&(e.kill()&&n.kill(),e.selection().each(function(n){var e=$c.relative(n.start(),n.finish()),t=ul.asLtrRange(r,e);h.selection.setRng(t)}))},i=function(n){var e=s(n);if(e.raw().shiftKey&&$l.isNavigation(e.raw().which)){var t=h.selection.getRng(),r=nn.fromDom(t.startContainer),o=nn.fromDom(t.endContainer);a.keyup(e,r,t.startOffset,o,t.endOffset).each(function(n){c(e,n)})}},u=function(n){var e=s(n);p().each(function(n){n.hideBars()});var t=h.selection.getRng(),r=nn.fromDom(h.selection.getStart()),o=nn.fromDom(t.startContainer),i=nn.fromDom(t.endContainer),u=xa.directionAt(r).isRtl()?$l.rtl:$l.ltr;a.keydown(e,o,t.startOffset,i,t.endOffset,u).each(function(n){c(e,n)}),p().each(function(n){n.showBars()})},l=function(n){return n.hasOwnProperty("x")&&n.hasOwnProperty("y")},s=function(n){var e=nn.fromDom(n.target),t=function(){n.stopPropagation()},r=function(){n.preventDefault()},o=y.compose(r,t);return{target:y.constant(e),x:y.constant(l(n)?n.x:null),y:y.constant(l(n)?n.y:null),stop:t,prevent:r,kill:o,raw:y.constant(n)}},f=function(n){return 0===n.button},d=function(n){f(n)&&hf(n)&&t.mousedown(s(n))},m=function(n){var e;(e=n).buttons!==undefined&&0==(1&e.buttons)||!hf(n)||t.mouseover(s(n))},g=function(n){f(n)&&hf(n)&&t.mouseup(s(n))};h.on("mousedown",d),h.on("mouseover",m),h.on("mouseup",g),h.on("keyup",i),h.on("keydown",u),h.on("nodechange",function(){var n=h.selection,e=nn.fromDom(n.getStart()),t=nn.fromDom(n.getEnd());rr.sharedOne(Ye.table,[e,t]).fold(function(){w.clear(o)},y.noop)}),b=x.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(n){})}}}var vf=ja.each,bf=function(e){var t=[];function n(n){return function(){e.execCommand(n)}}vf("inserttable tableprops deletetable | cell row column".split(" "),function(n){"|"===n?t.push({text:"-"}):t.push(e.menuItems[n])}),e.addButton("table",{type:"menubutton",title:"Table",menu:t}),e.addButton("tableprops",{title:"Table properties",onclick:n("mceTableProps"),icon:"table"}),e.addButton("tabledelete",{title:"Delete table",onclick:n("mceTableDelete")}),e.addButton("tablecellprops",{title:"Cell properties",onclick:n("mceTableCellProps")}),e.addButton("tablemergecells",{title:"Merge cells",onclick:n("mceTableMergeCells")}),e.addButton("tablesplitcells",{title:"Split cell",onclick:n("mceTableSplitCells")}),e.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:n("mceTableInsertRowBefore")}),e.addButton("tableinsertrowafter",{title:"Insert row after",onclick:n("mceTableInsertRowAfter")}),e.addButton("tabledeleterow",{title:"Delete row",onclick:n("mceTableDeleteRow")}),e.addButton("tablerowprops",{title:"Row properties",onclick:n("mceTableRowProps")}),e.addButton("tablecutrow",{title:"Cut row",onclick:n("mceTableCutRow")}),e.addButton("tablecopyrow",{title:"Copy row",onclick:n("mceTableCopyRow")}),e.addButton("tablepasterowbefore",{title:"Paste row before",onclick:n("mceTablePasteRowBefore")}),e.addButton("tablepasterowafter",{title:"Paste row after",onclick:n("mceTablePasteRowAfter")}),e.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:n("mceTableInsertColBefore")}),e.addButton("tableinsertcolafter",{title:"Insert column after",onclick:n("mceTableInsertColAfter")}),e.addButton("tabledeletecol",{title:"Delete column",onclick:n("mceTableDeleteCol")})},wf=function(e){var n,t=""===(n=e.getParam("table_toolbar",Ca))||!1===n?[]:p.isString(n)?n.split(/[ ,]/):p.isArray(n)?n:[];0<t.length&&e.addContextToolbar(function(n){return e.dom.is(n,"table")&&e.getBody().contains(n)},t.join(" "))},yf=function(o,t){var r=x.none(),i=[],u=[],a=[],c=[],l=function(n){n.disabled(!0)},s=function(n){n.disabled(!1)},n=function(){var e=this;i.push(e),r.fold(function(){l(e)},function(n){s(e)})},e=function(){var e=this;u.push(e),r.fold(function(){l(e)},function(n){s(e)})};o.on("init",function(){o.on("nodechange",function(n){var e=x.from(o.dom.getParent(o.selection.getStart(),"th,td"));(r=e.bind(function(n){var e=nn.fromDom(n);return Ye.table(e).map(function(n){return _r.forMenu(t,n,e)})})).fold(function(){P.each(i,l),P.each(u,l),P.each(a,l),P.each(c,l)},function(e){P.each(i,s),P.each(u,s),P.each(a,function(n){n.disabled(e.mergable().isNone())}),P.each(c,function(n){n.disabled(e.unmergable().isNone())})})})});var f=function(n,e,t,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],s=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=e+1+" x "+(t+1),s&&(e=9-e),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(s?e<=o:o<=e)&&i<=t,n.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===o.getParam("table_grid",!0,"boolean")?{text:"Table",icon:"table",context:"table",onclick:m("mceInsertTable")}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(n){n.aria&&(this.parent().hideAll(),n.stopImmediatePropagation(),o.execCommand("mceInsertTable"))},onshow:function(){f(o,0,0,this.menu.items()[0])},onhide:function(){var n=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(n,"mce-active"),o.dom.addClass(n[0],"mce-active")},menu:[{type:"container",html:function(){var n="";n='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var e=0;e<10;e++){n+="<tr>";for(var t=0;t<10;t++)n+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*e+t)+'" href="#" data-mce-x="'+t+'" data-mce-y="'+e+'"></a></td>';n+="</tr>"}return n+="</table>",n+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(n){var e,t,r=n.target;"A"===r.tagName.toUpperCase()&&(e=parseInt(r.getAttribute("data-mce-x"),10),t=parseInt(r.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(e=9-e),e===this.lastX&&t===this.lastY||(f(o,e,t,n.control),this.lastX=e,this.lastY=t))},onclick:function(n){var e=this;"A"===n.target.tagName.toUpperCase()&&(n.preventDefault(),n.stopPropagation(),e.parent().cancel(),o.undoManager.transact(function(){uc(o,e.lastX+1,e.lastY+1)}),o.addVisual())}}]};function m(n){return function(){o.execCommand(n)}}var g={text:"Table properties",context:"table",onPostRender:n,onclick:m("mceTableProps")},h={text:"Delete table",context:"table",onPostRender:n,cmd:"mceTableDelete"},p={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:e},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:e},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:e},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:e},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:e},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:e},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:e},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:e}]},v={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:e},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:e},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:e}]},b={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:e},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:function(){var e=this;a.push(e),r.fold(function(){l(e)},function(n){e.disabled(n.mergable().isNone())})}},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:function(){var e=this;c.push(e),r.fold(function(){l(e)},function(n){e.disabled(n.unmergable().isNone())})}}]};o.addMenuItem("inserttable",d),o.addMenuItem("tableprops",g),o.addMenuItem("deletetable",h),o.addMenuItem("row",p),o.addMenuItem("column",v),o.addMenuItem("cell",b)},xf=function(t,o){return{insertTable:function(n,e){return uc(t,n,e)},setClipboardRows:function(n){return e=n,t=o,r=P.map(e,nn.fromDom),void t.set(x.from(r));var e,t,r},getClipboardRows:function(){return o.get().fold(function(){},function(n){return P.map(n,function(n){return n.dom()})})}}};u.add("table",function(e){var t,r=Lc(e),n=pf(e,r.lazyResize),o=La(e,r.lazyWire),i=(t=e,{get:function(){var n=fa(t);return Tr(n,Nr.selectedSelector()).fold(function(){return t.selection.getStart()===undefined?Br.none():Br.single(t.selection)},function(n){return Br.multiple(n)})}}),u=No(x.none());return fc(e,o,n,i,u),zr(e,i,o,n),yf(e,i),bf(e),wf(e),e.on("PreInit",function(){e.serializer.addTempAttr(Nr.firstSelected()),e.serializer.addTempAttr(Nr.lastSelected())}),e.getParam("table_tab_navigation",!0,"boolean")&&e.on("keydown",function(n){Vl(n,e,o,r.lazyWire)}),e.on("remove",function(){r.destroy(),n.destroy()}),xf(e,u)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t,o){var r;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===o?"color":"background-color"])&&(r=e)}),r},g=function(t){var e,o=[];for(e=0;e<t.length;e+=2)o.push({text:t[e+1],color:"#"+t[e]});return o},r=function(t,e,o){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},e=function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})},o=function(o){o.addCommand("mceApplyTextcolor",function(t,e){r(o,t,e)}),o.addCommand("mceRemoveTextcolor",function(t){e(o,t)})},F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],l=function(t){return t.getParam("textcolor_map",a)},c=function(t){return t.getParam("textcolor_rows",5)},u=function(t){return t.getParam("textcolor_cols",8)},m=function(t){return t.getParam("color_picker_callback",null)},s=function(t){return t.getParam("forecolor_map",l(t))},d=function(t){return t.getParam("backcolor_map",l(t))},f=function(t){return t.getParam("forecolor_rows",c(t))},b=function(t){return t.getParam("backcolor_rows",c(t))},p=function(t){return t.getParam("forecolor_cols",u(t))},C=function(t){return t.getParam("backcolor_cols",u(t))},y=m,v=function(t){return"function"==typeof m(t)},h=tinymce.util.Tools.resolve("tinymce.util.I18n"),P=function(t,e,o,r){var n,a,l,c,i,u,m,s=0,d=F.DOM.uniqueId("mcearia"),f=function(t,e){var o="transparent"===t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+d+"-"+s+++'" data-mce-color="'+(t||"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+h.translate(e)+'">'+(o?"×":"")+"</div></td>"};for((n=g(o)).push({text:h.translate("No color"),color:"transparent"}),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=n.length-1,u=0;u<e;u++){for(l+="<tr>",i=0;i<t;i++)l+=c<(m=u*t+i)?"<td></td>":f((a=n[m]).color,a.text);l+="</tr>"}if(r){for(l+='<tr><td colspan="'+t+'" class="mce-custom-color-btn"><div id="'+d+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+d+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+h.translate("Custom...")+"</button></div></td></tr>",l+="<tr>",i=0;i<t;i++)l+=f("","Custom color");l+="</tr>"}return l+="</tbody></table>"},k=function(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(o){return function(t){var e=t.control;e._color?o.execCommand("mceApplyTextcolor",e.settings.format,e._color):o.execCommand("mceRemoveTextcolor",e.settings.format)}},T=function(r,c){return function(t){var e,a=this.parent(),o=n(r,a.settings.format),l=function(t){r.execCommand("mceApplyTextcolor",a.settings.format,t),a.hidePanel(),a.color(t)};F.DOM.getParent(t.target,".mce-custom-color-btn")&&(a.hidePanel(),y(r).call(r,function(t){var e,o,r,n=a.panel.getEl().getElementsByTagName("table")[0];for(e=i.map(n.rows[n.rows.length-1].childNodes,function(t){return t.firstChild}),r=0;r<e.length&&(o=e[r]).getAttribute("data-mce-color");r++);if(r===c)for(r=0;r<c-1;r++)k(e[r],e[r+1].getAttribute("data-mce-color"));k(o,t),l(t)},o)),(e=t.target.getAttribute("data-mce-color"))?(this.lastId&&F.DOM.get(this.lastId).setAttribute("aria-selected","false"),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,"transparent"===e?(r.execCommand("mceRemoveTextcolor",a.settings.format),a.hidePanel(),a.resetColor()):l(e)):null!==e&&a.hidePanel()}},_=function(n,a){return function(){var t=a?p(n):C(n),e=a?f(n):b(n),o=a?s(n):d(n),r=v(n);return P(t,e,o,r)}},A=function(t){t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!0),onclick:T(t,p(t))},onclick:x(t)}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!1),onclick:T(t,C(t))},onclick:x(t)})};t.add("textcolor",function(t){o(t),A(t)})}();!function(){"use strict";var n,e,t,r,o=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return o(t())}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){return{isEnabled:function(){return n.get()}}},c=function(n,e){return n.fire("VisualChars",{state:e})},a={"\xa0":"nbsp","\xad":"shy"},f=function(n,e){var t,r="";for(t in n)r+=t;return new RegExp("["+r+"]",e?"g":"")},l=function(n){var e,t="";for(e in n)t&&(t+=","),t+="span.mce-"+n[e];return t},s={charMap:a,regExp:f(a),regExpGlobal:f(a,!0),selector:l(a),charMapToRegExp:f,charMapToSelector:l},d=function(n){return function(){return n}},m=d(!1),p=d(!0),v={noop:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e]},noarg:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t()}},compose:function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,arguments))}},constant:d,identity:function(n){return n},tripleEquals:function(n,e){return n===e},curry:function(u){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var i=new Array(arguments.length-1),t=1;t<arguments.length;t++)i[t-1]=arguments[t];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=new Array(arguments.length),r=0;r<t.length;r++)t[r]=arguments[r];var o=i.concat(t);return u.apply(null,o)}},not:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,arguments)}},die:function(n){return function(){throw new Error(n)}},apply:function(n){return n()},call:function(n){n()},never:m,always:p},h=v.never,g=v.always,y=function(){return b},b=(r={fold:function(n,e){return n()},is:h,isSome:h,isNone:g,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},or:t,orThunk:e,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:h,forall:g,filter:y,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:v.constant("none()")},Object.freeze&&Object.freeze(r),r),T=function(t){var n=function(){return 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:g,isNone:h,getOr:n,getOrThunk:n,getOrDie:n,or:e,orThunk:e,map:function(n){return T(n(t))},ap:function(n){return n.fold(y,function(n){return T(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:b},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(h,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w={some:T,none:y,from:function(n){return null===n||n===undefined?b:T(n)}},x=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===e}},E={isString:x("string"),isObject:x("object"),isArray:x("array"),isNull:x("null"),isBoolean:x("boolean"),isUndefined:x("undefined"),isFunction:x("function"),isNumber:x("number")},N=(Array.prototype.indexOf,undefined,function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var u=n[o];r[o]=e(u,o,n)}return r}),k=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t,n)},A=(Array.prototype.push,Array.prototype.slice,E.isFunction(Array.from)&&Array.from,N),O=k,C=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:v.constant(n)}},M={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),"HTML must have a single root node";return C(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return C(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return C(t)},fromDom:C,fromPoint:function(n,e,t){return w.from(n.dom().elementFromPoint(e,t)).map(C)}},S=8,D=9,P=3,B=function(n){return n.dom().nodeName.toLowerCase()},j=function(n){return n.dom().nodeType},V=function(e){return function(n){return j(n)===e}},q=V(1),H=V(P),L=V(D),R={name:B,type:j,value:function(n){return n.dom().nodeValue},isElement:q,isText:H,isDocument:L,isComment:function(n){return j(n)===S||"#comment"===B(n)}},_=function(n){return'<span data-mce-bogus="1" class="mce-'+s.charMap[n]+'">'+n+"</span>"},F=function(n,e){var t=[],r=n.dom(),o=A(r.childNodes,M.fromDom);return O(o,function(n){e(n)&&(t=t.concat([n])),t=t.concat(F(n,e))}),t},z={isMatch:function(n){return R.isText(n)&&R.value(n)!==undefined&&s.regExp.test(R.value(n))},filterDescendants:F,findParentElm:function(n,e){for(;n.parentNode;){if(n.parentNode===e)return n;n=n.parentNode}},replaceWithSpans:function(n){return n.replace(s.regExpGlobal,_)}},G=function(t,n){var r,o,e=z.filterDescendants(M.fromDom(n),z.isMatch);O(e,function(n){var e=z.replaceWithSpans(R.value(n));for(o=t.dom.create("div",null,e);r=o.lastChild;)t.dom.insertAfter(r,n.dom());t.dom.remove(n.dom())})},W=function(e,n){var t=e.dom.select(s.selector,n);O(t,function(n){e.dom.remove(n,1)})},I=G,U=W,J=function(n){var e=n.getBody(),t=n.selection.getBookmark(),r=z.findParentElm(n.selection.getNode(),e);r=r!==undefined?r:e,W(n,r),G(n,r),n.selection.moveToBookmark(t)},K=function(n,e){var t,r=n.getBody(),o=n.selection;e.set(!e.get()),c(n,e.get()),t=o.getBookmark(),!0===e.get()?I(n,r):U(n,r),o.moveToBookmark(t)},Q=function(n,e){n.addCommand("mceVisualChars",function(){K(n,e)})},X=tinymce.util.Tools.resolve("tinymce.util.Delay"),Y=function(e,t){var r=X.debounce(function(){J(e)},300);!1!==e.settings.forced_root_block&&e.on("keydown",function(n){!0===t.get()&&(13===n.keyCode?J(e):r())})},Z=function(t){return function(n){var e=n.control;t.on("VisualChars",function(n){e.active(n.state)})}};u.add("visualchars",function(n){var e,t=o(!1);return Q(n,t),(e=n).addButton("visualchars",{active:!1,title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:Z(e)}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:Z(e),selectable:!0,context:"view",prependToContext:!0}),Y(n,t),i(t)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n="[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",t="[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",r="[\xb1+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",E="[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",T="\\r",u="\\n",i="[\x0B\f\x85\u2028\u2029]",o="[\u0300-\u036f\u0483-\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\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",c="[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",a="[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",R="[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]",f="[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]",A={characterIndices:{ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},SETS:[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp(n),new RegExp(t),new RegExp(r),new RegExp(E),new RegExp(T),new RegExp(u),new RegExp(i),new RegExp(o),new RegExp(c),new RegExp(a),new RegExp(R),new RegExp("@")],EMPTY_STRING:"",PUNCTUATION:new RegExp("^"+f+"$"),WHITESPACE:/^\s+$/},N=function(e,n,t){var r,E;if(!e)return 0;if(t=t||e,e.length!==undefined){for(r=0,E=e.length;r<E;r++)if(!1===n.call(t,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===n.call(t,e[r],r,e))return 0;return 1},s=function(t,r){var E=[];return N(t,function(e,n){E.push(r(e,n,t))}),E},l=A.SETS,M=A.characterIndices.OTHER,d=function(e){var n,t,r=M,E=l.length;for(n=0;n<E;++n)if((t=l[n])&&t.test(e)){r=n;break}return r},I=function(e){var t,r,n=(t=d,r={},function(e){if(r[e])return r[e];var n=t(e);return r[e]=n});return s(e.split(""),n)},L=A.characterIndices,g=function(e,n){var t,r,E=e[n],T=e[n+1];return!(n<0||n>e.length-1&&0!==n||E===L.ALETTER&&T===L.ALETTER||(r=e[n+2],E===L.ALETTER&&(T===L.MIDLETTER||T===L.MIDNUMLET||T===L.AT)&&r===L.ALETTER||(t=e[n-1],(E===L.MIDLETTER||E===L.MIDNUMLET||T===L.AT)&&T===L.ALETTER&&t===L.ALETTER||!(E!==L.NUMERIC&&E!==L.ALETTER||T!==L.NUMERIC&&T!==L.ALETTER)||(E===L.MIDNUM||E===L.MIDNUMLET)&&T===L.NUMERIC&&t===L.NUMERIC||E===L.NUMERIC&&(T===L.MIDNUM||T===L.MIDNUMLET)&&r===L.NUMERIC||E===L.EXTEND||E===L.FORMAT||t===L.EXTEND||t===L.FORMAT||T===L.EXTEND||T===L.FORMAT||E===L.CR&&T===L.LF||E!==L.NEWLINE&&E!==L.CR&&E!==L.LF&&T!==L.NEWLINE&&T!==L.CR&&T!==L.LF&&(E===L.KATAKANA&&T===L.KATAKANA||T===L.EXTENDNUMLET&&(E===L.ALETTER||E===L.NUMERIC||E===L.KATAKANA||E===L.EXTENDNUMLET)||E===L.EXTENDNUMLET&&(T===L.ALETTER||T===L.NUMERIC||T===L.KATAKANA)||E===L.AT))))},p=A.EMPTY_STRING,U=A.WHITESPACE,w=A.PUNCTUATION,h=function(e,n,t){var r=function(e,n){var t;for(t=n;t<e.length;++t){var r=e.charAt(t);if(U.test(r))break}return t}(n,t+1),E=n.substring(t+1,r);return"://"===E.substr(0,3)?{word:e+E,index:r}:{word:e,index:t}},v=function(e,n){return function(e,n){var t,r,E,T,u=0,i=I(e),o=i.length,c=[],a=[];for(n||(n={}),n.ignoreCase&&(e=e.toLowerCase()),r=n.includePunctuation,E=n.includeWhitespace;u<o;++u)if(t=e.charAt(u),c.push(t),g(i,u)){if((c=c.join(p))&&(E||!U.test(c))&&(r||!w.test(c)))if("http"===(T=c)||"https"===T){var R=h(c,e,u);a.push(R.word),u=R.index}else a.push(c);c=[]}return a}(e.replace(/\ufeff/g,""),n)},x=function(e){return v((n=e,n.removed?"":n.getBody().innerText)).length;var n},C=function(e){return{getCount:function(){return x(e)}}},D=tinymce.util.Tools.resolve("tinymce.util.Delay"),m=tinymce.util.Tools.resolve("tinymce.util.I18n"),y=function(t){var r=function(e){return m.translate(["{0} words",x(e)])},E=function(){t.theme.panel.find("#wordcount").text(r(t))};t.on("init",function(){var e=t.theme.panel&&t.theme.panel.find("#statusbar")[0],n=D.debounce(E,300);e&&D.setEditorTimeout(t,function(){e.insert({type:"label",name:"wordcount",text:r(t),classes:"wordcount",disabled:t.settings.readonly},0),t.on("setcontent beforeaddundo undo redo keyup",n)},0)})};e.add("wordcount",function(e){return y(e),C(e)})}();//= require jquery/dist/jquery.min.js
+//= require flatpickr/dist/flatpickr.min.js
+//= require tablednd/dist/jquery.tablednd.min.js
+//= require tinymce.js
+
+$(function(){
+ function initWidget(selector, init) {
+ var elements = document.querySelectorAll(selector);
+ for (var i = 0; i < elements.length; ++i) {
+ init(elements[i]);
+ }
}
-}
-
-function imagePreview() {
- var mouseX = 0, mouseY = 0;
-
- $('#changelist tr.image').on({
- mouseover: function() {
- var url = $(this).data('url');
- $('#prop img').attr('src', url);
- $('#prop').css('top', mouseY+5);
- $('#prop').css('left', mouseX+10);
- $('#prop').show();
- },
- mouseout: function() {
- $('#prop').hide();
+
+ $('.toggle-sidebar').on('change', function() {
+ $('body').toggleClass('pushed');
+ return false;
+ });
+
+ // reorder items
+ $('#items-grid.reorderable').tableDnD({
+ onDragClass: "ItemsDragClass",
+ onDrop: function(table, row) {
+ var ids = [];
+ $('#items-grid .trsort').each(function(){
+ ids.push(this.id);
+ });
+ $.post('reorder/', { 'ids[]': ids }, function(data){});
}
});
- $(document).mousemove(function(event) {
- mouseX = event.pageX;
- mouseY = event.pageY;
- $('#prop').css('top', mouseY+5);
- $('#prop').css('left', mouseX+10);
+ // reorder inlines
+ $('.orderable-set-table').each(function(){
+ var $table = $(this), $form = $table.closest("form"), reorder = $table.data("reorder");
+ $table.tableDnD({
+ onDragClass: "ItemsDragClass",
+ onDrop: function(table, row) {
+ var i;
+ $form.find("[name='"+reorder+"[]']").remove();
+ $table.find('tr[data-id]').each(function(){
+ i = $("<input/>").attr("type", "hidden").attr("name", reorder+"[]").attr("value", $(this).data('id'));
+ $form.append(i);
+ });
+ }
+ });
});
-}
-function FileBrowserSelect() {
- top.tinymce.activeEditor.windowManager.getParams().onSelect(encodeURI(selected_url));
- top.tinymce.activeEditor.windowManager.close();
-}
+ function initDatePicker(defaultFormat, element) {
+ flatpickr(element, {
+ defaultDate: element.val,
+ dateFormat: element.dataset.format || defaultFormat
+ });
+ }
+
+ function initCheckGroup(element) {
+ var group = $(element);
+ group.find('.object-tools .checkall').click(function(){
+ group.find('.checkgroup input').prop('checked', true);
+ return false;
+ });
+ group.find('.object-tools .uncheckall').click(function(){
+ group.find('.checkgroup input').prop('checked', false);
+ return false;
+ });
+ }
-// init
-imagePreview();
-$('#changelist .file').on('click', fileSelected);
+ initWidget('.dateinput', initDatePicker.bind(null, 'Y-m-d'));
+ initWidget('.datetimeinput', initDatePicker.bind(null, 'Y-m-d H-i-s'));
+ initWidget('.admincheckgroup', initCheckGroup);
+
+ // html
+ function ipf_filebrowser(filebrowser_url, field_name, url, type, win) {
+ tinyMCE.activeEditor.windowManager.open({
+ file: filebrowser_url,
+ title: "IPF File Browser",
+ width: 800,
+ height: 600,
+ resizable: "yes",
+ inline: "yes",
+ close_previous: "no"
+ }, {
+ onSelect: function(value) {
+ var input = win.document.getElementById(field_name);
+
+ input.value = value;
+ if ("createEvent" in document) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("change", false, true);
+ input.dispatchEvent(evt);
+ } else {
+ input.fireEvent("onchange");
+ }
+ }
+ });
+ return false;
+ }
+
+ var tinyMCEDefaults = {
+ plugins: "anchor, charmap, code, colorpicker, contextmenu, fullscreen, hr, image, insertdatetime, link, lists, media, nonbreaking, paste, preview, print, searchreplace, tabfocus, table, textcolor, visualchars, wordcount",
+ toolbar: [
+ "undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor sub sup | preview fullscreen",
+ "code link unlink image charmap | table | pastetext removeformat | formatselect fontselect fontsizeselect"
+ ],
+ extended_valid_elements: "span[class|style],code[class],iframe[src|width|height|name|align|frameborder|scrolling]",
+ fix_list_elements: true,
+ browser_spellcheck: true,
+ width: "80%",
+ height: "300",
+ document_base_url: "/",
+
+ convert_urls: false,
+ relative_urls: false,
+ remove_script_host: true
+ };
+
+ $('.htmlEditor').each(function(){
+ var filebrowser_url = $(this).data('filebrowser');
+ tinyMCE.init($.extend({}, tinyMCEDefaults, $(this).data('config'), {
+ target: this,
+ file_browser_callback: ipf_filebrowser.bind(null, filebrowser_url)
+ }));
+ });
+});