@syncfusion/ej2-querybuilder 24.1.44 → 24.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/ej2-querybuilder.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es2015.js +24 -14
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +24 -14
- package/dist/es6/ej2-querybuilder.es5.js.map +1 -1
- package/dist/global/ej2-querybuilder.min.js +2 -2
- package/dist/global/ej2-querybuilder.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -10
- package/src/query-builder/query-builder-model.d.ts +1 -1
- package/src/query-builder/query-builder.d.ts +2 -1
- package/src/query-builder/query-builder.js +24 -14
- package/styles/bootstrap-dark.css +4 -0
- package/styles/bootstrap.css +4 -0
- package/styles/bootstrap4.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5.css +4 -0
- package/styles/fabric-dark.css +4 -0
- package/styles/fabric.css +4 -0
- package/styles/fluent-dark.css +4 -0
- package/styles/fluent.css +4 -0
- package/styles/highcontrast-light.css +4 -0
- package/styles/highcontrast.css +4 -0
- package/styles/material-dark.css +4 -0
- package/styles/material.css +4 -0
- package/styles/material3-dark.css +4 -0
- package/styles/material3.css +4 -0
- package/styles/query-builder/_layout.scss +4 -0
- package/styles/query-builder/bootstrap-dark.css +4 -0
- package/styles/query-builder/bootstrap.css +4 -0
- package/styles/query-builder/bootstrap4.css +4 -0
- package/styles/query-builder/bootstrap5-dark.css +4 -0
- package/styles/query-builder/bootstrap5.css +4 -0
- package/styles/query-builder/fabric-dark.css +4 -0
- package/styles/query-builder/fabric.css +4 -0
- package/styles/query-builder/fluent-dark.css +4 -0
- package/styles/query-builder/fluent.css +4 -0
- package/styles/query-builder/highcontrast-light.css +4 -0
- package/styles/query-builder/highcontrast.css +4 -0
- package/styles/query-builder/material-dark.css +4 -0
- package/styles/query-builder/material.css +4 -0
- package/styles/query-builder/material3-dark.css +4 -0
- package/styles/query-builder/material3.css +4 -0
- package/styles/query-builder/tailwind-dark.css +4 -0
- package/styles/query-builder/tailwind.css +4 -0
- package/styles/tailwind-dark.css +4 -0
- package/styles/tailwind.css +4 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-querybuilder.umd.min.js
|
|
3
|
-
* version : 24.1.
|
|
3
|
+
* version : 24.1.46
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-buttons","@syncfusion/ej2-dropdowns","@syncfusion/ej2-data","@syncfusion/ej2-inputs","@syncfusion/ej2-calendars","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-popups"],t):t(e.ej={},e.ej2Base,e.ej2Buttons,e.ej2Dropdowns,e.ej2Data,e.ej2Inputs,e.ej2Calendars,e.ej2Splitbuttons,e.ej2Popups)}(this,function(e,t,l,i,n,r,o,s,a){"use strict";var u=function(){var e=function(t,l){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(t,l)};return function(t,l){function i(){this.constructor=t}e(t,l),t.prototype=null===l?Object.create(l):(i.prototype=l.prototype,new i)}}(),d=function(){return(d=Object.assign||function(e){for(var t,l=1,i=arguments.length;l<i;l++){t=arguments[l];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},p=function(e,t,l,i){var n,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,l):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,l,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(t,l,o):n(t,l))||o);return r>3&&o&&Object.defineProperty(t,l,o),o},h=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(null)],l.prototype,"field",void 0),p([t.Property(null)],l.prototype,"label",void 0),p([t.Property(null)],l.prototype,"type",void 0),p([t.Property(null)],l.prototype,"values",void 0),p([t.Property(null)],l.prototype,"operators",void 0),p([t.Property()],l.prototype,"ruleTemplate",void 0),p([t.Property(null)],l.prototype,"template",void 0),p([t.Property({isRequired:!0,min:0,max:Number.MAX_VALUE})],l.prototype,"validation",void 0),p([t.Property(null)],l.prototype,"format",void 0),p([t.Property(null)],l.prototype,"step",void 0),p([t.Property(null)],l.prototype,"value",void 0),p([t.Property(null)],l.prototype,"category",void 0),p([t.Property(null)],l.prototype,"columns",void 0),l}(t.ChildProperty),c=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(null)],l.prototype,"condition",void 0),p([t.Collection([],l)],l.prototype,"rules",void 0),p([t.Property(null)],l.prototype,"field",void 0),p([t.Property(null)],l.prototype,"label",void 0),p([t.Property(null)],l.prototype,"type",void 0),p([t.Property(null)],l.prototype,"operator",void 0),p([t.Property(null)],l.prototype,"value",void 0),p([t.Property(!1)],l.prototype,"not",void 0),l}(t.ChildProperty),m=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(null)],l.prototype,"numericTextBoxModel",void 0),p([t.Property(null)],l.prototype,"multiSelectModel",void 0),p([t.Property(null)],l.prototype,"datePickerModel",void 0),p([t.Property(null)],l.prototype,"textBoxModel",void 0),p([t.Property(null)],l.prototype,"radioButtonModel",void 0),l}(t.ChildProperty),f=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(!0)],l.prototype,"ruleDelete",void 0),p([t.Property(!0)],l.prototype,"groupInsert",void 0),p([t.Property(!0)],l.prototype,"groupDelete",void 0),l}(t.ChildProperty),g=function(e){function h(t,l){var n=e.call(this,t,l)||this;return n.isReadonly=!0,n.fields={text:"label",value:"field"},n.updatedRule={not:!1,condition:"and"},n.isLocale=!1,n.isRefreshed=!1,n.isNotified=!1,n.isAddSuccess=!1,n.isNotValueChange=!1,n.isFieldChange=!1,n.isFieldClose=!1,n.isDestroy=!1,n.isGetNestedData=!1,n.isCustomOprCols=[],i.MultiSelect.Inject(i.CheckBoxSelection),n}return u(h,e),h.prototype.getPersistData=function(){return this.addOnPersist(["rule"])},h.prototype.reset=function(){this.isImportRules=!1;for(var e=this.element.querySelector(".e-group-body"),l=this.element.querySelectorAll("input.e-control"),i=0,n=l.length;i<n;i++)l[i].className.indexOf("e-tooltip")>-1?t.getComponent(l[i],"tooltip").destroy():l[i].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(l[i].parentElement,"tooltip").destroy();if(e)e.innerHTML="";else{var r=this.createElement("div",{attrs:{class:"e-group-container"}}),o=this.createElement("div",{attrs:{class:"e-group-header"}}),s=this.createElement("div",{attrs:{class:"e-group-body"}});r.appendChild(o).appendChild(s),this.element.appendChild(r),e=this.element.querySelector(".e-group-body")}this.headerTemplate&&this.isRoot&&(this.element.innerHTML="",this.isRoot=!1),this.enableNotCondition&&t.removeClass(this.element.querySelectorAll(".e-qb-toggle"),"e-active-toggle"),e.appendChild(this.createElement("div",{attrs:{class:"e-rule-list"}})),this.levelColl[this.element.id+"_group0"]=[0],this.setProperties({rule:{condition:"and",not:!1,rules:[]}},!0),this.disableRuleCondition(e.parentElement)},h.prototype.getWrapper=function(){return this.element},h.prototype.getModuleName=function(){return"query-builder"},h.prototype.GetRootColumnName=function(e){return this.separator?e.split(this.separator)[0]:e},h.prototype.initialize=function(){if(this.dataColl.length){var e=Object.keys(this.dataColl[0]),t=[],l=[],i=void 0,n=!1,r=!1,o=void 0,s={isRequired:!0,min:0,max:Number.MAX_VALUE};if(this.columns.length){this.columnSort();for(var a=0,u=(d=this.columns).length;a<u;a++)this.updateCustomOperator(d[a],"initial"),d[a].type||(e.indexOf(d[a].field)>-1&&("string"===(i=typeof(o=this.dataColl[0][d[a].field]))?r=!isNaN(Date.parse(o)):"object"===i&&(r=o instanceof Date&&!isNaN(o.getTime()),i="string"),d[a].type=i,r=!1),i="string"),d[a].validation||(d[a].validation=s),d[a].category?n=!0:d[a].category=this.l10n.getConstant("OtherFields"),l.indexOf(d[a].category)<0&&l.push(d[a].category),(!d[a].operators||this.isLocale&&0!==this.isCustomOprCols.indexOf(d[a].field))&&(d[a].operators=this.customOperators[d[a].type+"Operator"]);n&&(l.length>1||l[0]!==this.l10n.getConstant("OtherFields"))&&(this.fields={text:"label",value:"field",groupBy:"category"}),this.updateSubFieldsFromColumns(this.columns)}else{for(a=0,u=e.length;a<u;a++)"string"===(i=typeof(o=this.dataColl[0][e[a]]))?r=!isNaN(Date.parse(o)):"object"!==i||Object.keys(o).length||(r=o instanceof Date&&!isNaN(o.getTime()),i="string"),t[a]={field:e[a],label:e[a],type:r?"date":i,validation:s},r=!1,t[a].operators=this.customOperators[t[a].type+"Operator"],"object"===i&&this.updateSubFields(o,t[a]);this.columns=t}}else if(this.columns.length){var d;for(a=0,u=(d=this.columns).length;a<u;a++)d[a].category?this.fields={text:"label",value:"field",groupBy:"category"}:d[a].category=this.l10n.getConstant("OtherFields"),this.updateCustomOperator(d[a]),d[a].operators&&!this.isLocale||(d[a].operators=this.customOperators[d[a].type+"Operator"]);this.updateSubFieldsFromColumns(this.columns)}this.trigger("dataBound",{type:"dataBound"})},h.prototype.updateSubFieldsFromColumns=function(e,t){for(var l=0;l<e.length;l++)""!==this.separator&&e[l].field.indexOf(this.separator)<0&&(e[l].field=t?t+this.separator+e[l].field:e[l].field),e[l].operators?this.updateCustomOperator(e[l]):e[l].type&&"object"!==e[l].type&&(e[l].operators=this.customOperators[e[l].type+"Operator"]),e[l].columns&&(e[l].type="object",this.updateSubFieldsFromColumns(e[l].columns,e[l].field))},h.prototype.updateSubFields=function(e,t,l){var i;t.columns=[];var n,r,o=Object.keys(e);l=l||this.dataColl[0];for(var s=0,a=o.length;s<a;s++){var u=t.field.split(".");r=l?l[u[u.length-1]][o[s]]:this.dataColl[0][t.field][o[s]];var d=l[t.field.split(this.separator)[t.field.split(this.separator).length-1]];n=typeof r,i={field:t.field+this.separator+o[s],label:o[s],type:n="object"!==n||isNaN(Date.parse(r))?n:"date"},"object"!==n&&(i.operators=this.customOperators[n+"Operator"]),t.columns.push(i),"object"===n&&this.updateSubFields(r,i,d)}},h.prototype.updateCustomOperator=function(e,l){if(e.operators){this.isLocale||"initial"!==l||t.isNullOrUndefined(this.isCustomOprCols)||this.isCustomOprCols.push(e.field);for(var i=function(t){var l=Object.keys(e.operators[t]).indexOf("sqlOperator");if(l>-1){var i=e.operators[t],r=Object.keys(i),o=r.map(function(e){return i[""+e]}).join(",").split(","),s=r.indexOf("value");n.operators[o[s]]=o[l]}},n=this,r=0;r<e.operators.length;r++)i(r)}},h.prototype.focusEventHandler=function(e){this.target=e.target},h.prototype.clickEventHandler=function(e){var l,i=this,n=e.target;this.isImportRules=!1;var r;if("SPAN"===n.tagName&&(n=n.parentElement),n.className.indexOf("e-collapse-rule")>-1){var o=new t.Animation({duration:1e3,delay:0});this.element.querySelectorAll(".e-summary-content").length<1&&this.renderSummary();var s=document.getElementById(this.element.id+"_summary_content"),a=s.querySelector(".e-summary-text");o.animate(".e-query-builder",{name:"SlideLeftIn"});(d=this.element.querySelector(".e-group-container")).style.display="none",a.textContent=this.getSqlFromRules(this.rule),s.style.display="block",a.style.height=a.scrollHeight+"px"}if("BUTTON"===n.tagName&&n.className.indexOf("e-qb-toggle")<0){if(n.className.indexOf("e-removerule")>-1)this.actionButton=n,this.deleteRule(n);else if(n.className.indexOf("e-deletegroup")>-1)this.actionButton=n,this.deleteGroup(t.closest(n,".e-group-container"));else if(n.className.indexOf("e-edit-rule")>-1){if((o=new t.Animation({duration:1e3,delay:0})).animate(".e-query-builder",{name:"SlideLeftIn"}),document.getElementById(this.element.id+"_summary_content").style.display="none",this.element.querySelectorAll(".e-group-container").length<1){this.addGroupElement(!1,this.element,this.rule.condition,!1,this.rule.not);var u=t.extend({},this.rule,{},!0);this.setGroupRules(u),this.renderSummaryCollapse()}else{var d;(d=this.element.querySelector(".e-group-container")).querySelectorAll(".e-collapse-rule").length<1&&this.renderSummaryCollapse(),d.style.display="block"}}}else if("LABEL"===n.tagName&&n.parentElement.className.indexOf("e-btn-group")>-1||n.className.indexOf("e-qb-toggle")>-1){var p=t.closest(n,".e-group-container");if(!this.headerTemplate){var h=n.getAttribute("for"),c=void 0;h&&(c=document.getElementById(h).getAttribute("value")),r=p.id.replace(this.element.id+"_","");var m=this.getGroup(r),f=void 0;if(this.enableNotCondition)if(n.className.indexOf("e-qb-toggle")>-1){var g=p.getElementsByClassName("e-qb-toggle")[0];g.className.indexOf("e-active-toggle")>-1?(t.removeClass([g],"e-active-toggle"),f=!1):(t.addClass([g],"e-active-toggle"),f=!0),c=m.condition}else f=m.not;l={groupID:r,cancel:!1,type:"condition",value:c.toLowerCase()},this.enableNotCondition&&(l={groupID:r,cancel:!1,type:"condition",value:c.toLowerCase(),not:f})}this.isImportRules?this.beforeSuccessCallBack(l,n):this.trigger("beforeChange",l,function(e){i.beforeSuccessCallBack(e,n)}),this.target=n}},h.prototype.beforeSuccessCallBack=function(e,l){if(!e.cancel){var i=t.closest(l,".e-group-container"),n=i.id.replace(this.element.id+"_",""),r=this.getValidRules(this.rule),o=this.getParentGroup(i);o.condition=e.value,this.enableNotCondition&&(o.not=e.not),this.isImportRules||this.trigger("change",{groupID:n,type:"condition",value:o.condition}),this.filterRules(r,this.getValidRules(this.rule),"condition")}},h.prototype.selectBtn=function(e,l){"beforeOpen"===l.name?this.showButtons.groupInsert||t.isNullOrUndefined(this.showButtons.groupInsert)?(this.element.querySelectorAll(".e-group-container").length>=this.maxGroupCount+1?t.addClass([l.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"):t.removeClass([l.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"),this.enableRtl&&t.addClass([l.element.querySelector("li").parentElement],"e-rtl")):t.addClass([l.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"):l.element.children[0].className.indexOf("e-addrule")>-1?this.addRuleElement(t.closest(e,".e-group-container"),{}):l.element.children[0].className.indexOf("e-addgroup")>-1&&this.addGroupElement(!0,t.closest(e,".e-group-container"),"",!0)},h.prototype.appendRuleElem=function(e,l,i,n,r,o){var s,a,u,d=e.querySelector(".e-rule-list");if("change"===i?s=t.select("#"+n,e):((s=this.createElement("div",{attrs:{class:"e-rule-container"}})).setAttribute("id",e.id+"_rule"+this.ruleIdCounter),d.appendChild(s),this.ruleIdCounter++),l&&l.ruleTemplate&&o){u={requestType:"template-initialize",ruleID:s.id,action:r,fields:this.fields,rule:o},this.trigger("actionBegin",u),this.ruleTemplateFn=this.templateParser(l.ruleTemplate);var p=this.element.id+l.field;if(u.fields=this.fields,u.columns=this.columns,""===o.field&&(o.field=l.field),u.operators=this.getOperators(o.field),u.operatorFields={text:"key",value:"value"},this.isReact)(a=this.ruleTemplateFn(u,this,s.id,p)[0]).className+=" e-rule-field",s.appendChild(a);else if(this.isAngular){var h=this.ruleTemplateFn(u,this,s.id,p);(a=3===h[0].nodeType?h[1]:h[0]).className+=" e-rule-field",s.appendChild(a)}else this.isVue3?(a=this.ruleTemplateFn(u,this,"Template",p),t.append(a,s),s.children[s.children.length-1].className+=" e-rule-field"):((a=this.ruleTemplateFn(u,this,"Template",p)[0]).className+=" e-rule-field",s.appendChild(a))}else a=this.ruleElem.querySelector(".e-rule-field").cloneNode(!0),s.appendChild(a);return l&&l.ruleTemplate&&o&&this.renderReactTemplates(),s},h.prototype.addRuleElement=function(e,t,l,i,n,r){var o=this;if(e){var s={groupID:e.id.replace(this.element.id+"_",""),cancel:!1,type:"insertRule"};this.isImportRules||this.isInitialLoad?(this.isInitialLoad=!1,this.addRuleSuccessCallBack(s,e,t,l,i,n,r)):this.trigger("beforeChange",s,function(s){o.addRuleSuccessCallBack(s,e,t,l,i,n,r)})}},h.prototype.addRuleSuccessCallBack=function(e,l,n,r,o,s,a){var u,p,h,c,m=this.element.className.indexOf("e-device")>-1?"250px":"200px",f=n&&n.field?this.getColumn(n.field):r||this.columns[0],g={label:"",field:"",type:"",operator:""};if(!e.cancel){if(f&&f.ruleTemplate&&n.field){this.selectedColumn=f,p=this.selectedColumn.operators,g={label:f.label,field:f.field,type:f.type,operator:p[0].value};var v=Object.keys(n).length?n:g,y={requestType:"template-create",action:"insert-rule",ruleID:(c=this.appendRuleElem(l,f,o,s,"field",v)).id,fields:this.fields,rule:v};this.trigger("actionBegin",y)}else{(c=this.appendRuleElem(l,f,o,s,"field")).querySelector(".e-filter-input").setAttribute("id",c.id+"_filterkey");var C=c.querySelector("button");this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?(C.textContent=this.l10n.getConstant("Remove"),t.addClass([C],"e-flat"),t.addClass([C],"e-primary")):(t.addClass([C],"e-round"),t.addClass([C],"e-icon-btn"),C.setAttribute("title",this.l10n.getConstant("DeleteRule")),C=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-delete-icon"}}),c.querySelector("button").appendChild(C))}if("Vertical"===this.displayMode||this.element.className.indexOf("e-device")>-1?c.className="e-rule-container e-vertical-mode":c.className="e-rule-container e-horizontal-mode",c.previousElementSibling&&c.previousElementSibling.className.indexOf("e-rule-container")>-1&&(c.className.indexOf("e-joined-rule")<0&&(c.className+=" e-joined-rule"),c.previousElementSibling.className.indexOf("e-prev-joined-rule")<0&&(c.previousElementSibling.className+=" e-prev-joined-rule")),c.previousElementSibling&&c.previousElementSibling.className.indexOf("e-group-container")>-1&&c.className.indexOf("e-separate-rule")<0&&(c.className+=" e-separate-rule"),this.isImportRules||this.updateAddedRule(l,n,g,a,s),!f||f&&!f.ruleTemplate||!n.field)if("Default"===this.fieldMode){var b=void 0,S=void 0;S=this.separator&&n.field?this.GetRootColumnName(n.field):this.isImportRules?this.GetRootColumnName(n.field):n.field,b={dataSource:this.columns,fields:this.fields,placeholder:this.l10n.getConstant("SelectField"),popupHeight:this.columns.length>5?m:"auto",close:this.fieldClose.bind(this,c.id+"_filterkey"),change:this.changeField.bind(this),value:n?S:null,open:this.popupOpen.bind(this,!0)},this.fieldModel&&(b=d({},b,this.fieldModel)),(h=new i.DropDownList(b)).appendTo("#"+c.id+"_filterkey");var x=void 0;x=this.separator&&n.field?this.GetRootColumnName(n.field):this.isImportRules?this.GetRootColumnName(n.field):h.value,this.selectedColumn=h.getDataByValue(x),Object.keys(n).length&&this.changeRule(n,{element:h.element,itemData:this.selectedColumn})}else{b=void 0,S=(this.isImportRules,n.field);b={fields:{dataSource:this.columns,value:"field",text:"label",child:"columns",expanded:"expanded"},placeholder:this.l10n.getConstant("SelectField"),showClearButton:!1,popupHeight:this.columns.length>5?m:"auto",changeOnBlur:!1,change:this.changeField.bind(this),value:t.isNullOrUndefined(S)?null:[S],open:this.popupOpen.bind(this,!1),treeSettings:{expandOn:"Click"},select:this.onSelectField},this.fieldModel&&(b=d({},b,this.fieldModel));var O=new i.DropDownTree(b);if(O.appendTo("#"+c.id+"_filterkey"),!t.isNullOrUndefined(O.value)){var w=this.getLabelFromColumn(O.value[0]);O.element.value=w}x=t.isNullOrUndefined(n.field)?O.value:this.GetRootColumnName(n.field);this.selectedColumn=this.getColumn(x),Object.keys(n).length&&this.changeRule(n,{element:O.element,itemData:this.selectedColumn})}u=c.id.replace(this.element.id+"_",""),this.isImportRules||this.trigger("change",{groupID:l.id.replace(this.element.id+"_",""),ruleID:u,type:"insertRule"})}},h.prototype.updateAddedRule=function(e,l,i,n,r){var o,s,a,u=0;if(n){for(o=t.select("#"+r,e),s=t.closest(e,".e-group-container"),a=this.getParentGroup(s);o&&null!==o.previousElementSibling;)o=o.previousElementSibling,u++;a.rules[u]=l}else{s=t.closest(e,".e-group-container"),a=this.getParentGroup(s);var d=l.custom;Object.keys(l).length?(a.rules.push({field:l.field,type:l.type,label:l.label,operator:l.operator,value:l.value}),d&&(a.rules[a.rules.length-1].custom=d)):(d&&(i.custom=d),a.rules.push(i))}this.disableRuleCondition(e,a)},h.prototype.changeRuleTemplate=function(e,l){var i=this.selectedColumn.operators;if(!e.ruleTemplate){var n=t.closest(l,".e-group-container"),r=t.closest(l,".e-rule-container").id;if(this.previousColumn&&this.previousColumn.ruleTemplate&&(t.detach(l.closest('[id="'+r+'"]').querySelector(".e-rule-field")),this.clearQBTemplate([r])),e){var o={field:e.field,label:e.label,operator:i[0].value,value:""};this.addRuleElement(n,o,e,"change",r,!0)}}},h.prototype.renderToolTip=function(e){var t=new a.Tooltip({content:this.l10n.getConstant("ValidationMessage"),position:"BottomCenter",cssClass:"e-querybuilder-error",afterClose:function(e){t.destroy()}});t.appendTo(e),t.open(e)},h.prototype.validateFields=function(){var e,l=!0;if(this.allowValidation){var i=["isnull","isnotnull","isempty","isnotempty"],n=void 0,r=void 0,o=void 0,s=void 0,a=[],u=void 0,d=void 0,p=void 0,h=void 0,c=void 0,m=this.element.querySelectorAll(".e-rule-container");for(n=0,r=m.length;n<r;n++){var f=void 0;if(u=t.closest(m[n],".e-group-container"),c=this.getParentGroup(u),d=0,s=h=m[n],"DropdownTree"===this.fieldMode?(e=t.getComponent(m[n].querySelector(".e-rule-filter input.e-dropdowntree"),"dropdowntree"))&&e.value&&e.value.length&&(this.selectedColumn=this.getColumn(e.value[0]),f=this.selectedColumn.validation):(p=t.getComponent(m[n].querySelector(".e-rule-filter input.e-dropdownlist"),"dropdownlist"))&&p.value&&(this.selectedColumn=p.getDataByValue(p.value),f=!t.isNullOrUndefined(p.index)&&this.selectedColumn.validation),o=h.querySelector(".e-rule-field input.e-control"),f&&f.isRequired){for(;s&&null!==s.previousElementSibling;)s=s.previousElementSibling,d++;if(o=h.querySelector(".e-rule-operator .e-control"),c.rules[d].operator||(o.parentElement.className.indexOf("e-tooltip")<0&&this.renderToolTip(o.parentElement),l=!1),c.rules[d].value instanceof Array&&(a=c.rules[d].value),i.indexOf(c.rules[d].operator)<-1&&t.isNullOrUndefined(c.rules[d].value)&&"date"!==c.rules[d].type||""===c.rules[d].value||c.rules[d].value instanceof Array&&a.length<1){var g=h.querySelectorAll(".e-rule-value .e-control");l=!1;for(var v=0,y=g.length;v<y;v++){var C=g[v],b=void 0;C.parentElement.className.indexOf("e-searcher")>-1?(b=t.closest(C,".e-multi-select-wrapper")).className.indexOf("e-tooltip")<0&&this.renderToolTip(b):g[v].parentElement.className.indexOf("e-tooltip")<0&&g[v].className.indexOf("e-tooltip")<0&&this.renderToolTip(g[v].parentElement),v++}}}else(p&&p.element&&t.isNullOrUndefined(p.index)||e&&e.element&&(t.isNullOrUndefined(e.value)||e.value.length<1))&&(o.parentElement.className.indexOf("e-tooltip")<0&&this.renderToolTip(o.parentElement),l=!1)}}return l},h.prototype.refreshLevelColl=function(){this.levelColl={};var e=this.element.querySelector(".e-group-container");if(e){this.levelColl[e.id]=[0];var t={groupElement:e,level:[0]};this.refreshLevel(t)}},h.prototype.refreshLevel=function(e){var l,i,n=e.groupElement.querySelector(".e-rule-list").children,r=e.groupElement,o=n.length,s=0;for(i=0;i<o;i++)(l=n[i]).className.indexOf("e-group-container")>-1&&(e.level.push(s),this.levelColl[l.id]=e.level.slice(),s++,e.groupElement=l,e=this.refreshLevel(e));var a=t.closest(r,".e-rule-list");return e.groupElement=a?t.closest(a,".e-group-container"):r,e.level=this.levelColl[e.groupElement.id].slice(),e},h.prototype.groupTemplate=function(){var e,t,l,i,n,r=this.createElement("div",{attrs:{class:"e-group-container"}}),o=this.createElement("div",{attrs:{class:"e-group-header"}}),s=this.createElement("div",{attrs:{class:"e-group-body"}}),a=this.createElement("div",{attrs:{class:"e-rule-list"}});return r.appendChild(o),s.appendChild(a),r.appendChild(s),this.headerTemplate||(e=this.createElement("div",{attrs:{class:"e-lib e-btn-group",role:"group"}}),this.enableNotCondition&&(t=this.createElement("button",{attrs:{type:"button",class:"e-qb-toggle"}}),e.appendChild(t)),t=this.createElement("input",{attrs:{type:"radio",class:"e-btngroup-and",value:"AND"}}),e.appendChild(t),l=this.createElement("label",{attrs:{class:"e-lib e-btn e-btngroup-and-lbl e-small"},innerHTML:this.l10n.getConstant("AND")}),e.appendChild(l),t=this.createElement("input",{attrs:{type:"radio",class:"e-btngroup-or",value:"OR"}}),e.appendChild(t),l=this.createElement("label",{attrs:{class:"e-lib e-btn e-btngroup-or-lbl e-small"},innerHTML:this.l10n.getConstant("OR")}),e.appendChild(l),o.appendChild(e),i=this.createElement("div",{attrs:{class:"e-group-action"}}),n=this.createElement("button",{attrs:{type:"button",class:"e-add-btn"}}),i.appendChild(n),o.appendChild(i)),r},h.prototype.ruleTemplate=function(){var e,l,i=this.createElement("div"),n=this.createElement("div",{attrs:{class:"e-rule-field"}});e=this.createElement("div",{attrs:{class:"e-rule-filter"}});var r=this.createElement("input",{attrs:{type:"text",class:"e-filter-input"}});e.appendChild(r),n.appendChild(e),e=this.createElement("div",{attrs:{class:"e-rule-operator"}}),n.appendChild(e),e=this.createElement("div",{attrs:{class:"e-rule-value"}}),n.appendChild(e),e=this.createElement("div",{attrs:{class:"e-rule-value-delete"}}),l=this.showButtons.ruleDelete||t.isNullOrUndefined(this.showButtons.ruleDelete)?"e-removerule e-rule-delete e-css e-btn e-small":"e-removerule e-rule-delete e-css e-btn e-small e-button-hide";var o=this.createElement("button",{attrs:{type:"button",class:l}});return e.appendChild(o),n.appendChild(e),i.appendChild(n),i},h.prototype.addGroupElement=function(e,t,l,i,n,r,o){var s=this,a={groupID:t.id.replace(this.element.id+"_",""),cancel:!1,type:"insertGroup"};this.isImportRules||this.isInitialLoad?(this.isInitialLoad=!1,this.addGroupSuccess(a,e,t,l,i,n,r,o)):this.trigger("beforeChange",a,function(a){s.addGroupSuccess(a,e,t,l,i,n,r,o)})},h.prototype.addGroupSuccess=function(e,i,n,r,o,a,u,d){if(!e.cancel&&this.element.querySelectorAll(".e-group-container").length<=this.maxGroupCount){var p=n,h=void 0,c="";c=p.className.indexOf("e-group-container")<0?p.querySelector(".e-group-container")&&p.querySelector(".e-group-container").id:p.id;var m=this.groupElem.cloneNode(!0);if(m.setAttribute("id",this.element.id+"_group"+this.groupIdCounter),this.headerTemplate&&(u?(i=!1,m.setAttribute("id",this.element.id+"_group0"),this.headerTemplateFn(m,a,r,d,c),this.groupIdCounter=0):this.headerTemplateFn(m,a,r,d,c)),this.groupIdCounter++,!this.headerTemplate){var f=m.querySelector(".e-btngroup-and"),g=m.querySelector(".e-btngroup-or"),v=m.querySelector(".e-btngroup-and-lbl"),y=m.querySelector(".e-btngroup-or-lbl");f.setAttribute("id",this.element.id+"_and"+this.btnGroupId),g.setAttribute("id",this.element.id+"_or"+this.btnGroupId),f.setAttribute("name",this.element.id+"_and"+this.btnGroupId),g.setAttribute("name",this.element.id+"_and"+this.btnGroupId),v.setAttribute("for",this.element.id+"_and"+this.btnGroupId),y.setAttribute("for",this.element.id+"_or"+this.btnGroupId),this.btnGroupId++}if(i){var C=void 0;C=this.showButtons.groupDelete||t.isNullOrUndefined(this.showButtons.groupDelete)?"e-deletegroup":"e-deletegroup e-button-hide",h=this.createElement("button",{attrs:{type:"button",class:C}});new l.Button({iconCss:"e-icons e-delete-icon",cssClass:"e-small e-round"}).appendTo(h),h.setAttribute("title",this.l10n.getConstant("DeleteGroup")),t.rippleEffect(h,{selector:".deletegroup"}),this.headerTemplate||m.querySelector(".e-group-action").appendChild(h);for(var b=p.querySelector(".e-rule-list"),S=b.children,x=0,O=0,w=S.length;O<w;O++)S[O].className.indexOf("e-group-container")>-1&&(x+=1);b.appendChild(m);var N=this.levelColl[p.id].slice(0);N.push(x),this.levelColl[m.id]=N,this.isImportRules||(this.isAddSuccess=!0,this.addGroups([],p.id.replace(this.element.id+"_","")),this.isAddSuccess=!1,o&&this.addRuleElement(m,{}))}else p.appendChild(m),this.levelColl[m.id]=[0];if(this.enableNotCondition&&!this.headerTemplate){var E=m.querySelector(".e-qb-toggle");new l.Button({content:this.l10n.getConstant("NOT"),cssClass:"e-btn e-small"}).appendTo(E),m.querySelector(".e-btngroup-and-lbl").classList.add("e-not"),this.updatedRule&&this.updatedRule.not&&t.addClass([E],"e-active-toggle")}if(this.updatedRule=null,this.headerTemplate){var q={requestType:"header-template-create",ruleID:m.id,condition:r,notCondition:this.enableNotCondition?a:void 0};this.trigger("actionBegin",q)}else{var R=m.querySelector(".e-add-btn");new s.DropDownButton({items:this.items,cssClass:"e-round e-small e-caret-hide e-addrulegroup",iconCss:"e-icons e-add-icon",beforeOpen:this.selectBtn.bind(this,R),select:this.selectBtn.bind(this,R)}).appendTo(R),R.setAttribute("title",this.l10n.getConstant("AddButton"))}if(!this.isImportRules){var T=p.id.replace(this.element.id+"_",""),k=m.id.replace(this.element.id+"_","");this.trigger("change",{groupID:T,type:"insertGroup",childGroupID:k})}}},h.prototype.headerTemplateFn=function(e,l,i,n,r){var o,s,a=this.element.id+"_header",u=e.querySelector(".e-group-header");if(this.headerTemplate){if(s={requestType:"header-template-initialize",ruleID:e.id,notCondition:this.enableNotCondition?l:void 0,condition:i,rule:this.getRuleCollection(n,!0),groupID:r},this.trigger("actionBegin",s),this.headerFn=this.templateParser(this.headerTemplate),this.isReact)o=this.headerFn(s,this,e.id,a)[0],u.appendChild(o);else if(this.isAngular){var d=this.headerFn(s,this,e.id,a);o=3===d[0].nodeType?d[1]:d[0],u.appendChild(o)}else this.isVue3?(o=this.headerFn(s,this,e.id,a),t.append(o,u)):(o=this.headerFn(s,this,"Template",a)[0],u.appendChild(o));this.renderReactTemplates()}return e},h.prototype.notifyChange=function(e,l,i){var n=t.closest(l,".e-group-container"),r=this.getParentGroup(n),o=t.closest(l,".e-rule-container"),s=0;if("not"!==i)if("condition"!==i){for(;o&&null!==o.previousElementSibling;)o=o.previousElementSibling,s++;var a=r.rules[s],u=this.getColumn(a.field),d=this.getFormat(u.format);if("date"===u.type)if(e instanceof Date)e=this.intl.formatDate(e,d);else if(e instanceof Array)for(var p=0;p<e.length;p++)e[p]&&e[p]instanceof Date&&(e[p]=this.intl.formatDate(e[p],d));u.ruleTemplate?this.templateChange(l,e,i):(this.isNotified=!0,this.updateRules(l,e),this.isNotified=!1)}else r.condition=e;else r.not=e},h.prototype.templateChange=function(e,l,i){var n,r=t.closest(e,".e-group-container"),o=this.getParentGroup(r),s=t.closest(e,".e-rule-container"),a=0;for(this.allowValidation&&this.validateValue(o,s);s&&null!==s.previousElementSibling;)s=s.previousElementSibling,a++;var u=o.rules[a];"field"===i?this.selectedColumn=this.getColumn(l):u&&(this.selectedColumn=this.getColumn(u.field));var d;this.previousColumn=this.getColumn(u.field);var p=this.getValidRules(this.rule);this.selectedColumn&&(d=this.selectedColumn.operators?this.selectedColumn.operators:this.customOperators[this.selectedColumn.type+"Operator"]);var h,c=["in","notin","between","notbetween"];switch(i){case"field":u.field=l,u.label=this.selectedColumn.label,u.type=this.selectedColumn.type,u.value="",u.operator=d[0].value;break;case"operator":h=u.operator,u.operator=l,c.indexOf(u.operator)>-1?u.value=[]:c.indexOf(h)>-1&&(u.value="");break;case"value":u.value=l}if(this.changeRuleTemplate(this.selectedColumn,e),this.filterRules(p,this.getValidRules(this.rule),i),this.selectedColumn&&this.selectedColumn.ruleTemplate&&("field"===i||"operator"===i)){var m=t.closest(e,".e-rule-container");this.destroyControls(m,!0),t.detach(m.querySelector(".e-rule-field"));var f=this.appendRuleElem(t.closest(m,".e-group-container"),this.selectedColumn,"change",m.id,i,u);"Vertical"===this.displayMode||this.element.className.indexOf("e-device")>-1?f.className="e-rule-container e-vertical-mode":f.className="e-rule-container e-horizontal-mode",f.previousElementSibling&&f.previousElementSibling.className.indexOf("e-rule-container")>-1&&(f.className.indexOf("e-joined-rule")<0&&(f.className+=" e-joined-rule"),f.previousElementSibling.className.indexOf("e-prev-joined-rule")<0&&(f.previousElementSibling.className+=" e-prev-joined-rule")),f.previousElementSibling&&f.previousElementSibling.className.indexOf("e-group-container")>-1&&f.className.indexOf("e-separate-rule")<0&&(f.className+=" e-separate-rule");var g={requestType:"template-create",action:i,ruleID:m.id,fields:this.fields,rule:u};n={groupID:r.id.replace(this.element.id+"_",""),ruleID:m.id.replace(this.element.id+"_",""),value:u.field,type:"field"},this.trigger("actionBegin",g),this.trigger("change",n)}},h.prototype.changeValue=function(e,l){var i,n=this;if(l.element&&l.element.classList.contains("e-multiselect")){i=l.element}else i=l.event?l.event.target:l.element;if(i.className.indexOf("e-day")>-1||i.className.indexOf("e-today")>-1||i.className.indexOf("e-cell")>-1){i=l.element}var r,o=t.closest(i,".e-group-container"),s=t.closest(i,".e-rule-container"),a=o&&o.id.replace(this.element.id+"_",""),u=s.id.replace(this.element.id+"_",""),d=l;d.element&&d.element.className.indexOf("e-datepicker")>-1&&(i=d.element,(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist"))&&(this.selectedColumn=r.getDataByValue(r.value)),(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdowntree"))&&(this.selectedColumn=this.getColumn(r.value[0])));var p,h;if(i.className.indexOf("e-radio")>-1)if(h=parseInt(i.id.split("valuekey")[1],0),"Default"===this.fieldMode?(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist"),this.selectedColumn=r.getDataByValue(r.value)):(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdowntree"),this.selectedColumn=this.getColumn(r.value[0])),this.selectedColumn.values)p=this.selectedColumn.values[h];else{p=[!0,!1][h]}else p=i.className.indexOf("e-multiselect")>-1?t.getComponent(i,"multiselect").value:l.value;"input"===l.name&&this.immediateModeDelay?(window.clearInterval(this.timer),this.timer=window.setInterval(function(){n.filterValue(a,u,p,e,i)},this.immediateModeDelay)):this.filterValue(a,u,p,e,i)},h.prototype.filterValue=function(e,t,l,i,n){var r=this,o={groupID:e,ruleID:t,value:l,cancel:!1,type:"value"};window.clearInterval(this.timer),this.isImportRules?this.changeValueSuccessCallBack(o,n,i,e,t):this.trigger("beforeChange",o,function(l){r.changeValueSuccessCallBack(l,n,i,e,t)})},h.prototype.changeValueSuccessCallBack=function(e,t,l,i,n){e.cancel||(this.updateRules(t,e.value,l),this.isImportRules||this.trigger("change",{groupID:i,ruleID:n,value:e.value,cancel:!1,type:"value"}))},h.prototype.fieldClose=function(e){if(!this.isFieldChange&&!this.isDestroy){this.isFieldClose=!0;var l=t.getComponent(e,"dropdownlist"),i=l.popupObj.element.querySelector(".e-active"),n=l.getItemData();l.value=n.value;var r={element:l.element,value:n.value,isInteracted:!0,previousItemData:this.prevItemData,previousItem:null,item:i,itemData:n,event:null,e:null};l.previousValue!==l.value&&this.changeField(r),this.isFieldChange=!1}},h.prototype.onSelectField=function(e){e.itemData.hasChildren&&this.showPopup()},h.prototype.changeField=function(e){if(e.isInteracted){if(t.isNullOrUndefined(e.value))return;this.isFieldChange=!0,this.prevItemData=e.itemData;var l=t.closest(e.element,".e-rule-filter")||t.closest(e.element,".e-rule-sub-filter"),i="DropdownTree"===this.fieldMode?this.getColumn(e.value[0]):this.getColumn(e.value);if("DropdownTree"===this.fieldMode&&null!=l){var n=l.querySelector(".e-dropdowntree.e-control"),r=t.getComponent(n,"dropdowntree");if(!i)return;if("object"===i.type){if(r.value=e.oldValue,r.dataBind(),t.isNullOrUndefined(e.oldValue))n.value="";else{var o=this.getLabelFromColumn(e.oldValue[0]);n.value=o}return}if(!t.isNullOrUndefined(e.value[0])){r.value=e.value[0],r.dataBind();o=this.getLabelFromColumn(e.value[0]);n.value=o}}if(this.destroySubFields(l),this.subFieldElem=null,this.isNotValueChange=!0,i&&i.ruleTemplate)this.templateChange(e.element,i.field,"field");else if(i&&i.columns&&i.columns[0].ruleTemplate)this.templateChange(e.element,i.columns[0].field,"field");else{for(var s=t.closest(e.element,".e-group-container"),a=this.getParentGroup(s),u=t.closest(e.element,".e-rule-container"),d=0;u&&null!==u.previousElementSibling;)u=u.previousElementSibling,d++;a.rules[d].value="",this.changeRule(a.rules[d],e)}}},h.prototype.changeRule=function(e,l){if(!l.itemData){if("DropdownTree"!==this.fieldMode)return;if(null==t.getComponent(l.element,"dropdowntree").value)return}var i=t.closest(l.element,".e-rule-filter");i=i||t.closest(l.element,".e-rule-sub-filter");var n=t.getComponent(l.element,"dropdownlist");"DropdownTree"===this.fieldMode&&null!=i&&(n=t.getComponent(l.element,"dropdowntree"));var r=t.closest(l.element,".e-group-container").id.replace(this.element.id+"_","");this.changeFilter(i,n,r,e,{},l)},h.prototype.changeFilter=function(e,l,i,n,r,o){var s=this;if(e){var a=void 0;a="DropdownTree"===this.fieldMode?l.value[0]:this.isImportRules?this.GetRootColumnName(l.value):l.value,this.selectedColumn=this.getColumn(a);var u={groupID:i,ruleID:t.closest(e,".e-rule-container").id.replace(this.element.id+"_",""),selectedField:"DropdownTree"===this.fieldMode?l.value[0]:l.value,cancel:!1,type:"field"};this.isImportRules?this.fieldChangeSuccess(u,r,e,n,o):this.trigger("beforeChange",u,function(t){s.fieldChangeSuccess(t,r,e,n,o)})}else{var d=t.closest(o.element,".e-rule-operator");this.changeOperator(e,d,l,i,n,r,o)}},h.prototype.changeOperator=function(e,l,i,n,r,o,s){var a,u=this;l?(a={groupID:n,ruleID:t.closest(l,".e-rule-container").id.replace(this.element.id+"_",""),selectedIndex:i.index,cancel:!1,type:"operator"},this.isImportRules?this.operatorChangeSuccess(a,e,o,r,s):this.trigger("beforeChange",a,function(t){u.operatorChangeSuccess(t,e,o,r,s)})):this.changeRuleValues(e,r,o,s)},h.prototype.fieldChangeSuccess=function(e,l,i,n,r){for(var o=t.closest(i,".e-rule-container"),s=t.closest(r.element,".e-rule-operator"),a=t.closest(r.element,".e-group-container").id.replace(this.element.id+"_",""),u=t.getComponent(r.element,"dropdownlist"),d=o.querySelectorAll(".e-tooltip.e-input-group"),p=0;p<d.length;p++)t.getComponent(d[p],"tooltip").destroy();if(e.cancel)this.changeOperator(i,s,u,a,n,l,r);else{if(t.isNullOrUndefined(this.selectedColumn))return;if(l.type=this.selectedColumn.type,o.querySelector(".e-template")&&(n.value=""),"object"===this.selectedColumn.type&&"Default"===this.fieldMode)for(l.type=this.selectedColumn.columns[0].type;this.selectedColumn.columns;)this.createSubFields(i,n,l,r);else this.destroySubFields(i),this.changeOperator(i,s,u,a,n,l,r)}},h.prototype.destroySubFields=function(e){for(;e&&e.nextElementSibling.classList.contains("e-rule-sub-filter");)this.destroyControls(e),e.nextElementSibling.remove()},h.prototype.createSubFields=function(e,l,n,r){var o=!1,s=t.closest(e,".e-rule-field"),a=this.createElement("div",{attrs:{class:"e-rule-sub-filter",id:"subfilter"+this.subFilterCounter}});s.insertBefore(a,s.querySelector(".e-rule-operator"));var u=t.closest(a,".e-rule-container").id,p=this.createElement("input",{attrs:{type:"text",id:u+"_subfilterkey"+this.subFilterCounter}});a.appendChild(p);var h,c=this.element.className.indexOf("e-device")>-1?"250px":"200px",m=Object.keys(this.selectedColumn.columns[0]);h={dataSource:this.selectedColumn.columns,fields:this.fields,placeholder:this.l10n.getConstant("SelectField"),popupHeight:m.length>5?c:"auto",change:this.changeField.bind(this),index:0,open:this.popupOpen.bind(this,!1)},this.fieldModel&&(h=d({},h,this.fieldModel));var f=new i.DropDownList(h);if(f.appendTo("#"+u+"_subfilterkey"+this.subFilterCounter),this.isImportRules||this.previousColumn&&this.previousColumn.ruleTemplate&&this.GetRootColumnName(l.field)===this.GetRootColumnName(this.previousColumn.field))for(var g=this.selectedColumn.columns,v=0;v<g.length;v++)if(l.field===g[v].field||l.field.indexOf(g[v].field)>-1){f.value=g[v].field,this.selectedColumn=g[v],o=!0;break}this.subFilterCounter++,this.subFieldElem=p,r.itemData=r.itemData,!o&&this.selectedColumn.columns&&(!o&&this.isImportRules&&(f.value=null),this.selectedColumn=this.selectedColumn.columns[0]),this.previousColumn=this.selectedColumn,this.selectedColumn.columns||this.changeRuleValues(a,l,n,r)},h.prototype.operatorChangeSuccess=function(e,l,i,n,r){if(!e.cancel){var o=t.closest(r.element,".e-rule-operator"),s=o.nextElementSibling,a=t.getComponent(r.element,"dropdownlist"),u=n.operator?n.operator.toString().toLowerCase():"";i.operator=a.value.toString();var d=i.operator.toLowerCase();if(i.operator.toLowerCase().indexOf("between")>-1||i.operator.toLowerCase().indexOf("in")>-1&&i.operator.toLowerCase().indexOf("contains")<0?(l=o.previousElementSibling,i.type=n.type,(i.operator.toLowerCase().indexOf("in")<0||u.indexOf("in")<0)&&(n.value=[])):"object"==typeof n.value&&null!=n.value&&(n.value=n.value.length>0?n.value[0]:"number"===n.type?0:""),r.previousItemData){var p=r.previousItemData.value.toString().toLowerCase();(p.indexOf("between")>-1||(p.indexOf("in")>-1||p.indexOf("null")>-1||p.indexOf("empty")>-1)&&p.indexOf("contains")<0)&&(l=o.previousElementSibling,i.type=n.type)}if(u.indexOf("in")>-1&&u.indexOf("in")<5&&d.indexOf("in")>-1&&d.indexOf("in")<5&&(l=null),i.operator.indexOf("null")>-1||i.operator.indexOf("empty")>-1){var h=o.parentElement.querySelector(".e-rule-value"),c=h.querySelector(".e-tooltip.e-input-group");c&&t.getComponent(c,"tooltip").destroy(),t.removeClass([h],"e-show"),t.addClass([h],"e-hide")}s&&this.getColumn(n.field).template&&(l=o.previousElementSibling),this.changeRuleValues(l,n,i,r)}},h.prototype.changeRuleValues=function(e,l,n,r){var o,s,a,u=t.closest(r.element,".e-rule-operator");if(e)if(u=e.nextElementSibling,e.classList.contains("e-rule-sub-filter")&&(n.type=this.selectedColumn.type,u=u.classList.contains("e-rule-sub-filter")?u.nextElementSibling:u),t.addClass([u],"e-operator"),u.childElementCount){o=t.getComponent(u.querySelector(".e-dropdownlist"),"dropdownlist"),n.operator=o.value;var p=void 0;p="DropdownTree"===this.fieldMode?t.getComponent(e.querySelector(".e-dropdowntree"),"dropdowntree"):t.getComponent(e.querySelector(".e-dropdownlist"),"dropdownlist"),n.type="DropdownTree"===this.fieldMode?this.getColumn(p.value[0]).type:this.getColumn(p.value).type;var h=r.itemData;this.renderValues(u,h,r.previousItemData,!0,l,n,r.element)}else{var c=t.closest(u,".e-rule-container").id;a=this.createElement("input",{attrs:{type:"text",id:c+"_operatorkey"}}),u.appendChild(a),this.selectedColumn.operators?s=this.selectedColumn.operators:r.itemData&&(s=this.customOperators[this.selectedColumn.type+"Operator"]);var m=this.element.className.indexOf("e-device")>-1?"250px":"200px",f=s[0].value;f=l&&""!==l.operator?l.operator:f;var g=void 0;g={dataSource:s,fields:{text:"key",value:"value"},placeholder:this.l10n.getConstant("SelectOperator"),popupHeight:s.length>5?m:"auto",change:this.changeField.bind(this),index:0,value:f,open:this.popupOpen.bind(this,!1)},this.operatorModel&&(g=d({},g,this.operatorModel));new i.DropDownList(g).appendTo("#"+c+"_operatorkey"),n.operator=l&&""!==l.operator&&!t.isNullOrUndefined(l.operator)?l.operator:s[0].value,this.isImportRules&&(n.type=this.selectedColumn.type,n.operator=l.operator),this.renderValues(u,this.selectedColumn,r.previousItemData,!1,l,n,r.element)}this.isImportRules||this.updateRules(r.element,r.item)},h.prototype.popupOpen=function(e,l){this.enableRtl&&t.addClass([l.popup.element],"e-rtl"),e&&(this.isFieldClose=!1)},h.prototype.destroyControls=function(e,l){for(var i=l?e:e.nextElementSibling,n=i.querySelectorAll("input.e-control"),r=i.querySelectorAll("div.e-control:not(.e-handle)"),o=this.columns,s=0,a=n.length;s<a;s++){if(n[s].classList.contains("e-textbox"))t.getComponent(n[s],"textbox").destroy(),t.detach(t.select("input#"+n[s].id,i));else if(n[s].classList.contains("e-dropdownlist"))this.allowValidation&&n[s].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(n[s].parentElement,"tooltip").destroy(),t.getComponent(n[s],"dropdownlist").destroy();else if(n[s].classList.contains("e-radio"))t.getComponent(n[s],"radio").destroy();else if(n[s].classList.contains("e-numerictextbox"))t.getComponent(n[s],"numerictextbox").destroy(),t.detach(t.select("input#"+n[s].id,i));else if(n[s].classList.contains("e-datepicker"))t.getComponent(n[s],"datepicker").destroy();else if(n[s].classList.contains("e-multiselect"))t.getComponent(n[s],"multiselect").destroy();else if(n[s].className.indexOf("e-template")>-1)for(var u=n[s].className,d=0,p=o.length;d<p;d++)if(o[d].template&&u.indexOf(o[d].field)>-1){this.templateDestroy(o[d],n[s].id);break}document.getElementById(n[s].id)&&t.detach(n[s])}for(s=0,a=r.length;s<a;s++){if(r[s].className.indexOf("e-template")>-1)for(u=r[s].className,d=0,p=o.length;d<p;d++)if(o[d].template&&u.indexOf(o[d].field)>-1){this.templateDestroy(o[d],r[s].id);break}t.detach(r[s])}var h=i.querySelectorAll(".e-template:not(.e-control)");for(s=0,a=h.length;s<a;s++)t.detach(h[s])},h.prototype.templateDestroy=function(e,l){var i;if("string"!=typeof e.template||void 0===e.template.destroy){var n=(i=e.template).destroy;if(i.destroy){var r=void 0;document.getElementById(l)&&(r=t.closest(document.getElementById(l),".e-rule-field").querySelectorAll(".e-template")),"string"==typeof n?(n=t.getValue(n,window))({field:e.field,elementId:l,elements:r}):i.destroy({field:e.field,elementId:l,elements:r})}}},h.prototype.getValues=function(e){var t,l={},i=[],n=[];this.separator.length>0&&(n=e.split(this.separator));var r=this.dataColl;if(this.dataColl[1])for(var o=0,s=r.length;o<s;o++){var a={};if(n.length>1)for(var u=r[o],d=void 0,p=0,h=n.length;p<h;p++)d=n[p],n.length===p+1?(t=u[""+d],Number(u[""+d])===u[""+d]&&u[""+d]%1!=0&&(t=u[""+d].toString())):u=u[""+d];else t=r[o][""+e],Number(r[o][""+e])===r[o][""+e]&&r[o][""+e]%1!=0&&(t=r[o][""+e].toString());t in l||(l[""+t]=1,n.length>1?this.createNestedObject(a,n,t):a[""+e]=t,i.push(a))}return i},h.prototype.createNestedObject=function(e,t,l){for(var i,n=t.length-1,r=0;r<n;++r)(i=t[r])in e||(e[""+i]={}),e=e[""+i];e[t[n]]=l},h.prototype.getDistinctValues=function(e,t){for(var l={},i=[],n=[],r="",o=t.indexOf(this.separator),s=function(s,u){0===o?r=e[s][""+t]:(n=t.split(a.separator)).forEach(function(t){r=r?r[""+t]:e[s][""+t]}),Number(e[s][""+t])===e[s][""+t]&&e[s][""+t]%1!=0&&(r=e[s][""+t].toString());var d={};r in l||(l[""+r]=1,0===o?d[""+t]=r:d[n[n.length-1]]=r,i.push(d))},a=this,u=0,d=e.length;u<d;u++)s(u);return i},h.prototype.renderMultiSelect=function(e,t,l,r,o){var s,a=!1,u=!1;this.isGetNestedData=!1,this.dataColl[1]&&Object.keys(this.dataColl[1]).indexOf(e.field)>-1&&(a=!0,s=this.getDistinctValues(this.dataColl,e.field)),a=!e.columns&&a,!this.dataColl.length&&o.length&&(u=!0);var p=this.selectedRule.field;if(0!==this.selectedRule.field.indexOf(this.separator)&&"DropdownTree"!==this.fieldMode){var h=this.selectedRule.field.split(this.separator);p=h[h.length-1]}var c;c={dataSource:u?o:a?s:this.dataManager,query:new n.Query([e.field]),fields:{text:p,value:p},placeholder:this.l10n.getConstant("SelectValue"),value:r,mode:"CheckBox",width:"100%",change:this.changeValue.bind(this,l),close:this.closePopup.bind(this,l),actionBegin:this.multiSelectOpen.bind(this,t+"_valuekey"+l),open:this.popupOpen.bind(this,!1)},this.valueModel&&this.valueModel.multiSelectModel&&(c=d({},c,this.valueModel.multiSelectModel));var m=new i.MultiSelect(c);m.appendTo("#"+t+"_valuekey"+l),this.updateRules(m.element,r,0)},h.prototype.multiSelectOpen=function(e,l){if(this.dataSource instanceof n.DataManager){var i=document.getElementById(e),r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist");this.selectedColumn=r.getDataByValue(r.value);var o=this.selectedColumn.field,s=!1;if(this.dataColl[1]){Object.keys(this.dataColl[1]).indexOf(o)>-1&&(s=!0);0!==o.indexOf(this.separator)&&this.isGetNestedData&&(s=!0)}s||(l.cancel=!0,this.bindMultiSelectData(i,o))}},h.prototype.bindMultiSelectData=function(e,t){this.getMultiSelectData(e,t)},h.prototype.getMultiSelectData=function(e,l){var i,r=this,o=new n.Deferred,s=this.dataManager.executeQuery((new n.Query).select(l)),u=t.getComponent(e,"multiselect");u.hideSpinner(),this.createSpinner(t.closest(e,".e-multi-select-wrapper").parentElement),a.showSpinner(t.closest(e,".e-multi-select-wrapper").parentElement),s.then(function(n){i=n.actual&&n.actual.result?n.actual.result:n.result,r.dataColl=t.extend(r.dataColl,i,[],!0),u.dataSource=r.getDistinctValues(r.dataColl,l),r.isGetNestedData=!0,a.hideSpinner(t.closest(e,".e-multi-select-wrapper").parentElement)}).catch(function(e){o.reject(e)})},h.prototype.createSpinner=function(e){var l=this.createElement("span",{attrs:{class:"e-qb-spinner"}});e.appendChild(l),a.createSpinner({target:l,width:t.Browser.isDevice?"16px":"14px"})},h.prototype.closePopup=function(e,l){var i=document.getElementById(l.popup.element.id.replace("_popup",""));if(i){var n=t.getComponent(i,"multiselect").value;this.updateRules(i,n,e)}},h.prototype.processTemplate=function(e,l,i,n){var r=t.closest(e,".e-rule-container"),o=r.querySelectorAll(".e-template"),s=r.querySelector(".e-rule-filter .e-filter-input"),a="DropdownTree"===this.fieldMode?t.getComponent(s,"dropdowntree"):t.getComponent(r.querySelector(".e-rule-filter .e-filter-input"),"dropdownlist"),u="DropdownTree"===this.fieldMode?this.getColumn(a.value[0]):this.getColumn(a.value);if("string"==typeof l.template||void 0===l.template.write){var d={rule:i,ruleID:r.id,operator:n.operator,field:u.field,requestType:"value-template-create"};this.trigger("actionBegin",d)}else{var p=l.template;"string"==typeof p.write?t.getValue(p.write,window)({elements:o.length>1?o:o[0],values:i.value,operator:n.operator,field:u.field,dataSource:u.values}):"function"!=typeof l.template&&l.template.write({elements:o.length>1?o:o[0],values:i.value,operator:n.operator,field:u.field,dataSource:u.values})}},h.prototype.getItemData=function(e){var l=t.getComponent(document.getElementById(e+"_filterkey"),"dropdownlist");return"DropdownTree"===this.fieldMode&&(l=t.getComponent(document.getElementById(e+"_filterkey"),"dropdowntree")),"DropdownTree"===this.fieldMode?this.getColumn(l.value[0]):this.getColumn(l.value)},h.prototype.setDefaultValue=function(e,l,i){var n=this.getItemData(e);if(t.isNullOrUndefined(n.value))return i?l?[0,0]:0:l?[]:"";if(l){if(!(n.value instanceof Array))return[n.value]}else if(n.value instanceof Array)return n.value[0];return n.value},h.prototype.renderStringValue=function(e,t,l,i,n){var o,s,a=this.getItemData(e),u="string"==typeof a.template;if(s=this.isImportRules||this.isPublic||u?t.value:this.setDefaultValue(e,!1,!1),"in"!==l&&"notin"!==l||!this.dataColl.length&&!a.values){"in"!==l&&"notin"!==l||(s=(o=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1)).join(","));var p=void 0;p={placeholder:this.l10n.getConstant("SelectValue"),input:this.changeValue.bind(this,i)},this.valueModel&&this.valueModel.textBoxModel&&(p=d({},p,this.valueModel.textBoxModel));var h=new r.TextBox(p);h.appendTo("#"+e+"_valuekey"+i),h.value=s,h.dataBind()}else o=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1),this.renderMultiSelect(a,e,i,o,a.values),"Vertical"===this.displayMode||this.element.className.indexOf("e-device")>-1?n.style.width="100%":(n.style.width=null,n.style.minWidth="200px")},h.prototype.renderNumberValue=function(e,t,l,i,n,o,s){var a=this.getItemData(e),u="string"==typeof a.template,p=this.isImportRules||this.isPublic||u?t.value:this.setDefaultValue(e,!1,!0);if("in"!==l&&"notin"!==l||!this.dataColl.length&&!a.values)if("in"===l||"notin"===l){var h=(p=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1)).join(","),c=void 0;c={placeholder:this.l10n.getConstant("SelectValue"),input:this.changeValue.bind(this,i)},this.valueModel&&this.valueModel.textBoxModel&&(c=d({},c,this.valueModel.textBoxModel));var m=new r.TextBox(c);m.appendTo("#"+e+"_valuekey"+i),m.value=h,m.dataBind()}else{var f=(o=a).validation&&o.validation.min?o.validation.min:0,g=o.validation&&o.validation.max?o.validation.max:Number.MAX_VALUE,v=o.format?o.format:"n";s>1&&t&&(p=t.value[i]?t.value[i]:this.setDefaultValue(e,!0,!0));var y=void 0;y={value:p instanceof Array?p[i]:p,format:v,min:f,max:g,width:"100%",step:o.step?o.step:1,change:this.changeValue.bind(this,i)},this.valueModel&&this.valueModel.numericTextBoxModel&&(y=d({},y,this.valueModel.numericTextBoxModel));var C=new r.NumericTextBox(y);C.appendTo("#"+e+"_valuekey"+i),C.element.setAttribute("aria-label",o.label+" Value")}else p=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1),this.renderMultiSelect(a,e,i,p,a.values),this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?n.style.width="100%":(n.style.minWidth="200px",n.style.width=null)},h.prototype.processValueString=function(e,t){var l=[],i=e.split(",");if("string"===t)return i;for(var n=0,r=i.length;n<r;n++)l.push(Number(i[n]));return l},h.prototype.parseDate=function(e,l){var i,n;if(l){var r=this.intl.getDateParser({skeleton:"full",type:"dateTime"});i=this.getFormat(l),n=r(e),t.isNullOrUndefined(n)&&(n=this.intl.parseDate(e,i))}else n=new Date(e);return n},h.prototype.renderControls=function(e,l,i,n,r){if(t.addClass([e.parentElement.querySelector(".e-rule-value")],"e-value"),t.removeClass([e.parentElement.querySelector(".e-rule-value")],"e-hide"),t.addClass([e.parentElement.querySelector(".e-rule-value")],"e-show"),l.template&&(l.template.create||r))this.processTemplate(e,l,i,n);else{var s;s="boolean"===n.type?this.selectedColumn.values?this.selectedColumn.values.length:2:n.operator&&n.operator.toString().toLowerCase().indexOf("between")>-1?2:1;var a=t.closest(e,".e-rule-container").id,u=void 0,p=n.operator.toString();if(e.className.indexOf("e-rule-operator")>-1||e.className.indexOf("e-rule-filter")>-1){u=e.parentElement.querySelector(".e-rule-value"),this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?u.style.width="100%":"in"!==p&&"notin"!==p?t.addClass([u],"e-custom-value"):t.removeClass([u],"e-custom-value");for(var h=0;h<s;h++)switch(n.type){case"string":this.renderStringValue(a,i,p,h,u);break;case"number":this.renderNumberValue(a,i,p,h,u,l,s);break;case"boolean":this.processBoolValues(l,i,a,h);break;case"date":var c=new Date,m=void 0,f=void 0,g=l.format,v=void 0,y=void 0,C=this.l10n.getConstant("SelectValue"),b="string"==typeof l.template;if(l.field||l.key||!l.value||(c=l.value instanceof Date?l.value:this.parseDate(l.value,l.format)),!l.format&&i&&""!==i.field&&(g=(f=this.getColumn(i.field)).format),(this.isImportRules||this.isPublic||b)&&i&&(g=(f=this.getColumn(i.field)).format,i.value?(m=s>1?i.value[h]:i.value,c=this.parseDate(m,f.format)):c=i.value),g){var S=this.getFormat(g);S.skeleton?(y={locale:this.getLocale(),value:c,placeholder:C,format:S,change:this.changeValue.bind(this,h)},this.valueModel&&this.valueModel.datePickerModel&&(y=d({},y,this.valueModel.datePickerModel)),v=new o.DatePicker(y)):(y={value:c,locale:this.getLocale(),placeholder:C,format:S.format,change:this.changeValue.bind(this,h)},this.valueModel&&this.valueModel.datePickerModel&&(y=d({},y,this.valueModel.datePickerModel)),v=new o.DatePicker(y))}else y={locale:this.getLocale(),value:c,placeholder:C,change:this.changeValue.bind(this,h)},this.valueModel&&this.valueModel.datePickerModel&&(y=d({},y,this.valueModel.datePickerModel)),v=new o.DatePicker(y);if(v.appendTo("#"+a+"_valuekey"+h),!i.value){var x=document.getElementById(a+"_valuekey"+h);this.updateRules(x,c,null,this.isNotValueChange),this.isNotValueChange=!1}}}}},h.prototype.processBoolValues=function(e,i,n,r){var o,s,a=!1;t.isNullOrUndefined(i.type)&&e&&(i.type=e.type);var u;if(e.values){var p=e.values;"boolean"!==i.type||t.isNullOrUndefined(i.value)?e.value?a=p[r].toLowerCase()===e.value.toString().toLowerCase():0===r&&(a=!0):a=p[r].toLowerCase()===i.value.toString().toLowerCase(),s=o=u=p[r]}else{p=[!0,!1];"boolean"!==i.type||t.isNullOrUndefined(i.value)?e.value?a=p[r].toString().toLowerCase()===e.value.toString().toLowerCase():0===r&&(a=!0):a=p[r].toString().toLowerCase()===i.value.toString().toLowerCase(),o=p[r].toString(),s=p[r],u=this.l10n.getConstant(["True","False"][r])}var h;h={label:u,name:n+"default",checked:a,value:o,change:this.changeValue.bind(this,r)},this.valueModel&&this.valueModel.radioButtonModel&&(h=d({},h,this.valueModel.radioButtonModel));var c=new l.RadioButton(h);c.appendTo("#"+n+"_valuekey"+r),a&&this.updateRules(c.element,s,0)},h.prototype.getOperatorIndex=function(e,t){var l,i=e.dataSource.length;for(l=0;l<i;l++)if(t.operator===e.dataSource[l].value)return l;return 0},h.prototype.getPreviousItemData=function(e,t){return this.isFieldClose&&e&&(e=this.getColumn(e.value)),t&&t.template&&e&&Object.keys(e).length<4&&(e.template=t.template),e},h.prototype.renderValues=function(e,l,i,n,r,o,s){var a=e.previousElementSibling.getElementsByTagName("input")[0],u="DropdownTree"===this.fieldMode?t.getComponent(a,"dropdowntree"):t.getComponent(a,"dropdownlist"),d="DropdownTree"===this.fieldMode?this.getColumn(u.value[0]):this.getColumn(u.value);if(this.selectedRule=d,n){var p=t.getComponent(e.querySelector("input"),"dropdownlist");(l=s.id.indexOf("operator")>-1?l:this.selectedRule).operators&&(p.value=null,p.dataBind(),p.dataSource=l.operators,p.index=this.getOperatorIndex(p,r),p.value=o.operator=p.dataSource[p.index].value,p.dataBind())}var h=o.operator.toString(),c=!1;if(h.indexOf("null")>-1||h.indexOf("isempty")>-1||h.indexOf("isnotempty")>-1){(g=e.parentElement.querySelector(".e-rule-value"))&&(t.removeClass([g],"e-show"),t.addClass([g],"e-hide"))}else{var m=t.closest(e,".e-rule-container").id;if((i=this.getPreviousItemData(i,d))&&void 0===i.template?i.columns&&(i=this.getColumn(r.field)):"DropdownTree"===this.fieldMode&&void 0===i&&(i=this.getColumn(r.field)),i&&i.template){this.templateDestroy(i,m+"_valuekey0");var f=t.select("#"+m+"_valuekey0",e.nextElementSibling);f&&!f.classList.contains("e-control")&&t.detach(t.select("#"+m+"_valuekey0",e.nextElementSibling)),"string"!=typeof i.template&&void 0!==i.template.create||(e.nextElementSibling.classList.contains("e-template-value")&&this.clearQBTemplate([m]),e.nextElementSibling.innerHTML="")}if(n&&(this.validateValue(r,t.closest(e,".e-rule-container")),this.destroyControls(e)),d&&(l.template=d.template),l.template&&(t.addClass([e.nextElementSibling],"e-template-value"),l.template=d.template,c=this.setColumnTemplate(l,m,d.field,l.value||h,e,r)),c){var g=e.parentElement.querySelector(".e-rule-value");this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?g.style.width="100%":g.style.width="200px"}else{t.removeClass([e.nextElementSibling],"e-template-value");var v=1;v="boolean"===o.type?this.selectedColumn.values?this.selectedColumn.values.length:2:h&&h.toLowerCase().indexOf("between")>-1?2:1;for(var y=0;y<v;y++){var C=this.createElement("input",{attrs:{type:"text",id:m+"_valuekey"+y}});e.nextElementSibling.appendChild(C)}}this.renderControls(e,l,r,o,c)}},h.prototype.setColumnTemplate=function(e,l,i,n,r,o){var s,a=this,u=!0;if(e.template){if("string"==typeof e.template||void 0===e.template.create)return s={requestType:"value-template-initialize",ruleID:l,field:i,operator:n,rule:o,renderTemplate:!0},this.trigger("actionBegin",s,function(t){u=a.actionBeginSuccessCallBack(t,e,l,i,r)}),u;var d=void 0,p=e.template;if((d="string"==typeof p.create?t.getValue(p.create,window)({field:i,operator:n}):p.create({field:i,operator:n}))instanceof Element)d.id=l+"_valuekey0",t.addClass([d],"e-template"),r.nextElementSibling.appendChild(d),i.indexOf(" ")<0&&t.addClass([d],"e-"+i);else if(d instanceof Array){t.addClass(d,"e-template");for(var h=0,c=d.length;h<c;h++)d[h].id=l+"_valuekey"+h,r.nextElementSibling.appendChild(d[h])}return t.addClass([r.nextElementSibling],"e-template-value"),!0}return!0},h.prototype.actionBeginSuccessCallBack=function(e,l,i,n,r){if(e.renderTemplate){var o=void 0;this.columnTemplateFn=this.templateParser((l.template,l.template));var s=this.element.id+n;if(this.isReact)o=this.columnTemplateFn(e,this,i,s)[0],r.nextElementSibling.appendChild(o);else if(this.isAngular){var a=this.columnTemplateFn(e,this,i,s);o=3===a[0].nodeType?a[1]:a[0],r.nextElementSibling.appendChild(o)}else this.isVue3?(o=this.columnTemplateFn(e,this,"Template",s),t.append(o,r.nextElementSibling)):(o=this.columnTemplateFn(e,this,"Template",s)[0],r.nextElementSibling.appendChild(o));return t.addClass([r.nextElementSibling],"e-template-value"),this.renderReactTemplates(),!0}return!1},h.prototype.updateValues=function(e,l){var i=1;e.className.indexOf("e-template")>-1&&(i=3);var n=e.className.split(" e-")[i],r=parseInt(e.id.slice(-1),2);switch(n){case"checkbox":var o=t.getComponent(e,n).value;l.value=""!==o?o:void 0;break;case"textbox":case"dropdownlist":l.value=t.getComponent(e,n).value;break;case"radio":var s=t.getComponent(e,n);s.checked&&("boolean"==typeof l.value?l.value="true"===s.value:this.getColumn(l.field).values?l.value=s.value:l.value="true"===s.value),s.refresh();break;case"numerictextbox":l.operator.indexOf("between")>-1?("string"==typeof l.value&&(l.value=[]),l.value[r]=t.getComponent(e,n).value):l.value=t.getComponent(e,n).value;break;case"datepicker":var a=this.getColumn(l.field),u=this.getFormat(a.format),d=t.getComponent(e,n).value;l.operator.indexOf("between")>-1?("string"==typeof l.value&&(l.value=[]),l.value[r]=this.intl.formatDate(d,u)):t.isNullOrUndefined(u.format)&&d?l.value=this.intl.formatDate(d):l.value=d?this.intl.formatDate(d,u):d;break;case"multiselect":l.value=t.getComponent(e,n).value}},h.prototype.updateRules=function(e,l,i,n){for(var r,o,s=t.closest(e,".e-group-container"),a=this.getParentGroup(s),u=t.closest(e,".e-rule-container"),d=0,p=s.id.replace(this.element.id+"_",""),h=this.getValidRules(this.rule);u&&null!==u.previousElementSibling;)u=u.previousElementSibling,d++;var c=a.rules[d].operator?a.rules[d].operator.toString():"",m=(u=t.closest(e,".e-rule-container")).id.replace(this.element.id+"_","");if(t.closest(e,".e-rule-filter")||t.closest(e,".e-rule-sub-filter")){this.subFieldElem&&(e=this.subFieldElem),r="DropdownTree"===this.fieldMode?t.getComponent(e,"dropdowntree"):t.getComponent(e,"dropdownlist");var f="DropdownTree"===this.fieldMode?this.getColumn(r.value[0]):this.getColumn(r.value);!this.isImportRules&&a.rules[d].field&&a.rules[d].field.toLowerCase()!==f.field.toLowerCase()&&(!u.querySelectorAll(".e-template")&&!(c.indexOf("null")>-1)||c.indexOf("empty")>-1)&&(a.rules[d].value=""),this.selectedColumn=this.getColumn(this.selectedColumn.field),a.rules[d].field=this.selectedColumn.field,a.rules[d].type=this.selectedColumn.type,a.rules[d].label=this.selectedColumn.label;var g=t.closest(e,".e-rule-filter"),v=(g=g||t.closest(e,".e-rule-sub-filter")).nextElementSibling.querySelector("input.e-control");v=v||g.nextElementSibling.nextElementSibling.querySelector("input.e-control"),c=t.getComponent(v,"dropdownlist").value.toString(),a.rules[d].operator=c;var y=g.nextElementSibling.nextElementSibling,C=y.querySelectorAll("input.e-control");C.length<1&&(C=y.querySelectorAll("div.e-control")),C.length<1&&(C=y.querySelectorAll(".e-template")),o={groupID:p,ruleID:m,value:a.rules[d].field,type:"field"};for(var b=0;b<C.length;b++)c.indexOf("null")>-1||c.indexOf("empty")>-1?a.rules[d].value=null:this.updateValues(C[b],a.rules[d]);this.isImportRules||this.trigger("change",o),this.allowValidation&&a.rules[d].field&&e.parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(e.parentElement,"tooltip").destroy(),this.filterRules(h,this.getValidRules(this.rule),"field")}else if(t.closest(e,".e-rule-operator")){r=t.getComponent(e,"dropdownlist"),a.rules[d].operator=r.value.toString();var S=u.querySelectorAll(".e-rule-value input.e-control");o={groupID:p,ruleID:m,value:r.value,type:"operator"},this.allowValidation&&a.rules[d].operator&&e.parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(e.parentElement,"tooltip").destroy(),S.length>1&&!(S[0].className.indexOf("e-template")>-1)&&(a.rules[d].value=[]);for(var x=0;x<S.length;x++)a.rules[d].operator.indexOf("null")>-1||a.rules[d].operator.indexOf("empty")>-1?a.rules[d].value=null:S[x].classList.contains("e-template")||this.updateValues(S[x],a.rules[d]);this.isImportRules||this.trigger("change",o),this.filterRules(h,this.getValidRules(this.rule),"operator")}else t.closest(e,".e-rule-value")&&(this.ruleValueUpdate(e,l,a,d,s,u,i),n||this.filterRules(h,this.getValidRules(this.rule),"value"))},h.prototype.filterRules=function(e,t,l){JSON.stringify({condition:e.condition,not:e.not,rule:e.rules})!==JSON.stringify({condition:t.condition,not:t.not,rule:t.rules})&&(this.isImportRules||this.trigger("ruleChange",{previousRule:e,rule:t,type:l}))},h.prototype.ruleValueUpdate=function(e,t,l,i,n,r,o){var s,a,u=["in","between","notin","notbetween"];if(l.rules[i].operator&&(a=l.rules[i].operator.toString().toLowerCase()),null!==t){if(e.className.indexOf("e-multiselect")>-1&&"number"===l.rules[i].type&&!this.isNotified){for(var d=[],p=t,h=0,c=p.length;h<c;h++)"string"==typeof p[h]&&d.push(parseFloat(p[h]));d.length&&(t=d)}if(this.isNotified)l.rules[i].value=t,s={groupID:n.id,ruleID:r.id,value:l.rules[i].value,type:"value"},this.isImportRules||this.trigger("change",s);else if(e.className.indexOf("e-spin")>-1||e.className.indexOf("e-numeric")>-1)u.indexOf(a)>-1?l.rules[i].value[o]=t:l.rules[i].value=t;else if(e.className.indexOf("e-radio")>-1)l.rules[i].value=t;else if(e.className.indexOf("e-multiselect")>-1)l.rules[i].value=t;else if(e.className.indexOf("e-textbox")>-1)"in"===a||"notin"===a?(l.rules[i].type,l.rules[i].value=this.processValueString(t,l.rules[i].type)):l.rules[i].value=t;else if(e.className.indexOf("e-datepicker")>-1){var m=this.getFormat(this.getColumn(this.selectedColumn.field).format);m.type&&(u.indexOf(a)>-1?("string"==typeof l.rules[i].value&&(l.rules[i].value=[]),l.rules[i].value[o]=this.intl.formatDate(t,m)):l.rules[i].value=this.intl.formatDate(t,m))}this.validateValue(l,r,i)}else e.className.indexOf("e-datepicker")>-1&&u.indexOf(a)>-1?("string"==typeof l.rules[i].value&&(l.rules[i].value=[]),l.rules[i].value[o]=t):l.rules[i].value=t},h.prototype.validateValue=function(e,l,i){t.isNullOrUndefined(i)||(e=e.rules[i]);var n="object"==typeof e.value;if(this.allowValidation&&(t.isNullOrUndefined(i)||(n?e.value.length>0:e.value))){var r=l.querySelectorAll(".e-rule-value .e-control");r.length>0&&(r[0].className.indexOf("e-tooltip")>-1?t.getComponent(r[0],"tooltip").destroy():r[0].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(r[0].parentElement,"tooltip").destroy(),r[1]&&r[1].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(r[1].parentElement,"tooltip").destroy())}},h.prototype.getFormat=function(e){var t;return e?"string"==typeof e?(t={type:"dateTime"},"short"===e||"yMd"===e?(t.type="date",t.skeleton=e):t.format=e):t={type:"dateTime",skeleton:e.skeleton}:t={type:"date",skeleton:"yMd"},t},h.prototype.findGroupByIdx=function(e,t,l){var i=t.rules,n=[];if(!l){for(var r=0,o=i.length;r<o;r++)(t=i[r]).rules&&n.push(t);return n[e]}return t},h.prototype.destroy=function(){this.isDestroy=!0;if(this.element){var l,i,n,r;for(e.prototype.destroy.call(this),n=(l=this.element.querySelectorAll(".e-addrulegroup")).length,i=0;i<n;i++)t.getComponent(l[i],"dropdown-btn").destroy(),t.detach(l[i]);for(r=this.element.querySelectorAll(".e-rule-filter .e-control.e-tooltip"),i=0;i<r.length;i++)t.getComponent(r[i],"tooltip").destroy();for(n=(l=this.element.querySelectorAll(".e-rule-filter .e-control:not(.e-tooltip)")).length,i=0;i<n;i++)t.getComponent(l[i],"dropdownlist")?t.getComponent(l[i],"dropdownlist").destroy():t.getComponent(l[i],"dropdowntree").destroy(),t.detach(l[i]);for(r=this.element.querySelectorAll(".e-rule-operator .e-control.e-tooltip"),i=0;i<r.length;i++)t.getComponent(r[i],"tooltip").destroy();for(n=(l=this.element.querySelectorAll(".e-rule-operator .e-control:not(.e-tooltip)")).length,i=0;i<n;i++)t.getComponent(l[i],"dropdownlist")&&(t.getComponent(l[i],"dropdownlist").destroy(),t.detach(l[i]));for(r=this.element.querySelectorAll(".e-rule-value .e-control.e-tooltip"),i=0;i<r.length;i++)t.getComponent(r[i],"tooltip").destroy();this.isImportRules=!1,this.unWireEvents(),this.levelColl[this.element.id+"_group0"]=[0],this.element.innerHTML="",this.portals&&this.portals.length&&this.clearQBTemplate(),t.classList(this.element,[],["e-rtl","e-responsive","e-device"]),this.isDestroy=!1}},h.prototype.addRules=function(e,t){t=this.element.id+"_"+t,this.isPublic=!0;for(var l=0,i=e.length;l<i;l++)this.addRuleElement(document.getElementById(t),e[l]);this.isPublic=!1},h.prototype.addGroups=function(e,t){if(this.isAddSuccess||this.element.querySelectorAll(".e-group-container").length<=this.maxGroupCount){t=this.element.id+"_"+t;var l=document.getElementById(t),i=this.getParentGroup(l);if(e.length){this.isPublic=!0;for(var n=0,r=e.length;n<r;n++)this.updatedRule={condition:e[n].condition,not:e[n].not},this.importRules(e[n],l,!1,e[n].not);this.isPublic=!1}else{var o="and",s=!1;this.updatedRule&&(o=this.updatedRule.condition,s=this.updatedRule.not),this.enableNotCondition?i.rules.push({condition:o,not:s,rules:[]}):i.rules.push({condition:o,rules:[]})}this.headerTemplate||this.disableRuleCondition(l,i)}},h.prototype.initWrapper=function(){if(this.isInitialLoad=!0,this.cssClass&&t.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&t.addClass([this.element],"e-rtl"),this.width&&(this.element.style.width=this.width),this.height&&(this.element.style.height=this.height),this.rule.rules.length?this.isImportRules=!0:this.addGroupElement(!1,this.element),t.Browser.isDevice||"Vertical"===this.displayMode?(t.Browser.isDevice&&(this.element.style.width="100%",this.element.classList.add("e-device")),t.removeClass(this.element.querySelectorAll(".e-rule-container"),"e-horizontal-mode"),t.addClass(this.element.querySelectorAll(".e-rule-container"),"e-vertical-mode"),this.displayMode="Vertical"):this.displayMode="Horizontal",this.summaryView)this.isImportRules?this.renderSummary():this.renderSummaryCollapse();else{if(this.columns.length&&this.isImportRules){this.addGroupElement(!1,this.element,this.rule.condition,!1,this.rule.not,!1,this.rule);var e=t.extend({},this.rule,{},!0);this.isRefreshed=!0,this.setGroupRules(e),this.isRefreshed=!1}else this.columns.length&&this.addRuleElement(this.element.querySelector(".e-group-container"),{});this.notGroupRtl(),this.readonly&&this.enableReadonly();for(var l=this.element.querySelectorAll("label.e-btn"),i=void 0,n=0;n<l.length;n++)i=l.item(n),t.rippleEffect(i,{selector:".e-btn"})}},h.prototype.renderSummary=function(){var e=this.createElement("div",{attrs:{class:"e-summary-content",id:this.element.id+"_summary_content"}}),t=this.createElement("textarea",{attrs:{class:"e-summary-text",readonly:"true"},styles:"max-height:500px"}),l=this.createElement("button",{attrs:{type:"button",class:"e-edit-rule e-css e-btn e-small e-flat e-primary"}}),i=this.createElement("div",{attrs:{class:"e-summary-btndiv"}});e.appendChild(t),t.textContent=this.getSqlFromRules(this.rule),l.textContent=this.l10n.getConstant("Edit"),i.appendChild(l),e.appendChild(i),this.element.appendChild(e)},h.prototype.renderSummaryCollapse=function(){var e=this.createElement("div",{attrs:{class:"e-collapse-rule e-icons",title:this.l10n.getConstant("SummaryViewTitle")}});this.element.querySelector(".e-group-header").appendChild(e)},h.prototype.columnSort=function(){"descending"===this.sortDirection.toLowerCase()?this.columns=new n.DataManager(this.columns).executeLocal((new n.Query).sortByDesc("field")):"ascending"===this.sortDirection.toLowerCase()&&(this.columns=new n.DataManager(this.columns).executeLocal((new n.Query).sortBy("field")))},h.prototype.onChangeNotGroup=function(){if(this.element.innerHTML="",this.groupIdCounter=0,!this.headerTemplate)if(this.enableNotCondition){if(this.enableNotCondition){var e=this.createElement("button",{attrs:{type:"button",class:"e-qb-toggle"}});this.groupElem.querySelector(".e-btn-group").insertBefore(e,this.groupElem.querySelector(".e-btngroup-and"))}}else this.groupElem.querySelector(".e-qb-toggle").remove();this.setProperties({rule:this.checkNotGroup(this.rule)},!0),this.initWrapper()},h.prototype.notGroupRtl=function(){this.enableRtl?t.addClass(this.element.querySelectorAll(".e-btn-group"),"e-rtl"):t.removeClass(this.element.querySelectorAll(".e-btn-group"),"e-rtl")},h.prototype.checkNotGroup=function(e){var l;if(e.rules)for(var i=0;i<e.rules.length;i++)l=e.rules[i],l=this.checkNotGroup(l),e.rules[i]=l;return t.isNullOrUndefined(e.not)?this.enableNotCondition&&!t.isNullOrUndefined(e.condition)&&(e.not=!1):(this.enableNotCondition&&(e.not=!1),delete e.not),e},h.prototype.onPropertyChanged=function(e,l){for(var i=0,n=Object.keys(e);i<n.length;i++){switch(n[i]){case"summaryView":var r=this.element.querySelector(".e-group-container"),o=this.element.querySelector(".e-summary-content");e.summaryView?(r.style.display="none",this.element.querySelectorAll(".e-summary-content").length<1?(this.renderSummary(),o=this.element.querySelector(".e-summary-content")):this.element.querySelector(".e-summary-text").textContent=this.getSqlFromRules(this.rule),o.style.display="block"):(r.querySelectorAll(".e-collapse-rule").length>-1&&this.renderSummaryCollapse(),r.style.display="block",o.style.display="none");break;case"displayMode":this.refresh();break;case"showButtons":e.showButtons.ruleDelete?t.removeClass(this.element.querySelectorAll(".e-rule-delete"),"e-button-hide"):t.addClass(this.element.querySelectorAll(".e-rule-delete"),"e-button-hide"),e.showButtons.groupDelete?t.removeClass(this.element.querySelectorAll(".e-deletegroup"),"e-button-hide"):t.addClass(this.element.querySelectorAll(".e-deletegroup"),"e-button-hide");break;case"cssClass":l.cssClass&&t.removeClass([this.element],l.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?(t.addClass([this.element],"e-rtl"),this.notGroupRtl()):(t.removeClass([this.element],"e-rtl"),this.notGroupRtl());break;case"enablePersistence":this.enablePersistence=e.enablePersistence;break;case"dataSource":this.dataSource=e.dataSource,this.refresh();break;case"columns":this.columns=e.columns,this.columnSort(),this.updateSubFieldsFromColumns(this.columns);break;case"sortDirection":this.sortDirection=e.sortDirection,this.columnSort();break;case"maxGroupCount":this.maxGroupCount=e.maxGroupCount;break;case"height":this.height=e.height,this.element.style.height=this.height;break;case"rule":0!=this.rule.rules.length||t.isNullOrUndefined(this.rule)||this.reset(),this.setProperties({rule:e.rule},!0),e.rule=this.getRuleCollection(this.rule,!1),this.setRules(this.rule);break;case"width":this.width=e.width,this.element.style.width=this.width;break;case"locale":this.locale=e.locale,this.intl=new t.Internationalization(this.locale),this.isLocale=!0,this.refresh(),this.isLocale=!1;break;case"enableNotCondition":this.onChangeNotGroup();break;case"readonly":this.isReadonly=e.readonly,this.enableReadonly()}}},h.prototype.preRender=function(){this.element.id=this.element.id||t.getUniqueID("ej2-querybuilder"),this.defaultLocale={StartsWith:"Starts With",EndsWith:"Ends With",Contains:"Contains",NotLike:"Not Like",Like:"Like",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",Between:"Between",NotBetween:"Not Between",In:"In",NotIn:"Not In",Remove:"REMOVE",SelectField:"Select a field",SelectOperator:"Select operator",DeleteRule:"Remove this condition",DeleteGroup:"Delete group",AddGroup:"Add Group",AddCondition:"Add Condition",Edit:"EDIT",ValidationMessage:"This field is required",SummaryViewTitle:"Summary View",OtherFields:"Other Fields",AND:"AND",OR:"OR",NOT:"NOT",SelectValue:"Enter Value",IsEmpty:"Is Empty",IsNotEmpty:"Is Not Empty",IsNull:"Is Null",IsNotNull:"Is Not Null",True:"true",False:"false",AddButton:"Add Group/Condition"},this.l10n=new t.L10n("querybuilder",this.defaultLocale,this.locale),this.intl=new t.Internationalization(this.locale),this.groupIdCounter=0,this.subFilterCounter=0,this.ruleIdCounter=0,this.btnGroupId=0,this.isImportRules=!1,this.parser=[],this.customOperators={stringOperator:[{value:"startswith",key:this.l10n.getConstant("StartsWith")},{value:"endswith",key:this.l10n.getConstant("EndsWith")},{value:"contains",key:this.l10n.getConstant("Contains")},{value:"equal",key:this.l10n.getConstant("Equal")},{value:"notequal",key:this.l10n.getConstant("NotEqual")},{value:"in",key:this.l10n.getConstant("In")},{value:"notin",key:this.l10n.getConstant("NotIn")},{value:"isempty",key:this.l10n.getConstant("IsEmpty")},{value:"isnotempty",key:this.l10n.getConstant("IsNotEmpty")}],dateOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"greaterthan",key:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",key:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",key:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",key:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",key:this.l10n.getConstant("NotEqual")}],booleanOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"notequal",key:this.l10n.getConstant("NotEqual")}],numberOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"greaterthanorequal",key:this.l10n.getConstant("GreaterThanOrEqual")},{value:"greaterthan",key:this.l10n.getConstant("GreaterThan")},{value:"between",key:this.l10n.getConstant("Between")},{value:"lessthan",key:this.l10n.getConstant("LessThan")},{value:"notbetween",key:this.l10n.getConstant("NotBetween")},{value:"lessthanorequal",key:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",key:this.l10n.getConstant("NotEqual")},{value:"in",key:this.l10n.getConstant("In")},{value:"notin",key:this.l10n.getConstant("NotIn")}]},this.operators={equal:"=",notequal:"!=",greaterthan:">",greaterthanorequal:">=",lessthan:"<",in:"IN",notin:"NOT IN",lessthanorequal:"<=",startswith:"LIKE",endswith:"LIKE",between:"BETWEEN",notbetween:"NOT BETWEEN",contains:"LIKE",isnull:"IS NULL",isnotnull:"IS NOT NULL",isempty:"IS EMPTY",isnotempty:"IS NOT EMPTY",notstartswith:"NOT LIKE",notendswith:"NOT LIKE",notcontains:"NOT LIKE"},this.sqlOperators={equal:"=",notequal:"!=",greaterthan:">",greaterthanorequal:">=",lessthan:"<",in:this.l10n.getConstant("In").toUpperCase(),notin:this.l10n.getConstant("NotIn").toUpperCase(),lessthanorequal:"<=",startswith:this.l10n.getConstant("Like").toUpperCase(),endswith:this.l10n.getConstant("Like").toUpperCase(),between:this.l10n.getConstant("Between").toUpperCase(),notbetween:this.l10n.getConstant("NotBetween").toUpperCase(),contains:this.l10n.getConstant("Like").toUpperCase(),isnull:this.l10n.getConstant("IsNull").toUpperCase(),isnotnull:this.l10n.getConstant("IsNotNull").toUpperCase(),isempty:this.l10n.getConstant("IsEmpty").toUpperCase(),isnotempty:this.l10n.getConstant("IsNotEmpty").toUpperCase(),notstartswith:this.l10n.getConstant("NotLike").toUpperCase(),notendswith:this.l10n.getConstant("NotLike").toUpperCase(),notcontains:this.l10n.getConstant("NotLike").toUpperCase()},this.fields||(this.fields={text:"label",value:"field"})},h.prototype.render=function(){this.levelColl={},this.items=[{text:this.l10n.getConstant("AddGroup"),iconCss:"e-icons e-add-icon e-addgroup"},{text:this.l10n.getConstant("AddCondition"),iconCss:"e-icons e-add-icon e-addrule"}],this.ruleElem=this.ruleTemplate(),this.groupElem=this.groupTemplate();var e=[{value:"isnull",key:this.l10n.getConstant("IsNull")},{value:"isnotnull",key:this.l10n.getConstant("IsNotNull")}],t=[{value:"isnull",key:this.l10n.getConstant("IsNull")},{value:"isnotnull",key:this.l10n.getConstant("IsNotNull")}];this.customOperators.stringOperator=this.customOperators.stringOperator.concat(e),this.customOperators.numberOperator=this.customOperators.numberOperator.concat(t),this.dataSource instanceof n.DataManager?(this.dataManager=this.dataSource,this.executeDataManager((new n.Query).take(1))):(this.dataManager=new n.DataManager(this.dataSource),this.dataColl=this.dataManager.executeLocal(new n.Query),this.initControl()),this.renderComplete()},h.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(l){return t.compile(e)}},h.prototype.executeDataManager=function(e){var t=this,l=this.dataManager.executeQuery(e),i=new n.Deferred;l.then(function(e){e.actual&&e.actual.result?t.dataColl=e.actual.result:t.dataColl=e.result,t.initControl()}).catch(function(e){i.reject(e)})},h.prototype.initControl=function(){this.initialize(),this.initWrapper(),this.wireEvents()},h.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(e,"click",this.clickEventHandler,this),t.EventHandler.add(e,"focusout",this.focusEventHandler,this),t.EventHandler.add(e,"focusin",this.focusEventHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this)},h.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(e,"click",this.clickEventHandler),t.EventHandler.remove(e,"focusout",this.focusEventHandler),t.EventHandler.remove(e,"focusin",this.focusEventHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler)},h.prototype.getParentGroup=function(e,t){for(var l=e instanceof Element?this.levelColl[e.id]:this.levelColl[""+e],i=t?l.length-1:l.length,n=this.rule,r=0;r<i;r++)n=this.findGroupByIdx(l[r],n,0===r);return n},h.prototype.deleteGroup=function(e){var t,l=this,i=e;"string"==typeof e?(t=this.element.id+"_"+e,e=document.getElementById(t)):t=i.id.replace(this.element.id+"_","");var n={groupID:t,cancel:!1,type:"deleteGroup"};this.isImportRules?this.deleteGroupSuccessCallBack(n,e):this.trigger("beforeChange",n,function(t){l.deleteGroupSuccessCallBack(t,e)})},h.prototype.deleteGroupSuccessCallBack=function(e,l){if(!e.cancel){var i=l,n=this.getParentGroup(i,!0),r=0,o=void 0,s=void 0,a=this.getValidRules(this.rule),u=i.nextElementSibling,d=i.previousElementSibling,p=i.querySelectorAll(".e-group-container"),h=i.querySelectorAll(".e-tooltip");for(s=h.length,o=0;o<s;o++)t.getComponent(h[o],"tooltip").destroy();for(o=0,s=p.length;o<s;o++)delete this.levelColl[p[o].id];for(;null!==i.previousElementSibling;)i=i.previousElementSibling,r++;u&&u.className.indexOf("e-separate-rule")>-1&&(t.removeClass([u],"e-separate-rule"),t.addClass([u],"e-joined-rule"),d&&d.className.indexOf("e-rule-container")>-1&&t.addClass([d],"e-prev-joined-rule"));var c=i.parentElement.parentElement.parentElement,m=[];if(this.isReact||this.isAngular){var f=n.rules[r],g=l.querySelectorAll(".e-rule-container");if(f&&f.rules)for(var v=0;v<f.rules.length;v++){var y=this.getColumn(f.rules[v].field),C=g[v].querySelector(".e-template-value");y&&(y.ruleTemplate||this.isPlatformTemplate(y)&&C)&&m.push(g[v].id)}}t.detach(l),this.headerTemplate&&this.clearQBTemplate([l.id]),m.length&&this.clearQBTemplate(m),n.rules.splice(r,1),delete this.levelColl[e.groupID],this.refreshLevelColl(),this.disableRuleCondition(c,n),this.isImportRules||this.trigger("change",e),this.filterRules(a,this.getValidRules(this.rule),"deleteGroup")}},h.prototype.isPlatformTemplate=function(e){return e.template&&("string"==typeof e.template||void 0===e.template.create)},h.prototype.deleteRule=function(e){var l=this,i={groupID:t.closest(e,".e-group-container").id.replace(this.element.id+"_",""),ruleID:t.closest(e,".e-rule-container").id.replace(this.element.id+"_",""),cancel:!1,type:"deleteRule"};this.isImportRules?this.deleteRuleSuccessCallBack(i,e):this.trigger("beforeChange",i,function(t){l.deleteRuleSuccessCallBack(t,e)})},h.prototype.deleteRuleSuccessCallBack=function(e,l){if(!e.cancel){var i=t.closest(l,".e-group-container"),n=this.getParentGroup(i),r=t.closest(l,".e-rule-container"),o=this.getValidRules(this.rule),s=r,a=r.nextElementSibling,u=r.previousElementSibling,d=0,p=r.querySelectorAll(".e-tooltip"),h=void 0,c=p.length;for(h=0;h<c;h++)t.getComponent(p[h],"tooltip").destroy();for(;null!==r.previousElementSibling;)r=r.previousElementSibling,d++;var m=this.getColumn(n.rules[d].field);m&&m.template&&s.querySelector(".e-template")&&this.templateDestroy(m,s.querySelector(".e-template").id),(!u||u.className.indexOf("e-rule-container")<0)&&a&&t.removeClass([a],"e-joined-rule"),(!a||a.className.indexOf("e-rule-container")<0)&&u&&t.removeClass([u],"e-prev-joined-rule");var f=s.querySelector(".e-template-value");try{t.detach(s)}catch(e){(e=[]).error="error"}m&&m.ruleTemplate&&this.clearQBTemplate([s.id]),m&&this.isPlatformTemplate(m)&&f&&this.clearQBTemplate([s.id]),n.rules.splice(d,1),n.rules[0]&&n.rules[0].rules||this.disableRuleCondition(i,n),this.isImportRules||this.trigger("change",e),this.filterRules(o,this.getValidRules(this.rule),"deleteRule")}},h.prototype.setGroupRules=function(e,t){this.headerTemplate&&t&&(this.isRoot=!0),this.reset(),this.groupIdCounter=1,this.ruleIdCounter=0,this.isImportRules=!0,this.setProperties({rule:e},!0),e=this.getRuleCollection(this.rule,!1),this.importRules(this.rule,this.element.querySelector(".e-group-container"),!0,this.rule.not,t),this.isImportRules=!1},h.prototype.keyBoardHandler=function(e){!this.readonly||38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode||e.preventDefault()},h.prototype.clearQBTemplate=function(e){(this.isReact||this.isAngular)&&this.clearTemplate(e)},h.prototype.disableRuleCondition=function(e,t){if(!this.headerTemplate){if(this.readonly)return;var l=e.querySelector(".e-rule-list").childElementCount,i=e.querySelector(".e-btngroup-and"),n=e.querySelector(".e-btngroup-or");l>1?(i.disabled=!1,n.disabled=!1,(n.nextElementSibling.classList.contains("e-btn-disable")||i.nextElementSibling.classList.contains("e-btn-disable"))&&(n.nextElementSibling.classList.remove("e-btn-disable"),i.nextElementSibling.classList.remove("e-btn-disable")),t&&"or"===t.condition?n.checked=!0:i.checked=!0):(i.checked=!1,i.disabled=!0,n.checked=!1,n.disabled=!0,t&&(n.nextElementSibling.classList.add("e-btn-disable"),i.nextElementSibling.classList.add("e-btn-disable")))}},h.prototype.getValidRules=function(e){e||(e=this.getRules());var l=e.condition,i=e.not,n=t.extend([],e.rules,[],!0);return this.getRuleCollection({condition:l,rules:n,not:i},!0)},h.prototype.getRuleCollection=function(e,l){if(t.isNullOrUndefined(e))return null;var i;if(e.rules&&e.rules.length&&(Object.keys(e.rules[0]).length>6||l))for(var n=e.rules.length,r=0;r<n;r++)i=e.rules[r],i=this.getRuleCollection(i,l),e.rules[r]=i,Object.keys(i).length<1&&l&&(e.rules.splice(r,1),r--,n--);var o=e.custom;if(e.field&&""!==e.field&&(t.isNullOrUndefined(o)||o&&"question"!==o.type&&"answer"!==o.type))if(e.operator&&(e.operator.toString().indexOf("null")>-1||e.operator.toString().indexOf("empty")>-1)&&(e.value=null),this.isRefreshed&&this.enablePersistence||""!==e.field&&""!==e.operator&&""!==e.value&&void 0!==e.value||o&&o.isQuestion){var s=e.condition;e={label:e.label,field:e.field,operator:e.operator,type:e.type,value:e.value},s&&(e.condition=s),o&&(e.custom=o)}else e={};else if(!o||"question"!==o.type&&"answer"!==o.type)t.isNullOrUndefined(e.condition)&&t.isNullOrUndefined(e.rules)?e={}:(e=this.enableNotCondition?{condition:e.condition,rules:e.rules,not:e.not}:{condition:e.condition,rules:e.rules},o&&(e.custom=o),0===e.rules.length&&(e={}));else{var a=e.not;(e={label:e.label,field:e.field,operator:e.operator,type:e.type,value:e.value,condition:e.condition,rules:e.rules}).custom=o,this.enableNotCondition&&(e.not=a)}return e},h.prototype.setRules=function(e){var l=t.extend({},e,{},!0);this.headerTemplate?this.setGroupRules(l,!0):this.setGroupRules(l)},h.prototype.getRules=function(){var e;return e=this.enableNotCondition?{condition:this.rule.condition,rules:this.rule.rules,not:this.rule.not}:{condition:this.rule.condition,rules:this.rule.rules},this.rule.custom&&(e.custom=this.rule.custom),e},h.prototype.getRule=function(e){var l,i,n=0;if(e instanceof HTMLElement?l=t.closest(e,".e-rule-container"):(i=this.element.id+"_"+e,l=document.getElementById(i)),t.isNullOrUndefined(l))return null;for(var r=t.closest(l,".e-group-container"),o=this.getParentGroup(r);null!==l.previousElementSibling;)l=l.previousElementSibling,n++;return o.rules[n]},h.prototype.getGroup=function(e){e instanceof Element&&e.className.indexOf("e-group-container")<1&&(e=t.closest(e,".e-group-container"));var l=e instanceof Element?e.id:this.element.id+"_"+e;return this.getParentGroup(l)},h.prototype.deleteGroups=function(e){var t,l,i=e.length;for(t=0;t<i;t++)l=this.element.id+"_"+e[t],this.deleteGroup(document.getElementById(l))},h.prototype.getFilteredRecords=function(){var e=this.getPredicate(this.getValidRules(this.rule)),l=t.isNullOrUndefined(e)?new n.Query:(new n.Query).where(e);return this.dataManager.executeQuery(l)},h.prototype.deleteRules=function(e){var t,l,i=e.length;for(t=0;t<i;t++)l=this.element.id+"_"+e[t],this.deleteRule(document.getElementById(l))},h.prototype.getDataManagerQuery=function(e){for(var t=this.getPredicate(e),l=[],i=0,r=Object.keys(this.columns);i<r.length;i++)l.push(this.columns[i].field);return e.rules.length?(new n.Query).select(l).where(t):(new n.Query).select(l)},h.prototype.getPredicate=function(e){var l,i,r,o,s=e.rules,a=!1,u=["notcontains","notstartswith","notendswith"];if(!s)return l;for(var d=0,p=s.length;d<p;d++){if(a=!1,Object.keys(s[d]).indexOf("rules")>-1&&s[d].rules)(i=this.getPredicate(s[d]))&&(l=l?"and"===e.condition?l.and(i):l.or(i):i);else if(!t.isNullOrUndefined(s[d].operator)&&!t.isNullOrUndefined(s[d].operator.length)){var h=s[d].operator.toLowerCase(),c=!1,m=["equal","notequal","greaterthan","greaterthanorequal","lessthan","lessthanorequal"];if("string"===s[d].type&&(a=!this.matchCase),"date"===s[d].type&&m.indexOf(h)>-1&&(a=!0),o=this.getColumn(s[d].field),h.indexOf("null")>-1||h.indexOf("empty")>-1)s[d].value=null;else if("date"!==s[d].type||s[d].value instanceof Array)r=s[d].value;else{var f=this.getFormat(o.format);t.isNullOrUndefined(s[d].value)?r=null:(r=this.getDate(s[d].value,f),m.indexOf(h)>-1&&!this.isTime(s[d].value)&&(c=!0))}if(0===d)if(c||(h.indexOf("in")>-1||h.indexOf("between")>-1||h.indexOf("null")>-1||h.indexOf("empty")>-1)&&h.indexOf("contains")<0)l=c?this.datePredicate(s[d],r):this.arrayPredicate(s[d]);else{""!==(g=r)&&u.indexOf(h)<0&&(l=new n.Predicate(s[d].field,s[d].operator,r,a))}else{if(u.indexOf(h)>-1)continue;if(c||(h.indexOf("in")>-1||h.indexOf("between")>-1||h.indexOf("null")>-1||h.indexOf("empty")>-1)&&h.indexOf("contains")<0)l=c?this.datePredicate(s[d],r,l,e.condition):this.arrayPredicate(s[d],l,e.condition);else if("and"===e.condition){var g=r;l&&""!==g?l=l.and(s[d].field,s[d].operator,r,a):""!==g&&(l=new n.Predicate(s[d].field,s[d].operator,r,a))}else{g=r;l&&""!==g?l=l.or(s[d].field,s[d].operator,r,a):""!==g&&(l=new n.Predicate(s[d].field,s[d].operator,r,a))}}}}return this.dataSource instanceof n.DataManager&&(t.isNullOrUndefined(l)||"isnull"!==l.operator&&"isnotnull"!==l.operator||(l.operator="isnull"===l.operator?"equal":"notequal")),l},h.prototype.getLocale=function(){var e=this.locale;return t.getValue("main."+this.locale+".dates.calendars.gregorian.days.format.short",t.cldrData)||(e="en"),e},h.prototype.getColumn=function(e,t){for(var l,i=this.columns,n=0,r=(i=t||i).length;n<r;n++){if(i[n].field===e){l=i[n];break}if(i[n].columns){if(l=this.getColumn(e,i[n].columns))break}else if(e&&e.indexOf(this.separator)>-1&&""!==this.separator&&i[n].field===e.split(this.separator)[0]){l=i[n];break}}return l},h.prototype.getOperators=function(e){return this.getColumn(e).operators},h.prototype.setTime=function(e,t){return t?e.setHours(0,0,0):e.setHours(23,59,59),e},h.prototype.datePredicate=function(e,t,l,i){var r,o=this.setTime(new Date(t.getTime()),!0),s=this.setTime(t);switch(e.operator){case"equal":r=(r=new n.Predicate(e.field,"greaterthanorequal",o)).and(e.field,"lessthanorequal",s);break;case"notequal":r=(r=new n.Predicate(e.field,"lessthan",o)).or(e.field,"greaterthan",s);break;case"greaterthan":r=new n.Predicate(e.field,"greaterthan",s);break;case"greaterthanorequal":r=new n.Predicate(e.field,"greaterthanorequal",o);break;case"lessthan":r=new n.Predicate(e.field,"lessthan",o);break;case"lessthanorequal":r=new n.Predicate(e.field,"lessthanorequal",s)}return r&&(l?"and"===i?l=l.and(r):"or"===i&&(l=l.or(r)):l=r),l},h.prototype.arrayPredicate=function(e,t,l){var i,r=e.value,o=e.operator.toString(),s=e.value,a=this.getColumn(e.field),u=this.getFormat(a.format);if(o.indexOf("null")>-1||o.indexOf("empty")>-1)switch(o){case"isnull":i=new n.Predicate(e.field,"isnull",s);break;case"isnotnull":i=new n.Predicate(e.field,"isnotnull",s);break;case"isempty":i=new n.Predicate(e.field,"equal","");break;case"isnotempty":i=new n.Predicate(e.field,"notequal","")}if(!(o.indexOf("null")>-1||o.indexOf("empty")>-1))for(var d=0,p=r.length;d<p;d++)if(""!==r[d]||("in"===o||"notin"===o)&&"string"===a.type)if(0===d){var h="greaterthanorequal";switch(o){case"between":i="date"!==a.type?new n.Predicate(e.field,h,r[d]):new n.Predicate(e.field,h,r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u),!0):null);break;case"notbetween":i="date"===a.type?new n.Predicate(e.field,"lessthan",r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u),!0):null):new n.Predicate(e.field,"lessthan",r[d]);break;case"in":i=new n.Predicate(e.field,"equal",r[d]);break;case"notin":i=new n.Predicate(e.field,"notequal",r[d])}}else{switch(e.operator){case"between":i="date"===a.type?i.and(e.field,"lessthanorequal",r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u)):r[d]):i.and(e.field,"lessthanorequal",r[d]);break;case"notbetween":i="date"===a.type?i.or(e.field,"greaterthan",r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u)):r[d]):i.or(e.field,"greaterthan",r[d]);break;case"in":i=i.or(e.field,"equal",r[d]);break;case"notin":i=i.and(e.field,"notequal",r[d])}}return i&&(t?"and"===l?t=t.and(i):"or"===l&&(t=t.or(i)):t=i),t},h.prototype.getDate=function(e,t){var l=this.intl.parseDate(e,t);return e.indexOf(":")>-1&&e.indexOf("/")<0&&e.indexOf(",")<0&&e.indexOf("-")<0&&((l=new Date).setHours(parseInt(e.split(":")[0])),l.setMinutes(parseInt(e.split(":")[1])),e.split(":")[2]&&l.setSeconds(parseInt(e.split(":")[2]))),l},h.prototype.isTime=function(e){return!!(e&&e.indexOf(":")>-1)},h.prototype.importRules=function(e,l,i,n,r){if(i){if(e.rules.length>1&&!this.headerTemplate){var o=l.querySelector(".e-btngroup-or"),s=l.querySelector(".e-btngroup-and");o.disabled=!1,s.disabled=!1,"or"===e.condition?o.checked=!0:s.checked=!0}else this.disableRuleCondition(l);if(this.headerTemplate&&r&&(l=this.renderGroup(e,e.condition,this.element,e.not,r)),this.enableNotCondition&&!this.headerTemplate){var a=l.querySelector(".e-qb-toggle");e.not?t.addClass([a],"e-active-toggle"):t.removeClass([a],"e-active-toggle")}}else l=this.renderGroup(e,e.condition,l,n);0===e.rules.length&&this.headerTemplate&&(e.rules[0]={label:"",field:"",operator:"",type:"",value:""});var u=e.rules;if(!t.isNullOrUndefined(u))for(var d=0,p=u.length;d<p;d++){var h=Object.keys(u[d]);!t.isNullOrUndefined(u[d].rules)&&h.indexOf("rules")>-1&&0!==u[d].rules.length?(l=this.renderGroup(u[d],u[d].condition,l,u[d].not),l=this.importRules(u[d],l,!0)):this.renderRule(u[d],l)}return(l=t.closest(l,".e-rule-list"))&&(l=t.closest(l,".e-group-container")),l},h.prototype.renderGroup=function(e,t,l,i,n){this.addGroupElement(!0,l,t,!1,i,n,e);var r=l.querySelectorAll(".e-group-container");return r[r.length-1]},h.prototype.renderRule=function(e,t){t.className.indexOf("e-group-container")>-1?this.addRuleElement(t,e):this.addRuleElement(t.querySelector(".e-group-container"),e)},h.prototype.enableReadonly=function(){for(var e=this.element.querySelectorAll(".e-dropdownlist, .e-dropdowntree, .e-numerictextbox, .e-textbox, .e-datepicker, .e-multiselect .e-lib, .e-radio"),n=0;n<e.length;n++)if(e[n].classList.contains("e-dropdownlist")){t.getInstance(e[n],i.DropDownList).readonly=this.isReadonly}else if(e[n].classList.contains("e-dropdowntree")){t.getComponent(e[n],"dropdowntree").readonly=this.isReadonly}else if(e[n].classList.contains("e-numerictextbox")){t.getInstance(e[n],r.NumericTextBox).readonly=this.isReadonly}else if(e[n].classList.contains("e-textbox")){t.getInstance(e[n],r.TextBox).readonly=this.isReadonly}else if(e[n].classList.contains("e-datepicker")){t.getInstance(e[n],o.DatePicker).readonly=this.isReadonly}else if(e[n].classList.contains("e-multiselect")){t.getInstance(e[n],i.MultiSelect).readonly=this.isReadonly}else if(e[n].classList.contains("e-radio")){t.getInstance(e[n],l.RadioButton).checked||(this.isReadonly?e[n].parentElement.style.display="none":e[n].parentElement.style.display="inherit")}var s=this.element.querySelectorAll(".e-deletegroup"),a=this.element.querySelectorAll(".e-addrulegroup"),u=this.element.querySelectorAll(".e-removerule");!this.isReadonly&&this.ruleElem.classList.contains("e-readonly")&&this.ruleElem.classList.remove("e-readonly");var d=[s,a,u];for(n=0;n<d.length;n++)d[n].forEach(function(e){e.classList.contains("e-readonly")?e.classList.remove("e-readonly"):e.classList.add("e-readonly")});this.enableBtnGroup()},h.prototype.enableBtnGroup=function(){var e=this,t=!1;this.element.querySelectorAll(".e-btngroup-and-lbl, .e-btngroup-or-lbl, .e-qb-toggle").forEach(function(l){!l.classList.contains("e-qb-toggle")||l.classList.contains("e-active-toggle")||l.classList.contains("e-readonly")?l.classList.contains("e-qb-toggle")&&l.classList.contains("e-not-readonly")?l.classList.remove("e-not-readonly"):l.classList.contains("e-qb-toggle")&&l.classList.contains("e-readonly")?l.classList.remove("e-readonly"):l.classList.contains("e-active-toggle")?(l.classList.add("e-not-readonly"),t=!0):l.previousElementSibling.checked||l.classList.contains("e-readonly")?(l.classList.remove("e-readonly"),t?"AND"===l.textContent?l.classList.add("e-readonly-and"):l.classList.add("e-readonly-or"):("AND"===l.textContent&&e.isReadonly?(l.classList.remove("e-not"),l.classList.add("e-readonly-and")):(e.enableNotCondition&&l.classList.add("e-not"),l.classList.remove("e-readonly-and")),"OR"===l.textContent&&e.isReadonly?l.classList.add("e-readonly-or-not"):l.classList.remove("e-readonly-or-not"))):l.classList.contains("e-btn-disable")||l.classList.add("e-readonly"):(l.classList.add("e-readonly"),t=!1)})},h.prototype.isDateFunction=function(e){for(var t=["date","time","day","week","month","year","hour","minute","second","now","quarter","period","extract"],l=0,i=t.length;l<i;l++)if(e.toLowerCase().indexOf(t[l])>-1)return!0;return!1},h.prototype.getSqlString=function(e,t,l,i){var n=!1;l||""===l?l+="(":(l="",n=!0);var r=e.condition;if(e.not){l+=n?i?this.l10n.getConstant("NOT").toUpperCase()+" (":"NOT (":i?" "+this.l10n.getConstant("NOT").toUpperCase()+" (":" NOT ("}if(e.rules)for(var o=0,s=e.rules.length;o<s;o++){if(e.rules[o].rules)l=this.getSqlString(e.rules[o],t,l,i);else{var a=e.rules[o],u="",d=i?this.sqlOperators[a.operator]:this.operators[a.operator];if(a.value instanceof Array)if(a.operator.toString().indexOf("between")>-1){var p=i?" "+this.l10n.getConstant("AND").toUpperCase()+" ":" AND ";"date"!==a.type||this.isDateFunction(a.value[0])?u+=a.value[0]+p+a.value[1]:u+='"'+a.value[0]+'"'+p+'"'+a.value[1]+'"'}else if("string"==typeof a.value[0]&&null!==a.value){u+='("'+a.value[0]+'"';for(var h=1,c=a.value.length;h<c;h++)u+=',"'+a.value[h]+'"';u+=")"}else u+="("+a.value+")";else a.operator.toString().indexOf("startswith")>-1?u+=a.value?'("'+a.value+'%")':"("+a.value+")":a.operator.toString().indexOf("endswith")>-1?u+=a.value?'("%'+a.value+'")':"("+a.value+")":a.operator.toString().indexOf("contains")>-1?u+=a.value?'("%'+a.value+'%")':"("+a.value+")":"number"===a.type||"boolean"==typeof a.value||null===a.value?u+=a.value:u+='"'+a.value+'"';a.operator.toString().indexOf("null")>-1||a.operator.toString().indexOf("empty")>-1?(t?a.field="`"+a.field+"`":a.field.indexOf(" ")>-1&&(a.field='"'+a.field+'"'),l+=a.field+" "+d):(t?a.field="`"+a.field+"`":a.field.indexOf(" ")>-1&&(a.field='"'+a.field+'"'),l+=a.field+" "+d+" "+u),a.condition&&""!==a.condition&&(r=a.condition)}if(o!==s-1){a=e.rules[o];(""===r||a&&""!==a.condition&&a.custom&&a.custom.isCustom)&&(r=a.condition),l+=" "+(r=i?this.l10n.getConstant(r.toUpperCase()).toUpperCase():r.toUpperCase())+" "}}return n||(l+=")"),e.not&&(l+=")"),l},h.prototype.setRulesFromSql=function(e,t){e=e.replace(/`/g,"");var l=this.getRulesFromSql(e,t);this.setRules({condition:l.condition,not:l.not,rules:l.rules})},h.prototype.getRulesFromSql=function(e,t){this.parser=[],this.sqlParser(e,t),this.setProperties({rule:{condition:"and",not:!1,rules:[]}},!0);var l=this.processParser(this.parser,this.rule,[0],t);return this.enableNotCondition?{condition:l.condition,not:l.not,rules:l.rules}:{condition:l.condition,rules:l.rules}},h.prototype.getSqlFromRules=function(e,t,l){return e||(e=this.getValidRules()),e=this.getRuleCollection(e,!1),this.getSqlString(this.getValidRules(e),t,null,l).replace(/"/g,"'")},h.prototype.sqlParser=function(e,t){var l,i=0;do{l=e.slice(i),i+=this.parseSqlStrings(l,t)}while(""!==l);return this.parser},h.prototype.parseSqlStrings=function(e,t){var l,i=["=","!=","<=",">=","<",">"];l=t?[this.l10n.getConstant("AND").toUpperCase(),this.l10n.getConstant("OR").toUpperCase(),this.l10n.getConstant("NOT").toUpperCase()]:["AND","OR","NOT"];var n;n=t?[this.l10n.getConstant("In").toUpperCase(),this.l10n.getConstant("NotIn").toUpperCase(),this.l10n.getConstant("Like").toUpperCase(),this.l10n.getConstant("NotLike").toUpperCase(),this.l10n.getConstant("Between").toUpperCase(),this.l10n.getConstant("NotBetween").toUpperCase(),this.l10n.getConstant("IsNull").toUpperCase(),this.l10n.getConstant("IsNotNull").toUpperCase(),this.l10n.getConstant("IsEmpty").toUpperCase(),this.l10n.getConstant("IsNotEmpty").toUpperCase()]:["IN","NOT IN","LIKE","NOT LIKE","BETWEEN","NOT BETWEEN","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"];for(var r,o,s=0,a=i.length;s<a;s++)if(r=/^\w+$/.test(i[s])?"\\b":"",new RegExp("^("+i[s]+")"+r,"ig").exec(e))return this.parser.push(["Operators",i[s].toLowerCase()]),i[s].length;var u=this.parser[this.parser.length-1];if(!u||u&&"Literal"!==u[0])for(s=0,a=l.length;s<a;s++)if(r=/^\w+$/.test(l[s])?"\\b":"",new RegExp("^("+l[s]+")"+r,"ig").exec(e))return this.parser.push(["Conditions",l[s].toLowerCase()]),l[s].length;for(s=0,a=n.length;s<a;s++)if(r=/^\w+$/.test(n[s])?"\\b":"",new RegExp("^("+n[s]+")"+r,"ig").exec(e))return this.parser.push(["SubOperators",n[s].toLowerCase()]),n[s].length;if(/^\(/.exec(e))return this.parser.push(["Left","("]),1;if(/^\)/.exec(e))return this.parser.push(["Right",")"]),1;if(/^(true|false)/.exec(e))return o=/^(true|false)/.exec(e)[0],this.parser.push(["String",o]),o.length;if(/^null/.exec(e))return o=/^null/.exec(e)[0],this.parser.push(["String",null]),o.length;if(/^`?([a-z_][a-z0-9_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(e))return o=/^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(e)[1],this.parser.push(["Literal",o]),o.length;if(this.checkLiteral()&&/^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(e))return o=/^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(e)[1],this.parser.push(["Literal",o]),o.length+2;if(this.checkNumberLiteral(e,t))return o=/^[0-9]+(\.[0-9]+)?/.exec(e)[0],this.parser.push(["Literal",o]),o.length;if(/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(e)){if("("===(o=/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(e)[0])[o.length-2])for(var d=!1,p=o.length;p<e.length&&(o+=e[p],")"===e[p]&&(d=!0),!d||"'"!==e[p]);p++);return this.parser.push(["String",o]),o.length}return/^"([^\\"]*(?:\\.[^\\"]*)*)"/.exec(e)?(o=/^"([^\\"]*(?:\\.[^\\"]*)*)"/.exec(e)[0],this.parser.push(["DoubleString",o]),o.length):/^[0-9]+(\.[0-9]+)?/.exec(e)?(o=/^[0-9]+(\.[0-9]+)?/.exec(e)[0],this.parser.push(["Number",o]),o.length):/^-?[0-9]+(\.[0-9]+)?/.exec(e)?(o=/^-?[0-9]+(\.[0-9]+)?/.exec(e)[0],this.parser.push(["Number",o]),o.length):1},h.prototype.checkLiteral=function(){var e=this.parser[this.parser.length-1];if(!e)return!0;var t=this.parser[this.parser.length-2],l=this.parser[this.parser.length-3];if("Left"===e[0]&&t&&"Conditions"===t[0])return!0;return!!("Conditions"===e[0]&&l&&l[1].indexOf("between")<0)},h.prototype.checkNumberLiteral=function(e,t){var l=this.parser[this.parser.length-1];if(!l)return!0;if(/^[0-9]+(\.[0-9]+)?/.exec(e)){var i=this.parser[this.parser.length-2],n=this.parser[this.parser.length-3];if("Left"===l[0]&&i&&"Conditions"===i[0])return!0;var r=t?this.l10n.getConstant("Between").toLowerCase():"between";if("Conditions"===l[0]&&n&&n[1].indexOf(r)<0)return!0}return!1},h.prototype.getOperator=function(e,t,l){if(l){for(var i=Object.keys(this.sqlOperators),n=0;n<i.length;n++)if(this.sqlOperators[i[n]]===t.toUpperCase())return e&&0===e.indexOf("%")&&"%"===e[e.length-1]?"notcontains"===i[n]?"notcontains":"contains":e&&0!==e.indexOf("%")&&e.indexOf("%")===e.length-1?"notstartswith"===i[n]?"notstartswith":"startswith":e&&0===e.indexOf("%")&&e.indexOf("%")!==e.length-1?"notendswith"===i[n]?"notendswith":"endswith":i[n];return null}if(e){if(0===e.indexOf("%")&&"%"===e[e.length-1])return"not like"===t?"notcontains":"contains";if(0!==e.indexOf("%")&&e.indexOf("%")===e.length-1)return"not like"===t?"notstartswith":"startswith";if(0===e.indexOf("%")&&e.indexOf("%")!==e.length-1)return"not like"===t?"notendswith":"endswith"}else{if("not like"===t)return"notequal";if("like"===t)return"equal"}return{"=":"equal","!=":"notequal","<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal",in:"in","not in":"notin",between:"between","not between":"notbetween","is empty":"isempty","is null":"isnull","is not null":"isnotnull","is not empty":"isnotempty"}[""+t]},h.prototype.getTypeFromColumn=function(e){var l=this.getColumn(e.field);return t.isNullOrUndefined(l)?null:l.type},h.prototype.getLabelFromColumn=function(e){var t="",l=0;if(""!==this.separator){for(var i=e.split(this.separator),n=0;n<i.length;n++)t+=this.getLabelFromField(i,n+1),++l<i.length&&(t+=this.separator);return t}return this.getColumn(e).label},h.prototype.getLabelFromField=function(e,t){for(var l="",i=0,n=0;n<t;n++)l+=e[n],++i<t&&(l+=this.separator);return this.getColumn(l).label},h.prototype.processParser=function(e,t,l,i){for(var n,r,o,s,a,u,d,p,h,c,m=[],f=[],g=!1,v=0,y=e.length;v<y;v++)if("Literal"===e[v][0]){var C=this.getColumn(e[v][1]);if(o={label:C&&C.label?C.label:e[v][1],field:e[v][1]},"SubOperators"===e[v+1][0]){if(e[v+1][1].indexOf("null")>-1||e[v+1][1].indexOf("empty")>-1)o.operator=this.getOperator(" ",e[v+1][1],i),o.value=null,o.type=this.getTypeFromColumn(o);else{var b=e[v+3][1]?e[v+3][1].replace(/'/g,""):e[v+3][1];o.operator=this.getOperator(b,e[v+1][1],i)}for(c=e[v+1][1],n=++v+1,r=y,i&&"contains"===o.operator||"startswith"===o.operator||"endswith"===o.operator?c="like":i&&"notcontains"===o.operator||"notstartswith"===o.operator||"notendswith"===o.operator?c="not like":i&&(c=o.operator),n=v+1;n<r;n++)if(c.indexOf("between")<0&&"Left"===e[n][0])g=!0;else{if("Right"===e[n][0]&&g){v=n,g=!1;break}if(c.indexOf("null")>-1||c.indexOf("empty")>-1)break;if(c.indexOf("like")>-1&&"String"===e[n][0]){var S=e[n][1];e[n][1]&&"'"===e[n][1][0]&&(S=e[n][1].substring(1,e[n][1].length-1)),S=S?S.replace(/%/g,""):e[n][1],o.value=S,o.type="string"}else if(c.indexOf("between")>-1){if("Literal"===e[n][0]||"Left"===e[n][0])break;if("Number"===e[n][0])m.push(Number(e[n][1]));else if("String"===e[n][0]){S=e[n][1];e[n][1]&&"'"===e[n][1][0]&&(S=e[n][1].substring(1,e[n][1].length-1)),f.push(S)}}else if("Number"===e[n][0])m.push(Number(e[n][1]));else if("String"===e[n][0]){S=e[n][1];e[n][1]&&"'"===e[n][1][0]&&(S=e[n][1].substring(1,e[n][1].length-1)),f.push(S)}o.type=this.getTypeFromColumn(o)}c.indexOf("like")<0&&("Number"===e[n-1][0]?(o.value=m,o.type="number"):"String"===e[n-1][0]?(o.value=f,o.type="string"):c.indexOf("between")>-1&&"Conditions"===e[n-1][0]&&(0!==f.length?(o.value=f,o.type="string"):(o.value=m,o.type="number")),m=[],f=[],o.type=this.getTypeFromColumn(o))}else"Operators"===e[v+1][0]&&(o.operator=this.getOperator(e[v+2][1],e[v+1][1],i),"Number"===e[v+2][0]?(o.type="number",o.value=Number(e[v+2][1])):(o.type="string",o.value=e[v+2][1]?e[v+2][1].replace(/'/g,""):e[v+2][1]),o.type=this.getTypeFromColumn(o));t.rules.push(o)}else{if("Left"===e[v][0]){if("Left"!==e[0][0]&&("not"===e[v-1][1]||i&&this.l10n.getConstant("NOT").toLowerCase()===e[v-1][1]))continue;for(this.parser=e.splice(v+1,y-(v+1)),s=this.enableNotCondition?{condition:"and",rules:[],not:!1}:{condition:"and",rules:[]},h=0,u=t.rules.length,a=0;a<u;a++)t.rules[a].rules&&h++;return l.push(h),t.rules.push(s),s=this.processParser(this.parser,s,l,i),t}if("Conditions"===e[v][0])"not"===e[v][1]||i&&this.l10n.getConstant("NOT").toLowerCase()===e[v][1]?t.not=!0:t.condition=e[v][1];else if("Right"===e[v][0]){for(this.parser=e.splice(v+1,y-(v+1)),l.pop(),t=this.rule,p=l.length,d=0;d<p;d++)t=this.findGroupByIdx(l[d],t,0===d);return this.processParser(this.parser,t,l,i)}}return t},p([t.Event()],h.prototype,"created",void 0),p([t.Event()],h.prototype,"actionBegin",void 0),p([t.Event()],h.prototype,"beforeChange",void 0),p([t.Event()],h.prototype,"change",void 0),p([t.Event()],h.prototype,"dataBound",void 0),p([t.Event()],h.prototype,"ruleChange",void 0),p([t.Property({ruleDelete:!0,groupInsert:!0,groupDelete:!0})],h.prototype,"showButtons",void 0),p([t.Property(!1)],h.prototype,"summaryView",void 0),p([t.Property(!1)],h.prototype,"allowValidation",void 0),p([t.Property("Default")],h.prototype,"fieldMode",void 0),p([t.Property([])],h.prototype,"columns",void 0),p([t.Property(null)],h.prototype,"fieldModel",void 0),p([t.Property(null)],h.prototype,"operatorModel",void 0),p([t.Property(null)],h.prototype,"valueModel",void 0),p([t.Property()],h.prototype,"headerTemplate",void 0),p([t.Property("")],h.prototype,"cssClass",void 0),p([t.Property([])],h.prototype,"dataSource",void 0),p([t.Property("Horizontal")],h.prototype,"displayMode",void 0),p([t.Property(!1)],h.prototype,"enablePersistence",void 0),p([t.Property("Default")],h.prototype,"sortDirection",void 0),p([t.Property(5)],h.prototype,"maxGroupCount",void 0),p([t.Property("auto")],h.prototype,"height",void 0),p([t.Property("auto")],h.prototype,"width",void 0),p([t.Property(!1)],h.prototype,"matchCase",void 0),p([t.Property(0)],h.prototype,"immediateModeDelay",void 0),p([t.Property(!1)],h.prototype,"enableNotCondition",void 0),p([t.Property(!1)],h.prototype,"readonly",void 0),p([t.Property("")],h.prototype,"separator",void 0),p([t.Complex({condition:"and",rules:[]},c)],h.prototype,"rule",void 0),h=p([t.NotifyPropertyChanges],h)}(t.Component);e.Columns=h,e.Rule=c,e.Value=m,e.ShowButtons=f,e.QueryBuilder=g,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-buttons","@syncfusion/ej2-dropdowns","@syncfusion/ej2-data","@syncfusion/ej2-inputs","@syncfusion/ej2-calendars","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-popups"],t):t(e.ej={},e.ej2Base,e.ej2Buttons,e.ej2Dropdowns,e.ej2Data,e.ej2Inputs,e.ej2Calendars,e.ej2Splitbuttons,e.ej2Popups)}(this,function(e,t,l,i,n,r,o,s,a){"use strict";var u=function(){var e=function(t,l){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(t,l)};return function(t,l){function i(){this.constructor=t}e(t,l),t.prototype=null===l?Object.create(l):(i.prototype=l.prototype,new i)}}(),d=function(){return(d=Object.assign||function(e){for(var t,l=1,i=arguments.length;l<i;l++){t=arguments[l];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},p=function(e,t,l,i){var n,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,l):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,l,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(t,l,o):n(t,l))||o);return r>3&&o&&Object.defineProperty(t,l,o),o},h=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(null)],l.prototype,"field",void 0),p([t.Property(null)],l.prototype,"label",void 0),p([t.Property(null)],l.prototype,"type",void 0),p([t.Property(null)],l.prototype,"values",void 0),p([t.Property(null)],l.prototype,"operators",void 0),p([t.Property()],l.prototype,"ruleTemplate",void 0),p([t.Property(null)],l.prototype,"template",void 0),p([t.Property({isRequired:!0,min:0,max:Number.MAX_VALUE})],l.prototype,"validation",void 0),p([t.Property(null)],l.prototype,"format",void 0),p([t.Property(null)],l.prototype,"step",void 0),p([t.Property(null)],l.prototype,"value",void 0),p([t.Property(null)],l.prototype,"category",void 0),p([t.Property(null)],l.prototype,"columns",void 0),l}(t.ChildProperty),c=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(null)],l.prototype,"condition",void 0),p([t.Collection([],l)],l.prototype,"rules",void 0),p([t.Property(null)],l.prototype,"field",void 0),p([t.Property(null)],l.prototype,"label",void 0),p([t.Property(null)],l.prototype,"type",void 0),p([t.Property(null)],l.prototype,"operator",void 0),p([t.Property(null)],l.prototype,"value",void 0),p([t.Property(!1)],l.prototype,"not",void 0),l}(t.ChildProperty),m=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(null)],l.prototype,"numericTextBoxModel",void 0),p([t.Property(null)],l.prototype,"multiSelectModel",void 0),p([t.Property(null)],l.prototype,"datePickerModel",void 0),p([t.Property(null)],l.prototype,"textBoxModel",void 0),p([t.Property(null)],l.prototype,"radioButtonModel",void 0),l}(t.ChildProperty),f=function(e){function l(){return null!==e&&e.apply(this,arguments)||this}return u(l,e),p([t.Property(!0)],l.prototype,"ruleDelete",void 0),p([t.Property(!0)],l.prototype,"groupInsert",void 0),p([t.Property(!0)],l.prototype,"groupDelete",void 0),l}(t.ChildProperty),g=function(e){function h(t,l){var n=e.call(this,t,l)||this;return n.isReadonly=!0,n.fields={text:"label",value:"field"},n.updatedRule={not:!1,condition:"and"},n.isLocale=!1,n.isRefreshed=!1,n.isNotified=!1,n.isAddSuccess=!1,n.isNotValueChange=!1,n.isFieldChange=!1,n.isFieldClose=!1,n.isDestroy=!1,n.isGetNestedData=!1,n.isCustomOprCols=[],i.MultiSelect.Inject(i.CheckBoxSelection),n}return u(h,e),h.prototype.getPersistData=function(){return this.addOnPersist(["rule"])},h.prototype.reset=function(){this.isImportRules=!1;for(var e=this.element.querySelector(".e-group-body"),l=this.element.querySelectorAll("input.e-control"),i=0,n=l.length;i<n;i++)l[i].className.indexOf("e-tooltip")>-1?t.getComponent(l[i],"tooltip").destroy():l[i].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(l[i].parentElement,"tooltip").destroy();if(e)e.innerHTML="";else{var r=this.createElement("div",{attrs:{class:"e-group-container"}}),o=this.createElement("div",{attrs:{class:"e-group-header"}}),s=this.createElement("div",{attrs:{class:"e-group-body"}});r.appendChild(o).appendChild(s),this.element.appendChild(r),e=this.element.querySelector(".e-group-body")}this.headerTemplate&&this.isRoot&&(this.element.innerHTML="",this.isRoot=!1),this.enableNotCondition&&t.removeClass(this.element.querySelectorAll(".e-qb-toggle"),"e-active-toggle"),e.appendChild(this.createElement("div",{attrs:{class:"e-rule-list"}})),this.levelColl[this.element.id+"_group0"]=[0],this.setProperties({rule:{condition:"and",not:!1,rules:[]}},!0),this.disableRuleCondition(e.parentElement)},h.prototype.getWrapper=function(){return this.element},h.prototype.getModuleName=function(){return"query-builder"},h.prototype.GetRootColumnName=function(e){return this.separator?e.split(this.separator)[0]:e},h.prototype.initialize=function(){if(this.dataColl.length){var e=Object.keys(this.dataColl[0]),t=[],l=[],i=void 0,n=!1,r=!1,o=void 0,s={isRequired:!0,min:0,max:Number.MAX_VALUE};if(this.columns.length){this.columnSort();for(var a=0,u=(d=this.columns).length;a<u;a++)this.updateCustomOperator(d[a],"initial"),d[a].type||(e.indexOf(d[a].field)>-1&&("string"===(i=typeof(o=this.dataColl[0][d[a].field]))?r=!isNaN(Date.parse(o)):"object"===i&&(r=o instanceof Date&&!isNaN(o.getTime()),i="string"),d[a].type=i,r=!1),i="string"),d[a].validation||(d[a].validation=s),d[a].category?n=!0:d[a].category=this.l10n.getConstant("OtherFields"),l.indexOf(d[a].category)<0&&l.push(d[a].category),(!d[a].operators||this.isLocale&&0!==this.isCustomOprCols.indexOf(d[a].field))&&(d[a].operators=this.customOperators[d[a].type+"Operator"]);n&&(l.length>1||l[0]!==this.l10n.getConstant("OtherFields"))&&(this.fields={text:"label",value:"field",groupBy:"category"}),this.updateSubFieldsFromColumns(this.columns)}else{for(a=0,u=e.length;a<u;a++)"string"===(i=typeof(o=this.dataColl[0][e[a]]))?r=!isNaN(Date.parse(o)):"object"!==i||Object.keys(o).length||(r=o instanceof Date&&!isNaN(o.getTime()),i="string"),t[a]={field:e[a],label:e[a],type:r?"date":i,validation:s},r=!1,t[a].operators=this.customOperators[t[a].type+"Operator"],"object"===i&&this.updateSubFields(o,t[a]);this.columns=t}}else if(this.columns.length){var d;for(a=0,u=(d=this.columns).length;a<u;a++)d[a].category?this.fields={text:"label",value:"field",groupBy:"category"}:d[a].category=this.l10n.getConstant("OtherFields"),this.updateCustomOperator(d[a]),d[a].operators&&!this.isLocale||(d[a].operators=this.customOperators[d[a].type+"Operator"]);this.updateSubFieldsFromColumns(this.columns)}this.trigger("dataBound",{type:"dataBound"})},h.prototype.updateSubFieldsFromColumns=function(e,t){for(var l=0;l<e.length;l++)""!==this.separator&&e[l].field.indexOf(this.separator)<0&&(e[l].field=t?t+this.separator+e[l].field:e[l].field),e[l].operators?this.updateCustomOperator(e[l]):e[l].type&&"object"!==e[l].type&&(e[l].operators=this.customOperators[e[l].type+"Operator"]),e[l].columns&&(e[l].type="object",this.updateSubFieldsFromColumns(e[l].columns,e[l].field))},h.prototype.updateSubFields=function(e,t,l){var i;t.columns=[];var n,r,o=Object.keys(e);l=l||this.dataColl[0];for(var s=0,a=o.length;s<a;s++){var u=t.field.split(".");r=l?l[u[u.length-1]][o[s]]:this.dataColl[0][t.field][o[s]];var d=l[t.field.split(this.separator)[t.field.split(this.separator).length-1]];n=typeof r,i={field:t.field+this.separator+o[s],label:o[s],type:n="object"!==n||isNaN(Date.parse(r))?n:"date"},"object"!==n&&(i.operators=this.customOperators[n+"Operator"]),t.columns.push(i),"object"===n&&this.updateSubFields(r,i,d)}},h.prototype.updateCustomOperator=function(e,l){if(e.operators){this.isLocale||"initial"!==l||t.isNullOrUndefined(this.isCustomOprCols)||this.isCustomOprCols.push(e.field);for(var i=function(t){var l=Object.keys(e.operators[t]).indexOf("sqlOperator");if(l>-1){var i=e.operators[t],r=Object.keys(i),o=r.map(function(e){return i[""+e]}).join(",").split(","),s=r.indexOf("value");n.operators[o[s]]=o[l]}},n=this,r=0;r<e.operators.length;r++)i(r)}},h.prototype.focusEventHandler=function(e){this.target=e.target},h.prototype.clickEventHandler=function(e){var l,i=this,n=e.target;this.isImportRules=!1;var r;if("SPAN"===n.tagName&&(n=n.parentElement),n.className.indexOf("e-collapse-rule")>-1){var o=new t.Animation({duration:1e3,delay:0});this.element.querySelectorAll(".e-summary-content").length<1&&this.renderSummary();var s=document.getElementById(this.element.id+"_summary_content"),a=s.querySelector(".e-summary-text");o.animate(".e-query-builder",{name:"SlideLeftIn"});(d=this.element.querySelector(".e-group-container")).style.display="none",a.textContent=this.getSqlFromRules(this.rule),s.style.display="block",a.style.height=a.scrollHeight+"px"}if("BUTTON"===n.tagName&&n.className.indexOf("e-qb-toggle")<0){if(n.className.indexOf("e-removerule")>-1)this.actionButton=n,this.deleteRule(n);else if(n.className.indexOf("e-deletegroup")>-1)this.actionButton=n,this.deleteGroup(t.closest(n,".e-group-container"));else if(n.className.indexOf("e-edit-rule")>-1){if((o=new t.Animation({duration:1e3,delay:0})).animate(".e-query-builder",{name:"SlideLeftIn"}),document.getElementById(this.element.id+"_summary_content").style.display="none",this.element.querySelectorAll(".e-group-container").length<1){this.addGroupElement(!1,this.element,this.rule.condition,!1,this.rule.not);var u=t.extend({},this.rule,{},!0);this.setGroupRules(u),this.renderSummaryCollapse()}else{var d;(d=this.element.querySelector(".e-group-container")).querySelectorAll(".e-collapse-rule").length<1&&this.renderSummaryCollapse(),d.style.display="block"}}}else if("LABEL"===n.tagName&&n.parentElement.className.indexOf("e-btn-group")>-1||n.className.indexOf("e-qb-toggle")>-1){var p=t.closest(n,".e-group-container");if(!this.headerTemplate){var h=n.getAttribute("for"),c=void 0;h&&(c=document.getElementById(h).getAttribute("value")),r=p.id.replace(this.element.id+"_","");var m=this.getGroup(r),f=void 0;if(this.enableNotCondition)if(n.className.indexOf("e-qb-toggle")>-1){var g=p.getElementsByClassName("e-qb-toggle")[0];g.className.indexOf("e-active-toggle")>-1?(t.removeClass([g],"e-active-toggle"),f=!1):(t.addClass([g],"e-active-toggle"),f=!0),c=m.condition}else f=m.not;l={groupID:r,cancel:!1,type:"condition",value:c.toLowerCase()},this.enableNotCondition&&(l={groupID:r,cancel:!1,type:"condition",value:c.toLowerCase(),not:f})}this.isImportRules?this.beforeSuccessCallBack(l,n):this.trigger("beforeChange",l,function(e){i.beforeSuccessCallBack(e,n)}),this.target=n}},h.prototype.beforeSuccessCallBack=function(e,l){if(!e.cancel){var i=t.closest(l,".e-group-container"),n=i.id.replace(this.element.id+"_",""),r=this.getValidRules(this.rule),o=this.getParentGroup(i);o.condition=e.value,this.enableNotCondition&&(o.not=e.not),this.isImportRules||this.trigger("change",{groupID:n,type:"condition",value:o.condition}),this.filterRules(r,this.getValidRules(this.rule),"condition")}},h.prototype.selectBtn=function(e,l){"beforeOpen"===l.name?this.showButtons.groupInsert||t.isNullOrUndefined(this.showButtons.groupInsert)?(this.element.querySelectorAll(".e-group-container").length>=this.maxGroupCount+1?t.addClass([l.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"):t.removeClass([l.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"),this.enableRtl&&t.addClass([l.element.querySelector("li").parentElement],"e-rtl")):t.addClass([l.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"):l.element.children[0].className.indexOf("e-addrule")>-1?this.addRuleElement(t.closest(e,".e-group-container"),{}):l.element.children[0].className.indexOf("e-addgroup")>-1&&this.addGroupElement(!0,t.closest(e,".e-group-container"),"",!0)},h.prototype.appendRuleElem=function(e,l,i,n,r,o){var s,a,u,d=e.querySelector(".e-rule-list");if("change"===i?s=t.select("#"+n,e):((s=this.createElement("div",{attrs:{class:"e-rule-container"}})).setAttribute("id",e.id+"_rule"+this.ruleIdCounter),d.appendChild(s),this.ruleIdCounter++),l&&l.ruleTemplate&&o){u={requestType:"template-initialize",ruleID:s.id,action:r,fields:this.fields,rule:o},this.trigger("actionBegin",u),this.ruleTemplateFn=this.templateParser(l.ruleTemplate);var p=this.element.id+l.field;if(u.fields=this.fields,u.columns=this.columns,""===o.field&&(o.field=l.field),u.operators=this.getOperators(o.field),u.operatorFields={text:"key",value:"value"},this.isReact)(a=this.ruleTemplateFn(u,this,s.id,p)[0]).className+=" e-rule-field",s.appendChild(a);else if(this.isAngular){var h=this.ruleTemplateFn(u,this,s.id,p);(a=3===h[0].nodeType?h[1]:h[0]).className+=" e-rule-field",s.appendChild(a)}else this.isVue3?(a=this.ruleTemplateFn(u,this,"Template",p),t.append(a,s),s.children[s.children.length-1].className+=" e-rule-field"):((a=this.ruleTemplateFn(u,this,"Template",p)[0]).className+=" e-rule-field",s.appendChild(a))}else a=this.ruleElem.querySelector(".e-rule-field").cloneNode(!0),s.appendChild(a);return l&&l.ruleTemplate&&o&&this.renderReactTemplates(),s},h.prototype.addRuleElement=function(e,t,l,i,n,r){var o=this;if(e){var s={groupID:e.id.replace(this.element.id+"_",""),cancel:!1,type:"insertRule"};this.isImportRules||this.isInitialLoad?(this.isInitialLoad=!1,this.addRuleSuccessCallBack(s,e,t,l,i,n,r)):this.trigger("beforeChange",s,function(s){o.addRuleSuccessCallBack(s,e,t,l,i,n,r)})}},h.prototype.addRuleSuccessCallBack=function(e,l,n,r,o,s,a){var u,p,h,c,m=this.element.className.indexOf("e-device")>-1?"250px":"200px",f=n&&n.field?this.getColumn(n.field):r||this.columns[0],g={label:"",field:"",type:"",operator:""};if(!e.cancel){if(f&&f.ruleTemplate&&n.field){this.selectedColumn=f,p=this.selectedColumn.operators,g={label:f.label,field:f.field,type:f.type,operator:p[0].value};var v=Object.keys(n).length?n:g,y={requestType:"template-create",action:"insert-rule",ruleID:(c=this.appendRuleElem(l,f,o,s,"field",v)).id,fields:this.fields,rule:v};this.trigger("actionBegin",y)}else{(c=this.appendRuleElem(l,f,o,s,"field")).querySelector(".e-filter-input").setAttribute("id",c.id+"_filterkey");var C=c.querySelector("button");this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?(C.textContent=this.l10n.getConstant("Remove"),t.addClass([C],"e-flat"),t.addClass([C],"e-primary")):(t.addClass([C],"e-round"),t.addClass([C],"e-icon-btn"),C.setAttribute("title",this.l10n.getConstant("DeleteRule")),C=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-delete-icon"}}),c.querySelector("button").appendChild(C))}if("Vertical"===this.displayMode||this.element.className.indexOf("e-device")>-1?c.className="e-rule-container e-vertical-mode":c.className="e-rule-container e-horizontal-mode",c.previousElementSibling&&c.previousElementSibling.className.indexOf("e-rule-container")>-1&&(c.className.indexOf("e-joined-rule")<0&&(c.className+=" e-joined-rule"),c.previousElementSibling.className.indexOf("e-prev-joined-rule")<0&&(c.previousElementSibling.className+=" e-prev-joined-rule")),c.previousElementSibling&&c.previousElementSibling.className.indexOf("e-group-container")>-1&&c.className.indexOf("e-separate-rule")<0&&(c.className+=" e-separate-rule"),this.isImportRules||this.updateAddedRule(l,n,g,a,s),!f||f&&!f.ruleTemplate||!n.field)if("Default"===this.fieldMode){var b=void 0,S=void 0;S=this.separator&&n.field?this.GetRootColumnName(n.field):this.isImportRules?this.GetRootColumnName(n.field):n.field,b={dataSource:this.columns,fields:this.fields,placeholder:this.l10n.getConstant("SelectField"),popupHeight:this.columns.length>5?m:"auto",close:this.fieldClose.bind(this,c.id+"_filterkey"),change:this.changeField.bind(this),value:n?S:null,open:this.popupOpen.bind(this,!0)},this.fieldModel&&(b=d({},b,this.fieldModel)),(h=new i.DropDownList(b)).appendTo("#"+c.id+"_filterkey");var x=void 0;x=this.separator&&n.field?this.GetRootColumnName(n.field):this.isImportRules?this.GetRootColumnName(n.field):h.value,this.selectedColumn=h.getDataByValue(x),Object.keys(n).length&&this.changeRule(n,{element:h.element,itemData:this.selectedColumn})}else{b=void 0,S=(this.isImportRules,n.field);this.dummyDropdownTreeDs=t.extend([],this.columns,[],!0),this.updateDropdowntreeDS(this.dummyDropdownTreeDs),b={fields:{dataSource:this.dummyDropdownTreeDs,value:"field",text:"label",child:"columns",expanded:"expanded",selectable:"selectable"},placeholder:this.l10n.getConstant("SelectField"),showClearButton:!1,popupHeight:this.columns.length>5?m:"auto",changeOnBlur:!1,change:this.changeField.bind(this),value:t.isNullOrUndefined(S)?null:[S],open:this.popupOpen.bind(this,!1),treeSettings:{expandOn:"Click"},cssClass:"e-qb-ddt"},this.fieldModel&&(b=d({},b,this.fieldModel));var O=new i.DropDownTree(b);if(O.appendTo("#"+c.id+"_filterkey"),!t.isNullOrUndefined(O.value)){var w=this.getLabelFromColumn(O.value[0]);O.element.value=w}x=t.isNullOrUndefined(n.field)?O.value:this.GetRootColumnName(n.field);this.selectedColumn=this.getColumn(x),Object.keys(n).length&&this.changeRule(n,{element:O.element,itemData:this.selectedColumn})}u=c.id.replace(this.element.id+"_",""),this.isImportRules||this.trigger("change",{groupID:l.id.replace(this.element.id+"_",""),ruleID:u,type:"insertRule"})}},h.prototype.updateDropdowntreeDS=function(e){for(var t=0;t<e.length;t++)"object"===e[parseInt(t.toString(),10)].type&&(e[parseInt(t.toString(),10)].selectable=!1,this.updateDropdowntreeDS(e[parseInt(t.toString(),10)].columns))},h.prototype.updateAddedRule=function(e,l,i,n,r){var o,s,a,u=0;if(n){for(o=t.select("#"+r,e),s=t.closest(e,".e-group-container"),a=this.getParentGroup(s);o&&null!==o.previousElementSibling;)o=o.previousElementSibling,u++;a.rules[u]=l}else{s=t.closest(e,".e-group-container"),a=this.getParentGroup(s);var d=l.custom;Object.keys(l).length?(a.rules.push({field:l.field,type:l.type,label:l.label,operator:l.operator,value:l.value}),d&&(a.rules[a.rules.length-1].custom=d)):(d&&(i.custom=d),a.rules.push(i))}this.disableRuleCondition(e,a)},h.prototype.changeRuleTemplate=function(e,l){var i=this.selectedColumn.operators;if(!e.ruleTemplate){var n=t.closest(l,".e-group-container"),r=t.closest(l,".e-rule-container").id;if(this.previousColumn&&this.previousColumn.ruleTemplate&&(t.detach(l.closest('[id="'+r+'"]').querySelector(".e-rule-field")),this.clearQBTemplate([r])),e){var o={field:e.field,label:e.label,operator:i[0].value,value:""};this.addRuleElement(n,o,e,"change",r,!0)}}},h.prototype.renderToolTip=function(e){var t=new a.Tooltip({content:this.l10n.getConstant("ValidationMessage"),position:"BottomCenter",cssClass:"e-querybuilder-error",afterClose:function(){t.destroy()}});t.appendTo(e),t.open(e)},h.prototype.validateFields=function(){var e,l=!0;if(this.allowValidation){var i=["isnull","isnotnull","isempty","isnotempty"],n=void 0,r=void 0,o=void 0,s=void 0,a=[],u=void 0,d=void 0,p=void 0,h=void 0,c=void 0,m=this.element.querySelectorAll(".e-rule-container");for(n=0,r=m.length;n<r;n++){var f=void 0;if(u=t.closest(m[n],".e-group-container"),c=this.getParentGroup(u),d=0,s=h=m[n],"DropdownTree"===this.fieldMode?(e=t.getComponent(m[n].querySelector(".e-rule-filter input.e-dropdowntree"),"dropdowntree"))&&e.value&&e.value.length&&(this.selectedColumn=this.getColumn(e.value[0]),f=this.selectedColumn.validation):(p=t.getComponent(m[n].querySelector(".e-rule-filter input.e-dropdownlist"),"dropdownlist"))&&p.value&&(this.selectedColumn=p.getDataByValue(p.value),f=!t.isNullOrUndefined(p.index)&&this.selectedColumn.validation),o=h.querySelector(".e-rule-field input.e-control"),f&&f.isRequired){for(;s&&null!==s.previousElementSibling;)s=s.previousElementSibling,d++;if(o=h.querySelector(".e-rule-operator .e-control"),c.rules[d].operator||(o.parentElement.className.indexOf("e-tooltip")<0&&this.renderToolTip(o.parentElement),l=!1),c.rules[d].value instanceof Array&&(a=c.rules[d].value),i.indexOf(c.rules[d].operator)<-1&&t.isNullOrUndefined(c.rules[d].value)&&"date"!==c.rules[d].type||""===c.rules[d].value||c.rules[d].value instanceof Array&&a.length<1){var g=h.querySelectorAll(".e-rule-value .e-control");l=!1;for(var v=0,y=g.length;v<y;v++){var C=g[v],b=void 0;C.parentElement.className.indexOf("e-searcher")>-1?(b=t.closest(C,".e-multi-select-wrapper")).className.indexOf("e-tooltip")<0&&this.renderToolTip(b):g[v].parentElement.className.indexOf("e-tooltip")<0&&g[v].className.indexOf("e-tooltip")<0&&this.renderToolTip(g[v].parentElement),v++}}}else(p&&p.element&&t.isNullOrUndefined(p.index)||e&&e.element&&(t.isNullOrUndefined(e.value)||e.value.length<1))&&(o.parentElement.className.indexOf("e-tooltip")<0&&this.renderToolTip(o.parentElement),l=!1)}}return l},h.prototype.refreshLevelColl=function(){this.levelColl={};var e=this.element.querySelector(".e-group-container");if(e){this.levelColl[e.id]=[0];var t={groupElement:e,level:[0]};this.refreshLevel(t)}},h.prototype.refreshLevel=function(e){var l,i,n=e.groupElement.querySelector(".e-rule-list").children,r=e.groupElement,o=n.length,s=0;for(i=0;i<o;i++)(l=n[i]).className.indexOf("e-group-container")>-1&&(e.level.push(s),this.levelColl[l.id]=e.level.slice(),s++,e.groupElement=l,e=this.refreshLevel(e));var a=t.closest(r,".e-rule-list");return e.groupElement=a?t.closest(a,".e-group-container"):r,e.level=this.levelColl[e.groupElement.id].slice(),e},h.prototype.groupTemplate=function(){var e,t,l,i,n,r=this.createElement("div",{attrs:{class:"e-group-container"}}),o=this.createElement("div",{attrs:{class:"e-group-header"}}),s=this.createElement("div",{attrs:{class:"e-group-body"}}),a=this.createElement("div",{attrs:{class:"e-rule-list"}});return r.appendChild(o),s.appendChild(a),r.appendChild(s),this.headerTemplate||(e=this.createElement("div",{attrs:{class:"e-lib e-btn-group",role:"group"}}),this.enableNotCondition&&(t=this.createElement("button",{attrs:{type:"button",class:"e-qb-toggle"}}),e.appendChild(t)),t=this.createElement("input",{attrs:{type:"radio",class:"e-btngroup-and",value:"AND"}}),e.appendChild(t),l=this.createElement("label",{attrs:{class:"e-lib e-btn e-btngroup-and-lbl e-small"},innerHTML:this.l10n.getConstant("AND")}),e.appendChild(l),t=this.createElement("input",{attrs:{type:"radio",class:"e-btngroup-or",value:"OR"}}),e.appendChild(t),l=this.createElement("label",{attrs:{class:"e-lib e-btn e-btngroup-or-lbl e-small"},innerHTML:this.l10n.getConstant("OR")}),e.appendChild(l),o.appendChild(e),i=this.createElement("div",{attrs:{class:"e-group-action"}}),n=this.createElement("button",{attrs:{type:"button",class:"e-add-btn"}}),i.appendChild(n),o.appendChild(i)),r},h.prototype.ruleTemplate=function(){var e,l,i=this.createElement("div"),n=this.createElement("div",{attrs:{class:"e-rule-field"}});e=this.createElement("div",{attrs:{class:"e-rule-filter"}});var r=this.createElement("input",{attrs:{type:"text",class:"e-filter-input"}});e.appendChild(r),n.appendChild(e),e=this.createElement("div",{attrs:{class:"e-rule-operator"}}),n.appendChild(e),e=this.createElement("div",{attrs:{class:"e-rule-value"}}),n.appendChild(e),e=this.createElement("div",{attrs:{class:"e-rule-value-delete"}}),l=this.showButtons.ruleDelete||t.isNullOrUndefined(this.showButtons.ruleDelete)?"e-removerule e-rule-delete e-css e-btn e-small":"e-removerule e-rule-delete e-css e-btn e-small e-button-hide";var o=this.createElement("button",{attrs:{type:"button",class:l}});return e.appendChild(o),n.appendChild(e),i.appendChild(n),i},h.prototype.addGroupElement=function(e,t,l,i,n,r,o){var s=this,a={groupID:t.id.replace(this.element.id+"_",""),cancel:!1,type:"insertGroup"};this.isImportRules||this.isInitialLoad?(this.isInitialLoad=!1,this.addGroupSuccess(a,e,t,l,i,n,r,o)):this.trigger("beforeChange",a,function(a){s.addGroupSuccess(a,e,t,l,i,n,r,o)})},h.prototype.addGroupSuccess=function(e,i,n,r,o,a,u,d){if(!e.cancel&&this.element.querySelectorAll(".e-group-container").length<=this.maxGroupCount){var p=n,h=void 0,c="";c=p.className.indexOf("e-group-container")<0?p.querySelector(".e-group-container")&&p.querySelector(".e-group-container").id:p.id;var m=this.groupElem.cloneNode(!0);if(m.setAttribute("id",this.element.id+"_group"+this.groupIdCounter),this.headerTemplate&&(u?(i=!1,m.setAttribute("id",this.element.id+"_group0"),this.headerTemplateFn(m,a,r,d,c),this.groupIdCounter=0):this.headerTemplateFn(m,a,r,d,c)),this.groupIdCounter++,!this.headerTemplate){var f=m.querySelector(".e-btngroup-and"),g=m.querySelector(".e-btngroup-or"),v=m.querySelector(".e-btngroup-and-lbl"),y=m.querySelector(".e-btngroup-or-lbl");f.setAttribute("id",this.element.id+"_and"+this.btnGroupId),g.setAttribute("id",this.element.id+"_or"+this.btnGroupId),f.setAttribute("name",this.element.id+"_and"+this.btnGroupId),g.setAttribute("name",this.element.id+"_and"+this.btnGroupId),v.setAttribute("for",this.element.id+"_and"+this.btnGroupId),y.setAttribute("for",this.element.id+"_or"+this.btnGroupId),this.btnGroupId++}if(i){var C=void 0;C=this.showButtons.groupDelete||t.isNullOrUndefined(this.showButtons.groupDelete)?"e-deletegroup":"e-deletegroup e-button-hide",h=this.createElement("button",{attrs:{type:"button",class:C}});new l.Button({iconCss:"e-icons e-delete-icon",cssClass:"e-small e-round"}).appendTo(h),h.setAttribute("title",this.l10n.getConstant("DeleteGroup")),t.rippleEffect(h,{selector:".deletegroup"}),this.headerTemplate||m.querySelector(".e-group-action").appendChild(h);for(var b=p.querySelector(".e-rule-list"),S=b.children,x=0,O=0,w=S.length;O<w;O++)S[O].className.indexOf("e-group-container")>-1&&(x+=1);b.appendChild(m);var N=this.levelColl[p.id].slice(0);N.push(x),this.levelColl[m.id]=N,this.isImportRules||(this.isAddSuccess=!0,this.addGroups([],p.id.replace(this.element.id+"_","")),this.isAddSuccess=!1,o&&this.addRuleElement(m,{}))}else p.appendChild(m),this.levelColl[m.id]=[0];if(this.enableNotCondition&&!this.headerTemplate){var E=m.querySelector(".e-qb-toggle");new l.Button({content:this.l10n.getConstant("NOT"),cssClass:"e-btn e-small"}).appendTo(E),m.querySelector(".e-btngroup-and-lbl").classList.add("e-not"),this.updatedRule&&this.updatedRule.not&&t.addClass([E],"e-active-toggle")}if(this.updatedRule=null,this.headerTemplate){var q={requestType:"header-template-create",ruleID:m.id,condition:r,notCondition:this.enableNotCondition?a:void 0};this.trigger("actionBegin",q)}else{var R=m.querySelector(".e-add-btn");new s.DropDownButton({items:this.items,cssClass:"e-round e-small e-caret-hide e-addrulegroup",iconCss:"e-icons e-add-icon",beforeOpen:this.selectBtn.bind(this,R),select:this.selectBtn.bind(this,R)}).appendTo(R),R.setAttribute("title",this.l10n.getConstant("AddButton"))}if(!this.isImportRules){var D=p.id.replace(this.element.id+"_",""),T=m.id.replace(this.element.id+"_","");this.trigger("change",{groupID:D,type:"insertGroup",childGroupID:T})}}},h.prototype.headerTemplateFn=function(e,l,i,n,r){var o,s,a=this.element.id+"_header",u=e.querySelector(".e-group-header");if(this.headerTemplate){if(s={requestType:"header-template-initialize",ruleID:e.id,notCondition:this.enableNotCondition?l:void 0,condition:i,rule:this.getRuleCollection(n,!0),groupID:r},this.trigger("actionBegin",s),this.headerFn=this.templateParser(this.headerTemplate),this.isReact)o=this.headerFn(s,this,e.id,a)[0],u.appendChild(o);else if(this.isAngular){var d=this.headerFn(s,this,e.id,a);o=3===d[0].nodeType?d[1]:d[0],u.appendChild(o)}else this.isVue3?(o=this.headerFn(s,this,e.id,a),t.append(o,u)):(o=this.headerFn(s,this,"Template",a)[0],u.appendChild(o));this.renderReactTemplates()}return e},h.prototype.notifyChange=function(e,l,i){var n=t.closest(l,".e-group-container"),r=this.getParentGroup(n),o=t.closest(l,".e-rule-container"),s=0;if("not"!==i)if("condition"!==i){for(;o&&null!==o.previousElementSibling;)o=o.previousElementSibling,s++;var a=r.rules[s],u=this.getColumn(a.field),d=this.getFormat(u.format);if("date"===u.type)if(e instanceof Date)e=this.intl.formatDate(e,d);else if(e instanceof Array)for(var p=0;p<e.length;p++)e[p]&&e[p]instanceof Date&&(e[p]=this.intl.formatDate(e[p],d));u.ruleTemplate?this.templateChange(l,e,i):(this.isNotified=!0,this.updateRules(l,e),this.isNotified=!1)}else r.condition=e;else r.not=e},h.prototype.templateChange=function(e,l,i){var n,r=t.closest(e,".e-group-container"),o=this.getParentGroup(r),s=t.closest(e,".e-rule-container"),a=0;for(this.allowValidation&&this.validateValue(o,s);s&&null!==s.previousElementSibling;)s=s.previousElementSibling,a++;var u=o.rules[a];"field"===i?this.selectedColumn=this.getColumn(l):u&&(this.selectedColumn=this.getColumn(u.field));var d;this.previousColumn=this.getColumn(u.field);var p=this.getValidRules(this.rule);this.selectedColumn&&(d=this.selectedColumn.operators?this.selectedColumn.operators:this.customOperators[this.selectedColumn.type+"Operator"]);var h,c=["in","notin","between","notbetween"];switch(i){case"field":u.field=l,u.label=this.selectedColumn.label,u.type=this.selectedColumn.type,u.value="",u.operator=d[0].value;break;case"operator":h=u.operator,u.operator=l,c.indexOf(u.operator)>-1?u.value=[]:c.indexOf(h)>-1&&(u.value="");break;case"value":u.value=l}if(this.changeRuleTemplate(this.selectedColumn,e),this.filterRules(p,this.getValidRules(this.rule),i),this.selectedColumn&&this.selectedColumn.ruleTemplate&&("field"===i||"operator"===i)){var m=t.closest(e,".e-rule-container");this.destroyControls(m,!0),t.detach(m.querySelector(".e-rule-field"));var f=this.appendRuleElem(t.closest(m,".e-group-container"),this.selectedColumn,"change",m.id,i,u);"Vertical"===this.displayMode||this.element.className.indexOf("e-device")>-1?f.className="e-rule-container e-vertical-mode":f.className="e-rule-container e-horizontal-mode",f.previousElementSibling&&f.previousElementSibling.className.indexOf("e-rule-container")>-1&&(f.className.indexOf("e-joined-rule")<0&&(f.className+=" e-joined-rule"),f.previousElementSibling.className.indexOf("e-prev-joined-rule")<0&&(f.previousElementSibling.className+=" e-prev-joined-rule")),f.previousElementSibling&&f.previousElementSibling.className.indexOf("e-group-container")>-1&&f.className.indexOf("e-separate-rule")<0&&(f.className+=" e-separate-rule");var g={requestType:"template-create",action:i,ruleID:m.id,fields:this.fields,rule:u};n={groupID:r.id.replace(this.element.id+"_",""),ruleID:m.id.replace(this.element.id+"_",""),value:u.field,type:"field"},this.trigger("actionBegin",g),this.trigger("change",n)}},h.prototype.changeValue=function(e,l){var i,n=this;if(l.element&&l.element.classList.contains("e-multiselect")){i=l.element}else i=l.event?l.event.target:l.element;if(i.className.indexOf("e-day")>-1||i.className.indexOf("e-today")>-1||i.className.indexOf("e-cell")>-1){i=l.element}var r,o=t.closest(i,".e-group-container"),s=t.closest(i,".e-rule-container"),a=o&&o.id.replace(this.element.id+"_",""),u=s.id.replace(this.element.id+"_",""),d=l;d.element&&d.element.className.indexOf("e-datepicker")>-1&&(i=d.element,(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist"))&&(this.selectedColumn=r.getDataByValue(r.value)),(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdowntree"))&&(this.selectedColumn=this.getColumn(r.value[0])));var p,h;if(i.className.indexOf("e-radio")>-1)if(h=parseInt(i.id.split("valuekey")[1],0),"Default"===this.fieldMode?(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist"),this.selectedColumn=r.getDataByValue(r.value)):(r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdowntree"),this.selectedColumn=this.getColumn(r.value[0])),this.selectedColumn.values)p=this.selectedColumn.values[h];else{p=[!0,!1][h]}else p=i.className.indexOf("e-multiselect")>-1?t.getComponent(i,"multiselect").value:l.value;"input"===l.name&&this.immediateModeDelay?(window.clearInterval(this.timer),this.timer=window.setInterval(function(){n.filterValue(a,u,p,e,i)},this.immediateModeDelay)):this.filterValue(a,u,p,e,i)},h.prototype.filterValue=function(e,t,l,i,n){var r=this,o={groupID:e,ruleID:t,value:l,cancel:!1,type:"value"};window.clearInterval(this.timer),this.isImportRules?this.changeValueSuccessCallBack(o,n,i,e,t):this.trigger("beforeChange",o,function(l){r.changeValueSuccessCallBack(l,n,i,e,t)})},h.prototype.changeValueSuccessCallBack=function(e,t,l,i,n){e.cancel||(this.updateRules(t,e.value,l),this.isImportRules||this.trigger("change",{groupID:i,ruleID:n,value:e.value,cancel:!1,type:"value"}))},h.prototype.fieldClose=function(e){if(!this.isFieldChange&&!this.isDestroy){this.isFieldClose=!0;var l=t.getComponent(e,"dropdownlist"),i=l.popupObj.element.querySelector(".e-active"),n=l.getItemData();l.value=n.value;var r={element:l.element,value:n.value,isInteracted:!0,previousItemData:this.prevItemData,previousItem:null,item:i,itemData:n,event:null,e:null};l.previousValue!==l.value&&this.changeField(r),this.isFieldChange=!1}},h.prototype.changeField=function(e){if(e.isInteracted){if(t.isNullOrUndefined(e.value))return;this.isFieldChange=!0,this.prevItemData=e.itemData;var l=t.closest(e.element,".e-rule-filter")||t.closest(e.element,".e-rule-sub-filter"),i="DropdownTree"===this.fieldMode?this.getColumn(e.value[0]):this.getColumn(e.value);if("DropdownTree"===this.fieldMode&&null!=l){var n=l.querySelector(".e-dropdowntree.e-control"),r=t.getComponent(n,"dropdowntree");if(!i)return;if("object"===i.type){if(r.value=e.oldValue,r.dataBind(),t.isNullOrUndefined(e.oldValue))n.value="";else{var o=this.getLabelFromColumn(e.oldValue[0]);n.value=o}return}if(!t.isNullOrUndefined(e.value[0])){r.value=e.value[0],r.dataBind();o=this.getLabelFromColumn(e.value[0]);n.value=o}}if(this.destroySubFields(l),this.subFieldElem=null,this.isNotValueChange=!0,i&&i.ruleTemplate)this.templateChange(e.element,i.field,"field");else if(i&&i.columns&&i.columns[0].ruleTemplate)this.templateChange(e.element,i.columns[0].field,"field");else{for(var s=t.closest(e.element,".e-group-container"),a=this.getParentGroup(s),u=t.closest(e.element,".e-rule-container"),d=0;u&&null!==u.previousElementSibling;)u=u.previousElementSibling,d++;a.rules[d].value="",this.changeRule(a.rules[d],e)}}},h.prototype.changeRule=function(e,l){if(!l.itemData){if("DropdownTree"!==this.fieldMode)return;if(null==t.getComponent(l.element,"dropdowntree").value)return}var i=t.closest(l.element,".e-rule-filter");i=i||t.closest(l.element,".e-rule-sub-filter");var n=t.getComponent(l.element,"dropdownlist");"DropdownTree"===this.fieldMode&&null!=i&&(n=t.getComponent(l.element,"dropdowntree"));var r=t.closest(l.element,".e-group-container").id.replace(this.element.id+"_","");this.changeFilter(i,n,r,e,{},l)},h.prototype.changeFilter=function(e,l,i,n,r,o){var s=this;if(e){var a=void 0;a="DropdownTree"===this.fieldMode?l.value[0]:this.isImportRules?this.GetRootColumnName(l.value):l.value,this.selectedColumn=this.getColumn(a);var u={groupID:i,ruleID:t.closest(e,".e-rule-container").id.replace(this.element.id+"_",""),selectedField:"DropdownTree"===this.fieldMode?l.value[0]:l.value,cancel:!1,type:"field"};this.isImportRules?this.fieldChangeSuccess(u,r,e,n,o):this.trigger("beforeChange",u,function(t){s.fieldChangeSuccess(t,r,e,n,o)})}else{var d=t.closest(o.element,".e-rule-operator");this.changeOperator(e,d,l,i,n,r,o)}},h.prototype.changeOperator=function(e,l,i,n,r,o,s){var a,u=this;l?(a={groupID:n,ruleID:t.closest(l,".e-rule-container").id.replace(this.element.id+"_",""),selectedIndex:i.index,cancel:!1,type:"operator"},this.isImportRules?this.operatorChangeSuccess(a,e,o,r,s):this.trigger("beforeChange",a,function(t){u.operatorChangeSuccess(t,e,o,r,s)})):this.changeRuleValues(e,r,o,s)},h.prototype.fieldChangeSuccess=function(e,l,i,n,r){for(var o=t.closest(i,".e-rule-container"),s=t.closest(r.element,".e-rule-operator"),a=t.closest(r.element,".e-group-container").id.replace(this.element.id+"_",""),u=t.getComponent(r.element,"dropdownlist"),d=o.querySelectorAll(".e-tooltip.e-input-group"),p=0;p<d.length;p++)t.getComponent(d[p],"tooltip").destroy();if(e.cancel)this.changeOperator(i,s,u,a,n,l,r);else{if(t.isNullOrUndefined(this.selectedColumn))return;if(l.type=this.selectedColumn.type,o.querySelector(".e-template")&&(n.value=""),"object"===this.selectedColumn.type&&"Default"===this.fieldMode)for(l.type=this.selectedColumn.columns[0].type;this.selectedColumn.columns;)this.createSubFields(i,n,l,r);else this.destroySubFields(i),this.changeOperator(i,s,u,a,n,l,r)}},h.prototype.destroySubFields=function(e){for(;e&&e.nextElementSibling.classList.contains("e-rule-sub-filter");)this.destroyControls(e),e.nextElementSibling.remove()},h.prototype.createSubFields=function(e,l,n,r){var o=!1,s=t.closest(e,".e-rule-field"),a=this.createElement("div",{attrs:{class:"e-rule-sub-filter",id:"subfilter"+this.subFilterCounter}});s.insertBefore(a,s.querySelector(".e-rule-operator"));var u=t.closest(a,".e-rule-container").id,p=this.createElement("input",{attrs:{type:"text",id:u+"_subfilterkey"+this.subFilterCounter}});a.appendChild(p);var h,c=this.element.className.indexOf("e-device")>-1?"250px":"200px",m=Object.keys(this.selectedColumn.columns[0]);h={dataSource:this.selectedColumn.columns,fields:this.fields,placeholder:this.l10n.getConstant("SelectField"),popupHeight:m.length>5?c:"auto",change:this.changeField.bind(this),index:0,open:this.popupOpen.bind(this,!1)},this.fieldModel&&(h=d({},h,this.fieldModel));var f=new i.DropDownList(h);if(f.appendTo("#"+u+"_subfilterkey"+this.subFilterCounter),this.isImportRules||this.previousColumn&&this.previousColumn.ruleTemplate&&this.GetRootColumnName(l.field)===this.GetRootColumnName(this.previousColumn.field))for(var g=this.selectedColumn.columns,v=0;v<g.length;v++)if(l.field===g[v].field||l.field.indexOf(g[v].field)>-1){f.value=g[v].field,this.selectedColumn=g[v],o=!0;break}this.subFilterCounter++,this.subFieldElem=p,r.itemData=r.itemData,!o&&this.selectedColumn.columns&&(!o&&this.isImportRules&&(f.value=null),this.selectedColumn=this.selectedColumn.columns[0]),this.previousColumn=this.selectedColumn,this.selectedColumn.columns||this.changeRuleValues(a,l,n,r)},h.prototype.operatorChangeSuccess=function(e,l,i,n,r){if(!e.cancel){var o=t.closest(r.element,".e-rule-operator"),s=o.nextElementSibling,a=t.getComponent(r.element,"dropdownlist"),u=n.operator?n.operator.toString().toLowerCase():"";i.operator=a.value.toString();var d=i.operator.toLowerCase();if(i.operator.toLowerCase().indexOf("between")>-1||i.operator.toLowerCase().indexOf("in")>-1&&i.operator.toLowerCase().indexOf("contains")<0?(l=o.previousElementSibling,i.type=n.type,(i.operator.toLowerCase().indexOf("in")<0||u.indexOf("in")<0)&&(n.value=[])):"object"==typeof n.value&&null!=n.value&&(n.value=n.value.length>0?n.value[0]:"number"===n.type?0:""),r.previousItemData){var p=r.previousItemData.value.toString().toLowerCase();(p.indexOf("between")>-1||(p.indexOf("in")>-1||p.indexOf("null")>-1||p.indexOf("empty")>-1)&&p.indexOf("contains")<0)&&(l=o.previousElementSibling,i.type=n.type)}if(u.indexOf("in")>-1&&u.indexOf("in")<5&&d.indexOf("in")>-1&&d.indexOf("in")<5&&(l=null),i.operator.indexOf("null")>-1||i.operator.indexOf("empty")>-1){var h=o.parentElement.querySelector(".e-rule-value"),c=h.querySelector(".e-tooltip.e-input-group");c&&t.getComponent(c,"tooltip").destroy(),t.removeClass([h],"e-show"),t.addClass([h],"e-hide")}s&&this.getColumn(n.field).template&&(l=o.previousElementSibling),this.changeRuleValues(l,n,i,r)}},h.prototype.changeRuleValues=function(e,l,n,r){var o,s,a,u=t.closest(r.element,".e-rule-operator");if(e)if(u=e.nextElementSibling,e.classList.contains("e-rule-sub-filter")&&(n.type=this.selectedColumn.type,u=u.classList.contains("e-rule-sub-filter")?u.nextElementSibling:u),t.addClass([u],"e-operator"),u.childElementCount){o=t.getComponent(u.querySelector(".e-dropdownlist"),"dropdownlist"),n.operator=o.value;var p=void 0;p="DropdownTree"===this.fieldMode?t.getComponent(e.querySelector(".e-dropdowntree"),"dropdowntree"):t.getComponent(e.querySelector(".e-dropdownlist"),"dropdownlist"),n.type="DropdownTree"===this.fieldMode?this.getColumn(p.value[0]).type:this.getColumn(p.value).type;var h=r.itemData;this.renderValues(u,h,r.previousItemData,!0,l,n,r.element)}else{var c=t.closest(u,".e-rule-container").id;a=this.createElement("input",{attrs:{type:"text",id:c+"_operatorkey"}}),u.appendChild(a),this.selectedColumn.operators?s=this.selectedColumn.operators:r.itemData&&(s=this.customOperators[this.selectedColumn.type+"Operator"]);var m=this.element.className.indexOf("e-device")>-1?"250px":"200px",f=s[0].value;f=l&&""!==l.operator?l.operator:f;var g=void 0;g={dataSource:s,fields:{text:"key",value:"value"},placeholder:this.l10n.getConstant("SelectOperator"),popupHeight:s.length>5?m:"auto",change:this.changeField.bind(this),index:0,value:f,open:this.popupOpen.bind(this,!1)},this.operatorModel&&(g=d({},g,this.operatorModel));new i.DropDownList(g).appendTo("#"+c+"_operatorkey"),n.operator=l&&""!==l.operator&&!t.isNullOrUndefined(l.operator)?l.operator:s[0].value,this.isImportRules&&(n.type=this.selectedColumn.type,n.operator=l.operator),this.renderValues(u,this.selectedColumn,r.previousItemData,!1,l,n,r.element)}this.isImportRules||this.updateRules(r.element,r.item)},h.prototype.popupOpen=function(e,l){this.enableRtl&&t.addClass([l.popup.element],"e-rtl"),e&&(this.isFieldClose=!1)},h.prototype.destroyControls=function(e,l){for(var i=l?e:e.nextElementSibling,n=i.querySelectorAll("input.e-control"),r=i.querySelectorAll("div.e-control:not(.e-handle)"),o=this.columns,s=0,a=n.length;s<a;s++){if(n[s].classList.contains("e-textbox"))t.getComponent(n[s],"textbox").destroy(),t.detach(t.select("input#"+n[s].id,i));else if(n[s].classList.contains("e-dropdownlist"))this.allowValidation&&n[s].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(n[s].parentElement,"tooltip").destroy(),t.getComponent(n[s],"dropdownlist").destroy();else if(n[s].classList.contains("e-radio"))t.getComponent(n[s],"radio").destroy();else if(n[s].classList.contains("e-numerictextbox"))t.getComponent(n[s],"numerictextbox").destroy(),t.detach(t.select("input#"+n[s].id,i));else if(n[s].classList.contains("e-datepicker"))t.getComponent(n[s],"datepicker").destroy();else if(n[s].classList.contains("e-multiselect"))t.getComponent(n[s],"multiselect").destroy();else if(n[s].className.indexOf("e-template")>-1)for(var u=n[s].className,d=0,p=o.length;d<p;d++)if(o[d].template&&u.indexOf(o[d].field)>-1){this.templateDestroy(o[d],n[s].id);break}document.getElementById(n[s].id)&&t.detach(n[s])}for(s=0,a=r.length;s<a;s++){if(r[s].className.indexOf("e-template")>-1)for(u=r[s].className,d=0,p=o.length;d<p;d++)if(o[d].template&&u.indexOf(o[d].field)>-1){this.templateDestroy(o[d],r[s].id);break}t.detach(r[s])}var h=i.querySelectorAll(".e-template:not(.e-control)");for(s=0,a=h.length;s<a;s++)t.detach(h[s])},h.prototype.templateDestroy=function(e,l){var i;if("string"!=typeof e.template||void 0===e.template.destroy){var n=(i=e.template).destroy;if(i.destroy){var r=void 0;document.getElementById(l)&&(r=t.closest(document.getElementById(l),".e-rule-field").querySelectorAll(".e-template")),"string"==typeof n?(n=t.getValue(n,window))({field:e.field,elementId:l,elements:r}):i.destroy({field:e.field,elementId:l,elements:r})}}},h.prototype.getValues=function(e){var t,l={},i=[],n=[];this.separator.length>0&&(n=e.split(this.separator));var r=this.dataColl;if(this.dataColl[1])for(var o=0,s=r.length;o<s;o++){var a={};if(n.length>1)for(var u=r[o],d=void 0,p=0,h=n.length;p<h;p++)d=n[p],n.length===p+1?(t=u[""+d],Number(u[""+d])===u[""+d]&&u[""+d]%1!=0&&(t=u[""+d].toString())):u=u[""+d];else t=r[o][""+e],Number(r[o][""+e])===r[o][""+e]&&r[o][""+e]%1!=0&&(t=r[o][""+e].toString());t in l||(l[""+t]=1,n.length>1?this.createNestedObject(a,n,t):a[""+e]=t,i.push(a))}return i},h.prototype.createNestedObject=function(e,t,l){for(var i,n=t.length-1,r=0;r<n;++r)(i=t[r])in e||(e[""+i]={}),e=e[""+i];e[t[n]]=l},h.prototype.getDistinctValues=function(e,t){for(var l={},i=[],n=[],r="",o=t.indexOf(this.separator),s=function(s,u){0===o?r=e[s][""+t]:(n=t.split(a.separator)).forEach(function(t){r=r?r[""+t]:e[s][""+t]}),Number(e[s][""+t])===e[s][""+t]&&e[s][""+t]%1!=0&&(r=e[s][""+t].toString());var d={};r in l||(l[""+r]=1,0===o?d[""+t]=r:d[n[n.length-1]]=r,i.push(d))},a=this,u=0,d=e.length;u<d;u++)s(u);return i},h.prototype.renderMultiSelect=function(e,t,l,r,o){var s,a=!1,u=!1;this.isGetNestedData=!1,this.dataColl[1]&&Object.keys(this.dataColl[1]).indexOf(e.field)>-1&&(a=!0,s=this.getDistinctValues(this.dataColl,e.field)),a=!e.columns&&a,!this.dataColl.length&&o.length&&(u=!0);var p=this.selectedRule.field;if(0!==this.selectedRule.field.indexOf(this.separator)&&"DropdownTree"!==this.fieldMode){var h=this.selectedRule.field.split(this.separator);p=h[h.length-1]}var c;c={dataSource:u?o:a?s:this.dataManager,query:new n.Query([e.field]),fields:{text:p,value:p},placeholder:this.l10n.getConstant("SelectValue"),value:r,mode:"CheckBox",width:"100%",change:this.changeValue.bind(this,l),close:this.closePopup.bind(this,l),actionBegin:this.multiSelectOpen.bind(this,t+"_valuekey"+l),open:this.popupOpen.bind(this,!1)},this.valueModel&&this.valueModel.multiSelectModel&&(c=d({},c,this.valueModel.multiSelectModel));var m=new i.MultiSelect(c);m.appendTo("#"+t+"_valuekey"+l),this.updateRules(m.element,r,0)},h.prototype.multiSelectOpen=function(e,l){if(this.dataSource instanceof n.DataManager){var i=document.getElementById(e),r=t.getComponent(t.closest(i,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist");this.selectedColumn=r.getDataByValue(r.value);var o=this.selectedColumn.field,s=!1;if(this.dataColl[1]){Object.keys(this.dataColl[1]).indexOf(o)>-1&&(s=!0);0!==o.indexOf(this.separator)&&this.isGetNestedData&&(s=!0)}s||(l.cancel=!0,this.bindMultiSelectData(i,o))}},h.prototype.bindMultiSelectData=function(e,t){this.getMultiSelectData(e,t)},h.prototype.getMultiSelectData=function(e,l){var i,r=this,o=new n.Deferred,s=this.dataManager.executeQuery((new n.Query).select(l)),u=t.getComponent(e,"multiselect");u.hideSpinner(),this.createSpinner(t.closest(e,".e-multi-select-wrapper").parentElement),a.showSpinner(t.closest(e,".e-multi-select-wrapper").parentElement),s.then(function(n){i=n.actual&&n.actual.result?n.actual.result:n.result,r.dataColl=t.extend(r.dataColl,i,[],!0),u.dataSource=r.getDistinctValues(r.dataColl,l),r.isGetNestedData=!0,a.hideSpinner(t.closest(e,".e-multi-select-wrapper").parentElement)}).catch(function(e){o.reject(e)})},h.prototype.createSpinner=function(e){var l=this.createElement("span",{attrs:{class:"e-qb-spinner"}});e.appendChild(l),a.createSpinner({target:l,width:t.Browser.isDevice?"16px":"14px"})},h.prototype.closePopup=function(e,l){var i=document.getElementById(l.popup.element.id.replace("_popup",""));if(i){var n=t.getComponent(i,"multiselect").value;this.updateRules(i,n,e)}},h.prototype.processTemplate=function(e,l,i,n){var r=t.closest(e,".e-rule-container"),o=r.querySelectorAll(".e-template"),s=r.querySelector(".e-rule-filter .e-filter-input"),a="DropdownTree"===this.fieldMode?t.getComponent(s,"dropdowntree"):t.getComponent(r.querySelector(".e-rule-filter .e-filter-input"),"dropdownlist"),u="DropdownTree"===this.fieldMode?this.getColumn(a.value[0]):this.getColumn(a.value);if("string"==typeof l.template||void 0===l.template.write){var d={rule:i,ruleID:r.id,operator:n.operator,field:u.field,requestType:"value-template-create"};this.trigger("actionBegin",d)}else{var p=l.template;"string"==typeof p.write?t.getValue(p.write,window)({elements:o.length>1?o:o[0],values:i.value,operator:n.operator,field:u.field,dataSource:u.values}):"function"!=typeof l.template&&l.template.write({elements:o.length>1?o:o[0],values:i.value,operator:n.operator,field:u.field,dataSource:u.values})}},h.prototype.getItemData=function(e){var l=t.getComponent(document.getElementById(e+"_filterkey"),"dropdownlist");return"DropdownTree"===this.fieldMode&&(l=t.getComponent(document.getElementById(e+"_filterkey"),"dropdowntree")),"DropdownTree"===this.fieldMode?this.getColumn(l.value[0]):this.getColumn(l.value)},h.prototype.setDefaultValue=function(e,l,i){var n=this.getItemData(e);if(t.isNullOrUndefined(n.value))return i?l?[0,0]:0:l?[]:"";if(l){if(!(n.value instanceof Array))return[n.value]}else if(n.value instanceof Array)return n.value[0];return n.value},h.prototype.renderStringValue=function(e,t,l,i,n){var o,s,a=this.getItemData(e),u="string"==typeof a.template;if(s=this.isImportRules||this.isPublic||u?t.value:this.setDefaultValue(e,!1,!1),"in"!==l&&"notin"!==l||!this.dataColl.length&&!a.values){"in"!==l&&"notin"!==l||(s=(o=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1)).join(","));var p=void 0;p={placeholder:this.l10n.getConstant("SelectValue"),input:this.changeValue.bind(this,i)},this.valueModel&&this.valueModel.textBoxModel&&(p=d({},p,this.valueModel.textBoxModel));var h=new r.TextBox(p);h.appendTo("#"+e+"_valuekey"+i),h.value=s,h.dataBind()}else o=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1),this.renderMultiSelect(a,e,i,o,a.values),"Vertical"===this.displayMode||this.element.className.indexOf("e-device")>-1?n.style.width="100%":(n.style.width=null,n.style.minWidth="200px")},h.prototype.renderNumberValue=function(e,t,l,i,n,o,s){var a=this.getItemData(e),u="string"==typeof a.template,p=this.isImportRules||this.isPublic||u?t.value:this.setDefaultValue(e,!1,!0);if("in"!==l&&"notin"!==l||!this.dataColl.length&&!a.values)if("in"===l||"notin"===l){var h=(p=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1)).join(","),c=void 0;c={placeholder:this.l10n.getConstant("SelectValue"),input:this.changeValue.bind(this,i)},this.valueModel&&this.valueModel.textBoxModel&&(c=d({},c,this.valueModel.textBoxModel));var m=new r.TextBox(c);m.appendTo("#"+e+"_valuekey"+i),m.value=h,m.dataBind()}else{var f=(o=a).validation&&o.validation.min?o.validation.min:0,g=o.validation&&o.validation.max?o.validation.max:Number.MAX_VALUE,v=o.format?o.format:"n";s>1&&t&&(p=t.value[i]?t.value[i]:this.setDefaultValue(e,!0,!0));var y=void 0;y={value:p instanceof Array?p[i]:p,format:v,min:f,max:g,width:"100%",step:o.step?o.step:1,change:this.changeValue.bind(this,i)},this.valueModel&&this.valueModel.numericTextBoxModel&&(y=d({},y,this.valueModel.numericTextBoxModel));var C=new r.NumericTextBox(y);C.appendTo("#"+e+"_valuekey"+i),C.element.setAttribute("aria-label",o.label+" Value")}else p=this.isImportRules?t.value:this.setDefaultValue(e,!0,!1),this.renderMultiSelect(a,e,i,p,a.values),this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?n.style.width="100%":(n.style.minWidth="200px",n.style.width=null)},h.prototype.processValueString=function(e,t){var l=[],i=e.split(",");if("string"===t)return i;for(var n=0,r=i.length;n<r;n++)l.push(Number(i[n]));return l},h.prototype.parseDate=function(e,l){var i,n;if(l){var r=this.intl.getDateParser({skeleton:"full",type:"dateTime"});i=this.getFormat(l),n=r(e),t.isNullOrUndefined(n)&&(n=this.intl.parseDate(e,i))}else n=new Date(e);return n},h.prototype.renderControls=function(e,l,i,n,r){if(t.addClass([e.parentElement.querySelector(".e-rule-value")],"e-value"),t.removeClass([e.parentElement.querySelector(".e-rule-value")],"e-hide"),t.addClass([e.parentElement.querySelector(".e-rule-value")],"e-show"),l.template&&(l.template.create||r))this.processTemplate(e,l,i,n);else{var s;s="boolean"===n.type?this.selectedColumn.values?this.selectedColumn.values.length:2:n.operator&&n.operator.toString().toLowerCase().indexOf("between")>-1?2:1;var a=t.closest(e,".e-rule-container").id,u=void 0,p=n.operator.toString();if(e.className.indexOf("e-rule-operator")>-1||e.className.indexOf("e-rule-filter")>-1){u=e.parentElement.querySelector(".e-rule-value"),this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?u.style.width="100%":"in"!==p&&"notin"!==p?t.addClass([u],"e-custom-value"):t.removeClass([u],"e-custom-value");for(var h=0;h<s;h++)switch(n.type){case"string":this.renderStringValue(a,i,p,h,u);break;case"number":this.renderNumberValue(a,i,p,h,u,l,s);break;case"boolean":this.processBoolValues(l,i,a,h);break;case"date":var c=new Date,m=void 0,f=void 0,g=l.format,v=void 0,y=void 0,C=this.l10n.getConstant("SelectValue"),b="string"==typeof l.template;if(l.field||l.key||!l.value||(c=l.value instanceof Date?l.value:this.parseDate(l.value,l.format)),!l.format&&i&&""!==i.field&&(g=(f=this.getColumn(i.field)).format),(this.isImportRules||this.isPublic||b)&&i&&(g=(f=this.getColumn(i.field)).format,i.value?(m=s>1?i.value[h]:i.value,c=this.parseDate(m,f.format)):c=i.value),g){var S=this.getFormat(g);S.skeleton?(y={locale:this.getLocale(),value:c,placeholder:C,format:S,change:this.changeValue.bind(this,h)},this.valueModel&&this.valueModel.datePickerModel&&(y=d({},y,this.valueModel.datePickerModel)),v=new o.DatePicker(y)):(y={value:c,locale:this.getLocale(),placeholder:C,format:S.format,change:this.changeValue.bind(this,h)},this.valueModel&&this.valueModel.datePickerModel&&(y=d({},y,this.valueModel.datePickerModel)),v=new o.DatePicker(y))}else y={locale:this.getLocale(),value:c,placeholder:C,change:this.changeValue.bind(this,h)},this.valueModel&&this.valueModel.datePickerModel&&(y=d({},y,this.valueModel.datePickerModel)),v=new o.DatePicker(y);if(v.appendTo("#"+a+"_valuekey"+h),!i.value){var x=document.getElementById(a+"_valuekey"+h);this.updateRules(x,c,null,this.isNotValueChange),this.isNotValueChange=!1}}}}},h.prototype.processBoolValues=function(e,i,n,r){var o,s,a=!1;t.isNullOrUndefined(i.type)&&e&&(i.type=e.type);var u;if(e.values){var p=e.values;"boolean"!==i.type||t.isNullOrUndefined(i.value)?e.value?a=p[r].toLowerCase()===e.value.toString().toLowerCase():0===r&&(a=!0):a=p[r].toLowerCase()===i.value.toString().toLowerCase(),s=o=u=p[r]}else{p=[!0,!1];"boolean"!==i.type||t.isNullOrUndefined(i.value)?e.value?a=p[r].toString().toLowerCase()===e.value.toString().toLowerCase():0===r&&(a=!0):a=p[r].toString().toLowerCase()===i.value.toString().toLowerCase(),o=p[r].toString(),s=p[r],u=this.l10n.getConstant(["True","False"][r])}var h;h={label:u,name:n+"default",checked:a,value:o,change:this.changeValue.bind(this,r)},this.valueModel&&this.valueModel.radioButtonModel&&(h=d({},h,this.valueModel.radioButtonModel));var c=new l.RadioButton(h);c.appendTo("#"+n+"_valuekey"+r),a&&this.updateRules(c.element,s,0)},h.prototype.getOperatorIndex=function(e,t){var l,i=e.dataSource.length;for(l=0;l<i;l++)if(t.operator===e.dataSource[l].value)return l;return 0},h.prototype.getPreviousItemData=function(e,t){return this.isFieldClose&&e&&(e=this.getColumn(e.value)),t&&t.template&&e&&Object.keys(e).length<4&&(e.template=t.template),e},h.prototype.renderValues=function(e,l,i,n,r,o,s){var a=e.previousElementSibling.getElementsByTagName("input")[0],u="DropdownTree"===this.fieldMode?t.getComponent(a,"dropdowntree"):t.getComponent(a,"dropdownlist"),d="DropdownTree"===this.fieldMode?this.getColumn(u.value[0]):this.getColumn(u.value);if(this.selectedRule=d,n){var p=t.getComponent(e.querySelector("input"),"dropdownlist");(l=s.id.indexOf("operator")>-1?l:this.selectedRule).operators&&(p.value=null,p.dataBind(),p.dataSource=l.operators,p.index=this.getOperatorIndex(p,r),p.value=o.operator=p.dataSource[p.index].value,p.dataBind())}var h=o.operator.toString(),c=!1;if(h.indexOf("null")>-1||h.indexOf("isempty")>-1||h.indexOf("isnotempty")>-1){(g=e.parentElement.querySelector(".e-rule-value"))&&(t.removeClass([g],"e-show"),t.addClass([g],"e-hide"))}else{var m=t.closest(e,".e-rule-container").id;if((i=this.getPreviousItemData(i,d))&&void 0===i.template?i.columns&&(i=this.getColumn(r.field)):"DropdownTree"===this.fieldMode&&void 0===i&&(i=this.getColumn(r.field)),i&&i.template){this.templateDestroy(i,m+"_valuekey0");var f=t.select("#"+m+"_valuekey0",e.nextElementSibling);f&&!f.classList.contains("e-control")&&t.detach(t.select("#"+m+"_valuekey0",e.nextElementSibling)),"string"!=typeof i.template&&void 0!==i.template.create||(e.nextElementSibling.classList.contains("e-template-value")&&this.clearQBTemplate([m]),e.nextElementSibling.innerHTML="")}if(n&&(this.validateValue(r,t.closest(e,".e-rule-container")),this.destroyControls(e)),d&&(l.template=d.template),l.template&&(t.addClass([e.nextElementSibling],"e-template-value"),l.template=d.template,c=this.setColumnTemplate(l,m,d.field,l.value||h,e,r)),c){var g=e.parentElement.querySelector(".e-rule-value");this.element.className.indexOf("e-device")>-1||"Vertical"===this.displayMode?g.style.width="100%":g.style.width="200px"}else{t.removeClass([e.nextElementSibling],"e-template-value");var v=1;v="boolean"===o.type?this.selectedColumn.values?this.selectedColumn.values.length:2:h&&h.toLowerCase().indexOf("between")>-1?2:1;for(var y=0;y<v;y++){var C=this.createElement("input",{attrs:{type:"text",id:m+"_valuekey"+y}});e.nextElementSibling.appendChild(C)}}this.renderControls(e,l,r,o,c)}},h.prototype.setColumnTemplate=function(e,l,i,n,r,o){var s,a=this,u=!0;if(e.template){if("string"==typeof e.template||void 0===e.template.create)return s={requestType:"value-template-initialize",ruleID:l,field:i,operator:n,rule:o,renderTemplate:!0},this.trigger("actionBegin",s,function(t){u=a.actionBeginSuccessCallBack(t,e,l,i,r)}),u;var d=void 0,p=e.template;if((d="string"==typeof p.create?t.getValue(p.create,window)({field:i,operator:n}):p.create({field:i,operator:n}))instanceof Element)d.id=l+"_valuekey0",t.addClass([d],"e-template"),r.nextElementSibling.appendChild(d),i.indexOf(" ")<0&&t.addClass([d],"e-"+i);else if(d instanceof Array){t.addClass(d,"e-template");for(var h=0,c=d.length;h<c;h++)d[h].id=l+"_valuekey"+h,r.nextElementSibling.appendChild(d[h])}return t.addClass([r.nextElementSibling],"e-template-value"),!0}return!0},h.prototype.actionBeginSuccessCallBack=function(e,l,i,n,r){if(e.renderTemplate){var o=void 0;this.columnTemplateFn=this.templateParser((l.template,l.template));var s=this.element.id+n;if(this.isReact)o=this.columnTemplateFn(e,this,i,s)[0],r.nextElementSibling.appendChild(o);else if(this.isAngular){var a=this.columnTemplateFn(e,this,i,s);o=3===a[0].nodeType?a[1]:a[0],r.nextElementSibling.appendChild(o)}else this.isVue3?(o=this.columnTemplateFn(e,this,"Template",s),t.append(o,r.nextElementSibling)):(o=this.columnTemplateFn(e,this,"Template",s)[0],r.nextElementSibling.appendChild(o));return t.addClass([r.nextElementSibling],"e-template-value"),this.renderReactTemplates(),!0}return!1},h.prototype.updateValues=function(e,l){var i=1;e.className.indexOf("e-template")>-1&&(i=3);var n=e.className.split(" e-")[i],r=parseInt(e.id.slice(-1),2);switch(n){case"checkbox":var o=t.getComponent(e,n).value;l.value=""!==o?o:void 0;break;case"textbox":case"dropdownlist":l.value=t.getComponent(e,n).value;break;case"radio":var s=t.getComponent(e,n);s.checked&&("boolean"==typeof l.value?l.value="true"===s.value:this.getColumn(l.field).values?l.value=s.value:l.value="true"===s.value),s.refresh();break;case"numerictextbox":l.operator.indexOf("between")>-1?("string"==typeof l.value&&(l.value=[]),l.value[r]=t.getComponent(e,n).value):l.value=t.getComponent(e,n).value;break;case"datepicker":var a=this.getColumn(l.field),u=this.getFormat(a.format),d=t.getComponent(e,n).value;l.operator.indexOf("between")>-1?("string"==typeof l.value&&(l.value=[]),l.value[r]=this.intl.formatDate(d,u)):t.isNullOrUndefined(u.format)&&d?l.value=this.intl.formatDate(d):l.value=d?this.intl.formatDate(d,u):d;break;case"multiselect":l.value=t.getComponent(e,n).value}},h.prototype.updateRules=function(e,l,i,n){for(var r,o,s=t.closest(e,".e-group-container"),a=this.getParentGroup(s),u=t.closest(e,".e-rule-container"),d=0,p=s.id.replace(this.element.id+"_",""),h=this.getValidRules(this.rule);u&&null!==u.previousElementSibling;)u=u.previousElementSibling,d++;var c=a.rules[d].operator?a.rules[d].operator.toString():"",m=(u=t.closest(e,".e-rule-container")).id.replace(this.element.id+"_","");if(t.closest(e,".e-rule-filter")||t.closest(e,".e-rule-sub-filter")){this.subFieldElem&&(e=this.subFieldElem),r="DropdownTree"===this.fieldMode?t.getComponent(e,"dropdowntree"):t.getComponent(e,"dropdownlist");var f="DropdownTree"===this.fieldMode?this.getColumn(r.value[0]):this.getColumn(r.value);!this.isImportRules&&a.rules[d].field&&a.rules[d].field.toLowerCase()!==f.field.toLowerCase()&&(!u.querySelectorAll(".e-template")&&!(c.indexOf("null")>-1)||c.indexOf("empty")>-1)&&(a.rules[d].value=""),this.selectedColumn=this.getColumn(this.selectedColumn.field),a.rules[d].field=this.selectedColumn.field,a.rules[d].type=this.selectedColumn.type,a.rules[d].label=this.selectedColumn.label;var g=t.closest(e,".e-rule-filter"),v=(g=g||t.closest(e,".e-rule-sub-filter")).nextElementSibling.querySelector("input.e-control");v=v||g.nextElementSibling.nextElementSibling.querySelector("input.e-control"),c=t.getComponent(v,"dropdownlist").value.toString(),a.rules[d].operator=c;var y=g.nextElementSibling.nextElementSibling,C=y.querySelectorAll("input.e-control");C.length<1&&(C=y.querySelectorAll("div.e-control")),C.length<1&&(C=y.querySelectorAll(".e-template")),o={groupID:p,ruleID:m,value:a.rules[d].field,type:"field"};for(var b=0;b<C.length;b++)c.indexOf("null")>-1||c.indexOf("empty")>-1?a.rules[d].value=null:this.updateValues(C[b],a.rules[d]);this.isImportRules||this.trigger("change",o),this.allowValidation&&a.rules[d].field&&e.parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(e.parentElement,"tooltip").destroy(),this.filterRules(h,this.getValidRules(this.rule),"field")}else if(t.closest(e,".e-rule-operator")){r=t.getComponent(e,"dropdownlist"),a.rules[d].operator=r.value.toString();var S=u.querySelectorAll(".e-rule-value input.e-control");o={groupID:p,ruleID:m,value:r.value,type:"operator"},this.allowValidation&&a.rules[d].operator&&e.parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(e.parentElement,"tooltip").destroy(),S.length>1&&!(S[0].className.indexOf("e-template")>-1)&&(a.rules[d].value=[]);for(var x=0;x<S.length;x++)a.rules[d].operator.indexOf("null")>-1||a.rules[d].operator.indexOf("empty")>-1?a.rules[d].value=null:S[x].classList.contains("e-template")||this.updateValues(S[x],a.rules[d]);this.isImportRules||this.trigger("change",o),this.filterRules(h,this.getValidRules(this.rule),"operator")}else t.closest(e,".e-rule-value")&&(this.ruleValueUpdate(e,l,a,d,s,u,i),n||this.filterRules(h,this.getValidRules(this.rule),"value"))},h.prototype.filterRules=function(e,t,l){JSON.stringify({condition:e.condition,not:e.not,rule:e.rules})!==JSON.stringify({condition:t.condition,not:t.not,rule:t.rules})&&(this.isImportRules||this.trigger("ruleChange",{previousRule:e,rule:t,type:l}))},h.prototype.ruleValueUpdate=function(e,t,l,i,n,r,o){var s,a,u=["in","between","notin","notbetween"];if(l.rules[i].operator&&(a=l.rules[i].operator.toString().toLowerCase()),null!==t){if(e.className.indexOf("e-multiselect")>-1&&"number"===l.rules[i].type&&!this.isNotified){for(var d=[],p=t,h=0,c=p.length;h<c;h++)"string"==typeof p[h]&&d.push(parseFloat(p[h]));d.length&&(t=d)}if(this.isNotified)l.rules[i].value=t,s={groupID:n.id,ruleID:r.id,value:l.rules[i].value,type:"value"},this.isImportRules||this.trigger("change",s);else if(e.className.indexOf("e-spin")>-1||e.className.indexOf("e-numeric")>-1)u.indexOf(a)>-1?l.rules[i].value[o]=t:l.rules[i].value=t;else if(e.className.indexOf("e-radio")>-1)l.rules[i].value=t;else if(e.className.indexOf("e-multiselect")>-1)l.rules[i].value=t;else if(e.className.indexOf("e-textbox")>-1)"in"===a||"notin"===a?(l.rules[i].type,l.rules[i].value=this.processValueString(t,l.rules[i].type)):l.rules[i].value=t;else if(e.className.indexOf("e-datepicker")>-1){var m=this.getFormat(this.getColumn(this.selectedColumn.field).format);m.type&&(u.indexOf(a)>-1?("string"==typeof l.rules[i].value&&(l.rules[i].value=[]),l.rules[i].value[o]=this.intl.formatDate(t,m)):l.rules[i].value=this.intl.formatDate(t,m))}this.validateValue(l,r,i)}else e.className.indexOf("e-datepicker")>-1&&u.indexOf(a)>-1?("string"==typeof l.rules[i].value&&(l.rules[i].value=[]),l.rules[i].value[o]=t):l.rules[i].value=t},h.prototype.validateValue=function(e,l,i){t.isNullOrUndefined(i)||(e=e.rules[i]);var n="object"==typeof e.value;if(this.allowValidation&&(t.isNullOrUndefined(i)||(n?e.value.length>0:e.value))){var r=l.querySelectorAll(".e-rule-value .e-control");r.length>0&&(r[0].className.indexOf("e-tooltip")>-1?t.getComponent(r[0],"tooltip").destroy():r[0].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(r[0].parentElement,"tooltip").destroy(),r[1]&&r[1].parentElement.className.indexOf("e-tooltip")>-1&&t.getComponent(r[1].parentElement,"tooltip").destroy())}},h.prototype.getFormat=function(e){var t;return e?"string"==typeof e?(t={type:"dateTime"},"short"===e||"yMd"===e?(t.type="date",t.skeleton=e):t.format=e):t={type:"dateTime",skeleton:e.skeleton}:t={type:"date",skeleton:"yMd"},t},h.prototype.findGroupByIdx=function(e,t,l){var i=t.rules,n=[];if(!l){for(var r=0,o=i.length;r<o;r++)(t=i[r]).rules&&n.push(t);return n[e]}return t},h.prototype.destroy=function(){this.isDestroy=!0;if(this.element){var l,i,n,r;for(e.prototype.destroy.call(this),n=(l=this.element.querySelectorAll(".e-addrulegroup")).length,i=0;i<n;i++)t.getComponent(l[i],"dropdown-btn").destroy(),t.detach(l[i]);for(r=this.element.querySelectorAll(".e-rule-filter .e-control.e-tooltip"),i=0;i<r.length;i++)t.getComponent(r[i],"tooltip").destroy();for(n=(l=this.element.querySelectorAll(".e-rule-filter .e-control:not(.e-tooltip)")).length,i=0;i<n;i++)t.getComponent(l[i],"dropdownlist")?t.getComponent(l[i],"dropdownlist").destroy():t.getComponent(l[i],"dropdowntree").destroy(),t.detach(l[i]);for(r=this.element.querySelectorAll(".e-rule-operator .e-control.e-tooltip"),i=0;i<r.length;i++)t.getComponent(r[i],"tooltip").destroy();for(n=(l=this.element.querySelectorAll(".e-rule-operator .e-control:not(.e-tooltip)")).length,i=0;i<n;i++)t.getComponent(l[i],"dropdownlist")&&(t.getComponent(l[i],"dropdownlist").destroy(),t.detach(l[i]));for(r=this.element.querySelectorAll(".e-rule-value .e-control.e-tooltip"),i=0;i<r.length;i++)t.getComponent(r[i],"tooltip").destroy();this.isImportRules=!1,this.unWireEvents(),this.levelColl[this.element.id+"_group0"]=[0],this.element.innerHTML="",this.portals&&this.portals.length&&this.clearQBTemplate(),t.classList(this.element,[],["e-rtl","e-responsive","e-device"]),this.isDestroy=!1}},h.prototype.addRules=function(e,t){t=this.element.id+"_"+t,this.isPublic=!0;for(var l=0,i=e.length;l<i;l++)this.addRuleElement(document.getElementById(t),e[l]);this.isPublic=!1},h.prototype.addGroups=function(e,t){if(this.isAddSuccess||this.element.querySelectorAll(".e-group-container").length<=this.maxGroupCount){t=this.element.id+"_"+t;var l=document.getElementById(t),i=this.getParentGroup(l);if(e.length){this.isPublic=!0;for(var n=0,r=e.length;n<r;n++)this.updatedRule={condition:e[n].condition,not:e[n].not},this.importRules(e[n],l,!1,e[n].not);this.isPublic=!1}else{var o="and",s=!1;this.updatedRule&&(o=this.updatedRule.condition,s=this.updatedRule.not),this.enableNotCondition?i.rules.push({condition:o,not:s,rules:[]}):i.rules.push({condition:o,rules:[]})}this.headerTemplate||this.disableRuleCondition(l,i)}},h.prototype.initWrapper=function(){if(this.isInitialLoad=!0,this.cssClass&&t.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&t.addClass([this.element],"e-rtl"),this.width&&(this.element.style.width=this.width),this.height&&(this.element.style.height=this.height),this.rule.rules.length?this.isImportRules=!0:this.addGroupElement(!1,this.element),t.Browser.isDevice||"Vertical"===this.displayMode?(t.Browser.isDevice&&(this.element.style.width="100%",this.element.classList.add("e-device")),t.removeClass(this.element.querySelectorAll(".e-rule-container"),"e-horizontal-mode"),t.addClass(this.element.querySelectorAll(".e-rule-container"),"e-vertical-mode"),this.displayMode="Vertical"):this.displayMode="Horizontal",this.summaryView)this.isImportRules?this.renderSummary():this.renderSummaryCollapse();else{if(this.columns.length&&this.isImportRules){this.addGroupElement(!1,this.element,this.rule.condition,!1,this.rule.not,!1,this.rule);var e=t.extend({},this.rule,{},!0);this.isRefreshed=!0,this.setGroupRules(e),this.isRefreshed=!1}else this.columns.length&&this.addRuleElement(this.element.querySelector(".e-group-container"),{});this.notGroupRtl(),this.readonly&&this.enableReadonly();for(var l=this.element.querySelectorAll("label.e-btn"),i=void 0,n=0;n<l.length;n++)i=l.item(n),t.rippleEffect(i,{selector:".e-btn"})}},h.prototype.renderSummary=function(){var e=this.createElement("div",{attrs:{class:"e-summary-content",id:this.element.id+"_summary_content"}}),t=this.createElement("textarea",{attrs:{class:"e-summary-text",readonly:"true"},styles:"max-height:500px"}),l=this.createElement("button",{attrs:{type:"button",class:"e-edit-rule e-css e-btn e-small e-flat e-primary"}}),i=this.createElement("div",{attrs:{class:"e-summary-btndiv"}});e.appendChild(t),t.textContent=this.getSqlFromRules(this.rule),l.textContent=this.l10n.getConstant("Edit"),i.appendChild(l),e.appendChild(i),this.element.appendChild(e)},h.prototype.renderSummaryCollapse=function(){var e=this.createElement("div",{attrs:{class:"e-collapse-rule e-icons",title:this.l10n.getConstant("SummaryViewTitle")}});this.element.querySelector(".e-group-header").appendChild(e)},h.prototype.columnSort=function(){"descending"===this.sortDirection.toLowerCase()?this.columns=new n.DataManager(this.columns).executeLocal((new n.Query).sortByDesc("field")):"ascending"===this.sortDirection.toLowerCase()&&(this.columns=new n.DataManager(this.columns).executeLocal((new n.Query).sortBy("field")))},h.prototype.onChangeNotGroup=function(){if(this.element.innerHTML="",this.groupIdCounter=0,!this.headerTemplate)if(this.enableNotCondition){if(this.enableNotCondition){var e=this.createElement("button",{attrs:{type:"button",class:"e-qb-toggle"}});this.groupElem.querySelector(".e-btn-group").insertBefore(e,this.groupElem.querySelector(".e-btngroup-and"))}}else this.groupElem.querySelector(".e-qb-toggle").remove();this.setProperties({rule:this.checkNotGroup(this.rule)},!0),this.initWrapper()},h.prototype.notGroupRtl=function(){this.enableRtl?t.addClass(this.element.querySelectorAll(".e-btn-group"),"e-rtl"):t.removeClass(this.element.querySelectorAll(".e-btn-group"),"e-rtl")},h.prototype.checkNotGroup=function(e){var l;if(e.rules)for(var i=0;i<e.rules.length;i++)l=e.rules[i],l=this.checkNotGroup(l),e.rules[i]=l;return t.isNullOrUndefined(e.not)?this.enableNotCondition&&!t.isNullOrUndefined(e.condition)&&(e.not=!1):(this.enableNotCondition&&(e.not=!1),delete e.not),e},h.prototype.onPropertyChanged=function(e,l){for(var i=0,n=Object.keys(e);i<n.length;i++){switch(n[i]){case"summaryView":var r=this.element.querySelector(".e-group-container"),o=this.element.querySelector(".e-summary-content");e.summaryView?(r.style.display="none",this.element.querySelectorAll(".e-summary-content").length<1?(this.renderSummary(),o=this.element.querySelector(".e-summary-content")):this.element.querySelector(".e-summary-text").textContent=this.getSqlFromRules(this.rule),o.style.display="block"):(r.querySelectorAll(".e-collapse-rule").length>-1&&this.renderSummaryCollapse(),r.style.display="block",o.style.display="none");break;case"displayMode":this.refresh();break;case"showButtons":e.showButtons.ruleDelete?t.removeClass(this.element.querySelectorAll(".e-rule-delete"),"e-button-hide"):t.addClass(this.element.querySelectorAll(".e-rule-delete"),"e-button-hide"),e.showButtons.groupDelete?t.removeClass(this.element.querySelectorAll(".e-deletegroup"),"e-button-hide"):t.addClass(this.element.querySelectorAll(".e-deletegroup"),"e-button-hide");break;case"cssClass":l.cssClass&&t.removeClass([this.element],l.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?(t.addClass([this.element],"e-rtl"),this.notGroupRtl()):(t.removeClass([this.element],"e-rtl"),this.notGroupRtl());break;case"enablePersistence":this.enablePersistence=e.enablePersistence;break;case"dataSource":this.dataSource=e.dataSource,this.refresh();break;case"columns":this.columns=e.columns,this.columnSort(),this.updateSubFieldsFromColumns(this.columns);break;case"sortDirection":this.sortDirection=e.sortDirection,this.columnSort();break;case"maxGroupCount":this.maxGroupCount=e.maxGroupCount;break;case"height":this.height=e.height,this.element.style.height=this.height;break;case"rule":0!==this.rule.rules.length||t.isNullOrUndefined(this.rule)||this.reset(),this.setProperties({rule:e.rule},!0),e.rule=this.getRuleCollection(this.rule,!1),this.setRules(this.rule);break;case"width":this.width=e.width,this.element.style.width=this.width;break;case"locale":this.locale=e.locale,this.intl=new t.Internationalization(this.locale),this.isLocale=!0,this.refresh(),this.isLocale=!1;break;case"enableNotCondition":this.onChangeNotGroup();break;case"readonly":this.isReadonly=e.readonly,this.enableReadonly()}}},h.prototype.preRender=function(){this.element.id=this.element.id||t.getUniqueID("ej2-querybuilder"),this.defaultLocale={StartsWith:"Starts With",EndsWith:"Ends With",Contains:"Contains",NotLike:"Not Like",Like:"Like",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",Between:"Between",NotBetween:"Not Between",In:"In",NotIn:"Not In",Remove:"REMOVE",SelectField:"Select a field",SelectOperator:"Select operator",DeleteRule:"Remove this condition",DeleteGroup:"Delete group",AddGroup:"Add Group",AddCondition:"Add Condition",Edit:"EDIT",ValidationMessage:"This field is required",SummaryViewTitle:"Summary View",OtherFields:"Other Fields",AND:"AND",OR:"OR",NOT:"NOT",SelectValue:"Enter Value",IsEmpty:"Is Empty",IsNotEmpty:"Is Not Empty",IsNull:"Is Null",IsNotNull:"Is Not Null",True:"true",False:"false",AddButton:"Add Group/Condition"},this.l10n=new t.L10n("querybuilder",this.defaultLocale,this.locale),this.intl=new t.Internationalization(this.locale),this.groupIdCounter=0,this.subFilterCounter=0,this.ruleIdCounter=0,this.btnGroupId=0,this.isImportRules=!1,this.parser=[],this.customOperators={stringOperator:[{value:"startswith",key:this.l10n.getConstant("StartsWith")},{value:"endswith",key:this.l10n.getConstant("EndsWith")},{value:"contains",key:this.l10n.getConstant("Contains")},{value:"equal",key:this.l10n.getConstant("Equal")},{value:"notequal",key:this.l10n.getConstant("NotEqual")},{value:"in",key:this.l10n.getConstant("In")},{value:"notin",key:this.l10n.getConstant("NotIn")},{value:"isempty",key:this.l10n.getConstant("IsEmpty")},{value:"isnotempty",key:this.l10n.getConstant("IsNotEmpty")}],dateOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"greaterthan",key:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",key:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",key:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",key:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",key:this.l10n.getConstant("NotEqual")}],booleanOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"notequal",key:this.l10n.getConstant("NotEqual")}],numberOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"greaterthanorequal",key:this.l10n.getConstant("GreaterThanOrEqual")},{value:"greaterthan",key:this.l10n.getConstant("GreaterThan")},{value:"between",key:this.l10n.getConstant("Between")},{value:"lessthan",key:this.l10n.getConstant("LessThan")},{value:"notbetween",key:this.l10n.getConstant("NotBetween")},{value:"lessthanorequal",key:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",key:this.l10n.getConstant("NotEqual")},{value:"in",key:this.l10n.getConstant("In")},{value:"notin",key:this.l10n.getConstant("NotIn")}]},this.operators={equal:"=",notequal:"!=",greaterthan:">",greaterthanorequal:">=",lessthan:"<",in:"IN",notin:"NOT IN",lessthanorequal:"<=",startswith:"LIKE",endswith:"LIKE",between:"BETWEEN",notbetween:"NOT BETWEEN",contains:"LIKE",isnull:"IS NULL",isnotnull:"IS NOT NULL",isempty:"IS EMPTY",isnotempty:"IS NOT EMPTY",notstartswith:"NOT LIKE",notendswith:"NOT LIKE",notcontains:"NOT LIKE"},this.sqlOperators={equal:"=",notequal:"!=",greaterthan:">",greaterthanorequal:">=",lessthan:"<",in:this.l10n.getConstant("In").toUpperCase(),notin:this.l10n.getConstant("NotIn").toUpperCase(),lessthanorequal:"<=",startswith:this.l10n.getConstant("Like").toUpperCase(),endswith:this.l10n.getConstant("Like").toUpperCase(),between:this.l10n.getConstant("Between").toUpperCase(),notbetween:this.l10n.getConstant("NotBetween").toUpperCase(),contains:this.l10n.getConstant("Like").toUpperCase(),isnull:this.l10n.getConstant("IsNull").toUpperCase(),isnotnull:this.l10n.getConstant("IsNotNull").toUpperCase(),isempty:this.l10n.getConstant("IsEmpty").toUpperCase(),isnotempty:this.l10n.getConstant("IsNotEmpty").toUpperCase(),notstartswith:this.l10n.getConstant("NotLike").toUpperCase(),notendswith:this.l10n.getConstant("NotLike").toUpperCase(),notcontains:this.l10n.getConstant("NotLike").toUpperCase()},this.fields||(this.fields={text:"label",value:"field"})},h.prototype.render=function(){this.levelColl={},this.items=[{text:this.l10n.getConstant("AddGroup"),iconCss:"e-icons e-add-icon e-addgroup"},{text:this.l10n.getConstant("AddCondition"),iconCss:"e-icons e-add-icon e-addrule"}],this.ruleElem=this.ruleTemplate(),this.groupElem=this.groupTemplate();var e=[{value:"isnull",key:this.l10n.getConstant("IsNull")},{value:"isnotnull",key:this.l10n.getConstant("IsNotNull")}],t=[{value:"isnull",key:this.l10n.getConstant("IsNull")},{value:"isnotnull",key:this.l10n.getConstant("IsNotNull")}];this.customOperators.stringOperator=this.customOperators.stringOperator.concat(e),this.customOperators.numberOperator=this.customOperators.numberOperator.concat(t),this.dataSource instanceof n.DataManager?(this.dataManager=this.dataSource,this.executeDataManager((new n.Query).take(1))):(this.dataManager=new n.DataManager(this.dataSource),this.dataColl=this.dataManager.executeLocal(new n.Query),this.initControl()),this.renderComplete()},h.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(l){return t.compile(e)}},h.prototype.executeDataManager=function(e){var t=this,l=this.dataManager.executeQuery(e),i=new n.Deferred;l.then(function(e){e.actual&&e.actual.result?t.dataColl=e.actual.result:t.dataColl=e.result,t.initControl()}).catch(function(e){i.reject(e)})},h.prototype.initControl=function(){this.initialize(),this.initWrapper(),this.wireEvents()},h.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(e,"click",this.clickEventHandler,this),t.EventHandler.add(e,"focusout",this.focusEventHandler,this),t.EventHandler.add(e,"focusin",this.focusEventHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this)},h.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(e,"click",this.clickEventHandler),t.EventHandler.remove(e,"focusout",this.focusEventHandler),t.EventHandler.remove(e,"focusin",this.focusEventHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler)},h.prototype.getParentGroup=function(e,t){for(var l=e instanceof Element?this.levelColl[e.id]:this.levelColl[""+e],i=t?l.length-1:l.length,n=this.rule,r=0;r<i;r++)n=this.findGroupByIdx(l[r],n,0===r);return n},h.prototype.deleteGroup=function(e){var t,l=this,i=e;"string"==typeof e?(t=this.element.id+"_"+e,e=document.getElementById(t)):t=i.id.replace(this.element.id+"_","");var n={groupID:t,cancel:!1,type:"deleteGroup"};this.isImportRules?this.deleteGroupSuccessCallBack(n,e):this.trigger("beforeChange",n,function(t){l.deleteGroupSuccessCallBack(t,e)})},h.prototype.deleteGroupSuccessCallBack=function(e,l){if(!e.cancel){var i=l,n=this.getParentGroup(i,!0),r=0,o=void 0,s=void 0,a=this.getValidRules(this.rule),u=i.nextElementSibling,d=i.previousElementSibling,p=i.querySelectorAll(".e-group-container"),h=i.querySelectorAll(".e-tooltip");for(s=h.length,o=0;o<s;o++)t.getComponent(h[o],"tooltip").destroy();for(o=0,s=p.length;o<s;o++)delete this.levelColl[p[o].id];for(;null!==i.previousElementSibling;)i=i.previousElementSibling,r++;u&&u.className.indexOf("e-separate-rule")>-1&&(t.removeClass([u],"e-separate-rule"),t.addClass([u],"e-joined-rule"),d&&d.className.indexOf("e-rule-container")>-1&&t.addClass([d],"e-prev-joined-rule"));var c=i.parentElement.parentElement.parentElement,m=[];if(this.isReact||this.isAngular){var f=n.rules[r],g=l.querySelectorAll(".e-rule-container");if(f&&f.rules)for(var v=0;v<f.rules.length;v++){var y=this.getColumn(f.rules[v].field),C=g[v].querySelector(".e-template-value");y&&(y.ruleTemplate||this.isPlatformTemplate(y)&&C)&&m.push(g[v].id)}}t.detach(l),this.headerTemplate&&this.clearQBTemplate([l.id]),m.length&&this.clearQBTemplate(m),n.rules.splice(r,1),delete this.levelColl[e.groupID],this.refreshLevelColl(),this.disableRuleCondition(c,n),this.isImportRules||this.trigger("change",e),this.filterRules(a,this.getValidRules(this.rule),"deleteGroup")}},h.prototype.isPlatformTemplate=function(e){return e.template&&("string"==typeof e.template||void 0===e.template.create)},h.prototype.deleteRule=function(e){var l=this,i={groupID:t.closest(e,".e-group-container").id.replace(this.element.id+"_",""),ruleID:t.closest(e,".e-rule-container").id.replace(this.element.id+"_",""),cancel:!1,type:"deleteRule"};this.isImportRules?this.deleteRuleSuccessCallBack(i,e):this.trigger("beforeChange",i,function(t){l.deleteRuleSuccessCallBack(t,e)})},h.prototype.deleteRuleSuccessCallBack=function(e,l){if(!e.cancel){var i=t.closest(l,".e-group-container"),n=this.getParentGroup(i),r=t.closest(l,".e-rule-container"),o=this.getValidRules(this.rule),s=r,a=r.nextElementSibling,u=r.previousElementSibling,d=0,p=r.querySelectorAll(".e-tooltip"),h=void 0,c=p.length;for(h=0;h<c;h++)t.getComponent(p[h],"tooltip").destroy();for(;null!==r.previousElementSibling;)r=r.previousElementSibling,d++;var m=this.getColumn(n.rules[d].field);m&&m.template&&s.querySelector(".e-template")&&this.templateDestroy(m,s.querySelector(".e-template").id),(!u||u.className.indexOf("e-rule-container")<0)&&a&&t.removeClass([a],"e-joined-rule"),(!a||a.className.indexOf("e-rule-container")<0)&&u&&t.removeClass([u],"e-prev-joined-rule");var f=s.querySelector(".e-template-value");try{t.detach(s)}catch(e){(e=[]).error="error"}m&&m.ruleTemplate&&this.clearQBTemplate([s.id]),m&&this.isPlatformTemplate(m)&&f&&this.clearQBTemplate([s.id]),n.rules.splice(d,1),n.rules[0]&&n.rules[0].rules||this.disableRuleCondition(i,n),this.isImportRules||this.trigger("change",e),this.filterRules(o,this.getValidRules(this.rule),"deleteRule")}},h.prototype.setGroupRules=function(e,t){this.headerTemplate&&t&&(this.isRoot=!0),this.reset(),this.groupIdCounter=1,this.ruleIdCounter=0,this.isImportRules=!0,this.setProperties({rule:e},!0),e=this.getRuleCollection(this.rule,!1),this.importRules(this.rule,this.element.querySelector(".e-group-container"),!0,this.rule.not,t),this.isImportRules=!1},h.prototype.keyBoardHandler=function(e){!this.readonly||38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode||e.preventDefault()},h.prototype.clearQBTemplate=function(e){(this.isReact||this.isAngular)&&this.clearTemplate(e)},h.prototype.disableRuleCondition=function(e,t){if(!this.headerTemplate){if(this.readonly)return;var l=e.querySelector(".e-rule-list").childElementCount,i=e.querySelector(".e-btngroup-and"),n=e.querySelector(".e-btngroup-or");l>1?(i.disabled=!1,n.disabled=!1,(n.nextElementSibling.classList.contains("e-btn-disable")||i.nextElementSibling.classList.contains("e-btn-disable"))&&(n.nextElementSibling.classList.remove("e-btn-disable"),i.nextElementSibling.classList.remove("e-btn-disable")),t&&"or"===t.condition?n.checked=!0:i.checked=!0):(i.checked=!1,i.disabled=!0,n.checked=!1,n.disabled=!0,t&&(n.nextElementSibling.classList.add("e-btn-disable"),i.nextElementSibling.classList.add("e-btn-disable")))}},h.prototype.getValidRules=function(e){e||(e=this.getRules());var l=e.condition,i=e.not,n=t.extend([],e.rules,[],!0);return this.getRuleCollection({condition:l,rules:n,not:i},!0)},h.prototype.getRuleCollection=function(e,l){if(t.isNullOrUndefined(e))return null;var i;if(e.rules&&e.rules.length&&(Object.keys(e.rules[0]).length>6||l))for(var n=e.rules.length,r=0;r<n;r++)i=e.rules[r],i=this.getRuleCollection(i,l),e.rules[r]=i,Object.keys(i).length<1&&l&&(e.rules.splice(r,1),r--,n--);var o=e.custom;if(e.field&&""!==e.field&&(t.isNullOrUndefined(o)||o&&"question"!==o.type&&"answer"!==o.type))if(e.operator&&(e.operator.toString().indexOf("null")>-1||e.operator.toString().indexOf("empty")>-1)&&(e.value=null),this.isRefreshed&&this.enablePersistence||""!==e.field&&""!==e.operator&&""!==e.value&&void 0!==e.value||o&&o.isQuestion){var s=e.condition;e={label:e.label,field:e.field,operator:e.operator,type:e.type,value:e.value},s&&(e.condition=s),o&&(e.custom=o),"in"!==e.operator&&"notin"!==e.operator||!e.value||0!==e.value.length||(e={})}else e={};else if(!o||"question"!==o.type&&"answer"!==o.type)t.isNullOrUndefined(e.condition)&&t.isNullOrUndefined(e.rules)?e={}:(e=this.enableNotCondition?{condition:e.condition,rules:e.rules,not:e.not}:{condition:e.condition,rules:e.rules},o&&(e.custom=o),0===e.rules.length&&(e={}));else{var a=e.not;(e={label:e.label,field:e.field,operator:e.operator,type:e.type,value:e.value,condition:e.condition,rules:e.rules}).custom=o,this.enableNotCondition&&(e.not=a)}return e},h.prototype.setRules=function(e){var l=t.extend({},e,{},!0);this.headerTemplate?this.setGroupRules(l,!0):this.setGroupRules(l)},h.prototype.getRules=function(){var e;return e=this.enableNotCondition?{condition:this.rule.condition,rules:this.rule.rules,not:this.rule.not}:{condition:this.rule.condition,rules:this.rule.rules},this.rule.custom&&(e.custom=this.rule.custom),e},h.prototype.getRule=function(e){var l,i,n=0;if(e instanceof HTMLElement?l=t.closest(e,".e-rule-container"):(i=this.element.id+"_"+e,l=document.getElementById(i)),t.isNullOrUndefined(l))return null;for(var r=t.closest(l,".e-group-container"),o=this.getParentGroup(r);null!==l.previousElementSibling;)l=l.previousElementSibling,n++;return o.rules[n]},h.prototype.getGroup=function(e){e instanceof Element&&e.className.indexOf("e-group-container")<1&&(e=t.closest(e,".e-group-container"));var l=e instanceof Element?e.id:this.element.id+"_"+e;return this.getParentGroup(l)},h.prototype.deleteGroups=function(e){var t,l,i=e.length;for(t=0;t<i;t++)l=this.element.id+"_"+e[t],this.deleteGroup(document.getElementById(l))},h.prototype.getFilteredRecords=function(){var e=this.getPredicate(this.getValidRules(this.rule)),l=t.isNullOrUndefined(e)?new n.Query:(new n.Query).where(e);return this.dataManager.executeQuery(l)},h.prototype.deleteRules=function(e){var t,l,i=e.length;for(t=0;t<i;t++)l=this.element.id+"_"+e[t],this.deleteRule(document.getElementById(l))},h.prototype.getDataManagerQuery=function(e){for(var t=this.getPredicate(e),l=[],i=0,r=Object.keys(this.columns);i<r.length;i++)l.push(this.columns[i].field);return e.rules.length?(new n.Query).select(l).where(t):(new n.Query).select(l)},h.prototype.getPredicate=function(e){var l,i,r,o,s=e.rules,a=!1,u=["notcontains","notstartswith","notendswith"];if(!s)return l;for(var d=0,p=s.length;d<p;d++){if(a=!1,Object.keys(s[d]).indexOf("rules")>-1&&s[d].rules)(i=this.getPredicate(s[d]))&&(l=l?"and"===e.condition?l.and(i):l.or(i):i);else if(!t.isNullOrUndefined(s[d].operator)&&!t.isNullOrUndefined(s[d].operator.length)){var h=s[d].operator.toLowerCase(),c=!1,m=["equal","notequal","greaterthan","greaterthanorequal","lessthan","lessthanorequal"];if("string"===s[d].type&&(a=!this.matchCase),"date"===s[d].type&&m.indexOf(h)>-1&&(a=!0),o=this.getColumn(s[d].field),h.indexOf("null")>-1||h.indexOf("empty")>-1)s[d].value=null;else if("date"!==s[d].type||s[d].value instanceof Array)r=s[d].value;else{var f=this.getFormat(o.format);t.isNullOrUndefined(s[d].value)?r=null:(r=this.getDate(s[d].value,f),m.indexOf(h)>-1&&!this.isTime(s[d].value)&&(c=!0))}if(0===d)if(c||(h.indexOf("in")>-1||h.indexOf("between")>-1||h.indexOf("null")>-1||h.indexOf("empty")>-1)&&h.indexOf("contains")<0)l=c?this.datePredicate(s[d],r):this.arrayPredicate(s[d]);else{""!==(g=r)&&u.indexOf(h)<0&&(l=new n.Predicate(s[d].field,s[d].operator,r,a))}else{if(u.indexOf(h)>-1)continue;if(c||(h.indexOf("in")>-1||h.indexOf("between")>-1||h.indexOf("null")>-1||h.indexOf("empty")>-1)&&h.indexOf("contains")<0)l=c?this.datePredicate(s[d],r,l,e.condition):this.arrayPredicate(s[d],l,e.condition);else if("and"===e.condition){var g=r;l&&""!==g?l=l.and(s[d].field,s[d].operator,r,a):""!==g&&(l=new n.Predicate(s[d].field,s[d].operator,r,a))}else{g=r;l&&""!==g?l=l.or(s[d].field,s[d].operator,r,a):""!==g&&(l=new n.Predicate(s[d].field,s[d].operator,r,a))}}}}return this.dataSource instanceof n.DataManager&&(t.isNullOrUndefined(l)||"isnull"!==l.operator&&"isnotnull"!==l.operator||(l.operator="isnull"===l.operator?"equal":"notequal")),l},h.prototype.getLocale=function(){var e=this.locale;return t.getValue("main."+this.locale+".dates.calendars.gregorian.days.format.short",t.cldrData)||(e="en"),e},h.prototype.getColumn=function(e,t){for(var l,i=this.columns,n=0,r=(i=t||i).length;n<r;n++){if(i[n].field===e){l=i[n];break}if(i[n].columns){if(l=this.getColumn(e,i[n].columns))break}else if(e&&e.indexOf(this.separator)>-1&&""!==this.separator&&i[n].field===e.split(this.separator)[0]){l=i[n];break}}return l},h.prototype.getOperators=function(e){return this.getColumn(e).operators},h.prototype.setTime=function(e,t){return t?e.setHours(0,0,0):e.setHours(23,59,59),e},h.prototype.datePredicate=function(e,t,l,i){var r,o=this.setTime(new Date(t.getTime()),!0),s=this.setTime(t);switch(e.operator){case"equal":r=(r=new n.Predicate(e.field,"greaterthanorequal",o)).and(e.field,"lessthanorequal",s);break;case"notequal":r=(r=new n.Predicate(e.field,"lessthan",o)).or(e.field,"greaterthan",s);break;case"greaterthan":r=new n.Predicate(e.field,"greaterthan",s);break;case"greaterthanorequal":r=new n.Predicate(e.field,"greaterthanorequal",o);break;case"lessthan":r=new n.Predicate(e.field,"lessthan",o);break;case"lessthanorequal":r=new n.Predicate(e.field,"lessthanorequal",s)}return r&&(l?"and"===i?l=l.and(r):"or"===i&&(l=l.or(r)):l=r),l},h.prototype.arrayPredicate=function(e,t,l){var i,r=e.value,o=e.operator.toString(),s=e.value,a=this.getColumn(e.field),u=this.getFormat(a.format);if(o.indexOf("null")>-1||o.indexOf("empty")>-1)switch(o){case"isnull":i=new n.Predicate(e.field,"isnull",s);break;case"isnotnull":i=new n.Predicate(e.field,"isnotnull",s);break;case"isempty":i=new n.Predicate(e.field,"equal","");break;case"isnotempty":i=new n.Predicate(e.field,"notequal","")}if(!(o.indexOf("null")>-1||o.indexOf("empty")>-1))for(var d=0,p=r.length;d<p;d++)if(""!==r[d]||("in"===o||"notin"===o)&&"string"===a.type)if(0===d){var h="greaterthanorequal";switch(o){case"between":i="date"!==a.type?new n.Predicate(e.field,h,r[d]):new n.Predicate(e.field,h,r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u),!0):null);break;case"notbetween":i="date"===a.type?new n.Predicate(e.field,"lessthan",r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u),!0):null):new n.Predicate(e.field,"lessthan",r[d]);break;case"in":i=new n.Predicate(e.field,"equal",r[d]);break;case"notin":i=new n.Predicate(e.field,"notequal",r[d])}}else{switch(e.operator){case"between":i="date"===a.type?i.and(e.field,"lessthanorequal",r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u)):r[d]):i.and(e.field,"lessthanorequal",r[d]);break;case"notbetween":i="date"===a.type?i.or(e.field,"greaterthan",r[d]?this.isTime(r[d])?this.getDate(r[d],u):this.setTime(this.getDate(r[d],u)):r[d]):i.or(e.field,"greaterthan",r[d]);break;case"in":i=i.or(e.field,"equal",r[d]);break;case"notin":i=i.and(e.field,"notequal",r[d])}}return i&&(t?"and"===l?t=t.and(i):"or"===l&&(t=t.or(i)):t=i),t},h.prototype.getDate=function(e,t){var l=this.intl.parseDate(e,t);return e.indexOf(":")>-1&&e.indexOf("/")<0&&e.indexOf(",")<0&&e.indexOf("-")<0&&((l=new Date).setHours(parseInt(e.split(":")[0])),l.setMinutes(parseInt(e.split(":")[1])),e.split(":")[2]&&l.setSeconds(parseInt(e.split(":")[2]))),l},h.prototype.isTime=function(e){return!!(e&&e.indexOf(":")>-1)},h.prototype.importRules=function(e,l,i,n,r){if(i){if(e.rules.length>1&&!this.headerTemplate){var o=l.querySelector(".e-btngroup-or"),s=l.querySelector(".e-btngroup-and");o.disabled=!1,s.disabled=!1,"or"===e.condition?o.checked=!0:s.checked=!0}else this.disableRuleCondition(l);if(this.headerTemplate&&r&&(l=this.renderGroup(e,e.condition,this.element,e.not,r)),this.enableNotCondition&&!this.headerTemplate){var a=l.querySelector(".e-qb-toggle");e.not?t.addClass([a],"e-active-toggle"):t.removeClass([a],"e-active-toggle")}}else l=this.renderGroup(e,e.condition,l,n);0===e.rules.length&&this.headerTemplate&&(e.rules[0]={label:"",field:"",operator:"",type:"",value:""});var u=e.rules;if(!t.isNullOrUndefined(u))for(var d=0,p=u.length;d<p;d++){var h=Object.keys(u[d]);!t.isNullOrUndefined(u[d].rules)&&h.indexOf("rules")>-1&&0!==u[d].rules.length?(l=this.renderGroup(u[d],u[d].condition,l,u[d].not),l=this.importRules(u[d],l,!0)):this.renderRule(u[d],l)}return(l=t.closest(l,".e-rule-list"))&&(l=t.closest(l,".e-group-container")),l},h.prototype.renderGroup=function(e,t,l,i,n){this.addGroupElement(!0,l,t,!1,i,n,e);var r=l.querySelectorAll(".e-group-container");return r[r.length-1]},h.prototype.renderRule=function(e,t){t.className.indexOf("e-group-container")>-1?this.addRuleElement(t,e):this.addRuleElement(t.querySelector(".e-group-container"),e)},h.prototype.enableReadonly=function(){for(var e=this.element.querySelectorAll(".e-dropdownlist, .e-dropdowntree, .e-numerictextbox, .e-textbox, .e-datepicker, .e-multiselect .e-lib, .e-radio"),n=0;n<e.length;n++)if(e[n].classList.contains("e-dropdownlist")){t.getInstance(e[n],i.DropDownList).readonly=this.isReadonly}else if(e[n].classList.contains("e-dropdowntree")){t.getComponent(e[n],"dropdowntree").readonly=this.isReadonly}else if(e[n].classList.contains("e-numerictextbox")){t.getInstance(e[n],r.NumericTextBox).readonly=this.isReadonly}else if(e[n].classList.contains("e-textbox")){t.getInstance(e[n],r.TextBox).readonly=this.isReadonly}else if(e[n].classList.contains("e-datepicker")){t.getInstance(e[n],o.DatePicker).readonly=this.isReadonly}else if(e[n].classList.contains("e-multiselect")){t.getInstance(e[n],i.MultiSelect).readonly=this.isReadonly}else if(e[n].classList.contains("e-radio")){t.getInstance(e[n],l.RadioButton).checked||(this.isReadonly?e[n].parentElement.style.display="none":e[n].parentElement.style.display="inherit")}var s=this.element.querySelectorAll(".e-deletegroup"),a=this.element.querySelectorAll(".e-addrulegroup"),u=this.element.querySelectorAll(".e-removerule");!this.isReadonly&&this.ruleElem.classList.contains("e-readonly")&&this.ruleElem.classList.remove("e-readonly");var d=[s,a,u];for(n=0;n<d.length;n++)d[n].forEach(function(e){e.classList.contains("e-readonly")?e.classList.remove("e-readonly"):e.classList.add("e-readonly")});this.enableBtnGroup()},h.prototype.enableBtnGroup=function(){var e=this,t=!1;this.element.querySelectorAll(".e-btngroup-and-lbl, .e-btngroup-or-lbl, .e-qb-toggle").forEach(function(l){!l.classList.contains("e-qb-toggle")||l.classList.contains("e-active-toggle")||l.classList.contains("e-readonly")?l.classList.contains("e-qb-toggle")&&l.classList.contains("e-not-readonly")?l.classList.remove("e-not-readonly"):l.classList.contains("e-qb-toggle")&&l.classList.contains("e-readonly")?l.classList.remove("e-readonly"):l.classList.contains("e-active-toggle")?(l.classList.add("e-not-readonly"),t=!0):l.previousElementSibling.checked||l.classList.contains("e-readonly")?(l.classList.remove("e-readonly"),t?"AND"===l.textContent?l.classList.add("e-readonly-and"):l.classList.add("e-readonly-or"):("AND"===l.textContent&&e.isReadonly?(l.classList.remove("e-not"),l.classList.add("e-readonly-and")):(e.enableNotCondition&&l.classList.add("e-not"),l.classList.remove("e-readonly-and")),"OR"===l.textContent&&e.isReadonly?l.classList.add("e-readonly-or-not"):l.classList.remove("e-readonly-or-not"))):l.classList.contains("e-btn-disable")||l.classList.add("e-readonly"):(l.classList.add("e-readonly"),t=!1)})},h.prototype.isDateFunction=function(e){for(var t=["date","time","day","week","month","year","hour","minute","second","now","quarter","period","extract"],l=0,i=t.length;l<i;l++)if(e.toLowerCase().indexOf(t[l])>-1)return!0;return!1},h.prototype.getSqlString=function(e,t,l,i){var n=!1;l||""===l?l+="(":(l="",n=!0);var r=e.condition;if(e.not){l+=n?i?this.l10n.getConstant("NOT").toUpperCase()+" (":"NOT (":i?" "+this.l10n.getConstant("NOT").toUpperCase()+" (":" NOT ("}if(e.rules)for(var o=0,s=e.rules.length;o<s;o++){if(e.rules[o].rules)l=this.getSqlString(e.rules[o],t,l,i);else{var a=e.rules[o],u="",d=i?this.sqlOperators[a.operator]:this.operators[a.operator];if(a.value instanceof Array)if(a.operator.toString().indexOf("between")>-1){var p=i?" "+this.l10n.getConstant("AND").toUpperCase()+" ":" AND ";"date"!==a.type||this.isDateFunction(a.value[0])?u+=a.value[0]+p+a.value[1]:u+='"'+a.value[0]+'"'+p+'"'+a.value[1]+'"'}else if("string"==typeof a.value[0]&&null!==a.value){u+='("'+a.value[0]+'"';for(var h=1,c=a.value.length;h<c;h++)u+=',"'+a.value[h]+'"';u+=")"}else u+="("+a.value+")";else a.operator.toString().indexOf("startswith")>-1?u+=a.value?'("'+a.value+'%")':"("+a.value+")":a.operator.toString().indexOf("endswith")>-1?u+=a.value?'("%'+a.value+'")':"("+a.value+")":a.operator.toString().indexOf("contains")>-1?u+=a.value?'("%'+a.value+'%")':"("+a.value+")":"number"===a.type||"boolean"==typeof a.value||null===a.value?u+=a.value:u+='"'+a.value+'"';a.operator.toString().indexOf("null")>-1||a.operator.toString().indexOf("empty")>-1?(t?a.field="`"+a.field+"`":a.field.indexOf(" ")>-1&&(a.field='"'+a.field+'"'),l+=a.field+" "+d):(t?a.field="`"+a.field+"`":a.field.indexOf(" ")>-1&&(a.field='"'+a.field+'"'),l+=a.field+" "+d+" "+u),a.condition&&""!==a.condition&&(r=a.condition)}if(o!==s-1){a=e.rules[o];(""===r||a&&""!==a.condition&&a.custom&&a.custom.isCustom)&&(r=a.condition),l+=" "+(r=i?this.l10n.getConstant(r.toUpperCase()).toUpperCase():r.toUpperCase())+" "}}return n||(l+=")"),e.not&&(l+=")"),l},h.prototype.setRulesFromSql=function(e,t){e=e.replace(/`/g,"");var l=this.getRulesFromSql(e,t);this.setRules({condition:l.condition,not:l.not,rules:l.rules})},h.prototype.getRulesFromSql=function(e,t){this.parser=[],this.sqlParser(e,t),this.setProperties({rule:{condition:"and",not:!1,rules:[]}},!0);var l=this.processParser(this.parser,this.rule,[0],t);return this.enableNotCondition?{condition:l.condition,not:l.not,rules:l.rules}:{condition:l.condition,rules:l.rules}},h.prototype.getSqlFromRules=function(e,t,l){return e||(e=this.getValidRules()),e=this.getRuleCollection(e,!1),this.getSqlString(this.getValidRules(e),t,null,l).replace(/"/g,"'")},h.prototype.sqlParser=function(e,t){var l,i=0;do{l=e.slice(i),i+=this.parseSqlStrings(l,t)}while(""!==l);return this.parser},h.prototype.parseSqlStrings=function(e,t){var l,i=["=","!=","<=",">=","<",">"];l=t?[this.l10n.getConstant("AND").toUpperCase(),this.l10n.getConstant("OR").toUpperCase(),this.l10n.getConstant("NOT").toUpperCase()]:["AND","OR","NOT"];var n;n=t?[this.l10n.getConstant("In").toUpperCase(),this.l10n.getConstant("NotIn").toUpperCase(),this.l10n.getConstant("Like").toUpperCase(),this.l10n.getConstant("NotLike").toUpperCase(),this.l10n.getConstant("Between").toUpperCase(),this.l10n.getConstant("NotBetween").toUpperCase(),this.l10n.getConstant("IsNull").toUpperCase(),this.l10n.getConstant("IsNotNull").toUpperCase(),this.l10n.getConstant("IsEmpty").toUpperCase(),this.l10n.getConstant("IsNotEmpty").toUpperCase()]:["IN","NOT IN","LIKE","NOT LIKE","BETWEEN","NOT BETWEEN","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"];for(var r,o,s=0,a=i.length;s<a;s++)if(r=/^\w+$/.test(i[s])?"\\b":"",new RegExp("^("+i[s]+")"+r,"ig").exec(e))return this.parser.push(["Operators",i[s].toLowerCase()]),i[s].length;var u=this.parser[this.parser.length-1];if(!u||u&&"Literal"!==u[0])for(s=0,a=l.length;s<a;s++)if(r=/^\w+$/.test(l[s])?"\\b":"",new RegExp("^("+l[s]+")"+r,"ig").exec(e))return this.parser.push(["Conditions",l[s].toLowerCase()]),l[s].length;for(s=0,a=n.length;s<a;s++)if(r=/^\w+$/.test(n[s])?"\\b":"",new RegExp("^("+n[s]+")"+r,"ig").exec(e))return this.parser.push(["SubOperators",n[s].toLowerCase()]),n[s].length;if(/^\(/.exec(e))return this.parser.push(["Left","("]),1;if(/^\)/.exec(e))return this.parser.push(["Right",")"]),1;if(/^(true|false)/.exec(e))return o=/^(true|false)/.exec(e)[0],this.parser.push(["String",o]),o.length;if(/^null/.exec(e))return o=/^null/.exec(e)[0],this.parser.push(["String",null]),o.length;if(/^`?([a-z_][a-z0-9_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(e))return o=/^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(e)[1],this.parser.push(["Literal",o]),o.length;if(this.checkLiteral()&&/^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(e))return o=/^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(e)[1],this.parser.push(["Literal",o]),o.length+2;if(this.checkNumberLiteral(e,t))return o=/^[0-9]+(\.[0-9]+)?/.exec(e)[0],this.parser.push(["Literal",o]),o.length;if(/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(e)){if("("===(o=/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(e)[0])[o.length-2])for(var d=!1,p=o.length;p<e.length&&(o+=e[p],")"===e[p]&&(d=!0),!d||"'"!==e[p]);p++);return this.parser.push(["String",o]),o.length}return/^"([^\\"]*(?:\\.[^\\"]*)*)"/.exec(e)?(o=/^"([^\\"]*(?:\\.[^\\"]*)*)"/.exec(e)[0],this.parser.push(["DoubleString",o]),o.length):/^[0-9]+(\.[0-9]+)?/.exec(e)?(o=/^[0-9]+(\.[0-9]+)?/.exec(e)[0],this.parser.push(["Number",o]),o.length):/^-?[0-9]+(\.[0-9]+)?/.exec(e)?(o=/^-?[0-9]+(\.[0-9]+)?/.exec(e)[0],this.parser.push(["Number",o]),o.length):1},h.prototype.checkLiteral=function(){var e=this.parser[this.parser.length-1];if(!e)return!0;var t=this.parser[this.parser.length-2],l=this.parser[this.parser.length-3];if("Left"===e[0]&&t&&"Conditions"===t[0])return!0;return!!("Conditions"===e[0]&&l&&l[1].indexOf("between")<0)},h.prototype.checkNumberLiteral=function(e,t){var l=this.parser[this.parser.length-1];if(!l)return!0;if(/^[0-9]+(\.[0-9]+)?/.exec(e)){var i=this.parser[this.parser.length-2],n=this.parser[this.parser.length-3];if("Left"===l[0]&&i&&"Conditions"===i[0])return!0;var r=t?this.l10n.getConstant("Between").toLowerCase():"between";if("Conditions"===l[0]&&n&&n[1].indexOf(r)<0)return!0}return!1},h.prototype.getOperator=function(e,t,l){if(l){for(var i=Object.keys(this.sqlOperators),n=0;n<i.length;n++)if(this.sqlOperators[i[n]]===t.toUpperCase())return e&&0===e.indexOf("%")&&"%"===e[e.length-1]?"notcontains"===i[n]?"notcontains":"contains":e&&0!==e.indexOf("%")&&e.indexOf("%")===e.length-1?"notstartswith"===i[n]?"notstartswith":"startswith":e&&0===e.indexOf("%")&&e.indexOf("%")!==e.length-1?"notendswith"===i[n]?"notendswith":"endswith":i[n];return null}if(e){if(0===e.indexOf("%")&&"%"===e[e.length-1])return"not like"===t?"notcontains":"contains";if(0!==e.indexOf("%")&&e.indexOf("%")===e.length-1)return"not like"===t?"notstartswith":"startswith";if(0===e.indexOf("%")&&e.indexOf("%")!==e.length-1)return"not like"===t?"notendswith":"endswith"}else{if("not like"===t)return"notequal";if("like"===t)return"equal"}return{"=":"equal","!=":"notequal","<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal",in:"in","not in":"notin",between:"between","not between":"notbetween","is empty":"isempty","is null":"isnull","is not null":"isnotnull","is not empty":"isnotempty"}[""+t]},h.prototype.getTypeFromColumn=function(e){var l=this.getColumn(e.field);return t.isNullOrUndefined(l)?null:l.type},h.prototype.getLabelFromColumn=function(e){var t="",l=0;if(""!==this.separator){for(var i=e.split(this.separator),n=0;n<i.length;n++)t+=this.getLabelFromField(i,n+1),++l<i.length&&(t+=this.separator);return t}return this.getColumn(e).label},h.prototype.getLabelFromField=function(e,t){for(var l="",i=0,n=0;n<t;n++)l+=e[n],++i<t&&(l+=this.separator);return this.getColumn(l).label},h.prototype.processParser=function(e,t,l,i){for(var n,r,o,s,a,u,d,p,h,c,m=[],f=[],g=!1,v=0,y=e.length;v<y;v++)if("Literal"===e[v][0]){var C=this.getColumn(e[v][1]);if(o={label:C&&C.label?C.label:e[v][1],field:e[v][1]},"SubOperators"===e[v+1][0]){if(e[v+1][1].indexOf("null")>-1||e[v+1][1].indexOf("empty")>-1)o.operator=this.getOperator(" ",e[v+1][1],i),o.value=null,o.type=this.getTypeFromColumn(o);else{var b=e[v+3][1]?e[v+3][1].replace(/'/g,""):e[v+3][1];o.operator=this.getOperator(b,e[v+1][1],i)}for(c=e[v+1][1],n=++v+1,r=y,i&&"contains"===o.operator||"startswith"===o.operator||"endswith"===o.operator?c="like":i&&"notcontains"===o.operator||"notstartswith"===o.operator||"notendswith"===o.operator?c="not like":i&&(c=o.operator),n=v+1;n<r;n++)if(c.indexOf("between")<0&&"Left"===e[n][0])g=!0;else{if("Right"===e[n][0]&&g){v=n,g=!1;break}if(c.indexOf("null")>-1||c.indexOf("empty")>-1)break;if(c.indexOf("like")>-1&&"String"===e[n][0]){var S=e[n][1];e[n][1]&&"'"===e[n][1][0]&&(S=e[n][1].substring(1,e[n][1].length-1)),S=S?S.replace(/%/g,""):e[n][1],o.value=S,o.type="string"}else if(c.indexOf("between")>-1){if("Literal"===e[n][0]||"Left"===e[n][0])break;if("Number"===e[n][0])m.push(Number(e[n][1]));else if("String"===e[n][0]){S=e[n][1];e[n][1]&&"'"===e[n][1][0]&&(S=e[n][1].substring(1,e[n][1].length-1)),f.push(S)}}else if("Number"===e[n][0])m.push(Number(e[n][1]));else if("String"===e[n][0]){S=e[n][1];e[n][1]&&"'"===e[n][1][0]&&(S=e[n][1].substring(1,e[n][1].length-1)),f.push(S)}o.type=this.getTypeFromColumn(o)}c.indexOf("like")<0&&("Number"===e[n-1][0]?(o.value=m,o.type="number"):"String"===e[n-1][0]?(o.value=f,o.type="string"):c.indexOf("between")>-1&&"Conditions"===e[n-1][0]&&(0!==f.length?(o.value=f,o.type="string"):(o.value=m,o.type="number")),m=[],f=[],o.type=this.getTypeFromColumn(o))}else"Operators"===e[v+1][0]&&(o.operator=this.getOperator(e[v+2][1],e[v+1][1],i),"Number"===e[v+2][0]?(o.type="number",o.value=Number(e[v+2][1])):(o.type="string",o.value=e[v+2][1]?e[v+2][1].replace(/'/g,""):e[v+2][1]),o.type=this.getTypeFromColumn(o));t.rules.push(o)}else{if("Left"===e[v][0]){if("Left"!==e[0][0]&&("not"===e[v-1][1]||i&&this.l10n.getConstant("NOT").toLowerCase()===e[v-1][1]))continue;for(this.parser=e.splice(v+1,y-(v+1)),s=this.enableNotCondition?{condition:"and",rules:[],not:!1}:{condition:"and",rules:[]},h=0,u=t.rules.length,a=0;a<u;a++)t.rules[a].rules&&h++;return l.push(h),t.rules.push(s),s=this.processParser(this.parser,s,l,i),t}if("Conditions"===e[v][0])"not"===e[v][1]||i&&this.l10n.getConstant("NOT").toLowerCase()===e[v][1]?t.not=!0:t.condition=e[v][1];else if("Right"===e[v][0]){for(this.parser=e.splice(v+1,y-(v+1)),l.pop(),t=this.rule,p=l.length,d=0;d<p;d++)t=this.findGroupByIdx(l[d],t,0===d);return this.processParser(this.parser,t,l,i)}}return t},p([t.Event()],h.prototype,"created",void 0),p([t.Event()],h.prototype,"actionBegin",void 0),p([t.Event()],h.prototype,"beforeChange",void 0),p([t.Event()],h.prototype,"change",void 0),p([t.Event()],h.prototype,"dataBound",void 0),p([t.Event()],h.prototype,"ruleChange",void 0),p([t.Property({ruleDelete:!0,groupInsert:!0,groupDelete:!0})],h.prototype,"showButtons",void 0),p([t.Property(!1)],h.prototype,"summaryView",void 0),p([t.Property(!1)],h.prototype,"allowValidation",void 0),p([t.Property("Default")],h.prototype,"fieldMode",void 0),p([t.Property([])],h.prototype,"columns",void 0),p([t.Property(null)],h.prototype,"fieldModel",void 0),p([t.Property(null)],h.prototype,"operatorModel",void 0),p([t.Property(null)],h.prototype,"valueModel",void 0),p([t.Property()],h.prototype,"headerTemplate",void 0),p([t.Property("")],h.prototype,"cssClass",void 0),p([t.Property([])],h.prototype,"dataSource",void 0),p([t.Property("Horizontal")],h.prototype,"displayMode",void 0),p([t.Property(!1)],h.prototype,"enablePersistence",void 0),p([t.Property("Default")],h.prototype,"sortDirection",void 0),p([t.Property(5)],h.prototype,"maxGroupCount",void 0),p([t.Property("auto")],h.prototype,"height",void 0),p([t.Property("auto")],h.prototype,"width",void 0),p([t.Property(!1)],h.prototype,"matchCase",void 0),p([t.Property(0)],h.prototype,"immediateModeDelay",void 0),p([t.Property(!1)],h.prototype,"enableNotCondition",void 0),p([t.Property(!1)],h.prototype,"readonly",void 0),p([t.Property("")],h.prototype,"separator",void 0),p([t.Complex({condition:"and",rules:[]},c)],h.prototype,"rule",void 0),h=p([t.NotifyPropertyChanges],h)}(t.Component);e.Columns=h,e.Rule=c,e.Value=m,e.ShowButtons=f,e.QueryBuilder=g,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-querybuilder.umd.min.js.map
|