=")||"Opera"===s.browser&&s.verComp(s.version,12,">=")||"IE"===s.browser&&s.verComp(s.version,10,">=")||!!~o.inArray(s.browser,["Chrome","Safari"]))},upload_filesize:i,use_http_method:function(e){return!o.arrayDiff(e,["GET","POST"])}}),o.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(n),t=n=null})}),o.extend(this.getShim(),l)}),l}),e("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,d,f,p,m,a,h){return e.FileInput=function(){var s,l,u=[];function c(){var e,t,n,r=this,i=r.getRuntime(),o=f.guid("uid_"),a=i.getShimContainer();s&&(e=p.get(s+"_form"))&&f.extend(e.style,{top:"100%"}),(t=document.createElement("form")).setAttribute("id",o+"_form"),t.setAttribute("method","post"),t.setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"),f.extend(t.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),(n=document.createElement("input")).setAttribute("id",o),n.setAttribute("type","file"),n.setAttribute("name",l.name||"Filedata"),n.setAttribute("accept",u.join(",")),f.extend(n.style,{fontSize:"999px",opacity:0}),t.appendChild(n),a.appendChild(t),f.extend(n.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===h.browser&&h.verComp(h.version,10,"<")&&f.extend(n.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),n.onchange=function(){var e;if(this.value){if(this.files){if(0===(e=this.files[0]).size)return void t.parentNode.removeChild(t)}else e={name:this.value};e=new d(i.uid,e),this.onchange=function(){},c.call(r),r.files=[e],n.setAttribute("id",e.uid),t.setAttribute("id",e.uid+"_form"),r.trigger("change"),n=t=null}},i.can("summon_file_dialog")&&(e=p.get(l.browse_button),m.removeEvent(e,"click",r.uid),m.addEvent(e,"click",function(e){n&&!n.disabled&&n.click(),e.preventDefault()},r.uid)),s=o}f.extend(this,{init:function(e){var t,n,r,i=this,o=i.getRuntime();u=(l=e).accept.mimes||a.extList2mimes(e.accept,o.can("filter_by_extension")),t=o.getShimContainer(),r=p.get(e.browse_button),o.can("summon_file_dialog")&&("static"===p.getStyle(r,"position")&&(r.style.position="relative"),n=parseInt(p.getStyle(r,"z-index"),10)||1,r.style.zIndex=n,t.style.zIndex=n-1),n=o.can("summon_file_dialog")?r:t,m.addEvent(n,"mouseover",function(){i.trigger("mouseenter")},i.uid),m.addEvent(n,"mouseout",function(){i.trigger("mouseleave")},i.uid),m.addEvent(n,"mousedown",function(){i.trigger("mousedown")},i.uid),m.addEvent(p.get(e.container),"mouseup",function(){i.trigger("mouseup")},i.uid),c.call(this),t=null,i.trigger({type:"ready",async:!0})},disable:function(e){var t;(t=p.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();m.removeAllEvents(e,this.uid),m.removeAllEvents(l&&p.get(l.container),this.uid),m.removeAllEvents(l&&p.get(l.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),s=u=l=null}})}}),e("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),e("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,f,p,m,h,g,v,y){return e.XMLHttpRequest=function(){var l,u,c;function d(t){var e,n,r,i=this,o=!1;if(c){if(e=c.id.replace(/_iframe$/,""),e=p.get(e+"_form")){for(r=(n=e.getElementsByTagName("input")).length;r--;)switch(n[r].getAttribute("type")){case"hidden":n[r].parentNode.removeChild(n[r]);break;case"file":o=!0}n=[],o||e.parentNode.removeChild(e),e=null}setTimeout(function(){g.removeEvent(c,"load",i.uid),c.parentNode&&c.parentNode.removeChild(c);var e=i.getRuntime().getShimContainer();e.children.length||e.parentNode.removeChild(e),e=c=null,t()},1)}}f.extend(this,{send:function(t,e){var n,r,i,o,a=this,s=a.getRuntime();if(l=u=null,e instanceof y&&e.hasBlob()){if(o=e.getBlob(),n=o.uid,i=p.get(n),!(r=p.get(n+"_form")))throw new h.DOMException(h.DOMException.NOT_FOUND_ERR)}else n=f.guid("uid_"),(r=document.createElement("form")).setAttribute("id",n+"_form"),r.setAttribute("method",t.method),r.setAttribute("enctype","multipart/form-data"),r.setAttribute("encoding","multipart/form-data"),s.getShimContainer().appendChild(r);r.setAttribute("target",n+"_iframe"),e instanceof y&&e.each(function(e,t){var n;e instanceof v?i&&i.setAttribute("name",t):(n=document.createElement("input"),f.extend(n,{type:"hidden",name:t,value:e}),i?r.insertBefore(n,i):r.appendChild(n))}),r.setAttribute("action",t.url),e=s.getShimContainer()||document.body,(s=document.createElement("div")).innerHTML='',c=s.firstChild,e.appendChild(c),g.addEvent(c,"load",function(){var e;try{e=c.contentWindow.document||c.contentDocument||window.frames[c.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)?l=e.title.replace(/^(\d+).*$/,"$1"):(l=200,u=f.trim(e.body.innerHTML),a.trigger({type:"progress",loaded:u.length,total:u.length}),o&&a.trigger({type:"uploadprogress",loaded:o.size||1025,total:o.size||1025}))}catch(e){if(!m.hasSameOrigin(t.url))return void d.call(a,function(){a.trigger("error")});l=404}d.call(a,function(){a.trigger("load")})},a.uid),r.submit(),a.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e&&"string"===f.typeOf(u)&&window.JSON)try{return JSON.parse(u.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return u},abort:function(){var e=this;c&&c.contentWindow&&(c.contentWindow.stop?c.contentWindow.stop():c.contentWindow.document.execCommand?c.contentWindow.document.execCommand("Stop"):c.src="about:blank"),d.call(this,function(){e.dispatchEvent("abort")})}})}}),e("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t});for(var t=["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/FileInput","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"],n=0;n <% if (typeof getIcon !== "undefined" && getIcon) { %> <% } %> state-<%- review_state %> <% } %> " /span> <%- Title %> <%- path %> '),p=o.createClass({getInitialState:function(){return{selected:this.props.initial_selection,items:[]}},getDefaultProps:function(){return{initial_selection:[],allowAdd:!0,noItemsSelectedText:"No items selected",portal_url:i("body").attr("data-portal-url")}},getQueryHelper:function(){return new s.QueryHelper({vocabularyUrl:this.props.vocabularyUrl,batchSize:30,pattern:this.props.parent,sort_on:"getObjPositionInParent",sort_order:"ascending",baseCriteria:this.props.baseCriteria.slice(),attributes:["UID","Title","portal_type","path","review_state","is_folderish"]})},selectionUpdated:function(){this.props.updateValue(this.state.selected),this.load()},componentDidMount:function(){this.load(),this.setupSelect2()},setupSelect2:function(){var n=this,r=new s.QueryHelper({vocabularyUrl:this.props.vocabularyUrl,batchSize:15,attributes:["UID","Title","portal_type","path","review_state","is_folderish"]}),e=r.selectAjax();e.data=function(e,t){e={query:JSON.stringify({criteria:r.getCriterias(e)}),attributes:JSON.stringify(r.options.attributes)};return t&&(e.batch=JSON.stringify(r.getBatch(t))),e},e.quietMillis=300,i(n.refs.select2.getDOMNode()).select2({placeholder:"Type to search",minimumInputLength:3,ajax:e,multiple:!0,width:n.props.widget||400,formatResult:function(e){e.selected=-1!==n.state.selected.indexOf(e.UID),null===n.props.selectableTypes?e.selectable=!0:e.selectable=-1>10|55296,1023&r|56320)}var Be,d,_,He,je,Ue,ze,$e,We,qe,Ve,Ge,Xe,Ke,Je,Qe,Ze,et,tt={requestAnimationFrame:function(e,t){se?se.then(e):se=new Ce(function(e){t=t||document.body,Re(e,t)}).then(e)},setTimeout:Ae,setInterval:Pe,setEditorTimeout:function(e,t,n){return Ae(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r=Pe(function(){e.removed?clearInterval(r):t()},n);return r},debounce:Oe,throttle:Oe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},nt=/^(?:mouse|contextmenu)|click/,rt={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},it=function(e){return e.isDefaultPrevented===at||e.isDefaultPrevented===ot},ot=function(){return!1},at=function(){return!0},st=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},lt=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},ut=function(e,t){var n=e.path;return n&&0+~]|"+i+")"+i+"*"),Dt=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),St=new RegExp(ge),Et=new RegExp("^"+e+"$"),Lt={ID:new RegExp("^#("+e+")"),CLASS:new RegExp("^\\.("+e+")"),TAG:new RegExp("^("+e+"|[*])"),ATTR:new RegExp("^"+ve),PSEUDO:new RegExp("^"+ge),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},Nt=/^(?:input|select|textarea|button)$/i,Rt=/^h\d$/i,At=/^[^{]+\{\s*\[native \w/,Pt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Ot=/[+~]/,It=/'|\\/g,Yt=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig");try{wt.apply(n=xt.call(ct.childNodes),ct.childNodes),n[ct.childNodes.length].nodeType}catch(e){wt={apply:n.length?function(e,t){_t.apply(e,xt.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function G(e,t,n,r){var i,o,a,s,l,u,c;if((t?t.ownerDocument||t:ct)!==Xe&&Ge(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(i=(t=t||Xe).nodeType)&&9!==i)return[];if(Je&&!r){if(u=Pt.exec(e))if(c=u[1]){if(9===i){if(!(s=t.getElementById(c))||!s.parentNode)return n;if(s.id===c)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(c))&&et(t,s)&&s.id===c)return n.push(s),n}else{if(u[2])return wt.apply(n,t.getElementsByTagName(e)),n;if((c=u[3])&&d.getElementsByClassName)return wt.apply(n,t.getElementsByClassName(c)),n}if(d.qsa&&(!Qe||!Qe.test(e))){if(l=s=w,u=t,c=9===i&&e,1===i&&"object"!==t.nodeName.toLowerCase()){for(a=Ue(e),(s=t.getAttribute("id"))?l=s.replace(It,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",o=a.length;o--;)a[o]=l+$t(a[o]);u=Ot.test(e)&&Ut(t.parentNode)||t,c=a.join(",")}if(c)try{return wt.apply(n,u.querySelectorAll(c)),n}catch(e){}finally{s||t.removeAttribute("id")}}}return $e(e.replace(kt,"$1"),t,n,r)}function Ft(){var n=[];function r(e,t){return n.push(e+" ")>_.cacheLength&&delete r[n.shift()],r[e+" "]=t}return r}function Bt(e){return e[w]=!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 jt(a){return Bt(function(o){return o=+o,Bt(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function Ut(e){return e&&typeof e.getElementsByTagName!==vt&&e}for(Be in d=G.support={},je=G.isXML=function(e){e=e&&(e.ownerDocument||e).documentElement;return!!e&&"HTML"!==e.nodeName},Ge=G.setDocument=function(e){var l=e?e.ownerDocument||e:ct,e=l.defaultView;return l!==Xe&&9===l.nodeType&&l.documentElement?(Ke=(Xe=l).documentElement,Je=!je(l),e&&e!==function(e){try{return e.top}catch(e){}return null}(e)&&(e.addEventListener?e.addEventListener("unload",function(){Ge()},!1):e.attachEvent&&e.attachEvent("onunload",function(){Ge()})),d.attributes=!0,d.getElementsByTagName=!0,d.getElementsByClassName=At.test(l.getElementsByClassName),d.getById=!0,_.find.ID=function(e,t){if(typeof t.getElementById!==vt&&Je)return(t=t.getElementById(e))&&t.parentNode?[t]:[]},_.filter.ID=function(e){var t=e.replace(Yt,Fe);return function(e){return e.getAttribute("id")===t}},_.find.TAG=d.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==vt)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"!==e)return o;for(;n=o[i++];)1===n.nodeType&&r.push(n);return r},_.find.CLASS=d.getElementsByClassName&&function(e,t){if(Je)return t.getElementsByClassName(e)},Ze=[],Qe=[],d.disconnectedMatch=!0,Qe=Qe.length&&new RegExp(Qe.join("|")),Ze=Ze.length&&new RegExp(Ze.join("|")),e=At.test(Ke.compareDocumentPosition),et=e||At.test(Ke.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!(!t||1!==t.nodeType||!(n.contains?n.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},gt=e?function(e,t){var n;return e===t?(Ve=!0,0):(n=!e.compareDocumentPosition-!t.compareDocumentPosition)||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===l||e.ownerDocument===ct&&et(ct,e)?-1:t===l||t.ownerDocument===ct&&et(ct,t)?1:qe?Ct.call(qe,e)-Ct.call(qe,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Ve=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===l?-1:t===l?1:i?-1:o?1:qe?Ct.call(qe,e)-Ct.call(qe,t):0;if(i===o)return Ht(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?Ht(a[r],s[r]):a[r]===ct?-1:s[r]===ct?1:0},l):Xe},G.matches=function(e,t){return G(e,null,null,t)},G.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Xe&&Ge(e),t=t.replace(Dt,"='$1']"),d.matchesSelector&&Je&&(!Ze||!Ze.test(t))&&(!Qe||!Qe.test(t)))try{var n=(void 0).call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Yt,Fe),e[3]=(e[3]||e[4]||e[5]||"").replace(Yt,Fe),"~="===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]||G.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]&&G.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Lt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&St.test(n)&&(t=(t=Ue(n,!0))&&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(Yt,Fe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=pt[e+" "];return t||(t=new RegExp("(^|"+i+")"+e+"("+i+"|$)"))&&pt(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==vt&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(e){e=G.attr(e,t);return null==e?"!="===n:!n||(e+="","="===n?e===r:"!="===n?e!==r:"^="===n?r&&0===e.indexOf(r):"*="===n?r&&-1)[^>]*$|#([\w\-]*)$)/,Tn=Ye.Event,Mn=K.makeMap("children,contents,next,prev"),Dn=K.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Sn=K.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),En={for:"htmlFor",class:"className",readonly:"readOnly"},Ln={float:"cssFloat"},Nn={},Rn={},An=/^\s*|\s*$/g,ye=(X.fn=X.prototype={constructor:X,selector:"",context:null,length:0,init:function(e,t){var n,r,i=this;if(e)if(e.nodeType)i.context=i[0]=e,i.length=1;else{if(t&&t.nodeType)i.context=t;else{if(t)return X(e).attr(t);i.context=t=document}if(nn(e)){if(!(n="<"===(i.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:kn.exec(e)))return X(t).find(e);if(n[1])for(r=rn(e,dn(t)).firstChild;r;)xn.call(i,r),r=r.nextSibling;else{if(!(r=dn(t).getElementById(n[2])))return i;if(r.id!==n[2])return i.find(e);i.length=1,i[0]=r}}else this.add(e,!1)}return i},toArray:function(){return K.toArray(this)},add:function(e,t){var n,r;if(nn(e))return this.add(X(e));if(!1!==t)for(n=X.unique(this.toArray().concat(X.makeArray(e))),this.length=n.length,r=0;r=a.length&&r(i)}))})})},gi={par:ei,mapM:function(e,t){e=b.map(e,t);return ei(e)},compose:function(t,n){return function(e){return n(e).bind(t)}}},vi={value:ti,error:ni};function yi(f,e){function p(e){f.getElementsByTagName("head")[0].appendChild(e)}function r(t){return mi.nu(function(e){n(t,v.compose(e,v.constant(vi.value(t))),v.compose(e,v.constant(vi.error(t))))})}function i(e){return e.fold(v.identity,v.identity)}var m,h=0,g={},n=(m=(e=e||{}).maxLoadTime||5e3,function(e,t,n){function r(){for(var e=c.passed,t=e.length;t--;)e[t]();c.status=2,c.passed=[],c.failed=[]}function i(e,t){e()||((new Date).getTime()-u\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$i=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wi=/[<>&\"\']/g,qi=/([a-z0-9]+);?|&([a-z0-9]+);/gi,Vi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},Gi={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Xi={"<":"<",">":">","&":"&",""":'"',"'":"'"},Ki=Mi("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),Ji={encodeRaw:Di,encodeAllRaw:function(e){return(""+e).replace(Wi,function(e){return Gi[e]||e})},encodeNumeric:Si,encodeNamed:Ei,getEncodeFunc:function(e,t){var n=Mi(t)||Ki,e=Ui(e.replace(/\+/g,","));return e.named&&e.numeric?function(e,t){return e.replace(t?zi:$i,function(e){return void 0!==Gi[e]?Gi[e]:void 0!==n[e]?n[e]:1>10),56320+(1023&t))):Vi[t]||String.fromCharCode(t):Xi[e]||Ki[e]||(t=e,(e=H.fromTag("div").dom()).innerHTML=t,e.textContent)||e.innerText||t})}},Qi={},Zi={},eo=K.makeMap,to=K.each,no=K.extend,ro=K.explode,io=K.inArray,M=function(e,t){return(e=K.trim(e))?e.split(t||" "):[]},oo=function(e){function t(e,t,n){function r(e,t){for(var n={},r=0,i=e.length;r]*>","gi")}),function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")});i.valid_elements?n(i.valid_elements):(to(u,function(e,t){C[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},_[t]=e.children}),"html5"!==i.schema&&to(M("strong/b em/i"),function(e){e=M(e,"/"),C[e[1]].outputName=e[0]}),to(M("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){C[e]&&(C[e].removeEmpty=!0)}),to(M("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){C[e].paddEmpty=!0}),to(M("span"),function(e){C[e].removeEmptyAttrs=!0})),r(i.custom_elements),o(i.valid_children),t(i.extended_valid_elements),o("+ol[ul|ol],+ul[ul|ol]"),to({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){C[t]&&(C[t].parentsRequired=M(e))}),i.invalid_elements&&to(ro(i.invalid_elements),function(e){C[e]&&delete C[e]}),a("span")||t("span[!data-mce-type|*]");return{children:_,elements:C,getValidStyles:function(){return s},getValidClasses:function(){return m},getBlockElements:function(){return h},getInvalidStyles:function(){return l},getShortEndedElements:function(){return f},getTextBlockElements:function(){return y},getTextInlineElements:function(){return b},getBoolAttrs:function(){return p},getElementRule:a,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return g},getMoveCaretBeforeOnEnterElements:function(){return v},getWhiteSpaceElements:function(){return c},getSpecialElements:function(){return x},isValidChild:function(e,t){e=_[e.toLowerCase()];return!(!e||!e[t.toLowerCase()])},isValid:function(e,t){var n,r,i=a(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return w},addValidElements:t,setValidElements:n,addCustomElements:r,addValidChildren:o}}var lo=function(e,t,n,r){function i(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e}return"#"+i(t)+i(n)+i(r)};function uo(y,e){var b,t,u,c,_=/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,x=/\s*([^:]+):\s*([^;]+);?/g,C=/\s+$/,k={},T="\ufeff";for(y=y||{},e&&(u=e.getValidStyles(),c=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+T).split(" "),b=0;b"+n,t.removeChild(t.firstChild)}catch(e){X("
").html(" "+n).contents().slice(1).appendTo(t)}return n}}):e.html(n)},B=function(e,n,r,i,o){return L(e,function(e){var t="string"==typeof n?a.createElement(n):n;return N(t,r),i&&("string"!=typeof i&&i.nodeType?t.appendChild(i):"string"==typeof i&&F(t,i)),o?t:e.appendChild(t)})},R=function(e,t,n){return B(a.createElement(e),e,t,n,!0)},H=Ji.decode,j=Ji.encodeAllRaw,A=function(e,t){e=b(e);return(t?e.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}):e).remove(),1"+n+""+e+">":i+" />"},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:A,setStyle:function(e,t,n){e=b(e).css(t,n);o.update_styles&&co(h,e)},getStyle:T,setStyles:function(e,t){e=b(e).css(t);o.update_styles&&co(h,e)},removeAllAttribs:function(e){return L(e,function(e){for(var t=e.attributes,n=t.length-1;0<=n;n--)e.removeAttributeNode(t.item(n))})},setAttrib:x,setAttribs:N,getAttrib:_,getPos:k,parseStyle:function(e){return h.parse(e)},serializeStyle:function(e,t){return h.serialize(e,t)},addStyle:function(e){var t,n;if(O!==yo.DOM&&a===document){if(u[e])return;u[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 t;O!==yo.DOM&&a===document?yo.DOM.loadCSS(e):(e=e||"",t=a.getElementsByTagName("head")[0],po(e.split(","),function(e){e=K._addCacheSuffix(e),d[e]||(d[e]=!0,e=R("link",{rel:"stylesheet",href:e}),t.appendChild(e))}))},addClass:function(e,t){b(e).addClass(t)},removeClass:function(e,t){U(e,t,!1)},hasClass:function(e,t){return b(e).hasClass(t)},toggleClass:U,show:function(e){b(e).show()},hide:function(e){b(e).hide()},isHidden:function(e){return"none"===b(e).css("display")},uniqueId:function(e){return(e||"mce_")+Y++},setHTML:F,getOuterHTML:function(e){e="string"==typeof e?y(e):e;return Q.isElement(e)?e.outerHTML:X("
").append(X(e).clone()).html()},setOuterHTML:function(e,t){b(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}A(X(this).html(t),!0)})},decode:H,encode:j,insertAfter:function(e,t){var r=y(t);return L(e,function(e){var t=r.parentNode,n=r.nextSibling;return n?t.insertBefore(e,n):t.appendChild(e),e})},replace:z,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=R(e),po(w(t),function(e){x(n,e.nodeName,_(t,e.nodeName))}),z(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 h.toHex(K.trim(e))},run:L,getAttribs:w,isEmpty:function(e,t){var n,r,i,o,a,s,l=0;if(e=e.firstChild){a=new J(e,e.parentNode),t=t||(m?m.getNonEmptyElements():null),o=m?m.getWhiteSpaceElements():{};do{if(i=e.nodeType,Q.isElement(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=a.next("all"===u);continue}if(s=e.nodeName.toLowerCase(),t&&t[s]){if("br"!==s)return!1;l++,e=a.next();continue}for(n=(r=w(e)).length;n--;)if("name"===(s=r[n].nodeName)||"data-mce-bookmark"===s)return!1}if(8===i)return!1;if(3===i&&!vo.test(e.nodeValue))return!1;if(3===i&&e.parentNode&&o[e.parentNode.nodeName]&&vo.test(e.nodeValue))return!1;e=a.next()}while(e)}return l<=1},createRng:P,nodeIndex:fo,split:function(e,t,n){var r,i,o=P();if(e&&t)return o.setStart(e.parentNode,fo(e)),o.setEnd(t.parentNode,fo(t)),r=o.extractContents(),(o=P()).setStart(t.parentNode,fo(t)+1),o.setEnd(e.parentNode,fo(e)+1),o=o.extractContents(),(i=e.parentNode).insertBefore(ji(O,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(ji(O,o),e),A(e),n||t},bind:$,unbind:W,fire:function(e,t,n){return g.fire(e,t,n)},getContentEditable:q,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=q(e));e=e.parentNode);return n},destroy:function(){if(p)for(var e=p.length;e--;){var t=p[e];g.unbind(t[0],t[1],t[2])}G.setDocument&&G.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 n=h,i=function(){return O},e={},l=(r=o).keep_values,e={style:{set:function(e,t){null!==t&&"object"==typeof t?e.css(t):(l&&e.attr("data-mce-style",t),e.attr("style",t))},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return n.serialize(n.parse(t),e[0].nodeName)}}},l&&(e.href=e.src={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||i(),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)}}),s=e,O}(ye=yo=yo||{}).DOM=ye(document),ye.nodeIndex=fo;function bo(e){return"function"==typeof e}var m=yo,_o=m.DOM,wo=K.each,xo=K.grep,Co=function(){var d={},i=[],o={},a=[],f=0;this.isDone=function(e){return 2===d[e]},this.markDone=function(e){d[e]=2},this.add=this.load=function(e,t,n,r){void 0===d[e]&&(i.push(e),d[e]=0),t&&(o[e]||(o[e]=[]),o[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete d[e],delete o[e]},this.loadQueue=function(e,t,n){this.loadScripts(i,e,t,n)},this.loadScripts=function(t,e,n,r){var l,u=[],c=function(t,e){wo(o[e],function(e){bo(e[t])&&e[t].call(e.scope)}),o[e]=void 0};a.push({success:e,failure:r,scope:n||this}),(l=function(){var e=xo(t);t.length=0,wo(e,function(e){var t,n,r,i,o,a;function s(){i.remove(o),a&&(a.onreadystatechange=a.onload=a=null),n()}2===d[e]?c("success",e):3===d[e]?c("failure",e):1!==d[e]&&(d[e]=1,f++,t=e,n=function(){d[e]=2,f--,c("success",e),l()},r=function(){d[e]=3,f--,u.push(e),c("failure",e),l()},o=(i=_o).uniqueId(),(a=document.createElement("script")).id=o,a.type="text/javascript",a.src=K._addCacheSuffix(t),"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&s()}:a.onload=s,a.onerror=function(){bo(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(a))}),f||(e=a.slice(0),a.length=0,wo(e,function(e){0===u.length?bo(e.success)&&e.success.call(e.scope):bo(e.failure)&&e.failure.call(e.scope,u)}))})()}},ko=(Co.ScriptLoader=new Co,K.each);function To(){function a(t,e,n){var r=u(name);ko(r,function(e){e=c(t,e);d(e.resource,e,void 0,void 0)}),e&&(n?e.call(n):e.call(Co))}var r=this,i=[],s={},l={},o=[],u=function(e){var t;return(t=l[e]?l[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}},d=function(e,t,n,r,i){var o;s[e]||(0!==(o="string"==typeof t?t:t.prefix+t.resource+t.suffix).indexOf("/")&&-1===o.indexOf("://")&&(o=To.baseURL+"/"+o),s[e]=o.substring(0,o.lastIndexOf("/")),l[e]?a(t,n,r):Co.ScriptLoader.add(o,function(){return a(t,n,r)},r,i))};return{items:i,urls:s,lookup:l,_listeners:o,get:function(e){if(l[e])return l[e].instance},dependencies:u,requireLangPack:function(e,t){var n=To.language;if(n&&!1!==To.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Co.ScriptLoader.add(s[e]+"/langs/"+n+".js")}},add:function(t,e,n){i.push(e),l[t]={instance:e,dependencies:n};n=b.partition(o,function(e){return e.name===t});return o=n.fail,ko(n.pass,function(e){e.callback()}),e},remove:function(e){delete s[e],delete l[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];ko(t,function(e){Co.ScriptLoader.add(n+"/"+e)})},load:d,waitFor:function(e,t){l.hasOwnProperty(e)?t():o.push({name:e,callback:t})}}}(ge=To=To||{}).PluginManager=ge(),ge.ThemeManager=ge();function Mo(e){var t=e.container();return e&&Q.isText(t)&&t.data.charAt(e.offset())===h.ZWSP}function Do(e){var t=e.container();return e&&Q.isText(t)&&t.data.charAt(e.offset()-1)===h.ZWSP}function So(e,t,n){var r;return(e=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),e.setAttribute("data-mce-bogus","all"),e.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r)),r=t.parentNode,n?r.insertBefore(e,t):t.nextSibling?r.insertBefore(e,t.nextSibling):r.appendChild(e),e}function Eo(e){return!ia(e)&&(ea(e)?!ta(e.parentNode):na(e)||Zo(e)||ra(e)||aa(e))}function Lo(e,t){return e=ua(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e}function No(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2}function Ro(e,t){return e.bottom-e.height/2t.bottom)&&No(t.top-e.bottom,e,t)}function Ao(e,t){return e.top>t.bottom||!(e.bottom=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e}function Io(e){for(var t=1;t=e.length?e.apply(this,n.slice(1)):function(){var e=n.concat([].slice.call(arguments));return Io.apply(this,e)}}function Yo(e){return e&&/[\r\n\t ]/.test(e)}function Fo(e){function r(e){0===e.height||0e.left&&t.righte.top&&t.bottom=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return Ta(t,e?n-1:n)}}}(Bo=g=g||{}).fromRangeStart=function(e){return Bo(e.startContainer,e.startOffset)},Bo.fromRangeEnd=function(e){return Bo(e.endContainer,e.endOffset)},Bo.after=function(e){return Bo(e.parentNode,ka(e)+1)},Bo.before=function(e){return Bo(e.parentNode,ka(e))},Bo.isAbove=function(e,t){return va.liftN([b.head(t.getClientRects()),b.last(e.getClientRects())],Ro).getOr(!1)},Bo.isBelow=function(e,t){return va.liftN([b.last(t.getClientRects()),b.head(e.getClientRects())],Ao).getOr(!1)},Bo.isAtStart=function(e){return!!e&&e.isAtStart()},Bo.isAtEnd=function(e){return!!e&&e.isAtEnd()},Bo.isTextPosition=function(e){return!!e&&Q.isText(e.container())},Bo.isElementPosition=function(e){return!1===Bo.isTextPosition(e)};function Pa(e,t){0===t.length?Ps(e):e.nodeValue=t}function Oa(e){var t=h.trim(e);return{count:e.length-t.length,text:t}}function Ia(e){var t;Rs(e)&&Wo(e)&&(qo(e)?e.removeAttribute("data-mce-caret"):Ps(e)),As(e)&&(t=h.trim(function(e){try{return e.nodeValue}catch(e){return""}}(e)),Pa(e,t))}function Ya(e,t){var n,r=e?t.firstChild:t.lastChild;return Q.isText(r)?p.some(k(r,e?0:r.data.length)):r?Eo(r)?p.some(e?k.before(r):(n=r,Q.isBr(n)?k.before(n):k.after(n))):(n=t,t=r,t=(r=e)?k.before(t):k.after(t),zs(r,n,t)):p.none()}function Fa(e,t,n,r,i){return t._selectionOverrides.showCaret(e,n,r,i)}function Ba(e,t,n){return t&&t.collapsed&&Vs(e,t,n)||t}function Ha(e,t){return e===Ns.Backwards?t.reverse():t}function ja(e,t,n,r){for(var i,o,a,s=ql(n),l=r,u=[];l&&(o=s,a=l,o=t===Ns.Forwards?o.next(a):o.prev(a));){if(Q.isBr(o.getNode(!1)))return t===Ns.Forwards?{positions:Ha(t,u).concat([o]),breakType:Ls.Br,breakAt:p.some(o)}:{positions:Ha(t,u),breakType:Ls.Br,breakAt:p.some(o)};if(o.isVisible()){if(e(l,o))return a=l,i=o,i=Q.isBr(i.getNode(t===Ns.Forwards))?Ls.Br:!1===Tl(a,i)?Ls.Block:Ls.Wrap,{positions:Ha(t,u),breakType:i,breakAt:p.some(o)};u.push(o)}l=o}return{positions:Ha(t,u),breakType:Ls.Eol,breakAt:p.none()}}function Ua(n,r,i,e){return r(i,e).breakAt.map(function(e){var t=r(i,e).positions;return n===Ns.Backwards?t.concat(e):[e].concat(t)}).getOr([])}function za(e,i){return b.foldl(e,function(e,r){return e.fold(function(){return p.some(r)},function(n){return va.liftN([b.head(n.getClientRects()),b.head(r.getClientRects())],function(e,t){e=Math.abs(i-e.left);return Math.abs(i-t.left)<=e?r:n}).or(e)})},p.none())}function $a(t,e){return b.head(e.getClientRects()).bind(function(e){return za(t,e.left)})}function Wa(e,t,n,r,i){var o,a,s,n=tl.descendants(H.fromDom(n),"td,th").map(function(e){return e.dom()}),e=b.filter((o=e,b.bind(n,function(e){var t=nl(e.getBoundingClientRect(),-1);return[{x:t.left,y:o(t),cell:e},{x:t.right,y:o(t),cell:e}]})),function(e){return t(e,i)});return a=r,s=i,b.foldl(e,function(e,r){return e.fold(function(){return p.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-a)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-a)+Math.abs(r.y-s));return p.some(n=(t=o.childNodes).length&&t.length&&(i=1,r=Math.max(0,t.length-1)),a.push(e.nodeIndex(t[r],n)+i));o&&o!==s;o=o.parentNode)a.push(e.nodeIndex(o,n));return a}function Cs(e,t){var n,r=e[(i=t?"start":"end")+"Container"],i=e[i+"Offset"];Q.isElement(r)&&"TR"===r.nodeName&&(r=(n=r.childNodes)[Math.min(t?i:i-1,n.length-1)])&&(i=t?0:r.childNodes.length,e["set"+(t?"Start":"End")](r,i))}function ks(e,t){return Q.isElement(e)&&(e=Oo(e,t),ou(e))?e:Wo(e)&&(t=(e=Q.isText(e)&&zo(e)?e.parentNode:e).previousSibling,ou(t)||(t=e.nextSibling,ou(t)))?t:void 0}function Ts(e,t,n){var r=n.getNode(),i=r?r.nodeName:null,o=n.getRng();return ou(r)||"IMG"===i?{name:i,index:lu(n.dom,i,r)}:(r=cu(o))?{name:i=r.tagName,index:lu(n.dom,i,r)}:au(e,n,t,o)}function Ms(e,t){var n=e.dom,r=e.getRng(),i=n.uniqueId(),o=e.isCollapsed(),a=e.getNode(),s=a.nodeName;return"IMG"===s?{name:s,index:lu(n,s,a)}:(s=uu(r.cloneRange()),o||(s.collapse(!1),a=du(n,i+"_end",t),s.insertNode(a),su(a.nextSibling)),(r=uu(r)).collapse(!0),o=du(n,i+"_start",t),r.insertNode(o),su(o.previousSibling),e.moveToBookmark({id:i,keep:1}),{id:i})}function Ds(e,t,n){return!(!1!==t.hasChildNodes()||!hu(e,t)||(e=n,t=(n=t).ownerDocument.createTextNode(h.ZWSP),n.appendChild(t),e.setStart(t,0),e.setEnd(t,0),0))}function Ss(e){return Q.isText(e)&&0t}),ol={scrollElementIntoView:function(e,t,n){var r,i,o,a=e.dom,s=a.getRoot(),l=0;if(!function(e,t,n){t={elm:t,alignToTop:n};return e.fire("scrollIntoView",t),t.isDefaultPrevented()}(e,t,n)&&Q.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==s.nodeName){n=e.selection.getScrollContainer();if(n)return r=Ga(t).y-Ga(n).y+l,o=n.clientHeight,void((r<(i=n.scrollTop)||i+o")},getDocumentBaseUrl:function(e){return e.getParam("document_base_url","")},getBodyId:function(e){return Xa(e,"body_id","tinymce")},getBodyClass:function(e){return Xa(e,"body_class","")},getContentSecurityPolicy:function(e){return e.getParam("content_security_policy","")},shouldPutBrInPre:function(e){return e.getParam("br_in_pre",!0)},getForcedRootBlock:function(e){return e.getParam("force_p_newlines",!1)?"p":!1===(e=e.getParam("forced_root_block","p"))?"":e},getForcedRootBlockAttrs:function(e){return e.getParam("forced_root_block_attrs",{})},getBrNewLineSelector:function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},getNoNewLineSelector:function(e){return e.getParam("no_newline_selector","")},shouldKeepStyles:function(e){return e.getParam("keep_styles",!0)},shouldEndContainerOnEmptyBlock:function(e){return e.getParam("end_container_on_empty_block",!1)},getFontStyleValues:function(e){return K.explode(e.getParam("font_size_style_values",""))},getFontSizeClasses:function(e){return K.explode(e.getParam("font_size_classes",""))}},D={before:Ka,after:function(e,t){c.nextSibling(e).fold(function(){c.parent(e).each(function(e){Ja(e,t)})},function(e){Ka(e,t)})},prepend:function(t,n){c.firstChild(t).fold(function(){Ja(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:Ja,appendAt:function(e,t,n){c.child(e,n).fold(function(){Ja(e,t)},function(e){Ka(e,t)})},wrap:function(e,t){Ka(e,t),Ja(t,e)}},al=Cr.detect().browser,sl=ga.curry(es,Gs),ll=ga.curry(es,Xs),ul=function(t,n){return function(){return p.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return p.from(t.dom.getParent(e,"table")).map(function(e){return ts(t,n,e)})}).getOr(!1)}},cl=function(n,r){return function(){return p.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return p.from(n.dom.getParent(t,"table")).map(function(e){return is(n,r,e,t)})}).getOr(!1)}},dl=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return dl(n)}}},fl=Q.isContentEditableFalse,pl=function(o,i,a){function s(){for(var e,t,n,r=X("*[contentEditable=false]",o),i=0;i').css(r).appendTo(o)[0],c.set(p.some({caret:r,element:e,before:t})),c.get().each(function(e){t&&X(e.caret).addClass("mce-visual-caret-before")}),l=tt.setInterval(function(){a()?X("div.mce-visual-caret",o).toggleClass("mce-visual-caret-hidden"):X("div.mce-visual-caret",o).addClass("mce-visual-caret-hidden")},500),(n=e.ownerDocument.createRange()).setStart(u,0),n.setEnd(u,0)):(u=function(e,t){var n,r=e.ownerDocument.createTextNode(h.ZWSP),i=e.parentNode;if(t){if(n=e.previousSibling,Uo(n)){if(Wo(n))return n;if(Go(n))return n.splitText(n.data.length-1)}i.insertBefore(r,e)}else{if(n=e.nextSibling,Uo(n)){if(Wo(n))return n;if(Vo(n))return n.splitText(1),n}e.nextSibling?i.insertBefore(r,e.nextSibling):i.appendChild(r)}return r}(e,t),n=e.ownerDocument.createRange(),fl(u.nextSibling)?(n.setStart(u,0),n.setEnd(u,0)):(n.setStart(u,1),n.setEnd(u,1))),n)},hide:s,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(o,e.element,e.before);X(e.caret).css(t)})},destroy:function(){return tt.clearInterval(l)}}},ml=function(e){return fl(e)||Q.isTable(e)&&Qa()},hl=Q.isContentEditableFalse,gl=Q.matchStyleValues("display","block table table-cell table-caption list-item"),vl=Wo,yl=zo,bl=ga.curry,_l=Q.isElement,wl=Eo,xl=function(e){return 0=a.data.length-1)return 1===e&&(r=t(a))?Dl(r):n;if(Vo(a)&&s<=1)return-1===e&&(r=o(a))?Sl(r):n;if(s===a.data.length)return(r=t(a))?Dl(r):n;if(0===s)return(r=o(a))?Sl(r):n}return n},Ll=bl(cs,0),Nl=bl(cs,-1),Rl=bl(ds,0),Al=bl(ds,-1),Pl=((_r=Ns=Ns||{})[_r.Backwards=-1]="Backwards",_r[_r.Forwards=1]="Forwards",Q.isContentEditableFalse),Ol=Q.isText,Il=Q.isElement,Yl=Q.isBr,Fl=Eo,Bl=function(e){return na(e)||!!aa(e=e)&&!0!==y.reduce(e.getElementsByTagName("*"),function(e,t){return e||Jo(t)},!1)},Hl=sa,jl=function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n},Ul=function(e,t){return e.hasChildNodes()&&t=(r=o.childNodes).length?(n="after",t=r.length-1):n="before",o=r[t]),i.push(ws(o)),r=function(e,t,n){var r=[];for(t=t.parentNode;t!==e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}(e,o),r=y.filter(r,ga.negate(Q.isBogus)),(i=i.concat(y.map(r,ws))).reverse().join("/")+","+n},iu=function(e,t){var n;if(!t)return null;if(t=(n=t.split(","))[0].split("/"),n=1i.data.length&&(o=i.data.length),k(i,o)}return n="after"===n?nu(t)+1:nu(t),k(t.parentNode,n)},ou=Q.isContentEditableFalse,au=function(e,t,n,r){var i=t.dom,o={};return o.start=xs(i,e,n,r,!0),t.isCollapsed()||(o.end=xs(i,e,n,r,!1)),o},su=function(e){Q.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},lu=function(e,t,n){var r=0;return K.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},uu=function(e){return Cs(e,!0),Cs(e,!1),e},cu=function(e){return ks(e.startContainer,e.startOffset)||ks(e.endContainer,e.endOffset)},du=function(e,t,n){t={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",t,""):e.create("span",t)},fu={getBookmark:function(e,t,n){return 2===t?Ts(h.trim,n,e):3===t?(r=(n=e).getRng(),{start:ru(n.dom.getRoot(),k.fromRangeStart(r)),end:ru(n.dom.getRoot(),k.fromRangeEnd(r))}):t?{rng:e.getRng()}:Ms(e,!1);var r},getUndoBookmark:v.curry(Ts,v.identity,!0),getPersistentBookmark:Ms},pu="_mce_caret",mu=function(e){return Q.isElement(e)&&e.id===pu},hu=function(e,t){for(;t&&t!==e;){if(t.id===pu)return t;t=t.parentNode}return null},gu=function(e,t){return!e.isBlock(t)||t.innerHTML||V.ie||(t.innerHTML=' '),t},vu=function(e,t,n,r){var i,o,a,s,l,u=n[t?"start":"end"],c=e.getRoot();if(u){for(n=u[0],o=c,i=u.length-1;1<=i;i--){if(a=o.childNodes,Ds(c,o,r))return!0;if(u[i]>a.length-1)return!!Ds(c,o,r)||(s=o,l=r,C.lastPositionIn(s).fold(function(){return!1},function(e){return l.setStart(e.container(),e.offset()),l.setEnd(e.container(),e.offset()),!0}));o=a[u[i]]}3===o.nodeType&&(n=Math.min(u[0],o.nodeValue.length)),1===o.nodeType&&(n=Math.min(u[0],o.childNodes.length)),t?r.setStart(o,n):r.setEnd(o,n)}return!0},yu=function(e,t,n){var r,i,o,a,s=e.get(n.id+"_"+t),l=n.keep;if(s){if(o=s.parentNode,a=(o=(r="start"===t?l?s.hasChildNodes()?(o=s.firstChild,1):Ss(s.nextSibling)?(o=s.nextSibling,0):Ss(s.previousSibling)?(o=s.previousSibling,s.previousSibling.data.length):(o=s.parentNode,e.nodeIndex(s)+1):e.nodeIndex(s):l?s.hasChildNodes()?(o=s.firstChild,1):Ss(s.previousSibling)?(o=s.previousSibling,s.previousSibling.data.length):(o=s.parentNode,e.nodeIndex(s)):e.nodeIndex(s),o),r),!l){for(l=s.previousSibling,i=s.nextSibling,K.each(K.grep(s.childNodes),function(e){Q.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});s=e.get(n.id+"_"+t);)e.remove(s,!0);l&&i&&l.nodeType===i.nodeType&&Q.isText(l)&&!V.opera&&(r=l.nodeValue.length,l.appendData(i.nodeValue),e.remove(i),a=(o=l,r))}return p.some(k(o,a))}return p.none()},bu=function(e,t){return e.isSome()?e:t},_u=function(e,t){var n,r,i,o,a,s,l,e=e.dom;if(t){if(K.isArray(t.start))return s=t,l=(a=e).createRng(),vu(a,!0,s,l)&&vu(a,!1,s,l)?p.some(l):p.none();if("string"==typeof t.start)return p.some((a=t,l=(s=e).createRng(),o=iu(s.getRoot(),a.start),l.setStart(o.container(),o.offset()),o=iu(s.getRoot(),a.end),l.setEnd(o.container(),o.offset()),l));if(t.hasOwnProperty("id"))return i=yu(r=e,"start",o=t),o=yu(r,"end",o),va.liftN([i,bu(o,i)],function(e,t){var n=r.createRng();return n.setStart(gu(r,e.container()),e.offset()),n.setEnd(gu(r,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=e,i=t,p.from(n.select(i.name)[i.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return p.some(t.rng)}return p.none()},wu={getBookmark:function(e,t,n){return fu.getBookmark(e,t,n)},moveToBookmark:function(t,e){_u(t,e).each(function(e){t.setRng(e)})},isBookmarkNode:function(e){return Q.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")}},xu=K.each,Cu=function(i){this.compare=function(e,t){var n,r;return e.nodeName===t.nodeName&&!(!(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})((n=function(t){var n={};return xu(i.getAttribs(t),function(e){e=e.nodeName.toLowerCase();0!==e.indexOf("_")&&"style"!==e&&0!==e.indexOf("data-")&&(n[e]=i.getAttrib(t,e))}),n})(e),n(t))||!r(i.parseStyle(i.getAttrib(e,"style")),i.parseStyle(i.getAttrib(t,"style")))||wu.isBookmarkNode(e)||wu.isBookmarkNode(t))}},ku={before:function(t,e){b.each(e,function(e){D.before(t,e)})},after:function(n,r){b.each(r,function(e,t){t=0===t?n:r[t-1];D.after(t,e)})},prepend:function(t,e){b.each(e.slice().reverse(),function(e){D.prepend(t,e)})},append:function(t,e){b.each(e,function(e){D.append(t,e)})}},Tu={empty:function(e){e.dom().textContent="",b.each(c.children(e),function(e){Es(e)})},remove:Es,unwrap:function(e){var t=c.children(e);0'))},isPaddedElement:function(e){return 1===b.filter(c.children(e),Nu).length},trimBlockTrailingBr:function(n){c.lastChild(n).each(function(t){c.prevSibling(t).each(function(e){Ni(n)&&Ri(t)&&Ni(e)&&Tu.remove(t)})})}},Pu=K.makeMap;function Ou(e){var s=[],l=(e=e||{}).indent,u=Pu(e.indent_before||""),c=Pu(e.indent_after||""),d=Ji.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format;return{start:function(e,t,n){var r,i,o,a;if(l&&u[e]&&0":" />",n&&l&&c[e]&&0"),l&&c[e]&&0")},comment:function(e){s.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?s.push("",e," ",d(t),"?>"):s.push("",e,"?>"),l&&s.push("\n")},doctype:function(e){s.push("",l?"\n":"")},reset:function(){s.length=0},getContent:function(){return s.join("").replace(/\n$/,"")}}}function Iu(t,p){void 0===p&&(p=so());var m=Ou(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(e){var c=t.validate,d={3:function(e){m.text(e.value,e.raw)},8:function(e){m.comment(e.value)},7:function(e){m.pi(e.name,e.value)},10:function(e){m.doctype(e.value)},4:function(e){m.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;f(e),e=e.next;);}},f=(m.reset(),function(e){var t,n,r,i,o,a,s,l,u=d[e.type];if(u)u(e);else{if(u=e.name,t=e.shortEnded,n=e.attributes,c&&n&&1|)$/," "):t("nextSibling")||(e=e.replace(/( | )( |)$/," "))),e}var i,o,a,s,l,u,c,d,f,p=n.schema.getTextInlineElements(),m=n.selection,h=n.dom;if(/^ | $/.test(e)&&(e=r(e)),i=n.parser,f=t.merge,o=Iu({validate:n.settings.validate},n.schema),d=' ',l={content:e,format:"html",selection:!0,paste:t.paste},(l=n.fire("BeforeSetContent",l)).isDefaultPrevented())n.fire("SetContent",{content:l.content,format:"html",selection:!0,paste:t.paste});else{-1===(e=l.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,d);var g,v=(g=m.getRng()).startContainer||(g.parentElement?g.parentElement():null),y=n.getBody(),v=(v===y&&m.isCollapsed()&&h.isBlock(y.firstChild)&&(v=y.firstChild)&&!n.schema.getShortEndedElements()[v.nodeName]&&h.isEmpty(y.firstChild)&&((g=h.createRng()).setStart(y.firstChild,0),g.setEnd(y.firstChild,0),m.setRng(g)),m.isCollapsed()||(n.selection.setRng(Bu.normalize(n.selection.getRng())),n.getDoc().execCommand("Delete",!1,null),v=m.getRng(),y=v.startContainer,x=v.startOffset,3===y.nodeType&&v.collapsed&&(" "===y.data[x]?(y.deleteData(x,1),/[\u00a0| ]$/.test(e)||(e+=" ")):" "===y.data[x-1]&&(y.deleteData(x-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e)))),{context:(a=m.getNode()).nodeName.toLowerCase(),data:t.data,insert:!0}),b=i.parse(e,v);if(!0===t.paste&&Zl.isListFragment(n.schema,b)&&Zl.isParentBlockLi(h,a))g=Zl.insertAtCaret(o,h,n.selection.getRng(),b),n.selection.setRng(g),n.fire("SetContent",l);else{for(var _,w,x,C=b;C=C.walk();)1===C.type&&C.attr("data-mce-fragment","1");if("mce_marker"===(c=b.lastChild).attr("id"))for(c=(u=c).prev;c;c=c.walk(!0))if(3===c.type||!h.isBlock(c.name)){n.schema.isValidChild(c.parent.name,"span")&&c.parent.insert(u,c,"br"===c.name);break}if(n._selectionOverrides.showBlockCaretContainer(a),v.invalid){for(m.setContent(d),a=m.getNode(),s=n.getBody(),9===a.nodeType?a=c=s:c=a;c!==s;)c=(a=c).parentNode;e=a===s?s.innerHTML:h.getOuterHTML(a),e=o.serialize(i.parse(e.replace(//i,function(){return o.serialize(b)}))),a===s?h.setHTML(s,e):h.setOuterHTML(a,e)}else e=o.serialize(b),ju(n,e,a);f&&(_=n.getBody(),w=new Cu(h),K.each(h.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==_;t=t.parentNode)p[e.nodeName.toLowerCase()]&&w.compare(t,e)&&h.remove(e,!0)})),(y=h.get("mce_marker"))&&(m.scrollIntoView(y),(x=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(y))?(h.remove(y),m.select(x)):(g=h.createRng(),(c=y.previousSibling)&&3===c.nodeType?(g.setStart(c,c.nodeValue.length),V.ie||(t=y.nextSibling)&&3===t.nodeType&&(c.appendData(t.data),t.parentNode.removeChild(t))):(g.setStartBefore(y),g.setEndBefore(y)),x=h.getParent(y,h.isBlock),h.remove(y),x&&h.isEmpty(x)&&(n.$(x).empty(),g.setStart(x,0),g.setEnd(x,0),Hu(x)||x.getAttribute("data-mce-fragment")||!(y=function(e){e=k.fromRangeStart(e);if(e=ql(n.getBody()).next(e))return e.toRange()}(g))?h.add(x,h.create("br",{"data-mce-bogus":"1"})):(g=y,h.remove(x))),m.setRng(g))),v=n.getBody(),K.each(v.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),Uu(n.dom,n.selection.getStart()),n.fire("SetContent",l),n.addVisual()}}}var Fu=function(e,t,n,r){var i=document.createRange();return i.setStart(e,t),i.setEnd(n,r),i},Bu={normalize:function(e){return e.collapsed?e:(t=e,n=k.fromRangeStart(t),r=k.fromRangeEnd(t),i=t.commonAncestorContainer,C.fromPosition(!1,i,r).map(function(e){return!Tl(n,r,i)&&Tl(n,e,i)?Fu(n.container(),n.offset(),e.container(),e.offset()):t}).getOr(t));var t,n,r,i}},Hu=Q.matchNodeNames("td th"),ju=function(e,t,n){var r,i;"all"===n.getAttribute("data-mce-bogus")?n.parentNode.insertBefore(e.dom.createFragment(t),n):(r=n.firstChild,i=n.lastChild,!r||r===i&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t))},Uu=function(e,t){p.from(e.getParent(t,"td,th")).map(H.fromDom).each(Au.trimBlockTrailingBr)},zu={insertAtCaret:function(e,t){var n="string"!=typeof(t=t)?(n=K.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:n}):{content:t,details:{}};Yu(e,n.content,n.details)}};function $u(e,t,n,r,i){return e(n,r)?p.some(n):l.isFunction(i)&&i(n)?p.none():t(n,r,i)}function Wu(e,t,n){for(var r=e.dom(),i=l.isFunction(n)?n:v.constant(!1);r.parentNode;){var r=r.parentNode,o=H.fromDom(r);if(t(o))return p.some(o);if(i(o))break}return p.none()}function qu(e,t){return b.find(e.dom().childNodes,v.compose(t,H.fromDom)).map(H.fromDom)}function Vu(e,r){function i(e){for(var t=0;t'),Tu.empty(e),D.append(e,t),p.some(k.before(t.dom()))):p.none()}function vc(e,t){return Q.isText(e.container())?of(t,e.container()):of(t,e.getNode())}function yc(e,t){return(t=t.get())&&e.container()===t&&$o(t)}function bc(e,t,n){var r=S.normalizeForwards(n),i=df(t,r.container());return S.findRootInline(e,i,r).fold(function(){return C.nextPosition(i,r).bind(v.curry(S.findRootInline,e,i)).map(function(e){return cf.before(e)})},p.none)}function _c(e,t){return null===hu(e,t)}function wc(e,t,n){var r=S.normalizeBackwards(n);return ff(e,t,r).bind(function(e){return C.prevPosition(e,r).isNone()?p.some(cf.start(e)):p.none()})}function xc(e,t,n){var r=S.normalizeForwards(n);return ff(e,t,r).bind(function(e){return C.nextPosition(e,r).isNone()?p.some(cf.end(e)):p.none()})}function Cc(e,t,n){var r=S.normalizeBackwards(n),i=df(t,r.container());return S.findRootInline(e,i,r).fold(function(){return C.prevPosition(i,r).bind(v.curry(S.findRootInline,e,i)).map(function(e){return cf.after(e)})},p.none)}function kc(e){return e.fold(v.constant("before"),v.constant("start"),v.constant("end"),v.constant("after"))}function Tc(e,t){return e?t.fold(v.compose(p.some,cf.start),p.none,v.compose(p.some,cf.after),p.none):t.fold(p.none,v.compose(p.some,cf.before),p.none,v.compose(p.some,cf.end))}function Mc(e,a,s,l){var t=S.normalizePosition(e,l),u=mf(a,s,t);return mf(a,s,t).bind(v.curry(Tc,e)).orThunk(function(){return t=e,n=a,r=s,i=u,o=S.normalizePosition(t,l),C.fromPosition(t,r,o).map(v.curry(S.normalizePosition,t)).fold(function(){return i.map(gf)},function(e){return mf(n,r,e).map(v.curry(vf,t,n,r,o,e)).filter(v.curry(yf,i))}).filter(pf);var t,n,r,i,o})}function Dc(e){return l.isFunction(e.selection.getSel().modify)}function Sc(e,t,n){var r=e?1:-1;return t.setRng(k(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0}function Ec(e){return!1!==e.settings.inline_boundaries}function Lc(e,t,n){return function(){return!!Ec(t)&&_f(e,t)}}function Nc(e,t){return yd.closest(H.fromDom(e),"td,th",t)}function Rc(e,t){return yd.ancestor(e,"table",t)}function Ac(e){return!1===f.eq(e.start(),e.end())}function Pc(e){return tl.descendants(e,"td,th")}function Oc(r,e){var t=Nc(e.startContainer,r),n=Nc(e.endContainer,r);return e.collapsed?p.none():va.liftN([t,n],Lf).fold(function(){return t.fold(function(){return n.bind(function(t){return Rc(t,r).bind(function(e){return b.head(Pc(e)).map(function(e){return Lf(e,t)})})})},function(t){return Rc(t,r).bind(function(e){return b.last(Pc(e)).map(function(e){return Lf(t,e)})})})},function(e){return Ic(r,e)?p.none():(n=r,Rc((t=e).start(),n).bind(function(e){return b.last(Pc(e)).map(function(e){return Lf(t.start(),e)})}));var t,n})}function Ic(e,t){return Pf(t,e).isSome()}function Yc(e,t){return b.findIndex(e,function(e){return f.eq(e,t)})}function Fc(n){return Yf(n).map(function(e){var t=n.cells();return e.length===t.length?Rf.removeTable(n.table()):Rf.emptyCells(e)})}function Bc(e){var t=[];if(e)for(var n=0;nl.childNodes.length-1&&(d=!1),Q.isDocument(l)&&(l=a,u=0),l===a){if(d&&(o=l.childNodes[0",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:n.convertURL,url_converter_scope:n,ie7_compat:!0}},md=function(e,t,n,r){var i,o,r=function(n,e){e=Dr.bifilter(e,function(e,t){return b.contains(n,t)});return ud(e.t,e.f)}(["mobile"],r),t=K.extend(t,n,r.settings(),(t=e,o=(i=r).settings().inline,t&&Xu(i,"mobile")&&!o?function(e,t,n){e=e.sections(),e=e.hasOwnProperty(t)?e[t]:{};return K.extend({},n,e)}(r,"mobile",fd):{}),{validate:!0,content_editable:r.settings().inline,external_plugins:function(e,t){t=t.external_plugins||{};return e&&e.external_plugins?K.extend({},e.external_plugins,t):t}(n,r.settings())});return Ku(e,r,n,t)},hd=v.curry(Ju,l.isString),gd=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,S={isInlineTarget:function(e,t){e=hd(e,"inline_boundaries_selector").getOr("a[href],code");return si.is(H.fromDom(t),e)},findRootInline:function(e,t,n){e=e,t=t;n=b.filter(m.DOM.getParents(n.container(),"*",t),e);return p.from(n[n.length-1])},isRtl:function(e){return"rtl"===m.DOM.getStyle(e,"direction",!0)||(e=e.textContent,gd.test(e))},isAtZwsp:function(e){return Mo(e)||Do(e)},normalizePosition:Zu,normalizeForwards:v.curry(Zu,!0),normalizeBackwards:v.curry(Zu,!1),hasSameParentBlock:function(e,t,n){t=ss(t,e),n=ss(n,e);return t&&t===n}},vd={getParentBlock:function(e,t){return f.contains(e,t)?ld.closest(t,function(e){return Ai(e)||Oi(e)},(n=e,function(e){return f.eq(n,H.fromDom(e.dom().parentNode))})):p.none();var n},paddEmptyBody:function(e){var t;e.dom.isEmpty(e.getBody())&&(e.setContent(""),t=(t=(e=e).getBody()).firstChild&&e.dom.isBlock(t.firstChild)?t.firstChild:t,e.selection.setCursorLocation(t,0))},willDeleteLastPositionInElement:function(i,o,a){return va.liftN([C.firstPositionIn(a),C.lastPositionIn(a)],function(e,t){var n=S.normalizePosition(!0,e),r=S.normalizePosition(!1,t),e=S.normalizePosition(!1,o);return(i?C.nextPosition(a,e).map(function(e){return e.isEqual(r)&&o.isEqual(n)}):C.prevPosition(a,e).map(function(e){return e.isEqual(n)&&o.isEqual(r)})).getOr(!1)}).getOr(!0)}},yd={first:function(e){return si.one(e)},ancestor:ec,sibling:function(e,t){return ld.sibling(e,function(e){return si.is(e,t)})},child:function(e,t){return ld.child(e,function(e){return si.is(e,t)})},descendant:function(e,t){return si.one(t,e)},closest:function(e,t,n){return $u(si.is,ec,e,t,n)}},bd=function(e,t,n){return yd.ancestor(e,t,n).isSome()},_d=function(e,t){return Eo(t)&&!1===tc(e,t)||(e=t,Q.isElement(e)&&"A"===e.nodeName&&e.hasAttribute("name"))||wd(t)},wd=Q.hasAttribute("data-mce-bookmark"),xd=Q.hasAttribute("data-mce-bogus"),Cd=Q.hasAttributeValue("data-mce-bogus","all"),kd={isEmpty:function(e){var t,n,r=e.dom(),i=0;if(_d(r,r))return!1;if(!(n=r.firstChild))return!0;t=new J(n,r);do{if(Cd(n))n=t.next(!0);else{if(!xd(n))if(Q.isBr(n))i++;else if(_d(r,n))return!1;n=t.next()}}while(n);return i<=1}},Td=n.immutable("block","position"),Md=n.immutable("from","to"),Dd=function(e,t){var e=H.fromDom(e),n=H.fromDom(t.container());return vd.getParentBlock(e,n).map(function(e){return Td(e,t)})},Sd=function(e){return!1===f.eq(e.from().block(),e.to().block())},Ed=function(e){return c.parent(e.from().block()).bind(function(t){return c.parent(e.to().block()).filter(function(e){return f.eq(t,e)})}).isSome()},Ld=function(e){return!1===Q.isContentEditableFalse(e.from().block())&&!1===Q.isContentEditableFalse(e.to().block())},Nd=function(t,n,r){return Q.isBr(r.position().getNode())&&!1===kd.isEmpty(r.block())?C.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?C.fromPosition(n,t,e).bind(function(e){return Dd(t,e)}):p.some(r)}).getOr(r):r},Rd=function(e,t,n){return n.collapsed?(i=t,t=n,t=Dd(r=e,k.fromRangeStart(t)),n=t.bind(function(e){return C.fromPosition(i,r,e.position()).bind(function(e){return Dd(r,e).map(function(e){return Nd(r,i,e)})})}),va.liftN([t,n],Md).filter(function(e){return Sd(e)&&Ed(e)&&Ld(e)})):p.none();var r,i},Ad={parentsUntil:nc,parents:rc,parentsAndSelf:function(e,t){return[e].concat(rc(e,t))}},Pd=function(e){t=c.children(e);var t,e=b.findIndex(t,Ni).fold(function(){return t},function(e){return t.slice(0,e)});return b.each(e,function(e){Tu.remove(e)}),e},Od=function(e,t){C.positionIn(e,t.dom()).each(function(e){e=e.getNode();Q.isBr(e)&&Tu.remove(H.fromDom(e))})},Id=function(e,t){t=Ad.parentsAndSelf(t,e);return b.find(t.reverse(),kd.isEmpty).each(Tu.remove)},Yd=function(n,r){return f.contains(r,n)?c.parent(n).bind(function(e){var t;return f.eq(e,r)?p.some(n):(t=r,e=n,e=c.parents(e,function(e){return f.eq(e,t)}),p.from(e[e.length-2]))}):p.none()},Fd=function(e,t,n,r){return t?ic(e,r,n):ic(e,n,r)},Bd={backspaceDelete:function(t,n){var r=H.fromDom(t.getBody()),e=Rd(r.dom(),n,t.selection.getRng()).bind(function(e){return Fd(r,n,e.from().block(),e.to().block())});return e.each(function(e){t.selection.setRng(e.toRange())}),e.isSome()}},Hd=function(n,r){var i=r.getRng();return va.liftN([vd.getParentBlock(n,H.fromDom(i.startContainer)),vd.getParentBlock(n,H.fromDom(i.endContainer))],function(e,t){return!1===f.eq(e,t)&&(i.deleteContents(),Fd(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1)},jd=function(e,t){var n=C.prevPosition(e.dom(),k.fromRangeStart(t)).isNone(),r=C.nextPosition(e.dom(),k.fromRangeEnd(t)).isNone();return!(oc(e=e,(t=t).startContainer)||oc(e,t.endContainer))&&n&&r},Ud=function(e){return e.setContent(""),e.selection.setCursorLocation(),!0},zd={backspaceDelete:function(e,t){return!e.selection.isCollapsed()&&(e=e,n=H.fromDom(e.getBody()),r=e.selection.getRng(),jd(n,r)?Ud(e):Hd(n,e.selection));var n,r}},we=function(a){if(!l.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 s=[],n={};return b.each(a,function(e,r){var t=Dr.keys(e);if(1!==t.length)throw new Error("one and only one name per case");var i=t[0],o=e[i];if(void 0!==n[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!l.isArray(o))throw new Error("case arguments must be an array");s.push(i),n[i]=function(){var e=arguments.length;if(e!==o.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+o.length+" ("+o+"), got "+e);for(var n=new Array(e),t=0;tk.before(e).offset()?k(t.container(),t.offset()-1):t;var n,r,i},Vd=function(e,t,n){return(e?pc:fc)(t,n)},Gd={deleteElement:function(t,n,e){s=n,l=t.getBody(),r=e.dom();var r,i,o,a,s=Vd(s,l,r).map(v.curry(qd,r)),l=ld.ancestor(e,v.curry(hc,t),(i=t.getBody(),function(e){return e.dom()===i})),u=(o=e,a=s,va.liftN([c.prevSibling(o),c.nextSibling(o),a],function(e,t,n){var r,e=e.dom(),i=t.dom();return Q.isText(e)&&Q.isText(i)?(r=e.data.length,e.appendData(i.data),Tu.remove(t),Tu.remove(o),n.container()===i?k(e,r):n):(Tu.remove(o),n)}).orThunk(function(){return Tu.remove(o),a}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):l.bind(gc).fold(function(){mc(t,n,u)},function(e){mc(t,n,p.some(e))})}},Xd=function(t,n){return function(e){return t._selectionOverrides.hideFakeCaret(),Gd.deleteElement(t,n,H.fromDom(e)),!0}},Kd=function(t,n){return function(e){e=n?k.before(e):k.after(e);return t.selection.setRng(e.toRange()),!0}},Jd=function(t){return function(e){return t.selection.setRng(e.toRange()),!0}},Qd=function(e){b.each(tl.descendants(e,".mce-offscreen-selection"),Tu.remove)},Zd={backspaceDelete:function(e,t){return e.selection.isCollapsed()?(i=t,Wd((r=e).getBody(),i,r.selection.getRng()).map(function(e){return e.fold(Xd(r,i),Kd(r,i),Jd(r))}).getOr(!1)):(t=t,n=(e=e).selection.getNode(),!!Q.isContentEditableFalse(n)&&(Qd(H.fromDom(e.getBody())),Gd.deleteElement(e,t,H.fromDom(e.selection.getNode())),vd.paddEmptyBody(e),!0));var n,r,i},paddEmptyElement:function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Q.isContentEditableTrue(t)||Q.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Q.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(k.before(t).toRange())),!0}},ef=Q.isText,tf=function(e){return ef(e)&&e.data[0]===h.ZWSP},nf=function(e){return ef(e)&&e.data[e.data.length-1]===h.ZWSP},rf=function(e){return e.ownerDocument.createTextNode(h.ZWSP)},of=function(e,t){return e?ef((e=t).previousSibling)?(nf(e.previousSibling)||e.previousSibling.appendData(h.ZWSP),e.previousSibling):ef(e)?(tf(e)||e.insertData(0,h.ZWSP),e):(n=rf(e),e.parentNode.insertBefore(n,e),n):ef((e=t).nextSibling)?(tf(e.nextSibling)||e.nextSibling.insertData(0,h.ZWSP),e.nextSibling):ef(e)?(nf(e)||e.appendData(h.ZWSP),e):(n=rf(e),e.nextSibling?e.parentNode.insertBefore(n,e.nextSibling):e.parentNode.appendChild(n),n);var n},af=v.curry(of,!0),sf=v.curry(of,!1),lf=function(t,e){return e.fold(function(e){Fs.remove(t.get());e=af(e);return t.set(e),p.some(k(e,e.length-1))},function(e){return C.firstPositionIn(e).map(function(e){return yc(e,t)?k(t.get(),1):(Fs.remove(t.get()),e=vc(e,!0),t.set(e),k(e,1))})},function(e){return C.lastPositionIn(e).map(function(e){return yc(e,t)?k(t.get(),t.get().length-1):(Fs.remove(t.get()),e=vc(e,!1),t.set(e),k(e,e.length-1))})},function(e){Fs.remove(t.get());e=sf(e);return t.set(e),p.some(k(e,1))})},uf=function(e,t){for(var n=0;ns.childNodes.length-1,s=s.childNodes[Math.min(e,s.childNodes.length-1)]||s,e=l&&3===s.nodeType?s.nodeValue.length:0),l=t.getParent(s,t.isBlock),u=l?t.getParent(l.parentNode,t.isBlock):null,c=u?u.nodeName.toUpperCase():"",r=r&&r.ctrlKey,"LI"!==c||r||(l=u),s&&3===s.nodeType&&e>=s.nodeValue.length&&(up(n.schema,s,l)||(i=t.create("br"),a.insertNode(i),a.setStartAfter(i),a.setEndAfter(i),o=!0)),i=t.create("br"),a.insertNode(i),cp(t,d,i),dp(t,d,i,o),n.undoManager.add())}},xe=we([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),vp={before:xe.before,on:xe.on,after:xe.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(v.identity,v.identity,v.identity)}},yp=we([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),e=n.immutable("start","soffset","finish","foffset"),bp={domRange:yp.domRange,relative:yp.relative,exact:yp.exact,exactFromRange:function(e){return yp.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:e,getWin:function(e){e=e.match({domRange:function(e){return H.fromDom(e.startContainer)},relative:function(e,t){return vp.getStart(e)},exact:function(e,t,n,r){return e}});return c.defaultView(e)}},_p=Cr.detect().browser,wp=function(e,t){t=u.isText(t)?Ru.get(t).length:c.children(t).length+1;return t ")},mceToggleVisualAid:function(){a.hasVisual=!a.hasVisual,a.addVisual()},mceReplaceContent:function(e,t,n){a.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,d.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=c.getParent(d.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||f.remove("link"),n.href&&f.apply("link",n,r)},selectAll:function(){var e,t=c.getParent(d.getStart(),Q.isContentEditableTrue);t&&((e=c.createRng()).selectNodeContents(t),d.setRng(e))},delete:function(){Xf.deleteCommand(a)},forwardDelete:function(){Xf.forwardDeleteCommand(a)},mceNewDocument:function(){a.setContent("")},InsertLineBreak:function(e,t,n){return gp.insert(a,n),!0}});e({JustifyLeft:u("alignleft"),JustifyCenter:u("aligncenter"),JustifyRight:u("alignright"),JustifyFull:u("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":i,mceBlockQuote:function(){return i("blockquote")},Outdent:function(){var e;if(h.inline_styles){if((e=c.getParent(d.getStart(),c.isBlock))&&0"),l))[e.length-1]=K.extend(e[e.length-1],{func:n,scope:r||o}),K.extend(e[0],{desc:o.translate(t),subpatterns:e.slice(1)})}function n(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)}function r(e){e.func&&e.func.call(e.scope)}var s={},i=[],l=function(e){var t,n,r={};for(n in am(sm(e,"+"),function(e){e in um?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=lm[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],um)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,V.mac?r.ctrl=!0:r.shift=!0),r.meta&&(V.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r};o.on("keyup keypress keydown",function(t){var e;((e=t).altKey||e.ctrlKey||e.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(am(s,function(e){if(n(t,e))return i=e.subpatterns.slice(0),"keydown"===t.type&&r(e),!0}),n(t,i[0]))&&(1===i.length&&"keydown"===t.type&&r(i[0]),i.shift())}),this.add=function(e,t,n,r){var i=n;return"string"==typeof n?n=function(){o.execCommand(i,!1,null)}:K.isArray(i)&&(n=function(){o.execCommand(i[0],i[1],i[2])}),am(sm(K.trim(e.toLowerCase())),function(e){e=a(e,t,n,r);s[e.id]=e}),!0},this.remove=function(e){e=a(e);return!!s[e.id]&&(delete s[e.id],!0)}}function dm(e){e.dom().focus()}function fm(e){return e=void 0!==e?e.dom():document,p.from(e.activeElement).map(H.fromDom)}function pm(t,e){return((e=e).collapsed?p.from(Oo(e.startContainer,e.startOffset)).map(H.fromDom):p.none()).bind(function(e){return Yi(e)?p.some(e):!1===f.contains(t,e)?p.some(t):p.none()})}function mm(e,t){return t.dom()[e]}function hm(e,t){return parseInt(Ir.get(t,e),10)}var gm=function(e,t,n){return ld.closest(e,t,n).isSome()},vm={hasFocus:function(e){var t=c.owner(e).dom();return e.dom()===t.activeElement},focus:dm,blur:function(e){e.dom().blur()},active:fm,search:function(t){return fm(c.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},focusInside:function(t){var e=c.owner(t);fm(e).filter(function(e){return gm(e,v.curry(f.eq,t))}).fold(function(){dm(t)},v.noop)}},ym=function(t,e){return t.dom.getParent(e,function(e){return"true"===t.dom.getContentEditable(e)})},bm=function(t,e){pm(H.fromDom(t.getBody()),e).bind(function(e){return C.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},_m=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},wm=function(e){return vm.hasFocus(e)||vm.search(e).isSome()},xm=function(e){var t;return e.inline?(t=(t=e).getBody())&&wm(H.fromDom(t)):(t=e).iframeElement&&vm.hasFocus(H.fromDom(t.iframeElement))},Cm=function(e){return e.editorManager.setActive(e)},km={focus:function(e,t){var n,r,i;e.removed||(t?Cm(e):(t=(n=e).selection,e=n.settings.content_editable,r=n.getBody(),i=t.getRng(),n.quirks.refreshContentEditable(),t=ym(n,t.getNode()),n.$.contains(r,t)?(_m(t),bm(n,i)):(void 0!==n.bookmark&&!1===xm(n)&&Dp.getRng(n).each(function(e){n.selection.setRng(e),i=e}),e||(V.opera||_m(r),n.getWin().focus()),(V.gecko||e)&&(_m(r),bm(n,i))),Cm(n)))},hasFocus:xm},Tm=v.curry(mm,"clientWidth"),Mm=v.curry(mm,"clientHeight"),Dm=v.curry(hm,"margin-top"),Sm=v.curry(hm,"margin-left"),Em=function(e){return e.dom().getBoundingClientRect()},Lm={isXYInContentArea:function(e,t,n){var r,i,o=H.fromDom(e.getBody()),o=e.inline?o:c.documentElement(o),t=(e=e.inline,t=t,n=n,r=Em(i=o),{x:t-(e?r.left+i.dom().clientLeft+Sm(i):0),y:n-(e?r.top+i.dom().clientTop+Dm(i):0)});return n=t.x,e=t.y,i=Tm(r=o),r=Mm(r),0<=n&&0<=e&&n<=i&&e<=r},isEditorAttachedToDom:function(e){e=e.inline?e.getBody():e.getContentAreaContainer();return p.from(e).map(H.fromDom).map(function(e){return f.contains(c.owner(e),e)}).getOr(!1)}};function Nm(n){function t(t){if(!n.removed&&Lm.isEditorAttachedToDom(n))return b.find(i,function(e){return a(o().getArgs(e),t)}).getOrThunk(function(){n.editorManager.setActive(n);var e=o().open(t,function(){u(e),s()});return l(e),s(),e})}var r,i=[],o=function(){var e=n.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():{open:t,close:t,reposition:t,getArgs:t};function t(){throw new Error("Theme did not provide a NotificationManager implementation.")}},a=function(e,t){return!(e.type!==t.type||e.text!==t.text||e.progressBar||e.timeout||t.progressBar||t.timeout)},s=function(){0t}}function _h(t){return function(e){return e.line===t}}function wh(e,t){return Math.abs(e.left-t)}function xh(e,t){return Math.abs(e.right-t)}function Ch(e,t){return e>=t.left&&e<=t.right}function kh(e,i){return y.reduce(e,function(e,t){var n=Math.min(wh(e,i),xh(e,i)),r=Math.min(wh(t,i),xh(t,i));return Ch(i,t)||!Ch(i,e)&&(r===n&&$h(t.node)||r').attr("id",f)).appendTo(s.getBody()),e=s.dom.createRng(),t===i&&V.ie?(r.empty().append('
').append(t),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(t)):(r.empty().append(" ").append(t).append(" "),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:a.getPos(n,s.getBody()).y}),r[0].focus(),(i=s.selection.getSel()).removeAllRanges(),i.addRange(e),b.each(tl.descendants(H.fromDom(s.getBody()),"*[data-mce-selected]"),function(e){x.remove(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),l=n,v(),e)}function o(){l&&l.removeAttribute("data-mce-selected"),yd.descendant(H.fromDom(s.getBody()),"#"+f).each(Tu.remove),l=null}var l,e,t,a,u,c=s.getBody(),d=pl(s.getBody(),function(e){return s.dom.isBlock(e)},function(){return km.hasFocus(s)}),f="sel-"+s.dom.uniqueId(),p=function(e,t,n,r){return void 0===r&&(r=!0),s.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&s.selection.scrollIntoView(t,-1===e),d.show(n,t))},m=function(e,t){return t=El(e,c,t),-1===e?k.fromRangeStart(t):k.fromRangeEnd(t)},h=function(e){return Wo(e)||Vo(e)||Go(e)},g=function(e){return h(e.startContainer)||h(e.endContainer)},v=function(){d.hide()};function y(e,t){var e=s.dom.getParent(e,s.dom.isBlock),t=s.dom.getParent(t,s.dom.isBlock);return!(!e||!s.dom.isChildOf(e,t)||!1!==Jh(eg(s,e)))||e&&(t=t,!(s.dom.getParent(e,s.dom.isBlock)===s.dom.getParent(t,s.dom.isBlock)))&&(e=ql(t=e),!!t.firstChild&&(t=k.before(t.firstChild),e=e.next(t))&&!Zh(e)&&!Qh(e))}return V.ceFalse&&(s.on("mouseup",function(e){var t=n();t.collapsed&&Lm.isXYInContentArea(s,e.clientX,e.clientY)&&r(Vs(s,t,!1))}),s.on("click",function(e){var t=eg(s,e.target);t&&(Jh(t)&&(e.preventDefault(),s.focus()),Kh(t))&&s.dom.isChildOf(t,s.selection.getNode())&&o()}),s.on("blur NewBlock",function(){o()}),s.on("ResizeWindow FullscreenStateChanged",function(){return d.reposition()}),u=!1,(a=s).on("touchstart",function(){u=!1}),a.on("touchmove",function(){u=!0}),a.on("touchend",function(e){var t=eg(a,e.target);Jh(t)&&!u&&(e.preventDefault(),i(qs(a,t)))}),s.on("mousedown",function(e){var t,n=e.target;n!==c&&"HTML"!==n.nodeName&&!s.dom.isChildOf(n,c)||!1===Lm.isXYInContentArea(s,e.clientX,e.clientY)||((t=eg(s,n))?Jh(t)?(e.preventDefault(),i(qs(s,t))):(o(),Kh(t)&&e.shiftKey||Vh.isXYWithinRange(e.clientX,e.clientY,s.selection.getRng())||(v(),s.selection.placeCaretAt(e.clientX,e.clientY))):!1===ml(n)&&(o(),v(),t=qh(c,e.clientX,e.clientY))&&!y(e.target,t.node)&&(e.preventDefault(),n=p(1,t.node,t.before,!1),s.getBody().focus(),r(n)))}),s.on("keypress",function(e){j.modifierPressed(e)||(e.keyCode,Jh(s.selection.getNode())&&e.preventDefault())}),s.on("getSelectionRange",function(e){var t=e.range;l&&(l.parentNode?((t=t.cloneRange()).selectNode(l),e.range=t):l=null)}),s.on("setSelectionRange",function(e){var t=i(e.range,e.forward);t&&(e.range=t)}),s.on("AfterSetSelectionRange",function(e){var e=e.range;g(e)||v(),e=e.startContainer.parentNode,s.dom.hasClass(e,"mce-offscreen-selection")||o()}),s.on("copy",function(e){var t,n=e.clipboardData;e.isDefaultPrevented()||!e.clipboardData||V.ie||(t=(t=s.dom.get(f))&&t.getElementsByTagName("*")[0])&&(e.preventDefault(),n.clearData(),n.setData("text/html",t.outerHTML),n.setData("text/plain",t.outerText))}),Hh.init(s),Xh.setup(s),e=s.contentStyles,t=".mce-content-body",e.push(d.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:p,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Ko(e),r(n()),s.selection.scrollIntoView(e[0]))},hideFakeCaret:v,destroy:function(){d.destroy(),l=null}}}function Sh(e,t,n){var r,i,o=1,a=e.getShortEndedElements(),s=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(s.lastIndex=r=n;i=s.exec(t);){if(r=s.lastIndex,"/"===i[1])o--;else if(!i[1]){if(i[2]in a)continue;o++}if(0===o)break}return r}var Eh,Lh=function(e){var t=e.getBoundingClientRect(),e=e.ownerDocument,n=e.documentElement,e=e.defaultView;return{top:t.top+e.pageYOffset-n.clientTop,left:t.left+e.pageXOffset-n.clientLeft}},Nh=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},t={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:t},Rh=function(e,t){return i=(i=e).inline?Lh(i.getBody()):{left:0,top:0},r=(n=e).getBody(),n=n.inline?{left:r.scrollLeft,top:r.scrollTop}:{left:0,top:0},r=e,{pageX:(t=(e=t).target.ownerDocument!==r.getDoc()?(t=Lh(r.getContentAreaContainer()),r=Nh(r),{left:e.pageX-t.left+r.left,top:e.pageY-t.top+r.top}):{left:e.pageX,top:e.pageY}).left-i.left+n.left,pageY:t.top-i.top+n.top};var n,r,i},Ah=Q.isContentEditableFalse,Ph=Q.isContentEditableTrue,Oh=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Ih=function(o,a){return function(e){var t,n,r,i;0===e.button&&(n=y.find(a.dom.getParents(e.target),ga.or(Ah,Ph)),r=a.getBody(),Ah(i=n))&&i!==r&&(i=a.dom.getPos(n),r=a.getBody(),t=a.getDoc().documentElement,o.element=n,o.screenX=e.screenX,o.screenY=e.screenY,o.maxX=(a.inline?r.scrollWidth:t.offsetWidth)-2,o.maxY=(a.inline?r.scrollHeight:t.offsetHeight)-2,o.relX=e.pageX-i.x,o.relY=e.pageY-i.y,o.width=n.offsetWidth,o.height=n.offsetHeight,o.ghost=(r=a,t=n,e=o.width,i=o.height,t=t.cloneNode(!0),r.dom.setStyles(t,{width:e,height:i}),r.dom.setAttrib(t,"data-mce-selected",null),n=r.dom.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"}),r.dom.setStyles(n,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:e,height:i}),r.dom.setStyles(t,{margin:0,boxSizing:"border-box"}),n.appendChild(t),n))}},Yh=function(u,c){var d=tt.throttle(function(e,t){c._selectionOverrides.hideFakeCaret(),c.selection.placeCaretAt(e,t)},0);return function(e){var t,n,r,i,o,a,s,l=Math.max(Math.abs(e.screenX-u.screenX),Math.abs(e.screenY-u.screenY));if(u.element&&!u.dragging&&10n&&(i=s.pageX+l-n),s.pageY+t>r&&(o=s.pageY+t-r),a.style.width=l-i+"px",a.style.height=t-o+"px",d(e.clientX,e.clientY))}},Fh=function(o,a){return function(e){var t,n,r,i;o.dragging&&(r=function(e){e=e.getSel().getRangeAt(0).startContainer;return 3===e.nodeType?e.parentNode:e}((n=a).selection),i=o.element,r===i||n.dom.isChildOf(r,i)||Ah(r)||(t=function(e){e=e.cloneNode(!0);return e.removeAttribute("data-mce-selected"),e}(o.element),(n=a.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY})).isDefaultPrevented())||(t=n.targetClone,a.undoManager.transact(function(){Oh(o.element),a.insertContent(a.dom.getOuterHTML(t)),a._selectionOverrides.hideFakeCaret()}))),hh(o)}},Bh=function(e,t){return function(){e.dragging&&t.fire("dragend"),hh(e)}},Hh={init:function(e){var t,n,r,i,o,a,s,l,u;t=e,n={},r=m.DOM,i=document,o=Ih(n,t),a=Yh(n,t),s=Fh(n,t),l=Bh(n,t),t.on("mousedown",o),t.on("mousemove",a),t.on("mouseup",s),r.bind(i,"mousemove",a),r.bind(i,"mouseup",l),t.on("remove",function(){r.unbind(i,"mousemove",a),r.unbind(i,"mouseup",l)}),(u=e).on("drop",function(e){var t=void 0!==e.clientX?u.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ah(t)||Ah(u.dom.getContentEditableParent(t)))&&e.preventDefault()})}},jh=function(t){function e(e){return y.map(e,function(e){return(e=ua(e)).node=t,e})}var n;return Q.isElement(t)?e(t.getClientRects()):Q.isText(t)?((n=t.ownerDocument.createRange()).setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())):void 0},Uh=((ge=Eh=Eh||{})[ge.Up=-1]="Up",ge[ge.Down=1]="Down",v.curry(vh,Eh.Up,Ro,Ao)),zh=v.curry(vh,Eh.Down,Ao,Ro),$h=Q.isContentEditableFalse,Wh=kl,qh=function(e,t,n){var r=gh(y.filter(y.toArray(e.getElementsByTagName("*")),ml)),r=y.filter(r,function(e){return n>=e.top&&n<=e.bottom}),r=kh(r,t);return(r=r&&kh(Mh(e,r),t))&&ml(r.node)?(e=t,{node:(t=r).node,before:wh(t,e)=(t=t).left&&n<=t.right&&e>=t.top&&e<=t.bottom);var n},!1)}},Gh=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))}}},Xh={setup:function(t){var e=Gh(function(){var e;t.removed||t.selection.getRng().collapsed&&(e=Ba(t,t.selection.getRng(),!1),t.selection.setRng(e))},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})}},j={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 V.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Kh=Q.isContentEditableTrue,Jh=Q.isContentEditableFalse,Qh=Nl,Zh=Ll,eg=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Kh(t)||Jh(t))return t;t=t.parentNode}return null};function tg(F,B){void 0===B&&(B=so());function e(){}!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var H=F.comment||e,j=F.cdata||e,U=F.text||e,z=F.start||e,$=F.end||e,W=F.pi||e,q=F.doctype||e;return{parse:function(e){for(var t,n,r,s,i,o,a,l,u,c,d,f,p,m,h,g,v,y,b,_=0,w=[],x=0,C=Ji.decode,k=K.makeMap("src,href,data,background,formaction,poster,xlink:href"),T=/((java|vb)script|mhtml):/i,M=function(e){for(var t,n=w.length;n--&&w[n].name!==e;);if(0<=n){for(t=w.length-1;n<=t;t--)(e=w[t]).valid&&$(e.name);w.length=n}},D=function(e,t,n,r,i){var o,a;if(n=(t=t.toLowerCase())in R?t:C(n||r||i||""),A&&!l&&!1==(0===(r=t).indexOf("data-")||0===r.indexOf("aria-"))){if(!(o=m[t])&&h){for(a=h.length;a--&&!(o=h[a]).pattern.test(t););-1===a&&(o=null)}if(!o)return;if(o.validValues&&!(n in o.validValues))return}if(k[t]&&!F.allow_script_urls){var i=n.replace(/[\s\u0000-\u001F]+/g,"");try{i=decodeURIComponent(i)}catch(e){i=unescape(i)}if(T.test(i))return;if(r=i,!(i=F).allow_html_data_urls&&(/^data:image\//i.test(r)?!1===i.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(r):/^data:/i.test(r)))return}l&&(t in k||0===t.indexOf("on"))||(s.map[t]=n,s.push({name:t,value:n}))},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"),E=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,L=B.getShortEndedElements(),N=F.self_closing_elements||B.getSelfClosingElements(),R=B.getBoolAttrs(),A=F.validate,P=F.remove_internals,O=F.fix_self_closing,I=B.getSpecialElements(),Y=e+">";t=S.exec(Y);){if(_e.length){U(C(e.substr(t.index))),_=t.index+t[0].length;continue}if(u=(n=":"===(n=n.toLowerCase()).charAt(0)?n.substr(1):n)in L,O&&N[n]&&0"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),H(n)):(n=t[2])?j(n.replace(//g,"")):(n=t[3])?q(n):(n=t[4])&&W(n,t[5]);_=t.index+t[0].length}for(_]*data-mce-bogus="all"[^>]*>/g,s=e.schema,o=function(e,t){e=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(e,"")}(e.getTempAttrs(),o),l=s.getShortEndedElements();i=a.exec(o);)n=a.lastIndex,r=i[0].length,i=l[i[1]]?n:sg.findEndTag(s,o,n),o=o.substring(0,n-r)+o.substring(i),a.lastIndex=n-r;return h.trim(o)}function rg(e){return Q.isElement(e)?e.outerHTML:Q.isText(e)?Ji.encodeRaw(e.data,!1):Q.isComment(e)?"\x3c!--"+e.data+"--\x3e":""}function ig(e){return e.dom().innerHTML}function og(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}}function ag(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}}var sg=tg,lg={trimExternal:ng,trimInternal:ng},ug={KEEP:0,DELETE:2,INSERT:1,diff:function(m,h){function u(e,t,n,r,i){var o=function(e,t,n,r){var i=t-e,o=r-n;if(i===0||o===0)return null;var a=i-o,s=o+i,l=(s%2===0?s:s+1)/2,u,c,d,f,p;for(g[1+l]=e,v[1+l]=t+1,u=0;u<=l;++u){for(c=-u;c<=u;c+=2){d=c+l;if(c===-u||c!==u&&g[d-1]=e&&p>=n&&m[f]===h[p]){v[d]=f--;p--}if(a%2===0&&-u<=c&&c<=u)if(v[d]<=g[d+a])return y(v[d],c+e-n,t,r)}}}(e,t,n,r);if(null===o||o.start===t&&o.diag===t-r||o.end===e&&o.diag===e-n)for(var a=e,s=n;a")?og(e):ag(n)},applyToEditor:function(e,t,n){"fragmented"===t.type?pg(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},isEq:function(e,t){return!(!e||!t)&&(n=t,yg(e)===yg(n)||(n=t,bg(e)===bg(n)));var n}};function wg(o){function a(e){o.setDirty(e)}function r(e){f(!1),l.add({},e)}function t(){l.typing&&(f(!1),l.add())}var s,i,l=this,u=0,c=[],n=0,d=function(){return 0===n},f=function(e){d()&&(l.typing=e)};o.on("init",function(){l.add()}),o.on("BeforeExecCommand",function(e){e=e.command;"Undo"!==e&&"Redo"!==e&&"mceRepaint"!==e&&(t(),l.beforeChange())}),o.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&r(e)}),o.on("ObjectResizeStart Cut",function(){l.beforeChange()}),o.on("SaveContent ObjectResized blur",r),o.on("DragEnd",r),o.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(r(),o.nodeChanged()),46!==t&&8!==t||o.nodeChanged(),i&&l.typing&&!1===_g.isEq(_g.createFromEditor(o),c[0])&&(!1===o.isDirty()&&(a(!0),o.fire("change",{level:c[0],lastLevel:null})),o.fire("TypingUndo"),i=!1,o.nodeChanged()))}),o.on("KeyDown",function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?l.typing&&r(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20r.custom_undo_redo_levels){for(n=0;n ").append(e.childNodes)}))},av[r="pre"]||(av[r]=[]),av[r].push(_e);function uv(e){return/^(TH|TD)$/.test(e.nodeName)}function cv(e,t,n){var r,i=t[n?"startContainer":"endContainer"],t=t[n?"startOffset":"endOffset"];return Q.isElement(i)&&(r=i.childNodes.length-1,!n&&t&&t--,i=i.childNodes[r=i.nodeValue.length&&(i=new J(i,e.getBody()).next()||i),i=Q.isText(i)&&!n&&0===t?new J(i,e.getBody()).prev()||i:i}function dv(e,t,n){var r,i,o=new Cu(e);if(t&&n&&(t=Sv(t,"previousSibling"),n=Sv(n,"nextSibling"),o.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(i=r).nextSibling,t.appendChild(i);return e.remove(n),K.each(K.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n}function fv(n,e){return v.curry(function(e,t){return!(!t||!E.getStyle(n,t,e))},e)}function pv(r,e,t){return v.curry(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),Lv(r,n)},e,t)}function mv(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=E.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))}function hv(m,h,g,r){function v(n,e){var t;e=e||_,n&&(e.onformat&&e.onformat(n,e,g,r),Yv(e.styles,function(e,t){p.setStyle(n,t,E.replaceVars(e,g))}),e.styles&&(t=p.getAttrib(n,"style"))&&n.setAttribute("data-mce-style",t),Yv(e.attributes,function(e,t){p.setAttrib(n,t,E.replaceVars(e,g))}),Yv(e.classes,function(e){e=E.replaceVars(e,g),p.hasClass(n,e)||p.addClass(n,e)}))}function y(e,t){var n=!1;return!!_.selector&&(Yv(e,function(e){return!("collapsed"in e&&e.collapsed!==f)&&p.is(t,e.selector)&&!mu(t)?(v(t,e),!(n=!0)):void 0}),n)}function e(l,e,t,u){var c=[],d=!0,f=_.inline||_.block,p=l.create(f);v(p),yv(l,e,function(e){var a,s=function(e){var t,n=d,r=e.nodeName.toLowerCase(),i=e.parentNode.nodeName.toLowerCase();if(1===e.nodeType&&l.getContentEditable(e)&&(n=d,d="true"===l.getContentEditable(e),t=!0),E.isEq(r,"br"))a=0,_.block&&l.remove(e);else if(_.wrapper&&Xg.matchNode(m,e,h,g))a=0;else if(d&&!t&&_.block&&!_.wrapper&&E.isTextBlock(m,r)&&E.isValid(m,i,f))e=l.rename(e,f),v(e),c.push(e),a=0;else{if(_.selector){var o=y(b,e);if(!_.inline||o)return void(a=0)}!d||t||!E.isValid(m,f,r)||!E.isValid(m,i,f)||!u&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||mu(e)||_.inline&&l.isBlock(e)?(a=0,Yv(K.grep(e.childNodes),s),t&&(d=n),a=0):(a||(a=l.clone(p,!1),e.parentNode.insertBefore(a,e),c.push(a)),a.appendChild(e))}};Yv(e,s)}),!0===_.links&&Yv(c,function(e){var t=function(e){"A"===e.nodeName&&v(e,_),Yv(K.grep(e.childNodes),t)};t(e)}),Yv(c,function(e){var t,n,r,i=function(e){var n=!1;return Yv(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!wu.isBookmarkNode(t)&&!mu(t)&&!Q.isBogus(t))return n=e,!1;var t}),n};t=0,Yv(e.childNodes,function(e){E.isWhiteSpaceNode(e)||wu.isBookmarkNode(e)||t++}),n=t,(1=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===c&&0p.length-1?f=p.length-1:f<0&&(f=0),u=p[f]||d),r===u)return i(m([r]));for(n=e.findCommonAncestor(r,u),o=r;o;o=o.parentNode){if(o===u)return g(r,n,!0);if(o===n)break}for(o=u;o;o=o.parentNode){if(o===r)return g(u,n);if(o===n)break}p=t(r,n)||r,f=t(u,n)||u,g(r,p,!0),(s=h(p===r?p:p.nextSibling,"nextSibling",f===u?f.nextSibling:f)).length&&i(m(s)),g(u,f)}},bv=/^(src|href|style)$/,_v=K.each,wv=E.isEq,xv=function(e,t,n,r){e=e.create(n,r);return t.parentNode.insertBefore(e,t),e.appendChild(t),e},Cv=function(e,t,n,r){return!(t=E.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},kv=function(e,n,r,i,o){var t,a,s,l,u,c,d,f,p,m,h=e.dom;if(f=h,!(wv(c=i,(u=n).inline)||wv(c,u.block)||(u.selector?Q.isElement(c)&&f.is(c,u.selector):void 0)||(f=i,n.links&&"A"===f.tagName)))return!1;if("all"!==n.remove)for(_v(n.styles,function(e,t){e=E.normalizeStyleValue(h,E.replaceVars(e,r),t),"number"==typeof t&&(t=e,o=0),!n.remove_similar&&o&&!wv(E.getStyle(h,o,t),e)||h.setStyle(i,t,""),s=1}),s&&""===h.getAttrib(i,"style")&&(i.removeAttribute("style"),i.removeAttribute("data-mce-style")),_v(n.attributes,function(e,t){var n;e=E.replaceVars(e,r),"number"==typeof t&&(t=e,o=0),o&&!wv(h.getAttrib(o,t),e)||("class"===t&&(e=h.getAttrib(i,t))&&(n="",_v(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n)?h.setAttrib(i,t,n):("class"===t&&i.removeAttribute("className"),bv.test(t)&&i.removeAttribute("data-mce-"+t),i.removeAttribute(t)))}),_v(n.classes,function(e){e=E.replaceVars(e,r),o&&!h.hasClass(o,e)||h.removeClass(i,e)}),a=h.getAttribs(i),t=0;t)\s*/g,"$1"),K.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var e=K.map(e.split(/(?:~\+|~|\+)/),Vv),t=e.pop();return e.length&&(t.siblings=e),t}).reverse()):[]}var Wv=K.each,qv=m.DOM,Vv=function(e){var t,o={classes:[],attrs:{}};return"*"!==(e=o.selector=K.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,i){switch(t){case"#":o.attrs.id=n;break;case".":o.classes.push(n);break;case":":-1!==K.inArray("checked disabled enabled read-only required".split(" "),n)&&(o.attrs[n]=n)}return"["===r&&(t=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/))&&(o.attrs[t[1]]=t[2]),""})),o.name=t||"div",o},Gv={getCssText:function(n,e){var t,r,i,o,a="",s=n.settings.preview_styles;if(!1===s)return"";"string"!=typeof s&&(s="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");function l(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===(s=e.preview)?"":(t=e.block||e.inline||"span",i=(i=$v(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,zv(i,n)):zv([t],n),r=qv.select(t,i)[0]||i.firstChild,Wv(e.styles,function(e,t){(e=l(e))&&qv.setStyle(r,t,e)}),Wv(e.attributes,function(e,t){(e=l(e))&&qv.setAttrib(r,t,e)}),Wv(e.classes,function(e){e=l(e),qv.hasClass(r,e)||qv.addClass(r,e)}),n.fire("PreviewFormats"),qv.setStyles(i,{position:"absolute",left:-65535}),n.getBody().appendChild(i),o=qv.getStyle(n.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Wv(s.split(" "),function(e){var t=qv.getStyle(r,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=qv.getStyle(n.getBody(),e,!0),"#ffffff"===qv.toHex(t).toLowerCase())||"color"===e&&"#000000"===qv.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===o)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*o+"px"}"border"===e&&t&&(a+="padding:0 2px;"),a+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),qv.remove(i),a)},parseSelector:$v,selectorToHtml:function(e,t){return zv($v(e),t)}},Xv={toggle:function(e,t,n,r,i){t=t.get(n);!Xg.match(e,n,r,i)||"toggle"in t[0]&&!t[0].toggle?Fv.applyFormat(e,n,r,i):Tv.remove(e,n,r,i)}},Kv={setup: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 Jv(e){var t=Uv(e),n=dl(null);return Kv.setup(e),ov(e),{get:t.get,register:t.register,unregister:t.unregister,apply:v.curry(Fv.applyFormat,e),remove:v.curry(Tv.remove,e),toggle:v.curry(Xv.toggle,e,t),match:v.curry(Xg.match,e),matchAll:v.curry(Xg.matchAll,e),matchNode:v.curry(Xg.matchNode,e),canApply:v.curry(Xg.canApply,e),formatChanged:v.curry(Hv.formatChanged,e,n),getCssText:v.curry(Gv.getCssText,e)}}function Qv(a){return function(){for(var e=new Array(arguments.length),t=0;t)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};o--;)r=(n=e[o]).firstChild?n.firstChild.value:"","script"===t?((i=n.attr("type"))&&n.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===l.element_format&&0")):"xhtml"===l.element_format&&0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return ol.scrollElementIntoView(s,e,t)},placeCaretAt:function(e,t){return i(gb.fromPoint(e,t,s.getDoc()))},getBoundingClientRect:function(){var e=n();return e.collapsed?k.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){o=u=c=null,h.destroy()}},m=cb(p),h=pb(p,s);return p.bookmarkManager=m,p.controlSelection=h,p}function jy(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function Uy(e,t,n,r){var i,o,a=e===Ns.Forwards,s=a?Wb:$b;return!r.collapsed&&(o=zb(r),Ub(o))?Fa(e,t,o,e===Ns.Backwards,!0):(o=zo(r.startContainer),s(i=ps(e,t.getBody(),r))?qs(t,i.getNode(!a)):(i=n(i))?s(i)?Fa(e,t,i.getNode(!a),a,!0):s(s=n(i))&&function(e,t){t=Tl(e,t);return!(t||!Q.isBr(e.getNode()))||t}(i,s)?Fa(e,t,s.getNode(!a),a,!0):o?Ba(t,i.toRange(),!0):null:o?r:null)}function zy(e,t,n){var r,i=ql(e.getBody()),o=ga.curry(jy,i.next),i=ga.curry(jy,i.prev);n.collapsed&&e.settings.forced_root_block&&(r=e.dom.getParent(n.startContainer,"PRE"))&&!(1===t?o:i)(k.fromRangeStart(n))&&(o=function(e){e=e.dom.create(e.settings.forced_root_block);return(!V.ie||11<=V.ie)&&(e.innerHTML=' '),e}(e),1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}function $y(e,t){var n,r,i,o,a,s,l=t?1:-1,t=t?zh:Uh,u=e.selection.getRng();return n=l,r=e,t=t,a=zb(i=u),i=ps(n,r.getBody(),i),t=t(r.getBody(),bh(1),i),t=y.filter(t,_h(1)),s=y.last(i.getClientRects()),(Wb(i)||Rl(i))&&(a=i.getNode()),($b(i)||Al(i))&&(a=i.getNode(!0)),(o=s?(i=s.left,(s=kh(t,i))&&Ub(s.node)?(t=Math.abs(i-s.left),o=Math.abs(i-s.right),Fa(n,r,s.node,t'}function Jy(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t}function Qy(e,t){return e_.getParentBlock(e).filter(function(e){return 0F(r)?(w=S(_*y),_=S(w/y)):(_=S(w/y),w=S(_*y))),k.setStyles(R(u),{width:_,height:w}),e=d.startPos.x+n,t=d.startPos.y+r,k.setStyles(c,{left:e=0e?t.cells().length:e},0)},Mb=function(e,t,n,r,i){for(var o=[],a=e.rows(),s=n;s<=i;s++){var l=a[s].cells(),l=t"+(n.item?n.item(0).outerHTML:n.htmlText),r.removeChild(r.firstChild)):r.innerHTML=n.toString(),t.getInner=!0,o=e.selection.serializer.serialize(r,t),"tree"===t.format)return o;t.content=e.selection.isCollapsed()?"":o}return e.fire("GetContent",t),t.content}},Ab={setContent:function(e,t,n){var r,i,o=e.selection.getRng(),a=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,!n.no_events&&(n=e.fire("BeforeSetContent",n)).isDefaultPrevented())e.fire("SetContent",n);else{if(t=n.content,o.insertNode){t+='_ ',o.startContainer===a&&o.endContainer===a||(o.deleteContents(),0===a.body.childNodes.length)?a.body.innerHTML=t:o.createContextualFragment?o.insertNode(o.createContextualFragment(t)):(r=a.createDocumentFragment(),i=a.createElement("div"),r.appendChild(i),i.outerHTML=t,o.insertNode(r)),i=e.dom.get("__caret"),(o=a.createRange()).setStartBefore(i),o.setEndBefore(i),e.selection.setRng(o),e.dom.remove("__caret");try{e.selection.setRng(o)}catch(e){}}else o.item&&(a.execCommand("Delete",!1,null),o=e.getRng()),/^\s+/.test(t)?(o.pasteHTML('_ '+t),e.dom.remove("__mce_tmp")):o.pasteHTML(t);n.no_events||e.fire("SetContent",n)}}},Pb=function(e,t,n){return Yy(e,t,!0,n,function(e,t){return Math.min(c.childNodesCount(e),t)})},Ob=function(e,t,n){return Yy(e,t,!1,n,function(e,t){return 0l.childNodes.length-1,l=l.childNodes[Math.min(o,l.childNodes.length-1)]||l,o=m&&Q.isText(l)?l.nodeValue.length:0),s=s_(v,l))if((p&&!g||!p&&g)&&(l=function(e,t,n,r,i){var o,a,s,l,t=t||"P",u=e.dom,c=s_(u,r),d=u.getParent(r,u.isBlock);if(!d||!o_(u,d)){if(c=((d=d||c)===e.getBody()||i_(d)?d:d.parentNode).nodeName.toLowerCase(),!d.hasChildNodes())return o=u.create(t),l_(e,o),d.appendChild(o),n.setStart(o,0),n.setEnd(o,0),o;for(s=r;s.parentNode!==d;)s=s.parentNode;for(;s&&!u.isBlock(s);)s=(a=s).previousSibling;if(a&&e.schema.isValidChild(c,t.toLowerCase())){for(o=u.create(t),l_(e,o),a.parentNode.insertBefore(o,a),s=a;s&&!u.isBlock(s);)l=s.nextSibling,o.appendChild(s),s=l;n.setStart(r,i),n.setEnd(r,i)}}return r}(a,p,_,l,o)),u=v.getParent(l,v.isBlock),c=u?v.getParent(u.parentNode,v.isBlock):null,d=u?u.nodeName.toUpperCase():"","LI"!==(f=c?c.nodeName.toUpperCase():"")||e.ctrlKey||(c=(u=c).parentNode,d=f),/^(LI|DT|DD)$/.test(d)&&v.isEmpty(u))n_(a,t,c,u,p);else if(!p||u!==a.getBody()){if(p=p||"P",zo(u))i=Ko(u),v.isEmpty(u)&&Ky(u),e_.moveToCaretPosition(a,i);else if(n())r();else if(n(!0))i=u.parentNode.insertBefore(t(),u),e_.moveToCaretPosition(a,Jy(u,"HR")?i:u);else{(e=(g=_).cloneRange()).setStart(g.startContainer,a_(!0,g.startContainer,g.startOffset)),e.setEnd(g.endContainer,a_(!1,g.endContainer,g.endOffset)),(g=e.cloneRange()).setEndAfter(u);for(var w=e=g.extractContents();Q.isText(w)&&(w.nodeValue=w.nodeValue.replace(/^[\r\n]+/,"")),w=w.firstChild;);i=e.firstChild,v.insertAfter(e,u),!function(e,t,n){var r,i=n,o=[];if(i){for(;i=i.firstChild;){if(e.isBlock(i))return;Q.isElement(i)&&!t[i.nodeName.toLowerCase()]&&o.push(i)}for(r=o.length;r--;)(!(i=o[r]).hasChildNodes()||i.firstChild===i.lastChild&&""===i.firstChild.nodeValue||r_(i))&&e.remove(i)}}(v,b,i),g=v,(e=u).normalize(),(h=e.lastChild)&&!/^(left|right)$/gi.test(g.getStyle(h,"float",!0))||g.add(e,"br"),v.isEmpty(u)&&Ky(u),i.normalize(),v.isEmpty(i)?(v.remove(i),r()):e_.moveToCaretPosition(a,i)}v.setAttrib(i,"id",""),a.fire("NewBlock",{newBlock:i})}},c_={shouldInsertBr:function(e){return Qy(e,T.getBrNewLineSelector(e))},shouldBlockNewLine:function(e){return Qy(e,T.getNoNewLineSelector(e))}},d_=we([{br:[]},{block:[]},{none:[]}]),f_=function(n,r){return function(e,t){return e_.getParentBlockName(e)===n.toUpperCase()===r}},p_=function(e,t){return uf([sb([Zy],d_.none()),sb([f_("summary",!0)],d_.br()),sb([nb(!0),rb(!1),ob],d_.br()),sb([nb(!0),rb(!1)],d_.block()),sb([nb(!0),rb(!0),ob],d_.block()),sb([nb(!0),rb(!0)],d_.br()),sb([tb(!0),ob],d_.br()),sb([tb(!0)],d_.block()),sb([eb(!0),ob,ab],d_.block()),sb([eb(!0)],d_.br()),sb([ib],d_.br()),sb([eb(!1),ob],d_.br()),sb([ab],d_.block())],[e,t.shiftKey]).getOr(d_.none())},m_={insert:function(e,t){p_(e,t).fold(function(){gp.insert(e,t)},function(){u_(e,t)},v.noop)}},h_=function(e){e.typing&&(e.typing=!1,e.add())},g_=function(r){r.on("keydown",function(e){var t,n;e.keyCode===j.ENTER&&(t=r,(n=e).isDefaultPrevented()||(n.preventDefault(),h_(t.undoManager),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),m_.insert(t,n)})))})},v_=function(e,t,n){return!!lb(n,t)&&(n=e,t=(e=t).container(),e=e.offset(),t.insertData(e," "),n.selection.setCursorLocation(t,e+1),!0)},y_={insertAtSelection:function(e){return!!e.selection.isCollapsed()&&(e=e,t=v.curry(S.isInlineTarget,e),n=k.fromRangeStart(e.selection.getRng()),bf.readLocation(t,e.getBody(),n).map(v.curry(v_,e,n)).getOr(!1));var t,n}},b_=function(n){n.on("keydown",function(e){var t;!1===e.isDefaultPrevented()&&(t=e,a.execute([{keyCode:j.SPACEBAR,action:a.action(y_.insertAtSelection,n)}],t).each(function(e){t.preventDefault()}))})},__=function(e){return yd.descendant(H.fromDom(e.getBody()),"*[data-mce-caret]").fold(v.constant(null),function(e){return e.dom()})},w_=function(e,t){t.hasAttribute("data-mce-caret")&&(Ko(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))},x_=function(e){e.on("keyup compositionstart",v.curry(ub,e))},C_=function(e){var t=kf.setupSelectedState(e);x_(e),Gb(e,t),Zb(e,t),g_(e),b_(e)};function k_(o){function e(e,t){try{o.getDoc().execCommand(e,!1,t)}catch(e){}}function a(e){return e.isDefaultPrevented()}function t(){o.shortcuts.add("meta+a",null,"SelectAll")}function n(){function n(){var e=p.getAttribs(m.getStart().cloneNode(!1));return function(){var t=m.getStart();t!==o.getBody()&&(p.setAttrib(t,"style",null),c(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function r(){return!m.isCollapsed()&&p.getParent(m.getStart(),p.isBlock)!==p.getParent(m.getEnd(),p.isBlock)}o.on("keypress",function(e){var t;if(!a(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),o.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),p.bind(o.getDoc(),"cut",function(e){var t;!a(e)&&r()&&(t=n(),tt.setEditorTimeout(o,function(){t()}))})}function r(){o.on("keydown",function(e){if(!a(e)&&e.keyCode===d&&m.isCollapsed()&&0===m.getRng().startOffset){var t=m.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function i(){h.readonly||o.on("BeforeExecCommand MouseDown",function(){e("StyleWithCSS",!1),e("enableInlineTableEditing",!1),h.object_resizing||e("enableObjectResizing",!1)})}function s(){o.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||c(p.select("a"),function(e){var t=e.parentNode,n=p.getRoot();if(t.lastChild===e){for(;t&&!p.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}p.add(t,"br",{"data-mce-bogus":1})}})})}function l(){o.inline||(o.contentStyles.push("body {min-height: 150px}"),o.on("click",function(e){"HTML"===e.target.nodeName&&(11',"TABLE"===o.nodeName?i=""+r+" ":/^(UL|OL)$/.test(o.nodeName)&&(i=""+r+" "),i=(e=T.getForcedRootBlock(n))&&n.schema.isValidChild(o.nodeName.toLowerCase(),e.toLowerCase())?n.dom.createHTML(e,n.settings.forced_root_block_attrs,i=r):i||' ',x0(n,i),n.fire("SetContent",t)):("raw"!==t.format&&(i=Iu({validate:n.validate},n.schema).serialize(n.parser.parse(i,{isRootContent:!0,insert:!0}))),t.content=Bi(H.fromDom(o))?i:K.trim(i),x0(n,t.content),t.no_events||n.fire("SetContent",t)),t.content);var t,n,r,i,o})}function A_(e){p.from(e).each(function(e){return e.destroy()})}function P_(e){var t,n,r,i;e.removed||(t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),i=e.getElement(),r&&e.save(),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&i&&C0.remove(i.nextSibling),!e.inline&&r&&C0.setStyle(e.id,"display",e.orgDisplay),em.fireRemove(e),e.editorManager.remove(e),C0.remove(e.getContainer()),A_(t),A_(n),e.destroy())}function O_(e,t){var n=e.selection,r=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),A_(n),A_(r)),(n=(t=e).formElement)&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),C0.unbind(n,"submit reset",t.formEventDelegate)),(r=e).contentAreaContainer=r.formElement=r.container=r.editorContainer=null,r.bodyElement=r.contentDocument=r.contentWindow=null,r.iframeElement=r.targetElm=null,r.selection&&(r.selection=r.selection.win=r.selection.dom=r.selection.dom.doc=null),e.destroyed=!0):e.remove())}function I_(e,t,n){var r=this,i=r.documentBaseUrl=n.documentBaseURL,o=n.baseURI;t=function(e,t,n,r,i){t=pd(t,n,e);return md(cd,t,r,i)}(r,e,i,n.defaultSettings,t),r.settings=t,To.language=t.language||"en",To.languageLoad=t.language_load,To.baseURL=n.baseURL,r.id=e,r.setDirty(!1),r.plugins={},r.documentBaseURI=new S_(t.document_base_url,{base_uri:o}),r.baseURI=o,r.contentCSS=[],r.contentStyles=[],r.shortcuts=new cm(r),r.loadedCSS={},r.editorCommands=new Ap(r),r.suffix=n.suffix,r.editorManager=n,r.inline=t.inline,r.buttons={},r.menuItems={},t.cache_suffix&&(V.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(V.overrideViewPort=!1),n.fire("SetupEditor",{editor:r}),r.execCallback("setup",r),r.$=X.overrideDefaults(function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}})}function Y_(e){return E0.isEditorUIElement(e)}function F_(n,e){e=e.editor,A0.register(e),e.on("focusin",function(){var e=n.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),n.setActive(this),(n.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),e.on("focusout",function(){var t=this;tt.setEditorTimeout(t,function(){var e=n.focusedEditor;O0(t,I0())||e!==t||(t.fire("blur",{focusedEditor:null}),n.focusedEditor=null)})}),U_||(U_=function(e){var t=n.activeEditor,e=e.target;t&&e.ownerDocument===document&&e!==document.body&&!O0(t,e)&&n.focusedEditor===t&&(t.fire("blur",{focusedEditor:null}),n.focusedEditor=null)},P0.bind(document,"focusin",U_))}function B_(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(P0.unbind(document,"focusin",U_),U_=null)}function H_(t){z0(K0.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})}function j_(e){e!==q0&&(e?X(window).on("resize scroll",H_):X(window).off("resize scroll",H_),q0=e)}var U_,z_,$_=function(e){return Q.isElement(e)&&Ai(H.fromDom(e))},W_=function(o){o.on("click",function(e){var t,n,r,i;3===e.detail&&(n=(e=o).selection.getRng(),r=g.fromRangeStart(n),i=g.fromRangeEnd(n),g.isElementPosition(r)&&(t=r.container(),$_(t))&&C.firstPositionIn(t).each(function(e){return n.setStart(e.container(),e.offset())}),g.isElementPosition(i)&&(t=r.container(),$_(t))&&C.lastPositionIn(t).each(function(e){return n.setEnd(e.container(),e.offset())}),e.selection.setRng(Bu.normalize(n)))})},q_=function(t){t.on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()})},V_=function(e){e.parser.addNodeFilter("details",function(e){b.each(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),e.serializer.addNodeFilter("details",function(e){b.each(e,function(e){var t=e.attr("data-mce-open");e.attr("open",l.isString(t)?t:null),e.attr("data-mce-open",null)})})},G_=m.DOM,X_=function(t){t.settings.auto_focus&&tt.setEditorTimeout(t,function(){var e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus);e.destroyed||e.focus()},100)},K_=function(t,e){var n,s,r=t.settings,i=t.getElement(),o=t.getDoc();r.inline||(t.getElement().style.visibility=t.orgVisibility),e||r.content_editable||(o.open(),o.write(t.iframeHTML),o.close()),r.content_editable&&(t.on("remove",function(){var e=this.getBody();G_.removeClass(e,"mce-content-body"),G_.removeClass(e,"mce-edit-focus"),G_.setAttrib(e,"contentEditable",null)}),G_.addClass(i,"mce-content-body"),t.contentDocument=o=r.content_document||document,t.contentWindow=r.content_window||window,t.bodyElement=i,r.content_document=r.content_window=null,r.root_name=i.nodeName.toLowerCase()),(e=t.getBody()).disabled=!0,t.readonly=r.readonly,t.readonly||(t.inline&&"static"===G_.getStyle(e,"position",!0)&&(e.style.position="relative"),e.contentEditable=t.getParam("content_editable_state",!0)),e.disabled=!1,t.editorUpload=nh(t),t.schema=so(r),t.dom=m(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:r.content_editable,schema:t.schema,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((i=xy((s=t).settings,s.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,i,o=e.length,a=s.dom;o--;)r=(n=e[o]).attr(t),n.attributes.map[i="data-mce-"+t]||0!==r.indexOf("data:")&&0!==r.indexOf("blob:")&&("style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(i,r),n.attr(t,r)):"tabindex"===t?(n.attr(i,r),n.attr(t,null)):n.attr(i,s.convertURL(r,t,n.name)))}),i.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)}),i.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=s.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new uy("br",1)).shortEnded=!0)}),i),t.serializer=Ey(r,t),t.selection=Hy(t.dom,t.getWin(),t.serializer,t),t.formatter=Jv(t),t.undoManager=wg(t),t._nodeChangeDispatcher=new mh(t),t._selectionOverrides=Dh(t),q_(i=t),V_(i),W_(t),C_(t),dh(t),t.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(o.body.spellcheck=!1,G_.setAttrib(e,"spellcheck","false")),t.quirks=k_(t),t.fire("PostRender"),r.directionality&&(e.dir=r.directionality),r.nowrap&&(e.style.whiteSpace="nowrap"),r.protect&&t.on("BeforeSetContent",function(t){K.each(r.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";return T.getDocumentBaseUrl(e)!==e.documentBaseUrl&&(r+=' '),r+=' ',t=T.getBodyId(e),n=T.getBodyClass(e),T.getContentSecurityPolicy(e)&&(r+=' '),r+=' '},t0=function(e,t){o=t,r=(n=e).editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),(i=Z_(n.id,r,o.height,T.getIframeAttrs(n)).dom()).onload=function(){i.onload=null,n.fire("load")},r=Q_(n,i),n.contentAreaContainer=o.iframeContainer,n.iframeElement=i,n.iframeHTML=e0(n),J_.add(o.iframeContainer,i);var n,r,i,o=r;t.editorContainer&&(J_.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=J_.isHidden(t.editorContainer)),e.getElement().style.display="none",J_.setAttrib(e.id,"aria-hidden","true"),o||K_(e)},n0=m.DOM,r0=function(t,n,e){var r=Fm.get(e),i=Fm.urls[e]||t.documentBaseUrl.replace(/\/$/,"");e=K.trim(e),r&&-1===K.inArray(n,e)&&(K.each(Fm.dependencies(e),function(e){r0(t,n,e)}),t.plugins[e]||(r=new r(t,i,t.$),(t.plugins[e]=r).init&&(r.init(t,i),n.push(e))))},i0=function(e){return e.replace(/^\-/,"")},o0=function(e){var t=e.settings,n=e.getElement(),r=t.width||n0.getStyle(n,"width")||"100%",i=t.height||n0.getStyle(n,"height")||n.offsetHeight,o=t.min_height||100,a=/^[0-9\.]+(|px)$/i;return a.test(""+r)&&(r=Math.max(parseInt(r,10),100)),a.test(""+i)&&(i=Math.max(parseInt(i,10),o)),a=e.theme.renderUI({targetNode:n,width:r,height:i,deltaWidth:t.delta_width,deltaHeight:t.delta_height}),t.content_editable||(i=(a.iframeHeight||i)+("number"==typeof i?a.deltaHeight||0:""))=n.length)for(r=0,i=e.length;r=n.length||e[r]!==n[r]){o=r+1;break}if(e.length=e.length||e[r]!==n[r]){o=r+1;break}if(1===o)return t;for(r=0,i=e.length-(o-1);r]*>( | |\\s| | |)<\\/"+e+">[\r\n]*| [\r\n]*)$");return t.replace(e,"")},w0=function(e,t,n){e=function(e,n,t){var r,i,o={},a={},s=[];for(r in t.firstChild&&L_(t.firstChild,function(t){b.each(e,function(e){e.name===t.name&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})}),b.each(n,function(e){"string"==typeof t.attr(e.name)&&(a[e.name]?a[e.name].nodes.push(t):a[e.name]={filter:e,nodes:[t]})})}),o)o.hasOwnProperty(r)&&s.push(o[r]);for(i in a)a.hasOwnProperty(i)&&s.push(a[i]);return s}(e,t,n);b.each(e,function(t){b.each(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},x0=function(e,t){var n;e.dom.setHTML(e.getBody(),t),n=e,km.hasFocus(n)&&C.firstPositionIn(n.getBody()).each(function(e){var t=e.getNode(),t=Q.isTable(t)?C.firstPositionIn(t).getOr(e):e;n.selection.setRng(t.toRange())})},C0=m.DOM,k0=m.DOM,T0=K.extend,M0=K.each,D0=K.resolve,S0=V.ie,E0=(T0(I_.prototype={render:function(){p0(this)},focus:function(e){km.focus(this,e)},hasFocus:function(){return km.hasFocus(this)},execCallback:function(e){for(var t=1;t=n.x&&i.x+i.w<=n.w+n.x&&i.y>=n.y&&i.y+i.h<=n.h+n.y)return r[o];return null},intersect:function(e,t){var n=aw(e.x,t.x),r=aw(e.y,t.y),i=ow(e.x+e.w,t.x+t.w),e=ow(e.y+e.h,t.y+t.h);return i-n<0||e-r<0?null:Z0(n,r,i-n,e-r)},clamp:function(e,t,n){var r=e.x,i=e.y,o=e.x+e.w,e=e.y+e.h,a=t.x+t.w,s=t.y+t.h,l=aw(0,t.x-r),t=aw(0,t.y-i),a=aw(0,o-a),s=aw(0,e-s);return r+=l,i+=t,n&&(o+=l,e+=t,r-=a,i-=s),Z0(r,i,(o-=a)-r,(e-=s)-i)},create:Z0,fromClientRect:function(e){return Z0(e.left,e.top,e.width,e.height)}},lw={},ge={add:function(e,t){lw[e.toLowerCase()]=t},has:function(e){return!!lw[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),t=lw.hasOwnProperty(t)?lw[t]:null;if(null===t)throw new Error("Could not find module for type: "+e);return t},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),n=lw[e])return(n=new n(t)).type=e,n;throw new Error("Could not find control by type: "+e)}},uw=K.each,cw=K.extend,dw=(ew.extend=rw=function(n){function r(){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)}function t(){return this}var e,i,o,a=this.prototype;for(i in iw=!0,e=new this,iw=!1,n.Mixins&&(uw(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),a.Mixins)&&(n.Mixins=a.Mixins.concat(n.Mixins)),n.Methods&&uw(n.Methods.split(","),function(e){n[e]=t}),n.Properties&&uw(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return void 0!==e?(this[t]=e,this):this[t]}}),n.Statics&&uw(n.Statics,function(e,t){r[t]=e}),n.Defaults&&a.Defaults&&(n.Defaults=cw({},a.Defaults,n.Defaults)),n)"function"==typeof(o=n[i])&&a[i]?e[i]=function(n,r){return function(){var e,t=this._super;return this._super=a[n],e=r.apply(this,arguments),this._super=t,e}}(i,o):e[i]=o;return r.prototype=e,(r.constructor=r).extend=rw,r},Math.min),fw=Math.max,pw=Math.round,mw={serialize:tw,parse:function(e){try{return JSON.parse(e)}catch(e){}}},r={callbacks:{},count:0,send:function(t){var n=this,r=m.DOM,i=(void 0!==t.count?t:n).count,o="tinymce_jsonp_"+i;n.callbacks[i]=function(e){r.remove(o),delete n.callbacks[i],t.callback(e)},r.add(r.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),n.count++}},hw={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4\n \n <% if (!folderish) { %>\n \n \n \n <% } %>\n <%= Title %> \n <%= path %> \n \n \n <% if (folderish) { %>\n \n <% } %>\n \n\n'}),define("text!mockup-patterns-tinymce-url/templates/selection.xml",[],function(){return'\n \n \n \n <%= Title %> \n <%= path %> \n \'\n'}),define("text!mockup-patterns-tinymce-url/templates/link.xml",[],function(){return'\n
\n
<%- insertHeading %> \n\n
\n\n
\n Internal \n \n
\n \x3c!-- this gives the name to the "linkType" --\x3e\n \n
\n
\n URL Type \n \n View \n Download \n \n
\n
\n \n\n
\n External \n \n <%- externalText %> \n \n
\n \n\n
\n Email \n \n \n\n
\n Anchor \n \n
\n
Select an anchor \n
\n \n
\n
\n
\n \n\n <% if(linkTypes.indexOf(\'modallink\') !== -1){ %>\n
\n Modal \n \n
\n Select content for modal \n \x3c!-- reuse internal value here! --\x3e\n \n
\n
\n \n <% } %>\n\n
\x3c!-- / tabs --\x3e\n\n
\n
\n Target \n \n <% _.each(targetList, function(target){ %>\n <%- target.text %> \n <% }); %>\n \n
\n
\n <%- titleText %> \n \n
\n
\n\n
\n
\n
\n
\n'}),define("text!mockup-patterns-tinymce-url/templates/image.xml",[],function(){return'\n
\n
<%- insertHeading %> \n\n
\n\n <% if(_.contains(linkTypes, \'image\')){ %>\n
\n Internal Image \n \n \n <% } %>\n\n <% if(_.contains(linkTypes, \'externalImage\')){ %>\n
\n External Image \n \n
\n <%- externalImageText %> \n \n
\n
\n \n <% } %>\n\n
\x3c!-- / tabs --\x3e\n\n
\n
\n Summary \n \n
\n
\n <%- imageAlignText %> \n \n <% _.each([\'inline\', \'right\', \'left\'], function(align){ %>\n \n <%- align.charAt(0).toUpperCase() + align.slice(1) %>\n \n <% }); %>\n \n
\n
\n\n
\n
\n\n
\n
\n'}),define("mockup-patterns-tinymce-url/js/links",["jquery","underscore","pat-registry","pat-base","tinymce","text!mockup-patterns-tinymce-url/templates/link.xml","text!mockup-patterns-tinymce-url/templates/image.xml","mockup-patterns-relateditems","castle-url/components/utils","mockup-utils","mockup-patterns-autotoc","mockup-patterns-modal"],function(s,i,e,t,n,r,o,a,l,u){"use strict";var c="_direct_",d=t.extend({defaults:{linkModal:null},init:function(){this.linkModal=this.options.linkModal,this.tinypattern=this.options.tinypattern,this.tiny=this.tinypattern.tiny,this.dom=this.tiny.dom},getEl:function(){return this.$el.find("input").first()},value:function(){return s.trim(this.getEl().val())},toUrl:function(){return this.value()},load:function(e){this.getEl().attr("value",this.tiny.dom.getAttrib(e,"data-val"))},set:function(e){var t=this.getEl();t.attr("value",e),t.val(e)},attributes:function(){return{"data-val":this.value()}}}),f=d.extend({init:function(){d.prototype.init.call(this),this.getEl().on("change",function(){var e=s(this).val();new RegExp("https?://").test(e)||-1!==s(this).val().split("/")[0].indexOf(".")&&s(this).val("http://"+e)})}}),p=d.extend({init:function(){d.prototype.init.call(this),this.getEl().addClass("pat-relateditems"),this.createRelatedItems()},getEl:function(){return this.$el.find("input:not(.select2-input)").first()},createRelatedItems:function(){this.relatedItems=new a(this.getEl().first(),this.linkModal.options.relatedItems)},value:function(){var e=this.getEl().val();return e&&("object"==typeof e?e=e[0]:"string"==typeof e&&(e={UID:e})),e},toUrl:function(){var e=this.value();return e?this.tinypattern.generateUrl(e):null},load:function(e){e=this.tiny.dom.getAttrib(e,"data-val");e&&this.set(e)},set:function(e){var t=this.getEl().first();t[0].component.setState({selected:[e]}),t[0].component.selectionUpdated()},attributes:function(){var e=this.value();return e?{"data-val":e.UID}:{}}}),m=p.extend({toUrl:function(){var e=this.value();return this.tinypattern.generateImageUrl(e,this.linkModal.$scale.val())},createRelatedItems:function(){this.relatedItems=new a(this.getEl().first(),l.extend(this.linkModal.options.relatedItems,{initialPath:"/image-repository"}))}}),h=d.extend({toUrl:function(){var e,t=this.value();return t?(t="mailto:"+t,(e=this.getSubject())&&(t+="?subject="+e),t):null},load:function(e){d.prototype.load.apply(this,[e]),this.linkModal.$subject.val(this.tiny.dom.getAttrib(e,"data-subject"))},getSubject:function(){return this.linkModal.$subject.val()},attributes:function(){var e=d.prototype.attributes.call(this);return e["data-subject"]=this.getSubject(),e}}),g=d.extend({init:function(){d.prototype.init.call(this),this.$select=this.$el.find("select"),this.anchorNodes=[],this.anchorData=[],this.populate()},value:function(){var e=this.$select.val();if(e)return this.findData(e)},updated:function(){this.populate()},populate:function(){var n=this,r=(n.anchorNodes=[],n.anchorData=[],n.addAnchors(s("a.mceItemAnchor,img.mceItemAnchor,a.mce-item-anchor,img.mce-item-anchor,a[id]:not([href])")),n.linkModal.linkTypes.internal.value());r&&r.UID?(r=r.UID&&r.UID||r,s.ajax({url:s("body").attr("data-portal-url")+"/resolveuid/"+r+"/view"}).done(function(e){var t=s(u.parseBodyTag(e)),e=(e=i.find(s.parseHTML(e),function(e){return"TITLE"===e.tagName}))?e.innerHTML:void 0,t=(n.addAnchors(s("a[id]:not([href])",t),e+": ",r),n.$select.attr("data-selected"));n.createSelect2(t)}).fail(function(){n.createSelect2()})):n.createSelect2()},addAnchors:function(e,t,n){var r,i,o,a;for(t=t||"",i=0;i"+n.label+"");e==r&&(n[0].selected=!0),this.$select.append(n)}else this.$select.append("No anchors found.. ");this.$select.select2()},getAnchorId:function(e){var t=e.id;return e.uid&&(t+=e.uid),t},findData:function(e){for(var t=0;t]+>[^<]+<\/a>$/.test(e)||-1===e.indexOf("href=")))return!1;if(this.anchorElm){var t=this.anchorElm.childNodes;if(0===t.length)return!1;for(var n=t.length-1;0<=n;n--)if(3!==t[n].nodeType)return!1}return!0},generateModalHtml:function(){return this.template({options:this.options,text:this.options.text,insertHeading:this.options.text.insertHeading,linkTypes:this.options.linkTypes,externalText:this.options.text.external,emailText:this.options.text.email,subjectText:this.options.text.subject,targetList:this.options.targetList,titleText:this.options.text.title,externalImageText:this.options.text.externalImage,altText:this.options.text.alt,imageAlignText:this.options.text.imageAlign,scaleText:this.options.text.scale,scales:this.options.scales,cancelBtn:this.options.text.cancelBtn,insertBtn:this.options.text.insertBtn})},isImageMode:function(){return-1!==["image","externalImage"].indexOf(this.linkType)},emitLinkLoaded:function(){var t=this;i.each(t.options.linkTypes,function(e){t.linkTypes[e].updated&&t.linkTypes[e].updated()})},initElements:function(){var e,r=this;r.$selectedTile=s(".mosaic-selected-tile"),r.$target=s('select[name="target"]',r.modal.$modal),r.$button=s('.plone-modal-footer input[name="insert"]',r.modal.$modal),r.$title=s('input[name="title"]',r.modal.$modal),r.$subject=s('input[name="subject"]',r.modal.$modal),r.$urlTypeContainer=s(".urltype",r.modal.$modal),r.$urlType=s('select[name="urlType"]',r.$urlTypeContainer),r.$urlTypeContainer.hide(),r.$alt=s('input[name="alt"]',r.modal.$modal),r.$align=s('select[name="align"]',r.modal.$modal),r.$scale=s('select[name="scale"]',r.modal.$modal),i.each(r.options.linkTypes,function(e){var t,n=s(".linkType."+e+" .main",r.modal.$modal);r.linkTypes[e]=new r.options.linkTypeClassMapping[e](n,{linkModal:r,tinypattern:r.tinypattern}),"internal"!==e&&"modallink"!==e||(t=r.linkTypes[e].relatedItems).$el.on("loaded",function(){var e=t.component.state.items[0];e&&-1!==["File","Video","Audio","Image"].indexOf(e.portal_type)?r.$urlTypeContainer.show():(r.$urlTypeContainer.hide(),r.urlType=c,r.$urlType.val(c)),r.emitLinkLoaded()})}),s(".autotoc-nav a",r.modal.$modal).click(function(){var e=s("fieldset.linkType",r.modal.$modal).eq(s(this).index())[0].className.split(/\s+/);i.each(e,function(e){-1!==i.indexOf(r.options.linkTypes,e)&&(r.linkType=e)})}),r.data={},r.initialText=null,r.rng=r.tiny.selection.getRng(),r.selectedElm=r.tiny.selection.getNode(),r.anchorElm=r.tiny.dom.getParent(r.selectedElm,"a[href]"),r.onlyText=r.isOnlyTextSelected(),r.data.text=r.initialText=r.anchorElm?r.anchorElm.innerText||r.anchorElm.textContent:r.tiny.selection.getContent({format:"text"}),r.data.href=r.anchorElm?r.tiny.dom.getAttrib(r.anchorElm,"href"):"",r.anchorElm?r.data.target=r.tiny.dom.getAttrib(r.anchorElm,"target"):r.tiny.settings.default_link_target&&(r.data.target=r.tiny.settings.default_link_target),(e=r.tiny.dom.getAttrib(r.anchorElm,"rel"))&&(r.data.rel=e),(e=r.tiny.dom.getAttrib(r.anchorElm,"class"))&&(r.data.class=e),(e=r.tiny.dom.getAttrib(r.anchorElm,"title"))&&(r.data.title=e),s(".autotoc-nav a:first",r.modal.$modal).trigger("click")},getLinkUrl:function(){return this.linkTypes[this.linkType].toUrl()},getValue:function(){return this.linkTypes[this.linkType].value()},updateAnchor:function(e){var t=this,n=(t.urlType=t.$urlType.val()||c,t.tiny.focus(),t.tiny.selection.setRng(t.rng),"internal"!==t.linkType&&"modallink"!==t.linkType||t.urlType===c||(e+=t.urlType),t.$target.val()),r=t.$title.val(),r=s.extend(!0,t.data,{title:r||null,target:n||null,"data-linkType":t.linkType,"data-urltype":t.urlType,href:e},t.linkTypes[t.linkType].attributes());t.anchorElm?(t.onlyText&&r.text!==t.initialText&&("innerText"in t.anchorElm?t.anchorElm.innerText=t.data.text:t.anchorElm.textContent=t.data.text),t.tiny.dom.setAttribs(t.anchorElm,r),t.tiny.selection.select(t.anchorElm),t.tiny.undoManager.add()):t.onlyText?t.tiny.insertContent(t.tiny.dom.createHTML("a",r,t.tiny.dom.encode(t.data.text))):t.tiny.execCommand("mceInsertLink",!1,r)},focusElement:function(e){this.tiny.focus(),this.tiny.selection.select(e),this.tiny.nodeChanged()},updateImage:function(e){var t,n=this,r=n.$title.val(),e=(n.tiny.focus(),n.tiny.selection.setRng(n.rng),s.extend(!0,{},{src:e,title:r||null,alt:n.$alt.val(),class:"image-"+n.$align.val(),"data-linkType":n.linkType,"data-scale":n.$scale.val()},n.linkTypes[n.linkType].attributes()));n.imgElm&&!n.imgElm.getAttribute("data-mce-object")?(e.width=n.dom.getAttrib(n.imgElm,"width"),e.height=n.dom.getAttrib(n.imgElm,"height")):n.imgElm=null,n.imgElm?n.dom.setAttribs(n.imgElm,e):(e.id="__mcenew",n.tiny.insertContent(n.dom.createHTML("img",e)),n.imgElm=n.dom.get("__mcenew"),n.dom.setAttrib(n.imgElm,"id",null)),(t=n.imgElm).onload=t.onerror=function(){t.onload=t.onerror=null,n.focusElement(t)},n.imgElm.complete&&n.focusElement(n.imgElm)},modalShown:function(e){var n=this;n.initElements(),n.initData(),n.$button.off("click").on("click",function(e){var t;n.hide(),e.preventDefault(),e.stopPropagation(),n.linkType=n.modal.$modal.find("fieldset.active").data("linktype");try{t=n.getLinkUrl()}catch(e){return}t&&(n.isImageMode()?n.updateImage(t):n.updateAnchor(t))}),s('.plone-modal-footer input[name="cancel"]',n.modal.$modal).click(function(e){e.preventDefault(),n.hide()})},show:function(){this.modal.show()},hide:function(){this.modal.hide()},initData:function(){var e,t=this,n=(t.selection=t.tiny.selection,t.tiny.focus(),t.imgElm=t.selection.getNode());if(t.anchorElm=t.dom.getParent(n,"a[href]"),t.isImageMode()){if("IMG"!==t.imgElm.nodeName&&t.anchorElm&&0<(n=t.anchorElm.getElementsByTagName("img")).length&&(t.imgElm=n[0],t.focusElement(t.imgElm)),"IMG"!==t.imgElm.nodeName&&(t.imgElm=null),t.imgElm){var r,n=t.dom.getAttrib(t.imgElm,"src");t.$title.val(t.dom.getAttrib(t.imgElm,"title")),t.$alt.val(t.dom.getAttrib(t.imgElm,"alt")),(e=t.dom.getAttrib(t.imgElm,"data-linktype"))?(t.linkType=e,t.linkTypes[t.linkType].load(t.imgElm),(r=t.dom.getAttrib(t.imgElm,"data-scale"))&&t.$scale.val(r),s("#tinylink-"+t.linkType,t.modal.$modal).trigger("click")):n&&t.guessImageLink(n);for(var i=t.dom.getAttrib(t.imgElm,"class").split(" "),o=0;o ctrl+shift+p","",function(){var e=r(f.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.items()[0].focus()})},a={isString:e("string"),isObject:e("object"),isArray:e("array"),isNull:e("null"),isBoolean:e("boolean"),isUndefined:e("undefined"),isFunction:e("function"),isNumber:e("number")},Se=void 0===(be=Array.prototype.indexOf)?function(e,t){return Ee(e,t)}:function(e,t){return be.call(e,t)},Ee=function(e,t){for(var n=0,r=e.length;ntinymce']),e=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+e}:null,r.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:t},i,e]})),f.fireBeforeRenderUI(t),t.on("SwitchMode",(a=r,function(e){a.find("*").disabled("readonly"===e.mode)})),r.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&Ve.setStyle(r.getEl(),"width",n.width),t.on("remove",function(){r.remove(),r=null}),G(t,r),De(t),{iframeContainer:r.find("#iframe")[0].getEl(),editorContainer:r.getEl()}},b=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Ke=0,_={id:function(){return"mceu_"+Ke++},create:function(e,t,n){var r=document.createElement(e);return d.DOM.setAttribs(r,t),"string"==typeof n?r.innerHTML=n:m.each(n,function(e){e.nodeType&&r.appendChild(e)}),r},createFragment:function(e){return d.DOM.createFragment(e)},getWindowSize:function(){return d.DOM.getViewPort()},getSize:function(e){var t,n;return n=e.getBoundingClientRect?(n=e.getBoundingClientRect(),t=Math.max(n.width||n.right-n.left,e.offsetWidth),Math.max(n.height||n.bottom-n.bottom,e.offsetHeight)):(t=e.offsetWidth,e.offsetHeight),{width:t,height:n}},getPos:function(e,t){return d.DOM.getPos(e,t||_.getContainer())},getContainer:function(){return y.container||document.body},getViewPort:function(e){return d.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return d.DOM.addClass(e,t)},removeClass:function(e,t){return d.DOM.removeClass(e,t)},hasClass:function(e,t){return d.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return d.DOM.toggleClass(e,t,n)},css:function(e,t,n){return d.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return d.DOM.getStyle(e,t,!0)},on:function(e,t,n,r){return d.DOM.bind(e,t,n,r)},off:function(e,t,n){return d.DOM.unbind(e,t,n)},fire:function(e,t,n){return d.DOM.fire(e,t,n)},innerHtml:function(e,t){d.DOM.setHTML(e,t)}};function Je(e,t,n){var r,i=Qe(),o=_.getPos(t,xe(e)),a=o.x,o=o.y;return ye(e)&&ve(document.body)&&(a-=i.x,o-=i.y),i=e.getEl(),i=(e=_.getSize(i)).width,r=e.height,t=(e=_.getSize(t)).width,e=e.height,"b"===(n=(n||"").split(""))[0]&&(o+=e),"r"===n[1]&&(a+=t),"c"===n[0]&&(o+=Math.round(e/2)),"c"===n[1]&&(a+=Math.round(t/2)),"b"===n[3]&&(o-=r),"r"===n[4]&&(a-=i),"c"===n[3]&&(o-=Math.round(r/2)),"c"===n[4]&&(a-=Math.round(i/2)),{x:a,y:o,w:i,h:r}}function Qe(){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)}}function Ze(e){var t=xe(e);return t&&!ye(e)?{x:0,y:0,w:t.scrollWidth-1,h:t.scrollHeight-1}:Qe()}var et={testMoveRel:function(e,t){for(var n=Ze(this),r=0;rn.x&&i.x+i.wn.y&&i.y+i.h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,ct=/^\s*|\s*$/g,dt=t.extend({init:function(e){var i=this.match;function a(e,t,n){function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((e=lt.exec(e.replace(ct,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(e[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}}(e[3])),r(function(t,n,r){if(t)return function(e){e=e[t]?e[t]():"";return n?"="===n?e===r:"*="===n?0<=e.indexOf(r):"~="===n?0<=(" "+e+" ").indexOf(" "+r+" "):"!="===n?e!==r:"^="===n?0===e.indexOf(r):"$="===n&&e.substr(e.length-r.length)===r:!!r}}(e[4],e[5],e[6])),r(function(r){var t;if(r)return(r=/(?:not\((.+)\))|(.+)/i.exec(r))[1]?(t=s(r[1],[]),function(e){return!i(e,t)}):(r=r[2],function(e,t,n){return"first"===r?0===t:"last"===r?t===n-1:"even"===r?t%2==0:"odd"===r?t%2==1:!!e[r]&&e[r]()})}(e[7])),t.pseudo=!!e[7],t.direct=n,t}function s(e,t){var n,r,i,o=[];do{if(ut.exec(""),(r=ut.exec(e))&&(e=r[3],o.push(r[1]),r[2])){n=r[3];break}}while(r);for(n&&s(n,t),e=[],i=0;i"!==o[i]&&e.push(a(o[i],[],">"===o[i-1]));return t.push(e),t}this._selectors=s(e,[])},match:function(e,t){for(var n,r,i,o,a,s,l,u,c,d,f,p=0,m=(t=t||this._selectors).length;pi.maxW?i.maxW:r,i.w=r,i.innerW=r-t),void 0!==(r=e.h)&&(r=(r=ri.maxH?i.maxH:r,i.h=r,i.innerH=r-n),void 0!==(r=e.innerW)&&(r=(r=ri.maxW-t?i.maxW-t:r,i.innerW=r,i.w=r+t),void 0!==(r=e.innerH)&&(r=(r=ri.maxH-n?i.maxH-n:r,i.innerH=r,i.h=r+n),void 0!==e.contentW&&(i.contentW=e.contentW),void 0!==e.contentH&&(i.contentH=e.contentH),(t=this._lastLayoutRect).x===i.x&&t.y===i.y&&t.w===i.w&&t.h===i.h||((r=St.repaintControls)&&r.map&&!r.map[this._id]&&(r.push(this),r.map[this._id]=!0),t.x=i.x,t.y=i.y,t.w=i.w,t.h=i.h),this):i},repaint:function(){var e,t,n,r=this,i=document.createRange?function(e){return e}:Math.round,o=r.getEl().style,a=r._layoutRect,s=r._lastRepaintRect||{},l=r.borderBox,u=l.left+l.right,l=l.top+l.bottom;a.x!==s.x&&(o.left=i(a.x)+"px",s.x=a.x),a.y!==s.y&&(o.top=i(a.y)+"px",s.y=a.y),a.w!==s.w&&(n=i(a.w-u),o.width=(0<=n?n:0)+"px",s.w=a.w),a.h!==s.h&&(n=i(a.h-l),o.height=(0<=n?n:0)+"px",s.h=a.h),r._hasBody&&a.innerW!==s.innerW&&(n=i(a.innerW),(t=r.getEl("body"))&&((e=t.style).width=(0<=n?n:0)+"px"),s.innerW=a.innerW),r._hasBody&&a.innerH!==s.innerH&&(n=i(a.innerH),(t=t||r.getEl("body"))&&((e=e||t.style).height=(0<=n?n:0)+"px"),s.innerH=a.innerH),r._lastRepaintRect=s,r.fire("repaint",{},!1)},updateLayoutRect:function(){this.parent()._lastRect=null,_.css(this.getEl(),{width:"",height:""}),this._layoutRect=this._lastRepaintRect=this._lastLayoutRect=null,this.initLayoutRect()},on:function(e,t){var n,r,i,o=this;return Tt(o).on(e,"string"!=typeof(n=t)?n:function(e){if(r||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(r=t[n]))return i=e,!1}),r)return r.call(i,e);e.action=n,this.fire("execute",e)}),o},off:function(e,t){return Tt(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=Tt(this).fire(e,t),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},hasEventListeners:function(e){return Tt(this).has(e)},parents:function(e){for(var t=new ht,n=this.parent();n;n=n.parent())t.add(n);return t=e?t.filter(e):t},parentsAndSelf:function(e){return new ht(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){e=e?this._id+"-"+e:this._id;return this._elmCache[e]||(this._elmCache[e]=b("#"+e)[0]),this._elmCache[e]},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.getEl(this.ariaTarget);return void 0===t?this._aria[e]:(this._aria[e]=t,this.state.get("rendered")&&n.setAttribute("role"===e?e:"aria-"+e,t),this)},encode:function(e,t){return((e=!1!==t?this.translate(e):e)||"").replace(/[&<>"]/g,function(e){return""+e.charCodeAt(0)+";"})},translate:function(e){return St.translate?St.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,n=this,e=n.getEl(),r=n.parent();if(n.items)for(var i=n.items().toArray(),o=i.length;o--;)i[o].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&&b(e).off();r=n.getRoot().controlIdLookup;return r&&delete r[n._id],e&&e.parentNode&&e.parentNode.removeChild(e),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return b(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return b(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'
'},postRender:function(){var e,t,n,r=this,i=r.settings;for(t in r.$el=b(r.getEl()),r.state.set("rendered",!0),i)0===t.indexOf("on")&&r.on(t.substr(2),i[t]);if(r._eventsRoot){for(e=r.parent();!n&&e;e=e.parent())n=e._eventsRoot;if(n)for(t in n._nativeEvents)r._nativeEvents[t]=!0}Mt(r),i.style&&(a=r.getEl())&&(a.setAttribute("style",i.style),a.style.cssText=i.style),r.settings.border&&(a=r.borderBox,r.$el.css({"border-top-width":a.top,"border-right-width":a.right,"border-bottom-width":a.bottom,"border-left-width":a.left}));var o,a=r.getRoot();for(o in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[r._id]=r)._aria)r.aria(o,r._aria[o]);!1===r.state.get("visible")&&(r.getEl().style.display="none"),r.bindStates(),r.state.on("change:visible",function(e){var t,e=e.value;r.state.get("rendered")&&(r.getEl().style.display=!1===e?"none":"",r.getEl().getBoundingClientRect()),(t=r.parent())&&(t._lastRect=null),r.fire(e?"show":"hide"),_t.add(r)}),r.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t=this.getEl(),n=t.parentNode,r=function(e,t){for(var n,r=e,i=n=0;r&&r!==t&&r.nodeType;)i+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:i,y:n}}(t,n),i=r.x,r=r.y,o=t.offsetWidth,t=t.offsetHeight,a=n.clientWidth,s=n.clientHeight;return"end"===e?(i-=a-o,r-=s-t):"center"===e&&(i-=a/2-o/2,r-=s/2-t/2),n.scrollLeft=i,n.scrollTop=r,this},getRoot:function(){for(var e=this,t=[];e;){if(e.rootControl){n=e.rootControl;break}t.push(e),e=(n=e).parent()}for(var n=n||this,r=t.length;r--;)t[r].rootControl=n;return n},reflow:function(){_t.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function Tt(n){return n._eventDispatcher||(n._eventDispatcher=new tt({scope:n,toggleEvent:function(e,t){t&&tt.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered"))&&Mt(n)}})),n._eventDispatcher}function Mt(s){var e,t,n,l,r,i;function o(e){var t=s.getParentCtrl(e.target);t&&t.fire(e.type,e)}function a(){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,r,i=s.getParentCtrl(e.target),o=l._lastHoverCtrl,a=0;if(i!==o){if((n=(l._lastHoverCtrl=i).parents().toArray().reverse()).push(i),o){for((r=o.parents().toArray().reverse()).push(o),a=0;a=t.length&&(e=0),t[e]&&t[e].focus(),e}function f(e,t){var n=-1,r=c();t=t||u(r.getEl());for(var i=0;i'+(this.settings.html||"")+e.renderHtml(this)+"
"},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=Et({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this._layoutRect,t=this._lastRect;if(!t||t.w!==e.w||t.h!==e.h)return this._layout.recalc(this),e=this.layoutRect(),this._lastRect={x:e.x,y:e.y,w:e.w,h:e.h},!0},reflow:function(){var e;if(_t.remove(this),this.visible()){for(w.repaintControls=[],w.repaintControls.map={},this.recalc(),e=w.repaintControls.length;e--;)w.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),w.repaintControls=[]}return this}});function Nt(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n").css({position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,cursor:s}).appendTo(m.body),b(m).on("mousemove touchmove",g).on("mouseup touchend",v),u.start(e)},g=function(e){if(Nt(e),e.button!==d)return v(e);e.deltaX=e.screenX-f,e.deltaY=e.screenY-p,e.preventDefault(),u.drag(e)},v=function(e){Nt(e),b(m).off("mousemove touchmove",g).off("mouseup touchend",v),c.remove(),u.stop&&u.stop(e)};this.destroy=function(){b(h).off()},b(h).on("mousedown touchstart",e)}var Rt,At,Pt,Ot,It={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var d=this;function n(){var u,c,e;function t(e,t,n,r,i,o){var a,s,l=d.getEl("scroll"+e);l&&(a=t.toLowerCase(),s=n.toLowerCase(),b(d.getEl("absend")).css(a,d.layoutRect()[r]-1),i?(b(l).css("display","block"),r=d.getEl("body"),i=d.getEl("scroll"+e+"t"),e=r["client"+n]-4,o=(e-=u&&c?l["client"+o]:0)/r["scroll"+n],(n={})[a]=r["offset"+t]+2,n[s]=e,b(l).css(n),(n={})[a]=r["scroll"+t]*o,n[s]=e*o,b(i).css(n)):b(l).css("display","none"))}e=d.getEl("body"),u=e.scrollWidth>e.clientWidth,c=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",u,"Height"),t("v","Top","Height","contentH",c,"Width")}function e(i,o,a,s,l){var u,e=d._id+"-scroll"+i,t=d.classPrefix;b(d.getEl()).append(''),d.draghelper=new x(e+"t",{start:function(){u=d.getEl("body")["scroll"+o],b("#"+e).addClass(t+"active")},drag:function(e){var t=d.layoutRect(),n=t.contentW>t.innerW,t=t.contentH>t.innerH,r=d.getEl("body")["client"+a]-4,n=(r-=n&&t?d.getEl("scroll"+i)["client"+l]:0)/d.getEl("body")["scroll"+a];d.getEl("body")["scroll"+o]=u+e["delta"+s]/n},stop:function(){b("#"+e).removeClass(t+"active")}})}d.settings.autoScroll&&(d._hasScroll||(d._hasScroll=!0,d.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height"),d.on("wheel",function(e){var t=d.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),b(d.getEl("body")).on("scroll",n)),n())}},Yt=r.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[It],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n=''+t.renderHtml(e)+"
":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),''+(e._preBodyHtml||"")+n+"
"}}),Ft={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){var n;return(e<=1||t<=1)&&(n=_.getWindowSize(),e=e<=1?e*n.w:e,t=t<=1?t*n.h:t),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)}},C=[],k=[];function Bt(e){for(var t=C.length;t--;){var n=C[t],r=n.getParentCtrl(e.target);!n.settings.autohide||r&&(function(e,t){for(;e;){if(e===t)return 1;e=e.parent()}}(r,n)||n.parent()===r)||(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}function Ht(i){var e=_.getViewPort().y;function t(e,t){for(var n,r=0;re&&(i.fixed(!1).layoutRect({y:i._autoFixY}).repaint(),t(!1,i._autoFixY-e)):(i._autoFixY=i.layoutRect().y,i._autoFixY').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),b(i.getEl()).addClass(n+"in")}),Ot=!0),jt(!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='
',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;return this.state.get("fixed")!==e&&(this.state.get("rendered")&&(t=_.getViewPort(),e?this.layoutRect().y-=t.y:this.layoutRect().y+=t.y),this.classes.toggle("fixed",e),this.state.set("fixed",e)),this},show:function(){for(var e=this._super(),t=C.length;t--&&C[t]!==this;);return-1===t&&C.push(this),e},hide:function(){return Ut(this),jt(!1,this),this._super()},hideAll:function(){T.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),jt(!1,this)),this},remove:function(){Ut(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Ut(e){for(var t=C.length;t--;)C[t]===e&&C.splice(t,1);for(t=k.length;t--;)k[t]===e&&k.splice(t,1)}T.hideAll=function(){for(var e=C.length;e--;){var t=C[e];t&&t.settings.autohide&&(t.hide(),C.splice(e,1))}};function zt(e,t){return!(!e||t.settings.ui_container)}var $t=function(o,e,t){function n(){a&&(a.show(),c(),l.addClass(o.getBody(),"mce-edit-focus"))}function r(){a&&(a.hide(),T.hideAll(),l.removeClass(o.getBody(),"mce-edit-focus"))}function i(){a?a.visible()||n():(a=e.panel=h.create({type:s?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:zt(s,o),fixed:zt(s,o),border:1,items:[!1===I(o)?null:{type:"menubar",border:"0 0 1 0",items:Ye(o)},Te(o,Y(o))]}),we(o,a),f.fireBeforeRenderUI(o),(s?a.renderTo(s):a.renderTo()).reflow(),G(o,a),n(),De(o),o.on("nodeChange",c),o.on("ResizeWindow",c),o.on("activate",n),o.on("deactivate",r),o.nodeChanged())}var a,s,l=d.DOM,u=o.getParam("fixed_toolbar_container"),c=(u&&(s=l.select(u)[0]),function(){var e,t,n,r,i;a&&a.moveRel&&a.visible()&&!a._fixed&&(n=o.selection.getScrollContainer(),e=o.getBody(),i=r=0,n&&(t=l.getPos(e),n=l.getPos(n),r=Math.max(0,n.x-t.x),i=Math.max(0,n.y-t.y)),a.fixed(!1).moveRel(e,o.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(r,i))});return o.settings.content_editable=!0,o.on("focus",function(){!1===F(o)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,i,i):i()}),o.on("blur hide",r),o.on("remove",function(){a&&(a.remove(),a=null)}),!1===F(o)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,qe(o)):qe(o)(),{}};function Wt(r,i){var o,a,s=this,l=w.classPrefix;s.show=function(e,t){function n(){o&&(b(r).append('
'),t)&&t()}return s.hide(),o=!0,e?a=u.setTimeout(n,e):n(),s},s.hide=function(){var e=r.lastChild;return u.clearTimeout(a),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,s}}function qt(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")}var Vt=function(e,t){var n;e.on("ProgressState",function(e){n=n||new Wt(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Gt=function(e,t,n){r=(o=e).settings,i=r.skin,r=r.skin_url,!1!==i&&(i=i||"lightgray",r=r?o.documentBaseURI.toAbsolute(r):z.baseURL+"/skins/"+i);var r,i,o=r;return o&&(n.skinUiCss=o+"/skin.min.css",e.contentCSS.push(o+"/content"+(e.inline?".inline":"")+".min.css")),Vt(e,t),(e.getParam("inline",!1,"boolean")?$t:Xe)(e,t,n)},Xt=w.extend({Mixins:[et],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this.classPrefix;return'
'+this.encode(this.state.get("text"))+"
"},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=this.getEl().style,t=this._layoutRect;e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),i=w.extend({init:function(n){var r=this;r._super(n),n=r.settings,r.canFocus=!0,n.tooltip&&!1!==i.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);e.control===r?(e=t.text(n.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]),t.classes.toggle("tooltip-n","bc-tc"===e),t.classes.toggle("tooltip-nw","bc-tl"===e),t.classes.toggle("tooltip-ne","bc-tr"===e),t.moveRel(r.getEl(),e)):t.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",n.ariaLabel||n.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new Xt({type:"tooltip"}),Ce(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this.settings;this._super(),this.parent()||!e.width&&!e.height||(this.initLayoutRect(),this.repaint()),e.autofocus&&this.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function r(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){r(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&r(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Kt=i.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''},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()}}),Jt=w.extend({Mixins:[et],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=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(i='× '),t.progressBar&&(o=t.progressBar.renderHtml()),''+r+'
'+t.state.get("text")+"
"+o+i+'
'},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),qt(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,qt(t,e.value)}),t.progressBar&&(t.progressBar.bindStates(),t.progressBar.state.on("change:value",function(e){qt(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e=this.getEl().style,t=this._layoutRect;e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Qt(r){var i=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var e=m.extend(e,{maxWidth:(e=i(r),_.getSize(e).width)}),n=new Jt(e);return 0<(n.args=e).timeout&&(n.timer=setTimeout(function(){n.close(),t()},e.timeout)),n.on("close",function(){t()}),n.renderTo(),n},close:function(e){e.close()},reposition:function(e){var n,t;p.each(e,function(e){e.moveTo(0,0)}),0<(n=e).length&&(e=n.slice(0,1)[0],t=i(r),e.moveRel(t,"tc-tc"),p.each(n,function(e,t){0e.w&&(n=e.x-Math.max(0,t/2),i.layoutRect({w:t,x:n}),r=!0),o&&(o.layoutRect({w:i.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w)&&(n=e.x-Math.max(0,t-e.w),i.layoutRect({w:t,x:n}),r=!0),r&&i.recalc()},initLayoutRect:function(){var e=this._super(),t=0,n=(this.settings.title&&!this._fullscreen&&(n=this.getEl("head"),n=_.getSize(n),e.headerW=n.width,e.headerH=n.height,t+=e.headerH),this.statusbar&&(t+=this.statusbar.layoutRect().h),e.deltaH+=t,e.minH+=t,e.h+=t,_.getWindowSize());return e.x=this.settings.x||Math.max(0,n.w/2-e.w/2),e.y=this.settings.y||Math.max(0,n.h/2-e.h/2),e},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o=''),void 0===(s=i.url?'':s)&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'"},fullscreen:function(e){var n,t,r=this,i=document.documentElement,o=r.classPrefix;return e!==r._fullscreen&&(b(window).on("resize",function(){var e,t;r._fullscreen&&(n?r._timer||(r._timer=u.setTimeout(function(){var e=_.getWindowSize();r.moveTo(0,0).resizeTo(e.w,e.h),r._timer=0},50)):(e=(new Date).getTime(),t=_.getWindowSize(),r.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)))}),t=r.layoutRect(),(r._fullscreen=e)?(r._initial={x:t.x,y:t.y,w:t.w,h:t.h},r.borderBox=nt("0"),r.getEl("head").style.display="none",t.deltaH-=t.headerH+2,b([i,document.body]).addClass(o+"fullscreen"),r.classes.add("fullscreen"),e=_.getWindowSize(),r.moveTo(0,0).resizeTo(e.w,e.h)):(r.borderBox=nt(r.settings.border),r.getEl("head").style.display="",t.deltaH+=t.headerH,b([i,document.body]).removeClass(o+"fullscreen"),r.classes.remove("fullscreen"),r.moveTo(r._initial.x,r._initial.y).resizeTo(r._initial.w,r._initial.h))),r.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 x(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()}),M.push(n),en(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e;for(this.dragHelper.destroy(),this._super(),this.statusbar&&this.statusbar.remove(),tn(this.classPrefix,!1),e=M.length;e--;)M[e]===this&&M.splice(e,1);en(0'+this._super(e)}}),dn=i.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=this.getEl().firstChild;e&&((e=e.style).width=e.height="100%"),this._super()},renderHtml:function(){var e=this._id,t=this.classPrefix,n=this.state.get("icon"),r=this.state.get("text"),i="",o=this.settings,a=o.image;return a=a?(n="none"," style=\"background-image: url('"+(a="string"!=typeof a?window.getSelection?a[0]:a[1]:a)+"')\""):"",r&&(this.classes.add("btn-has-text"),i=''+this.encode(r)+" "),r="boolean"==typeof o.active?' aria-pressed="'+o.active+'"':"",''+((n=n?t+"ico "+t+"i-"+n:"")?' ":"")+i+"
"},bindStates:function(){var r=this,n=r.$,i=r.classPrefix+"txt";function o(e){var t=n("span."+i,r.getEl());e?(t[0]||(n("button:first",r.getEl()).append(' '),t=n("span."+i,r.getEl())),t.html(r.encode(e))):t.remove(),r.classes.toggle("btn-has-text",!!e)}return r.state.on("change:text",function(e){o(e.value)}),r.state.on("change:icon",function(e){var e=e.value,t=r.classPrefix,t=(e=(r.settings.icon=e)?t+"ico "+t+"i-"+r.settings.icon:"",r.getEl().firstChild),n=t.getElementsByTagName("i")[0];e?(n&&n===t.firstChild||(n=document.createElement("i"),t.insertBefore(n,t.firstChild)),n.className=e):n&&t.removeChild(n),o(r.state.get("text"))}),r._super()}}),fn=dn.extend({init:function(e){e=m.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=_.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),b(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)}),b(t).on("click",function(e){e.stopPropagation()}),b(n.getEl("button")).on("click",function(e){e.stopPropagation(),t.click()}),n.getEl().appendChild(t)},remove:function(){b(this.getEl("button")).off(),b(this.getEl("input")).off(),this._super()}}),pn=r.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this._layout;return this.classes.add("btn-group"),this.preRender(),e.preRender(this),''+(this.settings.html||"")+e.renderHtml(this)+"
"}}),mn=i.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._id,t=this.classPrefix;return''+this.encode(this.state.get("text"))+"
"},bindStates:function(){var r=this;function t(e){r.classes.toggle("checked",e),r.aria("checked",e)}return r.state.on("change:text",function(e){r.getEl("al").firstChild.data=r.translate(e.value)}),r.state.on("change:checked change:value",function(e){r.fire("change"),t(e.value)}),r.state.on("change:icon",function(e){var e=e.value,t=r.classPrefix;if(void 0===e)return r.settings.icon;var e=(r.settings.icon=e)?t+"ico "+t+"i-"+r.settings.icon:"",t=r.getEl().firstChild,n=t.getElementsByTagName("i")[0];e?(n&&n===t.firstChild||(n=document.createElement("i"),t.insertBefore(n,t.firstChild)),n.className=e):n&&t.removeChild(n)}),r.state.get("checked")&&t(!0),r._super()}}),hn=tinymce.util.Tools.resolve("tinymce.util.VK"),gn=i.extend({init:function(r){var i=this;i._super(r),r=i.settings,i.classes.add("combobox"),i.subinput=!0,i.ariaTarget="inp",r.menu=r.menu||r.values,r.menu&&(r.icon="caret"),i.on("click",function(e){var t=e.target,n=i.getEl();if(b.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(i.fire("action"),r.menu)&&(i.showMenu(),e.aria)&&i.menu.items()[0].focus(),t=t.parentNode}),i.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),i.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),i.fire("submit",{data:t.toJSON()}))}),i.on("keyup",function(e){var t,n;"INPUT"===e.target.nodeName&&(t=i.state.get("value"),(n=e.target.value)!==t)&&(i.state.set("value",n),i.fire("autocomplete",e))}),i.on("mouseover",function(e){var t,n=i.tooltip().moveTo(-65535);i.statusLevel()&&-1!==e.target.className.indexOf(i.classPrefix+"status")&&(t=i.statusMessage()||"Ok",t=n.text(t).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]),n.classes.toggle("tooltip-n","bc-tc"===t),n.classes.toggle("tooltip-nw","bc-tl"===t),n.classes.toggle("tooltip-ne","bc-tr"===t),n.moveRel(e.target,t))})},statusLevel:function(e){return 0 ',r.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=a+"ico "+a+"i-"+o.icon),t=r.state.get("text"),(e||t)&&(l=''+("caret"!==e?' ':' ')+(t?(e?" ":"")+t:"")+"
",r.classes.add("has-open")),' '+n+l+"
"},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,r){var i=this;0===e.length?i.hideMenu():(i.menu?i.menu.items().remove():i.menu=h.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(i).renderTo(),m.each(e,function(e){var t,n;i.menu.add({text:e.title,url:e.previewUrl,match:r,classes:"menu-item-ellipsis",onclick:(t=e.value,n=e.title,function(){i.fire("selectitem",{title:n,value:t})})})}),i.menu.renderNew(),i.hideMenu(),i.menu.on("cancel",function(e){e.control.parent()===i.menu&&(e.stopPropagation(),i.focus(),i.hideMenu())}),i.menu.on("select",function(){i.focus()}),e=i.layoutRect().w,i.menu.layoutRect({w:e,minW:0,maxW:e}),i.menu.repaint(),i.menu.reflow(),i.menu.show(),i.menu.moveRel(i.getEl(),i.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){function n(e,t){t&&0'+e.encode(r)+" "),''+(i?' ":"")+' '+a+'
'},postRender:function(){var t=this,n=t.settings.onclick;return t.on("click",function(e){e.aria&&"down"===e.aria.key||e.control!==t||bn.getParent(e.target,"."+t.classPrefix+"open")||(e.stopImmediatePropagation(),n.call(t,e))}),delete t.settings.onclick,t._super()}}),wn=tinymce.util.Tools.resolve("tinymce.util.Color"),xn=i.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var t,n,r,i,o,a=this,s=a.color();function l(e,t){var n=_.getPos(e),r=t.pageX-n.x,t=t.pageY-n.y;return{x:Math.max(0,Math.min(r/e.clientWidth,1)),y:Math.max(0,Math.min(t/e.clientHeight,1))}}function u(e,t){var n=(360-e.h)/360;_.css(r,{top:100*n+"%"}),t||_.css(o,{left:e.s+"%",top:100-e.v+"%"}),i.style.background=wn({s:100,v:100,h:e.h}).toHex(),a.color().parse({s:e.s,v:e.v,h:e.h})}function e(e){e=l(i,e);t.s=100*e.x,t.v=100*(1-e.y),u(t),a.fire("change")}function c(e){e=l(n,e);(t=s.toHsv()).h=360*(1-e.y),u(t,!0),a.fire("change")}n=a.getEl("h"),r=a.getEl("hp"),i=a.getEl("sv"),o=a.getEl("svp"),a._repaint=function(){u(t=s.toHsv())},a._super(),a._svdraghelper=new x(a._id+"-sv",{start:e,drag:e}),a._hdraghelper=new x(a._id+"-h",{start:c,drag:c}),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=wn()),this._color},renderHtml:function(){var e=this._id,o=this.classPrefix,a="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";var t=''+function(){for(var e="",t="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",n=a.split(","),r=0,i=n.length-1;r
';return e}()+'
';return'"}}),Cn=i.extend({init:function(e){e=m.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=this.settings,t={id:this._id,hidefocus:"1"},t=_.create("div",t,""+this.translate(e.text)+" ");return e.height&&_.css(t,"height",e.height+"px"),e.width&&_.css(t,"width",e.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){function e(e){e.preventDefault(),o.classes.toggle("dragenter"),o.getEl().className=o.classes}var o=this;o._super(),o.$el.on("dragover",function(e){e.preventDefault()}),o.$el.on("dragenter",e),o.$el.on("dragleave",e),o.$el.on("drop",function(e){var t,n,r,i;e.preventDefault(),o.state.get("disabled")||(n=e.dataTransfer.files,t="string"!=typeof(i=o.settings.accept)?n:(r=new RegExp("("+i.split(/\s*,\s*/).join("|")+")$","i"),m.grep(n,function(e){return r.test(e.name)})),o.value=function(){return t.length?o.settings.multiple?t:t[0]:null},t.length&&o.fire("change",e))})},remove:function(){this.$el.off(),this._super()}}),kn=i.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="»"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){(e=e.target.getAttribute("data-index"))&&t.fire("select",{value:t.row()[e],index:e})}),t.row(t.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''+this._getDataPathHtml(this.state.get("row"))+"
"},bindStates:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtml:function(e){for(var t=e||[],n="",r=this.classPrefix,i=0,o=t.length;i '+this.settings.delimiter+" ":"")+''+t[i].name+"
";return n=n||'
'}}),Tn=kn.extend({postRender:function(){var o=this,a=o.settings.editor;return!1!==a.settings.elementpath&&(o.on("select",function(e){a.focus(),a.selection.select(this.row()[e.index].element),a.nodeChanged()}),a.on("nodeChange",function(e){for(var t=[],n=e.parents,r=n.length;r--;)if(1===n[r].nodeType&&!function(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return 1;if("bookmark"===e.getAttribute("data-mce-type"))return 1}}(n[r])){var i=a.fire("ResolveName",{name:n[r].nodeName.toLowerCase(),target:n[r]});if(i.isDefaultPrevented()||t.push({name:i.name,element:n[r]}),i.isPropagationStopped())break}o.row(t)})),o._super()}}),Mn=r.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),''+(e.settings.title?'
'+e.settings.title+"
":"")+'
'+(e.settings.html||"")+t.renderHtml(e)+"
"}}),Dn=r.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 n=this,e=n.items();n.settings.formItemDefaults||(n.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t=e.settings.label;t&&((t=new Mn(m.extend({items:{type:"label",id:e._id+"-l",text:t,flex:0,forId:e._id,disabled:e.disabled()}},n.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),void 0===e.settings.flex&&(e.settings.flex=1),n.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 i=this;function e(){var e,t,n=0,r=[];if(!1!==i.settings.labelGapCalc)for(("children"===i.settings.labelGapCalc?i.find("formitem"):i.items()).filter("formitem").each(function(e){var e=e.items()[0],t=e.getEl().clientWidth;n=n'+(e.settings.title?''+e.settings.title+" ":"")+''+(e.settings.html||"")+t.renderHtml(e)+"
"}}),En=0,Ln=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++En+String(t)},S={fromHtml:function(e,t){t=(t||document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1",s)),null!==r&&a.push(Kr("",r)),a))],p.foldl(s,function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(l,t)},[])):Zr(e,i(P))}function Mr(r,n,i,o){function t(e){var t=Vr(i),t=Tr(e,t,o,n);r.showAutoComplete(t,e)}r.on("autocomplete",function(){t(r.value())}),r.on("selectitem",function(e){var e=e.value,t=(r.value(e.url),function(e){e=e.title;return e.raw||e}(e));"image"===o?r.fire("change",{meta:{alt:t,attach:e.attach}}):r.fire("change",{meta:{text:t,attach:e.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;e.isDefaultPrevented()||(e=r.value(),n=P[t=o],/^https?/.test(e)&&(n?p.indexOf(n,e).isNone()&&(P[t]=n.slice(0,Gr).concat(e)):P[t]=[e]))})})}function Dr(n,e,t){var r,i=e.filepicker_validator_handler;i&&(r=function(e){0===e.length?n.statusLevel("none"):i({url:e,type:t},function(e){t=(e=e).status,e=e.message;var t="valid"===t?{status:"ok",message:e}:"unknown"===t||"invalid"===t?{status:"warn",message:e}:{status:"none",message:""};n.statusMessage(t.message),n.statusLevel(t.status)})},n.state.on("change:value",function(e){r(e.value)}))}var Sr=function(e,n){return hr(e,n).map(function(e){var t=Kn(e.versionRegexes,n);return{current:e.name,version:t}})},Er=function(e,n){return hr(e,n).map(function(e){var t=Kn(e.versionRegexes,n);return{current:e.name,version:t}})},R=function(e,t){return-1!==e.indexOf(t)},Lr=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Lr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return R(e,"edge/")&&R(e,"chrome")&&R(e,"safari")&&R(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Lr],search:function(e){return R(e,"chrome")&&!R(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return R(e,"msie")||R(e,"trident")}},{name:"Opera",versionRegexes:[Lr,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:N("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:N("firefox")},{name:"Safari",versionRegexes:[Lr,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(R(e,"safari")||R(e,"mobile/"))&&R(e,"applewebkit")}}],Nr=[{name:"Windows",search:N("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return R(e,"iphone")||R(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:N("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:N("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:N("linux"),versionRegexes:[]},{name:"Solaris",search:N("sunos"),versionRegexes:[]},{name:"FreeBSD",search:N("freebsd"),versionRegexes:[]}],Rr={browsers:c.constant(Lr),oses:c.constant(Nr)},Ar=function(e){var t,n,r,i,o,a,s,l=Rr.browsers(),u=Rr.oses(),l=Sr(l,e).fold(ir,or),u=Er(u,e).fold(pr,mr),e=(n=l,e=e,r=(t=u).isiOS()&&!0===/ipad/i.test(e),i=t.isiOS()&&!r,o=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,o=r||o||a&&!0===/mobile/i.test(e),s=(a=t.isiOS()||t.isAndroid())&&!o,n=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(e),{isiPad:c.constant(r),isiPhone:c.constant(i),isTablet:c.constant(o),isPhone:c.constant(s),isTouch:c.constant(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:c.constant(n)});return{browser:l,os:u,deviceType:e}},Lr=gt(function(){var e=navigator.userAgent;return Ar(e)}),Pr=Nn,Or=t,A={all:function(e,t){t=void 0===t?document:t.dom();return gr(t)?[]:p.map(t.querySelectorAll(e),S.fromDom)},is:function(e,t){e=e.dom();if(e.nodeType!==Pr)return!1;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){t=void 0===t?document:t.dom();return gr(t)?s.none():s.from(t.querySelector(e)).map(S.fromDom)}},Ir=({detect:Lr}.detect().browser.isIE(),vr),Yr=(Vn.immutable("element","offset"),function(e,t){return A.all(t,e)}),Fr=m.trim,Br=yr("true"),Hr=yr("false"),jr=function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return Br(e)}return!1},Ur=function(e,t){return p.map(Yr(S.fromDom(t),e),function(e){return e.dom()})},zr=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&xr(e);var t},$r=function(e){return wr(e)&&xr(e)},Wr=function(e){var t,n=e.id||Ln("h");return br("header",_r(e),"#"+n,wr(t=e)?parseInt(t.nodeName.substr(1),10):0,function(){e.id=n})},qr=function(e){var t=e.id||e.name,e=_r(e);return br("anchor",e||"#"+t,"#"+t,0,c.noop)},Vr=function(e){e=Ur("h1,h2,h3,h4,h5,h6,a:not([href])",e);return p.filter(p.map(p.filter(e,$r),Wr).concat(p.map(p.filter(e,zr),qr)),Cr)},P={},Gr=5,Xr=function(e){return m.map(e,kr)},Kr=function(e,t){return{title:e,value:{title:e,url:t,attach:c.noop}}},Jr=function(t,e){return!p.exists(e,function(e){return e.url===t})},Qr=function(e,t,n){e=t in e?e[t]:n;return!1===e?null:e},Zr=function(e,t){var n=e.toLowerCase(),t=m.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===t.length&&t[0].title===e?[]:t},ei=gn.extend({Statics:{clearHistory:function(){P={}}},init:function(e){var t,n,r,i=this,o=(window.tinymce||z).activeEditor,a=o.settings,s=e.filetype;e.spellcheck=!1,(r=(r=a.file_picker_types||a.file_browser_callback_types)&&m.makeMap(r,/[, ]/))&&!r[s]||(!(n=a.file_picker_callback)||r&&!r[s]?!(n=a.file_browser_callback)||r&&!r[s]||(t=function(){n(i.getEl("inp").id,i.value(),s,window)}):t=function(){var e=i.fire("beforecall").meta,e=m.extend({filetype:s},e);n.call(o,function(e,t){i.value(e).fire("change",{meta:t})},i.value(),e)}),t&&(e.icon="browse",e.onaction=t),i._super(e),i.classes.add("filepicker"),Mr(i,a,o.getBody(),s),Dr(i,a,s)}}),ti=cn.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()})}}),ni=cn.extend({recalc:function(e){var t,n,r,i,o,a,s,l,I,u,c,d,f,p,m,h,g,v,y,b,_,w,x,C,k,T,M,D,S=[],E=Math.max,Y=Math.min,L=e.items().filter(":visible"),N=e.layoutRect(),R=e.paddingBox,A=e.settings,P=e.isRtl()?A.direction||"row-reversed":A.direction,O=A.align,F=e.isRtl()?A.pack||"end":A.pack,B=A.spacing||0;for("row-reversed"!==P&&"column-reverse"!==P||(L=L.set(L.toArray().reverse()),P=P.split("-")[0]),A="column"===P?(h="y",p="h",m="minH",g="maxH",y="innerH",v="top",b="deltaH",_="contentH",T="left",C="w",w="x",x="innerW",k="minW",M="right",D="deltaW","contentW"):(h="x",p="w",m="minW",g="maxW",y="innerW",v="left",b="deltaW",_="contentW",T="top",C="h",w="y",x="innerH",k="minH",M="bottom",D="deltaH","contentH"),i=N[y]-R[v]-R[v],t=f=r=0,n=L.length;t'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),$i=i.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.classPrefix;return''+this.encode(this.state.get("text"))+'
'},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()}}),Wi=i.extend({init:function(e){this._super(e),this.classes.add("widget").add("label"),this.canFocus=!1,e.multiline&&this.classes.add("autoscroll"),e.strong&&this.classes.add("strong")},initLayoutRect:function(){var e=this._super();return this.settings.multiline&&(_.getSize(this.getEl()).width>e.maxW&&(e.minW=e.maxW,this.classes.add("multiline")),this.getEl().style.width=e.minW+"px",e.startMinH=e.h=e.minH=Math.min(e.maxH,_.getSize(this.getEl()).height)),e},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=this,n=t.settings.forId,r=t.settings.html||t.encode(t.state.get("text"));return(n=!n&&(e=t.settings.forName)&&(e=t.getRoot().find("#"+e)[0])?e._id:n)?'"+r+" ":''+r+" "},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()}}),qi=r.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()}}),Vi=qi.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}});var Gi=dn.extend({init:function(e){this._renderOpen=!0,this._super(e),e=this.settings,this.classes.add("menubtn"),e.fixedWidth&&this.classes.add("fixed-width"),this.aria("haspopup",!0),this.state.set("menu",e.menu||this.render())},showMenu:function(e){var t=this;if(t.menu&&t.menu.visible()&&!1!==e)return t.hideMenu();t.menu||(e=t.state.get("menu")||[],t.classes.add("opened"),e.length?e={type:"menu",animate:!0,items:e}:(e.type=e.type||"menu",e.animate=!0),e.renderTo?t.menu=e.parent(t).show().renderTo():t.menu=h.create(e).parent(t).renderTo(),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control.parent()===t.menu&&(e.stopPropagation(),t.focus(),t.hideMenu())}),t.menu.on("select",function(){t.focus()}),t.menu.on("show hide",function(e){e.control===t.menu&&(t.activeMenu("show"===e.type),t.classes.toggle("opened","show"===e.type)),t.aria("expanded","show"===e.type)}).fire("show")),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.repaint(),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),t.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=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i=e.state.get("text"),o="",a=e.settings.image;return a=a?(r="none"," style=\"background-image: url('"+(a="string"!=typeof a?window.getSelection?a[0]:a[1]:a)+"')\""):"",i&&(e.classes.add("btn-has-text"),o=''+e.encode(i)+" "),r=e.settings.icon?n+"ico "+n+"i-"+r:"",e.aria("role",e.parent()instanceof Vi?"menuitem":"button"),''+(r?' ":"")+o+'
'},postRender:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return 1;e=e.parentNode}}(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,e=r.parent();n&&e&&n instanceof Gi&&n.parent()===e&&(e.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()}}),Xi=T.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]=m.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==y.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 r(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Wt(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",r)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0===e.length?n.hide():n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",r(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded"))}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var t=this;return t.items().each(function(e){e=e.settings;if(e.icon||e.image||e.selectable)return!(t._hasIcons=!0)}),t.settings.itemsFactory&&t.on("postrender",function(){t.settings.itemsFactory&&t.load()}),t.on("show hide",function(e){e.control===t&&("show"===e.type?u.setTimeout(function(){t.classes.add("in")},0):t.classes.remove("in"))}),t._super()}}),Ki=Gi.extend({init:function(r){var e,i,o,n,a=this;a._super(r),r=a.settings,a._values=e=r.values,e&&(void 0!==r.value&&function e(t){for(var n=0;n").replace(new RegExp(u("]mce~match!"),"g"),"")}return o&&e.parent().classes.add("menu-has-icons"),n.image&&(a=" style=\"background-image: url('"+n.image+"')\""),s=s&&function(e){var t,n,r={},r=y.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"};for(e=e.split("+"),t=0;t ":"",i=d(e.encode(c(i))),l=d(e.encode(c(l))),''+o+("-"!==i?'
'+i+" ":"")+(s?'":"")+(n.menu?'
':"")+(l?'":"")+"
"},postRender:function(){var e,t=this,n=t.settings,r=n.textStyle;return(r="function"==typeof r?r.call(this):r)&&(e=t.getEl("text"))&&(e.setAttribute("style",r),t._textStyle=r),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){var t,n,r;return n=e,(r=(t=this)._textStyle)&&((t=t.getEl("text")).setAttribute("style",r),n)&&(t.style.color="",t.style.backgroundColor=""),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),Qi=mn.extend({Defaults:{classes:"radio",role:"radio"}}),Zi=i.extend({renderHtml:function(){var e=this.classPrefix;return this.classes.add("resizehandle"),"both"===this.settings.direction&&this.classes.add("resizehandle-both"),this.canFocus=!1,'
'},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new x(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 eo(e){var t="";if(e)for(var n=0;n'+e[n]+"";return t}var to=i.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=eo(this._options);return this.size&&(e=' size = "'+this.size+'"'),'"+t+" "},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=eo(e.value)}),t._super()}});function no(e,t,n){return e=n<(e=e
'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,r,i,o,a,s,l,u,c,d,f,p,m,h,g=this;function v(e){var t=g.value();t=no(((t+a)/(s-a)+.05*e)*(s-a)-a,a,s),g.value(t),g.fire("dragstart",{value:t}),g.fire("drag",{value:t}),g.fire("dragend",{value:t})}e=g._minValue,t=g._maxValue,o="v"===g.settings.orientation?(n="screenY",r="top",i="height","h"):(n="screenX",r="left",i="width","w"),g._super(),a=e,s=t,g.on("keydown",function(e){switch(e.keyCode){case 37:case 38:v(-1);break;case 39:case 40:v(1)}}),l=e,u=t,c=g.getEl("handle"),g._dragHelper=new x(g._id,{handle:g._id+"-handle",start:function(e){d=e[n],f=parseInt(g.getEl("handle").style[r],10),p=(g.layoutRect()[o]||100)-_.getSize(c)[i],g.fire("dragstart",{value:h})},drag:function(e){e=e[n]-d;m=no(f+e,0,p),c.style[r]=m+"px",h=l+m/p*(u-l),g.value(h),g.tooltip().text(""+g.settings.previewFilter(h)).show().moveRel(c,"bc tc"),g.fire("drag",{value:h})},stop:function(){g.tooltip().hide(),g.fire("dragend",{value:h})}})},repaint:function(){this._super(),io(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){io(t,e.value)}),t._super()}}),so=i.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'
'}}),lo=Gi.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t=this.getEl(),n=this.layoutRect();return this._super(),e=t.firstChild,t=t.lastChild,b(e).css({width:n.w-_.getSize(t).width,height:n.h-2}),b(t).css({height:n.h-2}),this},activeMenu:function(e){b(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i=e.state.get("text"),o=e.settings,a="",s=o.image;return s=s?(r="none"," style=\"background-image: url('"+(s="string"!=typeof s?window.getSelection?s[0]:s[1]:s)+"')\""):"",r=o.icon?n+"ico "+n+"i-"+r:"",i&&(e.classes.add("btn-has-text"),a=''+e.encode(i)+" "),i="boolean"==typeof o.active?' aria-pressed="'+o.active+'"':"",''+(r?' ":"")+a+' '+(e._menuBtnText?(r?" ":"")+e._menuBtnText:"")+'
'},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()}}),uo=ri.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),co=Yt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),b(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true"),b(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 n=this,e=n._layout,r="",i=n.classPrefix;return n.preRender(),e.preRender(n),n.items().each(function(e,t){t=n._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labelledby",t),r+=''+n.encode(e.settings.title)+"
"}),'"},postRender:function(){var r=this;r._super(),r.settings.activeTab=r.settings.activeTab||0,r.activateTab(r.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===r._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&r.activateTab(n)})},initLayoutRect:function(){var e,t,n=_.getSize(this.getEl("head")).width,r=(n=n<0?0:n,t=0,this.items().each(function(e){n=Math.max(n,e.layoutRect().minW),t=Math.max(t,e.layoutRect().minH)}),this.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=n,e.settings.h=t,e.layoutRect({x:0,y:0,w:n,h:t})}),_.getSize(this.getEl("head")).height);return this.settings.minWidth=n,this.settings.minHeight=t+r,(e=this._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),fo=i.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=this.getEl().style,n=this._layoutRect,r=this._lastRepaintRect||{},i=document;return!this.settings.multiline&&i.all&&(!i.documentMode||i.documentMode<=8)&&(t.lineHeight=+n.h+"px"),e=(i=this.borderBox).left+i.right+8,i=i.top+i.bottom+(this.settings.multiline?8:0),n.x!==r.x&&(t.left=n.x+"px",r.x=n.x),n.y!==r.y&&(t.top=n.y+"px",r.y=n.y),n.w!==r.w&&(t.width=n.w-e+"px",r.w=n.w),n.h!==r.h&&(t.height=n.h-i+"px",r.h=n.h),this._lastRepaintRect=r,this.fire("repaint",{},!1),this},renderHtml:function(){var e,t=this.settings,n={id:this._id,hidefocus:"1"};return m.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){n[e]=t[e]}),this.disabled()&&(n.disabled="disabled"),t.subtype&&(n.type=t.subtype),(e=_.create(t.multiline?"textarea":"input",n)).value=this.state.get("value"),e.className=this.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()}}),Nr=function(n){n.ui?m.each(oo(),function(e,t){n.ui[t]=e}):n.ui=oo()};m.each(oo(),function(e,t){h.add(t,e)}),Nr(window.tinymce||{}),U.add("modern",function(e){return ji.setup(e),ln(e)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-advlist",["tinymce"],function(){return function(){!function(){"use strict";function s(r,i){return function(e){var n=e.control;r.on("NodeChange",function(e){var t=function(e,t){for(var n=0;nf.getAutoResizeMinHeight(e)&&(n=r),(l=f.getAutoResizeMaxHeight(e))&&l]*>(( | |[ \t]| ]*>)+?|)"+n+">| $","i").test(t)}function i(e){var t=parseInt(u.getItem(p.getAutoSavePrefix(e)+"time"),10)||0;return!((new Date).getTime()-t>p.getAutoSaveRetention(e)&&(o(e,!1),1))}function o(e,t){var n=p.getAutoSavePrefix(e);u.removeItem(n+"draft"),u.removeItem(n+"time"),!1!==t&&d.fireRemoveDraft(e)}function a(e){var t=p.getAutoSavePrefix(e);!n(e)&&e.isDirty()&&(u.setItem(t+"draft",e.getContent({format:"raw",no_events:!0})),u.setItem(t+"time",(new Date).getTime().toString()),d.fireStoreDraft(e))}function t(e){var t=p.getAutoSavePrefix(e);i(e)&&(e.setContent(u.getItem(t+"draft"),{format:"raw"}),d.fireRestoreDraft(e))}function s(t,n){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[n].concat(e))}}function l(n,r){return function(e){var t=e.control;t.disabled(!m.hasDraft(n)),n.on("StoreDraft RestoreDraft RemoveDraft",function(){t.disabled(!m.hasDraft(n))}),m.startStoreDraft(n,r)}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),d={fireRestoreDraft:function(e){return e.fire("RestoreDraft")},fireStoreDraft:function(e){return e.fire("StoreDraft")},fireRemoveDraft:function(e){return e.fire("RemoveDraft")}},f=function(e,t){return((e=/^(\d+)([ms]?)$/.exec(""+(e||t)))[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(e,10)},p={shouldAskBeforeUnload:function(e){return e.getParam("autosave_ask_before_unload",!0)},getAutoSavePrefix:function(e){var t=e.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return t=(t=(t=(t=t.replace(/\{path\}/g,document.location.pathname)).replace(/\{query\}/g,document.location.search)).replace(/\{hash\}/g,document.location.hash)).replace(/\{id\}/g,e.id)},shouldRestoreWhenEmpty:function(e){return e.getParam("autosave_restore_when_empty",!1)},getAutoSaveInterval:function(e){return f(e.settings.autosave_interval,"30s")},getAutoSaveRetention:function(e){return f(e.settings.autosave_retention,"20m")}},m={isEmpty:n,hasDraft:i,removeDraft:o,storeDraft:a,restoreDraft:t,startStoreDraft:function(e,t){var n=p.getAutoSaveInterval(e);t.get()||(setInterval(function(){e.removed||a(e)},n),t.set(!0))},restoreLastDraft:function(e){e.undoManager.transact(function(){t(e),o(e)}),e.focus()}},h=function(e){return{hasDraft:s(m.hasDraft,e),storeDraft:s(m.storeDraft,e),restoreDraft:s(m.restoreDraft,e),removeDraft:s(m.removeDraft,e),isEmpty:s(m.isEmpty,e)}},g=tinymce.util.Tools.resolve("tinymce.EditorManager"),v=(g._beforeUnloadHandler=function(){var t;return c.each(g.get(),function(e){e.plugins.autosave&&e.plugins.autosave.storeDraft(),!t&&e.isDirty()&&p.shouldAskBeforeUnload(e)&&(t=e.translate("You have unsaved changes are you sure you want to navigate away?"))}),t},function(e){window.onbeforeunload=g._beforeUnloadHandler}),y=function(e,t){e.addButton("restoredraft",{title:"Restore last draft",onclick:function(){m.restoreLastDraft(e)},onPostRender:l(e,t)}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:function(){m.restoreLastDraft(e)},onPostRender:l(e,t),context:"file"})};e.add("autosave",function(e){var t=r(!1);return v(e),y(e,t),h(e)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-bbcode",["tinymce"],function(){return function(){!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(n){n=t.trim(n);function e(e,t){n=n.replace(e,t)}return e(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),e(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),e(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),e(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),e(/(.*?)<\/font>/gi,"$1"),e(/ /gi,"[img]$1[/img]"),e(/(.*?)<\/span>/gi,"[code]$1[/code]"),e(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),e(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),e(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),e(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),e(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),e(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),e(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),e(/<\/(strong|b)>/gi,"[/b]"),e(/<(strong|b)>/gi,"[b]"),e(/<\/(em|i)>/gi,"[/i]"),e(/<(em|i)>/gi,"[i]"),e(/<\/u>/gi,"[/u]"),e(/(.*?)<\/span>/gi,"[u]$1[/u]"),e(//gi,"[u]"),e(/]*>/gi,"[quote]"),e(/<\/blockquote>/gi,"[/quote]"),e(/ /gi,"\n"),e(/ /gi,"\n"),e(/ /gi,"\n"),e(//gi,""),e(/<\/p>/gi,"\n"),e(/ |\u00a0/gi," "),e(/"/gi,'"'),e(/</gi,"<"),e(/>/gi,">"),e(/&/gi,"&"),n},r=function(n){n=t.trim(n);function e(e,t){n=n.replace(e,t)}return e(/\n/gi," "),e(/\[b\]/gi,""),e(/\[\/b\]/gi," "),e(/\[i\]/gi,""),e(/\[\/i\]/gi," "),e(/\[u\]/gi,""),e(/\[\/u\]/gi," "),e(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2 '),e(/\[url\](.*?)\[\/url\]/gi,'$1 '),e(/\[img\](.*?)\[\/img\]/gi,' '),e(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2 '),e(/\[code\](.*?)\[\/code\]/gi,'$1 '),e(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),n};e.add("bbcode",function(){return{init:function(e){e.on("beforeSetContent",function(e){e.content=r(e.content)}),e.on("postProcess",function(e){e.set&&(e.content=r(e.content)),e.get&&(e.content=n(e.content))})}}})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-charmap",["tinymce"],function(){return function(){!function(){"use strict";function i(e){for(;e;){if("TD"===e.nodeName)return e;e=e.parentNode}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e,t){return e.fire("insertCustomChar",{chr:t})},o=function(e,t){t=n(e,t).chr;e.execCommand("mceInsertContent",!1,t)},t=tinymce.util.Tools.resolve("tinymce.util.Tools"),r={getCharMap:function(e){return e.settings.charmap},getCharMapAppend:function(e){return e.settings.charmap_append}},a=t.isArray,s=function(e){return a(e)?[].concat(t.grep(e,function(e){return a(e)&&2===e.length})):"function"==typeof e?e():[]},l=function(e){return e=e,t=[["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"]],(n=r.getCharMap(e))&&(t=s(n)),(n=r.getCharMapAppend(e))?[].concat(t).concat(s(n)):t;var t,n},u=function(t){return{getCharMap:function(){return l(t)},insertChar:function(e){o(t,e)}}},c=function(e){for(var t,n=Math.min(e.length,25),r=Math.ceil(e.length/n),i='
',o=0;o",t=0;t'+s+"
"):i+=" "}i+=""}return i+="
"},d=function(n){var e={type:"container",html:c(l(n)),onclick:function(e){var t=e.target;/^(TD|DIV)$/.test(t.nodeName)&&(t=i(t).firstChild)&&t.hasAttribute("data-chr")&&(t=t.getAttribute("data-chr"),t=parseInt(t,10),isNaN(t)||o(n,String.fromCharCode(t)),e.ctrlKey||r.close())},onmouseover:function(e){e=i(e.target);e&&e.firstChild?(r.find("#preview").text(e.firstChild.firstChild.data),r.find("#previewTitle").text(e.title)):(r.find("#preview").text(" "),r.find("#previewTitle").text(" "))}},r=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(){r.close()}}]})},f=function(e){e.addCommand("mceShowCharmap",function(){d(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 f(e),p(e),u(e)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-code",["tinymce"],function(){return function(){!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),r=function(e){return e.getParam("code_dialog_width",600)},i=function(e){return e.getParam("code_dialog_height",Math.min(t.DOM.getViewPort().h-200,500))},o=function(e,t){e.focus(),e.undoManager.transact(function(){e.setContent(t)}),e.selection.setCursorLocation(),e.nodeChanged()},a=function(e){return e.getContent({source_view:!0})},n=function(t){var e=r(t),n=i(t);t.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e,minHeight:n,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(e){o(t,e.data.code)}}).find("#code").value(a(t))},s=function(e){e.addCommand("mceCodeEditor",function(){n(e)})},l=function(e){e.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){n(e)}}),e.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){n(e)}})};e.add("code",function(e){return s(e),l(e),{}})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-colorpicker",["tinymce"],function(){return function(){!function(){"use strict";function i(e,t){var n=(t=r(t)).toRgb();e.fromJSON({r:n.r,g:n.g,b:n.b,hex:t.toHex().substr(1)}),o(e,t.toHex())}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.util.Color"),o=function(e,t){e.find("#preview")[0].getEl().style.background=t},a=function(e,t,n){var r=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:n,onchange:function(){var e=this.rgb();r&&(r.find("#r").value(e.r),r.find("#g").value(e.g),r.find("#b").value(e.b),r.find("#hex").value(this.value().substr(1)),o(r,this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e=r.find("colorpicker")[0],t=this.name(),n=this.value();"hex"===t?(i(r,n="#"+n),e.value(n)):(n={r:r.find("#r").value(),g:r.find("#g").value(),b:r.find("#b").value()},e.value(n),i(r,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(){t("#"+r.toJSON().hex)}});i(r,n)};e.add("colorpicker",function(n){n.settings.color_picker_callback||(n.settings.color_picker_callback=function(e,t){a(n,e,t)})})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-contextmenu",["tinymce"],function(){return function(){!function(){"use strict";function r(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return r(n)}}}function n(e,t){var n,r;return e&&"static"!==o.DOM.getStyle(e,"position",!0)?(n=(r=o.DOM.getPos(e)).x-e.scrollLeft,r=r.y-e.scrollTop,u(t,-n,-r)):u(t,0,0)}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e){return{isContextMenuVisible:function(){return e.get()}}},a={shouldNeverUseNative:function(e){return e.settings.contextmenu_never_use_native},getContextMenu:function(e){return e.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")}},o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=function(e){return o.DOM.select(e.settings.ui_container)[0]},l=function(e,t){return{x:e,y:t}},u=function(e,t,n){return l(e.x+t,e.y+n)},c=function(e,t){return e.inline?n(s(e),l(t.pageX,t.pageY)):(t=function(e,t){e=o.DOM.getPos(e);return u(t,e.x,e.y)}(e.getContentAreaContainer(),l(t.clientX,t.clientY)),n(s(e),t))},d=tinymce.util.Tools.resolve("tinymce.ui.Factory"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),p=function(e,t,n,r){null===r.get()?r.set(function(n,t){var e,r=[],i=a.getContextMenu(n);f.each(i.split(/[ ,]/),function(e){var t=n.menuItems[e];(t="|"===e?{text:e}:t)&&(t.shortcut="",r.push(t))});for(var o=0;o",t.each(e,function(e){var t=n+"/img/smiley-"+e+".gif";r+=' '}),r+=""}),r+=""},r=function(r,e){e=n(e);r.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:e,onclick:function(e){var t,n,e=r.dom.getParent(e.target,"a");e&&(t=r,n=e.getAttribute("data-mce-url"),e=e.getAttribute("data-mce-alt"),t.insertContent(t.dom.createHTML("img",{src:n,alt:e})),this.hide())}},tooltip:"Emoticons"})};e.add("emoticons",function(e,t){r(e,t)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-fullpage",["tinymce"],function(){return function(){!function(){"use strict";function r(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return r(n)}}}function c(e){return t({validate:!1,root_name:"#document"}).parse(e)}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.html.DomParser"),d=tinymce.util.Tools.resolve("tinymce.html.Node"),f=tinymce.util.Tools.resolve("tinymce.html.Serializer"),h={shouldHideInSourceView:function(e){return e.getParam("fullpage_hide_in_source_view")},getDefaultXmlPi:function(e){return e.getParam("fullpage_default_xml_pi")},getDefaultEncoding:function(e){return e.getParam("fullpage_default_encoding")},getDefaultFontFamily:function(e){return e.getParam("fullpage_default_font_family")},getDefaultFontSize:function(e){return e.getParam("fullpage_default_font_size")},getDefaultTextColor:function(e){return e.getParam("fullpage_default_text_color")},getDefaultTitle:function(e){return e.getParam("fullpage_default_title")},getDefaultDocType:function(e){return e.getParam("fullpage_default_doctype","")}},g={parseHeader:c,htmlToData:function(e,t){var n,t=c(t),r={};function i(e,t){return e.attr(t)||""}return r.fontface=h.getDefaultFontFamily(e),r.fontsize=h.getDefaultFontSize(e),7===(e=t.firstChild).type&&(r.xml_pi=!0,n=/encoding="([^"]+)"/.exec(e.value))&&(r.docencoding=n[1]),(e=t.getAll("#doctype")[0])&&(r.doctype=""),(e=t.getAll("title")[0])&&e.firstChild&&(r.title=e.firstChild.value),m.each(t.getAll("meta"),function(e){var t=e.attr("name"),n=e.attr("http-equiv");t?r[t.toLowerCase()]=e.attr("content"):"Content-Type"===n&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(r.docencoding=t[1])}),(e=t.getAll("html")[0])&&(r.langcode=i(e,"lang")||i(e,"xml:lang")),r.stylesheets=[],m.each(t.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&r.stylesheets.push(e.attr("href"))}),(e=t.getAll("body")[0])&&(r.langdir=i(e,"dir"),r.style=i(e,"style"),r.visited_color=i(e,"vlink"),r.link_color=i(e,"link"),r.active_color=i(e,"alink")),r},dataToHtml:function(e,o,t){var a,n,s,r=e.dom;function i(e,t,n){e.attr(t,n||void 0)}function l(e){n.firstChild?n.insert(e,n.firstChild):n.append(e)}a=c(t),(n=a.getAll("head")[0])||(s=a.getAll("html")[0],n=new d("head",1),s.firstChild?s.insert(n,s.firstChild,!0):s.append(n)),s=a.firstChild,o.xml_pi?(t='version="1.0"',o.docencoding&&(t+=' encoding="'+o.docencoding+'"'),7!==s.type&&(s=new d("xml",7),a.insert(s,a.firstChild,!0)),s.value=t):s&&7===s.type&&s.remove(),s=a.getAll("#doctype")[0],o.doctype?(s||(s=new d("#doctype",10),o.xml_pi?a.insert(s,a.firstChild):l(s)),s.value=o.doctype.substring(9,o.doctype.length-1)):s&&s.remove(),s=null,m.each(a.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(s=e)}),o.docencoding?(s||((s=new d("meta",1)).attr("http-equiv","Content-Type"),s.shortEnded=!0,l(s)),s.attr("content","text/html; charset="+o.docencoding)):s&&s.remove(),s=a.getAll("title")[0],o.title?(s?s.empty():l(s=new d("title",1)),s.append(new d("#text",3)).value=o.title):s&&s.remove(),m.each("keywords,description,author,copyright,robots".split(","),function(e){for(var t,n=a.getAll("meta"),r=o[e],i=0;i"))}},n=function(t,n){var r=g.htmlToData(t,n.get());t.windowManager.open({title:"Document properties",data:r,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){e=g.dataToHtml(t,m.extend(r,e.data),n.get());n.set(e)}})},i=function(e,t){e.addCommand("mceFullPageProperties",function(){n(e,t)})},v={protectHtml:function(e,t){return m.each(e,function(e){t=t.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),t},unprotectHtml:function(e){return e.replace(//g,function(e,t){return unescape(t)})}},y=m.each,b=function(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})},_=function(e){var t,n="",r="";return h.getDefaultXmlPi(e)&&(n+='\n'),n=n+h.getDefaultDocType(e)+"\n\n\n",(t=h.getDefaultTitle(e))&&(n+=""+t+" \n"),(t=h.getDefaultEncoding(e))&&(n+=' \n'),(t=h.getDefaultFontFamily(e))&&(r+="font-family: "+t+";"),(t=h.getDefaultFontSize(e))&&(r+="font-size: "+t+";"),(t=h.getDefaultTextColor(e))&&(r+="color: "+t+";"),n+="\n\n"},o=function(d,f,p){d.on("BeforeSetContent",function(e){var t,n,r,i,o,a,s,l,u,c;n=f,r=p,e=e,u="",c=(t=d).dom,e.selection||(l=v.protectHtml(t.settings.protect,e.content),"raw"===e.format&&n.get())||e.source_view&&h.shouldHideInSourceView(t)||(-1!==(o=(l=(l=0!==l.length||e.source_view?l:m.trim(n.get())+"\n"+m.trim(l)+"\n"+m.trim(r.get())).replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",o),n.set(b(l.substring(0,o+1))),-1===(i=l.indexOf("\n")),e=g.parseHeader(n.get()),y(e.getAll("style"),function(e){e.firstChild&&(u+=e.firstChild.value)}),(o=e.getAll("body")[0])&&c.setAttribs(t.getBody(),{style:o.attr("style")||"",dir:o.attr("dir")||"",vLink:o.attr("vlink")||"",link:o.attr("link")||"",aLink:o.attr("alink")||""}),c.remove("fullpage_styles"),a=t.getDoc().getElementsByTagName("head")[0],u&&(c.add(a,"style",{id:"fullpage_styles"},u),(o=c.get("fullpage_styles")).styleSheet)&&(o.styleSheet.cssText=u),s={},m.each(a.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(s[e.href]=e)}),m.each(e.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;s[t]||"stylesheet"!==e.attr("rel")||c.add(a,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete s[t]}),m.each(s,function(e){e.parentNode.removeChild(e)}))}),d.on("GetContent",function(e){var t,n,r;t=d,n=f.get(),r=p.get(),(e=e).selection||e.source_view&&h.shouldHideInSourceView(t)||(e.content=v.unprotectHtml(m.trim(n)+"\n"+m.trim(e.content)+"\n"+m.trim(r)))})},a=function(e){e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"})};e.add("fullpage",function(e){var t=r(""),n=r("");i(e,t),a(e),o(e,t,n)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-fullscreen",["tinymce"],function(){return function(){!function(){"use strict";function r(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return r(n)}}}function t(n){return function(e){var t=e.control;n.on("FullscreenStateChanged",function(e){t.active(e.state)})}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return{isFullscreen:function(){return null!==e.get()}}},i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=function(e,t){e.fire("FullscreenStateChanged",{state:t})},p=i.DOM,o=function(e,t){function n(){var e,t,n;p.setStyle(c,"height",(t=window,(n=document.body).offsetWidth&&(n.offsetWidth,e=n.offsetHeight),t.innerWidth&&t.innerHeight&&(t.innerWidth,e=t.innerHeight),e-(l.clientHeight-c.clientHeight)))}function r(){p.unbind(window,"resize",n)}var i,o=document.body,a=document.documentElement,s=t.get(),l=e.getContainer(),u=l.style,c=e.getContentAreaContainer().firstChild,d=c.style;s?(d.width=s.iframeWidth,d.height=s.iframeHeight,s.containerWidth&&(u.width=s.containerWidth),s.containerHeight&&(u.height=s.containerHeight),p.removeClass(o,"mce-fullscreen"),p.removeClass(a,"mce-fullscreen"),p.removeClass(l,"mce-fullscreen"),i=s.scrollPos,window.scrollTo(i.x,i.y),p.unbind(window,"resize",s.resizeHandler),e.off("remove",s.removeHandler),t.set(null),f(e,!1)):(s={scrollPos:{x:(i=p.getViewPort()).x,y:i.y},containerWidth:u.width,containerHeight:u.height,iframeWidth:d.width,iframeHeight:d.height,resizeHandler:n,removeHandler:r},d.width=d.height="100%",u.width=u.height="",p.addClass(o,"mce-fullscreen"),p.addClass(a,"mce-fullscreen"),p.addClass(l,"mce-fullscreen"),p.bind(window,"resize",n),e.on("remove",r),n(),t.set(s),f(e,!0))},a=function(e,t){e.addCommand("mceFullScreen",function(){o(e,t)})},s=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:t(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:t(e)})};e.add("fullscreen",function(e){var t=r(null);return e.settings.inline||(a(e,t),s(e),e.addShortcut("Ctrl+Shift+F","","mceFullScreen")),n(t)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-hr",["tinymce"],function(){return function(){!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1," ")})},n=function(e){e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};e.add("hr",function(e){t(e),n(e)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-image",["tinymce"],function(){return function(){!function(){"use strict";function n(e,t){for(var n=null!=t?t:a,r=0;r'+n+"")):e.insertContent(s(e,t))},getDateTime:s},p=function(e){e.addCommand("mceInsertDate",function(){f.insertDateTime(e,l.getDateFormat(e))}),e.addCommand("mceInsertTime",function(){f.insertDateTime(e,l.getTimeFormat(e))})},m=tinymce.util.Tools.resolve("tinymce.util.Tools"),h=function(t,n){r=t,i=n,e=l.getFormats(r);var r,i,e=m.map(e,function(e){return{text:f.getDateTime(r,e),onclick:function(){i.set(e),f.insertDateTime(r,e)}}});t.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",menu:e,onclick:function(){var e=n.get();f.insertDateTime(t,e||l.getDefaultDateTime(t))}}),t.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:e,context:"insert"})};e.add("insertdatetime",function(e){var t=r(null);p(e),h(e,t)})}()}.apply(e,arguments)})}(this),function(e){define("tinymce-legacyoutput",["tinymce"],function(){return function(){!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(i){i.settings.inline_styles=!1,i.on("init",function(){var e,t,n,r;e=i,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",n=o.explode(e.settings.font_size_style_values),r=e.schema,e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(e){return o.inArray(n,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),o.each("b,i,u,strike".split(","),function(e){r.addValidElements(e+"[*]")}),r.getElementRule("font")||r.addValidElements("font[face|size|color|style]"),o.each(t.split(","),function(e){e=r.getElementRule(e);e&&!e.attributes.align&&(e.attributes.align={},e.attributesOrder.push("align"))})})},n=function(r){r.addButton("fontsizeselect",function(){var i=[],e=r.settings.fontsizeFormats||"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7";return r.$.each(e.split(" "),function(e,t){var n=t,r=t,t=t.split("=");1'),t.close())}},y=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(e){return e&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className)},b={link:function(o,a){return function(i){o.undoManager.transact(function(){var e=o.selection.getNode(),t=l(o,e),n={href:i.href,target:i.target||null,rel:i.rel||null,class:i.class||null,title:i.title||null};if(v.hasRelList(o.settings)||!1!==v.allowUnsafeLinkTarget(o.settings)||(n.rel=s(n.rel,"_blank"===n.target)),i.href===a.href&&(a.attach(),a={}),t)o.focus(),i.hasOwnProperty("text")&&("innerText"in t?t.innerText=i.text:t.textContent=i.text),o.dom.setAttribs(t,n),o.selection.select(t),o.undoManager.add();else if(m(e)){var t=o,r=n,e=t.dom.select("img",e)[0];if(e){t=t.dom.create("a",r);e.parentNode.insertBefore(t,e);t.appendChild(e)}}else i.hasOwnProperty("text")?o.insertContent(o.dom.createHTML("a",n,o.dom.encode(i.text))):o.execCommand("mceInsertLink",!1,n)})}},unlink:function(r){return function(){r.undoManager.transact(function(){var e=r.selection.getNode();if(m(e)){var t=r,n=t.dom.select("img",e)[0];if(n){e=t.dom.getParents(n,"a[href]",e)[0];if(e){e.parentNode.insertBefore(n,e);t.dom.remove(e)}}}else r.execCommand("unlink")})}},isLink:i,hasLinks:function(e){return 0]+>[^<]+<\/a>$/.test(e)||-1===e.indexOf("href=")))},getAnchorElement:l,getAnchorText:function(e,t){return(t?t.innerText||t.textContent:e.getContent({format:"text"})).replace(/\uFEFF/g,"")},toggleTargetRules:s},h=tinymce.util.Tools.resolve("tinymce.util.Delay"),g=tinymce.util.Tools.resolve("tinymce.util.XHR"),_={},w=function(e,r,t){function i(e,n){return n=n||[],y.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=i(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n}return i(e,t||[])},x=function(t,e,n){var r=t.selection.getRng();h.setEditorTimeout(t,function(){t.windowManager.confirm(e,function(e){t.selection.setRng(r),n(e)})})},C=function(e){var t,n;t=e,n=o,"string"==typeof(e=v.getLinkList(t.settings))?g.send({url:e,success:function(e){n(t,JSON.parse(e))}}):"function"==typeof e?e(function(e){n(t,e)}):n(t,e)},k=function(e,t){return e.dom.getParent(t,"a[href]")},T=function(e){var t=e.getAttribute("data-mce-href");return t||e.getAttribute("href")},M=function(e){return function(){C(e)}},D=function(e){return function(){u(e,a(e))}},S=function(r){return function(e){var t,n;return!!(v.hasContextToolbar(r.settings)&&!function(e){e=e.plugins.contextmenu;return!!e&&e.isContextMenuVisible()}(r)&&b.isLink(e)&&3===(n=(t=(e=r.selection).getRng()).startContainer).nodeType&&e.isCollapsed()&&0=e.childNodes.length?n.data.length:0}:{container:e,offset:t}}function I(e,t){var n,r=t.parentNode;"LI"===r.nodeName&&r.firstChild===t&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),y.isEmpty(e,r)&&x.remove(r)):x.setStyle(r,"listStyleType","none")),y.isListNode(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)}function i(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",k(e,t))}function o(e,t){y.isEmpty(e,t)&&E.remove(t)}function s(e,t){var n,r=t.parentNode;return r?(n=r.parentNode,r!==e.getBody()&&("DD"===t.nodeName?E.rename(t,"DT"):y.isFirstChild(t)&&y.isLastChild(t)?"LI"===n.nodeName?(E.insertAfter(t,n),o(e.dom,n),E.remove(r)):y.isListNode(n)?E.remove(r,!0):(n.insertBefore(D(e,t),r),E.remove(r)):y.isFirstChild(t)?"LI"===n.nodeName?(E.insertAfter(t,n),t.appendChild(r),o(e.dom,n)):y.isListNode(n)?n.insertBefore(t,r):(n.insertBefore(D(e,t),r),E.remove(t)):y.isLastChild(t)?"LI"===n.nodeName?E.insertAfter(t,n):y.isListNode(n)?E.insertAfter(t,r):(E.insertAfter(D(e,t),r),E.remove(t)):(n="LI"===n.nodeName?(r=n,D(e,t,"LI")):y.isListNode(n)?D(e,t,"LI"):D(e,t),q(e,r,t,n),C(e.dom,r.parentNode)))):o(e.dom,t),!0}function l(n,e){g.each(e,function(e,t){n.setAttribute(t,e)})}function c(e,t,n,r){var i=t[n?"startContainer":"endContainer"],t=t[n?"startOffset":"endOffset"];for(1===i.nodeType&&(i=i.childNodes[Math.min(t,i.childNodes.length-1)]||i),!n&&y.isBr(i.nextSibling)&&(i=i.nextSibling);i.parentNode!==r;){if(y.isTextBlock(e,i))return i;if(/^(TD|TH)$/.test(i.parentNode.nodeName))return i;i=i.parentNode}return i}function a(e,t,n){return G(t,n)&&X(e,t,n)&&K(t,n)}function u(e,t,n,r){var i,o,a=t.startContainer,t=t.startOffset;if(3===a.nodeType&&(n?t"):"application/x-shockwave-flash"===r.source1mime?(o='',a.poster&&(o+=' '),o+=" "):-1!==r.source1mime.indexOf("audio")?(o=r,(e=e)?e(o):''+(o.source2?'\n \n":"")+" "):"script"===r.type?'