text: /*
  * Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
  * Copyright 2015 Telerik AD. All rights reserved.
  *
  * Kendo UI commercial licenses may be obtained at
  * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
  * If you do not own a commercial license, this file shall be governed by the trial license terms.
  */
  !function(e,define){define(["./kendo.combobox.min","./kendo.dropdownlist.min","./kendo.resizable.min","./kendo.window.min","./kendo.colorpicker.min","./kendo.imagebrowser.min","./kendo.filebrowser.min"],e)}(function(){return function(e,t){var n,i,o,r,s=window.kendo,a=s.Class,l=s.ui.Widget,c=s.support.mobileOS,h=s.support.browser,d=e.extend,u=e.proxy,f=s.deepExtend,p=".kendoEditor",g=s.keys,m=a.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return s.template(e.template,{useWithBlock:!1})(e)}}),v={editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar" /></td></tr><tr><td class="k-editable-area" /></tr></tbody></table>',buttonTemplate:'<a href="" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span unselectable="on" class="k-tool-icon #= data.cssClass #"></span><span class="k-tool-text">#= data.title #</span></a>',colorPickerTemplate:'<div class="k-colorpicker #= data.cssClass #" />',comboBoxTemplate:'<select title="#= data.title #" class="#= data.cssClass #" />',dropDownListTemplate:'<span class="k-editor-dropdown"><select title="#= data.title #" class="#= data.cssClass #" /></span>',separatorTemplate:'<span class="k-separator" />',overflowAnchorTemplate:'<a href="" role="button" class="k-tool k-overflow-anchor" data-popup unselectable="on"><span unselectable="on" class="k-icon k-i-more"></span></a>',formatByName:function(t,n){for(var i=0;n.length>i;i++)if(e.inArray(t,n[i].tags)>=0)return n[i]},registerTool:function(e,t){var n=t.options;n&&n.template&&(n.template.options.cssClass="k-"+e),t.name||(t.options.name=e,t.name=e.toLowerCase()),b.defaultTools[e]=t},registerFormat:function(e,t){b.fn.options.formats[e]=t}},_={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertFile:"Insert file",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",formatting:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",editAreaTitle:"Editable area. Press F10 for toolbar.",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",imageWidth:"Width (px)",imageHeight:"Height (px)",fileWebAddress:"Web address",fileTitle:"Title",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogCancel:"Cancel",createTable:"Create table",createTableHint:"Create a {0} x {1} table",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteRow:"Delete row",deleteColumn:"Delete column"},y=!c||c.ios&&c.flatVersion>=500||!c.ios&&t!==document.documentElement.contentEditable,w={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},b=l.extend({init:function(t,n){var i,o,r,a,c,h=this,g=s.ui.editor,m=g.Dom;y&&(l.fn.init.call(h,t,n),h.options=f({},h.options,n),t=h.element,c=t[0],a=m.name(c),t.closest("form").on("submit"+p,function(){h.update()}),r=d({},h.options),r.editor=h,"textarea"==a?(h._wrapTextarea(),o=h.wrapper.find(".k-editor-toolbar"),c.id&&o.attr("aria-controls",c.id)):(h.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),r.popup=!0,o=e('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(t)),h.toolbar=new g.Toolbar(o[0],r),h.toolbar.bindTo(h),"textarea"==a&&setTimeout(function(){var e=h.wrapper[0].style.height,t=parseInt(e,10),n=h.wrapper.height();e.indexOf("px")>0&&!isNaN(t)&&n>t&&h.wrapper.height(t-(n-t))}),h._resizable(),h._initializeContentElement(h),h.keyboard=new g.Keyboard([new g.BackspaceHandler(h),new g.TypingHandler(h),new g.SystemHandler(h)]),h.clipboard=new g.Clipboard(this),h.undoRedoStack=new g.UndoRedoStack,n&&n.value?i=n.value:h.textarea?(i=c.value,h.options.encoded&&e.trim(c.defaultValue).length&&(i=c.defaultValue),i=i.replace(/[\r\n\v\f\t ]+/gi," ")):i=c.innerHTML,h.value(i),e(document).on("mousedown",u(h._endTyping,h)).on("mouseup",u(h._mouseup,h)),h.toolbar.resize(),s.notify(h))},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){h.msie||s.ui.editor.Dom.ensureTrailingBreaks(this.body),this._selectionStarted=!1,this.saveSelection(),this.trigger("select",{})},_resizable:function(){var n=this.options.resizable,i=e.isPlainObject(n)?n.content===t||n.content===!0:n;i&&this.textarea&&(e("<div class='k-resize-handle'><span class='k-icon k-resize-se' /></div>").insertAfter(this.textarea),this.wrapper.kendoResizable(d({},this.options.resizable,{start:function(t){var n=this.editor=e(t.currentTarget).closest(".k-editor");this.initialSize=n.height(),n.find("td:last").append("<div class='k-overlay' />")},resize:function(e){var t=e.y.initialDelta,n=this.initialSize+t,i=this.options.min||0,o=this.options.max||1/0;n=Math.min(o,Math.max(i,n)),this.editor.height(n)},resizeend:function(){this.editor.find(".k-overlay").remove(),this.editor=null}})))},_wrapTextarea:function(){var t=this,n=t.element,i=n[0].style.width,o=n[0].style.height,r=v.editorWrapperTemplate,s=e(r).insertBefore(n).width(i).height(o),a=s.find(".k-editable-area");n.attr("autocomplete","off").appendTo(a).addClass("k-content k-raw-content").css("display","none"),t.textarea=n,t.wrapper=s},_createContentElement:function(t){var n,i,o,r=this,a=r.textarea,l=r.options.domain,c=l||document.domain,h="",d='javascript:""';return(l||c!=location.hostname)&&(h='<script>document.domain="'+c+'"</script>',d="javascript:document.write('"+h+"')"),a.hide(),n=e("<iframe />",{title:r.options.messages.editAreaTitle,frameBorder:"0"})[0],e(n).css("display","").addClass("k-content").insertBefore(a),n.src=d,i=n.contentWindow||n,o=i.document||n.contentDocument,e(n).one("load",function(){r.toolbar.decorateFrom(o.body)}),o.open(),o.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;height:100%;min-height:100%;}body{font-size:12px;font-family:Verdana,Geneva,sans-serif;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+(s.support.isRtl(a)?"direction:rtl;":"")+"}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\\3Ascript{display: none;}.k-table{table-layout:fixed;width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table p{margin:0;padding:0;}</style>"+h+"<script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');</script>"+e.map(t,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>"),o.close(),i},_blur:function(){var e=this.textarea,t=e?e.val():this._oldValue,n=this.options.encoded?this.encodedValue():this.value();this.update(),e&&e.trigger("blur"),n!=t&&this.trigger("change")},_spellCorrect:function(n){var i,o=!1;e(n.body).on("contextmenu"+p,function(){n.one("select",function(){i=null}),n._spellCorrectTimeout=setTimeout(function(){i=new s.ui.editor.RestorePoint(n.getRange()),o=!1},10)}).on("input"+p,function(){return i?s.support.browser.mozilla&&!o?(o=!0,t):(s.ui.editor._finishUpdate(n,i),t):t})},_initializeContentElement:function(){var n,i,o=this;o.textarea?(o.window=o._createContentElement(o.options.stylesheets),n=o.document=o.window.contentDocument||o.window.document,o.body=n.body,i=o.window,e(n).on("mouseup"+p,u(o._mouseup,o))):(o.window=window,n=o.document=document,o.body=o.element[0],i=o.body,o.toolbar.decorateFrom(o.body)),e(i).on("blur"+p,u(this._blur,this));try{n.execCommand("enableInlineTableEditing",null,!1)}catch(r){}s.support.touch&&e(n).on("selectionchange"+p,u(this._selectionChange,this)).on("keydown"+p,function(){s._activeElement()!=n.body&&o.window.focus()}),this._spellCorrect(o),e(o.body).on("dragstart"+p,!1).on("keydown"+p,function(e){var n,i,r,s,a,l;return e.keyCode!==g.BACKSPACE&&e.keyCode!==g.DELETE||"true"===o.body.getAttribute("contenteditable")?e.keyCode===g.F10?(setTimeout(u(o.toolbar.focus,o.toolbar),100),e.preventDefault(),t):((e.keyCode==g.LEFT||e.keyCode==g.RIGHT)&&(n=o.getRange(),i=e.keyCode==g.LEFT,r=n[i?"startContainer":"endContainer"],s=n[i?"startOffset":"endOffset"],a=i?-1:1,i&&(s-=1),s+a>0&&3==r.nodeType&&"﻿"==r.nodeValue[s]&&(n.setStart(r,s+a),n.collapse(!0),o.selectRange(n))),(l=o.keyboard.toolFromShortcut(o.toolbar.tools,e))?(e.preventDefault(),/^(undo|redo)$/.test(l)||o.keyboard.endTyping(!0),o.trigger("keydown",e),o.exec(l),!1):(o.keyboard.clearTimeout(),o.keyboard.keydown(e),t)):!1}).on("keyup"+p,function(t){var n=[8,9,33,34,35,36,37,38,39,40,40,45,46];(e.inArray(t.keyCode,n)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&o._selectionChange(),o.keyboard.keyup(t)}).on("mousedown"+p,function(t){if(o._selectionStarted=!0,!h.gecko){var n=e(t.target);(2==t.which||1==t.which&&t.ctrlKey)&&n.is("a[href]")&&window.open(n.attr("href"),"_new")}}).on("click"+p,function(e){var t,n=s.ui.editor.Dom;"img"===n.name(e.target)&&(t=o.createRange(),t.selectNode(e.target),o.selectRange(t))}).on("cut"+p+" paste"+p,function(e){o.clipboard["on"+e.type](e)}).on("focusin"+p,function(){e(this).addClass("k-state-active"),o.toolbar.show()}).on("focusout"+p,function(){setTimeout(function(){var t=s._activeElement(),n=o.body,i=o.toolbar;t==n||e.contains(n,t)||e(t).is(".k-editortoolbar-dragHandle")||i.focused()||(e(n).removeClass("k-state-active"),i.hide())},10)})},_mouseup:function(){var e=this;e._selectionStarted&&setTimeout(function(){e._selectionChange()},1)},refresh:function(){var e=this;e.textarea&&(e.textarea.val(e.value()),e.wrapper.find("iframe").remove(),e._initializeContentElement(e),e.value(e.textarea.val()))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:_,formats:{},encoded:!0,domain:null,resizable:!1,serialization:{entities:!0,semantic:!0,scripts:!1},stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:[].concat.call(["formatting"],w.basic,w.alignment,w.lists,w.indenting,w.links,["insertImage"],w.tables)},destroy:function(){var t=this;l.fn.destroy.call(t),e(t.window).add(t.document).add(t.body).add(t.wrapper).add(t.element.closest("form")).off(p),e(document).off("mousedown",u(t._endTyping,t)).off("mouseup",u(t._mouseup,t)),clearTimeout(this._spellCorrectTimeout),t._focusOutside(),t.toolbar.destroy(),s.destroy(t.wrapper)},_focusOutside:function(){if(s.support.browser.msie&&this.textarea){var t=e("<input style='position:absolute;left:-10px;top:-10px;width:1px;height:1px;font-size:0;border:0;' />").appendTo(document.body).focus();t.blur().remove()}},state:function(e){var t,n,i=b.defaultTools[e],o=i&&(i.options.finder||i.finder),r=s.ui.editor.RangeUtils;return o?(t=this.getRange(),n=r.textNodes(t),!n.length&&t.collapsed&&(n=[t.startContainer]),o.getFormat?o.getFormat(n):o.isFormatted(n)):!1},value:function(e){var n=this.body,i=s.ui.editor,o=i.Serializer.domToXhtml(n,this.options.serialization);return e===t?o:(e!=o&&(i.Serializer.htmlToDom(e,n),h.msie||s.ui.editor.Dom.ensureTrailingBreaks(this.body),this.selectionRestorePoint=null,this.update(),this.toolbar.refreshTools()),t)},saveSelection:function(t){t=t||this.getRange();var n=t.commonAncestorContainer,i=this.body;(n==i||e.contains(i,n))&&(this.selectionRestorePoint=new s.ui.editor.RestorePoint(t))},_focusBody:function(){var e,t=this.body,n=this.wrapper&&this.wrapper.find("iframe")[0],i=this.document.documentElement,o=s._activeElement();o!=t&&o!=n&&(e=i.scrollTop,t.focus(),i.scrollTop=e)},restoreSelection:function(){this._focusBody(),this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(e){e=e||this.options.encoded?this.encodedValue():this.value(),this.textarea?this.textarea.val(e):this._oldValue=e},encodedValue:function(){return s.ui.editor.Dom.encode(this.value())},createRange:function(e){return s.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return s.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this._focusBody();var t=this.getSelection();t.removeAllRanges(),t.addRange(e),this.saveSelection(e)},getRange:function(){var e=this.getSelection(),t=e&&e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return s.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(t,n){var i=new s.ui.editor.InsertHtmlCommand(e.extend({range:this.getRange(),html:t},n));i.editor=this,i.exec()},exec:function(e,n){var i,o,r,s,a=this,l=null;if(!e)throw Error("kendoEditor.exec(): `name` parameter cannot be empty");if("true"!==a.body.getAttribute("contenteditable"))return!1;if(e=e.toLowerCase(),a.keyboard.isTypingInProgress()||a.restoreSelection(),o=a.toolbar.toolById(e),!o)for(s in b.defaultTools)if(s.toLowerCase()==e){o=b.defaultTools[s];break}if(o){if(i=a.getRange(),o.command&&(l=o.command(d({range:i},n))),r=a.trigger("execute",{name:e,command:l}))return;if(/^(undo|redo)$/i.test(e))a.undoRedoStack[e]();else if(l&&(l.managesUndoRedo||a.undoRedoStack.push(l),l.editor=a,l.exec(),l.async))return l.change=u(a._selectionChange,a),t;a._selectionChange()}}});b.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},s.ui.plugin(b),n=a.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title}),e.children(".k-tool-text").html(t.title)},command:function(e){return new this.options.command(e)},update:e.noop}),n.exec=function(e,t,n){e.exec(t,{value:n})},i=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new s.ui.editor.FormatCommand(d(e,{formatter:t.options.formatter}))},update:function(e,t){var n=this.options.finder.isFormatted(t);e.toggleClass("k-state-selected",n),e.attr("aria-pressed",n)}}),v.registerTool("separator",new n({template:new m({template:v.separatorTemplate})})),o=h.msie&&9>h.version?"﻿":"",r='<br class="k-br" />',h.msie&&(10>h.version?r="﻿":11>h.version&&(r=" ")),d(s.ui,{editor:{ToolTemplate:m,EditorUtils:v,Tool:n,FormatTool:i,_bomFill:o,emptyElementContent:r}}),s.PDFMixin&&(s.PDFMixin.extend(b.prototype),b.prototype._drawPDF=function(){return s.drawing.drawDOM(this.body,this.options.pdf)},b.prototype.saveAsPDF=function(){var t,n,i=new e.Deferred,o=i.promise(),r={promise:o};if(!this.trigger("pdfExport",r))return t=this.options.pdf,n=t.paperSize,this._drawPDF(i).then(function(e){return t.paperSize="auto",s.drawing.exportPDF(e,t)}).done(function(e){s.saveAs({dataURI:e,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy}),t.paperSize=n,i.resolve()}).fail(function(e){i.reject(e)}),o})}(window.jQuery),function(e){function t(e){var t,n,i={};for(t=0,n=e.length;n>t;t++)i[e[t]]=!0;return i}var n,i,o,r,s,a,l,c,h,d,u=window.kendo,f=e.map,p=e.extend,g=u.support.browser,m="style",v="float",_="cssFloat",y="styleFloat",w="class",b="k-marker",x=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),k="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),C=k.concat(["ul","ol","li"]),S=t(C),T="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby".split(","),A=t(T),D=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),P=function(e){1==e.nodeType&&e.normalize()};g.msie&&g.version>=8&&(P=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,d.remove(t)),t=n}}),n=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,o=/\ufeff/g,r=/^(\s+|\ufeff)$/,a="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),l=/[<>\&]/g,c=/[\u00A0-\u2666<>\&]/g,h={34:"quot",38:"amp",39:"apos",60:"lt",62:"gt",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",402:"fnof",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:"sigmaf",963:"sigma",964:"tau",965:"upsilon",966:"phi",967:"chi",968:"psi",969:"omega",977:"thetasym",978:"upsih",982:"piv",8226:"bull",8230:"hellip",8242:"prime",8243:"Prime",8254:"oline",8260:"frasl",8472:"weierp",8465:"image",8476:"real",8482:"trade",8501:"alefsym",8592:"larr",8593:"uarr",8594:"rarr",8595:"darr",8596:"harr",8629:"crarr",8656:"lArr",8657:"uArr",8658:"rArr",8659:"dArr",8660:"hArr",8704:"forall",8706:"part",8707:"exist",8709:"empty",8711:"nabla",8712:"isin",8713:"notin",8715:"ni",8719:"prod",8721:"sum",8722:"minus",8727:"lowast",8730:"radic",8733:"prop",8734:"infin",8736:"ang",8743:"and",8744:"or",8745:"cap",8746:"cup",8747:"int",8756:"there4",8764:"sim",8773:"cong",8776:"asymp",8800:"ne",8801:"equiv",8804:"le",8805:"ge",8834:"sub",8835:"sup",8836:"nsub",8838:"sube",8839:"supe",8853:"oplus",8855:"otimes",8869:"perp",8901:"sdot",8968:"lceil",8969:"rceil",8970:"lfloor",8971:"rfloor",9001:"lang",9002:"rang",9674:"loz",9824:"spades",9827:"clubs",9829:"hearts",9830:"diams",338:"OElig",339:"oelig",352:"Scaron",353:"scaron",376:"Yuml",710:"circ",732:"tilde",8194:"ensp",8195:"emsp",8201:"thinsp",8204:"zwnj",8205:"zwj",8206:"lrm",8207:"rlm",8211:"ndash",8212:"mdash",8216:"lsquo",8217:"rsquo",8218:"sbquo",8220:"ldquo",8221:"rdquo",8222:"bdquo",8224:"dagger",8225:"Dagger",8240:"permil",8249:"lsaquo",8250:"rsaquo",8364:"euro"},d={block:S,inline:A,findNodeIndex:function(e,t){var n=0;if(!e)return-1;for(;;){if(e=e.previousSibling,!e)break;t&&3==e.nodeType||n++}return n},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!d.isDataNode(t)&&(e.contains(t,d.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){return!1}},isAncestorOrSelf:function(e,t){return d.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(d.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return d.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n,i=e.cloneNode(!1),o="",r=e.nextSibling;r&&3==r.nodeType&&r.nodeValue;)o+=r.nodeValue,n=r,r=r.nextSibling,d.remove(n);e.deleteData(t,e.length),i.deleteData(0,t),i.nodeValue+=o,d.insertAfter(i,e)},attrEquals:function(e,t){var n,i;for(n in t)if(i=e[n],n==v&&(i=e[u.support.cssFloat?_:y]),"object"==typeof i){if(!d.attrEquals(i,t[n]))return!1}else if(i!=t[n])return!1;return!0},blockParentOrBody:function(e){return d.parentOfType(e,C)||e.ownerDocument.body},blockParents:function(t){var n,i,o,r=[];for(n=0,i=t.length;i>n;n++)o=d.parentOfType(t[n],d.blockElements),o&&e.inArray(o,r)<0&&r.push(o);return r},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:P,blockElements:C,nonListBlockElements:k,inlineElements:T,empty:x,fillAttrs:D,toHex:function(e){var t=i.exec(e);return t?"#"+f(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e,t){var n=!t||t.entities?c:l;return e.replace(n,function(e){var t=e.charCodeAt(0),n=h[t];return n?"&"+n+";":e})},stripBom:function(e){return(e||"").replace(o,"")},insignificant:function(e){var t=e.attributes;return"k-marker"==e.className||d.is(e,"br")&&("k-br"==e.className||t._moz_dirty||t._moz_editor_bogus_node)},significantNodes:function(t){return e.grep(t,function(e){var t=d.name(e);return"br"==t?!1:d.insignificant(e)?!1:3==e.nodeType&&r.test(e.nodeValue)?!1:1==e.nodeType&&!x[t]&&d.emptyNode(e)?!1:!0})},emptyNode:function(e){return!d.significantNodes(e.childNodes).length},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!d.isWhitespace(e)})},lastTextNode:function(e){var t,n=null;if(3==e.nodeType)return e;for(t=e.lastChild;t;t=t.previousSibling)if(n=d.lastTextNode(t))return n;return n},is:function(e,t){return d.name(e)==t},isMarker:function(e){return e.className==b},isWhitespace:function(e){return n.test(e.nodeValue)},isBlock:function(e){return S[d.name(e)]},isEmpty:function(e){return x[d.name(e)]},isInline:function(e){return A[d.name(e)]},scrollContainer:function(e){var t=d.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=u.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,i,o=e(d.isDataNode(t)?t.parentNode:t),r=d.windowFromDocument(t.ownerDocument),s=r.innerHeight,a=d.scrollContainer(t.ownerDocument);n=o.offset().top,i=o[0].offsetHeight,i||(i=parseInt(o.css("line-height"),10)||Math.ceil(1.2*parseInt(o.css("font-size"),10))||15),i+n>a.scrollTop+s&&(a.scrollTop=i+n-s)},persistScrollTop:function(e){s=d.scrollContainer(e).scrollTop},restoreScrollTop:function(e){d.scrollContainer(e).scrollTop=s},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},removeTextSiblings:function(e){for(var t=e.parentNode;e.nextSibling&&3==e.nextSibling.nodeType;)t.removeChild(e.nextSibling);for(;e.previousSibling&&3==e.previousSibling.nodeType;)t.removeChild(e.previousSibling)},trim:function(e){var t,n;for(t=e.childNodes.length-1;t>=0;t--)n=e.childNodes[t],d.isDataNode(n)?(d.stripBom(n.nodeValue).length||d.remove(n),d.isWhitespace(n)&&d.insertBefore(n,e)):n.className!=b&&(d.trim(n),n.childNodes.length||d.isEmpty(n)||d.remove(n));return e},closest:function(e,t){for(;e&&d.name(e)!=t;)e=e.parentNode;return e},sibling:function(e,t){do e=e[t];while(e&&1!=e.nodeType);return e},next:function(e){return d.sibling(e,"nextSibling")},prev:function(e){return d.sibling(e,"previousSibling")},parentOfType:function(e,t){do e=e.parentNode;while(e&&!d.ofType(e,t));return e},ofType:function(t,n){return e.inArray(d.name(t),n)>=0},changeTag:function(e,t,n){var i,o,r,s,a,l=d.create(e.ownerDocument,t),c=e.attributes;if(!n)for(i=0,o=c.length;o>i;i++)a=c[i],a.specified&&(r=a.nodeName,s=a.nodeValue,r==w?l.className=s:r==m?l.style.cssText=e.style.cssText:l.setAttribute(r,s));for(;e.firstChild;)l.appendChild(e.firstChild);return d.insertBefore(l,e),d.remove(e),l},editableParent:function(e){for(;e&&(3==e.nodeType||"true"!==e.contentEditable);)e=e.parentNode;return e},wrap:function(e,t){return d.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},create:function(e,t,n){return d.attr(e.createElement(t),n)},attr:function(e,t){t=p({},t),t&&m in t&&(d.style(e,t.style),delete t.style);for(var n in t)null===t[n]?(e.removeAttribute(n),delete t[n]):"className"==n&&(e[n]=t[n]);return p(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(e,t){for(var n in t)n==v&&(n=u.support.cssFloat?_:y),e.style[n]="";""===e.style.cssText&&e.removeAttribute(m)},inlineStyle:function(t,n,i){var o,r=e(d.create(t.ownerDocument,n,i));return t.appendChild(r[0]),o=f(a,function(e){return g.msie&&"line-height"==e&&"1px"==r.css(e)?"line-height:1.5":e+":"+r.css(e)}).join(";"),r.remove(),o},getEffectiveBackground:function(e){var t=e.css("background-color");return t.indexOf("rgba(0, 0, 0, 0")<0&&"transparent"!==t?t:"html"===e[0].tagName.toLowerCase()?"Window":d.getEffectiveBackground(e.parent())},removeClass:function(t,n){var i,o,r=" "+t.className+" ",s=n.split(" ");for(i=0,o=s.length;o>i;i++)r=r.replace(" "+s[i]+" "," ");r=e.trim(r),r.length?t.className=r:t.removeAttribute(w)},commonAncestor:function(){var e,t,n,i,o,r=arguments.length,s=[],a=1/0,l=null;if(!r)return null;if(1==r)return arguments[0];for(e=0;r>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;s.push(t.reverse()),a=Math.min(a,t.length)}if(1==r)return s[0][0];for(e=0;a>e;e++){for(i=s[0][e],o=1;r>o;o++)if(i!=s[o][e])return l;l=i}return l},closestSplittableParent:function(t){var n,i,o;return n=1==t.length?d.parentOfType(t[0],["ul","ol"]):d.commonAncestor.apply(null,t),n||(n=d.parentOfType(t[0],["p","td"])||t[0].ownerDocument.body),d.isInline(n)&&(n=d.blockParentOrBody(n)),i=f(t,d.editableParent),o=d.commonAncestor(i)[0],e.contains(n,o)&&(n=o),n},closestEditable:function(t,n){var i,o=d.editableParent(t);return i=d.ofType(t,n)?t:d.parentOfType(t,n),i&&o&&e.contains(i,o)?i=o:!i&&o&&(i=o),i},closestEditableOfType:function(e,t){var n=d.closestEditable(e,t);return n&&d.ofType(n,t)?n:void 0},filter:function(e,t,n){for(var i,o=0,r=t.length,s=[];r>o;o++)i=d.name(t[o]),(!n&&i==e||n&&i!=e)&&s.push(t[o]);return s},ensureTrailingBreaks:function(t){var n=e(t).find("p,td,th"),i=n.length,o=0;if(i)for(;i>o;o++)d.ensureTrailingBreak(n[o]);else d.ensureTrailingBreak(t)},removeTrailingBreak:function(t){e(t).find("br[type=_moz],.k-br").remove()},ensureTrailingBreak:function(e){var t,n,i;d.removeTrailingBreak(e),t=e.lastChild,n=t&&d.name(t),(!n||"br"!=n&&"img"!=n||"br"==n&&"k-br"!=t.className)&&(i=e.ownerDocument.createElement("br"),i.className="k-br",e.appendChild(i))}},u.ui.editor.Dom=d}(window.kendo.jQuery),function(e,t){var n,i,o=window.kendo,r=o.ui.editor,s=r.Dom,a=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),c=/"/g,h=/<br[^>]*>/i,d=/^\d+(\.\d*)?(px)?$/i,u=/<p><\/p>/i,f=/([\w|\-]+)\s*:\s*([^;]+);?/i,p=/^sizzle-\d+/i,g=/^k-script-/i,m=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,v=document.createElement("div");v.innerHTML=" <hr>",n=3===v.firstChild.nodeType,v=null,i={toEditableHtml:function(e){var t='<br class="k-br">';return e=e||"",e.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<k:script$1>$2</k:script>").replace(/<img([^>]*)>/gi,function(e){return e.replace(m,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/^<(table|blockquote)/i,t+"<$1").replace(/^[\s]*(&nbsp;|\u00a0)/i,"$1").replace(/<\/(table|blockquote)>$/i,"</$1>"+t)},_fillEmptyElements:function(t){e(t).find("p").each(function(){var t,n=e(this);if(/^\s*$/g.test(n.text())&&!n.find("img,input").length){for(t=this;t.firstChild&&3!=t.firstChild.nodeType;)t=t.firstChild;1!=t.nodeType||s.empty[s.name(t)]||(t.innerHTML=o.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){e(".k-paste-container",t).remove()},_resetOrderedLists:function(e){var t,n,i,o=e.getElementsByTagName("ol");for(t=0;o.length>t;t++)n=o[t],i=n.getAttribute("start"),n.setAttribute("start",1),i?n.setAttribute("start",i):n.removeAttribute(i)},_preventScriptExecution:function(t){e(t).find("*").each(function(){var e,t,n,i,o=this.attributes;for(t=0,n=o.length;n>t;t++)e=o[t],i=e.nodeName,e.specified&&/^on/i.test(i)&&(this.setAttribute("k-script-"+i,e.value),this.removeAttribute(i))})},htmlToDom:function(t,n){var r,a,l=o.support.browser,c=l.msie,h=c&&9>l.version;return t=i.toEditableHtml(t),h&&(t="<br/>"+t,r="originalsrc",a="originalhref",t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,r+'="$1"')),n.innerHTML=t,h?(s.remove(n.firstChild),e(n).find("k\\:script,script,link,img,a").each(function(){var e=this;
  e[a]&&(e.setAttribute("href",e[a]),e.removeAttribute(a)),e[r]&&(e.setAttribute("src",e[r]),e.removeAttribute(r))})):c&&(s.normalize(n),i._resetOrderedLists(n)),i._preventScriptExecution(n),i._fillEmptyElements(n),i._removeSystemElements(n),e("table",n).addClass("k-table"),n},domToXhtml:function(i,r){function a(t){return e.grep(t,function(e){return"style"!=e.name})}function m(t){var n,i,o,r,a,l=e.trim,h=l(t).split(";"),d=[];for(r=0,a=h.length;a>r;r++)h[r].length&&(n=f.exec(h[r]),n&&(i=l(n[1].toLowerCase()),o=l(n[2]),"font-size-adjust"!=i&&"font-stretch"!=i&&(i.indexOf("color")>=0?o=s.toHex(o):i.indexOf("font")>=0?o=o.replace(c,"'"):/\burl\(/g.test(o)&&(o=o.replace(c,"")),d.push({property:i,value:o}))));return d}function v(e){var t,n=m(e);for(t=0;n.length>t;t++)C.push(n[t].property),C.push(":"),C.push(n[t].value),C.push(";")}function _(e){var t,n,i,o,a,l,c=[],h=e.attributes;for(n=0,i=h.length;i>n;n++)t=h[n],o=t.nodeName,a=t.value,l=t.specified,"value"==o&&"value"in e&&e.value?l=!0:"type"==o&&"text"==a?l=!0:"class"!=o||a?p.test(o)?l=!1:"complete"==o?l=!1:"altHtml"==o?l=!1:"start"==o&&(s.is(e,"ul")||s.is(e,"ol"))?l=!1:o.indexOf("_moz")>=0?l=!1:g.test(o)&&(l=!!r.scripts):l=!1,l&&c.push(t);return c}function y(n,i){var r,a,l,c,h,u,f,p;if(i=i||_(n),s.is(n,"img")&&(u=n.style.width,f=n.style.height,p=e(n),u&&d.test(u)&&(p.attr("width",parseInt(u,10)),s.unstyle(n,{width:t})),f&&d.test(f)&&(p.attr("height",parseInt(f,10)),s.unstyle(n,{height:t}))),i.length)for(i.sort(function(e,t){return e.nodeName>t.nodeName?1:t.nodeName>e.nodeName?-1:0}),r=0,a=i.length;a>r;r++)l=i[r],c=l.nodeName,h=l.value,("class"!=c||"k-table"!=h)&&(c=c.replace(g,""),C.push(" "),C.push(c),C.push('="'),"style"==c?v(h||n.style.cssText):C.push("src"==c||"href"==c?o.htmlEncode(n.getAttribute(c,2)):s.fillAttrs[c]?c:h),C.push('"'))}function w(e,t,n){for(var i=e.firstChild;i;i=i.nextSibling)x(i,t,n)}function b(e){return e.nodeValue.replace(/\ufeff/g,"")}function x(e,i,o){var a,l,c,h,d,u=e.nodeType;if(1==u){if(a=s.name(e),!a||s.insignificant(e))return;if(s.isInline(e)&&1==e.childNodes.length&&3==e.firstChild.nodeType&&!b(e.firstChild))return;if(!r.scripts&&("script"==a||"k:script"==a))return;if(l=S[a],l&&(t===l.semantic||r.semantic^l.semantic))return l.start(e),w(e,!1,l.skipEncoding),l.end(e),t;C.push("<"),C.push(a),y(e),s.empty[a]?C.push(" />"):(C.push(">"),w(e,i||s.is(e,"pre")),C.push("</"),C.push(a),C.push(">"))}else 3==u?(h=b(e),!i&&n&&(c=e.parentNode,d=e.previousSibling,d||(d=(s.isInline(c)?c:e).previousSibling),(!d||""===d.innerHTML||s.isBlock(d))&&(h=h.replace(/^[\r\n\v\f\t ]+/,"")),h=h.replace(/ +/," ")),C.push(o?h:s.encode(h,r))):4==u?(C.push("<![CDATA["),C.push(e.data),C.push("]]>")):8==u&&(e.data.indexOf("[CDATA[")<0?(C.push("<!--"),C.push(e.data),C.push("-->")):(C.push("<!"),C.push(e.data),C.push(">")))}function k(e){var t=e.childNodes.length,n=t&&3==e.firstChild.nodeType;return n&&(1==t||2==t&&s.insignificant(e.lastChild))}var C=[],S={iframe:{start:function(e){C.push("<iframe"),y(e),C.push(">")},end:function(){C.push("</iframe>")}},"k:script":{start:function(e){C.push("<script"),y(e),C.push(">")},end:function(){C.push("</script>")},skipEncoding:!0},span:{semantic:!0,start:function(t){var n,i,o=t.style,r=_(t),c=a(r);c.length&&(C.push("<span"),y(t,c),C.push(">")),"underline"==o.textDecoration&&C.push("<u>"),n=[],o.color&&n.push('color="'+s.toHex(o.color)+'"'),o.fontFamily&&n.push('face="'+o.fontFamily+'"'),o.fontSize&&(i=e.inArray(o.fontSize,l),n.push('size="'+i+'"')),n.length&&C.push("<font "+n.join(" ")+">")},end:function(e){var t=e.style;(t.color||t.fontFamily||t.fontSize)&&C.push("</font>"),"underline"==t.textDecoration&&C.push("</u>"),a(_(e)).length&&C.push("</span>")}},strong:{semantic:!0,start:function(){C.push("<b>")},end:function(){C.push("</b>")}},em:{semantic:!0,start:function(){C.push("<i>")},end:function(){C.push("</i>")}},b:{semantic:!1,start:function(){C.push("<strong>")},end:function(){C.push("</strong>")}},i:{semantic:!1,start:function(){C.push("<em>")},end:function(){C.push("</em>")}},u:{semantic:!1,start:function(){C.push('<span style="text-decoration:underline;">')},end:function(){C.push("</span>")}},font:{semantic:!1,start:function(e){var t,n,i;C.push('<span style="'),t=e.getAttribute("color"),n=l[e.getAttribute("size")],i=e.getAttribute("face"),t&&(C.push("color:"),C.push(s.toHex(t)),C.push(";")),i&&(C.push("font-family:"),C.push(i),C.push(";")),n&&(C.push("font-size:"),C.push(n),C.push(";")),C.push('">')},end:function(){C.push("</span>")}}};return S.script=S["k:script"],r=r||{},t===r.semantic&&(r.semantic=!0),k(i)?s.encode(b(i.firstChild).replace(/[\r\n\v\f\t ]+/," "),r):(w(i),C=C.join(""),""===C.replace(h,"").replace(u,"")?"":C)}},a(r,{Serializer:i})}(window.kendo.jQuery),function(e){function t(e,t,n,i){var o,r,s,a;if(e==t)return i-n;for(o=t;o&&o.parentNode!=e;)o=o.parentNode;if(o)return f(o)-n;for(o=e;o&&o.parentNode!=t;)o=o.parentNode;if(o)return i-f(o)-1;for(r=u.commonAncestor(e,t),s=e;s&&s.parentNode!=r;)s=s.parentNode;for(s||(s=r),a=t;a&&a.parentNode!=r;)a=a.parentNode;return a||(a=r),s==a?0:f(a)-f(s)}function n(e,n){function i(e){try{return t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)<0}catch(n){return!0}}i(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function i(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!u.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function o(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),u.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function r(e,t,n){var i,o=t[n?"startContainer":"endContainer"],r=t[n?"startOffset":"endOffset"],s=0,a=p(o),l=a?o:o.childNodes[r]||null,c=a?o.parentNode:o,h=t.ownerDocument,d=h.body.createTextRange();(3==o.nodeType||4==o.nodeType)&&(s=r),c||(c=h.body),"img"==c.nodeName.toLowerCase()?(d.moveToElementText(c),d.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",d)):(i=c.insertBefore(u.create(h,"a"),l),d.moveToElementText(i),u.remove(i),d[n?"moveStart":"moveEnd"]("character",s),d.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",d))}function s(e,t,n,i){var o,r,s,a,l,c,h,d=u.create(t.ownerDocument,"a"),g=e.duplicate(),m=i?"StartToStart":"StartToEnd",v=!1;d.innerHTML="﻿",g.collapse(i),r=g.parentElement(),u.isAncestorOrSelf(n,r)||(r=n);do v?r.insertBefore(d,d.previousSibling):(r.appendChild(d),v=!0),g.moveToElementText(d);while((o=g.compareEndPoints(m,e))>0&&d.previousSibling);s=d.nextSibling,-1==o&&p(s)?(g.setEndPoint(i?"EndToStart":"EndToEnd",e),u.remove(d),c=[s,g.text.length]):(a=!i&&d.previousSibling,l=i&&d.nextSibling,p(l)?c=[l,0]:p(a)?c=[a,a.length]:(h=f(d),c=r.nextSibling&&h==r.childNodes.length-1?[r.nextSibling,0]:[r,h]),u.remove(d)),t[i?"setStart":"setEnd"].apply(t,c)}var a=window.kendo,l=a.Class,c=e.extend,h=a.ui.editor,d=a.support.browser,u=h.Dom,f=u.findNodeIndex,p=u.isDataNode,g=u.findClosestAncestor,m=u.getNodeLength,v=u.normalize,_={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new b(e.document)},selectionFromRange:function(e){var t=T.documentFromRange(e);return _.selectionFromDocument(t)},selectionFromDocument:function(e){return _.selectionFromWindow(u.windowFromDocument(e))}},y=l.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,i(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,i(this),n(this,!1)},setStartBefore:function(e){this.setStart(e.parentNode,f(e))},setStartAfter:function(e){this.setStart(e.parentNode,f(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,f(e))},setEndAfter:function(e){this.setEnd(e.parentNode,f(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(g(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new w(t))},cloneContents:function(){var e=T.documentFromRange(this);return function t(n){for(var i,o=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),o.appendChild(i);return o}(new w(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(g(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=T.documentFromRange(t),function i(n){for(var o,r=e.createDocumentFragment();o=n.next();)n.hasPartialSubtree()?(o=o.cloneNode(!1),o.appendChild(i(n.getSubtreeIterator()))):n.remove(t.originalRange),r.appendChild(o);return r}(new w(n))},insertNode:function(e){var t=this;p(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&u.splitDataNode(t.startContainer,t.startOffset),u.insertAfter(e,t.startContainer)):u.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new y(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return("#text"==e?this.startContainer.nodeValue:e)+"("+this.startOffset+") : "+("#text"==t?this.endContainer.nodeValue:t)+"("+this.endOffset+")"}}),w=l.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||p(t.startContainer)?g(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||p(t.endContainer)?g(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,p(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t},traverse:function(e){function t(){return i._current=i._next,i._next=i._current&&i._current.nextSibling!=i._end?i._current.nextSibling:null,i._current}for(var n,i=this;n=t();)i.hasPartialSubtree()?i.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,i,o,r,s=this,a=s.range.startContainer==s._current,l=s.range.endContainer==s._current;p(s._current)&&(a||l)?(t=a?s.range.startOffset:0,n=l?s.range.endOffset:s._current.length,i=n-t,e&&(a||l)&&(s._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=i),s._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=i)),s._current.deleteData(t,i)):(o=s._current.parentNode,!e||s.range.startContainer!=o&&s.range.endContainer!=o||(r=f(s._current),o==e.startContainer&&e.startOffset>=r&&(e.startOffset-=1),o==e.endContainer&&e.endOffset>r&&(e.endOffset-=1)),u.remove(s._current))},hasPartialSubtree:function(){return!p(this._current)&&(u.isAncestorOrSelf(this._current,this.range.startContainer)||u.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),u.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),u.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new w(t)}}),b=l.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();r(t,e,!1),r(t,e,!0),t.select()},removeAllRanges:function(){var e=this.ownerDocument.selection;"None"!=e.type&&e.empty()},getRangeAt:function(){var e,t,n,i,r,a,l,c,h=new y(this.ownerDocument),d=this.ownerDocument.selection;try{if(e=d.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return h}catch(u){return h}if("Control"==d.type)h.selectNode(e.item(0));else if(n=o(e),s(e,h,n,!0),s(e,h,n,!1),9==h.startContainer.nodeType&&h.setStart(h.endContainer,h.startOffset),9==h.endContainer.nodeType&&h.setEnd(h.startContainer,h.endOffset),0===e.compareEndPoints("StartToEnd",e)&&h.collapse(!1),i=h.startContainer,r=h.endContainer,a=this.ownerDocument.body,!(h.collapsed||0!==h.startOffset||h.endOffset!=m(h.endContainer)||i==r&&p(i)&&i.parentNode==a)){for(l=!1,c=!1;0===f(i)&&i==i.parentNode.firstChild&&i!=a;)i=i.parentNode,l=!0;for(;f(r)==m(r.parentNode)-1&&r==r.parentNode.lastChild&&r!=a;)r=r.parentNode,c=!0;i==a&&r==a&&l&&c&&(h.setStart(i,0),h.setEnd(r,m(a)))}return h}}),x=l.extend({init:function(e){this.enumerate=function(){function t(e){if(u.is(e,"img")||3==e.nodeType&&(!u.isWhitespace(e)||"﻿"==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new w(e).traverse(t),n}}}),k=l.extend({init:function(e,t){var n=this;n.range=e,n.rootNode=T.documentFromRange(e),n.body=t||n.getEditable(e),"body"!=u.name(n.body)&&(n.rootNode=n.body),n.html=n.body.innerHTML,n.startContainer=n.nodeToPath(e.startContainer),n.endContainer=n.nodeToPath(e.endContainer),n.startOffset=n.offset(e.startContainer,e.startOffset),n.endOffset=n.offset(e.endContainer,e.endOffset)},index:function(e){for(var t,n=0,i=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||i!=t)&&n++,i=t;return n},getEditable:function(e){for(var t=e.commonAncestorContainer;t&&(3==t.nodeType||t.attributes&&!t.attributes.contentEditable);)t=t.parentNode;return t},restoreHtml:function(){this.body.innerHTML=this.html},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,i){for(var o=this.rootNode,r=n.length,s=i;r--;)o=o.childNodes[n[r]];for(;o&&3==o.nodeType&&s>o.nodeValue.length;)s-=o.nodeValue.length,o=o.nextSibling;o&&s>=0&&e[t?"setStart":"setEnd"](o,s)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),C=l.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=u.create(T.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t,n,i,o,r=this,s=r.caret.previousSibling,a=0;s&&(a=p(s)?s.nodeValue.length:f(s)),t=r.caret.parentNode,n=s?f(s):0,u.remove(r.caret),v(t),i=t.childNodes[n],p(i)?e.setStart(i,a):i?(o=u.lastTextNode(i),o?e.setStart(o,o.nodeValue.length):e[s?"setStartAfter":"setStartBefore"](i)):(d.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,i,o=this,r=e.collapsed&&!T.isExpandable(e),s=T.documentFromRange(e);return t&&e.collapsed&&(o.addCaret(e),e=T.expand(e)),n=e.cloneRange(),n.collapse(!1),o.end=u.create(s,"span",{className:"k-marker"}),n.insertNode(o.end),n=e.cloneRange(),n.collapse(!0),o.start=o.end.cloneNode(!0),n.insertNode(o.start),o._removeDeadMarkers(o.start,o.end),r&&(i=s.createTextNode("﻿"),u.insertAfter(i.cloneNode(),o.start),u.insertBefore(i,o.end)),v(e.commonAncestorContainer),e.setStartBefore(o.start),e.setEndAfter(o.end),e},_removeDeadMarkers:function(e,t){e.previousSibling&&"﻿"==e.previousSibling.nodeValue&&u.remove(e.previousSibling),t.nextSibling&&"﻿"==t.nextSibling.nodeValue&&u.remove(t.nextSibling)},_normalizedIndex:function(e){for(var t=f(e),n=e;n.previousSibling;)3==n.nodeType&&3==n.previousSibling.nodeType&&t--,n=n.previousSibling;return t},remove:function(e){var t,n,i,o,r,s,a,l,c,h,d,f=this,g=f.start,m=f.end;for(v(e.commonAncestorContainer);!g.nextSibling&&g.parentNode;)g=g.parentNode;for(;!m.previousSibling&&m.parentNode;)m=m.parentNode;if(t=g.previousSibling&&3==g.previousSibling.nodeType&&g.nextSibling&&3==g.nextSibling.nodeType,n=m.previousSibling&&3==m.previousSibling.nodeType&&m.nextSibling&&3==m.nextSibling.nodeType,i=t&&n,g=g.nextSibling,m=m.previousSibling,o=!1,r=!1,g==f.end&&(r=!!f.start.previousSibling,g=m=f.start.previousSibling||f.end.nextSibling,o=!0),u.remove(f.start),u.remove(f.end),!g||!m)return e.selectNodeContents(e.commonAncestorContainer),void e.collapse(!0);if(s=o?p(g)?g.nodeValue.length:g.childNodes.length:0,a=p(m)?m.nodeValue.length:m.childNodes.length,3==g.nodeType)for(;g.previousSibling&&3==g.previousSibling.nodeType;)g=g.previousSibling,s+=g.nodeValue.length;if(3==m.nodeType)for(;m.previousSibling&&3==m.previousSibling.nodeType;)m=m.previousSibling,a+=m.nodeValue.length;l=g.parentNode,c=m.parentNode,h=this._normalizedIndex(g),d=this._normalizedIndex(m),v(l),3==g.nodeType&&(g=l.childNodes[h]),v(c),3==m.nodeType&&(m=c.childNodes[d]),o?(3==g.nodeType?e.setStart(g,s):e[r?"setStartAfter":"setStartBefore"](g),e.collapse(!0)):(3==g.nodeType?e.setStart(g,s):e.setStartBefore(g),3==m.nodeType?e.setEnd(m,a):e.setEndAfter(m)),f.caret&&f.removeCaret(e)}}),S=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,T={nodes:function(e){var t=T.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=T.textNodes(e),t.length||(t=u.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new x(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return d.msie&&9>d.version?new y(e):e.createRange()},selectRange:function(e){var t,n=T.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=_.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},stringify:function(e){return a.format("{0}:{1} - {2}:{3}",u.name(e.startContainer),e.startOffset,u.name(e.endContainer),e.endOffset)},split:function(e,t,n){function i(i){var o,r=e.cloneRange();r.collapse(i),r[i?"setStartBefore":"setEndAfter"](t),o=r.extractContents(),n&&(o=u.trim(o)),u[i?"insertBefore":"insertAfter"](o,t)}i(!0),i(!1)},mapAll:function(t,n){var i=[];return new w(t).traverse(function(t){var o=n(t);o&&e.inArray(o,i)<0&&i.push(o)}),i},getAll:function(e,t){var n=t;return"string"==typeof t&&(t=function(e){return u.is(e,n)}),T.mapAll(e,function(e){return t(e)?e:void 0})},getMarkers:function(e){return T.getAll(e,function(e){return"k-marker"==e.className})},image:function(e){var t=T.getAll(e,"img");return 1==t.length?t[0]:void 0},isStartOf:function(e,t){var n,i;for(e=e.cloneRange();0===e.startOffset&&e.startContainer!=t;){for(n=u.findNodeIndex(e.startContainer),i=e.startContainer.parentNode;n>0&&u.insignificant(i[n-1]);)n--;e.setStart(i,n)}return 0===e.startOffset&&e.startContainer==t},isEndOf:function(e,t){function n(e){u.insignificant(e)||o.push(e)}var i,o;return e=e.cloneRange(),e.collapse(!1),i=e.startContainer,u.isDataNode(i)&&e.startOffset==u.getNodeLength(i)&&(e.setStart(i.parentNode,u.findNodeIndex(i)+1),e.collapse(!0)),e.setEnd(t,u.getNodeLength(t)),o=[],new w(e).traverse(n),!o.length},wrapSelectedElements:function(e){function t(e,t){var n,i=u.getNodeLength(t);if(e==i)return!0;for(n=e;i>n;n++)if(!u.insignificant(t.childNodes[n]))return!1;return!0}for(var n=u.editableParent(e.startContainer),i=u.editableParent(e.endContainer);0===e.startOffset&&e.startContainer!=n;)e.setStart(e.startContainer.parentNode,u.findNodeIndex(e.startContainer));for(;t(e.endOffset,e.endContainer)&&e.endContainer!=i;)e.setEnd(e.endContainer.parentNode,u.findNodeIndex(e.endContainer)+1);return e},expand:function(e){var t,n,i,o,r=e.cloneRange(),s=r.startContainer.childNodes[0===r.startOffset?0:r.startOffset-1],a=r.endContainer.childNodes[r.endOffset];return p(s)&&p(a)?(t=s.nodeValue,n=a.nodeValue,t&&n?(i=t.split("").reverse().join("").search(S),o=n.search(S),i&&o?(o=-1==o?n.length:o,i=-1==i?0:t.length-i,r.setStart(s,i),r.setEnd(a,o),r):r):r):r},isExpandable:function(e){var t,n,i,o,r,s,a=e.startContainer,l=T.documentFromRange(e);return a==l||a==l.body?!1:(t=e.cloneRange(),(n=a.nodeValue)?(i=n.substring(0,t.startOffset),o=n.substring(t.startOffset),r=0,s=0,i&&(r=i.split("").reverse().join("").search(S)),o&&(s=o.search(S)),r&&s):!1)}};c(h,{SelectionUtils:_,W3CRange:y,RangeIterator:w,W3CSelection:b,RangeEnumerator:x,RestorePoint:k,Marker:C,RangeUtils:T})}(window.kendo.jQuery),function(e){function t(e,t){var n=e.selectionRestorePoint=new h(e.getRange()),i=new p(t,n);return i.editor=e,e.undoRedoStack.push(i),n}var n=window.kendo,i=n.Class,o=n.ui.editor,r=o.EditorUtils,s=r.registerTool,a=o.Dom,l=o.Tool,c=o.ToolTemplate,h=o.RestorePoint,d=o.Marker,u=e.extend,f=i.extend({init:function(e){this.options=e,this.restorePoint=new h(e.range),this.marker=new d,this.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),this.editor.selectRange(e)},undo:function(){var e=this.restorePoint;e.restoreHtml(),this.editor.selectRange(e.toRange())},redo:function(){this.exec()},createDialog:function(t,i){var o=this.editor;return e(t).appendTo(document.body).kendoWindow(u({},o.options.dialogOptions,i)).closest(".k-window").toggleClass("k-rtl",n.support.isRtl(o.wrapper)).end()},exec:function(){var e=this.lockRange(!0);this.formatter.editor=this.editor,this.formatter.toggle(e),this.releaseRange(e)}}),p=i.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,this.editor.selectRange(this.startRestorePoint.toRange())}}),g=f.extend({init:function(e){f.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e,t=this.editor,n=this.options,i=n.range,o=t.body,r=new h(i,o),s=n.html||n.value||"";t.selectRange(i),t.clipboard.paste(s,n),n.postProcess&&n.postProcess(t,t.getRange()),e=new p(r,new h(t.getRange(),o)),e.editor=t,t.undoRedoStack.push(e),t.focus()}}),m=l.extend({initialize:function(e,t){var n=t.editor,i=this.options,r=i.items?i.items:n.options.insertHtml;new o.SelectBox(e,{dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){l.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new g(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),v=i.extend({init:function(){this.clear()},push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},clear:function(){this.stack=[],this.currentCommandIndex=-1},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),_=i.extend({init:function(e){this.editor=e},keydown:function(n){var i,o=this,r=o.editor,s=r.keyboard,a=s.isTypingKey(n),l=u(e.Event(),n);return o.editor.trigger("keydown",l),l.isDefaultPrevented()?(n.preventDefault(),!0):l.isDefaultPrevented()||!a||s.isTypingInProgress()?!1:(i=r.getRange(),o.startRestorePoint=new h(i),s.startTyping(function(){o.endRestorePoint=t(r,o.startRestorePoint)}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),y=i.extend({init:function(e){this.editor=e},_addCaret:function(e){var t=a.create(this.editor.document,"a");return e.appendChild(t),t},_restoreCaret:function(e){var t=this.editor.createRange();t.setStartAfter(e),t.collapse(!0),this.editor.selectRange(t),a.remove(e)},_handleDelete:function(e){var t,n,i=e.endContainer,r=a.closestEditableOfType(i,a.blockElements);return r&&o.RangeUtils.isEndOf(e,r)?(t=this._addCaret(r),n=a.next(r),n&&"p"==a.name(n)?(this._merge(r,n),this._restoreCaret(t),!0):(a.remove(t),!1)):!1},_handleBackspace:function(e){var t,n,i,r,s=e.startContainer,l=e.startOffset,c=a.closestEditableOfType(s,["li"]),h=a.closestEditableOfType(s,"p,h1,h2,h3,h4,h5,h6".split(","));if(a.isDataNode(s)){for(;l>=0&&"﻿"==s.nodeValue[l-1];)s.deleteData(l-1,1),l--;e.setStart(s,Math.max(0,l)),e.collapse(!0),this.editor.selectRange(e)}return h&&h.previousSibling&&o.RangeUtils.isStartOf(e,h)?(t=h.previousSibling,n=this._addCaret(t),this._merge(t,h),this._restoreCaret(n),!0):c&&o.RangeUtils.isStartOf(e,c)?(i=new o.GreedyBlockFormatter([{tags:["p"]}]),r=c.firstChild,i.editor=this.editor,i.apply(c.childNodes),e.setStart(r,0),this.editor.selectRange(e),!0):!1},_handleSelection:function(t){var n,i,r,s=t.commonAncestorContainer,l=a.closest(s,"table"),c=o.emptyElementContent;return/t(able|body)/i.test(a.name(s))&&t.selectNode(l),n=new d,n.add(t,!1),t.setStartAfter(n.start),t.setEndBefore(n.end),i=t.startContainer,r=t.endContainer,t.deleteContents(),l&&""===e(l).text()&&(t.selectNode(l),t.deleteContents()),s=t.commonAncestorContainer,"p"===a.name(s)&&""===s.innerHTML&&(s.innerHTML=c,t.setStart(s,0)),this._join(i,r),a.insertAfter(this.editor.document.createTextNode("﻿"),n.start),n.remove(t),i=t.startContainer,"tr"==a.name(i)&&(i=i.childNodes[Math.max(0,t.startOffset-1)],t.setStart(i,a.getNodeLength(i))),t.collapse(!0),this.editor.selectRange(t),!0},_root:function(e){for(;e&&e.parentNode&&"body"!=a.name(e.parentNode);)e=e.parentNode;return e},_join:function(e,t){e=this._root(e),t=this._root(t),e!=t&&a.is(t,"p")&&this._merge(e,t)},_merge:function(e,t){for(a.removeTrailingBreak(e);t.firstChild;)e.appendChild(t.firstChild);a.remove(t)},keydown:function(e){var i,o,r=this.editor.getRange(),s=e.keyCode,a=n.keys,l=s===a.BACKSPACE,c=s==a.DELETE;!l&&!c||r.collapsed?l?i="_handleBackspace":c&&(i="_handleDelete"):i="_handleSelection",i&&(o=new h(r),this[i](r)&&(e.preventDefault(),t(this.editor,o)))},keyup:e.noop}),w=i.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){this.startRestorePoint=this.endRestorePoint=t(this.editor,this.startRestorePoint)},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,i=n.keyboard;return i.isModifierKey(e)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new h(n.getRange()),!0):i.isSystem(e)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(){var e=this;return e.systemCommandIsInProgress&&e.changed()?(e.systemCommandIsInProgress=!1,e.createUndoCommand(),!0):!1}}),b=i.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&90>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||229==e},toolFromShortcut:function(t,n){var i,o,r=String.fromCharCode(n.keyCode);for(i in t)if(o=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(o.key==r||o.key==n.keyCode)&&o.ctrl==n.ctrlKey&&o.alt==n.altKey&&o.shift==n.shiftKey)return i},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress&&this.onEndTyping&&this.onEndTyping(),this.typingInProgress=!1},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,i=this.handlers;for(n=0;i.length>n&&!i[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),x=i.extend({init:function(e){this.editor=e,this.cleaners=[new C,new S,new T,new A]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=a.create(n,"div"),o=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)o.appendChild(i.firstChild);return o},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},_startModification:function(){var e,t,n=this.editor;if(!this._inProgress)return this._inProgress=!0,e=n.getRange(),t=new h(e),a.persistScrollTop(n.document),{range:e,restorePoint:t}},_endModification:function(e){t(this.editor,e.restorePoint),this.editor._selectionChange(),this._inProgress=!1},_contentModification:function(e,t){var n=this,i=n.editor,o=n._startModification();o&&(e.call(n,i,o.range),setTimeout(function(){t.call(n,i,o.range),n._endModification(o)}))},oncut:function(){this._contentModification(e.noop,e.noop)},_fileToDataURL:function(t){var n=e.Deferred(),i=new FileReader;return t instanceof window.File||(t=t.getAsFile()),i.onload=e.proxy(n.resolve,n),i.readAsDataURL(t),n.promise()},_triggerPaste:function(e,t){var n={html:e||""};n.html=n.html.replace(/\ufeff/g,""),this.editor.trigger("paste",n),this.paste(n.html,t||{})},_handleImagePaste:function(t){var n,i,o,r;if("FileReader"in window&&(n=t.clipboardData||t.originalEvent.clipboardData||window.clipboardData,i=n&&(n.items||n.files),o=i&&e.grep(i,function(e){return/^image\//i.test(e.type)}),o.length&&(r=this._startModification())))return e.when.apply(e,e.map(o,this._fileToDataURL)).done(e.proxy(function(){var t=Array.prototype.slice.call(arguments),n=e.map(t,function(e){return'<img src="'+e.target.result+'" />'}).join("");this._triggerPaste(n),this._endModification(r)},this)),!0},onpaste:function(t){return this._handleImagePaste(t)?void t.preventDefault():void this._contentModification(function(i,o){var r,s,l,c=a.create(i.document,"div",{className:"k-paste-container",innerHTML:"﻿"}),h=n.support.browser;i.body.appendChild(c),h.msie&&11>h.version?(t.preventDefault(),r=i.createRange(),r.selectNodeContents(c),i.selectRange(r),s=i.document.body.createTextRange(),s.moveToElementText(c),e(i.body).unbind("paste"),s.execCommand("Paste"),e(i.body).bind("paste",e.proxy(this.onpaste,this))):(l=i.createRange(),l.selectNodeContents(c),i.selectRange(l)),o.deleteContents()},function(t,n){var i,o="";t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&a.is(e,"br")&&a.remove(e),o+=this.innerHTML}),i.remove(),this._triggerPaste(o,{clean:!0})})},splittableParent:function(e,t){var n,i;if(e)return a.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,a.isInline(n))for(;n.parentNode!=i&&!a.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var i,r,s,l,c,h,f,p,g,m,v,_,y=this.editor;for(n=u({clean:!1,split:!0},n),i=0,r=this.cleaners.length;r>i;i++)this.cleaners[i].applicable(t)&&(t=this.cleaners[i].clean(t));if(n.clean&&(t=t.replace(/(<br>(\s|&nbsp;)*)+(<\/?(div|p|li|col|t))/gi,"$3"),t=t.replace(/<(a|span)[^>]*><\/\1>/gi,"")),t=t.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>"),s=this.isBlock(t),y.focus(),l=y.getRange(),l.deleteContents(),l.startContainer==y.document&&l.selectNodeContents(y.body),c=new d,h=c.addCaret(l),f=this.splittableParent(s,h),p=!1,g=f!=y.body&&!a.is(f,"td"),n.split&&g&&(s||a.isInline(f))&&(l.selectNode(h),o.RangeUtils.split(l,f,!0),p=!0),m=this.htmlToFragment(t),m.firstChild&&"k-paste-container"===m.firstChild.className){for(v=[],i=0,r=m.childNodes.length;r>i;i++)v.push(m.childNodes[i].innerHTML);
  m=this.htmlToFragment(v.join("<br />"))}if(e(m.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),l.insertNode(m),f=this.splittableParent(s,h),p){for(;h.parentNode!=f;)a.unwrap(h.parentNode);a.unwrap(h.parentNode)}a.normalize(l.commonAncestorContainer),h.style.display="inline",a.restoreScrollTop(y.document),a.scrollTo(h),c.removeCaret(l),_=l.commonAncestorContainer.parentNode,l.collapsed&&"tbody"==a.name(_)&&(l.setStartAfter(e(_).closest("table")[0]),l.collapse(!0)),y.selectRange(l)}}),k=i.extend({clean:function(e){var t,n,i=this,o=i.replacements;for(t=0,n=o.length;n>t;t+=2)e=e.replace(o[t],o[t+1]);return e}}),C=k.extend({init:function(){this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(e){return/<script[^>]*>/i.test(e)}}),S=k.extend({init:function(){var e=" ";this.replacements=[/<span\s+class="Apple-tab-span"[^>]*>\s*<\/span>/gi,e,/\t/gi,e,/&nbsp;&nbsp; &nbsp;/gi,e]},applicable:function(e){return/&nbsp;&nbsp; &nbsp;|class="?Apple-tab-span/i.test(e)}}),T=k.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/&quot;/g,"'",/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>(?!\n)/g," ",/<table([^>]*)>(\s|&nbsp;)+<t/gi,"<table$1><t",/<tr[^>]*>(\s|&nbsp;)*<\/tr>/gi,"",/<tbody[^>]*>(\s|&nbsp;)*<\/tbody>/gi,"",/<table[^>]*>(\s|&nbsp;)*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*(&nbsp;)+/gi,"",/(&nbsp;|<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)font(\s[^>]*)?>/gi,this.convertFontMatch,/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/<o:p>&nbsp;<\/o:p>/gi,"&nbsp;",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/<\/o>/g,"",/style=(["|'])\s*\1/g,"",/(<br[^>]*>)?\n/g,function(e,t){return t?e:" "}]},convertFontMatch:function(e,t,n){var i=/face=['"]([^'"]+)['"]/i,o=i.exec(n),r=n&&o&&o[1];return t?"</span>":r?'<span style="font-family:'+r+'">':"<span>"},applicable:function(e){return/class="?Mso/i.test(e)||/style="[^"]*mso-/i.test(e)||/urn:schemas-microsoft-com:office/.test(e)},stripEmptyAnchors:function(e){return e.replace(/<a([^>]*)>\s*<\/a>/gi,function(e,t){return!t||t.indexOf("href")<0?"":e})},listType:function(e){var t;return/^(<span [^>]*texhtml[^>]*>)?<span [^>]*(Symbol|Wingdings)[^>]*>/i.test(e)&&(t=!0),e=e.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),!t&&/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(e)||t&&/^.\u00a0+/.test(e)?"ul":/^\s*\w+[\.\)]\u00a0{2,}/.test(e)?"ol":void 0},_convertToLi:function(e){var t;return 1==e.childNodes.length?t=e.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(a.remove(e.firstChild),3==e.firstChild.nodeType&&/^[ivx]+\.$/i.test(e.firstChild.nodeValue)&&a.remove(e.firstChild),/^(&nbsp;|\s)+$/i.test(e.firstChild.innerHTML)&&a.remove(e.firstChild),t=e.innerHTML),a.remove(e),a.create(document,"li",{innerHTML:t})},lists:function(t){var n,i,o,r,s,l,c,h,d,u=e(a.blockElements.join(","),t),f=-1,p={ul:{},ol:{}},g=t;for(o=0;u.length>o;o++)if(r=u[o],s=this.listType(r.innerHTML),i=a.name(r),"td"!=i)if(s&&"p"==i){if(l=parseFloat(r.style.marginLeft||0),c=p[s][l],(l>f||!c)&&(c=a.create(document,s),g==t?a.insertBefore(c,r):g.appendChild(c),p[s][l]=c),n!=s)for(h in p)for(d in p[h])e.contains(c,p[h][d])&&delete p[h][d];g=this._convertToLi(r),c.appendChild(g),f=l,n=s}else r.innerHTML?(p={ul:{},ol:{}},g=t,f=-1):a.remove(r)},removeAttributes:function(e){for(var t=e.attributes,n=t.length;n--;)"colspan"!=a.name(t[n])&&e.removeAttributeNode(t[n])},createColGroup:function(t){var i=t.cells,o=e(t).closest("table"),r=o.children("colgroup");2>i.length||(r.length&&(i=r.children(),r[0].parentNode.removeChild(r[0])),r=e(e.map(i,function(e){var t=e.width;return t&&0!==parseInt(t,10)?n.format('<col style="width:{0}px;"/>',t):"<col />"}).join("")),r.is("colgroup")||(r=e("<colgroup/>").append(r)),r.prependTo(o))},convertHeaders:function(t){var n,i=t.cells,o=e.map(i,function(t){var n=e(t).children("p").children("strong")[0];return n&&"strong"==a.name(n)?n:void 0});if(o.length==i.length){for(n=0;o.length>n;n++)a.unwrap(o[n]);for(e(t).closest("table").find("colgroup").after("<thead></thead>").end().find("thead").append(t),n=0;i.length>n;n++)a.changeTag(i[n],"th")}},removeParagraphs:function(t){var n,i,o,r,s;for(n=0;t.length>n;n++)for(this.removeAttributes(t[n]),r=e(t[n]),s=r.children("p"),i=0,o=s.length;o>i;i++)o-1>i&&a.insertAfter(a.create(document,"br"),s[i]),a.unwrap(s[i])},removeDefaultColors:function(e){for(var t=0;e.length>t;t++)/^\s*color:\s*[^;]*;?$/i.test(e[t].style.cssText)&&a.unwrap(e[t])},tables:function(t){var n,i,o,r,s,a=e(t).find("table"),l=this;for(r=0;a.length>r;r++){for(n=a[r].rows,o=i=n[0],s=1;n.length>s;s++)n[s].cells.length>o.cells.length&&(o=n[s]);l.createColGroup(o),l.convertHeaders(i),l.removeAttributes(a[r]),l.removeParagraphs(a.eq(r).find("td,th")),l.removeDefaultColors(a.eq(r).find("span"))}},headers:function(t){var n,i=e(t).find("p.MsoTitle");for(n=0;i.length>n;n++)a.changeTag(i[n],"h1")},clean:function(e){var t,n=this;return e=k.fn.clean.call(n,e),e=n.stripEmptyAnchors(e),t=a.create(document,"div",{innerHTML:e}),n.headers(t),n.lists(t),n.tables(t),e=t.innerHTML.replace(/(<[^>]*)\s+class="?[^"\s>]*"?/gi,"$1")}}),A=k.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)}}),D=f.extend({init:function(e){f.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e=this.editor;n.support.browser.msie?e.document.execCommand("print",!1,null):e.window.print&&e.window.print()}}),P=f.extend({init:function(e){this.async=!0,f.fn.init.call(this,e)},exec:function(){var e=this,t=this.lockRange(!0);this.editor.saveAsPDF().then(function(){e.releaseRange(t)})}});u(o,{_finishUpdate:t,Command:f,GenericCommand:p,InsertHtmlCommand:g,InsertHtmlTool:m,UndoRedoStack:v,TypingHandler:_,SystemHandler:w,BackspaceHandler:y,Keyboard:b,Clipboard:x,Cleaner:k,TabCleaner:S,MSWordFormatCleaner:T,WebkitFormatCleaner:A,PrintCommand:D,ExportPdfCommand:P}),s("insertHtml",new m({template:new c({template:r.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})})),s("print",new l({command:D,template:new c({template:r.buttonTemplate,title:"Print"})})),s("pdf",new l({command:P,template:new c({template:r.buttonTemplate,title:"Export PDF"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,o=t.ui.Editor.fn.options.formats,r=i.EditorUtils,s=i.Tool,a=i.ToolTemplate,l=i.FormatTool,c=i.Dom,h=i.RangeUtils,d=e.extend,u=i.EditorUtils.registerTool,f=i.EditorUtils.registerFormat,p="k-marker",g=n.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,i=0,o=0,r=e.parentNode;for(t=r.firstChild;t;t=t.nextSibling)t!=e&&(t.className==p?o++:3==t.nodeType?n++:i++);return o>1&&r.firstChild.className==p&&r.lastChild.className==p?0:i+n},findSuitable:function(e,t){var n,i;if(!t&&this.numberOfSiblings(e)>0)return null;for(n=e.parentNode,i=this.format[0].tags;!c.ofType(n,i);){if(this.numberOfSiblings(n)>0)return null;n=n.parentNode}return n},findFormat:function(e){var t,n,i,o,r,s=this.format,a=c.attrEquals;for(t=0,n=s.length;n>t;t++){if(i=e,o=s[t].tags,r=s[t].attr,i&&c.ofType(i,o)&&a(i,r))return i;for(;i;)if(i=c.parentOfType(i,o),i&&a(i,r))return i}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(this.findFormat(e[t]))return!0;return!1}}),m=n.extend({init:function(e,t){this.finder=new g(e),this.attributes=d({},e[0].attr,t),this.tag=e[0].tags[0]},wrap:function(e){return c.wrap(e,c.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){this.finder.isFormatted(t)?(this.split(e),this.remove(t)):this.apply(t)},toggle:function(e){var t=h.textNodes(e);t.length>0&&this.activate(e,t)},apply:function(e){var t,n,i,o,r=[];for(t=0,n=e.length;n>t;t++){if(i=e[t],o=this.finder.findSuitable(i))c.attr(o,this.attributes);else{for(;!c.isBlock(i.parentNode)&&1==i.parentNode.childNodes.length;)i=i.parentNode;o=this.wrap(i)}r.push(o)}this.consolidate(r)},remove:function(e){var t,n,i;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(this.attributes&&this.attributes.style?(c.unstyle(i,this.attributes.style),i.style.cssText||i.attributes["class"]||c.unwrap(i)):c.unwrap(i))},split:function(e){var t,n,i=h.textNodes(e),o=i.length;if(o>0)for(t=0;o>t;t++)n=this.finder.findFormat(i[t]),n&&h.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==p&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);c.remove(t)}}}),v=g.extend({init:function(e,t){this.format=e,this.greedyProperty=t,g.fn.init.call(this,e)},getInlineCssValue:function(t){var n,i,o,r,s,a,l,h,d,u,f,p,g=t.attributes,m=e.trim;if(g)for(n=0,i=g.length;i>n;n++)if(o=g[n],r=o.nodeName,s=o.nodeValue,o.specified&&"style"==r)for(a=m(s||t.style.cssText).split(";"),h=0,d=a.length;d>h;h++)if(l=a[h],l.length){if(u=l.split(":"),f=m(u[0].toLowerCase()),p=m(u[1]),f!=this.greedyProperty)continue;return f.indexOf("color")>=0?c.toHex(p):p}},getFormatInner:function(t){var n,i,o,r=e(c.isDataNode(t)?t.parentNode:t),s=r.parentsUntil("[contentEditable]").addBack().toArray().reverse();for(n=0,i=s.length;i>n;n++)if(o="className"==this.greedyProperty?s[n].className:this.getInlineCssValue(s[n]))return o;return"inherit"},getFormat:function(e){var t,n,i=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(i!=this.getFormatInner(e[t]))return"";return i},isFormatted:function(e){return""!==this.getFormat(e)}}),_=m.extend({init:function(e,n,i){m.fn.init.call(this,e,n),this.values=n,this.finder=new v(e,i),i&&(this.greedyProperty=t.toCamelCase(i))},activate:function(e,t){var n=this.greedyProperty,i="apply";this.split(e),n&&"inherit"==this.values.style[n]&&(i="remove"),this[i](t)}}),y=l.extend({init:function(e){l.fn.init.call(this,d(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}}),w=s.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),b=w.extend({init:function(e){s.fn.init.call(this,e),this.type=t.support.browser.msie||t.support.touch?"kendoDropDownList":"kendoComboBox",this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(d(e,{formatter:function(){return o[t.domAttr]=e.value,new _(n,{style:o},t.cssAttr)}}))},initialize:function(e,t){var n,i=t.editor,o=this.options,r=o.name,a=[];o.defaultValue&&(a=[{text:i.options.messages[o.defaultValue[0].text],value:o.defaultValue[0].value}]),n=a.concat(o.items?o.items:i.options[r]||[]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){s.exec(i,r,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),x=s.extend({init:function(e){s.fn.init.call(this,e),this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(d(e,{formatter:function(){return o[t.domAttr]=e.value,new _(n,{style:o},t.cssAttr)}}))},initialize:function(n,i){var o=i.editor,r=this.name,a=d({},x.fn.options,this.options),l=a.palette;n=this._widget=new t.ui.ColorPicker(n,{value:e.isArray(l)?l[0]:"#000",toolIcon:"k-"+a.name,palette:l,change:function(){var e=n.value();e&&s.exec(o,r,e),o.focus()},activate:function(e){e.preventDefault(),n.trigger("change")}}),n.wrapper.attr({title:i.title,unselectable:"on"}).find("*").attr("unselectable","on")}});d(i,{InlineFormatFinder:g,InlineFormatter:m,DelayedExecutionTool:w,GreedyInlineFormatFinder:v,GreedyInlineFormatter:_,InlineFormatTool:y,FontTool:b,ColorTool:x}),f("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),u("bold",new y({key:"B",ctrl:!0,format:o.bold,template:new a({template:r.buttonTemplate,title:"Bold"})})),f("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),u("italic",new y({key:"I",ctrl:!0,format:o.italic,template:new a({template:r.buttonTemplate,title:"Italic"})})),f("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),u("underline",new y({key:"U",ctrl:!0,format:o.underline,template:new a({template:r.buttonTemplate,title:"Underline"})})),f("strikethrough",[{tags:["del","strike"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),u("strikethrough",new y({format:o.strikethrough,template:new a({template:r.buttonTemplate,title:"Strikethrough"})})),f("superscript",[{tags:["sup"]}]),u("superscript",new y({format:o.superscript,template:new a({template:r.buttonTemplate,title:"Superscript"})})),f("subscript",[{tags:["sub"]}]),u("subscript",new y({format:o.subscript,template:new a({template:r.buttonTemplate,title:"Subscript"})})),u("foreColor",new x({cssAttr:"color",domAttr:"color",name:"foreColor",template:new a({template:r.colorPickerTemplate,title:"Color"})})),u("backColor",new x({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new a({template:r.colorPickerTemplate,title:"Background Color"})})),u("fontName",new b({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new a({template:r.comboBoxTemplate,title:"Font Name"})})),u("fontSize",new b({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new a({template:r.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery),function(e){var t,n=window.kendo,i=n.Class,o=e.extend,r=n.ui.editor,s=n.ui.Editor.fn.options.formats,a=r.Dom,l=r.Command,c=r.ToolTemplate,h=r.FormatTool,d=r.EditorUtils,u=d.registerTool,f=d.registerFormat,p=r.RangeUtils,g=i.extend({init:function(e){this.format=e},contains:function(e,t){var n,i,o;for(n=0,i=t.length;i>n;n++)if(o=t[n],!o||!a.isAncestorOrSelf(e,o))return!1;return!0},findSuitable:function(t){var n,i,o,r,s=this.format,l=[];for(n=0,i=t.length;i>n;n++){for(r=s.length-1;r>=0&&!(o=a.ofType(t[n],s[r].tags)?t[n]:a.parentOfType(t[n],s[r].tags));r--);if(!o||"true"===o.contentEditable)return[];e.inArray(o,l)<0&&l.push(o)}for(n=0,i=l.length;i>n;n++)if(this.contains(l[n],l))return[l[n]];return l},findFormat:function(e){var t,n,i,o,r,s=this.format,l=a.editableParent(e);for(t=0,n=s.length;n>t;t++)for(i=e,o=s[t].tags,r=s[t].attr;i&&a.isAncestorOf(l,i);){if(a.ofType(i,o)&&a.attrEquals(i,r))return i;i=i.parentNode}return null},getFormat:function(e){var t,n,i=this,o=function(e){return i.findFormat(a.isDataNode(e)?e.parentNode:e)},r=o(e[0]);if(!r)return"";for(t=1,n=e.length;n>t;t++)if(r!=o(e[t]))return"";return r.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;n>t;t++)if(!this.findFormat(e[t]))return!1;return!0}}),m=i.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new g(e)},wrap:function(e,t,n){var i,o,r,s,l,c=1==n.length?a.blockParentOrBody(n[0]):a.commonAncestor.apply(null,n);for(a.isInline(c)&&(c=a.blockParentOrBody(c)),i=a.significantChildNodes(c),o=a.findNodeIndex(i[0]),r=a.create(c.ownerDocument,e,t),s=0;i.length>s;s++)l=i[s],a.isBlock(l)?(a.attr(l,t),r.childNodes.length&&(a.insertBefore(r,l),r=r.cloneNode(!1)),o=a.findNodeIndex(l)+1):r.appendChild(l);r.firstChild&&a.insertAt(c,r,o)},apply:function(t){function n(e){return o({},e&&e.attr,h)}var i,r,s,l,c,h=this.values,u=a.filter("img",t),f=d.formatByName("img",this.format),p=n(f);if(e.each(u,function(){a.attr(this,p)}),u.length!=t.length)if(r=a.filter("img",t,!0),s=this.finder.findSuitable(r),s.length)for(l=0,c=s.length;c>l;l++)i=d.formatByName(a.name(s[l]),this.format),a.attr(s[l],n(i));else i=this.format[0],this.wrap(i.tags[0],n(i),r)},remove:function(e){var t,n,i,o,r;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(r=a.name(i),"div"!=r||i.getAttribute("class")?(o=d.formatByName(r,this.format),o.attr.style&&a.unstyle(i,o.attr.style),o.attr.className&&a.removeClass(i,o.attr.className)):a.unwrap(i))},toggle:function(e){var t=this,n=p.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),v=i.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new g(e)},apply:function(e){var t,n,i,o,s,l,c,h=this.format,d=a.blockParents(e),u=h[0].tags[0];if(d.length)for(t=0,n=d.length;n>t;t++)c=a.name(d[t]),"li"==c?(i=d[t].parentNode,o=new r.ListFormatter(i.nodeName.toLowerCase(),u),s=this.editor.createRange(),s.selectNode(d[t]),o.toggle(s)):u&&("td"==c||d[t].attributes.contentEditable)?new m(h,this.values).apply(d[t].childNodes):(l=a.changeTag(d[t],u),a.attr(l,h[0].attr));else new m(h,this.values).apply(e)},toggle:function(e){var t=p.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=p.textNodes(e),t.length||(t=a.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),_=l.extend({init:function(e){e.formatter=e.formatter(),l.fn.init.call(this,e)}}),y=h.extend({init:function(e){h.fn.init.call(this,o(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}});o(r,{BlockFormatFinder:g,BlockFormatter:m,GreedyBlockFormatter:v,FormatCommand:_,BlockFormatTool:y}),t=["ul","ol","li"],f("justifyLeft",[{tags:a.nonListBlockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"left",listStylePosition:""}}}]),u("justifyLeft",new y({format:s.justifyLeft,template:new c({template:d.buttonTemplate,title:"Justify Left"})})),f("justifyCenter",[{tags:a.nonListBlockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"center",listStylePosition:"inside"}}}]),u("justifyCenter",new y({format:s.justifyCenter,template:new c({template:d.buttonTemplate,title:"Justify Center"})})),f("justifyRight",[{tags:a.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"right",listStylePosition:"inside"}}}]),u("justifyRight",new y({format:s.justifyRight,template:new c({template:d.buttonTemplate,title:"Justify Right"})})),f("justifyFull",[{tags:a.nonListBlockElements,attr:{style:{textAlign:"justify"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"justify",listStylePosition:""}}}]),u("justifyFull",new y({format:s.justifyFull,template:new c({template:d.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.Dom,r=i.Command,s=i.Tool,a=i.BlockFormatter,l=o.normalize,c=i.RangeUtils,h=i.EditorUtils.registerTool,d=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},_insertMarker:function(e,t){var n,i=o.create(e,"a");return i.className="k-marker",t.insertNode(i),i.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(i)),l(i.parentNode),i},_moveFocus:function(e,t){if(o.isEmpty(t))e.setStartBefore(t);else{e.selectNodeContents(t);var n=c.textNodes(e)[0];if(!n){for(;t.childNodes.length&&!o.is(t.firstChild,"br");)t=t.firstChild;n=t}o.isEmpty(n)?e.setStartBefore(n):e.selectNodeContents(n)}},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=o.parentOfType(e.startContainer,t),i=o.parentOfType(e.endContainer,t);return n&&!i||!n&&i},_blankAfter:function(e){for(;e&&(o.isMarker(e)||""===o.stripBom(e.nodeValue));)e=e.nextSibling;return!e},exec:function(){var e,t,n,r,s,h,d,u,f=this.getRange(),p=c.documentFromRange(f),g=i.emptyElementContent,m=this.shouldTrim(f);f.deleteContents(),s=this._insertMarker(p,f),h=o.closestEditableOfType(s,["li"]),d=o.closestEditableOfType(s,"h1,h2,h3,h4,h5,h6".split(",")),h?o.emptyNode(h)&&(r=o.create(p,"p"),h.nextSibling&&(u=f.cloneRange(),u.selectNode(h),c.split(u,h.parentNode)),o.insertAfter(r,h.parentNode),o.remove(1==h.parentNode.childNodes.length?h.parentNode:h),r.innerHTML=g,n=r):d&&this._blankAfter(s)&&(r=o.create(p,"p"),o.insertAfter(r,d),r.innerHTML=g,o.remove(s),n=r),n||(h||d||new a([{tags:["p"]}]).apply([s]),f.selectNode(s),e=o.parentOfType(s,[h?"li":d?o.name(d):"p"]),c.split(f,e,m),t=e.previousSibling,o.is(t,"li")&&t.firstChild&&!o.is(t.firstChild,"br")&&(t=t.firstChild),n=e.nextSibling,this.clean(t),this.clean(n,{links:!0}),o.is(n,"li")&&n.firstChild&&!o.is(n.firstChild,"br")&&(n=n.firstChild),o.remove(e),l(t)),l(n),this._moveFocus(f,n),f.collapse(!0),o.scrollTo(n),c.selectRange(f)},clean:function(t,n){var r,s=t;if(t.firstChild&&o.is(t.firstChild,"br")&&o.remove(t.firstChild),o.isDataNode(t)&&!t.nodeValue&&(t=t.parentNode),t){for(r=!1;t.firstChild&&1==t.firstChild.nodeType;)r=r||o.significantNodes(t.childNodes).length>1,t=t.firstChild;if(o.isEmpty(t)||!/^\s*$/.test(t.innerHTML)||r||(e(s).find(".k-br").remove(),t.innerHTML=i.emptyElementContent),n&&n.links)for(;t!=s;){if(o.is(t,"a")&&o.emptyNode(t)){o.unwrap(t);break}t=t.parentNode}}}}),u=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e,n=this.getRange(),i=o.create(c.documentFromRange(n),"br"),r=t.support.browser,s=r.msie&&11>r.version;n.deleteContents(),n.insertNode(i),l(i.parentNode),s||i.nextSibling&&!o.isWhitespace(i.nextSibling)||(e=i.cloneNode(!0),e.className="k-br",o.insertAfter(e,i)),n.setStartAfter(i),n.collapse(!0),o.scrollTo(i.nextSibling||i),c.selectRange(n)}});n(i,{ParagraphCommand:d,NewLineCommand:u}),h("insertLineBreak",new s({key:13,shift:!0,command:u})),h("insertParagraph",new s({key:13,command:d}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=t.ui.editor,r=o.Dom,s=o.RangeUtils,a=o.EditorUtils,l=o.Command,c=o.ToolTemplate,h=o.FormatTool,d=o.BlockFormatFinder,u=s.textNodes,f=o.EditorUtils.registerTool,p=d.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];d.fn.init.call(this,[{tags:t}])},isFormatted:function(e){var t,n,i=[];for(n=0;e.length>n;n++)t=this.findFormat(e[n]),t&&r.name(t)==this.tag&&i.push(t);if(1>i.length)return!1;if(i.length!=e.length)return!1;for(n=0;i.length>n&&i[n].parentNode==t.parentNode;n++)if(i[n]!=t)return!1;return!0},findSuitable:function(e){var t=this.findFormat(e[0]);return t&&r.name(t)==this.tag?t:null}}),g=n.extend({init:function(e,t){var n=this;n.finder=new p(e),n.tag=e,n.unwrapTag=t},isList:function(e){var t=r.name(e);return"ul"==t||"ol"==t||"dl"==t},wrap:function(e,t){var n,i,o=r.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(i=t[n],r.is(i,"li"))e.appendChild(i);else if(this.isList(i))for(;i.firstChild;)e.appendChild(i.firstChild);else if(r.is(i,"td")){for(;i.firstChild;)o.appendChild(i.firstChild);e.appendChild(o),i.appendChild(e),e=e.cloneNode(!1),o=o.cloneNode(!1)}else o.appendChild(i),r.isBlock(i)&&(e.appendChild(o),r.unwrap(i),o=o.cloneNode(!1));o.firstChild&&e.appendChild(o)},containsAny:function(e,t){for(var n=0;t.length>n;n++)if(r.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&r.isBlock(n))return!1;if(n=e.previousSibling,n&&r.isBlock(n))return!1}return this.containsAny(e,t)||r.isInline(e)||3==e.nodeType},_parentLists:function(t){var n=r.closestEditable(t);return e(t).parentsUntil(n,"ul,ol")},split:function(e){var t,n,i,o,a,l,c=u(e);if(c.length)for(t=r.parentOfType(c[0],["li"]),n=r.parentOfType(c[c.length-1],["li"]),e.setStartBefore(t),e.setEndAfter(n),o=0,a=c.length;a>o;o++)l=this.finder.findFormat(c[o]),l&&(i=this._parentLists(l),i.length?s.split(e,i.last()[0],!0):s.split(e,l,!0))},merge:function(e,t){for(var n,i=t.previousSibling;i&&("k-marker"==i.className||3==i.nodeType&&r.isWhitespace(i));)i=i.previousSibling;if(i&&r.name(i)==e){for(;t.firstChild;)i.appendChild(t.firstChild);r.remove(t),t=i}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&r.isWhitespace(n));)n=n.nextSibling;if(n&&r.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);r.remove(t)}},breakable:function(e){return e!=e.ownerDocument.body&&!/table|tbody|tr|td/.test(r.name(e))&&!e.attributes.contentEditable},applyOnSection:function(t,n){function i(){d.push(this)}var o,s,a,l,c=this.tag,h=r.closestSplittableParent(n),d=[],u=this.finder.findSuitable(n);for(u||(u=new p("ul"==c?"ol":"ul").findSuitable(n)),/table|tbody/.test(r.name(h))?o=e.map(n,function(e){return r.parentOfType(e,["td"])}):(o=r.significantChildNodes(h),e.grep(o,r.isBlock).length&&(o=e.grep(o,e.proxy(function(e){return this.containsAny(e,n)},this))),o.length||(o=n)),s=0;o.length>s;s++)a=o[s],l=(!u||!r.isAncestorOrSelf(u,a))&&this.suitable(a,n),l&&(u&&this.isList(a)?(e.each(a.childNodes,i),r.remove(a)):d.push(a));d.length==o.length&&this.breakable(h)&&(d=[h]),u||(u=r.create(h.ownerDocument,c),r.insertBefore(u,d[0])),this.wrap(u,d),r.is(u,c)||r.changeTag(u,c),this.merge(c,u)},apply:function(e){var t,n,i,o=0,s=[];do i=r.closestEditable(e[o],["td","body"]),t&&i==t?n.push(e[o]):(t&&s.push({section:t,nodes:n}),n=[e[o]],t=i),o++;while(e.length>o);for(s.push({section:t,nodes:n}),o=0;s.length>o;o++)this.applyOnSection(s[o].section,s[o].nodes)},unwrap:function(e){var t,n,i,o,s=e.ownerDocument.createDocumentFragment(),a=this.unwrapTag;for(n=e.firstChild;n;n=n.nextSibling){for(i=r.create(e.ownerDocument,a||"p");n.firstChild;)o=n.firstChild,r.isBlock(o)?(i.firstChild&&(s.appendChild(i),i=r.create(e.ownerDocument,a||"p")),s.appendChild(o)):i.appendChild(o);i.firstChild&&s.appendChild(i)}t=this._parentLists(e),t[0]?(r.insertAfter(s,t.last()[0]),t.last().remove()):r.insertAfter(s,e),r.remove(e)},remove:function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,i=u(e),o=e.commonAncestorContainer;i.length||(e.selectNodeContents(o),i=u(e),i.length||(t=o.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),i=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(i)?(n.split(e),n.remove(i)):n.apply(i)}}),m=l.extend({init:function(e){e.formatter=new g(e.tag),l.fn.init.call(this,e)}}),v=h.extend({init:function(e){this.options=e,h.fn.init.call(this,i(e,{finder:new p(e.tag)}))},command:function(e){return new m(i(e,{tag:this.options.tag}))}});i(o,{ListFormatFinder:p,ListFormatter:g,ListCommand:m,ListTool:v}),f("insertUnorderedList",new v({tag:"ul",template:new c({template:a.buttonTemplate,title:"Insert unordered list"})})),f("insertOrderedList",new v({tag:"ol",template:new c({template:a.buttonTemplate,title:"Insert ordered list"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=e.proxy,r=t.ui.editor,s=r.Dom,a=r.RangeUtils,l=r.EditorUtils,c=r.Command,h=r.Tool,d=r.ToolTemplate,u=r.InlineFormatter,f=r.InlineFormatFinder,p=a.textNodes,g=r.EditorUtils.registerTool,m=n.extend({findSuitable:function(e){return s.parentOfType(e,["a"])}}),v=n.extend({init:function(){this.finder=new m},apply:function(e,t){var n,i,o,r,l,c,h,d=p(e);if(t.innerHTML){for(i=a.documentFromRange(e),n=a.getMarkers(e),e.deleteContents(),r=s.create(i,"a",t),e.insertNode(r),l=r.parentNode,"a"==s.name(l)&&s.insertAfter(r,l),s.emptyNode(l)&&s.remove(l),c=r,h=0;n.length>h;h++)s.insertAfter(n[h],c),c=n[h];n.length&&(s.insertBefore(i.createTextNode("﻿"),n[1]),s.insertAfter(i.createTextNode("﻿"),n[1]),e.setStartBefore(n[0]),e.setEndAfter(n[n.length-1]))}else o=new u([{tags:["a"]}],t),o.finder=this.finder,o.apply(d)}}),_=c.extend({init:function(e){e.formatter={toggle:function(e){new u([{tags:["a"]}]).remove(p(e))}},this.options=e,c.fn.init.call(this,e)}}),y=c.extend({init:function(e){this.options=e,c.fn.init.call(this,e),this.formatter=new v,e.url?this.exec=function(){this.formatter.apply(e.range,{href:e.url,innerHTML:e.text||e.url,target:e.target})}:(this.attributes=null,this.async=!0)},_dialogTemplate:function(){return t.template("<div class=\"k-editor-dialog k-popup-edit-form k-edit-form-container\"><div class='k-edit-label'><label for='k-editor-link-url'>#: messages.linkWebAddress #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-url'></div><div class='k-edit-label k-editor-link-text-row'><label for='k-editor-link-text'>#: messages.linkText #</label></div><div class='k-edit-field k-editor-link-text-row'><input type='text' class='k-input k-textbox' id='k-editor-link-text'></div><div class='k-edit-label'><label for='k-editor-link-title'>#: messages.linkToolTip #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-title'></div><div class='k-edit-label'></div><div class='k-edit-field'><input type='checkbox' class='k-checkbox' id='k-editor-link-target'><label for='k-editor-link-target' class='k-checkbox-label'>#: messages.linkOpenInNewWindow #</label></div><div class='k-edit-buttons k-state-default'><button class=\"k-dialog-insert k-button k-primary\">#: messages.dialogInsert #</button><button class=\"k-dialog-close k-button\">#: messages.dialogCancel #</button></div></div>")({messages:this.editor.options.messages})},exec:function(){var t,n,i,r,a=(this.getRange().collapsed,this.editor.options.messages);this._initialText="",this._range=this.lockRange(!0),t=p(this._range),n=t.length?this.formatter.finder.findSuitable(t[0]):null,i=t.length&&"img"==s.name(t[0]),r=this.createDialog(this._dialogTemplate(),{title:a.createLink,close:o(this._close,this),visible:!1}),n&&(this._range.selectNodeContents(n),t=p(this._range)),this._initialText=this.linkText(t),r.find(".k-dialog-insert").click(o(this._apply,this)).end().find(".k-dialog-close").click(o(this._close,this)).end().find(".k-edit-field input").keydown(o(this._keydown,this)).end().find("#k-editor-link-url").val(this.linkUrl(n)).end().find("#k-editor-link-text").val(this._initialText).end().find("#k-editor-link-title").val(n?n.title:"").end().find("#k-editor-link-target").attr("checked",n?"_blank"==n.target:!1).end().find(".k-editor-link-text-row").toggle(!i),this._dialog=r.data("kendoWindow").center().open(),e("#k-editor-link-url",r).focus().select()},_keydown:function(e){var n=t.keys;e.keyCode==n.ENTER?this._apply(e):e.keyCode==n.ESC&&this._close(e)},_apply:function(t){var n,i,o,r=this._dialog.element,a=e("#k-editor-link-url",r).val(),l=e("#k-editor-link-text",r);a&&"http://"!=a&&(a.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(a)&&(a="mailto:"+a),this.attributes={href:a},n=e("#k-editor-link-title",r).val(),n&&(this.attributes.title=n),l.is(":visible")&&(i=l.val(),i||this._initialText?i&&i!==this._initialText&&(this.attributes.innerHTML=s.stripBom(i)):this.attributes.innerHTML=a),o=e("#k-editor-link-target",r).is(":checked"),this.attributes.target=o?"_blank":null,this.formatter.apply(this._range,this.attributes)),this._close(t),this.change&&this.change()},_close:function(e){e.preventDefault(),this._dialog.destroy(),s.windowFromDocument(a.documentFromRange(this._range)).focus(),this.releaseRange(this._range)},linkUrl:function(e){return e?e.getAttribute("href",2):"http://"},linkText:function(e){var t,n="";for(t=0;e.length>t;t++)n+=e[t].nodeValue;return s.stripBom(n||"")},redo:function(){var e=this.lockRange(!0);this.formatter.apply(e,this.attributes),this.releaseRange(e)}}),w=h.extend({init:function(t){this.options=t,this.finder=new f([{tags:["a"]}]),h.fn.init.call(this,e.extend(t,{command:_}))},initialize:function(e,t){h.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});i(t.ui.editor,{LinkFormatFinder:m,LinkFormatter:v,UnlinkCommand:_,LinkCommand:y,UnlinkTool:w}),g("createLink",new h({key:"K",ctrl:!0,command:y,template:new d({template:l.buttonTemplate,title:"Create Link"})})),g("unlink",new w({key:"K",ctrl:!0,shift:!0,template:new d({template:l.buttonTemplate,title:"Remove Link"})}))
  }(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.extend,o=n.ui.editor,r=o.EditorUtils,s=o.Dom,a=r.registerTool,l=o.ToolTemplate,c=o.RangeUtils,h=o.Command,d=o.LinkFormatter,u=c.textNodes,f=n.keys,p="#k-editor-file-url",g="#k-editor-file-title",m=h.extend({init:function(e){var t=this;h.fn.init.call(t,e),t.formatter=new d,t.async=!0,t.attributes={}},insertFile:function(e,t){var n=this.attributes,i=c.documentFromRange(t);if(n.href&&"http://"!=n.href){if(!e)return e=s.create(i,"a",{href:n.href}),e.innerHTML=n.innerHTML,t.deleteContents(),t.insertNode(e),e.nextSibling||s.insertAfter(i.createTextNode("﻿"),e),t.setStartAfter(e),t.setEndAfter(e),c.selectRange(t),!0;s.attr(e,n)}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-file-url">#: messages.fileWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-url"></div><div class=\'k-edit-label\'><label for="k-editor-file-title">#: messages.fileTitle #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-title"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #</button><button class="k-dialog-close k-button">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();this.formatter.apply(t,this.attributes),e.releaseRange(t)},exec:function(){function e(e){var t=a.element,n=t.find(p).val().replace(/ /g,"%20"),i=t.find(g).val();l.attributes={href:n,innerHTML:""!==i?i:n},m=l.insertFile(v,h),o(e),l.change&&l.change()}function o(e){e.preventDefault(),a.destroy(),s.windowFromDocument(c.documentFromRange(h)).focus(),m||l.releaseRange(h)}function r(t){t.keyCode==f.ENTER?e(t):t.keyCode==f.ESC&&o(t)}var a,l=this,h=l.lockRange(),d=u(h),m=!1,v=d.length?this.formatter.finder.findSuitable(d[0]):null,_=l.editor.options,y=_.messages,w=_.fileBrowser,b=!!(n.ui.FileBrowser&&w&&w.transport&&w.transport.read!==t),x={title:y.insertFile,visible:!1,resizable:b};x.close=o,b&&(x.width=750),a=this.createDialog(l._dialogTemplate(b),x).toggleClass("k-filebrowser-dialog",b).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(o).end().find(".k-edit-field input").keydown(r).end().find(p).val(v?v.getAttribute("href",2):"http://").end().find(g).val(v?v.title:"").end().data("kendoWindow"),b&&new n.ui.FileBrowser(a.element.find(".k-filebrowser"),i({},w,{change:function(){a.element.find(p).val(this.value())},apply:e})),a.center().open(),a.element.find(p).focus().select()}});n.ui.editor.FileCommand=m,a("insertFile",new o.Tool({command:m,template:new l({template:r.buttonTemplate,title:"Insert File"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.extend,o=n.ui.editor,r=o.EditorUtils,s=o.Dom,a=r.registerTool,l=o.ToolTemplate,c=o.RangeUtils,h=o.Command,d=n.keys,u="#k-editor-image-url",f="#k-editor-image-title",p="#k-editor-image-width",g="#k-editor-image-height",m=h.extend({init:function(e){var t=this;h.fn.init.call(t,e),t.async=!0,t.attributes={}},insertImage:function(e,t){var n,i=this.attributes,o=c.documentFromRange(t);if(i.src&&"http://"!=i.src){if(n=function(){setTimeout(function(){i.width||e.removeAttribute("width"),i.height||e.removeAttribute("height"),e.removeAttribute("complete")})},!e)return e=s.create(o,"img",i),e.onload=e.onerror=n,t.deleteContents(),t.insertNode(e),e.nextSibling||s.insertAfter(o.createTextNode("﻿"),e),n(),t.setStartAfter(e),t.setEndAfter(e),c.selectRange(t),!0;e.onload=e.onerror=n,s.attr(e,i),n()}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser k-imagebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-image-url">#: messages.imageWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-url"></div><div class=\'k-edit-label\'><label for="k-editor-image-title">#: messages.imageAltText #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-title"></div><div class=\'k-edit-label\'><label for="k-editor-image-width">#: messages.imageWidth #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-width"></div><div class=\'k-edit-label\'><label for="k-editor-image-height">#: messages.imageHeight #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-height"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #</button><button class="k-dialog-close k-button">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();e.insertImage(c.image(t),t)||e.releaseRange(t)},exec:function(){function e(e){var t=a.element,n=parseInt(t.find(p).val(),10),i=parseInt(t.find(g).val(),10);l.attributes={src:t.find(u).val().replace(/ /g,"%20"),alt:t.find(f).val()},l.attributes.width=null,l.attributes.height=null,!isNaN(n)&&n>0&&(l.attributes.width=n),!isNaN(i)&&i>0&&(l.attributes.height=i),m=l.insertImage(v,h),o(e),l.change&&l.change()}function o(e){e.preventDefault(),a.destroy(),s.windowFromDocument(c.documentFromRange(h)).focus(),m||l.releaseRange(h)}function r(t){t.keyCode==d.ENTER?e(t):t.keyCode==d.ESC&&o(t)}var a,l=this,h=l.lockRange(),m=!1,v=c.image(h),_=v&&v.getAttribute("width")||"",y=v&&v.getAttribute("height")||"",w=l.editor.options,b=w.messages,x=w.imageBrowser,k=!!(n.ui.ImageBrowser&&x&&x.transport&&x.transport.read!==t),C={title:b.insertImage,visible:!1,resizable:k};C.close=o,k&&(C.width=750),a=this.createDialog(l._dialogTemplate(k),C).toggleClass("k-filebrowser-dialog",k).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(o).end().find(".k-edit-field input").keydown(r).end().find(u).val(v?v.getAttribute("src",2):"http://").end().find(f).val(v?v.alt:"").end().find(p).val(_).end().find(g).val(y).end().data("kendoWindow"),k&&new n.ui.ImageBrowser(a.element.find(".k-imagebrowser"),i({},x,{change:function(){a.element.find(u).val(this.value())},apply:e})),a.center().open(),a.element.find(u).focus().select()}});n.ui.editor.ImageCommand=m,a("insertImage",new o.Tool({command:m,template:new l({template:r.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.DropDownList,o=n.ui.editor.Dom,r=i.extend({init:function(t,o){var r=this;i.fn.init.call(r,t,o),n.support.mobileOS.ios&&(this._initSelectOverlay(),this.bind("dataBound",e.proxy(this._initSelectOverlay,this))),r.text(r.options.title),r.bind("open",function(){if(r.options.autoSize){var e,t=r.list;t.css({whiteSpace:"nowrap",width:"auto"}),e=t.width(),e?e+=20:e=r._listWidth,t.css("width",e+n.support.scrollbar()),r._listWidth=e}})},options:{name:"SelectBox",index:-1},_initSelectOverlay:function(){var t,i,o,r,s=this,a=s.value(),l=this.dataSource.view(),c="",h=n.htmlEncode;for(i=0;l.length>i;i++)t=l[i],c+="<option value='"+h(t.value)+"'",t.value==a&&(c+=" selected"),c+=">"+h(t.text)+"</option>";o=e("<select class='k-select-overlay'>"+c+"</select>"),r=e(this.element).closest(".k-widget"),r.next(".k-select-overlay").remove(),o.insertAfter(r),o.on("change",function(){s.value(this.value),s.trigger("change")})},value:function(e){var n=this,o=i.fn.value.call(n,e);return e===t?o:(i.fn.value.call(n)||n.text(n.options.title),t)},decorate:function(t){var n,i,r,s,a=this,l=a.dataSource,c=l.data();for(t&&a.list.css("background-color",o.getEffectiveBackground(e(t))),n=0;c.length>n;n++)i=c[n].tag||"span",r=c[n].className,s=o.inlineStyle(t,i,{className:r}),s=s.replace(/"/g,"'"),c[n].style=s+";display:inline-block";l.trigger("change")}});n.ui.plugin(r),n.ui.editor.SelectBox=r}(window.kendo.jQuery),function(e,t){function n(n,i){var o="rtl"==e(n).css("direction"),r=o?"Right":"Left",s="td"!=a.name(n)?"margin"+r:"padding"+r;return i===t?n.style[s]||0:(i>0?n.style[s]=i+"px":(n.style[s]="",n.style.cssText||n.removeAttribute("style")),t)}var i=window.kendo,o=i.Class,r=e.extend,s=i.ui.editor,a=s.Dom,l=s.EditorUtils,c=l.registerTool,h=s.Command,d=s.Tool,u=s.ToolTemplate,f=s.RangeUtils,p=a.blockElements,g=s.BlockFormatFinder,m=s.BlockFormatter,v=o.extend({init:function(){this.finder=new g([{tags:a.blockElements}])},apply:function(t){var i,o,r,s,l,c,h,d,u,f,p=this.finder.findSuitable(t),g=[];if(p.length){for(i=0,o=p.length;o>i;i++)a.is(p[i],"li")?e(p[i]).index()?e.inArray(p[i].parentNode,g)<0&&g.push(p[i]):g.push(p[i].parentNode):g.push(p[i]);for(;g.length;)if(r=g.shift(),a.is(r,"li"))if(s=r.parentNode,l=e(r).prev("li"),c=l.find("ul,ol").last(),h=e(r).children("ul,ol")[0],h&&l[0])c[0]?(c.append(r),c.append(e(h).children()),a.remove(h)):(l.append(h),h.insertBefore(r,h.firstChild));else for(h=l.children("ul,ol")[0],h||(h=a.create(r.ownerDocument,a.name(s)),l.append(h));r&&r.parentNode==s;)h.appendChild(r),r=g.shift();else for(d=parseInt(n(r),10)+30,n(r,d),u=0;g.length>u;u++)e.contains(r,g[u])&&g.splice(u,1)}else f=new m([{tags:["p"]}],{style:{marginLeft:30}}),f.apply(t)},remove:function(t){var i,o,r,s,a,l,c,h,d=this.finder.findSuitable(t);for(o=0,r=d.length;r>o;o++){if(c=e(d[o]),c.is("li")){if(s=c.parent(),a=s.parent(),a.is("li,ul,ol")&&!n(s[0])){if(i&&e.contains(i,a[0]))continue;l=c.nextAll("li"),l.length&&e(s[0].cloneNode(!1)).appendTo(c).append(l),a.is("li")?c.insertAfter(a):c.appendTo(a),s.children("li").length||s.remove();continue}if(i==s[0])continue;i=s[0]}else i=d[o];h=parseInt(n(i),10)-30,n(i,h)}}}),_=h.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(f.nodes(e))}},h.fn.init.call(this,e)}}),y=h.extend({init:function(e){e.formatter={toggle:function(e){(new v).remove(f.nodes(e))}},h.fn.init.call(this,e)}}),w=d.extend({init:function(e){d.fn.init.call(this,e),this.finder=new g([{tags:p}])},initialize:function(e,t){d.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(i,o){var r,s,l,c,h=this.finder.findSuitable(o);for(l=0,c=h.length;c>l;l++)if(r=n(h[l]),r||(s=e(h[l]).parents("ul,ol").length,r=a.is(h[l],"li")&&(s>1||n(h[l].parentNode))||a.ofType(h[l],["ul","ol"])&&s>0),r)return i.removeClass("k-state-disabled"),t;i.addClass("k-state-disabled").removeClass("k-state-hover")}});r(s,{IndentFormatter:v,IndentCommand:_,OutdentCommand:y,OutdentTool:w}),c("indent",new d({command:_,template:new u({template:l.buttonTemplate,title:"Indent"})})),c("outdent",new w({command:y,template:new u({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.EditorUtils,r=i.Command,s=i.Tool,a=i.ToolTemplate,l=r.extend({init:function(e){var t=this;t.options=e,r.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function n(e){r.value(a.find(h).val()),i(e),o.change&&o.change(),r.trigger("change")}function i(e){e.preventDefault(),a.data("kendoWindow").destroy(),r.focus()}var o=this,r=o.editor,s=r.options.messages,a=e(t.template(l.template)(s)).appendTo(document.body),c=l.indent(r.value()),h=".k-editor-textarea";this.createDialog(a,{title:s.viewHtml,close:i,visible:!1}).find(h).val(c).end().find(".k-dialog-update").click(n).end().find(".k-dialog-close").click(i).end().data("kendoWindow").center().open(),a.find(h).focus()}});n(l,{template:"<div class='k-editor-dialog k-popup-edit-form k-edit-form-container k-viewhtml-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-edit-buttons k-state-default'><button class='k-dialog-update k-button k-primary'>#: dialogUpdate #</button><button class='k-dialog-close k-button'>#: dialogCancel #</button></div></div>",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}}),t.ui.editor.ViewHtmlCommand=l,i.EditorUtils.registerTool("viewHtml",new s({command:l,template:new a({template:o.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.ui.editor,i=n.Tool,o=n.ToolTemplate,r=n.DelayedExecutionTool,s=n.Command,a=n.Dom,l=n.EditorUtils,c=n.RangeUtils,h=l.registerTool,d=r.extend({init:function(e){var n=this;i.fn.init.call(n,t.deepExtend({},n.options,e)),n.type="kendoSelectBox",n.finder={getFormat:function(){return""}}},options:{items:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],width:110},toFormattingItem:function(e){var t,n=e.value;return n?e.tag||e.className?e:(t=n.indexOf("."),0===t?e.className=n.substring(1):-1==t?e.tag=n:(e.tag=n.substring(0,t),e.className=n.substring(t+1)),e):e},command:function(t){var i=t.value;return i=this.toFormattingItem(i),new n.FormatCommand({range:t.range,formatter:function(){var t,o=(i.tag||i.context||"span").split(","),r=[{tags:o,attr:{className:i.className||""}}];return t=e.inArray(o[0],a.inlineElements)>=0?new n.GreedyInlineFormatter(r):new n.GreedyBlockFormatter(r)}})},initialize:function(e,n){var o=n.editor,r=this.options,s=r.name,a=this;e.width(r.width),e.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:r.items||o.options[s],title:o.options.messages[s],autoSize:!0,change:function(){var e=this.dataItem();e&&i.exec(o,s,e.toJSON())},dataBound:function(){var e,t=this.dataSource.data();for(e=0;t.length>e;e++)t[e]=a.toFormattingItem(t[e])},highlightFirst:!1,template:t.template('<span unselectable="on" style="display:block;#=(data.style||"")#">#:data.text#</span>')}),e.addClass("k-decorated").closest(".k-widget").removeClass("k-"+s).find("*").addBack().attr("unselectable","on")},getFormattingValue:function(t,n){var i,o,r,s,a,l,c;for(i=0;t.length>i;i++)if(o=t[i],r=o.tag||o.context||"",s=o.className?"."+o.className:"",a=r+s,l=e(n[0]).closest(a)[0]){if(1==n.length)return o.value;for(c=1;n.length>c&&e(n[c]).closest(a)[0];c++)if(c==n.length-1)return o.value}return""},update:function(t,n){var i,o,s,l,c,h=e(t).data(this.type);if(h&&(i=h.dataSource,o=i.data(),c=a.commonAncestor.apply(null,n),c==a.closestEditable(c)||this._ancestor!=c)){for(this._ancestor=c,s=0;o.length>s;s++)l=o[s].context,o[s].visible=!l||!!e(c).closest(l).length;i.filter([{field:"visible",operator:"eq",value:!0}]),r.fn.update.call(this,t,n),h.value(this.getFormattingValue(i.view(),n)),h.wrapper.toggleClass("k-state-disabled",!i.view().length)}},destroy:function(){this._ancestor=null}}),u=s.extend({exec:function(){var t,i=new n.ListFormatter("ul"),o=this.lockRange(!0),r=this.options.remove||"strong,em,span,sup,sub,del,b,i,u,font".split(",");c.wrapSelectedElements(o),t=new n.RangeIterator(o),t.traverse(function s(t){var n,o,l,c;if(t&&!a.isMarker(t)){if(n=a.name(t),"ul"==n||"ol"==n)for(o=t.previousSibling,l=t.nextSibling,i.unwrap(t);o&&o!=l;o=o.nextSibling)s(o);else if("blockquote"==n)a.changeTag(t,"p");else if(1==t.nodeType&&!a.insignificant(t)){for(c=t.childNodes.length-1;c>=0;c--)s(t.childNodes[c]);t.removeAttribute("style"),t.removeAttribute("class")}e.inArray(n,r)>-1&&a.unwrap(t)}}),this.releaseRange(o)}});e.extend(n,{FormattingTool:d,CleanFormatCommand:u}),h("formatting",new d({template:new o({template:l.dropDownListTemplate,title:"Format"})})),h("cleanFormatting",new i({command:u,template:new o({template:l.buttonTemplate,title:"Clean formatting"})}))}(window.kendo.jQuery),function(e){var t,n=window.kendo,i=n.ui,o=i.editor,r=i.Widget,s=e.extend,a=e.proxy,l=n.keys,c=".kendoEditor",h=n.ui.editor.EditorUtils,d=n.ui.editor.ToolTemplate,u=n.ui.editor.Tool,f="overflowAnchor",p=".k-tool-group:visible a.k-tool:not(.k-state-disabled),.k-tool.k-overflow-anchor,.k-tool-group:visible .k-widget.k-colorpicker,.k-tool-group:visible .k-selectbox,.k-tool-group:visible .k-dropdown,.k-tool-group:visible .k-combobox .k-input",g=u.extend({initialize:function(t,n){t.attr({unselectable:"on"});var i=n.editor.toolbar;t.on("click",e.proxy(function(){this.overflowPopup.toggle()},i))},options:{name:f},command:e.noop,update:e.noop,destroy:e.noop});h.registerTool(f,new g({key:"",ctrl:!0,template:new d({template:h.overflowAnchorTemplate})})),t=r.extend({init:function(e,t){var i=this;t=s({},t,{name:"EditorToolbar"}),r.fn.init.call(i,e,t),t.popup&&i._initPopup(),t.resizable&&t.resizable.toolbar&&(i._resizeHandler=n.onResize(function(){i.resize()}),i.element.addClass("k-toolbar-resizable"))},events:["execute"],groups:{basic:["bold","italic","underline","strikethrough"],scripts:["subscript","superscript"],alignment:["justifyLeft","justifyCenter","justifyRight","justifyFull"],links:["insertImage","insertFile","createLink","unlink"],lists:["insertUnorderedList","insertOrderedList","indent","outdent"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"],advanced:["viewHtml","cleanFormatting","print","pdf"],fonts:["fontName","fontSize"],colors:["foreColor","backColor"]},overflowFlaseTools:["formatting","fontName","fontSize","foreColor","backColor","insertHtml"],_initPopup:function(){this.window=e(this.element).wrap("<div class='editorToolbarWindow k-header' />").parent().prepend("<button class='k-button k-button-bare k-editortoolbar-dragHandle'><span class='k-icon k-i-move' /></button>").kendoWindow({title:!1,resizable:!1,draggable:{dragHandle:".k-editortoolbar-dragHandle"},animation:{open:{effects:"fade:in"},close:{effects:"fade:out"}},minHeight:42,visible:!1,autoFocus:!1,actions:[],dragend:function(){this._moved=!0}}).on("mousedown",function(t){e(t.target).is(".k-icon")||t.preventDefault()}).data("kendoWindow")},_toggleOverflowStyles:function(e,t){e.find("li").toggleClass("k-item k-state-default",t).find(".k-tool:not(.k-state-disabled),.k-overflow-button").toggleClass("k-overflow-button k-button",t)},_initOverflowPopup:function(t){var n=this,i="<ul class='k-editor-overflow-popup k-overflow-container k-list-container'></ul>";n.overflowPopup=e(i).appendTo("body").kendoPopup({anchor:t,origin:"bottom right",position:"top right",copyAnchorStyles:!1,open:function(e){this.element.is(":empty")&&e.preventDefault(),n._toggleOverflowStyles(this.element,!0)},activate:a(n.focusOverflowPopup,n)}).data("kendoPopup")},items:function(){var e,t,n=this.options.resizable&&this.options.resizable.toolbar;return t=this.element.children().find("> *, select"),n&&(e=this.overflowPopup,t=t.add(e.element.children().find("> *"))),t},focused:function(){return this.element.find(".k-state-focused").length>0},toolById:function(e){var t,n=this.tools;for(t in n)if(t.toLowerCase()==e)return n[t]},toolGroupFor:function(t){var n,i=this.groups;if(this.isCustomTool(t))return"custom";for(n in i)if(e.inArray(t,i[n])>=0)return n},bindTo:function(t){var n=this,i=n.window;n._editor&&n._editor.unbind("select",a(n.resize,n)),n._editor=t,n.options.resizable&&n.options.resizable.toolbar&&t.options.tools.push(f),n.tools=n.expandTools(t.options.tools),n.render(),n.element.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),i=t.keyCode;i==l.RIGHT||i==l.LEFT?n.close():i==l.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),n._attachEvents(),n.items().each(function(){var i,o=n._toolName(this),r="more"!==o?n.tools[o]:n.tools.overflowAnchor,s=r&&r.options,a=t.options.messages,l=s&&s.tooltip||a[o],c=e(this);r&&r.initialize&&(("fontSize"==o||"fontName"==o)&&(i=a[o+"Inherit"],c.find("input").val(i).end().find("span.k-input").text(i).end()),r.initialize(c,{title:n._appendShortcutSequence(l,r),editor:n._editor}),c.closest(".k-widget",n.element).addClass("k-editor-widget"),c.closest(".k-colorpicker",n.element).next(".k-colorpicker").addClass("k-editor-widget"))}),t.bind("select",a(n.resize,n)),n.update(),i&&i.wrapper.css({top:"",left:"",width:""})},show:function(){var e,t,n,i=this,o=i.window,r=i.options.editor;o&&(e=o.wrapper,t=r.element,e.is(":visible")&&i.window.options.visible||(e[0].style.width||e.width(t.outerWidth()-parseInt(e.css("border-left-width"),10)-parseInt(e.css("border-right-width"),10)),o._moved||(n=t.offset(),e.css({top:Math.max(0,parseInt(n.top,10)-e.outerHeight()-parseInt(i.window.element.css("padding-bottom"),10)),left:Math.max(0,parseInt(n.left,10))})),o.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var e="tabIndex",t=this.element,n=this._editor.element.attr(e);t.attr(e,n||0).focus().find(p).first().focus(),n||0===n||t.removeAttr(e)},focusOverflowPopup:function(){var e="tabIndex",t=this.overflowPopup.element,n=this._editor.element.attr(e);t.closest(".k-animation-container").addClass("k-overflow-wrapper"),t.attr(e,n||0).focus().find(p).first().focus(),n||0===n||t.removeAttr(e)},_appendShortcutSequence:function(e,t){if(!t.key)return e;var n=e+" (";return t.ctrl&&(n+="Ctrl + "),t.shift&&(n+="Shift + "),t.alt&&(n+="Alt + "),n+=t.key+")"},_nativeTools:["insertLineBreak","insertParagraph","redo","undo"],tools:{},isCustomTool:function(e){return!(e in n.ui.Editor.defaultTools)},expandTools:function(t){var i,r,a,l,c=this._nativeTools,h=n.deepExtend({},n.ui.Editor.defaultTools),d={};for(r=0;t.length>r;r++)i=t[r],l=i.name,e.isPlainObject(i)?l&&h[l]?(d[l]=s({},h[l]),s(d[l].options,i)):(a=s({cssClass:"k-i-custom",type:"button",title:""},i),a.name||(a.name="custom"),a.cssClass="k-"+("custom"==a.name?"i-custom":a.name),a.template||"button"!=a.type||(a.template=o.EditorUtils.buttonTemplate,a.title=a.title||a.tooltip),d[l]={options:a}):h[i]&&(d[i]=h[i]);for(r=0;c.length>r;r++)d[c[r]]||(d[c[r]]=h[c[r]]);return d},render:function(){function t(t){var i;return t.getHtml?i=t.getHtml():(e.isFunction(t)||(t=n.template(t)),i=t(r)),e.trim(i)}function i(){u.children().length&&(x&&(u.data("position",b),b++),u.appendTo(_))}function o(t){t!==f?(u=e("<li class='k-tool-group' role='presentation' />"),u.data("overflow",-1===e.inArray(t,k)?!0:!1)):u=e("<li class='k-overflow-tools' />")}var r,s,l,c,h,d,u,p,g=this,m=g.tools,v=g._editor.element,_=g.element.empty(),y=g._editor.options.tools,w=n.support.browser,b=0,x=g.options.resizable&&g.options.resizable.toolbar,k=this.overflowFlaseTools;for(_.empty(),y.length&&(c=y[0].name||y[0]),o(c,k),p=0;y.length>p;p++)c=y[p].name||y[p],r=m[c]&&m[c].options,!r&&e.isPlainObject(c)&&(r=c),s=r&&r.template,"break"==c&&(i(),e("<li class='k-row-break' />").appendTo(g.element),o(c,k)),s&&(d=g.toolGroupFor(c),(h!=d||c==f)&&(i(),o(c,k),h=d),s=t(s),l=e(s).appendTo(u),"custom"==d&&(i(),o(c,k)),r.exec&&l.hasClass("k-tool")&&l.click(a(r.exec,v[0])));i(),e(g.element).children(":has(> .k-tool)").addClass("k-button-group"),g.options.popup&&w.msie&&9>w.version&&g.window.wrapper.find("*").attr("unselectable","on"),g.updateGroups(),x&&g._initOverflowPopup(g.element.find(".k-overflow-anchor")),g.angular("compile",function(){return{elements:g.element}})},updateGroups:function(){e(this.element).children().each(function(){e(this).children().filter(function(){return!e(this).hasClass("k-state-disabled")}).removeClass("k-group-end").first().addClass("k-group-start").end().last().addClass("k-group-end").end()})},decorateFrom:function(t){this.items().filter(".k-decorated").each(function(){var n=e(this).data("kendoSelectBox");n&&n.decorate(t)})},destroy:function(){r.fn.destroy.call(this);var e,t=this.tools;for(e in t)t[e].destroy&&t[e].destroy();this.window&&this.window.destroy(),this._resizeHandler&&n.unbindResize(this._resizeHandler),this.overflowPopup&&this.overflowPopup.destroy()},_attachEvents:function(){var t=this,n="[role=button].k-tool",i=n+":not(.k-state-disabled)",o=n+".k-state-disabled",r=t.overflowPopup?t.overflowPopup.element:e([]);t.element.add(r).off(c).on("mouseenter"+c,i,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+c,i,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+c,n,function(e){e.preventDefault()}).on("keydown"+c,p,function(n){function i(e,t,n){var i=t.find(p),o=i.index(s)+e;return n&&(o=Math.max(0,Math.min(i.length-1,o))),i[o]}var o,r,s=this,a=t.options.resizable&&t.options.resizable.toolbar,c=n.keyCode;c==l.RIGHT||c==l.LEFT?e(s).hasClass(".k-dropdown")||(o=i(c==l.RIGHT?1:-1,t.element,!0)):!a||c!=l.UP&&c!=l.DOWN?c==l.ESC?(t.overflowPopup.visible()&&t.overflowPopup.close(),o=t._editor):c!=l.TAB||n.ctrlKey||n.altKey||(r=a&&e(s.parentElement).hasClass("k-overflow-tool-group")?t.overflowPopup.element:t.element,n.shiftKey?o=i(-1,r):(o=i(1,r),o||(o=t._editor))):o=i(c==l.DOWN?1:-1,t.overflowPopup.element,!0),o&&(n.preventDefault(),o.focus())}).on("click"+c,i,function(n){var i=e(this);n.preventDefault(),n.stopPropagation(),i.removeClass("k-state-hover"),i.is("[data-popup]")||t._editor.exec(t._toolName(this))}).on("click"+c,o,function(e){e.preventDefault()})},_toolName:function(t){var n,i;if(t)return n=t.className,/k-tool\b/i.test(n)&&(n=t.firstChild.className),i=e.grep(n.split(" "),function(e){return!/^k-(widget|tool|tool-icon|icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)}),i[0]?i[0].substring(i[0].lastIndexOf("-")+1):"custom"},refreshTools:function(){var t=this,i=t._editor,o=i.getRange(),r=n.ui.editor.RangeUtils.textNodes(o);r.length||(r=[o.startContainer]),t.items().each(function(){var n=t.tools[t._toolName(this)];n&&n.update&&n.update(e(this),r)}),this.update()},update:function(){this.updateGroups()},_resize:function(e){var t=e.width,n=this.options.resizable&&this.options.resizable.toolbar,i=this.overflowPopup;this.refreshTools(),n&&(i.visible()&&i.close(!0),this._refreshWidths(),this._shrink(t),this._stretch(t),this._toggleOverflowStyles(this.element,!1),this._toggleOverflowStyles(this.overflowPopup.element,!0),this.element.children("li.k-overflow-tools").css("visibility",i.element.is(":empty")?"hidden":"visible"))},_refreshWidths:function(){this.element.children("li").each(function(t,n){var i=e(n);i.data("outerWidth",i.outerWidth(!0))})},_shrink:function(e){var t,n,i;if(e<this._groupsWidth())for(n=this._visibleGroups().filter(":not(.k-overflow-tools)"),i=n.length-1;i>=0&&(t=n.eq(i),!(e>this._groupsWidth()));i--)this._hideGroup(t)},_stretch:function(e){var t,n,i;if(e>this._groupsWidth())for(n=this._hiddenGroups(),i=0;n.length>i&&(t=n.eq(i),!(e<this._groupsWidth())&&this._showGroup(t,e));i++);},_hiddenGroups:function(){var t=this.overflowPopup,n=this.element.children("li.k-tool-group").filter(":hidden");return n=n.add(t.element.children("li")),n.sort(function(t,n){return e(t).data("position")>e(n).data("position")?1:-1}),n},_visibleGroups:function(){return this.element.children("li.k-tool-group, li.k-overflow-tools").filter(":visible")},_groupsWidth:function(){var t=0;return this._visibleGroups().each(function(){t+=e(this).data("outerWidth")}),Math.ceil(t)},_hideGroup:function(e){if(e.data("overflow")){var t=this.overflowPopup;e.detach().prependTo(t.element).addClass("k-overflow-tool-group")}else e.hide()},_showGroup:function(t,n){var i,o;return t.length&&n>this._groupsWidth()+t.data("outerWidth")?(t.hasClass("k-overflow-tool-group")?(i=t.data("position"),0===i?t.detach().prependTo(this.element):(o=this.element.children().filter(function(t,n){return e(n).data("position")===i-1}),t.detach().insertAfter(o)),t.removeClass("k-overflow-tool-group")):t.show(),!0):!1}}),e.extend(o,{Toolbar:t})}(window.jQuery),function(e){var t=window.kendo,n=e.extend,i=e.proxy,o=t.ui.editor,r=o.Dom,s=o.EditorUtils,a=o.RangeUtils,l=o.Command,c=".kendoEditor",h="k-state-active",d="k-state-selected",u=o.Tool,f=o.ToolTemplate,p=o.InsertHtmlCommand,g=o.BlockFormatFinder,m=o.EditorUtils.registerTool,v="<td>"+o.emptyElementContent+"</td>",_=new g([{tags:["table"]}]),y=p.extend({_tableHtml:function(e,t){return e=e||1,t=t||1,"<table class='k-table' data-last>"+Array(e+1).join("<tr>"+Array(t+1).join(v)+"</tr>")+"</table>"},postProcess:function(t,n){var i=e("table[data-last]",t.document).removeAttr("data-last");n.setStart(i.find("td")[0],0),n.collapse(!0),t.selectRange(n)},exec:function(){var e=this.options;e.html=this._tableHtml(e.rows,e.columns),e.postProcess=this.postProcess,p.fn.exec.call(this)}}),w=u.extend({initialize:function(t,n){u.fn.initialize.call(this,t,n);var o=e(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:i(this._open,this),activate:i(this._activate,this),close:i(this._close,this)}).data("kendoPopup");t.click(i(this._toggle,this)).keydown(i(this._keydown,this)),this._editor=n.editor,this._popup=o},popup:function(){return this._popup},_activate:e.noop,_open:function(){this._popup.options.anchor.addClass(h)},_close:function(){this._popup.options.anchor.removeClass(h)},_keydown:function(e){var n=t.keys,i=e.keyCode;i==n.DOWN&&e.altKey?this._popup.open():i==n.ESC&&this._popup.close()},_toggle:function(t){var n=e(t.target).closest(".k-tool");n.hasClass("k-state-disabled")||this.popup().toggle()},update:function(e){var t=this.popup();t.wrapper&&"block"==t.wrapper.css("display")&&t.close(),e.removeClass("k-state-hover")},destroy:function(){this._popup.destroy()}}),b=w.extend({init:function(t){this.cols=8,this.rows=6,w.fn.init.call(this,e.extend(t,{command:y,popupTemplate:"<div class='k-ct-popup'>"+Array(this.cols*this.rows+1).join("<span class='k-ct-cell k-state-disabled' />")+"<div class='k-status'></div></div>"}))},_activate:function(){function n(t){var n=e(window);return{row:Math.floor((t.clientY+n.scrollTop()-d.top)/o)+1,col:Math.floor((t.clientX+n.scrollLeft()-d.left)/i)+1}}var i,o,r=this,s=r._popup.element,a=s.find(".k-ct-cell"),l=a.eq(0),h=a.eq(a.length-1),d=t.getOffset(l),u=t.getOffset(h),f=r.cols,p=r.rows;s.find("*").addBack().attr("unselectable","on"),u.left+=h[0].offsetWidth,u.top+=h[0].offsetHeight,i=(u.left-d.left)/f,o=(u.top-d.top)/p,s.on("mousemove"+c,function(e){r._setTableSize(n(e))}).on("mouseleave"+c,function(){r._setTableSize()}).on("mouseup"+c,function(e){r._exec(n(e))})},_valid:function(e){return e&&e.row>0&&e.col>0&&this.rows>=e.row&&this.cols>=e.col},_exec:function(e){this._valid(e)&&(this._editor.exec("createTable",{rows:e.row,columns:e.col}),this._popup.close())},_setTableSize:function(n){var i=this._popup.element,o=i.find(".k-status"),r=i.find(".k-ct-cell"),s=this.cols,a=this._editor.options.messages;this._valid(n)?(o.text(t.format(a.createTableHint,n.row,n.col)),r.each(function(t){e(this).toggleClass(d,n.col>t%s&&n.row>t/s)})):(o.text(a.dialogCancel),r.removeClass(d))},_keydown:function(e){var n,i,o,r,s,a,l,c;w.fn._keydown.call(this,e),this._popup.visible()&&(n=t.keys,i=e.keyCode,o=this._popup.element.find(".k-ct-cell"),r=Math.max(o.filter(".k-state-selected").last().index(),0),s=Math.floor(r/this.cols),a=r%this.cols,l=!1,i!=n.DOWN||e.altKey?i==n.UP?(l=!0,s--):i==n.RIGHT?(l=!0,a++):i==n.LEFT&&(l=!0,a--):(l=!0,s++),c={row:Math.max(1,Math.min(this.rows,s+1)),col:Math.max(1,Math.min(this.cols,a+1))},i==n.ENTER?this._exec(c):this._setTableSize(c),l&&(e.preventDefault(),e.stopImmediatePropagation()))},_open:function(){var e=this._editor.options.messages;w.fn._open.call(this),this.popup().element.find(".k-status").text(e.dialogCancel).end().find(".k-ct-cell").removeClass(d)},_close:function(){w.fn._close.call(this),this.popup().element.off(c)},update:function(e,t){var n;w.fn.update.call(this,e),n=_.isFormatted(t),e.toggleClass("k-state-disabled",n)}}),x=l.extend({exec:function(){for(var e,t,n,i,s=this.lockRange(!0),a=s.endContainer;"td"!=r.name(a);)a=a.parentNode;for(t=a.parentNode,e=t.children.length,n=t.cloneNode(!0),i=0;t.cells.length>i;i++)n.cells[i].innerHTML=o.emptyElementContent;"before"==this.options.position?r.insertBefore(n,t):r.insertAfter(n,t),this.releaseRange(s)}}),k=l.extend({exec:function(){var e,t,n,i,s=this.lockRange(!0),a=r.closest(s.endContainer,"td"),l=r.closest(a,"table"),c=l.rows,h=this.options.position;
  for(e=r.findNodeIndex(a,!0),t=0;c.length>t;t++)n=c[t].cells[e],i=n.cloneNode(),i.innerHTML=o.emptyElementContent,"before"==h?r.insertBefore(i,n):r.insertAfter(i,n);this.releaseRange(s)}}),C=l.extend({exec:function(){var t,n,i,o=this.lockRange(),s=a.mapAll(o,function(t){return e(t).closest("tr")[0]}),l=r.closest(s[0],"table");if(s.length>=l.rows.length)t=r.next(l),(!t||r.insignificant(t))&&(t=r.prev(l)),r.remove(l);else for(n=0;s.length>n;n++)i=s[n],r.removeTextSiblings(i),t=r.next(i)||r.prev(i),t=t.cells[0],r.remove(i);t&&(o.setStart(t,0),o.collapse(!0),this.editor.selectRange(o))}}),S=l.extend({exec:function(){var e,t,n=this.lockRange(),i=r.closest(n.endContainer,"td"),o=r.closest(i,"table"),s=o.rows,a=r.findNodeIndex(i,!0),l=s[0].cells.length;if(1==l)e=r.next(o),(!e||r.insignificant(e))&&(e=r.prev(o)),r.remove(o);else for(r.removeTextSiblings(i),e=r.next(i)||r.prev(i),t=0;s.length>t;t++)r.remove(s[t].cells[a]);e&&(n.setStart(e,0),n.collapse(!0),this.editor.selectRange(n))}}),T=u.extend({command:function(e){return e=n(e,this.options),"delete"==e.action?"row"==e.type?new C(e):new S(e):"row"==e.type?new x(e):new k(e)},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){var n=!_.isFormatted(t);e.toggleClass("k-state-disabled",n)}});n(t.ui.editor,{PopupTool:w,TableCommand:y,InsertTableTool:b,TableModificationTool:T,InsertRowCommand:x,InsertColumnCommand:k,DeleteRowCommand:C,DeleteColumnCommand:S}),m("createTable",new b({template:new f({template:s.buttonTemplate,popup:!0,title:"Create table"})})),m("addColumnLeft",new T({type:"column",position:"before",template:new f({template:s.buttonTemplate,title:"Add column on the left"})})),m("addColumnRight",new T({type:"column",template:new f({template:s.buttonTemplate,title:"Add column on the right"})})),m("addRowAbove",new T({type:"row",position:"before",template:new f({template:s.buttonTemplate,title:"Add row above"})})),m("addRowBelow",new T({type:"row",template:new f({template:s.buttonTemplate,title:"Add row below"})})),m("deleteRow",new T({type:"row",action:"delete",template:new f({template:s.buttonTemplate,title:"Delete row"})})),m("deleteColumn",new T({type:"column",action:"delete",template:new f({template:s.buttonTemplate,title:"Delete column"})}))}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});