/* SCEditor v3.2.1 | (C) 2017, Sam Clarke | sceditor.com/license */ (()=>{function i(e,t){return typeof t===e}var ye=i.bind(null,"string"),Xe=i.bind(null,"undefined"),Ke=i.bind(null,"function"),a=i.bind(null,"number");function l(e){return!Object.keys(e).length}function be(e,t){var n=e===!!e,o=n?2:1,r=n?t:e,i=n&&e;function a(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}for(;o{var n=e.style.length;if(n===t.style.length){for(;n--;){var o=e.style[n];if(e.style[o]!==t.style[o])return}return 1}})(e,t):o.value!==_e(t,o.name))return}return 1}}function yt(e){for(;e.firstChild;)Oe(e.firstChild,e);Se(e)}var v,bt={toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:_e(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,startInSourceMode:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,allowedIframeUrls:[],parserOptions:{},dropDownCss:{},allowedTags:[],allowedAttributes:[]},y=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,b=/^data:image\/(png|bmp|gif|p?jpe?g);/i,w=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function wt(e){return e.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function ze(e,t){var n;return e&&(!(n={"&":"&","<":"<",">":">"," ":"  ","\r\n":"
","\r":"
","\n":"
"})!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})),e}function xt(e){var t,n=window.location;return!e||b.test(e)||y.test(e.replace(w,""))||((t=n.pathname.split("/")).pop(),e=n.protocol+"//"+n.host+t.join("/")+"/"+e,y.test(e.replace(w,"")))?e:""}let{entries:Tt,setPrototypeOf:x,isFrozen:T,getPrototypeOf:E,getOwnPropertyDescriptor:C}=Object,{freeze:Ve,seal:e,create:Et}=Object,{apply:S,construct:N}="undefined"!=typeof Reflect&&Reflect,Ct=(Ve=Ve||function(e){return e},e=e||function(e){return e},S=S||function(e,t){for(var n=arguments.length,o=new Array(2{for(let e=0;e/gm),A=e(/\$\{[\w\W]*/gm),t=e(/^data-[\-\w.\u00B7-\uFFFF]+$/),n=e(/^aria-[\-\w]+$/);let $t=e(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);var _=e(/^(?:\w+script|data):/i),R=e(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);let Xt=e(/^html$/i);var M=e(/^[a-z][.\w]*(-[.\w]+)+$/i),Kt=Object.freeze({__proto__:null,ARIA_ATTR:n,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:M,DATA_ATTR:t,DOCTYPE_NAME:Xt,ERB_EXPR:D,IS_ALLOWED_URI:$t,IS_SCRIPT_OR_DATA:_,MUSTACHE_EXPR:k,TMPLIT_EXPR:A});function Zt(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}}let Jt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12};var Qt=function i(e){e=0i(e);if(u.version="3.2.7",u.removed=[],!e||!e.document||e.document.nodeType!==Jt.document||!e.Element)return u.isSupported=!1,u;let r=e.document,l=r,H=l.currentScript,{DocumentFragment:z,HTMLTemplateElement:P,Node:s,Element:B,NodeFilter:t,NamedNodeMap:U=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:W,DOMParser:j,trustedTypes:d}=e;e=B.prototype;let V=Ft(e,"cloneNode"),G=Ft(e,"remove"),Y=Ft(e,"nextSibling"),q=Ft(e,"childNodes"),a=Ft(e,"parentNode");"function"==typeof P&&(e=r.createElement("template")).content&&e.content.ownerDocument&&(r=e.content.ownerDocument);function $(e){return e instanceof RegExp||e instanceof Function}function X(){let e=0{if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;var o="data-tt-policy-suffix",t="dompurify"+((n=t&&t.hasAttribute(o)?t.getAttribute(o):n)?"#"+n:"");try{return e.createPolicy(t,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+t+" could not be created."),null}})(d,H):p)&&"string"==typeof c&&(c=p.createHTML(""));Ve&&Ve(e),o=e}}function f(e,t){try{kt(u.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){kt(u.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(T||E)try{L(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}}function K(e){let t=null,n=null;Te?e=""+e:(o=Rt(e,/^[\r\n\t ]+/),n=o&&o[0]),"application/xhtml+xml"===O&&_===A&&(e=''+e+"");var o=p?p.createHTML(e):e;if(_===A)try{t=(new j).parseFromString(o,O)}catch(e){}if(!t||!t.documentElement){t=ee.createDocument(_,"template",null);try{t.documentElement.innerHTML=Re?c:o}catch(e){}}return o=t.body||t.documentElement,e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),_===A?oe.call(t,x?"html":"body")[0]:x?t.documentElement:o}function Z(e){return te.call(e.ownerDocument||e,e,t.SHOW_ELEMENT|t.SHOW_COMMENT|t.SHOW_TEXT|t.SHOW_PROCESSING_INSTRUCTION|t.SHOW_CDATA_SECTION,null)}function J(e){return e instanceof W&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof U)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)}function Q(e){return"function"==typeof s&&e instanceof s}let p,c="",{implementation:ee,createNodeIterator:te,createDocumentFragment:ne,getElementsByTagName:oe}=r,re=l.importNode,m=Zt(),{MUSTACHE_EXPR:ie,ERB_EXPR:ae,TMPLIT_EXPR:le,DATA_ATTR:se,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:ue,ATTR_WHITESPACE:de,CUSTOM_ELEMENT:fe}=(u.isSupported="function"==typeof Tt&&"function"==typeof a&&ee&&void 0!==ee.createHTMLDocument,Kt),pe=Kt.IS_ALLOWED_URI,g=null,me=qe({},[...Ht,...zt,...Pt,...Ut,...jt]),h=null,ge=qe({},[...Vt,...Gt,...Yt,...qt]),v=Object.seal(Et(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),y=null,he=null,ve=!0,ye=!0,be=!1,we=!0,b=!1,w=!0,x=!1,xe=!1,Te=!1,T=!1,E=!1,C=!1,Ee=!0,Ce=!1,Se=!0,S=!1,n={},N=null,Ne=qe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ke=null,De=qe({},["audio","video","img","source","image","track"]),Ae=null,_e=qe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),k="http://www.w3.org/1998/Math/MathML",D="http://www.w3.org/2000/svg",A="http://www.w3.org/1999/xhtml",_=A,Re,Me=null,Oe=qe({},[k,D,A],_t),R=qe({},["mi","mo","mn","ms","mtext"]),M=qe({},["annotation-xml"]),Ie=qe({},["title","style","font","a","script"]),O=null,Le=["application/xhtml+xml","text/html"],I=null,o=null,Fe=r.createElement("form"),He=qe({},[...zt,...Pt,...Bt]),ze=qe({},[...Ut,...Wt]),L=function(t){kt(u.removed,{element:t});try{a(t).removeChild(t)}catch(e){G(t)}};function F(e,t,n){Ct(e,e=>{e.call(u,t,n,o)})}function Pe(t){let n=null;if(F(m.beforeSanitizeElements,t,null),!J(t)){var e=I(t.nodeName);if(F(m.uponSanitizeElement,t,{tagName:e,allowedTags:g}),!(w&&t.hasChildNodes()&&!Q(t.firstElementChild)&&Ye(/<[/\w!]/g,t.innerHTML)&&Ye(/<[/\w!]/g,t.textContent)||t.nodeType===Jt.progressingInstruction||w&&t.nodeType===Jt.comment&&Ye(/<[/\w]/g,t.data))){if(g[e]&&!y[e])return t instanceof B&&!(e=>{let t=a(e);t&&t.tagName||(t={namespaceURI:_,tagName:"template"});var n=At(e.tagName),o=At(t.tagName);return!!Me[e.namespaceURI]&&(e.namespaceURI===D?t.namespaceURI===A?"svg"===n:t.namespaceURI===k?"svg"===n&&("annotation-xml"===o||R[o]):Boolean(He[n]):e.namespaceURI===k?t.namespaceURI===A?"math"===n:t.namespaceURI===D?"math"===n&&M[o]:Boolean(ze[n]):e.namespaceURI===A?!(t.namespaceURI===D&&!M[o]||t.namespaceURI===k&&!R[o]||ze[n])&&(Ie[n]||!He[n]):!("application/xhtml+xml"!==O||!Me[e.namespaceURI]))})(t)||("noscript"===e||"noembed"===e||"noframes"===e)&&Ye(/<\/no(script|embed|frames)/i,t.innerHTML)?L(t):(b&&t.nodeType===Jt.text&&(n=t.textContent,Ct([ie,ae,le],e=>{n=Mt(n,e," ")}),t.textContent!==n)&&(kt(u.removed,{element:t.cloneNode()}),t.textContent=n),F(m.afterSanitizeElements,t,null));if(!y[e]&&je(e)){if(v.tagNameCheck instanceof RegExp&&Ye(v.tagNameCheck,e))return;if(v.tagNameCheck instanceof Function&&v.tagNameCheck(e))return}if(Se&&!N[e]){var o=a(t)||t.parentNode,r=q(t)||t.childNodes;if(r&&o)for(let e=r.length-1;0<=e;--e){var i=V(r[e],!0);i.__removalCount=(t.__removalCount||0)+1,o.insertBefore(i,Y(t))}}}}L(t)}function Be(e,t,n){if(Ee&&("id"===t||"name"===t)&&(n in r||n in Fe))return!1;if((!ye||he[t]||!Ye(se,t))&&(!ve||!Ye(ce,t)))if(!h[t]||he[t]){if(!(je(e)&&(v.tagNameCheck instanceof RegExp&&Ye(v.tagNameCheck,e)||v.tagNameCheck instanceof Function&&v.tagNameCheck(e))&&(v.attributeNameCheck instanceof RegExp&&Ye(v.attributeNameCheck,t)||v.attributeNameCheck instanceof Function&&v.attributeNameCheck(t,e))||"is"===t&&v.allowCustomizedBuiltInElements&&(v.tagNameCheck instanceof RegExp&&Ye(v.tagNameCheck,n)||v.tagNameCheck instanceof Function&&v.tagNameCheck(n))))return!1}else if(!Ae[t]&&!Ye(pe,Mt(n,de,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ot(n,"data:")||!ke[e])&&(!be||Ye(ue,Mt(n,de,"")))&&n)return!1;return!0}function Ue(n){F(m.beforeSanitizeAttributes,n,null);var o=n.attributes;if(o&&!J(n)){var r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:h,forceKeepAttr:void 0};let e=o.length;for(;e--;){var{name:i,namespaceURI:a,value:l}=o[e],s=I(i);let t="value"===i?l:It(l);if(r.attrName=s,r.attrValue=t,r.keepAttr=!0,r.forceKeepAttr=void 0,F(m.uponSanitizeAttribute,n,r),t=r.attrValue,!Ce||"id"!==s&&"name"!==s||(f(i,n),t="user-content-"+t),w&&Ye(/((--!?|])>)|<\/(style|title|textarea)/i,t))f(i,n);else if("attributename"===s&&Rt(t,"href"))f(i,n);else if(!r.forceKeepAttr)if(r.keepAttr)if(!we&&Ye(/\/>/i,t))f(i,n);else{b&&Ct([ie,ae,le],e=>{t=Mt(t,e," ")});var c=I(n.nodeName);if(Be(c,s,t)){if(p&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!a)switch(d.getAttributeType(c,s)){case"TrustedHTML":t=p.createHTML(t);break;case"TrustedScriptURL":t=p.createScriptURL(t)}if(t!==l)try{a?n.setAttributeNS(a,i,t):n.setAttribute(i,t),J(n)?L(n):Nt(u.removed)}catch(e){f(i,n)}}else f(i,n)}else f(i,n)}F(m.afterSanitizeAttributes,n,null)}}function We(e){var t,n=Z(e);for(F(m.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)F(m.uponSanitizeShadowNode,t,null),Pe(t),Ue(t),t.content instanceof z&&We(t.content);F(m.afterSanitizeShadowDOM,e,null)}let je=function(e){return"annotation-xml"!==e&&Rt(e,fe)};return u.sanitize=function(e){var t,n=1\n"+a),b&&Ct([ie,ae,le],e=>{a=Mt(a,e," ")}),p&&C?p.createHTML(a):a},u.setConfig=function(){var e=0

',toolbarButton:'
{dispName}
',emoticon:'{key}',fontOpt:'{font}',sizeOpt:'{size}',pastetext:'
',table:'
',image:'
',email:'
',link:'
',youtubeMenu:'
',youtube:''};function Pe(e,t,n,o){var r=O[e];return Object.keys(t).forEach(function(e){!1!==o&&(t[e]=ze(String(t[e]))),r=r.replace(new RegExp(wt("{"+e+"}"),"g"),t[e])}),!1!==o&&(r=Qt.sanitize(r,{ADD_ATTR:["unselectable"]})),r=n?ut(r):r}function I(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t=t&&t.nextSibling}3!==n.nodeType||!/[\n\r\t]+/.test(n.nodeValue)||/^pre/.test(Re(n.parentNode,"whiteSpace"))||Se(n),n=t}}var Be={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{state:function(e){var t;if(e=e&&3===e.nodeType?e.parentNode:e)return t="ltr"===Re(e,"direction"),e=Re(e,"textAlign"),/left/.test(e)||e===(t?"start":"end")},exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{state:function(e){var t;if(e=e&&3===e.nodeType?e.parentNode:e)return t="ltr"===Re(e,"direction"),e=Re(e,"textAlign"),/right/.test(e)||e===(t?"end":"start")},exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(t,e,n){var o=Ee("div");De(o,"click","a",function(e){n(ot(this,"font")),t.closeDropDown(!0),e.preventDefault()}),t.opts.fonts.split(",").forEach(function(e){Ne(o,Pe("fontOpt",{font:e},!0))}),t.createDropDown(e,"font-picker",o)},exec:function(e){var t=this;Be.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(t,e,n){var o=Ee("div");De(o,"click","a",function(e){n(ot(this,"size")),t.closeDropDown(!0),e.preventDefault()});for(var r=1;r<=7;r++)Ne(o,Pe("sizeOpt",{size:r},!0));t.createDropDown(e,"fontsize-picker",o)},exec:function(e){var t=this;Be.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(t,e,n){var o=Ee("div"),r="",i=Be.color;i._htmlCache||(t.opts.colors.split("|").forEach(function(e){r+='
',e.split(",").forEach(function(e){/^[\#a-z0-9\-\(\) \/%\.]+$/i.test(e)||(e=""),r+=''}),r+="
"}),i._htmlCache=r),Ne(o,ut(i._htmlCache)),De(o,"click","a",function(e){n(ot(this,"color")),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"color-picker",o)},exec:function(e){var t=this;Be.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=Ee("div"),o=this;Ne(n,Pe("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),De(n,"click",".button",function(e){(t=ke(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){I(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){I(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n;return Me(t,"li")||Me(t,"ul,ol,menu")&&(n=(t=this.getRangeHelper().selectedRange()).startContainer.parentNode,t=t.endContainer.parentNode,n!==n.parentNode.firstElementChild||Me(t,"li")&&t!==t.parentNode.lastElementChild)?0:-1},exec:function(){var e=this.getRangeHelper().getFirstBlockParent();this.focus(),Ce(e,"ul,ol,menu")&&this.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return Ce(t,"ul,ol,menu")?0:-1},exec:function(){Ce(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var r=this,i=Ee("div");Ne(i,Pe("table",{rows:r._("Rows:"),cols:r._("Cols:"),insert:r._("Insert")},!0)),De(i,"click",".button",function(e){var t=Number(ke(i,"#rows")[0].value),n=Number(ke(i,"#cols")[0].value),o="";0"+Array(n+1).join("")+""),r.wysiwygEditorInsertHtml(o+="

"),r.closeDropDown(!0),e.preventDefault())}),r.createDropDown(e,"inserttable",i)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("","
")},tooltip:"Code"},image:{_dropDown:function(t,e,n,o){var r=Ee("div"),i=(Ne(r,Pe("image",{url:t._("URL:"),width:t._("Width (optional):"),height:t._("Height (optional):"),insert:t._("Insert")},!0)),ke(r,"#image")[0]);i.value=n,De(r,"click",".button",function(e){i.value&&o(i.value,ke(r,"#width")[0].value,ke(r,"#height")[0].value),t.closeDropDown(!0),e.preventDefault()}),t.createDropDown(e,"insertimage",r)},exec:function(e){var r=this;Be.image._dropDown(r,e,"",function(e,t,n){var o="";t&&(o+=' width="'+parseInt(t,10)+'"'),n&&(o+=' height="'+parseInt(n,10)+'"'),o+=' src="'+ze(e)+'"',r.wysiwygEditorInsertHtml("")})},tooltip:"Insert an image"},email:{_dropDown:function(n,e,o){var r=Ee("div");Ne(r,Pe("email",{label:n._("E-mail:"),desc:n._("Description (optional):"),insert:n._("Insert")},!0)),De(r,"click",".button",function(e){var t=ke(r,"#email")[0].value;t&&o(t,ke(r,"#des")[0].value),n.closeDropDown(!0),e.preventDefault()}),n.createDropDown(e,"insertemail",r)},exec:function(e){var n=this;Be.email._dropDown(n,e,function(e,t){!n.getRangeHelper().selectedHtml()||t?n.wysiwygEditorInsertHtml(''+ze(t||e)+""):n.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(t,e,n){var o=Ee("div"),r=(Ne(o,Pe("link",{url:t._("URL:"),desc:t._("Description (optional):"),ins:t._("Insert")},!0)),ke(o,"#link")[0]);function i(e){r.value&&n(r.value,ke(o,"#des")[0].value),t.closeDropDown(!0),e.preventDefault()}De(o,"click",".button",i),De(o,"keypress",function(e){13===e.which&&r.value&&i(e)},!0),t.createDropDown(e,"insertlink",o)},exec:function(e){var n=this;Be.link._dropDown(n,e,function(e,t){t||!n.getRangeHelper().selectedHtml()?n.wysiwygEditorInsertHtml(''+ze(t||e)+""):n.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return Ce(this.currentNode(),"a")?0:-1},exec:function(){var e=Ce(this.currentNode(),"a");if(e){for(;e.firstChild;)Oe(e.firstChild,e);Se(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="
",r="
";t?(o=o+(n=n?""+ze(n)+"":"")+t+r,r=null):""===this.getRangeHelper().selectedHtml()&&(r="
"+r),this.wysiwygEditorInsertHtml(o,r)},tooltip:"Insert a Quote"},emoticon:{exec:function(u){function d(e){var n,t=f.opts,o=t.emoticonsRoot||"",r=t.emoticonsCompat,i=f.getRangeHelper(),a=r&&" "!==i.getOuterText(!0,1)?" ":"",l=r&&" "!==i.getOuterText(!1,1)?" ":"",s=Ee("div"),c=Ee("div"),r=be({},t.emoticons.dropdown,e?t.emoticons.more:{});return Ne(s,c),n=Math.sqrt(Object.keys(r).length),De(s,"click","img",function(e){f.insert(a+_e(this,"alt")+l,null,!1).closeDropDown(!0),e.preventDefault()}),we(r,function(e,t){Ne(c,Ee("img",{src:xt(o+(t.url||t)),alt:e,title:t.tooltip||e})),c.children.length>=n&&(c=Ee("div"),Ne(s,c))}),!e&&t.emoticons.more&&(Ne(i=Ee("a",{className:"sceditor-more"}),document.createTextNode(f._("More"))),De(i,"click",function(e){f.createDropDown(u,"more-emoticons",d(!0)),e.preventDefault()}),Ne(s,i)),s}var f=this;f.createDropDown(u,"emoticons",d(!1))},txtExec:function(e){Be.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(r,e,i){var a=Ee("div");Ne(a,Pe("youtubeMenu",{label:r._("Video URL:"),insert:r._("Insert")},!0)),De(a,"click",".button",function(e){var t=ke(a,"#link")[0].value,n=t.match(/(?:v=|v\/|embed\/|youtu.be\/)?([a-zA-Z0-9_-]{11})/),t=t.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),o=0;t&&we(t[1].split(/[hms]/),function(e,t){""!==t&&(o=60*o+Number(t))}),n&&/^[a-zA-Z0-9_\-]{11}$/.test(n[1])&&i(n[1],o),r.closeDropDown(!0),e.preventDefault()}),r.createDropDown(e,"insertlink",a)},exec:function(e){var n=this;Be.youtube._dropDown(n,e,function(e,t){n.wysiwygEditorInsertHtml(Pe("youtube",{id:e,time:t},!1,!1))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,t=t.getDate();return o<10&&(o="0"+o),t<10&&(t="0"+t),e.opts.dateFormat.replace(/year/i,n=n<2e3?1900+n:n).replace(/month/i,o).replace(/day/i,t)},exec:function(){this.insertText(Be.date._date(this))},txtExec:function(){this.insertText(Be.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),e=e.getSeconds();return(t=t<10?"0"+t:t)+":"+(n=n<10?"0"+n:n)+":"+(e=e<10?"0"+e:e)},exec:function(){this.insertText(Be.time._time())},txtExec:function(){this.insertText(Be.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this.getRangeHelper(),t=e.getFirstBlockParent();this.focus(),(t&&!Me(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!Me(t,"body")))&&(e="ltr"===Re(t,"direction")?"":"ltr",Re(t,"direction",e))},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this.getRangeHelper(),t=e.getFirstBlockParent();this.focus(),(t&&!Me(t,"body")||(this.execCommand("formatBlock","p"),(t=e.getFirstBlockParent())&&!Me(t,"body")))&&(e="rtl"===Re(t,"direction")?"":"rtl",Re(t,"direction",e))},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize()),this.focus()},txtExec:function(){this.maximize(!this.maximize()),this.focus()},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode(),this.focus()},txtExec:function(){this.toggleSourceMode(),this.focus()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},L={};function en(i){function a(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)}function e(e,t){e=[].slice.call(e);for(var n,o=a(e.shift()),r=0;rs.length&&c&&3===c.nodeType;)o=c.nodeValue,r=n-s.length,l&&(a=o.length,i=0),l=c,c=t?(u=i=Math.max(a-r,0),s=o.substr(i,a-i)+s,l.previousSibling):(u=i+(a=Math.min(r,o.length)),s+=o.substr(i,a),l.nextSibling);return{node:l||c,offset:u,text:s}};function tn(r,e,i){var a,l,s=e||r.contentDocument||r.document,c="sceditor-start-marker",u="sceditor-end-marker",h=this;h.insertHTML=function(e,t){var n,o;if(!h.selectedRange())return!1;for(t&&(e+=h.selectedHtml()+t),o=Ee("p",{},s),n=s.createDocumentFragment(),o.innerHTML=i(e);o.firstChild;)Ne(n,o.firstChild);h.insertNode(n)},l=function(e,t,n){var o,r=s.createDocumentFragment();if("string"==typeof e?(t&&(e+=h.selectedHtml()+t),r=ut(e)):(Ne(r,e),t&&(Ne(r,h.selectedRange().extractContents()),Ne(r,t))),o=r.lastChild){for(;!He(o.lastChild,!0);)o=o.lastChild;return pt(o)?o.lastChild||Ne(o,document.createTextNode("​")):o=r,h.removeMarkers(),Ne(o,a(c)),Ne(o,a(u)),n?(Ne(e=Ee("div"),r),e.innerHTML):r}},h.insertNode=function(e,t){var n,o,e=l(e,t),t=h.selectedRange(),r=t.commonAncestorContainer,i=[];if(!e)return!1;function a(e){e&&p(e)&&i.indexOf(e)<0&&Se(e)}t.startContainer!==t.endContainer&&(we(r.childNodes,function(e,t){p(t)&&i.push(t)}),n=e.firstChild,o=e.lastChild),t.deleteContents(),r&&3!==r.nodeType&&!pt(r)?Oe(e,r):(t.insertNode(e),a(n&&n.previousSibling),a(o&&o.nextSibling)),h.restoreRange()},h.cloneSelected=function(){var e=h.selectedRange();if(e)return e.cloneRange()},h.selectedRange=function(){var e,t,n=r.getSelection();if(n){if(n.rangeCount<=0){for(t=s.body;t.firstChild;)t=t.firstChild;(e=s.createRange()).setStartBefore(t),n.addRange(e)}return e=0'})},void n.readAsDataURL(t);i[a[s]]=r.getData(a[s])}i.text=i["text/plain"],i.html=L(i["text/html"]),Z(i)}else if(!x){var c=o.scrollTop;for(m.saveRange(),x=We.createDocumentFragment();o.firstChild;)Ne(x,o.firstChild);setTimeout(function(){var e=o.innerHTML;o.innerHTML="",Ne(o,x),o.scrollTop=c,x=!1,m.restoreRange(),Z({html:L(e)})},0)}},Z=function(e){var t=Ee("div",{},d),e=(g.call("pasteRaw",e),lt(w,"pasteraw",e),e.html?(t.innerHTML=L(e.html),mt(t)):t.innerHTML=ze(e.text||""),{val:t.innerHTML}),t=("fragmentToSource"in a&&(e.val=a.fragmentToSource(e.val,d,h)),g.call("paste",e),lt(w,"paste",e),"fragmentToHtml"in a&&(e.val=a.fragmentToHtml(e.val,h)),g.call("pasteHtml",e),m.getFirstBlockParent());A.wysiwygEditorInsertHtml(e.val,null,!0),function e(t){if(t.nodeType===xe){for(var n=t.parentNode,o=t.tagName,r=t.childNodes.length;r--;)e(t.childNodes[r]);if(He(t)&&"BR"!==o){for(r=t.style.length;r--;){var i=t.style[r];Re(n,i)===Re(t,i)&&t.style.removeProperty(i)}if(!t.style.length)if(Qe(t,"style"),"FONT"===o&&(Re(t,"fontFamily").toLowerCase()===Re(n,"fontFamily").toLowerCase()&&Qe(t,"face"),Re(t,"color")===Re(n,"color")&&Qe(t,"color"),Re(t,"fontSize")===Re(n,"fontSize"))&&Qe(t,"size"),!t.attributes.length&&/SPAN|FONT/.test(o))yt(t);else if(/B|STRONG|EM|SPAN|FONT/.test(o))for(var a=/B|STRONG/.test(o),l="EM"===o;n&&He(n)&&(!a||/bold|700/i.test(Re(n,"fontWeight")))&&(!l||"italic"===Re(n,"fontStyle"));){if((n.tagName===o||a&&/B|STRONG/.test(n.tagName))&&vt(n,t)){yt(t);break}n=n.parentNode}var s=t.nextSibling;s&&s.tagName===o&&vt(s,t)&&(Ne(t,s),yt(s))}}}(t)},A.closeDropDown=function(e){s&&(Se(s),s=null),!0===e&&A.focus()},A.wysiwygEditorInsertHtml=function(e,t,n){var o=Fe(i);A.focus(),!n&&Ce(v,"code")||(m.insertHTML(e,t),m.saveRange(),B(),mt(f),an(f,d),tt(n=ke(f,"#sceditor-end-marker")[0]),e=f.scrollTop,t=ht(n).top+1.5*n.offsetHeight-o,et(n),(e").replace(/&/g,"&")),A.wysiwygEditorInsertHtml(e)),A},A.getWysiwygEditorValue=function(e){for(var t,n=Ee("div",{},d),o=f.childNodes,r=0;r

"),B(),S(),N(),D()},A.setSourceEditorValue=function(e){l.value=e,N()},A.updateOriginal=function(){r.value=A.val()},B=function(){var e,l,s,c,t,u,d;I.emoticonsEnabled&&(e=f,l=O,s=I.emoticonsCompat,c=e.ownerDocument,t="(^|\\s| | | | |$)",u=[],d={},Je(e,"code")||(we(l,function(e){d[e]=new RegExp(t+wt(e)+t),u.push(e)}),u.sort(function(e,t){return t.length-e.length}),function e(t){for(t=t.firstChild;t;){if(t.nodeType!==xe||Me(t,"code")||e(t),t.nodeType===Te)for(var n=0;n"),e.preventDefault()))},S=function(){ct(f,function(e){var t;if(e.nodeType===xe&&!/inline/.test(Re(e,"display"))&&(!Me(e,".sceditor-nlf")&&dt(e)))return(t=Ee("p",{},d)).className="sceditor-nlf",t.innerHTML="
",Ne(f,t),!1;if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||Me(e,"br"))return!1})},E=function(){A.val(r.value)},te=function(){A.closeDropDown()},A._=function(){var n=arguments;return t&&t[n[0]]&&(n[0]=t[n[0]]),n[0].replace(/\{(\d+)\}/g,function(e,t){return void 0!==n[+t+1]?n[+t+1]:"{"+t+"}"})},oe=function(t){g&&g.call(t.type+"Event",t,A);var e=(t.target===l?"scesrc":"scewys")+t.type;_[e]&&_[e].forEach(function(e){e.call(A,t)})},A.bind=function(e,t,n,o){for(var r,i,a=(e=e.split(" ")).length;a--;)Ke(t)&&(r="scewys"+e[a],i="scesrc"+e[a],n||(_[r]=_[r]||[],_[r].push(t)),o||(_[i]=_[i]||[],_[i].push(t)),"valuechanged"===e[a])&&(N.hasHandler=!0);return A},A.unbind=function(e,t,n,o){for(var r=(e=e.split(" ")).length;r--;)Ke(t)&&(n||Ze(_["scewys"+e[r]]||[],t),o||Ze(_["scesrc"+e[r]]||[],t));return A},A.blur=function(e,t,n){return Ke(e)?A.bind("blur",e,t,n):(A.sourceMode()?l:f).blur(),A},A.focus=function(e,t,n){if(Ke(e))A.bind("focus",e,t,n);else if(A.inSourceMode())l.focus();else{if(ke(d,":focus").length)return;e=m.selectedRange();y||ce(!0),e&&1===e.endOffset&&e.collapsed&&(t=e.endContainer)&&1===t.childNodes.length&&Me(t.firstChild,"br")&&(e.setStartBefore(t.firstChild),e.collapse(!0),m.selectRange(e)),o.focus(),f.focus()}return C(),A},A.keyDown=function(e,t,n){return A.bind("keydown",e,t,n)},A.keyPress=function(e,t,n){return A.bind("keypress",e,t,n)},A.keyUp=function(e,t,n){return A.bind("keyup",e,t,n)},A.nodeChanged=function(e){return A.bind("nodechanged",e,!1,!0)},A.selectionChanged=function(e){return A.bind("selectionchanged",e,!1,!0)},A.valueChanged=function(e,t,n){return A.bind("valuechanged",e,t,n)},ue=function(e){var n=0,o=A.emoticonsCache,t=String.fromCharCode(e.which);Ce(v,"code")||(o||(o=[],we(O,function(e,t){o[n++]=[e,t]}),o.sort(function(e,t){return e[0].length-t[0].length}),A.emoticonsCache=o,A.longestEmoticonCode=o[o.length-1][0].length),!m.replaceKeyword(A.emoticonsCache,!0,!0,A.longestEmoticonCode,I.emoticonsCompat,t))||I.emoticonsCompat&&/^\s$/.test(t)||e.preventDefault()},de=function(){var e=v,t=m,n=/[^\s\xA0\u2002\u2003\u2009]+/,o=e&&ke(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var r=0;r","/":"?","\\":"|","[":"{","]":"}"},o={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r=e.which,i={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),o[r]?i=o[r]:n[i]&&(i=n[i])),i&&(r<16||18