text: this.ej=this.ej||{},this.ej.grids=function(e,t,r,i,n,o,s,l,a,d,c){"use strict";function h(e,t,r,i){if(i&&e)return void e.removeAttribute(t);e&&e.setAttribute(t,r)}function p(){return["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings"]}function u(e,t){return e.prototype&&t in e.prototype}function g(e,i,n){return t.isNullOrUndefined(e)||""===e?"":r.DataUtil.getObject(e,i)}function f(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function m(e){for(var t=[],r=e.vRows,i=0;i<r.length;i++)r[i].isDataRow?t.push(r[i]):r[i].isDataRow||(t.push(r[i]),!r[i].isExpand&&r[i].isCaptionRow&&(i+=y(r[i],e)));e.vcRows=t}function y(e,r){qr=0;var i=r.groupSettings.columns.length,n="items",o=e.gSummary,s=0,l="aggregatesCount";if(o===e.data.count)return r.groupSettings.columns.length&&!t.isNullOrUndefined(e[l])?1!==r.groupSettings.columns.length&&e[l]?qr+=0!==e.indent&&o<2?e.gSummary*(i-e.indent+(i-e.indent)*e[l]):e.gSummary*(i-e.indent+(i-e.indent-1)*e[l])+e[l]:e[l]&&1===r.groupSettings.columns.length&&(qr+=e.gSummary*(i-e.indent)+e[l]):r.groupSettings.columns.length&&(1!==r.groupSettings.columns.length?qr+=e.gSummary*(r.groupSettings.columns.length-e.indent):qr+=e.gSummary),qr;for(var a=0,d=e.data[n].length;a<d;a++){var c=e.data[n][a];qr+=c[n].length+(i===r.columns.length||t.isNullOrUndefined(c[n].records)?0:c[n].records.length),s+=t.isNullOrUndefined(c[n].records)||t.isNullOrUndefined(e[l])?c[n].length:c[n].records.length,c[n].GroupGuid&&0!==c[n].childLevels&&v(c)}return qr+=e.data[n].length,t.isNullOrUndefined(e[l])||e[l]&&qr&&0!==s&&(qr+=(qr-s)*e[l]+e[l]),qr}function v(e){for(var t=0,r=e.items.length;t<r;t++){var i=e.items[t];qr+=i.count,0!==i.items.childLevels&&v(i)}}function C(e,r){for(var i=[],n=0,o=e.length;n<o;n++){var s=r(e[n],n);t.isNullOrUndefined(s)||i.push(s)}return i}function w(e){for(var r=[],i=0;i<e.length;i++)r.push(t.extend({},I(e[i]),{},!0));return r}function b(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(r){return t.compile(e)}}function S(e,r){var i={},n=["style","class"];t.extend(i,r,{}),"style"in i&&(t.setStyleAttribute(e,i[n[0]]),delete i[n[0]]),"class"in i&&(t.addClass([e],i[n[1]]),delete i[n[1]]),t.attributes(e,i)}function x(e,r,i,n){var o=t.extend(e,r,i);return Object.keys(o).forEach(function(e,t){n&&-1!==n.indexOf(e)&&delete o[e]}),o}function R(e,r){void 0===r&&(r=0);for(var i=0,n=e.length;i<n;i++)e[i].columns?(e[i].index=t.isNullOrUndefined(e[i].index)?r:e[i].index,r++,r=R(e[i].columns,r)):(e[i].index=t.isNullOrUndefined(e[i].index)?r:e[i].index,r++);return r}function E(e,r){for(var i=0,n=e.length;i<n;i++){var o=void 0;"string"==typeof e[i]?o=new we({field:e[i]}):e[i]instanceof we?o=e[i]:e[i].columns?(e[i].columns=E(e[i].columns),o=new we(e[i])):o=new we(e[i]),o.headerText=t.isNullOrUndefined(o.headerText)?o.foreignKeyValue||o.field||"":o.headerText,o.foreignKeyField=o.foreignKeyField||o.field,o.valueAccessor=("string"==typeof o.valueAccessor?t.getValue(o.valueAccessor,window):o.valueAccessor)||g,o.width=r&&t.isNullOrUndefined(o.width)?200:o.width,t.isNullOrUndefined(o.visible)&&(o.visible=!0),e[i]=o}return e}function T(e,r,i){var n,o=e.querySelector("span"),s=e.parentElement.getBoundingClientRect(),l=r.target.getBoundingClientRect();o.className=i,e.style.display="",n=(t.isNullOrUndefined(r.clientY)?r.changedTouches[0].clientY:r.clientY)>e.offsetHeight+10,e.style.top=l.top-s.top+(n?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=D(e,r,l,s.left)+"px",n?(e.querySelector(".e-downtail").style.display="",e.querySelector(".e-uptail").style.display="none"):(e.querySelector(".e-downtail").style.display="none",e.querySelector(".e-uptail").style.display="")}function D(e,t,r,i){var n=e.offsetWidth/2,o=P(t).x;return o-r.left<n?r.left-i:r.right-o<n?r.right-i-2*n:o-i-n}function I(e){return e instanceof t.ChildProperty?t.getValue("properties",e):e}function O(e,t,r){for(var i=e;i&&(r?i.id!==t:!i.classList.contains(t));)i=i.parentElement;return i}function F(e,t){for(var r=-1,i=0,n=t.length;i<n;i++)if(t[i].isEqualNode(e)){r=i;break}return r}function k(e,t){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}function M(e){for(var t=[],r=0,i=e.length;r<i;r++)e[r].hasOwnProperty("properties")?t.push(e[r].properties):t.push(e[r]);return t}function A(e,r){for(var i=[].slice.call(e.querySelectorAll(r)),n=0;n<i.length;n++)t.remove(i[n])}function P(e){var r={};return r.x=t.isNullOrUndefined(e.clientX)?e.changedTouches[0].clientX:e.clientX,r.y=t.isNullOrUndefined(e.clientY)?e.changedTouches[0].clientY:e.clientY,r}function N(e){return e+zr++}function B(e,t){for(var r=0,i=t.length;r<i;r++)i===t.length?e.appendChild(t[r]):e.appendChild(t[0]);return e}function L(e,t,r){for(var i=e,n=[];i;)(r?i.id===t:i.classList.contains(t))&&n.push(i),i=i.parentElement;return n}function q(e,i,n,o){if("Custom"===e){var s=n.customAggregate;return"string"==typeof s&&(s=t.getValue(s,window)),s?s.call(o,i,n):""}return n.field in i||i instanceof Array?r.DataUtil.aggregates[e.toLowerCase()](i,n.field):null}function z(){if(null!==Hr)return Hr;var e=document.createElement("div"),t=0;return e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth|0,document.body.removeChild(e),Hr=t}function H(e){if(void 0!==ut)return ut;var r=t.createElement("table",{className:"e-table",styles:"visibility: hidden"});r.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(r);var i=r.querySelector("td").getBoundingClientRect();return e.removeChild(r),ut=Math.ceil(i.height)}function U(e){return e.split(".").length>1}function j(e){return void 0===e&&(e=""),e.replace(/\./g,"___")}function V(e){return void 0===e&&(e=""),e.replace(/___/g,".")}function G(e,t,r){var i=O(r,"e-row"),n=!i||i&&!i.classList.contains("e-insertedrow");return"beginEdit"===t&&n?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):("add"!==t||!e.isIdentity)&&!(n&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function _(e){var t=e.element.querySelector("#"+e.element.id+"EditConfirm");return"Batch"===e.editSettings.mode&&e.element.querySelectorAll(".e-updatedtd").length&&e.editSettings.showConfirmDialog&&(!t||t.classList.contains("e-popup-close"))}function K(e,t){e=e instanceof Array?e:[e];for(var r=0;r<e.length;r++)t?e[r].classList.add("e-wrap"):e[r].classList.remove("e-wrap")}function W(e,t){var r=e.getService("valueFormatter");switch(t.type){case"date":t.setFormatter(r.getFormatFunction({type:"date",skeleton:t.format})),t.setParser(r.getParserFunction({type:"date",skeleton:t.format}));break;case"datetime":t.setFormatter(r.getFormatFunction({type:"dateTime",skeleton:t.format})),t.setParser(r.getParserFunction({type:"dateTime",skeleton:t.format}));break;case"number":t.setFormatter(r.getFormatFunction({format:t.format})),t.setParser(r.getParserFunction({format:t.format}))}}function Q(e,r){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];for(var o=0,s=e.length;o<s;o++)r?(t.classList(e[o],i.slice(),[]),e[o].setAttribute("aria-selected","true")):(t.classList(e[o],[],i.slice()),e[o].removeAttribute("aria-selected"))}function J(e){for(var t={},r=[],i=0;i<e.length;i++)e[i]in t||(r.push(e[i].toString()),t[e[i]]=1);return r}function Y(e,t,r){var n=t.element.style.display;t.element.style.display="block";var o,s=t.width;if(r.enableRtl){o=i.calculatePosition(e,"left","bottom"),t.element.style.top=o.top+e.getBoundingClientRect().height-35+"px",t.element.style.display=n;l=o.left-s+e.clientWidth;t.element.style.left=l<1?s+l+-16+"px":l-16+"px"}else{o=i.calculateRelativeBasedPosition(e,t.element),t.element.style.display=n,t.element.style.top=o.top+e.getBoundingClientRect().height-5+"px";var l=o.left-s+e.clientWidth;t.element.style.left=l<1?s+l-16+"px":l+-4+"px"}}function X(e,t){e.popup.element.style.zIndex=(t.zIndex+1).toString()}function $(e){var r=e.querySelector(".e-frame");r.classList.contains("e-check")?t.classList(r,["e-uncheck"],["e-check"]):t.classList(r,["e-check"],["e-uncheck"])}function Z(e,r,i){var n=t.createElement("div",{className:i});return n.appendChild(r),n.setAttribute("uid",e),n}function ee(e,r){t.removeClass([e],["e-check","e-stop","e-uncheck"]),r?e.classList.add("e-check"):e.classList.add("e-uncheck")}function te(e,r,i){r.forEach(function(r){t.setValue(r.field,re(r,i),e.foreignKeyData)}),e.cells.forEach(function(r){r.isForeignKey&&t.setValue("foreignKeyData",t.getValue(r.column.field,e.foreignKeyData),r)})}function re(e,i,n,o){var s=e.foreignKeyField,l=t.isNullOrUndefined(n)?g(e.field,i,e):n;l=t.isNullOrUndefined(l)?"":l;var a=new r.Query,d=o||(e.dataSource instanceof r.DataManager&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return l.getDay?a.where(ne({field:s,operator:"equal",value:l,matchCase:!1})):a.where(s,"==",l,!1),new r.DataManager(d).executeLocal(a)}function ie(e,t){var r;return t.some(function(t){return r=t,t.foreignKeyValue===e})&&r}function ne(e,i){var n,o,s,l=t.extend({},I(e)),a=t.extend({},I(e));if(null===e.value)return n=new r.Predicate(l.field,l.operator,l.value,!1);var d=new Date(e.value);if("equal"===e.operator||"notequal"===e.operator){"datetime"===i?(o=new Date(d.setSeconds(d.getSeconds()-1)),s=new Date(d.setSeconds(d.getSeconds()+2)),e.value=new Date(d.setSeconds(s.getSeconds()-1))):(o=new Date(d.setHours(0)-1),s=new Date(d.setHours(24))),l.value=o,a.value=s,"equal"===e.operator?(l.operator="greaterthan",a.operator="lessthan"):"notequal"===e.operator&&(l.operator="lessthanorequal",a.operator="greaterthanorequal");var c=new r.Predicate(l.field,l.operator,l.value,!1),h=new r.Predicate(a.field,a.operator,a.value,!1);n="equal"===e.operator?c.and(h):c.or(h)}else"string"==typeof l.value&&(l.value=new Date(l.value)),n=new r.Predicate(l.field,l.operator,l.value,!1);return e.setProperties?e.setProperties({ejpredicate:n},!0):e.ejpredicate=n,n}function oe(e,t){for(var r=e.cloneNode(!0),i=0;i<t;i++)r.removeChild(r.children[0]);for(var i=t,n=e.childElementCount;i<n;i++)e.removeChild(e.children[e.childElementCount-1]);return r}function se(e){return e.enableVirtualization&&e.groupSettings.columns.length>0&&e.isVirtualAdaptive}function le(e,r){if(void 0===e&&(e=""),e){for(var i=r,n=e.split("."),o=0;o<n.length&&!t.isNullOrUndefined(i);o++)i=i[n[o]];return i}}function ae(e,r){var i=new t.Internationalization;return"date"===r?"object"==typeof e?i.getDatePattern({type:e.type?e.type:"date",format:e.format},!1):i.getDatePattern({type:"date",skeleton:e},!1):"object"==typeof e?i.getDatePattern({type:e.type?e.type:"dateTime",format:e.format},!1):i.getDatePattern({type:"dateTime",skeleton:e},!1)}function de(e,t){for(var r={},i=0,n=e.getRowsObject();i<n.length;i++){var o=n[i];if(o.isExpand&&!o.isDetailRow){var s=e.allowPaging&&"AllPages"===e.printMode?o.index+e.pageSettings.currentPage*e.pageSettings.pageSize-e.pageSettings.pageSize:o.index;r[s]={},r[s].isExpand=!0,r[s].gridModel=ce(o.childGrid,t),r[s].gridModel.query=e.childGrid.query}}return r}function ce(e,t){void 0===t&&(t="Expanded");var r={};if(!e)return r;for(var i=0,n=Lr.printGridProp;i<n.length;i++){var o=n[i];r[o]="columns"===o?M(e[o]):"allowPaging"===o?"CurrentPage"===e.printMode:I(e[o])}return e.childGrid&&"None"!==t&&(r.expandedRows=de(e,t)),r}function he(e,r,i,n){var o=e||{},s=arguments.length;n&&(s-=1);for(var l=arguments,a=1;a<s;a++)!function(e){if(!l[e])return"continue";var r=l[e];(Object.keys(Object.getPrototypeOf(r)).length?Object.keys(r).concat(pe(r)):Object.keys(r)).forEach(function(e){var i,s=o[e],l=r[e];n&&(t.isObject(l)||Array.isArray(l))?t.isObject(l)?(i=s||{},o[e]=t.extend({},i,l,n)):(i=s||[],o[e]=t.extend([],i,l,n)):o[e]=l})}(a);return o}function pe(e){for(var t=[];Object.getPrototypeOf(e)&&Object.keys(Object.getPrototypeOf(e)).length;)t=t.concat(Object.keys(Object.getPrototypeOf(e))),e=Object.getPrototypeOf(e);return t}function ue(e){for(var t=0,r=0;r<e.length;r++){var i=ge(e[r],0);t<i&&(t=i)}return t+1}function ge(e,t){var r=t,i=[];if(e.columns){t++;for(var n=0;n<e.columns.length;n++)i[n]=ge(e.columns[n],t);for(var o=0;o<i.length;o++)r<i[o]&&(r=i[o]);t=r}return t}function fe(e,t){for(var r=0;r<t.length;r++)t[r].uid=t[r].isForeignKey?ie(t[r].field,e.getForeignKeyColumns()).uid:e.getColumnByField(t[r].field).uid}function me(e,t){e.forEach(function(e){e.columns.forEach(function(r){t(r,e)})})}function ye(e,t,r){var i="Dialog"!==t,n=ae(e.column.format,e.column.type),o=le(e.column.field,e.rowData);return o=o?new Date(o):null,{floatLabelType:i?"Never":"Always",value:o,format:n,placeholder:i?"":e.column.headerText,enableRtl:r,enabled:G(e.column,e.requestType,e.element)}}var ve=function(){function e(e){this.intl=new t.Internationalization,t.isNullOrUndefined(e)||(this.intl.culture=e)}return e.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},e.prototype.getParserFunction=function(e){return e.type?this.intl.getDateParser(e):this.intl.getNumberParser(e)},e.prototype.fromView=function(e,r,i){return"date"!==i&&"datetime"!==i&&"number"!==i||t.isNullOrUndefined(r)?e:r(e)},e.prototype.toView=function(e,r){var i=e;return t.isNullOrUndefined(r)||t.isNullOrUndefined(e)||(i=r(e)),i},e.prototype.setCulture=function(e){t.isNullOrUndefined(e)||t.setCulture(e)},e}(),Ce=function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},we=function(){function e(e){var i=this;this.disableHtmlEncode=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return i.editTemplateFn},this.getFilterTemplate=function(){return i.filterTemplateFn},t.merge(this,e),this.type="none"===this.type?null:this.type?this.type.toLowerCase():this.type,this.editType&&(this.editType=this.editType.toLowerCase()),this.uid=N("grid-column");var n=new ve;if(e.format&&(e.format.skeleton||e.format.format)&&(this.setFormatter(n.getFormatFunction(e.format)),this.setParser(n.getParserFunction(e.format))),this.toJSON=function(){for(var e={},t=["filter","dataSource","headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate"],r=Object.keys(i),n=0;n<r.length;n++)if("columns"===r[n]){e[r[n]]=[];for(var o=0;o<i[r[n]].length;o++)e[r[n]].push(i[r[n]][o].toJSON())}else t.indexOf(r[n])<0&&(e[r[n]]=i[r[n]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=b(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=b(this.headerTemplate)),!t.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=b(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=b(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=b(this.filterTemplate)),this.isForeignColumn()&&(t.isNullOrUndefined(this.editType)||"dropdownedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params=t.extend({dataSource:this.dataSource,query:new r.Query,fields:{value:this.foreignKeyField||this.field,text:this.foreignKeyValue}},this.edit.params)),this.sortComparer){var o=this.sortComparer;this.sortComparer=function(e,t,r,i){if("string"==typeof o&&(o=le(o,window)),"Descending"===this.sortDirection){var n=e;e=t,t=n;var s=r;r=i,i=s}return o(e,t,r,i)}}!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=le(i.foreignKeyValue,re(i,{},e)[0]),t=le(i.foreignKeyValue,re(i,{},t)[0]),"Descending"===i.sortDirection?r.DataUtil.fnDescending(e,t):r.DataUtil.fnAscending(e,t)})}return e.prototype.getSortDirection=function(){return this.sortDirection},e.prototype.setSortDirection=function(e){this.sortDirection=e},e.prototype.setProperties=function(e){for(var t=Object.keys(e),r=0;r<t.length;r++)this[t[r]]=e[t[r]]},e.prototype.isForeignColumn=function(){return!(!this.dataSource||!this.foreignKeyValue)},e.prototype.getFormatter=function(){return this.formatFn},e.prototype.setFormatter=function(e){this.formatFn=e},e.prototype.getParser=function(){return this.parserFn},e.prototype.setParser=function(e){this.parserFn=e},e.prototype.getColumnTemplate=function(){return this.templateFn},e.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},e.prototype.getFilterItemTemplate=function(){return this.fltrTemplateFn},e.prototype.getDomSetter=function(){return this.disableHtmlEncode?"textContent":"innerHTML"},e}(),be=function(){function e(){}return Ce([t.Property()],e.prototype,"title",void 0),Ce([t.Property()],e.prototype,"type",void 0),Ce([t.Property()],e.prototype,"buttonOption",void 0),e}(),Se="actionBegin",xe="actionComplete",Re="dataBound",Ee="columnDragStart",Te="columnDrag",De="columnDrop",Ie="rowDragStartHelper",Oe="rowDragStart",Fe="rowDrag",ke="rowDrop",Me="initial-load",Ae="initial-end",Pe="data-ready",Ne="content-ready",Be="ui-update",Le="on-empty",qe="inbound-model-changed",ze="model-changed",He="colgroup-refresh",Ue="header-refreshed",je="reorder-complete",Ve="key-pressed",Ge="click",_e="destroy",Ke="column-visible-changed",We="column-position-changed",Qe="rows-added",Je="rows-removed",Ye="column-drag-stop",Xe="header-drop",$e="datasource-modified",Ze="refresh-virtual-block",et="toolbar-refresh",tt="auto-col",rt="update-data",it="prevent-batch",nt="dialog-destroy",ot="add-delete-Action",st="freezerender",lt="hierarchyprint",at="expandchildgrid",dt="row-position-changed",ct="columns-prepared",ht="cbox-filter-begin",pt="filter-Prevent";!function(e){e[e.Data=0]="Data",e[e.Header=1]="Header",e[e.Summary=2]="Summary",e[e.GroupSummary=3]="GroupSummary",e[e.CaptionSummary=4]="CaptionSummary",e[e.Filter=5]="Filter",e[e.Indent=6]="Indent",e[e.GroupCaption=7]="GroupCaption",e[e.GroupCaptionEmpty=8]="GroupCaptionEmpty",e[e.Expand=9]="Expand",e[e.HeaderIndent=10]="HeaderIndent",e[e.StackedHeader=11]="StackedHeader",e[e.DetailHeader=12]="DetailHeader",e[e.DetailExpand=13]="DetailExpand",e[e.CommandColumn=14]="CommandColumn",e[e.DetailFooterIntent=15]="DetailFooterIntent",e[e.RowDragIcon=16]="RowDragIcon",e[e.RowDragHIcon=17]="RowDragHIcon"}(e.CellType||(e.CellType={})),function(e){e[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary"}(e.RenderType||(e.RenderType={})),function(e){e[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e[e.Cancel=4]="Cancel",e[e.Print=5]="Print",e[e.Search=6]="Search",e[e.ColumnChooser=7]="ColumnChooser",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.WordExport=11]="WordExport"}(e.ToolbarItem||(e.ToolbarItem={}));var ut,gt=function(){function e(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Qe,this.addRows,this),this.parent.on(dt,this.reorderRows,this),this.parent.on(Je,this.removeRows,this),this.parent.on($e,this.initDataManager,this),this.parent.on(_e,this.destroy,this),this.parent.on(rt,this.crudActions,this),this.parent.on(ot,this.getData,this),this.parent.on(tt,this.refreshFilteredCols,this),this.parent.on(ct,this.refreshFilteredCols,this))}return e.prototype.reorderRows=function(e){this.dataManager.dataSource.json.splice(e.toIndex,0,this.dataManager.dataSource.json.splice(e.fromIndex,1)[0])},e.prototype.getModuleName=function(){return"data"},e.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof r.DataManager?e.dataSource:t.isNullOrUndefined(e.dataSource)?new r.DataManager:new r.DataManager(e.dataSource),e.setProperties({query:e.query instanceof r.Query?e.query:new r.Query},!0)},e.prototype.generateQuery=function(e){var t=this.parent.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)t.select(this.parent.getColumns().filter(function(e){return!(!0!==e.isPrimaryKey&&!1===e.visible||void 0===e.field)}).map(function(e){return e.field}));else if("Schema"===this.parent.columnQueryMode){for(var r=[],i=this.parent.columns,n=0;n<i.length;n++)r.push(i[n].field);t.select(r)}return this.filterQuery(t),this.searchQuery(t),this.aggregateQuery(t),this.sortQuery(t),se(this.parent)?this.virtualGroupPageQuery(t):this.pageQuery(t,e),this.groupQuery(t),t},e.prototype.aggregateQuery=function(e,t){return this.parent.aggregates.forEach(function(t){t.columns.forEach(function(t){(t.type instanceof Array?t.type:[t.type]).forEach(function(r){return e.aggregate(r.toLowerCase(),t.field)})})}),e},e.prototype.virtualGroupPageQuery=function(e){this.parent;if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[t].fn&&e.queries.splice(t,1);return e},e.prototype.pageQuery=function(e,t){var r=this.parent;if((r.allowPaging||r.enableVirtualization)&&!0!==t){if(r.pageSettings.currentPage=Math.max(1,r.pageSettings.currentPage),r.pageSettings.pageCount<=0&&(r.pageSettings.pageCount=8),r.pageSettings.pageSize<=0&&(r.pageSettings.pageSize=12),e.queries.length)for(var i=0;i<e.queries.length;i++)"onPage"===e.queries[i].fn&&e.queries.splice(i,1);e.page(r.pageSettings.currentPage,r.pageSettings.pageSize)}return e},e.prototype.groupQuery=function(e){var t=this.parent;if(t.allowGrouping&&t.groupSettings.columns.length)for(var r=t.groupSettings.columns,i=0,n=r.length;i<n;i++){var o=this.getColumnByField(r[i]);o||this.parent.log("initial_action",{moduleName:"group",columnName:r[i]});var s=o.enableGroupByFormat,l=o.format;s?e.group(r[i],this.formatGroupColumn.bind(this),l):e.group(r[i],null)}return e},e.prototype.sortQuery=function(e){var t=this.parent;if((t.allowSorting||t.allowGrouping)&&t.sortSettings.columns.length){for(var r=t.sortSettings.columns,i=[],n=r.length-1;n>-1;n--){var o=this.getColumnByField(r[n].field);if(!o)return this.parent.log("initial_action",{moduleName:"sort",columnName:r[n].field}),e;o.setSortDirection(r[n].direction);var s=r[n].direction;o.sortComparer&&(this.parent.log("grid_sort_comparer"),s=this.isRemote()?r[n].direction:o.sortComparer.bind(o)),-1===t.groupSettings.columns.indexOf(r[n].field)?e.sortBy(o.field,s):i.push({direction:s,field:o.field})}for(var n=0,l=i.length;n<l;n++)e.sortBy(i[n].field,i[n].direction)}return e},e.prototype.searchQuery=function(e){var t=this,i=this.parent.searchSettings,n=i.fields.length?i.fields:this.getSearchColumnFieldNames(),o=[];return this.parent.searchSettings.key.length&&(!this.parent.getForeignKeyColumns().some(function(e){return n.indexOf(e.field)>-1})||this.dataManager.adaptor.getModulename&&"ODataV4Adaptor"===this.dataManager.adaptor.getModulename()?e.search(i.key,n,i.operator,i.ignoreCase,i.ignoreAccent):(n.forEach(function(e){var n=t.getColumnByField(e);n.isForeignColumn()?o=t.fGeneratePredicate(n,o):o.push(new r.Predicate(n.field,i.operator,i.key,i.ignoreCase,i.ignoreAccent))}),e.where(r.Predicate.or(o)))),e},e.prototype.filterQuery=function(e,t,i){var n=this.parent,o=[],s=[],l=this.parent.getForeignKeyColumns();if(n.allowFiltering&&n.filterSettings.columns.length){for(var a=t||n.filterSettings.columns,d={},c=0,h=n.getColumns();c<h.length;c++)d[(w=h[c]).field]=w.filter.type?w.filter.type:n.filterSettings.type;for(var p=[],u=[],g=0,f=a;g<f.length;g++)"CheckBox"===d[(w=f[g]).field]||"Excel"===d[w.field]?p.push(w):u.push(w);if(p.length)for(var m=Ur.getPredicate(p),y=0,v=Object.keys(m);y<v.length;y++){var C=v[y],w=void 0;this.parent.getColumnByField(C).isForeignColumn()&&(w=ie(C,l)),w||this.parent.log("initial_action",{moduleName:"filter",columnName:C}),w&&!i?(o=this.fGeneratePredicate(w,o),s.push(w)):o.push(m[C])}if(u.length)for(var b=0,S=u;b<S.length;b++){(w=S[b]).uid=w.uid||this.parent.grabColumnByFieldFromAllCols(w.field).uid;var x=this.parent.grabColumnByUidFromAllCols(w.uid);x||this.parent.log("initial_action",{moduleName:"filter",columnName:w.field});var R=x.type;x.isForeignColumn()&&ie(w.field,l)&&!i?(s.push(w),o=this.fGeneratePredicate(x,o)):"date"!==R&&"datetime"!==R?o.push(new r.Predicate(w.field,w.operator,w.value,!w.matchCase,this.parent.filterSettings.ignoreAccent)):o.push(ne(w,R))}o.length?e.where(r.Predicate.and(o)):this.parent.notify("showEmptyGrid",{})}return e},e.prototype.fGeneratePredicate=function(e,t){var r={};return e&&(this.parent.notify("generateQuery",{predicate:r,column:e}),r.predicate.predicates.length&&t.push(r.predicate)),t},e.prototype.getData=function(e,r){var i=this;void 0===e&&(e={requestType:""});var n=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());if(this.parent.log("datasource_syntax_mismatch",{dataState:this.parent}),this.parent.dataSource&&"result"in this.parent.dataSource)return this.eventPromise(e,r,n).promise;var o=void 0;switch(e.requestType){case"delete":if(r=r||this.generateQuery(),1===Object.keys(e.data).length)o=this.dataManager.remove(n,e.data[0],r.fromTable,r);else{var s={addedRecords:[],deletedRecords:[],changedRecords:[]};s.deletedRecords=e.data,o=this.dataManager.saveChanges(s,n,r.fromTable,r.requiresCount())}break;case"save":r=r||this.generateQuery(),e.index=t.isNullOrUndefined(e.index)?0:e.index,o=this.dataManager.insert(e.data,r.fromTable,r,e.index)}return!o||Array.isArray(o)||o.hasOwnProperty("deletedRecords")?this.insert(r,e):o.then(function(t){return i.insert(r,e)})},e.prototype.insert=function(e,t){return"save"===t.requestType&&this.parent.notify("recordAdded",t),this.executeQuery(e)},e.prototype.executeQuery=function(e){var t=this;if(this.dataManager.ready){var i=new r.Deferred;return this.dataManager.ready.then(function(r){t.dataManager.executeQuery(e).then(function(e){i.resolve(e)})}).catch(function(e){i.reject(e)}),i.promise}return this.dataManager.executeQuery(e)},e.prototype.formatGroupColumn=function(e,r){this.parent;var i=this.serviceLocator,n=this.getColumnByField(r),o=e;return n.type||(n.type=o.getDay?o.getHours()>0||o.getMinutes()>0||o.getSeconds()>0||o.getMilliseconds()>0?"datetime":"date":typeof e),t.isNullOrUndefined(n.getFormatter())&&W(i,n),ve.prototype.toView(e,n.getFormatter())},e.prototype.crudActions=function(e){var t=this.generateQuery(),r=null,i="promise",n=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());switch(this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,t,n),e.requestType){case"save":r=this.dataManager.update(n,e.data,t.fromTable,t,e.previousData)}e[i]=r||e[i],this.parent.notify("crud-Action",e)},e.prototype.saveChanges=function(e,t,i,n){if(void 0===n&&(n=this.generateQuery()),n.requiresCount(),"result"in this.parent.dataSource){this.getStateEventArgument(n);var o=new r.Deferred,s={requestType:"batchsave",changes:e,key:t,query:n,endEdit:o.resolve};return this.setState({isPending:!0,resolver:o.resolve}),this.parent.trigger("dataSourceChanged",s),o.promise}return this.dataManager.saveChanges(e,t,n.fromTable,n,i)},e.prototype.getKey=function(e){if(e&&e.length)return e[0]},e.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},e.prototype.addRows=function(e){for(var t=e.records.length;t>0;t--)this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1])},e.prototype.removeRows=function(e){var t=this.dataManager.dataSource.json;this.dataManager.dataSource.json=t.filter(function(t,r){return-1===e.records.indexOf(t)})},e.prototype.getColumnByField=function(e){var t;return this.parent.columnModel.some(function(r){return t=r,r.field===e})&&t},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Qe,this.addRows),this.parent.off(Je,this.removeRows),this.parent.off($e,this.initDataManager),this.parent.off(_e,this.destroy),this.parent.off(rt,this.crudActions),this.parent.off(ot,this.getData),this.parent.off(tt,this.refreshFilteredCols),this.parent.off(ct,this.refreshFilteredCols))},e.prototype.getState=function(){return this.dataState},e.prototype.setState=function(e){return this.dataState=e},e.prototype.getStateEventArgument=function(e){var i=new r.UrlAdaptor,n=new r.DataManager({url:"",adaptor:new r.UrlAdaptor}),o=i.processQuery(n,e),s=JSON.parse(o.data);return t.extend(s,o.pvtData)},e.prototype.eventPromise=function(e,t,i){var n,o=this,s=e;n=this.getStateEventArgument(t);var l=new r.Deferred,a=new r.Deferred;if(void 0!==e.requestType&&!1!==this.dataState.isDataChanged)if(n.action=e,"save"===e.requestType||"delete"===e.requestType){var d=e;d.key=i;d.promise=a.promise,d.state=n,this.setState({isPending:!0,resolver:a.resolve}),s.endEdit=a.resolve,s.cancelEdit=a.reject,this.parent.trigger("dataSourceChanged",d),a.promise.then(function(e){o.setState({isPending:!0,resolver:l.resolve,group:n.group,aggregates:n.aggregates}),"save"===d.requestType&&o.parent.notify("recordAdded",d),o.parent.trigger("dataStateChange",n)}).catch(function(){})}else this.setState({isPending:!0,resolver:l.resolve,group:n.group,aggregates:n.aggregates}),this.parent.trigger("dataStateChange",n);else this.setState({}),l.resolve(this.parent.dataSource);return l},e.prototype.getSearchColumnFieldNames=function(){for(var e=[],r=0,i=this.parent.getColumns();r<i.length;r++){var n=i[r];n.allowSearching&&!t.isNullOrUndefined(n.field)&&e.push(n.field)}return e},e.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&fe(this.parent,this.parent.filterSettings.columns)},e}(),ft=function(){function e(e){t.merge(this,e)}return e.prototype.clone=function(){var r=new e({});return t.merge(r,this),r.cells=this.cells.map(function(e){return e.clone()}),r},e}(),mt=function(){function e(e){this.isSpanned=!1,this.isRowSpanned=!1,t.merge(this,e)}return e.prototype.clone=function(){var r=new e({});return t.merge(r,this),r},e}(),yt=function(){function r(e,t){this.serviceLocator=e,this.parent=t}return r.prototype.render=function(r,i,n,o){var s,l=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(i.cells[n].cellType||e.CellType.Data),a=i.cells[n].cellSpan?i.cells[n].cellSpan:r.colSpan+n<=i.cells.length?r.colSpan:i.cells.length-n,d=r.rowSpan,c=0;if(i.index>0){var h=this.parent.groupSettings.columns.length>0&&!this.parent.getRowsObject()[i.index-1].isDataRow?this.parent.getRowsObject()[i.index].cells:this.parent.getRowsObject()[i.index-1].cells,p=i.cells[n];s=h.filter(function(e){return e.column.uid===p.column.uid})[0]}for(var u=s&&s.colSpanRange>1&&s.rowSpanRange>1?s.colSpanRange:a,g=n+1;g<n+u&&g<i.cells.length;g++)!1===i.cells[g].visible?c++:i.cells[g].isSpanned=!0;if(c>0){for(g=n+a;g<n+a+c&&g<i.cells.length;g++)i.cells[g].isSpanned=!0;n+a+c>=i.cells.length&&(a-=n+a+c-i.cells.length)}return i.cells[n].cellSpan&&(i.data[r.column.field]=i.cells[n].spanText,o=l.render(i.cells[n],i.data,{index:t.isNullOrUndefined(i.index)?"":i.index.toString()})),a>1&&t.attributes(o,{colSpan:a.toString(),"aria-colSpan":a.toString()}),d>1&&(t.attributes(o,{rowspan:d.toString(),"aria-rowspan":d.toString()}),i.cells[n].isRowSpanned=!0,i.cells[n].rowSpanRange=Number(d),a>1&&(i.cells[n].colSpanRange=Number(a))),i.index>0&&s.rowSpanRange>1&&(i.cells[n].isSpanned=!0,i.cells[n].rowSpanRange=Number(s.rowSpanRange-1),i.cells[n].colSpanRange=s.rowSpanRange>0?s.colSpanRange:1),!this.parent.enableColumnVirtualization||i.cells[n].cellSpan||this.containsKey(r.column.field,r.data[r.column.field])||this.backupMergeCells(r.column.field,r.data[r.column.field],r.colSpan),o},r.prototype.backupMergeCells=function(e,t,r){this.setMergeCells(this.generteKey(e,t),r)},r.prototype.generteKey=function(e,t){return e+"__"+t.toString()},r.prototype.splitKey=function(e){return e.split("__")},r.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},r.prototype.getMergeCells=function(){return this.parent.mergeCells},r.prototype.setMergeCells=function(e,t){this.parent.mergeCells[e]=t},r.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),r=0,i=Object.keys(t);r<i.length;r++){var n=i[r],o=t[n],s=this.splitKey(n),l=this.getIndexFromAllColumns(s[0]),a=this.parent.getColumnIndexesInView(),d=o-(a[0]-l);if(l<a[0]&&d>1)for(var c=0,h=e;c<h.length;c++){var p=h[c];if(p.data[s[0]].toString()===s[1].toString()){p.cells[0].cellSpan=d,p.cells[0].spanText=s[1];break}}}return e},r.prototype.getIndexFromAllColumns=function(e){return C(this.parent.getVisibleColumns(),function(t,r){if(t.field===e)return r})[0]},r}(),vt=function(){function r(e,t,r){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=r,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}return r.prototype.render=function(e,t,r,i,n){return this.refreshRow(e,t,r,i,n)},r.prototype.refresh=function(e,t,r,i,n){r&&(e.data=he({},e.changes),this.refreshMergeCells(e));var o=this.parent.element.querySelector("[data-uid="+e.uid+"]"),s=this.refreshRow(e,t,i,n,null,r),l=[].slice.call(s.cells);o.innerHTML="";for(var a=0,d=l;a<d.length;a++){var c=d[a];o.appendChild(c)}},r.prototype.refreshRow=function(r,i,n,o,s,l){var a=t.isNullOrUndefined(s)?this.element.cloneNode():s,d={data:r.data},c={data:r.data},h=t.extend({},n,{}),p=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],u=!1;p&&(u=le(p.field,d.data)),r.isDataRow&&(r.isSelected=this.parent.getSelectedRowIndexes().indexOf(r.index)>-1||u),r.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(r.isSelected=!0,-1===this.parent.getSelectedRowIndexes().indexOf(r.index)&&this.parent.getSelectedRowIndexes().push(r.index)),this.buildAttributeFromRow(a,r),t.attributes(a,h),S(a,r.attributes);for(var g=this.serviceLocator.getService("cellRendererFactory"),f=this,m=0,y=r.cells.length;m<y;m++)!function(i,n){var o=r.cells[i];o.isSelected=r.isSelected;var s=g.getCellRenderer(r.cells[i].cellType||e.CellType.Data),d={index:t.isNullOrUndefined(r.index)?"":r.index.toString()};r.isExpand&&r.cells[i].cellType===e.CellType.DetailExpand&&(d.class=f.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand");var h=s.render(r.cells[i],r.data,d,r.isExpand,l);if(r.cells[i].cellType!==e.CellType.Filter){if(r.cells[i].cellType===e.CellType.Data||r.cells[i].cellType===e.CellType.CommandColumn){f.parent.trigger("queryCellInfo",t.extend(c,{cell:h,column:o.column,colSpan:1,rowSpan:1,foreignKeyData:r.cells[i].foreignKeyData,requestType:f.parent.requestTypeAction}));var p=!1;if(r.index>0&&f.isSpan){var u=(f.parent.groupSettings.columns.length>0&&!f.parent.getRowsObject()[r.index-1].isDataRow?f.parent.getRowsObject()[r.index].cells:f.parent.getRowsObject()[r.index-1].cells).filter(function(e){return e.column.uid===r.cells[i].column.uid})[0];p=u.isRowSpanned?u.isRowSpanned:u.rowSpanRange>1}(c.colSpan>1||r.cells[i].cellSpan>1||c.rowSpan>1||p)&&(f.isSpan=!0,h=new yt(f.serviceLocator,f.parent).render(c,r,i,h))}r.cells[i].isSpanned||a.appendChild(h)}}(m);var v={row:a,rowHeight:this.parent.rowHeight};if(r.isDataRow&&(this.parent.trigger("rowDataBound",t.extend(d,v)),this.parent.childGrid||this.parent.isRowDragable()||this.parent.detailTemplate)){var C=a.querySelectorAll(".e-rowcell:not(.e-hide)")[0];C&&C.classList.add("e-detailrowvisible")}if(this.parent.enableVirtualization&&(d.rowHeight=this.parent.rowHeight),d.rowHeight?a.style.height=d.rowHeight+"px":this.parent.rowHeight&&(a.querySelector(".e-headercell")||a.querySelector(".e-groupcaption"))&&(a.style.height=this.parent.rowHeight+"px"),r.cssClass&&a.classList.add(r.cssClass),this.parent.element.scrollHeight>this.parent.height&&this.parent.aggregates.length)for(m=0;m<this.parent.aggregates.length;m++){if(this.parent.aggregates[m].properties.columns[0].footerTemplate){var w=a.querySelectorAll(".e-summarycell");if(w.length){var b=w[w.length-1];t.addClass([b],["e-lastsummarycell"])}}}return a},r.prototype.refreshMergeCells=function(e){for(var t=0,r=e.cells;t<r.length;t++)r[t].isSpanned=!1;return e},r.prototype.buildAttributeFromRow=function(e,r){var i={},n={rowindex:"aria-rowindex",dataUID:"data-uid",ariaSelected:"aria-selected"},o=[];r.isDataRow&&o.push("e-row"),r.isAltRow&&o.push("e-altrow"),t.isNullOrUndefined(r.index)||(i[n.rowindex]=r.index),r.rowSpan&&(i.rowSpan=r.rowSpan),r.uid&&(i[n.dataUID]=r.uid),r.isSelected&&(i[n.ariaSelected]=!0),!1===r.visible&&o.push("e-hide"),i.class=o,S(e,i)},r}(),Ct=function(){function r(e){this.parent=e}return r.prototype.generateRows=function(e,t){for(var r=[],i=this.parent.enableVirtualization?t.startIndex:0,n=0,o=Object.keys(e).length;n<o;n++,i++)r[n]=this.generateRow(e[n],i);return r},r.prototype.ensureColumns=function(){var t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&t.push(this.generateCell({},null,e.CellType.DetailExpand)),this.parent.isRowDragable()&&t.push(this.generateCell({},null,e.CellType.RowDragIcon)),t},r.prototype.generateRow=function(e,t,r,i,n,o){var s={};s.foreignKeyData={},s.uid=N("grid-row"),s.data=e,s.index=t,s.indent=i,s.tIndex=o,s.isDataRow=!0,s.parentGid=n,this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?s.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[t]&&(s.isExpand=this.parent.expandedRows[t].isExpand)),s.cssClass=r,s.isAltRow=!!this.parent.enableAltRow&&t%2!=0,s.isSelected=this.parent.getSelectedRowIndexes().indexOf(t)>-1,this.refreshForeignKeyRow(s);var l=this.ensureColumns(),a=new ft(s);return a.cells=l.concat(this.generateCells(s)),a},r.prototype.refreshForeignKeyRow=function(e){this.parent.getForeignKeyColumns().forEach(function(r){t.setValue(r.field,re(r,e.data),e.foreignKeyData)})},r.prototype.generateCells=function(r){var i=this,n=[];return this.parent.getColumns().forEach(function(o,s){return n.push(i.generateCell(o,r.uid,t.isNullOrUndefined(o.commands)?void 0:e.CellType.CommandColumn,null,s,r.foreignKeyData))}),n},r.prototype.generateCell=function(r,i,n,o,s,l){var a={visible:r.visible,isDataCell:!t.isNullOrUndefined(r.field||r.template),isTemplate:!t.isNullOrUndefined(r.template),rowID:i,column:r,cellType:t.isNullOrUndefined(n)?e.CellType.Data:n,colSpan:o,commands:r.commands,isForeignKey:r.isForeignColumn&&r.isForeignColumn(),foreignKeyData:r.isForeignColumn&&r.isForeignColumn()&&t.getValue(r.field,l)};return(a.isDataCell||"checkbox"===a.column.type)&&(a.index=s),new mt(a)},r.prototype.refreshRows=function(e){var t=this;return e.forEach(function(e){t.refreshForeignKeyRow(e),e.cells=t.generateCells(e)}),e},r}(),wt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),bt=function(){function r(e){this.parent=e}return r.prototype.getData=function(){var e=this,t=[];return this.parent.aggregates.slice().forEach(function(r){var i=r.columns.filter(function(t){return!(t.footerTemplate||t.groupFooterTemplate||t.groupCaptionTemplate)||e.columnSelector(t)});i.length&&t.push({columns:i})}),t},r.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},r.prototype.getColumns=function(e,r){var i=[];return this.parent.allowGrouping&&this.parent.groupSettings.columns.forEach(function(e){return i.push(new we({}))}),(this.parent.detailTemplate||!t.isNullOrUndefined(this.parent.childGrid)||this.parent.isRowDragable())&&i.push(new we({})),i.push.apply(i,this.parent.getColumns()),t.isNullOrUndefined(e)?i:i.slice(e,r)},r.prototype.generateRows=function(e,t,r,i){var n=this;if(0===this.parent.currentViewData.length)return[];var o=this.buildSummaryData(e,t),s=[];return this.getData().forEach(function(e,l){s.push(n.getGeneratedRow(e,o[l],t?t.level:void 0,r,i))}),s},r.prototype.getGeneratedRow=function(r,i,n,o,s){var l=this,a=[],d=this.getIndentByLevel(n),c=!t.isNullOrUndefined(this.parent.childGrid),h=this.parent.groupSettings.columns.length+(this.parent.detailTemplate||!t.isNullOrUndefined(this.parent.childGrid)?1:0);this.parent.isRowDragable()&&(h++,d=["e-indentcelltop"]),this.getColumns(o,s).forEach(function(t,i){return a.push(l.getGeneratedCell(t,r,i>=h?l.getCellType():i<l.parent.groupSettings.columns.length?e.CellType.Indent:e.CellType.DetailFooterIntent,d[i],c))});var p=new ft({data:i,attributes:{class:"e-summaryrow"}});return p.cells=a,p.uid=N("grid-row"),p.visible=a.some(function(e){return e.isDataCell&&e.visible}),p},r.prototype.getGeneratedCell=function(e,r,i,n,o){var s=r.columns.filter(function(t){return t.columnName===e.field})[0],l={style:{textAlign:e.textAlign},"e-mappinguid":e.uid,index:e.index};n&&(l.class=n),t.isNullOrUndefined(n)&&o&&(l.class="e-detailindentcelltop");var a={visible:e.visible,isDataCell:!t.isNullOrUndefined(s),isTemplate:s&&!t.isNullOrUndefined(s.footerTemplate||s.groupFooterTemplate||s.groupCaptionTemplate),column:s||{},attributes:l,cellType:i};return new mt(a)},r.prototype.buildSummaryData=function(e,t){var r=this,i=[],n={};return this.getData().forEach(function(o){n={},o.columns.forEach(function(i){n=r.setTemplate(i,t&&t.aggregates?t:e,n)}),i.push(n)}),i},r.prototype.getIndentByLevel=function(e){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},r.prototype.setTemplate=function(e,r,i){var n=this,o=e.type,s={},l=e.getFormatter()||function(){return function(e){return e}}(),a=r;return o instanceof Array||(o=[e.type]),o.forEach(function(o){var s=e.field+" - "+o.toLowerCase(),d=e.columnName,c="Custom"!==o&&a.aggregates&&s in a.aggregates?a.aggregates[s]:q(o,a.aggregates?a:r,e,n.parent);i[d]=i[d]||{},i[d][s]=c,i[d][o]=t.isNullOrUndefined(c)?" ":l(c),a.field&&(i[d].field=a.field,i[d].key=a.key)}),s.format=e.getFormatter(),e.setTemplate(s),i},r.prototype.getCellType=function(){return e.CellType.Summary},r}(),St=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return wt(r,t),r.prototype.columnSelector=function(e){return void 0!==e.groupFooterTemplate},r.prototype.getIndentByLevel=function(e){return void 0===e&&(e=this.parent.groupSettings.columns.length),this.parent.groupSettings.columns.map(function(t,r){return r<=e-1?"":"e-indentcelltop"})},r.prototype.getCellType=function(){return e.CellType.GroupSummary},r}(bt),xt=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return wt(r,t),r.prototype.columnSelector=function(e){return void 0!==e.groupCaptionTemplate},r.prototype.getData=function(){var e={columns:[]};return[t.prototype.getData.call(this).reduce(function(e,t){return e.columns=e.columns.concat(t.columns),e},e)]},r.prototype.isEmpty=function(){return 0===(this.getData()[0].columns||[]).length},r.prototype.getCellType=function(){return e.CellType.CaptionSummary},r}(bt),Rt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Et=function(r){function i(e){var t=r.call(this,e)||this;return t.rows=[],t.index=0,t.parent=e,t.summaryModelGen=new St(e),t.captionModelGen=new xt(e),t}return Rt(i,r),i.prototype.generateRows=function(e,t){if(0===this.parent.groupSettings.columns.length)return r.prototype.generateRows.call(this,e,t);this.rows=[],this.index=this.parent.enableVirtualization?t.startIndex:0;for(var i=0,n=e.length;i<n;i++)this.getGroupedRecords(0,e[i],e.level,i,void 0,this.rows.length);return this.index=0,this.rows},i.prototype.getGroupedRecords=function(e,r,i,n,o,s){var l,a=i;if(t.isNullOrUndefined(r.items))if(t.isNullOrUndefined(r.GroupGuid))this.rows=this.rows.concat(this.generateDataRows(r,e,n,this.rows.length));else for(var d=0,c=r.length;d<c;d++)this.getGroupedRecords(e,r[d],r.level,n,e,this.rows.length);else if(this.rows=this.rows.concat(this.generateCaptionRow(r,e,n,o,s)),r.items&&r.items.length&&this.getGroupedRecords(e+1,r.items,r.items.level,n,e+1,this.rows.length),this.parent.aggregates.length){var h=this.rows.length;(l=this.rows).push.apply(l,this.summaryModelGen.generateRows(r,{level:a}));for(var p=h-1;p>=0;p--)if(this.rows[p].isCaptionRow)this.rows[p].aggregatesCount=this.rows.length-h;else if(!this.rows[p].isCaptionRow&&!this.rows[p].isDataRow)break}},i.prototype.getCaptionRowCells=function(r,i,n){var o=this,s=[],l=[],a=this.parent.getColumnByField(r),d=this.parent.getColumnIndexesInView();this.parent.enableColumnVirtualization&&(a=this.parent.columns.filter(function(e){return e.field===r})[0]);var c=this.parent.groupSettings.columns.length,h=this.parent;if(!this.parent.enableColumnVirtualization||-1!==d.indexOf(i)){for(var p=0;p<i;p++)s.push(this.generateIndentCell());s.push(this.generateCell({},null,e.CellType.Expand))}if(i=this.parent.enableColumnVirtualization?1:this.parent.getVisibleColumns().length+c+(h.detailTemplate||h.childGrid?1:0)-i+(this.parent.getVisibleColumns().length?-1:0),this.parent.aggregates.length&&!this.captionModelGen.isEmpty()){var u=this.captionModelGen.generateRows(n)[0];t.extend(n,u.data);var g=0;u.cells.some(function(e,t){return g=t,e.visible&&e.isDataCell}),l=u.cells.slice(g).filter(function(e){return e.visible}),u.visible&&l[0].column.field===this.parent.getVisibleColumns()[0].field&&(l=l.slice(1)),1===this.parent.getVisibleColumns().length&&(l=[]),i-=l.length}var f=!0;return(this.parent.enableColumnVirtualization?this.parent.getColumns():[a]).forEach(function(t,r){var n=f&&-1!==d.indexOf(i);n&&(f=!1);var l=!o.parent.enableColumnVirtualization||n?e.CellType.GroupCaption:e.CellType.GroupCaptionEmpty;i=o.parent.enableColumnVirtualization&&l===e.CellType.GroupCaption?i+c:i,h.isRowDragable()&&i++,s.push(o.generateCell(a,null,l,i))}),s.push.apply(s,l),s},i.prototype.generateCaptionRow=function(e,r,i,n,o){var s={},l=this.parent.getColumnByField(e.field);s.data=t.extend({},e),l&&(s.data.field=e.field),s.isDataRow=!1,s.isExpand=!0,s.parentGid=i,s.childGid=n,s.tIndex=o,s.isCaptionRow=!0,s.gSummary=t.isNullOrUndefined(e.items.records)?e.items.length:e.items.records.length,s.uid=N("grid-row");var a=new ft(s);return a.indent=r,this.getForeignKeyData(a),a.cells=this.getCaptionRowCells(e.field,r,a.data),a},i.prototype.getForeignKeyData=function(e){var r=e.data,i=this.parent.getColumnByField(r.field);if(i&&i.isForeignColumn&&i.isForeignColumn()){var n=t.isNullOrUndefined(r.key)?"":i.valueAccessor(i.foreignKeyValue,re(i,{},r.key)[0],i);t.setValue("foreignKey",n,e.data)}},i.prototype.generateDataRows=function(e,t,r,i){for(var n=[],o=this.parent.getColumnIndexesInView(),s=0,l=e.length;s<l;s++,i++){n[s]=this.generateRow(e[s],this.index,s?void 0:"e-firstchildrow",t,r,i);for(var a=0;a<t;a++)this.parent.enableColumnVirtualization&&-1===o.indexOf(t)||n[s].cells.unshift(this.generateIndentCell());this.index++}return n},i.prototype.generateIndentCell=function(){return this.generateCell({},null,e.CellType.Indent)},i.prototype.refreshRows=function(e){var t=this,r=this.parent.getColumnIndexesInView();return e.forEach(function(e){if(e.isDataRow){e.cells=t.generateCells(e);for(var i=0;i<e.indent;i++)t.parent.enableColumnVirtualization&&-1===r.indexOf(e.indent)||e.cells.unshift(t.generateIndentCell())}else{var n=t.generateCaptionRow(e.data,e.indent);e.cells=n.cells}}),e},i}(Ct),Tt=function(){function e(e,r){var i=this;this.rows=[],this.freezeRows=[],this.movableRows=[],this.freezeRowElements=[],this.isLoaded=!0,this.drop=function(e){i.parent.notify(De,{target:e.target,droppedElement:e.droppedElement}),t.remove(e.droppedElement)},this.rafCallback=function(e){var t=e;return function(){if(i.ariaService.setBusy(i.getPanel().firstChild,!1),!i.parent.isDestroyed){var r=i.rows.slice(0);if(0!==i.parent.getFrozenColumns()&&(r=e.isFrozen?i.freezeRows:i.movableRows),i.parent.notify(Ne,{rows:r,args:t}),i.isLoaded&&(i.parent.trigger(Re,{}),i.parent.allowTextWrap&&i.parent.notify(st,{case:"textwrap"}),0===i.parent.getFrozenColumns()||i.parent.allowTextWrap||i.parent.notify(st,{case:"refreshHeight"})),t){var n=(t.requestType||"").toLowerCase()+"-complete";i.parent.notify(n,t),"batchsave"===e.requestType&&(e.cancel=!1,i.parent.trigger(xe,e))}i.isLoaded&&i.parent.hideSpinner()}}},this.parent=e,this.serviceLocator=r,this.ariaService=this.serviceLocator.getService("ariaService"),this.generator=this.getModelGenerator(),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.enableVirtualization||this.parent.on(Ke,this.setVisible,this),this.parent.on(He,this.colGroupRefresh,this),this.parent.on(Be,this.enableAfterRender,this))}return e.prototype.renderPanel=function(){var e=this.parent,t=this.parent.createElement("div",{className:"e-gridcontent"}),r=this.parent.createElement("div",{className:"e-content"});this.ariaService.setOptions(r,{busy:!1}),t.appendChild(r),this.setPanel(t),e.element.appendChild(t)},e.prototype.renderTable=function(){var e=this.getPanel(),r=e.querySelector(".e-virtualtable"),i=e.querySelector(".e-virtualtrack");!this.parent.enableVirtualization||t.isNullOrUndefined(r)||t.isNullOrUndefined(i)||(t.remove(r),t.remove(i)),e.appendChild(this.createContentTable("_content_table")),this.setTable(e.querySelector(".e-table")),this.ariaService.setOptions(this.getTable(),{multiselectable:"Multiple"===this.parent.selectionSettings.type}),this.initializeContentDrop(),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont")},e.prototype.createContentTable=function(e){var r=this.getPanel().firstChild;this.getTable()&&t.remove(this.getTable());var i=this.parent.createElement("table",{className:"e-table",attrs:{cellspacing:"0.25px",role:"grid",id:this.parent.element.id+e}});return this.setColGroup(this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0)),i.appendChild(this.getColGroup()),i.appendChild(this.parent.createElement("tbody")),r.appendChild(i),r},e.prototype.splitRows=function(e){this.parent.getFrozenColumns()&&(0===e?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):this.movableRows=this.rows)},e.prototype.refreshContentRows=function(e){var r=this;void 0===e&&(e={});var i=this.parent;if(0!==i.currentViewData.length){var n,o,s,l=i.currentViewData,a=document.createDocumentFragment(),d=document.createDocumentFragment(),c=i.getColumns(),h=i.getFrozenColumns(),p=new vt(this.serviceLocator,null,this.parent);this.rowElements=[],this.rows=[];var u=this.getPanel().querySelector(".e-frozencontent"),g=this.getPanel().querySelector(".e-movablecontent"),m=this.getPanel().querySelector(".e-content");se(i)&&["sorting","filtering","searching","grouping","ungrouping","reorder"].some(function(t){return e.requestType===t})&&(i.vcRows=[],i.vRows=[]);var y=this.generator.generateRows(l,e);t.isNullOrUndefined(y[0].cells[0])&&(g.querySelector("tbody").innerHTML="");var v=y[0].cells[0].index;if(this.parent.registeredTemplate&&this.parent.registeredTemplate.template&&!e.isFrozen){for(var C=[],w=0;w<this.parent.registeredTemplate.template.length;w++)for(k=0;k<this.parent.registeredTemplate.template[w].rootNodes.length;k++)t.isNullOrUndefined(this.parent.registeredTemplate.template[w].rootNodes[k].parentNode)&&C.push(this.parent.registeredTemplate.template[w]);this.parent.destroyTemplate(["template"],C)}this.parent.enableColumnVirtualization&&new yt(this.serviceLocator,this.parent).updateVirtualCells(y),this.tbody=h&&v>=h?g.querySelector("tbody"):this.getTable().querySelector("tbody");var b=0,S=!0;if(se(i)&&i.vcRows.length){var x=t.isNullOrUndefined(e.virtualInfo.offsets)?t.isNullOrUndefined(e.scrollTop)?0:e.scrollTop.top:e.virtualInfo.offsets.top;if(0!==x){for(var R=i.vGroupOffsets,E=i.pageSettings.pageSize/2,T=Object.keys(R).map(function(e){return R[e]}),D=0;D<T.length;D++)if(x<T[D]){if(t.isNullOrUndefined(e.virtualInfo)||"up"!==e.virtualInfo.direction){e.virtualInfo.blockIndexes=0===D||1===D?[1,2]:[D,D+1],b=0===D||1===D?0:D*E;break}e.virtualInfo.blockIndexes=0===D||1===D?[1,2]:[D,D+1],b=0===D||1===D?0:D*E;break}x+this.contentPanel.firstElementChild.offsetHeight!==this.contentPanel.firstElementChild.scrollHeight||e.rowObject||(S=!1)}}for(var w=b,I=y.length;w<I&&(this.rows.push(y[w]),!(se(i)&&this.rows.length>=i.pageSettings.pageSize&&S));w++){if(i.rowTemplate){var O=i.element.id+"rowTemplate",F=i.getRowTemplate()(t.extend({index:w},l[w]),i,"rowTemplate",O);if("TBODY"===F[0].tagName){for(var k=0;k<F.length;k++){var M="tr"===F[k].nodeName.toLowerCase();(M||F[k].querySelectorAll&&F[k].querySelectorAll("tr").length)&&(n=M?F[k]:F[k].querySelector("tr"))}i.frozenRows&&w<i.frozenRows?d.appendChild(n):a.appendChild(n)}else i.frozenRows&&w<i.frozenRows?n=B(d,F):s=(n=B(a,F)).lastElementChild;var A={data:y[w].data,row:s||n};this.parent.trigger("rowDataBound",A)}else n=p.render(y[w],c),i.frozenRows&&w<i.frozenRows?d.appendChild(n):a.appendChild(n),y[w].isExpand&&i.notify(at,n.cells[i.groupSettings.columns.length]);y[w].isDataRow&&this.rowElements.push(n),this.ariaService.setOptions(this.getTable(),{colcount:i.getColumns().length.toString()})}this.splitRows(v),i.frozenRows&&((o=h?i.getHeaderContent().querySelector(0===v?".e-frozenheader":".e-movableheader").querySelector("tbody"):i.getHeaderTable().querySelector("tbody")).innerHTML="",o.appendChild(d)),i.frozenRows&&0===v&&m.offsetHeight===Number(i.height)&&(m.style.height=m.offsetHeight-o.offsetHeight+"px"),h&&0===v&&(this.getPanel().firstChild.style.overflowY="hidden"),t.isBlazor()&&!this.parent.isJsComponent||(e.rows=this.rows.slice(0)),e.isFrozen=0!==this.parent.getFrozenColumns()&&!e.isFrozen,this.index=v,f(function(){r.parent.notify("beforeFragAppend",e),r.parent.enableVirtualization||(t.remove(r.tbody),r.tbody=r.parent.createElement("tbody")),h?(r.tbody.appendChild(a),0===r.index?(r.isLoaded=!1,u.querySelector("table").appendChild(r.tbody)):(r.tbody.childElementCount<1&&r.tbody.appendChild(r.parent.createElement("tr").appendChild(r.parent.createElement("td"))),r.isLoaded=!0,g.querySelector("table").appendChild(r.tbody),u.style.height=g.offsetHeight-z()+"px",g.style.overflowY="auto"!==r.parent.height?"scroll":"auto",u.style.borderRightWidth="1px")):(i.rowTemplate&&t.updateBlazorTemplate(i.element.id+"rowTemplate","RowTemplate",i),r.appendContent(r.tbody,a,e)),h&&0===v&&r.refreshContentRows(t.extend({},e)),a=null},this.rafCallback(t.extend({},e)))}},e.prototype.appendContent=function(e,t,r){e.appendChild(t),this.getTable().appendChild(e)},e.prototype.getPanel=function(){return this.contentPanel},e.prototype.setPanel=function(e){this.contentPanel=e},e.prototype.getTable=function(){return this.contentTable},e.prototype.setTable=function(e){this.contentTable=e},e.prototype.getRows=function(){return this.parent.getFrozenColumns()?this.freezeRows:this.rows},e.prototype.getMovableRows=function(){return this.movableRows},e.prototype.getRowElements=function(){return this.parent.getFrozenColumns()?this.freezeRowElements:this.rowElements},e.prototype.getMovableRowElements=function(){return this.rowElements},e.prototype.setRowElements=function(e){this.rowElements=e},e.prototype.getColGroup=function(){return this.colgroup},e.prototype.setColGroup=function(e){return t.isNullOrUndefined(e)||(e.id="content-"+e.id),this.colgroup=e},e.prototype.setVisible=function(e){var r=this.parent,i=r.getFrozenColumns(),n=[];if(i)for(var o=this.freezeRows,s=this.movableRows,l=o.length,a=void 0,d=0,c=void 0;d<l;d++){a=s[d].cells.length,c=o[d].clone();for(var h=0;h<a;h++)c.cells.push(s[d].cells[h]);n.push(c)}else n=this.getRows();var p;n.some(function(e){return e.isDataRow&&(p=e),e.isDataRow});var u=!0;!r.groupSettings.columns.length&&p&&(u=!1);for(var g=r.getDataRows(),f={},m=this.rows.filter(function(e){return!e.isDetailRow}),y=0,v=e.length;y<v;y++){var C=e[y],w=this.parent.getNormalizedColumnIndex(C.uid),b=!0===C.visible?"":"none";if(-1!==w&&p&&w<p.cells.length)if(i)if(w<i)t.setStyleAttribute(this.getColGroup().childNodes[w],{display:b}),m=this.freezeRows;else{var S=r.getContent().querySelector(".e-movablecontent").querySelector("colgroup");w-=i,t.setStyleAttribute(S.childNodes[w],{display:b}),g=r.getMovableDataRows(),m=this.movableRows}else r.isRowDragable()&&w++,t.setStyleAttribute(this.getColGroup().childNodes[w],{display:b}),r.isRowDragable()&&w--;w=r.isDetail()?w-1:w,u||this.setDisplayNone(g,w,b,m),!this.parent.invokedFromMedia&&C.hideAtMedia&&this.parent.updateMediaColumns(C),this.parent.invokedFromMedia=!1}u?this.refreshContentRows({requestType:"refresh"}):this.parent.getFrozenColumns()?(this.parent.notify("partial-refresh",{rows:this.freezeRows,args:{isFrozen:!0,rows:this.freezeRows}}),this.parent.notify("partial-refresh",{rows:this.movableRows,args:{isFrozen:!1,rows:this.movableRows}})):this.parent.notify("partial-refresh",{rows:m,args:f})},e.prototype.setDisplayNone=function(e,r,i,n){Object.keys(e).forEach(function(o){e[o].querySelectorAll("td.e-rowcell").length&&(t.setStyleAttribute(e[o].querySelectorAll("td.e-rowcell")[r],{display:i}),e[o].querySelectorAll("td.e-rowcell")[r].classList.contains("e-hide")&&t.removeClass([e[o].querySelectorAll("td.e-rowcell")[r]],["e-hide"]),n[o].cells[r].visible=""===i)})},e.prototype.colGroupRefresh=function(){if(this.getColGroup()){var e=t.isBlazor()?this.parent.getHeaderTable().querySelector("colgroup").cloneNode(!0):this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0);this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)}},e.prototype.initializeContentDrop=function(){var e=this.parent;new t.Droppable(e.getContent(),{accept:".e-dragclone",drop:this.drop})},e.prototype.canSkip=function(e,r,i){return t.isNullOrUndefined(r)||t.isNullOrUndefined(e.visible)||r.cells[i].visible===e.visible},e.prototype.getModelGenerator=function(){return this.generator=this.parent.allowGrouping?new Et(this.parent):new Ct(this.parent)},e.prototype.renderEmpty=function(e){this.getTable().appendChild(e),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector("tbody").innerHTML="")},e.prototype.setSelection=function(e,t,r){this.parent.getFrozenColumns()&&this.getMovableRows().filter(function(t){return r||e===t.uid}).forEach(function(e){return e.isSelected=t}),this.getRows().filter(function(t){return r||e===t.uid}).forEach(function(e){e.isSelected=t,e.cells.forEach(function(e){return e.isSelected=t})})},e.prototype.getRowByIndex=function(e){return this.parent.getDataRows()[e]},e.prototype.getVirtualRowIndex=function(e){return e},e.prototype.getMovableRowByIndex=function(e){return this.parent.getMovableDataRows()[e]},e.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},e.prototype.setRowObjects=function(e){this.rows=e},e}(),Dt=function(){function r(e,r){var i=this;this.frzIdx=0,this.notfrzIdx=0,this.helper=function(e){var r=i.parent,n=e.sender.target,o=O(n,"e-headercell");if(!r.allowReordering&&!r.allowGrouping||!t.isNullOrUndefined(o)&&o.querySelectorAll(".e-checkselectall").length>0)return!1;var s=i.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),l=n.classList.contains("e-headercell")?n:o;if(!l||!r.allowReordering&&l.classList.contains("e-stackedheadercell"))return!1;var a,d=l.offsetHeight,c=l.querySelector(".e-headercelldiv")||l.querySelector(".e-stackedheadercelldiv");if(c){if(a=l.querySelector(".e-stackedheadercelldiv")?r.getStackedHeaderColumnByHeaderText(c.innerText.trim(),r.columns):r.getColumnByUid(c.getAttribute("e-mappinguid")),i.column=a,i.column.lockColumn)return!1;s.setAttribute("e-mappinguid",i.column.uid)}if(a&&!t.isNullOrUndefined(a.headerTemplate))if(t.isNullOrUndefined(a.headerTemplate))s.innerHTML=a.headerTemplate;else{var h=r.getColumnIndexByField(a.field);B(s,a.getHeaderTemplate()(t.extend({index:h},a),r,"headerTemplate"))}else s.innerHTML=c?a.headerText:l.firstElementChild.innerHTML;return s.style.width=l.offsetWidth+"px",s.style.height=l.offsetHeight+"px",s.style.lineHeight=(d-6).toString()+"px",r.element.appendChild(s),s},this.dragStart=function(e){var r=i.parent;r.element.querySelector(".e-gridpopup").style.display="none",r.notify(Ee,{target:e.target,column:i.column,event:e.event}),t.isBlazor()&&e.bindEvents(e.dragElement)},this.drag=function(e){var r=i.parent,n=e.target;if(n){var o=t.closest(n,".e-grid"),s=i.parent.element.querySelector(".e-cloneproperties");if(!o||o.getAttribute("id")!==r.element.getAttribute("id"))return t.classList(s,["e-notallowedcur"],["e-defaultcur"]),void(r.allowReordering&&(r.element.querySelector(".e-reorderuparrow").style.display="none",r.element.querySelector(".e-reorderdownarrow").style.display="none"));r.notify(Te,{target:e.target,column:i.column,event:e.event})}},this.dragStop=function(e){var r,n=i.parent;n.element.querySelector(".e-gridpopup").style.display="none",(!O(e.target,"e-headercell")&&!O(e.target,"e-groupdroparea")||!n.allowReordering&&O(e.target,"e-headercell")||!e.helper.getAttribute("e-mappinguid")&&O(e.target,"e-groupdroparea"))&&(t.remove(e.helper),r=!0),n.notify(Ye,{target:e.target,event:e.event,column:i.column,cancel:r})},this.drop=function(e){var r=i.parent,n=e.droppedElement.getAttribute("e-mappinguid"),o=t.closest(e.target,".e-grid");t.remove(e.droppedElement),o&&o.getAttribute("id")!==r.element.getAttribute("id")||!r.allowReordering&&!r.allowGrouping||r.notify(Xe,{target:e.target,uid:n})},this.parent=e,this.serviceLocator=r,this.ariaService=this.serviceLocator.getService("ariaService"),this.widthService=this.serviceLocator.getService("widthService"),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.on(Ke,this.setVisible,this),this.parent.on(We,this.colPosRefresh,this))}return r.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:"e-gridheader"}),t=this.parent.createElement("div",{className:"e-headercontent"});this.toggleStackClass(e),e.appendChild(t),this.setPanel(e),this.parent.element.appendChild(e)},r.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector(".e-table")),this.parent.getFrozenColumns()||(this.initializeHeaderDrag(),this.initializeHeaderDrop()),this.parent.notify(Ue,{rows:this.rows,args:{isFrozen:0!==this.parent.getFrozenColumns()}})},r.prototype.getPanel=function(){return this.headerPanel},r.prototype.setPanel=function(e){this.headerPanel=e},r.prototype.getTable=function(){return this.headerTable},r.prototype.setTable=function(e){this.headerTable=e},r.prototype.getColGroup=function(){return this.colgroup},r.prototype.setColGroup=function(e){return this.colgroup=e},r.prototype.getRows=function(){return this.getTable().tHead.rows},r.prototype.createHeaderTable=function(){var e=this.createTable(),t=this.getPanel().firstChild;return t.appendChild(e),t},r.prototype.createTable=function(){var r=this.parent;this.getTable()&&!r.getFrozenColumns()&&t.remove(this.getTable());r.getColumns();var i=this.parent.createElement("table",{className:"e-table",attrs:{cellspacing:"0.25px",role:"grid"}}),n=(this.getPanel().firstChild,this.createHeaderContent()),o=n.thead,s=this.parent.createElement("tbody",{className:this.parent.frozenRows?"":"e-hide"});this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"});for(var l,a=this.parent.createElement("colgroup"),d=this.parent.createElement("tr"),c=this.rows=n.rows,h=(new vt(this.serviceLocator,e.CellType.Header,this.parent),0),p=c.length;h<p;h++)for(var u=0,g=c[h].cells.length;u<g;u++){c[h].cells[u];l=this.parent.createElement("td"),d.appendChild(l)}return(r.allowFiltering||r.allowSorting||r.allowGrouping)&&i.classList.add("e-sortfilter"),this.updateColGroup(a),s.appendChild(d),i.appendChild(this.setColGroup(a)),i.appendChild(o),i.appendChild(s),i.appendChild(this.caption),this.ariaService.setOptions(i,{colcount:r.getColumns().length.toString()}),i},r.prototype.createHeaderContent=function(){var t=this.parent,r=t.getColumns(),i=this.parent.createElement("thead"),n=this.parent.createElement("tr",{className:"e-columnheader"}),o=new vt(this.serviceLocator,e.CellType.Header,t);o.element=n;var s,l=[];this.colDepth=ue(t.columns);for(var a=0,d=this.colDepth;a<d;a++)l[a]=this.generateRow(a),l[a].cells=[];l=this.ensureColumns(l),l=this.getHeaderCells(l);for(var a=0,d=this.colDepth;a<d;a++)s=o.render(l[a],r),this.parent.rowHeight&&s.querySelector(".e-headercell")&&(s.style.height=this.parent.rowHeight+"px"),i.appendChild(s);return{thead:i,rows:l}},r.prototype.updateColGroup=function(e){var r,i=this.parent.getColumns(),n=this.parent.getColumnIndexesInView();if(e.id=this.parent.element.id+"colGroup",this.parent.allowGrouping)for(var o=0,s=this.parent.groupSettings.columns.length;o<s;o++)this.parent.enableColumnVirtualization&&-1===n.indexOf(o)||(r=this.parent.createElement("col",{className:"e-group-intent"}),e.appendChild(r));(this.parent.detailTemplate||this.parent.childGrid)&&(r=this.parent.createElement("col",{className:"e-detail-intent"}),e.appendChild(r)),this.parent.isRowDragable()&&(r=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(r));for(var o=0,s=i.length;o<s;o++)r=this.parent.createElement("col"),!1===i[o].visible&&t.setStyleAttribute(r,{display:"none"}),e.appendChild(r);return e},r.prototype.ensureColumns=function(t){for(var r=this.parent,i=this.parent.getColumnIndexesInView(),n=0,o=t.length;n<o;n++){if(r.allowGrouping)for(var s=0,l=r.groupSettings.columns.length;s<l;s++)this.parent.enableColumnVirtualization&&-1===i.indexOf(s)||t[n].cells.push(this.generateCell({},e.CellType.HeaderIndent));(r.detailTemplate||r.childGrid)&&t[n].cells.push(this.generateCell({},e.CellType.DetailHeader)),r.isRowDragable()&&t[n].cells.push(this.generateCell({},e.CellType.RowDragHIcon))}return t},r.prototype.getHeaderCells=function(e){var t=this.parent.getHeaderTable()&&this.parent.getHeaderTable().querySelector("thead"),r=this.parent.enableColumnVirtualization?this.parent.getColumns(this.parent.enablePersistence):this.parent.columns;if(this.frzIdx=0,this.notfrzIdx=0,this.parent.lockcolPositionCount)for(i=0;i<r.length;i++)this.lockColsRendered=!1,e=this.appendCells(r[i],e,0,0===i,!1,i===r.length-1,t);for(var i=0,n=r.length;i<n;i++)this.notfrzIdx=0,this.lockColsRendered=!0,e=this.appendCells(r[i],e,0,0===i,!1,i===n-1,t);return e},r.prototype.appendCells=function(t,r,i,n,o,s,l){var a=s?"e-lastcell":"",d=this.parent.getFrozenColumns();if(t.columns){var c=this.getCellCnt(t,0);if(c){var h=this.refreshFrozenHdr(t.columns,{isPartial:!1,isComp:!0,cnt:0}),p=this.getStackedLockColsCount(t,0);(!d&&(!this.parent.lockcolPositionCount||!this.lockColsRendered&&p||this.lockColsRendered&&c-p)||d&&(!l&&(this.parent.frozenColumns-this.frzIdx>0||h.isPartial)||l&&c+this.frzIdx>this.parent.frozenColumns&&!h.isComp))&&r[i].cells.push(new mt({cellType:e.CellType.StackedHeader,column:t,colSpan:this.getColSpan(c,l,h.cnt,p)}))}if(this.parent.lockcolPositionCount&&!this.lockColsRendered)for(u=0;u<t.columns.length;u++)r=this.appendCells(t.columns[u],r,i+1,n,0===u,u===t.columns.length-1&&s,l);if(this.lockColsRendered)for(var u=0,g=t.columns.length;u<g;u++)r=this.appendCells(t.columns[u],r,i+1,n,0===u,u===g-1&&s,l)}else(!d&&(!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered)||d&&(!l&&(this.frzIdx+this.notfrzIdx<this.parent.frozenColumns||t.isFrozen)&&(!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered)||l&&this.frzIdx+this.notfrzIdx>=this.parent.frozenColumns&&!t.isFrozen&&(!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered)))&&r[i].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-i,(n?"":o?"e-firstcell":"")+a,i,this.parent.getColumnIndexByUid(t.uid))),this.parent.lockcolPositionCount?this.frzIdx+this.notfrzIdx<this.parent.frozenColumns&&(t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered)?this.frzIdx++:this.notfrzIdx++:this.frzIdx++;return r},r.prototype.getStackedLockColsCount=function(e,t){if(e.columns)for(var r=0;r<e.columns.length;r++)t=this.getStackedLockColsCount(e.columns[r],t);else e.lockColumn&&t++;return t},r.prototype.refreshFrozenHdr=function(e,t){for(var r=0;r<e.length;r++)e[r].columns?t=this.refreshFrozenHdr(e[r].columns,t):(e[r].isFrozen&&(t.isPartial=!0,t.cnt++),t.isComp=t.isComp&&(e[r].isFrozen||this.parent.getColumnIndexByField(e[r].field)<this.parent.frozenColumns));return t},r.prototype.getColSpan=function(e,t,r,i){var n=this.parent.frozenColumns;return this.parent.getFrozenColumns()&&this.frzIdx+e>n?t?e=e-(n>this.frzIdx?n-this.frzIdx:0)-r:e-=e-(n>this.frzIdx?n+r-this.frzIdx:r):this.parent.lockcolPositionCount&&(e=this.lockColsRendered?e-i:i),e},r.prototype.generateRow=function(e){return new ft({})},r.prototype.generateCell=function(e,r,i,n,o,s){var l={visible:e.visible,isDataCell:!1,isTemplate:!t.isNullOrUndefined(e.headerTemplate),rowID:"",column:e,cellType:r,rowSpan:i,className:n,index:o,colIndex:s};return(!l.rowSpan||l.rowSpan<2)&&delete l.rowSpan,new mt(l)},r.prototype.setVisible=function(e){for(var r,i,n=this.parent,o=([].slice.call(this.getRows()),n.getFrozenColumns()),s=0,l=e.length;s<l;s++){var a=e[s];if(i=n.getNormalizedColumnIndex(a.uid),r=a.visible?"":"none",o)if(i<o)t.setStyleAttribute(this.getColGroup().children[i],{display:r});else{var d=n.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup");t.setStyleAttribute(d.children[i-o],{display:r})}else n.isRowDragable()&&i++,t.setStyleAttribute(this.getColGroup().children[i],{display:r});this.refreshUI()}},r.prototype.colPosRefresh=function(){this.refreshUI()},r.prototype.refreshUI=function(){var e=this.getPanel();this.toggleStackClass(e);var r=this.getTable(),i=this.parent.getFrozenColumns();if(this.getTable()){t.remove(this.getTable()),r.removeChild(r.firstChild),r.removeChild(r.childNodes[0]);var n=this.parent.createElement("colgroup"),o=this.createHeaderContent();this.rows=o.rows,r.insertBefore(o.thead,r.firstChild),this.updateColGroup(n),r.insertBefore(this.setColGroup(n),r.firstChild),this.setTable(r),this.appendContent(r),this.parent.notify(He,{}),this.widthService.setWidthToColumns(),this.parent.updateDefaultCursor(),i||this.initializeHeaderDrag();for(var s=[].slice.call(e.querySelectorAll("tr.e-columnheader")),l=0,a=s;l<a.length;l++){var d=a[l],c=[].slice.call(d.querySelectorAll(".e-grouptopleftcell"));c.length&&c[c.length-1].classList.add("e-lastgrouptopleftcell")}i||this.parent.notify(Ue,{rows:this.rows,args:{isFrozen:0!==this.parent.getFrozenColumns()}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&K(s,!0)}},r.prototype.toggleStackClass=function(e){this.parent.columns.some(function(e){return!t.isNullOrUndefined(e.columns)})?e.classList.add("e-stackedheader"):e.classList.remove("e-stackedheader")},r.prototype.appendContent=function(e){this.getPanel().firstChild.appendChild(e)},r.prototype.getCellCnt=function(e,t){if(e.columns)for(var r=0,i=e.columns.length;r<i;r++)t=this.getCellCnt(e.columns[r],t);else e.visible&&t++;return t},r.prototype.initializeHeaderDrag=function(){var e=this.parent;if(this.parent.allowReordering||this.parent.allowGrouping&&this.parent.groupSettings.showDropArea)for(var r=[].slice.call(e.getHeaderContent().querySelectorAll(".e-columnheader")),i=0,n=r.length;i<n;i++)new t.Draggable(r[i],{dragTarget:".e-headercell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,abort:".e-rhandler"})},r.prototype.initializeHeaderDrop=function(){var e=this.parent;new t.Droppable(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop})},r}(),It=function(){function e(e,t){this.localizer=t.getService("localization"),this.formatter=t.getService("valueFormatter"),this.parent=e,this.element=this.parent.createElement("TD",{className:"e-rowcell",attrs:{role:"gridcell",tabindex:"-1"}}),this.rowChkBox=this.parent.createElement("input",{className:"e-checkselect",attrs:{type:"checkbox"}})}return e.prototype.getGui=function(){return""},e.prototype.format=function(e,r,i){return t.isNullOrUndefined(e.format)||(r=this.formatter.toView(r,e.getFormatter())),t.isNullOrUndefined(r)?"":r.toString()},e.prototype.evaluate=function(e,r,i,n,o,s){var l,a;if(r.column.template){var d=["index"],c=he({},i,(l={},l.foreignKeyData=o,l.column=r.column,l)),h=this.parent.element.id+r.column.uid,p="isStringTemplate";if(t.isBlazor()&&s){var u="Batch"!==this.parent.editSettings.mode?parseInt(n.index,10):null;a=r.column.getColumnTemplate()(t.extend({index:n[d[0]]},c),this.parent,"template",h,this.parent[p],u),window[h]=null,"Batch"!==this.parent.editSettings.mode&&t.updateBlazorTemplate(h,"Template",r.column,!1)}else a=r.column.getColumnTemplate()(t.extend({index:n[d[0]]},c),this.parent,"template",h,this.parent[p]);return B(e,a),this.parent.notify("template-result",{template:a}),a=null,e.setAttribute("aria-label",e.innerText+" is template cell column header "+r.column.headerText),!1}return!0},e.prototype.invokeFormatter=function(e,r,i){return t.isNullOrUndefined(e.formatter)||(r=u(e.formatter,"getValue")?(new(0,e.formatter)).getValue(e,i):"function"==typeof e.formatter?e.formatter(e,i):e.formatter.getValue(e,i)),r},e.prototype.render=function(e,t,r,i,n){return this.refreshCell(e,t,r,n)},e.prototype.refreshTD=function(e,t,r,i){var n="Batch"===this.parent.editSettings.mode&&e.classList.contains("e-editedbatchcell"),o=this.refreshCell(t,r,i,n);e.innerHTML="",e.setAttribute("aria-label",o.getAttribute("aria-label"));for(var s=0,l=[].slice.call(o.childNodes);s<l.length;s++){var a=l[s];e.appendChild(a)}},e.prototype.refreshCell=function(e,r,i,o){var s,l,a=this.element.cloneNode(),d=e.column;e.isForeignKey&&(l=e.foreignKeyData[0]||(s={},s[d.foreignKeyValue]=d.format?null:"",s));var c=this.getGui(),h=e.isForeignKey?this.getValue(d.foreignKeyValue,l,d):this.getValue(d.field,r,d);if("date"!==d.type&&"datetime"!==d.type||t.isNullOrUndefined(h)||(h=new Date(h)),h=this.format(d,h,r),c=h.toString(),"boolean"===d.type&&!d.displayAsCheckBox){var p="true"!==h&&"false"!==h?null:"true"===h?"True":"False";c=p?this.localizer.getConstant(p):c}var u=this.invokeFormatter(d,h,r);if(c=t.isNullOrUndefined(d.formatter)?c:t.isNullOrUndefined(u)?"":u.toString(),a.setAttribute("aria-label",(""===c?"empty":c)+" column header "+e.column.headerText),t.isNullOrUndefined(e.column.headerText)||a.setAttribute("aria-label",c+" column header "+e.column.headerText),this.evaluate(a,e,r,i,l,o)&&"checkbox"!==d.type?this.appendHtml(a,c,d.getDomSetter?d.getDomSetter():"innerHTML"):"checkbox"===d.type&&(a.classList.add("e-gridchkbox"),a.setAttribute("aria-label","checkbox"),h=!!this.parent.selectionSettings.persistSelection&&"true"===h,(f=n.createCheckBox(this.parent.createElement,!1,{checked:h,label:" "})).insertBefore(this.rowChkBox.cloneNode(),f.firstChild),a.appendChild(f)),"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(a,e,i),"boolean"===d.type&&d.displayAsCheckBox){var g=isNaN(parseInt(h.toString(),10))?"true"===h:parseInt(h.toString(),10)>0,f=n.createCheckBox(this.parent.createElement,!1,{checked:g,label:" "});a.innerHTML="",f.classList.add("e-checkbox-disabled"),a.appendChild(f),a.setAttribute("aria-label",g+" column header "+e.column.headerText)}return a},e.prototype.appendHtml=function(e,t,r){return void 0===r&&(r="innerHTML"),e[r]=t,e},e.prototype.setAttributes=function(e,t,r){var i=t.column;this.buildAttributeFromCell(e,t,"checkbox"===i.type),S(e,r),S(e,t.attributes),i.customAttributes&&S(e,i.customAttributes),i.textAlign&&(e.style.textAlign=i.textAlign),"Clip"===i.clipMode?e.classList.add("e-gridclip"):"EllipsisWithTooltip"===i.clipMode&&e.classList.add("e-ellipsistooltip")},e.prototype.buildAttributeFromCell=function(e,r,i){var n={},o={colindex:"aria-colindex"},s=[];r.colSpan&&(n.colSpan=r.colSpan),r.rowSpan&&(n.rowSpan=r.rowSpan),r.isTemplate&&s.push("e-templatecell"),r.isSelected&&(s.push.apply(s,["e-selectionbackground","e-active"]),i&&e.querySelector(".e-frame").classList.add("e-check")),t.isNullOrUndefined(r.index)||(n[o.colindex]=r.index),r.visible||s.push("e-hide"),n.class=s,S(e,n)},e.prototype.getValue=function(e,t,r){return r.valueAccessor(e,t,r)},e}(),Ot=function(){function e(){}return e.prototype.setOptions=function(e,t){Object.keys(t).forEach(function(r){return h(e,Ft[r],t[r])})},e.prototype.setExpand=function(e,t){h(e,Ft.expand,t)},e.prototype.setSort=function(e,t){h(e,Ft.sort,t,"boolean"==typeof t)},e.prototype.setBusy=function(e,t){h(e,Ft.busy,t),h(e,Ft.invalid,null,!0)},e.prototype.setGrabbed=function(e,t,r){h(e,Ft.grabbed,t,r)},e.prototype.setDropTarget=function(e,t){h(e,Ft.dropeffect,"copy",!t)},e}(),Ft={expand:"aria-expanded",role:"role",selected:"aria-selected",multiselectable:"aria-multiselectable",sort:"aria-sort",busy:"aria-busy",invalid:"aria-invalid",grabbed:"aria-grabbed",dropeffect:"aria-dropeffect",haspopup:"aria-haspopup",level:"aria-level",colcount:"aria-colcount"},kt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Mt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell",attrs:{role:"columnheader",tabindex:"-1"}}),t.ariaService=new Ot,t.hTxtEle=t.parent.createElement("span",{className:"e-headertext"}),t.sortEle=t.parent.createElement("div",{className:"e-sortfilterdiv e-icons"}),t.gui=t.parent.createElement("div"),t.chkAllBox=t.parent.createElement("input",{className:"e-checkselectall",attrs:{type:"checkbox"}}),t}return kt(r,e),r.prototype.getGui=function(){return this.gui.cloneNode()},r.prototype.render=function(e,t,r){var i=this.element.cloneNode(),n=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter"});return this.prepareHeader(e,i,n)},r.prototype.refresh=function(e,t){this.clean(t);var r=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter"});return this.prepareHeader(e,t,r)},r.prototype.clean=function(e){e.innerHTML=""},r.prototype.prepareHeader=function(e,r,i){var o=e.column,s={},l=this.getGui();if(t.attributes(l,{"e-mappinguid":o.uid,class:"e-headercelldiv"}),"checkbox"!==o.type){var a=o.headerText,d=this.hTxtEle.cloneNode();d[o.getDomSetter()]=a,l.appendChild(d)}else{o.editType="booleanedit";var c=n.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "});c.insertBefore(this.chkAllBox.cloneNode(),c.firstChild),l.appendChild(c),l.classList.add("e-headerchkcelldiv")}if(this.buildAttributeFromCell(r,e),this.appendHtml(r,l),r.appendChild(this.sortEle.cloneNode()),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&o.allowFiltering&&!t.isNullOrUndefined(o.field)&&(!this.parent.showColumnMenu||!o.showColumnMenu)){t.attributes(i,{"e-mappinguid":"e-flmenu-"+o.uid}),r.classList.add("e-fltr-icon");var h=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==h.length)for(var p=0;p<this.parent.columns.length;p++)for(var u=0;u<this.parent.filterSettings.columns.length;u++)if(this.parent.filterSettings.columns[u].field===o.field){i.classList.add("e-filtered"),h.push(o.field);break}r.appendChild(i.cloneNode())}e.className&&r.classList.add(e.className),o.customAttributes&&S(r,o.customAttributes),o.allowSorting&&(s.sort="none"),o.allowGrouping&&(s.grabbed=!1),r=this.extendPrepareHeader(o,r);var g,f=this.parent,m=f.getColumnIndexByField(o.field);if(!t.isNullOrUndefined(o.headerTemplate)){var y=f.element.id+o.uid+"headerTemplate";g=o.getHeaderTemplate()(t.extend({index:m},o),f,"headerTemplate",y,this.parent.isStringTemplate),r.firstElementChild.innerHTML="",B(r.firstElementChild,g)}if(this.ariaService.setOptions(r,s),!t.isNullOrUndefined(o.headerTextAlign)||!t.isNullOrUndefined(o.textAlign)){var v=o.headerTextAlign||o.textAlign;l.style.textAlign=v,"Right"===v||"Left"===v?r.classList.add("Right"===v?"e-rightalign":"e-leftalign"):"Center"===v&&r.classList.add("e-centeralign")}return"Clip"===o.clipMode?r.classList.add("e-gridclip"):"EllipsisWithTooltip"===o.clipMode&&r.classList.add("e-ellipsistooltip"),r.setAttribute("aria-rowspan",(t.isNullOrUndefined(e.rowSpan)?1:e.rowSpan).toString()),r.setAttribute("aria-colspan","1"),this.parent.trigger("headerCellInfo",{cell:e,node:r}),r},r.prototype.extendPrepareHeader=function(e,r){if(this.parent.showColumnMenu&&e.showColumnMenu&&!t.isNullOrUndefined(e.field)){var i=this.parent.createElement("div",{className:"e-icons e-columnmenu"}),n=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==n.length)for(var o=0;o<this.parent.columns.length;o++)for(var s=0;s<this.parent.filterSettings.columns.length;s++)if(this.parent.filterSettings.columns[s].field===e.field){i.classList.add("e-filtered"),n.push(e.field);break}r.classList.add("e-fltr-icon"),r.appendChild(i)}if(this.parent.allowResizing){var l=this.parent.createElement("div");l.className=e.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",r.appendChild(l)}return r},r.prototype.appendHtml=function(e,t){return e.appendChild(t),e},r}(It),At=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Pt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell e-stackedheadercell",attrs:{role:"columnheader",tabindex:"-1"}}),t}return At(r,e),r.prototype.render=function(e,r,i){var n=this.element.cloneNode(),o=this.parent.createElement("div",{className:"e-stackedheadercelldiv",attrs:{"e-mappinguid":e.column.uid}}),s=e.column;if(n.appendChild(o),t.isNullOrUndefined(s.headerTemplate)?this.appendHtml(o,s.headerText,s.getDomSetter()):B(o,s.getHeaderTemplate()(s,this.parent,"headerTemplate")),e.column.toolTip&&n.setAttribute("title",e.column.toolTip),"Clip"===s.clipMode?n.classList.add("e-gridclip"):"EllipsisWithTooltip"===s.clipMode&&n.classList.add("e-ellipsistooltip"),t.isNullOrUndefined(e.column.textAlign)||(o.style.textAlign=e.column.textAlign),e.column.customAttributes&&S(n,e.column.customAttributes),n.setAttribute("colspan",e.colSpan.toString()),n.setAttribute("aria-colspan",e.colSpan.toString()),n.setAttribute("aria-rowspan","1"),this.parent.allowResizing){var l=this.parent.createElement("div");l.className=e.column.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",n.appendChild(l)}return this.parent.trigger("headerCellInfo",{cell:e,node:n}),n},r}(It),Nt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-indentcell"}),t}return Nt(t,e),t.prototype.render=function(e,t){var r=this.element.cloneNode();return S(r,e.attributes),r},t}(It),Lt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),qt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-groupcaption",attrs:{id:t.parent.element.id+"captioncell",role:"gridcell",tabindex:"-1"}}),t}return Lt(r,e),r.prototype.render=function(e,r){var i,n,o=this.element.cloneNode(),s=this.parent;r.headerText=e.column.headerText,e.isForeignKey&&(n=this.format(e.column,e.column.valueAccessor("foreignKey",r,e.column)));var l=e.isForeignKey?n:e.column.enableGroupByFormat?r.key:this.format(e.column,e.column.valueAccessor("key",r,e.column));if(t.isNullOrUndefined(s.groupSettings.captionTemplate))o.innerHTML=e.column.headerText+": "+l+" - "+r.count+" "+(r.count<2?this.localizer.getConstant("Item"):this.localizer.getConstant("Items"));else{if(t.isBlazor()){var a=s.element.id+"captionTemplate";i=b(s.groupSettings.captionTemplate)(r,null,null,a)}else i=b(s.groupSettings.captionTemplate)(r);B(o,i)}return o.setAttribute("colspan",e.colSpan.toString()),o.setAttribute("aria-label",o.innerHTML+" is groupcaption cell"),o.setAttribute("title",o.innerHTML),o},r}(It),zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-groupcaption"}),t}return Lt(t,e),t.prototype.render=function(e,t){var r=this.element.cloneNode();return r.innerHTML="&nbsp;",r.setAttribute("colspan",e.colSpan.toString()),r},t}(It),Ht=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ut=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ht(t,e),t.prototype.render=function(e,t,r,i){var n=this.element.cloneNode();return n.className=i?"e-recordplusexpand":"e-recordpluscollapse",n.setAttribute("ej-mappingname",t.field),n.setAttribute("ej-mappingvalue",t.key),n.setAttribute("aria-expanded",i?"true":"false"),n.setAttribute("tabindex","-1"),n.appendChild(this.parent.createElement("div",{className:i?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow"})),n},t}(Bt),jt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Vt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-grouptopleftcell"}),t}return jt(t,e),t.prototype.render=function(e,t){var r=this.element.cloneNode();return r.appendChild(this.parent.createElement("div",{className:"e-headercelldiv e-emptycell",innerHTML:""})),r},t}(It),Gt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),_t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-detailheadercell"}),t}return Gt(t,e),t.prototype.render=function(e,t){var r=this.element.cloneNode();return r.appendChild(this.parent.createElement("div",{className:"e-emptycell"})),r},t}(It),Kt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Wt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-detailrowcollapse",attrs:{"aria-expanded":"false",role:"gridcell",tabindex:"-1"}}),t}return Kt(r,e),r.prototype.render=function(e,r,i){var n=this.element.cloneNode();return i&&!t.isNullOrUndefined(i.class)?(n.className="",n.className=i.class,n.appendChild(this.parent.createElement("div",{className:"e-icons e-dtdiagonaldown e-icon-gdownarrow"}))):n.appendChild(this.parent.createElement("div",{className:"e-icons e-dtdiagonalright e-icon-grightarrow"})),n},r}(It),Qt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Jt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-rowdragdrop",attrs:{role:"gridcell",tabindex:"-1"}}),t}return Qt(t,e),t.prototype.render=function(e,t){var r=this.element.cloneNode();return r.appendChild(this.parent.createElement("div",{className:"e-icons e-rowcelldrag e-dtdiagonalright e-icon-rowdragicon"})),r},t}(It),Yt=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Xt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-rowdragheader"}),t}return Yt(r,e),r.prototype.render=function(e,r){var i=this.element.cloneNode();return i.appendChild(t.createElement("div",{className:"e-emptycell"})),i},r}(It),$t=function(){function i(e,t){this.emptyGrid=!1,this.counter=0,this.parent=e,this.locator=t,this.data=new gt(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}return i.prototype.render=function(){var t=this.parent;this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer.renderPanel(),this.contentRenderer.renderPanel(),t.getColumns().length&&(this.isLayoutRendered=!0,this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.emptyRow(!1)),this.parent.scrollModule.setWidth(),this.parent.scrollModule.setHeight(),"auto"!==this.parent.height&&this.parent.scrollModule.setPadding(),this.refreshDataManager()},i.prototype.refresh=function(e){var r=this;void 0===e&&(e={requestType:"refresh"});var i=this.parent;i.notify(e.requestType+"-begin",e),t.isBlazor()&&this.resetTemplates(),i.trigger(Se,e,function(e){if(void 0===e&&(e={requestType:"refresh"}),"delete"===e.requestType&&t.isBlazor()&&!i.isJsComponent){e.data=i.getSelectedRecords()}if(e.cancel)return void i.notify("cancel-Begin",e);if("delete"===e.requestType&&i.allowPaging){var n=e.data.length,o=i.pageSettings.totalRecordsCount-n;i.currentViewData.length-n||!o||(i.prevPageMoving=!0,i.setProperties({pageSettings:{totalRecordsCount:o,currentPage:Math.ceil(o/i.pageSettings.pageSize)}},!0),i.pagerModule.pagerObj.totalRecordsCount=o)}r.refreshDataManager(e)})},i.prototype.resetTemplates=function(){var e=this.parent,r=e.getColumns();if(e.detailTemplate){var i=e.element.id+"detailTemplate";t.blazorTemplates[i]=[],t.resetBlazorTemplate(i,"DetailTemplate")}e.groupSettings.captionTemplate&&t.resetBlazorTemplate(e.element.id+"captionTemplate","CaptionTemplate"),e.rowTemplate&&t.resetBlazorTemplate(e.element.id+"rowTemplate","RowTemplate"),e.toolbarTemplate&&t.resetBlazorTemplate(e.element.id+"toolbarTemplate","ToolbarTemplate");for(var n=0;n<r.length;n++)r[n].template&&(t.blazorTemplates[e.element.id+r[n].uid]=[],t.resetBlazorTemplate(e.element.id+r[n].uid,"Template")),r[n].headerTemplate&&t.resetBlazorTemplate(e.element.id+r[n].uid+"headerTemplate","HeaderTemplate"),r[n].filterTemplate&&t.resetBlazorTemplate(e.element.id+r[n].uid+"filterTemplate","FilterTemplate");for(var o=0;o<e.aggregates.length;o++)for(var s=0;s<e.aggregates[o].columns.length;s++){if(e.aggregates[o].columns[s].footerTemplate){l=e.element.id+e.aggregates[o].columns[s].guid+"footerTemplate";t.resetBlazorTemplate(l,"FooterTemplate")}if(e.aggregates[o].columns[s].groupFooterTemplate){l=e.element.id+e.aggregates[o].columns[s].guid+"groupFooterTemplate";t.resetBlazorTemplate(l,"GroupFooterTemplate")}if(e.aggregates[o].columns[s].groupCaptionTemplate){var l=e.element.id+e.aggregates[o].columns[s].guid+"groupCaptionTemplate";t.resetBlazorTemplate(l,"GroupCaptionTemplate")}}},i.prototype.refreshComplete=function(e){this.parent.trigger(xe,e)},i.prototype.refreshDataManager=function(e){var t=this;void 0===e&&(e={}),"virtualscroll"!==e.requestType&&this.parent.showSpinner(),this.emptyGrid=!1;var i,n=this.isNeedForeignAction();if(this.ariaService.setBusy(this.parent.getContent().firstChild,!0),n){var o=new r.Deferred;i=this.getFData(o)}if(i=i?i.then(function(i){var n=t.data.generateQuery().requiresCount();if(t.emptyGrid){var o=new r.Deferred;return o.resolve({result:[],count:0}),o.promise}return t.data.getData(e,n)}):this.data.getData(e,this.data.generateQuery().requiresCount()),this.parent.getForeignKeyColumns().length&&(!n||this.parent.searchSettings.key.length)){var s=new r.Deferred;i=i.then(function(e){return t.parent.notify("getForeignKeyData",{dataManager:i,result:e,promise:s}),s.promise})}this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&(i=i.then(function(e){return t.validateGroupRecords(e)})),i.then(function(r){return t.dataManagerSuccess(r,e)}).catch(function(r){return t.dataManagerFailure(r,e)})},i.prototype.getFData=function(e){return this.parent.notify("getForeignKeyData",{isComplex:!0,promise:e}),e.promise},i.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},i.prototype.foreignKey=function(e){var t=this;return e.some(function(e){return!(!t.parent.filterSettings.columns.some(function(t){return e.uid===t.uid})&&!t.parent.searchSettings.key.length)})},i.prototype.sendBulkRequest=function(e){var t=this;e.requestType="batchsave";var r=this.data.saveChanges(e.changes,this.parent.getPrimaryKeyFieldNames()[0],e.original),i=this.data.generateQuery().requiresCount();if(this.data.dataManager.dataSource.offline)return void this.refreshDataManager({requestType:"batchsave"});r.then(function(r){t.data.getData(e,i).then(function(r){return t.dmSuccess(r,e)}).catch(function(r){return t.dmFailure(r,e)})}).catch(function(r){return t.dmFailure(r,e)})},i.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},i.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},i.prototype.renderEmptyRow=function(){this.emptyRow(!0)},i.prototype.emptyRow=function(e){var r,i=this.parent,n=this.contentRenderer.getTable().querySelector("tbody");t.isNullOrUndefined(n)||t.remove(n),n=this.parent.createElement("tbody");var o=0;(i.detailTemplate||i.childGrid)&&++o,(r=this.parent.createElement("tr",{className:"e-emptyrow"})).appendChild(this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(i.getColumns().length+o).toString()}})),n.appendChild(r),this.contentRenderer.renderEmpty(n),e&&(this.parent.trigger(Re,{}),this.parent.notify(Le,{rows:[new ft({isDataRow:!0,cells:[new mt({isDataCell:!0,visible:!0})]})]}))},i.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},i.prototype.updateColumnType=function(e){for(var r,i=this.parent.getColumns(),n=e&&e.items?e.items[0]:e,o=this.locator.getService("valueFormatter"),s=0,l=i.length;s<l;s++){r=le(i[s].field||"",n),t.isNullOrUndefined(i[s].customFormat)||(i[s].format=i[s].customFormat),t.isNullOrUndefined(i[s].validationRules)||t.isNullOrUndefined(i[s].validationRules.equalTo)||(i[s].validationRules.equalTo[0]=this.parent.element.id+i[s].validationRules.equalTo[0]),i[s].isForeignColumn()&&i[s].columnData&&(r=le(i[s].foreignKeyValue||"",i[s].columnData[0])),t.isNullOrUndefined(r)?i[s].type=i[s].type||null:(this.isColTypeDef=!0,i[s].type||(i[s].type=r.getDay?r.getHours()>0||r.getMinutes()>0||r.getSeconds()>0||r.getMilliseconds()>0?"datetime":"date":typeof r));var a=new ve;i[s].format&&(i[s].format.skeleton||i[s].format.format)&&(i[s].setFormatter(a.getFormatFunction(i[s].format)),i[s].setParser(a.getParserFunction(i[s].format))),"string"==typeof i[s].format?W(this.locator,i[s]):i[s].format||"number"!==i[s].type||i[s].setParser(o.getParserFunction({format:"n2"}))}},i.prototype.dataManagerSuccess=function(r,i){var n=this,o=this.parent;this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),r.actionArgs=i,o.trigger("beforeDataBound",r,function(e){if(!e.cancel){e.result=t.isNullOrUndefined(e.result)?[]:e.result;var r=Object.keys(e.result).length;if(!n.parent.isDestroyed){if(!(o.getColumns().length||r||o.columns.length&&o.columns[0]instanceof we))return void o.hideSpinner();if(n.parent.isEdit=!1,n.parent.notify("tooltip-destroy",{}),o.currentViewData=e.result,!r&&e.count&&o.allowPaging&&i&&"delete"!==i.requestType)return o.prevPageMoving=!0,o.pageSettings.totalRecordsCount=e.count,"paging"!==i.requestType&&(o.pageSettings.currentPage=Math.ceil(e.count/o.pageSettings.pageSize)),void o.dataBind();if((o.getColumns().length||!r)&&n.isLayoutRendered||se(o)||n.updatesOnInitialRender(e),!n.isColTypeDef&&o.getCurrentViewRecords()&&n.updateColumnType(o.getCurrentViewRecords()[0]),n.parent.isInitialLoad||!n.parent.groupSettings.disablePageWiseAggregates||n.parent.groupSettings.columns.length||(e.result=n.parent.dataSource instanceof Array?n.parent.dataSource:n.parent.currentViewData),n.parent.notify(Pe,t.extend({count:e.count,result:e.result,aggregates:e.aggregates},i)),(o.groupSettings.columns.length||i&&"ungrouping"===i.requestType)&&i&&"filtering"!==i.requestType&&n.headerRenderer.refreshUI(),r){if(se(o)){i.scrollTop={top:n.contentRenderer.content.scrollTop}}n.contentRenderer.refreshContentRows(i)}else{if(!o.getColumns().length)return o.element.innerHTML="",void alert(n.l10n.getConstant("EmptyDataSourceError"));if(n.contentRenderer.setRowElements([]),n.contentRenderer.setRowObjects([]),n.ariaService.setBusy(n.parent.getContent().firstChild,!1),n.renderEmptyRow(),i){var s=(i.requestType||"").toLowerCase()+"-complete";n.parent.notify(s,i),"batchsave"===i.requestType&&(i.cancel=!1,i.rows=[],i.isFrozen=0!==n.parent.getFrozenColumns()&&!i.isFrozen,n.parent.trigger(xe,i))}n.parent.hideSpinner()}n.parent.notify(et,{})}}})},i.prototype.dataManagerFailure=function(e,t){this.ariaService.setOptions(this.parent.getContent().firstChild,{busy:!1,invalid:!0}),this.parent.trigger("actionFailure",{error:e}),this.parent.hideSpinner(),"save"!==t.requestType&&"delete"!==t.requestType&&"bulk-save"!==t.name&&(this.parent.currentViewData=[],this.renderEmptyRow(),this.parent.log("actionfailure",{error:e}))},i.prototype.updatesOnInitialRender=function(e){this.isLayoutRendered=!0,this.parent.columns.length<1&&this.buildColumns(e.result[0]),E(this.parent.columns),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(tt,{})},i.prototype.iterateComplexColumns=function(e,t,r){for(var i=Object.keys(e),n=0;n<i.length;n++){var o=Object.keys(e[i[n]]);"object"==typeof e[i[n]]&&o.length?this.iterateComplexColumns(e[i[n]],t+(i[n]+"."),r):(r[this.counter]=t+i[n],this.counter++)}},i.prototype.buildColumns=function(e){var r=[],i={};this.iterateComplexColumns(e,"",i);for(var n=Object.keys(i).filter(function(e){return"BlazId"!==i[e]}).map(function(e){return i[e]}),o=0,s=n.length;o<s;o++)r[o]={field:n[o]},this.parent.enableColumnVirtualization&&(r[o].width=t.isNullOrUndefined(r[o].width)?200:r[o].width);this.parent.setProperties({columns:r},!0)},i.prototype.instantiateRenderer=function(){this.renderer.addRenderer(e.RenderType.Header,new Dt(this.parent,this.locator)),this.renderer.addRenderer(e.RenderType.Content,new Tt(this.parent,this.locator));var t=this.locator.getService("cellRendererFactory");t.addCellRenderer(e.CellType.Header,new Mt(this.parent,this.locator)),t.addCellRenderer(e.CellType.Data,new It(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new Pt(this.parent,this.locator)),t.addCellRenderer(e.CellType.Indent,new Bt(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaption,new qt(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaptionEmpty,new zt(this.parent,this.locator)),t.addCellRenderer(e.CellType.Expand,new Ut(this.parent,this.locator)),t.addCellRenderer(e.CellType.HeaderIndent,new Vt(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new Pt(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailHeader,new _t(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragHIcon,new Xt(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailExpand,new Wt(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailFooterIntent,new Bt(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragIcon,new Jt(this.parent,this.locator))},i.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(Me,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on(ze,this.refresh,this),this.parent.on("refresh-complete",this.refreshComplete,this),this.parent.on("bulk-save",this.sendBulkRequest,this),this.parent.on("showEmptyGrid",function(){e.emptyGrid=!0},this),this.parent.on(tt,this.dynamicColumnChange,this))},i.prototype.validateGroupRecords=function(e){var t=this,i=e.result.length-1;if(i<0)return Promise.resolve(e);var n=e.result[0],o=e.result[i],s=[],l=function(e){[n,o].forEach(function(e){return s.push(new r.Predicate("field","==",e.field).and(t.getPredicate("key","equal",e.key)))}),e.where(r.Predicate.or(s))},a=new r.Query;l(a);var d=new r.DataManager(e.result).executeLocal(a),c=this.data.generateQuery(!0),h=[];this.data.isRemote()?([n,o].forEach(function(e){return h.push(t.getPredicate(e.field,"equal",e.key))}),c.where(r.Predicate.or(h))):l(c);var p=new r.Deferred;return this.data.getData({},c).then(function(r){t.updateGroupInfo(d,r.result),p.resolve(e)}).catch(function(e){return p.reject(e)}),p.promise},i.prototype.getPredicate=function(e,t,i){return i instanceof Date?ne({field:e,operator:t,value:i}):new r.Predicate(e,t,i)},i.prototype.updateGroupInfo=function(e,t){var i=this,n=new r.DataManager(t);return e.forEach(function(e,t,o){var s=n.executeLocal((new r.Query).where(new r.Predicate("field","==",e.field).and(i.getPredicate("key","equal",e.key))))[0];e.count=s.count;var l=e.items,a=s.items;l.GroupGuid&&(e.items=i.updateGroupInfo(e.items,s.items)),i.parent.aggregates.forEach(function(t){return t.columns.forEach(function(t){(t.type instanceof Array?t.type:[t.type]).forEach(function(n){var o=t.field+" - "+n.toLowerCase(),d=l.level?a.records:s.items,c=i.parent;if("Custom"===n){var h=l.level?a:s;e.aggregates[o]=t.customAggregate?t.customAggregate.call(c,h,t):""}else e.aggregates[o]=r.DataUtil.aggregates[n.toLowerCase()](d,t.field)})})})}),e},i}(),Zt=function(){function r(){this.cellRenderMap={}}return r.prototype.addCellRenderer=function(r,i){r="string"==typeof r?r:t.getEnumValue(e.CellType,r),t.isNullOrUndefined(this.cellRenderMap[r])&&(this.cellRenderMap[r]=i)},r.prototype.getCellRenderer=function(r){if(r="string"==typeof r?r:t.getEnumValue(e.CellType,r),t.isNullOrUndefined(this.cellRenderMap[r]))throw"The cellRenderer "+r+" is not found";return this.cellRenderMap[r]},r}(),er=function(){function e(){this.services={}}return e.prototype.register=function(e,r){t.isNullOrUndefined(this.services[e])&&(this.services[e]=r)},e.prototype.getService=function(e){if(t.isNullOrUndefined(this.services[e]))throw"The service "+e+" is not registered";return this.services[e]},e}(),tr=function(){function r(){this.rendererMap={}}return r.prototype.addRenderer=function(r,i){var n=t.getEnumValue(e.RenderType,r);t.isNullOrUndefined(this.rendererMap[n])&&(this.rendererMap[n]=i)},r.prototype.getRenderer=function(r){var i=t.getEnumValue(e.RenderType,r);if(t.isNullOrUndefined(this.rendererMap[i]))throw"The renderer "+i+" is not found";return this.rendererMap[i]},r}(),rr=function(){function e(e){this.parent=e}return e.prototype.setWidthToColumns=function(){var e=this,t=0,r=this.parent.getColumnIndexesInView(),i=!0,n=0;if(this.parent.allowGrouping)for(var o=this.parent.groupSettings.columns.length;t<o;t++)this.parent.enableColumnVirtualization&&-1===r.indexOf(t)?i=!1:this.setColumnWidth(new we({width:"30px"}),t);(this.parent.detailTemplate||this.parent.childGrid)&&(this.setColumnWidth(new we({width:"30px"}),t),t++),this.parent.isRowDragable()&&(this.setColumnWidth(new we({width:"30px"}),t),t++),this.parent.getColumns().forEach(function(r,n){e.setColumnWidth(r,i&&e.parent.enableColumnVirtualization?void 0:n+t)}),n=this.getTableWidth(this.parent.getColumns()),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(n)},e.prototype.setMinwidthBycalculation=function(e){var r=0,i=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)||"auto"===e.width});if(i.length){t.isNullOrUndefined(this.parent.width)||"auto"===this.parent.width||(r=("string"==typeof this.parent.width?parseInt(this.parent.width,10):this.parent.width)-e);for(var n=0,o=0,s=i;o<s.length;o++){var l=s[o];n+=t.isNullOrUndefined(l.minWidth)?0:"string"==typeof l.minWidth?parseInt(l.minWidth,10):l.minWidth}for(var a=0;a<i.length;a++)0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&a!==i.length-1&&this.setUndefinedColumnWidth(i),0!==e&&r<n?this.setWidth(i[a].minWidth,this.parent.getColumnIndexByField(i[a].field)):0!==e&&r>n&&this.setWidth("",this.parent.getColumnIndexByField(i[a].field),!0)}},e.prototype.setUndefinedColumnWidth=function(e){for(var t=0;t<e.length;t++)t!==e.length-1&&(e[t].width=200,this.setWidth(200,this.parent.getColumnIndexByField(e[t].field)))},e.prototype.setColumnWidth=function(e,r,i){if(!(this.parent.getColumns().length<1)){var n=t.isNullOrUndefined(r)?this.parent.getNormalizedColumnIndex(e.uid):r,o=this.getWidth(e),s=this.getTableWidth(this.parent.getColumns());null!==o&&(this.setWidth(o,n),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(s),(this.parent.allowResizing&&"resize"===i||this.parent.getFrozenColumns()&&this.parent.allowResizing)&&this.setWidthToTable(),this.parent.notify("column-width-changed",{index:n,width:o,column:e,module:i}))}},e.prototype.setWidth=function(e,r,i){if("string"==typeof e&&-1!==e.indexOf("%")&&(!Boolean(window.chrome)||!Boolean(window.chrome.webstore))&&this.parent.allowGrouping){var n=this.parent.element.offsetWidth;e=parseInt(e,10)/100*n}var o,s=this.parent.getHeaderTable(),l=this.parent.getContentTable(),a=t.formatUnit(e),d=this.parent.getFrozenColumns(),c=this.parent.getHeaderContent().querySelector(".e-movableheader");(o=d&&r>=d&&c&&c.querySelector("colgroup")?c.querySelector("colgroup").children[r-d]:s.querySelector("colgroup").children[r])&&!i?o.style.width=a:o&&i&&(o.style.width=" ");var h;(h=d&&r>=d?this.parent.getContent().querySelector(".e-movablecontent").querySelector("colgroup").children[r-d]:l.querySelector("colgroup").children[r])&&!i?h.style.width=a:h&&i&&(h.style.width=" ");for(var p=this.parent.element.querySelectorAll(".e-table.e-inline-edit"),u=[],g=0;g<p.length;g++)for(var f=0;f<p[g].querySelector("colgroup").children.length;f++)u.push(p[g].querySelector("colgroup").children[f]);p.length&&(u[r].style.width=a)},e.prototype.getSiblingsHeight=function(e){return this.getHeightFromDirection(e,"previous")+this.getHeightFromDirection(e,"next")},e.prototype.getHeightFromDirection=function(e,t){for(var r=e[t+"ElementSibling"],i=0,n=["e-gridheader","e-gridfooter","e-groupdroparea","e-gridpager","e-toolbar"];r;)n.some(function(e){return r.classList.contains(e)})&&(i+=r.offsetHeight),r=r[t+"ElementSibling"];return i},e.prototype.isWidthUndefined=function(){var e=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)&&t.isNullOrUndefined(e.minWidth)}).length;return this.parent.getColumns().length===e},e.prototype.getWidth=function(e){if(t.isNullOrUndefined(e.width)&&this.parent.allowResizing&&t.isNullOrUndefined(e.minWidth)&&!this.isWidthUndefined()&&(e.width=200),this.parent.frozenColumns&&t.isNullOrUndefined(e.width)&&e.index<this.parent.frozenColumns&&(e.width=200),!e.width)return null;var r=parseInt(e.width.toString(),10);return e.minWidth&&r<parseInt(e.minWidth.toString(),10)?e.minWidth:e.maxWidth&&r>parseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width},e.prototype.getTableWidth=function(e){for(var t=0,r=0,i=e;r<i.length;r++){var n=i[r],o=this.getWidth(n);"auto"===n.width&&(o=0),!1!==n.visible&&null!==o&&(t+=parseInt(o.toString(),10))}return t},e.prototype.calcMovableOrFreezeColWidth=function(e){var r=this.parent.getColumns().slice();return"movable"===e?r.splice(0,this.parent.getFrozenColumns()):"freeze"===e&&r.splice(this.parent.getFrozenColumns(),r.length),t.formatUnit(this.getTableWidth(r))},e.prototype.setWidthToFrozenTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze");this.parent.getHeaderTable().style.width=e,this.parent.getContentTable().style.width=e},e.prototype.setWidthToMovableTable=function(){var e="",r=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)}).length>=1,i=this.parent.getColumns().filter(function(e){return"auto"===e.width}).length>=1;"number"!=typeof this.parent.width||r||i?r||i||(e=this.calcMovableOrFreezeColWidth("movable")):e=t.formatUnit(this.parent.width-parseInt(this.calcMovableOrFreezeColWidth("freeze").split("px")[0],10)-5),this.parent.getHeaderContent().querySelector(".e-movableheader").firstElementChild&&(this.parent.getHeaderContent().querySelector(".e-movableheader").firstElementChild.style.width=e),this.parent.getContent().querySelector(".e-movablecontent").firstElementChild.style.width=e},e.prototype.setWidthToFrozenEditTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze");this.parent.element.querySelectorAll(".e-table.e-inline-edit")[0].style.width=e},e.prototype.setWidthToMovableEditTable=function(){var e=this.calcMovableOrFreezeColWidth("movable");this.parent.element.querySelectorAll(".e-table.e-inline-edit")[1].style.width=e},e.prototype.setWidthToTable=function(){var e=t.formatUnit(this.getTableWidth(this.parent.getColumns()));this.parent.getFrozenColumns()?(this.setWidthToFrozenTable(),this.setWidthToMovableTable()):((this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new we({width:"30px"})),this.parent.getHeaderTable().style.width=e,this.parent.getContentTable().style.width=e);var r=this.parent.element.querySelector(".e-table.e-inline-edit");r&&this.parent.getFrozenColumns()?(this.setWidthToFrozenEditTable(),this.setWidthToMovableEditTable()):r&&(r.style.width=e)},e}(),ir=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),nr=function(){function e(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.forget=!0,this.skipFocus=!0,this.focusByClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.parent=e,this.rowModelGen=new Ct(this.parent),this.addEventListener()}return e.prototype.focusCheck=function(e){var t=e.target;this.focusByClick=!0,this.skipFocus=t.classList.contains("e-grid")},e.prototype.onFocus=function(){if(!(this.parent.isDestroyed||t.Browser.isDevice||this.parent.enableVirtualization)){this.setActive(0===this.parent.frozenRows,0!==this.parent.frozenColumns),this.parent.getCurrentViewRecords().length||this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new ft({isDataRow:!0})]}),this.getContent().selector,!1);var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.skipFocus&&(this.focus(),this.skipFocus=!1)}},e.prototype.passiveFocus=function(e){this.parent.isDestroyed||e.target&&e.target.classList.contains("e-detailcell")&&(this.currentInfo.skipAction=!1,t.addClass([this.currentInfo.element],["e-focused","e-focus"]))},e.prototype.onBlur=function(e){this.parent.isEdit||e&&(!e.relatedTarget||t.closest(e.relatedTarget,".e-grid"))||(this.removeFocus(),this.skipFocus=!1,this.currentInfo.skipAction=!1,this.getContent().getFocusInfo().elementToFocus&&(this.getContent().getFocusInfo().elementToFocus.tabIndex=0))},e.prototype.onClick=function(e,r){var i=!t.isNullOrUndefined(t.closest(e.target,".e-gridcontent")),n=!t.isNullOrUndefined(t.closest(e.target,".e-gridheader"));i=i&&n?!i:i;var o=!t.isNullOrUndefined(t.closest(e.target,".e-frozencontent"))||!t.isNullOrUndefined(t.closest(e.target,".e-frozenheader"));if(!(!i&&t.isNullOrUndefined(t.closest(e.target,".e-gridheader"))||e.target.classList.contains("e-content"))&&t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))){if(this.setActive(i,o),!i&&t.isNullOrUndefined(t.closest(e.target,".e-gridheader"))||e.target.classList.contains("e-filtermenudiv"))return void this.clearOutline();var s={cancel:!1,byKey:!1,byClick:!t.isNullOrUndefined(e.target),clickArgs:e};if(this.parent.notify("beforecellfocused",s),!s.cancel&&!t.closest(e.target,".e-inline-edit")&&(this.setActive(i,o),this.getContent())){if(!1===this.getContent().onClick(e,r))return;this.focus()}}},e.prototype.onKeyPress=function(e){if(!this.skipOn(e)){var t={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify("beforecellfocused",t),!t.cancel){var r=this.getContent().matrix.current;this.currentInfo.outline=!0;var i=this.getContent().jump(e.action,r);if(this.swap=i,i.swap&&(this.setActive(!i.toHeader,i.toFrozen),this.getContent().matrix.current=this.getContent().getNextCurrent(r,i,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent()),!1===this.getContent().onKeyPress(e))return void this.clearIndicator();e.preventDefault(),this.focus(e)}}},e.prototype.skipOn=function(e){var r=e.target;return!!r&&(this.currentInfo.skipAction?(this.clearIndicator(),!0):["pageUp","pageDown"].indexOf(e.action)>-1?(this.clearIndicator(),!0):(t.closest(r,"th")&&!t.closest(r,"th").tabIndex&&null!==t.closest(document.activeElement,".e-filterbarcell")&&this.removeFocus(),"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit||["insert","f2"].indexOf(e.action)>-1)||null!==t.closest(document.activeElement,".e-filterbarcell")||null!==t.closest(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)>-1||null===t.closest(r,".e-gridcontent")&&null===t.closest(r,".e-gridheader")||"space"===e.action&&!r.classList.contains("e-gridchkbox")&&null===t.closest(r,".e-gridchkbox")&&null===t.closest(r,".e-headerchkcelldiv")))},e.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},e.prototype.getContent=function(){return this.active||this.content},e.prototype.setActive=function(e,t){this.active=e?t?this.fContent:this.content:t?this.fHeader:this.header},e.prototype.setFocusedElement=function(e){var t=this;this.currentInfo.elementToFocus=e,setTimeout(function(){return t.currentInfo.elementToFocus.focus()},0)},e.prototype.focus=function(e){this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)},e.prototype.removeFocus=function(e){this.currentInfo.element&&(t.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focused","e-focus"]),this.currentInfo.element.tabIndex=-1)},e.prototype.addFocus=function(e,r){if(this.currentInfo=e,this.currentInfo.outline=e.outline&&!t.isNullOrUndefined(r),e.element){var i=e.elementToFocus.classList.contains("e-focus");if(!i){this.currentInfo.outline&&t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]),e.element.tabIndex=0,i||this.setFocusedElement(e.elementToFocus),this.parent.notify("cellfocused",{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!t.isNullOrUndefined(r),byClick:t.isNullOrUndefined(r),keyArgs:r,isJump:this.swap.swap,container:this.getContent().getInfo(r),outline:!t.isNullOrUndefined(r),swapInfo:this.swap});var n=this.getContent().matrix.current,o=n[0],s=n[1];this.prevIndexes={rowIndex:o,cellIndex:s},this.focusedColumnUid=this.parent.getColumnByIndex(s).uid,this.focusByClick=!1}}},e.prototype.refreshMatrix=function(e){var r=this;return function(i){e&&i.args&&i.args.isFrozen&&!r.fContent?r.fContent=new ar(r.parent):e&&!r.content&&(r.content=new sr(r.parent)),!e&&i.args&&i.args.isFrozen&&!r.fHeader?r.fHeader=new dr(r.parent):e||r.header||(r.header=new lr(r.parent));var n=e?i.args&&i.args.isFrozen?r.fContent:r.content:i.args&&i.args.isFrozen?r.fHeader:r.header,o=e?i.rows.slice(r.parent.frozenRows):i.rows,s=e?i.rows.slice(0,r.parent.frozenRows):i.rows,l=!t.isNullOrUndefined(r.parent.rowTemplate),a=n.matrix.generate(s,n.selector,l),d=r.parent.getFrozenColumns();if("batchAdd"===i.name&&d){for(var c=o.map(function(e){return e.clone()}),h=o.map(function(e){return e.clone()}),p=0;p<o.length;p++)o[p].cells.length>d&&(h[p].cells=o[p].cells.slice(0,d),c[p].cells=o[p].cells.slice(d));r.fContent.matrix.generate(h,r.fContent.selector,l),n.matrix.generate(c,n.selector,l)}else n.matrix.generate(o,n.selector,l);if(n.generateRows(s,{matrix:a,handlerInstance:i.args&&i.args.isFrozen?r.fHeader:r.header}),!t.Browser.isDevice&&!r.focusByClick&&i&&i.args&&"paging"===i.args.requestType&&(r.skipFocus=!1,r.parent.element.focus()),i&&i.args&&"virtualscroll"===i.args.requestType)if(r.currentInfo.uid){var u;if(i.rows.some(function(e,t){return u=t,e.uid===r.currentInfo.uid})&&(r.content.matrix.current[0]=u,r.content.matrix.current[1]=r.parent.getColumnIndexByUid(r.focusedColumnUid)||0,m=r.getContent().getFocusInfo().elementToFocus)){var g=m.getBoundingClientRect(),f=r.parent.element.getBoundingClientRect();g.top>=0&&g.left>=0&&g.right<=Math.min(f.right,window.innerWidth||document.documentElement.clientWidth)&&g.bottom<=Math.min(f.bottom,window.innerHeight||document.documentElement.clientHeight)&&r.focus()}}else if(i.args.focusElement&&i.args.focusElement.classList.contains("e-filtertext")){var m=r.parent.element.querySelector("#"+i.args.focusElement.id);m&&m.focus()}}},e.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(t.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),t.EventHandler.add(this.parent.element,"focus",this.onFocus,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(t){return e.passiveFocus(t)},!0),t.EventHandler.add(this.parent.element,"focusout",this.onBlur,this),this.parent.on(Ve,this.onKeyPress,this),this.parent.on(Ge,this.onClick,this),this.parent.on(Ne,this.refMatrix,this),this.parent.on("partial-refresh",this.refMatrix,this),this.parent.on(Ue,this.refreshMatrix(),this),this.parent.on("close-edit",this.restoreFocus,this),["start-edit","start-add"].forEach(function(t){return e.parent.on(t,e.clearIndicator,e)}),["sorting"].forEach(function(t){return e.parent.on(t+"-complete",e.restoreFocus,e)}),this.parent.on("batchAdd",this.refMatrix,this),this.parent.on("batchCancel",this.refMatrix,this),this.parent.on("batchDelete",this.refMatrix,this),this.parent.on("detailDataBound",this.refMatrix,this),this.parent.on(Le,this.refMatrix,this),this.parent.on("cellfocused",this.internalCellFocus,this))},e.prototype.removeEventListener=function(){var e=this;this.parent.isDestroyed||(t.EventHandler.remove(this.parent.element,"mousedown",this.focusCheck),t.EventHandler.remove(this.parent.element,"focus",this.onFocus),t.EventHandler.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),this.parent.off(Ve,this.onKeyPress),this.parent.off(Ge,this.onClick),this.parent.off(Ne,this.refMatrix),this.parent.off("partial-refresh",this.refMatrix),this.parent.off(Ue,this.refreshMatrix()),this.parent.off("close-edit",this.restoreFocus),["start-edit","start-add"].forEach(function(t){return e.parent.off(t,e.clearOutline)}),["sorting"].forEach(function(t){return e.parent.off(t+"-complete",e.restoreFocus)}),this.parent.off("batchAdd",this.refMatrix),this.parent.off("batchDelete",this.refMatrix),this.parent.off("batchCancel",this.refMatrix),this.parent.off("detailDataBound",this.refMatrix),this.parent.off(Le,this.refMatrix),this.parent.off("cellfocused",this.internalCellFocus))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.restoreFocus=function(){this.addFocus(this.getContent().getFocusInfo())},e.prototype.clearOutline=function(){this.getContent().matrix.current=this.getContent().matrix.get(0,-1,[0,1],"downArrow",this.getContent().validator()),this.clearIndicator()},e.prototype.clearIndicator=function(){this.currentInfo.element&&this.currentInfo.elementToFocus&&t.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focus","e-focused"])},e.prototype.getPrevIndexes=function(){var e=this.forget;return this.forget=!1,e?{rowIndex:null,cellIndex:null}:this.prevIndexes},e.prototype.forgetPrevious=function(){this.forget=!0},e.prototype.setActiveByKey=function(e,t){var r=this;if(0!==this.parent.frozenColumns||0!==this.parent.frozenRows){var i,n={home:function(){return{toHeader:!i.isContent,toFrozen:!0}},end:function(){return{toHeader:!i.isContent,toFrozen:!1}},ctrlHome:function(){return{toHeader:!0,toFrozen:0!==r.parent.frozenColumns}},ctrlEnd:function(){return{toHeader:!1,toFrozen:!1}}};if(e in n){i=t.getInfo();var o=n[e]();this.setActive(!o.toHeader,o.toFrozen),this.getContent().matrix.current=t.matrix.current}}},e.prototype.internalCellFocus=function(e){if(e.byKey&&e.container.isContent&&"enter"===e.keyArgs.action&&(e.parent.classList.contains("e-detailcell")||e.parent.classList.contains("e-unboundcell")||e.parent.classList.contains("e-templatecell"))){this.clearIndicator();var t=this.getContent().getFocusable(this.getFocusedElement());this.setFocusedElement(t),this.currentInfo.skipAction=!0}},e}(),or=function(){function e(){this.matrix=[],this.current=[]}return e.prototype.set=function(e,t,r){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.columns)),this.matrix[e]=this.matrix[e]||[],this.matrix[e][t]=r?1:0},e.prototype.get=function(e,r,i,n,o){var s=r;if(e+i[0]<0)return[e,r];if(e=Math.max(0,Math.min(e+i[0],this.rows)),t.isNullOrUndefined(this.matrix[e]))return null;if(r=Math.max(0,Math.min(r+i[1],this.matrix[e].length-1)),s+i[1]>this.matrix[e].length-1&&o(e,r,n))return[e,s];var l=this.first(this.matrix[e],r,i,!0,n);r=null===l?s:l;var a=t.getValue(e+"."+r,this.matrix);return e!==this.rows||"downArrow"!==n&&"enter"!==n||(i[0]=-1),this.inValid(a)||!o(e,r,n)?this.get(e,s,i,n,o):[e,r]},e.prototype.first=function(e,t,r,i,n){return(t<0||t===e.length)&&this.inValid(e[t])&&"upArrow"!==n&&"downArrow"!==n||!e.some(function(e){return 1===e})?null:this.inValid(e[t])?this.first(e,-1!==["upArrow","downArrow","shiftUp","shiftDown"].indexOf(n)?i?0:++t:t+r[1],r,!1,n):t},e.prototype.select=function(e,t){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.matrix[e].length-1)),this.current=[e,t]},e.prototype.generate=function(e,t,r){var i=this;return this.rows=e.length-1,this.matrix=[],e.forEach(function(e,n){var o=e.cells.filter(function(e){return!0!==e.isSpanned});i.columns=Math.max(o.length-1,0|i.columns),o.forEach(function(o,s){i.set(n,s,t(e,o,r))})}),this.matrix},e.prototype.inValid=function(e){return 0===e||void 0===e},e}(),sr=function(){function r(e){var t=this;this.matrix=new or,this.parent=e,this.keyActions={rightArrow:[0,1],tab:[0,1],leftArrow:[0,-1],shiftTab:[0,-1],upArrow:[-1,0],downArrow:[1,0],shiftUp:[-1,0],shiftDown:[1,0],shiftRight:[0,1],shiftLeft:[0,-1],enter:[1,0],shiftEnter:[-1,0]},this.indexesByKey=function(e){return{home:[t.matrix.current[0],-1,0,1],end:[t.matrix.current[0],t.matrix.columns+1,0,-1],ctrlHome:[0,-1,0,1],ctrlEnd:[t.matrix.rows,t.matrix.columns+1,0,-1]}[e]||null}}return r.prototype.getTable=function(){return this.parent.frozenColumns?this.parent.getContent().querySelector(".e-movablecontent .e-table"):this.parent.getContentTable()},r.prototype.onKeyPress=function(e){var t=this.keyActions[e.action],r=this.getCurrentFromAction(e.action,t,e.action in this.keyActions,e);if(r){if((["tab","shiftTab"].indexOf(e.action)>-1&&this.matrix.current||[]).toString()===r.toString()){if(r.toString()===[this.matrix.rows,this.matrix.columns].toString()||r.toString()===[0,0].toString()||this.matrix.current[0]===this.matrix.rows&&this.matrix.current.toString()===r.toString())return!1;r=this.editNextRow(r[0],r[1],e.action)}this.matrix.select(r[0],r[1])}},r.prototype.editNextRow=function(e,t,r){var i=this.parent,n=i.editSettings.allowNextRowEdit&&(i.isEdit||i.isLastCellPrimaryKey),o=i.getColumnIndexByField(i.getVisibleColumns()[0].field),s=this.getTable().rows[e].cells[t];return"tab"===r&&n&&(e++,t=o+(this.getTable().rows[e].querySelectorAll(".e-indentcell").length+this.getTable().rows[e].querySelectorAll(".e-detailrowcollapse").length)),"shiftTab"===r&&n&&(e--,t=i.getColumnIndexByField(i.getVisibleColumns()[i.getVisibleColumns().length-1].field)),s.classList.contains("e-rowcell")||s.classList.contains("e-headercell")?[e,t]:this.editNextRow(e,t,r)},r.prototype.getCurrentFromAction=function(e,t,r,i){if(void 0===t&&(t=[0,0]),!r&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(i))return this.matrix.current;var n=this.indexesByKey(e)||this.matrix.current.concat(t),o=n[0],s=n[1],l=n[2],a=n[3];return this.matrix.get(o,s,[l,a],e,this.validator())},r.prototype.onClick=function(e,r){var i=e.target;if(i=i.classList.contains("e-rowcell")?i:t.closest(i,"td"),i=i||(t.closest(e.target,"td.e-detailrowcollapse")||t.closest(e.target,"td.e-detailrowexpand")),i=t.closest(e.target,"td.e-detailcell")&&t.isNullOrUndefined(t.closest(t.closest(e.target,".e-grid"),"td.e-detailcell"))?null:i,!(i=i&&t.closest(i,"table").classList.contains("e-table")?i:null))return!1;var n=[i.parentElement.rowIndex,i.cellIndex],o=n[0],s=n[1],l=this.matrix.current,a=l[0],d=l[1],c=t.getValue(o+"."+s,this.matrix.matrix);if(this.matrix.inValid(c)||!r&&a===o&&d===s)return!1;this.matrix.select(o,s)},r.prototype.getFocusInfo=function(){var e={},r=this.matrix.current,i=r[0],n=void 0===i?0:i,o=r[1],s=void 0===o?0:o;return this.matrix.current=[n,s],e.element=t.isNullOrUndefined(this.getTable().rows[n])?null:this.getTable().rows[n].cells[s],e.element?(e.elementToFocus=e.element.classList.contains("e-unboundcell")||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.outline=!0,e.uid=e.element.parentElement.getAttribute("data-uid"),e):e},r.prototype.getFocusable=function(e){var t='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])';this.parent.isEdit&&(t='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea');var r=[].slice.call(e.querySelectorAll(t));return r.length?r[0]:e},r.prototype.selector=function(r,i,n){var o=[e.CellType.Expand,e.CellType.GroupCaption,e.CellType.CaptionSummary,e.CellType.GroupSummary];return(r.isDataRow&&i.visible&&(i.isDataCell||i.isTemplate)||r.isDataRow&&i.cellType===e.CellType.DetailExpand&&t.isNullOrUndefined(i.visible)||!r.isDataRow&&o.indexOf(i.cellType)>-1||i.column&&"checkbox"===i.column.type||i.cellType===e.CellType.CommandColumn||r.isDataRow&&n)&&!("delete"===r.edit&&r.isDirty)},r.prototype.jump=function(e,t){var r=this.parent.frozenColumns>0&&("leftArrow"===e||"shiftTab"===e)&&0===t[1],i=0!==this.parent.frozenRows&&"shiftEnter"===e;return{swap:("upArrow"===e||i)&&0===t[0]||r,toHeader:("upArrow"===e||i)&&0===t[0],toFrozen:r}},r.prototype.getNextCurrent=function(e,t,r,i){void 0===e&&(e=[]);var n=[];return"rightArrow"===i||"tab"===i?(n[0]=e[0],n[1]=-1):"downArrow"!==i&&"enter"!==i||(n[0]=-1,n[1]=e[1]),n},r.prototype.generateRows=function(e,t){var r,i=t.matrix,n=t.handlerInstance,o=n.matrix.matrix.length,s=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?o+1:o;n.matrix.matrix=n.matrix.matrix.slice(0,s),n.matrix.rows=s,(r=n.matrix.matrix).push.apply(r,i),n.matrix.rows+=i.length},r.prototype.getInfo=function(e){var t=this.getFocusInfo(),r=this.matrix.current,i=r[0],n=r[1],o=t.element.classList.contains("e-rowcell"),s=o||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),l=[Math.min(parseInt(t.element.parentElement.getAttribute("aria-rowindex"),10),i),Math.min(parseInt(t.element.getAttribute("aria-colindex"),10),n)];return{isContent:!0,isDataCell:o,indexes:[l[0],l[1]],isSelectable:s}},r.prototype.validator=function(){var e=this.getTable();return function(t,r,i){var n,o=0!==(n=e.rows[t].cells[0].classList.contains("e-editcell")?e.rows[t].cells[0].querySelectorAll("td")[r]:e.rows[t].cells[r]).getBoundingClientRect().width;return"enter"===i||"shiftEnter"===i?o&&n.classList.contains("e-rowcell"):"shiftUp"!==i&&"shiftDown"!==i||!n.classList.contains("e-rowcell")?"shiftUp"!==i&&"shiftDown"!==i&&o:o}},r.prototype.shouldFocusChange=function(e){var r=this.matrix.current,i=r[0],n=void 0===i?-1:i,o=r[1],s=void 0===o?-1:o;if(n<0||s<0)return!0;var l=t.getValue(n+".cells."+s,this.getTable().rows);return!l||("enter"!==e.action&&"shiftEnter"!==e.action||l.classList.contains("e-rowcell")&&!l.classList.contains("e-unboundcell")&&!l.classList.contains("e-templatecell")&&!l.classList.contains("e-detailcell"))},r}(),lr=function(r){function i(e){return r.call(this,e)||this}return ir(i,r),i.prototype.getTable=function(){return this.parent.getFrozenColumns()?this.parent.getHeaderContent().querySelector(".e-movableheader .e-table"):this.parent.getHeaderTable()},i.prototype.onClick=function(e){var r=e.target;if((r=r.classList.contains("e-headercell")?r:t.closest(r,"th"))||0===this.parent.frozenRows||(r=e.target.classList.contains("e-rowcell")?e.target:t.closest(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(r){var i=[r.parentElement.rowIndex,r.cellIndex],n=i[0],o=i[1],s=t.getValue(n+"."+o,this.matrix.matrix);if(this.matrix.inValid(s))return!1;this.matrix.select(r.parentElement.rowIndex,r.cellIndex)}},i.prototype.getFocusInfo=function(){var e={},t=this.matrix.current,r=t[0],i=void 0===r?0:r,n=t[1],o=void 0===n?0:n;return e.element=this.getTable().rows[i].cells[o],e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell"),e},i.prototype.selector=function(t,r){return r.visible&&(void 0!==r.column.field||r.isTemplate)||"checkbox"===r.column.type||r.cellType===e.CellType.StackedHeader},i.prototype.jump=function(e,t){var r=this.parent.frozenColumns>0&&("leftArrow"===e||"shiftTab"===e)&&0===t[1],i=0!==this.parent.frozenRows&&"enter"===e;return{swap:("downArrow"===e||i)&&t[0]===this.matrix.matrix.length-1||r,toHeader:r,toFrozen:r}},i.prototype.getNextCurrent=function(e,t,r,i){void 0===e&&(e=[]);var n=[];return"upArrow"===i||"shiftEnter"===i?(n[0]=this.matrix.matrix.length,n[1]=e[1]):"rightArrow"!==i&&"tab"!==i||(n[0]=e[0],n[1]=-1),n},i.prototype.generateRows=function(e){var t=this,r=this.matrix.matrix.length;this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type&&(this.matrix.rows=++this.matrix.rows,e[0].cells.forEach(function(e,i){return t.matrix.set(r,i,e.visible&&!1!==e.column.allowFiltering)}))},i.prototype.getInfo=function(e){return t.extend(r.prototype.getInfo.call(this,e),{isContent:!1,isHeader:!0})},i.prototype.validator=function(){return function(){return!0}},i.prototype.shouldFocusChange=function(e){var r=this.matrix.current,i=r[0],n=r[1];if(i<0||n<0)return!0;var o=t.getValue(i+".cells."+n,this.getTable().rows);return!o||("enter"!==e.action&&"altDownArrow"!==e.action||!o.classList.contains("e-headercell"))},i}(sr),ar=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ir(t,e),t.prototype.getTable=function(){return this.parent.getContent().querySelector(".e-frozencontent .e-table")},t.prototype.jump=function(e,t){var r=0!==this.parent.frozenRows&&"shiftEnter"===e;return{swap:("upArrow"===e||r)&&0===t[0]||("tab"===e||"rightArrow"===e)&&t[1]===this.matrix.columns,toHeader:("upArrow"===e||r)&&0===t[0],toFrozen:("upArrow"===e||r)&&0===t[0]}},t.prototype.getNextCurrent=function(e,t,r,i){void 0===e&&(e=[]);var n=[];return"leftArrow"===i||"shiftTab"===i?(n[0]=e[0],n[1]=r.matrix.columns+1):"downArrow"!==i&&"enter"!==i||(n[0]=-1,n[1]=e[1]),n},t}(sr),dr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ir(t,e),t.prototype.jump=function(e,t){var r=0!==this.parent.frozenRows&&"enter"===e;return{swap:("downArrow"===e||r)&&t[0]===this.matrix.matrix.length-1||("rightArrow"===e||"tab"===e)&&t[1]===this.matrix.columns,toHeader:("rightArrow"===e||"tab"===e)&&t[1]===this.matrix.columns,toFrozen:("downArrow"===e||r)&&t[0]===this.matrix.matrix.length-1}},t.prototype.getTable=function(){return this.parent.getHeaderContent().querySelector(".e-frozenheader .e-table")},t.prototype.getNextCurrent=function(e,t,r,i){void 0===e&&(e=[]);var n=[];return"leftArrow"===i||"shiftTab"===i?(n[0]=e[0],n[1]=r.matrix.columns+1):"upArrow"!==i&&"shiftEnter"!==i||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},t}(lr),cr=function(){function e(e){this.searchBox=e}return e.prototype.searchFocus=function(e){e.target.parentElement.classList.add("e-input-focus")},e.prototype.searchBlur=function(e){e.target.parentElement.classList.remove("e-input-focus")},e.prototype.wireEvent=function(){this.searchBox&&(t.EventHandler.add(this.searchBox,"focus",this.searchFocus,this),t.EventHandler.add(this.searchBox,"blur",this.searchBlur,this))},e.prototype.unWireEvent=function(){this.searchBox&&(t.EventHandler.remove(this.searchBox,"focus",this.searchFocus),t.EventHandler.remove(this.searchBox,"blur",this.searchBlur))},e}(),hr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),pr=function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},ur=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return hr(r,e),pr([t.Property(12)],r.prototype,"pageSize",void 0),pr([t.Property(8)],r.prototype,"pageCount",void 0),pr([t.Property(1)],r.prototype,"currentPage",void 0),pr([t.Property()],r.prototype,"totalRecordsCount",void 0),pr([t.Property(!1)],r.prototype,"enableQueryString",void 0),pr([t.Property(!1)],r.prototype,"pageSizes",void 0),pr([t.Property(null)],r.prototype,"template",void 0),r}(t.ChildProperty),gr=function(){return(gr=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},fr=function(){function i(e,t,r){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.preventFocus=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.enableSelectMultiTouch=!1,this.clearRowCheck=!1,this.selectRowCheck=!1,this.selectedRowState={},this.totalRecordsCount=0,this.chkAllCollec=[],this.isCheckedOnAdd=!1,this.persistSelectedData=[],this.isCancelDeSelect=!1,this.isPreventCellSelect=!1,this.disableUI=!1,this.isPersisted=!1,this.cmdKeyPressed=!1,this.parent=e,this.selectionSettings=t,this.factory=r.getService("rendererFactory"),this.focus=r.getService("focus"),this.addEventListener(),this.wireEvents()}return i.prototype.initializeSelection=function(){this.parent.log("selection_key_missing"),t.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this)},i.prototype.onActionBegin=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},i.prototype.fDataUpdate=function(e){if(e.cellIndex||e.rowIndex){var r=this.getRowObj(t.isNullOrUndefined(e.rowIndex)?t.isNullOrUndefined(e.cellIndex)?this.currentIndex:e.cellIndex.rowIndex:e.rowIndex);e.foreignKeyData=r.foreignKeyData}return e},i.prototype.onActionComplete=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},i.prototype.getModuleName=function(){return"selection"},i.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.hidePopUp(),this.clearSelection(),this.removeEventListener(),this.unWireEvents(),t.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler))},i.prototype.isEditing=function(){return("Normal"===this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate())&&this.parent.isEdit&&!this.parent.isPersistSelection},i.prototype.getSelectedMovableRow=function(e){var t=this.parent;return t.getFrozenColumns()?t.getMovableRowByIndex(e):null},i.prototype.getCurrentBatchRecordChanges=function(){var e=this.parent;if("Batch"===e.editSettings.mode&&e.editModule){var t=w(this.parent.getCurrentViewRecords());t=this.parent.editModule.getBatchChanges().addedRecords.concat(t);for(var r=this.parent.editModule.getBatchChanges().deletedRecords,i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<r.length;n++)for(var o=0;o<t.length;o++)if(r[n][i]===t[o][i]){t.splice(o,1);break}return t}return e.getCurrentViewRecords()},i.prototype.selectRow=function(e,r){if(this.selectedRowIndexes.length&&this.selectionSettings.enableSimpleMultiRowSelection)return void this.addRowsToSelection([e]);var i,n=this.parent,o=n.getRowByIndex(e),s=this.getSelectedMovableRow(e),l=!1;if(n.enableVirtualization&&e>-1){if(!o)return this.parent.getSelectedRecords().length>0&&this.clearRowSelection(),void this.parent.notify("select-virtual-Row",{selectedIndex:e});i=n.getRowObjectFromUID(o.getAttribute("data-uid")).data}else i=this.getCurrentBatchRecordChanges()[e];if(this.isRowType()&&o&&!this.isEditing()){var a,d=o.hasAttribute("aria-selected");(r=r?!!this.selectedRowIndexes.length&&(1===this.selectedRowIndexes.length&&e===this.selectedRowIndexes[0]):r)||(a={data:i,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:o,previousRow:n.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1},a=this.addMovableArgs(a,s),this.onActionBegin(a,"rowSelecting")),(t.isNullOrUndefined(a)||!0!==a.cancel)&&(this.index=e,this.toggle=r,this.data=i,this.removed=l,d&&this.selectionSettings.persistSelection?(this.clearSelectedRow(e),l=!0,this.removed=l,this.selectRowCallBack()):!d&&this.selectionSettings.persistSelection&&this.selectRowCallBack(),this.selectionSettings.persistSelection||(this.selectRowCheck=!0,this.clearRow()))}},i.prototype.selectRowCallBack=function(){var e,t=this.parent,r=this.index,i=this.toggle,n=this.data,o=this.removed,s=t.getRowByIndex(r),l=this.getSelectedMovableRow(r);i||o||(this.selectedRowIndexes.indexOf(r)<=-1&&(this.updateRowSelection(s,r),t.getFrozenColumns()&&this.updateRowSelection(l,r)),this.selectRowIndex(r)),i||(e={data:n,rowIndex:r,row:s,previousRow:t.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget},e=this.addMovableArgs(e,l),this.onActionComplete(e,"rowSelected")),this.updateRowProps(r)},i.prototype.addMovableArgs=function(e,t){if(this.parent.getFrozenColumns()){var r={mRow:t,previousMovRow:this.parent.getMovableRows()[this.prevRowIndex]};e=gr({},e,r)}return e},i.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},i.prototype.selectRows=function(e){var r=this.parent,i=this.isSingleSel()?e[e.length-1]:e[0],n=r.getRowByIndex(i),o=this.getSelectedMovableRow(i),s=r.getFrozenColumns(),l=this.getCurrentBatchRecordChanges()[e[0]];if(this.isRowType()&&!this.isEditing()){var a={cancel:!1,rowIndexes:e,row:n,rowIndex:i,target:this.actualTarget,prevRow:r.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:l};if(a=this.addMovableArgs(a,o),this.onActionBegin(a,"rowSelecting"),t.isNullOrUndefined(a)||!0!==a.cancel){if(this.clearRow(),this.selectRowIndex(e.slice(-1)[0]),this.isSingleSel())this.updateRowSelection(r.getRowByIndex(i),i),s&&this.updateRowSelection(r.getMovableRowByIndex(i),i),this.updateRowProps(i);else for(var d=0,c=e;d<c.length;d++){var h=c[d];this.updateRowSelection(r.getRowByIndex(h),h),s&&this.updateRowSelection(r.getMovableRowByIndex(h),h),this.updateRowProps(i)}a={rowIndexes:e,row:n,rowIndex:i,target:this.actualTarget,prevRow:r.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,data:this.getSelectedRecords(),isInteracted:this.isInteracted},a=this.addMovableArgs(a,o),this.onActionComplete(a,"rowSelected")}}},i.prototype.addRowsToSelection=function(e){var r=this.parent,i=this.target,n=this.isSingleSel()?r.getRowByIndex(e[e.length-1]):r.getRowByIndex(e[0]),o=this.isSingleSel()?this.getSelectedMovableRow(e[e.length-1]):this.getSelectedMovableRow(e[0]),s=r.getFrozenColumns();if(this.isRowType()&&!this.isEditing())for(var l,a=this.parent.getColumns().filter(function(e){return"checkbox"===e.type}),d=0,c=e;d<c.length;d++){var h=c[d],p=this.getRowObj(h),u=this.selectedRowIndexes.indexOf(h)>-1;if(this.selectRowIndex(h),u&&(a.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.rowDeselect("rowDeselecting",[h],[p.data],[n],[p.foreignKeyData],i),this.isCancelDeSelect)return;this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(h),1),this.selectedRecords.splice(this.selectedRecords.indexOf(n),1),n.removeAttribute("aria-selected"),this.addRemoveClassesForRow(n,!1,null,"e-selectionbackground","e-active"),o&&(this.selectedRecords.splice(this.selectedRecords.indexOf(o),1),o.removeAttribute("aria-selected"),this.addRemoveClassesForRow(o,!1,null,"e-selectionbackground","e-active")),this.rowDeselect("rowDeselected",[h],[p.data],[n],[p.foreignKeyData],i,[o]),this.isInteracted=!1}else{if(l={cancel:!1,data:p.data,rowIndex:h,row:n,target:this.actualTarget,prevRow:r.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:p.foreignKeyData},l=this.addMovableArgs(l,o),this.onActionBegin(l,"rowSelecting"),!t.isNullOrUndefined(l)&&!0===l.cancel)return;this.isSingleSel()&&this.clearRow(),this.updateRowSelection(n,h),s&&this.updateRowSelection(o,h)}if(u||(l={data:p.data,rowIndex:h,row:n,target:this.actualTarget,prevRow:r.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:p.foreignKeyData},l=this.addMovableArgs(l,o),this.onActionComplete(l,"rowSelected")),this.updateRowProps(h),this.isSingleSel())break}},i.prototype.getCollectionFromIndexes=function(e,t){for(var r=[],i=e<=t?{i:e,max:t}:{i:t,max:e},n=i.i,o=i.max;n<=o;n++)r.push(n);return e>t&&r.reverse(),r},i.prototype.clearRow=function(){this.clearRowCheck=!0,this.clearRowSelection()},i.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},i.prototype.clearSelectedRow=function(e){if(this.target){var t=this.target.parentElement;this.disableUI||(t.removeAttribute("aria-selected"),this.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),this.updatePersistCollection(t,!1),this.updateCheckBoxes(t),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(e),1),this.selectedRecords.splice(this.selectedRecords.indexOf(this.parent.getRowByIndex(e)),1)}},i.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},i.prototype.updatePersistCollection=function(e,r){var i=this;if(this.parent.isPersistSelection&&!t.isNullOrUndefined(e)){var n=this.getRowObj(e),o=n.data?n.data[this.primaryKey]:null;if(null===o)return;n.isSelected=r,r?(this.selectedRowState[o]=r,this.persistSelectedData.some(function(e){return e[i.primaryKey]===o})||this.persistSelectedData.push(n.data)):this.updatePersistDelete(o)}},i.prototype.updatePersistDelete=function(e){var t=this;delete this.selectedRowState[e];var r;this.persistSelectedData.some(function(i,n){return r=n,i[t.primaryKey]===e})&&this.persistSelectedData.splice(r,1)},i.prototype.updateCheckBoxes=function(e,r,i){if(!t.isNullOrUndefined(e)){var n=e.querySelector(".e-checkselect");t.isNullOrUndefined(n)||(ee(n.nextElementSibling,r),(t.isNullOrUndefined(this.checkedTarget)||!t.isNullOrUndefined(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(i))}},i.prototype.updateRowSelection=function(e,t){if(e){this.selectedRowIndexes.push(t);var r=this.selectedRowIndexes.length;if(this.parent.getFrozenColumns()&&r>1&&this.selectedRowIndexes[r-2]===this.selectedRowIndexes[r-1]&&this.selectedRowIndexes.pop(),this.selectedRecords.push(e),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),this.addRemoveClassesForRow(e,!0,null,"e-selectionbackground","e-active"),!this.preventFocus){var i=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide):not(.e-detailrowcollapse):not(.e-detailrowexpand)");if(!i)return;this.focus.onClick({target:i},!0)}}},i.prototype.clearSelection=function(){if(!this.parent.isPersistSelection||this.parent.isPersistSelection&&!this.parent.isEdit||!t.isNullOrUndefined(this.checkedTarget)&&this.checkedTarget.classList.contains("e-checkselectall")){var e=this.parent.element.querySelector(".e-gridpopup").querySelector("span");e.classList.contains("e-rowselect")&&e.classList.remove("e-spanclicked"),this.isInteracted=!1,this.parent.isPersistSelection&&(this.persistSelectedData=[],this.selectedRowState={}),this.clearRowSelection(),this.clearCellSelection(),this.enableSelectMultiTouch=!1}},i.prototype.clearRowSelection=function(){var e=this;if(this.isRowSelected){for(var t=this.parent,r=this.parent.getDataRows(),i=[],n=[],o=[],s=[],l=t.getFrozenColumns(),a=[],d=this.target,c=(this.parent.getCurrentViewRecords(),0),h=this.selectedRowIndexes.length;c<h;c++){var p="Batch"===this.parent.editSettings.mode?this.parent.getRows()[this.selectedRowIndexes[c]]:this.parent.getDataRows()[this.selectedRowIndexes[c]],u=this.getRowObj(p);u&&(i.push(u.data),n.push(p),s.push(this.selectedRowIndexes[c]),a.push(u.foreignKeyData)),l&&o.push(t.getMovableRows()[this.selectedRowIndexes[c]])}this.selectionSettings.persistSelection&&(this.isInteracted=!!this.checkSelectAllClicked),this.rowDeselect("rowDeselecting",s,i,n,a,d,o,function(){if(e.isCancelDeSelect&&(e.isInteracted||e.checkSelectAllClicked)){if(e.parent.isPersistSelection)if("Intermediate"===e.getCheckAllStatus(e.parent.element.querySelector(".e-checkselectall")))for(t=0;t<e.selectedRecords.length;t++)e.updatePersistCollection(e.selectedRecords[t],!0);else e.parent.checkAllRows="Check",e.updatePersistSelectedData(!0);return void(e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1)))}r.filter(function(e){return e.hasAttribute("aria-selected")}).forEach(function(t){e.disableUI||(t.removeAttribute("aria-selected"),e.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),e.updatePersistCollection(t,!1),e.updateCheckBoxes(t)});for(var t=0,l=e.selectedRowIndexes.length;t<l;t++){var c=e.getSelectedMovableRow(e.selectedRowIndexes[t]);c&&(e.disableUI||(c.removeAttribute("aria-selected"),e.addRemoveClassesForRow(c,!1,!0,"e-selectionbackground","e-active")),e.updatePersistCollection(c,!1))}e.selectedRowIndexes=[],e.selectedRecords=[],e.isRowSelected=!1,e.selectRowIndex(-1),e.rowDeselect("rowDeselected",s,i,n,a,d,o),e.isInteracted=!1,e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1))})}else this.clearRowCheck&&(this.clearRowCallBack(),this.clearRowCheck=!1,this.selectRowCheck&&(this.selectRowCallBack(),this.selectRowCheck=!1))},i.prototype.rowDeselect=function(e,r,i,n,o,s,l,a){var d=this;if(this.selectionSettings.persistSelection&&this.isInteracted||!this.selectionSettings.persistSelection){var c={rowIndex:r,data:i,foreignKeyData:o,cancel:!1,target:s,isInteracted:this.isInteracted};if(!t.isBlazor()||this.parent.isJsComponent){c.row=n}else{c.rowIndex=c.rowIndex[c.rowIndex.length-1],c.data=c.data[c.data.length-1]}this.parent.trigger(e,this.parent.getFrozenColumns()?gr({},c,{mRow:l}):c,function(e){d.isCancelDeSelect=e.cancel,d.isCancelDeSelect&&(d.isInteracted||d.checkSelectAllClicked)||(d.updatePersistCollection(n[0],!1),d.updateCheckBoxes(n[0],void 0,r[0])),void 0!==a&&a()})}else this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==a&&a()},i.prototype.getRowObj=function(e){return void 0===e&&(e=this.currentIndex),t.isNullOrUndefined(e)?{}:("number"==typeof e&&(e=this.parent.getRowByIndex(e)),e?this.parent.getRowObjectFromUID(e.getAttribute("data-uid"))||{}:{})},i.prototype.getSelectedMovableCell=function(e){var t=this.parent,r=t.getFrozenColumns();return r&&e.cellIndex>=r?t.getMovableCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex)):null},i.prototype.selectCell=function(e,r){if(this.isCellType()){var i,n=this.parent,o=this.getSelectedMovableCell(e);o||(o=n.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex))),this.currentIndex=e.rowIndex;var s=this.getCurrentBatchRecordChanges()[this.currentIndex];if(this.isCellType()&&o&&!this.isEditing()){var l=o.classList.contains("e-cellselectionbackground");if(r=r?!t.isUndefined(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&l:r)this.successCallBack(i,r,e,o,s)(i);else{if(i={data:s,cellIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,cancel:!1},!t.isBlazor()||this.parent.isJsComponent){i.currentCell=o;i.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(i),this.successCallBack(i,r,e,o,s))}}}},i.prototype.successCallBack=function(e,r,i,n,o){var s=this;return function(e){if((t.isNullOrUndefined(e)||!0!==e.cancel)&&(r||(e.currentCell=e.currentCell?e.currentCell:n),s.clearCell(),r||s.updateCellSelection(n,i.rowIndex,i.cellIndex),!r)){var l={data:o,cellIndex:i,currentCell:n,selectedRowCellIndex:s.selectedRowCellIndexes,previousRowCell:s.prevECIdxs?s.getCellIndex(s.prevECIdxs.rowIndex,s.prevECIdxs.cellIndex):void 0};if(!t.isBlazor()){l.previousRowCellIndex=s.prevECIdxs}s.updateCellProps(i,i),s.onActionComplete(l,"cellSelected")}}},i.prototype.getCellIndex=function(e,t){return this.parent.getFrozenColumns()&&t>=this.parent.getFrozenColumns()?this.parent.getMovableCellFromIndex(e,t):this.parent.getCellFromIndex(e,t)},i.prototype.selectCellsByRange=function(e,r){var i=this;if(this.isCellType()){var n=this.parent,o=this.getSelectedMovableCell(e),s=n.getFrozenColumns();o||(o=n.getCellFromIndex(e.rowIndex,e.cellIndex));var l,a,d,c=e,h=r=r||e;this.currentIndex=e.rowIndex;var p=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var u={data:p,cellIndex:e,currentCell:o,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};if(!t.isBlazor()){u.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(u),function(u){if(t.isNullOrUndefined(u)||!0!==u.cancel){if(i.clearCell(),e.rowIndex>r.rowIndex){var g=e;e=r,r=g}for(var f=e.rowIndex;f<=r.rowIndex;f++){i.selectionSettings.cellSelectionMode.indexOf("Box")<0?(l=f===e.rowIndex?e.cellIndex:0,a=f===r.rowIndex?r.cellIndex:i.getLastColIndex(f)):(l=e.cellIndex,a=r.cellIndex),d=[];for(var m=l<a?l:a,y=l>a?l:a;m<=y;m++)(o=s?m<s?n.getCellFromIndex(f,m):n.getMovableCellFromIndex(f,m):n.getCellFromIndex(f,m))&&(d.push(m),i.updateCellSelection(o),i.addAttribute(o));i.selectedRowCellIndexes.push({rowIndex:f,cellIndexes:d})}var v={data:p,cellIndex:h,currentCell:n.getCellFromIndex(h.rowIndex,h.cellIndex),selectedRowCellIndex:i.selectedRowCellIndexes,previousRowCell:i.prevECIdxs?i.getCellIndex(i.prevECIdxs.rowIndex,i.prevECIdxs.cellIndex):void 0};if(!t.isBlazor()){v.previousRowCellIndex=i.prevECIdxs}i.onActionComplete(v,"cellSelected"),i.updateCellProps(c,h)}})}}},i.prototype.selectCells=function(e){if(this.isCellType()){var r=this.parent,i=this.getSelectedMovableCell(e[0]),n=r.getFrozenColumns();i||(i=r.getCellFromIndex(e[0].rowIndex,e[0].cellIndexes[0])),this.currentIndex=e[0].rowIndex;var o=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var s={data:o,cellIndex:e[0].cellIndexes[0],currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};t.isBlazor()||(s[p="previousRowCellIndex"]=this.prevECIdxs),this.onActionBegin(s,"cellSelecting");for(var l=0,a=e.length;l<a;l++)for(var d=0,c=e[l].cellIndexes.length;d<c;d++)(i=n?e[l].cellIndexes[d]<n?r.getCellFromIndex(e[l].rowIndex,e[l].cellIndexes[d]):r.getMovableCellFromIndex(e[l].rowIndex,e[l].cellIndexes[d]):r.getCellFromIndex(e[l].rowIndex,e[l].cellIndexes[d]))&&(this.updateCellSelection(i),this.addAttribute(i),this.addRowCellIndex({rowIndex:e[l].rowIndex,cellIndex:e[l].cellIndexes[d]}));this.updateCellProps({rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]},{rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]});var h={data:o,cellIndex:e[0].cellIndexes[0],currentCell:i,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};if(!t.isBlazor()){var p="previousRowCellIndex";h[p]=this.prevECIdxs}this.onActionComplete(h,"cellSelected")}}},i.prototype.addCellsToSelection=function(e){if(this.isCellType()){var r,i,n=this.parent,o=n.getFrozenColumns();this.currentIndex=e[0].rowIndex;var s=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){this.hideAutoFill();var l;l=o&&e[0].cellIndex>=o?n.getMovableRowsObject()[e[0].rowIndex]:this.getRowObj(e[0].rowIndex);for(var a=[],d=0,c=e;d<c.length;d++){for(var h=c[d],p=0,u=this.selectedRowCellIndexes.length;p<u;p++)if(this.selectedRowCellIndexes[p].rowIndex===h.rowIndex){i=p;break}(r=this.getSelectedMovableCell(h))||(r=n.getCellFromIndex(h.rowIndex,this.getColIndex(h.rowIndex,h.cellIndex))),a.push(l.cells[o&&e[0].cellIndex>=o?h.cellIndex-o:h.cellIndex].foreignKeyData);var g={cancel:!1,data:s,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,currentCell:r,isCtrlPressed:this.isMultiCtrlRequest,previousRowCell:this.prevECIdxs?n.getCellFromIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};t.isBlazor()||(g[v="previousRowCellIndex"]=this.prevECIdxs);var f=i>-1;if(f){var m=this.selectedRowCellIndexes[i].cellIndexes;m.indexOf(h.cellIndex)>-1?(this.cellDeselect("cellDeselecting",[{rowIndex:h.rowIndex,cellIndexes:[h.cellIndex]}],s,[r],a),m.splice(m.indexOf(h.cellIndex),1),0===m.length&&this.selectedRowCellIndexes.splice(i,1),r.classList.remove("e-cellselectionbackground"),r.removeAttribute("aria-selected"),this.cellDeselect("cellDeselected",[{rowIndex:h.rowIndex,cellIndexes:[h.cellIndex]}],s,[r],a)):(f=!1,this.onActionBegin(g,"cellSelecting"),this.addRowCellIndex({rowIndex:h.rowIndex,cellIndex:h.cellIndex}),this.updateCellSelection(r),this.addAttribute(r))}else{if(this.onActionBegin(g,"cellSelecting"),!t.isNullOrUndefined(g)&&!0===g.cancel)return;this.updateCellSelection(r,h.rowIndex,h.cellIndex)}if(!f){var y={data:s,cellIndex:e[0],currentCell:r,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes};if(!t.isBlazor()){var v="previousRowCellIndex";y[v]=this.prevECIdxs}this.onActionComplete(y,"cellSelected")}this.updateCellProps(h,h)}}}},i.prototype.getColIndex=function(e,t){var r,i=this.parent.getFrozenColumns();if(i&&t>=i&&(r=this.parent.getMovableDataRows()[e]&&this.parent.getMovableDataRows()[e].querySelectorAll("td.e-rowcell")),r||(r=this.parent.getDataRows()[e]&&this.parent.getDataRows()[e].querySelectorAll("td.e-rowcell")),r)for(var n=0;n<r.length;n++)if(parseInt(r[n].getAttribute("aria-colindex"),10)===t)return i&&t>=i&&(n+=i),n;return-1},i.prototype.getLastColIndex=function(e){var t=this.parent.getFrozenColumns()?this.parent.getMovableDataRows()[e].querySelectorAll("td.e-rowcell"):this.parent.getDataRows()[e].querySelectorAll("td.e-rowcell");return parseInt(t[t.length-1].getAttribute("aria-colindex"),10)},i.prototype.clearCell=function(){this.clearCellSelection()},i.prototype.cellDeselect=function(e,r,i,n,o){n[0]&&n[0].classList.contains("e-gridchkbox")&&this.updateCheckBoxes(t.closest(n[0],"tr"));var s={cells:n,data:i,cellIndexes:r,foreignKeyData:o,cancel:!1};this.parent.trigger(e,s),this.isPreventCellSelect=s.cancel},i.prototype.updateCellSelection=function(e,r,i){t.isNullOrUndefined(r)||this.addRowCellIndex({rowIndex:r,cellIndex:i}),e.classList.add("e-cellselectionbackground"),e.classList.contains("e-gridchkbox")&&this.updateCheckBoxes(t.closest(e,"tr"),!0),this.addAttribute(e)},i.prototype.addAttribute=function(e){this.target=e,t.isNullOrUndefined(e)||(e.setAttribute("aria-selected","true"),this.preventFocus||this.focus.onClick({target:e},!0))},i.prototype.updateCellProps=function(e,t){this.prevCIdxs=e,this.prevECIdxs=t,this.isCellSelected=this.selectedRowCellIndexes.length&&!0},i.prototype.addRowCellIndex=function(e){for(var t,r,i=0,n=this.selectedRowCellIndexes.length;i<n;i++)if(this.selectedRowCellIndexes[i].rowIndex===e.rowIndex){t=!0,r=i;break}t?this.selectedRowCellIndexes[r].cellIndexes.indexOf(e.cellIndex)<0&&this.selectedRowCellIndexes[r].cellIndexes.push(e.cellIndex):this.selectedRowCellIndexes.push({rowIndex:e.rowIndex,cellIndexes:[e.cellIndex]})},i.prototype.clearCellSelection=function(){if(this.isCellSelected){var e=this.parent,t=this.getSelectedCellsElement(),r=this.selectedRowCellIndexes,i=[],n=[],o=[],s=this.getCurrentBatchRecordChanges(),l=e.getFrozenColumns();this.hideAutoFill();for(var a=0,d=r.length;a<d;a++){i.push(s[r[a].rowIndex]);for(var c=this.getRowObj(r[a].rowIndex),h=0,p=r[a].cellIndexes.length;h<p;h++)l?r[a].cellIndexes[h]<l?n.push(e.getCellFromIndex(r[a].rowIndex,r[a].cellIndexes[h])):n.push(e.getMovableCellFromIndex(r[a].rowIndex,r[a].cellIndexes[h])):(c.cells&&o.push(c.cells[r[a].cellIndexes[h]].foreignKeyData),n.push(e.getCellFromIndex(r[a].rowIndex,r[a].cellIndexes[h])))}if(this.cellDeselect("cellDeselecting",r,i,n,o),!0===this.isPreventCellSelect)return;for(var a=0,d=t.length;a<d;a++)t[a].classList.remove("e-cellselectionbackground"),t[a].removeAttribute("aria-selected");this.bdrBottom&&this.hideBorders(),this.selectedRowCellIndexes=[],this.isCellSelected=!1,this.cellDeselect("cellDeselected",r,i,n,o)}},i.prototype.getSelectedCellsElement=function(){var e,t=this.parent,r=t.getDataRows();t.getFrozenColumns()&&(e=t.getMovableDataRows(),r=t.addMovableRows(r,e));for(var i=[],n=0,o=r.length;n<o;n++)i=i.concat([].slice.call(r[n].querySelectorAll(".e-cellselectionbackground")));return i},i.prototype.mouseMoveHandler=function(e){e.preventDefault();var r,i=this.parent.element.getBoundingClientRect(),n=this.x,o=this.y,s=P(e),l=s.x-i.left,a=s.y-i.top,d=t.closest(e.target,"tr");if(this.isDragged=!0,this.isCellDrag||(d||(d=t.closest(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr")),n>l&&(r=l,l=n,n=r),o>a&&(r=a,a=o,o=r),this.element.style.left=n+"px",this.element.style.top=o+"px",this.element.style.width=l-n+"px",this.element.style.height=a-o+"px"),d&&!e.ctrlKey&&!e.shiftKey){var c=parseInt(d.getAttribute("aria-rowindex"),10);if(this.isCellDrag){var h=O(e.target,"e-rowcell");h&&(this.startAFCell=this.startCell,this.endAFCell=O(e.target,"e-rowcell"),this.selectLikeExcel(e,c,parseInt(h.getAttribute("aria-colindex"),10)))}else this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,c)}},i.prototype.selectLikeExcel=function(e,t,r){this.isAutoFillSel?(this.showAFBorders(),this.selectLikeAutoFill(e)):(this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:r}),this.drawBorders())},i.prototype.drawBorders=function(){"BoxWithBorder"===this.selectionSettings.cellSelectionMode&&this.selectedRowCellIndexes.length&&!this.parent.isEdit?(this.bdrBottom||this.createBorders(),this.positionBorders()):this.hideBorders()},i.prototype.positionBorders=function(){if(this.updateStartEndCells(),this.startCell&&this.bdrLeft&&this.selectedRowCellIndexes.length){this.showBorders();var e=this.startCell.getBoundingClientRect(),t=this.endCell.getBoundingClientRect(),r=this.startCell.offsetParent.getBoundingClientRect();this.bdrLeft.style.left=e.left-r.left+"px",this.bdrLeft.style.top=e.top-r.top+"px",this.bdrLeft.style.height=t.top-e.top>0?t.top-r.top+t.height+1-(e.top-r.top)+"px":t.height+"px",this.bdrRight.style.left=t.left-r.left+t.width+"px",this.bdrRight.style.top=this.bdrLeft.style.top,this.bdrRight.style.height=this.bdrLeft.style.height,this.bdrTop.style.left=this.bdrLeft.style.left,this.bdrTop.style.top=this.bdrRight.style.top,this.bdrTop.style.width=parseInt(this.bdrRight.style.left,10)-parseInt(this.bdrLeft.style.left,10)+1+"px",this.bdrBottom.style.left=this.bdrLeft.style.left,this.bdrBottom.style.top=parseInt(this.bdrLeft.style.top,10)+parseInt(this.bdrLeft.style.height,10)+"px",this.bdrBottom.style.width=this.bdrTop.style.width}},i.prototype.createBorders=function(){this.bdrLeft||(this.bdrLeft=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdrleft",styles:"width: 2px;"})),this.bdrRight=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdrright",styles:"width: 2px;"})),this.bdrBottom=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdrbottom",styles:"height: 2px;"})),this.bdrTop=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdrtop",styles:"height: 2px;"})))},i.prototype.showBorders=function(){this.bdrLeft&&(this.bdrLeft.style.display="",this.bdrRight.style.display="",this.bdrBottom.style.display="",this.bdrTop.style.display="")},i.prototype.hideBorders=function(){this.bdrLeft&&(this.bdrLeft.style.display="none",this.bdrRight.style.display="none",this.bdrBottom.style.display="none",this.bdrTop.style.display="none")},i.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},i.prototype.positionAFBorders=function(){if(this.startCell&&this.bdrAFLeft){this.showBorders();var e=this.startAFCell.getBoundingClientRect(),t=this.endAFCell.getBoundingClientRect(),r=this.startAFCell.offsetParent.getBoundingClientRect();this.bdrAFLeft.style.left=e.left-r.left+"px",this.bdrAFLeft.style.top=e.top-r.top+"px",this.bdrAFLeft.style.height=t.top-e.top>0?t.top-r.top+t.height+1-(e.top-r.top)+"px":t.height+"px",this.bdrAFRight.style.left=t.left-r.left+t.width+"px",this.bdrAFRight.style.top=this.bdrAFLeft.style.top,this.bdrAFRight.style.height=this.bdrAFLeft.style.height,this.bdrAFTop.style.left=this.bdrAFLeft.style.left,this.bdrAFTop.style.top=this.bdrAFRight.style.top,this.bdrAFTop.style.width=parseInt(this.bdrAFRight.style.left,10)-parseInt(this.bdrAFLeft.style.left,10)+1+"px",this.bdrAFBottom.style.left=this.bdrAFLeft.style.left,this.bdrAFBottom.style.top=parseInt(this.bdrAFLeft.style.top,10)+parseInt(this.bdrAFLeft.style.height,10)+"px",this.bdrAFBottom.style.width=this.bdrAFTop.style.width}},i.prototype.createAFBorders=function(){this.bdrAFLeft||(this.bdrAFLeft=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdrafleft",styles:"width: 2px;"})),this.bdrAFRight=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdrafright",styles:"width: 2px;"})),this.bdrAFBottom=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdrafbottom",styles:"height: 2px;"})),this.bdrAFTop=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdraftop",styles:"height: 2px;"})))},i.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},i.prototype.hideAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="none",this.bdrAFRight.style.display="none",this.bdrAFBottom.style.display="none",this.bdrAFTop.style.display="none")},i.prototype.updateValue=function(e,t,r){var i=this.parent.getColumnByIndex(t);this.parent.editModule&&r&&("number"===i.type?this.parent.editModule.updateCell(e,i.field,parseInt(r.textContent,10)):this.parent.editModule.updateCell(e,i.field,r.textContent))},i.prototype.selectLikeAutoFill=function(e,t){var r=parseInt(O(this.startAFCell,"e-row").getAttribute("aria-rowindex"),10),i=parseInt(this.startAFCell.getAttribute("aria-colindex"),10),n=parseInt(O(this.endAFCell,"e-row").getAttribute("aria-rowindex"),10),o=parseInt(this.endAFCell.getAttribute("aria-colindex"),10),s=this.selectedRowCellIndexes.length-1,l=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!O(e.target,"e-rowcell"):this.startAFCell=this.parent.getCellFromIndex(r,i),this.endAFCell=this.parent.getCellFromIndex(r+s,i+l),this.drawAFBorders();break;case i+l<o&&o-i-l+1>n-r-s&&o-i-l+1>r-n:if(this.endAFCell=this.parent.getCellFromIndex(r+s,o),n=parseInt(O(this.endAFCell,"e-row").getAttribute("aria-rowindex"),10),o=parseInt(this.endAFCell.getAttribute("aria-colindex"),10),t){for(var a=parseInt(this.endCell.getAttribute("aria-colindex"),10),d=r;d<=n;d++)for(var c=[].slice.call(this.parent.getDataRows()[d].querySelectorAll(".e-cellselectionbackground")),h=0,p=a+1;p<=o;p++)h>l&&(h=0),this.updateValue(d,p,c[h]),h++;this.selectCellsByRange({rowIndex:r,cellIndex:this.startCellIndex},{rowIndex:n,cellIndex:o})}else this.drawAFBorders();break;case i>o&&i-o+1>n-r-s&&i-o+1>r-n:if(this.startAFCell=this.parent.getCellFromIndex(r,o),this.endAFCell=this.endCell,t){for(d=r;d<=r+s;d++){(c=[].slice.call(this.parent.getDataRows()[d].querySelectorAll(".e-cellselectionbackground"))).reverse();for(var h=0,p=this.startCellIndex-1;p>=o;p--)h>l&&(h=0),this.updateValue(d,p,c[h]),h++}this.selectCellsByRange({rowIndex:r,cellIndex:o},{rowIndex:r+s,cellIndex:this.startCellIndex+l})}else this.drawAFBorders();break;case r>n:if(this.startAFCell=this.parent.getCellFromIndex(n,i),this.endAFCell=this.endCell,t){for(var u=g=parseInt(this.endCell.parentElement.getAttribute("aria-rowindex"),10),d=r-1;d>=n;d--){u===this.startIndex-1&&(u=g);var c=[].slice.call(this.parent.getDataRows()[u].querySelectorAll(".e-cellselectionbackground")),h=0;u--;for(p=this.startCellIndex;p<=this.startCellIndex+l;p++)this.updateValue(d,p,c[h]),h++}this.selectCellsByRange({rowIndex:n,cellIndex:i+l},{rowIndex:r+s,cellIndex:i})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(n,i+l),t){for(var g=parseInt(this.endCell.parentElement.getAttribute("aria-rowindex"),10),u=this.startIndex,d=g+1;d<=n;d++){u===g+1&&(u=this.startIndex);c=[].slice.call(this.parent.getDataRows()[u].querySelectorAll(".e-cellselectionbackground"));u++;for(var h=0,f=this.startCellIndex;f<=this.startCellIndex+l;f++)this.updateValue(d,f,c[h]),h++}this.selectCellsByRange({rowIndex:g-s,cellIndex:i},{rowIndex:n,cellIndex:i+l})}else this.drawAFBorders()}},i.prototype.mouseUpHandler=function(e){document.body.classList.remove("e-disableuserselect"),this.element&&t.remove(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=O(e.target,"e-rowcell"):this.mUPTarget=null,this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel&&(this.startAFCell=this.startCell,this.endAFCell=O(e.target,"e-rowcell"),this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.isAutoFillSel=!1),t.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),t.EventHandler.remove(document.body,"mouseup",this.mouseUpHandler)},i.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},i.prototype.updateAutoFillPosition=function(){if(this.parent.enableAutoFill&&!this.parent.isEdit&&this.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel()&&this.selectedRowCellIndexes.length){var e=[].slice.call(this.parent.getDataRows()[this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex].querySelectorAll(".e-cellselectionbackground"));this.parent.element.querySelector("#"+this.parent.element.id+"_autofill")||(this.autofill=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-autofill",id:this.parent.element.id+"_autofill"})));var r=e[e.length-1];if(r&&r.offsetParent){var i=r.getBoundingClientRect(),n=r.offsetParent.getBoundingClientRect();this.autofill.style.left=i.left-n.left+i.width-3+"px",this.autofill.style.top=i.top-n.top+i.height-3+"px"}this.autofill.style.display=""}else this.hideAutoFill()},i.prototype.mouseDownHandler=function(e){var r,i=e.target,n=this.parent,o=O(i,"e-grid");if(!o||o.id===n.element.id){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),O(i,"e-rowcell")&&!e.shiftKey&&!e.ctrlKey){if(n.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel())this.isCellDrag=!0,r=!0;else if(n.allowRowDragAndDrop&&!n.isEdit){if(!this.isRowType()||this.isSingleSel()||t.closest(i,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);r=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),n.getContent().appendChild(this.element)}r&&this.enableDrag(e,!0)}this.updateStartEndCells(),i.classList.contains("e-autofill")&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},i.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute("aria-rowindex"),10),this.startCellIndex=parseInt(O(this.startCell,"e-rowcell").getAttribute("aria-colindex"),10))},i.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute("aria-rowindex"),10),this.startCellIndex=parseInt(O(this.startCell,"e-rowcell").getAttribute("aria-colindex"),10))},i.prototype.enableDrag=function(e,r){var i=this.parent;if(r){var n=t.closest(e.target,"tr");this.startDIndex=parseInt(n.getAttribute("aria-rowindex"),10),this.startDCellIndex=parseInt(O(e.target,"e-rowcell").getAttribute("aria-colindex"),10)}document.body.classList.add("e-disableuserselect");var o=i.element.getBoundingClientRect(),s=P(e);this.x=s.x-o.left,this.y=s.y-o.top,t.EventHandler.add(i.getContent(),"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document.body,"mouseup",this.mouseUpHandler,this)},i.prototype.clearSelAfterRefresh=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Be,this.enableAfterRender,this),this.parent.on(Ae,this.initializeSelection,this),this.parent.on("rowselected",this.onActionComplete,this),this.parent.on("cellselected",this.onActionComplete,this),this.parent.on(qe,this.onPropertyChanged,this),this.parent.on("cellfocused",this.onCellFocused,this),this.parent.on("beforeFragAppend",this.clearSelAfterRefresh,this),this.parent.on(We,this.columnPositionChanged,this),this.parent.on(Ne,this.initialEnd,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(Se,this.actionBeginFunction),this.parent.addEventListener(xe,this.actionCompleteFunction),this.parent.on(Je,this.rowsRemoved,this),this.parent.on(Ue,this.refreshHeader,this),this.addEventListener_checkbox())},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Be,this.enableAfterRender),this.parent.off(Ae,this.initializeSelection),this.parent.off("rowselected",this.onActionComplete),this.parent.off("cellselected",this.onActionComplete),this.parent.off(qe,this.onPropertyChanged),this.parent.off("cellfocused",this.onCellFocused),this.parent.off("beforeFragAppend",this.clearSelAfterRefresh),this.parent.off(We,this.columnPositionChanged),this.parent.removeEventListener(Se,this.actionBeginFunction),this.parent.removeEventListener(xe,this.actionCompleteFunction),this.parent.off(Je,this.rowsRemoved),this.parent.off(Ue,this.refreshHeader),this.removeEventListener_checkbox())},i.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS&&(t.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.parent.element,"keyup",this.keyUpHandler,this))},i.prototype.unWireEvents=function(){this.isMacOS&&(t.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler))},i.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},i.prototype.refreshHeader=function(){this.setCheckAllState()},i.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)delete this.selectedRowState[e.records[t][this.primaryKey]],--this.totalRecordsCount;this.setCheckAllState()},i.prototype.beforeFragAppend=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},i.prototype.getCheckAllBox=function(){return this.parent.getHeaderContent().querySelector(".e-checkselectall")},i.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},i.prototype.render=function(e){t.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this)},i.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){var r=this.parent;t.isNullOrUndefined(e.properties.type)||"Single"!==this.selectionSettings.type||(this.selectedRowCellIndexes.length>1&&(this.clearCellSelection(),this.prevCIdxs=void 0),this.selectedRowIndexes.length>1&&(this.clearRowSelection(),this.prevRowIndex=void 0),this.enableSelectMultiTouch=!1,this.hidePopUp()),t.isNullOrUndefined(e.properties.mode)&&t.isNullOrUndefined(e.properties.cellSelectionMode)||(this.clearSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0),this.isPersisted=!0,this.checkBoxSelectionChanged(),this.isPersisted=!1,this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(r.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders()}},i.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup").querySelectorAll(".e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},i.prototype.initialEnd=function(){this.parent.off(Ne,this.initialEnd),this.selectRow(this.parent.selectedRowIndex)},i.prototype.checkBoxSelectionChanged=function(){this.parent.off(Ne,this.checkBoxSelectionChanged);var e=this.parent,r=e.getColumns().filter(function(e){return"checkbox"===e.type});r.length>0&&(e.isCheckBoxSelection=!0,this.chkField=r[0].field,this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount,t.isNullOrUndefined(this.totalRecordsCount)&&(this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.isSingleSel()?(e.selectionSettings.type="Multiple",e.dataBind()):this.initPerisistSelection()),e.isCheckBoxSelection||this.isPersisted||(this.chkField=null,this.initPerisistSelection())},i.prototype.initPerisistSelection=function(){var e=this.parent;this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!0,this.ensureCheckboxFieldSelection()):this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!1,this.ensureCheckboxFieldSelection()):(e.isPersistSelection=!1,this.selectedRowState={})},i.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;if(this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],!e.enableVirtualization&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)){var t=this.parent.getDataModule(),i=(new r.Query).where(this.chkField,"equal",!0);i.params||(i.params=this.parent.query.params);var n=t.getData({},i),o=this;this.parent.showSpinner(),n.then(function(e){o.dataSuccess(e.result),o.refreshPersistSelection(),o.parent.hideSpinner()})}},i.prototype.dataSuccess=function(e){for(var r=0;r<e.length;r++)t.isNullOrUndefined(this.selectedRowState[e[r][this.primaryKey]])&&e[r][this.chkField]&&(this.selectedRowState[e[r][this.primaryKey]]=e[r][this.chkField]);this.persistSelectedData=e},i.prototype.setRowSelection=function(e){if(!this.parent.getDataModule().isRemote()&&"BlazorAdaptor"!==this.parent.dataSource.adaptorName)if(e)for(var t=0,r=this.getData();t<r.length;t++){var i=r[t];this.selectedRowState[i[this.primaryKey]]=!0}else this.selectedRowState={}},i.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},i.prototype.refreshPersistSelection=function(){var e=this.parent.getRows();if(e.length>0&&(this.parent.isPersistSelection||this.chkField)){for(var r=[],i=0;i<e.length;i++){var n=this.getRowObj(e[i]),o=n?n.data[this.primaryKey]:null;if(null===o)return;var s=void 0,l=e[i].querySelector(".e-checkselect");this.selectedRowState[o]||"Check"===this.parent.checkAllRows&&this.chkAllCollec.indexOf(o)<0||"Uncheck"===this.parent.checkAllRows&&this.chkAllCollec.indexOf(o)>0||"Intermediate"===this.parent.checkAllRows&&!t.isNullOrUndefined(this.chkField)&&n.data[this.chkField]?(r.push(parseInt(e[i].getAttribute("aria-rowindex"),10)),s=!0):(s=!1,this.checkedTarget!==l&&this.parent.isCheckBoxSelection&&ee(l.nextElementSibling,s)),this.updatePersistCollection(e[i],s)}this.isSingleSel()&&r.length>0?this.selectRow(r[0],!0):this.selectRows(r)}this.parent.isCheckBoxSelection&&this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState()},i.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var r=this.parent.element.querySelector(".e-edit-checkselect");if(!t.isNullOrUndefined(r)){var i=t.closest(r,".e-editedrow");if(i){"Dialog"===this.parent.editSettings.mode&&(i=this.parent.element.querySelector(".e-dlgeditrow"));var n=this.getRowObj(i);if(!n)return;this.selectedRowState[n.data[this.primaryKey]]=n.isSelected=r.checked}else this.isCheckedOnAdd=r.checked}}},i.prototype.actionComplete=function(e){var r=this;if("save"===e.requestType&&this.parent.isPersistSelection){if("add"===e.action&&this.isCheckedOnAdd){var i=this.parent.getRowObjectFromUID(this.parent.getRows()[e.selectedRow].getAttribute("data-uid"));this.selectedRowState[i.data[this.primaryKey]]=i.isSelected=this.isCheckedOnAdd}this.refreshPersistSelection()}if("delete"===e.requestType&&this.parent.isPersistSelection){(t.isBlazor()?this.getSelectedRecords():e.data).slice().forEach(function(e){t.isNullOrUndefined(e[r.primaryKey])||r.updatePersistDelete(e[r.primaryKey])}),this.setCheckAllState(),this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount}"paging"===e.requestType&&(this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0)},i.prototype.onDataBound=function(){!this.parent.enableVirtualization&&this.parent.isPersistSelection&&this.refreshPersistSelection()},i.prototype.updatePersistSelectedData=function(e){if(this.parent.isPersistSelection){for(var t=this.parent.getRows(),r=0;r<t.length;r++)this.updatePersistCollection(t[r],e);"Uncheck"===this.parent.checkAllRows?(this.setRowSelection(!1),this.persistSelectedData=this.parent.getDataModule().isRemote()?this.persistSelectedData:[]):"Check"===this.parent.checkAllRows&&(this.setRowSelection(!0),this.persistSelectedData=this.parent.getDataModule().isRemote()||"BlazorAdaptor"===this.parent.dataSource.adaptorName?this.persistSelectedData:this.getData().slice())}},i.prototype.checkSelectAllAction=function(e){var r=this.getRenderer(),i=this.parent.element.querySelector(".e-gridform");if(this.checkedTarget=this.getCheckAllBox(),e&&this.getCurrentBatchRecordChanges().length?(this.parent.checkAllRows="Check",this.updatePersistSelectedData(e),this.selectRowsByRange(r.getVirtualRowIndex(0),r.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1))):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(e),this.clearSelection()),this.chkAllCollec=[],!t.isNullOrUndefined(i)){var n=i.querySelector(".e-edit-checkselect");t.isNullOrUndefined(n)||ee(n.nextElementSibling,e)}},i.prototype.checkSelectAll=function(e){var t=this,r=this.getCheckAllStatus(e),i="Check"===r;"Intermediate"===r&&(i=this.getCurrentBatchRecordChanges().some(function(e){return e[t.primaryKey]in t.selectedRowState})),this.checkSelectAllAction(!i),this.target=null,this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState(),this.triggerChkChangeEvent(e,!i)},i.prototype.getCheckAllStatus=function(e){var t=e?e.nextElementSibling.classList:this.getCheckAllBox().nextElementSibling.classList;return t.contains("e-check")?"Check":t.contains("e-uncheck")?"Uncheck":t.contains("e-stop")?"Intermediate":"None"},i.prototype.checkSelect=function(e){var r=t.closest(this.checkedTarget,".e-rowcell"),i=this.parent;this.isMultiCtrlRequest=!0;var n=0;if(se(i)){var o=r.parentElement.getAttribute("data-uid");n=i.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(o)}else n=parseInt(r.parentElement.getAttribute("aria-rowindex"),10);this.parent.isPersistSelection&&this.parent.element.querySelectorAll(".e-addedrow").length>0&&++n,this.rowCellSelectionHandler(n,parseInt(r.getAttribute("aria-colindex"),10)),this.moveIntoUncheckCollection(t.closest(r,".e-row")),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},i.prototype.moveIntoUncheckCollection=function(e){if("Check"===this.parent.checkAllRows||"Uncheck"===this.parent.checkAllRows){var t=this.getRowObj(e),r=t&&t.data?t.data[this.primaryKey]:null;if(!r)return;this.chkAllCollec.indexOf(r)<0?this.chkAllCollec.push(r):this.chkAllCollec.splice(this.chkAllCollec.indexOf(r),1)}},i.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger("checkBoxChange",{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},i.prototype.updateSelectedRowIndex=function(e){if(this.parent.isCheckBoxSelection&&this.parent.enableVirtualization&&!this.parent.getDataModule().isRemote())if("Check"===this.parent.checkAllRows){this.selectedRowIndexes=[];for(var t=0;t<this.getData().length;t++)this.selectedRowIndexes.push(t)}else if("Uncheck"===this.parent.checkAllRows)this.selectedRowIndexes=[];else if(e&&"false"===this.parent.getRowByIndex(e).getAttribute("aria-selected")){var r=this.selectedRowIndexes.indexOf(e);this.selectedRowIndexes.splice(r,1)}},i.prototype.setCheckAllState=function(e,r){if(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode){var i=Object.keys(this.selectedRowState).length;if(this.parent.isPersistSelection||(i=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.getCheckAllBox()){var n=this.getCheckAllBox().nextElementSibling;t.removeClass([n],["e-check","e-stop","e-uncheck"]),i===this.totalRecordsCount&&this.totalRecordsCount||this.parent.enableVirtualization&&!this.parent.allowPaging&&!this.parent.getDataModule().isRemote()&&i===this.getData().length?(t.addClass([n],["e-check"]),r&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):0===i||0===this.getCurrentBatchRecordChanges().length?(t.addClass([n],["e-uncheck"]),r&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck",0===i&&0===this.getCurrentBatchRecordChanges().length?t.addClass([n.parentElement],["e-checkbox-disabled"]):t.removeClass([n.parentElement],["e-checkbox-disabled"])):(t.addClass([n],["e-stop"]),this.parent.checkAllRows="Intermediate"),!this.parent.enableVirtualization||this.parent.allowPaging||this.parent.getDataModule().isRemote()||this.updateSelectedRowIndex(e)}}},i.prototype.keyDownHandler=function(e){("chrome"===t.Browser.info.name&&(91===e.keyCode||93===e.keyCode)||"opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode)&&(this.cmdKeyPressed=!0)},i.prototype.keyUpHandler=function(e){("chrome"===t.Browser.info.name&&(91===e.keyCode||93===e.keyCode)||"opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode)&&(this.cmdKeyPressed=!1)},i.prototype.clickHandler=function(e){var r=e.target;this.actualTarget=r,this.isInteracted=!0,this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch||this.isMacOS&&this.cmdKeyPressed,this.isMultiShiftRequest=e.shiftKey,this.popUpClickHandler(e);var i=!1;this.preventFocus=!0;var n,o=O(r,"e-checkbox-wrapper");if(this.checkSelectAllClicked=!(!o||!o.querySelectorAll(".e-checkselectall")),o&&o.querySelectorAll(".e-checkselect,.e-checkselectall").length>0&&(n=o.querySelector('input[type="checkbox"]'),i=!0),this.drawBorders(),(r=O(r,"e-rowcell"))&&r.parentElement.classList.contains("e-row")&&!this.parent.selectionSettings.checkboxOnly||i){if(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=r,t.isNullOrUndefined(n)){var s=this.parent,l=0;if(se(s)){var a=r.parentElement.getAttribute("data-uid");l=s.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(a)}else l=parseInt(r.parentElement.getAttribute("aria-rowindex"),10);this.parent.isPersistSelection&&this.parent.element.querySelectorAll(".e-addedrow").length>0&&++l,this.mUPTarget&&this.mUPTarget.isEqualNode(r)||this.rowCellSelectionHandler(l,parseInt(r.getAttribute("aria-colindex"),10)),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(t.closest(r,".e-row")),this.setCheckAllState())}else this.checkedTarget=n,n.classList.contains("e-checkselectall")?this.checkSelectAll(n):this.checkSelect(n);this.parent.isCheckBoxSelection||!t.Browser.isDevice||this.isSingleSel()||this.showPopup(e)}this.isMultiCtrlRequest=!1,this.isMultiShiftRequest=!1,t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},i.prototype.popUpClickHandler=function(e){var r=e.target;t.closest(r,".e-headercell")||e.target.classList.contains("e-rowcell")||t.closest(r,".e-gridpopup")?r.classList.contains("e-rowselect")&&(r.classList.contains("e-spanclicked")?(r.classList.remove("e-spanclicked"),this.enableSelectMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(r.classList.add("e-spanclicked"),this.enableSelectMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},i.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||T(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(this.selectedRecords.length>(this.parent.getFrozenColumns()?2:1)||this.selectedRowCellIndexes.length>1)?" e-spanclicked":""))},i.prototype.rowCellSelectionHandler=function(e,r){this.parent;!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?(this.isDragged||this.selectRow(e,this.selectionSettings.enableToggle),this.selectCell({rowIndex:e,cellIndex:r},this.selectionSettings.enableToggle),this.selectedRowCellIndexes.length&&this.updateAutoFillPosition(),this.drawBorders()):this.isMultiShiftRequest?(this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!t.closest(this.target,".e-rowcell").classList.contains("e-gridchkbox")?this.selectRowsByRange(t.isUndefined(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange(t.isUndefined(this.prevCIdxs)?{rowIndex:e,cellIndex:r}:this.prevCIdxs,{rowIndex:e,cellIndex:r}),this.updateAutoFillPosition(),this.drawBorders()):(this.addRowsToSelection([e]),this.addCellsToSelection([{rowIndex:e,cellIndex:r}]),this.hideBorders()),this.isDragged=!1},i.prototype.onCellFocused=function(e){if(this.parent.frozenRows&&e.container.isHeader&&e.byKey)if("upArrow"===e.keyArgs.action)this.parent.allowFiltering?e.isJump="INPUT"===e.element.tagName:e.isJump="TH"===e.element.tagName;else if("downArrow"===e.keyArgs.action){var r=Number(e.element.parentElement.getAttribute("aria-rowindex"));e.isJump=0===r}else"ctrlHome"===e.keyArgs.action&&(e.isJump=!0);var i=this.parent.getFrozenColumns()?(e.container.isHeader&&"TD"!==e.element.tagName&&e.isJump||(e.container.isContent||"TD"===e.element.tagName)&&!(e.container.isSelectable||"TD"===e.element.tagName))&&!(e.byKey&&"space"===e.keyArgs.action):(e.container.isHeader&&e.isJump||e.container.isContent&&!e.container.isSelectable)&&!(e.byKey&&"space"===e.keyArgs.action),n=e.container.isHeader&&"TD"!==e.element.tagName&&!t.closest(e.element,".e-rowcell")&&!(e.byKey&&"space"===e.keyArgs.action);if(!e.byKey||i)return void(i&&!this.parent.isCheckBoxSelection&&this.clearSelection());var o=e.container.isContent?e.container.indexes:e.indexes,s=o[0],l=o[1],a=this.focus.getPrevIndexes();if(this.parent.frozenRows)if(e.container.isHeader&&("TD"===e.element.tagName||t.closest(e.element,".e-rowcell"))){var d=this.parent.getHeaderTable().querySelector("thead").childElementCount;s-=d,a.rowIndex=a.rowIndex?a.rowIndex-d:null}else s+=this.parent.frozenRows,a.rowIndex=0!==a.rowIndex&&t.isNullOrUndefined(a.rowIndex)?null:a.rowIndex+this.parent.frozenRows;if(this.parent.getFrozenColumns()){var c=Number(e.element.getAttribute("aria-colindex"));a.cellIndex=a.cellIndex?a.cellIndex===l?c:c-1:null,l=c}if(!(n||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&s===a.rowIndex&&l===a.cellIndex)){switch(this.preventFocus=!0,e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.applyDownUpKey(s,l);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(s,l);break;case"shiftDown":case"shiftUp":this.shiftDownKey(s,l);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(s,l);break;case"home":case"end":l="end"===e.keyArgs.action?this.getLastColIndex(s):0,this.applyHomeEndKey(s,l);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(s,l);break;case"escape":this.clearSelection();break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(s)}this.preventFocus=!1,this.positionBorders(),this.updateAutoFillPosition()}},i.prototype.ctrlPlusA=function(){this.isRowType()&&!this.isSingleSel()&&this.selectRowsByRange(0,this.parent.getRows().length-1),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},i.prototype.applySpaceSelection=function(e){e.classList.contains("e-checkselectall")?(this.checkedTarget=e,this.checkSelectAll(this.checkedTarget)):e.classList.contains("e-checkselect")&&(this.checkedTarget=e,this.checkSelect(this.checkedTarget))},i.prototype.applyDownUpKey=function(e,t){var r=this.parent;this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&!this.selectionSettings.persistSelection&&(this.checkSelectAllAction(!1),this.checkedTarget=null),this.isRowType()&&(this.parent.frozenRows,this.selectRow(e,!0),this.applyUpDown(r.selectedRowIndex)),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},i.prototype.applyUpDown=function(e){if(!(e<0)){this.target||(this.target=this.parent.getRows()[0].children[this.parent.groupSettings.columns.length||0]);var t=parseInt(this.target.getAttribute("aria-colindex"),10),r=this.parent.getFrozenColumns();this.target=r&&t>=r?this.contentRenderer.getMovableRowByIndex(e).querySelectorAll(".e-rowcell")[t-r]:this.contentRenderer.getRowByIndex(e).querySelectorAll(".e-rowcell")[t],this.addAttribute(this.target)}},i.prototype.applyRightLeftKey=function(e,t){this.parent;this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},i.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},i.prototype.shiftDownKey=function(e,r){this.parent;this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&(t.isUndefined(this.prevRowIndex)?this.selectRow(0,!0):(this.selectRowsByRange(this.prevRowIndex,e),this.applyUpDown(e))),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange(this.prevCIdxs||{rowIndex:0,cellIndex:0},{rowIndex:e,cellIndex:r}),this.isMultiShiftRequest=!1},i.prototype.applyShiftLeftRightKey=function(e,t){this.parent;this.isMultiShiftRequest=!0,this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},i.prototype.applyCtrlHomeEndKey=function(e,t){this.isRowType()&&(this.selectRow(e,!0),this.addAttribute(this.parent.getCellFromIndex(e,t))),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},i.prototype.addRemoveClassesForRow=function(e,t,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];if(e){var o=[].slice.call(e.querySelectorAll(".e-rowcell")),s=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),l=e.querySelector(".e-rowdragdrop");s&&o.push(s),l&&o.push(l),Q.apply(void 0,[o,t].concat(i))}this.getRenderer().setSelection(e?e.getAttribute("data-uid"):null,t,r)},i.prototype.isRowType=function(){return"Row"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},i.prototype.isCellType=function(){return"Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},i.prototype.isSingleSel=function(){return"Single"===this.selectionSettings.type},i.prototype.getRenderer=function(){return t.isNullOrUndefined(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(e.RenderType.Content)),this.contentRenderer},i.prototype.getSelectedRecords=function(){return this.selectionSettings.persistSelection?this.persistSelectedData:this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data})},i.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(Pe,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(Re,this.onDataBoundFunction),this.parent.on(Ne,this.checkBoxSelectionChanged,this),this.actionCompleteFunc=this.actionCompleteHandler.bind(this),this.parent.addEventListener(xe,this.actionCompleteFunc),this.parent.on(Ge,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener("resizeStop",this.resizeEndFn)},i.prototype.removeEventListener_checkbox=function(){this.parent.off(Pe,this.dataReady),this.parent.removeEventListener(Re,this.onDataBoundFunction),this.parent.removeEventListener(xe,this.actionCompleteFunc),this.parent.off(Ge,this.clickHandler)},i.prototype.dataReady=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||(this.disableUI=!0,this.clearSelection(),this.disableUI=!1)},i.prototype.actionCompleteHandler=function(e){"save"===e.requestType&&this.parent.isPersistSelection&&this.refreshPersistSelection()},i.prototype.selectRowIndex=function(e){this.parent.isSelectedRowIndexUpdating=!0,this.parent.selectedRowIndex=e},i}(),mr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.search=function(e){var r=this.parent;if(e=t.isNullOrUndefined(e)?"":e,_(r))return void r.notify(it,{instance:this,handler:this.search,arg1:e});e!==r.searchSettings.key?(r.searchSettings.key=e.toString(),r.dataBind()):this.refreshSearch&&r.refresh()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(qe,this.onPropertyChanged,this),this.parent.on("searching-complete",this.onSearchComplete,this),this.parent.on(_e,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(xe,this.actionCompleteFunc),this.parent.on("cancel-Begin",this.cancelBeginEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(qe,this.onPropertyChanged),this.parent.off("searching-complete",this.onSearchComplete),this.parent.off(_e,this.destroy),this.parent.removeEventListener(xe,this.actionCompleteFunc),this.parent.off("cancel-Begin",this.cancelBeginEvent))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(t.isNullOrUndefined(e.properties.key)?this.parent.notify(ze,{requestType:"searching",type:Se}):this.parent.notify(ze,{requestType:"searching",type:Se,searchString:this.parent.searchSettings.key}))},e.prototype.onSearchComplete=function(e){this.parent.trigger(xe,t.extend(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:xe}))},e.prototype.onActionComplete=function(e){this.refreshSearch="searching"!==e.requestType},e.prototype.cancelBeginEvent=function(e){"searching"===e.requestType&&this.parent.setProperties({searchSettings:{key:""}},!0)},e.prototype.getModuleName=function(){return"search"},e}(),yr=function(){function e(e){this.parent=e}return e.prototype.show=function(e,t){var r=this.getToggleFields(e),i=this.getColumns(r,t);this.parent.notify("tooltip-destroy",{module:"edit"}),i.forEach(function(e){e.visible=!0}),this.setVisible(i)},e.prototype.hide=function(e,t){var r=this.getToggleFields(e),i=this.getColumns(r,t);this.parent.notify("tooltip-destroy",{module:"edit"}),i.forEach(function(e){e.visible=!1}),this.setVisible(i)},e.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},e.prototype.getColumns=function(e,t){var r=this;return C(e,function(e,i){return C(r.parent.columnModel,function(r,i){if(r[t]===e)return r})[0]})},e.prototype.setVisible=function(e){if(_(this.parent))return void this.parent.notify(it,{instance:this,handler:this.setVisible,arg1:e});var r=this.parent.getColumns();e=t.isNullOrUndefined(e)?r:e,this.parent.allowSelection&&this.parent.getSelectedRecords().length&&this.parent.clearSelection(),this.parent.enableColumnVirtualization?e.filter(function(e){return r.some(function(t){return e.field===t.field})}).length&&this.parent.notify(Ke,e):this.parent.notify(Ke,e),"All"!==this.parent.columnQueryMode&&this.parent.refresh()},e}(),vr=function(){function e(e){this.lastScrollTop=0,this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new rr(e),this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(e){this.parent.element.style.width=t.formatUnit(this.parent.width),e&&this.widthService.setWidthToColumns(),this.parent.toolbarModule&&this.parent.toolbarModule.toolbar&&this.parent.toolbarModule.toolbar.element&&this.parent.toolbarModule.toolbar.refreshOverflow()},e.prototype.setHeight=function(){var e=0,r=this.parent.getContent().firstChild;this.parent.frozenRows&&"auto"!==this.parent.height?(e=this.parent.getHeaderContent().querySelector("tbody").offsetHeight,r.style.height=t.formatUnit(this.parent.height-e)):r.style.height=t.formatUnit(this.parent.height),this.ensureOverflow(r)},e.prototype.setPadding=function(){var t=this.parent.getHeaderContent(),r=e.getScrollBarWidth()-this.getThreshold(),i=this.getCssProperties();t.firstChild.style[i.border]=r>0?"1px":"0px",t.style[i.padding]=r>0?r+"px":"0px"},e.prototype.removePadding=function(e){var t=this.getCssProperties(e);this.parent.getHeaderContent().firstChild.style[t.border]="",this.parent.getHeaderContent().firstChild.parentElement.style[t.padding]=""},e.prototype.refresh=function(){if("100%"===this.parent.height){var e=this.parent.getContent();this.parent.element.style.height="100%";var t=this.widthService.getSiblingsHeight(e);e.style.height="calc(100% - "+t+"px)"}},e.prototype.getThreshold=function(){return"mozilla"===t.Browser.info.name?.5:1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Le,this.wireEvents,this),this.parent.on(Ne,this.wireEvents,this),this.parent.on(Be,this.onPropertyChanged,this),this.parent.on("textWrapRefresh",this.wireEvents,this),this.parent.on(Ue,this.setScrollLeft,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Le,this.wireEvents),this.parent.off(Ne,this.wireEvents),this.parent.off(Be,this.onPropertyChanged),this.parent.off("textWrapRefresh",this.wireEvents),this.parent.off(Ue,this.setScrollLeft))},e.prototype.setScrollLeft=function(){this.parent.frozenColumns&&(this.parent.headerModule.getMovableHeader().scrollLeft=this.previousValues.left)},e.prototype.onContentScroll=function(e){var t=this,r=e,i=r.classList.contains("e-headercontent");return function(e){if(null!==t.content.querySelector("tbody")&&!t.parent.isPreventScrollEvent){var n=e.target,o=n.scrollLeft,s=(n.scrollWidth,n.classList.contains("e-summarycontent"));if(t.previousValues.left===o)return void(t.previousValues.top=i?n.scrollTop:t.previousValues.top);r.scrollLeft=o,s&&(t.header.scrollLeft=o),t.previousValues.left=o,t.parent.notify("scroll",{left:o})}}},e.prototype.onFreezeContentScroll=function(e){var t=this,r=e;return function(e){if(null!==t.content.querySelector("tbody")){var i=e.target.scrollTop;t.previousValues.top!==i&&(r.scrollTop=i,t.previousValues.top=i,t.parent.isDestroyed)}}},e.prototype.onWheelScroll=function(e){var t=this,r=e;return function(e){if(null!==t.content.querySelector("tbody")){var i=r.scrollTop+(1===e.deltaMode?30*e.deltaY:e.deltaY);t.previousValues.top!==i&&(e.preventDefault(),t.parent.getContent().querySelector(".e-frozencontent").scrollTop=i,r.scrollTop=i,t.previousValues.top=i)}}},e.prototype.onTouchScroll=function(e){var t=this,r=e;return function(e){if("mouse"!==e.pointerType){var i,n,o=t.getPointXY(e),s=r.scrollTop+(t.pageXY.y-o.y),l=r.scrollLeft+(t.pageXY.x-o.x);if(t.parent.getHeaderContent().contains(e.target)){if(n=t.parent.getFrozenColumns()?t.parent.getHeaderContent().querySelector(".e-movableheader"):t.parent.getHeaderContent().firstChild,t.previousValues.left===l||l<0||n.scrollWidth-n.clientWidth<l)return;e.preventDefault(),n.scrollLeft=l,r.scrollLeft=l,t.pageXY.x=o.x,t.previousValues.left=l}else{if(i=t.parent.getContent().querySelector(".e-frozencontent"),t.previousValues.top===s&&(s<0||i.scrollHeight-i.clientHeight<s)||s<0||i.scrollHeight-i.clientHeight<s)return;e.preventDefault(),i.scrollTop=s,r.scrollTop=s,t.pageXY.y=o.y,t.previousValues.top=s}}}},e.prototype.setPageXY=function(){var e=this;return function(t){"mouse"!==t.pointerType&&(e.pageXY=e.getPointXY(t))}},e.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},e.prototype.wireEvents=function(){var e=this;if(this.oneTimeReady){var r=this.parent.getFrozenColumns();this.content=this.parent.getContent().firstChild,this.header=this.parent.getHeaderContent().firstChild;var i=this.content.querySelector(".e-movablecontent"),n=this.content.querySelector(".e-frozencontent"),o=this.header.querySelector(".e-movableheader");this.parent.frozenRows&&(t.EventHandler.add(r?o:this.header,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(r?o:this.header,"touchmove pointermove",this.onTouchScroll(r?i:this.content),this)),r?(t.EventHandler.add(i,"scroll",this.onContentScroll(o),this),t.EventHandler.add(i,"scroll",this.onFreezeContentScroll(n),this),t.EventHandler.add(n,"scroll",this.onFreezeContentScroll(i),this),t.EventHandler.add(o,"scroll",this.onContentScroll(i),this),t.EventHandler.add(n,"wheel",this.onWheelScroll(i),this),t.EventHandler.add(n,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(n,"touchmove pointermove",this.onTouchScroll(i),this)):(t.EventHandler.add(this.content,"scroll",this.onContentScroll(this.header),this),t.EventHandler.add(this.header,"scroll",this.onContentScroll(this.content),this)),this.parent.aggregates.length&&t.EventHandler.add(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll(this.content),this),this.refresh(),this.oneTimeReady=!1}var s,l,a,d=this.parent.getContentTable();f(function(){s=e.header.scrollLeft,l=d.scrollHeight,a=e.parent.getContent().clientHeight},function(){e.parent.enableVirtualization||(l<a&&(t.addClass(d.querySelectorAll("tr:last-child td"),"e-lastrowcell"),e.parent.getFrozenColumns()&&t.addClass(e.parent.getContent().querySelector(".e-movablecontent").querySelectorAll("tr:last-child td"),"e-lastrowcell")),(e.parent.frozenRows>0||e.parent.frozenColumns>0)&&e.header.querySelector(".e-movableheader")?e.header.querySelector(".e-movableheader").scrollLeft=e.previousValues.left:e.header.scrollLeft=e.previousValues.left,e.content.scrollLeft=e.previousValues.left,e.content.scrollTop=e.previousValues.top),e.parent.enableColumnVirtualization||(e.content.scrollLeft=s),e.parent.frozenColumns&&e.header.querySelector(".e-movableheader")&&(e.header.querySelector(".e-movableheader").scrollLeft=e.content.querySelector(".e-movablecontent").scrollLeft)}),this.parent.isPreventScrollEvent=!1},e.prototype.getCssProperties=function(e){var r={},i=t.isNullOrUndefined(e)?this.parent.enableRtl:e;return r.border=i?"borderLeftWidth":"borderRightWidth",r.padding=i?"paddingLeft":"paddingRight",r},e.prototype.ensureOverflow=function(e){this.parent.getFrozenColumns()?(e.querySelector(".e-movablecontent").style.overflowY="auto"===this.parent.height?"auto":"scroll","scroll"===e.querySelector(".e-movablecontent").style.overflowY&&this.setPadding()):e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){this.setPadding(),this.oneTimeReady=!0,"auto"===this.parent.height&&this.removePadding(),this.wireEvents(),this.setHeight();this.setWidth(!t.isNullOrUndefined(e.properties.width))}},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.removeEventListener(),this.removePadding(),t.removeClass([this.parent.getHeaderContent().firstChild],"e-headercontent"),t.removeClass([this.parent.getContent().firstChild],"e-content"),this.parent.getContent().firstChild.style.height="",this.parent.element.style.width="",t.EventHandler.remove(this.parent.getContent().firstChild,"scroll",this.onContentScroll))},e.getScrollBarWidth=function(){return z()},e}(),Cr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),wr=function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},br=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.templateFn={},e}return Cr(i,r),i.prototype.setFormatter=function(e){var t=new ve(e);this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=t.getFormatFunction(this.format))},i.prototype.getFormatter=function(){return this.formatFn},i.prototype.setTemplate=function(r){void 0===r&&(r={}),void 0!==this.footerTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.Summary)]={fn:t.compile(this.footerTemplate,r),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]={fn:t.compile(this.groupFooterTemplate,r),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]={fn:t.compile(this.groupCaptionTemplate,r),property:"groupCaptionTemplate"})},i.prototype.getTemplate=function(r){return this.templateFn[t.getEnumValue(e.CellType,r)]},i.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},wr([t.Property()],i.prototype,"type",void 0),wr([t.Property()],i.prototype,"field",void 0),wr([t.Property()],i.prototype,"columnName",void 0),wr([t.Property()],i.prototype,"format",void 0),wr([t.Property()],i.prototype,"footerTemplate",void 0),wr([t.Property()],i.prototype,"groupFooterTemplate",void 0),wr([t.Property()],i.prototype,"groupCaptionTemplate",void 0),wr([t.Property()],i.prototype,"customAggregate",void 0),i}(t.ChildProperty),Sr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Cr(r,e),wr([t.Collection([],br)],r.prototype,"columns",void 0),r}(t.ChildProperty),xr=function(){function e(e){this.copyContent="",this.isSelect=!1,this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ne,this.initialEnd,this),this.parent.on(Ve,this.keyDownHandler,this),this.parent.on(Ge,this.clickHandler,this),t.EventHandler.add(this.parent.element,"keydown",this.pasteHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ve,this.keyDownHandler),this.parent.off(Ge,this.clickHandler),t.EventHandler.remove(this.parent.element,"keydown",this.pasteHandler))},e.prototype.clickHandler=function(e){var t=e.target;t=O(t,"e-rowcell")},e.prototype.pasteHandler=function(e){var r=this;if(86===e.keyCode&&e.ctrlKey&&!this.parent.isEdit){var i=t.closest(document.activeElement,".e-rowcell");if(!i)return;this.activeElement=document.activeElement,this.clipBoardTextArea.value="";var n=window.scrollX,o=window.scrollY;this.clipBoardTextArea.focus(),setTimeout(function(){r.activeElement.focus(),window.scrollTo(n,o),r.paste(r.clipBoardTextArea.value,parseInt(i.parentElement.getAttribute("aria-rowindex"),10),parseInt(i.getAttribute("aria-colindex"),10))},10)}},e.prototype.paste=function(e,r,i){var n,o,s,l=this.parent,a=i,d=r;if(l.editSettings.allowEditing&&"Batch"===l.editSettings.mode&&"Cell"===l.selectionSettings.mode&&"Flow"!==l.selectionSettings.cellSelectionMode){var c,h,p=e.split("\n"),u=l.getDataRows(),g=this.parent.getFrozenColumns();g&&(h=l.getMovableDataRows());for(var f=0;f<p.length;f++){if(c=p[f].split("\t"),a=i,f===p.length-1&&""===p[f]||t.isUndefined(l.getRowByIndex(d))){a++;break}for(var m=0;m<c.length;m++){if(s=l.getCellFromIndex(d,a),g){var y=u[d],v=h[d];s=!!y.querySelector('[aria-colindex="'+a+'"]')||v.querySelector('[aria-colindex="'+a+'"]')}if(!s){a++;break}if(n=l.getColumnByIndex(a),o=n.getParser()?n.getParser()(c[m]):c[m],n.allowEditing&&!n.isPrimaryKey&&!n.template){var C={column:n,data:o};this.parent.trigger("beforePaste",C),l.editModule&&("number"===n.type?this.parent.editModule.updateCell(d,n.field,parseInt(C.data,10)):l.editModule.updateCell(d,n.field,C.data))}a++}d++}l.selectionModule.selectCellsByRange({rowIndex:r,cellIndex:i},{rowIndex:d-1,cellIndex:a-1});var w=this.parent.getCellFromIndex(d-1,a-1);w&&t.classList(w,["e-focus","e-focused"],[])}},e.prototype.initialEnd=function(){this.parent.off(Ne,this.initialEnd),this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",styles:"opacity: 0",attrs:{tabindex:"-1","aria-label":"clipboard"}}),this.parent.element.appendChild(this.clipBoardTextArea)},e.prototype.keyDownHandler=function(e){"ctrlPlusC"===e.action?this.copy():"ctrlShiftPlusH"===e.action&&this.copy(!0)},e.prototype.setCopyData=function(e){if(""===window.getSelection().toString()){var r=this.parent.getFrozenColumns();this.clipBoardTextArea.value=this.copyContent="";var i=void 0,n=this.parent.getRows();if(r&&(i=this.parent.getMovableDataRows()),"Cell"!==this.parent.selectionSettings.mode){var o=this.parent.getSelectedRowIndexes().sort(function(e,t){return e-t});if(e){for(var s=[],l=0;l<this.parent.getVisibleColumns().length;l++)s[l]=this.parent.getVisibleColumns()[l].headerText;this.getCopyData(s,!1,"\t",e),this.copyContent+="\n"}for(l=0;l<o.length;l++){l>0&&(this.copyContent+="\n");c=[].slice.call(n[o[l]].querySelectorAll(".e-rowcell"));r&&c.push.apply(c,[].slice.call(i[o[l]].querySelectorAll(".e-rowcell"))),this.getCopyData(c,!1,"\t",e)}}else{var a=this.checkBoxSelection();if(a.status){if(e){for(var d=[],l=0;l<a.colIndexes.length;l++)d.push(this.parent.getColumnHeaderByIndex(a.colIndexes[l]));this.getCopyData(d,!1,"\t",e),this.copyContent+="\n"}for(l=0;l<a.rowIndexes.length;l++){l>0&&(this.copyContent+="\n");var c=[].slice.call(n[a.rowIndexes[l]].querySelectorAll(".e-cellselectionbackground"));r&&c.push.apply(c,[].slice.call(i[a.rowIndexes[l]].querySelectorAll(".e-cellselectionbackground"))),this.getCopyData(c,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.querySelectorAll(".e-cellselectionbackground")),!0,"\n",e)}var h={data:this.copyContent,cancel:!1};if(this.parent.trigger("beforeCopy",h),h.cancel)return;this.clipBoardTextArea.value=this.copyContent=h.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0}},e.prototype.getCopyData=function(e,t,r,i){for(var n="string"!=typeof e[0],o=0;o<e.length;o++)i&&t&&(this.copyContent+=this.parent.getColumns()[parseInt(e[o].getAttribute("aria-colindex"),10)].headerText+"\n"),n?e[o].classList.contains("e-hide")||(this.copyContent+=e[o].textContent):this.copyContent+=e[o],o<e.length-1&&(this.copyContent+=r)},e.prototype.copy=function(e){document.queryCommandSupported("copy")&&(this.setCopyData(e),document.execCommand("copy"),this.clipBoardTextArea.blur()),this.isSelect&&(window.getSelection().removeAllRanges(),this.isSelect=!1)},e.prototype.getModuleName=function(){return"clipboard"},e.prototype.destroy=function(){this.removeEventListener(),this.clipBoardTextArea&&t.remove(this.clipBoardTextArea)},e.prototype.checkBoxSelection=function(){var e=this.parent,t={status:!1};if("Cell"===e.selectionSettings.mode){var r=e.getSelectedRowCellIndexes(),i=void 0,n=[],o=void 0;for(o=0;o<r.length&&(r[o].cellIndexes.length&&n.push(r[o].rowIndex),!r[o].cellIndexes.length||(i||(i=JSON.stringify(r[o].cellIndexes.sort())),i===JSON.stringify(r[o].cellIndexes.sort())));o++);n.sort(function(e,t){return e-t}),o===r.length&&n[n.length-1]-n[0]==n.length-1&&(t={status:!0,rowIndexes:n,colIndexes:r[0].cellIndexes})}return t},e}(),Rr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Er=function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Tr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property()],r.prototype,"field",void 0),Er([t.Property()],r.prototype,"direction",void 0),Er([t.Property(!1)],r.prototype,"isFromGroup",void 0),r}(t.ChildProperty),Dr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Collection([],Tr)],r.prototype,"columns",void 0),Er([t.Property(!0)],r.prototype,"allowUnsort",void 0),r}(t.ChildProperty),Ir=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property()],r.prototype,"field",void 0),Er([t.Property()],r.prototype,"operator",void 0),Er([t.Property()],r.prototype,"value",void 0),Er([t.Property()],r.prototype,"matchCase",void 0),Er([t.Property()],r.prototype,"ignoreAccent",void 0),Er([t.Property()],r.prototype,"predicate",void 0),Er([t.Property({})],r.prototype,"actualFilterValue",void 0),Er([t.Property({})],r.prototype,"actualOperator",void 0),Er([t.Property()],r.prototype,"type",void 0),Er([t.Property()],r.prototype,"ejpredicate",void 0),Er([t.Property()],r.prototype,"uid",void 0),Er([t.Property()],r.prototype,"isForeignKey",void 0),r}(t.ChildProperty),Or=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Collection([],Ir)],r.prototype,"columns",void 0),Er([t.Property("FilterBar")],r.prototype,"type",void 0),Er([t.Property()],r.prototype,"mode",void 0),Er([t.Property(!0)],r.prototype,"showFilterBarStatus",void 0),Er([t.Property(1500)],r.prototype,"immediateModeDelay",void 0),Er([t.Property()],r.prototype,"operators",void 0),Er([t.Property(!1)],r.prototype,"ignoreAccent",void 0),Er([t.Property(!1)],r.prototype,"enableCaseSensitivity",void 0),r}(t.ChildProperty),Fr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property("Row")],r.prototype,"mode",void 0),Er([t.Property("Flow")],r.prototype,"cellSelectionMode",void 0),Er([t.Property("Single")],r.prototype,"type",void 0),Er([t.Property(!1)],r.prototype,"checkboxOnly",void 0),Er([t.Property(!1)],r.prototype,"persistSelection",void 0),Er([t.Property("Default")],r.prototype,"checkboxMode",void 0),Er([t.Property(!1)],r.prototype,"enableSimpleMultiRowSelection",void 0),Er([t.Property(!0)],r.prototype,"enableToggle",void 0),r}(t.ChildProperty),kr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property([])],r.prototype,"fields",void 0),Er([t.Property("")],r.prototype,"key",void 0),Er([t.Property("contains")],r.prototype,"operator",void 0),Er([t.Property(!0)],r.prototype,"ignoreCase",void 0),Er([t.Property(!1)],r.prototype,"ignoreAccent",void 0),r}(t.ChildProperty),Mr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property()],r.prototype,"targetID",void 0),r}(t.ChildProperty),Ar=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property("Both")],r.prototype,"wrapMode",void 0),r}(t.ChildProperty),Pr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property(!0)],r.prototype,"showDropArea",void 0),Er([t.Property(!1)],r.prototype,"showToggleButton",void 0),Er([t.Property(!1)],r.prototype,"showGroupedColumn",void 0),Er([t.Property(!0)],r.prototype,"showUngroupButton",void 0),Er([t.Property(!1)],r.prototype,"disablePageWiseAggregates",void 0),Er([t.Property([])],r.prototype,"columns",void 0),Er([t.Property()],r.prototype,"captionTemplate",void 0),r}(t.ChildProperty),Nr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Rr(r,e),Er([t.Property(!1)],r.prototype,"allowAdding",void 0),Er([t.Property(!1)],r.prototype,"allowEditing",void 0),Er([t.Property(!1)],r.prototype,"allowDeleting",void 0),Er([t.Property("Normal")],r.prototype,"mode",void 0),Er([t.Property(!0)],r.prototype,"allowEditOnDblClick",void 0),Er([t.Property(!0)],r.prototype,"showConfirmDialog",void 0),Er([t.Property(!1)],r.prototype,"showDeleteConfirmDialog",void 0),Er([t.Property("")],r.prototype,"template",void 0),Er([t.Property("Top")],r.prototype,"newRowPosition",void 0),Er([t.Property({})],r.prototype,"dialog",void 0),Er([t.Property(!1)],r.prototype,"allowNextRowEdit",void 0),r}(t.ChildProperty),Br=function(n){function o(e,r){var i=n.call(this,e,r)||this;return i.isPreventScrollEvent=!1,i.inViewIndexes=[],i.media={},i.freezeRefresh=t.Component.prototype.refresh,i.isVirtualAdaptive=!1,i.vRows=[],i.vcRows=[],i.vGroupOffsets={},i.currentViewData=[],i.lockcolPositionCount=0,i.prevPageMoving=!1,i.pageTemplateChange=!1,i.isAutoGen=!1,i.enableLogger=!0,i.needsID=!0,s.Inject(fr),t.setValue("mergePersistData",i.mergePersistGridData,i),i}Rr(o,n),s=o,o.prototype.getPersistData=function(){var e=this,r=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","selectedRowIndex","scrollPosition"],i={pageSettings:["template","pageSizes","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent"],groupSettings:["showDropArea","showToggleButton","showGroupedColumn","showUngroupButton","disablePageWiseAggregates","hideCaptionCount"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]};return r.forEach(function(t){for(var r=e[t],n=0,o=i[t];n<o.length;n++)delete r[o[n]]}),this.pageSettings.template=void 0,this.pageTemplateChange=!t.isNullOrUndefined(this.pagerTemplate),this.addOnPersist(r)},o.prototype.requiredModules=function(){var e=[];return this.isDestroyed?e:(this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator]}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this,this.serviceLocator]}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this]}),this.allowSorting&&e.push({member:"sort",args:[this,this.sortSettings,this.sortedColumns,this.serviceLocator]}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings]}),this.allowSelection&&e.push({member:"selection",args:[this,this.selectionSettings,this.serviceLocator]}),e.push({member:"resize",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this]}),this.allowGrouping&&e.push({member:"group",args:[this,this.groupSettings,this.sortedColumns,this.serviceLocator]}),this.aggregates.length&&e.push({member:"aggregate",args:[this,this.serviceLocator]}),this.isDetail()&&e.push({member:"detailRow",args:[this,this.serviceLocator]}),(this.toolbar||this.toolbarTemplate)&&e.push({member:"toolbar",args:[this,this.serviceLocator]}),(this.enableVirtualization||this.enableColumnVirtualization)&&e.push({member:"virtualscroll",args:[this,this.serviceLocator]}),(this.getFrozenColumns()||this.frozenRows)&&e.push({member:"freeze",args:[this,this.serviceLocator]}),this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this,this.serviceLocator]}),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this,this.serviceLocator]}),this.extendRequiredModules(e),e)},o.prototype.extendRequiredModules=function(e){this.contextMenuItems&&e.push({member:"contextMenu",args:[this,this.serviceLocator]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this,this.serviceLocator]}),this.showColumnChooser&&e.push({member:"columnChooser",args:[this,this.serviceLocator]}),this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator]}),this.enableLogger&&e.push({member:"logger",args:[this]})},o.prototype.preRender=function(){this.serviceLocator=new er,this.initProperties(),this.initializeServices()},o.prototype.initProperties=function(){this.isInitial=!0,this.sortedColumns=[],this.inViewIndexes=[],this.mediaCol=[],this.isInitialLoad=!1,this.mergeCells={},this.isEdit=!1,this.checkAllRows="None",this.isCheckBoxSelection=!1,this.isPersistSelection=!1,this.freezeRefresh=t.Component.prototype.refresh,this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith"},this.defaultLocale={EmptyRecord:"No records to display",True:"true",False:"false",InvalidFilterMessage:"Invalid Filter Data",GroupDropArea:"Drag a column header here to group its column",UnGroup:"Click here to ungroup",GroupDisable:"Grouping is disabled for this column",FilterbarTitle:"'s filter bar cell",EmptyDataSourceError:"DataSource must not be empty at initial load since columns are generated from dataSource in AutoGenerate Column Grid",Add:"Add",Edit:"Edit",Cancel:"Cancel",Update:"Update",Delete:"Delete",Print:"Print",Pdfexport:"PDF Export",Excelexport:"Excel Export",Wordexport:"Word Export",Csvexport:"CSV Export",Search:"Search",Columnchooser:"Columns",Save:"Save",Item:"item",Items:"items",EditOperationAlert:"No records selected for edit operation",DeleteOperationAlert:"No records selected for delete operation",SaveButton:"Save",OKButton:"OK",CancelButton:"Cancel",EditFormTitle:"Details of ",AddFormTitle:"Add New Record",BatchSaveConfirm:"Are you sure you want to save changes?",BatchSaveLostChanges:"Unsaved changes will be lost. Are you sure you want to continue?",ConfirmDelete:"Are you sure you want to Delete Record?",CancelEdit:"Are you sure you want to Cancel the changes?",ChooseColumns:"Choose Column",SearchColumns:"search columns",Matchs:"No Matches Found",FilterButton:"Filter",ClearButton:"Clear",StartsWith:"Starts With",EndsWith:"Ends With",Contains:"Contains",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",ChooseDate:"Choose a Date",EnterValue:"Enter the value",Copy:"Copy",Group:"Group by this column",Ungroup:"Ungroup by this column",autoFitAll:"Autofit all columns",autoFit:"Autofit this column",Export:"Export",FirstPage:"First Page",LastPage:"Last Page",PreviousPage:"Previous Page",NextPage:"Next Page",SortAscending:"Sort Ascending",SortDescending:"Sort Descending",EditRecord:"Edit Record",DeleteRecord:"Delete Record",FilterMenu:"Filter",SelectAll:"Select All",Blanks:"Blanks",FilterTrue:"True",FilterFalse:"False",NoResult:"No Matches Found",ClearFilter:"Clear Filter",NumberFilter:"Number Filters",TextFilter:"Text Filters",DateFilter:"Date Filters",DateTimeFilter:"DateTime Filters",MatchCase:"Match Case",Between:"Between",CustomFilter:"Custom Filter",CustomFilterPlaceHolder:"Enter the value",CustomFilterDatePlaceHolder:"Choose a date",AND:"AND",OR:"OR",ShowRowsWhere:"Show rows where:"},this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftRight:"shift+rightarrow",shiftLeft:"shift+leftarrow",home:"home",end:"end",escape:"escape",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",pageUp:"pageup",pageDown:"pagedown",ctrlAltPageUp:"ctrl+alt+pageup",ctrlAltPageDown:"ctrl+alt+pagedown",altPageUp:"alt+pageup",altPageDown:"alt+pagedown",altDownArrow:"alt+downarrow",altUpArrow:"alt+uparrow",ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlPlusA:"ctrl+A",ctrlPlusP:"ctrl+P",insert:"insert",delete:"delete",f2:"f2",enter:"enter",ctrlEnter:"ctrl+enter",shiftEnter:"shift+enter",tab:"tab",shiftTab:"shift+tab",space:"space",ctrlPlusC:"ctrl+C",ctrlShiftPlusH:"ctrl+shift+H"}},o.prototype.render=function(){this.log(["module_missing","promise_enabled","locale_missing","check_datasource_columns"]),this.ariaService.setOptions(this.element,{role:"grid"}),t.isBlazor()&&this.renderComplete(),i.createSpinner({target:this.element},this.createElement),this.renderModule=new $t(this,this.serviceLocator),this.searchModule=new mr(this),this.scrollModule=new vr(this),this.notify(Me,{}),!0!==this.getDataModule().dataManager.dataSource.offline&&void 0!==this.getDataModule().dataManager.dataSource.url||(this.isVirtualAdaptive=!0),this.trigger("load"),E(this.columns,this.enableColumnVirtualization),this.enablePersistence&&this.notify(ct,{}),this.getMediaColumns(),R(this.columns),this.checkLockColumns(this.columns),this.getColumns(),this.processModel(),this.gridRender(),this.wireEvents(),this.addListener(),this.updateDefaultCursor(),this.updateStackedFilter(),this.showSpinner(),this.notify(Ae,{})},o.prototype.showSpinner=function(){i.showSpinner(this.element)},o.prototype.hideSpinner=function(){i.hideSpinner(this.element)},o.prototype.updateStackedFilter=function(){this.allowFiltering&&"FilterBar"===this.filterSettings.type&&this.getHeaderContent().querySelectorAll(".e-stackedheadercell").length?this.getHeaderContent().classList.add("e-stackedfilter"):this.getHeaderContent().classList.remove("e-stackedfilter")},o.prototype.getMediaColumns=function(){if(!this.enableColumnVirtualization){var e=this.getColumns();if(this.getShowHideService=this.serviceLocator.getService("showHideService"),!t.isNullOrUndefined(e))for(var r=0;r<e.length;r++)t.isNullOrUndefined(e[r].hideAtMedia)||!t.isNullOrUndefined(e[r].visible)&&!e[r].visible||this.pushMediaColumn(e[r],r)}},o.prototype.pushMediaColumn=function(e,t){this.mediaCol.push(e),this.media[e.uid]=window.matchMedia(e.hideAtMedia),this.mediaQueryUpdate(t,this.media[e.uid]),this.media[e.uid].addListener(this.mediaQueryUpdate.bind(this,t))},o.prototype.updateMediaColumns=function(e){if(!this.enableColumnVirtualization){for(var t=this.getColumnIndexByUid(e.uid),r=0;r<this.mediaCol.length;r++)if(e.uid===this.mediaCol[r].uid)return void this.mediaCol.splice(r,1);this.pushMediaColumn(e,t)}},o.prototype.mediaQueryUpdate=function(e,t){var r=this.getColumns()[e];this.mediaCol.some(function(e){return e.uid===r.uid})&&(r.visible=t.matches,this.isInitialLoad&&(this.invokedFromMedia=!0,r.visible?this.showHider.show(r.headerText,"headerText"):this.showHider.hide(r.headerText,"headerText")))},o.prototype.refreshMediaCol=function(){if(this.isInitialLoad=!0,this.aggregates.length&&this.element.scrollHeight>this.height){var e=this.element.querySelector(".e-gridfooter");t.addClass([e],["e-footerpadding"])}this.getColumns().filter(function(e){return"checkbox"===e.type}).length&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&(this.isCheckBoxSelection=!1,this.refreshHeader())},o.prototype.eventInitializer=function(){},o.prototype.destroy=function(){var e=this.element;if(e){var r=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent"));r&&this.unwireEvents(),this.removeListener(),this.notify(_e,{}),this.destroyDependentModules(),r&&n.prototype.destroy.call(this),this.toolTipObj.destroy();for(var i=["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","showHider","scrollModule","printModule","clipboardModule","focusModule"],o=0;o<i.length;o++)this[i[o]]&&(this[i[o]]=null);this.element.innerHTML="",t.classList(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"])}},o.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy())},o.prototype.getModuleName=function(){return"grid"},o.prototype.enableBoxSelection=function(){this.enableAutoFill&&(this.selectionSettings.cellSelectionMode="BoxWithBorder")},o.prototype.onPropertyChanged=function(e,r){var i,n=!1,o=!1,s=!1,l={requestType:"refresh"};if(!this.isDestroyed){this.log("module_missing");var a=Object.keys(e);a.indexOf("columns")>-1&&(this.updateColumnObject(),o=!0);for(var d=0,c=a;d<c.length;d++){var h=c[d];switch(h){case"allowPaging":this.notify(Be,{module:"pager",enable:this.allowPaging}),n=!0;break;case"pageSettings":if(this.pageTemplateChange){this.pageTemplateChange=!1;break}this.notify(qe,{module:"pager",properties:e.pageSettings}),(t.isNullOrUndefined(e.pageSettings.currentPage)&&t.isNullOrUndefined(e.pageSettings.pageSize)&&t.isNullOrUndefined(e.pageSettings.totalRecordsCount)||!t.isNullOrUndefined(r.pageSettings)&&e.pageSettings.currentPage!==r.pageSettings.currentPage&&!this.enableColumnVirtualization&&!this.enableVirtualization&&this.pageSettings.totalRecordsCount<=this.pageSettings.pageSize)&&(n=!0);break;case"allowSorting":this.notify(Be,{module:"sort",enable:this.allowSorting}),n=!0,i=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(Be,{module:"filter",enable:this.allowFiltering}),n=!0,"FilterBar"!==this.filterSettings.type&&this.refreshHeader();break;case"height":case"width":this.notify(Be,{module:"scroll",properties:{width:e.width,height:e.height}});break;case"allowReordering":this.headerModule.refreshUI(),i=!0;break;case"allowRowDragAndDrop":this.notify(Be,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop});break;case"allowSelection":this.notify(Be,{module:"selection",enable:this.allowSelection});break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=b(this.rowTemplate),n=!0;break;case"detailTemplate":this.detailTemplateFn=b(this.detailTemplate),n=!0;break;case"allowGrouping":this.notify(Be,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),n=!0,i=!0;break;case"childGrid":n=!0;break;case"toolbar":this.notify(Be,{module:"toolbar"});break;case"groupSettings":this.notify(qe,{module:"group",properties:e.groupSettings,oldProperties:r.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(n=!0),this.notify(Be,{module:"aggregate",properties:e});break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"currencyCode":case"locale":this.log("frozen_rows_columns"),s=!0,o=!0;break;case"query":n=!0;break;default:this.extendedPropertyChange(h,e,o)}}i&&this.updateDefaultCursor(),o?s||this.frozenColumns||this.frozenRows?this.freezeRefresh():this.refresh():n&&(this.notify(ze,l),n=!1,this.maintainSelection(e.selectedRowIndex))}},o.prototype.extendedPropertyChange=function(e,i,n){switch(e){case"enableRtl":this.updateRTL(),this.allowPaging&&(this.element.querySelector(".e-gridpager").ej2_instances[0].enableRtl=i.enableRtl,this.element.querySelector(".e-gridpager").ej2_instances[0].dataBind()),"auto"!==this.height&&(this.scrollModule.removePadding(!i.enableRtl),this.scrollModule.setPadding()),this.toolbar&&this.toolbarModule&&(this.toolbarModule.getToolbar().ej2_instances[0].enableRtl=i.enableRtl,this.toolbarModule.getToolbar().ej2_instances[0].dataBind()),this.contextMenuItems&&this.contextMenuModule&&(this.contextMenuModule.getContextMenu().ej2_instances[0].enableRtl=i.enableRtl,this.contextMenuModule.getContextMenu().ej2_instances[0].dataBind()),this.showColumnMenu&&this.columnMenuModule&&(this.columnMenuModule.getColumnMenu().ej2_instances[0].enableRtl=i.enableRtl,this.columnMenuModule.getColumnMenu().ej2_instances[0].dataBind()),this.notify("rtl-updated",{});break;case"enableAltRow":this.renderModule.refresh();break;case"allowResizing":this.headerModule.refreshUI(),this.updateResizeLines();break;case"rowHeight":this.rowHeight?t.addClass([this.element],"e-grid-min-height"):t.removeClass([this.element],"e-grid-min-height"),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"gridLines":this.updateGridLines();break;case"showColumnMenu":this.headerModule.refreshUI(),this.notify(Be,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(Be,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(Be,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.notify(Be,{module:"columnChooser",enable:this.showColumnChooser});break;case"filterSettings":this.updateStackedFilter(),this.notify(qe,{module:"filter",properties:i.filterSettings});break;case"searchSettings":this.notify(qe,{module:"search",properties:i.searchSettings});break;case"sortSettings":this.notify(qe,{module:"sort"});break;case"selectionSettings":this.notify(qe,{module:"selection",properties:i.selectionSettings});break;case"editSettings":this.notify(qe,{module:"edit",properties:i.editSettings});break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(st,{case:"textwrap",isModeChg:"textWrapSettings"===e});break;case"dataSource":var o=this.getDataModule().getState();if(Object.getPrototypeOf(i).deepWatch)for(var s=this.getPrimaryKeyFieldNames()[0],l=0,a=Object.keys(i.dataSource);l<a.length;l++)this.setRowData(t.getValue(s,this.dataSource[a[l]]),this.dataSource[a[l]]);else if(o.isPending){var d=t.isNullOrUndefined(this.dataSource)?[]:this.dataSource.result;(o.group||[]).forEach(function(e){d=r.DataUtil.group(d,e,o.aggregates||[])}),this.dataSource={result:d,count:this.dataSource.count,aggregates:this.dataSource.aggregates},this.getDataModule().setState({}),o.resolver(this.dataSource)}else this.getDataModule().setState({isDataChanged:!1}),this.notify($e,{}),n||this.renderModule.refresh();break;case"enableHover":(i.enableHover?t.addClass:t.removeClass)([this.element],"e-gridhover");break;case"selectedRowIndex":this.isSelectedRowIndexUpdating||this.selectRow(i.selectedRowIndex),this.isSelectedRowIndexUpdating=!1}},o.prototype.maintainSelection=function(e){var t=this;if(-1!==e){var r=function(){t.selectRow(e),t.off(Ne,r)};this.on(Ne,r,this)}},o.prototype.setProperties=function(e,t){n.prototype.setProperties.call(this,e,t);e.filterSettings&&this.filterModule&&t&&this.filterModule.refreshFilter()},o.prototype.updateDefaultCursor=function(){for(var e=[].slice.call(this.getHeaderContent().querySelectorAll(".e-headercell:not(.e-stackedheadercell)")),t=[].slice.call(this.getHeaderContent().querySelectorAll(".e-stackedheadercell")),r=this.getColumns(),i=0;i<e.length;i++){var n=e[i];(this.allowGrouping||this.allowReordering||this.allowSorting)&&(r[i].allowReordering&&r[i].allowSorting&&r[i].allowGrouping?n.classList.add("e-mousepointer"):n.classList.add("e-defaultcursor"))}for(var o=0;o<t.length;o++)this.allowReordering&&t[o].classList.add("e-mousepointer")},o.prototype.updateColumnModel=function(e){for(var t=0,r=e.length;t<r;t++)e[t].columns?this.updateColumnModel(e[t].columns):this.columnModel.push(e[t]);this.updateFrozenColumns(),this.updateLockableColumns()},o.prototype.updateFrozenColumns=function(){for(var e=this.columnModel,t=0,r=0,i=e.length;r<i;r++)e[r].isFrozen&&(e.splice(this.frozenColumns+t,0,e.splice(r,1)[0]),t++)},o.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,r=0,i=this.getFrozenColumns(),n=0;n<e.length;n++)e[n].lockColumn&&(n<i?(e.splice(t,0,e.splice(n,1)[0]),t++):(e.splice(i+r,0,e.splice(n,1)[0]),r++))},o.prototype.checkLockColumns=function(e){for(var t=0;t<e.length;t++)e[t].columns?this.checkLockColumns(e[t].columns):e[t].lockColumn&&this.lockcolPositionCount++},o.prototype.getColumns=function(e){var r=this,i=this.inViewIndexes.map(function(e){return e-r.groupSettings.columns.length}).filter(function(e){return e>-1}),n=i.length;return(!this.enableColumnVirtualization||t.isNullOrUndefined(this.columnModel)||0===this.columnModel.length||e)&&(this.columnModel=[],this.updateColumnModel(this.columns)),0===n?this.columnModel:this.columnModel.slice(i[0],i[n-1]+1)},o.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var r=0;r<t.length;r++){var i=t[r];if(i.field===e||i.headerText===e){this.stackedColumn=i;break}i.columns&&this.getStackedHeaderColumnByHeaderText(e,i.columns)}return this.stackedColumn},o.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},o.prototype.getQuery=function(){return this.query},o.prototype.getLocaleConstants=function(){return this.defaultLocale},o.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},o.prototype.getVisibleColumns=function(){for(var e=[],t=0,r=this.columnModel;t<r.length;t++){var i=r[t];i.visible&&e.push(i)}return e},o.prototype.getHeaderContent=function(){return this.headerModule.getPanel()},o.prototype.setGridHeaderContent=function(e){this.headerModule.setPanel(e)},o.prototype.getContentTable=function(){return this.contentModule.getTable()},o.prototype.setGridContentTable=function(e){this.contentModule.setTable(e)},o.prototype.getContent=function(){return this.contentModule.getPanel()},o.prototype.setGridContent=function(e){this.contentModule.setPanel(e)},o.prototype.getHeaderTable=function(){return this.headerModule.getTable()},o.prototype.setGridHeaderTable=function(e){this.headerModule.setTable(e)},o.prototype.getFooterContent=function(){return t.isNullOrUndefined(this.footerElement)&&(this.footerElement=this.element.getElementsByClassName("e-gridfooter")[0]),this.footerElement},o.prototype.getFooterContentTable=function(){return t.isNullOrUndefined(this.footerElement)&&(this.footerElement=this.element.getElementsByClassName("e-gridfooter")[0]),this.footerElement.firstChild.firstChild},o.prototype.getPager=function(){return this.gridPager},o.prototype.setGridPager=function(e){this.gridPager=e},o.prototype.getRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},o.prototype.getMovableRowByIndex=function(e){return this.contentModule.getMovableRowByIndex(e)},o.prototype.getRows=function(){return this.contentModule.getRowElements()},o.prototype.getRowInfo=function(e){var r=e,i={target:e};if(!t.isNullOrUndefined(e)&&t.isNullOrUndefined(O(r,"e-detailrowcollapse")&&t.isNullOrUndefined(O(r,"e-recordplusexpand")))&&!this.isEdit){var n=t.closest(r,".e-rowcell");if(!n)return i;var o=parseInt(n.getAttribute("aria-colindex"),10);if(!t.isNullOrUndefined(n)&&!isNaN(o)){var s=t.closest(n,".e-row"),l=parseInt(s.getAttribute("aria-rowindex"),10),a=this.getFrozenColumns(),d=!!a&&o>=a,c=(d?this.contentModule.getMovableRows():this.contentModule.getRows()).filter(function(e){return e.uid===s.getAttribute("data-uid")}),h={},p=void 0;Object.keys(c).length&&(h=c[0].data,p=c[0].cells[d?o-a:o].column),i={cell:n,cellIndex:o,row:s,rowIndex:l,rowData:h,column:p,target:e}}}return i},o.prototype.getMovableRows=function(){return this.contentModule.getMovableRowElements()},o.prototype.getDataRows=function(){var e=[].slice.call(this.getContentTable().querySelector("tbody").children);if(this.frozenRows){var t=[].slice.call(this.getHeaderTable().querySelector("tbody").children);e=this.addMovableRows(t,e)}return this.generateDataRows(e)},o.prototype.addMovableRows=function(e,t){for(var r=0,i=t.length;r<i;r++)e.push(t[r]);return e},o.prototype.generateDataRows=function(e){for(var t=[],r=0,i=e.length;r<i;r++)e[r].classList.contains("e-row")&&!e[r].classList.contains("e-hiddenrow")&&t.push(e[r]);return t},o.prototype.getMovableDataRows=function(){var e=[].slice.call(this.getContent().querySelector(".e-movablecontent").querySelector("tbody").children);if(this.frozenRows){var t=[].slice.call(this.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody").children);e=this.addMovableRows(t,e)}return this.generateDataRows(e)},o.prototype.setCellValue=function(e,r,i){var n,o,s,l,a=this.getPrimaryKeyFieldNames()[0],d=new It(this,this.serviceLocator),c={},h={},p=this.contentModule.getRows(),u=this.contentModule.getMovableRows();if(n=this.getColumnIndexByField(r),(this.groupSettings.columns.length>0||this.childGrid||this.detailTemplate)&&(n+=1),o=this.getColumnByField(r),c=p.filter(function(r){return t.getValue(a,r.data)===e})[0],h=u.filter(function(r){return t.getValue(a,r.data)===e})[0],s=t.isNullOrUndefined(c)?null:this.element.querySelector("[data-uid="+c.uid+"]"),l=t.isNullOrUndefined(h)?null:this.element.querySelector("[data-uid="+h.uid+"]"),!t.isNullOrUndefined(s)){t.setValue(r,i,c.data);var g=t.isNullOrUndefined(s.childNodes[n])?l.childNodes[n-this.frozenColumns]:s.childNodes[n];if(!t.isNullOrUndefined(g)){var f=c.cells[n],m=void 0;this.frozenColumns&&(m=h.cells[n-this.frozenColumns]),d.refreshTD(g,t.isNullOrUndefined(f)?m:f,c.data,{index:c.index}),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})),t.isNullOrUndefined(h)||t.isNullOrUndefined(h.changes)||(h.changes[r]=i),this.trigger("queryCellInfo",{cell:g,column:o,data:c.data})}}},o.prototype.setRowData=function(e,r){var i,n=this.contentModule.getRows(),o=this.getPrimaryKeyFieldNames()[0],s=new vt(this.serviceLocator,null,this);this.groupSettings.columns.length>0&&this.aggregates.length>0&&(n=n.filter(function(e){return e.isDataRow})),i=n.filter(function(r){return t.getValue(o,r.data)===e})[0],!t.isNullOrUndefined(i)&&this.element.querySelectorAll("[data-uid="+i.uid+"]").length&&(i.changes=r,te(i,this.getForeignKeyColumns(),i.changes),s.refresh(i,this.getColumns(),!0),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})))},o.prototype.getCellFromIndex=function(e,t){return this.getDataRows()[e]&&this.getDataRows()[e].querySelectorAll(".e-rowcell")[t]},o.prototype.getMovableCellFromIndex=function(e,t){return this.getMovableDataRows()[e]&&this.getMovableDataRows()[e].querySelectorAll(".e-rowcell")[t-this.getFrozenColumns()]},o.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().querySelectorAll(".e-headercell")[e]},o.prototype.getRowObjectFromUID=function(e){var r=this.contentModule.getRows(),i=this.rowObject(r,e);return this.getFrozenColumns()&&!i?i=this.rowObject(this.contentModule.getMovableRows(),e):t.isNullOrUndefined(i)&&this.enableVirtualization&&this.groupSettings.columns.length>0?i=this.rowObject(this.vRows,e):i},o.prototype.rowObject=function(e,t){for(var r=0,i=e;r<i.length;r++){var n=i[r];if(n.uid===t)return n}return null},o.prototype.getRowsObject=function(){return this.contentModule.getRows()},o.prototype.getMovableRowsObject=function(){return this.contentModule.getMovableRows()},o.prototype.getColumnHeaderByField=function(e){return this.getColumnHeaderByUid(this.getColumnByField(e).uid)},o.prototype.getColumnHeaderByUid=function(e){return this.getHeaderContent().querySelector("[e-mappinguid="+e+"]").parentElement},o.prototype.getColumnByIndex=function(e){var t;return this.getColumns().some(function(r,i){return t=r,i===e}),t},o.prototype.getColumnByField=function(e){return C(this.getColumns(),function(t,r){if(t.field===e)return t})[0]},o.prototype.getColumnIndexByField=function(e){for(var t=this.getColumns(),r=0;r<t.length;r++)if(t[r].field===e)return r;return-1},o.prototype.getColumnByUid=function(e){return C(this.getColumns().concat(this.getStackedColumns(this.columns)),function(t,r){if(t.uid===e)return t})[0]},o.prototype.getStackedColumns=function(e,t){void 0===t&&(t=[]);for(var r=0,i=e;r<i.length;r++){var n=i[r];n.columns&&(t.push(n),this.getStackedColumns(n.columns,t))}return t},o.prototype.getColumnIndexByUid=function(e){var r=C(this.getColumns(),function(t,r){if(t.uid===e)return r})[0];return t.isNullOrUndefined(r)?-1:r},o.prototype.getUidByColumnField=function(e){return C(this.getColumns(),function(t,r){if(t.field===e)return t.uid})[0]},o.prototype.getNormalizedColumnIndex=function(e){var r=this.getColumnIndexByUid(e);return this.allowGrouping&&(r+=this.groupSettings.columns.length),this.isDetail()&&r++,this.allowRowDragAndDrop&&t.isNullOrUndefined(this.rowDropSettings.targetID)&&this.allowResizing&&r++,r},o.prototype.getColumnFieldNames=function(){for(var e,t=[],r=0,i=this.getColumns().length;r<i;r++)(e=this.getColumns()[r]).visible&&t.push(e.field);return t},o.prototype.getRowTemplate=function(){return this.rowTemplateFn},o.prototype.getDetailTemplate=function(){return this.detailTemplateFn},o.prototype.getEditTemplate=function(){return this.editTemplateFn},o.prototype.getPrimaryKeyFieldNames=function(){for(var e=[],t=0;t<this.columnModel.length;t++)this.columnModel[t].isPrimaryKey&&e.push(this.columnModel[t].field);return e},o.prototype.refresh=function(){this.headerModule.refreshUI(),this.updateStackedFilter(),this.renderModule.refresh()},o.prototype.refreshHeader=function(){this.headerModule.refreshUI()},o.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},o.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},o.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},o.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},o.prototype.getDataModule=function(){return this.renderModule.data},o.prototype.showColumns=function(e,t){t=t||"headerText",this.showHider.show(e,t)},o.prototype.hideColumns=function(e,t){t=t||"headerText",this.showHider.hide(e,t)},o.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0)},o.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},o.prototype.getVisibleFrozenColumnsCount=function(){for(var e=0,t=this.columns,r=0;r<this.frozenColumns;r++)t[r].visible&&e++;return e},o.prototype.getVisibleFrozenCount=function(e,t){for(var r=0,i=e.length;r<i;r++)e[r].columns?t=this.getVisibleFrozenCount(e[r].columns,t):e[r].isFrozen&&e[r].visible&&t++;return t},o.prototype.getFrozenCount=function(e,t){for(var r=0,i=e.length;r<i;r++)e[r].columns?t=this.getFrozenCount(e[r].columns,t):e[r].isFrozen&&t++;return t},o.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},o.prototype.updateExternalMessage=function(e){this.pagerModule&&this.pagerModule.updateExternalMessage(e)},o.prototype.sortColumn=function(e,t,r){this.sortModule&&this.sortModule.sortColumn(e,t,r)},o.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},o.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},o.prototype.filterByColumn=function(e,t,r,i,n,o,s,l){this.filterModule&&this.filterModule.filterByColumn(e,t,r,i,n,o,s,l)},o.prototype.clearFiltering=function(){this.filterModule&&this.filterModule.clearFiltering()},o.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},o.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},o.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},o.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},o.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},o.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},o.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},o.prototype.print=function(){this.printModule&&this.printModule.print()},o.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},o.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},o.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},o.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},o.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},o.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},o.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},o.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},o.prototype.updateCell=function(e,t,r){this.editModule&&this.editModule.updateCell(e,t,r)},o.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},o.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},o.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},o.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},o.prototype.recalcIndentWidth=function(){var e=this;if(this.getHeaderTable().querySelector(".e-emptycell")&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&!this.getHeaderTable().querySelector(".e-emptycell").getAttribute("indentRefreshed")&&this.getContentTable()){var t=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,r=[].slice.call(this.getHeaderTable().querySelector("colgroup").childNodes),i=[].slice.call(this.getContentTable().querySelector("colgroup").childNodes),n=t/30,o=0,s=function(t,n){r[t].style.width=n+"px",i[t].style.width=n+"px",e.notify("column-width-changed",{index:t,width:n})};for(n>=1&&(t=30/n),(this.enableColumnVirtualization||this.isAutoGen)&&(t=30);o<this.groupSettings.columns.length;)s(o,t),o++;this.isDetail()&&(s(o,t),o++),this.isRowDragable()&&s(o,t),this.isAutoGen=!1,this.getHeaderTable().querySelector(".e-emptycell").setAttribute("indentRefreshed","true")}},o.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},o.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},o.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},o.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},o.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},o.prototype.refreshDataSource=function(e,t){this.notify("refreshdataSource",e)},o.prototype.disableRowDD=function(e){var r=this.getHeaderTable(),i=this.getContentTable(),n=r.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),o=this.getRows(),s=e?"none":"";t.setStyleAttribute(r.querySelector("colgroup").childNodes[0],{display:s}),t.setStyleAttribute(i.querySelector("colgroup").childNodes[0],{display:s});for(var l=0;l<this.getRows().length;l++){d=o[l].firstElementChild;e?t.addClass([d],"e-hide"):t.removeClass([d],["e-hide"])}for(var a=0;a<r.querySelectorAll("th.e-rowdragheader, th.e-mastercell").length;a++){var d=n[a];e?t.addClass([d],"e-hide"):t.removeClass([d],["e-hide"])}},o.prototype.autoFitColumns=function(e){this.resizeModule&&this.resizeModule.autoFitColumns(e)},o.prototype.createColumnchooser=function(e,t,r){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,r)},o.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new rr(this)),this.serviceLocator.register("cellRendererFactory",new Zt),this.serviceLocator.register("rendererFactory",new tr),this.serviceLocator.register("localization",this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new ve(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new yr(this)),this.serviceLocator.register("ariaService",this.ariaService=new Ot),this.serviceLocator.register("focus",this.focusModule=new nr(this))},o.prototype.processModel=function(){var e,r,i=this,n=this.groupSettings.columns,o=this.sortSettings.columns;if(this.allowGrouping)for(var s=this,l=0,a=n.length;l<a;l++)!function(t,i){r=0;for(var l=o.length;r<l;r++)if(o[r].field===n[t]){e=!0;break}if(e?s.allowSorting?s.sortedColumns.push(o[r].field):o[r].direction="Ascending":o.push({field:n[t],direction:"Ascending"}),!s.groupSettings.showGroupedColumn){var a=s.enableColumnVirtualization?s.columns.filter(function(e){return e.field===n[t]})[0]:s.getColumnByField(n[t]);a?a.visible=!1:s.log("initial_action",{moduleName:"group",columnName:n[t]})}}(l);if(n.length||o.forEach(function(e){i.sortedColumns.push(e.field)}),this.rowTemplateFn=b(this.rowTemplate),this.detailTemplateFn=b(this.detailTemplate),this.editTemplateFn=b(this.editSettings.template),!t.isNullOrUndefined(this.parentDetails)){var d=t.isNullOrUndefined(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue;this.query.where(this.queryString,"equal",d,!0)}this.initForeignColumn()},o.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify("initForeignKeyColumn",this.getForeignKeyColumns())},o.prototype.gridRender=function(){this.updateRTL(),this.enableHover&&this.element.classList.add("e-gridhover"),t.Browser.isDevice&&this.element.classList.add("e-device"),this.rowHeight&&this.element.classList.add("e-grid-min-height"),t.classList(this.element,["e-responsive","e-default"],[]);var r=this.serviceLocator.getService("rendererFactory");this.headerModule=r.getRenderer(e.RenderType.Header),this.contentModule=r.getRenderer(e.RenderType.Content),this.printModule=new Lr(this,this.scrollModule),this.clipboardModule=new xr(this),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection()},o.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},o.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},o.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup",styles:"display:none;"}),r=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});t.append([r,this.createElement("div",{className:"e-uptail e-tail"})],e),r.appendChild(this.createElement("span")),t.append([r,this.createElement("div",{className:"e-downtail e-tail"})],e),this.element.appendChild(e)},o.prototype.updateGridLines=function(){switch(t.classList(this.element,[],["e-verticallines","e-horizontallines","e-hidelines","e-bothlines"]),this.gridLines){case"Horizontal":this.element.classList.add("e-horizontallines");break;case"Vertical":this.element.classList.add("e-verticallines");break;case"None":this.element.classList.add("e-hidelines");break;case"Both":this.element.classList.add("e-bothlines")}this.updateResizeLines()},o.prototype.updateResizeLines=function(){this.allowResizing&&"Vertical"!==this.gridLines&&"Both"!==this.gridLines?this.element.classList.add("e-resize-lines"):this.element.classList.remove("e-resize-lines")},o.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.querySelectorAll(".e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":K(this.element,!1),K(this.getContent(),!1),K(e,!0);break;case"Content":K(this.getContent(),!0),K(this.element,!1),K(e,!1);break;default:K(this.element,!0),K(this.getContent(),!1),K(e,!1)}}},o.prototype.removeTextWrap=function(){K(this.element,!1),K([].slice.call(this.element.querySelectorAll(".e-columnheader")),!1),K(this.getContent(),!1)},o.prototype.createTooltip=function(){this.toolTipObj=new i.Tooltip({opensOn:"custom",content:""},this.element)},o.prototype.getTooltipStatus=function(e){var t,r=this.getHeaderTable(),i=(this.getContentTable(),this.createTable(r,"e-gridheader","header")),n=this.createTable(r,"e-gridheader","content"),o=e.classList.contains("e-headercell")?i:n,s=e.classList.contains("e-headercell")?"th":"tr";return o.querySelector(s).className=e.className,o.querySelector(s).innerHTML=e.innerHTML,t=o.querySelector(s).getBoundingClientRect().width,document.body.removeChild(i),document.body.removeChild(n),t>e.getBoundingClientRect().width},o.prototype.mouseMoveHandler=function(e){if(this.isEllipsisTooltip()){var r=O(e.target,"e-ellipsistooltip");this.prevElement===r&&"mouseout"!==e.type||this.toolTipObj.close();var i=e.target.tagName,n=["A","BUTTON","INPUT"];if(r&&"mouseout"!==e.type&&(!t.Browser.isDevice||-1===n.indexOf(i))){if(r.getAttribute("aria-describedby"))return;this.getTooltipStatus(r)&&(r.getElementsByClassName("e-headertext").length?this.toolTipObj.content=r.getElementsByClassName("e-headertext")[0].innerText:this.toolTipObj.content=r.innerText,this.prevElement=r,this.toolTipObj.open(r))}}},o.prototype.isEllipsisTooltip=function(){for(var e=this.getColumns(),t=0;t<e.length;t++)if("EllipsisWithTooltip"===e[t].clipMode)return!0;return!1},o.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},o.prototype.createTable=function(e,t,r){var i=this.createElement("div");i.className=this.element.className,i.style.cssText="display: inline-block;visibility:hidden;position:absolute";var n=this.createElement("div");n.className=t;var o=this.createElement("table");o.className=e.className,o.style.cssText="table-layout: auto;width: auto";var s="header"===r?"th":"td",l=this.createElement("tr"),a=this.createElement(s);return l.appendChild(a),o.appendChild(l),n.appendChild(o),i.appendChild(n),document.body.appendChild(i),i},o.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},o.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"dblclick",this.dblClickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),t.EventHandler.add(this.getContent().firstElementChild,"scroll",this.scrollHandler,this),t.EventHandler.add(this.element,"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(this.element,"mouseout",this.mouseMoveHandler,this),t.EventHandler.add(this.getContent(),"touchstart",this.tapEvent,this)},o.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.mouseClickHandler),t.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"dblclick",this.dblClickHandler),t.EventHandler.remove(this.getContent().firstElementChild,"scroll",this.scrollHandler),t.EventHandler.remove(this.element,"mousemove",this.mouseMoveHandler),t.EventHandler.remove(this.element,"mouseout",this.mouseMoveHandler),t.EventHandler.remove(this.element,"keydown",this.keyPressHandler),t.EventHandler.remove(this.getContent(),"touchstart",this.tapEvent)},o.prototype.addListener=function(){this.isDestroyed||(this.on(Pe,this.dataReady,this),this.on(Ne,this.recalcIndentWidth,this),this.on(Ue,this.recalcIndentWidth,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(Re,this.dataBoundFunction),this.on(Ve,this.onKeyPressed,this),this.on(Ne,this.blazorTemplate,this))},o.prototype.removeListener=function(){this.isDestroyed||(this.off(Pe,this.dataReady),this.off(Ne,this.recalcIndentWidth),this.off(Ue,this.recalcIndentWidth),this.removeEventListener(Re,this.dataBoundFunction),this.off(Ve,this.onKeyPressed))},o.prototype.blazorTemplate=function(){if(t.isBlazor()){for(var e=0;e<this.columnModel.length;e++){if(this.columnModel[e].template&&t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid,"Template",this.columnModel[e],!1),this.columnModel[e].headerTemplate&&t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid+"headerTemplate","HeaderTemplate",this.columnModel[e],!1),"FilterBar"==this.filterSettings.type&&this.columnModel[e].filterTemplate){for(var r=this.columnModel[e].field,i=this.element.id+this.columnModel[e].uid+"filterTemplate",n=this.filterSettings.columns,o=0;o<n.length;o++)r==n[o].field&&(t.blazorTemplates[i][0][r]=n[o].value);t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid+"filterTemplate","FilterTemplate",this.columnModel[e],!1)}"FilterBar"!=this.filterSettings.type&&this.columnModel[e].filterTemplate&&t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid+"filterTemplate","FilterTemplate",this.columnModel[e])}this.groupSettings.captionTemplate&&t.updateBlazorTemplate(this.element.id+"captionTemplate","CaptionTemplate",this.groupSettings);for(o=0;o<this.aggregates.length;o++)for(var s=0;s<this.aggregates[o].columns.length;s++)this.aggregates[o].columns[s].footerTemplate&&t.updateBlazorTemplate(this.element.id+this.aggregates[o].columns[s].guid+"footerTemplate","FooterTemplate",this.aggregates[o].columns[s]),this.aggregates[o].columns[s].groupFooterTemplate&&t.updateBlazorTemplate(this.element.id+this.aggregates[o].columns[s].guid+"groupFooterTemplate","GroupFooterTemplate",this.aggregates[o].columns[s]),this.aggregates[o].columns[s].groupCaptionTemplate&&t.updateBlazorTemplate(this.element.id+this.aggregates[o].columns[s].guid+"groupCaptionTemplate","GroupCaptionTemplate",this.aggregates[o].columns[s])}},o.prototype.getCurrentViewRecords=function(){return se(this)?t.isNullOrUndefined(this.currentViewData.records)?this.currentViewData:this.currentViewData.records:this.allowGrouping&&this.groupSettings.columns.length&&this.currentViewData.length?this.currentViewData.records:this.currentViewData},o.prototype.mouseClickHandler=function(e){this.isChildGrid(e)||O(e.target,"e-gridpopup")&&e.touches||this.element.querySelectorAll(".e-cloneproperties").length||this.checkEdit(e)||(!this.allowRowDragAndDrop&&(O(e.target,"e-gridcontent")||"TD"===e.target.tagName)||!this.allowGrouping&&!this.allowReordering&&O(e.target,"e-gridheader"))&&e.touches||(O(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&e.preventDefault(),this.notify(Ge,e))},o.prototype.checkEdit=function(e){var t=O(e.target,"e-row"),r="Batch"!==this.editSettings.mode&&this.isEdit&&t&&(t.classList.contains("e-editedrow")||t.classList.contains("e-addedrow"));return!O(e.target,"e-unboundcelldiv")&&(r||O(e.target,"e-rowcell")&&O(e.target,"e-rowcell").classList.contains("e-editedbatchcell"))},o.prototype.dblClickHandler=function(e){var r=O(e.target,"e-grid");if(!t.isNullOrUndefined(r)&&r.id===this.element.id&&!t.closest(e.target,".e-unboundcelldiv")){var i=!1,n=t.closest(e.target,"tr");if(n&&n.getAttribute("data-uid")){var o=this.getRowObjectFromUID(n.getAttribute("data-uid"));i=!!o&&o.isDataRow}var s=this.getRowInfo(e.target);s.target=e.target,i&&this.trigger("recordDoubleClick",s),this.notify("dblclick",e)}},o.prototype.focusOutHandler=function(e){if(!this.isChildGrid(e)){O(e.target,"e-grid")||(this.element.querySelector(".e-gridpopup").style.display="None");var r=this.element.querySelector(".e-cancel:not(.e-hide)");r&&r.classList.add("e-hide");var i=e.relatedTarget,n=i?i.getAttribute("aria-owns"):null;i&&(O(i,"e-grid")||(!t.isNullOrUndefined(n)&&n)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||t.Browser.isDevice||("Batch"===this.editSettings.mode&&(this.editModule.saveCell(),this.notify("editNextValCell",{})),"Normal"===this.editSettings.mode&&this.editModule.editFormValidate()),this.keyPress=!1}},o.prototype.isChildGrid=function(e){var t=O(e.target,"e-grid");return!(!t||t.id===this.element.id)},o.prototype.mergePersistGridData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);if(!t.isNullOrUndefined(e)&&""!==e){var r=JSON.parse(e);this.enableVirtualization&&(r.pageSettings.currentPage=1);var i=Object.keys(r);this.isProtectedOnChange=!0;for(var n=0,o=i;n<o.length;n++){var s=o[n];"object"!=typeof this[s]||t.isNullOrUndefined(this[s])?this[s]=r[s]:Array.isArray(this[s])&&"columns"===s?(R(this[s]),this.mergeColumns(r[s],this[s]),this[s]=r[s]):t.extend(this[s],r[s])}this.isProtectedOnChange=!1}},o.prototype.mergeColumns=function(e,r){var i=this;e.forEach(function(e,n,o){var s=r.filter(function(t){return t.index===e.index})[0];if(!t.isNullOrUndefined(s))if(s.columns&&s.columns.length)i.mergeColumns(e.columns,s.columns),o[n]=t.extend(s,e,!0);else{if(t.isBlazor()){e.guid=s.guid}o[n]=t.extend(s,e,!0)}})},o.prototype.isDetail=function(){return!t.isNullOrUndefined(this.detailTemplate)||!t.isNullOrUndefined(this.childGrid)},o.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},o.prototype.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},o.prototype.keyPressHandler=function(e){var r=t.extend(e,{cancel:!1});this.trigger("keyPressed",r),!0===r.cancel&&e.stopImmediatePropagation()},o.prototype.keyActionHandler=function(e){this.keyPress="space"!==e.action,this.isChildGrid(e)||this.isEdit&&"escape"!==e.action&&"enter"!==e.action&&"shiftEnter"!==e.action&&"tab"!==e.action&&"shiftTab"!==e.action||this.allowKeyboard&&("ctrlPlusP"===e.action&&(e.preventDefault(),this.print()),this.notify(Ve,e))},o.prototype.setInjectedModules=function(e){this.injectedModules=e},o.prototype.updateColumnObject=function(){E(this.columns,this.enableColumnVirtualization),R(this.columns),this.initForeignColumn(),this.notify(tt,{})},o.prototype.getForeignKeyColumns=function(){return this.getColumns().filter(function(e){return e.isForeignColumn()})},o.prototype.getRowHeight=function(){return this.rowHeight?this.rowHeight:H(this.element)},o.prototype.refreshColumns=function(){var e=this.getContent().querySelector(".e-frozencontent");1===this.getFrozenColumns()&&!e||0===this.getFrozenColumns()&&e?this.freezeRefresh():(this.isPreventScrollEvent=!0,this.updateColumnObject(),this.checkLockColumns(this.getColumns()),this.refresh())},o.prototype.excelExport=function(e,t,r,i){return this.excelExportModule?this.excelExportModule.Map(this,e,t,r,!1,i):null},o.prototype.csvExport=function(e,t,r,i){return this.excelExportModule?this.excelExportModule.Map(this,e,t,r,!0,i):null},o.prototype.pdfExport=function(e,t,r,i){return this.pdfExportModule?this.pdfExportModule.Map(this,e,t,r,i):null},o.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},o.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},o.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},o.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},o.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},o.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},o.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},o.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},o.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},o.prototype.clearRowSelection=function(){this.selectionModule&&this.selectionModule.clearRowSelection()},o.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},o.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},o.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},o.prototype.ensureModuleInjected=function(e){return this.getInjectedModules().indexOf(e)>=0},o.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},o.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.log(e,t)},o.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},o.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},o.prototype.hideScroll=function(){var e=this.getContent().querySelector(".e-content"),t=e.querySelector(".e-movablecontent")?e.querySelector(".e-movablecontent"):e,r=e.querySelector(".e-frozencontent")?e.querySelector(".e-frozencontent"):e;t.scrollHeight<=t.clientHeight&&r.scrollHeight<=r.clientHeight&&(this.scrollModule.removePadding(),t.style.overflowY="auto"),this.frozenColumns&&t.scrollWidth<=t.clientWidth&&(t.style.overflowX="auto",t.style.overflowY="auto",this.notify("frozenHeight",0))},o.prototype.getRowIndexByPrimaryKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[t]:e;for(var r=0;r<this.getRowsObject().length;r++)if(this.getRowsObject()[r].data[t]===e)return this.getRowsObject()[r].index;return-1},o.prototype.grabColumnByFieldFromAllCols=function(e){var t;return this.columnModel=[],this.updateColumnModel(this.columns),this.columnModel.forEach(function(r){e===r.field&&(t=r)}),t},o.prototype.grabColumnByUidFromAllCols=function(e){var t;return this.columnModel=[],this.updateColumnModel(this.columns),this.columnModel.forEach(function(r){e===r.uid&&(t=r)}),t},o.prototype.getUserAgent=function(){var e=t.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},o.prototype.tapEvent=function(t){this.getUserAgent()&&(e.Global.timer?(clearTimeout(e.Global.timer),e.Global.timer=null,this.dblClickHandler(t),this.notify("double-tap",t)):e.Global.timer=setTimeout(function(){e.Global.timer=null},300))};var s;return Er([t.Property([])],o.prototype,"columns",void 0),Er([t.Property(!0)],o.prototype,"enableAltRow",void 0),Er([t.Property(!0)],o.prototype,"enableHover",void 0),Er([t.Property(!1)],o.prototype,"enableAutoFill",void 0),Er([t.Property(!0)],o.prototype,"allowKeyboard",void 0),Er([t.Property(!1)],o.prototype,"allowTextWrap",void 0),Er([t.Complex({},Ar)],o.prototype,"textWrapSettings",void 0),Er([t.Property(!1)],o.prototype,"allowPaging",void 0),Er([t.Complex({},ur)],o.prototype,"pageSettings",void 0),Er([t.Property(!1)],o.prototype,"enableVirtualization",void 0),Er([t.Property(!1)],o.prototype,"enableColumnVirtualization",void 0),Er([t.Complex({},kr)],o.prototype,"searchSettings",void 0),Er([t.Property(!1)],o.prototype,"allowSorting",void 0),Er([t.Property(!0)],o.prototype,"allowMultiSorting",void 0),Er([t.Property(!1)],o.prototype,"allowExcelExport",void 0),Er([t.Property(!1)],o.prototype,"allowPdfExport",void 0),Er([t.Complex({},Dr)],o.prototype,"sortSettings",void 0),Er([t.Property(!0)],o.prototype,"allowSelection",void 0),Er([t.Property(-1)],o.prototype,"selectedRowIndex",void 0),Er([t.Complex({},Fr)],o.prototype,"selectionSettings",void 0),Er([t.Property(!1)],o.prototype,"allowFiltering",void 0),Er([t.Property(!1)],o.prototype,"allowReordering",void 0),Er([t.Property(!1)],o.prototype,"allowResizing",void 0),Er([t.Property(!1)],o.prototype,"allowRowDragAndDrop",void 0),Er([t.Complex({},Mr)],o.prototype,"rowDropSettings",void 0),Er([t.Complex({},Or)],o.prototype,"filterSettings",void 0),Er([t.Property(!1)],o.prototype,"allowGrouping",void 0),Er([t.Property(!1)],o.prototype,"showColumnMenu",void 0),Er([t.Complex({},Pr)],o.prototype,"groupSettings",void 0),Er([t.Complex({},Nr)],o.prototype,"editSettings",void 0),Er([t.Collection([],Sr)],o.prototype,"aggregates",void 0),Er([t.Property(!1)],o.prototype,"showColumnChooser",void 0),Er([t.Property("auto")],o.prototype,"height",void 0),Er([t.Property("auto")],o.prototype,"width",void 0),Er([t.Property("Default")],o.prototype,"gridLines",void 0),Er([t.Property()],o.prototype,"rowTemplate",void 0),Er([t.Property()],o.prototype,"detailTemplate",void 0),Er([t.Property()],o.prototype,"childGrid",void 0),Er([t.Property()],o.prototype,"queryString",void 0),Er([t.Property("AllPages")],o.prototype,"printMode",void 0),Er([t.Property("Expanded")],o.prototype,"hierarchyPrintMode",void 0),Er([t.Property([])],o.prototype,"dataSource",void 0),Er([t.Property(null)],o.prototype,"rowHeight",void 0),Er([t.Property()],o.prototype,"query",void 0),Er([t.Property("USD")],o.prototype,"currencyCode",void 0),Er([t.Property()],o.prototype,"toolbar",void 0),Er([t.Property()],o.prototype,"contextMenuItems",void 0),Er([t.Property()],o.prototype,"columnMenuItems",void 0),Er([t.Property()],o.prototype,"toolbarTemplate",void 0),Er([t.Property()],o.prototype,"pagerTemplate",void 0),Er([t.Property(0)],o.prototype,"frozenRows",void 0),Er([t.Property(0)],o.prototype,"frozenColumns",void 0),Er([t.Property("All")],o.prototype,"columnQueryMode",void 0),Er([t.Event()],o.prototype,"created",void 0),Er([t.Event()],o.prototype,"destroyed",void 0),Er([t.Event()],o.prototype,"load",void 0),Er([t.Event()],o.prototype,"rowDataBound",void 0),Er([t.Event()],o.prototype,"queryCellInfo",void 0),Er([t.Event()],o.prototype,"headerCellInfo",void 0),Er([t.Event()],o.prototype,"actionBegin",void 0),Er([t.Event()],o.prototype,"actionComplete",void 0),Er([t.Event()],o.prototype,"actionFailure",void 0),Er([t.Event()],o.prototype,"dataBound",void 0),Er([t.Event()],o.prototype,"recordDoubleClick",void 0),Er([t.Event()],o.prototype,"rowSelecting",void 0),Er([t.Event()],o.prototype,"rowSelected",void 0),Er([t.Event()],o.prototype,"rowDeselecting",void 0),Er([t.Event()],o.prototype,"rowDeselected",void 0),Er([t.Event()],o.prototype,"cellSelecting",void 0),Er([t.Event()],o.prototype,"cellSelected",void 0),Er([t.Event()],o.prototype,"cellDeselecting",void 0),Er([t.Event()],o.prototype,"cellDeselected",void 0),Er([t.Event()],o.prototype,"columnDragStart",void 0),Er([t.Event()],o.prototype,"columnDrag",void 0),Er([t.Event()],o.prototype,"columnDrop",void 0),Er([t.Event()],o.prototype,"printComplete",void 0),Er([t.Event()],o.prototype,"beforePrint",void 0),Er([t.Event()],o.prototype,"pdfQueryCellInfo",void 0),Er([t.Event()],o.prototype,"pdfHeaderQueryCellInfo",void 0),Er([t.Event()],o.prototype,"exportDetailDataBound",void 0),Er([t.Event()],o.prototype,"excelQueryCellInfo",void 0),Er([t.Event()],o.prototype,"excelHeaderQueryCellInfo",void 0),Er([t.Event()],o.prototype,"beforeExcelExport",void 0),Er([t.Event()],o.prototype,"excelExportComplete",void 0),Er([t.Event()],o.prototype,"beforePdfExport",void 0),Er([t.Event()],o.prototype,"pdfExportComplete",void 0),Er([t.Event()],o.prototype,"rowDragStartHelper",void 0),Er([t.Event()],o.prototype,"detailDataBound",void 0),Er([t.Event()],o.prototype,"rowDragStart",void 0),Er([t.Event()],o.prototype,"rowDrag",void 0),Er([t.Event()],o.prototype,"rowDrop",void 0),Er([t.Event()],o.prototype,"toolbarClick",void 0),Er([t.Event()],o.prototype,"beforeOpenColumnChooser",void 0),Er([t.Event()],o.prototype,"batchAdd",void 0),Er([t.Event()],o.prototype,"batchDelete",void 0),Er([t.Event()],o.prototype,"batchCancel",void 0),Er([t.Event()],o.prototype,"beforeBatchAdd",void 0),Er([t.Event()],o.prototype,"beforeBatchDelete",void 0),Er([t.Event()],o.prototype,"beforeBatchSave",void 0),Er([t.Event()],o.prototype,"beginEdit",void 0),Er([t.Event()],o.prototype,"commandClick",void 0),Er([t.Event()],o.prototype,"cellEdit",void 0),Er([t.Event()],o.prototype,"cellSave",void 0),Er([t.Event()],o.prototype,"cellSaved",void 0),Er([t.Event()],o.prototype,"resizeStart",void 0),Er([t.Event()],o.prototype,"resizing",void 0),Er([t.Event()],o.prototype,"resizeStop",void 0),Er([t.Event()],o.prototype,"keyPressed",void 0),Er([t.Event()],o.prototype,"beforeDataBound",void 0),Er([t.Event()],o.prototype,"contextMenuOpen",void 0),Er([t.Event()],o.prototype,"contextMenuClick",void 0),Er([t.Event()],o.prototype,"columnMenuOpen",void 0),Er([t.Event()],o.prototype,"columnMenuClick",void 0),Er([t.Event()],o.prototype,"checkBoxChange",void 0),Er([t.Event()],o.prototype,"beforeCopy",void 0),Er([t.Event()],o.prototype,"beforePaste",void 0),Er([t.Event()],o.prototype,"dataStateChange",void 0),Er([t.Event()],o.prototype,"dataSourceChanged",void 0),o=s=Er([t.NotifyPropertyChanges],o)}(t.Component),Lr=function(){function e(e,t){this.isAsyncPrint=!1,this.defered=new r.Deferred,this.parent=e,this.parent.isDestroyed||(this.parent.on(Ne,this.isContentReady(),this),this.parent.addEventListener(Se,this.actionBegin.bind(this)),this.parent.on(Le,this.onEmpty.bind(this)),this.parent.on(lt,this.hierarchyPrint,this),this.scrollModule=t)}return e.prototype.isContentReady=function(){var e=this;return!this.isPrintGrid()||"None"!==this.parent.hierarchyPrintMode&&this.parent.childGrid?function(){e.defered.promise.then(function(){e.contentReady()}),e.isPrintGrid()&&e.hierarchyPrint()}:this.contentReady},e.prototype.hierarchyPrint=function(){this.removeColGroup(this.parent);var e=window.printGridObj;e&&!e.element.querySelector("[aria-busy=true")&&e.printModule.defered.resolve()},e.prototype.print=function(){this.renderPrintGrid(),this.printWind=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight)},e.prototype.onEmpty=function(){this.isPrintGrid()&&this.contentReady()},e.prototype.actionBegin=function(){this.isPrintGrid()&&(this.isAsyncPrint=!0)},e.prototype.renderPrintGrid=function(){var e=this.parent,r=t.createElement("div",{id:this.parent.element.id+"_print",className:e.element.className+" e-print-grid"});document.body.appendChild(r);var i=new Br(ce(e,e.hierarchyPrintMode));i.query=e.getQuery().clone(),window.printGridObj=i,i.isPrinting=!0;var n=i.getInjectedModules(),o=e.getInjectedModules();n&&n.length===o.length||i.setInjectedModules(o),e.notify("printGrid-Init",{element:r,printgrid:i}),this.parent.log("exporting_begin",this.getModuleName()),i.appendTo(r),i.registeredTemplate=this.parent.registeredTemplate,i.trigger=e.trigger},e.prototype.contentReady=function(){if(this.isPrintGrid()){var e=this.parent;if(this.isAsyncPrint)return void this.printGrid();var r={requestType:"print",element:e.element,selectedRows:e.getContentTable().querySelectorAll('tr[aria-selected="true"]'),cancel:!1,hierarchyPrintMode:e.hierarchyPrintMode};if(this.isAsyncPrint||e.trigger("beforePrint",r),r.cancel)return void t.detach(e.element);this.isAsyncPrint||this.printGrid()}},e.prototype.printGrid=function(){var e=this.parent;if("auto"!==e.height){var r=this.scrollModule.getCssProperties(),i=e.element.querySelector(".e-content"),n=e.element.querySelector(".e-gridheader");i.style.height="auto",i.style.overflowY="auto",n.style[r.padding]="",n.firstElementChild.style[r.border]=""}e.allowGrouping&&(e.groupSettings.columns.length?this.removeColGroup(e):e.element.querySelector(".e-groupdroparea").style.display="none");for(var o=0,s=[].slice.call(e.element.querySelectorAll(".e-content"));o<s.length;o++)(c=s[o]).style.overflowX="hidden";for(var l=e.element.querySelectorAll(".e-spin-show"),a=0,d=[].slice.call(l);a<d.length;a++){var c=d[a];t.classList(c,["e-spin-hide"],["e-spin-show"])}this.printGridElement(e),e.isPrinting=!1,delete window.printGridObj;var h={element:e.element};e.trigger("printComplete",h),this.parent.log("exporting_complete",this.getModuleName())},e.prototype.printGridElement=function(e){t.classList(e.element,["e-print-grid-layout"],["e-print-grid"]),e.isPrinting&&t.detach(e.element),this.printWind=t.print(e.element,this.printWind)},e.prototype.removeColGroup=function(e){var t=e.groupSettings.columns.length,r=e.element,i="#"+e.element.id;if(t){for(var n=r.querySelectorAll(i+"captioncell.e-groupcaption"),o=n[t-1].getAttribute("colspan"),s=0;s<n.length;s++)n[s].setAttribute("colspan",o);var l=r.querySelectorAll("colgroup"+i+"colGroup"),a=r.querySelector(".e-content").querySelectorAll("colgroup");this.hideColGroup(l,t),this.hideColGroup(a,t)}},e.prototype.hideColGroup=function(e,t){for(var r=0;r<e.length;r++)for(var i=0;i<t;i++)e[r].childNodes[i].style.display="none"},e.prototype.isPrintGrid=function(){return this.parent.element.id.indexOf("_print")>0&&this.parent.isPrinting},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Ne,this.contentReady.bind(this)),this.parent.removeEventListener(Se,this.actionBegin.bind(this)),this.parent.off(Le,this.onEmpty.bind(this)),this.parent.off(lt,this.hierarchyPrint))},e.prototype.getModuleName=function(){return"print"},e.printGridProp=["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings"].concat(["beforePrint","printComplete"]),e}(),qr=0,zr=0,Hr=null;!function(e){e.timer=null}(e.Global||(e.Global={}));var Ur=function(){function e(e,i){this.existingPredicate={},this.foreignKeyQuery=new r.Query,this.filterState=!0,this.values={},this.renderEmpty=!1,this.parent=e,this.id=this.parent.element.id,this.filterSettings=i,this.valueFormatter=new ve(this.parent.locale),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){this.closeDialog()},e.prototype.wireEvents=function(){t.EventHandler.add(this.dlg,"click",this.clickHandler,this),this.searchHandler=t.debounce(this.searchBoxKeyUp,200),t.EventHandler.add(this.dlg.querySelector(".e-searchinput"),"keyup",this.searchHandler,this)},e.prototype.unWireEvents=function(){t.EventHandler.remove(this.dlg,"click",this.clickHandler);var e=this.dlg.querySelector(".e-searchinput");e&&t.EventHandler.remove(e,"keyup",this.searchHandler)},e.prototype.foreignKeyFilter=function(e,t,r){var i=this,n={},o=[],s=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(s.where(r)).then(function(r){i.options.column.columnData=r.result,i.parent.notify("generateQuery",{predicate:n,column:i.options.column}),e.ejpredicate=n.predicate.predicates,n.predicate.predicates.forEach(function(e){o.push({field:e.field,predicate:"or",matchCase:e.ignoreCase,ignoreAccent:e.ignoreAccent,operator:e.operator,value:e.value,type:i.options.type})}),e.filterCollection=o.length?o:t.filter(function(e){return e.field=i.options.field}),i.options.handler(e)})},e.prototype.foreignFilter=function(e,t){var i=this.parent.getDataModule().isRemote()?"string"===this.options.column.type?"contains":"equal":this.options.column.type?"startswith":"contains",n=new r.Predicate(this.options.column.foreignKeyValue,i,t,!0,this.parent.filterSettings.ignoreAccent);this.foreignKeyFilter(e,[e.filterCollection],n)},e.prototype.searchBoxClick=function(e){e.target.classList.contains("e-searchclear")&&(this.sInput.value="",this.refreshCheckboxes(),this.updateSearchIcon(),this.sInput.focus())},e.prototype.searchBoxKeyUp=function(e){this.refreshCheckboxes(),this.updateSearchIcon()},e.prototype.updateSearchIcon=function(){this.sInput.value.length?t.classList(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]):t.classList(this.sIcon,["e-search-icon"],["e-chkcancel-icon"])},e.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},e.prototype.updateDataSource=function(){var e=this.options.dataSource;if(!(e instanceof r.DataManager))for(var t=0;t<e.length;t++)if("object"!=typeof e){var i={};i[this.options.field]=e[t],e[t]=i}},e.prototype.updateModel=function(e){this.options=e,this.existingPredicate=e.actualPredicate||{},this.options.dataSource=e.dataSource,this.updateDataSource(),this.options.type=e.type,this.options.format=e.format||"",this.options.filteredColumns=e.filteredColumns||this.parent.filterSettings.columns,this.options.sortedColumns=e.sortedColumns||this.parent.sortSettings.columns,this.options.query=e.query||new r.Query,this.options.allowCaseSensitive=e.allowCaseSensitive||!1,this.options.uid=e.column.uid,this.values={},this.localeObj=e.localeObj,this.isFiltered=e.filteredColumns.length},e.prototype.getAndSetChkElem=function(e){if(this.dlg=this.parent.createElement("div",{id:this.id+this.options.type+"_excelDlg",className:"e-checkboxfilter e-filter-popup"}),this.sBox=this.parent.createElement("div",{className:"e-searchcontainer"}),!e.hideSearchbox){this.sInput=this.parent.createElement("input",{id:this.id+"_SearchBox",className:"e-searchinput"}),this.sIcon=this.parent.createElement("span",{className:"e-searchclear e-search-icon e-icons e-input-group-icon",attrs:{type:"text",title:this.getLocalizedLabel("Search")}}),this.searchBox=this.parent.createElement("span",{className:"e-searchbox e-fields"}),this.searchBox.appendChild(this.sInput),this.sBox.appendChild(this.searchBox);var t={element:this.sInput,floatLabelType:"Never",properties:{placeholder:this.getLocalizedLabel("Search")}};o.Input.createInput(t,this.parent.createElement),this.searchBox.querySelector(".e-input-group").appendChild(this.sIcon)}return this.spinner=this.parent.createElement("div",{className:"e-spinner"}),this.cBox=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxList",className:"e-checkboxlist e-fields"}),this.spinner.appendChild(this.cBox),this.sBox.appendChild(this.spinner),this.sBox},e.prototype.showDialog=function(e){var r={requestType:"filterbeforeopen",columnName:this.options.field,columnType:this.options.type,cancel:!1};if(!t.isBlazor()||this.parent.isJsComponent){r.filterModel=this}if(this.parent.notify(ht,r),!r.cancel){this.dialogObj=new i.Dialog({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),width:!t.isNullOrUndefined(O(e.target,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:255,target:this.parent.element,animationSettings:{effect:"None"},buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:"e-flat",content:this.getLocalizedLabel(this.isExcel?"CancelButton":"ClearButton")}}],created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this)});this.dialogObj.isStringTemplate=!0,this.dialogObj.appendTo(this.dlg),this.dialogObj.element.style.maxHeight=this.options.height+"px",this.dialogObj.show(),this.wireEvents(),i.createSpinner({target:this.spinner},this.parent.createElement),i.showSpinner(this.spinner),this.getAllData()}},e.prototype.dialogCreated=function(e){t.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:Y(this.options.target,this.dialogObj,this.parent),this.parent.notify("filterDialogCreated",e)},e.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},e.prototype.closeDialog=function(){this.dialogObj&&!this.dialogObj.isDestroyed&&(this.parent.getColumns().filter(function(e){return e.getFilterItemTemplate()}).length&&this.parent.destroyTemplate(["filterItemTemplate"]),this.parent.notify("filter-menu-close",{field:this.options.field}),this.dialogObj.destroy(),this.unWireEvents(),t.remove(this.dlg),this.dlg=null)},e.prototype.clearFilter=function(){var e={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(pt,e),e.cancel||this.options.handler({action:"clear-filter",field:this.options.field})},e.prototype.btnClick=function(e){if(this.filterState){if("input"===e.target.tagName.toLowerCase()){var t=e.target.value;"boolean"===this.options.column.type&&(void 0!==t&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(t.toLowerCase())?t="true":void 0!==t&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(t.toLowerCase())&&(t="false"));var r={action:"filtering",filterCollection:{field:this.options.field,operator:this.options.isRemote?"string"===this.options.column.type?"contains":"equal":"date"===this.options.column.type||"datetime"===this.options.column.type||"boolean"===this.options.column.type?"equal":"contains",value:t,matchCase:!1,type:this.options.column.type},field:this.options.field};t?this.options.column.isForeignColumn()?this.foreignFilter(r,t):this.options.handler(r):this.closeDialog()}else{var i=e.target.firstChild.textContent.toLowerCase();this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===i?this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===i&&this.clearFilter()}this.closeDialog()}else"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog())},e.prototype.fltrBtnHandler=function(){var e=[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall)")),r="equal",i=this.searchBox.querySelector(".e-searchinput"),n=this.options.allowCaseSensitive,o={field:this.options.field,predicate:"or",uid:this.options.uid,operator:r,type:this.options.type,matchCase:n,ignoreAccent:this.parent.filterSettings.ignoreAccent},s=this.itemsCnt!==e.length&&this.itemsCnt-e.length<e.length;s&&""===i.value&&(r="notequal",e=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),o.predicate="and",o.operator="notequal");var l,a,d=[];if(e.length!==this.itemsCnt||i.value&&""!==i.value){for(var c=0;c<e.length;c++){l=this.values[O(e[c],"e-ftrchk").getAttribute("uid")],a=t.extend({},{value:l},o),l&&!l.toString().length&&(a.operator=s?"notequal":"equal"),""===l||t.isNullOrUndefined(l)?("string"===this.options.type&&d.push({field:o.field,ignoreAccent:o.ignoreAccent,matchCase:o.matchCase,operator:o.operator,predicate:o.predicate,value:""}),d.push({field:o.field,matchCase:o.matchCase,operator:o.operator,predicate:o.predicate,value:null}),d.push({field:o.field,matchCase:o.matchCase,operator:o.operator,predicate:o.predicate,value:void 0})):d.push(a);var h={instance:this,handler:this.fltrBtnHandler,arg1:a.field,arg2:a.predicate,arg3:a.operator,arg4:a.matchCase,arg5:a.ignoreAccent,arg6:a.value,cancel:!1};if(this.parent.notify(pt,h),h.cancel)return}this.initiateFilter(d)}else this.clearFilter()},e.prototype.initiateFilter=function(e){var i,n=e[0];if(!t.isNullOrUndefined(n)){i=n.ejpredicate?n.ejpredicate:new r.Predicate(n.field,n.operator,n.value,!n.matchCase,n.ignoreAccent);for(var o=1;o<e.length;o++)i=void 0!==e[o].ejpredicate?i[e[o].predicate](e[o].ejpredicate):i[e[o].predicate](e[o].field,e[o].operator,e[o].value,!e[o].matchCase,e[o].ignoreAccent);var s={action:"filtering",filterCollection:e,field:this.options.field,ejpredicate:r.Predicate.or(i)};this.options.handler(s)}},e.prototype.refreshCheckboxes=function(){var e=this,n=this.sInput.value,o=this.options.column,s=o.isForeignColumn()?this.foreignKeyQuery.clone():this.options.query.clone(),l=this.options.query.clone();s.queries=[],l.queries=[];var a="string"!==this.options.type&&parseFloat(n)?parseFloat(n):n,d=this.parent.getDataModule().isRemote()?"string"===this.options.type?"contains":"equal":this.options.type?"startswith":"contains",c=this.parent.filterSettings.ignoreAccent,h=o.isForeignColumn()?o.foreignKeyValue:o.field;a=""===a||void 0===a?void 0:a;var p;"boolean"===this.options.type&&(void 0!==a&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(a.toLowerCase())?(this.parent.getDataModule().dataManager.adaptor.getModuleName(),a=!0):void 0!==a&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(a.toLowerCase())&&(this.parent.getDataModule().dataManager.adaptor.getModuleName(),a=!1),d="equal"),this.addDistinct(s);var u={requestType:"filtersearchbegin",filterModel:this,columnName:h,column:o,operator:d,matchCase:!0,ignoreAccent:c,filterChoiceCount:null,query:s};if(this.parent.notify(ht,u),p=new r.Predicate(h,u.operator,a,u.matchCase,u.ignoreAccent),"date"===this.options.type||"datetime"===this.options.type){if(a=this.valueFormatter.fromView(n,this.options.parserFn,this.options.type),d="equal",t.isNullOrUndefined(a)&&n.length)return;p=ne({field:h,operator:d,value:a,matchCase:!0,ignoreAccent:c},this.options.type)}n.length&&s.where(p),u.filterChoiceCount=t.isNullOrUndefined(u.filterChoiceCount)?1e3:u.filterChoiceCount;var g={};i.showSpinner(this.spinner),this.renderEmpty=!1,o.isForeignColumn()&&n.length?o.dataSource.executeQuery(s).then(function(t){var r=e.options.column.columnData;e.options.column.columnData=t.result,e.parent.notify("generateQuery",{predicate:g,column:o}),g.predicate.predicates.length?l.where(g.predicate):e.renderEmpty=!0,e.options.column.columnData=r,l.take(u.filterChoiceCount),e.search(u,l)}):(s.take(u.filterChoiceCount),this.search(u,s))},e.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},e.prototype.getPredicateFromCols=function(t){for(var i=e.getPredicate(t),n=[],o={},s=void 0!==this.parent.getForeignKeyColumns,l=s?this.parent.getForeignKeyColumns():[],a=0,d=Object.keys(i);a<d.length;a++){var c=d[a],h=void 0;s&&this.parent.getColumnByField(c).isForeignColumn()&&(h=ie(c,l)),h?(this.parent.notify("generateQuery",{predicate:o,column:h}),o.predicate.predicates.length&&n.push(r.Predicate.or(o.predicate.predicates))):n.push(i[c])}return n.length&&r.Predicate.and(n)},e.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new r.Query},e.prototype.getAllData=function(){var e=this.getQuery();e.requiresCount(),this.addDistinct(e);var r={requestType:"filterchoicerequest",query:e,filterChoiceCount:null};if(!t.isBlazor()||this.parent.isJsComponent){r.filterModel=this}this.parent.notify(ht,r),r.filterChoiceCount=t.isNullOrUndefined(r.filterChoiceCount)?1e3:r.filterChoiceCount,e.take(r.filterChoiceCount),this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(r,e):this.processDataOperation(e,!0)},e.prototype.addDistinct=function(e){var t=r.DataUtil.distinct(this.options.filteredColumns,"field");return t.indexOf(this.options.column.field)<=-1&&(t=t.concat(this.options.column.field)),e.distinct(t),e},e.prototype.filterEvent=function(e,t){var r=this;this.eventPromise(e,t).promise.then(function(e){r.dataSuccess(e)})},e.prototype.eventPromise=function(e,t){var i;i=this.getStateEventArgument(t);var n=new r.Deferred;return i.dataSource=n.resolve,i.action=e,this.parent.trigger("dataStateChange",i),n},e.prototype.getStateEventArgument=function(e){var t=new r.UrlAdaptor,i=new r.DataManager({url:"",adaptor:new r.UrlAdaptor}),n=t.processQuery(i,e);return JSON.parse(n.data)},e.prototype.processDataOperation=function(e,t){var i=this;this.options.dataSource=this.options.dataSource instanceof r.DataManager?this.options.dataSource:new r.DataManager(this.options.dataSource);var n=[],o=[];this.options.column.isForeignColumn()&&t&&(n.push(this.options.column.dataSource.executeQuery(this.foreignKeyQuery)),o.push(function(e){return i.foreignKeyData=e})),n.push(this.options.dataSource.executeQuery(e)),o.push(this.dataSuccess.bind(this));var s=0;Promise.all(n).then(function(e){e.forEach(function(e){o[s++](e.result)})})},e.prototype.dataSuccess=function(i){this.fullData=i;var n=new r.Query;if(this.parent.searchSettings&&this.parent.searchSettings.key.length){var o=this.parent.searchSettings,s=o.fields.length?o.fields:this.parent.getColumns().map(function(e){return e.field});n.search(o.key,s,o.operator,o.ignoreCase,o.ignoreAccent)}if(this.options.filteredColumns.length){for(var l=[],a=0;a<this.options.filteredColumns.length;a++){var d=this.options.filteredColumns[a];this.options.uid?(d.uid=d.uid||this.parent.getColumnByField(d.field).uid,d.uid!==this.options.uid&&l.push(this.options.filteredColumns[a])):d.field!==this.options.field&&l.push(this.options.filteredColumns[a])}var c=this.getPredicateFromCols(l);c&&n.where(c)}var h=new r.DataManager(this.fullData).executeLocal(n),p=this.options.column;this.filteredData=e.getDistinct(h,this.options.field,p,this.foreignKeyData).records||[],this.processDataSource(null,!0,this.filteredData),this.sInput.focus();var u={requestType:"filterafteropen",columnName:this.options.field,columnType:this.options.type};if(!t.isBlazor()||this.parent.isJsComponent){u.filterModel=this}this.parent.notify("cbox-filter-complete",u)},e.prototype.processDataSource=function(e,t,r){i.showSpinner(this.spinner),this.updateResult(),this.createFilterItems(r,t)},e.prototype.processSearch=function(e){this.processDataOperation(e)},e.prototype.updateResult=function(){this.result={};var e=this.getPredicateFromCols(this.options.filteredColumns),t=new r.Query;e&&t.where(e);for(var i=0,n=new r.DataManager(this.fullData).executeLocal(t);i<n.length;i++){var o=n[i];this.result[le(this.options.field,o)]=!0}},e.prototype.clickHandler=function(e){var t=e.target,r=O(t,"e-checkbox-wrapper");if(O(t,"e-searchbox")&&this.searchBoxClick(e),r){var i=r.querySelector(".e-selectall");i?this.updateAllCBoxes(!i.classList.contains("e-check")):$(r.parentElement),this.updateIndeterminatenBtn(),r.querySelector(".e-chk-hidden").focus()}},e.prototype.updateAllCBoxes=function(e){for(var t=0,r=[].slice.call(this.cBox.querySelectorAll(".e-frame"));t<r.length;t++)ee(r[t],e)},e.prototype.dialogOpen=function(){this.parent.element.classList.contains("e-device")&&(this.dialogObj.element.querySelector(".e-input-group").classList.remove("e-input-focus"),this.dialogObj.element.querySelector(".e-btn").focus())},e.prototype.createCheckbox=function(e,r,i){var n=r?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0),o=n.querySelector(".e-label");return o.innerHTML=!t.isNullOrUndefined(e)&&e.toString().length?e:this.getLocalizedLabel("Blanks"),t.addClass([o],["e-checkboxfiltertext"]),this.options.template&&(o.innerHTML="",B(o,this.options.template(i,this.parent,"filterItemTemplate"))),n},e.prototype.updateIndeterminatenBtn=function(){var e=this.cBox.children.length-1,r=[],i=this.cBox.querySelector(".e-selectall"),n=this.cBox.querySelectorAll(".e-check:not(.e-selectall)").length,o=this.dialogObj.btnObj[0];o.disabled=!1,e===n?r=["e-check"]:n?r=["e-stop"]:(r=["e-uncheck"],o.disabled=!0),this.filterState=!o.disabled,o.dataBind(),t.removeClass([i],["e-check","e-stop","e-uncheck"]),t.addClass([i],r)},e.prototype.createFilterItems=function(e,n){for(var o,s=this.parent.createElement("div"),l=this.dialogObj.btnObj[0],a=-1,d=0;d<e.length;d++){var c=t.getValue("ejValue",e[d]);(""===c||t.isNullOrUndefined(c))&&(a+=1)}if(this.itemsCnt=-1!==a?e.length-a:e.length,e.length&&!this.renderEmpty){var h=this.getLocalizedLabel("SelectAll"),p=this.createCheckbox(h,!1,(o={},o[this.options.field]=h,o)),u=Z(N("cbox"),p,"e-ftrchk");u.querySelector(".e-frame").classList.add("e-selectall"),s.appendChild(u);var g=new r.Predicate("field","equal",this.options.field);this.options.foreignKeyValue&&(g=g.or("field","equal",this.options.foreignKeyValue));for(var f=new r.DataManager(this.options.filteredColumns).executeLocal((new r.Query).where(g)).length,m=void 0,d=0;d<e.length;d++){var y=N("cbox");this.values[y]=t.getValue("ejValue",e[d]);var v=this.valueFormatter.toView(t.getValue(this.options.field,e[d]),this.options.formatFn);if(""===v||t.isNullOrUndefined(v)){if(m)continue;m=!0}var C=this.createCheckbox(v,this.getCheckedState(f,this.values[y]),t.getValue("dataObj",e[d]));s.appendChild(Z(y,C,"e-ftrchk"))}this.cBox.innerHTML="",B(this.cBox,[].slice.call(s.children)),this.updateIndeterminatenBtn(),l.disabled=!1}else s.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",B(this.cBox,[].slice.call(s.children)),l.disabled=!0;this.filterState=!l.disabled,l.dataBind();var w={requestType:"filterchoicerequest",dataSource:this.renderEmpty?[]:e};if(!t.isBlazor()||this.parent.isJsComponent){w.filterModel=this}this.parent.notify("cbox-filter-complete",w),i.hideSpinner(this.spinner)},e.prototype.getCheckedState=function(e,t){return!this.isFiltered||!e||this.result[t]},e.getDistinct=function(e,i,n,o){for(var s,l=e.length,a=[],d={},c=n&&n.isForeignColumn();l--;)if(s=e[l],!((s=le(i,s))in d)){var h={};if(h.ejValue=s,d[s]=!0,c){var p=re(n,{},s,o)[0];t.setValue("foreignKeyData",p,e[l]),s=t.getValue(n.foreignKeyValue,p)}t.setValue(i,t.isNullOrUndefined(s)?null:s,h),t.setValue("dataObj",e[l],h),a.push(h)}return r.DataUtil.group(r.DataUtil.sort(a,i,r.DataUtil.fnAscending),"ejValue")},e.getPredicate=function(t){for(var i=r.DataUtil.distinct(t,"field",!0)||[],n=[],o={},s=0;s<i.length;s++)0!==(n=new r.DataManager(t).executeLocal((new r.Query).where("field","equal",i[s].field))).length&&(o[i[s].field]=e.generatePredicate(n));return o},e.generatePredicate=function(i){var n,o,s=i?i.length:0;(o=e.updateDateFilter(i[0])).ignoreAccent=!t.isNullOrUndefined(o.ignoreAccent)&&o.ignoreAccent,n="date"===o.type||"datetime"===o.type?ne(o,o.type):o.ejpredicate?o.ejpredicate:new r.Predicate(o.field,o.operator,o.value,!e.getCaseValue(o),o.ignoreAccent);for(var l=1;l<s;l++)i[l]=e.updateDateFilter(i[l]),s>2&&l>1&&"or"===i[l].predicate?"date"===i[l].type||"datetime"===i[l].type?n.predicates.push(ne(i[l],i[l].type)):n.predicates.push(new r.Predicate(i[l].field,i[l].operator,i[l].value,!e.getCaseValue(i[l]),i[l].ignoreAccent)):n="date"===i[l].type||"datetime"===i[l].type?n[i[l].predicate](ne(i[l]),i[l].type,i[l].ignoreAccent):i[l].ejpredicate?n[i[l].predicate](i[l].ejpredicate):n[i[l].predicate](i[l].field,i[l].operator,i[l].value,!e.getCaseValue(i[l]),i[l].ignoreAccent);return n||null},e.getCaseValue=function(e){return!!t.isNullOrUndefined(e.matchCase)||e.matchCase},e.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e},e}(),jr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Vr=function(e){function d(t,r,i){var n=e.call(this,t,r)||this;return n.customFilterOperators=i,n.isExcel=!0,n}return jr(d,e),d.prototype.getCMenuDS=function(e,t){var r={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","","CustomFilter"]};r.date=r.number,r.datetime=r.number;for(var i=[],n=0;n<r[e].length;n++)r[e][n].length?t?i.push({text:this.getLocalizedLabel(r[e][n])+"...",iconCss:"e-icons e-icon-check "+(t===r[e][n].toLowerCase()?"":"e-emptyicon")}):i.push({text:this.getLocalizedLabel(r[e][n])+"..."}):i.push({separator:!0});return i},d.prototype.destroy=function(){this.dlg&&(this.unwireExEvents(),e.prototype.destroy.call(this)),this.cmenu&&this.cmenu.parentElement&&t.remove(this.cmenu)},d.prototype.createMenu=function(e,t,r){var i={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"};this.menu=this.parent.createElement("div",{className:"e-contextmenu-wrapper"}),this.parent.enableRtl?this.menu.classList.add("e-rtl"):this.menu.classList.remove("e-rtl");var n=this.parent.createElement("ul"),o=t?"e-excl-filter-icon e-filtered":"e-excl-filter-icon";n.appendChild(this.createMenuElem(this.getLocalizedLabel("ClearFilter"),t?"":"e-disabled",o)),"boolean"!==e&&n.appendChild(this.createMenuElem(this.getLocalizedLabel(i[e]),"e-submenu",r&&this.ensureTextFilter()?"e-icon-check":o+" e-emptyicon",!0)),this.menu.appendChild(n)},d.prototype.createMenuElem=function(e,t,r,i){var n=this.parent.createElement("li",{className:t+" e-menu-item"});return n.innerHTML=e,n.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+r}),n.firstChild),i&&n.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),n},d.prototype.wireExEvents=function(){t.EventHandler.add(this.dlg,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.dlg,"click",this.clickExHandler,this)},d.prototype.unwireExEvents=function(){t.EventHandler.remove(this.dlg,"mouseover",this.hoverHandler),t.EventHandler.remove(this.dlg,"click",this.clickExHandler)},d.prototype.clickExHandler=function(e){var t=O(e.target,"e-menu-item");t&&this.getLocalizedLabel("ClearFilter")===t.innerText.trim()&&(this.clearFilter(),this.closeDialog())},d.prototype.destroyCMenu=function(){this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),t.remove(this.cmenu))},d.prototype.hoverHandler=function(e){var r,i=e.target.querySelector(".e-contextmenu"),n=O(e.target,"e-menu-item"),o=this.menu.querySelector(".e-focused");if(o&&o.classList.remove("e-focused"),n&&(n.classList.add("e-focused"),r=n.classList.contains("e-submenu")),!i){if(!r){var s=this.menu.querySelector(".e-submenu");t.isNullOrUndefined(s)||s.classList.remove("e-selected"),this.isCMenuOpen=!1,this.destroyCMenu()}var l=this.ensureTextFilter();if(!this.isCMenuOpen&&r){n.classList.add("e-selected"),this.isCMenuOpen=!0;var d={items:this.getCMenuDS(this.options.type,l?l.replace(/\s/g,""):void 0),select:this.selectHandler.bind(this),onClose:this.destroyCMenu.bind(this),enableRtl:this.parent.enableRtl,beforeClose:this.preventClose};this.parent.element.appendChild(this.cmenu),this.menuObj=new a.ContextMenu(d,this.cmenu);var c=this.menu.querySelector(".e-submenu").getBoundingClientRect(),h={top:0,left:0};if(t.Browser.isDevice){var p=this.getContextBounds(this.menuObj);h.top=(window.innerHeight-p.height)/2,h.left=(window.innerWidth-p.width)/2,this.closeDialog()}else h.top=t.Browser.isIE?window.pageYOffset+c.top:window.scrollY+c.top,h.left=this.getCMenuYPosition(this.dlg,this.menuObj);this.menuObj.open(h.top,h.left,e.target),this.parent.applyBiggerTheme(this.menuObj.element.parentElement)}}},d.prototype.ensureTextFilter=function(){var e,t=this.existingPredicate[this.options.field];return t&&2===t.length?e="greaterthanorequal"===t[0].operator&&"lessthanorequal"===t[1].operator?"between":"customfilter":t&&1===t.length&&(this.optrData=this.customFilterOperators[this.options.type+"Operator"],e=t[0].operator),e},d.prototype.preventClose=function(e){e.event instanceof MouseEvent&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},d.prototype.getContextBounds=function(e){this.menuObj.element.style.display;return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},d.prototype.getCMenuYPosition=function(e,t){var r=this.getContextBounds(t).width,i=e.getBoundingClientRect(),n=i.right+r-this.parent.element.clientWidth,o=e.offsetWidth-e.clientWidth;return o=o?o+1:0,n<1?i.right+1-o:i.left-r-1+o},d.prototype.openDialog=function(e){var t=this;this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),this.dialogObj.dataBind();var r=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return t.options.field===e.field}).length;this.createMenu(e.type,r>0,1===r||2===r),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),this.dlg.classList.remove("e-checkboxfilter"),this.cmenu=this.parent.createElement("ul",{className:"e-excel-menu"}),this.wireExEvents()},d.prototype.closeDialog=function(){e.prototype.closeDialog.call(this)},d.prototype.selectHandler=function(e){e.item&&(this.menuItem=e.item,this.renderDialogue(e))},d.prototype.renderDialogue=function(e){var r=this,n=e.element,o=this.options.field,s=!t.isNullOrUndefined(o)&&U(o),l=!t.isNullOrUndefined(o)&&j(o),a=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:s?l+"-xlflmenu":o+"-xlflmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:s?l+"-xlfldlg":o+"-xlfldlg"}),this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new i.Dialog({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,closeOnEscape:!1,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){var e=r.dlgObj.element.querySelector("table.e-xlfl-table>tr");r.options.column.filterTemplate?t.isBlazor()?e.querySelector(".e-xlfl-valuediv").children[0].focus():e.querySelector("#"+r.options.column.field+"-xlfl-frstvalue").focus():e.cells[1].querySelector("input:not([type=hidden])").focus()},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,n,o),buttons:[{click:this.filterBtnClick.bind(this,o),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:"e-xlfl-cancelbtn"}}],content:a,width:430,animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv)},d.prototype.removeDialog=function(){if(t.isBlazor())for(var e=this.parent.getColumns(),r=0;r<e.length;r++)if(e[r].filterTemplate){var i=this.parent.element.id+e[r].uid+"filterTemplate";t.updateBlazorTemplate(i,"FilterTemplate",e[r])}this.removeObjects([this.dropOptr,this.datePicker,this.dateTimePicker,this.actObj,this.numericTxtObj,this.dlgObj]),t.remove(this.dlgDiv)},d.prototype.createdDialog=function(e,r){this.renderCustomFilter(e,r),this.dlgObj.element.style.left="0px",this.dlgObj.element.style.top="0px",t.Browser.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify("beforeCustomFilterOpen",{column:r,dialog:this.dialogObj}),this.dlgObj.show(),this.parent.applyBiggerTheme(this.dlgObj.element.parentElement)},d.prototype.renderCustomFilter=function(e,t){var r=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),i=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"});r.appendChild(i);var n=this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"});r.appendChild(n),this.renderFilterUI(t,r)},d.prototype.filterBtnClick=function(e){var r,i=!t.isNullOrUndefined(e)&&U(e),n=!t.isNullOrUndefined(e)&&j(e),o=i?n:e,s=this.parent.getColumnByField(e).filterTemplate&&t.isBlazor()?this.dlgDiv.querySelector(".-xlfl-frstvalue").children[0].querySelector(".e-control").ej2_instances[0]:this.dlgDiv.querySelector("#"+o+"-xlfl-frstvalue").ej2_instances[0],l=this.dlgDiv.querySelector("#"+o+"-xlfl-frstoptr").ej2_instances[0],a=this.parent.getColumnByField(e).filterTemplate&&t.isBlazor()?this.dlgDiv.querySelector(".-xlfl-secndvalue").children[0].querySelector(".e-control").ej2_instances[0]:this.dlgDiv.querySelector("#"+o+"-xlfl-secndvalue").ej2_instances[0],d=this.dlgDiv.querySelector("#"+o+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(r=this.dlgDiv.querySelector("#"+o+"-xlflmtcase").ej2_instances[0].checked);var c=this.dlgDiv.querySelector("#"+o+"e-xlfl-frstpredicate").ej2_instances[0],h=(this.dlgDiv.querySelector("#"+o+"e-xlfl-secndpredicate").ej2_instances[0],c.checked?"and":"or");null===a.value&&(h="or"),this.filterByColumn(this.options.field,l.value,s.value,h,r,this.parent.filterSettings.ignoreAccent,d.value,a.value),this.removeDialog()},d.prototype.filterByColumn=function(e,i,n,o,s,l,a,d){var c,h=this.parent.getColumnByField(e),p=h.isForeignColumn()?h.foreignKeyValue:e,u=[];u.push({field:p,predicate:o,matchCase:s,ignoreAccent:l,operator:i,value:n,type:this.options.type});var g={instance:this,handler:this.filterByColumn,arg1:e,arg2:i,arg3:n,arg4:o,arg5:s,arg6:l,arg7:a,arg8:d,cancel:!1};if(this.parent.notify(pt,g),!g.cancel){c=new r.Predicate(p,i.toLowerCase(),n,!s,l),t.isNullOrUndefined(d)||(a=t.isNullOrUndefined(a)?"equal":a,u.push({field:p,predicate:o,matchCase:s,ignoreAccent:l,operator:a,value:d,type:this.options.type}),c=c[o](p,a.toLowerCase(),d,!s,l));var f={action:"filtering",filterCollection:u,field:this.options.field,ejpredicate:c,actualPredicate:u};h.isForeignColumn()?this.foreignKeyFilter(f,u,c):this.options.handler(f)}},d.prototype.renderOperatorUI=function(e,r,i,n,o){var l=this.parent.createElement("tr",{className:"e-xlfl-fields"});r.appendChild(l);var a=this.parent.createElement("td",{className:"e-xlfl-optr"});l.appendChild(a);var d=this.parent.createElement("div",{className:"e-xlfl-optrdiv"}),c=!t.isNullOrUndefined(e)&&U(e),h=!t.isNullOrUndefined(e)&&j(e),p=this.parent.createElement("input",{id:c?h+i:e+i});d.appendChild(p),a.appendChild(d);var u=this.options.type+"Operator",g=this.customFilterOperators[u];this.optrData=g;var f=this.dropSelectedVal(this.parent.getColumnByField(e),n,o),m="";this.menuItem&&((m=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(f=o?m:void 0),m===this.getLocalizedLabel("Between")&&(f=this.getLocalizedLabel(o?"GreaterThanOrEqual":"LessThanOrEqual")));var y=this.parent.getColumnByField(e);return this.dropOptr=new s.DropDownList(x({dataSource:g,fields:{text:"text",value:"value"},text:f,open:this.dropDownOpen.bind(this),enableRtl:this.parent.enableRtl},y.filter.params)),this.dropOptr.appendTo(p),{fieldElement:l,operator:this.getSelectedValue(f)}},d.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},d.prototype.getSelectedValue=function(e){var i=new r.DataManager(this.optrData).executeLocal((new r.Query).where("text","equal",e));return t.isNullOrUndefined(i[0])?"":i[0].value},d.prototype.dropSelectedVal=function(e,t,r){var i;return i=t&&t.length>0?2===t.length?r?t[0].operator:t[1].operator:r?t[0].operator:void 0:r?e.filter.operator||"equal":void 0,this.getSelectedText(i)},d.prototype.getSelectedText=function(e){var i=new r.DataManager(this.optrData).executeLocal((new r.Query).where("value","equal",e));return t.isNullOrUndefined(i[0])?"":i[0].text},d.prototype.renderFilterUI=function(e,t){var r=this.existingPredicate[e],i=this.parent.createElement("table",{className:"e-xlfl-table"});t.appendChild(i);var n=this.parent.createElement("colGroup");n.innerHTML='<col style="width: 50%"></col><col style="width: 50%"></col>',i.appendChild(n);var o=this.renderOperatorUI(e,i,"-xlfl-frstoptr",r,!0);this.renderFlValueUI(e,o,"-xlfl-frstvalue",r,!0);var s=this.parent.createElement("tr",{className:"e-xlfl-predicate"});i.appendChild(s),this.renderRadioButton(e,s,r),o=this.renderOperatorUI(e,i,"-xlfl-secndoptr",r,!1),this.renderFlValueUI(e,o,"-xlfl-secndvalue",r,!1)},d.prototype.renderRadioButton=function(e,r,i){var o=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}});r.appendChild(o);var s=this.parent.createElement("div",{className:"e-xlfl-radiodiv",attrs:{style:"display: inline-block"}}),l=!t.isNullOrUndefined(e)&&U(e),a=!t.isNullOrUndefined(e)&&j(e),d=this.parent.createElement("input",{id:l?a+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),c=this.parent.createElement("input",{id:l?a+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}});s.appendChild(d),s.appendChild(c),o.appendChild(s),"string"===this.options.type&&this.renderMatchCase(e,r,o,"-xlflmtcase",i);var h=new n.RadioButton({label:this.getLocalizedLabel("AND"),name:"default",cssClass:"e-xlfl-radio-and",checked:!0,enableRtl:this.parent.enableRtl}),p=new n.RadioButton({label:this.getLocalizedLabel("OR"),name:"default",cssClass:"e-xlfl-radio-or",enableRtl:this.parent.enableRtl});"and"===(i&&2===i.length?i[1].predicate:"and")?(h.checked=!0,p.checked=!1):(p.checked=!0,h.checked=!1),h.appendTo(d),p.appendTo(c)},d.prototype.removeObjects=function(e){for(var t=0,r=e;t<r.length;t++){var i=r[t];i&&!i.isDestroyed&&i.destroy()}},d.prototype.renderFlValueUI=function(e,r,i,n,o){var s=this.parent.createElement("td",{className:"e-xlfl-value"});r.fieldElement.appendChild(s);var l=!t.isNullOrUndefined(e)&&U(e),a=!t.isNullOrUndefined(e)&&j(e),d=this.parent.createElement("div",{className:"e-xlfl-valuediv"}),c=this.filterSettings.columns.some(function(t){return e===t.field}),h=this.options.filteredColumns.filter(function(t){return t.field===e});if(this.options.column.filterTemplate){var p={},u=this.parent.getColumnByField(e);c&&i&&(p=this.getExcelFilterData(i,p,u,n,h));var g=this.parent.element.id+u.uid+"filterTemplate";B(d,this.options.column.getFilterTemplate()(p,this.parent,"filterTemplate",g)),t.isBlazor()?(d.children[0].classList.add(i),this.dlgDiv.querySelectorAll(".e-xlfl-value").length>1&&t.updateBlazorTemplate(g,"FilterTemplate",u)):d.children[0].id=l?a+i:e+i,s.appendChild(d)}else{var f=this.parent.createElement("input",{id:l?a+i:e+i});d.appendChild(f),s.appendChild(d);var m=void 0,y=void 0;n&&n.length>0&&(m=(y=2===n.length?o?n[0]:n[1]:o?n[0]:void 0)&&y.operator===r.operator?y.value:void 0),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,e,f,m,this.parent.enableRtl)}},d.prototype.getExcelFilterData=function(e,t,r,i,n){var o="-xlfl-frstvalue"===e?0:1;if("-xlfl-frstvalue"===e||n.length>1){t={column:i instanceof Array?i[o]:i};var s=this.options.column.columnData&&n.length>1?1===this.options.column.columnData.length?0:1:o;t[this.options.field]=r.foreignKeyValue?this.options.column.columnData[s][r.foreignKeyValue]:n[s].value,this.options.foreignKeyValue&&(t[this.options.foreignKeyValue]=this.options.column.columnData[s][r.foreignKeyValue])}return t},d.prototype.renderMatchCase=function(e,r,i,o,s){var l=this.parent.createElement("div",{className:"e-xlfl-matchcasediv",attrs:{style:"display: inline-block"}}),a=!t.isNullOrUndefined(e)&&U(e),d=!t.isNullOrUndefined(e)&&j(e),c=this.parent.createElement("input",{id:a?d+o:e+o,attrs:{type:"checkbox"}});l.appendChild(c),i.appendChild(l);var h=!!(s&&s.length>0)&&(s&&2===s.length?s[1].matchCase:s[0].matchCase);new n.CheckBox({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:h}).appendTo(c)},d.prototype.renderDate=function(e,t,r,i,n){var o=ae(e.format,e.type);this.datePicker=new l.DatePicker(x({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(i)},e.column.filter.params)),this.datePicker.appendTo(r)},d.prototype.renderDateTime=function(e,t,r,i,n){var o=ae(e.format,e.type);this.dateTimePicker=new l.DateTimePicker(x({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(i)},e.column.filter.params)),this.dateTimePicker.appendTo(r)},d.prototype.completeAction=function(e){e.result=J(e.result)},d.prototype.renderNumericTextBox=function(e,t,r,i,n){this.numericTxtObj=new o.NumericTextBox(x({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:n,value:i},e.column.filter.params)),this.numericTxtObj.appendTo(r)},d.prototype.renderAutoComplete=function(e,i,n,o,l){var a=this,d=this.parent.getColumnByField(i),c=d.isForeignColumn(),h=c?d.dataSource:e.dataSource,p={value:c?d.foreignKeyValue:i},u=new s.AutoComplete(x({dataSource:h instanceof r.DataManager?h:new r.DataManager(h),fields:p,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:"e-popup-flmenu",autofill:!0,focus:function(){var r=!t.isNullOrUndefined(i)&&U(i),o=!t.isNullOrUndefined(i)&&j(i),s=r?o:i;u.filterType=a.dlgDiv.querySelector("#"+s+(n.id===s+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,u.ignoreCase="string"!==e.type||!a.dlgDiv.querySelector("#"+s+"-xlflmtcase").ej2_instances[0].checked,u.filterType=t.isNullOrUndefined(u.filterType)?"equal":u.filterType},placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:l,actionComplete:function(e){var r=!t.isNullOrUndefined(i)&&U(i);e.result=e.result.filter(function(e,t,i){return i.map(function(e){return r?a.performComplexDataOperation(u.fields.value,e):e[u.fields.value]}).indexOf(r?a.performComplexDataOperation(u.fields.value,e):e[a.actObj.fields.value])===t})},value:o},d.filter.params));u.appendTo(n),this.actObj=u},d.prototype.performComplexDataOperation=function(e,t){for(var r,i=e.split(".").length,n=e.split("."),o=t,s=0;s<i;s++)o=r=o[n[s]];return r},d}(Ur),Gr=function(){function e(e,t,r,i){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new Ot,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=r,this.focus=i.getService("focus"),this.addEventListener()}return e.prototype.updateModel=function(){var e,t={field:this.columnName,direction:this.direction},r=this.parent.groupSettings.columns,i=!1;if(this.isMultiSort)(e=this.getSortedColsIndexByField(this.columnName))>-1&&this.sortSettings.columns.splice(e,1),this.sortSettings.columns.push(t),this.sortSettings.columns=this.sortSettings.columns;else if(r.length){for(var n=[],o=0,s=r.length;o<s;o++)if(e=this.getSortedColsIndexByField(r[o],n),this.columnName===r[o])i=!0,n.push(t);else{var l=this.getSortColumnFromField(r[o]);n.push({field:l.field,direction:l.direction,isFromGroup:l.isFromGroup})}i||n.push(t),this.sortSettings.columns=n}else this.sortSettings.columns=[t];this.parent.dataBind(),this.lastSortedCol=this.columnName},e.prototype.onActionComplete=function(e){var r=this.isRemove?{requestType:"sorting",type:xe}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:xe};this.isRemove=!1,this.parent.trigger(xe,t.extend(e,r))},e.prototype.sortColumn=function(e,t,r){var i=this.parent;if(!1===this.parent.getColumnByField(e).allowSorting||this.parent.isContextMenuOpen())return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:e});if(i.allowMultiSorting||(r=i.allowMultiSorting),this.isActionPrevent())return void i.notify(it,{instance:this,handler:this.sortColumn,arg1:e,arg2:t,arg3:r});this.backupSettings(),this.columnName=e,this.direction=t,this.isMultiSort=r,this.removeSortIcons();i.getColumnHeaderByField(e);this.updateSortedCols(e,r),this.updateModel()},e.prototype.backupSettings=function(){this.lastSortedCols=w(this.sortSettings.columns),this.lastCols=this.sortedColumns},e.prototype.restoreSettings=function(){this.isModelChanged=!1,this.isMultiSort=!0,this.parent.setProperties({sortSettings:{columns:this.lastSortedCols}},!0),this.sortedColumns=this.lastCols,this.isModelChanged=!0},e.prototype.updateSortedCols=function(e,t){if(!t)if(this.parent.allowGrouping)for(var r=0,i=this.sortedColumns.length;r<i;r++)this.parent.groupSettings.columns.indexOf(this.sortedColumns[r])<0&&(this.sortedColumns.splice(r,1),i--,r--);else this.sortedColumns.splice(0,this.sortedColumns.length);this.sortedColumns.indexOf(e)<0&&this.sortedColumns.push(e)},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){if(this.contentRefresh){var t=this.sortSettings.columns.length?{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:Se,target:this.currentTarget}:{requestType:"sorting",type:Se,cancel:!1,target:this.currentTarget};this.parent.notify(ze,t)}this.refreshSortSettings(),this.removeSortIcons(),this.addSortIcons()}},e.prototype.refreshSortSettings=function(){var e=this;this.sortedColumns.length=0,this.sortSettings.columns.forEach(function(t){t.isFromGroup||e.sortedColumns.push(t.field)})},e.prototype.clearSorting=function(){var e=M(this.sortSettings.columns);if(this.isActionPrevent())return void this.parent.notify(it,{instance:this,handler:this.clearSorting});for(var t=0,r=e.length;t<r;t++)this.removeSortColumn(e[t].field)},e.prototype.isActionPrevent=function(){return _(this.parent)},e.prototype.removeSortColumn=function(e){var t=this.parent,r=this.sortSettings.columns;if(!(this.sortedColumns.indexOf(e)<0)){if(this.isActionPrevent())return void this.parent.notify(it,{instance:this,handler:this.removeSortColumn,arg1:e});this.backupSettings(),this.removeSortIcons();for(var i=0,n=r.length;i<n;i++)if(r[i].field===e){if(t.allowGrouping&&t.groupSettings.columns.indexOf(r[i].field)>-1)continue;this.sortedColumns.splice(this.sortedColumns.indexOf(r[i].field),1),r.splice(i,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify(ze,{requestType:"sorting",type:Se,target:this.currentTarget});break}this.addSortIcons()}},e.prototype.getSortedColsIndexByField=function(e,t){for(var r=t||this.sortSettings.columns,i=0,n=r.length;i<n;i++)if(r[i].field===e)return i;return-1},e.prototype.getModuleName=function(){return"sort"},e.prototype.initialEnd=function(){if(this.parent.off(Ne,this.initialEnd),this.parent.getColumns().length&&this.sortSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.isMultiSort=this.sortSettings.columns.length>1;for(var t=0,r=e.sortSettings.columns.slice();t<r.length;t++){var i=r[t];this.sortedColumns.indexOf(i.field)>-1&&this.sortColumn(i.field,i.direction,!0)}this.isMultiSort=!1,this.contentRefresh=!0}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ne,this.initialEnd,this),this.parent.on("sorting-complete",this.onActionComplete,this),this.parent.on(qe,this.onPropertyChanged,this),this.parent.on(Ge,this.clickHandler,this),this.parent.on(Ue,this.refreshSortIcons,this),this.parent.on(Ve,this.keyPressed,this),this.parent.on("cancel-Begin",this.cancelBeginEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("sorting-complete",this.onActionComplete),this.parent.off(qe,this.onPropertyChanged),this.parent.off(Ge,this.clickHandler),this.parent.off(Ue,this.refreshSortIcons),this.parent.off(Ve,this.keyPressed),this.parent.off("cancel-Begin",this.cancelBeginEvent))},e.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.element.querySelector(".e-gridpopup").querySelectorAll(".e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||this.clearSorting(),this.isModelChanged=!0,this.removeEventListener())},e.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},e.prototype.clickHandler=function(e){this.currentTarget=null,this.popUpClickHandler(e);var r=t.closest(e.target,".e-headercell");if(r&&!e.target.classList.contains("e-grptogglebtn")&&!e.target.classList.contains("e-stackedheadercell")&&!e.target.classList.contains("e-stackedheadercelldiv")&&!r.classList.contains("e-resized")&&!e.target.classList.contains("e-rhandler")&&!e.target.classList.contains("e-columnmenu")&&!e.target.classList.contains("e-filtermenudiv")){var i=this.parent.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));r.querySelectorAll(".e-ascending").length;"checkbox"!==i.type&&(this.initiateSort(r,e,i),t.Browser.isDevice&&this.showPopUp(e))}r&&r.classList.remove("e-resized")},e.prototype.keyPressed=function(e){var r=e.target;if(!this.parent.isEdit&&("enter"===e.action||"ctrlEnter"===e.action||"shiftEnter"===e.action)&&t.closest(r,".e-headercell")){var i=this.focus.getFocusedElement();if(t.isNullOrUndefined(i)||!i.classList.contains("e-headercell")||!i.querySelector(".e-headercelldiv"))return;var n=this.parent.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));this.initiateSort(i,e,n)}},e.prototype.initiateSort=function(e,t,r){var i=this.parent,n=r.field;this.currentTarget=t.target;var o=e.querySelectorAll(".e-ascending").length?"Descending":"Ascending";t.shiftKey||this.sortSettings.allowUnsort&&e.querySelectorAll(".e-descending").length&&!(i.groupSettings.columns.indexOf(n)>-1)?this.removeSortColumn(n):this.sortColumn(n,o,t.ctrlKey||this.enableSortMultiTouch)},e.prototype.showPopUp=function(e){var r=t.closest(e.target,".e-headercell");t.isNullOrUndefined(r)&&!this.parent.isContextMenuOpen()||T(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(this.sortedColumns.length>1?" e-spanclicked":""))},e.prototype.popUpClickHandler=function(e){var r=e.target;t.closest(r,".e-headercell")||e.target.classList.contains("e-rowcell")||t.closest(r,".e-gridpopup")?r.classList.contains("e-sortdirect")&&(r.classList.contains("e-spanclicked")?(r.classList.remove("e-spanclicked"),this.enableSortMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(r.classList.add("e-spanclicked"),this.enableSortMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},e.prototype.addSortIcons=function(){for(var e,r,i=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=0,l=n.length;s<l;s++)-1!==o.indexOf(n[s].field)&&(e=i.getColumnHeaderByField(n[s].field),this.aria.setSort(e,n[s].direction),this.isMultiSort&&n.length>1&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(s+1).toString()}),e.querySelector(".e-headertext")),r=e.querySelector(".e-sortfilterdiv"),"Ascending"===n[s].direction?t.classList(r,["e-ascending","e-icon-ascending"],[]):t.classList(r,["e-descending","e-icon-descending"],[]))},e.prototype.removeSortIcons=function(e){for(var r,i=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=e||0,l=t.isNullOrUndefined(e)?n.length:e+1;s<l;s++)r=i.getColumnHeaderByField(n[s].field),i.allowGrouping&&i.groupSettings.columns.indexOf(n[s].field)>-1&&(t.isNullOrUndefined(r)||!r.querySelector(".e-sortfilterdiv"))||-1!==o.indexOf(n[s].field)&&(this.aria.setSort(r,"none"),t.classList(r.querySelector(".e-sortfilterdiv"),[],["e-descending","e-icon-descending","e-ascending","e-icon-ascending"]),r.querySelector(".e-sortnumber")&&r.querySelector(".e-headercelldiv").removeChild(r.querySelector(".e-sortnumber")))},e.prototype.getSortColumnFromField=function(e){for(var t=0,r=this.sortSettings.columns.length;t<r;t++)if(this.sortSettings.columns[t].field===e)return this.sortSettings.columns[t];return!1},e.prototype.updateAriaAttr=function(){for(var e=this.parent.getColumns().map(function(e){return e.field}),t=0,r=this.sortedColumns;t<r.length;t++){var i=r[t];if(-1!==e.indexOf(i)){var n=this.parent.getColumnHeaderByField(i);this.aria.setSort(n,this.getSortColumnFromField(i).direction)}}},e.prototype.refreshSortIcons=function(e){void 0===e&&(e={args:{isFrozen:!1}}),e.args.isFrozen||(this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr())},e}(),_r=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){this.pagerElement=this.pagerModule.element,this.renderNumericContainer(),this.refreshNumericLinks(),this.wireEvents()},e.prototype.refresh=function(){this.pagerModule.updateTotalPages(),this.links.length&&this.updateLinksHtml(),this.updateStyles()},e.prototype.refreshNumericLinks=function(){var e,r=this.pagerModule,i=r.element.querySelector(".e-numericcontainer"),n=document.createDocumentFragment();i.innerHTML="";for(var o=1;o<=r.pageCount;o++)e=t.createElement("a",{className:"e-link e-numericitem e-spacing e-pager-default",attrs:{role:"link",tabindex:"-1","aria-label":"Goto Page "+o,href:"javascript:void(0);",name:"Goto page"+o}}),r.currentPage===o&&t.classList(e,["e-currentitem","e-active"],["e-pager-default"]),n.appendChild(e);i.appendChild(n),this.links=[].slice.call(i.childNodes)},e.prototype.wireEvents=function(){t.EventHandler.add(this.pagerElement,"click",this.clickHandler,this)},e.prototype.unwireEvents=function(){t.EventHandler.remove(this.pagerModule.element,"click",this.clickHandler)},e.prototype.destroy=function(){this.unwireEvents()},e.prototype.renderNumericContainer=function(){this.element=t.createElement("div",{className:"e-pagercontainer",attrs:{role:"navigation"}}),this.renderFirstNPrev(this.element),this.renderPrevPagerSet(this.element),this.element.appendChild(t.createElement("div",{className:"e-numericcontainer"})),this.renderNextPagerSet(this.element),this.renderNextNLast(this.element),this.pagerModule.element.appendChild(this.element)},e.prototype.renderFirstNPrev=function(e){this.first=t.createElement("div",{className:"e-first e-icons e-icon-first",attrs:{title:this.pagerModule.getLocalizedLabel("firstPageTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}}),this.prev=t.createElement("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:this.pagerModule.getLocalizedLabel("previousPageTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}),t.append([this.first,this.prev],e)},e.prototype.renderPrevPagerSet=function(e){var r=t.createElement("div");this.PP=t.createElement("a",{className:"e-link e-pp e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),role:"link","aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip"),tabindex:"-1",name:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),href:"javascript:void(0);"}}),r.appendChild(this.PP),e.appendChild(r)},e.prototype.renderNextPagerSet=function(e){var r=t.createElement("div");this.NP=t.createElement("a",{className:"e-link e-np e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),role:"link","aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip"),tabindex:"-1",name:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),href:"javascript:void(0);"}}),r.appendChild(this.NP),e.appendChild(r)},e.prototype.renderNextNLast=function(e){this.next=t.createElement("div",{className:"e-next e-icons e-icon-next",attrs:{title:this.pagerModule.getLocalizedLabel("nextPageTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}}),this.last=t.createElement("div",{className:"e-last e-icons e-icon-last",attrs:{title:this.pagerModule.getLocalizedLabel("lastPageTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}),t.append([this.next,this.last],e)},e.prototype.clickHandler=function(e){var r=this.pagerModule,i=e.target;return r.previousPageNo=r.currentPage,i.classList.contains("e-disable")||t.isNullOrUndefined(i.getAttribute("index"))||(r.currentPage=parseInt(i.getAttribute("index"),10),r.dataBind()),!1},e.prototype.updateLinksHtml=function(){var e,r,i=this.pagerModule;i.currentPage=1===i.totalPages?1:i.currentPage,i.currentPage>i.totalPages&&i.totalPages&&(i.currentPage=i.totalPages),e=parseInt((i.currentPage/i.pageCount).toString(),10),i.currentPage%i.pageCount==0&&e>0&&(e-=1);for(var n=0;n<i.pageCount;n++)(r=e*i.pageCount+1+n)<=i.totalPages?(this.links[n].style.display="",this.links[n].setAttribute("index",r.toString()),this.links[n].innerHTML=i.customText?i.customText+r:r.toString(),i.currentPage!==r?this.links[n].classList.add("e-pager-default"):this.links[n].classList.remove("e-pager-default")):(this.links[n].innerHTML=i.customText?i.customText+r:r.toString(),this.links[n].style.display="none"),t.classList(this.links[n],[],["e-currentitem","e-active"]);this.first.setAttribute("index","1"),this.last.setAttribute("index",i.totalPages.toString()),this.prev.setAttribute("index",(i.currentPage-1).toString()),this.next.setAttribute("index",(i.currentPage+1).toString()),this.pagerElement.querySelector(".e-mfirst").setAttribute("index","1"),this.pagerElement.querySelector(".e-mlast").setAttribute("index",i.totalPages.toString()),this.pagerElement.querySelector(".e-mprev").setAttribute("index",(i.currentPage-1).toString()),this.pagerElement.querySelector(".e-mnext").setAttribute("index",(i.currentPage+1).toString()),this.PP.setAttribute("index",(parseInt(this.links[0].getAttribute("index"),10)-i.pageCount).toString()),this.NP.setAttribute("index",(parseInt(this.links[this.links.length-1].getAttribute("index"),10)+1).toString())},e.prototype.updateStyles=function(){this.updateFirstNPrevStyles(),this.updatePrevPagerSetStyles(),this.updateNextPagerSetStyles(),this.updateNextNLastStyles(),this.links.length&&t.classList(this.links[(this.pagerModule.currentPage-1)%this.pagerModule.pageCount],["e-currentitem","e-active"],[])},e.prototype.updateFirstNPrevStyles=function(){var e=["e-firstpage","e-pager-default"],r=["e-firstpagedisabled","e-disable"],i=["e-prevpage","e-pager-default"],n=["e-prevpagedisabled","e-disable"];this.pagerModule.totalPages>0&&this.pagerModule.currentPage>1?(t.classList(this.prev,i,n),t.classList(this.first,e,r),t.classList(this.pagerElement.querySelector(".e-mfirst"),e,r),t.classList(this.pagerElement.querySelector(".e-mprev"),i,n)):(t.classList(this.prev,n,i),t.classList(this.first,r,e),t.classList(this.pagerElement.querySelector(".e-mprev"),n,i),t.classList(this.pagerElement.querySelector(".e-mfirst"),r,e))},e.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount?t.classList(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):t.classList(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},e.prototype.updateNextPagerSetStyles=function(){var e=this.pagerModule,r=this.links[0].innerHTML.replace(e.customText,"");!r.length||!this.links.length||parseInt(r,10)+e.pageCount>e.totalPages?t.classList(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):t.classList(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},e.prototype.updateNextNLastStyles=function(){var e=["e-lastpage","e-pager-default"],r=["e-lastpagedisabled","e-disable"],i=["e-nextpage","e-pager-default"],n=["e-nextpagedisabled","e-disable"],o=this.pagerModule;o.currentPage===o.totalPages||0===o.totalRecordsCount?(t.classList(this.last,r,e),t.classList(this.next,n,i),t.classList(this.pagerElement.querySelector(".e-mlast"),r,e),t.classList(this.pagerElement.querySelector(".e-mnext"),n,i)):(t.classList(this.last,e,r),t.classList(this.next,i,n),t.classList(this.pagerElement.querySelector(".e-mlast"),e,r),t.classList(this.pagerElement.querySelector(".e-mnext"),i,n))},e}(),Kr=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){var e=t.createElement("div",{className:"e-parentmsgbar",attrs:{"aria-label":"Pager Information"}});this.pageNoMsgElem=t.createElement("span",{className:"e-pagenomsg",styles:"textalign:right"}),this.pageCountMsgElem=t.createElement("span",{className:"e-pagecountmsg",styles:"textalign:right"}),t.append([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},e.prototype.refresh=function(){var e=this.pagerModule;this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("currentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel("totalItemsInfo"),[e.totalRecordsCount||0]),this.pageNoMsgElem.parentElement.setAttribute("aria-label",this.pageNoMsgElem.textContent+this.pageCountMsgElem.textContent)},e.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},e.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},e.prototype.destroy=function(){},e.prototype.format=function(e,t){for(var r,i=0;i<t.length;i++)r=new RegExp("\\{"+i+"\\}","gm"),e=e.replace(r,t[i].toString());return e},e}(),Wr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Qr=function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Jr=function(e){function r(t,r){return e.call(this,t,r)||this}return Wr(r,e),r.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this]}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this]}),e},r.prototype.preRender=function(){this.defaultConstants={currentPageInfo:"{0} of {1} pages",totalItemsInfo:"({0} items)",firstPageTooltip:"Go to first page",lastPageTooltip:"Go to last page",nextPageTooltip:"Go to next page",previousPageTooltip:"Go to previous page",nextPagerTooltip:"Go to next pager",previousPagerTooltip:"Go to previous pager",pagerDropDown:"Items per page",pagerAllDropDown:"Items",All:"All"},this.containerModule=new _r(this),this.pagerMessageModule=new Kr(this)},r.prototype.render=function(){this.template?this.pagerTemplate():(this.initLocalization(),this.updateRTL(),this.totalRecordsCount=this.totalRecordsCount||0,this.renderFirstPrevDivForDevice(),this.containerModule.render(),this.enablePagerMessage&&this.pagerMessageModule.render(),this.renderNextLastDivForDevice(),this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.render(),this.addAriaLabel(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render(),this.refresh(),this.trigger("created",{currentPage:this.currentPage,totalRecordsCount:this.totalRecordsCount}))},r.prototype.getPersistData=function(){var e=["currentPage","pageSize"];return this.addOnPersist(e)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.element.innerHTML=""},r.prototype.getModuleName=function(){return"pager"},r.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var r=0,i=Object.keys(e);r<i.length;r++)switch(i[r]){case"currentPage":this.checkGoToPage(e.currentPage,t.currentPage)&&this.currentPageChanged(e,t);break;case"pageSize":case"totalRecordsCount":case"customText":this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.setDropDownValue("value",this.pageSize),e.pageSize!==t.pageSize?(this.pageSize=e.pageSize,this.currentPageChanged(e,t)):this.refresh();break;case"pageSizes":this.checkpagesizes()&&this.pagerdropdownModule&&(this.pagerdropdownModule.destroy(),this.pagerdropdownModule.render()),this.refresh();break;case"template":this.templateFn=this.compile(this.template),this.refresh();break;case"locale":this.initLocalization(),this.refresh();break;case"enableExternalMessage":this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render();break;case"externalMessage":this.externalMessageModule&&this.externalMessageModule.refresh();break;case"enableRtl":this.updateRTL();break;case"enablePagerMessage":this.enablePagerMessage?this.pagerMessageModule.showMessage():this.pagerMessageModule.hideMessage()}}},r.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},r.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.dataBind())},r.prototype.setPageSize=function(e){this.pageSize=e,this.dataBind()},r.prototype.checkpagesizes=function(){return!(!0!==this.pageSizes&&!this.pageSizes.length)},r.prototype.checkGoToPage=function(e,r){return e!==this.currentPage&&(this.previousPageNo=this.currentPage),t.isNullOrUndefined(r)||(this.previousPageNo=r),this.previousPageNo!==e&&e>=1&&e<=this.totalPages},r.prototype.currentPageChanged=function(e,t){if(this.enableQueryString&&this.updateQueryString(this.currentPage),e.currentPage!==t.currentPage||e.pageSize!==t.pageSize){var r={currentPage:this.currentPage,newProp:e,oldProp:t,cancel:!1};this.trigger("click",r),r.cancel||this.refresh()}},r.prototype.pagerTemplate=function(){var e;this.element.classList.add("e-pagertemplate"),this.compile(this.template);var t={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages};e=this.getPagerTemplate()(t),B(this.element,e)},r.prototype.updateTotalPages=function(){this.totalPages=this.totalRecordsCount%this.pageSize==0?this.totalRecordsCount/this.pageSize:parseInt((this.totalRecordsCount/this.pageSize).toString(),10)+1},r.prototype.getPagerTemplate=function(){return this.templateFn},r.prototype.compile=function(e){if(e)try{document.querySelectorAll(e).length&&(this.templateFn=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){this.templateFn=t.compile(e)}},r.prototype.refresh=function(){this.template?(this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate()):(this.updateRTL(),this.containerModule.refresh(),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh())},r.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},r.prototype.initLocalization=function(){this.localeObj=new t.L10n(this.getModuleName(),this.defaultConstants,this.locale)},r.prototype.updateQueryString=function(e){var t=this.getUpdatedURL(window.location.href,"page",e.toString());window.history.pushState({path:t},"",t)},r.prototype.getUpdatedURL=function(e,t,r){var i=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");if(e.match(i))return e.replace(i,"$1"+t+"="+r+"$2");var n="";return-1!==e.indexOf("#")&&(n=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+r+n},r.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}))},r.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}))},r.prototype.addAriaLabel=function(){var e=this,r=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];t.Browser.isDevice||r.forEach(function(t){var r=e.element.querySelector(t);r.setAttribute("aria-label",r.getAttribute("title"))})},Qr([t.Property(!1)],r.prototype,"enableQueryString",void 0),Qr([t.Property(!1)],r.prototype,"enableExternalMessage",void 0),Qr([t.Property(!0)],r.prototype,"enablePagerMessage",void 0),Qr([t.Property(12)],r.prototype,"pageSize",void 0),Qr([t.Property(10)],r.prototype,"pageCount",void 0),Qr([t.Property(1)],r.prototype,"currentPage",void 0),Qr([t.Property()],r.prototype,"totalRecordsCount",void 0),Qr([t.Property()],r.prototype,"externalMessage",void 0),Qr([t.Property(!1)],r.prototype,"pageSizes",void 0),Qr([t.Property()],r.prototype,"template",void 0),Qr([t.Property("")],r.prototype,"customText",void 0),Qr([t.Event()],r.prototype,"click",void 0),Qr([t.Event()],r.prototype,"dropDownChanged",void 0),Qr([t.Event()],r.prototype,"created",void 0),r=Qr([t.NotifyPropertyChanges],r)}(t.Component),Yr=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"pagerdropdown"},e.prototype.render=function(){var e=this.pagerModule;this.pagerDropDownDiv=t.createElement("div",{className:"e-pagesizes"});var r=t.createElement("div",{className:"e-pagerdropdown"}),i=t.createElement("div",{className:"e-pagerconstant"}),n=t.createElement("input",{attrs:{type:"text",tabindex:"1"}});this.pagerCons=t.createElement("span",{className:"e-constant",innerHTML:this.pagerModule.getLocalizedLabel("pagerDropDown")}),r.appendChild(n),i.appendChild(this.pagerCons),this.pagerDropDownDiv.appendChild(r),this.pagerDropDownDiv.appendChild(i),this.pagerModule.element.appendChild(this.pagerDropDownDiv);var o=this.pagerModule.pageSizes,l=o.length?this.convertValue(o):[this.pagerModule.getLocalizedLabel("All"),"5","10","12","20"],a=this.pagerModule.pageSize;this.dropDownListObject=new s.DropDownList({dataSource:l,value:a.toString(),change:this.onChange.bind(this),cssClass:"e-alldrop"}),this.dropDownListObject.appendTo(n),o.length&&(this.dropDownListObject.element.value=this.pagerModule.pageSize.toString()),e.pageSize=a,e.dataBind(),e.trigger("dropDownChanged",{pageSize:a}),this.addEventListener()},e.prototype.onChange=function(e){this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?(this.pagerModule.pageSize=this.pagerModule.totalRecordsCount,this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerAllDropDown"),e.value=this.pagerModule.pageSize,document.getElementsByClassName("e-popup-open e-alldrop").length&&(document.getElementsByClassName("e-popup-open e-alldrop")[0].style.display="none")):(this.pagerModule.pageSize=parseInt(this.dropDownListObject.value,10),this.pagerCons.innerHTML!==this.pagerModule.getLocalizedLabel("pagerDropDown")&&(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerDropDown"))),this.pagerModule.dataBind(),this.pagerModule.trigger("dropDownChanged",{pageSize:parseInt(this.dropDownListObject.value,10)})},e.prototype.beforeValueChange=function(e){if("number"==typeof e.newProp.value){var t=e.newProp.value.toString();e.newProp.value=t}},e.prototype.convertValue=function(e){for(var t=e,r=0;r<t.length;r++)t[r]="number"==typeof t[r]?t[r].toString():t[r];return t},e.prototype.setDropDownValue=function(e,t){this.dropDownListObject&&(this.dropDownListObject[e]=t)},e.prototype.addEventListener=function(){this.dropDownListObject.on("beforeValueChange",this.beforeValueChange,this)},e.prototype.removeEventListener=function(){this.dropDownListObject.off("beforeValueChange",this.beforeValueChange)},e.prototype.destroy=function(e){this.dropDownListObject&&!this.dropDownListObject.isDestroyed&&(this.removeEventListener(),this.dropDownListObject.destroy(),t.remove(this.pagerDropDownDiv))},e}(),Xr=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"externalMessage"},e.prototype.render=function(){this.element=t.createElement("div",{className:"e-pagerexternalmsg",attrs:{"aria-label":"Pager external message"}}),this.pagerModule.element.appendChild(this.element),this.refresh()},e.prototype.refresh=function(){this.pagerModule.externalMessage&&this.pagerModule.externalMessage.toString().length?(this.showMessage(),this.element.innerHTML=this.pagerModule.externalMessage):this.hideMessage()},e.prototype.hideMessage=function(){t.isNullOrUndefined(this.element)||(this.element.style.display="none")},e.prototype.showMessage=function(){this.element.style.display=""},e.prototype.destroy=function(){t.remove(this.element)},e}(),$r=function(){function e(e,t){Jr.Inject(Xr,Yr),this.parent=e,this.pageSettings=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"pager"},e.prototype.render=function(){var e,r=this.parent;this.pagerDestroy(),t.isNullOrUndefined(this.parent.pagerTemplate)||(this.pageSettings.template=this.parent.pagerTemplate,this.parent.pageTemplateChange=!0),this.element=this.parent.createElement("div",{className:"e-gridpager"}),e=x({},t.extend({},I(this.pageSettings)),{click:this.clickHandler.bind(this),dropDownChanged:this.onSelect.bind(this),enableRtl:r.enableRtl,locale:r.locale,created:this.addAriaAttr.bind(this)},["parentObj","propName"]),this.pagerObj=new Jr(e)},e.prototype.onSelect=function(e){this.pageSettings.pageSize=e.pageSize,this.isInitialLoad||(this.pageSettings.currentPage=1)},e.prototype.addAriaAttr=function(){var e=this;if(!this.pageSettings.template){for(var t=this.parent.createElement("div",{className:"e-numericcontainer"}),r=this.element.querySelector(".e-pagercontainer"),i=document.createDocumentFragment(),n=this.element.querySelector(".e-numericcontainer"),o=n.querySelectorAll("a"),s=0;s<o.length;s++){this.parent.getContentTable()?o[s].setAttribute("aria-owns",this.parent.getContentTable().id):o[s].setAttribute("aria-owns",this.parent.element.getAttribute("id")+"_content_table");var l=this.parent.createElement("div");l.appendChild(o[s]),i.appendChild(l)}t.appendChild(i),r.replaceChild(t,n),[".e-mfirst",".e-mprev",".e-first",".e-prev",".e-next",".e-last",".e-mnext",".e-mlast"].forEach(function(t){var r=e.element.querySelector(t);e.parent.getContentTable()&&r.setAttribute("aria-owns",e.parent.getContentTable().id)})}},e.prototype.dataReady=function(e){this.updateModel(e)},e.prototype.refresh=function(){this.pagerObj.refresh()},e.prototype.goToPage=function(e){this.pagerObj.goToPage(e)},e.prototype.setPageSize=function(e){this.pagerObj.setPageSize(e)},e.prototype.updateModel=function(e){this.parent.pageSettings.totalRecordsCount=e.count,this.parent.dataBind()},e.prototype.onActionComplete=function(e){this.parent.trigger(xe,t.extend(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:xe}))},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){for(var t=e.properties,r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];this.pagerObj[n]=t[n]}this.pagerObj.dataBind()}},e.prototype.clickHandler=function(e){var r=this.parent;if(this.isForceCancel||_(r)&&!r.prevPageMoving)return this.isForceCancel?this.isForceCancel=!1:(t.isNullOrUndefined(e.newProp)||t.isNullOrUndefined(e.newProp.pageSize)?e.currentPage&&(r.notify(it,{instance:this,handler:this.goToPage,arg1:e.currentPage}),this.pagerObj.currentPage=r.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:r.pageSettings.currentPage):(r.notify(it,{instance:this,handler:this.setPageSize,arg1:e.newProp.pageSize}),this.pagerObj.pageSize=e.oldProp.pageSize,r.pageSettings.pageSize=e.newProp.pageSize),this.isForceCancel=!0,this.pagerObj.dataBind()),void(e.cancel=!0);r.pageSettings.pageSize=this.pagerObj.pageSize,r.prevPageMoving=!1;var i=this.pageSettings.currentPage;this.pageSettings.currentPage=e.currentPage,this.parent.notify(ze,{requestType:"paging",previousPage:i,currentPage:e.currentPage,type:Se}),this.parent.requestTypeAction="paging"},e.prototype.keyPressHandler=function(e){e.action in Zr&&(e.preventDefault(),this.element.querySelector(Zr[e.action]).click())},e.prototype.updateExternalMessage=function(e){this.pagerObj.enableExternalMessage||(this.pagerObj.enableExternalMessage=!0,this.pagerObj.dataBind()),this.pagerObj.externalMessage=e,this.pagerObj.dataBind()},e.prototype.appendToElement=function(e){this.isInitialLoad=!0,this.parent.element.appendChild(this.element),this.parent.setGridPager(this.element),this.pagerObj.appendTo(this.element),this.isInitialLoad=!1},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.appendToElement())},e.prototype.addEventListener=function(){this.handlers={load:this.render,end:this.appendToElement,ready:this.dataReady,complete:this.onActionComplete,updateLayout:this.enableAfterRender,inboundChange:this.onPropertyChanged,keyPress:this.keyPressHandler},this.parent.isDestroyed||(this.parent.on(Me,this.handlers.load,this),this.parent.on(Ae,this.handlers.end,this),this.parent.on(Pe,this.handlers.ready,this),this.parent.on("paging-complete",this.handlers.complete,this),this.parent.on(Be,this.handlers.updateLayout,this),this.parent.on(qe,this.handlers.inboundChange,this),this.parent.on(Ve,this.handlers.keyPress,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Me,this.handlers.load),this.parent.off(Ae,this.handlers.end),this.parent.off(Pe,this.handlers.ready),this.parent.off("paging-complete",this.handlers.complete),this.parent.off(Be,this.handlers.updateLayout),this.parent.off(qe,this.handlers.inboundChange),this.parent.off(Ve,this.handlers.keyPress))},e.prototype.destroy=function(){this.removeEventListener(),this.pagerDestroy()},e.prototype.pagerDestroy=function(){this.pagerObj&&!this.pagerObj.isDestroyed&&(this.pagerObj.destroy(),t.remove(this.element))},e}(),Zr={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"},ei=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ti=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-filterbarcell"}),t}return ei(r,e),r.prototype.getGui=function(){return this.parent.createElement("div")},r.prototype.render=function(e,r){var i,n=this.parent.element.querySelector(".e-filterbar"),s=this.element.cloneNode(),l=this.getGui(),a=e.column;if(n.appendChild(s),s.setAttribute("e-mappinguid",a.uid),a.filterTemplate){var d={};r&&(d[a.field]=r[a.field]);if(d.column=a,a.visible){var c=this.parent.element.id+a.uid+"filterTemplate";B(s,a.getFilterTemplate()(d,this.parent,"filterTemplate",c))}else s.classList.add("e-hide")}else if("checkbox"!==a.type){if(!t.isNullOrUndefined(a.allowFiltering)&&!a.allowFiltering||t.isNullOrUndefined(a.filterBarTemplate)){t.attributes(l,{class:"e-filterdiv e-fltrinputdiv"}),i=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filtertext",attrs:{type:"search",title:a.headerText+e.attributes.title,value:r[e.column.field]?r[e.column.field]:"",role:"search"}}),l.appendChild(i);h={element:i,floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0}};o.Input.createInput(h,this.parent.createElement)}else if(s.classList.add("e-fltrtemp"),t.attributes(l,{class:"e-fltrtempdiv"}),t.isNullOrUndefined(a.filterBarTemplate.create))i=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filterUi_input e-filtertext e-fltrTemp",attrs:{type:"search",title:a.headerText}}),l.appendChild(i);else{var h={column:a,node:Element},p=a.filterBarTemplate.create;if("string"==typeof p&&(p=t.getValue(p,window)),"string"==typeof(i=p(h))){var u=this.parent.createElement("div");u.innerHTML=i,i=u.firstChild}t.attributes(l,{class:"e-filterUi_input e-filtertext e-fltrTemp",title:a.headerText,id:a.field+"_filterBarcell"}),l.appendChild(i)}if((!1===a.allowFiltering||""===a.field||t.isNullOrUndefined(a.field))&&(i.setAttribute("disabled","true"),i.classList.add("e-disable")),a.visible||s.classList.add("e-hide"),this.appendHtml(s,l),(t.isNullOrUndefined(a.allowFiltering)||a.allowFiltering)&&!t.isNullOrUndefined(a.filterBarTemplate)){var g=a.filterBarTemplate.write,h={element:i,column:a};"string"==typeof g&&(g=t.getValue(g,window)),g.call(this,h)}}return s},r.prototype.appendHtml=function(e,t){return e.appendChild(t),e},r}(It),ri=function(){function e(e,t,r,i){this.parent=e,this.serviceLocator=r,this.filterSettings=i,this.customFilterOperators=t}return e.prototype.renderOperatorUI=function(e,r,i,n){this.dialogObj=n;var o=i.type+"Operator";this.optrData=this.customOptr=t.isNullOrUndefined(this.parent.filterSettings.operators)||t.isNullOrUndefined(this.parent.filterSettings.operators[o])?this.customFilterOperators[o]:this.parent.filterSettings.operators[o];var l=this.customOptr,a=this.dropSelectedVal(i,o),d=this.parent.createElement("div",{className:"e-flm_optrdiv"});e.appendChild(d);var c=this.parent.createElement("input",{id:i.uid+"-floptr"});d.appendChild(c),this.dropOptr=new s.DropDownList({dataSource:l,fields:{text:"text",value:"value"},open:this.dropDownOpen.bind(this),cssClass:"e-popup-flmenu",text:a}),this.dropOptr.appendTo("#"+i.uid+"-floptr")},e.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},e.prototype.dropSelectedVal=function(e,i){for(var n="",o=0,s=this.parent.filterSettings.columns;o<s.length;o++){var l=s[o];if(e.field===l.field||e.isForeignColumn()&&e.foreignKeyValue===l.field){var a=new r.DataManager(this.optrData).executeLocal((new r.Query).where("value","equal",l.operator));n=t.isNullOrUndefined(a[0])?"":a[0].text}}if(""===n)if(e.filter.operator)for(var d=Object.keys(this.optrData).length,c=0;c<d;c++)this.optrData[c].value===e.filter.operator&&(n=this.optrData[c].text);else n=this.optrData[0].text;return n},e.prototype.getFlOperator=function(){return this.dropOptr.value},e}(),ii=function(){function e(e,t,r){this.parent=e,this.serLocator=t,this.filterSettings=r}return e.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"strui-"+e.column.uid}),e.target.appendChild(this.instance),this.dialogObj=e.dialogObj,this.actObj=this.getAutoCompleteOptions(e),this.actObj.appendTo(this.instance)},e.prototype.getAutoCompleteOptions=function(e){var i=this,n=e.column.isForeignColumn(),o=n?e.column.dataSource:this.parent.dataSource,l={value:n?e.column.foreignKeyValue:e.column.field};return new s.AutoComplete(t.extend({dataSource:o instanceof r.DataManager?o:new r.DataManager(o),fields:l,locale:this.parent.locale,enableRtl:this.parent.enableRtl,query:this.parent.query.clone(),sortOrder:"Ascending",open:this.openPopup.bind(this),cssClass:"e-popup-flmenu",focus:function(){i.actObj.filterType=e.getOptrInstance.getFlOperator()},autofill:!0,placeholder:e.localizeText.getConstant("EnterValue"),actionComplete:function(e){e.result=e.result.filter(function(e,r,n){return n.map(function(e){return t.getValue(i.actObj.fields.value,e)}).indexOf(t.getValue(i.actObj.fields.value,e))===r})}},e.column.filter.params))},e.prototype.write=function(e){this.filterSettings.columns;""===e.filteredValue||t.isNullOrUndefined(e.filteredValue)||(document.querySelector("#strui-"+e.column.uid).ej2_instances[0].value=e.filteredValue)},e.prototype.read=function(e,r,i,n){var o=document.querySelector("#strui-"+r.uid).ej2_instances[0];t.Browser.isDevice&&(o.hidePopup(),o.focusOut());var s=o.value;(t.isNullOrUndefined(s)||""===s)&&(s=null),n.filterByColumn(r.field,i,s,"and",this.parent.filterSettings.enableCaseSensitivity)},e.prototype.openPopup=function(e){X(e,this.dialogObj)},e}(),ni=function(){function e(e,t,r){this.filterSettings=r,this.parent=e,this.serviceLocator=t}return e.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"numberui-"+e.column.uid}),e.target.appendChild(this.instance),this.numericTxtObj=new o.NumericTextBox(t.extend({format:e.column.format,locale:this.parent.locale,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("EnterValue"),enableRtl:this.parent.enableRtl},e.column.filter.params)),this.numericTxtObj.appendTo(this.instance)},e.prototype.write=function(e){document.querySelector("#numberui-"+e.column.uid).ej2_instances[0].value=e.filteredValue},e.prototype.read=function(e,t,r,i){var n=document.querySelector("#numberui-"+t.uid).ej2_instances[0].value;i.filterByColumn(t.field,r,n,"and",!0)},e}(),oi=function(){function e(e,t,r){this.parent=e,this.serviceLocator=t,this.filterSettings=r}return e.prototype.create=function(e){var i=e.column.isForeignColumn(),n=i?e.column.dataSource:this.parent.dataSource,o=i?e.column.foreignKeyValue:e.column.field;this.elem=this.parent.createElement("input",{className:"e-flmenu-input",id:"bool-ui-"+e.column.uid}),e.target.appendChild(this.elem),this.dialogObj=e.dialogObj,this.dropInstance=new s.DropDownList(t.extend({dataSource:n instanceof r.DataManager?n:new r.DataManager(n),query:(new r.Query).select(o),fields:{text:o,value:o},placeholder:e.localizeText.getConstant("SelectValue"),cssClass:"e-popup-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this),actionComplete:function(e){e.result=r.DataUtil.distinct(e.result,o,!0)}},e.column.filter.params)),this.dropInstance.appendTo(this.elem)},e.prototype.write=function(e){var r=document.querySelector("#bool-ui-"+e.column.uid).ej2_instances[0];t.isNullOrUndefined(e.filteredValue)||(r.text=e.filteredValue)},e.prototype.read=function(e,t,r,i){var n=document.querySelector("#bool-ui-"+t.uid).ej2_instances[0].value;i.filterByColumn(t.field,r,n,"and",!1)},e.prototype.openPopup=function(e){X(e,this.dialogObj)},e}(),si=function(){function e(e,t,r){this.parent=e,this.locator=t,this.fltrSettings=r}return e.prototype.create=function(e){var r=ae(e.column.format,e.column.type);this.dialogObj=e.dialogObj,this.inputElem=this.parent.createElement("input",{className:"e-flmenu-input",id:"dateui-"+e.column.uid}),e.target.appendChild(this.inputElem),"date"===e.column.type?this.datePickerObj=new l.DatePicker(t.extend({format:r,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this)},e.column.filter.params)):"datetime"===e.column.type&&(this.datePickerObj=new l.DateTimePicker(t.extend({format:r,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this)},e.column.filter.params))),this.datePickerObj.appendTo(this.inputElem)},e.prototype.write=function(e){this.fltrSettings.columns;document.querySelector("#dateui-"+e.column.uid).ej2_instances[0].value=t.isNullOrUndefined(e.filteredValue)?null:new Date(e.filteredValue)},e.prototype.read=function(e,r,i,n){var o=document.querySelector("#dateui-"+r.uid).ej2_instances[0].value;o=t.isNullOrUndefined(o)?null:o,n.filterByColumn(r.field,i,o,"and",!0)},e.prototype.openPopup=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},e}(),li=function(){function e(e,t,r,i,n){this.isDialogOpen=!1,this.colTypes={string:ii,number:ni,date:si,boolean:oi,datetime:si},this.parent=e,this.filterSettings=t,this.serviceLocator=r,this.customFilterOperators=i,this.filterObj=n,this.flMuiObj=new ri(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization")}return e.prototype.openDialog=function(e){this.col=this.parent.getColumnByField(e.field),(t.isNullOrUndefined(this.col.filter)||t.isNullOrUndefined(this.col.filter.type)||"Menu"===this.col.filter.type)&&this.renderDlgContent(e.target,this.col)},e.prototype.closeDialog=function(){if(this.dlgObj){if(t.isBlazor())for(var e=this.parent.getColumns(),r=0;r<e.length;r++)if(e[r].filterTemplate){var i=this.parent.element.id+e[r].uid+"filterTemplate";t.updateBlazorTemplate(i,"FilterTemplate",e[r])}var n=document.getElementById(this.dlgObj.element.id);this.dlgObj&&!this.dlgObj.isDestroyed&&n&&(this.parent.notify("filter-menu-close",{field:this.col.field}),this.isDialogOpen=!1,this.dlgObj.destroy(),t.remove(n))}},e.prototype.renderDlgContent=function(e,r){var n={requestType:"filterbeforeopen",columnName:r.field,columnType:r.type};if(!t.isBlazor()||this.parent.isJsComponent){n.filterModel=this}this.parent.trigger(Se,n);var o=this.parent.createElement("div",{className:"e-flmenu-maindiv",id:r.uid+"-flmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-flmenu",id:r.uid+"-flmdlg"}),this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new i.Dialog({showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,created:this.dialogCreated.bind(this,e,r),position:this.parent.element.classList.contains("e-device")?{X:"center",Y:"center"}:{X:"",Y:""},target:this.parent.element.classList.contains("e-device")?document.body:this.parent.element,buttons:[{click:this.filterBtnClick.bind(this,r),buttonModel:{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,r),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:"e-flmenu-cancelbtn"}}],content:o,width:!t.isNullOrUndefined(O(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:"e-filter-popup"});this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv)},e.prototype.dialogCreated=function(e,r){t.Browser.isDevice||Y(e,this.dlgObj,this.parent),this.renderFilterUI(e,r),this.parent.notify("filterDialogCreated",{}),this.dlgObj.element.style.maxHeight="350px",this.dlgObj.show(),r.filterTemplate||this.writeMethod(r,this.dlgObj.element.querySelector("#"+r.uid+"-flmenu"));var i={requestType:"filterafteropen",columnName:r.field,columnType:r.type};if(!t.isBlazor()||this.parent.isJsComponent){i.filterModel=this}this.isDialogOpen=!0,this.parent.trigger(xe,i)},e.prototype.renderFilterUI=function(e,t){var r=this.dlgObj.element.querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(r,e,t),this.renderFlValueUI(r,e,t)},e.prototype.renderOperatorUI=function(e,t,r){this.flMuiObj.renderOperatorUI(e,t,r,this.dlgObj)},e.prototype.renderFlValueUI=function(e,r,i){var n=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),o=this.filterObj;e.appendChild(n);this.flMuiObj,this.dlgObj;var s=new this.colTypes[i.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(i.filterTemplate){var l={};l[i.field]=l.value=o.values[i.field],i.foreignKeyValue&&(l[i.foreignKeyValue]=o.values[i.field],l[i.field]=void 0);l.column=i;var a=this.parent.element.id+i.uid+"filterTemplate",d=i.getFilterTemplate()(l,this.parent,"filterTemplate",a);t.updateBlazorTemplate(a,"FilterTemplate",i),B(n,d)}else if(t.isNullOrUndefined(i.filter)||t.isNullOrUndefined(i.filter.ui)||t.isNullOrUndefined(i.filter.ui.create))s.create({column:i,target:n,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj});else{var c=i.filter.ui.create;"string"==typeof c&&(c=t.getValue(c,window)),c({column:i,target:n,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj})}},e.prototype.writeMethod=function(e,r){for(var i,n=r.querySelector(".e-flmenu-valinput"),o=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),s=0,l=this.filterSettings.columns;s<l.length;s++){var a=l[s];e.uid===a.uid&&(i=a.value)}if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.write))o.write({column:e,target:n,parent:this.parent,filteredValue:i});else{var d=e.filter.ui.write;"string"==typeof d&&(d=t.getValue(d,window)),d({column:e,target:n,parent:this.parent,filteredValue:i})}},e.prototype.filterBtnClick=function(e){var r,i=this.dlgObj.element.querySelector(".e-flmenu-valuediv input");r=this.flMuiObj.getFlOperator();var n=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(e.filterTemplate){var o=this.dlgDiv.querySelector(".e-flmenu-valuediv"),s=void 0;s=o.children[0].value?o.children[0].value:t.isBlazor()||t.isNullOrUndefined(o.children[0].ej2_instances)?o.querySelector(".e-control").ej2_instances[0].value:o.children[0].ej2_instances[0].value,this.filterObj.filterByColumn(e.field,r,s)}else if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.read))n.read(i,e,r,this.filterObj);else{var l=e.filter.ui.read;"string"==typeof l&&(l=t.getValue(l,window)),l({element:i,column:e,operator:r,fltrObj:this.filterObj})}var a=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter",d=this.parent.element.querySelector('[e-mappinguid="'+e.uid+'"]').parentElement.querySelector(a);d&&d.classList.add("e-filtered"),this.closeDialog()},e.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),this.closeDialog();var t=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter",r=this.parent.element.querySelector('[e-mappinguid="'+e.uid+'"]').parentElement.querySelector(t);r&&r.classList.remove("e-filtered")},e.prototype.destroy=function(){this.closeDialog()},e}(),ai=function(){function e(e,t,r){this.parent=e,this.checkBoxBase=new Ur(e,t),this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},e.prototype.openDialog=function(e){this.checkBoxBase.openDialog(e),this.parent.log("column_type_missing",{column:e.column})},e.prototype.closeDialog=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},e.prototype.getModuleName=function(){return"checkboxFilter"},e.prototype.actionBegin=function(e){this.parent.trigger(Se,e)},e.prototype.actionComplete=function(e){this.parent.trigger(xe,e)},e.prototype.actionPrevent=function(e){_(this.parent)&&(this.parent.notify(it,e),e.cancel=!0)},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ht,this.actionBegin,this),this.parent.on("cbox-filter-complete",this.actionComplete,this),this.parent.on(pt,this.actionPrevent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ht,this.actionBegin),this.parent.off("cbox-filter-complete",this.actionComplete),this.parent.off(pt,this.actionPrevent))},e}(),di=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ci=function(e){function t(t,r,i,n){var o=e.call(this,t,r,i)||this;return o.parent=t,o.excelFilterBase=new Vr(t,r,n),o}return di(t,e),t.prototype.destroy=function(){this.excelFilterBase.closeDialog()},t.prototype.openDialog=function(e){this.excelFilterBase.openDialog(e)},t.prototype.closeDialog=function(){this.excelFilterBase.closeDialog()},t.prototype.filterByColumn=function(e,t,r,i,n,o,s,l){this.excelFilterBase.filterByColumn(e,t,r,i,n,o,s,l)},t.prototype.getModuleName=function(){return"excelFilter"},t}(ai),hi=function(){function i(e,t,r){this.predicate="and",this.contentRefresh=!0,this.refresh=!0,this.values={},this.cellText={},this.nextFlMenuOpen="",this.type={Menu:li,CheckBox:ai,Excel:ci},this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith"},this.fltrDlgDetails={field:"",isOpen:!1},this.skipNumberInput=["="," ","!"],this.skipStringInput=[">","<","="],this.actualPredicate={},this.parent=e,this.filterSettings=t,this.serviceLocator=r,this.addEventListener()}return i.prototype.render=function(i){if(!r.DataUtil.getObject("args.isFrozen",i)){var n=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&n.columns.length){var o=this.parent.element.querySelector(".e-filterbar");o&&t.remove(o);var s=new vt(this.serviceLocator,e.CellType.Filter,n),l=void 0;this.serviceLocator.getService("cellRendererFactory").addCellRenderer(e.CellType.Filter,new ti(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),s.element=this.parent.createElement("tr",{className:"e-filterbar"}),(l=this.generateRow()).data=this.values,this.parent.getHeaderContent().querySelector("thead").appendChild(s.element);var a=this.parent.element.querySelector(".e-rowdragheader");this.element=s.render(l,n.getColumns(),null,null,s.element);var d=this.element.querySelector(".e-detailheadercell");d&&(d.className="e-filterbarcell e-mastercell"),a&&(a.className="e-dragheadercell e-mastercell");var c=[].slice.call(this.element.querySelectorAll(".e-grouptopleftcell"));c.length&&c[c.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(st,{case:"filter"})}}},i.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),this.element)){t.remove(this.element);var r=this.parent.getHeaderContent().querySelector(".e-filterbar");this.parent.getFrozenColumns()&&r&&t.remove(r)}},i.prototype.generateRow=function(e){var t=new ft({});return t.cells=this.generateCells(),t},i.prototype.generateCells=function(){var t=[];if(this.parent.allowGrouping)for(var r=0,i=this.parent.groupSettings.columns.length;r<i;r++)t.push(this.generateCell({},e.CellType.HeaderIndent));(this.parent.detailTemplate||this.parent.childGrid)&&t.push(this.generateCell({},e.CellType.DetailHeader)),this.parent.isRowDragable()&&t.push(this.generateCell({},e.CellType.RowDragHIcon));for(var n=0,o=this.parent.getColumns();n<o.length;n++){var s=o[n];t.push(this.generateCell(s))}return t},i.prototype.generateCell=function(t,r){var i={visible:t.visible,isDataCell:!1,rowId:"",column:t,cellType:r||e.CellType.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new mt(i)},i.prototype.updateModel=function(){var e=this.parent.getColumnByField(this.fieldName),t=e.isForeignColumn()?e.foreignKeyValue:this.fieldName;this.currentFilterObject={field:t,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:this.value,predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}};var r=this.getFilteredColsIndexByField(e);r>-1?this.filterSettings.columns[r]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject),this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},i.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,r=0,i=t.length;r<i;r++)if(t[r].uid===e.uid||e.isForeignColumn()&&this.parent.getColumnByUid(e.uid).field===e.foreignKeyValue)return r;return-1},i.prototype.onActionComplete=function(e){var r=this.isRemove?{requestType:"filtering",type:xe}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:t.isNullOrUndefined(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:xe};this.parent.trigger(xe,t.extend(e,r)),this.isRemove=!1},i.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandler,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandler)},i.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},i.prototype.initialEnd=function(){if(this.parent.off(Ne,this.initialEnd),this.parent.getColumns().length&&this.filterSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.initialLoad=!0;for(var t=0,r=e.filterSettings.columns;t<r.length;t++){var i=r[t];this.filterByColumn(i.field,i.operator,i.value,i.predicate,i.matchCase,i.ignoreAccent,i.actualFilterValue,i.actualOperator)}this.initialLoad=!1,this.updateFilterMsg(),this.contentRefresh=!0}},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Be,this.enableAfterRender,this),this.parent.on("filtering-complete",this.onActionComplete,this),this.parent.on(qe,this.onPropertyChanged,this),this.parent.on(Ve,this.keyUpHandler,this),this.parent.on(We,this.columnPositionChanged,this),this.parent.on(Ue,this.render,this),this.parent.on(Ne,this.initialEnd,this),this.parent.on("filter-menu-close",this.filterMenuClose,this),t.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on("filterOpen",this.columnMenuFilter,this),this.parent.on(Ge,this.filterIconClickHandler,this))},i.prototype.removeEventListener=function(){t.EventHandler.remove(document,"click",this.clickHandler),this.parent.isDestroyed||(this.parent.off(Be,this.enableAfterRender),this.parent.off("filtering-complete",this.onActionComplete),this.parent.off(qe,this.onPropertyChanged),this.parent.off(Ve,this.keyUpHandler),this.parent.off(We,this.columnPositionChanged),this.parent.off(Ue,this.render),this.parent.off("filterOpen",this.columnMenuFilter),this.parent.off("filter-menu-close",this.filterMenuClose),this.parent.off(Ge,this.filterIconClickHandler))},i.prototype.filterMenuClose=function(e){this.fltrDlgDetails.isOpen=!1},i.prototype.filterByColumn=function(e,r,i,n,o,s,l,a){var d,c=this.parent;return this.column=c.grabColumnByFieldFromAllCols(e),"FilterBar"===this.filterSettings.type&&(d=c.getHeaderContent().querySelector("[id='"+this.column.field+"_filterBarcell']")),t.isNullOrUndefined(this.column.allowFiltering)||this.column.allowFiltering?_(c)?void c.notify(it,{instance:this,handler:this.filterByColumn,arg1:e,arg2:r,arg3:i,arg4:n,arg5:o,arg6:s,arg7:l,arg8:a}):(this.value=i,this.matchCase=o||!1,this.ignoreAccent=this.ignoreAccent=t.isNullOrUndefined(s)?this.parent.filterSettings.ignoreAccent:s,this.fieldName=e,this.predicate=n||"and",this.operator=r,i=!t.isNullOrUndefined(i)&&i.toString(),"number"!==this.column.type&&"date"!==this.column.type||(this.matchCase=!0),c.getColumnHeaderByField(e).setAttribute("aria-filtered","true"),i.length<1||this.checkForSkipInput(this.column,i)?(this.filterStatusMsg=i.length<1?"":this.l10n.getConstant("InvalidFilterMessage"),void this.updateFilterMsg()):(d&&"FilterBar"===this.filterSettings.type&&d.value!==i&&(d.value=i),t.isNullOrUndefined(this.column.format)?this.values[this.column.field]=i:(this.applyColumnFormat(i),this.initialLoad&&"FilterBar"===this.filterSettings.type&&(d.value=this.values[this.column.field])),this.actualPredicate[this.fieldName]=[{field:this.fieldName,predicate:n,matchCase:o,ignoreAccent:s,operator:this.operator,value:this.value,type:this.column.type}],this.addFilteredClass(this.fieldName),void(this.checkAlreadyColFiltered(this.column.field)||this.updateModel()))):void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:this.column.headerText})},i.prototype.applyColumnFormat=function(e){var t="date"===this.column.type||"datetime"===this.column.type?new Date(e):parseFloat(e);this.values[this.column.field]=this.setFormatForFlColumn(t,this.column)},i.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,r=Object.keys(e.properties);t<r.length;t++){var i=r[t];switch(i){case"columns":this.contentRefresh&&(this.parent.notify(ze,{currentFilterObject:this.currentFilterObject,currentFilteringColumn:this.column?this.column.field:void 0,columns:this.filterSettings.columns,requestType:"filtering",type:Se}),this.refreshFilterSettings(),this.updateFilterMsg(),this.updateFilter());break;case"showFilterBarStatus":e.properties[i]?this.updateFilterMsg():this.parent.allowPaging&&this.parent.updateExternalMessage("");break;case"type":this.parent.refreshHeader(),this.refreshFilterSettings()}}},i.prototype.refreshFilterSettings=function(){if("FilterBar"===this.filterSettings.type){for(n=0;n<this.filterSettings.columns.length;n++){this.column=this.parent.grabColumnByUidFromAllCols(this.filterSettings.columns[n].uid);var e=this.filterSettings.columns[n].value;if(e=!t.isNullOrUndefined(e)&&e.toString(),t.isNullOrUndefined(this.column.format)){var r=this.filterSettings.columns[n].field;this.values[r]=this.filterSettings.columns[n].value}else this.applyColumnFormat(e);(o=this.getFilterBarElement(this.column.field))&&(t.isNullOrUndefined(this.cellText[this.filterSettings.columns[n].field])?o.value=this.filterSettings.columns[n].value:o.value=this.cellText[this.column.field])}if(0===this.filterSettings.columns.length)for(var i=this.parent.getColumns(),n=0;n<i.length;n++){var o=this.getFilterBarElement(i[n].field);o&&""!==o.value&&(o.value="",delete this.values[i[n].field])}}},i.prototype.getFilterBarElement=function(e){var r,i="[id='"+e+"_filterBarcell']";return i&&!t.isNullOrUndefined(this.element)&&(r=this.element.querySelector(i)),r},i.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},i.prototype.clearFiltering=function(){var e=this,t=M(this.filterSettings.columns);if(_(this.parent))return void this.parent.notify(it,{instance:this,handler:this.clearFiltering});t.forEach(function(t){t.uid=t.uid||e.parent.getColumnByField(t.field).uid});var r=t.map(function(e){return e.uid}),i=r.filter(function(e,t){return r.indexOf(e)===t});this.refresh=!1;for(var n=0,o=i.length;n<o;n++)this.removeFilteredColsByField(this.parent.getColumnByUid(i[n]).field,!1);if(this.refresh=!0,i.length&&this.parent.renderModule.refresh(),0===this.parent.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var s=[].slice.call(this.parent.element.querySelectorAll(".e-filtered")),n=0,o=s.length;n<o;n++)s[0].removeAttribute("aria-filtered"),s[0].classList.remove("e-filtered");this.isRemove=!0,this.filterStatusMsg="",this.updateFilterMsg()},i.prototype.checkAlreadyColFiltered=function(e){for(var t=0,r=this.filterSettings.columns;t<r.length;t++){var i=r[t];if(i.field===e&&i.value===this.value&&i.operator===this.operator&&i.predicate===this.predicate)return!0}return!1},i.prototype.columnMenuFilter=function(e){this.column=e.col;var r=t.closest(e.target,"#"+e.id);e.isClose&&!r?this.filterModule.closeDialog():r&&this.filterDialogOpen(this.column,e.target)},i.prototype.filterDialogOpen=function(e,r,i,n){var o=this.parent;this.filterModule&&this.filterModule.closeDialog(),this.filterModule=new this.type[e.filter.type||this.parent.filterSettings.type](this.parent,o.filterSettings,this.serviceLocator,this.customOperators,this);var s=e.filter.dataSource||o.getDataModule().dataManager;this.filterModule.openDialog({type:e.type,field:e.field,displayName:e.headerText,dataSource:s,format:e.format,height:800,filteredColumns:o.filterSettings.columns,target:r,sortedColumns:o.sortSettings.columns,formatFn:e.getFormatter(),parserFn:e.getParser(),query:o.query,template:e.getFilterItemTemplate(),hideSearchbox:!t.isNullOrUndefined(e.filter.hideSearchbox)&&e.filter.hideSearchbox,handler:this.filterHandler.bind(this),localizedStrings:o.getLocaleConstants(),position:{X:i,Y:n},column:e,foreignKeyValue:e.foreignKeyValue,actualPredicate:this.actualPredicate,localeObj:this.parent.localeObj,isRemote:this.parent.getDataModule().isRemote(),allowCaseSensitive:this.filterSettings.enableCaseSensitivity})},i.prototype.removeFilteredColsByField=function(e,t){var r,i=this.filterSettings.columns;if(_(this.parent)){var n={instance:this,handler:this.removeFilteredColsByField,arg1:e,arg2:t};return void this.parent.notify(it,n)}for(var o=i.map(function(e){return e.uid}),s=o.filter(function(e,t){return o.indexOf(e)===t}),l=0,a=s.length;l<a;l++){i[l].uid=i[l].uid||this.parent.getColumnByField(i[l].field).uid;var d=i.length,c=this.parent.grabColumnByUidFromAllCols(s[l]);if(c.field===e||c.field===c.foreignKeyValue&&c.isForeignColumn()){if("FilterBar"===this.filterSettings.type&&!t){var h="[id='"+c.field+"_filterBarcell']";(r=this.parent.getHeaderContent().querySelector(h))&&(r.value="",delete this.values[e])}for(;d--;)i[d].uid===c.uid&&i.splice(d,1);var p=this.parent.getColumnHeaderByField(c.field);if(p.removeAttribute("aria-filtered"),"FilterBar"!==this.filterSettings.type){var u=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter";p.querySelector(u).classList.remove("e-filtered")}this.isRemove=!0,this.actualPredicate[e]&&delete this.actualPredicate[e],this.values[e]&&delete this.values[e],this.refresh&&this.parent.notify(ze,{requestType:"filtering",type:Se,currentFilterObject:{field:c.field,operator:this.operator,value:this.value,predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}},currentFilterColumn:c});break}}this.updateFilterMsg()},i.prototype.getModuleName=function(){return"filter"},i.prototype.keyUpHandler=function(e){var r=this.parent,i=e.target;if(i&&t.matches(i,".e-filterbar input")){var n=t.closest(i,"th.e-filterbarcell");if(this.column=r.getColumnByUid(n.getAttribute("e-mappinguid")),!this.column)return;"Immediate"!==this.filterSettings.mode&&13!==e.keyCode||9===e.keyCode||(this.value=i.value.trim(),this.processFilter(e))}},i.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},i.prototype.updateFilterMsg=function(){if("FilterBar"===this.filterSettings.type){var e=this.parent,r=void 0,i=this.filterSettings.columns,n=(this.serviceLocator.getService("valueFormatter"),void 0);if(!this.filterSettings.showFilterBarStatus)return;if(i.length>0&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var o=0;o<i.length;o++)if(n=e.grabColumnByUidFromAllCols(i[o].uid),o&&(this.filterStatusMsg+=" && "),t.isNullOrUndefined(n.format))this.filterStatusMsg+=n.headerText+": "+this.values[n.field];else{var s="date"===n.type||"datetime"===n.type?this.valueFormatter.fromView(this.values[n.field],n.getParser(),n.type):this.values[n.field];r="date"!==n.type&&"datetime"!==n.type?this.serviceLocator.getService("valueFormatter").toView(s,n.getParser()).toString():this.setFormatForFlColumn(s,n),this.filterStatusMsg+=n.headerText+": "+r}}e.allowPaging&&e.updateExternalMessage(this.filterStatusMsg),this.filterStatusMsg=""}},i.prototype.setFormatForFlColumn=function(e,t){return this.serviceLocator.getService("valueFormatter").toView(e,t.getFormatter()).toString()},i.prototype.checkForSkipInput=function(e,t){var i;if("number"===e.type)(r.DataUtil.operatorSymbols[t]||this.skipNumberInput.indexOf(t)>-1)&&(i=!0);else if("string"===e.type)for(var n=0,o=t;n<o.length;n++){var s=o[n];this.skipStringInput.indexOf(s)>-1&&(i=!0)}return i},i.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},i.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},i.prototype.stopTimer=function(){window.clearInterval(this.timer)},i.prototype.onTimerTick=function(){var e="[id='"+this.column.field+"_filterBarcell']",r=this.element.querySelector(e);!r&&this.parent.getFrozenColumns()&&(r=this.parent.getHeaderContent().querySelector(e));var i;if(this.cellText[this.column.field]=r.value,this.stopTimer(),t.isNullOrUndefined(this.column.filterBarTemplate))i=JSON.parse(JSON.stringify(r.value));else{var n=this.column.filterBarTemplate.read;"string"==typeof n&&(n=t.getValue(n,window)),t.isNullOrUndefined(n)||(this.value=n.call(this,r))}if(t.isNullOrUndefined(this.value)||""===this.value)return void this.removeFilteredColsByField(this.column.field);this.validateFilterValue(this.value),this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent),r.value=i,this.updateFilterMsg()},i.prototype.validateFilterValue=function(e){var r,i;this.parent;switch(this.matchCase=this.filterSettings.enableCaseSensitivity,this.column.type){case"number":this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal,r=[">","<","=","!"];for(var n=0;n<e.length;n++)if(r.indexOf(e[n])>-1){i=n;break}this.getOperator(e.substring(i)),0!==i&&(this.value=e.substring(0,i)),""!==this.value&&e.length>=1&&(this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type)),isNaN(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage"));break;case"date":case"datetime":this.operator=this.filterOperators.equal,""===this.value||this.value instanceof Date||(this.getOperator(e),this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type),t.isNullOrUndefined(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")));break;case"string":this.matchCase=!1,"*"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(e.length-1)?(this.value=this.value.slice(0,-1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.endsWith):this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.startsWith;break;case"boolean":"true"===e.toLowerCase()||"1"===e?this.value=!0:"false"===e.toLowerCase()||"0"===e?this.value=!1:e.length&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")),this.operator=this.filterOperators.equal;break;default:this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal}},i.prototype.getOperator=function(e){var i=e.charAt(0),n=e.slice(0,2),o=t.extend({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},r.DataUtil.operatorSymbols);(o.hasOwnProperty(i)||o.hasOwnProperty(n))&&(this.operator=o[i],this.value=e.substring(1),this.operator||(this.operator=o[n],this.value=e.substring(2))),this.operator!==this.filterOperators.lessThan&&this.operator!==this.filterOperators.greaterThan||"="===this.value.charAt(0)&&(this.operator=this.operator+"orequal",this.value=this.value.substring(1))},i.prototype.columnPositionChanged=function(e){this.parent.filterSettings.type},i.prototype.getLocalizedCustomOperators=function(){var e=[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}];this.customOperators={stringOperator:[{value:"startswith",text:this.l10n.getConstant("StartsWith")},{value:"endswith",text:this.l10n.getConstant("EndsWith")},{value:"contains",text:this.l10n.getConstant("Contains")},{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}],numberOperator:e,dateOperator:e,datetimeOperator:e,booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]}},i.prototype.filterIconClickHandler=function(e){var t=e.target;if(t.classList.contains("e-filtermenudiv")&&("Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)){var r=this.parent,i=r.getColumnByUid(O(t,"e-headercell").firstElementChild.getAttribute("e-mappinguid")),n=r.element.getBoundingClientRect(),o=t.getBoundingClientRect();if(this.column=i,this.fltrDlgDetails.field===i.field&&this.fltrDlgDetails.isOpen)return;this.filterModule&&this.filterModule.closeDialog(),this.fltrDlgDetails={field:i.field,isOpen:!0},this.filterDialogOpen(this.column,t,o.right-n.left,o.bottom-n.top)}},i.prototype.clickHandler=function(e){if("Immediate"===this.filterSettings.mode||"Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type){this.parent;var r=e.target,i=r.classList.contains("e-day"),n=O(this.parent.element,"e-dialog"),o=!1,s=O(r,"e-popup");if(n&&s&&(o=n.id===s.id),O(r,"e-filter-popup")||r.classList.contains("e-filtermenudiv"))return;if(!this.filterModule||O(r,"e-popup-wrapper")||t.closest(r,".e-filter-item.e-menu-item")||i||(!o||O(r,"e-filter-popup")||O(r,"e-popup-flmenu"))&&s||this.filterModule.closeDialog(r),"Immediate"===this.filterSettings.mode&&r.classList.contains("e-clear-icon")){var l=r.previousElementSibling;this.removeFilteredColsByField(l.id.slice(0,-14))}}},i.prototype.filterHandler=function(e){var t;this.actualPredicate[e.field]=e.actualPredicate;for(var i=new r.DataManager(this.filterSettings.columns),n=(new r.Query).where("field",this.filterOperators.equal,e.field),o=i.executeLocal(n),s=0;s<o.length;s++){for(var l=-1,a=0;a<this.filterSettings.columns.length;a++)if(o[s].field===this.filterSettings.columns[a].field){l=a;break}-1!==l&&this.filterSettings.columns.splice(l,1)}this.values[e.field]&&delete this.values[e.field];var d=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter";t=this.parent.getColumnHeaderByField(e.field).querySelector(d),"filtering"===e.action?(this.filterSettings.columns=this.filterSettings.columns.concat(e.filterCollection),this.filterSettings.columns.length&&t&&t.classList.add("e-filtered")):(t&&t.classList.remove("e-filtered"),this.parent.renderModule.refresh()),this.parent.dataBind()},i.prototype.updateFilter=function(){var e=this.filterSettings.columns;this.actualPredicate={};for(var t=0;t<e.length;t++){this.column=this.parent.getColumnByField(e[t].field)||ie(e[t].field,this.parent.getForeignKeyColumns());var r=e[t].field;this.parent.getColumnByField(e[t].field)||(r=ie(e[t].field,this.parent.getForeignKeyColumns()).field),this.refreshFilterIcon(r,e[t].operator,e[t].value,e[t].type,e[t].predicate,e[t].matchCase,e[t].ignoreAccent,e[t].uid)}},i.prototype.refreshFilterIcon=function(e,t,r,i,n,o,s,l){var a;a={field:e,predicate:n,matchCase:o,ignoreAccent:s,operator:t,value:r,type:i},this.actualPredicate[e]?this.actualPredicate[e].push(a):this.actualPredicate[e]=[a];var d=l?this.parent.grabColumnByUidFromAllCols(l).field:e;this.addFilteredClass(d)},i.prototype.addFilteredClass=function(e){var t;this.parent.showColumnMenu?t=this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu"):this.parent.getColumnByField(e)&&(t=this.parent.getColumnHeaderByField(e).querySelector(".e-icon-filter")),t&&t.classList.add("e-filtered")},i}(),pi={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},ui=function(){function e(e){this.tapped=!1,this.isDblClk=!0,this.parent=e,this.parent.isDestroyed||(this.widthService=new rr(e),this.addEventListener())}return e.prototype.autoFitColumns=function(e){var t=void 0===e||null===e||e.length<=0?this.parent.getColumns().map(function(e){return e.field}):"string"==typeof e?[e]:e;this.findColumn(t)},e.prototype.autoFit=function(){var e=this.parent.getColumns().filter(function(e){return!0===e.autoFit}).map(function(e){return e.field||e.headerText});e.length>0&&this.autoFitColumns(e)},e.prototype.resizeColumn=function(e,r,i){var n,o,s,l,a,d,c=this.parent,h=0,p=0,u=i||this.parent.getUidByColumnField(e),g=this.parent.getNormalizedColumnIndex(u),f=c.getFrozenColumns();t.isNullOrUndefined(c.getFooterContent())||(s=c.getFooterContentTable()),f?r<f?(n=c.getHeaderTable(),o=c.getContentTable(),l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g+1)+")"),s&&(d=s.querySelectorAll("td:nth-child("+(g+1)+")"))):(n=c.getHeaderContent().querySelector(".e-movableheader").children[0],o=c.getContent().querySelector(".e-movablecontent").children[0],l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g-f+1)+")"),s&&(d=(s=c.getFooterContent().querySelector(".e-movablefootercontent").children[0]).querySelectorAll("td:nth-child("+(g-f+1)+")"))):(n=c.getHeaderTable(),o=c.getContentTable(),l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g+1)+"):not(.e-groupcaption)"),s&&(d=s.querySelectorAll("td:nth-child("+(g+1)+"):not(.e-groupcaption)")));var m=n.querySelector("tr").querySelectorAll(".e-grouptopleftcell");if(m.length>0)for(b=0;b<m.length;b++)p+=m[b].offsetWidth;var y=o.querySelector(".e-detailrowcollapse")||o.querySelector(".e-detailrowexpand");(this.parent.detailTemplate||this.parent.childGrid)&&y&&(p+=y.offsetWidth);var v=[l],C=[],w=[];if(s)for(b=0;b<d.length;b++)w[b]=d[b].cloneNode(!0);for(var b=0;b<a.length;b++)C[b]=a[b].cloneNode(!0);var S=this.createTable(n,v,"e-gridheader"),x=this.createTable(o,C,"e-gridcontent"),R=null;w.length&&(R=this.createTable(s,w,"e-gridfooter"));c.getColumns()[r].width=t.formatUnit(Math.max(S,x,R));this.widthService.setColumnWidth(c.getColumns()[r]),!1===c.getColumns().some(function(e){return null===e.width||void 0===e.width||e.width.length<=0})&&c.getColumns().forEach(function(e){e.visible&&(h+=parseFloat(e.width))});var E=h+p;h>0&&!c.getFrozenColumns()&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new we({width:"30px"})),n.style.width=t.formatUnit(E),o.style.width=t.formatUnit(E),t.isNullOrUndefined(s)||(s.style.width=t.formatUnit(E)));var T=n.offsetWidth;c.getContent().scrollWidth>T?(n.classList.add("e-tableborder"),o.classList.add("e-tableborder")):(n.classList.remove("e-tableborder"),o.classList.remove("e-tableborder")),t.isNullOrUndefined(s)||s.classList.add("e-tableborder")},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},e.prototype.getModuleName=function(){return"resize"},e.prototype.findColumn=function(e){var t=this;e.forEach(function(e){var r=e,i=t.parent.getColumnIndexByField(r);!0===t.parent.getColumns()[i].visible&&t.resizeColumn(r,i)})},e.prototype.createTable=function(e,t,r){var i=this.parent.createElement("div");i.className=this.parent.element.className,i.style.cssText="display: inline-block;visibility:hidden;position:absolute";var n=this.parent.createElement("div");n.className=r;var o=this.parent.createElement("table");o.className=e.className,o.classList.add("e-resizetable"),o.style.cssText="table-layout: auto;width: auto";var s=this.parent.createElement("tr");t.forEach(function(t){var r=s.cloneNode();r.className=e.querySelector("tr").className,r.appendChild(t),o.appendChild(r)}),n.appendChild(o),i.appendChild(n),document.body.appendChild(i);var l=o.getBoundingClientRect().width;return document.body.removeChild(i),Math.ceil(l)},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ue,this.refreshHeight,this),this.parent.on(Ae,this.wireEvents,this),this.parent.on(Ne,this.autoFit,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ue,this.refreshHeight),this.parent.off(Ae,this.wireEvents))},e.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},e.prototype.refreshHeight=function(){this.getResizeHandlers().forEach(function(e){e.parentElement.offsetHeight>0&&(e.style.height=e.parentElement.offsetHeight+"px")}),this.setHandlerHeight()},e.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.resizeStart,this),t.EventHandler.add(this.parent.getHeaderContent(),"dblclick",this.callAutoFit,this)},e.prototype.unwireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.resizeStart),t.EventHandler.remove(this.parent.getHeaderContent(),"dblclick",this.callAutoFit)},e.prototype.getResizeHandlers=function(){return this.parent.getFrozenColumns()?[].slice.call(this.parent.getHeaderContent().querySelectorAll("."+pi.root)):[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+pi.root))},e.prototype.setHandlerHeight=function(){[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+pi.suppress)).forEach(function(e){e.style.height=e.parentElement.offsetHeight+"px"})},e.prototype.callAutoFit=function(e){if(e.target.classList.contains("e-rhandler")){var r=this.getTargetColumn(e);if(r.columns)return;this.resizeColumn(r.field,this.parent.getNormalizedColumnIndex(r.uid),r.uid),t.closest(e.target,pi.header).classList.add("e-resized")}},e.prototype.resizeStart=function(e){if(e.target.classList.contains("e-rhandler")){if(!this.helper){if(0===this.getScrollBarWidth()){for(var r=0,i=this.refreshColumnWidth();r<i.length;r++){var n=i[r];this.widthService.setColumnWidth(n)}this.widthService.setWidthToTable()}if(this.refreshStackedColumnWidth(),this.element=e.target,this.parent.getVisibleFrozenColumns())for(var o=this.parent.getContent().querySelector(".e-movablecontent").querySelector("tbody"),s=this.parent.getContent().querySelector(".e-frozencontent").querySelector("tbody"),l=o.querySelectorAll("tr"),a=s.querySelectorAll("tr"),d=0;d<l.length;d++)this.parent.rowHeight?(l[d].style.height=this.parent.rowHeight+"px",a[d].style.height=this.parent.rowHeight+"px"):(l[d].style.removeProperty("height"),a[d].style.removeProperty("height"));this.parentElementWidth=this.parent.element.getBoundingClientRect().width,this.appendHelper(),this.column=this.getTargetColumn(e),this.pageX=this.getPointX(e),this.parent.enableRtl?this.minMove=parseFloat(this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(t.isNullOrUndefined(this.column.width)?"":this.column.width.toString()),this.minMove+=this.pageX}if(t.Browser.isDevice&&!this.helper.classList.contains(pi.icon))this.helper.classList.add(pi.icon),t.EventHandler.add(document,t.Browser.touchStartEvent,this.removeHelper,this),t.EventHandler.add(this.helper,t.Browser.touchStartEvent,this.resizeStart,this);else{var c={e:e,column:this.column};if(this.parent.trigger("resizeStart",c),c.cancel||this.parent.isEdit)return void this.cancelResizeAction();t.EventHandler.add(document,t.Browser.touchEndEvent,this.resizeEnd,this),t.EventHandler.add(this.parent.element,t.Browser.touchMoveEvent,this.resizing,this),this.updateCursor("add")}}},e.prototype.cancelResizeAction=function(e){e&&(t.EventHandler.remove(this.parent.element,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove")),t.Browser.isDevice&&(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart)),t.detach(this.helper),this.refresh()},e.prototype.getWidth=function(e,t,r){return t&&e<t?t:r&&e>r?r:e},e.prototype.updateResizeEleHeight=function(){var e=this;this.parent.getHeaderContent().querySelectorAll(".e-rhandler").forEach(function(t){t.style.height=e.element.parentElement.offsetHeight+"px"})},e.prototype.getColData=function(e,r){return{width:parseFloat(t.isNullOrUndefined(this.widthService.getWidth(e))||"auto"===this.widthService.getWidth(e)?"0":this.widthService.getWidth(e).toString())+r,minWidth:e.minWidth?parseFloat(e.minWidth.toString()):null,maxWidth:e.maxWidth?parseFloat(e.maxWidth.toString()):null}},e.prototype.resizing=function(e){if(!t.isNullOrUndefined(this.column)){var r=0;t.isNullOrUndefined(this.column)&&(r=O(this.element,"th").offsetWidth),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.setHelperHeight());var i=this.getPointX(e),n=this.parent.enableRtl?-(i-this.pageX):i-this.pageX,o=this.getColData(this.column,n);o.width||(o.width=t.closest(this.element,"th").offsetWidth);var s=this.getWidth(o.width,o.minWidth,o.maxWidth);if(this.parent.log("resize_min_max",{column:this.column,width:s}),(!this.parent.enableRtl&&this.minMove>=i||this.parent.enableRtl&&this.minMove<=i)&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):0,this.pageX=i=this.minMove),s!==parseFloat(t.isNullOrUndefined(this.column.width)||"auto"===this.column.width?r.toString():this.column.width.toString())){this.pageX=i,this.column.width=t.formatUnit(s);var l={e:e,column:this.column};if(this.parent.trigger("resizing",l),l.cancel)return void this.cancelResizeAction(!0);var a=[this.column],d=[this.column];this.column.columns&&(a=this.getSubColumns(this.column,[]),a=this.calulateColumnsWidth(a,!1,n),d=this.calulateColumnsWidth(a,!0,n));for(var c=0,h=d;c<h.length;c++){var p=h[c];this.widthService.setColumnWidth(p,null,"resize")}this.updateHelper()}this.isDblClk=!1}},e.prototype.calulateColumnsWidth=function(e,r,i){for(var n=[],o=this,s=0,l=e;s<l.length;s++)!function(s){var l=0;e.forEach(function(e){l+=parseFloat(e.width.toString())});var a=o.getColData(s,parseFloat(s.width)*i/l),d=o.getWidth(a.width,a.minWidth,a.maxWidth);d!==parseFloat(s.width.toString())&&(r&&(s.width=t.formatUnit(d<1?1:d)),n.push(s))}(l[s]);return n},e.prototype.getSubColumns=function(e,t){for(var r=0,i=e.columns;r<i.length;r++){var n=i[r];!1!==n.visible&&n.allowResizing&&(n.columns?this.getSubColumns(n,t):t.push(n))}return t},e.prototype.resizeEnd=function(e){if(this.helper&&!this.parent.isDestroyed){t.EventHandler.remove(this.parent.element,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove"),t.detach(this.helper);var r={e:e,column:this.column},i=this.parent.getContent().querySelector(".e-content"),n=i.querySelector(".e-movablecontent")?i.querySelector(".e-movablecontent"):i;n.scrollHeight>=n.clientHeight&&(this.parent.scrollModule.setPadding(),n.style.overflowY="scroll"),this.parent.trigger("resizeStop",r),t.closest(this.element,".e-headercell").classList.add("e-resized"),O(this.element,"e-frozenheader")?this.isFrozenColResized=!0:this.isFrozenColResized=!1,this.parent.getFrozenColumns()&&this.parent.notify(st,{case:"textwrap"}),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify("textWrapRefresh",{case:"textwrap"})),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0}},e.prototype.getPointX=function(e){return e.touches&&e.touches.length?e.touches[0].pageX:e.pageX},e.prototype.refreshColumnWidth=function(){for(var e=this.parent.getColumns(),t=0,r=[].slice.apply(this.parent.getHeaderTable().querySelectorAll("th.e-headercell"));t<r.length;t++)for(var i=r[t],n=0,o=e;n<o.length;n++){var s=o[n];if(i.querySelector("[e-mappinguid]")&&i.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===s.uid&&s.visible){s.width=i.getBoundingClientRect().width;break}}return e},e.prototype.refreshStackedColumnWidth=function(){for(var e=0,t=this.parent.getStackedColumns(this.parent.columns);e<t.length;e++){var r=t[e];r.width=this.getStackedWidth(r,0)}},e.prototype.getStackedWidth=function(e,t){for(var r=0,i=e.columns;r<i.length;r++){var n=i[r];!1!==n.visible&&(n.columns?this.getStackedWidth(n,t):t+=n.width)}return t},e.prototype.getTargetColumn=function(e){var r=t.closest(e.target,pi.header),i=(r=r.querySelector(".e-headercelldiv")||r.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");return this.parent.getColumnByUid(i)},e.prototype.updateCursor=function(e){var t=[].slice.call(this.parent.getHeaderContent().querySelectorAll("th"));t.push(this.parent.element);for(var r=0,i=t;r<i.length;r++)i[r].classList[e](pi.cursor)},e.prototype.refresh=function(){this.column=null,this.pageX=null,this.element=null,this.helper=null},e.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:pi.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},e.prototype.setHelperHeight=function(){var e=this.parent.getContent().offsetHeight-this.getScrollBarWidth(),r=t.closest(this.element,pi.header),i=[].slice.call(this.parent.getHeaderContent().querySelectorAll("tr")),n=this.parent.getFrozenColumns();n&&(r.parentElement.children.length!==n?i.splice(0,i.length/2):i.splice(i.length/2,i.length/2));for(var o=i.indexOf(r.parentElement);o<i.length;o++)e+=i[o].offsetHeight;var s=this.calcPos(r);s.left+=this.parent.enableRtl?-1:r.offsetWidth-2,this.helper.style.cssText="height: "+e+"px; top: "+s.top+"px; left:"+Math.floor(s.left)+"px;"},e.prototype.getScrollBarWidth=function(e){var t=this.parent.getFrozenColumns()?this.parent.getContent().querySelector(".e-movablecontent"):this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?z():0},e.prototype.removeHelper=function(e){var r=e.target.classList;r.contains(pi.root)||r.contains(pi.icon)||!this.helper||(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart),t.detach(this.helper),this.refresh())},e.prototype.updateHelper=function(){var e=t.closest(this.element,pi.header),r=Math.floor(this.calcPos(e).left+(this.parent.enableRtl?-1:e.offsetWidth-2));if(r>this.parentElementWidth&&(r=this.parentElementWidth-2),this.parent.getFrozenColumns()){var i=t.closest(e,".e-table").offsetLeft;r<i&&(r=i)}this.helper.style.left=r+"px"},e.prototype.calcPos=function(e){for(var t={top:0,left:0},r=e.getBoundingClientRect(),i=e.ownerDocument,n=e.offsetParent||i.documentElement;n&&(n===i.body||n===i.documentElement)&&"static"===n.style.position;)n=n.parentNode;return n&&n!==e&&1===n.nodeType&&(t=n.getBoundingClientRect()),{top:r.top-t.top,left:r.left-t.left}},e.prototype.doubleTapEvent=function(e){this.getUserAgent()&&this.isDblClk&&(this.tapped?(clearTimeout(this.tapped),this.callAutoFit(e),this.tapped=null):this.tapped=setTimeout(this.timeoutHandler(),300))},e.prototype.getUserAgent=function(){var e=t.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},e.prototype.timeoutHandler=function(){this.tapped=null},e}(),gi=function(){function e(e){this.parent=e,this.parent.isDestroyed||(this.parent.on(Xe,this.headerDrop,this),this.parent.on(Be,this.enableAfterRender,this),this.parent.on(je,this.onActionComplete,this),this.parent.on(Te,this.drag,this),this.parent.on(Ee,this.dragStart,this),this.parent.on(Ye,this.dragStop,this),this.parent.on(Xe,this.headerDrop,this),this.parent.on(Ue,this.createReorderElement,this))}return e.prototype.chkDropPosition=function(e,r){var i=this.parent.getColumnByUid(r.firstElementChild.getAttribute("e-mappinguid")),n=!i||!i.lockColumn;return(e.parentElement.isEqualNode(r.parentElement)||this.parent.getFrozenColumns()&&Array.prototype.indexOf.call(t.closest(e,"thead").children,e.parentElement)===Array.prototype.indexOf.call(t.closest(r,"thead").children,r.parentElement))&&this.targetParentContainerIndex(e,r)>-1&&n},e.prototype.chkDropAllCols=function(e,t){for(var r,i=this.getHeaderCells();!r&&i.length>0;)r=e!==i.pop()&&this.targetParentContainerIndex(e,t)>-1;return r},e.prototype.findColParent=function(e,t,r){r=r;for(var i=0,n=t.length;i<n;i++){if(e===t[i])return!0;if(t[i].columns){var o=r.length;if(r.push(t[i]),this.findColParent(e,t[i].columns,r))return!0;r.splice(o,r.length-o)}}return!1},e.prototype.getColumnsModel=function(e){for(var t=[],r=[],i=0,n=e.length;i<n;i++)t.push(e[i]),e[i].columns&&(r=r.concat(e[i].columns));return r.length&&(t=t.concat(this.getColumnsModel(r))),t},e.prototype.headerDrop=function(e){var r=this.parent,i=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid"),n=r.getColumnByUid(i);if(!t.closest(e.target,"th")||!t.isNullOrUndefined(n)&&(!n.allowReordering||n.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n});var o=t.closest(e.target,".e-headercell"),s=(o.querySelector(".e-headercelldiv")||o.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");if(!t.isNullOrUndefined(s)){var l=r.getColumnByUid(s);if(t.isNullOrUndefined(l)||!l.allowReordering||l.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n,destColumn:l})}if(o&&this.chkDropPosition(this.element,o)&&this.chkDropAllCols(this.element,o))if(this.parent.enableColumnVirtualization){var a=this.parent.columns,d=this.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"),c=null,h=this.parent.getColumns(!0).filter(function(e){return e.uid===d})[0],p=o.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");a.some(function(e,t){return e.uid===p&&(c=t,e.uid===p)});t.isNullOrUndefined(c)||this.moveColumns(c,h)}else{var u=this.targetParentContainerIndex(this.element,o),g=this.element.firstElementChild.getAttribute("e-mappinguid");if(this.destElement=o,g)this.moveColumns(u,this.parent.getColumnByUid(g));else{var f=this.getHeaderCells(),m=F(this.element,f),y=(a=this.getColumnsModel(this.parent.columns))[m];this.moveColumns(u,y)}}},e.prototype.isActionPrevent=function(e){return _(e)},e.prototype.moveColumns=function(e,t,r){var i=this.parent;if(this.isActionPrevent(i))return void i.notify(it,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});var n=this.getColParent(t,this.parent.columns),o=n?n.columns:this.parent.columns,s=k(t,o);if((this.parent.getFrozenColumns()&&n||this.parent.lockcolPositionCount)&&!r){for(a=0;a<o.length;a++)if(o[a].field===t.field){s=a;break}var l=this.parent.getColumnByUid(this.destElement.firstElementChild.getAttribute("e-mappinguid"));if(l){for(a=0;a<o.length;a++)if(o[a].field===l.field){e=a;break}}else for(var a=0;a<o.length;a++)o[a].headerText===this.destElement.innerText.trim()&&(e=a)}i.allowReordering&&s!==e&&-1!==s&&-1!==e&&(o.splice(e,0,o.splice(s,1)[0]),i.getColumns(!0),i.notify(We,{fromIndex:e,toIndex:s}),i.notify(ze,{type:Se,requestType:"reorder"}))},e.prototype.targetParentContainerIndex=function(e,t){var r=this.getHeaderCells(),i=this.parent.columns,n=this.getColumnsModel(i),o=this.getColParent(n[F(e,r)],i);return i=o?o.columns:i,k(n[F(t,r)],i)},e.prototype.getHeaderCells=function(){var e=this.parent.getFrozenColumns();if(e||this.parent.lockcolPositionCount){var t=void 0,r=void 0,i=[],n=[].slice.call(this.parent.getHeaderTable().querySelectorAll(".e-columnheader"));if(e)for(var o=[].slice.call(this.parent.getHeaderContent().querySelector(".e-movableheader").querySelectorAll(".e-columnheader")),s=0;s<n.length;s++){t=[].slice.call(n[s].getElementsByClassName("e-headercell")),r=[].slice.call(o[s].getElementsByClassName("e-headercell"));for(var l=void 0,a=0;a<t.length;a++){for(d=0;d<r.length;d++)if(r[d].innerText===t[a].innerText){l=!0;break}l||(i=i.concat([t[a]]))}for(d=0;d<r.length;d++)i.push(r[d])}else for(s=0;s<n.length;s++){r=[].slice.call(n[s].getElementsByClassName("e-headercell"));for(a=0;a<r.length;a++){for(var l=void 0,d=a+1;d<r.length;d++)if(r[d].innerText===r[a].innerText){l=!0;break}l||(i=i.concat([r[a]]))}}return i}return[].slice.call(this.parent.element.getElementsByClassName("e-headercell"))},e.prototype.getColParent=function(e,t){var r=[];return this.findColParent(e,t,r),r[r.length-1]},e.prototype.reorderSingleColumn=function(e,r){var i=this.parent.getColumnByField(e),n=this.parent.getColumnByField(r);if(!t.isNullOrUndefined(i)&&(!i.allowReordering||i.lockColumn)||!t.isNullOrUndefined(n)&&(!n.allowReordering||i.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:i,destColumn:n});var o=this.parent.getColumnByField(r),s=this.getColParent(o,this.parent.columns),l=k(o,s?s.columns:this.parent.columns);l>-1&&this.moveColumns(l,this.parent.getColumnByField(e),!0)},e.prototype.reorderMultipleColumns=function(e,r){var i=this.parent.getColumnIndexByField(r),n=this.parent.getColumnByField(r);if(!(i<0)&&(t.isNullOrUndefined(n)||n.allowReordering&&!n.lockColumn)){for(o=0;o<e.length;o++){s=this.parent.getColumnByField(e[o]);if(!t.isNullOrUndefined(s)&&(!s.allowReordering||s.lockColumn))return}for(var o=0;o<e.length;o++){var s=this.parent.getColumnByIndex(i),l=this.getColParent(s,this.parent.columns),a=k(s,l?l.columns:this.parent.columns);a>-1&&this.moveColumns(a,this.parent.getColumnByField(e[o]),!0),this.parent.getColumnIndexByField(e[o+1])>=a&&i++}}},e.prototype.moveTargetColumn=function(e,t){t>-1&&this.moveColumns(t,e,!0)},e.prototype.reorderSingleColumnByTarget=function(e,t){var r=this.parent.getColumnByField(e);this.moveTargetColumn(r,t)},e.prototype.reorderMultipleColumnByTarget=function(e,t){for(var r=0;r<e.length;r++)this.reorderSingleColumnByTarget(e[r],t)},e.prototype.reorderColumns=function(e,t){"string"==typeof e?this.reorderSingleColumn(e,t):this.reorderMultipleColumns(e,t)},e.prototype.reorderColumnByIndex=function(e,t){var r=this.parent.getColumnByIndex(e);this.moveTargetColumn(r,t)},e.prototype.reorderColumnByTargetIndex=function(e,t){"string"==typeof e?this.reorderSingleColumnByTarget(e,t):this.reorderMultipleColumnByTarget(e,t)},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.createReorderElement()},e.prototype.createReorderElement=function(){var e=this.parent.element.querySelector(".e-headercontent");this.upArrow=e.appendChild(this.parent.createElement("div",{className:"e-icons e-icon-reorderuparrow e-reorderuparrow",attrs:{style:"display:none"}})),this.downArrow=e.appendChild(this.parent.createElement("div",{className:"e-icons e-icon-reorderdownarrow e-reorderdownarrow",attrs:{style:"display:none"}}))},e.prototype.onActionComplete=function(e){this.parent.trigger(xe,t.extend(e,{type:xe}))},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(t.remove(this.upArrow),t.remove(this.downArrow),this.parent.off(Xe,this.headerDrop),this.parent.off(Be,this.enableAfterRender),this.parent.off(je,this.onActionComplete),this.parent.off(Te,this.drag),this.parent.off(Ee,this.dragStart),this.parent.off(Ye,this.dragStop),this.parent.off(Ue,this.createReorderElement))},e.prototype.drag=function(e){var r=this.parent,i=e.target;if(e.column.allowReordering&&!e.column.lockColumn){var n=t.closest(i,".e-headercell:not(.e-stackedHeaderCell)"),o=r.element.querySelector(".e-cloneproperties"),s=this.x>P(e.event).x+r.getContent().firstElementChild.scrollLeft;t.removeClass(r.getHeaderTable().querySelectorAll(".e-reorderindicate"),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),t.classList(o,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),n&&!n.isEqualNode(this.element)&&(i=n,this.chkDropPosition(this.element,i)&&this.chkDropAllCols(this.element,i)?(this.updateArrowPosition(i,s),t.classList(i,["e-allowDrop","e-reorderindicate"],[])):r.allowGrouping&&O(e.target,"e-groupdroparea")||t.classList(o,["e-notallowedcur"],["e-defaultcur"])),r.trigger(Te,{target:i,draggableType:"headercell",column:e.column})}},e.prototype.updateScrollPostion=function(e){var t=this,r=this.parent.getFrozenColumns(),i=P(e).x,n=this.parent.element.getBoundingClientRect(),o=r?this.parent.element.querySelector(".e-movableheader").getBoundingClientRect().left:n.left,s=n.right,l=r?this.parent.getContent().querySelector(".e-movablecontent"):this.parent.getContent().firstElementChild;i>o&&i<o+35?this.timer=window.setInterval(function(){t.setScrollLeft(l,!0)},50):i<s&&i>s-35&&(this.timer=window.setInterval(function(){t.setScrollLeft(l,!1)},50))},e.prototype.setScrollLeft=function(e,t){var r=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),r!==e.scrollLeft&&this.setDisplay("none")},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.updateArrowPosition=function(e,t){var r=e.getBoundingClientRect(),i=this.parent.element.getBoundingClientRect();t&&r.left<i.left||!t&&r.right>i.right||(this.upArrow.style.top=r.top+r.height-i.top+"px",this.downArrow.style.top=r.top-i.top-4+"px",this.upArrow.style.left=this.downArrow.style.left=(t?r.left:r.right)-i.left-4+"px",this.setDisplay(""))},e.prototype.dragStart=function(e){var t=this.parent,r=e.target;this.element=r.classList.contains("e-headercell")?r:O(r,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn&&(this.x=P(e.event).x+t.getContent().firstElementChild.scrollLeft,t.trigger(Ee,{target:r,draggableType:"headercell",column:e.column}))},e.prototype.dragStop=function(e){var r=this.parent;this.setDisplay("none"),this.stopTimer(),e.cancel||r.trigger(De,{target:e.target,draggableType:"headercell",column:e.column}),t.removeClass(r.getHeaderTable().querySelectorAll(".e-reorderindicate"),["e-reorderindicate"])},e.prototype.setDisplay=function(e){this.upArrow.style.display=e,this.downArrow.style.display=e},e.prototype.getModuleName=function(){return"reorder"},e}(),fi=function(){function e(e){var i=this;this.selectedRows=[],this.isOverflowBorder=!0,this.selectedRowColls=[],this.isRefresh=!0,this.helper=function(e){var r=i.parent,n=e.sender.target,o=i.parent.createElement("div",{className:"e-cloneproperties e-draganddrop e-grid e-dragclone",styles:'height:"auto", z-index:2, width:'+r.element.offsetWidth}),s=i.parent.createElement("table",{styles:"width:"+r.element.offsetWidth}),l=i.parent.createElement("tbody");if(document.getElementsByClassName("e-griddragarea").length||r.rowDropSettings.targetID&&!e.sender.target.classList.contains("e-selectionbackground")&&"Single"!==r.selectionSettings.type||!r.rowDropSettings.targetID&&!O(e.sender.target,"e-rowdragdrop"))return!1;r.rowDropSettings.targetID&&"Row"===r.selectionSettings.mode&&"Single"===r.selectionSettings.type&&r.selectRow(parseInt(e.sender.target.parentElement.getAttribute("aria-rowindex"),10)),i.startedRow=t.closest(n,"tr").cloneNode(!0),i.processArgs(n);var a={selectedRow:i.rows,dragelement:n,cloneElement:o,cancel:!1,data:i.rowData},d=r.getSelectedRows();r.trigger(Ie,a);if(a.cancel)return o=a.cloneElement;A(i.startedRow,".e-indentcell"),A(i.startedRow,".e-detailrowcollapse"),A(i.startedRow,".e-detailrowexpand"),i.removeCell(i.startedRow,"e-gridchkbox");var c=new RegExp("e-active","g");if(i.startedRow.innerHTML=i.startedRow.innerHTML.replace(c,""),l.appendChild(i.startedRow),r.getSelectedRows().length>1){var h=i.parent.createElement("span",{className:"e-dropitemscount",innerHTML:""+d.length});o.appendChild(h)}var p=t.closest(n,"tr").querySelector(".e-icon-rowdragicon");return p&&p.classList.add("e-dragstartrow"),s.appendChild(l),o.appendChild(s),r.element.appendChild(o),o},this.dragStart=function(e){var r=i.parent;if(!document.getElementsByClassName("e-griddragarea").length){var n=e.target,o=i.parent.element.querySelector(".e-dropitemscount");i.parent.getSelectedRecords().length>1&&o&&(o.style.left=i.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),i.processArgs(n),r.trigger(Oe,{rows:i.rows,target:e.target,draggableType:"rows",fromIndex:parseInt(i.rows[0].getAttribute("aria-rowindex"),10),data:i.rowData}),t.isBlazor()&&e.bindEvents(e.dragElement),i.dragStartData=i.rowData;var s=document.getElementById(r.rowDropSettings.targetID);r.rowDropSettings.targetID&&s&&s.ej2_instances&&"grid"===s.ej2_instances[0].getModuleName()&&s.ej2_instances[0].getContent().classList.add("e-allowRowDrop")}},this.drag=function(e){var r=i.parent,n=i.parent.element.querySelector(".e-cloneproperties"),o=i.getElementFromPosition(n,e.event);t.classList(n,["e-defaultcur"],["e-notallowedcur","e-movecur"]),i.isOverflowBorder=!0,i.hoverState=r.enableHover;var s=t.closest(e.target,"tr");if(r.enableHover=!1,e.target){i.processArgs(o);var l={rows:i.rows,target:o,draggableType:"rows",data:i.rowData,originalEvent:e,cancel:!1};if(r.trigger(Fe,l),i.stopTimer(),!l.cancel){if(r.element.classList.add("e-rowdrag"),i.dragTarget=s&&O(o,"e-grid").id===n.parentElement.id?s.rowIndex:parseInt(i.startedRow.getAttribute("aria-rowindex"),10),r.rowDropSettings.targetID)O(o,"e-gridcontent")&&O(n.parentElement,"e-grid").id!==O(o,"e-grid").id?t.classList(n,["e-defaultcur"],["e-notallowedcur"]):t.classList(n,["e-notallowedcur"],["e-defaultcur"]);else{var a=O(o,"e-grid");a&&a.id===n.parentElement.id?t.classList(n,["e-movecur"],["e-defaultcur"]):t.classList(n,["e-notallowedcur"],["e-movecur"])}if(!r.rowDropSettings.targetID&&(!r.groupSettings.columns.length||e.target.classList.contains("e-selectionbackground")))if(O(o,"e-grid")&&i.updateScrollPostion(e.event,o),i.isOverflowBorder&&parseInt(i.startedRow.getAttribute("aria-rowindex"),10)!==i.dragTarget)i.moveDragRows(e,i.startedRow,s);else{if(s&&i.parent.getRowByIndex(i.parent.getCurrentViewRecords().length-1).getAttribute("data-uid")===s.getAttribute("data-uid")){var d=i.parent.createElement("div",{className:"e-lastrow-dragborder"}),c=i.parent.getContent();d.style.width=i.parent.element.offsetWidth-i.getScrollWidth()+"px",c.querySelectorAll(".e-lastrow-dragborder").length||(c.classList.add("e-grid-relative"),c.appendChild(d),d.style.bottom=i.getScrollWidth()+"px")}i.removeBorder(s)}}}},this.dragStop=function(e){_(i.parent)?i.parent.notify(it,{instance:i,handler:i.processDragStop,arg1:e}):i.processDragStop(e)},this.processDragStop=function(e){var n=i.parent;if(!i.parent.isDestroyed){var o=i.getElementFromPosition(e.helper,e.event),s=o&&!o.classList.contains("e-dlg-overlay")?o:e.target;i.parent.element.querySelector(".e-cloneproperties");n.element.classList.remove("e-rowdrag");var l=document.getElementById(n.rowDropSettings.targetID);if(n.rowDropSettings.targetID&&l&&l.ej2_instances&&"grid"===l.ej2_instances[0].getModuleName()&&l.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),n.isRowDragable()){i.stopTimer(),n.enableHover=i.hoverState,i.parent.getContent().classList.remove("e-grid-relative"),i.removeBorder(o);var a=n.element.querySelector(".e-dragstartrow");a&&a.classList.remove("e-dragstartrow")}i.processArgs(s);var d={target:s,draggableType:"rows",cancel:!1,fromIndex:parseInt(i.rows[0].getAttribute("aria-rowindex"),10),dropIndex:i.dragTarget,rows:i.rows,data:i.dragStartData};if(n.trigger(ke,d),!O(s,"e-gridcontent")||d.cancel)return i.dragTarget=null,void t.remove(e.helper);i.isRefresh=!1;var c=i.parent.getSelectedRowIndexes();if(n.isRowDragable()){if(t.isBlazor()){var h=parseInt(i.startedRow.getAttribute("aria-rowindex"),10),p=[];p[0]=i.parent.currentViewData[h];var u=i.parent.getSelectedRecords().length?i.parent.getSelectedRecords():p,g={addedRecords:[],deletedRecords:u,changedRecords:[]},f=i.dragTarget?i.dragTarget:d.dropIndex,m=new r.Query;m.dragDropDestinationIndex=f,i.saveChange(g,m),g.deletedRecords=[],g.addedRecords=u,i.saveChange(g,m)}else!i.parent.rowDropSettings.targetID&&i.startedRow.querySelector("td.e-selectionbackground")&&c.length>1&&c.length!==i.parent.getCurrentViewRecords().length?i.reorderRows(c,d.dropIndex):i.reorderRows([parseInt(i.startedRow.getAttribute("aria-rowindex"),10)],i.dragTarget);i.dragTarget=null,n.rowDropSettings.targetID||(t.remove(e.helper),n.refresh())}i.isRefresh=!0}},this.removeCell=function(e,t){return[].slice.call(e.querySelectorAll("td")).filter(function(r){r.classList.contains(t)&&e.deleteCell(r.cellIndex)})},this.parent=e,this.parent.isDestroyed||(this.parent.on(Ae,this.initializeDrag,this),this.parent.on(De,this.columnDrop,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(Re,this.onDataBoundFn),this.parent.on(Be,this.enableAfterRender,this))}return e.prototype.saveChange=function(e,t){var r=this;this.parent.getDataModule().saveChanges(e,this.parent.getPrimaryKeyFieldNames()[0],{},t).then(function(){r.parent.notify(ze,{type:Se,requestType:"rowdraganddrop"})}).catch(function(e){r.parent.trigger("actionFailure",{error:e})})},e.prototype.reorderRows=function(e,t){for(var r=this.parent.getSelectedRowIndexes(),i=[],n=[],o=this.parent.renderModule.data.dataManager.dataSource.json,s=t,l=e[0],a=0,d=e.length;a<d;a++)n[a]=o[e[a]];for(var a=0,d=r.length;a<d;a++)i[a]=o[r[a]];for(var a=0,d=n.length;a<d;a++){if(0!==a){for(var c=0,h=o.length;c<h;c++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[c])===JSON.stringify(n[a])){l=c;break}for(var c=0,h=o.length;c<h;c++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[c])===JSON.stringify(n[a-1])){l>c&&(s=c+1);break}}this.reorderRow(l,s)}this.isRefresh&&this.parent.notify(ze,{type:Se,requestType:"rowdraganddrop"});for(var a=0,d=i.length;a<d;a++)for(var c=0,h=o.length;c<h;c++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[c])===JSON.stringify(i[a])){r[a]=c;break}this.selectedRowColls=r},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.initializeDrag=function(){var e=this.parent;this.draggable=new t.Draggable(e.getContent(),{dragTarget:".e-rowcelldrag, .e-rowdragdrop, .e-rowcell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop})},e.prototype.updateScrollPostion=function(e,t){var r=this,i=this.parent.getFrozenColumns(),n=P(e).y,o=this.parent.getContent().getBoundingClientRect(),s=this.parent.getRowHeight()-15,l=i?this.parent.getContent().querySelector(".e-movablecontent"):this.parent.getContent().firstElementChild;if(o.top+s>=n){var a=-this.parent.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){r.setScrollDown(l,a,!0)},200)}else if(o.top+this.parent.getContent().clientHeight-s-33<=n){var d=this.parent.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){r.setScrollDown(l,d,!0)},200)}},e.prototype.setScrollDown=function(e,t,r){e.scrollTop=e.scrollTop+t},e.prototype.moveDragRows=function(e,r,i){var n=this.parent.element.querySelector(".e-cloneproperties"),o=t.closest(e.target,"tr");if(O(o,"e-gridcontent")&&O(n.parentElement,"e-grid").id===O(o,"e-grid").id){var s=o||this.startedRow;this.setBorder(s,e.event,r,i)}},e.prototype.setBorder=function(e,r,i,n){var o=this.parent.element,s=this.parent.element.querySelector(".e-cloneproperties");if(this.removeFirstRowBorder(e),this.removeLastRowBorder(e),O(e,"e-gridcontent")&&O(s.parentElement,"e-grid").id===O(e,"e-grid").id){t.removeClass(o.querySelectorAll(".e-rowcell,.e-rowdragdrop"),["e-dragborder"]);var l=[];if(n&&0===n.rowIndex){var a=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),d=this.parent.getHeaderContent();d.classList.add("e-grid-relative"),a.style.width=o.offsetWidth-this.getScrollWidth()+"px",d.querySelectorAll(".e-firstrow-dragborder").length||d.appendChild(a)}else n&&parseInt(i.getAttribute("aria-rowindex"),10)>n.rowIndex?(e=this.parent.getRowByIndex(n.rowIndex-1),l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));l.length>0&&Q(l,!0)}},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?vr.getScrollBarWidth():0},e.prototype.removeFirstRowBorder=function(e){this.parent.element.getElementsByClassName("e-firstrow-dragborder").length>0&&e&&0!==e.rowIndex&&this.parent.element.getElementsByClassName("e-firstrow-dragborder")[0].remove()},e.prototype.removeLastRowBorder=function(e){var t=e&&this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid");this.parent.element.getElementsByClassName("e-lastrow-dragborder").length>0&&e&&t&&this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0].remove()},e.prototype.removeBorder=function(e){this.removeFirstRowBorder(e),this.removeLastRowBorder(e),(e=this.parent.getRows().filter(function(e){return e.querySelector("td.e-dragborder")})[0])&&Q([].slice.call(e.querySelectorAll(".e-dragborder")),!1)},e.prototype.getElementFromPosition=function(e,t){var r,i=P(t);return e.style.display="none",r=document.elementFromPoint(i.x,i.y),e.style.display="",r},e.prototype.onDataBound=function(e){this.selectedRowColls.length>0&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10):0},e.prototype.singleRowDrop=function(e){var r,i,n=t.closest(e.target,"tr");i=e.droppedElement.parentElement.ej2_instances[0],r=n?n.rowIndex:i.currentViewData.length-1,this.reorderRow(this.startedRowIndex,r)},e.prototype.columnDrop=function(e){var i=this.parent;e.droppedElement.parentElement.ej2_instances[0];if("grouping"!==e.droppedElement.getAttribute("action")){var n,o=t.closest(e.target,"tr"),s=void 0;if("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id===i.element.id||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==i.element.id)return;if(e.droppedElement.parentElement.id!==i.element.id)n=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(n.element.id!==i.element.id&&n.rowDropSettings.targetID!==i.element.id)return;var l=n.getSelectedRecords(),a=s=this.getTargetIdx(o);if(isNaN(a)&&(a=s=0),i.allowPaging&&(a=a+i.pageSettings.currentPage*i.pageSettings.pageSize-i.pageSettings.pageSize),t.isBlazor()){var d={addedRecords:l,deletedRecords:[],changedRecords:[]},c=new r.Query;c.dragDropDestinationIndex=a,i.getDataModule().saveChanges(d,i.getPrimaryKeyFieldNames()[0],{},c).then(function(){i.notify(ze,{type:Se,requestType:"rowdraganddrop"})}).catch(function(e){i.trigger("actionFailure",{error:e})}),d.deletedRecords=l,d.addedRecords=[],n.getDataModule().saveChanges(d,n.getPrimaryKeyFieldNames()[0],{},c).then(function(){n.notify(ze,{type:Se,requestType:"rowdraganddrop"})}).catch(function(e){n.trigger("actionFailure",{error:e})})}else{i.notify(Qe,{toIndex:a,records:l}),i.notify(ze,{type:Se,requestType:"rowdraganddrop"});var h=n.getSelectedRowIndexes(),p=n.allowPaging?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0;this.selectedRows=[];for(var u=0,g=l.length;u<g;u++)this.selectedRows.push(p+h[u]);n.notify(Je,{indexes:this.selectedRows,records:l}),n.notify(ze,{type:Se,requestType:"rowdraganddrop"})}}},e.prototype.reorderRow=function(e,t){var r=this.parent;if(!r.sortSettings.columns.length&&!r.groupSettings.columns.length&&!r.filterSettings.columns.length){var i=r.allowPaging?r.pageSettings.currentPage*r.pageSettings.pageSize-r.pageSettings.pageSize:0;t+=i,this.selectedRows=r.getSelectedRowIndexes(),r.notify(dt,{fromIndex:e+i,toIndex:t})}},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.initializeDrag()},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.draggable.destroy(),this.parent.off(Ae,this.initializeDrag),this.parent.off(De,this.columnDrop),this.parent.removeEventListener(Re,this.onDataBoundFn),this.parent.off(Be,this.enableAfterRender))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e.prototype.processArgs=function(e){var t=this.parent;t.getSelectedRecords().length>0&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length?(this.rows=[this.startedRow],this.rowData=this.parent.getRowInfo(this.startedRow.querySelector(".e-rowcell")).rowData):(this.rows=t.getSelectedRows(),this.rowData=t.getSelectedRecords())},e}(),mi=function(){function e(e,r,i,n){var o=this;this.isAppliedGroup=!1,this.isAppliedUnGroup=!1,this.visualElement=t.createElement("div",{className:"e-cloneproperties e-dragclone e-gdclone",styles:"line-height:23px",attrs:{action:"grouping"}}),this.helper=function(e){var t=o.parent,r=e.sender.target,i=r.classList.contains("e-groupheadercell")?r:O(r,"e-groupheadercell");return!!i&&(o.column=t.getColumnByField(i.firstElementChild.getAttribute("ej-mappingname")),o.visualElement.textContent=i.textContent,o.visualElement.style.width=i.offsetWidth+2+"px",o.visualElement.style.height=i.offsetHeight+2+"px",o.visualElement.setAttribute("e-mappinguid",o.column.uid),t.element.appendChild(o.visualElement),o.visualElement)},this.dragStart=function(e){o.parent.element.classList.add("e-ungroupdrag"),t.isBlazor()&&e.bindEvents(e.dragElement)},this.drag=function(e){var r=e.target,i=o.parent.element.querySelector(".e-cloneproperties");o.parent.trigger(Te,{target:r,draggableType:"headercell",column:o.column}),t.classList(i,["e-defaultcur"],["e-notallowedcur"]),O(r,"e-gridcontent")||O(r,"e-headercell")||t.classList(i,["e-notallowedcur"],["e-defaultcur"])},this.dragStop=function(e){if(o.parent.element.classList.remove("e-ungroupdrag"),!O(e.target,"e-gridcontent")&&!O(e.target,"e-gridheader"))return void t.remove(e.helper)},this.drop=function(e){var r=o.parent,i=r.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid"));if(o.element.classList.remove("e-hover"),t.remove(e.droppedElement),o.aria.setDropTarget(o.parent.element.querySelector(".e-groupdroparea"),!1),o.aria.setGrabbed(o.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),t.isNullOrUndefined(i)||!1===i.allowGrouping||O(r.getColumnHeaderByUid(i.uid),"e-grid").getAttribute("id")!==r.element.getAttribute("id"))return void o.parent.log("action_disabled_column",{moduleName:o.getModuleName(),columnName:i.headerText});o.groupColumn(i.field)},this.contentRefresh=!0,this.aria=new Ot,this.parent=e,this.groupSettings=r,this.serviceLocator=n,this.sortedColumns=i,this.focus=n.getService("focus"),this.addEventListener(),this.groupGenerator=new Et(this.parent)}return e.prototype.columnDrag=function(e){this.parent;var r=this.parent.element.querySelector(".e-cloneproperties");t.classList(r,["e-defaultcur"],["e-notallowedcur"]),O(e.target,"e-groupdroparea")||this.parent.allowReordering&&O(e.target,"e-headercell")||t.classList(r,["e-notallowedcur"],["e-defaultcur"]),e.target.classList.contains("e-groupdroparea")?this.element.classList.add("e-hover"):this.element.classList.remove("e-hover")},e.prototype.columnDragStart=function(e){if(!e.target.classList.contains("e-stackedheadercell")){this.parent;var t=this.parent.element.querySelector(".e-groupdroparea");this.aria.setDropTarget(t,e.column.allowGrouping);var r=e.target.classList.contains("e-headercell")?e.target:O(e.target,"e-headercell");this.aria.setGrabbed(r,!0,!e.column.allowGrouping)}},e.prototype.columnDrop=function(e){var r=this.parent;if("grouping"===e.droppedElement.getAttribute("action")){var i=r.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid"));if(t.isNullOrUndefined(i)||!1===i.allowGrouping||O(r.getColumnHeaderByUid(i.uid),"e-grid").getAttribute("id")!==r.element.getAttribute("id"))return;this.ungroupColumn(i.field)}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Be,this.enableAfterRender,this),this.parent.on("grouping-complete",this.onActionComplete,this),this.parent.on("ungrouping-complete",this.onActionComplete,this),this.parent.on(qe,this.onPropertyChanged,this),this.parent.on(Ge,this.clickHandler,this),this.parent.on(Te,this.columnDrag,this),this.parent.on(Ee,this.columnDragStart,this),this.parent.on(De,this.columnDrop,this),this.parent.on(Ue,this.refreshSortIcons,this),this.parent.on("sorting-complete",this.refreshSortIcons,this),this.parent.on(Ve,this.keyPressHandler,this),this.parent.on(Ne,this.initialEnd,this),this.parent.on(Le,this.initialEnd,this),this.parent.on(Ae,this.render,this),this.parent.on("group-aggregates",this.onGroupAggregates,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ae,this.render),this.parent.off(Be,this.enableAfterRender),this.parent.off("grouping-complete",this.onActionComplete),this.parent.off("ungrouping-complete",this.onActionComplete),this.parent.off(qe,this.onPropertyChanged),this.parent.off(Ge,this.clickHandler),this.parent.off(Te,this.columnDrag),this.parent.off(Ee,this.columnDragStart),this.parent.off(De,this.columnDrop),this.parent.off(Ue,this.refreshSortIcons),this.parent.off("sorting-complete",this.refreshSortIcons),this.parent.off(Ve,this.keyPressHandler),this.parent.off("group-aggregates",this.onGroupAggregates))},e.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off(Ne,this.initialEnd),this.parent.off(Le,this.initialEnd),this.parent.getColumns().length&&this.groupSettings.columns.length){this.contentRefresh=!1;for(var t=0,r=e.groupSettings.columns;t<r.length;t++){var i=r[t];this.groupColumn(i)}this.contentRefresh=!0}},e.prototype.keyPressHandler=function(e){var r=this.parent;if(this.groupSettings.columns.length&&-1!==["altDownArrow","altUpArrow","ctrlDownArrow","ctrlUpArrow","enter"].indexOf(e.action))switch(e.preventDefault(),e.action){case"altDownArrow":case"altUpArrow":var i=r.allowSelection?r.getSelectedRowIndexes():[];if(i.length){for(var n=r.getContentTable().querySelector("tbody").children,o=void 0,s=r.getDataRows()[i[i.length-1]].rowIndex;s>=0;s--)if(!n[s].classList.contains("e-row")&&!n[s].classList.contains("e-detailrow")){o=n[s];break}this.expandCollapseRows(o.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"enter":if(this.parent.isEdit||null!==t.closest(e.target,"#"+this.parent.element.id+"_searchbar"))return;var l=this.focus.getFocusedElement(),a=l?l.parentElement.querySelector('[class^="e-record"]'):null;if(!a)break;this.expandCollapseRows(a)}},e.prototype.clickHandler=function(e){this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},e.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname"))},e.prototype.toogleGroupFromHeader=function(e){this.groupSettings.showToggleButton&&(e.classList.contains("e-grptogglebtn")?e.classList.contains("e-toggleungroup")?this.ungroupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname")))},e.prototype.applySortFromTarget=function(e){var r=this.parent,i=t.closest(e,".e-groupheadercell");if(r.allowSorting&&i&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")){var n=i.firstElementChild.getAttribute("ej-mappingname");r.getColumnHeaderByField(n).querySelectorAll(".e-ascending").length?r.sortColumn(n,"Descending",!0):r.sortColumn(n,"Ascending",!0)}},e.prototype.expandCollapseRows=function(e){var r=O(e,"e-recordplusexpand")||O(e,"e-recordpluscollapse");if(r){var i=r.cellIndex,n=r.parentElement.rowIndex,o=this.parent.getContentTable().querySelector("tbody").children,s=[].slice.call(o).slice(n+1,o.length),l=void 0,a=void 0,d=[],c=this.parent,h=r.parentElement.querySelectorAll(".e-indentcell").length,p=!1;if(r.classList.contains("e-recordpluscollapse")?(t.addClass([r],"e-recordplusexpand"),t.removeClass([r],"e-recordpluscollapse"),r.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",p=!0,se(c)&&this.updateVirtualRows(c,e,p,void 0,void 0)):(l=!0,t.removeClass([r],"e-recordplusexpand"),t.addClass([r],"e-recordpluscollapse"),r.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",se(c)&&this.updateVirtualRows(c,e,!l,void 0,void 0)),this.aria.setExpand(r,p),!se(c))for(var u=0,g=s.length;u<g&&(s[u].querySelectorAll("td")[i]&&s[u].querySelectorAll("td")[i].classList.contains("e-indentcell")&&s);u++)l?s[u].style.display="none":s[u].querySelectorAll(".e-indentcell").length===h+1&&(s[u].style.display="",(a=s[u].querySelector(".e-recordplusexpand"))&&d.push(a),s[u].classList.contains("e-detailrow")&&s[u-1].querySelectorAll(".e-detailrowcollapse").length&&(s[u].style.display="none"));for(var u=0,g=d.length;u<g;u++)t.removeClass([d[u]],"e-recordplusexpand"),t.addClass([d[u]],"e-recordpluscollapse"),d[u].firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",this.expandCollapseRows(d[u])}},e.prototype.updateVirtualRows=function(e,t,r,i,n){var o=e.getRowObjectFromUID(t.closest("tr").getAttribute("data-uid"));o.isExpand=r,m(e),(i=e.getDataModule().generateQuery(!1)).queries=[];var s={requestType:"virtualscroll",rowObject:o};e.getDataModule().getData(s,i.requiresCount()).then(function(t){return e.renderModule.dataManagerSuccess(t,s)})},e.prototype.expandCollapse=function(e){for(var t,r=this.parent.getContentTable().querySelector("tbody").children,i=0,n=r.length;i<n;i++)r[i].querySelectorAll(".e-recordplusexpand, .e-recordpluscollapse").length?((t=r[i].querySelector(e?".e-recordpluscollapse":".e-recordplusexpand"))&&(t.className=e?"e-recordplusexpand":"e-recordpluscollapse",t.firstElementChild.className=e?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow"),r[i].firstElementChild.classList.contains("e-recordplusexpand")||r[i].firstElementChild.classList.contains("e-recordpluscollapse")||(r[i].style.display=e?"":"none")):r[i].style.display=e?"":"none"},e.prototype.expandAll=function(){this.expandCollapse(!0)},e.prototype.collapseAll=function(){this.expandCollapse(!1)},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderGroupDropArea(),this.initDragAndDrop(),this.refreshToggleBtn()},e.prototype.renderGroupDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");e&&t.remove(e),this.element=this.parent.createElement("div",{className:"e-groupdroparea",attrs:{tabindex:"-1"}}),this.updateGroupDropArea(),this.parent.element.insertBefore(this.element,this.parent.element.firstChild),this.groupSettings.showDropArea||(this.element.style.display="none")},e.prototype.updateGroupDropArea=function(e){if(this.groupSettings.showDropArea&&!this.groupSettings.columns.length){var t=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=t,this.element.classList.remove("e-grouped")}else(this.element.innerHTML===this.l10n.getConstant("GroupDropArea")&&(1===this.groupSettings.columns.length||!this.isAppliedGroup&&!this.isAppliedUnGroup)||e)&&(this.element.innerHTML=""),this.element.classList.add("e-grouped")},e.prototype.initDragAndDrop=function(){this.initializeGHeaderDrop(),this.initializeGHeaderDrag()},e.prototype.initializeGHeaderDrag=function(){new t.Draggable(this.element,{dragTarget:".e-groupheadercell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop})},e.prototype.initializeGHeaderDrop=function(){this.parent,new t.Droppable(this.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.groupColumn=function(e){var r=this.parent,i=r.getColumnByField(e);return t.isNullOrUndefined(i)||!1===i.allowGrouping||this.contentRefresh&&this.groupSettings.columns.indexOf(e)>-1?void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:i.headerText}):_(r)?void r.notify(it,{instance:this,handler:this.groupColumn,arg1:e}):(i.visible=r.groupSettings.showGroupedColumn,this.colName=e,this.isAppliedGroup=!0,this.contentRefresh?this.updateModel():this.addColToGroupDrop(e),this.updateGroupDropArea(),void(this.isAppliedGroup=!1))},e.prototype.ungroupColumn=function(e){var r=this.parent,i=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:r.getColumnByField(e);if(!(t.isNullOrUndefined(i)||!1===i.allowGrouping||this.groupSettings.columns.indexOf(e)<0)){if(_(r))return void r.notify(it,{instance:this,handler:this.ungroupColumn,arg1:e});i.visible=!0,this.colName=i.field;var n=JSON.parse(JSON.stringify(this.groupSettings.columns));if(n.splice(n.indexOf(this.colName),1),this.sortedColumns.indexOf(e)<0)for(var o=0,s=r.sortSettings.columns.length;o<s;o++)if(e===r.sortSettings.columns[o].field){r.sortSettings.columns.splice(o,1);break}this.groupSettings.columns=n,r.allowGrouping&&(this.isAppliedUnGroup=!0,this.parent.dataBind())}},e.prototype.updateModel=function(){this.parent;var e=JSON.parse(JSON.stringify(this.groupSettings.columns));e.push(this.colName),this.groupSettings.columns=e,this.groupAddSortingQuery(this.colName),this.parent.dataBind()},e.prototype.onActionComplete=function(e){this.parent;"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName);var r=this.groupSettings.columns.indexOf(this.colName)>-1?{columnName:this.colName,requestType:"grouping",type:xe}:{requestType:"ungrouping",type:xe};this.parent.trigger(xe,t.extend(e,r)),this.colName=null},e.prototype.groupAddSortingQuery=function(e){for(var t=0;t<this.parent.sortSettings.columns.length&&this.parent.sortSettings.columns[t].field!==e;)t++;this.parent.sortSettings.columns.length===t?this.parent.sortSettings.columns.push({field:e,direction:"Ascending",isFromGroup:!0}):this.parent.allowSorting||(this.parent.sortSettings.columns[t].direction="Ascending")},e.prototype.addColToGroupDrop=function(e){var r=this.parent,i="Ascending",n=this.parent.createElement("div",{className:"e-grid-icon e-groupheadercell"}),o=this.parent.createElement("div",{attrs:{"ej-mappingname":e}}),s=this.parent.getColumnByField(e);if(!t.isNullOrUndefined(s)){var l=r.getColumnHeaderByUid(s.uid);o.appendChild(this.parent.createElement("span",{className:"e-grouptext",innerHTML:s.headerText,attrs:{tabindex:"-1","aria-label":"sort the grouped column"}})),this.groupSettings.showToggleButton&&o.appendChild(this.parent.createElement("span",{className:"e-togglegroupbutton e-icons e-icon-ungroup e-toggleungroup",innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":"ungroup button"}})),l.querySelectorAll(".e-ascending,.e-descending").length&&(i=l.querySelector(".e-ascending")?"Ascending":"Descending"),o.appendChild(this.parent.createElement("span",{className:"e-groupsort e-icons e-"+i.toLowerCase()+" e-icon-"+i.toLowerCase(),innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":"sort the grouped column"}})),o.appendChild(this.parent.createElement("span",{className:"e-ungroupbutton e-icons e-icon-hide",innerHTML:"&nbsp;",attrs:{title:this.l10n.getConstant("UnGroup"),tabindex:"-1","aria-label":"ungroup the grouped column"},styles:this.groupSettings.showUngroupButton?"":"display:none"})),n.appendChild(o),this.element.appendChild(n)}},e.prototype.refreshToggleBtn=function(e){if(this.groupSettings.showToggleButton)for(var r=[].slice.call(this.parent.element.getElementsByClassName("e-headercelldiv")),i=0,n=r.length;i<n;i++)if(!r[i].classList.contains("e-emptycell")&&!r[i].classList.contains("e-headerchkcelldiv")){var o=this.parent.getColumnByUid(r[i].getAttribute("e-mappinguid"));(!this.parent.showColumnMenu||this.parent.showColumnMenu&&!o.showColumnMenu)&&(r[i].querySelectorAll(".e-grptogglebtn").length&&t.remove(r[i].querySelectorAll(".e-grptogglebtn")[0]),e||r[i].appendChild(this.parent.createElement("span",{className:"e-grptogglebtn e-icons "+(this.groupSettings.columns.indexOf(o.field)>-1?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":"Group button"}})))}},e.prototype.removeColFromGroupDrop=function(e){t.isNullOrUndefined(this.getGHeaderCell(e))||(t.remove(this.getGHeaderCell(e)),this.updateGroupDropArea()),this.isAppliedUnGroup=!1},e.prototype.onPropertyChanged=function(e){var t=this;if(e.module===this.getModuleName())for(var r=this,i=0,n=Object.keys(e.properties);i<n.length;i++)!function(i){switch(i){case"columns":var n=void 0;if(r.contentRefresh){if(r.isAppliedUnGroup)n={requestType:"ungrouping",type:Se};else{if(!r.isAppliedGroup){r.updateGroupDropArea(!0);for(var o=0;o<r.groupSettings.columns.length;o++)r.colName=r.groupSettings.columns[o],r.parent.getColumnByField(r.colName).visible=r.parent.groupSettings.showGroupedColumn,r.groupAddSortingQuery(r.colName),o<r.groupSettings.columns.length-1&&r.addColToGroupDrop(r.groupSettings.columns[o])}n={columnName:r.colName,requestType:e.properties[i].length?"grouping":"ungrouping",type:Se}}r.groupSettings.showGroupedColumn||e.oldProperties[i].forEach(function(r){-1===e.properties[i].indexOf(r)&&(t.parent.getColumnByField(r).visible=!0)}),r.parent.notify(ze,n)}break;case"showDropArea":r.updateGroupDropArea(),r.groupSettings.showDropArea?r.element.style.display="":r.element.style.display="none";break;case"showGroupedColumn":r.updateGroupedColumn(r.groupSettings.showGroupedColumn),r.parent.notify(ze,{requestType:"refresh"});break;case"showUngroupButton":r.updateButtonVisibility(r.groupSettings.showUngroupButton,"e-ungroupbutton");break;case"showToggleButton":r.updateButtonVisibility(r.groupSettings.showToggleButton,"e-togglegroupbutton "),r.parent.refreshHeader()}}(n[i])},e.prototype.updateGroupedColumn=function(e){for(var t=0;t<this.groupSettings.columns.length;t++)this.parent.getColumnByField(this.groupSettings.columns[t]).visible=e},e.prototype.updateButtonVisibility=function(e,t){for(var r=[].slice.call(this.element.querySelectorAll("."+t)),i=0;i<r.length;i++)r[i].style.display=e?"":"none"},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.isDestroyed||this.parent.refreshing||this.clearGrouping(),this.removeEventListener(),this.refreshToggleBtn(!0),t.remove(this.element))},e.prototype.clearGrouping=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));this.contentRefresh=!1;for(var t=0,r=e.length;t<r;t++)t===r-1&&(this.contentRefresh=!0),this.ungroupColumn(e[t]);this.contentRefresh=!0},e.prototype.getModuleName=function(){return"group"},e.prototype.refreshSortIcons=function(e){var r,i=this.parent,n=i.sortSettings.columns,o=i.groupSettings.columns,s=this.parent.getColumns().map(function(e){return e.field});this.refreshToggleBtn();for(var l=0,a=n.length;l<a;l++)-1!==s.indexOf(n[l].field)&&(r=i.getColumnHeaderByField(n[l].field),!i.allowSorting&&(this.sortedColumns.indexOf(n[l].field)>-1||this.groupSettings.columns.indexOf(n[l].field)>-1)?(t.classList(r.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),n.length>1&&r.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(l+1).toString()}))):this.getGHeaderCell(n[l].field)&&this.getGHeaderCell(n[l].field).querySelectorAll(".e-groupsort").length&&("Ascending"===n[l].direction?t.classList(this.getGHeaderCell(n[l].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):t.classList(this.getGHeaderCell(n[l].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])));for(var l=0,a=o.length;l<a;l++)-1!==s.indexOf(o[l])&&i.getColumnHeaderByField(o[l]).setAttribute("aria-grouped","true")},e.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[ej-mappingname="'+e+'"]')?this.element.querySelector('[ej-mappingname="'+e+'"]').parentElement:null},e.prototype.onGroupAggregates=function(e){var t=this,r=this.iterateGroupAggregates(e),i=this.groupGenerator.generateRows(r,{}),n=this.parent.getRowsObject().filter(function(e){return!e.isDataRow});i.filter(function(e){return!e.isDataRow}).forEach(function(e,r){var i={cells:e.cells.filter(function(e){return e.isDataCell}),data:e.data,dataUid:n[r]?n[r].uid:""};t.parent.notify("refresh-aggregate-cell",i)})},e.prototype.iterateGroupAggregates=function(e){var t=e instanceof Array?e:[],i=this.parent.getRowsObject(),n=this.parent.getCurrentViewRecords(),o=[],s=i.map(function(e){return"delete"===e.edit&&o.push(e.data),e.changes instanceof Object?e.changes:e.data}),l=this.parent.getPrimaryKeyFieldNames()[0];s=0===t.length?s:t;var a=n.map(function(e){var t,i=r.DataUtil.getObject(l,e);return s.some(function(e){return t=e,i===r.DataUtil.getObject(l,e)})?t:e}),d=e;(!d.type||"cancel"!==d.type)&&o.length>0&&o.forEach(function(e){var t=a.indexOf(e);a.splice(t,1)});var c=[];this.parent.aggregates.forEach(function(e){e.columns.forEach(function(e){var t={};t={type:e.type.toString().toLowerCase(),field:e.field},c.push(t)})});var h,p;return this.parent.groupSettings.columns.forEach(function(e){p=h||a,h=r.DataUtil.group(p,e,c,null,null)}),h},e}(),yi=function(){function r(e,t){this.aria=new Ot,this.parent=e,this.parent.isDestroyed||(this.focus=t.getService("focus"),this.parent.on(Ge,this.clickHandler,this),this.parent.on(_e,this.destroy,this),this.parent.on(Ve,this.keyPressHandler,this),this.parent.on(at,this.expand,this),this.parent.on(Ke,this.refreshColSpan,this))}return r.prototype.clickHandler=function(e){this.toogleExpandcollapse(t.closest(e.target,"td"))},r.prototype.toogleExpandcollapse=function(r){var i,n=this.parent;if(r&&(r.classList.contains("e-detailrowcollapse")||r.classList.contains("e-detailrowexpand"))){var o=r.parentElement,s=o.getAttribute("data-uid"),l=n.getRowObjectFromUID(s),a=this.parent.getContentTable().querySelector("tbody").children[o.rowIndex+1];if(r.classList.contains("e-detailrowcollapse")){var d=l.data;if(this.isDetailRow(a))a.style.display="";else if(n.getDetailTemplate()||n.childGrid){var c=N("grid-row"),h=this.parent.createElement("tr",{className:"e-detailrow",attrs:{"data-uid":c}}),p=this.parent.createElement("td",{className:"e-detailcell"}),u=this.parent.getVisibleColumns().length;this.parent.allowRowDragAndDrop&&u++,p.setAttribute("colspan",u.toString());for(var g=new ft({isDataRow:!0,isExpand:!0,uid:c,isDetailRow:!0,cells:[new mt({cellType:e.CellType.Indent}),new mt({isDataCell:!0,visible:!0})]}),f=0,m=n.groupSettings.columns.length;f<m;f++)h.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),g.cells.unshift(new mt({cellType:e.CellType.Indent}));if(h.appendChild(this.parent.createElement("td",{className:"e-detailindentcell"})),h.appendChild(p),o.parentNode.insertBefore(h,o.nextSibling),n.detailTemplate){var y=n.element.id+"detailTemplate";B(p,n.getDetailTemplate()(d,n,"detailTemplate",y)),t.isBlazor()&&t.updateBlazorTemplate(y,"DetailTemplate",n,!1)}else{(i=new Br(this.getGridModel(n,l,n.printMode))).query&&(i.query=i.query.clone()),i.parentDetails={parentID:n.element.id,parentPrimaryKeys:n.getPrimaryKeyFieldNames(),parentKeyField:n.childGrid.queryString,parentKeyFieldValue:d[n.childGrid.queryString],parentRowData:d},n.isPrinting&&(i.isPrinting=!0,i.on(Ne,this.promiseResolve(i),this),i.on(Le,this.promiseResolve(i),this)),l.childGrid=i;var v=i.getInjectedModules(),C=n.getInjectedModules();v&&v.length===C.length||i.setInjectedModules(C);var w=this.parent.createElement("div",{id:"child"+L(o,"e-grid").length+"_grid"+o.rowIndex+N("")});p.appendChild(w),i.appendTo(w)}h.appendChild(p),o.nextSibling?o.parentNode.insertBefore(h,o.nextSibling):o.parentNode.appendChild(h),n.getRows().splice(o.rowIndex+1,0,h),n.getRowsObject().splice(l.index+1,0,g),n.trigger("detailDataBound",{detailElement:p,data:d,childGrid:i}),n.notify("detailDataBound",{rows:n.getRowsObject()})}t.classList(r,["e-detailrowexpand"],["e-detailrowcollapse"]),t.classList(r.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),l.isExpand=!0,this.aria.setExpand(r,!0)}else this.isDetailRow(a)&&(a.style.display="none"),t.classList(r,["e-detailrowcollapse"],["e-detailrowexpand"]),t.classList(r.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),l.isExpand=!1,this.aria.setExpand(r,!1)}},r.prototype.getGridModel=function(e,t,r){var i;return e.isPrinting&&t.isExpand&&e.expandedRows&&e.expandedRows[t.index]&&e.expandedRows[t.index].gridModel?(e.expandedRows[t.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,i=e.expandedRows[t.index].gridModel):e.isPrinting&&e.childGrid.allowPaging?(e.childGrid.allowPaging="CurrentPage"===r,i=e.childGrid):i=e.childGrid,i},r.prototype.promiseResolve=function(e){var t=this;return function(){e.off(Ne,t.promiseResolve),e.off(Le,t.promiseResolve),e.notify(lt,{})}},r.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},r.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.off(Ge,this.clickHandler),this.parent.off(_e,this.destroy),this.parent.off(Ve,this.keyPressHandler),this.parent.off(at,this.expand),this.parent.off(Ke,this.refreshColSpan))},r.prototype.getTDfromIndex=function(e,t){var r=this.parent.getDataRows()[e];return r&&r.querySelector(t)?r.querySelector(t):null},r.prototype.expand=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowcollapse")),e&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},r.prototype.collapse=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowexpand")),e&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},r.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(xe,{requestType:"expandAllComplete",type:xe,moduleObj:this})},r.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(xe,{requestType:"collapseAllComplete",type:xe,moduleObj:this})},r.prototype.expandCollapse=function(e){for(var t,r=this.parent.getDataRows(),i=0,n=r.length;i<n;i++)t=r[i].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),e?this.expand(t):this.collapse(t)},r.prototype.keyPressHandler=function(e){var t=this.parent;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"altUpArrow":case"altDownArrow":var r=t.allowSelection?t.getSelectedRowIndexes():[];if(r.length){var i=t.getDataRows()[r[r.length-1]].querySelector(".e-detailrowcollapse, .e-detailrowexpand");"altDownArrow"===e.action?this.expand(i):this.collapse(i)}break;case"enter":if(this.parent.isEdit)return;var n=this.focus.getFocusedElement();if(!e.target.classList.contains("e-detailrowcollapse")&&!e.target.classList.contains("e-detailrowexpand"))break;this.toogleExpandcollapse(n)}},r.prototype.refreshColSpan=function(){var e=this.parent.contentModule.getTable().querySelectorAll("tr.e-detailrow"),t=this.parent.getVisibleColumns().length;e.forEach(function(e){e.querySelector(".e-detailcell").setAttribute("colspan",t+"")})},r.prototype.getModuleName=function(){return"detailRow"},r}(),vi=function(){function e(e,t){this.predefinedItems={},this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport"],this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization");for(var e=0,t=["Add","Edit","Update","Delete","Cancel","Print","PdfExport","ExcelExport","WordExport","CsvExport"];e<t.length;e++){var r=t[e],i=r.toLowerCase(),n=i[0].toUpperCase()+i.slice(1);this.predefinedItems[r]={id:this.gridID+"_"+i,prefixIcon:"e-"+i,text:this.l10n.getConstant(n),tooltipText:this.l10n.getConstant(n)}}this.predefinedItems.Search={id:this.gridID+"_search",template:'<div class="e-input-group e-search" role="search">            <input id="'+this.gridID+'_searchbar" class="e-input" name="input" type="search"             placeholder= "'+this.l10n.getConstant("Search")+'"/>            <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"             tabindex="-1" title="'+this.l10n.getConstant("Search")+'" aria-label= "search"></span>             </div>',tooltipText:this.l10n.getConstant("Search"),align:"Right",cssClass:"e-search-wrapper"},this.predefinedItems.ColumnChooser={id:this.gridID+"_columnchooser",cssClass:"e-cc e-ccdiv e-cc-toolbar",suffixIcon:"e-columnchooser-btn",text:this.l10n.getConstant("Columnchooser"),tooltipText:this.l10n.getConstant("Columnchooser"),align:"Right"},this.createToolbar()},e.prototype.getToolbar=function(){return this.toolbar.element},e.prototype.destroy=function(){this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.element?this.toolbar.destroy():this.parent.destroyTemplate(["toolbarTemplate"]),this.unWireEvent(),this.removeEventListener(),t.remove(this.element))},e.prototype.bindSearchEvents=function(){this.searchElement=this.element.querySelector("#"+this.gridID+"_searchbar"),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},e.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new a.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.bindSearchEvents.bind(this)});this.toolbar.isStringTemplate=!0;var r="viewContainerRef";if(this.parent[r]&&(this.toolbar.registeredTemplate={},this.toolbar[r]=this.parent[r]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.toolbarTemplate)if(t.isBlazor()||"string"!=typeof this.parent.toolbarTemplate)if(t.isBlazor()){var i=this.parent.element.id+"toolbarTemplate",n=B(this.element,b(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",i)),o=this.getItem(n);this.toolbar.items.push(o),this.toolbar.appendTo(this.element),t.updateBlazorTemplate(this.parent.element.id+"toolbarTemplate","ToolbarTemplate",this.parent)}else B(this.element,b(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate"));else this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element;else this.toolbar.appendTo(this.element);this.parent.element.insertBefore(this.element,this.parent.getHeaderContent()),this.bindSearchEvents()},e.prototype.refreshToolbarItems=function(e){var t=this.parent,r=[],i=[],n=t.editSettings,o=t.currentViewData&&t.currentViewData.length;n.allowAdding?r.push(this.gridID+"_add"):i.push(this.gridID+"_add"),n.allowEditing&&o?r.push(this.gridID+"_edit"):i.push(this.gridID+"_edit"),n.allowDeleting&&o?r.push(this.gridID+"_delete"):i.push(this.gridID+"_delete"),"Batch"===t.editSettings.mode?t.element.querySelectorAll(".e-updatedtd").length&&(n.allowAdding||n.allowEditing)?(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")):(i.push(this.gridID+"_update"),i.push(this.gridID+"_cancel")):t.isEdit&&(n.allowAdding||n.allowEditing)?(r=[this.gridID+"_update",this.gridID+"_cancel"],i=[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(i.push(this.gridID+"_update"),i.push(this.gridID+"_cancel")),this.enableItems(r,!0),this.enableItems(i,!1)},e.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)return[];for(var r=0,i=t;r<i.length;r++){var n=i[r];switch(typeof n){case"number":e.push(this.getItemObject(this.items[n]));break;case"string":e.push(this.getItemObject(n));break;default:e.push(this.getItem(n))}}return e},e.prototype.getItem=function(e){var r=this.predefinedItems[e.text];return r?t.extend(r,r,e):e},e.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.gridID+"_"+e}},e.prototype.enableItems=function(e,t){for(var r=0,i=e;r<i.length;r++){var n=i[r],o=this.element.querySelector("#"+n);o&&this.toolbar.enableItems(o.parentElement,t)}},e.prototype.toolbarClickHandler=function(e){var r=this,i=this.parent,n=this.gridID;t.extend(e,{cancel:!1});var o=!t.isBlazor()||this.parent.isJsComponent?e:{item:e.item,cancel:e.cancel,name:e.name},s=e.originalEvent;i.trigger("toolbarClick",o,function(e){if(e.originalEvent=e.originalEvent?e.originalEvent:s,!e.cancel)switch(!t.isNullOrUndefined(e.item)&&e.item.id){case n+"_print":i.print();break;case n+"_edit":i.startEdit();break;case n+"_update":i.endEdit();break;case n+"_cancel":i.closeEdit();break;case n+"_add":i.addRecord();break;case n+"_delete":i.deleteRecord();break;case n+"_search":e.originalEvent.target.id===n+"_searchbutton"&&r.search();break;case n+"_columnchooser":var o=r.parent.element.querySelector(".e-ccdiv"),l=o.getBoundingClientRect().top,a=o.getBoundingClientRect().left,d=e.originalEvent.target;l=o.getBoundingClientRect().top+o.offsetTop,i.createColumnchooser(a,l,d)}})},e.prototype.modelChanged=function(e){"edit"===e.module&&this.refreshToolbarItems()},e.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&this.parent.toolbar&&(this.element&&t.remove(this.element),this.render())},e.prototype.keyUpHandler=function(e){13===e.keyCode&&this.search()},e.prototype.search=function(){this.parent.search(this.searchElement.value)},e.prototype.updateSearchBox=function(){this.searchElement&&(this.searchElement.value=this.parent.searchSettings.key)},e.prototype.wireEvent=function(){this.searchElement&&(this.searchBoxObj=new cr(this.searchElement),t.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent())},e.prototype.unWireEvent=function(){this.searchElement&&(t.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent())},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ae,this.render,this),this.parent.on(Be,this.onPropertyChanged,this),this.parent.on(qe,this.updateSearchBox.bind(this)),this.parent.on(ze,this.refreshToolbarItems,this),this.parent.on(et,this.refreshToolbarItems,this),this.parent.on(qe,this.modelChanged,this),this.parent.on(Re,this.refreshToolbarItems,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ae,this.render),this.parent.off(Be,this.onPropertyChanged),this.parent.off(qe,this.updateSearchBox),this.parent.off(ze,this.refreshToolbarItems),this.parent.off(et,this.refreshToolbarItems),this.parent.off(qe,this.modelChanged),this.parent.off(Re,this.refreshToolbarItems))},e.prototype.getModuleName=function(){return"toolbar"},e}(),Ci=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),wi=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.aggregates={},i.parent=t,i.locator=r,i.modelGenerator=new bt(i.parent),i.addEventListener(),i}return Ci(r,e),r.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:"e-gridfooter"}),r=this.parent.createElement("div",{className:"e-summarycontent"}),i=r;if(this.parent.getFrozenColumns()){var n=this.parent.createElement("div",{className:"e-frozenfootercontent"}),o=this.parent.createElement("div",{className:"e-movablefootercontent"});r.appendChild(n),r.appendChild(o),this.frozenContent=n,this.movableContent=o,i=o}t.Browser.isDevice&&(i.style.overflowX="scroll"),e.appendChild(r),this.setPanel(e),null!=this.parent.getPager()?this.parent.element.insertBefore(e,this.parent.getPager()):this.parent.element.appendChild(e)},r.prototype.renderTable=function(){this.getPanel();var e=this.createContentTable("_footer_table").querySelector(".e-table"),r=this.parent.createElement("tfoot");if(e.appendChild(r),this.parent.getFrozenColumns()){var i=e.cloneNode(!0);this.frozenContent.appendChild(i),this.freezeTable=i,this.movableContent.appendChild(e),t.remove(e.querySelector("colgroup"));var n=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").cloneNode(!0);e.insertBefore(n,e.querySelector("tbody")),this.setColGroup(n)}this.setTable(e)},r.prototype.renderSummaryContent=function(e,r,i,n){var o=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.currentViewData,s=this.modelGenerator.getData(),l=t.isNullOrUndefined(i)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(i,n),a=t.isNullOrUndefined(i)?this.modelGenerator.generateRows(o,e||this.aggregates):this.modelGenerator.generateRows(o,e||this.aggregates,i,n),d=document.createDocumentFragment(),c=new vt(this.locator,null,this.parent);c.element=this.parent.createElement("TR",{className:"e-summaryrow"});for(var h=0,p=s.length;h<p;h++){var u=a[h];if(u){var g=c.render(u,l);d.appendChild(g)}}r.tFoot.appendChild(d),this.aggregates=t.isNullOrUndefined(e)?this.aggregates:e},r.prototype.refresh=function(e){if(this.parent.getFrozenColumns()&&(t.remove(this.getPanel()),this.renderPanel(),this.renderTable(),this.freezeTable.tFoot.innerHTML="",this.renderSummaryContent(e,this.freezeTable,0,this.parent.getFrozenColumns())),this.getTable().tFoot.innerHTML="",this.renderSummaryContent(e,this.getTable(),this.parent.getFrozenColumns()),this.parent.getFrozenColumns()){for(var r=[].slice.call(this.parent.element.querySelector(".e-frozenfootercontent").querySelectorAll(".e-summaryrow")),i=[].slice.call(this.parent.element.querySelector(".e-movablefootercontent").querySelectorAll(".e-summaryrow")),n=0;n<r.length;n++){var o=r[n].getBoundingClientRect().height,s=i[n].getBoundingClientRect().height;o<s?(r[n].classList.remove("e-hide"),r[n].style.height=s+"px"):o>s&&(i[n].classList.remove("e-hide"),i[n].style.height=o+"px")}var l=this.frozenContent;l.offsetHeight||(l.style.height=this.getTable().offsetHeight+"px")}this.onScroll()},r.prototype.refreshCol=function(){var e,t=e=this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0);this.parent.getFrozenColumns()&&(e=oe(t,this.parent.getFrozenColumns()),this.freezeTable.replaceChild(t,this.freezeTable.querySelector("colGroup"))),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},r.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=t.formatUnit(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},r.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.getFrozenColumns()?this.parent.getContent().querySelector(".e-movablecontent").scrollLeft:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},r.prototype.getColFromIndex=function(e){var t=this.parent.getFrozenColumns();return t&&t>e?this.freezeTable.querySelector("colGroup").children[e]:this.getColGroup().children[e-t]},r.prototype.columnVisibilityChanged=function(){this.refresh()},r.prototype.addEventListener=function(){this.parent.on(He,this.refreshCol,this),this.parent.on("column-width-changed",this.onWidthChange,this),this.parent.on("scroll",this.onScroll,this),this.parent.on(Ke,this.columnVisibilityChanged,this),this.parent.on("refresh-footer-rendered",this.refreshFooterRenderer,this)},r.prototype.removeEventListener=function(){this.parent.off(He,this.refreshCol),this.parent.off("column-width-changed",this.onWidthChange),this.parent.off("scroll",this.onScroll),this.parent.off(Ke,this.columnVisibilityChanged),this.parent.off("refresh-footer-rendered",this.refreshFooterRenderer)},r.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},r.prototype.refreshFooterRenderer=function(e){var t=this.onAggregates(e);this.refresh(t)},r.prototype.getIndexByKey=function(e,t){for(var r=this.parent.getPrimaryKeyFieldNames()[0],i=0;i<t.length;i++)if(t[i][r]===e[r])return i;return-1},r.prototype.onAggregates=function(e){var r=this;e=e instanceof Array?e:[];var i=[],n=[],o=!1,s={},l=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.dataSource.dataSource.json.length?this.parent.dataSource.dataSource.json:this.parent.getCurrentViewRecords();if(this.parent.editModule&&(s=this.parent.editModule.getBatchChanges()),Object.keys(s).length){for(a=0;a<l.length;a++)o=!1,s.changedRecords.length&&this.getIndexByKey(l[a],s.changedRecords)>-1&&(o=!0,n.push(s.changedRecords[this.getIndexByKey(l[a],s.changedRecords)])),s.deletedRecords.length&&this.getIndexByKey(l[a],s.deletedRecords)>-1?o=!0:o||n.push(l[a]);if(s.addedRecords.length)for(var a=0;a<s.addedRecords.length;a++)n.push(s.addedRecords[a])}else e.length&&i.push(e[0]),n=e?t.extend(l,i):l;var d=e;d.type&&"cancel"===d.type&&(n=l);var c,h={};return this.parent.aggregates.forEach(function(e){e.columns.forEach(function(e){var t=e.type.toString();c=q(t,n,e,r.parent),h[e.field+" - "+t.toLowerCase()]=c})}),{result:n,count:n.length,aggregates:h}},r}(Tt),bi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Si=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-summarycell",attrs:{role:"gridcell",tabindex:"-1"}}),t}return bi(r,e),r.prototype.getValue=function(e,r,i){var n;return n=t.isNullOrUndefined(i.type)?i.columnName:i.field+" - "+("string"==typeof i.type?i.type.toLowerCase():""),r[i.columnName]?r[i.columnName][n]:""},r.prototype.evaluate=function(e,r,i,n){var o=r.column;if(this.parent.on("refresh-aggregate-cell",this.refreshWithAggregate(e,r),this),!(o.footerTemplate||o.groupFooterTemplate||o.groupCaptionTemplate))return!0;var s=o.getTemplate(r.cellType),l="";if(t.isBlazor()){l=this.parent.element.id+o.guid+s.property}return B(e,s.fn(i[o.columnName],this.parent,s.property,l)),!1},r.prototype.refreshWithAggregate=function(e,r){var i=this,n=r;return function(r){var o=n,s=o.column.columnName?o.column.columnName:null,l=t.isNullOrUndefined(s)?null:r.cells.filter(function(e){return e.column.columnName===s})[0];e.parentElement&&e.parentElement.getAttribute("data-uid")===r.dataUid&&s&&s===l.column.columnName&&i.refreshTD(e,l,r.data)}},r}(It),xi=function(){function r(e,t){this.parent=e,this.locator=t,this.addEventListener()}return r.prototype.getModuleName=function(){return"aggregate"},r.prototype.initiateRender=function(){var t=this,r=this.locator.getService("cellRendererFactory"),i=new Si(this.parent,this.locator);[e.CellType.Summary,e.CellType.CaptionSummary,e.CellType.GroupSummary].forEach(function(e){return r.addCellRenderer(e,i)}),this.footerRenderer=new wi(this.parent,this.locator),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable(),this.locator.register("footerRenderer",this.footerRenderer);var n=function(){t.prepareSummaryInfo(),t.parent.off(Pe,n)};this.parent.on(Pe,n,this),this.parent.on(Pe,this.footerRenderer.refresh,this.footerRenderer)},r.prototype.prepareSummaryInfo=function(){var e=this;me(this.parent.aggregates,function(r){var i=(e.parent.getColumnByField(r.field)||{}).type;t.isNullOrUndefined(r.customFormat)||r.setPropertiesSilent({format:r.customFormat}),r.setPropertiesSilent({format:e.getFormatFromType(r.format,i)}),r.setFormatter(e.parent.locale),r.setPropertiesSilent({columnName:r.columnName||r.field})})},r.prototype.getFormatFromType=function(e,r){if(t.isNullOrUndefined(r)||"string"!=typeof e)return e;var i;switch(r){case"number":i={format:e};break;case"date":i={type:r,skeleton:e};break;case"datetime":i={type:"dateTime",skeleton:e}}return i},r.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){t.isNullOrUndefined(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh();var r=new xt(this.parent);0===new St(this.parent).getData().length&&r.isEmpty()||this.parent.notify(ze,{})}},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ae,this.initiateRender,this),this.parent.on(Be,this.onPropertyChanged,this),this.parent.on("refresh-aggregates",this.refresh,this))},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(Ae,this.initiateRender),this.parent.off(Pe,this.footerRenderer.refresh),this.parent.off(Be,this.onPropertyChanged),this.parent.off("refresh-aggregates",this.refresh))},r.prototype.destroy=function(){this.removeEventListener(),t.remove(this.parent.element.querySelector(".e-gridfooter"))},r.prototype.refresh=function(e){var t=e instanceof Array?e:[e];this.parent.notify("refresh-footer-rendered",t),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",t)},r}(),Ri=function(){function e(e,t){var r=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-r.containerRect.top;return t.entered=i>=0,i+r.options.pageHeight/2>=0},axis:"Y"},down:{check:function(e,t){r.options.container.clientHeight;var i=e.bottom;return t.entered=e.bottom<=r.containerRect.bottom,i-r.options.pageHeight/2<=r.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){var i=e.right;return t.entered=i<r.containerRect.right,i-r.containerRect.width<=r.containerRect.right},axis:"X"},left:{check:function(e,t){var i=e.left;return t.entered=i>0,i+r.containerRect.width>=r.containerRect.left},axis:"X"}},this.element=e,this.options=t}return e.prototype.observe=function(e,r){var i=this;this.containerRect=this.options.container.getBoundingClientRect(),t.EventHandler.add(this.options.container,"wheel",function(){return i.fromWheel=!0},this),t.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,r),this)},e.prototype.check=function(e){var t=this.sentinelInfo[e];return t.check(this.element.getBoundingClientRect(),t)},e.prototype.virtualScrollHandler=function(e,r){var i=this,n="chrome"===t.Browser.info.name?200:100,o=0,s=0,l=t.debounce(e,n),a=t.debounce(e,50);return function(e){var t=e.target.scrollTop,n=e.target.scrollLeft,d=o<t?"down":"up";d=s===n?d:s<n?"right":"left",o=t,s=n;var c=i.sentinelInfo[d];if(-1!==i.options.axes.indexOf(c.axis)){var h=i.check(d);if(c.entered&&r(i.element,c,d,{top:t,left:n},i.fromWheel,h),h){var p=l;"X"===c.axis&&(p=a),p({direction:d,sentinel:c,offset:{top:t,left:n},focusElement:document.activeElement})}i.fromWheel=!1}}},e.prototype.setPageHeight=function(e){this.options.pageHeight=e},e}(),Ei=function(){function e(e){this.cOffsets={},this.cache={},this.data={},this.groups={},this.parent=e,this.model=this.parent.pageSettings,this.rowModelGenerator=this.parent.allowGrouping?new Et(this.parent):new Ct(this.parent)}return e.prototype.generateRows=function(e,t){var r=this,i=t.virtualInfo=t.virtualInfo||this.getData(),n=i.sentinelInfo&&"X"===i.sentinelInfo.axis,o=n||!i.loadNext||i.loadSelf?i.page:i.nextInfo.page,s=[],l=(this.model.pageSize,this.getBlockIndexes(o)),a=[];if(this.checkAndResetCache(t.requestType),se(this.parent)&&this.parent.vcRows.length)return s=this.parent.vcRows;this.parent.enableColumnVirtualization&&i.blockIndexes.forEach(function(e){r.isBlockAvailable(e)&&(r.cache[e]=r.rowModelGenerator.refreshRows(r.cache[e]))}),i.blockIndexes.forEach(function(t){if(!r.isBlockAvailable(t)){var o=r.rowModelGenerator.generateRows(e,{virtualInfo:i,startIndex:r.getStartIndex(t,e)});se(r.parent)&&!r.parent.vcRows.length&&(r.parent.vRows=o,r.parent.vcRows=o);var d=void 0;se(r.parent)?(d=r.model.pageSize/2,r.isBlockAvailable(l[0])||(r.cache[l[0]]=o.slice(0,d)),r.isBlockAvailable(l[1])||(r.cache[l[1]]=o.slice(d,r.model.pageSize))):(d=~~Math.max(o.length,r.model.pageSize)/2,r.isBlockAvailable(l[0])||(r.cache[l[0]]=o.slice(0,d)),r.isBlockAvailable(l[1])||(r.cache[l[1]]=o.slice(d)))}r.parent.groupSettings.columns.length&&!n&&r.cache[t]&&(r.cache[t]=r.updateGroupRow(r.cache[t],t)),s.push.apply(s,r.cache[t]),r.isBlockAvailable(t)&&a.push(t)}),i.blockIndexes=a;return this.parent.allowGrouping?this.parent.currentViewData.records=s.map(function(e){return e.data}):this.parent.currentViewData=s.map(function(e){return e.data}),s},e.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},e.prototype.getPage=function(e){return e%2==0?e/2:(e+1)/2},e.prototype.isBlockAvailable=function(e){return e in this.cache},e.prototype.getData=function(){return{page:this.model.currentPage,blockIndexes:this.getBlockIndexes(this.model.currentPage),direction:"down",columnIndexes:this.parent.getColumnIndexesInView()}},e.prototype.getStartIndex=function(e,t,r){void 0===r&&(r=!0);var i=e%2==0,n=(this.getPage(e)-1)*this.model.pageSize;return r||!i?n:n+~~(this.model.pageSize/2)},e.prototype.getColumnIndexes=function(e){var r=this;void 0===e&&(e=this.parent.getHeaderContent().firstChild);var i=[],n=0|e.scrollLeft,o=Object.keys(this.cOffsets),s=e.getBoundingClientRect().width;n=Math.min(this.cOffsets[o.length-1]-s,n);var l=t.Browser.isDevice?2*s:s/2,a=n+s+(0===n?l:0);return o.some(function(e,t,o){var s=Number(e),d=r.cOffsets[e];return n-l<=d&&a+l>=d&&i.push(s),a+l<d}),i},e.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","grouping","ungrouping","reorder","save","delete"].some(function(t){return e===t});return t&&(this.cache={},this.data={},this.groups={}),t},e.prototype.refreshColOffsets=function(){var e=this,t=0;this.cOffsets={};var r=this.parent.groupSettings.columns.length,i=this.parent.columns,n=i.length,o=function(t){return t.visible&&(e.parent.groupSettings.showGroupedColumn?t.visible:e.parent.groupSettings.columns.indexOf(t.field)<0)};this.parent.groupSettings.columns.forEach(function(t,r){return e.cOffsets[r]=30+(0|e.cOffsets[r-1])}),Array.apply(null,Array(n)).map(function(){return t++}).forEach(function(t,n){t+=r,e.cOffsets[t]=(0|e.cOffsets[t-1])+(o(i[n])?parseInt(i[n].width,10):0)})},e.prototype.updateGroupRow=function(e,t){var r=this,i=e[0],n=[];return Object.keys(this.cache).forEach(function(e){Number(e)<t&&(n=n.concat(r.cache[e]))}),i&&i.isDataRow||t%2==0?e:this.iterateGroup(e,n)},e.prototype.iterateGroup=function(e,t){var r=e[0],i=0;return r&&r.isDataRow?e:(e.some(function(e){return t.some(function(t,r){var n=t&&void 0!==t.data.field&&t.data.field===e.data.field&&t.data.key===e.data.key;return n&&(i=r),n})})&&(e.shift(),e=this.iterateGroup(e,t.slice(i))),e)},e.prototype.getRows=function(){var e=this,t=[];return Object.keys(this.cache).forEach(function(r){return t=t.concat(e.cache[r])}),t},e}(),Ti=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Di=function(i){function n(e,t){var r=i.call(this,e,t)||this;return r.prevHeight=0,r.currentInfo={},r.preventEvent=!1,r.actions=["filtering","searching","grouping","ungrouping"],r.offsets={},r.tmpOffsets={},r.virtualEle=new Oi,r.offsetKeys=[],r.isFocused=!1,r.isSelection=!1,r.isBottom=!1,r.locator=t,r.eventListener("on"),r.parent.on(Ke,r.setVisible,r),r.vgenerator=r.generator,r}return Ti(n,i),n.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(e.RenderType.Header),i.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.content=this.getPanel().firstChild,this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),this.virtualEle.wrapper.style.position="absolute";var t=this.parent.dataSource instanceof r.DataManager&&!this.parent.dataSource.dataSource.offline,n={container:this.content,pageHeight:2*this.getBlockHeight(),debounceEvent:t,axes:this.parent.enableColumnVirtualization?["X","Y"]:["Y"]};this.observer=new Ri(this.virtualEle.wrapper,n)},n.prototype.renderEmpty=function(e){this.getTable().appendChild(e),this.virtualEle.adjustTable(0,0)},n.prototype.scrollListener=function(e){if(this.parent.enablePersistence&&(this.parent.scrollPosition=e.offset),this.preventEvent||this.parent.isDestroyed)return void(this.preventEvent=!1);t.isNullOrUndefined(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===t.closest(document.activeElement,".e-content")||this.content===document.activeElement;var r=e.sentinel,i=this.currentInfo=this.getInfoFromView(e.direction,r,e.offset);return se(this.parent)?"Y"===r.axis&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()&&"up"===e.direction&&2!==i.blockIndexes[i.blockIndexes.length-1]?void 0:(i.event="refresh-virtual-block",t.isNullOrUndefined(i.offsets)||(i.offsets.top=this.content.scrollTop),void this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement})):this.prevInfo&&("Y"===r.axis&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()||"X"===r.axis&&this.prevInfo.columnIndexes.toString()===i.columnIndexes.toString())?void(t.Browser.isIE&&this.parent.hideSpinner()):(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?i.columnIndexes:[]),this.parent.pageSettings.currentPage=i.loadNext&&!i.loadSelf?i.nextInfo.page:i.page,void this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement}))},n.prototype.block=function(e){return this.vgenerator.isBlockAvailable(e)},n.prototype.getInfoFromView=function(e,t,r){var i=[],n={direction:e,sentinelInfo:t,offsets:r},o=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height;n.page=this.getPageFromTop(r.top+o,n),n.blockIndexes=i=this.vgenerator.getBlockIndexes(n.page),n.loadSelf=!this.vgenerator.isBlockAvailable(i[n.block]);var s=this.ensureBlocks(n);return n.blockIndexes=s,n.loadNext=!s.filter(function(e){return-1===i.indexOf(e)}).every(this.block.bind(this)),n.event=n.loadNext||n.loadSelf?ze:Ze,n.nextInfo=n.loadNext?{page:Math.max(1,n.page+("down"===e?1:-1))}:{},n.columnIndexes="X"===t.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===t.axis&&(n.event=Ze),n},n.prototype.ensureBlocks=function(e){var t,r=this,i=e.blockIndexes[e.block],n=i,o=Math.max,s="down"===e.direction?[o(i,1),++i,++i]:[o(i-1,1),i,i+1];return s=s.filter(function(e,t){return s.indexOf(e)===t}),this.prevInfo.blockIndexes.toString()===s.toString()?s:((e.loadSelf||"down"===e.direction&&this.isEndBlock(n))&&(s=this.vgenerator.getBlockIndexes(e.page)),s.some(function(e,i){var n=e===(se(r.parent)?r.getGroupedTotalBlocks():r.getTotalBlocks());return n&&(t=i),n}),void 0!==t&&(s=s.slice(0,t+1),0===e.block&&1===s.length&&this.vgenerator.isBlockAvailable(s[0]-1)&&(s=[s[0]-1,s[0]])),s)},n.prototype.appendContent=function(e,r,i){var n=i.virtualInfo.sentinelInfo&&"Y"===i.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==i.virtualInfo.page?this.currentInfo:i.virtualInfo;this.prevInfo=this.prevInfo||i.virtualInfo;var o,s=n.columnIndexes[0]-1,l=this.getColumnOffset(s),a=n.blockIndexes;this.parent.groupSettings.columns.length&&this.refreshOffsets(),"100%"===this.parent.height&&(this.parent.element.style.height="100%");var d=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height,c=this.getTranslateY(this.content.scrollTop,d,n);if(this.virtualEle.adjustTable(l,c),this.parent.enableColumnVirtualization&&this.header.virtualEle.adjustTable(l,0),this.parent.enableColumnVirtualization){var h=n.columnIndexes;o=this.getColumnOffset(h[h.length-1])-this.getColumnOffset(h[0]-1)+"",this.header.virtualEle.setWrapperWidth(o)}this.virtualEle.setWrapperWidth(o,t.Browser.isIE||"edge"===t.Browser.info.name),t.isNullOrUndefined(e.parentNode)||t.remove(e);var p=this.parent.element.querySelector(".e-content").querySelector("tbody");if(p&&(t.remove(p),e=null),(e=this.parent.createElement("tbody")).appendChild(r),this.getTable().appendChild(e),this.parent.groupSettings.columns.length){if(!se(this.parent)&&"up"===n.direction){var u=this.offsets[this.getTotalBlocks()]-this.prevHeight;this.preventEvent=!0;var g=this.content.scrollTop;this.content.scrollTop=g+u}this.setVirtualHeight(),this.observer.setPageHeight(this.getOffset(a[a.length-1])-this.getOffset(a[0]-1))}this.prevInfo=n,this.isFocused&&this.content.focus();var f=Math.ceil(this.getTotalBlocks()/2);this.isBottom&&(this.isBottom=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage===f&&1===a.length&&(this.isBottom=!0,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-2])},n.prototype.onDataReady=function(e){t.isNullOrUndefined(e.count)||(this.count=e.count,this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize)),this.vgenerator.checkAndResetCache(e.requestType),["refresh","filtering","searching","grouping","ungrouping","reorder",void 0].some(function(t){return e.requestType===t})&&this.refreshOffsets(),this.setVirtualHeight(),this.resetScrollPosition(e.requestType)},n.prototype.setVirtualHeight=function(){var e=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length+this.parent.groupSettings.columns.length-1)+"px":"100%";this.virtualEle.setVirtualHeight(this.offsets[se(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks()],e),this.parent.enableColumnVirtualization&&this.header.virtualEle.setVirtualHeight(1,e)},n.prototype.getPageFromTop=function(e,t){var r=this,i=se(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),n=0;this.offsets[i],this.prevHeight;return this.offsetKeys.some(function(o){var s=Number(o),l=e<=r.offsets[o]||s===i&&e>r.offsets[o];return l&&(t.block=s%2==0?1:0,n=Math.max(1,Math.min(r.vgenerator.getPage(s),r.maxPage))),l}),n},n.prototype.getTranslateY=function(e,t,r,i){void 0===r&&((r={page:this.getPageFromTop(e+t,{})}).blockIndexes=this.vgenerator.getBlockIndexes(r.page));var n=(r.blockIndexes[0]||1)-1,o=this.getOffset(n),s=this.getOffset(r.blockIndexes[r.blockIndexes.length-1]);i&&(r=this.prevInfo);var l=o>e?this.getOffset(n-1):s<e+t?this.getOffset(n+1):o,a=this.offsets[r.blockIndexes[r.blockIndexes.length-1]]-this.tmpOffsets[r.blockIndexes[0]];return l+a>this.offsets[se(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks()]&&(l-=l+a-this.offsets[this.getTotalBlocks()]),l},n.prototype.getOffset=function(e){return Math.min(0|this.offsets[e],0|this.offsets[this.maxBlock])},n.prototype.onEntered=function(){var e=this;return function(r,i,n,o,s,l){t.Browser.isIE&&!s&&l&&!e.preventEvent&&e.parent.showSpinner();var a="X"===i.axis,d=e.prevInfo.offsets?e.prevInfo.offsets.top:null,c=e.content.getBoundingClientRect().height,h=e.getColumnOffset(a?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1),p=e.getTranslateY(o.top,c,a&&d===o.top?e.prevInfo:void 0,!0);e.virtualEle.adjustTable(h,Math.min(p,e.offsets[e.maxBlock])),e.parent.enableColumnVirtualization&&e.header.virtualEle.adjustTable(h,0)}},n.prototype.dataBound=function(){this.isSelection&&(this.isSelection=!1,this.parent.selectRow(this.selectedRowIndex))},n.prototype.eventListener=function(e){var t=this;this.parent[e](Pe,this.onDataReady,this),this.parent.addEventListener(Re,this.dataBound.bind(this)),this.parent[e](Ze,this.refreshContentRows,this),this.parent[e]("select-virtual-Row",this.selectVirtualRow,this),this.actions.forEach(function(r){return t.parent[e](r+"-begin",t.onActionBegin,t)});var r=function(){t.observer.observe(function(e){return t.scrollListener(e)},t.onEntered());var e=t.parent;if(e.enablePersistence&&e.scrollPosition){t.content.scrollTop=e.scrollPosition.top;var i={direction:"down",sentinel:t.observer.sentinelInfo.down,offset:e.scrollPosition,focusElement:e.element};t.scrollListener(i),e.enableColumnVirtualization&&(t.content.scrollLeft=e.scrollPosition.left)}t.parent.off(Ne,r)};this.parent.on(Ne,r,this)},n.prototype.getBlockSize=function(){return this.parent.pageSettings.pageSize>>1},n.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},n.prototype.isEndBlock=function(e){var t=this.getTotalBlocks();return e>=t||e===t-1},n.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getBlockSize()<1?1:e.length/this.getBlockSize())},n.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getBlockSize())},n.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[e]},n.prototype.getModelGenerator=function(){return new Ei(this.parent)},n.prototype.resetScrollPosition=function(e){this.actions.some(function(t){return t===e})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0)},n.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},n.prototype.getRows=function(){return this.vgenerator.getRows()},n.prototype.getRowByIndex=function(e){if(se(this.parent))return this.parent.getDataRows()[e];var t=(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize();return this.parent.getDataRows()[e-t]},n.prototype.getVirtualRowIndex=function(e){return(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize()+e},n.prototype.refreshOffsets=function(){var e=this,t=this.parent,r=0,i=this.getBlockSize(),n=se(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();this.prevHeight=this.offsets[n],this.maxBlock=n%2==0?n-2:n-1,this.offsets={},Array.apply(null,Array(n)).map(function(){return++r}).forEach(function(r){var o=(e.vgenerator.cache[r]||[]).length,s=se(e.parent)?t.vcRows.length%i:e.count%i,l=!se(e.parent)&&r in e.vgenerator.cache?o*e.parent.getRowHeight():s&&r===n?s*e.parent.getRowHeight():e.getBlockHeight();e.offsets[r]=(0|e.offsets[r-1])+l,e.tmpOffsets[r]=0|e.offsets[r-1]}),this.offsetKeys=Object.keys(this.offsets),se(this.parent)&&(this.parent.vGroupOffsets=this.offsets),this.parent.enableColumnVirtualization&&this.vgenerator.refreshColOffsets()},n.prototype.refreshVirtualElement=function(){this.vgenerator.refreshColOffsets(),this.setVirtualHeight()},n.prototype.setVisible=function(e){var r,i=this.parent,n=[];(n=this.getRows()).some(function(e){return e.isDataRow&&(r=e),e.isDataRow});var o=!0;!i.groupSettings.columns.length&&r&&(o=!1);for(var s=i.getDataRows(),l=0,a=e.length;l<a;l++){var d=e[l],c=i.getNormalizedColumnIndex(d.uid),h=!0===d.visible?"":"none";if(-1!==c&&r&&c<r.cells.length&&t.setStyleAttribute(this.getColGroup().childNodes[c],{display:h}),!o){var p=void 0;(p=d.visible?this.virtualEle.wrapper.offsetWidth+parseInt(d.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(d.width.toString(),10))>i.width?(this.setDisplayNone(s,c,h,n),this.virtualEle.setWrapperWidth(p+""),this.vgenerator.refreshColOffsets(),this.refreshVirtualElement()):this.refreshContentRows({requestType:"refresh"})}!this.parent.invokedFromMedia&&d.hideAtMedia&&this.parent.updateMediaColumns(d),this.parent.invokedFromMedia=!1}o?this.refreshContentRows({requestType:"refresh"}):this.parent.notify("partial-refresh",{rows:n,args:{isFrozen:!1,rows:n}})},n.prototype.selectVirtualRow=function(e){this.isSelection=!0,this.selectedRowIndex=e.selectedIndex;var t=Math.ceil((e.selectedIndex+1)/this.parent.pageSettings.pageSize),r=this.vgenerator.getBlockIndexes(t),i=this.offsets[r[0]-1];this.parent.getContent().firstElementChild.scrollTop=i},n}(Tt),Ii=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.virtualEle=new Oi,i.gen=new Ei(i.parent),i.parent.on(Ke,i.setVisible,i),i.parent.on(Ze,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?i.refreshUI():null},i),i}return Ti(r,e),r.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().firstChild)),e.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().firstChild,this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.virtualEle.renderPlaceHolder("absolute")},r.prototype.appendContent=function(e){this.virtualEle.wrapper.appendChild(e)},r.prototype.refreshUI=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().firstChild)),e.prototype.refreshUI.call(this)},r.prototype.setVisible=function(e){for(var r,i,n=this.parent,o=0,s=e.length;o<s;o++){var l=e[o];if(i=n.getNormalizedColumnIndex(l.uid),r=l.visible?"":"none",t.setStyleAttribute(this.getColGroup().children[i],{display:r}),n.enableColumnVirtualization&&!n.groupSettings.columns.length){var a=void 0;(a=l.visible?this.virtualEle.wrapper.offsetWidth+parseInt(l.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(l.width.toString(),10))>n.width?(this.setDisplayNone(l,r),this.virtualEle.setWrapperWidth(a+""),this.gen.refreshColOffsets()):this.refreshUI()}else this.refreshUI()}},r.prototype.setDisplayNone=function(e,r){for(var i=0,n=[].slice.apply(this.getTable().querySelectorAll("th.e-headercell"));i<n.length;i++){var o=n[i];if(o.querySelector("[e-mappinguid]")&&o.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===e.uid){t.setStyleAttribute(o,{display:r});break}}},r}(Dt),Oi=function(){function e(){}return e.prototype.renderWrapper=function(e){this.wrapper=t.createElement("div",{className:"e-virtualtable",styles:"min-height:"+t.formatUnit(e)}),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},e.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),this.placeholder=t.createElement("div",{className:"e-virtualtrack",styles:"position:"+e}),this.content.appendChild(this.placeholder)},e.prototype.adjustTable=function(e,t){this.wrapper.style.transform="translate("+e+"px, "+t+"px)"},e.prototype.setWrapperWidth=function(e,t){this.wrapper.style.width=e?e+"px":t?"100%":""},e.prototype.setVirtualHeight=function(e,t){this.placeholder.style.height=e+"px",this.placeholder.style.width=t},e}(),Fi=function(){function t(e,t){this.parent=e,this.locator=t,this.addEventListener()}return t.prototype.getModuleName=function(){return"virtualscroll"},t.prototype.instantiateRenderer=function(){this.parent.log(["limitation","virtual_height"],"virtualization");var t=this.locator.getService("rendererFactory");this.parent.enableColumnVirtualization&&t.addRenderer(e.RenderType.Header,new Ii(this.parent,this.locator)),t.addRenderer(e.RenderType.Content,new Di(this.parent,this.locator)),this.ensurePageSize()},t.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),t=this.parent.height.toString().indexOf("%")<0?this.parent.height:this.parent.element.getBoundingClientRect().height;this.blockSize=~~(t/e);var r=2*this.blockSize,i=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:i<r?r:i}},!0)},t.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Me,this.instantiateRenderer,this),this.parent.on("column-width-changed",this.refreshVirtualElement,this))},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Me,this.instantiateRenderer),this.parent.off("column-width-changed",this.refreshVirtualElement))},t.prototype.refreshVirtualElement=function(t){this.parent.enableColumnVirtualization&&"resize"===t.module&&this.locator.getService("rendererFactory").getRenderer(e.RenderType.Content).refreshVirtualElement()},t.prototype.destroy=function(){this.removeEventListener()},t}(),ki=function(){function e(e){this.parent=e}return e.prototype.addNew=function(e,t){this.isEdit=!1;var r,i;if(i=this.parent.frozenRows&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderContent().querySelector("tbody"):this.parent.getContentTable().querySelector("tbody"),t.row=this.parent.createElement("tr",{className:"e-row e-addedrow"}),i.querySelector(".e-emptyrow")&&i.querySelector(".e-emptyrow").remove(),"Top"===this.parent.editSettings.newRowPosition?i.insertBefore(t.row,i.firstChild):i.appendChild(t.row),t.row.appendChild(this.getEditElement(e,!1,void 0,t,!0)),this.parent.getFrozenColumns()){var n=this.renderMovableform(t.row,t);r=this.parent.frozenRows&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody"):this.parent.getContent().querySelector(".e-movablecontent").querySelector("tbody"),"Top"===this.parent.editSettings.newRowPosition?r.insertBefore(n,r.firstChild):r.appendChild(n),t.row.querySelector(".e-normaledit").setAttribute("colspan",this.parent.getVisibleFrozenColumns()+""),n.setAttribute("colspan",""+(this.parent.getVisibleColumns().length-this.parent.getVisibleFrozenColumns())),"auto"===this.parent.height&&this.parent.notify("frozenHeight",{})}},e.prototype.renderMovableform=function(e,t){var r=e.cloneNode(!0),i=t.movableForm=r.querySelector("form");return this.parent.editSettings.template?(i.innerHTML="",this.appendChildren(i,t.rowData,!1),r):(this.renderMovable(e,r),r.querySelector("colgroup").innerHTML=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").innerHTML,r)},e.prototype.updateFreezeEdit=function(e,t){return t=t.concat([].slice.call(this.getFreezeRow(e).querySelectorAll("td.e-rowcell")))},e.prototype.getFreezeRow=function(e){if(this.parent.getFrozenColumns()){var t=parseInt(e.getAttribute("aria-rowindex"),10),r=this.parent.getContent().querySelector(".e-frozencontent").querySelector("tbody"),i=this.parent.getContent().querySelector(".e-movablecontent").querySelector("tbody"),n=this.parent.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody"),o=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody");if(this.parent.frozenRows&&t>=this.parent.frozenRows&&(t-=this.parent.frozenRows),r.contains(e))return i.children[t];if(i.contains(e))return r.children[t];if(n.contains(e))return o.children[t];if(o.contains(e))return n.children[t]}return e},e.prototype.update=function(e,r){this.isEdit=!0,t.closest(r.row,".e-movablecontent")&&(r.row=this.getFreezeRow(r.row));var i=[].slice.call(r.row.querySelectorAll("td.e-rowcell"));r.row.innerHTML="",i=this.updateFreezeEdit(r.row,i),r.row.appendChild(this.getEditElement(e,!0,i,r,!0)),r.row.classList.add("e-editedrow"),this.refreshFreezeEdit(r.row,r)},e.prototype.refreshFreezeEdit=function(e,t){var r,i,n=e.firstChild,o=parseInt(e.getAttribute("aria-rowindex"),10);if(this.parent.getFrozenColumns()){o<this.parent.frozenRows?(i=this.parent.getHeaderContent(),r=".e-frozenheader"):(i=this.parent.getContent(),r=".e-frozencontent");var s=n.cloneNode(!0),l=t.movableForm=s.querySelector("form");this.parent.editSettings.template&&(l.innerHTML="",this.appendChildren(l,t.rowData,!1));var a=void 0;i.querySelector(r).contains(e)?(a=this.parent.getMovableRowByIndex(o),this.updateFrozenCont(a,n,s)):(a=this.parent.getRowByIndex(o),this.updateFrozenCont(a,s,n)),a.appendChild(s),a.classList.add("e-editedrow")}},e.prototype.updateFrozenCont=function(e,t,r){e.innerHTML="",this.parent.editSettings.template||(this.renderMovable(t,r),r.querySelector("colgroup").innerHTML=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").innerHTML),t.setAttribute("colspan",this.parent.getVisibleFrozenColumns()+""),r.setAttribute("colspan",this.parent.getVisibleColumns().length-this.parent.getVisibleFrozenColumns()+"")},e.prototype.renderMovable=function(e,t){for(var r=this.parent.getFrozenColumns(),i=0;i<r;i++)t.querySelector("tr").removeChild(t.querySelector("tr").children[0]);for(var i=r,n=e.querySelector("tr").childElementCount;i<n;i++)e.querySelector("tr").removeChild(e.querySelector("tr").children[e.querySelector("tr").childElementCount-1])},e.prototype.getEditElement=function(e,r,i,n,o){var s=this.parent,l=0,a=t.isNullOrUndefined(s.detailTemplate)&&t.isNullOrUndefined(s.childGrid)?0:1,d=s.isRowDragable()?1:0;s.allowGrouping&&(l=s.groupSettings.columns.length);var c=this.parent.createElement("td",{className:"e-editcell e-normaledit",attrs:{colspan:(s.getVisibleColumns().length-s.getVisibleFrozenColumns()+l+a+d).toString()}}),h=n.form=this.parent.createElement("form",{id:s.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)return this.appendChildren(h,n.rowData,o),c.appendChild(h),c;var p=this.parent.createElement("table",{className:"e-table e-inline-edit",attrs:{cellspacing:"0.25"}});p.appendChild(s.getContentTable().querySelector("colgroup").cloneNode(!0));var u=this.parent.createElement("tbody"),g=this.parent.createElement("tr"),f=0;for(a&&g.insertBefore(this.parent.createElement("td",{className:"e-detailrowcollapse"}),g.firstChild),s.isRowDragable()&&g.appendChild(this.parent.createElement("td",{className:"e-dragindentcell"}));f<l;)g.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),f++;var m=0;for(f=0;r&&m<i.length&&f<s.getColumns().length||f<s.getColumns().length;){var y=r?i[m].getAttribute("colspan"):null,v=s.getColumns()[f],C=this.parent.createElement("td",{className:"e-rowcell",attrs:{style:"text-align:"+(v.textAlign?v.textAlign:""),colspan:y||""}});v.visible?(C.appendChild(e[v.uid]),"booleanedit"===v.editType?C.classList.add("e-boolcell"):(v.commands||v.commandsTemplate)&&t.addClass([C],"e-unboundcell")):C.classList.add("e-hide"),g.appendChild(C),f=y?f+parseInt(y,10):f+1,m++}return u.appendChild(g),p.appendChild(u),h.appendChild(p),c.appendChild(h),c},e.prototype.removeEventListener=function(){},e.prototype.appendChildren=function(e,r,i){var n=t.extend({},r,{isAdd:!this.isEdit,isFrozen:i},!0);B(e,this.parent.getEditTemplate()(n,this.parent,"editSettingsTemplate"))},e}(),Mi=function(){function e(e){this.parent=e}return e.prototype.update=function(e,r){r.cell.innerHTML="",r.cell.appendChild(this.getEditElement(e,r)),r.cell.classList.remove("e-ellipsistooltip"),r.cell.classList.add("e-editedbatchcell"),t.classList(r.row,["e-editedrow","e-batchrow"],[])},e.prototype.getEditElement=function(e,t){var r=this.parent,i=this.parent.createElement("form",{id:r.element.id+"EditForm",className:"e-gridform"});return i.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),i},e.prototype.removeEventListener=function(){},e}(),Ai=function(){function e(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(nt,this.destroy,this),this.parent.on(_e,this.destroy,this))}return e.prototype.setLocaleObj=function(){this.l10n=this.serviceLocator.getService("localization")},e.prototype.addNew=function(e,t){this.isEdit=!1,this.createDialog(e,t)},e.prototype.update=function(e,t){this.isEdit=!0,this.createDialog(e,t)},e.prototype.createDialog=function(e,r){var n=this.parent;this.dialog=this.parent.createElement("div",{id:n.element.id+"_dialogEdit_wrapper",styles:"width: auto"}),n.element.appendChild(this.dialog),this.setLocaleObj(),this.dialogObj=new i.Dialog(t.extend({header:this.isEdit?this.l10n.getConstant("EditFormTitle")+r.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle"),isModal:!0,visible:!0,cssClass:"e-edit-dialog",content:this.getEditElement(e,r),showCloseIcon:!0,allowDragging:!0,close:this.dialogClose.bind(this),closeOnEscape:!0,width:n.editSettings.template?"auto":"330px",target:r.target?r.target:document.body,animationSettings:{effect:"None"},buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.l10n.getConstant("SaveButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}]},n.editSettings.dialog.params)),t.isBlazor()||(r.dialog=this.dialogObj);this.dialogObj.isStringTemplate=!0,this.dialogObj.appendTo(this.dialog),this.parent.applyBiggerTheme(this.dialogObj.element.parentElement)},e.prototype.btnClick=function(e){this.l10n.getConstant("CancelButton").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialogClose():this.parent.endEdit()},e.prototype.dialogClose=function(){this.parent.closeEdit(),this.destroy()},e.prototype.destroy=function(e){var r=this.parent.element.id+"editSettingsTemplate";t.updateBlazorTemplate(r,"Template",this.parent.editSettings),this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.parent.notify(et,{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),t.remove(this.dialog))},e.prototype.getEditElement=function(e,r){var i=this.parent,n=this.parent.createElement("div",{className:this.isEdit?"e-editedrow":"e-insertedrow"}),o=r.form=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template){var s=this.parent.element.id+"editSettingsTemplate",l=t.extend({},r.rowData,{isAdd:!this.isEdit},!0);return B(o,this.parent.getEditTemplate()(l,this.parent,"editSettingsTemplate",s)),t.updateBlazorTemplate(s,"Template",this.parent.editSettings),n.appendChild(o),n}for(var a=this.parent.createElement("table",{className:"e-table",attrs:{cellspacing:"6px"}}),d=this.parent.createElement("tbody"),c=i.getColumns(),h=0;h<c.length;h++)if(!(this.parent.editModule.checkColumnIsGrouped(c[h])||c[h].commands||c[h].commandsTemplate)){var p=this.parent.createElement("tr"),u=this.parent.createElement("td",{className:"e-rowcell",attrs:{style:"text-align:"+(this.parent.enableRtl?"right":"left")+";width:190px"}});this.parent.createElement("label",{innerHTML:c[h].field});e[c[h].uid].classList.remove("e-input"),u.appendChild(e[c[h].uid]),p.appendChild(u),d.appendChild(p)}return a.appendChild(d),o.appendChild(a),n.appendChild(o),n},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(nt,this.destroy),this.parent.off(_e,this.destroy))},e}(),Pi=function(){function r(e,t){this.editType={Inline:ki,Normal:ki,Batch:Mi,Dialog:Ai},this.parent=e,this.serviceLocator=t,this.renderer=new this.editType[this.parent.editSettings.mode](e,t),this.focus=t.getService("focus")}return r.prototype.addNew=function(e){this.renderer.addNew(this.getEditElements(e),e),this.convertWidget(e)},r.prototype.update=function(e){this.renderer.update(this.getEditElements(e),e),this.parent.notify("edit-form",e),this.convertWidget(e)},r.prototype.convertWidget=function(e){var r,i,n,o=this.parent,s=o.getFrozenColumns(),l="Dialog"===o.editSettings.mode?document.querySelector("#"+o.element.id+"_dialogEdit_wrapper").querySelector(".e-gridform"):o.element.querySelector(".e-gridform");if(s&&"Normal"===o.editSettings.mode){var a=parseInt(e.row.getAttribute("aria-rowindex"),10);n=o.frozenRows&&("add"===e.requestType&&"Top"===o.editSettings.newRowPosition||a<o.frozenRows)?o.element.querySelector(".e-movableheader").querySelector(".e-gridform"):o.element.querySelector(".e-movablecontent").querySelector(".e-gridform")}for(var d="Batch"!==o.editSettings.mode?o.getColumns():[o.getColumnByField(e.columnName)],c=0,h=d;c<h.length;c++){var p=h[c];if(!this.parent.editSettings.template||t.isNullOrUndefined(p.field)){if(!this.parent.editModule.checkColumnIsGrouped(p)&&!p.commands){p.valueAccessor(p.field,e.rowData,p),i=s&&d.indexOf(p)>=s&&"Normal"===o.editSettings.mode?n.querySelector("[e-mappinguid="+p.uid+"]"):l.querySelector("[e-mappinguid="+p.uid+"]");var u=p.edit.write;t.isNullOrUndefined(i)||("string"==typeof u?(u=le(u,window))({rowData:e.rowData,element:i,column:p,requestType:e.requestType,row:e.row,foreignKeyData:p.isForeignColumn()&&le(p.field,e.foreignKeyData)}):p.edit.write({rowData:e.rowData,element:i,column:p,requestType:e.requestType,row:e.row,foreignKeyData:p.isForeignColumn()&&le(p.field,e.foreignKeyData)}),r||i.getAttribute("disabled")||(this.focusElement(i,e.type),r=!0))}}else{var g=t.extend({},e);g.element=l.querySelector("[name="+j(p.field)+"]"),t.isNullOrUndefined(g.element)&&s&&(g.element=n.querySelector("[name="+j(p.field)+"]")),"string"==typeof p.edit.write?le(p.edit.write,window)(g):p.edit.write(g)}}if(!(0===s||this.parent.allowTextWrap||"add"!==e.requestType&&"beginEdit"!==e.requestType||"Dialog"===this.parent.editSettings.mode||t.isNullOrUndefined(l)||t.isNullOrUndefined(n))){var f=n.querySelector("tr").children[0],m=l.querySelector("tr").children[0];m.offsetHeight>f.offsetHeight?f.style.height=m.offsetHeight+"px":m.style.height=f.offsetHeight+"px"}},r.prototype.focusElement=function(e,r){var i=this.parent.element.querySelector(".e-edit-checkselect");t.isNullOrUndefined(i)||i.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode?this.focus.onClick({target:t.closest(e,"td")},!0):e.focus(),e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},r.prototype.getEditElements=function(r){var i=this.parent,n={},o="Batch"!==i.editSettings.mode?i.getColumns():[i.getColumnByField(r.columnName)];if(this.parent.editSettings.template)return{};for(var s=0,l=o.length;s<l;s++){var a=o[s];if(!this.parent.editModule.checkColumnIsGrouped(a))if(a.commands||a.commandsTemplate){var d=this.serviceLocator.getService("cellRendererFactory"),c=new Ct(this.parent),h=d.getCellRenderer(e.CellType.CommandColumn),p=c.generateRows(r.rowData)[0].cells.filter(function(e){return e.rowID}),u=h.render(p[s],r.rowData,{index:r.row?r.row.getAttribute("aria-rowindex"):0});(C=u.firstElementChild).setAttribute("textAlign",u.getAttribute("textAlign")),n[a.uid]=C}else{var g={column:a,value:a.valueAccessor(a.field,r.rowData,a),type:r.requestType,data:r.rowData},f=a.edit.create,m=void 0;if(a.editTemplate){m=this.parent.createElement("span",{attrs:{"e-mappinguid":a.uid}});var y=this.parent.element.id+a.uid+"editTemplate",v=t.extend({},{},r.rowData,!0);B(m,a.getEditTemplate()(v,this.parent,"editTemplate",y)),t.isBlazor()&&t.updateBlazorTemplate(y,"EditTemplate",a)}else{if("string"==typeof(m="string"==typeof f?(f=le(f,window))(g):a.edit.create(g))){var C=this.parent.createElement("div");C.innerHTML=m,m=C.firstChild}var w="input"!==m.tagName&&m.querySelectorAll("input").length,b=j(a.field);t.attributes(w?m.querySelector("input"):m,{name:b,"e-mappinguid":a.uid,id:i.element.id+b}),t.classList(m,["e-input","e-field"],[]),"Right"===a.textAlign&&m.classList.add("e-ralign"),((a.isPrimaryKey||a.isIdentity)&&"beginEdit"===r.requestType||a.isIdentity&&"add"===r.requestType)&&m.setAttribute("disabled","")}n[a.uid]=m}}return n},r.prototype.destroy=function(){this.renderer.removeEventListener()},r}(),Ni=function(){function e(e){this.activeClasses=["e-selectionbackground","e-active"],this.parent=e}return e.prototype.create=function(e){var t=e.column,r="e-field e-boolcell";"checkbox"===t.type&&(r="e-field e-boolcell e-edit-checkselect");var i=j(e.column.field);return this.parent.createElement("input",{className:r,attrs:{type:"checkbox",value:e.value,"e-mappinguid":t.uid,id:this.parent.element.id+i,name:i}})},e.prototype.read=function(e){return e.checked},e.prototype.write=function(e){var r,i;"add"===e.requestType||e.row.classList.contains("e-addedrow");if(t.isNullOrUndefined(e.row)||(r=e.row.querySelector(".e-edit-checkselect")),le(e.column.field,e.rowData)&&(i=JSON.parse(le(e.column.field,e.rowData).toString().toLowerCase())),!t.isNullOrUndefined(r)){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var o=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));i=!!o&&o.isSelected}Q.apply(void 0,[[].slice.call(e.row.querySelectorAll(".e-rowcell")),i].concat(this.activeClasses))}this.obj=new n.CheckBox(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!G(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.checkBoxChange.bind(this)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.checkBoxChange=function(e){if(this.editRow&&"Dialog"!==this.editType){var t=!1;e.checked?(t=!0,this.editRow.setAttribute("aria-selected",t.toString())):this.editRow.removeAttribute("aria-selected"),Q.apply(void 0,[[].slice.call(this.editRow.querySelectorAll(".e-rowcell")),t].concat(this.activeClasses))}},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Bi=function(){function e(e){this.parent=e,this.flag=!1}return e.prototype.create=function(e){var t=j(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new s.DropDownList(t.extend({dataSource:this.parent.dataSource instanceof r.DataManager?this.parent.dataSource:new r.DataManager(this.parent.dataSource),query:(new r.Query).select(e.column.field),enabled:G(e.column,e.requestType,e.element),fields:{value:e.column.field},value:le(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.ddActionComplete.bind(this),created:this.dropdownCreated.bind(this),placeholder:i?"":e.column.headerText,popupHeight:"200px",floatLabelType:i?"Never":"Always",open:this.dropDownOpen.bind(this),sortOrder:"Ascending"},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",j(e.column.field))},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.dropdownCreated=function(e){this.flag=!0},e.prototype.ddActionComplete=function(e){e.result=r.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.flag&&this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result),this.flag=!1},e.prototype.dropDownOpen=function(e){var r=O(this.obj.element,"e-dialog");if("Dialog"===this.parent.editSettings.mode&&!t.isNullOrUndefined(r)){var i=document.querySelector("#"+r.id).ej2_instances[0];e.popup.element.style.zIndex=(i.zIndex+1).toString()}},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Li=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var r=j(e.column.field);return this.instances=new t.Internationalization(this.parent.locale),this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+r,name:r,"e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return this.instances.getNumberParser({format:"n"})(e.value)},e.prototype.write=function(e){var r=e.column,i="Dialog"!==this.parent.editSettings.mode;this.obj=new o.NumericTextBox(t.extend({value:parseFloat(le(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:i?"":e.column.headerText,enabled:G(e.column,e.requestType,e.element),floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always"},r.edit.params)),e.element.setAttribute("name",j(e.column.field)),this.obj.appendTo(e.element)},e.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&this.obj.destroy()},e}(),qi=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var r=e.column;return this.parent.createElement("input",{className:"e-field e-input e-defaultcell",attrs:{type:"text",value:t.isNullOrUndefined(e.value)?"":e.value,"e-mappinguid":r.uid,id:this.parent.element.id+j(r.field),name:j(r.field),style:"text-align:"+r.textAlign}})},e.prototype.read=function(e){return e.value},e.prototype.write=function(e){e.column;var t="Dialog"!==this.parent.editSettings.mode,r={element:e.element,floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",properties:{enableRtl:this.parent.enableRtl,enabled:G(e.column,e.requestType,e.element),placeholder:t?"":e.column.headerText}};o.Input.createInput(r,this.parent.createElement)},e}(),zi=function(){function e(e,t,r){this.args={},this.parent=e,this.renderer=r,this.serviceLocator=t,this.addEventListener()}return e.prototype.clickHandler=function(e){var t=e.target,r=this.parent;(O(t,"e-gridcontent")&&O(O(t,"e-gridcontent"),"e-grid").id===r.element.id||r.frozenRows&&O(t,"e-headercontent"))&&!O(t,"e-unboundcelldiv")&&(this.rowIndex=O(t,"e-rowcell")?parseInt(t.parentElement.getAttribute("aria-rowindex"),10):-1,r.isEdit&&r.editModule.endEdit())},e.prototype.dblClickHandler=function(e){O(e.target,"e-rowcell")&&this.parent.editSettings.allowEditOnDblClick&&this.parent.editModule.startEdit(O(e.target,"e-row"))},e.prototype.editComplete=function(e){switch(this.parent.isEdit=!1,e.requestType){case"save":(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||this.parent.selectRow(0),this.parent.trigger(xe,t.extend(e,{requestType:"save",type:xe}));break;case"delete":if(t.isBlazor()&&!this.parent.isJsComponent){var r="data";e[r]=e[r][0]}this.parent.trigger(xe,t.extend(e,{requestType:"delete",type:xe})),this.parent.selectRow(this.editRowIndex)}},e.prototype.startEdit=function(e){var r=this,i=this.parent,n=i.getPrimaryKeyFieldNames(),o=[];if(this.rowIndex=this.editRowIndex=parseInt(e.getAttribute("aria-rowindex"),10),t.isBlazor())for(var s=this.parent.getColumns(),l=0;l<s.length;l++){var a=s[l];a.template&&t.resetBlazorTemplate(i.element.id+a.uid,"Template",this.rowIndex)}if(se(i)){var d=i.getRowObjectFromUID(e.getAttribute("data-uid"));this.previousData=d.data}else this.previousData=i.getCurrentViewRecords()[this.rowIndex];for(l=0;l<n.length;l++)o.push(le(n[l],this.previousData));this.uid=e.getAttribute("data-uid");var c=i.getRowObjectFromUID(this.uid),h={primaryKey:n,primaryKeyValue:o,requestType:"beginEdit",rowData:this.previousData,rowIndex:this.rowIndex,type:"edit",cancel:!1,foreignKeyData:c&&c.foreignKeyData,target:void 0};t.isBlazor()&&!this.parent.isJsComponent||(h.row=e),i.trigger("beginEdit",h,function(n){n.type="actionBegin",i.trigger(Se,n,function(n){n.cancel||(i.isEdit=!0,n.row=n.row?n.row:e,"Dialog"!==i.editSettings.mode&&i.clearSelection(),"Dialog"===i.editSettings.mode&&i.selectionModule&&(i.selectionModule.preventFocus=!0,n.row.classList.add("e-dlgeditrow")),r.renderer.update(n),r.uid=e.getAttribute("data-uid"),i.editModule.applyFormValidation(),n.type="actionComplete",i.trigger(xe,n),r.args=n,r.parent.allowTextWrap&&r.parent.notify(st,{case:"textwrap"}),t.isBlazor()&&(r.parent.notify(et,{}),i.element.querySelector(".e-gridpopup").style.display="none",r.parent.notify("start-edit",{})))})})},e.prototype.updateRow=function(e,t){var r=this,i=this.parent,n={requestType:"save",type:Se,data:t,cancel:!1,previousData:i.getCurrentViewRecords()[e]};i.showSpinner(),i.notify(rt,n),n.promise?n.promise.then(function(){return i.refresh()}).catch(function(e){return r.edFail(e)}):i.refresh()},e.prototype.editFormValidate=function(){var e=this.parent,t=e.editModule.formObj.validate(),r=!e.editModule.mFormObj||e.editModule.mFormObj.validate();return t&&r},e.prototype.endEdit=function(){var e=this.parent;if(this.parent.isEdit&&this.editFormValidate()){var r=t.extend({},{},this.previousData,!0),i=t.extend(this.args,{requestType:"save",type:Se,data:r,cancel:!1,previousData:this.previousData,selectedRow:e.selectedRowIndex,foreignKeyData:{}}),n="Dialog"===e.editSettings.mode,o=document.querySelector("#"+e.element.id+"_dialogEdit_wrapper"),s=n?o.querySelector(".e-gridform"):e.element.querySelector(".e-gridform");if(r=e.editModule.getCurrentEditedData(s,r),e.getFrozenColumns()&&"Normal"===e.editSettings.mode){var l=e.element.querySelector(".e-movableheader").querySelector(".e-gridform");r=e.frozenRows&&l?e.editModule.getCurrentEditedData(l,r):e.editModule.getCurrentEditedData(e.element.querySelector(".e-movablecontent").querySelector(".e-gridform"),r)}if(n?o.querySelectorAll(".e-editedrow").length:e.element.querySelectorAll(".e-editedrow").length)i.action="edit",e.trigger(Se,i,function(t){t.cancel||(e.showSpinner(),e.notify(rt,t))});else if(i.action="add",i.selectedRow=0,i.index=this.addedRowIndex,e.notify(ze,i),this.addedRowIndex=null,i.cancel)return}},e.prototype.destroyElements=function(){var e=this.parent;e.editModule.destroyWidgets(),e.editModule.destroyForm(),this.parent.notify(nt,{})},e.prototype.editHandler=function(e){var t=this;e.promise?e.promise.then(function(r){return t.edSucc(r,e)}).catch(function(e){return t.edFail(e)}):this.editSuccess(e.data,e)},e.prototype.edSucc=function(e,t){this.editSuccess(e,t)},e.prototype.edFail=function(e){this.editFailure(e)},e.prototype.updateCurrentViewData=function(e){this.parent.getCurrentViewRecords()[this.editRowIndex]=e},e.prototype.requestSuccess=function(e){this.parent.editModule.formObj&&!this.parent.editModule.formObj.isDestroyed&&(this.destroyElements(),this.stopEditStatus(),"Dialog"===this.parent.editSettings.mode&&"add"!==e.action&&this.parent.element.querySelector(".e-dlgeditrow").classList.remove("e-dlgeditrow"))},e.prototype.editSuccess=function(e,r){if(!(t.isNullOrUndefined(e)||e instanceof Array)){r.data=t.extend({},t.extend({},r.rowData,r.data),e)}this.requestSuccess(r),this.parent.trigger("beforeDataBound",r),r.type=xe,this.parent.isEdit=!1,this.refreshRow(r.data),this.updateCurrentViewData(r.data),this.blazorTemplate(),this.parent.trigger(xe,r),t.isBlazor()&&this.parent.notify(et,{}),(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||"Dialog"!==this.parent.editSettings.mode&&this.parent.selectRow(this.rowIndex>-1?this.rowIndex:this.editRowIndex),this.parent.hideSpinner()},e.prototype.blazorTemplate=function(){for(var e=this.parent.getColumns(),r=0;r<e.length;r++){var i=e[r];i.template&&t.updateBlazorTemplate(this.parent.element.id+i.uid,"Template",i,!1),i.editTemplate&&t.updateBlazorTemplate(this.parent.element.id+i.uid+"editTemplate","EditTemplate",i)}},e.prototype.editFailure=function(e){this.parent.trigger("actionFailure",t.isBlazor()&&e instanceof Array?e[0]:e),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e})},e.prototype.refreshRow=function(e){var t=this.parent.getFrozenColumns(),r=new vt(this.serviceLocator,null,this.parent),i=this.parent.getRowObjectFromUID(this.uid);if(i&&(i.changes=e,te(i,this.parent.getForeignKeyColumns(),i.changes),r.refresh(i,this.parent.getColumns(),!0),t)){var n=void 0,o=this.parent.element.querySelector("[data-uid="+i.uid+"]");n=O(o,"e-frozencontent")||O(o,"e-frozenheader")?this.parent.getMovableRows()[i.index].getAttribute("data-uid"):this.parent.getRows()[i.index].getAttribute("data-uid"),(i=this.parent.getRowObjectFromUID(n)).changes=e,r.refresh(i,this.parent.columns,!0)}},e.prototype.closeEdit=function(){var e=this;if(this.parent.isEdit){var r=this.parent,i=t.extend(this.args,{requestType:"cancel",type:Se,data:this.previousData,selectedRow:r.selectedRowIndex});this.blazorTemplate(),r.trigger(Se,i,function(i){"Dialog"===e.parent.editSettings.mode&&e.parent.notify(nt,{}),r.isEdit=!1,e.stopEditStatus(),i.type=xe,"Dialog"!==r.editSettings.mode&&e.refreshRow(i.data),r.getContentTable().querySelector("tr.e-emptyrow")||r.getContentTable().querySelector("tr.e-row")||r.renderModule.emptyRow(),"Dialog"!==r.editSettings.mode&&r.selectRow(e.rowIndex),r.trigger(xe,i),t.isBlazor()&&(e.parent.notify(et,{}),e.parent.notify("close-edit",{}))})}},e.prototype.addRecord=function(e,i){var n=this,o=this.parent;if(this.addedRowIndex=i=t.isNullOrUndefined(i)?0:i,e)return void o.notify(ze,{requestType:"save",type:Se,data:e,selectedRow:0,action:"add",index:i});if(!o.isEdit){this.previousData={},this.uid="",o.columnModel.forEach(function(e){e.field&&r.DataUtil.setValue(e.field,e.defaultValue,n.previousData)});var s={cancel:!1,foreignKeyData:{},requestType:"add",data:this.previousData,type:Se,index:i,rowData:this.previousData,target:void 0};o.trigger(Se,s,function(e){e.cancel||(o.isEdit=!0,"Dialog"!==o.editSettings.mode&&o.clearSelection(),n.renderer.addNew(e),o.editModule.applyFormValidation(),e.type=xe,e.row=o.element.querySelector(".e-addedrow"),o.trigger(xe,e),t.isBlazor()&&(n.parent.notify(et,{}),n.parent.notify("start-add",{})),n.args=e)})}},e.prototype.deleteRecord=function(e,r){if(this.editRowIndex=this.parent.selectedRowIndex,r){r=r instanceof Array?r:[r];var i=this.parent,n=Object.keys(r).length;e=e||this.parent.getPrimaryKeyFieldNames()[0];for(var o=0;o<n;o++)!function(t){var n,o,s=i.currentViewData.some(function(i){return o=i,r[t]===le(e,i)||r[t]===i});r[t]=s?o:(n={},n[e]=r[t],n)}(o)}var s={requestType:"delete",type:Se,foreignKeyData:{},data:r||this.parent.getSelectedRecords(),tr:this.parent.getSelectedRows(),cancel:!1};t.isBlazor()&&!this.parent.isJsComponent&&(s.data=s.data[0]),this.parent.notify(ze,s)},e.prototype.stopEditStatus=function(){var e,r,i=this.parent,n=i.element.querySelector(".e-addedrow");i.getFrozenColumns()&&(e=i.element.querySelectorAll(".e-addedrow")[1],r=i.element.querySelectorAll(".e-editedrow")[1],e&&t.remove(e),r&&r.classList.remove("e-editedrow")),n&&t.remove(n),(n=i.element.querySelector(".e-editedrow"))&&n.classList.remove("e-editedrow")},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("crud-Action",this.editHandler,this),this.parent.on("double-tap",this.dblClickHandler,this),this.parent.on(Ge,this.clickHandler,this),this.parent.on("recordAdded",this.requestSuccess,this),this.parent.on("dblclick",this.dblClickHandler,this),this.parent.on("delete-complete",this.editComplete,this),this.parent.on("save-complete",this.editComplete,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("crud-Action",this.editHandler),this.parent.off("double-tap",this.dblClickHandler),this.parent.off(Ge,this.clickHandler),this.parent.off("recordAdded",this.requestSuccess),this.parent.off("dblclick",this.dblClickHandler),this.parent.off("delete-complete",this.editComplete),this.parent.off("save-complete",this.editComplete))},e.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()},e}(),Hi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ui=function(e){function t(t,r,i){var n=e.call(this,t,r)||this;return n.parent=t,n.serviceLocator=r,n.renderer=i,n}return Hi(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,r){e.prototype.addRecord.call(this,t,r)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,r){e.prototype.updateRow.call(this,t,r)},t.prototype.deleteRecord=function(t,r){e.prototype.deleteRecord.call(this,t,r)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(zi),ji=function(){function i(e,t,r){this.cellDetails={},this.parent=e,this.serviceLocator=t,this.renderer=r,this.focus=t.getService("focus"),this.addEventListener()}return i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ge,this.clickHandler,this),this.parent.on("dblclick",this.dblClickHandler,this),this.parent.on("beforecellfocused",this.onBeforeCellFocused,this),this.parent.on("cellfocused",this.onCellFocused,this),this.dataBoundFunction=this.dataBound.bind(this),this.parent.addEventListener(Re,this.dataBoundFunction),this.parent.on("double-tap",this.dblClickHandler,this),this.parent.on(Ve,this.keyDownHandler,this),this.parent.on("editNextValCell",this.editNextValCell,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ge,this.clickHandler),this.parent.off("dblclick",this.dblClickHandler),this.parent.off("beforecellfocused",this.onBeforeCellFocused),this.parent.off("cellfocused",this.onCellFocused),this.parent.removeEventListener(Re,this.dataBoundFunction),this.parent.off("double-tap",this.dblClickHandler),this.parent.off(Ve,this.keyDownHandler),this.parent.off("editNextValCell",this.editNextValCell))},i.prototype.dataBound=function(){this.parent.notify(et,{})},i.prototype.destroy=function(){this.removeEventListener()},i.prototype.clickHandler=function(e){O(e.target,this.parent.element.id+"_add",!0)||(this.parent.isEdit&&(this.saveCell(),this.editNextValCell()),O(e.target,"e-rowcell")&&!this.parent.isEdit&&this.setCellIdx(e.target))},i.prototype.dblClickHandler=function(e){var t=O(e.target,"e-rowcell"),r=O(e.target,"e-row");t&&r&&!isNaN(parseInt(t.getAttribute("aria-colindex"),10))&&!t.parentElement.classList.contains("e-editedrow")&&this.editCell(parseInt(r.getAttribute("aria-rowindex"),10),this.parent.getColumns()[parseInt(t.getAttribute("aria-colindex"),10)].field,this.isAddRow(parseInt(r.getAttribute("aria-rowindex"),10)))},i.prototype.onBeforeCellFocused=function(e){this.parent.isEdit&&this.validateFormObj()&&(e.byClick||["tab","shiftTab","enter","shiftEnter"].indexOf(e.keyArgs.action)>-1)&&(e.cancel=!0,e.byClick?e.clickArgs.preventDefault():e.keyArgs.preventDefault())},i.prototype.onCellFocused=function(e){var t=this.parent.getFrozenColumns(),r=this.parent.getContent().querySelector(".e-movablecontent"),i=this.parent.getHeaderContent().querySelector(".e-movableheader"),n=!(e.container.isContent&&e.container.isDataCell||this.parent.frozenRows&&e.container.isHeader);if(!e.byKey||n)return void(this.parent.isEdit&&n&&this.saveCell());var o=e.container.indexes,s=o[0],l=o[1];t&&(r.contains(e.element)||this.parent.frozenRows&&i.contains(e.element))&&(l+=t),this.parent.frozenRows&&e.container.isContent&&(s+=this.parent.frozenRows);var a=this.parent.isEdit;if(!this.parent.element.querySelectorAll(".e-popup-open").length)switch(a=a&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":(a||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(s,l);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault(),a&&this.editCell(s,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(s,l),this.focus.focus()}},i.prototype.isAddRow=function(e){return this.parent.getDataRows()[e].classList.contains("e-insertedrow")},i.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[t].field,this.isAddRow(e))},i.prototype.closeEdit=function(){var e=this.parent,r=this.parent.getRowsObject(),i={cancel:!1,batchChanges:this.getBatchChanges()};if(e.notify("before-batch-cancel",i),!i.cancel){e.frozenColumns&&r.length<2*this.parent.currentViewData.length&&r.push.apply(r,this.parent.getMovableRowsObject());var n=this.parent.getColumns();if(t.isBlazor())for(d=0;d<n.length;d++){var o=n[d];o.template&&t.updateBlazorTemplate(this.parent.element.id+o.uid,"Template",o,!1)}var s,l,a=new vt(this.serviceLocator,null,this.parent);e.isEdit&&this.saveCell(!0),this.isAdded=!1,e.clearSelection();for(var d=0;d<r.length;d++)if(r[d].isDirty&&(e.frozenColumns&&(e.getMovableRowsObject()[r[d].index].isDirty=!0),s=e.getContentTable().querySelector("[data-uid="+r[d].uid+"]"),e.frozenRows&&!s&&(s=e.getHeaderContent().querySelector("[data-uid="+r[d].uid+"]")),e.frozenColumns&&(e.frozenRows?(l=e.getHeaderContent().querySelector(".e-movableheader").querySelector("[data-uid="+r[d].uid+"]"))||(l=e.getContent().querySelector(".e-movablecontent").querySelector("[data-uid="+r[d].uid+"]")):l=e.getContent().querySelector(".e-movablecontent").querySelector("[data-uid="+r[d].uid+"]")),s||l))if(s&&s.classList.contains("e-insertedrow")||l&&l.classList.contains("e-insertedrow"))s&&t.remove(s),l&&(e.frozenColumns||e.frozenRows)&&t.remove(l),this.removeRowObjectFromUID(r[d].uid),d--;else{te(r[d],this.parent.getForeignKeyColumns(),r[d].data),delete r[d].changes,delete r[d].edit,r[d].isDirty=!1;var c=l||s;if(t.classList(c,[],["e-hiddenrow","e-updatedtd"]),a.refresh(r[d],e.getColumns(),!1),this.parent.aggregates.length>0){var h=[];h.type="cancel",this.parent.notify("refresh-footer-rendered",h),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",h)}}e.getContentTable().querySelector("tr.e-row")||e.renderModule.renderEmptyRow();var p={requestType:"batchCancel",rows:this.parent.getRowsObject()};e.notify("batchCancel",{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new ft({isDataRow:!0,cells:[new mt({isDataCell:!0,visible:!0})]})]}),e.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),e.notify(et,{}),this.parent.notify("tooltip-destroy",{}),p={requestType:"batchCancel",rows:this.parent.getRowsObject()},e.trigger("batchCancel",p),e.frozenColumns&&r.splice(this.parent.getMovableRowsObject().length,r.length)}},i.prototype.deleteRecord=function(e,t){this.saveCell(),this.validateFormObj()&&this.saveCell(!0),this.isAdded=!1,this.bulkDelete(e,t),this.parent.aggregates.length>0&&(this.parent.notify("refresh-footer-rendered",{}),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",{}))},i.prototype.addRecord=function(e){this.bulkAddRow(e)},i.prototype.endEdit=function(e){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},i.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},i.prototype.batchSave=function(){var e=this.parent;if(e.isCheckBoxSelection){var r=e.element.querySelector(".e-checkselectall").parentElement;r.classList.contains("e-checkbox-disabled")&&e.pageSettings.totalRecordsCount>e.currentViewData.length&&t.removeClass([r],["e-checkbox-disabled"])}var i=this.parent.getColumns();if(t.isBlazor())for(var n=0;n<i.length;n++){var o=i[n];o.template&&(t.blazorTemplates[this.parent.element.id+o.uid]=[],t.resetBlazorTemplate(this.parent.element.id+o.uid,"Template"))}if(this.saveCell(),!(e.isEdit||this.editNextValCell()||e.isEdit)){var s=this.getBatchChanges();"Multiple"===this.parent.selectionSettings.type&&s.deletedRecords.length&&this.parent.selectionSettings.persistSelection&&(s.deletedRecords=this.removeSelectedData,this.removeSelectedData=[]);var l={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},a={batchChanges:s,cancel:!1};e.trigger("beforeBatchSave",a,function(t){t.cancel||(e.showSpinner(),e.notify("bulk-save",{changes:s,original:l}))})}},i.prototype.getBatchChanges=function(){for(var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=this.parent.getRowsObject(),r=this.parent.getMovableRowsObject(),i=this.parent.getFrozenColumns(),n=0,o=t;n<o.length;n++){var s=o[n];if(i&&this.mergeBatchChanges(s,r[s.index],i),s.isDirty)switch(s.edit){case"add":e.addedRecords.push(s.changes);break;case"delete":e.deletedRecords.push(s.data);break;default:e.changedRecords.push(s.changes)}}return e},i.prototype.mergeBatchChanges=function(e,t,r){if(e.isDirty){if(t.isDirty){var i=0;Object.keys(e.changes).forEach(function(n){i>=r&&(e.changes[n]=t.changes[n]),i++})}}else t.isDirty&&(e.changes=t.changes,e.isDirty=t.isDirty)},i.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),r=0,i=t.length;r<i&&t[r].uid!==e;r++);t.splice(r,1)},i.prototype.addRowObject=function(e){var t="Top"===this.parent.editSettings.newRowPosition;t?this.parent.getRowsObject().unshift(e):this.parent.getRowsObject().push(e);var r=this.parent.getMovableRowsObject();this.parent.getFrozenColumns()&&!r.length&&(t?r.unshift(e):r.push(e))},i.prototype.bulkDelete=function(e,r){var i=this;this.removeSelectedData=[];var n=this.parent;r&&n.selectRow(this.getIndexFromData(r));var o=n.selectedRowIndex,s=n.getSelectedRows(),l={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:o,rowData:r||n.getSelectedRecords()[0],cancel:!1};(t.isBlazor()&&!this.parent.isJsComponent||(l.row=r?n.getRows()[o]:s[0],l.row))&&n.trigger("beforeBatchDelete",l,function(e){if(!e.cancel){if(e.row=e.row?e.row:r?n.getRows()[o]:s[0],i.parent.frozenColumns||1===s.length){var l=e.row.getAttribute("data-uid");if(e.row.classList.contains("e-insertedrow"))i.removeRowObjectFromUID(l),t.remove(e.row);else{var a=n.getRowObjectFromUID(l);a.isDirty=!0,a.edit="delete",t.classList(e.row,["e-hiddenrow","e-updatedtd"],[]),n.getFrozenColumns()?(t.classList(r?n.getMovableRows()[o]:s[1],["e-hiddenrow","e-updatedtd"],[]),n.frozenRows&&o<n.frozenRows&&n.getMovableDataRows().length>=n.frozenRows&&(n.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody").appendChild(n.getMovableRowByIndex(n.frozenRows-1)),n.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody").appendChild(n.getRowByIndex(n.frozenRows-1)))):n.frozenRows&&o<n.frozenRows&&n.getDataRows().length>=n.frozenRows&&n.getHeaderContent().querySelector("tbody").appendChild(n.getRowByIndex(n.frozenRows-1))}delete e.row}else for(var d=0;d<s.length;d++){var c=s[d].getAttribute("data-uid");if(s[d].classList.contains("e-insertedrow"))i.removeRowObjectFromUID(c),t.remove(s[d]);else{t.classList(s[d],["e-hiddenrow","e-updatedtd"],[]);var h=n.getRowObjectFromUID(c);h.isDirty=!0,h.edit="delete",delete s[d]}}i.refreshRowIdx(),i.removeSelectedData=n.getSelectedRecords(),n.clearSelection(),n.selectRow(o),n.trigger("batchDelete",e),n.notify("batchDelete",{rows:i.parent.getRowsObject()}),n.notify(et,{})}})},i.prototype.refreshRowIdx=function(){var e=[],t=[],r=[],i=this.parent.getFrozenColumns();if(this.parent.frozenRows&&(e=[].slice.call(this.parent.getHeaderTable().querySelector("tbody").children),i)){t=[].slice.call(this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody").children);for(n=0;n<t.length;n++)r[n]=this.parent.createElement("tr",{className:"emptynonmv"})}i&&(t=t.concat([].slice.call(this.parent.getContentTable().querySelector("tbody").children)),r=r.concat([].slice.call(this.parent.element.querySelector(".e-movablecontent").querySelector("tbody").children)));for(var n=0,o=0,s=(e=e.concat([].slice.call(this.parent.getContentTable().querySelector("tbody").children))).length;n<s;n++)e[n].classList.contains("e-row")&&!e[n].classList.contains("e-hiddenrow")?(e[n].setAttribute("aria-rowindex",o.toString()),i&&(t[n].setAttribute("aria-rowindex",o.toString()),r[n].classList.contains("e-row")&&r[n].setAttribute("aria-rowindex",o.toString())),o++):(e[n].removeAttribute("aria-rowindex"),i&&t[n].removeAttribute("aria-rowindex"))},i.prototype.getIndexFromData=function(e){return k(e,this.parent.getCurrentViewRecords())},i.prototype.bulkAddRow=function(r){var i=this,n=this.parent;if(n.editSettings.allowAdding&&(n.isEdit&&(this.saveCell(),this.parent.notify("editNextValCell",{})),!n.isEdit)){this.parent.element.classList.add("e-editing");var o={defaultData:r||this.getDefaultData(),primaryKey:n.getPrimaryKeyFieldNames(),cancel:!1};n.trigger("beforeBatchAdd",o,function(o){if(!o.cancel){i.isAdded=!0,n.clearSelection();for(var s,l,a,d,c=new vt(i.serviceLocator,null,i.parent),h=new Ct(i.parent).generateRows([o.defaultData]),p=c.render(h[0],n.getColumns()),u=0;u<i.parent.groupSettings.columns.length;u++)p.insertBefore(i.parent.createElement("td",{className:"e-indentcell"}),p.firstChild),h[0].cells.unshift(new mt({cellType:e.CellType.Indent}));var g=n.getContentTable().querySelector("tbody");p.classList.add("e-insertedrow"),g.querySelector(".e-emptyrow")&&g.querySelector(".e-emptyrow").remove(),n.getFrozenColumns()&&(s=i.renderMovable(p),l=n.frozenRows&&"Top"===n.editSettings.newRowPosition?n.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody"):n.getContent().querySelector(".e-movablecontent").querySelector("tbody"),"Top"===i.parent.editSettings.newRowPosition?l.insertBefore(s,l.firstChild):l.appendChild(s),t.addClass(s.querySelectorAll(".e-rowcell"),["e-updatedtd"]),"auto"===i.parent.height&&i.parent.notify("frozenHeight",{})),g=n.frozenRows&&"Top"===n.editSettings.newRowPosition?n.getHeaderContent().querySelector("tbody"):n.getContent().querySelector("tbody"),"Top"===i.parent.editSettings.newRowPosition?g.insertBefore(p,g.firstChild):g.appendChild(p),t.addClass(p.querySelectorAll(".e-rowcell"),["e-updatedtd"]),h[0].isDirty=!0,h[0].changes=t.extend({},{},h[0].data,!0),h[0].edit="add",i.addRowObject(h[0]),i.refreshRowIdx(),i.focus.forgetPrevious(),n.notify("batchAdd",{rows:i.parent.getRowsObject(),args:{isFrozen:i.parent.getFrozenColumns()}});var f=i.getBatchChanges();"Top"===i.parent.editSettings.newRowPosition?n.selectRow(0):n.selectRow(i.parent.getCurrentViewRecords().length+f.addedRecords.length-1),r||(d=i.findNextEditableCell(0,!0),a=n.getColumns()[d],"Top"===i.parent.editSettings.newRowPosition?i.editCell(0,a.field,!0):i.editCell(i.parent.getCurrentViewRecords().length+f.addedRecords.length-1,a.field,!0)),i.parent.aggregates.length>0&&r&&i.parent.notify("refresh-footer-rendered",{});var m={defaultData:o.defaultData,row:p,columnObject:a,columnIndex:d,primaryKey:o.primaryKey,cell:p.cells[d]};n.trigger("batchAdd",m),t.isBlazor()&&(i.parent.notify(et,{}),i.parent.notify("start-add",{}))}})}},i.prototype.renderMovable=function(e){for(var t=e.cloneNode(!0),r=0;r<this.parent.frozenColumns;r++)t.removeChild(t.children[0]);for(var r=this.parent.frozenColumns,i=e.childElementCount;r<i;r++)e.removeChild(e.children[e.childElementCount-1]);return t},i.prototype.findNextEditableCell=function(e,r,i){for(var n,o=this.parent.getColumns(),s=o.length,l=e;l<s;l++){if(n=!!i&&t.isNullOrUndefined(o[l].validationRules),!r&&this.checkNPCell(o[l]))return l;if(r&&!o[l].template&&o[l].visible&&o[l].allowEditing&&(!o[l].isIdentity||!o[l].isPrimaryKey)&&!n)return l}return-1},i.prototype.checkNPCell=function(e){return!e.template&&e.visible&&!e.isPrimaryKey&&!e.isIdentity&&e.allowEditing},i.prototype.getDefaultData=function(){for(var e={},r={number:0,string:null,boolean:!1,date:null,datetime:null},i=0,n=this.parent.columnModel;i<n.length;i++){var o=n[i];o.field&&t.setValue(o.field,o.defaultValue?o.defaultValue:r[o.type],e)}return e},i.prototype.setCellIdx=function(e){var t=0;this.parent.allowGrouping&&(t=this.parent.groupSettings.columns.length),this.cellDetails.cellIndex=e.cellIndex-t,this.cellDetails.rowIndex=parseInt(e.getAttribute("index"),10)},i.prototype.editCell=function(e,r,i){var n=this,o=this.parent,s=o.getColumnByField(r),l=o.getPrimaryKeyFieldNames();if(this.parent.element.classList.add("e-editing"),t.isBlazor()&&s.template&&!i&&t.resetBlazorTemplate(this.parent.element.id+s.uid,"Template",e),o.editSettings.allowEditing&&s.allowEditing){if(o.isEdit&&(this.cellDetails.column.field!==r||this.cellDetails.rowIndex!==e||this.parent.getDataRows().length-1===e)&&(this.saveCell(),this.cellDetails.rowIndex===e&&this.cellDetails.column.field===r))return;if(o.isEdit)return;var a,d,c=void 0,h=o.getColumnIndexByField(r),p=o.getFrozenColumns();if(p&&h>=p?(a=o.getMovableDataRows()[e],c=this.parent.getRowObjectFromUID(this.parent.getMovableDataRows()[e].getAttribute("data-uid")),d=c.changes?t.extend({},{},c.changes,!0):t.extend({},{},this.getDataByIndex(e),!0)):(a=o.getDataRows()[e],d=t.extend({},{},this.getDataByIndex(e),!0)),l[0]===s.field&&!a.classList.contains("e-insertedrow")||s.columns||s.isPrimaryKey&&s.isIdentity)return void(this.parent.isLastCellPrimaryKey=!0);this.parent.isLastCellPrimaryKey=!1;var u=o.getRowObjectFromUID(a.getAttribute("data-uid")),g=[].slice.apply(a.cells),f={columnName:s.field,columnObject:s,isForeignKey:!t.isNullOrUndefined(s.foreignKeyValue),primaryKey:l,rowData:d,validationRules:t.extend({},s.validationRules?s.validationRules:{}),value:le(s.field,d),type:i?"add":"edit",cancel:!1,foreignKeyData:u&&u.foreignKeyData};if((!t.isBlazor()||this.parent.isJsComponent)&&(f.cell=g[this.getColIndex(g,this.getCellIdx(s.uid))],f.row=a,!f.cell))return;o.trigger("cellEdit",f,function(t){t.cancel||(t.cell=t.cell?t.cell:g[n.getColIndex(g,n.getCellIdx(s.uid))],t.row=t.row?t.row:a,n.cellDetails={rowData:d,column:s,value:t.value,isForeignKey:t.isForeignKey,rowIndex:e,cellIndex:parseInt(t.cell.getAttribute("aria-colindex"),10),foreignKeyData:t.foreignKeyData},t.cell.classList.contains("e-updatedtd")&&(n.isColored=!0,t.cell.classList.remove("e-updatedtd")),o.isEdit=!0,o.clearSelection(),o.isCheckBoxSelection&&o.isPersistSelection||o.selectRow(n.cellDetails.rowIndex,!0),n.renderer.update(t),n.parent.notify("batcheditform-rendered",t),n.form=o.element.querySelector("#"+o.element.id+"EditForm"),o.editModule.applyFormValidation([s]),n.parent.element.querySelector(".e-gridpopup").style.display="none")})}},i.prototype.updateCell=function(e,t,r){var i=this.parent.getColumnByField(t),n=this.parent.getColumnIndexByField(t);if(i&&!i.isPrimaryKey){var o=this.parent.getDataRows()[e].querySelectorAll(".e-rowcell")[n];this.parent.getFrozenColumns()&&(o=[].slice.call(this.parent.getDataRows()[e].querySelectorAll(".e-rowcell")).concat([].slice.call(this.parent.getMovableDataRows()[e].querySelectorAll(".e-rowcell")))[n]);var s=this.parent.getRowObjectFromUID(o.parentElement.getAttribute("data-uid"));this.refreshTD(o,i,s,r),this.parent.trigger("queryCellInfo",{cell:o,column:i,data:s.changes})}},i.prototype.setChanges=function(e,i,n){e.changes||(e.changes=t.extend({},{},e.data,!0)),t.isNullOrUndefined(i)||r.DataUtil.setValue(i,n,e.changes),e.data[i]!==n&&(e.isDirty=!0)},i.prototype.updateRow=function(e,t){for(var r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];this.updateCell(e,n,t[n])}},i.prototype.getCellIdx=function(e){var r=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return t.isNullOrUndefined(this.parent.detailTemplate)&&t.isNullOrUndefined(this.parent.childGrid)||r++,this.parent.isRowDragable()&&r++,r},i.prototype.refreshTD=function(e,t,r,i){var n,o=new It(this.parent,this.serviceLocator);this.setChanges(r,t.field,i);var s=this.parent.getFrozenColumns();te(r,this.parent.getForeignKeyColumns(),r.changes),n=s&&this.getCellIdx(t.uid)>=s&&this.parent.getColumns().length===r.cells.length?r.cells.slice(s,r.cells.length):r.cells,o.refreshTD(e,n[this.getCellIdx(t.uid)-(this.getCellIdx(t.uid)>=s?s:0)],r.changes,{index:this.getCellIdx(t.uid)}),e.classList.add("e-updatedtd"),this.parent.notify(et,{})},i.prototype.getColIndex=function(e,r){var i=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(i=this.parent.groupSettings.columns.length),t.isNullOrUndefined(this.parent.detailTemplate)&&t.isNullOrUndefined(this.parent.childGrid)||i++,this.parent.isRowDragable()&&i++;for(var n=0;n<e.length;n++)if(parseInt(e[n].getAttribute("aria-colindex"),10)===r-i)return n;return-1},i.prototype.editNextValCell=function(){var e=this.parent;if(this.isAdded&&!e.isEdit){for(var t=this.cellDetails.cellIndex;t<e.getColumns().length;t++){if(e.isEdit)return;var r=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),i=e.getColumns()[r];i&&(this.editCell(0,i.field,!0),this.saveCell())}e.isEdit||(this.isAdded=!1)}},i.prototype.saveCell=function(e){var r=this.parent;if(e||r.isEdit&&!this.validateFormObj()){this.parent.element.classList.remove("e-editing");var i=O(this.form,"e-row"),n=this.cellDetails.column,o={};o[n.field]=this.cellDetails.rowData[n.field];var s=r.editModule.getCurrentEditedData(this.form,o),l=t.extend({},s);s=t.extend({},s,this.cellDetails.rowData);var a=le(n.field,l);t.isNullOrUndefined(n.field)||t.setValue(n.field,a,s);var d={columnName:n.field,value:le(n.field,s),rowData:this.cellDetails.rowData,previousValue:this.cellDetails.value,columnObject:n,isForeignKey:this.cellDetails.isForeignKey,cancel:!1};t.isBlazor()&&!this.parent.isJsComponent||(d.cell=this.form.parentElement),e?this.successCallBack(d,i,n)(d):(r.trigger("cellSave",d,this.successCallBack(d,i,n)),r.notify("batchedit-form",{formObj:this.form}))}},i.prototype.successCallBack=function(e,r,i){var n=this;return function(e){var o=n.parent;e.cell=e.cell?e.cell:n.form.parentElement,e.cancel||(o.editModule.destroyForm(),o.isEdit=!1,o.editModule.destroyWidgets([i]),t.isBlazor()&&i.template&&!e.cell.parentElement.classList.contains("e-insertedrow")&&t.updateBlazorTemplate(o.element.id+i.uid,"Template",i,!1),n.parent.notify("tooltip-destroy",{}),n.refreshTD(e.cell,i,o.getRowObjectFromUID(r.getAttribute("data-uid")),e.value),t.removeClass([r],["e-editedrow","e-batchrow"]),t.removeClass([e.cell],["e-editedbatchcell","e-boolcell"]),(!t.isNullOrUndefined(e.value)&&e.value.toString()===(t.isNullOrUndefined(n.cellDetails.value)?"":n.cellDetails.value).toString()&&!n.isColored||t.isNullOrUndefined(e.value)&&t.isNullOrUndefined(n.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),o.trigger("cellSaved",e),o.notify(et,{}),n.isColored=!1,n.parent.aggregates.length>0&&(n.parent.notify("refresh-footer-rendered",{}),n.parent.groupSettings.columns.length>0&&!n.isAddRow(n.cellDetails.rowIndex)&&n.parent.notify("group-aggregates",{})))}},i.prototype.getDataByIndex=function(e){var t=this.parent.getRowObjectFromUID(this.parent.getDataRows()[e].getAttribute("data-uid"));return t.changes?t.changes:t.data},i.prototype.keyDownHandler=function(e){if(("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit){var t=this.parent,r=O(e.target,"e-rowcell");if(r){var i=r.querySelector(".e-field");if(i){var n=this.parent.getVisibleColumns();n["tab"===e.action?n.length-1:0].field===i.getAttribute("id").slice(this.parent.element.id.length)&&(this.cellDetails.rowIndex!==t.getRows().length-1?this.saveCell():"Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord())}}}},i.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.isColored=!1)},i}(),Vi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Gi=function(e){function t(t,r,i){var n=e.call(this,t,r)||this;return n.parent=t,n.serviceLocator=r,n.renderer=i,n}return Vi(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,r){e.prototype.addRecord.call(this,t,r)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,r){e.prototype.updateRow.call(this,t,r)},t.prototype.deleteRecord=function(t,r){e.prototype.deleteRecord.call(this,t,r)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(zi),_i=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=j(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.write=function(e){"datepickeredit"===e.column.editType?this.obj=new l.DatePicker(t.extend(ye(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params)):"datetimepickeredit"===e.column.editType&&(this.obj=new l.DateTimePicker(t.extend(ye(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params))),this.obj.appendTo(e.element)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Ki=function(){function e(e){this.parent=e}return e.prototype.read=function(e,t){return t},e.prototype.write=function(){},e.prototype.destroy=function(){},e}(),Wi=function(){function e(e,t){this.editType={Inline:Ui,Normal:Ui,Batch:ji,Dialog:Gi},this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}return e.prototype.updateColTypeObj=function(){var r=this;this.parent.columnModel.forEach(function(i){if(r.parent.editSettings.template||i.editTemplate){i.edit=t.extend(new e.editCellType.templateedit(r.parent),i.edit||{})}else i.edit=t.extend(new e.editCellType[i.editType&&e.editCellType[i.editType]?i.editType:"defaultedit"](r.parent,r.serviceLocator),i.edit||{})}),this.parent.log("primary_column_missing")},e.prototype.getModuleName=function(){return"edit"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=this.parent,r=(e.properties,0),i=Object.keys(e.properties);r<i.length;r++)switch(i[r]){case"allowAdding":case"allowDeleting":case"allowEditing":(t.editSettings.allowAdding||t.editSettings.allowEditing||t.editSettings.allowDeleting)&&this.initialEnd();break;case"mode":this.updateEditObj(),t.isEdit=!1,t.refresh()}},e.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new Pi(this.parent,this.serviceLocator),this.editModule=new this.editType[this.parent.editSettings.mode](this.parent,this.serviceLocator,this.renderer)},e.prototype.initialEnd=function(){this.updateColTypeObj()},e.prototype.startEdit=function(e){var r=this.parent;if(r.editSettings.allowEditing&&!r.isEdit&&"Batch"!==r.editSettings.mode){if(this.parent.element.classList.add("e-editing"),r.getSelectedRows().length)e||(e=r.getSelectedRows()[0]);else if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj);"none"!==e.style.display&&(this.editModule.startEdit(e),t.isBlazor()||(this.refreshToolbar(),r.element.querySelector(".e-gridpopup").style.display="none",this.parent.notify("start-edit",{})))}},e.prototype.closeEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.querySelectorAll(".e-updatedtd").length)return void this.showDialog("CancelEdit",this.dialogObj);this.editModule.closeEdit(),t.isBlazor()||(this.refreshToolbar(),this.parent.notify("close-edit",{}))},e.prototype.refreshToolbar=function(){this.parent.notify(et,{})},e.prototype.addRecord=function(e,r){this.parent.editSettings.allowAdding&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,r),t.isBlazor()||(this.refreshToolbar(),this.parent.notify("start-add",{})))},e.prototype.deleteRecord=function(e,t){var r=this.parent;if(r.editSettings.allowDeleting)return t||r.getSelectedRecords().length?r.editSettings.showDeleteConfirmDialog?void this.showDialog("ConfirmDelete",this.dialogObj):void this.editModule.deleteRecord(e,t):void this.showDialog("DeleteOperationAlert",this.alertDObj)},e.prototype.deleteRow=function(e){this.deleteRecord(null,this.parent.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)])},e.prototype.endEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&(t.isNullOrUndefined(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify("editNextValCell",{}),t.isNullOrUndefined(this.formObj)||this.formObj.validate()))return void this.showDialog("BatchSaveConfirm",this.dialogObj);this.endEditing()},e.prototype.updateCell=function(e,t,r){this.editModule.updateCell(e,t,r)},e.prototype.updateRow=function(e,t){this.editModule.updateRow(e,t)},e.prototype.batchCancel=function(){this.closeEdit()},e.prototype.batchSave=function(){this.endEdit()},e.prototype.editCell=function(e,t){this.editModule.editCell(e,t)},e.prototype.editFormValidate=function(){return!!this.formObj&&this.formObj.validate()},e.prototype.getBatchChanges=function(){return this.editModule.getBatchChanges?this.editModule.getBatchChanges():{}},e.prototype.getCurrentEditCellData=function(){var e=this.getCurrentEditedData(this.formObj.element,{});return e[Object.keys(e)[0]]},e.prototype.saveCell=function(){this.editModule.saveCell()},e.prototype.endEditing=function(){this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.refreshToolbar()},e.prototype.showDialog=function(e,t){t.content="<div>"+this.l10n.getConstant(e)+"</div>",t.dataBind(),t.show()},e.prototype.getValueFromType=function(e,t){var r=t;switch(e.type){case"number":r=isNaN(parseFloat(t))?null:parseFloat(t);break;case"boolean":"booleanedit"!==e.editType&&(r=t===this.l10n.getConstant("True")||!0===t);break;case"date":case"datetime":"datepickeredit"!==e.editType&&"datetimepickeredit"!==e.editType&&t&&t.length?r=new Date(t):""===t&&(r=null)}return r},e.prototype.destroyToolTip=function(){for(var e=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-griderror"));e<r.length;e++){var i=r[e];t.remove(i)}this.parent.getContent().firstElementChild.style.position="relative"},e.prototype.createConfirmDlg=function(){this.dialogObj=this.dlgWidget([{click:this.dlgOk.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.dlgCancel.bind(this),buttonModel:{cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}],"EditConfirm")},e.prototype.createAlertDlg=function(){this.alertDObj=this.dlgWidget([{click:this.alertClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:"e-flat",isPrimary:!0}}],"EditAlert")},e.prototype.alertClick=function(){this.alertDObj.hide()},e.prototype.dlgWidget=function(e,t){var r=this.parent.createElement("div",{id:this.parent.element.id+t});this.parent.element.appendChild(r);var n={showCloseIcon:!1,isModal:!0,visible:!1,closeOnEscape:!0,target:this.parent.element,width:"320px",animationSettings:{effect:"None"}};n.buttons=e;var o=new i.Dialog(n);return o.isStringTemplate=!0,o.appendTo(r),o},e.prototype.dlgCancel=function(){this.dialogObj.hide()},e.prototype.dlgOk=function(e){switch(this.dialogObj.element.querySelector(".e-dlg-content").firstElementChild.innerText){case this.l10n.getConstant("ConfirmDelete"):this.editModule.deleteRecord();break;case this.l10n.getConstant("CancelEdit"):this.editModule.closeEdit();break;case this.l10n.getConstant("BatchSaveConfirm"):this.endEditing();break;case this.l10n.getConstant("BatchSaveLostChanges"):"Batch"===this.parent.editSettings.mode&&this.editModule.addCancelWhilePaging(),this.executeAction()}this.dlgCancel()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(qe,this.onPropertyChanged,this),this.parent.on(Ae,this.initialEnd,this),this.parent.on(Ve,this.keyPressHandler,this),this.parent.on(tt,this.updateColTypeObj,this),this.parent.on("tooltip-destroy",this.destroyToolTip,this),this.parent.on(it,this.preventBatch,this),this.parent.on("destroy-form",this.destroyForm,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(Se,this.actionBeginFunction),this.parent.addEventListener(xe,this.actionCompleteFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(qe,this.onPropertyChanged),this.parent.off(Ae,this.initialEnd),this.parent.off(Ve,this.keyPressHandler),this.parent.off(tt,this.updateColTypeObj),this.parent.off("tooltip-destroy",this.destroyToolTip),this.parent.off(it,this.preventBatch),this.parent.off("destroy-form",this.destroyForm),this.parent.removeEventListener(xe,this.actionCompleteFunction),this.parent.removeEventListener(Se,this.actionBeginFunction))},e.prototype.actionComplete=function(e){["add","beginEdit","save","delete","cancel"].indexOf(e.requestType)<0&&(this.parent.isEdit=!1),this.refreshToolbar()},e.prototype.getCurrentEditedData=function(e,i){var n=this,o=this.parent;if(o.editSettings.template)return[].slice.call(e.elements).forEach(function(e){if(e.hasAttribute("name")){var n=V(e.getAttribute("name")),s=o.getColumnByField(n)||{field:n,type:e.getAttribute("type")},l=void 0;"checkbox"===s.type||"boolean"===s.type?l=e.checked:e.value&&(l=e.value,e.ej2_instances&&e.ej2_instances.length&&!t.isNullOrUndefined(e.ej2_instances[0].value)&&(e.blur(),l=e.ej2_instances[0].value)),s.edit&&"string"==typeof s.edit.read?l=t.getValue(s.edit.read,window)(e,l):s.edit&&s.edit.read&&(l=s.edit.read(e,l)),l=o.editModule.getValueFromType(s,l),r.DataUtil.setValue(s.field,l,i)}}),i;o.columnModel.filter(function(e){return e.editTemplate}).forEach(function(t){if(e[j(t.field)]){var o=[].slice.call(e[j(t.field)]);(o=o.length?o:[e[j(t.field)]]).forEach(function(e){var o=n.getValue(t,e,i);r.DataUtil.setValue(t.field,o,i)})}});for(var s=[].slice.call(e.querySelectorAll(".e-field")),l=0,a=s.length;l<a;l++){var d=o.getColumnByUid(s[l].getAttribute("e-mappinguid"));if(d&&d.field){var c=this.getValue(d,s[l],i);r.DataUtil.setValue(d.field,c,i)}}return i},e.prototype.getValue=function(e,r,i){var n=e.isForeignColumn()&&r.ej2_instances?r.ej2_instances[0].value:r.value,o=this.parent,s=e.edit.read;return"checkbox"!==e.type&&"boolean"!==e.type||(n=r.checked),"string"==typeof s?(s=t.getValue(s,window),n=o.editModule.getValueFromType(e,s(r,n))):n=o.editModule.getValueFromType(e,e.edit.read(r,n)),t.isNullOrUndefined(i[e.field])&&""===n&&(n=i[e.field]),n},e.prototype.onActionBegin=function(e){var t=["filterafteropen","filterbeforeopen","filterchoicerequest","save"];"Batch"!==this.parent.editSettings.mode&&this.formObj&&!this.formObj.isDestroyed&&-1===t.indexOf(e.requestType)&&(this.destroyWidgets(),this.destroyForm())},e.prototype.destroyWidgets=function(e){this.parent.editSettings.template&&this.parent.destroyTemplate(["editSettingsTemplate"]),(e=e||this.parent.getColumns()).some(function(e){return!t.isNullOrUndefined(e.editTemplate)})&&this.parent.destroyTemplate(["editTemplate"]);for(var r=0,i=e;r<i.length;r++){var n=i[r],o=n.edit.destroy;t.isBlazor()&&n.editTemplate&&t.resetBlazorTemplate(this.parent.element.id+n.uid+"editTemplate","EditTemplate"),n.edit.destroy&&("string"==typeof o?(o=t.getValue(o,window))():n.edit.destroy())}[].slice.call(this.formObj.element.elements).forEach(function(e){e.hasAttribute("name")&&e.ej2_instances&&e.ej2_instances.length&&!e.ej2_instances[0].isDestroyed&&e.ej2_instances[0].destroy()})},e.prototype.destroyForm=function(){this.destroyToolTip(),this.formObj&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.destroyToolTip()},e.prototype.destroy=function(){var e=this.parent.element;if(e){var r=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent"));r&&this.destroyForm(),this.removeEventListener();var i=this.dialogObj.element;i.childElementCount>0&&(this.dialogObj.destroy(),t.remove(i)),(i=this.alertDObj.element).childElementCount>0&&(this.alertDObj.destroy(),t.remove(i)),r&&this.editModule&&this.editModule.destroy()}},e.prototype.keyPressHandler=function(e){switch(e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")||document.querySelector(".e-popup-open")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":O(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(O(e.target,"e-gridcontent")||this.parent.frozenRows&&O(e.target,"e-headercontent"))||document.querySelectorAll(".e-popup-open").length||(e.preventDefault(),this.endEdit());break;case"escape":this.closeEdit()}},e.prototype.preventBatch=function(e){this.preventObj=e,this.showDialog("BatchSaveLostChanges",this.dialogObj)},e.prototype.executeAction=function(){this.preventObj.handler.call(this.preventObj.instance,this.preventObj.arg1,this.preventObj.arg2,this.preventObj.arg3,this.preventObj.arg4,this.preventObj.arg5,this.preventObj.arg6,this.preventObj.arg7,this.preventObj.arg8)},e.prototype.applyFormValidation=function(e){var r=this.parent,i=r.getFrozenColumns(),n="Dialog"!==this.parent.editSettings.mode?r.element.querySelector(".e-gridform"):document.querySelector("#"+r.element.id+"_dialogEdit_wrapper").querySelector(".e-gridform"),o=r.element.querySelectorAll(".e-gridform")[1],s={},l={};(e=e||r.getColumns()).forEach(function(e,t){e.visible&&(t<i&&e.validationRules?s[j(e.field)]=e.validationRules:t>=i&&e.validationRules&&(l[j(e.field)]=e.validationRules))}),i&&"Dialog"!==this.parent.editSettings.mode?this.parent.editModule.mFormObj=this.createFormObj(o,l):s=t.extend(s,l),this.parent.editModule.formObj=this.createFormObj(n,s)},e.prototype.createFormObj=function(e,t){var r=this;return new o.FormValidator(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){r.validationComplete(e)},customPlacement:function(e,t){r.valErrorPlacement(e,t)}})},e.prototype.valErrorPlacement=function(e,t){if(this.parent.isEdit){var r=t.getAttribute("for"),i=this.getElemTable(e).querySelector("#"+r+"_Error");i?i.querySelector(".e-tip-content").innerHTML=t.outerHTML:this.createTooltip(e,t,r,"")}},e.prototype.getElemTable=function(e){var r;return"Dialog"!==this.parent.editSettings.mode&&(r=this.parent.frozenRows&&this.parent.frozenRows>(parseInt(t.closest(e,".e-row").getAttribute("aria-rowindex"),10)||0)),"Dialog"!==this.parent.editSettings.mode?r?this.parent.getHeaderTable():this.parent.getContentTable():document.querySelector("#"+this.parent.element.id+"_dialogEdit_wrapper")},e.prototype.validationComplete=function(e){if(this.parent.isEdit){var t=this.getElemTable(e.element).querySelector("#"+e.inputName+"_Error");t&&("failure"===e.status?t.style.display="":t.style.display="none")}},e.prototype.createTooltip=function(e,r,n,o){var s,l=this.parent.getContent().firstElementChild,a=l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth,d="Dialog"!==this.parent.editSettings.mode;d&&(s=this.parent.frozenRows&&this.parent.frozenRows>(parseInt(t.closest(e,".e-row").getAttribute("aria-rowindex"),10)||0));var c=this.parent.getContent().querySelector(".e-frozencontent"),h=d?s?this.parent.getHeaderTable():this.parent.getContentTable():document.querySelector("#"+this.parent.element.id+"_dialogEdit_wrapper").querySelector(".e-dlg-content"),p=h.getBoundingClientRect(),u=d?this.parent.element.getBoundingClientRect().left:p.left,g=t.closest(e,"td"),f=g?g.getBoundingClientRect():e.parentElement.getBoundingClientRect(),m=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:n+"_Error",styles:"display:"+o+";top:"+((s?f.top+f.height:f.bottom-p.top-(this.parent.getFrozenColumns()?c.scrollTop:0))+h.scrollTop+9)+"px;left:"+(f.left-u+h.scrollLeft+f.width/2)+"px;max-width:"+f.width+"px;text-align:center;"});d&&p.left<u&&(m.style.left=parseInt(m.style.left,10)-p.left+u+"px");var y=this.parent.createElement("div",{className:"e-tip-content"});y.appendChild(r);var v;"Bottom"===this.parent.editSettings.newRowPosition&&"Dialog"!==this.parent.editSettings.mode&&(this.editModule.args&&"add"===this.editModule.args.requestType||this.editModule.isAdded)&&(v=!0);var C;v?((C=this.parent.createElement("div",{className:"e-arrow-tip e-tip-bottom"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-bottom"})),C.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-bottom"}))):((C=this.parent.createElement("div",{className:"e-arrow-tip e-tip-top"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),C.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-top"}))),m.appendChild(y),m.appendChild(C),this.parent.getFrozenColumns()&&"Dialog"!==this.parent.editSettings.mode?(("Normal"===this.parent.editSettings.mode?t.closest(e,".e-editcell"):t.closest(e,".e-table")).style.position="relative",m.style.position="absolute","Batch"===this.parent.editSettings.mode||t.closest(e,".e-frozencontent")||t.closest(e,".e-frozenheader")?this.formObj.element.appendChild(m):this.mFormObj.element.appendChild(m)):this.formObj.element.appendChild(m),d&&l.getBoundingClientRect().bottom<f.bottom+f.height&&(l.scrollTop=l.scrollTop+m.offsetHeight+C.scrollHeight);var w=parseInt(document.defaultView.getComputedStyle(m,null).getPropertyValue("font-size"),10);if(m.getBoundingClientRect().width<f.width&&m.querySelector("label").getBoundingClientRect().height/(1.2*w)>=2&&(m.style.width=m.style.maxWidth),!this.parent.getFrozenColumns()||"Normal"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode?m.style.left=parseInt(m.style.left,10)-m.offsetWidth/2+"px":m.style.left=g.offsetLeft+(g.offsetWidth/2-m.offsetWidth/2)+"px",!a&&d&&!this.parent.allowPaging){l.style.position="static";var b=i.calculateRelativeBasedPosition(g,m);m.style.top=b.top+f.height+9+"px"}if(v){if(a){var S=this.parent.getContent().firstElementChild,x=S.scrollWidth>S.offsetWidth?z():0;m.style.bottom=this.parent.height-this.parent.getContentTable().offsetHeight-x+f.height+9+"px"}else m.style.bottom=f.height+9+"px";m.style.top=null}},e.prototype.checkColumnIsGrouped=function(e){return!(e.visible||this.parent.groupSettings.columns.indexOf(e.field)>-1)},e.AddEditors=function(r){e.editCellType=t.extend(e.editCellType,r)},e.editCellType={dropdownedit:Bi,numericedit:Li,datepickeredit:_i,datetimepickeredit:_i,booleanedit:Ni,defaultedit:qi,templateedit:Ki},e}(),Qi=function(){function e(e,r){this.showColumn=[],this.hideColumn=[],this.isDlgOpen=!1,this.dlghide=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.prevShowedCols=[],this.parent=e,this.serviceLocator=r,this.addEventListener(),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!0,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!0,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.removeEventListener(),this.unWireEvents(),t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.element||this.dlgObj.isDestroyed||this.dlgObj.destroy())},e.prototype.rtlUpdate=function(){this.parent.enableRtl?t.addClass(this.innerDiv.querySelectorAll(".e-checkbox-wrapper"),["e-rtl"]):t.removeClass(this.innerDiv.querySelectorAll(".e-checkbox-wrapper"),["e-rtl"])},e.prototype.addEventListener=function(){this.parent.isDestroyed||(t.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(Be,this.enableAfterRenderEle,this),this.parent.on(Ae,this.render,this),this.parent.addEventListener(Re,this.hideDialog.bind(this)),this.parent.on(_e,this.destroy,this),this.parent.on("rtl-updated",this.rtlUpdate,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(Ae,this.render),this.parent.off(_e,this.destroy),this.parent.off(Be,this.enableAfterRenderEle),this.parent.off("rtl-updated",this.rtlUpdate))},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},e.prototype.clickHandler=function(e){var r=e.target;if(!this.isCustomizeOpenCC){if(t.isNullOrUndefined(t.closest(r,".e-cc"))&&t.isNullOrUndefined(t.closest(r,".e-cc-toolbar")))t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.visible||r.classList.contains("e-toolbar-items")||(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1);else if(r.classList.contains("e-columnchooser-btn")||r.classList.contains("e-cc-toolbar")){if(this.initialOpenDlg&&this.dlgObj.visible||!this.isDlgOpen)return void(this.isDlgOpen=!0)}else r.classList.contains("e-cc-cancel")&&(r.parentElement.querySelector(".e-ccsearch").value="",this.columnChooserSearch(""),this.removeCancelIcon(),this.refreshCheckboxButton());(this.parent.detailTemplate||this.parent.childGrid)&&(this.targetdlg=e.target)}this.isCustomizeOpenCC&&e.target.classList.contains("e-cc-cancel")&&this.refreshCheckboxState(),this.rtlUpdate()},e.prototype.hideDialog=function(){!t.isNullOrUndefined(this.dlgObj)&&this.dlgObj.visible&&(this.dlgObj.hide(),this.isDlgOpen=!1)},e.prototype.renderColumnChooser=function(e,r,n){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon();else{var o={requestType:"beforeOpenColumnChooser",element:this.parent.element,columns:this.getColumns(),cancel:!1,searchOperator:this.searchOperator};if(this.parent.trigger("beforeOpenColumnChooser",o),o.cancel)return;this.searchOperator=o.searchOperator,n&&(this.targetdlg=n),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var s=this.dlgObj.element.style.display;this.dlgObj.element.style.display="block";var l=i.calculateRelativeBasedPosition(t.closest(n,".e-toolbar-item"),this.dlgObj.element);this.dlgObj.element.style.display=s,this.dlgObj.element.style.top=l.top+t.closest(n,".e-cc-toolbar").getBoundingClientRect().height+"px";t.isNullOrUndefined(t.closest(n,".e-bigger"))||(this.dlgObj.width=258),t.Browser.isDevice?(this.dlgObj.target=document.body,this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition(),this.dlgObj.open=this.mOpenDlg.bind(this)):this.parent.enableRtl?this.dlgObj.element.style.left=n.offsetLeft+"px":this.dlgObj.element.style.left=l.left-250+t.closest(n,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.dlgObj.show()}this.rtlUpdate()},e.prototype.openColumnChooser=function(e,r){if(this.isCustomizeOpenCC=!0,this.dlgObj.visible)return void this.hideDialog();this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.dlgObj.position={X:"center",Y:"center"},t.isNullOrUndefined(e)?(this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition()):(this.dlgObj.element.style.top="",this.dlgObj.element.style.left="",this.dlgObj.element.style.top=r+"px",this.dlgObj.element.style.left=e+"px"),this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.dlgObj.show(),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this)},e.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},e.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.remove(e,"keyup",this.columnChooserManualSearch)},e.prototype.getColumns=function(){return this.parent.getColumns().filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},e.prototype.renderDlgContent=function(){this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),this.parent.element.appendChild(this.dlgDiv);this.parent.element.getBoundingClientRect().width,this.parent.enableRtl;var e=this.parent.element.querySelector(".e-ccdiv");t.isNullOrUndefined(e)||e.getBoundingClientRect().top,this.dlgObj=new i.Dialog({header:this.l10n.getConstant("ChooseColumns"),showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),buttons:[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:"e-cc e-cc_okbtn"}},{click:this.clearActions.bind(this),buttonModel:{cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}],content:this.renderChooserList(),width:250,cssClass:"e-cc",animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),this.wireEvents()},e.prototype.renderChooserList=function(){this.mainDiv=this.parent.createElement("div",{className:"e-main-div e-cc"});var e=this.parent.createElement("div",{className:"e-cc-searchdiv e-cc e-input-group"}),t=this.parent.createElement("input",{className:"e-ccsearch e-cc e-input",attrs:{placeholder:this.l10n.getConstant("Search")}}),r=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),i=this.parent.createElement("div",{className:"e-cc-contentdiv"});this.innerDiv=this.parent.createElement("div",{className:"e-innerdiv e-cc"}),e.appendChild(t),e.appendChild(r),this.searchBoxObj=new cr(t);var n=this.refreshCheckboxList(this.parent.getColumns());return this.innerDiv.appendChild(n),i.appendChild(this.innerDiv),this.mainDiv.appendChild(e),this.mainDiv.appendChild(i),this.mainDiv},e.prototype.confirmDlgBtnClick=function(e){this.parent.notify("columnChooserOpened",{event:e,dialog:this.dlgObj}),this.stateChangeColumns=[];var r=this.ulElement.querySelectorAll(".e-uncheck").length;if(!t.isNullOrUndefined(e)&&r<this.parent.getColumns().length){this.hideColumn.length&&this.columnStateChange(this.hideColumn,!1),this.showColumn.length&&this.columnStateChange(this.showColumn,!0);var i={requestType:"columnstate",element:this.parent.element,columns:this.stateChangeColumns,dialogInstance:this.dlgObj};this.parent.trigger(xe,i),this.getShowHideService.setVisible(this.stateChangeColumns),this.clearActions(),this.parent.notify("tooltip-destroy",{module:"edit"})}},e.prototype.columnStateChange=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],n=this.parent.getColumnByUid(i);"checkbox"!==n.type&&(n.visible=t),this.stateChangeColumns.push(n)}},e.prototype.clearActions=function(){this.hideColumn=[],this.showColumn=[],this.hideDialog(),this.addcancelIcon()},e.prototype.checkstatecolumn=function(e,t){e?(-1!==this.hideColumn.indexOf(t)&&this.hideColumn.splice(this.hideColumn.indexOf(t),1),-1===this.showColumn.indexOf(t)&&this.showColumn.push(t)):(-1!==this.showColumn.indexOf(t)&&this.showColumn.splice(this.showColumn.indexOf(t),1),-1===this.hideColumn.indexOf(t)&&this.hideColumn.push(t))},e.prototype.columnChooserSearch=function(e){var t,i,n=!1,o=this.dlgDiv.querySelector(".e-footer-content"),s=this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;if(this.isInitialOpen=!0,o&&(i=o.querySelector(".e-btn").ej2_instances[0]),""===e?(this.removeCancelIcon(),t=this.getColumns(),n=!0):t=new r.DataManager(this.getColumns()).executeLocal((new r.Query).where("headerText",this.searchOperator,e,!0)),t.length)this.innerDiv.innerHTML=" ",this.innerDiv.classList.remove("e-ccnmdiv"),this.innerDiv.appendChild(this.refreshCheckboxList(t,e)),n?i&&s&&(i.disabled=!1):(this.addcancelIcon(),this.refreshCheckboxButton());else{var l=this.parent.createElement("span",{className:"e-cc e-nmatch"});l.innerHTML=this.l10n.getConstant("Matchs"),this.innerDiv.innerHTML=" ",this.innerDiv.appendChild(l),this.innerDiv.classList.add("e-ccnmdiv"),i&&(i.disabled=!0)}this.flag=!0,this.stopTimer()},e.prototype.wireEvents=function(){t.EventHandler.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),t.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),this.searchBoxObj.wireEvent()},e.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj.element&&t.EventHandler.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),t.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent())},e.prototype.checkBoxClickHandler=function(e){var t,r=this,i=O(e.target,"e-checkbox-wrapper");if(i){if(i.querySelector(".e-selectall")?this.updateSelectAll(!i.querySelector(".e-check")):$(i.parentElement),i.querySelector(".e-chk-hidden").focus(),i.querySelector(".e-check"))t=!0;else{if(!i.querySelector(".e-uncheck"))return;t=!1}this.updateIntermediateBtn();var n=O(i,"e-ccheck").getAttribute("uid"),o=this.parent.getColumns();"grid-selectAll"===n?o.forEach(function(e){e.showInColumnChooser&&r.checkstatecolumn(t,e.uid)}):this.checkstatecolumn(t,n),this.refreshCheckboxButton()}},e.prototype.updateIntermediateBtn=function(){var e=this.ulElement.children.length-1,r=[],i=this.ulElement.children[0].querySelector(".e-frame"),n=this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length,o=this.dlgObj.btnObj[0];o.disabled=!1,e===n?r=["e-check"]:n?r=["e-stop"]:(r=["e-uncheck"],o.disabled=!0),o.dataBind(),t.removeClass([i],["e-check","e-stop","e-uncheck"]),t.addClass([i],r)},e.prototype.updateSelectAll=function(e){for(var t=0,r=[].slice.call(this.ulElement.querySelectorAll(".e-frame"));t<r.length;t++)ee(r[t],e)},e.prototype.refreshCheckboxButton=function(){this.dlgObj.element.querySelector(".e-cc.e-input").value;for(var e=this.parent.getVisibleColumns(),t=0;t<e.length;t++){a=e[t].uid;-1===this.prevShowedCols.indexOf(a)&&this.prevShowedCols.push(a)}for(var r,t=0;t<this.hideColumn.length;t++){var i=this.prevShowedCols.indexOf(this.hideColumn[t]);-1!==i&&this.prevShowedCols.splice(i,1)}r=0!==this.showColumn.length?1:this.prevShowedCols.length;var n=this.dlgDiv.querySelector(".e-footer-content").querySelector(".e-btn").ej2_instances[0];n.disabled=!1;for(var o=[],s=this.parent.element.querySelectorAll(".e-cc-chbox"),t=0,l=s.length;t<l;t++){var a=O(s[t],"e-ccheck").getAttribute("uid");o.push(a)}var d=this.showColumn.filter(function(e){return-1!==o.indexOf(e)});0===r&&0===d.length&&(n.disabled=!0),n.dataBind()},e.prototype.refreshCheckboxList=function(e,t){this.ulElement=this.parent.createElement("ul",{className:"e-ccul-ele e-cc"});var r=this.l10n.getConstant("SelectAll"),i=this.parent.createElement("li",{className:"e-cclist e-cc e-cc-selectall"}),n=this.createCheckBox(r,!1,"grid-selectAll");e.length&&(n.querySelector(".e-checkbox-wrapper").firstElementChild.classList.add("e-selectall"),n.querySelector(".e-frame").classList.add("e-selectall"),this.checkState(n.querySelector(".e-icons"),!0),i.appendChild(n),this.ulElement.appendChild(i));for(var o=0;o<e.length;o++){var s=e[o];this.renderCheckbox(s)}return this.ulElement},e.prototype.refreshCheckboxState=function(){this.dlgObj.element.querySelector(".e-cc.e-input").value="",this.columnChooserSearch("");for(var e=this.parent,t=this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)"),r=0,i=t.length;r<i;r++){var n=t[r],o=void 0;o=this.parent.childGrid||this.parent.detailTemplate?O(this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)")[r],"e-ccheck").getAttribute("uid"):O(n,"e-ccheck").getAttribute("uid"),e.getColumnByUid(o).visible?(n.checked=!0,this.checkState(n.parentElement.querySelector(".e-icons"),!0)):(n.checked=!1,this.checkState(n.parentElement.querySelector(".e-icons"),!1))}},e.prototype.checkState=function(e,r){r?t.classList(e,["e-check"],["e-uncheck"]):t.classList(e,["e-uncheck"],["e-check"])},e.prototype.createCheckBox=function(e,t,r){var i=t?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);return i.querySelector(".e-label").innerHTML=e,Z(r,i,"e-ccheck")},e.prototype.renderCheckbox=function(e){var t,r,i;if(e.showInColumnChooser){t=this.parent.createElement("li",{className:"e-cclist e-cc",styles:"list-style:None",id:"e-ccli_"+e.uid}),r=-1!==this.hideColumn.indexOf(e.uid),i=-1!==this.showColumn.indexOf(e.uid);var n=this.createCheckBox(e.headerText,e.visible&&!r||i,e.uid);t.appendChild(n),this.ulElement.appendChild(t)}this.isInitialOpen&&this.updateIntermediateBtn()},e.prototype.columnChooserManualSearch=function(e){this.addcancelIcon(),this.searchValue=e.target.value,this.stopTimer(),this.startTimer(e)},e.prototype.startTimer=function(e){var t=this,r=t.flag||13===e.keyCode?0:500;this.timer=window.setInterval(function(){t.columnChooserSearch(t.searchValue)},r)},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.addcancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel")},e.prototype.removeCancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel")},e.prototype.mOpenDlg=function(){t.Browser.isDevice&&(this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.remove("e-input-focus"),this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0].focus())},e.prototype.getModuleName=function(){return"columnChooser"},e.prototype.hideOpenedDialog=function(){for(var e=[].slice.call(document.getElementsByClassName("e-ccdlg")).filter(function(e){return e.classList.contains("e-popup-open")}),t=0,r=e.length;t<r;t++)(e[t].classList.contains("e-dialog")||this.parent.element.id+"_ccdlg"!==e[t].id)&&e[t].ej2_instances[0].hide()},e}(),Ji=function(){function i(e){this.hideColumnInclude=!1,this.foreignKeyData={},this.parent=e}return i.getQuery=function(e,t){return t.isRemote()?t.generateQuery(!0).requiresCount().take(e.pageSettings.totalRecordsCount):t.generateQuery(!0).requiresCount()},i.prototype.getFData=function(e,t){return re(t,{},e,this.foreignKeyData[t.field])[0]},i.prototype.getGridRowModel=function(e,t,r,i){void 0===i&&(i=0);var n=[],o=t.length;if(o){for(var s=0;s<o;s++,i++){var l={isExpand:!1};l.data=t[s],l.index=i,r.childGrid&&("All"===r.hierarchyPrintMode?l.isExpand=!0:"Expanded"===r.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[i]&&(l.isExpand=r.expandedRows[i].isExpand));var a=new ft(l);a.cells=this.generateCells(e,r),n.push(a)}this.processColumns(n)}return n},i.prototype.generateCells=function(t,r){var i=[];if(r.childGridLevel)for(var n=r.childGridLevel,o=0;n>o;o++)i.push(this.generateCell({},e.CellType.Indent));for(var s=0,l=t;s<l.length;s++){var a=l[s];i.push(this.generateCell(a,e.CellType.Data))}return i},i.prototype.getColumnData=function(e){var t,i=this,n=[],o=e.getForeignKeyColumns();return o.length&&(o.forEach(function(e){n.push(e.dataSource.executeQuery(new r.Query))}),t=Promise.all(n).then(function(e){o.forEach(function(t,r){i.foreignKeyData[t.field]=e[r].result})})),t},i.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=ue(e);for(var r=[],i=0;i<this.colDepth;i++)r[i]=new ft({}),r[i].cells=[];return r=this.processColumns(r),r=this.processHeaderCells(r),{rows:r,columns:this.generateActualColumns(e)}},i.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},i.prototype.generateActualColumns=function(e,t){void 0===t&&(t=[]);for(var r=0,i=e;r<i.length;r++){var n=i[r];n.commands||(n.columns?(n.visible||this.hideColumnInclude)&&0!==this.getCellCount(n,0)&&this.generateActualColumns(n.columns,t):(n.visible||this.hideColumnInclude)&&t.push(n))}return t},i.prototype.processHeaderCells=function(e){for(var t=this.parent.columns,r=0;r<t.length;r++)t[r].commands||(e=this.appendGridCells(t[r],e,0));return e},i.prototype.appendGridCells=function(t,r,i){if(t.columns||!1===t.visible&&!this.hideColumnInclude||t.commands){if(t.columns){var n=this.getCellCount(t,0);n&&r[i].cells.push(new mt({cellType:e.CellType.StackedHeader,column:t,colSpan:n}));for(var o=void 0,s=0,l=t.columns.length;s<l;s++)t.columns[s].visible&&!o&&(o=!0),r=this.appendGridCells(t.columns[s],r,i+1)}}else r[i].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-i,i));return r},i.prototype.generateCell=function(t,r,i,n){var o={visible:t.visible,isDataCell:r===e.CellType.Data,column:t,cellType:r,rowSpan:i,index:n};return(!o.rowSpan||o.rowSpan<2)&&delete o.rowSpan,new mt(o)},i.prototype.processColumns=function(t){var r=this.parent,i=[];r.enableColumnVirtualization&&(i=r.getColumnIndexesInView());for(var n=0,o=t.length;n<o;n++)if(r.allowGrouping)for(var s=0,l=r.groupSettings.columns.length;s<l;s++)r.enableColumnVirtualization&&-1===i.indexOf(s)||t[n].cells.splice(0,0,this.generateCell({},e.CellType.HeaderIndent));return t},i.prototype.getCellCount=function(e,t){if(e.columns)for(var r=0;r<e.columns.length;r++)t=this.getCellCount(e.columns[r],t);else(e.visible||this.hideColumnInclude)&&t++;return t},i.prototype.checkAndExport=function(e,t){Object.keys(e).some(function(t){return!e[t]})||t()},i.prototype.failureHandler=function(e,t,r){var i=this;return function(){e[t.id]=!0,i.checkAndExport(e,r)}},i.prototype.createChildGrid=function(e,r,i,n){var o=new Br(this.parent.detailRowModule.getGridModel(e,r,i));e.isPrinting=!1;o.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:t.getValue(o.queryString,r.data),parentRowData:r.data};var s=N("child-grid"),l=t.createElement("div",{id:s,styles:"display: none"});return document.body.appendChild(l),o.id=s,n[s]=!1,{childGrid:o,element:l}},i}(),Yi=function(){function e(e){this.valueFormatter=new ve(e),this.internationalization=new t.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,r){return!t.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(r)(e.value):""},e.prototype.formatCellValue=function(e){if(e.isForeignKey&&(e.value=t.getValue(e.column.foreignKeyValue,re(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format)return e.value?this.internationalization.getNumberFormat({format:e.column.format})(e.value):"";if("boolean"===e.column.type)return e.value?"true":"false";if("date"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format)return(t.isNullOrUndefined(e.column.type)||t.isNullOrUndefined(e.value))&&t.isNullOrUndefined(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var r=void 0;return r="date"===e.column.type?{type:"date",skeleton:e.column.format}:"time"===e.column.type?{type:"time",skeleton:e.column.format}:{type:"dateTime",skeleton:e.column.format},this.returnFormattedValue(e,r)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var i=void 0;return i="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,i)},e}(),Xi=function(){function i(e,t){this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.isCsvExport=!1,this.isElementIdChanged=!1,this.foreignKeyData={},this.gridPool={},this.parent=e,this.helper=new Ji(e),this.locator=t,this.l10n=this.locator.getService("localization")}return i.prototype.getModuleName=function(){return"ExcelExport"},i.prototype.init=function(e){null!==e.element&&""===e.element.id&&(e.element.id=(new Date).toISOString(),this.isElementIdChanged=!0),this.parent=e,this.parent.isDestroyed||(this.isExporting=void 0,this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.footer=void 0,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.exportValueFormatter=new Yi(e.locale),e.id=N("main-grid"),this.gridPool[e.id]=!1)},i.prototype.Map=function(e,r,i,n,o,s){var l=e;this.gridPool={},e.childGrid&&(t.isNullOrUndefined(r)||"None"!==r.hierarchyExportMode)&&(e.expandedRows=ce(e).expandedRows);var a={requestType:"beforeExcelExport",gridObject:l,cancel:!1,isMultipleExport:i,workbook:n,isCsv:o,isBlob:s};return l.trigger("beforeExcelExport",a),a.cancel?new Promise(function(e,t){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new gt(l),this.isExporting=!0,this.isBlob=a.isBlob,this.isCsvExport=!!a.isCsv&&a.isCsv,this.processRecords(l,r,a.isMultipleExport,a.workbook))},i.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger("excelExportComplete",this.isBlob?{promise:this.blobPromise}:{}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book)},i.prototype.processRecords=function(e,i,n,o){var s=this;if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.dataSource)&&i.dataSource instanceof r.DataManager)return new Promise(function(t,l){i.dataSource.executeQuery(new r.Query).then(function(r){s.init(e),s.processInnerRecords(e,i,n,o,r).then(function(){s.exportingSuccess(t)})})});if(t.isNullOrUndefined(i)||"CurrentPage"!==i.exportType){var l=[];return l.push(this.data.getData({},Ji.getQuery(e,this.data))),l.push(this.helper.getColumnData(e)),new Promise(function(t,r){Promise.all(l).then(function(r){s.init(e),s.processInnerRecords(e,i,n,o,r[0]).then(function(){s.exportingSuccess(t)})}).catch(function(e){r(s.book),s.parent.trigger("actionFailure",e)})})}return new Promise(function(t,r){s.init(e),s.processInnerRecords(e,i,n,o,s.parent.getCurrentViewRecords()),s.exportingSuccess(t)})},i.prototype.processInnerRecords=function(e,r,i,n,o){var s=this;this.groupedColLength=e.groupSettings.columns.length;var l=5,a=[];return t.isNullOrUndefined(r)||t.isNullOrUndefined(r.multipleExport)||(this.expType=t.isNullOrUndefined(r.multipleExport.type)?"AppendToSheet":r.multipleExport.type,t.isNullOrUndefined(r.multipleExport.blankRows)||(l=r.multipleExport.blankRows)),t.isNullOrUndefined(n)?(this.workSheet=[],this.rows=[],this.columns=[],this.styles=[]):"NewSheet"===this.expType?(this.workSheet=n.worksheets,this.rows=[],this.columns=[],this.styles=n.styles):(this.workSheet=[],this.rows=n.worksheets[0].rows,this.columns=n.worksheets[0].columns,this.styles=n.styles,this.rowLength=this.rows[this.rows.length-1].index+l,this.rowLength++),t.isNullOrUndefined(r)||(t.isNullOrUndefined(i)?(t.isNullOrUndefined(r.header)||this.processExcelHeader(JSON.parse(JSON.stringify(r.header))),t.isNullOrUndefined(r.footer)||(this.footer=JSON.parse(JSON.stringify(r.footer)))):(t.isNullOrUndefined(r.header)||!i&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(r.header))),t.isNullOrUndefined(r.footer)||("AppendToSheet"===this.expType?i||(this.footer=JSON.parse(JSON.stringify(r.footer))):this.footer=JSON.parse(JSON.stringify(r.footer))))),this.includeHiddenColumn=!t.isNullOrUndefined(r)&&r.includeHiddenColumn,new Promise(function(t,i){e.childGridLevel=0,a=s.processGridExport(e,r,o),s.globalResolve=t,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){var o=[];s.organiseRows(a,a[0].index,o),s.rows=s.rows.concat(o),t.isNullOrUndefined(s.footer)||("AppendToSheet"===s.expType&&!i||"NewSheet"===s.expType)&&s.processExcelFooter(s.footer);var l={};if(s.columns.length>0&&(l.columns=s.columns),l.rows=s.rows,s.workSheet.push(l),s.book.worksheets=s.workSheet,s.book.styles=s.styles,!i){if(s.isCsvExport){c=new d.Workbook(s.book,"csv",e.locale,e.currencyCode);s.isBlob?s.blobPromise=c.saveAsBlob("text/csv"):!t.isNullOrUndefined(r)&&r.fileName?c.save(r.fileName):c.save("Export.csv")}else{var c=new d.Workbook(s.book,"xlsx",e.locale,e.currencyCode);s.isBlob?s.blobPromise=c.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):!t.isNullOrUndefined(r)&&r.fileName?c.save(r.fileName):c.save("Export.xlsx")}s.isElementIdChanged&&(e.element.id=""),delete e.expandedRows}return n})},i.prototype.organiseRows=function(e,t,r){if(!e.length)return t;for(var i=0;i<e.length;i++){var n=e[i],o=n.childRows;o?(n.index=t++,delete n.childRows,r.push(n),t=this.organiseRows(o,t,r)):(n.index=t++,r.push(n))}return t},i.prototype.processGridExport=function(e,i,n){var o=[];t.isNullOrUndefined(i)||t.isNullOrUndefined(i.theme)||(this.theme=i.theme),e.childGrid&&!t.isNullOrUndefined(i)&&(e.hierarchyPrintMode=i.hierarchyExportMode||"Expanded");var s=new Ji(e),l=s.getHeaders(e.columns,this.includeHiddenColumn),a=e.groupSettings.columns.length;return o=this.processHeaderContent(e,l,a,o),o=t.isNullOrUndefined(i)||t.isNullOrUndefined(i.dataSource)||i.dataSource instanceof r.DataManager?t.isNullOrUndefined(i)||"CurrentPage"!==i.exportType?this.processRecordContent(e,n,l,i,void 0,o,s):this.processRecordContent(e,n,l,i,e.currentViewData,o,s):this.processRecordContent(e,n,l,i,i.dataSource,o,s)},i.prototype.processRecordContent=function(e,r,i,n,o,s,l){var a;if(a=t.isNullOrUndefined(o)?r.result:o,t.isNullOrUndefined(a.level)?this.processRecordRows(e,a,i,0,0,n,s,l):this.processGroupedRows(e,a,i,a.level,0,n,s,l),!t.isNullOrUndefined(r.aggregates))if(t.isNullOrUndefined(o)){var d=r.result.GroupGuid?r.result.records:r.result;this.processAggregates(e,d,s)}else this.processAggregates(e,r.result,s,o);return s},i.prototype.processGroupedRows=function(e,r,i,n,o,s,l,a){for(var d=0,c=r;d<c.length;d++){var h=c[d],p=[],u={};u.index=1+n;var g=e.getColumnByField(h.field),f={value:h.key,column:g,style:void 0,isForeignKey:g.isForeignColumn()};u.value=e.getColumnByField(h.field).headerText+": "+(g.enableGroupByFormat?h.key:this.exportValueFormatter.formatCellValue(f))+" - ",h.count>1?u.value+=h.count+" items":u.value+=h.count+" item",u.style=this.getCaptionThemeStyle(this.theme);var m=new xt(e).generateRows(h);if(this.fillAggregates(e,m,r.level+r.childLevels,l,this.rowLength),p.push(u),l[l.length-1].cells.length>0){for(var y=r.level+r.childLevels+m[0].cells.length,v=0,C=0,w=l[l.length-1].cells;C<w.length;C++){var b=w[C];b.index<y&&(y=b.index),b.index>v&&(v=b.index),p[p.length-1].index!==b.index&&p.push(b)}for(y-u.index>1&&(u.colSpan=y-u.index);v<i.columns.length+n+r.childLevels;){var S={};S.index=v+1,S.style=this.getCaptionThemeStyle(this.theme),p.push(S),v++}}else{for(var x=0,R=0,E=i.columns;R<E.length;R++)E[R].visible&&x++;u.colSpan=r.childLevels+x}if(l[l.length-1].cells=p,this.rowLength++,this.groupedColLength<8&&n>1){var T={outlineLevel:n-1,isCollapsed:!0};l[l.length-1].grouping=T}!t.isNullOrUndefined(r.childLevels)&&r.childLevels>0?this.processGroupedRows(e,h.items,i,h.items.level,o,s,l,a):(o=this.processRecordRows(e,h.items,i,n,o,s,l,a),this.processAggregates(e,h,l,void 0,n,!0))}},i.prototype.processRecordRows=function(r,i,n,o,s,l,a,d){for(var c=1,h=[],p=n.columns,u=0,g=d.getGridRowModel(p,i,r,s);u<g.length;u++){var f=g[u];h=[],s++,c=1;for(var m=0,y=f.cells.length;m<y;m++){var v=f.cells[m];if(v.cellType===e.CellType.Data){var C=v.column,w=C.field,b=t.isNullOrUndefined(w)?"":C.valueAccessor(w,f.data,C),S=t.isNullOrUndefined(b)?"":b,x=void 0;if(C.isForeignColumn&&C.isForeignColumn()&&(x=d.getFData(S,C),S=t.getValue(C.foreignKeyValue,x)),!t.isNullOrUndefined(S)){var R={},E={data:f.data,column:C,foreignKeyData:x,value:S,style:void 0,colSpan:1,cell:R};if(r.trigger("excelQueryCellInfo",E),R=E.cell,R.index=c+o+r.childGridLevel,R.value=E.value,""===E.data&&r.childGridLevel&&1===c){var T={};T.hAlign="left",E={style:T},R.colSpan=r.getVisibleColumns().length,R.value=this.l10n.getConstant("EmptyRecord")}if(E.colSpan>1&&(R.colSpan=E.colSpan),t.isNullOrUndefined(E.style))R.style={name:r.element.id+"column"+(c+o)};else{var D=this.getColumnStyle(r,c+o);R.style=this.mergeOptions(this.styles[D],E.style)}h.push(R)}c++}}var I={index:this.rowLength++,cells:h};if(this.groupedColLength<8&&o>0?(I.grouping={outlineLevel:o,isCollapsed:!0},a.push(I)):a.push(I),!t.isNullOrUndefined(r.childGrid)){r.isPrinting=!0;var O=!t.isNullOrUndefined(l)&&l.exportType?l.exportType:"AllPages",F=this.helper.createChildGrid(r,f,O,this.gridPool),k=F.childGrid,M=F.element;k.actionFailure=d.failureHandler(this.gridPool,k,this.globalResolve),k.childGridLevel=r.childGridLevel+1;var A={childGrid:k,row:f,exportProperties:l};this.parent.trigger("exportdetaildatabound",A),k.beforeDataBound=this.childGridCell(I,k,l,f),k.appendTo(M)}r.notify("export-RowDataBound",{rowObj:f,type:"excel"})}return s},i.prototype.childGridCell=function(e,r,i,n){var o=this;return function(s){r.beforeDataBound=null,s.cancel=!0,0===s.result.length&&(s.result=[""]),e.childRows=o.processGridExport(r,i,s);var l=o.parent.groupSettings.columns.length;return e.childRows.forEach(function(e){e.grouping={outlineLevel:l+r.childGridLevel,isCollapsed:!n.isExpand,isHidden:!n.isExpand}}),r.destroy(),t.detach(r.element),o.gridPool[r.id]=!0,o.helper.checkAndExport(o.gridPool,o.globalResolve),e}},i.prototype.processAggregates=function(e,r,i,n,o,s){var l=new bt(e),a=void 0;if(a=t.isNullOrUndefined(n)?r:n,void 0===o&&(o=0),e.groupSettings.columns.length>0&&s){var d=new St(e).generateRows(a,{level:a.level});d.length>0&&(i=this.fillAggregates(e,d,o,i))}else{o=e.groupSettings.columns.length>0&&!s?e.groupSettings.columns.length:o;var c=l.generateRows(a,r.aggregates);c.length>0&&!s&&(i=this.fillAggregates(e,c,o,i))}return i},i.prototype.fillAggregates=function(r,i,n,o,s){for(var l=0,a=i;l<a.length;l++){for(var d=a[l],c=[],h=0,p=0,u=d.cells;p<u.length;p++){var g=u[p],f={};if(g.cellType!==e.CellType.DetailFooterIntent&&(g.visible||this.includeHiddenColumn))if(h++,g.isDataCell){if(f.index=h+n+r.childGridLevel,t.isNullOrUndefined(g.column.footerTemplate))if(t.isNullOrUndefined(g.column.groupFooterTemplate))if(t.isNullOrUndefined(g.column.groupCaptionTemplate))for(var m=0,y=Object.keys(d.data[g.column.field]);m<y.length;m++)y[m]===g.column.type&&(t.isNullOrUndefined(d.data[g.column.field].Sum)?t.isNullOrUndefined(d.data[g.column.field].Average)?t.isNullOrUndefined(d.data[g.column.field].Max)?t.isNullOrUndefined(d.data[g.column.field].Min)?t.isNullOrUndefined(d.data[g.column.field].Count)?t.isNullOrUndefined(d.data[g.column.field].TrueCount)?t.isNullOrUndefined(d.data[g.column.field].FalseCount)?t.isNullOrUndefined(d.data[g.column.field].Custom)||(f.value=d.data[g.column.field].Custom):f.value=d.data[g.column.field][g.column.field+" - falsecount"]:f.value=d.data[g.column.field][g.column.field+" - truecount"]:f.value=d.data[g.column.field][g.column.field+" - count"]:f.value=d.data[g.column.field][g.column.field+" - min"]:f.value=d.data[g.column.field][g.column.field+" - max"]:f.value=d.data[g.column.field][g.column.field+" - average"]:f.value=d.data[g.column.field][g.column.field+" - sum"]);else f.value=this.getAggreateValue(e.CellType.CaptionSummary,g.column.groupCaptionTemplate,g,d);else f.value=this.getAggreateValue(e.CellType.GroupSummary,g.column.groupFooterTemplate,g,d);else f.value=this.getAggreateValue(e.CellType.Summary,g.column.footerTemplate,g,d);f.style=this.getCaptionThemeStyle(this.theme),this.aggregateStyle(g.column,f.style,g.column.field);var v=g.attributes.style;v.textAlign&&(f.style.hAlign=v.textAlign.toLowerCase()),c.push(f)}else void 0===s&&(f.index=h+n+r.childGridLevel,f.style=this.getCaptionThemeStyle(this.theme),c.push(f))}if(t.isNullOrUndefined(s)){var C={};if(this.groupedColLength<8&&this.groupedColLength>0){var w={outlineLevel:o[o.length-1].grouping.outlineLevel,isCollapsed:!0};C={index:this.rowLength++,cells:c,grouping:w}}else C={index:this.rowLength++,cells:c};o.push(C)}else o.push({index:s,cells:c})}return o},i.prototype.aggregateStyle=function(e,r,i){if("object"==typeof e.format){var n=e.format;r.numberFormat=t.isNullOrUndefined(n.format)?n.skeleton:n.format,r.type=t.isNullOrUndefined(n.type)?this.parent.getColumnByField(i).type.toLowerCase():n.type.toLowerCase()}else r.numberFormat=e.format,r.type=this.parent.getColumnByField(i).type.toLowerCase()},i.prototype.getAggreateValue=function(r,i,n,o){var s={};return s[t.getEnumValue(e.CellType,n.cellType)]=t.compile(i),s[t.getEnumValue(e.CellType,n.cellType)](o.data[n.column.field?n.column.field:n.column.columnName])[0].textContent},i.prototype.mergeOptions=function(e,t){for(var r={},i=Object.keys(e),n=0;n<i.length;n++)"name"!==i[n]&&(r[i[n]]=e[i[n]]);i=Object.keys(t);for(n=0;n<i.length;n++)"name"!==i[n]&&(r[i[n]]=t[i[n]]);return r},i.prototype.getColumnStyle=function(e,t){for(var r=0,i=0,n=this.styles;i<n.length;i++){if(n[i].name===e.element.id+"column"+t)return r;r++}},i.prototype.processHeaderContent=function(r,i,n,o){var s=i.rows,l=i.columns,a=[];if(n>0)for(var d=0;d!==n;)this.columns.push({index:d+1,width:30}),d++;for(var c=0;c<s.length;c++){for(var h=1+n,p=[],u=0;u<s[c].cells.length;u++){var g={},f={},m=s[c].cells[u];if(m.cellType!==e.CellType.HeaderIndent&&m.cellType!==e.CellType.DetailHeader){for(var y={contains:!0,index:1};y.contains;)if(y=this.getIndex(a,1,h),h=y.index,!y.contains){f.index=y.index+r.childGridLevel;break}if(!t.isNullOrUndefined(m.rowSpan)&&1!==m.rowSpan){f.rowSpan=m.rowSpan;for(var v=1;v<m.rowSpan+1;v++){var C={rowIndex:0,columnIndex:0};C.rowIndex=v,C.columnIndex=h,a.push(C)}}t.isNullOrUndefined(m.colSpan)||1===m.colSpan||(f.colSpan=m.colSpan,h=h+f.colSpan-1),f.value=m.column.headerText,g=this.getHeaderThemeStyle(this.theme),t.isNullOrUndefined(m.column.textAlign)||(g.hAlign=m.column.textAlign.toLowerCase()),t.isNullOrUndefined(m.column.headerTextAlign)||(g.hAlign=m.column.headerTextAlign.toLowerCase());var w={cell:f,gridCell:m,style:g};r.trigger("excelHeaderQueryCellInfo",w),f.style=w.style,p.push(f),h++}}o.push({index:this.rowLength++,cells:p})}for(var b=0;b<l.length;b++)this.parseStyles(r,l[b],this.getRecordThemeStyle(this.theme),n+b+1);return o},i.prototype.getHeaderThemeStyle=function(e){var r={};return r.fontSize=12,r.borders={color:"#E0E0E0"},r.bold=!0,t.isNullOrUndefined(e)||t.isNullOrUndefined(e.header)||(r=this.updateThemeStyle(e.header,r)),r},i.prototype.updateThemeStyle=function(e,r){return t.extend(r,e)},i.prototype.getCaptionThemeStyle=function(e){var r={};return r.fontSize=13,r.backColor="#F6F6F6",t.isNullOrUndefined(e)||t.isNullOrUndefined(e.caption)||(r=this.updateThemeStyle(e.caption,r)),r},i.prototype.getRecordThemeStyle=function(e){var r={};return r.fontSize=13,r.borders={color:"#E0E0E0"},t.isNullOrUndefined(e)||t.isNullOrUndefined(e.record)||(r=this.updateThemeStyle(e.record,r)),r},i.prototype.processExcelHeader=function(e){if(!t.isNullOrUndefined(e.rows)&&("NewSheet"===this.expType||1===this.rowLength)){var r=void 0;void 0===e.headerRows?this.rowLength=e.rows.length:this.rowLength=e.headerRows,r=this.rowLength<e.rows.length?this.rowLength:e.rows.length,this.rowLength++;for(var i=0;i<r;i++){var n=e.rows[i];(null===n.index||t.isNullOrUndefined(n.index))&&(n.index=i+1),this.updatedCellIndex(n)}}},i.prototype.updatedCellIndex=function(e){for(var r=e.cells.length,i=0;i<r;i++){var n=e.cells[i];(null===n.index||t.isNullOrUndefined(n.index))&&(n.index=i+1)}this.rows.push(e)},i.prototype.processExcelFooter=function(e){if(!t.isNullOrUndefined(e.rows)){var r=void 0;void 0===e.footerRows?this.rowLength+=e.rows.length:e.footerRows>e.rows.length?(this.rowLength+=e.footerRows-e.rows.length,r=e.rows.length):r=e.footerRows;for(var i=0;i<r;i++){var n=e.rows[i];null===n.index||void 0===n.index?n.index=this.rowLength++:n.index+=this.rowLength,this.updatedCellIndex(n)}}},i.prototype.getIndex=function(e,t,r){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(o.rowIndex===t&&o.columnIndex===r)return r+=1,{contains:!0,index:r}}return{contains:!1,index:r}},i.prototype.parseStyles=function(e,r,i,n){if(!t.isNullOrUndefined(r.format))if("object"==typeof r.format){var o=r.format;i.numberFormat=t.isNullOrUndefined(o.format)?o.skeleton:o.format,t.isNullOrUndefined(o.type)||(i.type=o.type.toLowerCase())}else i.numberFormat=r.format,i.type=r.type;t.isNullOrUndefined(r.textAlign)||(i.hAlign=r.textAlign.toLowerCase()),Object.keys(i).length>0&&(i.name=e.element.id+"column"+n,this.styles.push(i)),t.isNullOrUndefined(r.width)||this.columns.push({index:n+e.childGridLevel,width:"number"==typeof r.width?r.width:this.helper.getConvertedWidth(r.width)})},i.prototype.destroy=function(){},i}(),$i=function(){function i(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.parent=e,this.helper=new Ji(e),this.gridPool={}}return i.prototype.getModuleName=function(){return"PdfExport"},i.prototype.init=function(e){this.exportValueFormatter=new Yi(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=N("main-grid"),this.gridPool[e.id]=!1},i.prototype.exportWithData=function(e,r,i,n,o,s){var l=this;this.init(e),t.isNullOrUndefined(r)?this.pdfDocument=new c.PdfDocument:this.pdfDocument=r,this.processExport(e,n,o,s).then(function(){l.isExporting=!1,e.trigger("pdfExportComplete",l.isBlob?{promise:l.blobPromise}:{}),l.parent.log("exporting_complete",l.getModuleName()),i(l.pdfDocument)})},i.prototype.Map=function(e,i,n,o,s){var l=this;this.data=new gt(this.parent),this.isBlob=s,this.gridPool={},e.childGrid&&(t.isNullOrUndefined(i)||"None"!==i.hierarchyExportMode)&&(e.expandedRows=ce(e).expandedRows);var a={requestType:"beforePdfExport",cancel:!1};if(!t.isBlazor()){a.gridObject=e}if(e.trigger("beforePdfExport",a),!0===a.cancel)return new Promise(function(e,t){return e()});if(this.parent.log("exporting_begin",this.getModuleName()),!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.dataSource)&&i.dataSource instanceof r.DataManager)return new Promise(function(t,s){i.dataSource.executeQuery(new r.Query).then(function(r){l.exportWithData(e,o,t,r,i,n)})});if(t.isNullOrUndefined(i)||"CurrentPage"!==i.exportType){var d=[];return d.push(this.data.getData({},Ji.getQuery(e,this.data))),d.push(this.helper.getColumnData(e)),new Promise(function(r,s){Promise.all(d).then(function(s){l.init(e),t.isNullOrUndefined(o)?l.pdfDocument=new c.PdfDocument:l.pdfDocument=o,l.processExport(e,s[0],i,n).then(function(){l.isExporting=!1,e.trigger("pdfExportComplete",l.isBlob?{promise:l.blobPromise}:{}),l.parent.log("exporting_complete",l.getModuleName()),r(l.pdfDocument)})})})}return new Promise(function(t,r){l.exportWithData(e,o,t,l.parent.getCurrentViewRecords(),i,n)})},i.prototype.processExport=function(e,r,i,n){var o,s=this,l=this.pdfDocument.sections.add();this.processSectionExportProperties(l,i);var a=l.pages.add();return new Promise(function(t,n){o=s.processGridExport(e,r,i),s.globalResolve=t,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){return o.draw(a,0,0),n||(s.isBlob?s.blobPromise=s.pdfDocument.save():!t.isNullOrUndefined(i)&&i.fileName?s.pdfDocument.save(i.fileName):s.pdfDocument.save("Export.pdf"),s.pdfDocument.destroy(),delete e.expandedRows),s.pdfDocument})},i.prototype.processSectionExportProperties=function(e,r){if(!(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.pageOrientation)&&t.isNullOrUndefined(r.pageSize))){var i=new c.PdfPageSettings;i.orientation="Landscape"===r.pageOrientation?c.PdfPageOrientation.Landscape:c.PdfPageOrientation.Portrait,i.size=this.getPageSize(r.pageSize),e.setPageSettings(i)}return e},i.prototype.processGridExport=function(e,r,i){t.isNullOrUndefined(i)||(this.gridTheme=i.theme);var n=new Ji(e),o=this.processExportProperties(i,r.result),s=e.columns,l=!1;e.groupSettings.columns.length&&(l=!0),e.childGrid&&!t.isNullOrUndefined(i)&&(e.hierarchyPrintMode=i.hierarchyExportMode||"Expanded");var a=new c.PdfGrid,d=this.getHeaderThemeStyle(),h=d.border,p=d.font,u=d.brush,g=n.getHeaders(s,this.hideColumnInclude),f=g.columns;a=this.processGridHeaders(e.groupSettings.columns.length,a,g.rows,f,h,p,u,e),this.setColumnProperties(f,a,n,e);var m=this.getSummaryCaptionThemeStyle();if(!t.isNullOrUndefined(o)&&o.length){if(l?(t.isNullOrUndefined(m.border)||(h=m.border),this.processGroupedRecords(a,o,f,e,h,0,m.font,m.brush,m.backgroundBrush,r,i,n,0)):this.processRecord(h,f,e,o,a,0,i,n,0),!t.isNullOrUndefined(r.aggregates)){var y=new bt(e),v=void 0;v=this.customDataSource?y.generateRows(o,r.aggregates):this.currentViewData?y.generateRows(this.parent.getCurrentViewRecords(),r.aggregates):l?y.generateRows(o.records,r.aggregates):y.generateRows(r.result,r.aggregates),this.processAggregates(v,a,h,m.font,m.brush,m.backgroundBrush,!1)}}else a.rows.addRow().style.setBorder(h);return a},i.prototype.getSummaryCaptionThemeStyle=function(){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.caption))return{font:new c.PdfStandardFont(c.PdfFontFamily.Helvetica,9.75),brush:new c.PdfSolidBrush(new c.PdfColor(0,0,0)),backgroundBrush:new c.PdfSolidBrush(new c.PdfColor(246,246,246))};var e=t.isNullOrUndefined(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,r=t.isNullOrUndefined(this.gridTheme.caption.fontName)?c.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),i=this.getFontStyle(this.gridTheme.caption),n=new c.PdfColor(0,0,0);if(!t.isNullOrUndefined(this.gridTheme.caption.fontColor)){var o=this.hexToRgb(this.gridTheme.caption.fontColor);n=new c.PdfColor(o.r,o.g,o.b)}var s=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,l=new c.PdfStandardFont(r,e,i);return t.isNullOrUndefined(this.gridTheme.caption.font)||(l=this.gridTheme.caption.font),{font:l,brush:new c.PdfSolidBrush(n),backgroundBrush:new c.PdfSolidBrush(new c.PdfColor(246,246,246)),border:s}},i.prototype.getHeaderThemeStyle=function(){var e=new c.PdfBorders;if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.header))return e.all=new c.PdfPen(new c.PdfColor(234,234,234)),{border:e,font:new c.PdfStandardFont(c.PdfFontFamily.Helvetica,10.5),brush:new c.PdfSolidBrush(new c.PdfColor(102,102,102))};var r=t.isNullOrUndefined(this.gridTheme.header.fontName)?c.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),i=this.getFontStyle(this.gridTheme.header),n=t.isNullOrUndefined(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,o=new c.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.header.fontColor)){var s=this.hexToRgb(this.gridTheme.header.fontColor);o=new c.PdfColor(s.r,s.g,s.b)}var l=new c.PdfStandardFont(r,n,i);return t.isNullOrUndefined(this.gridTheme.header.font)||(l=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:l,brush:new c.PdfSolidBrush(o)}},i.prototype.processGroupedRecords=function(e,r,i,n,o,s,l,a,d,h,p,u,g){for(var f=s,m=0,y=r;m<y.length;m++){var v=y[m],C=e.rows.addRow(),w=n.getColumnByField(v.field),b={value:v.key,column:w,style:void 0,isForeignKey:w.isForeignColumn()},S=this.parent.getColumnByField(v.field).headerText+": "+(w.enableGroupByFormat?v.key:this.exportValueFormatter.formatCellValue(b))+" - "+v.count+(r.count>1?" items":" item");C.cells.getCell(f).value=S,C.cells.getCell(f+1).style.stringFormat=new c.PdfStringFormat(c.PdfTextAlignment.Left),C.style.setBorder(o),C.style.setFont(l),C.style.setTextBrush(a),C.style.setBackgroundBrush(d);var x=void 0,R=new xt(n);if(x=t.isNullOrUndefined(v.items.records)?R.generateRows(v.items,v):R.generateRows(v.items.records,v),t.isNullOrUndefined(x)||0!==x.length||(C.cells.getCell(f+1).columnSpan=e.columns.count-(f+1)),!t.isNullOrUndefined(r.childLevels)&&r.childLevels>0)this.processAggregates(x,e,o,l,a,d,!0,C,f),this.processGroupedRecords(e,v.items,i,n,o,f+1,l,a,d,h,p,u,g),x=(E=new St(n)).generateRows(v.items.records,v),this.processAggregates(x,e,o,l,a,d,!1);else{this.processAggregates(x,e,o,l,a,d,!0,C,f),g=this.processRecord(o,i,n,v.items,e,f+1,p,u,g);var E=new St(n);x=E.generateRows(v.items,v),this.processAggregates(x,e,o,l,a,d,!1)}}},i.prototype.processGridHeaders=function(r,i,n,o,s,l,a,d){var c=o.length+r;i.columns.add(c),i.headers.add(n.length);for(var h=0;h<n.length;h++){var p=i.headers.getHeader(h);p.style.setBorder(s),p.style.setFont(l),p.style.setTextBrush(a);for(var u=0,g=n[h].cells.length,f=0;f<g;f++){var m=n[h].cells[f],y=p.cells.getCell(f+u);switch(m.cellType){case e.CellType.HeaderIndent:case e.CellType.DetailHeader:y.value="",y.width=20;break;case e.CellType.Header:case e.CellType.StackedHeader:if(null!==y.value){if(t.isNullOrUndefined(m.column.headerTextAlign)||(y.style.stringFormat=this.getHorizontalAlignment(m.column.headerTextAlign)),!t.isNullOrUndefined(m.rowSpan)){y.rowSpan=m.rowSpan,y.style.stringFormat=this.getVerticalAlignment("Bottom",y.style.stringFormat,m.column.textAlign);for(var v=1;v<n[h].cells[f].rowSpan;v++)i.headers.getHeader(h+v).cells.getCell(f).value=null}t.isNullOrUndefined(m.colSpan)||(y.columnSpan=m.colSpan,u+=m.colSpan-1),y.value=m.column.headerText;var C={cell:y,gridCell:m,style:y.style};this.parent.trigger("pdfHeaderQueryCellInfo",C)}else u+=y.columnSpan,f-=1}}}return i.columns.count>=6&&(i.style.allowHorizontalOverflow=!0),i},i.prototype.processExportProperties=function(e,i){if(t.isNullOrUndefined(e))this.currentViewData=!1,this.customDataSource=!1;else{t.isNullOrUndefined(e.theme)||(this.gridTheme=e.theme);var n=this.pdfDocument.pageSettings.size;if(!t.isNullOrUndefined(e.header)){var o=e.header,s=new c.PointF(0,o.fromTop),l=new c.SizeF(n.width-80,.75*o.height),a=new c.RectangleF(s,l);this.pdfDocument.template.top=this.drawPageTemplate(new c.PdfPageTemplateElement(a),o)}if(!t.isNullOrUndefined(e.footer)){var d=e.footer,s=new c.PointF(0,n.width-80-.75*d.fromBottom),l=new c.SizeF(n.width-80,.75*d.height),a=new c.RectangleF(s,l);this.pdfDocument.template.bottom=this.drawPageTemplate(new c.PdfPageTemplateElement(a),d)}t.isNullOrUndefined(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),t.isNullOrUndefined(e.dataSource)?t.isNullOrUndefined(e.exportType)?(this.currentViewData=!1,this.customDataSource=!1):"CurrentPage"===e.exportType?(i=this.parent.currentViewData,this.currentViewData=!0,this.customDataSource=!1):(this.currentViewData=!1,this.customDataSource=!1):(e.dataSource instanceof r.DataManager||(i=e.dataSource),this.customDataSource=!0,this.currentViewData=!1)}return i},i.prototype.drawPageTemplate=function(e,t){for(var r=0,i=t.contents;r<i.length;r++){var n=i[r];switch(this.processContentValidation(n),n.type){case"Text":if(""===n.value||void 0===n.value||null===n.value||"string"!=typeof n.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,n);break;case"PageNumber":this.drawPageNumber(e,n);break;case"Image":if(void 0===n.src||null===n.src||""===n.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,n);break;case"Line":this.drawLine(e,n);break;default:throw new Error("Please set valid content type...")}}return e},i.prototype.processContentValidation=function(e){if(void 0===e.type||null===e.type)throw new Error("please set valid content type...");if("Line"===e.type){if(void 0===e.points||null===e.points)throw new Error("please enter valid points in "+e.type+" content...");if(void 0===e.points.x1||null===e.points.x1||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(void 0===e.points.y1||null===e.points.y1||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(void 0===e.points.x2||null===e.points.x2||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(void 0===e.points.y2||null===e.points.y2||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(void 0===e.position||null===e.position)throw new Error("please enter valid position in "+e.type+" content...");if(void 0===e.position.x||null===e.position.x||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(void 0===e.position.y||null===e.position.y||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},i.prototype.drawText=function(e,r){var i=this.getFont(r),n=this.getBrushFromContent(r),o=null;if(!t.isNullOrUndefined(r.style.textPenColor)){var s=this.hexToRgb(r.style.textPenColor);o=new c.PdfPen(new c.PdfColor(s.r,s.g,s.b))}null==n&&null==o&&(n=new c.PdfSolidBrush(new c.PdfColor(0,0,0)));var l=r.value.toString(),a=.75*r.position.x,d=.75*r.position.y,h=new c.PdfStringFormat,p=this.setContentFormat(r,h);null===p||t.isNullOrUndefined(p.format)||t.isNullOrUndefined(p.size)?e.graphics.drawString(l,i,o,n,a,d,h):e.graphics.drawString(l,i,o,n,a,d,p.size.width,p.size.height,p.format)},i.prototype.drawPageNumber=function(e,r){var i=this.getFont(r),n=null;if(t.isNullOrUndefined(r.style.textBrushColor))n=new c.PdfSolidBrush(new c.PdfColor(0,0,0));else{var o=this.hexToRgb(r.style.textBrushColor);n=new c.PdfSolidBrush(new c.PdfColor(o.r,o.g,o.b))}var s=new c.PdfPageNumberField(i,n);s.numberStyle=this.getPageNumberStyle(r.pageNumberType);var l,a;if(t.isNullOrUndefined(r.format))a="{0}",l=new c.PdfCompositeField(i,n,a,s);else if(-1!==r.format.indexOf("$total")&&-1!==r.format.indexOf("$current")){d=new c.PdfPageCountField(i);a=r.format.indexOf("$total")>r.format.indexOf("$current")?(a=r.format.replace("$current","0")).replace("$total","1"):(a=r.format.replace("$current","1")).replace("$total","0"),l=new c.PdfCompositeField(i,n,a,s,d)}else if(-1!==r.format.indexOf("$current")&&-1===r.format.indexOf("$total"))a=r.format.replace("$current","0"),l=new c.PdfCompositeField(i,n,a,s);else{var d=new c.PdfPageCountField(i);a=r.format.replace("$total","0"),l=new c.PdfCompositeField(i,n,a,d)}var h=.75*r.position.x,p=.75*r.position.y,u=this.setContentFormat(r,l.stringFormat);null===u||t.isNullOrUndefined(u.format)||t.isNullOrUndefined(u.size)||(l.stringFormat=u.format,l.bounds=new c.RectangleF(h,p,u.size.width,u.size.height)),l.draw(e.graphics,h,p)},i.prototype.drawImage=function(e,r){var i=.75*r.position.x,n=.75*r.position.y,o=t.isNullOrUndefined(r.size)?void 0:.75*r.size.width,s=t.isNullOrUndefined(r.size)?void 0:.75*r.size.height,l=new c.PdfBitmap(r.src);t.isNullOrUndefined(o)?e.graphics.drawImage(l,i,n):e.graphics.drawImage(l,i,n,o,s)},i.prototype.drawLine=function(e,r){var i=.75*r.points.x1,n=.75*r.points.y1,o=.75*r.points.x2,s=.75*r.points.y2,l=this.getPenFromContent(r);t.isNullOrUndefined(r.style)||null===r.style||(t.isNullOrUndefined(r.style.penSize)||null===r.style.penSize||"number"!=typeof r.style.penSize||(l.width=.75*r.style.penSize),l.dashStyle=this.getDashStyle(r.style.dashStyle)),e.graphics.drawLine(l,i,n,o,s)},i.prototype.processAggregates=function(r,i,n,o,s,l,a,d,c){for(var h=0,p=r;h<p.length;h++){for(var u=p[h],g=-1,f=0,m=!0,y=[],v=0;v<i.columns.count;v++){var C=u.cells[f];if(C.cellType!==e.CellType.DetailFooterIntent){if(!this.hideColumnInclude){for(;void 0===C.visible;)C.cellType!==e.CellType.DetailFooterIntent&&(t.isNullOrUndefined(d)?y.push(""):t.isNullOrUndefined(d.cells.getCell(v).value)?y.push(""):(y.push(""),y.push(d.cells.getCell(v).value),m=!1,v+=1),v+=1,f+=1,C=u.cells[f]);for(;!t.isNullOrUndefined(C.visible)&&!C.visible;)f+=1,C=u.cells[f]}if(C.isDataCell){var w={};if(t.isNullOrUndefined(C.column.footerTemplate)&&t.isNullOrUndefined(C.column.groupCaptionTemplate)&&t.isNullOrUndefined(C.column.groupFooterTemplate)){var b=this.getSummaryWithoutTemplate(u.data[C.column.field]);t.isNullOrUndefined(b)||y.push(b)}else{w=(b=this.getTemplateFunction(w,v,g,C.column)).templateFunction,g=b.leastCaptionSummaryIndex;var S=w[t.getEnumValue(e.CellType,C.cellType)](u.data[C.column.field?C.column.field:C.column.columnName]);y.push(S[0].textContent),m=!1}}else y.push("");m&&""!==y[v]&&!t.isNullOrUndefined(y[v])&&null!==y[v]&&(m=!1),f+=1}else v--,f++}if(!m)if(a)for(v=0;v<i.columns.count;v++)d.cells.getCell(v).value=y[v].toString(),v===c+1&&-1!==g?d.cells.getCell(v).columnSpan=g-(c+1):v===c+1&&-1===g&&(d.cells.getCell(v).columnSpan=i.columns.count-(c+1));else{var x=i.rows.addRow();x.style.setBorder(n),x.style.setFont(o),x.style.setTextBrush(s),x.style.setBackgroundBrush(l);for(v=0;v<i.columns.count;v++)x.cells.getCell(v).value=y[v].toString()}}},i.prototype.getTemplateFunction=function(r,i,n,o){return t.isNullOrUndefined(o.footerTemplate)?t.isNullOrUndefined(o.groupCaptionTemplate)?r[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]=t.compile(o.groupFooterTemplate):(-1===n&&(n=i),r[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]=t.compile(o.groupCaptionTemplate)):r[t.getEnumValue(e.CellType,e.CellType.Summary)]=t.compile(o.footerTemplate),{templateFunction:r,leastCaptionSummaryIndex:n}},i.prototype.getSummaryWithoutTemplate=function(e){return t.isNullOrUndefined(e.Sum)?t.isNullOrUndefined(e.Average)?t.isNullOrUndefined(e.Max)?t.isNullOrUndefined(e.Min)?t.isNullOrUndefined(e.Count)?t.isNullOrUndefined(e.TrueCount)?t.isNullOrUndefined(e.FalseCount)?t.isNullOrUndefined(e.Custom)?void 0:e.Custom:e.FalseCount:e.TrueCount:e.Count:e.Min:e.Max:e.Average:e.Sum},i.prototype.setColumnProperties=function(e,r,i,n){for(var o=n.groupSettings.columns.length,s=0;s<o;s++)r.columns.getColumn(s).width=20;for(s=0;s<e.length;s++)t.isNullOrUndefined(e[s].textAlign)||(r.columns.getColumn(s+o).format=this.getHorizontalAlignment(e[s].textAlign)),r.style.allowHorizontalOverflow&&!t.isNullOrUndefined(e[s].width)&&(r.columns.getColumn(s+o).width="number"==typeof e[s].width?.75*e[s].width:.75*i.getConvertedWidth(e[s].width))},i.prototype.setRecordThemeStyle=function(e,r){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.record))e.style.setTextBrush(new c.PdfSolidBrush(new c.PdfColor(0,0,0)));else{var i=t.isNullOrUndefined(this.gridTheme.record.fontName)?c.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),n=t.isNullOrUndefined(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,o=this.getFontStyle(this.gridTheme.record),s=new c.PdfStandardFont(i,n,o);t.isNullOrUndefined(this.gridTheme.record.font)||(s=this.gridTheme.record.font),e.style.setFont(s);var l=new c.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.record.fontColor)){var a=this.hexToRgb(this.gridTheme.record.fontColor);l=new c.PdfColor(a.r,a.g,a.b)}e.style.setTextBrush(new c.PdfSolidBrush(l))}var d=this.gridTheme&&this.gridTheme.record&&this.gridTheme.record.border?this.getBorderStyle(this.gridTheme.record.border):r;return e.style.setBorder(d),e},i.prototype.processRecord=function(r,i,n,o,s,l,a,d,h){for(var p=0,u=d.getGridRowModel(i,o,n,h);p<u.length;p++){var g=u[p];h++;for(var f=this.setRecordThemeStyle(s.rows.addRow(),r),m=g.cells.length,y=0;y<m;y++){var v=g.cells[y];if(v.cellType===e.CellType.Data){var C=v.column,w=C.field,b=t.isNullOrUndefined(w)?"":C.valueAccessor(w,g.data,C),S=t.isNullOrUndefined(b)?"":b,x=void 0;if(C.isForeignColumn&&C.isForeignColumn()&&(x=d.getFData(S,C),S=t.getValue(C.foreignKeyValue,x)),(k={data:g.data,value:S,column:C,style:void 0,colSpan:1,cell:T=f.cells.getCell(y)}).value=this.exportValueFormatter.formatCellValue(k),this.parent.trigger("pdfQueryCellInfo",k),T.value=k.value,t.isNullOrUndefined(k.style)||this.processCellStyle(T,k),k.colSpan>1){y+1+k.colSpan>f.cells.count&&(k.colSpan=f.cells.count-(y+1)),T.columnSpan=k.colSpan;for(var R=1;R<T.columnSpan;R++)f.cells.getCell(y+R).value="";y+=k.colSpan-1}}}if(g.isExpand){var E=this.setRecordThemeStyle(s.rows.addRow(),r),T=E.cells.getCell(l);T.columnSpan=E.cells.count-l,T.style.cellPadding=new c.PdfPaddings(10,10,10,10),n.isPrinting=!0;var D=!t.isNullOrUndefined(a)&&a.exportType?a.exportType:"AllPages",I=this.helper.createChildGrid(n,g,D,this.gridPool),O=I.childGrid,F=I.element;O.actionFailure=d.failureHandler(this.gridPool,O,this.globalResolve);var k={childGrid:O,row:g,cell:T,exportProperties:a};this.parent.trigger("exportdetaildatabound",k),O.beforeDataBound=this.childGridCell(T,O,a),O.appendTo(F)}this.parent.notify("export-RowDataBound",{type:"pdf",rowObj:g})}return h},i.prototype.childGridCell=function(e,r,i){var n=this;return function(o){return r.beforeDataBound=null,o.cancel=!0,e.value=n.processGridExport(r,o,i),r.destroy(),t.detach(r.element),n.gridPool[r.id]=!0,n.helper.checkAndExport(n.gridPool,n.globalResolve),e}},i.prototype.processCellStyle=function(e,r){if(!t.isNullOrUndefined(r.style.backgroundColor)){var i=this.hexToRgb(r.style.backgroundColor);e.style.backgroundBrush=new c.PdfSolidBrush(new c.PdfColor(i.r,i.g,i.b))}if(t.isNullOrUndefined(r.style.textAlignment)||(e.style.stringFormat=this.getHorizontalAlignment(r.style.textAlignment)),t.isNullOrUndefined(r.style.cellPadding)||(e.style.cellPadding=r.style.cellPadding),t.isNullOrUndefined(r.style.verticalAlignment)||(e.style.stringFormat=this.getVerticalAlignment(r.style.verticalAlignment,e.style.stringFormat)),!t.isNullOrUndefined(r.style.textBrushColor)){var n=this.hexToRgb(r.style.textBrushColor);e.style.textBrush=new c.PdfSolidBrush(new c.PdfColor(n.r,n.g,n.b))}if(!t.isNullOrUndefined(r.style.textPenColor)){var o=this.hexToRgb(r.style.textPenColor);e.style.textPen=new c.PdfPen(new c.PdfColor(o.r,o.g,o.b))}if(t.isNullOrUndefined(r.style.fontFamily)&&t.isNullOrUndefined(r.style.fontSize)&&t.isNullOrUndefined(r.style.bold)&&t.isNullOrUndefined(r.style.italic)&&t.isNullOrUndefined(r.style.underline)&&t.isNullOrUndefined(r.style.strikeout)||(e.style.font=this.getFont(r)),!t.isNullOrUndefined(r.style.border)){var s=new c.PdfBorders,l=r.style.border.width,a=t.isNullOrUndefined(l)||"number"!=typeof l?void 0:.75*l,d=new c.PdfColor(196,196,196);if(!t.isNullOrUndefined(r.style.border.color)){var h=this.hexToRgb(r.style.border.color);d=new c.PdfColor(h.r,h.g,h.b)}var p=new c.PdfPen(d,a);t.isNullOrUndefined(r.style.border.dashStyle)||(p.dashStyle=this.getDashStyle(r.style.border.dashStyle)),s.all=p,e.style.borders=s}t.isNullOrUndefined(r.style.paragraphIndent)||(e.style.stringFormat=new c.PdfStringFormat,e.style.stringFormat.paragraphIndent=r.style.paragraphIndent)},i.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new c.PdfStringFormat),e){case"Right":t.alignment=c.PdfTextAlignment.Right;break;case"Center":t.alignment=c.PdfTextAlignment.Center;break;case"Justify":t.alignment=c.PdfTextAlignment.Justify;break;case"Left":t.alignment=c.PdfTextAlignment.Left}return t},i.prototype.getVerticalAlignment=function(e,t,r){switch(void 0===t&&(t=new c.PdfStringFormat,t=this.getHorizontalAlignment(r,t)),e){case"Bottom":t.lineAlignment=c.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=c.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=c.PdfVerticalAlignment.Top}return t},i.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},i.prototype.getFont=function(e){if(e.font)return e.font;var r=t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,i=t.isNullOrUndefined(e.style.fontFamily)?c.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=c.PdfFontStyle.Regular;return!t.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=c.PdfFontStyle.Bold),!t.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=c.PdfFontStyle.Italic),!t.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=c.PdfFontStyle.Underline),!t.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=c.PdfFontStyle.Strikeout),new c.PdfStandardFont(i,r,n)},i.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},i.prototype.setContentFormat=function(e,r){if(!t.isNullOrUndefined(e.size)){var i=.75*e.size.width,n=.75*e.size.height;if(r=new c.PdfStringFormat(c.PdfTextAlignment.Left,c.PdfVerticalAlignment.Middle),!t.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":r.alignment=c.PdfTextAlignment.Right;break;case"Center":r.alignment=c.PdfTextAlignment.Center;break;case"Justify":r.alignment=c.PdfTextAlignment.Justify;break;default:r.alignment=c.PdfTextAlignment.Left}return t.isNullOrUndefined(e.style.vAlign)||(r=this.getVerticalAlignment(e.style.vAlign,r)),{format:r,size:new c.SizeF(i,n)}}return null},i.prototype.getPageSize=function(e){switch(e){case"Letter":return new c.SizeF(612,792);case"Note":return new c.SizeF(540,720);case"Legal":return new c.SizeF(612,1008);case"A0":return new c.SizeF(2380,3368);case"A1":return new c.SizeF(1684,2380);case"A2":return new c.SizeF(1190,1684);case"A3":return new c.SizeF(842,1190);case"A5":return new c.SizeF(421,595);case"A6":return new c.SizeF(297,421);case"A7":return new c.SizeF(210,297);case"A8":return new c.SizeF(148,210);case"A9":return new c.SizeF(105,148);case"B0":return new c.SizeF(2836,4008);case"B1":return new c.SizeF(2004,2836);case"B2":return new c.SizeF(1418,2004);case"B3":return new c.SizeF(1002,1418);case"B4":return new c.SizeF(709,1002);case"B5":return new c.SizeF(501,709);case"Archa":return new c.SizeF(648,864);case"Archb":return new c.SizeF(864,1296);case"Archc":return new c.SizeF(1296,1728);case"Archd":return new c.SizeF(1728,2592);case"Arche":return new c.SizeF(2592,3456);case"Flsa":return new c.SizeF(612,936);case"HalfLetter":return new c.SizeF(396,612);case"Letter11x17":return new c.SizeF(792,1224);case"Ledger":return new c.SizeF(1224,792);default:return new c.SizeF(595,842)}},i.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},i.prototype.getPenFromContent=function(e){var r=new c.PdfPen(new c.PdfColor(0,0,0));if(!t.isNullOrUndefined(e.style)&&null!==e.style&&!t.isNullOrUndefined(e.style.penColor)){var i=this.hexToRgb(e.style.penColor);r=new c.PdfPen(new c.PdfColor(i.r,i.g,i.b))}return r},i.prototype.getBrushFromContent=function(e){var r=null;if(!t.isNullOrUndefined(e.style.textBrushColor)){var i=this.hexToRgb(e.style.textBrushColor);r=new c.PdfSolidBrush(new c.PdfColor(i.r,i.g,i.b))}return r},i.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},i.prototype.getFontStyle=function(e){var r=c.PdfFontStyle.Regular;return!t.isNullOrUndefined(e)&&e.bold&&(r|=c.PdfFontStyle.Bold),!t.isNullOrUndefined(e)&&e.italic&&(r|=c.PdfFontStyle.Italic),!t.isNullOrUndefined(e)&&e.underline&&(r|=c.PdfFontStyle.Underline),!t.isNullOrUndefined(e)&&e.strikeout&&(r|=c.PdfFontStyle.Strikeout),r},i.prototype.getBorderStyle=function(e){var r=new c.PdfBorders;if(t.isNullOrUndefined(e))r.all=new c.PdfPen(new c.PdfColor(234,234,234));else{var i=e.width,n=t.isNullOrUndefined(i)||"number"!=typeof i?void 0:.75*i,o=new c.PdfColor(196,196,196);if(!t.isNullOrUndefined(e.color)){var s=this.hexToRgb(e.color);o=new c.PdfColor(s.r,s.g,s.b)}var l=new c.PdfPen(o,n);t.isNullOrUndefined(e.dashStyle)||(l.dashStyle=this.getDashStyle(e.dashStyle)),r.all=l}return r},i.prototype.destroy=function(){},i}(),Zi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),en=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.buttonElement=i.parent.createElement("button",{}),i.unbounDiv=i.parent.createElement("div",{className:"e-unboundcelldiv",styles:"display: inline-block"}),i.element=i.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{role:"gridcell",tabindex:"-1"}}),i}return Zi(r,e),r.prototype.render=function(e,r,i){var n=this.element.cloneNode();if(n.appendChild(this.unbounDiv.cloneNode()),n.setAttribute("aria-label","is Command column column header "+e.column.headerText),e.column.commandsTemplate)B(n.firstElementChild,e.column.getColumnTemplate()(r));else for(var o=0,s=e.commands;o<s.length;o++){var l=s[o];n=this.renderButton(n,l,i.index,l.uid)}return this.setAttributes(n,e,i),this.parent.isEdit?(t.addClass(n.querySelectorAll(".e-edit-delete"),"e-hide"),t.removeClass(n.querySelectorAll(".e-save-cancel"),"e-hide")):(t.addClass(n.querySelectorAll(".e-save-cancel"),"e-hide"),t.removeClass(n.querySelectorAll(".e-edit-delete"),"e-hide")),n},r.prototype.renderButton=function(e,r,i,o){var s=this.buttonElement.cloneNode();t.attributes(s,{id:this.parent.element.id+(r.type||"")+"_"+i,type:"button",title:t.isNullOrUndefined(r.title)?r.buttonOption.content||this.localizer.getConstant(r.type)||r.type:r.title,"data-uid":o}),s.onclick=r.buttonOption.click;var l=new n.Button(r.buttonOption,s);switch(l.commandType=r.type,e.firstElementChild.appendChild(l.element),r.type){case"Edit":case"Delete":t.addClass([s],["e-edit-delete","e-"+r.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":t.addClass([s],["e-save-cancel","e-"+r.type.toLowerCase()+"button"])}return e},r}(It),tn=function(){function r(e,t){this.parent=e,this.locator=t,this.initiateRender(),this.addEventListener()}return r.prototype.initiateRender=function(){this.locator.getService("cellRendererFactory").addCellRenderer(e.CellType.CommandColumn,new en(this.parent,this.locator))},r.prototype.commandClickHandler=function(e){var r=this.parent,i=(r.element.id,t.closest(e.target,"button"));if(i&&t.closest(e.target,".e-unboundcell")){var n,o=i.ej2_instances[0],s=o.commandType,l=i.getAttribute("data-uid"),a=r.getRowObjectFromUID(t.closest(i,".e-row").getAttribute("data-uid"));this.parent.columnModel.forEach(function(e){e.commands&&e.commands.forEach(function(e){e.uid===l&&e.type===s&&(n=e)})});var d={cancel:!1,target:i,commandColumn:n,rowData:t.isNullOrUndefined(a)?void 0:a.data};this.parent.trigger("commandClick",d,function(e){if(!o.disabled&&r.editModule&&!e.cancel)switch(s){case"Edit":r.editModule.endEdit(),r.editModule.startEdit(t.closest(i,"tr"));break;case"Cancel":r.editModule.closeEdit();break;case"Save":r.editModule.endEdit();break;case"Delete":"Batch"!==r.editSettings.mode&&r.editModule.endEdit(),r.clearSelection(),r.selectRow(parseInt(t.closest(i,"tr").getAttribute("aria-rowindex"),10),!1),r.editModule.deleteRecord()}})}},r.prototype.getModuleName=function(){return"commandColumn"},r.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ge,this.commandClickHandler),this.parent.off(Ve,this.keyPressHandler),this.parent.off(Ae,this.load))},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ge,this.commandClickHandler,this),this.parent.on(Ve,this.keyPressHandler,this),this.parent.on(Ae,this.load,this))},r.prototype.keyPressHandler=function(e){"enter"===e.action&&t.closest(e.target,".e-unboundcelldiv")&&(this.commandClickHandler(e),e.preventDefault())},r.prototype.load=function(){this.parent.columnModel.forEach(function(e,t){e.commands&&e.commands.forEach(function(e){e.uid=N("gridcommand")})})},r}(),rn={header:".e-gridheader",content:".e-gridcontent",edit:".e-inline-edit",batchEdit:".e-editedbatchcell",editIcon:"e-edit",pager:".e-gridpager",delete:"e-delete",save:"e-save",cancel:"e-cancel",copy:"e-copy",pdf:"e-pdfexport",group:"e-icon-group",ungroup:"e-icon-ungroup",csv:"e-csvexport",excel:"e-excelexport",fPage:"e-icon-first",nPage:"e-icon-next",lPage:"e-icon-last",pPage:"e-icon-prev",ascending:"e-icon-ascending",descending:"e-icon-descending",groupHeader:"e-groupdroparea",touchPop:"e-gridpopup"},nn=function(){function e(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.localeText=this.setLocaleKey(),this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Be,this.enableAfterRenderMenu,this),this.parent.on(Me,this.render,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Me,this.render),this.parent.off(Be,this.enableAfterRenderMenu),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler.bind(this)))},e.prototype.keyDownHandler=function(e){"Tab"!==e.code&&9!==e.which||this.contextMenu.close()},e.prototype.render=function(){this.parent.element.classList.add("e-noselect"),this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_cmenu"}),t.EventHandler.add(this.element,"keydown",this.keyDownHandler.bind(this)),this.parent.element.appendChild(this.element);var e="#"+this.gridID;this.contextMenu=new a.ContextMenu({items:this.getMenuItems(),enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,target:e,select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-grid-menu"}),this.contextMenu.appendTo(this.element)},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),t.remove(this.element),this.parent.element.classList.remove("e-noselect")),this.render())},e.prototype.getMenuItems=function(){for(var e=[],t=[],r=0,i=this.parent.contextMenuItems;r<i.length;r++){var n=i[r];"string"==typeof n&&-1!==this.getDefaultItems().indexOf(n)?-1!==n.toLocaleLowerCase().indexOf("export")?t.push(this.buildDefaultItems(n)):e.push(this.buildDefaultItems(n)):"string"!=typeof n&&e.push(n)}if(t.length>0){var o=this.buildDefaultItems("export");o.items=t,e.push(o)}return e},e.prototype.getLastPage=function(){var e=Math.floor(this.parent.pageSettings.totalRecordsCount/this.parent.pageSettings.pageSize);return this.parent.pageSettings.totalRecordsCount%this.parent.pageSettings.pageSize&&(e+=1),e},e.prototype.contextMenuOpen=function(){this.isOpen=!0},e.prototype.contextMenuItemClick=function(e){switch(this.getKeyFromId(e.item.id)){case"AutoFitAll":this.parent.autoFitColumns([]);break;case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Edit":this.parent.editModule&&("Batch"===this.parent.editSettings.mode?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute("aria-colindex"),10))&&this.parent.editModule.editCell(parseInt(this.row.getAttribute("aria-rowindex"),10),this.parent.getColumns()[parseInt(this.cell.getAttribute("aria-colindex"),10)].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?this.parent.editModule.deleteRow(this.row):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&this.parent.editModule.endEdit();break;case"Cancel":this.parent.editModule&&this.parent.editModule.closeEdit();break;case"Copy":this.parent.copy();break;case"PdfExport":this.parent.pdfExport();break;case"ExcelExport":this.parent.excelExport();break;case"CsvExport":this.parent.csvExport();break;case"SortAscending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"FirstPage":this.parent.goToPage(1);break;case"PrevPage":this.parent.goToPage(this.parent.pageSettings.currentPage-1);break;case"LastPage":this.parent.goToPage(this.getLastPage());break;case"NextPage":this.parent.goToPage(this.parent.pageSettings.currentPage+1)}e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuClick",e)},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof a.ContextMenu&&this.updateItemStatus()},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[e])},e.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},e.prototype.contextMenuBeforeOpen=function(e){var r=t.closest(e.event.target,".e-grid");if(e.event&&r&&r!==this.parent.element)e.cancel=!0;else if(e.event&&(t.closest(e.event.target,"."+rn.groupHeader)||t.closest(e.event.target,"."+rn.touchPop)||t.closest(e.event.target,".e-summarycell")||t.closest(e.event.target,".e-groupcaption")||t.closest(e.event.target,".e-filterbarcell")))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),this.targetRowdata=this.parent.getRowInfo(e.event.target),t.isNullOrUndefined(e.parentItem)&&this.targetColumn&&this.selectRow(e.event,!e.event.target.classList.contains("e-selectionbackground")||"Multiple"!==this.parent.selectionSettings.type);for(var i=[],n=[],o=0,s=e.items;o<s.length;o++){var l=s[o],a=this.getKeyFromId(l.id),d=this.defaultItems[a];if(-1!==this.getDefaultItems().indexOf(a))if(this.ensureDisabledStatus(a)&&this.disableItems.push(l.text),e.event&&(this.ensureTarget(e.event.target,rn.edit)||this.ensureTarget(e.event.target,rn.batchEdit)))"Save"!==a&&"Cancel"!==a&&this.hiddenItems.push(l.text);else{if(this.parent.editModule&&"Batch"===this.parent.editSettings.mode&&(t.closest(e.event.target,".e-gridform")||this.parent.editModule.getBatchChanges().changedRecords.length||this.parent.editModule.getBatchChanges().addedRecords.length||this.parent.editModule.getBatchChanges().deletedRecords.length)&&("Save"===a||"Cancel"===a))continue;t.isNullOrUndefined(e.parentItem)&&e.event&&!this.ensureTarget(e.event.target,d.target)&&this.hiddenItems.push(l.text)}else l.target&&e.event&&!this.ensureTarget(e.event.target,l.target)?l.separator?i.push(l.id):this.hiddenItems.push(l.text):this.ensureTarget(e.event.target,l.target)&&l.separator&&n.push(l.id)}n.length>0&&this.contextMenu.showItems(n,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),i.length>0&&this.contextMenu.hideItems(i,!0),this.eventArgs=e.event,e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuOpen",e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}this.parent.applyBiggerTheme(this.contextMenu.element.parentElement)},e.prototype.ensureTarget=function(e,r){var i=e;return(i=!this.ensureFrozenHeader(e)||r!==rn.header&&r!==rn.content?r===rn.content||r===rn.header?O(t.closest(e,".e-table"),r.substr(1,r.length)):t.closest(e,r):t.closest(e,r===rn.header?"thead":"tbody"))&&O(i,"e-grid")===this.parent.element},e.prototype.ensureFrozenHeader=function(e){return!(!this.parent.getFrozenColumns()&&!this.parent.frozenRows||!t.closest(e,rn.header))},e.prototype.ensureDisabledStatus=function(e){var t=this,r=!1;switch(e){case"AutoFitAll":case"AutoFit":r=!(this.parent.ensureModuleInjected(ui)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(mi)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.field)&&(r=!0);break;case"Ungroup":(!this.parent.allowGrouping||!this.parent.ensureModuleInjected(mi)||this.parent.ensureModuleInjected(mi)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(r=!0);break;case"Edit":case"Delete":case"Save":case"Cancel":this.parent.editModule&&0!==this.parent.getDataRows().length||(r=!0);break;case"Copy":0!==this.parent.getSelectedRowIndexes().length&&0!==this.parent.getCurrentViewRecords().length||(r=!0);break;case"export":this.parent.allowExcelExport&&this.parent.excelExport&&(this.parent.ensureModuleInjected($i)||this.parent.ensureModuleInjected(Xi))||(r=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected($i)||(r=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(Xi)||(r=!0);break;case"SortAscending":case"SortDescending":!this.parent.allowSorting||!this.parent.ensureModuleInjected(Gr)||this.targetColumn&&!this.targetColumn.field?r=!0:this.parent.ensureModuleInjected(Gr)&&this.parent.sortSettings.columns.length>0&&this.targetColumn&&this.parent.sortSettings.columns.forEach(function(i){i.field===t.targetColumn.field&&i.direction.toLowerCase()===e.toLowerCase().replace("sort","").toLocaleLowerCase()&&(r=!0)});break;case"FirstPage":case"PrevPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected($r)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected($r)&&1===this.parent.pageSettings.currentPage)&&(r=!0);break;case"LastPage":case"NextPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected($r)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected($r)&&this.parent.pageSettings.currentPage===this.getLastPage())&&(r=!0)}return r},e.prototype.getContextMenu=function(){return this.element},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.contextMenu.destroy(),t.remove(this.element),this.removeEventListener(),this.parent.element.classList.remove("e-noselect"))},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.generateID=function(e){return this.gridID+"_cmenu_"+e},e.prototype.getKeyFromId=function(e){return e.replace(this.gridID+"_cmenu_","")},e.prototype.buildDefaultItems=function(e){var t;switch(e){case"AutoFitAll":case"AutoFit":t={target:rn.header};break;case"Group":t={target:rn.header,iconCss:rn.group};break;case"Ungroup":t={target:rn.header,iconCss:rn.ungroup};break;case"Edit":t={target:rn.content,iconCss:rn.editIcon};break;case"Delete":t={target:rn.content,iconCss:rn.delete};break;case"Save":t={target:rn.edit,iconCss:rn.save};break;case"Cancel":t={target:rn.edit,iconCss:rn.cancel};break;case"Copy":t={target:rn.content,iconCss:rn.copy};break;case"export":t={target:rn.content};break;case"PdfExport":t={target:rn.content,iconCss:rn.pdf};break;case"ExcelExport":t={target:rn.content,iconCss:rn.excel};break;case"CsvExport":t={target:rn.content,iconCss:rn.csv};break;case"SortAscending":t={target:rn.header,iconCss:rn.ascending};break;case"SortDescending":t={target:rn.header,iconCss:rn.descending};break;case"FirstPage":t={target:rn.pager,iconCss:rn.fPage};break;case"PrevPage":t={target:rn.pager,iconCss:rn.pPage};break;case"LastPage":t={target:rn.pager,iconCss:rn.lPage};break;case"NextPage":t={target:rn.pager,iconCss:rn.nPage}}return this.defaultItems[e]={text:this.getLocaleText(e),id:this.generateID(e),target:t.target,iconCss:t.iconCss?"e-icons "+t.iconCss:""},this.defaultItems[e]},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","Group","Ungroup","Edit","Delete","Save","Cancel","Copy","export","PdfExport","ExcelExport","CsvExport","SortAscending","SortDescending","FirstPage","PrevPage","LastPage","NextPage"]},e.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Copy:"Copy",Group:"Group",Ungroup:"Ungroup",Edit:"EditRecord",Delete:"DeleteRecord",Save:"Save",Cancel:"CancelButton",PdfExport:"Pdfexport",ExcelExport:"Excelexport",CsvExport:"Csvexport",export:"Export",SortAscending:"SortAscending",SortDescending:"SortDescending",FirstPage:"FirstPage",LastPage:"LastPage",PrevPage:"PreviousPage",NextPage:"NextPage"}},e.prototype.getColumn=function(e){var r=t.closest(e.target,"th.e-headercell");if(r){var i=r.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("e-mappinguid");return this.parent.getColumnByUid(i)}return this.parent.getRowInfo(e.target).column||null},e.prototype.selectRow=function(e,r){this.cell=e.target,this.row=t.closest(e.target,"tr.e-row")||this.row,this.row&&r&&!O(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute("aria-rowindex"),10))},e}(),on=function(){function e(e){this.isFrzLoad=1,this.parent=e,this.rowModelGenerator=new Ct(this.parent)}return e.prototype.generateRows=function(e,t){for(var r=this.parent.getFrozenColumns(),i=this.rowModelGenerator.generateRows(e,t),n=0,o=i.length;n<o;n++)this.isFrzLoad%2==0?i[n].cells=i[n].cells.slice(r,i[n].cells.length):i[n].cells=i[n].cells.slice(0,r);return this.isFrzLoad++,i},e}(),sn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ln=function(e){function r(t,r){return e.call(this,t,r)||this}return sn(r,e),r.prototype.renderPanel=function(){e.prototype.renderPanel.call(this);var t=this.parent.createElement("div",{className:"e-frozencontent"}),r=this.parent.createElement("div",{className:"e-movablecontent"});this.getPanel().firstChild.appendChild(t),this.getPanel().firstChild.appendChild(r),this.setFrozenContent(t),this.setMovableContent(r)},r.prototype.renderEmpty=function(t){e.prototype.renderEmpty.call(this,t),this.getMovableContent().querySelector("tbody").innerHTML="<tr><td></td></tr>",this.getFrozenContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getFrozenColumns(),this.getFrozenContent().style.borderRightWidth="0px",this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody").innerHTML="",this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody").innerHTML="")},r.prototype.setFrozenContent=function(e){this.frozenContent=e},r.prototype.setMovableContent=function(e){this.movableContent=e},r.prototype.getFrozenContent=function(){return this.frozenContent},r.prototype.getMovableContent=function(){return this.movableContent},r.prototype.getModelGenerator=function(){return new on(this.parent)},r.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.getFrozenContent().appendChild(this.getTable());var r=this.getTable().cloneNode(!0);this.getMovableContent().appendChild(r),t.remove(this.getMovableContent().querySelector("colgroup"));var i=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").cloneNode(!0);r.insertBefore(i,r.querySelector("tbody"))},r}(Tt),an=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.addEventListener(),i}return sn(r,e),r.prototype.addEventListener=function(){this.parent.on(st,this.refreshFreeze,this),this.parent.on("frozenHeight",this.setFrozenHeight,this),this.parent.on(Be,this.enableAfterRender,this)},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("frozenHeight",this.setFrozenHeight),this.parent.off(Be,this.enableAfterRender))},r.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.rfshMovable(),this.updateColgroup(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Ue,{rows:this.rows,args:{isFrozen:!1}})},r.prototype.renderPanel=function(){e.prototype.renderPanel.call(this);var t=this.parent.createElement("div",{className:"e-frozenheader"}),r=this.parent.createElement("div",{className:"e-movableheader"});this.getPanel().firstChild.appendChild(t),this.getPanel().firstChild.appendChild(r),this.setFrozenHeader(t),this.setMovableHeader(r)},r.prototype.refreshUI=function(){var r=this.getMovableHeader().querySelector("tbody");t.remove(this.getMovableHeader().querySelector("table")),e.prototype.refreshUI.call(this),this.rfshMovable(),this.getMovableHeader().querySelector("tbody").innerHTML=r.innerHTML,this.updateColgroup(),this.widthService.setWidthToTable(),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&K([].slice.call(this.movableHeader.querySelectorAll("tr.e-columnheader")),!0),this.parent.updateDefaultCursor(),oe(this.parent.getContentTable().querySelector("colgroup"),this.parent.getFrozenColumns()),this.initializeHeaderDrag(),this.parent.notify(Ue,{rows:this.rows,args:{isFrozen:!1}})},r.prototype.rfshMovable=function(){this.getFrozenHeader().appendChild(this.getTable()),this.getMovableHeader().appendChild(this.createTable()),this.refreshStackedHdrHgt(),this.addMovableFirstCls()},r.prototype.addMovableFirstCls=function(){if(this.parent.getVisibleFrozenColumns())for(var e=this.parent.element.querySelector(".e-movableheader").querySelector("thead").querySelectorAll(".e-columnheader"),r=this.parent.element.querySelector(".e-movableheader").querySelector("thead").querySelectorAll(".e-columnheader").length,i=0;i<r;i++){var n=e[i].cells[0];n&&(t.addClass([n],["e-movablefirst"]),e[i].cells[0].rowSpan>1&&(i+=e[i].cells[0].rowSpan-1))}},r.prototype.refreshFreeze=function(e){if("filter"===e.case){var t=this.getTable().querySelector(".e-filterbar");this.parent.allowFiltering&&t&&this.getMovableHeader().querySelector("thead")&&this.getMovableHeader().querySelector("thead").appendChild(oe(t,this.parent.getFrozenColumns()))}else if("textwrap"===e.case||"refreshHeight"===e.case){var r=void 0,i=void 0,n=this.getFrozenHeader(),o=this.getMovableHeader(),s=this.parent.getContent(),l=this.parent.textWrapSettings.wrapMode,a=this.parent.getHeaderContent().firstChild.classList;"textwrap"===e.case?(("Header"!==l||e.isModeChg)&&(r=s.querySelector(".e-frozencontent").querySelectorAll("tr"),i=s.querySelector(".e-movablecontent").querySelectorAll("tr"),this.setWrapHeight(r,i,e.isModeChg,!0)),"Content"===l&&this.parent.allowTextWrap?a.add("e-wrap"):a.remove("e-wrap"),"Both"===l||e.isModeChg?(r=n.querySelectorAll("tr"),i=o.querySelectorAll("tr")):(r=n.querySelector("Content"===l?"tbody":"thead").querySelectorAll("tr"),i=o.querySelector("Content"===l?"tbody":"thead").querySelectorAll("tr")),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||this.setWrapHeight(r,i,e.isModeChg,!1,this.colDepth>1),this.refreshStackedHdrHgt()):"refreshHeight"===e.case&&(this.setWrapHeight(s.querySelector(".e-frozencontent").querySelectorAll("tr"),s.querySelector(".e-movablecontent").querySelectorAll("tr"),e.isModeChg),this.setWrapHeight(n.querySelectorAll("tr"),o.querySelectorAll("tr"),e.isModeChg))}},r.prototype.enableAfterRender=function(e){"scroll"===e.module&&this.setFrozenHeight()},r.prototype.updateResizeHandler=function(){[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-rhandler")).forEach(function(e){e.style.height=e.parentElement.offsetHeight+"px"})},r.prototype.setWrapHeight=function(e,r,i,n,o){for(var s,l,a=this.parent.allowTextWrap,d=this.parent.textWrapSettings.wrapMode,c=this.parent.getHeaderContent().querySelector("thead"),h=this.parent.getHeaderContent().querySelector("tbody"),p=[],u=[],g=0,f=e.length;g<f;g++)e[g].classList.contains("e-columnheader")||t.isNullOrUndefined(e[g])||t.isNullOrUndefined(r[g])||(p[g]=e[g].offsetHeight,u[g]=r[g].offsetHeight);for(var g=0,f=e.length;g<f;g++)(i&&("Header"===d&&n||"Content"===d&&c.contains(e[g])||"Header"===d&&h.contains(e[g]))||o)&&(e[g].style.height=null,r[g].style.height=null),s=p[g],l=u[g],!t.isNullOrUndefined(e[g])&&e[g].childElementCount&&(a&&s<l||!a&&s<l||this.parent.allowResizing&&this.parent.resizeModule&&!this.parent.resizeModule.isFrozenColResized)&&(e[g].style.height=l+"px"),r&&!t.isNullOrUndefined(r[g])&&r[g].childElementCount&&(a&&s>l||!a&&s>l||this.parent.allowResizing&&this.parent.resizeModule&&this.parent.resizeModule.isFrozenColResized)&&(r[g].style.height=s+"px");a&&this.setFrozenHeight()},r.prototype.setFrozenHeight=function(e){void 0===e&&(e=z());var t=this.parent.element.querySelector(".e-movablecontent").getBoundingClientRect().height,r=this.parent.element.querySelector(".e-movablecontent"),i=this.parent.element.querySelector(".e-frozencontent");r.scrollWidth-r.clientWidth?(i.style.height=t-e+"px",i.style.borderBottom=""):(i.style.height=t+"px",(i.scrollHeight<=i.clientHeight||r.scrollHeight<=r.clientHeight)&&this.parent.scrollModule.removePadding(),i.style.borderBottom="0px")},r.prototype.refreshStackedHdrHgt=function(){for(var e,t,r=this.getFrozenHeader().querySelectorAll(".e-columnheader"),i=this.getMovableHeader().querySelectorAll(".e-columnheader"),n=0,o=r.length;n<o;n++)e=this.getRowSpan(r[n]),t=this.getRowSpan(i[n]),e.min>1?this.updateStackedHdrRowHgt(n,e.max,r[n],i):t.min>1&&this.updateStackedHdrRowHgt(n,t.max,i[n],r);this.parent.allowResizing&&this.updateResizeHandler()},r.prototype.getRowSpan=function(e){for(var t,r,i,n=0,o=e.childElementCount;n<o;n++)0===n&&(r=e.children[0].rowSpan),t=e.children[n].rowSpan,r=Math.min(t,r),i=Math.max(t,r);return{min:r,max:i}},r.prototype.updateStackedHdrRowHgt=function(e,t,r,i){for(var n=0,o=0;o<t;o++)n+=i[e+o].style.height?parseInt(i[e+o].style.height,10):i[e+o].offsetHeight;r.style.height=n+"px"},r.prototype.setFrozenHeader=function(e){this.frozenHeader=e},r.prototype.setMovableHeader=function(e){this.movableHeader=e},r.prototype.getFrozenHeader=function(){return this.frozenHeader},r.prototype.getMovableHeader=function(){return this.movableHeader},r.prototype.updateColgroup=function(){var e=this.getMovableHeader().querySelector("table");t.remove(this.getMovableHeader().querySelector("colgroup")),e.insertBefore(oe(this.getFrozenHeader().querySelector("colgroup"),this.parent.getFrozenColumns()),e.querySelector("thead"))},r}(Dt),dn=function(){function t(e,t){this.parent=e,this.locator=t,this.addEventListener()}return t.prototype.getModuleName=function(){return"freeze"},t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Me,this.instantiateRenderer,this)},t.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName());var t=this.locator.getService("rendererFactory");this.parent.getFrozenColumns()&&(t.addRenderer(e.RenderType.Header,new an(this.parent,this.locator)),t.addRenderer(e.RenderType.Content,new ln(this.parent,this.locator)))},t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Me,this.instantiateRenderer)},t.prototype.destroy=function(){this.removeEventListener()},t}(),cn=function(){function e(e,t){this.defaultItems={},this.localeText=this.setLocaleKey(),this.disableItems=[],this.hiddenItems=[],this.isOpen=!1,this.GROUP="e-icon-group",this.UNGROUP="e-icon-ungroup",this.ASCENDING="e-icon-ascending",this.DESCENDING="e-icon-descending",this.ROOT="e-columnmenu",this.FILTER="e-icon-filter",this.POP="e-filter-popup",this.WRAP="e-col-menu",this.CHOOSER="_chooser_",this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.wireEvents=function(){var e=this;this.getColumnMenuHandlers().forEach(function(r){t.EventHandler.add(r,"mousedown",e.columnMenuHandlerDown,e)})},e.prototype.unwireEvents=function(){var e=this;this.getColumnMenuHandlers().forEach(function(r){t.EventHandler.remove(r,"mousedown",e.columnMenuHandlerDown)})},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),t.remove(this.element))},e.prototype.columnMenuHandlerClick=function(e){e.target.classList.contains("e-columnmenu")&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.isOpen&&this.headerCell!==this.getHeaderCell(e)||document.querySelector(".e-grid-menu .e-menu-parent.e-ul")?(this.columnMenu.close(),this.openColumnMenu(e)):this.isOpen?this.columnMenu.close():this.openColumnMenu(e))},e.prototype.openColumnMenu=function(e){var r={top:0,left:0};this.element.style.cssText="display:block;visibility:hidden";var n=this.element.getBoundingClientRect();this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),t.Browser.isDevice?(r.top=window.innerHeight/2-n.height/2,r.left=window.innerWidth/2-n.width/2):this.parent.enableRtl?r=i.calculatePosition(this.headerCell,"left","bottom"):(r=i.calculatePosition(this.headerCell,"right","bottom")).left-=n.width,this.columnMenu.open(r.top,r.left),e.preventDefault(),this.parent.applyBiggerTheme(this.columnMenu.element.parentElement)},e.prototype.columnMenuHandlerDown=function(e){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},e.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+this.ROOT))},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ue,this.wireEvents,this),this.parent.on(Be,this.enableAfterRenderMenu,this),this.parent.on(Ae,this.render,this),this.isFilterItemAdded()&&this.parent.on("filterDialogCreated",this.filterPosition,this),this.parent.on(Ge,this.columnMenuHandlerClick,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ue,this.unwireEvents),this.parent.off(Be,this.enableAfterRenderMenu),this.parent.off(Ae,this.render),this.isFilterItemAdded()&&this.parent.off("filterDialogCreated",this.filterPosition),this.parent.off(Ge,this.columnMenuHandlerClick))},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),t.remove(this.element)),this.render())},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_columnmenu",className:"e-colmenu"}),this.parent.element.appendChild(this.element),this.columnMenu=new a.ContextMenu({cssClass:"e-grid-menu",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,items:this.getItems(),select:this.columnMenuItemClick.bind(this),beforeOpen:this.columnMenuBeforeOpen.bind(this),onOpen:this.columnMenuOnOpen.bind(this),onClose:this.columnMenuOnClose.bind(this),beforeItemRender:this.beforeMenuItemRender.bind(this),beforeClose:this.columnMenuBeforeClose.bind(this)}),this.columnMenu.appendTo(this.element),this.wireFilterEvents()},e.prototype.wireFilterEvents=function(){!t.Browser.isDevice&&this.isFilterItemAdded()&&t.EventHandler.add(this.element,"mouseover",this.appendFilter,this)},e.prototype.unwireFilterEvents=function(){!t.Browser.isDevice&&this.isFilterItemAdded()&&t.EventHandler.remove(this.element,"mouseover",this.appendFilter)},e.prototype.beforeMenuItemRender=function(e){if(this.isChooserItem(e.item)){var t=this.getKeyFromId(e.item.id,this.CHOOSER),r=this.parent.columnModel.filter(function(e){return e.field===t}),i=n.createCheckBox(this.parent.createElement,!1,{label:e.item.text,checked:r[0].visible});this.parent.enableRtl&&i.classList.add("e-rtl"),e.element.innerHTML="",e.element.appendChild(i)}else e.item.id&&"Filter"===this.getKeyFromId(e.item.id)&&(e.element.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),e.element.className+="e-filter-item e-menu-caret-icon")},e.prototype.columnMenuBeforeClose=function(e){var r=e.event?t.closest(e.event.target,".e-menu-item"):null;!t.isNullOrUndefined(e.parentItem)&&"ColumnChooser"===this.getKeyFromId(e.parentItem.id)&&r&&this.isChooserItem(r)?e.cancel=!0:e.event&&(t.closest(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&O(e.event.currentTarget.activeElement,"e-filter-popup")||O(e.event.target,"e-popup")||O(e.event.target,"e-popup-wrapper"))&&!t.Browser.isDevice&&(e.cancel=!0)},e.prototype.isChooserItem=function(e){return e.id&&e.id.indexOf("_colmenu_")>=0&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},e.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger("columnMenuOpen",e);for(var t=0,r=e.items;t<r.length;t++){var i=r[t],n=this.getKeyFromId(i.id),o=this.defaultItems[n];-1!==this.getDefaultItems().indexOf(n)&&(this.ensureDisabledStatus(n)&&!o.hide?this.disableItems.push(i.text):i.hide&&this.hiddenItems.push(i.text))}this.columnMenu.enableItems(this.disableItems,!1),this.columnMenu.hideItems(this.hiddenItems)},e.prototype.columnMenuOnOpen=function(e){"e-menu-parent e-ul "===e.element.className&&(e.element.offsetHeight>window.innerHeight?(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto"):this.parent.element.offsetHeight>window.innerHeight&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto"))},e.prototype.ensureDisabledStatus=function(e){var t=this,r=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(mi)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.allowGrouping)&&(r=!0);break;case"AutoFitAll":case"AutoFit":r=!this.parent.ensureModuleInjected(ui);break;case"Ungroup":(!this.parent.ensureModuleInjected(mi)||this.parent.ensureModuleInjected(mi)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(r=!0);break;case"SortDescending":case"SortAscending":this.parent.allowSorting&&this.parent.ensureModuleInjected(Gr)&&this.parent.sortSettings.columns.length>0&&this.targetColumn&&this.targetColumn.allowSorting?this.parent.sortSettings.columns.forEach(function(i){i.field===t.targetColumn.field&&i.direction.toLocaleLowerCase()===e.toLocaleLowerCase().replace("sort","")&&(r=!0)}):(!this.parent.allowSorting||!this.parent.ensureModuleInjected(Gr)||this.parent.allowSorting&&this.targetColumn&&!this.targetColumn.allowSorting)&&(r=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(hi)&&this.targetColumn&&this.targetColumn.allowFiltering?r=!1:this.parent.ensureModuleInjected(hi)&&this.parent.allowFiltering&&this.targetColumn&&(!this.targetColumn.allowFiltering||"FilterBar"===this.parent.filterSettings.type)&&(r=!0)}return r},e.prototype.columnMenuItemClick=function(e){switch(this.isChooserItem(e.item)?"ColumnChooser":this.getKeyFromId(e.item.id)){case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"AutoFitAll":this.parent.autoFitColumns([]);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"SortAscending":this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"ColumnChooser":var t=this.getKeyFromId(e.item.id,this.CHOOSER),r=e.element.querySelector(".e-checkbox-wrapper .e-frame");r&&r.classList.contains("e-check")?(r.classList.remove("e-check"),this.parent.hideColumns(t,"field")):r&&(this.parent.showColumns(t,"field"),r.classList.add("e-check"));break;case"Filter":this.getFilter(e.element,e.item.id)}e.column=this.targetColumn,this.parent.trigger("columnMenuClick",e)},e.prototype.columnMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof a.ContextMenu&&(this.columnMenu.enableItems(this.disableItems,!1),this.disableItems=[],this.columnMenu.showItems(this.hiddenItems),this.hiddenItems=[],this.isFilterPopupOpen()&&this.getFilter(e.element,e.element.id,!0))},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},e.prototype.getItems=function(){for(var e=[],t=0,r=this.parent.columnMenuItems?this.parent.columnMenuItems:this.getDefault();t<r.length;t++){var i=r[t];if("string"==typeof i)if("ColumnChooser"===i){var n=this.getDefaultItem(i);n.items=this.createChooserItems(),e.push(n)}else e.push(this.getDefaultItem(i));else e.push(i)}return e},e.prototype.getDefaultItem=function(e){var t={};switch(e){case"SortAscending":t={iconCss:this.ASCENDING};break;case"SortDescending":t={iconCss:this.DESCENDING};break;case"Group":t={iconCss:this.GROUP};break;case"Ungroup":t={iconCss:this.UNGROUP};break;case"Filter":t={iconCss:this.FILTER}}return this.defaultItems[e]={text:this.getLocaleText(e),id:this.generateID(e),iconCss:t.iconCss?"e-icons "+t.iconCss:null},this.defaultItems[e]},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[e])},e.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},e.prototype.getKeyFromId=function(e,t){return e.indexOf("_colmenu_")>0&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},e.prototype.getColumnMenu=function(){return this.element},e.prototype.getModuleName=function(){return"columnMenu"},e.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"}},e.prototype.getHeaderCell=function(e){return t.closest(e.target,"th.e-headercell")},e.prototype.getColumn=function(){if(this.headerCell){var e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");return this.parent.getColumnByUid(e)}return null},e.prototype.createChooserItems=function(){for(var e=[],t=0,r=this.parent.columnModel;t<r.length;t++){var i=r[t];i.showInColumnChooser&&i.field&&e.push({id:this.generateID(i.field,this.CHOOSER),text:i.headerText?i.headerText:i.field})}return e},e.prototype.appendFilter=function(e){if(this.defaultItems.Filter){var r=this.defaultItems.Filter.id;t.closest(e.target,"#"+r)&&!this.isFilterPopupOpen()?this.getFilter(e.target,r):!t.closest(e.target,"#"+r)&&this.isFilterPopupOpen()&&this.getFilter(e.target,r,!0)}},e.prototype.getFilter=function(e,r,i){var n=this.getFilterPop();n?n.style.display=!t.Browser.isDevice&&i?"none":"block":this.parent.notify("filterOpen",{col:this.targetColumn,target:e,isClose:i,id:r})},e.prototype.setPosition=function(e,t){var r=this.parent.element.getBoundingClientRect(),i=e.getBoundingClientRect(),n=i.left-r.left,o=i.top-r.top;r.height<o?o=o-t.offsetHeight+i.height:r.height<o+t.offsetHeight&&(o=r.height-t.offsetHeight),window.innerHeight<t.offsetHeight+o+r.top&&(o=window.innerHeight-t.offsetHeight-r.top),n+=this.parent.enableRtl?-t.offsetWidth:i.width,r.width<=n+t.offsetWidth?n-=i.width+t.offsetWidth:n<0&&(n+=t.offsetWidth+i.width),t.style.top=o+"px",t.style.left=n+"px"},e.prototype.filterPosition=function(e){var r=this.getFilterPop();if(r.classList.add(this.WRAP),!t.Browser.isDevice){var i=r.style.display;r.style.cssText+="display:block;visibility:hidden";var n=this.element.querySelector("."+this.FILTER);n&&(this.setPosition(n.parentElement,r),r.style.cssText+="display:"+i+";visibility:visible")}},e.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(ui)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(mi)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(Gr)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(hi)&&e.push("Filter"),e},e.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},e.prototype.getFilterPop=function(){return t.Browser.isDevice&&null!==this.targetColumn?document.getElementById(this.targetColumn.uid+"-flmdlg"):this.parent.element.querySelector("."+this.POP)},e.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&this.parent.columnMenuItems.indexOf("Filter")>=0||!this.parent.columnMenuItems},e}(),hn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),pn=function(e){function i(t,r){var i=e.call(this,t,r)||this;return i.parent=t,i.serviceLocator=r,i.initEvent(),i}return hn(i,e),i.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on("initForeignKeyColumn",this.initForeignKeyColumns,this),this.parent.on("getForeignKeyData",this.getForeignKeyData,this),this.parent.on("generateQuery",this.generateQueryFormData,this))},i.prototype.initForeignKeyColumns=function(e){e.forEach(function(e){e.dataSource=e.dataSource instanceof r.DataManager?e.dataSource:t.isNullOrUndefined(e.dataSource)?new r.DataManager:new r.DataManager(e.dataSource)})},i.prototype.getForeignKeyData=function(e){var t=this,r=e.column?[e.column]:this.parent.getForeignKeyColumns(),i=[];r.forEach(function(r){var n,o=e.isComplex?t.genarateColumnQuery(r):t.genarateQuery(r,e.result.result,!1,!0);o.params=t.parent.query.params;var s=r.dataSource;n=!s.ready||s.dataSource.offline?s.executeQuery(o):s.ready.then(function(){return s.executeQuery(o)}),i.push(n)}),Promise.all(i).then(function(t){t.forEach(function(e,t){r[t].columnData=e.result}),e.promise.resolve(e.result)}).catch(function(r){return t.parent.log(["actionfailure","foreign_key_failure"]),e.promise&&e.promise.reject&&e.promise.reject(r),r})},i.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},i.prototype.genarateQuery=function(e,t,i,n){var o=this.parent,s=[],l=new r.Query,a=i?e.foreignKeyField:e.field;if(o.allowPaging||o.enableVirtualization||i){t=new r.DataManager(o.allowGrouping&&o.groupSettings.columns.length&&!i?t.records:t).executeLocal((new r.Query).select(a));var d=r.DataUtil.distinct(t,a,!1);a=i?e.field:e.foreignKeyField,d.forEach(function(e){e&&e.getDay?s.push(ne({field:a,operator:"equal",value:e,matchCase:!1})):s.push(new r.Predicate(a,"equal",e,!1))})}return n?s.length?l.where(r.Predicate.or(s)):l:s.length?r.Predicate.or(s):{predicates:[]}},i.prototype.genarateColumnQuery=function(e){var t=this.parent,i=new r.Query,n=this.isFiltered(e);if(n.isTrue&&(i=this.filterQuery(i,n.column,!0)),t.searchSettings.key.length){var o=t.searchSettings;i.search(o.key,e.foreignKeyValue,o.operator,o.ignoreCase)}return i},i.prototype.isFiltered=function(e){var t=this.parent.filterSettings.columns.filter(function(t){return t.field===e.foreignKeyValue&&t.uid===e.uid});return{column:t,isTrue:!!t.length}},i.prototype.getModuleName=function(){return"foreignKey"},i.prototype.destroy=function(){this.destroyEvent()},i.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off("initForeignKeyColumn",this.initForeignKeyColumns),this.parent.off("getForeignKeyData",this.getForeignKeyData),this.parent.off("generateQuery",this.generateQueryFormData))},i}(gt),un="https://ej2.syncfusion.com/documentation/grid",gn="https://ej2.syncfusion.com/documentation/",fn="[EJ2Grid.Warning]",mn="[EJ2Grid.Error]",yn="[EJ2Grid.Info]",vn=function(){function e(e){this.parent=e,this.parent.on("initial-end",this.patchadaptor,this)}return e.prototype.getModuleName=function(){return"logger"},e.prototype.log=function(e,t){var r=this;e instanceof Array||(e=[e]),e.forEach(function(e){var i=Cn[e],n=i.check(t,r.parent);n.success&&console[i.logType](i.generateMessage(t,r.parent,n.options))})},e.prototype.patchadaptor=function(){var e=this.parent.getDataModule().dataManager.adaptor,t=e.beforeSend;t&&(e.beforeSend=function(r,i,n){t.call(e,r,i,n)})},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},e}(),Cn={module_missing:{type:"module_missing",logType:"warn",check:function(e,t){var r=t.getInjectedModules().map(function(e){return e.prototype.getModuleName()}),i=t.requiredModules().map(function(e){return e.member}).filter(function(e){return-1===r.indexOf(e)});return{success:i.filter(function(e){return"resize"!==e}).length>0,options:i}},generateMessage:function(e,t,r){return r=r.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),fn+": MODULES MISSING\nThe following modules are not injected:.\n"+r+"Refer to "+un+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(e,t){return{success:"undefined"==typeof Promise}},generateMessage:function(e,t){return mn+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+gn+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(e,t){return fn+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+un+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},selection_key_missing:{type:"selection_key_missing",logType:"warn",check:function(e,t){return{success:t.selectionSettings.persistSelection&&0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(e,t){return fn+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+un+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(e,t){return{success:!0}},generateMessage:function(e,t){var r="",i=wn(e,t),n=bn(e,t);return r=""!==n?n:""!==i?i:e.error,fn+": "+r}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,i){var n=r.DataUtil.getObject("locale."+i.locale+".grid",t.L10n);return{success:"en-US"!==i.locale&&t.isNullOrUndefined(n)}},generateMessage:function(e,t){return fn+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+un+"/globalization-and-localization.html?#localization \n             for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,r){var i;switch(e){case"freeze":i={success:r.allowGrouping||!t.isUndefined(r.detailTemplate)||!t.isUndefined(r.childGrid)||!t.isUndefined(r.rowTemplate)||r.enableVirtualization,options:{name:"freeze"}};break;case"virtualization":i={success:!t.isUndefined(r.detailTemplate)||!t.isUndefined(r.childGrid)||0!==r.frozenRows||0!==r.frozenColumns,options:{name:"virtualization"}};break;default:i={success:!1}}return i},generateMessage:function(e,t,r){var i,n=r.name;switch(n){case"freeze":i="Frozen rows and columns do not support the following features:\n* Virtualization\n* Row Template\n* Details Template\n* Hierarchy Grid\n* Grouping";break;case"virtualization":i="Virtualization does not support the following features.\n* Freeze rows and columns.\n* Details Template.\n* Hierarchy Grid.\n";break;default:i=""}return fn+": "+n.toUpperCase()+" LIMITATIONS\n"+i}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,t){return{success:!(t.columns.length||t.dataSource instanceof r.DataManager||t.dataSource.length)}},generateMessage:function(e,t){return fn+": GRID CONFIG MISSING\ndataSource and columns are not provided in the grid. At least one of either must be provided for grid configuration.\nRefer to "+un+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,r){return{success:t.isNullOrUndefined(r.height)||"auto"===r.height}},generateMessage:function(e,t){return mn+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+un+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e,t){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(e,t){return mn+": RETRUN VALUE MISSING  \nRemote service returns invalid data. \nRefer to "+un+"/edit.html for documentation on configuring editing with remote data."}},grid_sort_comparer:{type:"grid_sort_comparer",logType:"warn",check:function(e,t){return{success:t.getDataModule().isRemote()}},generateMessage:function(e,t){return fn+": SORT COMPARER NOT WORKING  \nSort comparer will not work with remote data.Refer to "+un+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e,t){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(e,t){return yn+": RESIZING COLUMN REACHED MIN OR MAX  \nThe column resizing width is at its min or max."}},action_disabled_column:{type:"action_disabled_column",logType:"info",check:function(e,r){var i;switch(e.moduleName){case"reorder":i=t.isNullOrUndefined(e.destColumn)?"reordering action is disabled for the "+e.column.headerText+" column":"reordering action is disabled for the "+(e.column.allowReordering?e.destColumn.headerText:e.column.headerText)+" column";break;case"group":i="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":i="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":i="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:i}}},generateMessage:function(e,t,r){return yn+": ACTION DISABLED \n "+r.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e,t){return{success:!0,options:{args:e}}},generateMessage:function(e,t,r){return yn+": EXPORTNIG INPROGRESS \n Grid "+r.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e,t){return{success:!0,options:{args:e}}},generateMessage:function(e,t,r){return yn+": EXPORTNIG COMPLETED \n Grid "+r.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(e,t){return{success:!0}},generateMessage:function(e,t){return mn+": FOREIGNKEY CONFIG \n  Grid foreign key column needs a valid data source/service.Refer to "+un+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e,t){var r;switch(e.moduleName){case"group":r="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to group the column";break;case"filter":r="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to filter the column.";break;case"sort":r="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to sort the column."}return{success:!0,options:{fn:r}}},generateMessage:function(e,t,r){return mn+": INITIAL ACTION FAILURE \n "+r.fn}},frozen_rows_columns:{type:"frozen_rows_columns",logType:"error",check:function(e,t){return{success:t.getColumns().length<=t.frozenColumns||t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t,r){return mn+": OUT OF RANGE ERROR-\n "+(t.getColumns().length<=t.frozenColumns?"FROZEN COLUMNS,":"")+(t.frozenRows>=t.currentViewData.length?"FROZEN ROWS":"")+" invalid"}},column_type_missing:{type:"column_type_missing",logType:"error",check:function(e,r){return{success:t.isNullOrUndefined(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,r){return mn+": COLUMN TYPE MISSING-\n  "+r+" column type was invalid or not defined.Please go through below help link: "+gn+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e,i){return{success:(e.dataState.dataSource instanceof r.DataManager||e.dataState.dataSource instanceof Array)&&!t.isNullOrUndefined(e.dataState.dataStateChange)}},generateMessage:function(e,t,r){return fn+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},wn=function(e,t){var r=e.error;return r.indexOf&&0!==r.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+gn+"/base/intl.html?#supported-format-string.\nDate format: "+gn+"/base/intl.html?#manipulating-datetime.\nMessage: "+r},bn=function(e,i){var n=r.DataUtil.getObject("error.error",e);if(t.isNullOrUndefined(n))return"";var o="";try{o=JSON.parse(n.responseText)}catch(e){o=""}return"XMLHTTPREQUEST FAILED\nUrl: "+n.responseURL+"\nStatus: "+n.status+" - "+n.statusText+"\n"+(""!==o?"Message: "+o:"")},Sn=function(){function e(e){this.parentObj=e}return e.prototype.create=function(e){var t=j(e.column.field);return this.parentObj.createElement("input",{className:"e-field",attrs:{id:this.parentObj.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parentObj.editSettings.mode;this.object=new s.AutoComplete(t.extend({dataSource:this.parentObj.dataSource instanceof r.DataManager?this.parentObj.dataSource:new r.DataManager(this.parentObj.dataSource),query:(new r.Query).select(e.column.field),enabled:G(e.column,e.requestType,e.element),fields:{value:e.column.field},value:le(e.column.field,e.rowData),actionComplete:this.selectedValues.bind(this),placeholder:i?"":e.column.headerText,floatLabelType:i?"Never":"Always"},e.column.edit.params)),this.object.appendTo(e.element),e.element.setAttribute("name",j(e.column.field))},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.selectedValues=function(e){e.result=r.DataUtil.distinct(e.result,this.object.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},e.prototype.destroy=function(){this.object&&this.object.destroy()},e}(),xn=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=j(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new s.ComboBox(t.extend({dataSource:this.parent.dataSource instanceof r.DataManager?this.parent.dataSource:new r.DataManager(this.parent.dataSource),query:(new r.Query).select(e.column.field),fields:{value:e.column.field},value:le(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:i?"":e.column.headerText,floatLabelType:i?"Never":"Always",enabled:G(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.finalValue=function(e){e.result=r.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Rn=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=j(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.write=function(e){this.column=e.column;var r="Dialog"!==this.parent.editSettings.mode;this.obj=new s.MultiSelect(t.extend({fields:{text:e.column.field,value:e.column.field},value:t.getValue(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:r?"":e.column.headerText,popupHeight:"200px",floatLabelType:r?"Never":"Always"},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",j(e.column.field))},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),En=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=j(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.write=function(e){var r="Dialog"!==this.parent.editSettings.mode,i=le(e.column.field,e.rowData);i=i?new Date(i):null,this.obj=new l.TimePicker(t.extend({floatLabelType:r?"Never":"Always",value:i,placeholder:r?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:G(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Tn=function(){function e(e){this.activeClasses=["e-selectionbackground","e-active"],this.parent=e}return e.prototype.create=function(e){var t=e.column,r="e-field e-boolcell";"checkbox"===t.type&&(r="e-field e-boolcell e-edit-checkselect");var i=j(e.column.field);return this.parent.createElement("input",{className:r,attrs:{type:"checkbox",value:e.value,"e-mappinguid":t.uid,id:this.parent.element.id+i,name:i}})},e.prototype.read=function(e){return e.checked},e.prototype.write=function(e){var r,i;if(t.isNullOrUndefined(e.row)||(r=e.row.querySelector(".e-edit-checkselect")),le(e.column.field,e.rowData)&&(i=JSON.parse(le(e.column.field,e.rowData).toString().toLowerCase())),!t.isNullOrUndefined(r)){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var o=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));i=!!o&&o.isSelected}Q.apply(void 0,[[].slice.call(e.row.querySelectorAll(".e-rowcell")),i].concat(this.activeClasses))}this.obj=new n.Switch(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!G(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.switchModeChange.bind(this)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.switchModeChange=function(e){if(this.editRow&&"Dialog"!==this.editType){var t=!1;e.checked?(t=!0,this.editRow.setAttribute("aria-selected",t.toString())):this.editRow.removeAttribute("aria-selected"),Q.apply(void 0,[[].slice.call(this.editRow.querySelectorAll(".e-rowcell")),t].concat(this.activeClasses))}},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Dn=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=j(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var r="Dialog"!==this.parent.editSettings.mode;this.obj=new o.MaskedTextBox(t.extend({fields:{value:e.column.field},value:le(e.column.field,e.rowData),floatLabelType:r?"Never":"Always",mask:"000-000-0000",enabled:G(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}();return Br.Inject(hi,$r,fr,Gr,mi,gi,fi,yi,vi,xi,mr,Fi,Wi,ui,Xi,$i,tn,nn,dn,cn,Qi,pn),e.CheckBoxFilterBase=Ur,e.ExcelFilterBase=Vr,e.SortDescriptor=Tr,e.SortSettings=Dr,e.Predicate=Ir,e.FilterSettings=Or,e.SelectionSettings=Fr,e.SearchSettings=kr,e.RowDropSettings=Mr,e.TextWrapSettings=Ar,e.GroupSettings=Pr,e.EditSettings=Nr,e.Grid=Br,e.doesImplementInterface=u,e.valueAccessor=g,e.getUpdateUsingRaf=f,e.updatecloneRow=m,e.getCollapsedRowsCount=y,e.recursive=v,e.iterateArrayOrObject=C,e.iterateExtend=w,e.templateCompiler=b,e.setStyleAndAttributes=S,e.extend=x,e.setColumnIndex=R,e.prepareColumns=E,e.setCssInGridPopUp=T,e.getActualProperties=I,e.parentsUntil=O,e.getElementIndex=F,e.inArray=k,e.getActualPropFromColl=M,e.removeElement=A,e.getPosition=P,e.getUid=N,e.appendChildren=B,e.parents=L,e.calculateAggregate=q,e.getScrollBarWidth=z,e.getRowHeight=H,e.isComplexField=U,e.getComplexFieldID=j,e.setComplexFieldID=V,e.isEditable=G,e.isActionPrevent=_,e.wrap=K,e.setFormatter=W,e.addRemoveActiveClasses=Q,e.distinctStringValues=J,e.getFilterMenuPostion=Y,e.getZIndexCalcualtion=X,e.toogleCheckbox=$,e.createCboxWithWrap=Z,e.removeAddCboxClasses=ee,e.refreshForeignData=te,e.getForeignData=re,e.getColumnByForeignKeyValue=ie,e.getDatePredicate=ne,e.renderMovable=oe,e.isGroupAdaptive=se,e.getObject=le,e.getCustomDateFormat=ae,e.getExpandedState=de,e.getPrintGridModel=ce,e.extendObjWithFn=he,e.measureColumnDepth=ue,e.checkDepth=ge,e.refreshFilteredColsUid=fe,e.created="create",e.destroyed="destroy",e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.headerCellInfo="headerCellInfo",e.actionBegin=Se,e.actionComplete=xe,e.actionFailure="actionFailure",e.dataBound=Re,e.rowSelecting="rowSelecting",e.rowSelected="rowSelected",e.rowDeselecting="rowDeselecting",e.rowDeselected="rowDeselected",e.cellSelecting="cellSelecting",e.cellSelected="cellSelected",e.cellDeselecting="cellDeselecting",e.cellDeselected="cellDeselected",e.columnDragStart=Ee,e.columnDrag=Te,e.columnDrop=De,e.rowDragStartHelper=Ie,e.rowDragStart=Oe,e.rowDrag=Fe,e.rowDrop=ke,e.beforePrint="beforePrint",e.printComplete="printComplete",e.detailDataBound="detailDataBound",e.toolbarClick="toolbarClick",e.batchAdd="batchAdd",e.batchCancel="batchCancel",e.batchDelete="batchDelete",e.beforeBatchAdd="beforeBatchAdd",e.beforeBatchDelete="beforeBatchDelete",e.beforeBatchSave="beforeBatchSave",e.beginEdit="beginEdit",e.cellEdit="cellEdit",e.cellSave="cellSave",e.cellSaved="cellSaved",e.endAdd="endAdd",e.endDelete="endDelete",e.endEdit="endEdit",e.recordDoubleClick="recordDoubleClick",e.recordClick="recordClick",e.beforeDataBound="beforeDataBound",e.beforeOpenColumnChooser="beforeOpenColumnChooser",e.resizeStart="resizeStart",e.onResize="resizing",e.resizeStop="resizeStop",e.checkBoxChange="checkBoxChange",e.beforeCopy="beforeCopy",e.beforePaste="beforePaste",e.filterChoiceRequest="filterchoicerequest",e.filterAfterOpen="filterafteropen",e.filterBeforeOpen="filterbeforeopen",e.filterSearchBegin="filtersearchbegin",e.commandClick="commandClick",e.initialLoad=Me,e.initialEnd=Ae,e.dataReady=Pe,e.contentReady=Ne,e.uiUpdate=Be,e.onEmpty=Le,e.inBoundModelChanged=qe,e.modelChanged=ze,e.colGroupRefresh=He,e.headerRefreshed=Ue,e.pageBegin="paging-begin",e.pageComplete="paging-complete",e.sortBegin="sorting-begin",e.sortComplete="sorting-complete",e.filterBegin="filtering-begin",e.filterComplete="filtering-complete",e.searchBegin="searching-begin",e.searchComplete="searching-complete",e.reorderBegin="reorder-begin",e.reorderComplete=je,e.rowDragAndDropBegin="rowdraganddrop-begin",e.rowDragAndDropComplete="rowdraganddrop-complete",e.groupBegin="grouping-begin",e.groupComplete="grouping-complete",e.ungroupBegin="ungrouping-begin",e.ungroupComplete="ungrouping-complete",e.groupAggregates="group-aggregates",e.refreshFooterRenderer="refresh-footer-rendered",e.refreshAggregateCell="refresh-aggregate-cell",e.refreshAggregates="refresh-aggregates",e.rowSelectionBegin="rowselecting",e.rowSelectionComplete="rowselected",e.columnSelectionBegin="columnselecting",e.columnSelectionComplete="columnselected",e.cellSelectionBegin="cellselecting",e.cellSelectionComplete="cellselected",e.beforeCellFocused="beforecellfocused",e.cellFocused="cellfocused",e.keyPressed=Ve,e.click=Ge,e.destroy=_e,e.columnVisibilityChanged=Ke,e.scroll="scroll",e.columnWidthChanged="column-width-changed",e.columnPositionChanged=We,e.rowDragAndDrop="row-drag-and-drop",e.rowsAdded=Qe,e.rowsRemoved=Je,e.columnDragStop=Ye,e.headerDrop=Xe,e.dataSourceModified=$e,e.refreshComplete="refresh-complete",e.refreshVirtualBlock=Ze,e.dblclick="dblclick",e.toolbarRefresh=et,e.bulkSave="bulk-save",e.autoCol=tt,e.tooltipDestroy="tooltip-destroy",e.updateData=rt,e.editBegin="edit-begin",e.editComplete="edit-complete",e.addBegin="add-begin",e.addComplete="add-complete",e.saveComplete="save-complete",e.deleteBegin="delete-begin",e.deleteComplete="delete-complete",e.preventBatch=it,e.dialogDestroy=nt,e.crudAction="crud-Action",e.addDeleteAction=ot,e.destroyForm="destroy-form",e.doubleTap="double-tap",e.beforeExcelExport="beforeExcelExport",e.excelExportComplete="excelExportComplete",e.excelQueryCellInfo="excelQueryCellInfo",e.excelHeaderQueryCellInfo="excelHeaderQueryCellInfo",e.exportDetailDataBound="exportdetaildatabound",e.beforePdfExport="beforePdfExport",e.pdfExportComplete="pdfExportComplete",e.pdfQueryCellInfo="pdfQueryCellInfo",e.pdfHeaderQueryCellInfo="pdfHeaderQueryCellInfo",e.accessPredicate="access-predicate",e.contextMenuClick="contextMenuClick",e.freezeRender=st,e.freezeRefresh="freezerefresh",e.contextMenuOpen="contextMenuOpen",e.columnMenuClick="columnMenuClick",e.columnMenuOpen="columnMenuOpen",e.filterOpen="filterOpen",e.filterDialogCreated="filterDialogCreated",e.filterMenuClose="filter-menu-close",e.initForeignKeyColumn="initForeignKeyColumn",e.getForeignKeyData="getForeignKeyData",e.generateQuery="generateQuery",e.showEmptyGrid="showEmptyGrid",e.foreignKeyData="foreignKeyData",e.dataStateChange="dataStateChange",e.dataSourceChanged="dataSourceChanged",e.rtlUpdated="rtl-updated",e.beforeFragAppend="beforeFragAppend",e.frozenHeight="frozenHeight",e.textWrapRefresh="textWrapRefresh",e.recordAdded="recordAdded",e.cancelBegin="cancel-Begin",e.editNextValCell="editNextValCell",e.hierarchyPrint=lt,e.expandChildGrid=at,e.printGridInit="printGrid-Init",e.exportRowDataBound="export-RowDataBound",e.rowPositionChanged=dt,e.columnChooserOpened="columnChooserOpened",e.batchForm="batchedit-form",e.beforeStartEdit="edit-form",e.beforeBatchCancel="before-batch-cancel",e.batchEditFormRendered="batcheditform-rendered",e.partialRefresh="partial-refresh",e.beforeCustomFilterOpen="beforeCustomFilterOpen",e.selectVirtualRow="select-virtual-Row",e.columnsPrepared=ct,e.cBoxFltrBegin=ht,e.cBoxFltrComplete="cbox-filter-complete",e.fltrPrevent=pt,e.Data=gt,e.Sort=Gr,e.Page=$r,e.Selection=fr,e.Filter=hi,e.Search=mr,e.Scroll=vr,e.resizeClassList=pi,e.Resize=ui,e.Reorder=gi,e.RowDD=fi,e.Group=mi,e.getCloneProperties=p,e.Print=Lr,e.DetailRow=yi,e.Toolbar=vi,e.Aggregate=xi,e.summaryIterator=me,e.VirtualScroll=Fi,e.Edit=Wi,e.BatchEdit=ji,e.InlineEdit=Ui,e.NormalEdit=zi,e.DialogEdit=Gi,e.ColumnChooser=Qi,e.ExcelExport=Xi,e.PdfExport=$i,e.ExportHelper=Ji,e.ExportValueFormatter=Yi,e.Clipboard=xr,e.CommandColumn=tn,e.CheckBoxFilter=ai,e.menuClass=rn,e.ContextMenu=nn,e.Freeze=dn,e.ColumnMenu=cn,e.ExcelFilter=ci,e.ForeignKey=pn,e.Logger=vn,e.detailLists=Cn,e.Column=we,e.CommandColumnModel=be,e.Row=ft,e.Cell=mt,e.HeaderRender=Dt,e.ContentRender=Tt,e.RowRenderer=vt,e.CellRenderer=It,e.HeaderCellRenderer=Mt,e.FilterCellRenderer=ti,e.StackedHeaderCellRenderer=Pt,e.Render=$t,e.IndentCellRenderer=Bt,e.GroupCaptionCellRenderer=qt,e.GroupCaptionEmptyCellRenderer=zt,e.BatchEditRender=Mi,e.DialogEditRender=Ai,e.InlineEditRender=ki,e.EditRender=Pi,e.BooleanEditCell=Ni,e.DefaultEditCell=qi,e.DropDownEditCell=Bi,e.NumericEditCell=Li,e.DatePickerEditCell=_i,e.CommandColumnRenderer=en,e.FreezeContentRender=ln,e.FreezeRender=an,e.StringFilterUI=ii,e.NumberFilterUI=ni,e.DateFilterUI=si,e.BooleanFilterUI=oi,e.FlMenuOptrUI=ri,e.AutoCompleteEditCell=Sn,e.ComboboxEditCell=xn,e.MultiSelectEditCell=Rn,e.TimePickerEditCell=En,e.ToggleEditCell=Tn,e.MaskedTextBoxCellEdit=Dn,e.VirtualContentRenderer=Di,e.VirtualHeaderRenderer=Ii,e.VirtualElementHandler=Oi,e.CellRendererFactory=Zt,e.ServiceLocator=er,e.RowModelGenerator=Ct,e.GroupModelGenerator=Et,e.FreezeRowModelGenerator=on,e.ValueFormatter=ve,e.VirtualRowModelGenerator=Ei,e.InterSectionObserver=Ri,e.Pager=Jr,e.ExternalMessage=Xr,e.NumericContainer=_r,e.PagerMessage=Kr,e.PagerDropDown=Yr,e}({},ej.base,ej.data,ej.popups,ej.buttons,ej.inputs,ej.dropdowns,ej.calendars,ej.navigations,ej.excelexport,ej.pdfexport),this.ejs=ej;
  //# sourceMappingURL=ej2-grids.min.js.map
  