',m+=p._createButton({name:"update",text:l,attr:u})+p._createButton({name:"canceledit",text:d,attr:u}),m+="
",f=p._editContainer=e(m).appendTo(p.wrapper).eq(0).kendoWindow(be({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(i){if(i.userTriggered){if(i.sender.element.focus(),p.trigger("cancel",{container:f,model:n}))return i.preventDefault(),t;var r=p.items().index(e(p.current()).parent());p.cancelRow(),p.options.navigatable&&(p._setCurrent(p.items().eq(r).children().filter(He).first()),oe(p.table,!0))}}},k))),p.editable=p._editContainer.kendoEditable({fields:g,model:n,clearContainer:!1,target:p}).data("kendoEditable"),p._isMobile&&f.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),p._openPopUpEditor(),p.trigger(Le,{container:f,model:n})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,n){var i,r,o,a=this,s=[];a.lockedContent&&(t=t.add(a._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(r=e(this),i=L(a.columns)[a.cellIndex(r)],i.command||!i.field||n.editable&&!n.editable(i.field)){if(i.command&&(o=re(i.command,"edit"))){r.empty();var t,l,d;_e(o)&&(o.text&&_e(o.text)&&(t=o.text.update,l=o.text.cancel),o.attr&&(d=o.attr)),e(a._createButton({name:"update",text:t,attr:d})+a._createButton({name:"canceledit",text:l,attr:d})).appendTo(r)}}else s.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),r.attr(ue.attr("container-for"),i.field),r.empty()}),a._editContainer=t,a.editable=new ue.ui.Editable(t.addClass("k-grid-edit-row"),{target:a,fields:s,model:n,clearContainer:!1}),t.length>1&&(ie(t[0],t[1]),a._applyLockedContainersWidth()),a.trigger(Le,{container:t,model:n})},cancelRow:function(e){var t,n=this,i=n._editContainer;if(i){if(t=n._modelForContainer(i),e&&n.trigger("cancel",{container:i,model:t}))return;n._destroyEditable(),n.dataSource.cancelChanges(t),n._displayRow("popup"!==n._editMode()?i:n.tbody.find("["+ue.attr("uid")+"="+t.uid+"]"))}},saveRow:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t),i=e.editable;t&&i&&i.end()&&!e.trigger(Be,{container:t,model:n})&&e.dataSource.sync()},_displayRow:function(t){var n,i,r,o,a,s=this,l=s._modelForContainer(t),d=t.hasClass("k-state-selected"),c=t.hasClass("k-alt");l&&(s.lockedContent&&(n=e((c?s.lockedAltRowTemplate:s.lockedRowTemplate)(l)),s._relatedRow(t.last()).replaceWith(n)),s.angular("cleanup",function(){return{elements:t.get()}}),i=e((c?s.altRowTemplate:s.rowTemplate)(l)),t.replaceWith(i),o=i,a=[{dataItem:l}],n&&n.length&&(o=i.add(n),a.push({dataItem:l})),s.angular("compile",function(){return{elements:o.get(),data:a}}),d&&s.options.selectable&&s.select(i.add(n)),n&&ie(i[0],n[0]),r=i.next(),r.hasClass("k-detail-row")&&r.is(":visible")&&i.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,n){var i,r,o,a=this;return a._isMobile?(i=ue.template('").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar"),t.progress(function(e){n.value(e.progress)}).always(function(){ue.destroy(i),i.remove()})}),he.plugin(Tt),he.plugin(Ct)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.listview.min",["kendo.data.min","kendo.editable.min","kendo.selectable.min"],e)}(function(){return function(e,t){var n=window.kendo,i="change",r="cancel",o="dataBound",a="dataBinding",s=n.ui.Widget,l=n.keys,d=">*:not(.k-loading-mask)",c="progress",u="error",h="k-state-focused",f="k-state-selected",p="k-edit-item",m="edit",g="remove",v="save",_="click",b=".kendoListView",k=e.proxy,w=n._activeElement,y=n.ui.progress,x=n.data.DataSource,C=n.ui.DataBoundWidget.extend({init:function(t,i){var r=this;i=e.isArray(i)?{dataSource:i}:i,s.fn.init.call(r,t,i),i=r.options,r.wrapper=t=r.element,t[0].id&&(r._itemId=t[0].id+"_lv_active"),r._element(),r._dataSource(),r._templates(),r._navigatable(),r._selectable(),r._pageable(),r._crudHandlers(),r.options.autoBind&&r.dataSource.fetch(),n.notify(r)},events:[i,r,a,o,m,g,v],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},setOptions:function(e){s.fn.setOptions.call(this,e),this._templates(),this.selectable&&(this.selectable.destroy(),this.selectable=null),this._selectable()},_templates:function(){var e=this.options;this.template=n.template(e.template||""),this.altTemplate=n.template(e.altTemplate||e.template),this.editTemplate=n.template(e.editTemplate||"")},_item:function(e){return this.element.children()[e]()},items:function(){return this.element.children()},dataItem:function(t){var i=n.attr("uid"),r=e(t).closest("["+i+"]").attr(i);return this.dataSource.getByUid(r)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},_unbindDataSource:function(){var e=this;e.dataSource.unbind(i,e._refreshHandler).unbind(c,e._progressHandler).unbind(u,e._errorHandler)},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=k(e.refresh,e),e._progressHandler=k(e._progress,e),e._errorHandler=k(e._error,e)),e.dataSource=x.create(e.options.dataSource).bind(i,e._refreshHandler).bind(c,e._progressHandler).bind(u,e._errorHandler)},_progress:function(){y(this.element,!0)},_error:function(){y(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview").attr("role","listbox")},refresh:function(e){var i,r,s,l,d,c=this,u=c.dataSource.view(),h="",f=c.template,p=c.altTemplate,m=w();if(e=e||{},"itemchange"===e.action)return c._hasBindingTarget()||c.editable||(i=e.items[0],s=c.items().filter("["+n.attr("uid")+"="+i.uid+"]"),s.length>0&&(l=s.index(),c.angular("cleanup",function(){return{elements:[s]}}),s.replaceWith(f(i)),s=c.items().eq(l),s.attr(n.attr("uid"),i.uid),c.angular("compile",function(){return{elements:[s],data:[{dataItem:i}]}}),c.trigger("itemChange",{item:s,data:i}))),t;if(!c.trigger(a,{action:e.action||"rebind",items:e.items,index:e.index})){for(c._angularItems("cleanup"),c._destroyEditable(),l=0,d=u.length;d>l;l++)h+=l%2?p(u[l]):f(u[l]);for(c.element.html(h),r=c.items(),l=0,d=u.length;d>l;l++)r.eq(l).attr(n.attr("uid"),u[l].uid).attr("role","option").attr("aria-selected","false");c.element[0]===m&&c.options.navigatable&&c.current(r.eq(0)),c._angularItems("compile"),c.trigger(o)}},_pageable:function(){var t,i,r=this,o=r.options.pageable;e.isPlainObject(o)&&(i=o.pagerId,t=e.extend({},o,{dataSource:r.dataSource,pagerId:null}),r.pager=new n.ui.Pager(e("#"+i),t))},_selectable:function(){var e,r,o=this,a=o.options.selectable,s=o.options.navigatable;a&&(e=n.ui.Selectable.parseOptions(a).multiple,o.selectable=new n.ui.Selectable(o.element,{aria:!0,multiple:e,filter:d,change:function(){o.trigger(i)}}),s&&o.element.on("keydown"+b,function(n){if(n.keyCode===l.SPACEBAR){if(r=o.current(),n.target==n.currentTarget&&n.preventDefault(),e)if(n.ctrlKey){if(r&&r.hasClass(f))return r.removeClass(f),t}else o.selectable.clear();else o.selectable.clear();o.selectable.value(r)}}))},current:function(e){var n=this,i=n.element,r=n._current,o=n._itemId;return e===t?r:(r&&r[0]&&(r[0].id===o&&r.removeAttr("id"),r.removeClass(h),i.removeAttr("aria-activedescendant")),e&&e[0]&&(o=e[0].id||o,n._scrollTo(e[0]),i.attr("aria-activedescendant",o),e.addClass(h).attr("id",o)),n._current=e,t)},_scrollTo:function(t){var n,i,r=this,o=!1,a="scroll";"auto"==r.wrapper.css("overflow")||r.wrapper.css("overflow")==a?n=r.wrapper[0]:(n=window,o=!0),i=function(i,r){var s=o?e(t).offset()[i.toLowerCase()]:t["offset"+i],l=t["client"+r],d=e(n)[a+i](),c=e(n)[r.toLowerCase()]();s+l>d+c?e(n)[a+i](s+l-c):d>s&&e(n)[a+i](s)},i("Top","Height"),i("Left","Width")},_navigatable:function(){var t=this,i=t.options.navigatable,r=t.element,o=function(n){t.current(e(n.currentTarget)),e(n.target).is(":button,a,:input,a>.k-icon,textarea")||r.focus()};i&&(t._tabindex(),r.on("focus"+b,function(){var e=t._current;e&&e.is(":visible")||(e=t._item("first")),t.current(e)}).on("focusout"+b,function(){t._current&&t._current.removeClass(h)}).on("keydown"+b,function(i){var o,a,s=i.keyCode,d=t.current(),c=e(i.target),u=!c.is(":button,textarea,a,a>.t-icon,input"),h=c.is(":text,:password"),f=n.preventDefault,m=r.find("."+p),g=w();if(!(!u&&!h&&l.ESC!=s||h&&l.ESC!=s&&l.ENTER!=s))if(l.UP===s||l.LEFT===s)d&&(d=d.prev()),t.current(d&&d[0]?d:t._item("last")),f(i);else if(l.DOWN===s||l.RIGHT===s)d&&(d=d.next()),t.current(d&&d[0]?d:t._item("first")),f(i);else if(l.PAGEUP===s)t.current(null),t.dataSource.page(t.dataSource.page()-1),f(i);else if(l.PAGEDOWN===s)t.current(null),t.dataSource.page(t.dataSource.page()+1),f(i);else if(l.HOME===s)t.current(t._item("first")),f(i);else if(l.END===s)t.current(t._item("last")),f(i);else if(l.ENTER===s)0!==m.length&&(u||h)?(o=t.items().index(m),g&&g.blur(),t.save(),a=function(){t.element.trigger("focus"),t.current(t.items().eq(o))},t.one("dataBound",a)):""!==t.options.editTemplate&&t.edit(d);else if(l.ESC===s){if(m=r.find("."+p),0===m.length)return;o=t.items().index(m),t.cancel(),t.element.trigger("focus"),t.current(t.items().eq(o))}}),r.on("mousedown"+b+" touchstart"+b,d,k(o,t)))},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(i)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),r.value(n),t):r.value()},_destroyEditable:function(){var e=this;e.editable&&(e.editable.destroy(),delete e.editable)},_modelFromElement:function(e){var t=e.attr(n.attr("uid"));return this.dataSource.getByUid(t)},_closeEditable:function(){var e,t,i,r=this,o=r.editable,a=r.template;return o&&(o.element.index()%2&&(a=r.altTemplate),r.angular("cleanup",function(){return{elements:[o.element]}}),e=r._modelFromElement(o.element),r._destroyEditable(),i=o.element.index(),o.element.replaceWith(a(e)),t=r.items().eq(i),t.attr(n.attr("uid"),e.uid),r._hasBindingTarget()&&n.bind(t,e),r.angular("compile",function(){return{elements:[t],data:[{dataItem:e}]}})),!0},edit:function(e){var t,i,r=this,o=r._modelFromElement(e),a=o.uid;r.cancel(),e=r.items().filter("["+n.attr("uid")+"="+a+"]"),i=e.index(),e.replaceWith(r.editTemplate(o)),t=r.items().eq(i).addClass(p).attr(n.attr("uid"),o.uid),r.editable=t.kendoEditable({model:o,clearContainer:!1,errorTemplate:!1,target:r}).data("kendoEditable"),r.trigger(m,{model:o,item:t})},save:function(){var e,t,n=this,i=n.editable;i&&(t=i.element,e=n._modelFromElement(t),i.end()&&!n.trigger(v,{model:e,item:t})&&(n._closeEditable(),n.dataSource.sync()))},remove:function(e){var t=this,n=t.dataSource,i=t._modelFromElement(e);t.editable&&(n.cancelChanges(t._modelFromElement(t.editable.element)),t._closeEditable()),t.trigger(g,{model:i,item:e})||(e.hide(),n.remove(i),n.sync())},add:function(){var e,t=this,n=t.dataSource,i=n.indexOf((n.view()||[])[0]);0>i&&(i=0),t.cancel(),e=n.insert(i,{}),t.edit(t.element.find("[data-uid='"+e.uid+"']"))},cancel:function(){var e,t,n=this,i=n.dataSource;n.editable&&(e=n.editable.element,t=n._modelFromElement(e),n.trigger(r,{model:t,container:e})||(i.cancelChanges(t),n._closeEditable()))},_crudHandlers:function(){var t=this,i=_+b;t.element.on(i,".k-edit-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.edit(r),i.preventDefault()}),t.element.on(i,".k-delete-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.remove(r),i.preventDefault()}),t.element.on(i,".k-update-button",function(e){t.save(),e.preventDefault()}),t.element.on(i,".k-cancel-button",function(e){t.cancel(),e.preventDefault()})},destroy:function(){var e=this;s.fn.destroy.call(e),e._unbindDataSource(),e._destroyEditable(),e.element.off(b),e.pager&&e.pager.destroy(),n.destroy(e.element)}});n.ui.plugin(C)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.upload.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(t){return e.map(i(t),function(e){return e.name}).join(", ")}function i(e){var t=e[0];return t.files?r(t.files):[{name:s(t.value),extension:a(t.value),size:null}]}function r(t){return e.map(t,function(e){return o(e)})}function o(e){var t=e.name||e.fileName;return{name:b.htmlEncode(t),extension:a(t),size:e.size||e.fileSize,rawFile:e}}function a(e){var t=e.match(x);return t?t[0]:""}function s(e){var t=e.lastIndexOf("\\");return-1!=t?e.substr(t+1):e}function l(t,n){var i=b.guid();return e.map(t,function(e){return e.uid=n?b.guid():i,e})}function d(t){return!t.multiple&&e(".k-file",t.wrapper).length>1}function c(n,i,r){var o,a;return i._supportsRemove()?(o=n.data("fileNames"),a=e.map(o,function(e){return e.name}),i._submitRemove(a,r,function(e,t,r){i._removeFileEntry(n),i.trigger(D,{operation:"remove",files:o,response:e,XMLHttpRequest:r})},function(e){d(i)&&i._removeFileEntry(n),i.trigger(F,{operation:"remove",files:o,XMLHttpRequest:e}),y("Server response: "+e.responseText)}),t):(d(i)&&i._removeFileEntry(n),t)}function u(t,n,i){var r=!1,o="";try{o=e.parseJSON(h(t)),r=!0}catch(a){i()}r&&n(o)}function h(e){return(t===e||""===e)&&(e="{}"),e}function f(e){e.stopPropagation(),e.preventDefault()}function p(e,t,n,i){var r,o;e.on("dragenter"+t,function(){n(),o=new Date,r||(r=setInterval(function(){var e=new Date-o;e>100&&(i(),clearInterval(r),r=null)},100))}).on("dragover"+t,function(){o=new Date})}function m(e){return e.is(".k-file-progress, .k-file-success, .k-file-error")}function g(t){return e(t.target).closest(".k-file")}var v,_,b=window.kendo,k=b.ui.Widget,w=b.antiForgeryTokens,y=b.logToConsole,x=/\.([^\.]+)$/,C=".kendoUpload",S="select",T="upload",D="success",F="error",E="complete",R="cancel",A="progress",I="remove",M=k.extend({init:function(t,n){var i,r,o,a=this;k.fn.init.call(a,t,n),a.name=t.name,a.multiple=a.options.multiple,a.localization=a.options.localization,i=a.element,a.wrapper=i.closest(".k-upload"),0===a.wrapper.length&&(a.wrapper=a._wrapInput(i)),a._activeInput(i),a.toggle(a.options.enabled),r=a._ns=C+"-"+b.guid(),i.closest("form").on("submit"+r,e.proxy(a._onParentFormSubmit,a)).on("reset"+r,e.proxy(a._onParentFormReset,a)),a.options.async.saveUrl?(a._module=a._supportsFormData()?new _(a):new v(a),a._async=!0,o=a.options.files,o.length>0&&a._renderInitialFiles(o)):a._module=new H(a),a._supportsDrop()&&a._setupDropZone(),a.wrapper.on("click",".k-upload-action",e.proxy(a._onFileAction,a)).on("click",".k-upload-selected",e.proxy(a._onUploadSelected,a)),a.element.val()&&a._onInputChange({target:a.element})},events:[S,T,D,F,E,R,A,I],options:{name:"Upload",enabled:!0,multiple:!0,showFileList:!0,template:"",files:[],async:{removeVerb:"POST",autoUpload:!0,withCredentials:!0},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",uploadSelectedFiles:"Upload files",dropFilesHere:"drop files here to upload",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusUploaded:"Done"}},setOptions:function(e){var t=this,n=t.element;k.fn.setOptions.call(t,e),t.multiple=t.options.multiple,n.attr("multiple",t._supportsMultiple()?t.multiple:!1),t.toggle(t.options.enabled)},enable:function(e){e=t===e?!0:e,this.toggle(e)},disable:function(){this.toggle(!1)},toggle:function(e){e=t===e?e:!e,this.wrapper.toggleClass("k-state-disabled",e),this.element.prop("disabled",e)},destroy:function(){var t=this;e(document).add(e(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns),e(t.element).off(C),k.fn.destroy.call(t)},_addInput:function(t){if(t[0].nodeType){var n=this,i=t.clone().val("");i.insertAfter(n.element).data("kendoUpload",n),e(n.element).hide().attr("tabindex","-1").removeAttr("id").off(C),n._activeInput(i),n.element.focus()}},_activeInput:function(t){var n=this,i=n.wrapper;n.element=t,t.attr("multiple",n._supportsMultiple()?n.multiple:!1).attr("autocomplete","off").on("click"+C,function(e){i.hasClass("k-state-disabled")&&e.preventDefault()}).on("focus"+C,function(){e(this).parent().addClass("k-state-focused")}).on("blur"+C,function(){e(this).parent().removeClass("k-state-focused")}).on("change"+C,e.proxy(n._onInputChange,n)).on("keydown"+C,e.proxy(n._onInputKeyDown,n))},_onInputKeyDown:function(e){var t=this,n=t.wrapper.find(".k-upload-action:first");e.keyCode===b.keys.TAB&&n.length>0&&(e.preventDefault(),n.focus())},_onInputChange:function(t){var n=this,i=e(t.target),r=l(n._inputFiles(i),n._isAsyncNonBatch()),o=n.trigger(S,{files:r});o?(n._addInput(i),i.remove()):n._module.onSelect({target:i},r)},_onDrop:function(t){var n,i=t.originalEvent.dataTransfer,o=this,a=i.files,s=l(r(a),o._isAsyncNonBatch());f(t),a.length>0&&!o.wrapper.hasClass("k-state-disabled")&&(!o.multiple&&s.length>1&&s.splice(1,s.length-1),n=o.trigger(S,{files:s}),n||o._module.onSelect({target:e(".k-dropzone",o.wrapper)},s))},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(t){var n,i,r=this,o=0;for(t=l(t,!0),o=0;t.length>o;o++)n=t[o],i=r._enqueueFile(n.name,{fileNames:[n]}),i.addClass("k-file-success").data("files",[t[o]]),e(".k-progress",i).width("100%"),r.options.template||e(".k-upload-status",i).prepend("
100% "),r._supportsRemove()&&r._fileAction(i,I)},_prepareTemplateData:function(e,t){var n=t.fileNames,i={},r=0,o=0;for(o=0;n.length>o;o++)r+=n[o].size;return i.name=e,i.size=r,i.files=t.fileNames,i},_prepareDefaultFileEntryTemplate:function(t,n){var i="",r=e("
"+t+" ");return 1==n.fileNames.length&&n.fileNames[0].extension&&(i=n.fileNames[0].extension.substring(1),e(".k-icon",r).addClass("k-i-"+i)),r},_enqueueFile:function(t,n){var i,r,o,a,s=this,l=n.fileNames[0].uid,d=e(".k-upload-files",s.wrapper),c=s.options,u=c.template;return 0===d.length&&(d=e("
").appendTo(s.wrapper),s.options.showFileList||d.hide(),s.wrapper.removeClass("k-upload-empty")),i=e(".k-file",d),u?(o=s._prepareTemplateData(t,n),u=b.template(u),r=e("
"+u(o)+" "),r.find(".k-upload-action").addClass("k-button k-button-bare"),s.angular("compile",function(){return{elements:r,data:[o]}})):r=s._prepareDefaultFileEntryTemplate(t,n),r.attr(b.attr("uid"),l).appendTo(d).data(n),s._async||e(".k-progress",r).width("100%"),!s.multiple&&i.length>0&&(a={files:i.data("fileNames")},s.trigger(I,a)||s._module.onRemove({target:e(i,s.wrapper)},a.data)),r},_removeFileEntry:function(t){var n,i,r=this,o=t.closest(".k-upload-files");
t.remove(),n=e(".k-file",o),i=e(".k-file-success, .k-file-error",o),i.length===n.length&&this._hideUploadButton(),0===n.length&&(o.remove(),r.wrapper.addClass("k-upload-empty"),r._hideHeaderUploadstatus())},_fileAction:function(e,t){var n={remove:"k-delete",cancel:"k-cancel",retry:"k-retry"},i={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-refresh"};n.hasOwnProperty(t)&&(this._clearFileAction(e),this.options.template?e.find(".k-upload-action").addClass("k-button k-button-bare").append("
").show():(e.find(".k-upload-status .k-upload-action").remove(),e.find(".k-upload-status").append(this._renderAction(n[t],this.localization[t],i[t]))))},_fileState:function(t,n){var i=this.localization,r={uploading:{text:i.statusUploading},uploaded:{text:i.statusUploaded},failed:{text:i.statusFailed}},o=r[n];o&&e(".k-icon:not(.k-delete, .k-cancel, .k-retry)",t).text(o.text)},_renderAction:function(t,n,i){return e(""!==t?"
":"
"+n+" ")},_clearFileAction:function(t){e(".k-upload-action",t).empty().hide()},_onFileAction:function(t){var n,i,r,o,a=this;return a.wrapper.hasClass("k-state-disabled")||(n=e(t.target).closest(".k-upload-action"),i=n.find(".k-icon"),r=n.closest(".k-file"),o={files:r.data("fileNames")},i.hasClass("k-delete")?a.trigger(I,o)||a._module.onRemove({target:e(r,a.wrapper)},o.data):i.hasClass("k-cancel")?(a.trigger(R,o),a._module.onCancel({target:e(r,a.wrapper)}),this._checkAllComplete(),a._updateHeaderUploadStatus()):i.hasClass("k-retry")&&(e(".k-warning",r).remove(),a._module.onRetry({target:e(r,a.wrapper)}))),!1},_onUploadSelected:function(){var e=this,t=e.wrapper;return t.hasClass("k-state-disabled")||this._module.onSaveSelected(),!1},_onFileProgress:function(t,n){var i;n>100&&(n=100),this.options.template?e(".k-progress",t.target).width(n+"%"):(i=e(".k-upload-pct",t.target),0===i.length&&e(".k-upload-status",t.target).prepend("
"),e(".k-upload-pct",t.target).text(n+"%"),e(".k-progress",t.target).width(n+"%")),this.trigger(A,{files:g(t).data("fileNames"),percentComplete:n})},_onUploadSuccess:function(e,t,n){var i=g(e);this._fileState(i,"uploaded"),i.removeClass("k-file-progress").addClass("k-file-success"),this._updateHeaderUploadStatus(),this.trigger(D,{files:i.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:n}),this._supportsRemove()?this._fileAction(i,I):this._clearFileAction(i),this._checkAllComplete()},_onUploadError:function(t,n){var i=g(t),r=e(".k-upload-pct",i);this._fileState(i,"failed"),i.removeClass("k-file-progress").addClass("k-file-error"),e(".k-progress",i).width("100%"),r.length>0?r.empty().removeClass("k-upload-pct").addClass("k-icon k-warning"):e(".k-upload-status",i).prepend("
"),this._updateHeaderUploadStatus(),this._fileAction(i,"retry"),this.trigger(F,{operation:"upload",files:i.data("fileNames"),XMLHttpRequest:n}),y("Server response: "+n.responseText),this._checkAllComplete()},_showUploadButton:function(){var t=e(".k-upload-selected",this.wrapper);0===t.length&&(t=this._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected")),this.wrapper.append(t)},_hideUploadButton:function(){e(".k-upload-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(){var t=this.localization,n=e(".k-dropzone",this.wrapper),i=e(".k-upload-status-total",this.wrapper);0!==i.length&&i.remove(),i='
'+t.headerStatusUploading+''+t.statusUploading+" ",n.length>0?n.append(i):e(".k-upload-button",this.wrapper).after(i)},_updateHeaderUploadStatus:function(){var t,n,i,r=this,o=r.localization,a=e(".k-file",r.wrapper).not(".k-file-success, .k-file-error");0===a.length&&(t=e(".k-file.k-file-error",r.wrapper),n=e(".k-upload-status-total",r.wrapper),i=e(".k-icon",n).removeClass("k-loading").addClass(0!==t.length?"k-warning":"k-i-tick").text(0!==t.length?o.statusWarning:o.statusUploaded),n.text(r.localization.headerStatusUploaded).append(i))},_hideHeaderUploadstatus:function(){e(".k-upload-status-total",this.wrapper).remove()},_onParentFormSubmit:function(){var n,i=this,r=i.element;t!==this._module.onAbort&&this._module.onAbort(),r.value||(n=e(r),n.attr("disabled","disabled"),window.setTimeout(function(){n.removeAttr("disabled")},0))},_onParentFormReset:function(){e(".k-upload-files",this.wrapper).remove()},_supportsFormData:function(){return"undefined"!=typeof FormData},_supportsMultiple:function(){var e=this._userAgent().indexOf("Windows")>-1;return!(b.support.browser.opera||b.support.browser.safari&&e)},_supportsDrop:function(){var e=this._userAgent().toLowerCase(),t=/chrome/.test(e),n=!t&&/safari/.test(e),i=n&&/windows/.test(e);return!i&&this._supportsFormData()&&this.options.async.saveUrl},_userAgent:function(){return navigator.userAgent},_setupDropZone:function(){var t,n,i=this;e(".k-upload-button",this.wrapper).wrap("
"),t=i._ns,n=e(".k-dropzone",i.wrapper).append(e("
"+i.localization.dropFilesHere+" ")).on("dragenter"+t,f).on("dragover"+t,function(e){e.preventDefault()}).on("drop"+t,e.proxy(this._onDrop,this)),p(n,t,function(){n.closest(".k-upload").hasClass("k-state-disabled")||n.addClass("k-dropzone-hovered")},function(){n.removeClass("k-dropzone-hovered")}),p(e(document),t,function(){n.closest(".k-upload").hasClass("k-state-disabled")||(n.addClass("k-dropzone-active"),n.closest(".k-upload").removeClass("k-upload-empty"))},function(){n.removeClass("k-dropzone-active"),0===e("li.k-file",n.closest(".k-upload")).length&&n.closest(".k-upload").addClass("k-upload-empty")})},_supportsRemove:function(){return!!this.options.async.removeUrl},_submitRemove:function(t,n,i,r){var o=this,a=o.options.async.removeField||"fileNames",s=e.extend(n,w());s[a]=t,jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:h,url:this.options.async.removeUrl,traditional:!0,data:s,success:i,error:r,xhrFields:{withCredentials:this.options.async.withCredentials}})},_wrapInput:function(e){var t=this,n=t.options;return e.wrap(""),n.async.saveUrl||e.closest(".k-upload").addClass("k-upload-sync"),e.closest(".k-upload").addClass("k-upload-empty"),e.closest(".k-button").append("
"+this.localization.select+" "),e.closest(".k-upload")},_checkAllComplete:function(){0===e(".k-file.k-file-progress",this.wrapper).length&&this.trigger(E)},_inputFiles:function(e){return i(e)}}),H=function(e){this.name="syncUploadModule",this.element=e.wrapper,this.upload=e,this.element.closest("form").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data")};H.prototype={onSelect:function(t,i){var r,o=this.upload,a=e(t.target);o._addInput(a),r=o._enqueueFile(n(a),{relatedInput:a,fileNames:i}),o._fileAction(r,I)},onRemove:function(e){var t=g(e);t.data("relatedInput").remove(),this.upload._removeFileEntry(t)}},v=function(e){this.name="iframeUploadModule",this.element=e.wrapper,this.upload=e,this.iframes=[]},M._frameId=0,v.prototype={onSelect:function(t,n){var i=this.upload,r=e(t.target),o=this.prepareUpload(r,n);i.options.async.autoUpload?this.performUpload(o):(i._supportsRemove()&&this.upload._fileAction(o,I),i._showUploadButton())},prepareUpload:function(t,i){var r,o,a,s=this.upload,l=e(s.element),d=s.options.async.saveField||t.attr("name");return s._addInput(t),t.attr("name",d),r=this.createFrame(s.name+"_"+M._frameId++),this.registerFrame(r),o=this.createForm(s.options.async.saveUrl,r.attr("name")).append(l),a=s._enqueueFile(n(t),{frame:r,relatedInput:l,fileNames:i}),r.data({form:o,file:a}),a},performUpload:function(t){var n,i,r,o={files:t.data("fileNames")},a=t.data("frame"),s=this.upload;if(s.trigger(T,o))s._removeFileEntry(a.data("file")),this.cleanupFrame(a),this.unregisterFrame(a);else{s._hideUploadButton(),s._showHeaderUploadStatus(),a.appendTo(document.body),n=a.data("form").attr("action",s.options.async.saveUrl).appendTo(document.body),o.data=e.extend({},o.data,w());for(i in o.data)r=n.find("input[name='"+i+"']"),0===r.length&&(r=e("
",{type:"hidden",name:i}).prependTo(n)),r.val(o.data[i]);s._fileAction(t,R),s._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),a.one("load",e.proxy(this.onIframeLoad,this)),n[0].submit()}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=m(n);i||t.performUpload(n)})},onIframeLoad:function(t){var n,i=e(t.target);try{n=i.contents().text()}catch(r){n="Error trying to get server response: "+r}this.processResponse(i,n)},processResponse:function(t,n){var i=t.data("file"),r=this,o={responseText:n};u(n,function(n){e.extend(o,{statusText:"OK",status:"200"}),r.upload._onFileProgress({target:e(i,r.upload.wrapper)},100),r.upload._onUploadSuccess({target:e(i,r.upload.wrapper)},n,o),r.cleanupFrame(t),r.unregisterFrame(t)},function(){e.extend(o,{statusText:"error",status:"500"}),r.upload._onUploadError({target:e(i,r.upload.wrapper)},o)})},onCancel:function(t){var n=e(t.target).data("frame");this.stopFrameSubmit(n),this.cleanupFrame(n),this.unregisterFrame(n),this.upload._removeFileEntry(n.data("file"))},onRetry:function(e){var t=g(e);this.performUpload(t)},onRemove:function(e,t){var n=g(e),i=n.data("frame");i?(this.unregisterFrame(i),this.upload._removeFileEntry(n),this.cleanupFrame(i)):c(n,this.upload,t)},onAbort:function(){var t=this.element,n=this;e.each(this.iframes,function(){e("input",this.data("form")).appendTo(t),n.stopFrameSubmit(this[0]),this.data("form").remove(),this.remove()}),this.iframes=[]},createFrame:function(t){return e("
")},createForm:function(t,n){return e("
")},stopFrameSubmit:function(e){t!==e.stop?e.stop():e.document&&e.document.execCommand("Stop")},registerFrame:function(e){this.iframes.push(e)},unregisterFrame:function(t){this.iframes=e.grep(this.iframes,function(e){return e.attr("name")!=t.attr("name")})},cleanupFrame:function(e){var t=e.data("form");e.data("file").data("frame",null),setTimeout(function(){t.remove(),e.remove()},1)}},_=function(e){this.name="formDataUploadModule",this.element=e.wrapper,this.upload=e},_.prototype={onSelect:function(t,n){var i=this.upload,r=this,o=e(t.target),a=this.prepareUpload(o,n);e.each(a,function(){i.options.async.autoUpload?r.performUpload(this):(i._supportsRemove()&&i._fileAction(this,I),i._showUploadButton())})},prepareUpload:function(t,n){var i=this.enqueueFiles(n);return t.is("input")&&(e.each(i,function(){e(this).data("relatedInput",t)}),t.data("relatedFileEntries",i),this.upload._addInput(t)),i},enqueueFiles:function(t){var n,i,r,o,a=this.upload,s=t.length,l=[];if(a.options.async.batch===!0)n=e.map(t,function(e){return e.name}).join(", "),o=a._enqueueFile(n,{fileNames:t}),o.data("files",t),l.push(o);else for(i=0;s>i;i++)r=t[i],n=r.name,o=a._enqueueFile(n,{fileNames:[r]}),o.data("files",[r]),l.push(o);return l},performUpload:function(t){var n,i=this.upload,r=this.createFormData(),o=this.createXHR(),a={files:t.data("fileNames"),XMLHttpRequest:o};if(i.trigger(T,a))this.removeFileEntry(t);else{if(i._fileAction(t,R),i._hideUploadButton(),i._showHeaderUploadStatus(),a.formData)r=a.formData;else{a.data=e.extend({},a.data,w());for(n in a.data)r.append(n,a.data[n]);this.populateFormData(r,t.data("files"))}i._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),this.postFormData(i.options.async.saveUrl,r,t,o)}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=m(n);i||t.performUpload(n)})},onCancel:function(e){var t=g(e);this.stopUploadRequest(t),this.removeFileEntry(t)},onRetry:function(e){var t=g(e);this.performUpload(t)},onRemove:function(e,t){var n=g(e);n.hasClass("k-file-success")?c(n,this.upload,t):this.removeFileEntry(n)},createXHR:function(){return new XMLHttpRequest},postFormData:function(e,t,n,i){var r=this;n.data("request",i),i.addEventListener("load",function(e){r.onRequestSuccess.call(r,e,n)},!1),i.addEventListener(F,function(e){r.onRequestError.call(r,e,n)},!1),i.upload.addEventListener("progress",function(e){r.onRequestProgress.call(r,e,n)},!1),i.open("POST",e,!0),i.withCredentials=this.upload.options.async.withCredentials,i.send(t)},createFormData:function(){return new FormData},populateFormData:function(e,t){var n,i=this.upload,r=t.length;for(n=0;r>n;n++)e.append(i.options.async.saveField||i.name,t[n].rawFile);return e},onRequestSuccess:function(t,n){function i(){o.upload._onUploadError({target:e(n,o.upload.wrapper)},r)}var r=t.target,o=this;r.status>=200&&299>=r.status?u(r.responseText,function(t){o.upload._onFileProgress({target:e(n,o.upload.wrapper)},100),o.upload._onUploadSuccess({target:e(n,o.upload.wrapper)},t,r),o.cleanupFileEntry(n)},i):i()},onRequestError:function(t,n){var i=t.target;this.upload._onUploadError({target:e(n,this.upload.wrapper)},i)},cleanupFileEntry:function(t){var n=t.data("relatedInput"),i=!0;n&&(e.each(n.data("relatedFileEntries")||[],function(){this.parent().length>0&&this[0]!=t[0]&&(i=i&&this.hasClass("k-file-success"))}),i&&n.remove())},removeFileEntry:function(e){this.cleanupFileEntry(e),this.upload._removeFileEntry(e)},onRequestProgress:function(t,n){var i=Math.round(100*t.loaded/t.total);this.upload._onFileProgress({target:e(n,this.upload.wrapper)},i)},stopUploadRequest:function(e){e.data("request").abort()}},b.ui.plugin(M)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.filebrowser.min",["kendo.listview.min","kendo.dropdownlist.min","kendo.upload.min"],e)}(function(){return function(e,t){function n(e,t,n){var i,r;e.on("dragenter"+x,function(){t(),r=new Date,i||(i=setInterval(function(){var e=new Date-r;e>100&&(n(),clearInterval(i),i=null)},100))}).on("dragover"+x,function(){r=new Date})}function i(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function r(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}function o(e,t){var n=e[t];return h(n)?n.from||n.field||t:n}var a,s,l,d,c=window.kendo,u=c.ui.Widget,h=e.isPlainObject,f=e.proxy,p=e.extend,m=c.support.placeholder,g=c.support.browser,v=c.isFunction,_=/(^\/|\/$)/g,b="change",k="apply",w="error",y="click",x=".kendoFileBrowser",C=".kendoBreadcrumbs",S=".kendoSearchBox",T="name",D="size",F="type",E={field:F,dir:"asc"},R=c.template('
${text} '),A='';p(!0,c.data,{schemas:{filebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),p(!0,c.data,{transports:{filebrowser:c.data.RemoteTransport.extend({init:function(t){c.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),v(this.options[t])?this.options[t].call(this,n):c.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),a=g.msie&&8>g.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},s=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n.element.addClass("k-filebrowser"),n.element.on(y+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-delete)",f(n._deleteClick,n)).on(y+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-addfolder)",f(n._addClick,n)).on("keydown"+x,"li.k-state-selected input",f(n._directoryKeyDown,n)).on("blur"+x,"li.k-state-selected input",f(n._directoryBlur,n)),n._dataSource(),n.refresh(),n.path(n.options.path)},options:{name:"FileBrowser",messages:{uploadFile:"Upload",orderBy:"Arrange by",orderByName:"Name",orderBySize:"Size",directoryNotFound:"A directory with this name was not found.",emptyFolder:"Empty Folder",deleteFile:'Are you sure you want to delete "{0}"?',invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',dropFilesHere:"drop file here to upload",search:"Search"},transport:{},path:"/",fileTypes:"*.*"},events:[w,b,k],destroy:function(){var e=this;u.fn.destroy.call(e),e.dataSource.unbind(w,e._errorHandler),e.element.add(e.list).add(e.toolbar).off(x),c.destroy(e.element)},value:function(){var e,n=this,r=n._selectedItem(),o=n.options.transport.fileUrl;return r&&"f"===r.get(F)?(e=i(n.path(),r.get(T)).replace(_,""),o&&(e=v(o)?o(e):c.format(o,encodeURIComponent(e))),e):t},_selectedItem:function(){var e=this.listView,n=e.select();return n.length?this.dataSource.getByUid(n.attr(c.attr("uid"))):t},_toolbar:function(){var t=this,n=c.template(A),i=t.options.messages,r=[{text:i.orderByName,value:"name"},{text:i.orderBySize,value:"size"}];t.toolbar=e(n({messages:i,showUpload:t.options.transport.uploadUrl,showCreate:t.options.transport.create,showDelete:t.options.transport.destroy})).appendTo(t.element).find(".k-upload input").kendoUpload({multiple:!1,localization:{dropFilesHere:i.dropFilesHere},async:{saveUrl:t.options.transport.uploadUrl,autoUpload:!0},upload:f(t._fileUpload,t),error:function(e){t._error({xhr:e.XMLHttpRequest,status:"error"})}}).end(),t.upload=t.toolbar.find(".k-upload input").data("kendoUpload"),t.arrangeBy=t.toolbar.find(".k-tiles-arrange select").kendoDropDownList({dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){t.orderBy(this.value())}}).data("kendoDropDownList"),t._attachDropzoneEvents()},_attachDropzoneEvents:function(){var t=this;t.options.transport.uploadUrl&&(n(e(document.documentElement),e.proxy(t._dropEnter,t),e.proxy(t._dropLeave,t)),t._scrollHandler=f(t._positionDropzone,t))},_dropEnter:function(){this._positionDropzone(),e(document).on("scroll"+x,this._scrollHandler)},_dropLeave:function(){this._removeDropzone(),e(document).off("scroll"+x,this._scrollHandler)},_positionDropzone:function(){var e=this,t=e.element,n=t.offset();e.toolbar.find(".k-dropzone").addClass("k-filebrowser-dropzone").offset(n).css({width:t[0].clientWidth,height:t[0].clientHeight,lineHeight:t[0].clientHeight+"px"})},_removeDropzone:function(){this.toolbar.find(".k-dropzone").removeClass("k-filebrowser-dropzone").css({width:"",height:"",lineHeight:"",top:"",left:""})},_deleteClick:function(){var e=this,t=e.listView.select(),n=c.format(e.options.messages.deleteFile,t.find("strong").text());t.length&&e._showMessage(n,"confirm")&&e.listView.remove(t)},_addClick:function(){this.createDirectory()},_getFieldName:function(e){return o(this.dataSource.reader.model.fields,e)},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),a=e.files[0].name,s=T,l=D;o.test(a)?(e.data={path:n.path()},t=n._createFile(a),t?n.upload.one("success",function(e){t.set(s,e.response[n._getFieldName(s)]),t.set(l,e.response[n._getFieldName(l)]),n._tiles=n.listView.items().filter("["+c.attr("type")+"=f]")}):e.preventDefault()):(e.preventDefault(),n._showMessage(c.format(i.messages.invalidFileType,a,r)))},_findFile:function(e){var t,n,i,r=this.dataSource.data(),o=F,a=T;for(e=e.toLowerCase(),t=0,i=r.length;i>t;t++)if("f"===r[t].get(o)&&r[t].get(a).toLowerCase()===e){n=r[t];break}return n},_createFile:function(e){var t,n,i=this,r=0,o={},a=F,s=i.dataSource.view(),l=i._findFile(e);if(l)return i._showMessage(c.format(i.options.messages.overwriteFile,e),"confirm")?(l._forceReload=!0,l):null;for(t=0,n=s.length;n>t;t++)if("f"===s[t].get(a)){r=t;break}return o[a]="f",o[T]=e,o[D]=0,i.dataSource.insert(++r,o)},createDirectory:function(){var e,t,n=this,i=0,r=F,o=T,a=n.dataSource.data(),s=n._nameDirectory(),l=new n.dataSource.reader.model;for(e=0,t=a.length;t>e;e++)"d"===a[e].get(r)&&(i=e);l.set(r,"d"),l.set(o,s),n.listView.one("dataBound",function(){var e=n.listView.items().filter("["+c.attr("uid")+"="+l.uid+"]"),t=e.find("input");e.length&&this.edit(e),this.element.scrollTop(e.attr("offsetTop")-this.element[0].offsetHeight),setTimeout(function(){t.select()})}).one("save",function(e){var t=e.model.get(o);t?e.model.set(o,n._nameExists(t,l.uid)?n._nameDirectory():t):e.model.set(o,s)}),n.dataSource.insert(++i,l)},_directoryKeyDown:function(e){13==e.keyCode&&e.currentTarget.blur()},_directoryBlur:function(){this.listView.save()},_nameExists:function(e,t){var n,i,r=this.dataSource.data(),o=F,a=T;for(n=0,i=r.length;i>n;n++)if("d"===r[n].get(o)&&r[n].get(a).toLowerCase()===e.toLowerCase()&&r[n].uid!==t)return!0;return!1},_nameDirectory:function(){var t,n,i,r="New folder",o=this.dataSource.data(),a=[],s=F,l=T;for(n=0,i=o.length;i>n;n++)"d"===o[n].get(s)&&o[n].get(l).toLowerCase().indexOf(r.toLowerCase())>-1&&a.push(o[n].get(l));if(e.inArray(r,a)>-1){n=2;do t=r+" ("+n+")",n++;while(e.inArray(t,a)>-1);r=t}return r},orderBy:function(e){this.dataSource.sort([{field:F,dir:"asc"},{field:e,dir:"asc"}])},search:function(e){this.dataSource.filter({field:T,operator:"contains",value:e})},_content:function(){var t=this;t.list=e('
').appendTo(t.element).on("dblclick"+x,"li",f(t._dblClick,t)),t.listView=new c.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"),("remove"===e.action||"sync"===e.action)&&e.preventDefault()},dataBound:function(){t.dataSource.view().length?t._tiles=this.items().filter("["+c.attr("type")+"=f]"):this.wrapper.append(R({text:t.options.messages.emptyFolder}))},change:f(t._listViewChange,t)})},_dblClick:function(t){var n,r=this,o=e(t.currentTarget);o.hasClass("k-edit-item")&&r._directoryBlur(),o.filter("["+c.attr("type")+"=d]").length?(n=r.dataSource.getByUid(o.attr(c.attr("uid"))),n&&(r.path(i(r.path(),n.get(T))),r.breadcrumbs.value(r.path()))):o.filter("["+c.attr("type")+"=f]").length&&r.trigger(k)},_listViewChange:function(){var e=this._selectedItem();e&&(this.toolbar.find(".k-delete").parent().removeClass("k-state-disabled"),"f"===e.get(F)&&this.trigger(b))},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=p({},E),o={field:T,dir:"asc"},a={type:i.type||"filebrowser",sort:[r,o]};h(i)&&(i.path=f(t.path,t),a.transport=i),h(n.schema)?a.schema=n.schema:i.type&&h(c.data.schemas[i.type])&&(e=c.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(w,t._errorHandler):t._errorHandler=f(t._error,t),t.dataSource=c.data.DataSource.create(a).bind(w,t._errorHandler)},_navigation:function(){var t=this,n=e('
').appendTo(this.element);t.breadcrumbs=n.find("input:first").kendoBreadcrumbs({value:t.options.path,change:function(){t.path(this.value())}}).data("kendoBreadcrumbs"),t.searchBox=n.parent().find("input:last").kendoSearchBox({label:t.options.messages.search,change:function(){t.search(this.value())}}).data("kendoSearchBox")},_error:function(e){var t,n=this;n.trigger(w,e)||(t=e.xhr.status,"error"==e.status?"404"==t?n._showMessage(n.options.messages.directoryNotFound):"0"!=t&&n._showMessage("Error! The requested URL returned "+t+" - "+e.xhr.statusText):"timeout"==t&&n._showMessage("Error! Server timeout."))},_showMessage:function(e,t){return window[t||"alert"](e)},refresh:function(){var e=this;e._navigation(),e._toolbar(),e._content()},_editTmpl:function(){var e='
',e+="#if("+F+' == "d") { #',e+='
',e+="#}else{#",e+='
',e+="#}#",e+="#if("+F+' == "d") { #',e+=' ',e+="#}#",e+=" ",f(c.template(e),{sizeFormatter:r})},_itemTmpl:function(){var e='
',e+="#if("+F+' == "d") { #',e+='
',e+="#}else{#",e+='
',e+="#}#",e+="${"+T+"} ",e+="#if("+F+' == "f") { # ${this.sizeFormatter('+D+")} #}#",e+=" ",f(c.template(e),{sizeFormatter:r})},path:function(e){var n=this,i=n._path||"";return e!==t?(n._path=e.replace(_,"")+"/",n.dataSource.read({path:n._path}),t):(i&&(i=i.replace(_,"")),"/"===i||""===i?"":i+"/")}}),l=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),m&&n.element.attr("placeholder",n.options.label),n._wrapper(),n.element.on("keydown"+S,f(n._keydown,n)).on("change"+S,f(n._updateValue,n)),n.wrapper.on(y+S,"a",f(n._click,n)),m||n.element.on("focus"+S,f(n._focus,n)).on("blur"+S,f(n._blur,n))},options:{name:"SearchBox",label:"Search",value:""},events:[b],destroy:function(){var e=this;e.wrapper.add(e.element).add(e.label).off(S),u.fn.destroy.call(e)},_keydown:function(e){13===e.keyCode&&this._updateValue()},_click:function(e){e.preventDefault(),this._updateValue()},_updateValue:function(){var e=this,t=e.element.val();t!==e.value()&&(e.value(t),e.trigger(b))},_blur:function(){this._updateValue(),this._toggleLabel()},_toggleLabel:function(){m||this.label.toggle(!this.element.val())},_focus:function(){this.label.hide()},_wrapper:function(){var t=this.element,n=t.parents(".k-search-wrap");t[0].style.width="",t.addClass("k-input"),n.length||(n=t.wrap(e('
')).parent(),m||e('
'+this.options.label+" ").insertBefore(t),e('
').appendTo(n)),this.wrapper=n,this.label=n.find(">label")},value:function(e){var n=this;return e!==t?(n.options.value=e,n.element.val(e),n._toggleLabel(),t):n.options.value}}),d=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n._wrapper(),n.wrapper.on("focus"+C,"input",f(n._focus,n)).on("blur"+C,"input",f(n._blur,n)).on("keydown"+C,"input",f(n._keydown,n)).on(y+C,"a.k-i-arrow-n:first",f(n._rootClick,n)).on(y+C,"a:not(.k-i-arrow-n)",f(n._click,n)),n.value(n.options.value)},options:{name:"Breadcrumbs",gap:50},events:[b],destroy:function(){var e=this;u.fn.destroy.call(e),e.wrapper.add(e.wrapper.find("input")).add(e.wrapper.find("a")).off(C)},_update:function(e){e="/"===(e||"").charAt(0)?e:"/"+(e||""),e!==this.value()&&(this.value(e),this.trigger(b))},_click:function(t){t.preventDefault(),this._update(this._path(e(t.target).prevAll("a:not(.k-i-arrow-n)").addBack()))},_rootClick:function(e){e.preventDefault(),this._update("")},_focus:function(){var e=this,t=e.element;e.overlay.hide(),e.element.val(e.value()),setTimeout(function(){t.select()})},_blur:function(){if(!this.overlay.is(":visible")){var e=this,t=e.element,n=t.val().replace(/\/{2,}/g,"/");e.overlay.show(),t.val(""),e._update(n)}},_keydown:function(e){var t=this;13===e.keyCode&&(t._blur(),setTimeout(function(){t.overlay.find("a:first").focus()}))},_wrapper:function(){var t,n=this.element,i=n.parents(".k-breadcrumbs");n[0].style.width="",n.addClass("k-input"),i.length||(i=n.wrap(e('
')).parent()),t=i.find(".k-breadcrumbs-wrap"),t.length||(t=e('
').appendTo(i)),this.wrapper=i,this.overlay=t},refresh:function(){var n,i,r,o,a="",s=this.value();for(s!==t&&s.match(/^\//)||(s="/"+(s||"")),n=s.split("/"),r=0,o=n.length;o>r;r++)i=n[r],i&&(a||(a+='
root '),a+='
'+n[r]+" ",a+='
> ');this.overlay.empty().append(e(a)),this._adjustSectionWidth()},_adjustSectionWidth:function(){var t,n=this,i=n.wrapper,r=i.width()-n.options.gap,o=n.overlay.find("a");o.each(function(n){t=e(this),t.parent().width()>r&&(n==o.length-1?t.width(r):t.prev().addBack().hide())})},value:function(e){return e!==t?(this._value=e.replace(/\/{2,}/g,"/"),this.refresh(),t):this._value},_path:function(t){return"/"+e.map(t,function(t){return e(t).text()}).join("/")}}),c.ui.plugin(s),c.ui.plugin(d),c.ui.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.imagebrowser.min",["kendo.filebrowser.min"],e)}(function(){return function(e,t){function n(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function i(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}var r,o,a=window.kendo,s=a.ui.FileBrowser,l=e.isPlainObject,d=e.proxy,c=e.extend,u=a.support.browser,h=a.isFunction,f=/(^\/|\/$)/g,p="error",m=".kendoImageBrowser",g="name",v="size",_="type",b={field:_,dir:"asc"},k=a.template('
${text} ');c(!0,a.data,{schemas:{imagebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),c(!0,a.data,{transports:{imagebrowser:a.data.RemoteTransport.extend({init:function(t){a.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),h(this.options[t])?this.options[t].call(this,n):a.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),r=u.msie&&8>u.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},o=s.extend({init:function(e,t){var n=this;t=t||{},s.fn.init.call(n,e,t),n.element.addClass("k-imagebrowser")},options:{name:"ImageBrowser",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},value:function(){var e,i=this,r=i._selectedItem(),o=i.options.transport.imageUrl;return r&&"f"===r.get(_)?(e=n(i.path(),r.get(g)).replace(f,""),o&&(e=h(o)?o(e):a.format(o,encodeURIComponent(e))),e):t},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),s=e.files[0].name,l=g,d=v;o.test(s)?(e.data={path:n.path()},t=n._createFile(s),t?(t._uploading=!0,n.upload.one("success",function(e){delete t._uploading,t.set(l,e.response[n._getFieldName(l)]),t.set(d,e.response[n._getFieldName(d)]),n._tiles=n.listView.items().filter("["+a.attr("type")+"=f]"),n._scroll()})):e.preventDefault()):(e.preventDefault(),n._showMessage(a.format(i.messages.invalidFileType,s,r)))},_content:function(){var t=this;t.list=e('
').appendTo(t.element).on("scroll"+m,d(t._scroll,t)).on("dblclick"+m,"li",d(t._dblClick,t)),
t.listView=new a.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"),("remove"===e.action||"sync"===e.action)&&e.preventDefault()},dataBound:function(){t.dataSource.view().length?(t._tiles=this.items().filter("["+a.attr("type")+"=f]"),t._scroll()):this.wrapper.append(k({text:t.options.messages.emptyFolder}))},change:d(t._listViewChange,t)})},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=c({},b),o={field:g,dir:"asc"},s={type:i.type||"imagebrowser",sort:[r,o]};l(i)&&(i.path=d(t.path,t),s.transport=i),l(n.schema)?s.schema=n.schema:i.type&&l(a.data.schemas[i.type])&&(e=a.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(p,t._errorHandler):t._errorHandler=d(t._error,t),t.dataSource=a.data.DataSource.create(s).bind(p,t._errorHandler)},_loadImage:function(t){var n=this,i=e(t),r=n.dataSource.getByUid(i.attr(a.attr("uid"))),o=r.get(g),s=n.options.transport.thumbnailUrl,l=e("
",{alt:o}),d="?";r._uploading||(l.hide().on("load"+m,function(){e(this).prev().remove().end().addClass("k-image").fadeIn()}),i.find(".k-loading").after(l),h(s)?s=s(n.path(),encodeURIComponent(o)):(s.indexOf("?")>=0&&(d="&"),s=s+d+"path="+n.path()+encodeURIComponent(o),r._forceReload&&(s+="&_="+(new Date).getTime(),delete r._forceReload)),l.attr("src",s),t.loaded=!0)},_scroll:function(){var e=this;e.options.transport&&e.options.transport.thumbnailUrl&&(clearTimeout(e._timeout),e._timeout=setTimeout(function(){var n=e.list.outerHeight(),i=e.list.scrollTop(),o=i+n;e._tiles.each(function(){var n=r(this),a=n+this.offsetHeight;return(n>=i&&o>n||a>=i&&o>a)&&e._loadImage(this),n>o?!1:t}),e._tiles=e._tiles.filter(function(){return!this.loaded})},250))},_itemTmpl:function(){var e=this,t='
',t+="#if("+_+' == "d") { #',t+='
',t+="#}else{#",t+=e.options.transport&&e.options.transport.thumbnailUrl?'
':'
',t+="#}#",t+="${"+g+"} ",t+="#if("+_+' == "f") { # ${this.sizeFormatter('+v+")} #}#",t+=" ",d(a.template(t),{sizeFormatter:i})}}),a.ui.plugin(o)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/undoredostack.min",["kendo.core.min"],e)}(function(){!function(e){var t=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this,t),this.clear()},events:["undo","redo"],push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){if(this.canUndo()){var e=this.stack[this.currentCommandIndex--];e.undo(),this.trigger("undo",{command:e})}},redo:function(){if(this.canRedo()){var e=this.stack[++this.currentCommandIndex];e.redo(),this.trigger("redo",{command:e})}},clear:function(){this.stack=[],this.currentCommandIndex=-1},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}});e.deepExtend(e,{util:{UndoRedoStack:t}})}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/main.min",["util/undoredostack.min","kendo.combobox.min","kendo.dropdownlist.min","kendo.window.min","kendo.colorpicker.min"],e)}(function(){!function(e,t){var n,i,r,o,a=window.kendo,s=a.Class,l=a.ui.Widget,d=a.support.mobileOS,c=a.support.browser,u=e.extend,h=e.proxy,f=a.deepExtend,p=".kendoEditor",m=a.keys,g=s.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return a.template(e.template,{useWithBlock:!1})(e)}}),v={editorWrapperTemplate:'',buttonTemplate:'
#= data.title # ',colorPickerTemplate:'
',comboBoxTemplate:'
',dropDownListTemplate:'
',separatorTemplate:'
',overflowAnchorTemplate:'
',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()),w.defaultTools[e]=t},registerFormat:function(e,t){w.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"},b=!d||d.ios&&d.flatVersion>=500||!d.ios&&t!==document.documentElement.contentEditable,k={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"]},w=l.extend({init:function(t,n){var i,r,o,s,d,c=this,m=a.ui.editor,g=m.Dom;b&&(l.fn.init.call(c,t,n),c.options=f({},c.options,n),c.options.tools=c.options.tools.slice(),t=c.element,d=t[0],s=g.name(d),t.closest("form").on("submit"+p,function(){c.update()}),o=u({},c.options),o.editor=c,"textarea"==s?(c._wrapTextarea(),r=c.wrapper.find(".k-editor-toolbar"),d.id&&r.attr("aria-controls",d.id)):(c.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),o.popup=!0,r=e('
').insertBefore(t)),c.toolbar=new m.Toolbar(r[0],o),c.toolbar.bindTo(c),"textarea"==s&&setTimeout(function(){var e=c.wrapper[0].style.height,t=parseInt(e,10),n=c.wrapper.height();e.indexOf("px")>0&&!isNaN(t)&&n>t&&c.wrapper.height(t-(n-t))}),c._resizable(),c._initializeContentElement(c),c.keyboard=new m.Keyboard([new m.BackspaceHandler(c),new m.TypingHandler(c),new m.SystemHandler(c)]),c.clipboard=new m.Clipboard(this),c.undoRedoStack=new a.util.UndoRedoStack,n&&n.value?i=n.value:c.textarea?(i=d.value,c.options.encoded&&e.trim(d.defaultValue).length&&(i=d.defaultValue),i=i.replace(/[\r\n\v\f\t ]+/gi," ")):i=d.innerHTML,c.value(i||a.ui.editor.emptyElementContent),e(document).on("mousedown",h(c._endTyping,c)).on("mouseup",h(c._mouseup,c)),c.toolbar.resize(),a.notify(c))},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){c.msie||a.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("
").insertAfter(this.textarea),this.wrapper.kendoResizable(u({},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("
")},resize:function(e){var t=e.y.initialDelta,n=this.initialSize+t,i=this.options.min||0,r=this.options.max||1/0;n=Math.min(r,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,r=n[0].style.height,o=v.editorWrapperTemplate,a=e(o).insertBefore(n).width(i).height(r),s=a.find(".k-editable-area");n.attr("autocomplete","off").appendTo(s).addClass("k-content k-raw-content").css("display","none"),t.textarea=n,t.wrapper=a},_createContentElement:function(t){var n,i,r,o=this,s=o.textarea,l=o.options.domain,d=l||document.domain,c="",u='javascript:""';return(l||d!=location.hostname)&&(c='',u="javascript:document.write('"+c+"')"),s.hide(),n=e("
",{title:o.options.messages.editAreaTitle,frameBorder:"0"})[0],e(n).css("display","").addClass("k-content").attr("tabindex",s[0].tabIndex).insertBefore(s),n.src=u,i=n.contentWindow||n,r=i.document||n.contentDocument,e(n).one("load",function(){o.toolbar.decorateFrom(r.body)}),r.open(),r.write("
"+c+""+e.map(t,function(e){return"
"}).join("")+""),r.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,r=!1;e(n.body).on("contextmenu"+p,function(){n.one("select",function(){i=null}),n._spellCorrectTimeout=setTimeout(function(){i=new a.ui.editor.RestorePoint(n.getRange()),r=!1},10)}).on("input"+p,function(){return i?a.support.browser.mozilla&&!r?(r=!0,t):(a.ui.editor._finishUpdate(n,i),t):t})},_initializeContentElement:function(){var n,i,r=this;r.textarea?(r.window=r._createContentElement(r.options.stylesheets),n=r.document=r.window.contentDocument||r.window.document,r.body=n.body,i=r.window,e(n).on("mouseup"+p,h(r._mouseup,r))):(r.window=window,n=r.document=document,r.body=r.element[0],i=r.body,r.toolbar.decorateFrom(r.body)),e(i).on("blur"+p,h(this._blur,this));try{n.execCommand("enableInlineTableEditing",null,!1)}catch(o){}a.support.touch&&e(n).on("selectionchange"+p,h(this._selectionChange,this)).on("keydown"+p,function(){a._activeElement()!=n.body&&r.window.focus()}),this._spellCorrect(r),e(r.body).on("dragstart"+p,!1).on("keydown"+p,function(e){var n,i,o,a,s,l;return e.keyCode!==m.BACKSPACE&&e.keyCode!==m.DELETE||"true"===r.body.getAttribute("contenteditable")?e.keyCode===m.F10?(setTimeout(h(r.toolbar.focus,r.toolbar),100),e.preventDefault(),t):((e.keyCode==m.LEFT||e.keyCode==m.RIGHT)&&(n=r.getRange(),i=e.keyCode==m.LEFT,o=n[i?"startContainer":"endContainer"],a=n[i?"startOffset":"endOffset"],s=i?-1:1,i&&(a-=1),a+s>0&&3==o.nodeType&&"\ufeff"==o.nodeValue[a]&&(n.setStart(o,a+s),n.collapse(!0),r.selectRange(n))),(l=r.keyboard.toolFromShortcut(r.toolbar.tools,e))?(e.preventDefault(),/^(undo|redo)$/.test(l)||r.keyboard.endTyping(!0),r.trigger("keydown",e),r.exec(l),!1):(r.keyboard.clearTimeout(),r.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)&&r._selectionChange(),r.keyboard.keyup(t)}).on("mousedown"+p,function(t){if(r._selectionStarted=!0,!c.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=a.ui.editor.Dom;"img"===n.name(e.target)&&(t=r.createRange(),t.selectNode(e.target),r.selectRange(t))}).on("cut"+p+" copy"+p+" paste"+p,function(e){r.clipboard["on"+e.type](e)}).on("focusin"+p,function(){e(this).addClass("k-state-active"),r.toolbar.show()}).on("focusout"+p,function(){setTimeout(function(){var t=a._activeElement(),n=r.body,i=r.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},imageBrowser:null,fileBrowser:null,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"],k.basic,k.alignment,k.lists,k.indenting,k.links,["insertImage"],k.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",h(t._endTyping,t)).off("mouseup",h(t._mouseup,t)),clearTimeout(this._spellCorrectTimeout),t._focusOutside(),t.toolbar.destroy(),a.destroy(t.wrapper)},_focusOutside:function(){if(a.support.browser.msie&&this.textarea){var t=e("
").appendTo(document.body).focus();t.blur().remove()}},state:function(e){var t,n,i=w.defaultTools[e],r=i&&(i.options.finder||i.finder),o=a.ui.editor.RangeUtils;return r?(t=this.getRange(),n=o.textNodes(t),!n.length&&t.collapsed&&(n=[t.startContainer]),r.getFormat?r.getFormat(n):r.isFormatted(n)):!1},value:function(e){var n=this.body,i=a.ui.editor,r=i.Serializer.domToXhtml(n,this.options.serialization);return e===t?r:(e!=r&&(i.Serializer.htmlToDom(e,n),c.msie||a.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 a.ui.editor.RestorePoint(t))},_focusBody:function(){var e,t=this.body,n=this.wrapper&&this.wrapper.find("iframe")[0],i=this.document.documentElement,r=a._activeElement();r!=t&&r!=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 a.ui.editor.Dom.encode(this.value())},createRange:function(e){return a.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return a.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 a.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(t,n){this.focus();var i=new a.ui.editor.InsertHtmlCommand(e.extend({range:this.getRange(),html:t},n));i.editor=this,i.exec()},exec:function(e,n){var i,r,o,a,s=this,l=null;if(!e)throw Error("kendoEditor.exec(): `name` parameter cannot be empty");if("true"!==s.body.getAttribute("contenteditable")&&"print"!==e)return!1;if(e=e.toLowerCase(),s.keyboard.isTypingInProgress()||s.restoreSelection(),r=s.toolbar.toolById(e),!r)for(a in w.defaultTools)if(a.toLowerCase()==e){r=w.defaultTools[a];break}if(r){if(i=s.getRange(),r.command&&(l=r.command(u({range:i},n))),o=s.trigger("execute",{name:e,command:l}))return;if(/^(undo|redo)$/i.test(e))s.undoRedoStack[e]();else if(l&&(l.managesUndoRedo||s.undoRedoStack.push(l),l.editor=s,l.exec(),l.async))return l.change=h(s._selectionChange,s),t;s._selectionChange()}}});w.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},a.ui.plugin(w),n=s.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 a.ui.editor.FormatCommand(u(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 g({template:v.separatorTemplate})})),r=c.msie&&9>c.version?"\ufeff":"",o='
',c.msie&&(10>c.version?o="\ufeff":11>c.version&&(o=" ")),u(a.ui,{editor:{ToolTemplate:g,EditorUtils:v,Tool:n,FormatTool:i,_bomFill:r,emptyElementContent:o}}),a.PDFMixin&&(a.PDFMixin.extend(w.prototype),w.prototype._drawPDF=function(){return a.drawing.drawDOM(this.body,this.options.pdf)},w.prototype.saveAsPDF=function(){var t,n,i=new e.Deferred,r=i.promise(),o={promise:r};if(!this.trigger("pdfExport",o))return t=this.options.pdf,n=t.paperSize,this._drawPDF(i).then(function(e){return t.paperSize="auto",a.drawing.exportPDF(e,t)}).done(function(e){a.saveAs({dataURI:e,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy}),t.paperSize=n,i.resolve()}).fail(function(e){i.reject(e)}),r})}(window.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/dom.min",["editor/main.min"],e)}(function(){!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,r,o,a,s,l,d,c,u,h=window.kendo,f=e.map,p=e.extend,m=h.support.browser,g="style",v="float",_="cssFloat",b="styleFloat",k="class",w="k-marker",y=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),x="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=x.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(","),D=t(T),F=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),E=function(e){1==e.nodeType&&e.normalize()};m.msie&&m.version>=8&&(E=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,u.remove(t)),t=n}}),n=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,r=/\ufeff/g,o=/^(\s+|\ufeff)$/,s="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,d=/[\u00A0-\u2666<>\&]/g,c={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"},u={block:S,inline:D,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!u.isDataNode(t)&&(e.contains(t,u.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){return!1}},isAncestorOrSelf:function(e,t){return u.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(u.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return u.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n,i=e.cloneNode(!1),r="",o=e.nextSibling;o&&3==o.nodeType&&o.nodeValue;)r+=o.nodeValue,n=o,o=o.nextSibling,u.remove(n);e.deleteData(t,e.length),i.deleteData(0,t),i.nodeValue+=r,u.insertAfter(i,e)},attrEquals:function(e,t){var n,i;for(n in t)if(i=e[n],n==v&&(i=e[h.support.cssFloat?_:b]),"object"==typeof i){if(!u.attrEquals(i,t[n]))return!1}else if(i!=t[n])return!1;return!0},blockParentOrBody:function(e){return u.parentOfType(e,C)||e.ownerDocument.body},blockParents:function(t){var n,i,r,o=[];for(n=0,i=t.length;i>n;n++)r=u.parentOfType(t[n],u.blockElements),r&&e.inArray(r,o)<0&&o.push(r);return o},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:E,blockElements:C,nonListBlockElements:x,inlineElements:T,empty:y,fillAttrs:F,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?d:l;return e.replace(n,function(e){var t=e.charCodeAt(0),n=c[t];return n?"&"+n+";":e})},stripBom:function(e){return(e||"").replace(r,"")},insignificant:function(e){var t=e.attributes;return"k-marker"==e.className||u.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=u.name(e);return"br"==t?!1:u.insignificant(e)?!1:3==e.nodeType&&o.test(e.nodeValue)?!1:1==e.nodeType&&!y[t]&&u.emptyNode(e)?!1:!0})},emptyNode:function(e){return 1==e.nodeType&&!u.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||!u.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=u.lastTextNode(t))return n;return n},is:function(e,t){return u.name(e)==t},isMarker:function(e){return e.className==w},isWhitespace:function(e){return n.test(e.nodeValue)},isBlock:function(e){return S[u.name(e)]},isEmpty:function(e){return y[u.name(e)]},isInline:function(e){return D[u.name(e)]},scrollContainer:function(e){var t=u.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=h.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,i,r=e(u.isDataNode(t)?t.parentNode:t),o=u.windowFromDocument(t.ownerDocument),a=o.innerHeight,s=u.scrollContainer(t.ownerDocument);n=r.offset().top,i=r[0].offsetHeight,i||(i=parseInt(r.css("line-height"),10)||Math.ceil(1.2*parseInt(r.css("font-size"),10))||15),i+n>s.scrollTop+a&&(s.scrollTop=i+n-a)},persistScrollTop:function(e){a=u.scrollContainer(e).scrollTop},restoreScrollTop:function(e){u.scrollContainer(e).scrollTop=a},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],u.isDataNode(n)?(u.stripBom(n.nodeValue).length||u.remove(n),u.isWhitespace(n)&&u.insertBefore(n,e)):n.className!=w&&(u.trim(n),n.childNodes.length||u.isEmpty(n)||u.remove(n));return e},closest:function(e,t){for(;e&&u.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 u.sibling(e,"nextSibling")},prev:function(e){return u.sibling(e,"previousSibling")},parentOfType:function(e,t){do e=e.parentNode;while(e&&!u.ofType(e,t));return e},ofType:function(t,n){return e.inArray(u.name(t),n)>=0},changeTag:function(e,t,n){var i,r,o,a,s,l=u.create(e.ownerDocument,t),d=e.attributes;if(!n)for(i=0,r=d.length;r>i;i++)s=d[i],s.specified&&(o=s.nodeName,a=s.nodeValue,o==k?l.className=a:o==g?l.style.cssText=e.style.cssText:l.setAttribute(o,a));for(;e.firstChild;)l.appendChild(e.firstChild);return u.insertBefore(l,e),u.remove(e),l},editableParent:function(e){for(;e&&(3==e.nodeType||"true"!==e.contentEditable);)e=e.parentNode;return e},wrap:function(e,t){return u.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 u.attr(e.createElement(t),n)},attr:function(e,t){t=p({},t),t&&g in t&&(u.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=h.support.cssFloat?_:b),e.style[n]="";""===e.style.cssText&&e.removeAttribute(g)},inlineStyle:function(t,n,i){var r,o=e(u.create(t.ownerDocument,n,i));return t.appendChild(o[0]),r=f(s,function(e){return m.msie&&"line-height"==e&&"1px"==o.css(e)?"line-height:1.5":e+":"+o.css(e)}).join(";"),o.remove(),r},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":u.getEffectiveBackground(e.parent())},removeClass:function(t,n){var i,r,o=" "+t.className+" ",a=n.split(" ");for(i=0,r=a.length;r>i;i++)o=o.replace(" "+a[i]+" "," ");o=e.trim(o),o.length?t.className=o:t.removeAttribute(k)},commonAncestor:function(){var e,t,n,i,r,o=arguments.length,a=[],s=1/0,l=null;if(!o)return null;if(1==o)return arguments[0];for(e=0;o>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==o)return a[0][0];for(e=0;s>e;e++){for(i=a[0][e],r=1;o>r;r++)if(i!=a[r][e])return l;l=i}return l},closestSplittableParent:function(t){var n,i,r;return n=1==t.length?u.parentOfType(t[0],["ul","ol"]):u.commonAncestor.apply(null,t),n||(n=u.parentOfType(t[0],["p","td"])||t[0].ownerDocument.body),u.isInline(n)&&(n=u.blockParentOrBody(n)),i=f(t,u.editableParent),r=u.commonAncestor(i)[0],e.contains(n,r)&&(n=r),n},closestEditable:function(t,n){var i,r=u.editableParent(t);return i=u.ofType(t,n)?t:u.parentOfType(t,n),i&&r&&e.contains(i,r)?i=r:!i&&r&&(i=r),i},closestEditableOfType:function(e,t){var n=u.closestEditable(e,t);return n&&u.ofType(n,t)?n:void 0},filter:function(e,t,n){for(var i,r=0,o=t.length,a=[];o>r;r++)i=u.name(t[r]),(!n&&i==e||n&&i!=e)&&a.push(t[r]);return a},ensureTrailingBreaks:function(t){var n=e(t).find("p,td,th"),i=n.length,r=0;if(i)for(;i>r;r++)u.ensureTrailingBreak(n[r]);else u.ensureTrailingBreak(t)},removeTrailingBreak:function(t){e(t).find("br[type=_moz],.k-br").remove()},ensureTrailingBreak:function(e){var t,n,i;u.removeTrailingBreak(e),t=e.lastChild,n=t&&u.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))}},h.ui.editor.Dom=u}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/serializer.min",["editor/dom.min"],e)}(function(){!function(e,t){var n,i,r=window.kendo,o=r.ui.editor,a=o.Dom,s=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),d=/"/g,c=/
]*>/i,u=/^\d+(\.\d*)?(px)?$/i,h=/
<\/p>/i,f=/(\*?[-#\/\*\\\w]+(?:\[[0-9a-z_-]+\])?)\s*:\s*((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/g,p=/^sizzle-\d+/i,m=/^k-script-/i,g=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,v=document.createElement("div");v.innerHTML="
",n=3===v.firstChild.nodeType,v=null,i={toEditableHtml:function(e){var t='
';return e=e||"",e.replace(//g,"").replace(/<(\/?)script([^>]*)>/gi,"<$1k:script$2>").replace(/
]*)>/gi,function(e){return e.replace(g,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/^<(table|blockquote)/i,t+"<$1").replace(/^[\s]*( |\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||a.empty[a.name(t)]||(t.innerHTML=r.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){e(".k-paste-container",t).remove()},_resetOrderedLists:function(e){var t,n,i,r=e.getElementsByTagName("ol");for(t=0;r.length>t;t++)n=r[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,r=this.attributes;for(t=0,n=r.length;n>t;t++)e=r[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 o=r.support.browser,s=o.msie,l=s&&9>o.version,d="originalsrc",c="originalhref";return t=i.toEditableHtml(t),l&&(t="
"+t,t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,c+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,d+'="$1"')),n.innerHTML=t,l?(a.remove(n.firstChild),e(n).find("k\\:script,script,link,img,a").each(function(){var e=this;e[c]&&(e.setAttribute("href",e[c]),e.removeAttribute(c)),e[d]&&(e.setAttribute("src",e[d]),e.removeAttribute(d))})):s&&(a.normalize(n),i._resetOrderedLists(n)),i._preventScriptExecution(n),i._fillEmptyElements(n),i._removeSystemElements(n),e("table",n).addClass("k-table"),n},domToXhtml:function(i,o){function s(t){return e.grep(t,function(e){return"style"!=e.name})}function g(t){var n,i,r,o=e.trim,s=o(t),l=[];for(f.lastIndex=0;;){if(n=f.exec(s),!n)break;i=o(n[1].toLowerCase()),r=o(n[2]),"font-size-adjust"!=i&&"font-stretch"!=i&&(i.indexOf("color")>=0?r=a.toHex(r):i.indexOf("font")>=0?r=r.replace(d,"'"):/\burl\(/g.test(r)&&(r=r.replace(d,"")),l.push({property:i,value:r}))}return l}function v(e){var t,n=g(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,r,s,l,d=[],c=e.attributes;for(n=0,i=c.length;i>n;n++)t=c[n],r=t.nodeName,s=t.value,l=t.specified,"value"==r&&"value"in e&&e.value?l=!0:"type"==r&&"text"==s?l=!0:"class"!=r||s?p.test(r)?l=!1:"complete"==r?l=!1:"altHtml"==r?l=!1:"start"==r&&a.is(e,"ul")?l=!1:"start"==r&&a.is(e,"ol")&&"1"==s?l=!1:r.indexOf("_moz")>=0?l=!1:m.test(r)&&(l=!!o.scripts):l=!1,l&&d.push(t);return d}function b(n,i){var o,s,l,d,c,h,f,p;if(i=i||_(n),a.is(n,"img")&&(h=n.style.width,f=n.style.height,p=e(n),h&&u.test(h)&&(p.attr("width",parseInt(h,10)),a.unstyle(n,{width:t})),f&&u.test(f)&&(p.attr("height",parseInt(f,10)),a.unstyle(n,{height:t}))),i.length)for(i.sort(function(e,t){return e.nodeName>t.nodeName?1:t.nodeName>e.nodeName?-1:0}),o=0,s=i.length;s>o;o++)l=i[o],d=l.nodeName,c=l.value,("class"!=d||"k-table"!=c)&&(d=d.replace(m,""),C.push(" "),C.push(d),C.push('="'),"style"==d?v(c||n.style.cssText):C.push("src"==d||"href"==d?r.htmlEncode(n.getAttribute(d,2)):a.fillAttrs[d]?d:c),C.push('"'))}function k(e,t,n){for(var i=e.firstChild;i;i=i.nextSibling)y(i,t,n)}function w(e){return e.nodeValue.replace(/\ufeff/g,"")}function y(e,i,r){var s,l,d,c,u,h=e.nodeType;if(1==h){if(s=a.name(e),!s||a.insignificant(e))return;if(a.isInline(e)&&1==e.childNodes.length&&3==e.firstChild.nodeType&&!w(e.firstChild))return;if(!o.scripts&&("script"==s||"k:script"==s))return;if(l=S[s],l&&(t===l.semantic||o.semantic^l.semantic))return l.start(e),k(e,!1,l.skipEncoding),l.end(e),t;C.push("<"),C.push(s),b(e),a.empty[s]?C.push(" />"):(C.push(">"),k(e,i||a.is(e,"pre")),C.push(""),C.push(s),C.push(">"))}else 3==h?(c=w(e),!i&&n&&(d=e.parentNode,u=e.previousSibling,u||(u=(a.isInline(d)?d:e).previousSibling),(!u||""===u.innerHTML||a.isBlock(u))&&(c=c.replace(/^[\r\n\v\f\t ]+/,"")),c=c.replace(/ +/," ")),C.push(r?c:a.encode(c,o))):4==h?(C.push("")):8==h&&(e.data.indexOf("[CDATA[")<0?(C.push("")):(C.push("")))}function x(e){var t=e.childNodes.length,n=t&&3==e.firstChild.nodeType;return n&&(1==t||2==t&&a.insignificant(e.lastChild))}var C=[],S={iframe:{start:function(e){C.push("
")}},"k:script":{start:function(e){C.push("")},skipEncoding:!0},span:{semantic:!0,start:function(t){var n,i,r=t.style,o=_(t),d=s(o);d.length&&(C.push("
")),"underline"==r.textDecoration&&C.push(""),n=[],r.color&&n.push('color="'+a.toHex(r.color)+'"'),r.fontFamily&&n.push('face="'+r.fontFamily+'"'),r.fontSize&&(i=e.inArray(r.fontSize,l),n.push('size="'+i+'"')),n.length&&C.push("")},end:function(e){var t=e.style;(t.color||t.fontFamily||t.fontSize)&&C.push(" "),"underline"==t.textDecoration&&C.push(" "),s(_(e)).length&&C.push(" ")}},strong:{semantic:!0,start:function(){C.push("
")},end:function(){C.push(" ")}},em:{semantic:!0,start:function(){C.push("
")},end:function(){C.push(" ")}},b:{semantic:!1,start:function(){C.push("
")},end:function(){C.push(" ")}},i:{semantic:!1,start:function(){C.push("
")},end:function(){C.push(" ")}},u:{semantic:!1,start:function(){C.push('
')},end:function(){C.push(" ")}},font:{semantic:!1,start:function(e){var t,n,i;C.push('
')},end:function(){C.push(" ")}}};return S.script=S["k:script"],o=o||{},t===o.semantic&&(o.semantic=!0),x(i)?a.encode(w(i.firstChild).replace(/[\r\n\v\f\t ]+/," "),o):(k(i),C=C.join(""),""===C.replace(c,"").replace(h,"")?"":C)}},s(o,{Serializer:i})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/range.min",["editor/serializer.min"],e)}(function(){!function(e){function t(e,t,n,i){var r,o,a,s;if(e==t)return i-n;for(r=t;r&&r.parentNode!=e;)r=r.parentNode;if(r)return f(r)-n;for(r=e;r&&r.parentNode!=t;)r=r.parentNode;if(r)return i-f(r)-1;for(o=h.commonAncestor(e,t),a=e;a&&a.parentNode!=o;)a=a.parentNode;for(a||(a=o),s=t;s&&s.parentNode!=o;)s=s.parentNode;return s||(s=o),a==s?0:f(s)-f(a)}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&&!h.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function r(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),h.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function o(e,t,n){var i,r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],a=0,s=p(r),l=s?r:r.childNodes[o]||null,d=s?r.parentNode:r,c=t.ownerDocument,u=c.body.createTextRange();(3==r.nodeType||4==r.nodeType)&&(a=o),d||(d=c.body),"img"==d.nodeName.toLowerCase()?(u.moveToElementText(d),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u)):(i=d.insertBefore(h.create(c,"a"),l),u.moveToElementText(i),h.remove(i),u[n?"moveStart":"moveEnd"]("character",a),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u))}function a(e,t,n,i){var r,o,a,s,l,d,c,u=h.create(t.ownerDocument,"a"),m=e.duplicate(),g=i?"StartToStart":"StartToEnd",v=!1;u.innerHTML="\ufeff",m.collapse(i),o=m.parentElement(),h.isAncestorOrSelf(n,o)||(o=n);do v?o.insertBefore(u,u.previousSibling):(o.appendChild(u),v=!0),m.moveToElementText(u);while((r=m.compareEndPoints(g,e))>0&&u.previousSibling);a=u.nextSibling,-1==r&&p(a)?(m.setEndPoint(i?"EndToStart":"EndToEnd",e),h.remove(u),d=[a,m.text.length]):(s=!i&&u.previousSibling,l=i&&u.nextSibling,p(l)?d=[l,0]:p(s)?d=[s,s.length]:(c=f(u),d=o.nextSibling&&c==o.childNodes.length-1?[o.nextSibling,0]:[o,c]),h.remove(u)),t[i?"setStart":"setEnd"].apply(t,d)}var s=window.kendo,l=s.Class,d=e.extend,c=s.ui.editor,u=s.support.browser,h=c.Dom,f=h.findNodeIndex,p=h.isDataNode,m=h.findClosestAncestor,g=h.getNodeLength,v=h.normalize,_={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new w(e.document)},selectionFromRange:function(e){var t=T.documentFromRange(e);return _.selectionFromDocument(t)},selectionFromDocument:function(e){return _.selectionFromWindow(h.windowFromDocument(e))}},b=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(m(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new k(t))},cloneContents:function(){var e=T.documentFromRange(this);return function t(n){for(var i,r=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),r.appendChild(i);return r}(new k(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(m(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=T.documentFromRange(t),function i(n){for(var r,o=e.createDocumentFragment();r=n.next();)n.hasPartialSubtree()?(r=r.cloneNode(!1),r.appendChild(i(n.getSubtreeIterator()))):n.remove(t.originalRange),o.appendChild(r);return o}(new k(n))},insertNode:function(e){var t=this;p(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&h.splitDataNode(t.startContainer,t.startOffset),h.insertAfter(e,t.startContainer)):h.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new b(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+")"}}),k=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)?m(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||p(t.endContainer)?m(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,r,o,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;p(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,i=n-t,e&&(s||l)&&(a._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=i),a._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=i)),a._current.deleteData(t,i)):(r=a._current.parentNode,!e||a.range.startContainer!=r&&a.range.endContainer!=r||(o=f(a._current),r==e.startContainer&&e.startOffset>=o&&(e.startOffset-=1),r==e.endContainer&&e.endOffset>o&&(e.endOffset-=1)),h.remove(a._current))},hasPartialSubtree:function(){return!p(this._current)&&(h.isAncestorOrSelf(this._current,this.range.startContainer)||h.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),h.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),h.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new k(t)}}),w=l.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();o(t,e,!1),o(t,e,!0),t.select()},removeAllRanges:function(){var e=this.ownerDocument.selection;"None"!=e.type&&e.empty()},getRangeAt:function(){var e,t,n,i,o,s,l,d,c=new b(this.ownerDocument),u=this.ownerDocument.selection;try{if(e=u.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return c}catch(h){return c}if("Control"==u.type)c.selectNode(e.item(0));else if(n=r(e),a(e,c,n,!0),a(e,c,n,!1),9==c.startContainer.nodeType&&c.setStart(c.endContainer,c.startOffset),9==c.endContainer.nodeType&&c.setEnd(c.startContainer,c.endOffset),0===e.compareEndPoints("StartToEnd",e)&&c.collapse(!1),i=c.startContainer,o=c.endContainer,s=this.ownerDocument.body,!(c.collapsed||0!==c.startOffset||c.endOffset!=g(c.endContainer)||i==o&&p(i)&&i.parentNode==s)){for(l=!1,d=!1;0===f(i)&&i==i.parentNode.firstChild&&i!=s;)i=i.parentNode,l=!0;for(;f(o)==g(o.parentNode)-1&&o==o.parentNode.lastChild&&o!=s;)o=o.parentNode,d=!0;i==s&&o==s&&l&&d&&(c.setStart(i,0),c.setEnd(o,g(s)))}return c}}),y=l.extend({init:function(e){this.enumerate=function(){function t(e){if(h.is(e,"img")||3==e.nodeType&&(!h.isWhitespace(e)||"\ufeff"==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new k(e).traverse(t),n}}}),x=l.extend({init:function(e,t){var n=this;n.range=e,n.rootNode=T.documentFromRange(e),n.body=t||n.getEditable(e),"body"!=h.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 r=this.rootNode,o=n.length,a=i;o--;)r=r.childNodes[n[o]];for(;r&&3==r.nodeType&&a>r.nodeValue.length;)a-=r.nodeValue.length,r=r.nextSibling;r&&a>=0&&e[t?"setStart":"setEnd"](r,a)},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=h.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,r,o=this,a=o.caret.previousSibling,s=0;a&&(s=p(a)?a.nodeValue.length:f(a)),t=o.caret.parentNode,n=a?f(a):0,h.remove(o.caret),v(t),i=t.childNodes[n],p(i)?e.setStart(i,s):i?(r=h.lastTextNode(i),r?e.setStart(r,r.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](i)):(u.msie||t.innerHTML||(t.innerHTML='
'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,i,r=this,o=e.collapsed&&!T.isExpandable(e),a=T.documentFromRange(e);return t&&e.collapsed&&(r.addCaret(e),e=T.expand(e)),n=e.cloneRange(),n.collapse(!1),r.end=h.create(a,"span",{className:"k-marker"}),n.insertNode(r.end),n=e.cloneRange(),n.collapse(!0),r.start=r.end.cloneNode(!0),n.insertNode(r.start),r._removeDeadMarkers(r.start,r.end),o&&(i=a.createTextNode("\ufeff"),h.insertAfter(i.cloneNode(),r.start),h.insertBefore(i,r.end)),v(e.commonAncestorContainer),e.setStartBefore(r.start),e.setEndAfter(r.end),e},_removeDeadMarkers:function(e,t){e.previousSibling&&"\ufeff"==e.previousSibling.nodeValue&&h.remove(e.previousSibling),t.nextSibling&&"\ufeff"==t.nextSibling.nodeValue&&h.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,r,o,a,s,l,d,c,u,f=this,m=f.start,g=f.end;for(v(e.commonAncestorContainer);!m.nextSibling&&m.parentNode;)m=m.parentNode;for(;!g.previousSibling&&g.parentNode;)g=g.parentNode;if(t=m.previousSibling&&3==m.previousSibling.nodeType&&m.nextSibling&&3==m.nextSibling.nodeType,n=g.previousSibling&&3==g.previousSibling.nodeType&&g.nextSibling&&3==g.nextSibling.nodeType,i=t&&n,m=m.nextSibling,g=g.previousSibling,r=!1,o=!1,m==f.end&&(o=!!f.start.previousSibling,m=g=f.start.previousSibling||f.end.nextSibling,r=!0),h.remove(f.start),h.remove(f.end),!m||!g)return e.selectNodeContents(e.commonAncestorContainer),void e.collapse(!0);if(a=r?p(m)?m.nodeValue.length:m.childNodes.length:0,s=p(g)?g.nodeValue.length:g.childNodes.length,3==m.nodeType)for(;m.previousSibling&&3==m.previousSibling.nodeType;)m=m.previousSibling,a+=m.nodeValue.length;if(3==g.nodeType)for(;g.previousSibling&&3==g.previousSibling.nodeType;)g=g.previousSibling,s+=g.nodeValue.length;l=m.parentNode,d=g.parentNode,c=this._normalizedIndex(m),u=this._normalizedIndex(g),v(l),3==m.nodeType&&(m=l.childNodes[c]),v(d),3==g.nodeType&&(g=d.childNodes[u]),r?(3==m.nodeType?e.setStart(m,a):e[o?"setStartAfter":"setStartBefore"](m),e.collapse(!0)):(3==m.nodeType?e.setStart(m,a):e.setStartBefore(m),3==g.nodeType?e.setEnd(g,s):e.setEndAfter(g)),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=h.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new y(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return u.msie&&9>u.version?new b(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 s.format("{0}:{1} - {2}:{3}",h.name(e.startContainer),e.startOffset,h.name(e.endContainer),e.endOffset)},split:function(e,t,n){function i(i){var r,o=e.cloneRange();o.collapse(i),o[i?"setStartBefore":"setEndAfter"](t),r=o.extractContents(),n&&(r=h.trim(r)),h[i?"insertBefore":"insertAfter"](r,t)}i(!0),i(!1)},mapAll:function(t,n){var i=[];return new k(t).traverse(function(t){var r=n(t);r&&e.inArray(r,i)<0&&i.push(r)}),i},getAll:function(e,t){var n=t;return"string"==typeof t&&(t=function(e){return h.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,r;if(0!==e.startOffset)return!1;for(n=e.cloneRange();0===n.startOffset&&n.startContainer!=t;){for(i=h.findNodeIndex(n.startContainer),r=n.startContainer.parentNode;i>0&&r[i-1]&&h.insignificant(r[i-1]);)i--;n.setStart(r,i)}return 0===n.startOffset&&n.startContainer==t},isEndOf:function(e,t){function n(e){h.insignificant(e)||r.push(e)}var i,r,o=e.cloneRange();return o.collapse(!1),i=o.startContainer,h.isDataNode(i)&&o.startOffset==h.getNodeLength(i)&&(o.setStart(i.parentNode,h.findNodeIndex(i)+1),o.collapse(!0)),o.setEnd(t,h.getNodeLength(t)),r=[],new k(o).traverse(n),!r.length},wrapSelectedElements:function(e){function t(e,t){var n,i=h.getNodeLength(t);if(e==i)return!0;for(n=e;i>n;n++)if(!h.insignificant(t.childNodes[n]))return!1;return!0}for(var n=h.editableParent(e.startContainer),i=h.editableParent(e.endContainer);0===e.startOffset&&e.startContainer!=n;)e.setStart(e.startContainer.parentNode,h.findNodeIndex(e.startContainer));for(;t(e.endOffset,e.endContainer)&&e.endContainer!=i;)e.setEnd(e.endContainer.parentNode,h.findNodeIndex(e.endContainer)+1);return e},expand:function(e){var t,n,i,r,o=e.cloneRange(),a=o.startContainer.childNodes[0===o.startOffset?0:o.startOffset-1],s=o.endContainer.childNodes[o.endOffset];return p(a)&&p(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(i=t.split("").reverse().join("").search(S),r=n.search(S),i&&r?(r=-1==r?n.length:r,i=-1==i?0:t.length-i,o.setStart(a,i),o.setEnd(s,r),o):o):o):o},isExpandable:function(e){var t,n,i,r,o,a,s=e.startContainer,l=T.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(i=n.substring(0,t.startOffset),r=n.substring(t.startOffset),o=0,a=0,i&&(o=i.split("").reverse().join("").search(S)),r&&(a=r.search(S)),o&&a):!1)}};d(c,{SelectionUtils:_,W3CRange:b,RangeIterator:k,W3CSelection:w,RangeEnumerator:y,RestorePoint:x,Marker:C,RangeUtils:T})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/system.min",["editor/range.min"],e)}(function(){!function(e){function t(e,t){var n=e.selectionRestorePoint=new c(e.getRange()),i=new p(t,n);return i.editor=e,e.undoRedoStack.push(i),n}var n=window.kendo,i=n.Class,r=n.ui.editor,o=r.EditorUtils,a=o.registerTool,s=r.Dom,l=r.Tool,d=r.ToolTemplate,c=r.RestorePoint,u=r.Marker,h=e.extend,f=i.extend({init:function(e){this.options=e,this.restorePoint=new c(e.range),this.marker=new u,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 r=this.editor;return e(t).appendTo(document.body).kendoWindow(h({},r.options.dialogOptions,i)).closest(".k-window").toggleClass("k-rtl",n.support.isRtl(r.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())}}),m=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,r=t.body,o=new c(i,r),a=n.html||n.value||"";t.selectRange(i),t.clipboard.paste(a,n),n.postProcess&&n.postProcess(t,t.getRange()),e=new p(o,new c(t.getRange(),r)),e.editor=t,t.undoRedoStack.push(e),t.focus()}}),g=l.extend({initialize:function(e,t){var n=t.editor,i=this.options,o=i.items?i.items:n.options.insertHtml;this._selectBox=new r.SelectBox(e,{dataSource:o,dataTextField:"text",dataValueField:"value",change:function(){l.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new m(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(e){this.editor=e},keydown:function(n){var i,r=this,o=r.editor,a=o.keyboard,s=a.isTypingKey(n),l=h(e.Event(),n);return r.editor.trigger("keydown",l),l.isDefaultPrevented()?(n.preventDefault(),!0):l.isDefaultPrevented()||!s||a.isTypingInProgress()?!1:(i=o.getRange(),r.startRestorePoint=new c(i),a.startTyping(function(){r.endRestorePoint=t(o,r.startRestorePoint)}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),_=i.extend({init:function(e){this.editor=e},_addCaret:function(e){var t=s.create(this.editor.document,"a");return s.insertAt(e,t,0),t},_restoreCaret:function(e){var t=this.editor.createRange();t.setStartAfter(e),t.collapse(!0),this.editor.selectRange(t),s.remove(e)},_handleDelete:function(e){var t,n,i=e.endContainer,o=s.closestEditableOfType(i,s.blockElements);return o&&r.RangeUtils.isEndOf(e,o)?(t=s.next(o),t&&"p"==s.name(t)?(n=this._addCaret(t),this._merge(o,t),this._restoreCaret(n),!0):!1):!1},_cleanBomBefore:function(e){for(var t=e.startOffset,n=e.startContainer,i=n.nodeValue,r=0;t-r>=0&&"\ufeff"==i[t-r-1];)r++;r>0&&(n.deleteData(t-r,r),e.setStart(n,Math.max(0,t-r)),e.collapse(!0),this.editor.selectRange(e))},_handleBackspace:function(e){var t,n,i,o,a=e.startContainer,l=s.closestEditableOfType(a,["li"]),d=s.closestEditableOfType(a,"p,h1,h2,h3,h4,h5,h6".split(","));return s.isDataNode(a)&&this._cleanBomBefore(e),d&&d.previousSibling&&r.RangeUtils.isStartOf(e,d)?(t=d.previousSibling,n=this._addCaret(d),this._merge(t,d),this._restoreCaret(n),!0):l&&r.RangeUtils.isStartOf(e,l)?(i=l.firstChild,i||(l.innerHTML=r.emptyElementContent,i=l.firstChild),o=new r.ListFormatter(s.name(l.parentNode),"p"),e.selectNodeContents(l),o.toggle(e),s.insignificant(i)?e.setStartBefore(i):e.setStart(i,0),this.editor.selectRange(e),!0):!1},_handleSelection:function(t){var n,i,o,a=t.commonAncestorContainer,l=s.closest(a,"table"),d=r.emptyElementContent;return/t(able|body)/i.test(s.name(a))&&t.selectNode(l),n=new u,n.add(t,!1),t.setStartAfter(n.start),t.setEndBefore(n.end),i=t.startContainer,o=t.endContainer,t.deleteContents(),l&&""===e(l).text()&&(t.selectNode(l),t.deleteContents()),a=t.commonAncestorContainer,"p"===s.name(a)&&""===a.innerHTML&&(a.innerHTML=d,t.setStart(a,0)),this._join(i,o),s.insertAfter(this.editor.document.createTextNode("\ufeff"),n.start),n.remove(t),i=t.startContainer,"tr"==s.name(i)&&(i=i.childNodes[Math.max(0,t.startOffset-1)],t.setStart(i,s.getNodeLength(i))),t.collapse(!0),this.editor.selectRange(t),!0},_root:function(e){for(;e&&e.parentNode&&"body"!=s.name(e.parentNode);)e=e.parentNode;return e},_join:function(e,t){e=this._root(e),t=this._root(t),e!=t&&s.is(t,"p")&&this._merge(e,t)},_merge:function(e,t){for(s.removeTrailingBreak(e);t.firstChild;)1==e.nodeType?e.appendChild(t.firstChild):e.parentNode.appendChild(t.firstChild);s.remove(t)},keydown:function(e){var i,r,o=this.editor.getRange(),a=e.keyCode,s=n.keys,l=a===s.BACKSPACE,d=a==s.DELETE;!l&&!d||o.collapsed?l?i="_handleBackspace":d&&(i="_handleDelete"):i="_handleSelection",i&&(r=new c(o),this[i](o)&&(e.preventDefault(),t(this.editor,r)))},keyup:e.noop}),b=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 c(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}}),k=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,r,o=String.fromCharCode(n.keyCode);for(i in t)if(r=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(r.key==o||r.key==n.keyCode)&&r.ctrl==n.ctrlKey&&r.alt==n.altKey&&r.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")}}),w=i.extend({init:function(e){this.editor=e,this.cleaners=[new x,new C,new S,new T]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=s.create(n,"div"),r=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)r.appendChild(i.firstChild);return r},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 c(e),s.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,r=n._startModification();r&&(e.call(n,i,r.range),setTimeout(function(){t.call(n,i,r.range),n._endModification(r)}))},_removeBomNodes:function(e){var t,n=r.RangeUtils.textNodes(e);for(t=0;n.length>t;t++)n[t].nodeValue=s.stripBom(n[t].nodeValue)},_onBeforeCopy:function(e){var t=new u;t.add(e),this._removeBomNodes(e),t.remove(e),this.editor.selectRange(e)},oncopy:function(){this._onBeforeCopy(this.editor.getRange())},oncut:function(){this._onBeforeCopy(this.editor.getRange()),this._contentModification(e.noop,e.noop)},_fileToDataURL:function(t){var n=e.Deferred(),i=new FileReader;return t instanceof window.File||!t.getAsFile||(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,r,o,a;if("FileReader"in window&&(n=t.clipboardData||t.originalEvent.clipboardData||window.clipboardData||{},i=n.items||n.files,i&&(r=e.grep(i,function(e){return/^image\//i.test(e.type)}),o=e.grep(i,function(e){return/^text\/html/i.test(e.type)}),!o.length&&r.length&&(a=this._startModification()))))return e.when.apply(e,e.map(r,this._fileToDataURL)).done(e.proxy(function(){var t=Array.prototype.slice.call(arguments),n=e.map(t,function(e){return'
'}).join("");this._triggerPaste(n),this._endModification(a)},this)),!0},onpaste:function(t){return this._handleImagePaste(t)?void t.preventDefault():void this._contentModification(function(i,r){var o,a,l,d=s.create(i.document,"div",{className:"k-paste-container",innerHTML:"\ufeff"}),c=n.support.browser;i.body.appendChild(d),c.msie&&11>c.version?(t.preventDefault(),o=i.createRange(),o.selectNodeContents(d),i.selectRange(o),a=i.document.body.createTextRange(),a.moveToElementText(d),e(i.body).unbind("paste"),a.execCommand("Paste"),e(i.body).bind("paste",e.proxy(this.onpaste,this))):(l=i.createRange(),l.selectNodeContents(d),i.selectRange(l)),r.deleteContents()},function(t,n){var i,r="";t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&s.is(e,"br")&&s.remove(e),r+=this.innerHTML}),i.remove(),this._triggerPaste(r,{clean:!0})})},splittableParent:function(e,t){var n,i;if(e)return s.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,s.isInline(n))for(;n.parentNode!=i&&!s.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var i,o,a,l,d,c,f,p,m,g,v,_,b=this.editor;for(n=h({clean:!1,split:!0},n),i=0,o=this.cleaners.length;o>i;i++)this.cleaners[i].applicable(t)&&(t=this.cleaners[i].clean(t));if(n.clean&&(t=t.replace(/(
(\s| )*)+(<\/?(div|p|li|col|t))/gi,"$3"),t=t.replace(/<(a|span)[^>]*><\/\1>/gi,"")),t=t.replace(/^
$/g,"li>"),a=this.isBlock(t),b.focus(),l=b.getRange(),l.deleteContents(),l.startContainer==b.document&&l.selectNodeContents(b.body),d=new u,c=d.addCaret(l),f=this.splittableParent(a,c),p=!1,m=f!=b.body&&!s.is(f,"td"),n.split&&m&&(a||s.isInline(f))&&(l.selectNode(c),r.RangeUtils.split(l,f,!0),p=!0),g=this.htmlToFragment(t),g.firstChild&&"k-paste-container"===g.firstChild.className){for(v=[],i=0,o=g.childNodes.length;o>i;i++)v.push(g.childNodes[i].innerHTML);g=this.htmlToFragment(v.join(" "))}if(e(g.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),l.insertNode(g),f=this.splittableParent(a,c),p){for(;c.parentNode!=f;)s.unwrap(c.parentNode);s.unwrap(c.parentNode)}s.normalize(l.commonAncestorContainer),c.style.display="inline",s.restoreScrollTop(b.document),s.scrollTo(c),d.removeCaret(l),_=l.commonAncestorContainer.parentNode,l.collapsed&&"tbody"==s.name(_)&&(l.setStartAfter(e(_).closest("table")[0]),l.collapse(!0)),b.selectRange(l)}}),y=i.extend({clean:function(e){var t,n,i=this,r=i.replacements;for(t=0,n=r.length;n>t;t+=2)e=e.replace(r[t],r[t+1]);return e}}),x=y.extend({init:function(){this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(e){return/"+o.apply+" "+o.cancel+"
"},_generateFormats:function(){var r,o=this.options;o.currencies||(o.currencies=d.currenciesFrom(e.cultures)),o.numberFormats||(o.numberFormats=[{value:"#.00%",name:"100.00%"},{value:"#%",name:"100%"},{value:"#.00",name:"1024.00"},{value:"#,###.00",name:"1,024.00"}]),o.dateFormats||(r=e.cultures.current.calendars.standard.patterns,o.dateFormats=n("value",i.map(r,function(e){return(e=l.convert.date(e))?{value:e,name:t(34567.7678,e)}:void 0})))},open:function(t){var n,i,r=this.options,o=t.value(),a=r.categories.slice(0);this.viewModel=new l({currencies:r.currencies.slice(0),allFormats:{numberFormats:r.numberFormats.slice(0),dateFormats:r.dateFormats.slice(0)},categories:a,format:t.format(),category:o instanceof Date?a[2]:a[0],apply:this.apply.bind(this),close:this.close.bind(this),value:o}),s.fn.open.call(this),n=this.dialog().element,e.bind(n,this.viewModel),i=n.find("select.k-format-filter").data("kendoDropDownList"),r.currencies.length>10&&i.setOptions({filter:"contains"}),n.find(e.roleSelector("staticlist")).parent().addClass("k-list-wrapper")},apply:function(){var e=this.viewModel.format;s.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"format",value:e}})}}),d.currenciesFrom=function(t){return n("description",i.map(t,function(t,n){var i,r;if(/-/.test(n))return i=t.numberFormat.currency,r=e.format("{0} ({1}, {2})",i.name,i.abbr,i.symbol),{description:r,value:i}}))},e.spreadsheet.dialogs.register("formatCells",d),e.spreadsheet.dialogs.FormatCellsDialog=d,c=s.extend({options:{className:"k-spreadsheet-message",title:"",text:"",template:"
"},open:function(){s.fn.open.call(this),e.bind(this.dialog().element,{text:this.options.text,okText:o.okText,close:this.close.bind(this)})}}),e.spreadsheet.dialogs.register("message",c),u=s.extend({init:function(e){s.fn.init.call(this,e),this._list()},options:{title:o.fontFamilyDialog.title,template:""},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.fonts,i=this.options.defaultFont;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#:data#",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){s.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontFamily",value:e.sender.value()[0]}})}}),e.spreadsheet.dialogs.register("fontFamily",u),h=s.extend({init:function(e){s.fn.init.call(this,e),this._list()},options:{title:o.fontSizeDialog.title,template:""},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.sizes,i=this.options.defaultSize;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#:data#",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(t){s.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontSize",value:e.parseInt(t.sender.value()[0])}})}}),e.spreadsheet.dialogs.register("fontSize",h),f=s.extend({init:function(t){s.fn.init.call(this,t),this.element=this.dialog().element,this._borderPalette(),this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{title:o.bordersDialog.title,width:177,template:"
"+o.apply+" "+o.cancel+"
"},apply:function(){s.fn.apply.call(this);var e=this.value();this.trigger("action",{command:"BorderChangeCommand",options:{border:e.type,style:{size:1,color:e.color}}})},_borderPalette:function(){var t=this.dialog().element.find("div:first");this.borderPalette=new e.spreadsheet.BorderPalette(t,{change:this.value.bind(this)})},value:function(e){return void 0===e?this._state:void(this._state=e)}}),e.spreadsheet.dialogs.register("borders",f),p=s.extend({init:function(t){s.fn.init.call(this,t),this.element=this.dialog().element,this.property=t.property,this.options.title=t.title,this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{template:"
"+o.apply+" "+o.cancel+"
"},apply:function(){s.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:this.property,value:this.value()}})},value:function(e){return void 0===e?this._value:void(this._value=e.value)}}),m=p.extend({init:function(e){e.width=177,p.fn.init.call(this,e),this._colorPalette()},_colorPalette:function(){var e=this.dialog().element.find("div:first");this.colorPalette=e.kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],
change:this.value.bind(this)}).data("kendoColorPalette")}}),e.spreadsheet.dialogs.register("colorPicker",m),g=p.extend({init:function(e){e.width=268,p.fn.init.call(this,e),this.dialog().setOptions({animation:!1}),this.dialog().one("activate",this._colorPicker.bind(this))},_colorPicker:function(){var e=this.dialog().element.find("div:first");this.colorPicker=e.kendoFlatColorPicker({change:this.value.bind(this)}).data("kendoFlatColorPicker")}}),e.spreadsheet.dialogs.register("customColor",g),v=s.extend({init:function(e){s.fn.init.call(this,e),this._list()},options:{title:"Alignment",template:"",buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:o.alignmentDialog.buttons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:o.alignmentDialog.buttons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:o.alignmentDialog.buttons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:o.alignmentDialog.buttons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:o.alignmentDialog.buttons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:o.alignmentDialog.buttons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:o.alignmentDialog.buttons.alignBottom}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:" #=text# ",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];s.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:t.property,value:t.value}})}}),e.spreadsheet.dialogs.register("alignment",v),_=s.extend({init:function(e){s.fn.init.call(this,e),this._list()},options:{title:o.mergeDialog.title,template:"",buttons:[{value:"cells",iconClass:"merge-cells",text:o.mergeDialog.buttons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:o.mergeDialog.buttons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:o.mergeDialog.buttons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:o.mergeDialog.buttons.unmerge}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:" #=text# ",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];s.fn.apply.call(this),this.trigger("action",{command:"MergeCellCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("merge",_),b=s.extend({init:function(e){s.fn.init.call(this,e),this._list()},options:{title:o.freezeDialog.title,template:"",buttons:[{value:"panes",iconClass:"freeze-panes",text:o.freezeDialog.buttons.freezePanes},{value:"rows",iconClass:"freeze-row",text:o.freezeDialog.buttons.freezeRows},{value:"columns",iconClass:"freeze-col",text:o.freezeDialog.buttons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:o.freezeDialog.buttons.unfreeze}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:" #=text# ",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];s.fn.apply.call(this),this.trigger("action",{command:"FreezePanesCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("freeze",b),k=e.spreadsheet.ValidationCellsViewModel=r.extend({init:function(e){r.fn.init.call(this,e),this.bind("change",function(e){"criterion"===e.field&&(this.reset(),("custom"===this.criterion||"list"===this.criterion)&&this.setHintMessageTemplate()),"comparer"===e.field&&this.setHintMessageTemplate(),"hintMessage"!=e.field&&"hintTitle"!=e.field||this._mute||(this.shouldBuild=!1),"from"!=e.field&&"to"!=e.field&&"hintMessageTemplate"!=e.field&&"type"!=e.field||!this.shouldBuild||this.buildMessages()}.bind(this)),this.reset()},buildMessages:function(){this._mute=!0,this.set("hintTitle",this.hintTitleTemplate?e.format(this.hintTitleTemplate,this.type):""),this.set("hintMessage",this.hintMessageTemplate?e.format(this.hintMessageTemplate,this.from,this.to):""),this._mute=!1},reset:function(){this.setComparers(),this.set("comparer",this.comparers[0].type),this.set("from",null),this.set("to",null),this.set("useCustomMessages",!1),this.shouldBuild=!0,this.hintTitleTemplate=this.defaultHintTitle,this.buildMessages()},setComparers:function(){var e,t,n=this.defaultComparers,i=[];if("text"===this.criterion)for(e=["equalTo","notEqualTo"],t=0;n.length>t;t++)e[0]==n[t].type&&(i.push(n[t]),e.shift());else i=n.slice();this.set("comparers",i)},setHintMessageTemplate:function(){"custom"!==this.criterion&&"list"!==this.criterion?this.set("hintMessageTemplate",e.format(this.defaultHintMessage,this.criterion,this.comparerMessages[this.comparer])):(this.set("hintMessageTemplate",""),this.set("hintMessage",""))},isAny:function(){return"any"===this.get("criterion")},isNumber:function(){return"number"===this.get("criterion")},showToForNumber:function(){return this.showTo()&&this.isNumber()},showToForDate:function(){return this.showTo()&&this.isDate()},isText:function(){return"text"===this.get("criterion")},isDate:function(){return"date"===this.get("criterion")},isList:function(){return"list"===this.get("criterion")},isCustom:function(){return"custom"===this.get("criterion")},showRemove:function(){return this.get("hasValidation")},showTo:function(){return"between"==this.get("comparer")||"notBetween"==this.get("comparer")},update:function(e){this.set("hasValidation",!!e),e&&this.fromValidationObject(e)},fromValidationObject:function(e){this.set("criterion",e.dataType),this.set("comparer",e.comparerType),this.set("from",e.from),this.set("to",e.to),this.set("type",e.type),this.set("ignoreBlank",e.allowNulls),e.messageTemplate||e.titleTemplate?(this.hintMessageTemplate=e.messageTemplate,this.hintMessage=e.messageTemplate,this.hintTitleTemplate=e.titleTemplate,this.hintTitle=e.titleTemplate,this.useCustomMessages=!0,this.buildMessages()):this.useCustomMessages=!1},toValidationObject:function(){if("any"===this.criterion)return null;var e={type:this.type,dataType:this.criterion,comparerType:this.comparer,from:this.from,to:this.to,allowNulls:this.ignoreBlank};return this.useCustomMessages&&(e.messageTemplate=this.shouldBuild?this.hintMessageTemplate:this.hintMessage,e.titleTemplate=this.hintTitle),e}}),w=s.extend({init:function(e){s.fn.init.call(this,e)},options:{width:420,title:o.validationDialog.title,criterion:"any",type:"reject",ignoreBlank:!0,hintMessage:o.validationDialog.hintMessage,hintTitle:o.validationDialog.hintTitle,useCustomMessages:!1,criteria:[{type:"any",name:"Any value"},{type:"number",name:"Number"},{type:"text",name:"Text"},{type:"date",name:"Date"},{type:"custom",name:"Custom Formula"},{type:"list",name:"List"}],comparers:[{type:"greaterThan",name:o.validationDialog.comparers.greaterThan},{type:"lessThan",name:o.validationDialog.comparers.lessThan},{type:"between",name:o.validationDialog.comparers.between},{type:"notBetween",name:o.validationDialog.comparers.notBetween},{type:"equalTo",name:o.validationDialog.comparers.equalTo},{type:"notEqualTo",name:o.validationDialog.comparers.notEqualTo},{type:"greaterThanOrEqualTo",name:o.validationDialog.comparers.greaterThanOrEqualTo},{type:"lessThanOrEqualTo",name:o.validationDialog.comparers.lessThanOrEqualTo}],comparerMessages:o.validationDialog.comparerMessages,errorTemplate:'',template:'"},open:function(t){var n,i=this.options;this.viewModel=new k({type:i.type,defaultHintMessage:i.hintMessage,defaultHintTitle:i.hintTitle,defaultComparers:i.comparers.slice(0),comparerMessages:i.comparerMessages,criteria:i.criteria.slice(0),criterion:i.criterion,ignoreBlank:i.ignoreBlank,apply:this.apply.bind(this),close:this.close.bind(this),remove:this.remove.bind(this)}),this.viewModel.update(t.validation()),s.fn.open.call(this),n=this.dialog().element,this.validatable&&this.validatable.destroy(),e.bind(n,this.viewModel),this.validatable=new e.ui.Validator(n.find(".k-edit-form-container"),{validateOnBlur:!1,errorTemplate:this.options.errorTemplate||void 0})},apply:function(){this.validatable.validate()&&(s.fn.apply.call(this),this.trigger("action",{command:"EditValidationCommand",options:{value:this.viewModel.toValidationObject()}}))},remove:function(){this.viewModel.set("criterion","any"),this.apply()}}),e.spreadsheet.dialogs.register("validation",w),e.spreadsheet.dialogs.ValidationDialog=w,y=s.extend({init:function(t){s.fn.init.call(this,t),this.viewModel=e.observable({title:this.options.title,name:this.options.name,extension:this.options.extension,fileFormats:this.options.fileFormats,excel:t.excelExport,pdf:{proxyURL:t.pdfExport.proxyURL,forceProxy:t.pdfExport.forceProxy,title:t.pdfExport.title,author:t.pdfExport.author,subject:t.pdfExport.subject,keywords:t.pdfExport.keywords,creator:t.pdfExport.creator,date:t.pdfExport.date,fitWidth:this.options.pdf.fitWidth,area:this.options.pdf.area,areas:this.options.pdf.areas,paperSize:this.options.pdf.paperSize,paperSizes:this.options.pdf.paperSizes,margin:this.options.pdf.margin,margins:this.options.pdf.margins,landscape:this.options.pdf.landscape,guidelines:this.options.pdf.guidelines,hCenter:this.options.pdf.hCenter,vCenter:this.options.pdf.vCenter},apply:this.apply.bind(this),close:this.close.bind(this)}),this.viewModel.bind("change",function(e){"extension"===e.field&&this.set("showPdfOptions",".pdf"===this.extension?!0:!1)}),e.bind(this.dialog().element,this.viewModel)},options:{title:o.exportAsDialog.title,name:"Workbook",extension:".xlsx",fileFormats:[{description:"Excel Workbook (.xlsx)",extension:".xlsx"},{description:"Portable Document Format(.pdf)",extension:".pdf"}],pdf:{fitWidth:!0,area:"workbook",areas:[{area:"workbook",text:"Entire Workbook"},{area:"sheet",text:"Active Sheet"},{area:"selection",text:"Selection"}],paperSize:"a4",paperSizes:[{value:"a2",text:"A2 (420 mm × 594 mm) "},{value:"a3",text:"A3 (297 mm x 420 mm) "},{value:"a4",text:"A4 (210 mm x 297 mm) "},{value:"a5",text:"A5 (148 mm x 210 mm) "},{value:"b3",text:"B3 (353 mm × 500 mm) "},{value:"b4",text:"B4 (250 mm x 353 mm) "},{value:"b5",text:"B5 (176 mm x 250 mm) "},{value:"folio",text:'Folio (8.5" x 13") '},{value:"legal",text:'Legal (8.5" x 14") '},{value:"letter",text:'Letter (8.5" x 11") '},{value:"tabloid",text:'Tabloid (11" x 17") '},{value:"executive",text:'Executive (7.25" x 10.5")'}],margin:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},margins:[{value:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},text:"Normal"},{value:{bottom:"0.75in",left:"0.25in",right:"0.25in",top:"0.75in"},text:"Narrow"},{value:{bottom:"1in",left:"1in",right:"1in",top:"1in"},text:"Wide"}],landscape:!0,guidelines:!0,hCenter:!0,vCenter:!0},width:520,template:""+o.exportAsDialog.labels.fileName+":
"+o.exportAsDialog.labels.saveAsType+":
"+o.save+" "+o.cancel+"
"},apply:function(){s.fn.apply.call(this),this.trigger("action",{command:"SaveAsCommand",options:this.viewModel})}}),e.spreadsheet.dialogs.register("exportAs",y),x=c.extend({init:function(e){s.fn.init.call(this,e)},options:{template:o.modifyMergedDialog.errorMessage+"
"}}),e.spreadsheet.dialogs.register("modifyMerged",x),C=c.extend({init:function(e){s.fn.init.call(this,e)},options:{title:o.useKeyboardDialog.title,template:o.useKeyboardDialog.errorMessage+"Ctrl+C "+o.useKeyboardDialog.labels.forCopy+"
Ctrl+X "+o.useKeyboardDialog.labels.forCut+"
Ctrl+V "+o.useKeyboardDialog.labels.forPaste+"
"}}),e.spreadsheet.dialogs.register("useKeyboard",C),S=c.extend({init:function(e){s.fn.init.call(this,e)},options:{template:o.unsupportedSelectionDialog.errorMessage+"
"}}),e.spreadsheet.dialogs.register("unsupportedSelection",S))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheetbinder.min",["kendo.core.min","kendo.data.min","spreadsheet/sheet.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&9>e.support.browser.version)){var t=e.Class.extend({init:function(e){this.options=$.extend({},this.options,e),this.columns=this._normalizeColumns(this.options.columns),this._sheet(),this._dataSource(),this._header(),this.dataSource.fetch()},_sheet:function(){this.sheet=this.options.sheet,this._sheetChangeHandler=this._sheetChange.bind(this),this._sheetDeleteRowHandler=this._sheetDeleteRow.bind(this),this._sheetInsertRowHandler=this._sheetInsertRow.bind(this),this.sheet.bind("change",this._sheetChangeHandler).bind("deleteRow",this._sheetDeleteRowHandler).bind("insertRow",this._sheetInsertRowHandler)},_sheetInsertRow:function(e){void 0!==e.index&&this.dataSource.insert(Math.max(e.index-1,0),{})},_sheetDeleteRow:function(e){var t,n;void 0!==e.index&&(t=this.dataSource,n=t.view()[e.index-1],n&&t.remove(n))},_header:function(){this.sheet.batch(function(){this.columns.forEach(function(e,t){this.sheet.range(0,t).value(e.title)}.bind(this))}.bind(this))},_sheetChange:function(e){var t,n,i,r;e.recalc&&e.ref&&(t=this.dataSource,n=t.view(),i=this.columns,!i.length&&n.length&&(i=Object.keys(n[0].toJSON())),this._skipRebind=!0,r=this.sheet.range(e.ref).values(),e.ref.forEach(function(e){var o,a,s,l,d;for(e=e.toRangeRef(),a=0,s=e.topLeft.row;e.bottomRight.row>=s;s++){for(o=n[s-1],o||(o=t.insert(s-1,{}),n=t.view()),l=0,d=e.topLeft.col;e.bottomRight.col>=d&&i.length>d;d++)o.set(i[d].field,r[a][l++]);a++}}),this._skipRebind=!1)},_normalizeColumns:function(e){return e.map(function(e){var t=e.field||e;return{field:t,title:e.title||t}})},_dataSource:function(){var t=this.options,n=t.dataSource;n=Array.isArray(n)?{data:n}:n,this.dataSource&&this._changeHandler?this.dataSource.unbind("change",this._changeHandler):this._changeHandler=this._change.bind(this),this.dataSource=e.data.DataSource.create(n).bind("change",this._changeHandler)},_change:function(){var t,n,i;this._skipRebind||(t=this.dataSource.view(),n=this.columns,!n.length&&t.length&&(this.columns=n=this._normalizeColumns(Object.keys(t[0].toJSON())),this._header()),i=n.map(function(t){return e.getter(t.field)}),this.sheet.batch(function(){var e,n,r;for(e=0,n=t.length;n>e;e++)for(r=0;i.length>r;r++)this.sheet.range(e+1,r).value(i[r](t[e]))}.bind(this)))},destroy:function(){this.dataSource.unbind("change",this._changeHandler),this.sheet.unbind("change",this._sheetChangeHandler).unbind("deleteRow",this._sheetDeleteRowHandler).unbind("insertRow",this._sheetInsertRowHandler)},options:{columns:[]}});e.spreadsheet.SheetDataSourceBinder=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/filtermenu.min",["kendo.core.min","kendo.popup.min","kendo.treeview.min","kendo.numerictextbox.min","kendo.datepicker.min","kendo.datetimepicker.min"],e)}(function(){!function(e){function t(e){var t,n={},i=[];for(t=0;e.length>t;t++)n[e[t].value]?!n[e[t].value].checked&&e[t].checked&&(n[e[t].value].checked=!0):(n[e[t].value]=e[t],i.push(e[t]));return i}function n(t,i){var r,o,a,s,l,d=!1,c=t instanceof e.data.HierarchicalDataSource&&t.data();for(r=0;c.length>r;r++)o=c[r],a=(""+o.text).toLowerCase(),s=i===!0||""===i||a.indexOf(i)>=0,l=n(o.children,s||i),d=d||l||s,o.hidden=!s&&!l,o.checked=!o.hidden;return c&&t.filter({field:"hidden",operator:"neq",value:!0}),d}function i(t){var n,r,o=t instanceof e.data.HierarchicalDataSource&&t.data();for(n=0;o.length>n;n++)r=o[n],r.checked=!1,r.hasChildren&&i(r.children)}function r(e){var t,n,i=d.operators,r=[];for(t in e)if(e.hasOwnProperty(t))for(n in e[t])e[t].hasOwnProperty(n)&&r.push({text:i[t][n],value:n,unique:t+"_"+n,type:t});return r}var o,a,s,l,d,c,u,h,f;e.support.browser.msie&&9>e.support.browser.version||(o=e.jQuery,a=e.ui.Widget,s={details:"k-details",button:"k-button",detailsSummary:"k-details-summary",detailsContent:"k-details-content",icon:"k-icon k-font-icon",iconCollapse:"k-i-collapse-se",iconExpand:"k-i-expand-e",iconSearch:"k-i-search",textbox:"k-textbox",wrapper:"k-spreadsheet-filter-menu",filterByCondition:"k-spreadsheet-condition-filter",filterByValue:"k-spreadsheet-value-filter",valuesTreeViewWrapper:"k-spreadsheet-value-treeview-wrapper",actionButtons:"k-action-buttons"},l=a.extend({init:function(t,n){a.fn.init.call(this,t,n),this.element.addClass(f.classNames.details),this._summary=this.element.find("."+f.classNames.detailsSummary).on("click",this._toggle.bind(this));var i=n.expanded?f.classNames.iconCollapse:f.classNames.iconExpand;this._icon=o(" ",{"class":f.classNames.icon+" "+i}).prependTo(this._summary),this._container=e.wrap(this._summary.next(),!0),n.expanded||this._container.hide()},options:{name:"Details"},events:["toggle"],visible:function(){return this.options.expanded},toggle:function(t){var n=e.fx(this._container).expand("vertical");n.stop()[t?"reverse":"play"](),this._icon.toggleClass(f.classNames.iconExpand,t).toggleClass(f.classNames.iconCollapse,!t),this.options.expanded=!t},_toggle:function(){var e=this.visible();this.toggle(e),this.trigger("toggle",{show:e})}}),d=e.spreadsheet.messages.filterMenu={sortAscending:"Sort range A to Z",sortDescending:"Sort range Z to A",filterByValue:"Filter by value",filterByCondition:"Filter by condition",apply:"Apply",search:"Search",addToCurrent:"Add to current selection",clear:"Clear",blanks:"(Blanks)",operatorNone:"None",and:"AND",or:"OR",operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},e.data.binders.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t,n,i),this._change=o.proxy(this.change,this),o(this.element).on("change",this._change)},refresh:function(){var e=this,t=e.bindings.spreadsheetFilterValue.get();o(e.element).val(t instanceof Date?"":t)},change:function(){var e=this.element.value;this.bindings.spreadsheetFilterValue.set(e)}}),e.data.binders.widget.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=o.proxy(this.change,this),this.widget.first("change",this._change)},refresh:function(){var e=this.bindings.spreadsheetFilterValue,t=e.get(),n=o(this.widget.element).data("filterType");this.widget.value("date"===n&&t instanceof Date||"number"===n&&!isNaN(t)?t:null)},change:function(){var e=this.widget.value(),t=this.bindings.spreadsheetFilterValue;t.set(e)}}),c={filterByValue:"#= messages.filterByValue #
",filterByCondition:"#= messages.filterByCondition #
',menuItem:" #=text#",actionButtons:"
#=messages.apply# #=messages.clear# "},u=e.spreadsheet.FilterMenuViewModel=e.data.ObservableObject.extend({valuesChange:function(t){var n=t?t.sender.dataSource:this.valuesDataSource,i=function(e){return e.checked&&e.value},r=function(t){return"date"===t.dataType?e.spreadsheet.dateToNumber(t.value):t.value},o=function(e,t,n){return n.lastIndexOf(e)===t},a=n.data(),s=a[0].children.data().toJSON(),l=s.filter(function(e){return"blank"===e.dataType});l=l.length?l[0].checked:!1,s=s.filter(i).map(r),this.appendToSearch&&this.valueFilter&&this.valueFilter.values.length&&(s=s.concat(this.valueFilter.values.toJSON()).sort().filter(o)),this.set("valueFilter",{values:s,blanks:l})},valueSelect:function(e){e.preventDefault();var t=e.sender.dataItem(e.node);t.set("checked",!t.checked)},hasActiveSearch:!1,appendToSearch:!1,filterValues:function(e){var t="string"==typeof e?e:o(e.target).val().toLowerCase(),r=this.valuesDataSource;this.set("hasActiveSearch",!!t),i(r),n(r,t)},reset:function(){this.set("customFilter",{logic:"and",criteria:[{operator:null,value:null}]}),this.set("valueFilter",{values:[]})},operatorChange:function(e){var t=e.sender.dataItem();this.set("operatorType",t.type),this.set("customFilter.criteria[0].operator",t.value)},isNone:function(){return void 0===this.get("operatorType")},isString:function(){return"string"===this.get("operatorType")},isNumber:function(){return"number"===this.get("operatorType")},isDate:function(){return"date"===this.get("operatorType")}}),h=e.spreadsheet.FilterMenuController={valuesTree:function(e,t){return[{text:"All",expanded:!0,checked:!0,items:this.values(e.resize({top:1}),t)}]},values:function(n,i){var r=[],o=d,a=n.column(i),s=n.sheet();
return a.forEachCell(function(t,n,i){i.dataType=void 0===i.value?"blank":i.format?e.spreadsheet.formatting.type(i.value,i.format):typeof i.value,i.text=null!==i.value&&i.format?e.spreadsheet.formatting.text(i.value,i.format):i.value?i.value:o.blanks,"percent"===i.dataType&&(i.dataType="number"),"date"===i.dataType&&(i.value=e.spreadsheet.numberToDate(i.value)),i.hasOwnProperty("wrap")&&delete i.wrap,i.checked=!s.isHiddenRow(t),r.push(i)}),r=t(r),r.sort(function(e,t){return e.dataType===t.dataType?0:"blank"===e.dataType||"blank"===t.dataType?"blank"===e.dataType?-1:1:"number"===e.dataType||"number"===t.dataType?"number"===e.dataType?-1:1:"date"===e.dataType||"date"===t.dataType?"date"===e.dataType?-1:1:0}),r},filterType:function(e,t){var n,i,r,o=e.sheet(),a=this.filterForColumn(t,o);return a=a&&a.filter.toJSON(),a&&"custom"==a.filter&&(i=a.criteria[0].value,i instanceof Date?n="date":"string"==typeof i?n="string":"number"==typeof i&&(n="number")),n||(r=this.values(e.row(1),t)[0],n=r&&r.dataType,"blank"==n&&(n=null)),n},filterForColumn:function(e,t){var n,i=t.filter();return i&&(n=i.columns.filter(function(t){return t.index===e})[0]),n},filter:function(e,t){var n,i,r,o,a=this.filterForColumn(e,t);if(a)return n=a.filter.toJSON(),i=n.filter,delete n.filter,r={type:i,options:n},o=n.criteria,o&&o.length&&(r.operator=o[0].operator),r}},f=a.extend({init:function(e,t){a.call(this,e,t),this.element.addClass(f.classNames.wrapper),this.viewModel=new u({active:"value",operator:null,operators:r(this.options.operators),clear:this.clear.bind(this),apply:this.apply.bind(this)}),this._filterInit(),this._popup(),this._sort(),this._filterByCondition(),this._filterByValue(),this._actionButtons()},options:{name:"FilterMenu",column:0,range:null,operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},events:["action"],destroy:function(){a.fn.destroy.call(this),this.menu.destroy(),this.valuesTreeView.destroy(),this.popup.destroy()},openFor:function(e){this.popup.setOptions({anchor:e}),this.popup.open()},close:function(){this.popup.close()},clear:function(){this.action({command:"ClearFilterCommand",options:{column:this.options.column}}),this.viewModel.reset(),this.close()},apply:function(){var e,t,n;this._active(),e={operatingRange:this.options.range,column:this.options.column},"value"===this.viewModel.active?(this.viewModel.valuesChange({sender:this.valuesTreeView}),t=this.viewModel.valueFilter.toJSON(),t.values&&t.values.length&&(e.valueFilter=t)):"custom"===this.viewModel.active&&(n=this.viewModel.customFilter.toJSON(),n.criteria.length&&null!==n.criteria[0].value&&(e.customFilter=n)),(e.valueFilter||e.customFilter)&&this.action({command:"ApplyFilterCommand",options:e})},action:function(e){this.trigger("action",o.extend({},e))},_filterInit:function(){var e,t=this.options.column,n=this.options.range,i=n.sheet(),r=h.filter(t,i);r?(e=h.filterType(n,t),this.viewModel.set("active",r.type),this.viewModel.set(r.type+"Filter",r.options),"custom"==r.type&&(this.viewModel.set("operator",e+"_"+r.operator),this.viewModel.set("operatorType",e))):this.viewModel.reset()},_popup:function(){this.popup=this.element.kendoPopup({copyAnchorStyles:!1}).data("kendoPopup")},_sort:function(){var t=e.template(f.templates.menuItem),n=d,i=[{command:"sort",dir:"asc",text:n.sortAscending,iconClass:"sort-asc"},{command:"sort",dir:"desc",text:n.sortDescending,iconClass:"sort-desc"}],r=o("
",{html:e.render(t,i)}).appendTo(this.element);this.menu=r.kendoMenu({orientation:"vertical",select:function(e){var t=o(e.item).data("dir"),n=this.options.range.resize({top:1}),i={value:t,sheet:!1,operatingRange:n,column:this.options.column};n.isSortable()?this.action({command:"SortCommand",options:i}):this.close()}.bind(this)}).data("kendoMenu")},_appendTemplate:function(t,n,i,r){var a=e.template(t),s=o("
").html(a({messages:d,guid:e.guid(),ns:e.ns}));return this.element.append(s),i&&(i=new l(s,{expanded:r,toggle:this._detailToggle.bind(this)})),e.bind(s,this.viewModel),s},_detailToggle:function(e){this.element.find("[data-role=details]").not(e.sender.element).data("kendoDetails").toggle(!e.show)},_filterByCondition:function(){var e="custom"===this.viewModel.active;this._appendTemplate(f.templates.filterByCondition,f.classNames.filterByCondition,!0,e)},_filterByValue:function(){var t,n="value"===this.viewModel.active,i=this._appendTemplate(f.templates.filterByValue,f.classNames.filterByValue,!0,n);this.valuesTreeView=i.find("[data-role=treeview]").data("kendoTreeView"),t=h.valuesTree(this.options.range,this.options.column),this.viewModel.set("valuesDataSource",new e.data.HierarchicalDataSource({data:t}))},_actionButtons:function(){this._appendTemplate(f.templates.actionButtons,f.classNames.actionButtons,!1)},_active:function(){var e=this.element.find("[data-role=details]").filter(function(e,t){return o(t).data("kendoDetails").visible()});e.hasClass(f.classNames.filterByValue)?this.viewModel.set("active","value"):e.hasClass(f.classNames.filterByCondition)&&this.viewModel.set("active","custom")}}),e.spreadsheet.FilterMenu=f,o.extend(!0,f,{classNames:s,templates:c}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/editor.min",["kendo.core.min"],e)}(function(){!function(e){function t(e,t){return e&&(e.top!==t.top||e.left!==t.left)}if(!(e.support.browser.msie&&9>e.support.browser.version)){var n=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this),this.view=t,this.formulaBar=t.formulaBar,this.barInput=t.formulaBar.formulaInput,this.cellInput=t.formulaInput,this.barInput.syncWith(this.cellInput),this.cellInput.syncWith(this.barInput),this.barInput.bind("keyup",this._triggerUpdate.bind(this)),this.cellInput.bind("keyup",this._triggerUpdate.bind(this)),this.barInput.bind("focus",this._focus.bind(this)),this.cellInput.bind("focus",this._focus.bind(this))},events:["activate","deactivate","change","update"],_focus:function(e){this.lastActive=e.sender==this.barInput?"bar":"cell"},_triggerUpdate:function(){this.trigger("update",{value:this.value()})},activeEditor:function(){var t=null,n=e._activeElement();return this.barElement()[0]===n?t=this.barInput:this.cellElement()[0]===n&&(t=this.cellInput),t},activate:function(e){return this._active=!0,this._rect=e.rect,this.cellInput.position(e.rect),this.cellInput.resize(e.rect),this.cellInput.tooltip(e.tooltip),this.cellInput.activeCell=this.barInput.activeCell=e.range.topLeft,this.trigger("activate"),this},deactivate:function(){var e=this.cellInput;this._active&&(e.value()!=this._value&&this.trigger("change",{value:e.value()})||(this._active=!1,this._rect=null,e.hide(),this.trigger("deactivate")))},enable:function(e){this.barInput.enable(e)},barElement:function(){return this.barInput.element},cellElement:function(){return this.cellInput.element},focusLastActive:function(){this.focus(this.lastActive)},focus:function(e){e=e||"cell","cell"===e?(this.cellInput.element.focus(),this.cellInput.end()):this.barInput.element.focus()},isActive:function(){return this._active},isFiltered:function(){return this.barInput.popup.visible()||this.cellInput.popup.visible()},canInsertRef:function(e){var t=this.activeEditor();return t&&t.canInsertRef(e)},highlightedRefs:function(){var e=this.activeEditor(),t=[];return e&&(t=e.highlightedRefs()),t},scale:function(){this.cellInput.scale()},toggleTooltip:function(e){this.cellInput.toggleTooltip(t(this._rect,e))},value:function(e){return void 0===e?this.barInput.value():(null===e&&(e=""),this._value=e,this.barInput.value(e),void this.cellInput.value(e))}});e.spreadsheet.SheetEditor=n}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/autofill.min",["spreadsheet/runtime.min","spreadsheet/range.min"],e)}(function(){"use strict";function e(e){var t,n,i,r,o,a=e.length,s=(a+1)/2,l=e.reduce(function(e,t){return e+t},0)/a,d=0,c=0;for(t=0;a>t;t++)n=t+1-s,i=e[t]-l,d+=n*i,c+=n*n;return c?(r=d/c,o=l-r*s,function(e){return o+r*(e+1)}):function(t){return e[t%e.length]}}function t(t){function o(e){var t,n=e[1]-e[0];for(t=2;e.length>t;++t)if(e[t]-e[t-1]!=n)return null;return n}function a(e){return e.map(function(e){return e.number})}var s=[],l=t.map(function(e){return e.formula||e.value});return r(l,function(i,r,d,c){var u,h,f,p,m;for("number"==d?(h=a(c),1==h.length&&(i>0||l.length>r||"date"==n(h[0],t[i].format))&&h.push(h[0]+1),u=e(h)):"string"==d||"formula"==d||"boolean"==d?u=function(e,t){return l[t]}:Array.isArray(d)?1==c.length?u=function(e){return d[(c[0].number+e)%d.length]}:(f=o(a(c)),u=null==f?function(e){return c[e%c.length].value}:function(e){var t=c[0].number+f*e;return d[t%d.length]}):"null"!=d?(h=a(c),1==h.length&&h.push(h[0]+1),h=e(h),u=function(e,t){return l[t].replace(/^(.*\D)\d+/,"$1"+h(e,t))}):u=function(){return null},p={f:u,begin:i,end:r,len:r-i},m=i;r>m;++m)s[m]=p}),function(e,n){var r=s[n],o=e/l.length|0,a=e%l.length,d=o*r.len+a-r.begin,c=r.f(d,n),u=i(t[n]);return c instanceof h?u.formula=c:u.value=c,u}}function n(e,t){return null!=t?d.formatting.type(e,t):void 0}function i(e){var t={};return Object.keys(e||{}).forEach(function(n){t[n]=e[n]}),t}function r(e,t){var n,i,r=null,a=0,s=[];for(i=0;e.length>i;++i)n=o(e[i]),s.push(n),null!=r&&n.type!==r.type&&(t(a,i,r.type,s.slice(a,i)),a=i),r=n;t(a,i,r.type,s.slice(a,i))}function o(e){var t,n;if("number"==typeof e)return{type:"number",number:e};if("string"==typeof e)return(t=s(e))?t:(n=/^(.*\D)(\d+)/.exec(e),n?(e=e.replace(/^(.*\D)\d+/,"$1-######"),{type:e,match:n,number:parseFloat(n[2])}):{type:"string"});if("boolean"==typeof e)return{type:"boolean"};if(null==e)return{type:"null"};if(e instanceof h)return{type:"formula"};throw window.console.error(e),Error("Cannot fill data")}function a(){var e=kendo.culture();return[e.calendars.standard.days.namesAbbr,e.calendars.standard.days.names,e.calendars.standard.months.namesAbbr,e.calendars.standard.months.names]}function s(e){var t,n,i,r,o=e.toLowerCase(),s=a();for(t=0;s.length>t;++t)for(n=s[t],i=n.length;--i>=0;)if(r=n[i].toLowerCase(),r==o)return{type:n,number:i,value:e}}function l(e){var t,n,i=e.length,r=e[0].length,o=[];for(t=0;r>t;++t)for(o[t]=[],n=0;i>n;++n)o[t][n]=e[n][t];return o}var d,c,u,h,f,p;kendo.support.browser.msie&&kendo.support.browser.version<9||(d=kendo.spreadsheet,c=d.Range,u=d.calc.runtime,h=u.Formula,f="Incompatible ranges in fillFrom",p="Cannot determine fill direction",c.prototype._previewFillFrom=function(e,n){var i,r,o,a,s,d,c,u,h,m,g,v,_,b,k=this,w=k._sheet;if("string"==typeof e&&(e=w.range(e)),i=e._ref.toRangeRef(),r=k._ref.toRangeRef(),i.intersects(r)){if(i.eq(r))return null;if(r=r.clone(),i.topLeft.eq(r.topLeft))if(i.width()==r.width())r.topLeft.row+=i.height(),n=0;else{if(i.height()!=r.height())throw Error(f);r.topLeft.col+=i.width(),n=1}else{if(!i.bottomRight.eq(r.bottomRight))throw Error(f);if(i.width()==r.width())r.bottomRight.row-=i.height(),n=2;else{if(i.height()!=r.height())throw Error(f);r.bottomRight.col-=i.width(),n=3}}return w.range(r)._previewFillFrom(e,n)}if(null==n)if(i.topLeft.col==r.topLeft.col)n=r.topLeft.row>i.topLeft.row?0:2;else{if(i.topLeft.row!=r.topLeft.row)throw Error(p);n=r.topLeft.col>i.topLeft.col?1:3}if(o=1&n,a=2&n,o&&i.height()!=r.height()||!o&&i.width()!=r.width())throw Error(f);for(s=e._properties(),o?d=r.width():(s=l(s),d=r.height()),c=Array(s.length),u=0;s.length>u;++u)for(h=s[u],m=t(h),g=c[u]=Array(d),v=0;d>v;++v)_=a?-v-1:h.length+v,b=a?h.length-v%h.length-1:v%h.length,g[a?d-v-1:v]=m(_,b);return o||(c=l(c)),{props:c,direction:n,dest:k}},c.prototype.fillFrom=function(e,t){var n=this._previewFillFrom(e,t);return n.dest._properties(n.props),n.dest})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/print.min",["kendo.pdf.min","spreadsheet/sheet.min","spreadsheet/range.min","spreadsheet/references.min","spreadsheet/numformat.min","util/text-metrics"],e)}(function(){"use strict";function e(e,t){var n=0,i=[],r=.2*t,o=t;return e.forEach(function(e){t&&n+e>o&&(r>o-n&&(n=t*Math.ceil(n/t)),o+=t*Math.ceil(e/t)),i.push(n),n+=e}),i.push(n),i}function t(e,t){var n=e._grid,i={},r={};return e.forEachMergedCell(t,function(e){var o=e.topLeft;n.forEach(e,function(n){o.eq(n)?i[n.print()]=e:t.contains(n)&&(r[n.print()]=o)})}),{primary:i,secondary:r}}function n(n,s,l){var d,c,u,h,f,m,g,v,_=[],b=[],k=[],w=t(n,s),y=-1,x=-1;return n.forEach(s,function(e,t,i){var r,a,d,c=e-s.topLeft.row,u=t-s.topLeft.col;u||b.push(n.rowHeight(e)),c||k.push(n.columnWidth(t)),n.isHiddenColumn(t)||n.isHiddenRow(e)||(r=l.forScreen||o(i),(l.emptyCells||r)&&(a=new p(e,t).print(),w.secondary[a]||(r?(y=Math.max(y,c),x=Math.max(x,u)):i.empty=!0,d=w.primary[a],d?(delete w.primary[a],i.merged=!0,i.rowspan=d.height(),i.colspan=d.width(),l.forScreen&&(i.width=n._columns.sum(d.topLeft.col,d.bottomRight.col),i.height=n._rows.sum(d.topLeft.row,d.bottomRight.row))):(i.rowspan=1,i.colspan=1),i.row=c,i.col=u,_.push(i))))}),b=b.slice(0,y+1),k=k.slice(0,x+1),d=l.pageWidth,c=l.pageHeight,u=1,l.fitWidth&&(h=k.reduce(i,0),h>d&&(u=d/h,d/=u,c/=u)),f=e(b,c||0),m=e(k,d||0),g=0,v=0,_=_.filter(function(e){return e.empty&&(e.row>y||e.col>x)?!1:(e.left=m[e.col],e.top=f[e.row],e.merged?l.forScreen?(e.right=e.left+e.width,e.bottom=e.top+e.height):(e.right=r(m,e.col+e.colspan),e.bottom=r(f,e.row+e.rowspan),e.width=e.right-e.left,e.height=e.bottom-e.top):(e.width=k[e.col],e.height=b[e.row],e.bottom=e.top+e.height,e.right=e.left+e.width),g=Math.max(g,e.right),v=Math.max(v,e.bottom),!0)}),Object.keys(w.primary).forEach(function(e){var t=w.primary[e];n.forEach(t.topLeft.toRangeRef(),function(e,i,r){var o=e-s.topLeft.row,a=i-s.topLeft.col;r.merged=!0,r.colspan=t.height(),r.rowspan=t.width(),r.top=0>o?-n._rows.sum(e,e-o-1):f[o],r.left=0>a?-n._columns.sum(i,i-a-1):m[a],r.height=n._rows.sum(t.topLeft.row,t.bottomRight.row),r.width=n._columns.sum(t.topLeft.col,t.bottomRight.col),r.right=r.left+r.width,r.bottom=r.top+r.height,_.push(r)})}),{width:g,height:v,cells:_.sort(a),scale:u,xCoords:m,yCoords:f}}function i(e,t){return e+t}function r(e,t){return e.length>t?e[t]:e[e.length-1]}function o(e){return null!=e.value||e.merged||null!=e.background||null!=e.borderTop||null!=e.borderRight||null!=e.borderBottom||null!=e.borderLeft}function a(e,t){return t.top>e.top?-1:e.top==t.top?t.left>e.left?-1:e.left==t.left?0:1:1}function s(e,t,n){function i(i,r){var o,a,s,u,h,f=r*d,p=f+d,g=i*c,b=g+c,k=0,w=0,y=e.cells.filter(function(e){return f>=e.right||e.left>=p||g>=e.bottom||e.top>=b?!1:(k=Math.max(e.bottom,k),w=Math.max(e.right,w),!0)});y.length>0&&(o=new m.Group,t.append(o),o.clip(m.Path.fromRect(new v.Rect([0,0],[n.pageWidth,n.pageHeight]))),a=new m.Group,o.append(a),s=v.Matrix.scale(e.scale,e.scale).multiplyCopy(v.Matrix.translate(-f,-g)),(n.hCenter||n.vCenter)&&(s=s.multiplyCopy(v.Matrix.translate(n.hCenter?(p-w)/2:0,n.vCenter?(b-k)/2:0))),a.transform(s),n.guidelines&&(u=null,e.xCoords.forEach(function(e){e=Math.min(e,w),e!==u&&e>=f&&p>=e&&(u=e,a.append((new m.Path).moveTo(e,g).lineTo(e,k).close().stroke("#999",_)))}),u=null,e.yCoords.forEach(function(e){e=Math.min(e,k),e!==u&&e>=g&&b>=e&&(u=e,a.append((new m.Path).moveTo(f,e).lineTo(w,e).close().stroke("#999",_)))})),h=new m.Group,y.forEach(function(e){l(e,a,h,n)}),a.append(h))}var r,o,a=Math.ceil(e.width/n.pageWidth),s=Math.ceil(e.height/n.pageHeight),d=n.pageWidth/e.scale,c=n.pageHeight/e.scale;for(r=0;a>r;++r)for(o=0;s>o;++o)i(o,r)}function l(e,t,n,i){var r,o,a,s,l,c,u=new m.Group;if(t.append(u),r=new v.Rect([e.left,e.top],[e.width,e.height]),(e.background||e.merged)&&(o=r,i.guidelines&&(o=r.clone(),o.origin.x+=_/2,o.origin.y+=_/2,o.size.width-=_,o.size.height-=_),u.append(new m.Rect(o).fill(e.background||"#fff").stroke(null))),e.borderLeft&&n.append((new m.Path).moveTo(e.left,e.top).lineTo(e.left,e.bottom).close().stroke(e.borderLeft.color,e.borderLeft.size)),e.borderTop&&n.append((new m.Path).moveTo(e.left,e.top).lineTo(e.right,e.top).close().stroke(e.borderTop.color,e.borderTop.size)),e.borderRight&&n.append((new m.Path).moveTo(e.right,e.top).lineTo(e.right,e.bottom).close().stroke(e.borderRight.color,e.borderRight.size)),e.borderBottom&&n.append((new m.Path).moveTo(e.left,e.bottom).lineTo(e.right,e.bottom).close().stroke(e.borderBottom.color,e.borderBottom.size)),a=e.value,null!=a){if(s="number"==typeof a?"number":null,l=new m.Group,l.clip(m.Path.fromRect(r)),u.append(l),e.format?(c=g.textAndColor(a,e.format),a=c.text,c.type&&(s=c.type)):a+="",!e.textAlign)switch(s){case"number":case"date":case"percent":e.textAlign="right";break;case"boolean":e.textAlign="center"}d(a,c&&c.color||e.color||"#000",e,l)}}function d(e,t,n,i){var r,o,a,s,l=n.left+2,d=n.top+2,h=n.width-4,f=n.height-4,p=u(n),g={font:p},_={font:p,fill:{color:t}},b=[],k=0,w=d;switch(n.wrap?(c(e,g,h).forEach(function(e){var t=new m.Text(e.text,[l,w],_);w+=e.box.height,b.push({el:t,box:e.box})}),k=w-d):(r=new m.Text(e,[l,w],_),o=kendo.util.measureText(e,g),b.push({el:r,box:o}),k=o.height),a=new m.Group,i.append(a),s=0,n.verticalAlign){case"center":s=f-k>>1;break;case void 0:case null:case"bottom":s=f-k}0>s&&(s=0),b.forEach(function(e){a.append(e.el);var t=0;switch(n.textAlign){case"center":t=h-e.box.width>>1;break;case"right":t=h-e.box.width}0>t&&(t=0),(t||s)&&e.el.transform(v.Matrix.translate(t,s))})}function c(e,t,n){function i(o,s,l){var d=e.substring(a,s).trim(),c=kendo.util.measureText(d,t);n>=c.width?l-1>s?i(s,s+l>>1,l):(r.push({text:d,box:c}),a=s):s>o&&i(o,o+s>>1,s)}for(var r=[],o=e.length,a=0;o>a;)i(a,o,o);return r}function u(e){var t=[];return e.italic&&t.push("italic"),e.bold&&t.push("bold"),t.push((e.fontSize||12)+"px"),t.push(e.fontFamily||"Arial"),t.join(" ")}function h(e,t,i,r){var o,a,l,d,c;null==i&&null==r&&(r=t,i={},t=f.SHEETREF),null==r&&(r=i,t instanceof f.Range||t instanceof f.Ref||"string"==typeof t?i={}:(i=t,t=f.SHEETREF)),i=kendo.jQuery.extend({paperSize:"A4",landscape:!0,margin:"1cm",guidelines:!0,emptyCells:!0,fitWidth:!1,center:!1},i),o=new m.Group,a=kendo.pdf.getPaperOptions(i),o.options.set("pdf",{author:i.author,creator:i.creator,date:i.date,keywords:i.keywords,margin:a.margin,multiPage:!0,paperSize:a.paperSize,subject:i.subject,title:i.title}),l=a.paperSize[0],d=a.paperSize[1],a.margin&&(l-=a.margin.left+a.margin.right,d-=a.margin.top+a.margin.bottom),i.pageWidth=l,i.pageHeight=d,c=n(e,e._ref(t),i),s(c,o,i),r(o)}var f,p,m,g,v,_;kendo.support.browser.msie&&kendo.support.browser.version<9||(f=kendo.spreadsheet,p=f.CellRef,m=kendo.drawing,g=f.formatting,v=kendo.geometry,_=.8,f.Sheet.prototype.draw=function(e,t,n){var i=this;i._workbook?i.recalc(i._workbook._context,function(){h(i,e,t,n)}):h(i,e,t,n)},f.draw={doLayout:n,drawLayout:s,shouldDrawCell:o})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.spreadsheet.min",["util/undoredostack.min","util/text-metrics","util/parse-xml","kendo.excel.min","kendo.progressbar.min","kendo.pdf.min","spreadsheet/commands.min","spreadsheet/formulabar.min","spreadsheet/formulainput.min","spreadsheet/eventlistener.min","spreadsheet/rangelist.min","spreadsheet/propertybag.min","spreadsheet/references.min","spreadsheet/navigator.min","spreadsheet/axismanager.min","spreadsheet/clipboard.min","spreadsheet/range.min","spreadsheet/sheet.min","spreadsheet/sheetsbar.min","spreadsheet/excel-reader","spreadsheet/workbook.min","spreadsheet/formulacontext.min","spreadsheet/controller.min","spreadsheet/view.min","spreadsheet/grid.min","spreadsheet/axis.min","spreadsheet/filter.min","spreadsheet/sorter.min","spreadsheet/runtime.min","spreadsheet/calc.min","spreadsheet/numformat.min","spreadsheet/runtime.functions.min","spreadsheet/runtime.functions.2.min","spreadsheet/toolbar.min","spreadsheet/dialogs.min","spreadsheet/sheetbinder.min","spreadsheet/filtermenu.min","spreadsheet/editor.min","spreadsheet/autofill.min","spreadsheet/print.min"],e)}(function(){!function(e,t){var n,i,r,o,a,s,l,d,c;e.support.browser.msie&&9>e.support.browser.version||(n=e.jQuery,i=e.ui.Widget,r=e.spreadsheet.Workbook,o=e.spreadsheet.Controller,a=e.spreadsheet.View,s=".kendoSpreadsheet",l={recalc:!0,selection:!0,activeCell:!0,layout:!0,sheetSelection:!0,resize:!0,editorChange:!1,editorClose:!1},d={wrapper:"k-widget k-spreadsheet"},c=e.ui.Widget.extend({init:function(e,t){i.fn.init.call(this,e,t),this.element.addClass(c.classNames.wrapper),this._view=new a(this.element,{toolbar:this.options.toolbar,sheetsbar:this.options.sheetsbar}),this._workbook=new r(this.options,this._view),this._controller=new o(this._view,this._workbook),this._autoRefresh=!0,this._bindWorkbookEvents(),this._view.workbook(this._workbook),this.refresh(),this._resizeHandler=function(){this.resize()}.bind(this),n(window).on("resize"+s,this._resizeHandler)},_resize:function(){this.refresh({layout:!0})},_workbookChange:function(e){this._autoRefresh&&this.refresh(e)},activeSheet:function(e){return this._workbook.activeSheet(e)},moveSheetToIndex:function(e,t){return this._workbook.moveSheetToIndex(e,t)},insertSheet:function(e){return this._workbook.insertSheet(e)},sheets:function(){return this._workbook.sheets()},removeSheet:function(e){return this._workbook.removeSheet(e)},sheetByName:function(e){return this._workbook.sheetByName(e)},sheetIndex:function(e){return this._workbook.sheetIndex(e)},sheetByIndex:function(e){return this._workbook.sheetByIndex(e)},renameSheet:function(e,t){return this._workbook.renameSheet(e,t)},refresh:function(e){return e||(e=l),e.editorClose||(this._view.sheet(this._workbook.activeSheet()),this._controller.sheet(this._workbook.activeSheet()),this._workbook.refresh(e)),e.editorChange||(this._view.refresh(e),this._controller.refresh(),this._view.render(),this.trigger("render")),this},openDialog:function(e,t){return this._view.openDialog(e,t)},autoRefresh:function(e){return e!==t?(this._autoRefresh=e,e===!0&&this.refresh(),this):this._autoRefresh},toJSON:function(){return this._workbook.toJSON()},fromJSON:function(e){e.sheets?(this._workbook.destroy(),this._workbook=new r(n.extend({},this.options,e)),this._bindWorkbookEvents(),this._view.workbook(this._workbook),this._controller.workbook(this._workbook),this.activeSheet(this.activeSheet())):this.refresh()},fromFile:function(e,t){return this._workbook.fromFile(e,t)},saveAsPDF:function(e){this._workbook.saveAsPDF(n.extend({},this.options.pdf,e,{workbook:this._workbook}))},saveAsExcel:function(e){this._workbook.saveAsExcel(e)},draw:function(e,t){this._workbook.draw(e,t)},_workbookExcelExport:function(e){this.trigger("excelExport",e)&&e.preventDefault()},_workbookExcelImport:function(e){this.trigger("excelImport",e)?e.preventDefault():this._initProgress(e.promise)},_initProgress:function(t){var i=n("
").appendTo(this.element),r=n("
").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar");t.progress(function(e){r.value(e.progress)}).always(function(){e.destroy(i),i.remove()})},_workbookPdfExport:function(e){this.trigger("pdfExport",e)&&e.preventDefault()},_bindWorkbookEvents:function(){this._workbook.bind("change",this._workbookChange.bind(this)),this._workbook.bind("excelExport",this._workbookExcelExport.bind(this)),this._workbook.bind("excelImport",this._workbookExcelImport.bind(this)),this._workbook.bind("pdfExport",this._workbookPdfExport.bind(this))},destroy:function(){e.ui.Widget.fn.destroy.call(this),this._workbook.destroy(),this._controller.destroy(),this._view.destroy(),this._resizeHandler&&n(window).off("resize"+s,this._resizeHandler)},options:{name:"Spreadsheet",toolbar:!0,sheetsbar:!0,rows:200,columns:50,rowHeight:20,columnWidth:64,headerHeight:20,headerWidth:32,excel:{proxyURL:"",fileName:"Workbook.xlsx"},pdf:{area:"workbook",fileName:"Workbook.pdf",proxyURL:"",paperSize:"a4",landscape:!0,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator v."+e.version,date:null}},events:["pdfExport","excelExport","excelImport","render"]}),e.spreadsheet.ALL_REASONS=l,e.ui.plugin(c),n.extend(!0,c,{classNames:d}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.pivot.configurator.min",["kendo.dom.min"],e)}(function(){return function(e,t){function n(e){for(var t,n=0,i=e.length;i>n;n++)if(2==e[n].type){t=!0;break}t&&e.splice(n+1,0,{caption:"KPIs",defaultHierarchy:"[KPIs]",name:"KPIs",uniqueName:"[KPIs]"})}function i(e){return{name:e.uniqueName,type:e.type}}function r(e){for(var t=0,n=e.length;n>t;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e}function o(t){var n=e(t).closest(".k-pivot-setting");return n.length?n.data("kendoPivotSettingTarget"):null}function a(e,t,n){return{hierarchyUniqueName:e,uniqueName:t,caption:t,measure:t,name:t,type:n,kpi:!0}}function s(e){var t=e.name;return[a(t,e.value,"value"),a(t,e.goal,"goal"),a(t,e.status,"status"),a(t,e.trend,"trend")]}var l=window.kendo,d=l.ui,c=d.Widget,u=".kendoPivotConfigurator",h="mouseenter"+u+" mouseleave"+u,f=l.template('
${name}
'),p=c.extend({init:function(e,t){c.fn.init.call(this,e,t),this.element.addClass("k-widget k-fieldselector k-alt k-edit-form-container"),this._dataSource(),this._layout(),this.refresh(),l.notify(this)},events:[],options:{name:"PivotConfigurator",filterable:!1,sortable:!1,messages:{measures:"Drop Data Fields Here",columns:"Drop Column Fields Here",rows:"Drop Rows Fields Here",measuresLabel:"Measures",columnsLabel:"Columns",rowsLabel:"Rows",fieldsLabel:"Fields"}},_dataSource:function(){var t=this;t.dataSource&&t._refreshHandler?t.dataSource.unbind("change",t._refreshHandler).unbind("error",t._errorHandler).unbind("progress",t._progressHandler):(t._errorHandler=e.proxy(t._error,t),t._refreshHandler=e.proxy(t.refresh,t),t._progressHandler=e.proxy(t._requestStart,t)),t.dataSource=l.data.PivotDataSource.create(t.options.dataSource),t.dataSource.bind("change",t._refreshHandler).bind("error",t._errorHandler).bind("progress",t._progressHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.measures&&this.measures.setDataSource(e),this.rows&&this.rows.setDataSource(e),this.columns&&this.columns.setDataSource(e),this.refresh()},_treeViewDataSource:function(){var t=this;return l.data.HierarchicalDataSource.create({schema:{model:{id:"uniqueName",hasChildren:function(e){return!("hierarchyUniqueName"in e||"aggregator"in e)}}},transport:{read:function(i){var o,a,l;e.isEmptyObject(i.data)?(o=t.dataSource.schemaDimensions(),o.done(function(e){t.dataSource.cubeBuilder||n(e),i.success(e)}).fail(i.error)):(a=t.treeView.dataSource.get(i.data.uniqueName),"[KPIs]"===a.uniqueName?(l=!0,o=t.dataSource.schemaKPIs(),o.done(function(e){i.success(r(e))}).fail(i.error)):"kpi"==a.type&&(l=!0,i.success(s(a))),l||(o=2==a.type?t.dataSource.schemaMeasures():a.dimensionUniqueName?t.dataSource.schemaLevels(i.data.uniqueName):t.dataSource.schemaHierarchies(i.data.uniqueName),o.done(i.success).fail(i.error)))}}})},_progress:function(e){l.ui.progress(this.element,e)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_layout:function(){this.form=e('
').appendTo(this.element),this._fields(),this._targets()},_fields:function(){var t=e('
'+this.options.messages.fieldsLabel+"
").appendTo(this.form),n='# if (item.type == 2 || item.uniqueName == "[KPIs]") { #
# } else if (item.type && item.type !== "kpi") { #
# } ##: item.caption || item.name #';this.treeView=e("
").appendTo(t).kendoTreeView({template:n,dataTextField:"caption",dragAndDrop:!0,autoBind:!1,dataSource:this._treeViewDataSource(),dragstart:function(e){var t=this.dataItem(e.sourceNode);(t.hasChildren||t.aggregator||t.measure)&&2!=t.type&&"[KPIs]"!==t.uniqueName||e.preventDefault()},drag:function(e){var t="k-denied",n=o(e.dropTarget);n&&n.validate(this.dataItem(e.sourceNode))&&(t="k-add"),e.setStatusClass(t)},drop:function(e){var t,n,r,a,l,d;if(e.preventDefault(),t=o(e.dropTarget),n=this.dataItem(e.sourceNode),t&&t.validate(n)){if(d=n.defaultHierarchy||n.uniqueName,"kpi"===n.type)for(l=s(n),a=l.length,d=[],r=0;a>r;r++)d.push(i(l[r]));else n.kpi&&(d=[i(n)]);t.add(d)}}}).data("kendoTreeView")},_createTarget:function(t,n){var i='",new l.ui.PivotSettingTarget(t,e.extend({dataSource:this.dataSource,hint:function(t){var n=e('
');return n.find(".k-list").append(t.clone()),n},template:i,emptyTemplate:'
${data} '},n))},_targets:function(){var t=e('
').appendTo(this.form),n=e(f({name:this.options.messages.columnsLabel,icon:"k-i-vbars"})).appendTo(t),i=e('
').appendTo(n.last()),r=e(f({name:this.options.messages.rowsLabel,icon:"k-i-hbars"})).appendTo(t),o=e('
').appendTo(r.last()),a=e(f({name:this.options.messages.measuresLabel,icon:"k-i-sum"})).appendTo(t),s=e('
').appendTo(a.last()),l=this.options;this.columns=this._createTarget(i,{filterable:l.filterable,sortable:l.sortable,connectWith:o,messages:{empty:l.messages.columns,fieldMenu:l.messages.fieldMenu}}),this.rows=this._createTarget(o,{filterable:l.filterable,setting:"rows",connectWith:i,messages:{empty:this.options.messages.rows,fieldMenu:this.options.messages.fieldMenu}}),this.measures=this._createTarget(s,{setting:"measures",messages:{empty:l.messages.measures}}),i.add(o).add(s).on(h,".k-item:not(.k-empty)",this._toggleHover)},_toggleHover:function(t){e(t.currentTarget).toggleClass("k-state-hover","mouseenter"===t.type)},_resize:function(){var e,t,n=this.element,i=this.options.height;i&&(n.height(i),n.is(":visible")&&(t=n.children(".k-columns").children("div.k-state-default"),i=n.innerHeight(),e=(n.outerHeight()-i)/2,i=i-(t.outerHeight(!0)-t.height())-e,t.height(i)))},refresh:function(){var e=this.dataSource;(e.cubeBuilder||this._cube!==e.cube()||this._catalog!==e.catalog())&&this.treeView.dataSource.fetch(),this._catalog=this.dataSource.catalog(),this._cube=this.dataSource.cube(),this._resize(),this._progress(!1)},destroy:function(){c.fn.destroy.call(this),this.dataSource.unbind("change",this._refreshHandler),this.form.find(".k-list").off(u),this.rows.destroy(),this.columns.destroy(),this.measures.destroy(),this.treeView.destroy(),this.element=null,this._refreshHandler=null}});d.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.angular.min",["kendo.core.min"],e)}(function(){return function(e,t,n){"use strict";function i(e){var t=C;try{return C=function(e){return e()},e()}finally{C=t}}function r(t,i,r,d,c,g){function v(){var n,g,v,_,b,x,C;return r.kRebind&&(n=e(e(i)[0].cloneNode(!0))),S=o(t,i,r,d,y).options,i.is("select")&&!function(t){if(t.length>0){var n=e(t[0]);!/\S/.test(n.text())&&/^\?/.test(n.val())&&n.remove()}
}(i[0].options),g=y.call(i,D=S).data(d),l(g,t,r,d,c),t.$emit("kendoWidgetCreated",g),v=f(t,g),r.kRebind&&m(g,t,i,n,r.kRebind,v,r),r.kNgDisabled&&(_=r.kNgDisabled,b=t.$eval(_),b&&g.enable(!b),a(g,t,i,_)),r.kNgReadonly&&(x=r.kNgReadonly,C=t.$eval(x),C&&g.readonly(C),s(g,t,i,x)),r.kNgModel&&h(g,t,r.kNgModel),k&&u(g,t,i,k,w),g&&p(g,i),g}var _,b,k,w,y,x,S,T,F,E,R,A,I,M;if(!(i instanceof jQuery))throw Error("The Kendo UI directives require jQuery to be available before AngularJS. Please include jquery before angular in the document.");if(_=r.kNgDelay,b=t.$eval(_),g=g||[],k=g[0],w=g[1],y=e(i)[d],!y)return window.console.error("Could not find: "+d),null;if(x=o(t,i,r,d,y),S=x.options,x.unresolved.length){for(T=[],F=0,E=x.unresolved.length;E>F;F++)R=x.unresolved[F],A=e.Deferred(function(e){var i=t.$watch(R.path,function(t){t!==n&&(i(),e.resolve())})}).promise(),T.push(A);return e.when.apply(null,T).then(v),n}return _&&!b?(I=t.$root||t,M=function(){var e=t.$watch(_,function(t){t!==n&&(e(),i.removeAttr(r.$attr.kNgDelay),_=null,C(v))})},/^\$(digest|apply)$/.test(I.$$phase)?M():t.$apply(M),n):v()}function o(i,r,o,a,s){function l(e,r){var o=t.copy(i.$eval(r));o===n?p.push({option:e,path:r}):d[e]=o}var d,c,u,h,f=a.replace(/^kendo/,""),p=[],m=o.kOptions||o.options,g=i.$eval(m);return m&&g===n&&p.push({option:"options",path:m}),d=t.extend({},o.defaultOptions,g),c=s.widget.prototype.options,u=s.widget.prototype.events,e.each(o,function(e,t){var n,i,r,o;"source"!==e&&"kDataSource"!==e&&"kScopeField"!==e&&"scopeField"!==e&&(n="data"+e.charAt(0).toUpperCase()+e.slice(1),0===e.indexOf("on")&&(i=e.replace(/^on./,function(e){return e.charAt(2).toLowerCase()}),u.indexOf(i)>-1&&(d[i]=t)),c.hasOwnProperty(n)?l(n,t):c.hasOwnProperty(e)&&!R[e]?l(e,t):E[e]||(r=e.match(/^k(On)?([A-Z].*)/),r&&(o=r[2].charAt(0).toLowerCase()+r[2].slice(1),r[1]&&"kOnLabel"!=e?d[o]=t:("kOnLabel"==e&&(o="onLabel"),l(o,t)))))}),h=o.kDataSource||o.source,h&&(d.dataSource=F(i,r,f,h)),d.$angular=[i],{options:d,unresolved:p}}function a(e,t,i,r){return kendo.ui.PanelBar&&e instanceof kendo.ui.PanelBar||kendo.ui.Menu&&e instanceof kendo.ui.Menu?(T.warn("k-ng-disabled specified on a widget that does not have the enable() method: "+e.options.name),n):(t.$watch(r,function(t,n){t!=n&&e.enable(!t)}),n)}function s(e,t,i,r){return"function"!=typeof e.readonly?(T.warn("k-ng-readonly specified on a widget that does not have the readonly() method: "+e.options.name),n):(t.$watch(r,function(t,n){t!=n&&e.readonly(t)}),n)}function l(e,t,n,i,r){if(n[r]){var o=x(n[r]).assign;if(!o)throw Error(r+" attribute used but expression in it is not assignable: "+n[i]);o(t,e)}}function d(e){return/checkbox|radio/i.test(e.attr("type"))?e.prop("checked"):e.val()}function c(e){return A.test(e[0].tagName)}function u(e,t,i,r,o){var a,s,l,u;e.value&&(a=c(i)?function(){return d(i)}:function(){return e.value()},r.$render=function(){var i=r.$viewValue;i===n&&(i=r.$modelValue),i===n&&(i=null),setTimeout(function(){if(e){var n=t[e.element.attr("k-ng-model")];n&&(i=n),e.options.autoBind!==!1||e.listView.bound()?e.value(i):i&&e.value(i)}},0)},s=!1,c(i)&&i.on("change",function(){s=!0}),l=function(e){return function(){var n;s||(e&&o&&(n=o.$pristine),r.$setViewValue(a()),e&&(r.$setPristine(),n&&o.$setPristine()),_(t))}},e.first("change",l(!1)),kendo.ui.AutoComplete&&e instanceof kendo.ui.AutoComplete||e.first("dataBound",l(!0)),u=a(),isNaN(r.$viewValue)||u==r.$viewValue||(r.$isEmpty(r.$viewValue)?null!=u&&""!==u&&u!=r.$viewValue&&r.$setViewValue(u):e.value(r.$viewValue)),r.$setPristine())}function h(t,i,r){var o,a,s,l,d,c,u,h,f;return"function"!=typeof t.value?(T.warn("k-ng-model specified on a widget that does not have the value() method: "+t.options.name),n):(o=e(t.element).parents("form"),a=i[o.attr("name")],s=x(r),l=s.assign,d=!1,c=kendo.ui.MultiSelect&&t instanceof kendo.ui.MultiSelect,u=function(e){return c?e.length:0},h=u(s(i)),t.$angular_setLogicValue(s(i)),f=function(e,i){e===n&&(e=null),d||e==i&&u(e)==h||(h=u(e),t.$angular_setLogicValue(e))},c?i.$watchCollection(r,f):i.$watch(r,f),t.first("change",function(){d=!0,a&&a.$pristine&&a.$setDirty(),_(i,function(){l(i,t.$angular_getLogicValue()),h=u(s(i))}),d=!1}),n)}function f(e,t){var n=e.$on("$destroy",function(){n(),t&&(t.element&&(t=v(t.element),t&&t.destroy()),t=null)});return n}function p(t,n){function i(){a.disconnect()}function r(){a.observe(e(n)[0],{attributes:!0})}var o,a;window.MutationObserver&&t.wrapper&&(o=[].slice.call(e(n)[0].classList),a=new MutationObserver(function(n){i(),t&&(n.forEach(function(n){var i,r=e(t.wrapper)[0];switch(n.attributeName){case"class":i=[].slice.call(n.target.classList),i.forEach(function(e){o.indexOf(e)<0&&(r.classList.add(e),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.add(e))}),o.forEach(function(e){i.indexOf(e)<0&&(r.classList.remove(e),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.remove(e))}),o=i;break;case"disabled":"function"!=typeof t.enable||t.element.attr("readonly")||t.enable(!e(n.target).attr("disabled"));break;case"readonly":"function"!=typeof t.readonly||t.element.attr("disabled")||t.readonly(!!e(n.target).attr("readonly"))}}),r())}),r(),t.first("destroy",i))}function m(t,n,i,r,o,a,s){var l=n.$watch(o,function(o,d){var c,u,h,f,p;t._muteRebind||o===d||(l(),c=N[t.options.name],c&&c.forEach(function(t){var i=n.$eval(s["k"+t]);i&&r.append(e(i).attr(kendo.toHyphens("k"+t),""))}),u=e(t.wrapper)[0],h=e(t.element)[0],f="Upload"===t.options.name,f&&(i=e(h)),p=i.injector().get("$compile"),t._destroy(),a&&a(),t=null,h&&(u&&u.parentNode.replaceChild(h,u),e(i).replaceWith(r)),p(r)(n))},!0);_(n)}function g(e,n){function i(e,t){w.directive(e,["directiveFactory",function(n){return n.create(t,e)}])}var r,o,a,s,l=n?"Mobile":"";l+=e.fn.options.name,r=l,o="kendo"+l.charAt(0)+l.substr(1).toLowerCase(),l="kendo"+l,a=l.replace(/([A-Z])/g,"-$1"),-1==M.indexOf(l.replace("kendo",""))&&(s=l===o?[l]:[l,o],t.forEach(s,function(e){w.directive(e,function(){return{restrict:"E",replace:!0,template:function(e,t){var n=I[r]||"div",i=t.kScopeField||t.scopeField;return"<"+n+" "+a+(i?'="'+i+'"':"")+">"+e.html()+""+n+">"}}})})),H.indexOf(l.replace("kendo",""))>-1||(i(l,l),o!=l&&i(o,l))}function v(t){return t=e(t),kendo.widgetInstance(t,kendo.ui)||kendo.widgetInstance(t,kendo.mobile.ui)||kendo.widgetInstance(t,kendo.dataviz.ui)}function _(e,t){var n=e.$root||e,i=/^\$(digest|apply)$/.test(n.$$phase);t?i?t():n.$apply(t):i||n.$digest()}function b(t,n){t.$destroy(),n&&e(n).removeData("$scope").removeData("$$kendoScope").removeData("$isolateScope").removeData("$isolateScopeNoTemplate").removeClass("ng-scope")}function k(n,i,r){var o,a,s;if(e.isArray(n))return t.forEach(n,function(e){k(e,i,r)});if("string"==typeof n){for(o=n.split("."),a=kendo;a&&o.length>0;)a=a[o.shift()];if(!a)return z.push([n,i,r]),!1;n=a.prototype}return s=n[i],n[i]=function(){var e=this,t=arguments;return r.apply({self:e,next:function(){return s.apply(e,arguments.length>0?arguments:t)}},t)},!0}var w,y,x,C,S,T,D,F,E,R,A,I,M,H,z,N;t&&t.injector&&(w=t.module("kendo.directives",[]),y=t.injector(["ng"]),x=y.get("$parse"),C=y.get("$timeout"),T=y.get("$log"),F=function(){var e={TreeList:"TreeListDataSource",TreeView:"HierarchicalDataSource",Scheduler:"SchedulerDataSource",PanelBar:"$PLAIN",Menu:"$PLAIN",ContextMenu:"$PLAIN"},t=function(e,t){return"$PLAIN"==t?e:kendo.data[t].create(e)};return function(n,i,r,o){var a=e[r]||"DataSource",s=n.$eval(o),l=t(s,a);return n.$watch(o,function(e){var n,r=v(i);r&&"function"==typeof r.setDataSource&&e!==s&&(n=t(e,a),r.setDataSource(n),s=e)}),l}}(),E={kDataSource:!0,kOptions:!0,kRebind:!0,kNgModel:!0,kNgDelay:!0},R={name:!0,title:!0,style:!0},A=/^(input|select|textarea)$/i,w.factory("directiveFactory",["$compile",function(t){var n,i,o=!1;return S=t,i=function(t,i){return{restrict:"AC",require:["?ngModel","^?form"],scope:!1,controller:["$scope","$attrs","$element",function(e,t){var n=this;n.template=function(e,n){t[e]=kendo.stringify(n)},e.$on("$destroy",function(){n.template=null,n=null})}],link:function(a,s,l,d){var c,u=e(s),h=t.replace(/([A-Z])/g,"-$1");u.attr(h,u.attr("data-"+h)),u[0].removeAttribute("data-"+h),c=r(a,s,l,t,i,d),c&&(n&&clearTimeout(n),n=setTimeout(function(){a.$emit("kendoRendered"),o||(o=!0,e("form").each(function(){var t=e(this).controller("form");t&&t.$setPristine()}))}))}}},{create:i}}]),I={Editor:"textarea",NumericTextBox:"input",DatePicker:"input",DateTimePicker:"input",TimePicker:"input",AutoComplete:"input",ColorPicker:"input",MaskedTextBox:"input",MultiSelect:"input",Upload:"input",Validator:"form",Button:"button",MobileButton:"a",MobileBackButton:"a",MobileDetailButton:"a",ListView:"ul",MobileListView:"ul",TreeView:"ul",Menu:"ul",ContextMenu:"ul",ActionSheet:"ul"},M=["MobileView","MobileDrawer","MobileLayout","MobileSplitView","MobilePane","MobileModalView"],H=["MobileApplication","MobileView","MobileModalView","MobileLayout","MobileActionSheet","MobileDrawer","MobileSplitView","MobilePane","MobileScrollView","MobilePopOver"],t.forEach(["MobileNavBar","MobileButton","MobileBackButton","MobileDetailButton","MobileTabStrip","MobileScrollView","MobileScroller"],function(e){H.push(e),e="kendo"+e,w.directive(e,function(){return{restrict:"A",link:function(t,n,i){r(t,n,i,e,e)}}})}),z=[],kendo.onWidgetRegistered(function(t){z=e.grep(z,function(e){return!k.apply(null,e)}),g(t.widget,"Mobile"==t.prefix)}),k(["ui.Widget","mobile.ui.Widget"],"angular",function(r,o){var a,s=this.self;return"init"==r?(!o&&D&&(o=D),D=null,o&&o.$angular&&(s.$angular_scope=o.$angular[0],s.$angular_init(s.element,o)),n):(a=s.$angular_scope,a&&i(function(){var i,l,d=o(),c=d.elements,u=d.data;if(c.length>0)switch(r){case"cleanup":t.forEach(c,function(t){var n=e(t).data("$$kendoScope");n&&n!==a&&n.$$kendoScope&&b(n,t)});break;case"compile":i=s.element.injector(),l=i?i.get("$compile"):S,t.forEach(c,function(t,i){var r,o;d.scopeFrom?r=d.scopeFrom:(o=u&&u[i],o!==n?(r=e.extend(a.$new(),o),r.$$kendoScope=!0):r=a),e(t).data("$$kendoScope",r),l(t)(r)}),_(a)}}),n)}),k("ui.Widget","$angular_getLogicValue",function(){return this.self.value()}),k("ui.Widget","$angular_setLogicValue",function(e){this.self.value(e)}),k("ui.Select","$angular_getLogicValue",function(){var e=this.self.dataItem(),t=this.self.options.dataValueField;return e?this.self.options.valuePrimitive?t?e[t]:e:e.toJSON():null}),k("ui.Select","$angular_setLogicValue",function(e){var t=this.self,i=t.options,r=i.dataValueField,o=i.text||"";e===n&&(e=""),r&&!i.valuePrimitive&&e&&(o=e[i.dataTextField]||"",e=e[r||i.dataTextField]),t.options.autoBind!==!1||t.listView.bound()?t.value(e):!o&&e&&i.valuePrimitive?t.value(e):t._preselect(e,o)}),k("ui.MultiSelect","$angular_getLogicValue",function(){var t=this.self.dataItems().slice(0),n=this.self.options.dataValueField;return n&&this.self.options.valuePrimitive&&(t=e.map(t,function(e){return e[n]})),t}),k("ui.MultiSelect","$angular_setLogicValue",function(t){var n,i,r,o;null==t&&(t=[]),n=this.self,i=n.options,r=i.dataValueField,o=t,r&&!i.valuePrimitive&&(t=e.map(t,function(e){return e[r]})),i.autoBind!==!1||i.valuePrimitive||n.listView.bound()?n.value(t):n._preselect(o,t)}),k("ui.AutoComplete","$angular_getLogicValue",function(){var e,t,n,i,r,o=this.self.options,a=this.self.value().split(o.separator),s=o.valuePrimitive,l=this.self.dataSource.data(),d=[];for(e=0,t=l.length;t>e;e++)for(n=l[e],i=o.dataTextField?n[o.dataTextField]:n,r=0;a.length>r;r++)if(i===a[r]){d.push(s?i:n.toJSON());break}return d}),k("ui.AutoComplete","$angular_setLogicValue",function(t){null==t&&(t=[]);var i=this.self,r=i.options.dataTextField;r&&!i.options.valuePrimitive&&(t=t.length!==n?e.map(t,function(e){return e[r]}):t[r]),i.value(t)}),k("ui.Widget","$angular_init",function(t,n){var i,r,o,a,s=this.self;if(n&&!e.isArray(n))for(i=s.$angular_scope,r=s.events.length;--r>=0;)o=s.events[r],a=n[o],a&&"string"==typeof a&&(n[o]=s.$angular_makeEventHandler(o,i,a))}),k("ui.Widget","$angular_makeEventHandler",function(e,t,n){return n=x(n),function(e){_(t,function(){n(t,{kendoEvent:e})})}}),k(["ui.Grid","ui.ListView","ui.TreeView"],"$angular_makeEventHandler",function(e,n,i){return"change"!=e?this.next():(i=x(i),function(e){var r,o,a,s,l,d,c,u,h,f=e.sender,p=f.options,m={kendoEvent:e};for(t.isString(p.selectable)&&(r=-1!==p.selectable.indexOf("cell"),o=-1!==p.selectable.indexOf("multiple")),a=m.selected=this.select(),s=m.data=[],l=m.columns=[],c=0;a.length>c;c++)u=r?a[c].parentNode:a[c],h=f.dataItem(u),r?(t.element.inArray(h,s)<0&&s.push(h),d=t.element(a[c]).index(),t.element.inArray(d,l)<0&&l.push(d)):s.push(h);o||(m.dataItem=m.data=s[0],m.angularDataItem=kendo.proxyModelSetters(m.dataItem),m.selected=a[0]),_(n,function(){i(n,m)})})}),k("ui.Grid","$angular_init",function(i,r){if(this.next(),r.columns){var o=e.extend({},kendo.Template,r.templateSettings);t.forEach(r.columns,function(e){!e.field||e.template||e.format||e.values||e.encoded!==n&&!e.encoded||(e.template="
#: "+kendo.expr(e.field,o.paramName)+"# ")})}}),k("mobile.ui.ButtonGroup","value",function(e){var t=this.self;return null!=e&&(t.select(t.element.children("li.km-button").eq(e)),t.trigger("change"),t.trigger("select",{index:t.selectedIndex})),t.selectedIndex}),k("mobile.ui.ButtonGroup","_select",function(){this.next(),this.self.trigger("change")}),w.directive("kendoMobileApplication",function(){return{terminal:!0,link:function(e,t,n){r(e,t,n,"kendoMobileApplication","kendoMobileApplication")}}}).directive("kendoMobileView",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileView","kendoMobileView")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileDrawer",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileDrawer","kendoMobileDrawer")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileModalView",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileModalView","kendoMobileModalView")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileSplitView",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileSplitView","kendoMobileSplitView")},post:function(e,t,n){n._instance._layout()}}}}).directive("kendoMobilePane",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,r(e,t,n,"kendoMobilePane","kendoMobilePane")}}}}).directive("kendoMobileLayout",function(){return{link:{pre:function(e,t,n){r(e,t,n,"kendoMobileLayout","kendoMobileLayout")}}}}).directive("kendoMobileActionSheet",function(){return{restrict:"A",link:function(t,n,i){n.find("a[k-action]").each(function(){e(this).attr("data-"+kendo.ns+"action",e(this).attr("k-action"))}),r(t,n,i,"kendoMobileActionSheet","kendoMobileActionSheet")}}}).directive("kendoMobilePopOver",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,r(e,t,n,"kendoMobilePopOver","kendoMobilePopOver")}}}}).directive("kendoViewTitle",function(){return{restrict:"E",replace:!0,template:function(e){return"
"+e.html()+" "}}}).directive("kendoMobileHeader",function(){return{restrict:"E",link:function(e,t){t.addClass("km-header").attr("data-role","header")}}}).directive("kendoMobileFooter",function(){return{restrict:"E",link:function(e,t){t.addClass("km-footer").attr("data-role","footer")}}}).directive("kendoMobileScrollViewPage",function(){return{restrict:"E",replace:!0,template:function(e){return"
"+e.html()+"
"}}}),t.forEach(["align","icon","rel","transition","actionsheetContext"],function(e){var t="k"+e.slice(0,1).toUpperCase()+e.slice(1);w.directive(t,function(){return{restrict:"A",priority:2,link:function(n,i,r){i.attr(kendo.attr(kendo.toHyphens(e)),n.$eval(r[t]))}}})}),N={TreeMap:["Template"],MobileListView:["HeaderTemplate","Template"],MobileScrollView:["EmptyTemplate","Template"],Grid:["AltRowTemplate","DetailTemplate","RowTemplate"],ListView:["EditTemplate","Template","AltTemplate"],Pager:["SelectTemplate","LinkTemplate"],PivotGrid:["ColumnHeaderTemplate","DataCellTemplate","RowHeaderTemplate"],Scheduler:["AllDayEventTemplate","DateHeaderTemplate","EventTemplate","MajorTimeHeaderTemplate","MinorTimeHeaderTemplate"],TreeView:["Template"],Validator:["ErrorTemplate"]},function(){var e={};t.forEach(N,function(n,i){t.forEach(n,function(t){e[t]||(e[t]=[]),e[t].push("?^^kendo"+i)})}),t.forEach(e,function(e,t){var n="k"+t,i=kendo.toHyphens(n);w.directive(n,function(){return{restrict:"A",require:e,terminal:!0,compile:function(t,r){if(""===r[n]){t.removeAttr(i);var o=t[0].outerHTML;return function(r,a,s,l){for(var d;!d&&l.length;)d=l.shift();d?(d.template(n,o),t.remove()):T.warn(i+" without a matching parent widget found. It can be one of the following: "+e.join(", "))}}}}})})}())}(window.kendo.jQuery,window.angular),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.webcomponents.min",["kendo.core.min"],e)}(function(){return function(e,t,n){function i(e,t){var i=e.getAttribute(t);return null===i?i=n:"null"===i?i=null:"true"===i?i=!0:"false"===i?i=!1:p.test(i)?i=parseFloat(i):h.test(i)&&!f.test(i)&&(i=Function("return ("+i+")")()),i}function r(e,t){var n={};return Object.keys(t).concat("dataSource").forEach(function(t){e.hasAttribute(kendo.toHyphens(t))&&(n[t]=i(e,kendo.toHyphens(t)))}),n}function o(e){var t={};return Object.keys(e).forEach(function(n){"_"!=n[0]&&(t[n]=e[n])}),t}function a(e,t){var n=document.createEvent("CustomEvent");n.initCustomEvent(e,!1,!0,o(t)),this.dispatchEvent(n),n.defaultPrevented&&t.preventDefault()}function s(e,t){var n,i=Object.keys(t);for(n=0;i.length>=n;n++)if("function"==typeof t[i[n]])e[i[n]]||(e[i[n]]=t[i[n]].bind(e.widget));else{if("options"===i[n])continue;e[i[n]]=e[i[n]]||t[i[n]]}}function l(t,n){var i=n.prototype.options,o=Object.create(HTMLElement.prototype);Object.defineProperty(o,"options",{get:function(){return this.widget.options},set:function(n){var i,r,o,a=this.widget;n=e.extend(!0,{},a.options,n),i=e(a.wrapper)[0],r=e(a.element)[0],a._destroy(),o=document.createElement(d[t]||"div"),i&&r&&(i.parentNode.replaceChild(r,i),e(r).replaceWith(o)),a.value&&(n.value=a.value()),a.init(o,n),this.bindEvents()}}),o.bindEvents=function(){n.prototype.events.forEach(function(e){this.widget.bind(e,a.bind(this,e)),this.hasAttribute(c+e)&&this.bind(e,function(t){window[this.getAttribute(c+e)].call(this,t)}.bind(this))}.bind(this))},o.attachedCallback=function(){var o,a=this,l=document.createElement(d[t]||"div");e(l).append(a.childNodes),e(l).attr("class",e(a).attr("class")),e(l).attr("style",e(a).attr("style")),a.appendChild(l),a.widget=new n(l,r(a,i)),o=a.widget;do s(a,o);while(o=Object.getPrototypeOf(o));this.bindEvents()},o.detachedCallback=function(){kendo.destroy(this.element)},kendo.webComponents.push("kendo-"+t),document.registerElement("kendo-"+t,{prototype:o})}var d,c,u,h,f,p;kendo.support.customElements&&!kendo.webComponents.length&&(!t||1!=t.version.major&&!t.injector)&&(d={editor:"textarea",numerictextbox:"input",datepicker:"input",datetimepicker:"input",timepicker:"input",autocomplete:"input",colorpicker:"input",maskedtextbox:"input",dropdownlist:"select",multiselect:"select",upload:"input",validator:"form",button:"button",mobilebutton:"a",mobilebackbutton:"a",mobiledetailbutton:"a",listview:"ul",mobilelistview:"ul",treeview:"ul",menu:"ul",contextmenu:"ul",actionsheet:"ul"},c="on-",u=[],kendo.onWidgetRegistered(function(e){var t=e.prefix+e.widget.prototype.options.name.toLowerCase();-1===u.indexOf(t)&&(u.push(t),l(t,e.widget))}),h=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,f=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,p=/^(\+|-?)\d+(\.?)\d*$/)}(window.kendo.jQuery,window.angular),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.angular2.min",["kendo.core.min","kendo.webcomponents.min"],e)}(function(){!function(e,t){var n,i;t&&t.register&&(n=this&&this.__decorate||function(e,t,n,i){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,n,i);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,i){return void(i&&i(t,n))},void 0);case 4:return e.reduceRight(function(e,i){return i&&i(t,n,e)||e},i)}},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},t.register("kendo/angular2",["angular2/angular2"],function(t){var r,o;return{setters:[function(e){r=e}],execute:function(){o=function(){function t(e,t){var n=this;this.elementRef=t,this.onChange=function(e){},this.onTouched=function(){},this.element=t.nativeElement,this.element.addEventListener("change",function(){n.onChange(n.element.value())}),this.element.addEventListener("spin",function(){n.onChange(n.element.value())}),e.valueAccessor=this,this.cd=e,e.valueAccessor=this}return t.prototype.writeValue=function(e){this.element.value(e)},t.prototype.registerOnChange=function(e){this.onChange=e},t.prototype.registerOnTouched=function(e){this.onTouched=e},t=n([r.Directive({selector:e.webComponents.join(",")}),i("design:paramtypes",[r.NgControl,r.ElementRef])],t)}(),t("KendoValueAccessor",o)}}}))}(window.kendo,window.System)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.web.min",["kendo.core.min","kendo.router.min","kendo.view.min","kendo.fx.min","kendo.dom.min","kendo.data.odata.min","kendo.data.xml.min","kendo.data.min","kendo.ooxml.min","kendo.excel.min","kendo.data.signalr.min","kendo.binder.min","kendo.drawing.min","kendo.validator.min","kendo.userevents.min","kendo.draganddrop.min","kendo.mobile.scroller.min","kendo.groupable.min","kendo.reorderable.min","kendo.resizable.min","kendo.sortable.min","kendo.selectable.min","kendo.button.min","kendo.pager.min","kendo.popup.min","kendo.notification.min","kendo.tooltip.min","kendo.list.min","kendo.calendar.min","kendo.datepicker.min","kendo.autocomplete.min","kendo.dropdownlist.min","kendo.combobox.min","kendo.multiselect.min","kendo.colorpicker.min","kendo.columnmenu.min","kendo.columnsorter.min","kendo.grid.min","kendo.listview.min","kendo.filebrowser.min","kendo.imagebrowser.min","kendo.editor.min","kendo.numerictextbox.min","kendo.maskedtextbox.min","kendo.menu.min","kendo.editable.min","kendo.pivot.fieldmenu.min","kendo.filtercell.min","kendo.panelbar.min","kendo.progressbar.min","kendo.responsivepanel.min","kendo.tabstrip.min","kendo.timepicker.min","kendo.toolbar.min","kendo.datetimepicker.min","kendo.treeview.draganddrop.min","kendo.treeview.min","kendo.slider.min","kendo.splitter.min","kendo.upload.min","kendo.window.min","kendo.virtuallist.min","kendo.scheduler.view.min","kendo.scheduler.dayview.min","kendo.scheduler.agendaview.min","kendo.scheduler.monthview.min","kendo.scheduler.recurrence.min","kendo.scheduler.min","kendo.gantt.list.min","kendo.gantt.timeline.min","kendo.gantt.min","kendo.treelist.min","kendo.pivotgrid.min","kendo.spreadsheet.min","kendo.pivot.configurator.min","kendo.angular.min","kendo.webcomponents.min","kendo.angular2.min"],e)}(function(){"bundle all"},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.web.min.js.map