@easyquery/enterprise 7.2.5-beta01 → 7.2.5-rc02
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/dist/easyquery.enterprise.cjs.js +1218 -0
- package/dist/easyquery.enterprise.esm.js +1211 -0
- package/dist/types/dm/model_ex.d.ts +3 -0
- package/dist/types/extensions.d.ts +1 -0
- package/dist/{lib → types}/query/query_ex.d.ts +5 -1
- package/package.json +16 -36
- package/api-eq-enterprise.js +0 -15
- package/dist/browser/eq.enterprise.js +0 -37130
- package/dist/browser/eq.enterprise.js.map +0 -1
- package/dist/browser/eq.enterprise.min.js +0 -2
- package/dist/browser/eq.enterprise.min.js.LICENSE.txt +0 -11
- package/dist/browser/eq.enterprise.min.js.map +0 -1
- package/dist/bundles/easyquery.enterprise.js +0 -8107
- package/dist/bundles/easyquery.enterprise.js.map +0 -1
- package/dist/bundles/easyquery.enterprise.min.js +0 -3
- package/dist/bundles/easyquery.enterprise.min.js.LICENSE.txt +0 -1
- package/dist/bundles/easyquery.enterprise.min.js.map +0 -1
- package/dist/lib/data/data_table_aggr_calculator.js +0 -164
- package/dist/lib/data/data_table_aggr_calculator.js.map +0 -1
- package/dist/lib/data/eqs_aggr_calculator.js +0 -173
- package/dist/lib/data/eqs_aggr_calculator.js.map +0 -1
- package/dist/lib/dm/model_ex.d.ts +0 -9
- package/dist/lib/dm/model_ex.js +0 -152
- package/dist/lib/dm/model_ex.js.map +0 -1
- package/dist/lib/extensions.d.ts +0 -26
- package/dist/lib/extensions.js +0 -115
- package/dist/lib/extensions.js.map +0 -1
- package/dist/lib/license/lc-dialog.js +0 -315
- package/dist/lib/license/lc-dialog.js.map +0 -1
- package/dist/lib/main/eqs_query_storage.js +0 -106
- package/dist/lib/main/eqs_query_storage.js.map +0 -1
- package/dist/lib/public_api.js +0 -8
- package/dist/lib/public_api.js.map +0 -1
- package/dist/lib/query/condition_ex.js +0 -98
- package/dist/lib/query/condition_ex.js.map +0 -1
- package/dist/lib/query/query_column_ex.js +0 -58
- package/dist/lib/query/query_column_ex.js.map +0 -1
- package/dist/lib/query/query_ex.js +0 -78
- package/dist/lib/query/query_ex.js.map +0 -1
- package/dist/lib/utils/lcv.js +0 -103
- package/dist/lib/utils/lcv.js.map +0 -1
- package/tsconfig.json +0 -22
- package/webpack.config.js +0 -118
- /package/dist/{lib → types}/data/data_table_aggr_calculator.d.ts +0 -0
- /package/dist/{lib → types}/data/eqs_aggr_calculator.d.ts +0 -0
- /package/dist/{lib → types}/license/lc-dialog.d.ts +0 -0
- /package/dist/{lib → types}/main/eqs_query_storage.d.ts +0 -0
- /package/dist/{lib → types}/public_api.d.ts +0 -0
- /package/dist/{lib → types}/query/condition_ex.d.ts +0 -0
- /package/dist/{lib → types}/query/query_column_ex.d.ts +0 -0
- /package/dist/{lib → types}/utils/lcv.d.ts +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see easyquery.enterprise.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("easyqueryCore")):"function"==typeof define&&define.amd?define("easyqueryEnterprise",["easyqueryCore"],e):"object"==typeof exports?exports.easyqueryEnterprise=e(require("easyqueryCore")):t.easyqueryEnterprise=e(t.easyqueryCore)}(self,(__WEBPACK_EXTERNAL_MODULE__388__=>(()=>{"use strict";var __webpack_modules__={789:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var browserUtils;(function(browserUtils){var _isFirefox=null,_isIE=null;function IsIE(){if(null===_isIE){var t=navigator.userAgent;_isIE=t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1}return _isIE}function IsEdge(){return!IsIE()&&eval("!!window.StyleMedia")}function IsFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.IsIE=IsIE,browserUtils.IsEdge=IsEdge,browserUtils.IsFirefox=IsFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?"k-mobile":null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass})(browserUtils||(browserUtils={}))},388:t=>{t.exports=__WEBPACK_EXTERNAL_MODULE__388__}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConditionEx:()=>u,DataModelEx:()=>y,EqServerAggregatesCalculator:()=>qt,EqServerQueryStorage:()=>g,QueryColumnEx:()=>h,QueryEx:()=>f});var t=__webpack_require__(388),e=[45,128,231];Math.trunc=Math.trunc||function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)};var n={__kt:0,versionNum:"7.2",ck:function(t){if(t&&t.length)try{for(var a=function(t){for(var e=function(t){var e=t;switch((e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")).length%4){case 0:break;case 2:e+="==";break;case 3:e+="="}return window.atob(e)}(t),n=e.length,o=new Uint8Array(n),i=0;i<n;i++)o[i]=e.charCodeAt(i);return o}(t.slice(0,t.length-12)),s=t.slice(t.length-12),l=!1,c=0,u=e;c<u.length;c++){var d=r(u[c]);if(s[0]===d[0]&&s[2]===d[1]){l=!0;break}}l||(n.__kt=-1);if(s[8]!=o(9,19))return void(n.__kt=-2);if(s[1]!=o(a[3]))return;if(n.__kt=s[3]!=o(a[5])?2:3,2===n.__kt){var h="".concat(function(t){for(var e=0,n=0;n<t.length;++n)e+=i.indexOf(t[n])*Math.pow(i.length,t.length-n-1);return e}(s.substring(4,6)+s.substring(10))),p=new Date(2e3+Number.parseInt(h.substring(0,2)),Number.parseInt(h.substring(2,4))-1,Number.parseInt(h.substring(4)),0,0,0,0);Date.now()>p.getTime()&&(n.__kt=1)}}catch(t){}else this.__kt=-3}};function o(t,e){return void 0===e&&(e=20),String.fromCharCode(65+t%e)}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function r(t){for(var e="";t>0;)e=i[t%i.length]+e,t/=i.length;return e}var a,s,l,c=(a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.readOnly=!1,t.parameterized=!1,t.inJoin=!1,t}return c(o,e),o.prototype.isReadOnly=function(){return this.readOnly||this.getParent()&&this.getParent().isReadOnly()},o.prototype.setReadOnly=function(t){this.readOnly=t||this.getParent()&&this.getParent().isReadOnly(),this.conditions&&this.conditions.forEach((function(e){e.setReadOnly(t)}))},o.prototype.isParameterized=function(){return this.parameterized},o.prototype.setParameterized=function(t){this.parameterized=t},o.prototype.isInJoin=function(){return this.inJoin},o.prototype.setInJoin=function(t){this.inJoin=t},o.prototype.loadFromData=function(t,o){if(e.prototype.loadFromData.call(this,t,o),!(n.__kt<=1)&&(void 0!==o.readOnly&&this.setReadOnly(o.readOnly),void 0!==o.inJoin&&this.setInJoin(o.inJoin),void 0!==o.parameterized&&this.setParameterized(o.parameterized),o.conds))for(var i=0;i<o.conds.length;i++){var r=this.query.createCondition();r.loadFromData(t,o.conds[i]),this.conditions.push(r),r.setParent(this)}},o.prototype.saveToData=function(){var o=e.prototype.saveToData.call(this);if(n.__kt<=1)return o;if(this.isReadOnly()&&(o.readOnly=this.isReadOnly()),this.isParameterized()&&(o.parameterized=this.isParameterized()),this.isInJoin()&&(o.inJoin=this.isInJoin()),this.tag==t.CondTag.Group){o.conds=[];for(var i=0;i<this.conditions.length;i++)o.conds.push(this.conditions[i].saveToData())}return o},o}(t.Condition),d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.readOnly=!1,e}return d(e,t),e.prototype.isReadOnly=function(){return this.readOnly},e.prototype.setReadOnly=function(t){this.readOnly=t},e.prototype.loadFromData=function(e,o){t.prototype.loadFromData.call(this,e,o),n.__kt<=2||o&&void 0!==o.readOnly&&(this.readOnly=o.readOnly)},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return n.__kt<=2||this.isReadOnly()&&(e.readOnly=this.isReadOnly()),e},e}(t.QueryColumn),p=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),f=function(e){function o(t,n){return e.call(this,t,null,n)||this}return p(o,e),o.prototype.isEx=function(){return n.__kt>1},o.prototype.createSubQuery=function(){return new o(this.model,{context:this.context})},o.prototype.createCondition=function(o){return void 0===o&&(o=t.CondTag.Simple),n.__kt<=1?e.prototype.createCondition.call(this,o):new u(this,o)},o.prototype.createColumn=function(t){return void 0===t&&(t=!1),n.__kt<=1?e.prototype.createColumn.call(this,t):new h(this,t)},o.prototype.addConditionGroup=function(o,i){if(void 0===i&&(i=!0),n.__kt<=1)return e.prototype.addConditionGroup.call(this,o,i);var r=o.parent||this.getRootCondition(),a=o.linking||(r.linkType===t.LinkType.All?t.LinkType.Any:t.LinkType.All),s=this.createCondition(t.CondTag.Group);if(s.linkType=a,i){var l=this.getModel(),c=l.getFirstUICAttr();if(c){var u=l.getDefaultOperatorForAttr(c),d=this.createSimpleConditionObject(c,u,"");s.addCondition(d)}}return r.addCondition(s),s},o.prototype.addExtraConditionGroup=function(t,o){return void 0===o&&(o=!0),t.parent=t.parent||this.extraConditions,n.__kt<=1?e.prototype.addExtraConditionGroup.call(this,t,o):this.addConditionGroup(t)},o}(t.Query),g=function(){function t(t){this.context=t}return t.prototype.init=function(){},t.prototype.newQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=this.context.getModel(),o=t.modelId||(n?n.getId():"");t.queryId&&e.setId(t.queryId),t.name&&e.setName(t.name),t.description&&e.setDescription(t.description);var i={query:e.toJSONData()};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("NewQuery",{modelId:o});return this.context.getServices().getHttpClient().post(r,i).then((function(t){return t.query}))},t.prototype.getQueryList=function(t){var e=(t=t||{}).modelId||this.context.getModel().getId(),n=this.context.resolveEndpoint("GetQueryList",{modelId:e});return this.context.getServices().getHttpClient().get(n).then((function(t){return t.queries?t.queries:Promise.reject({message:"Wrong response format"})}))},t.prototype.loadQuery=function(t){t=t||{};var e=this.context.getModel(),n=this.context.getQuery(),o=t.modelId||e.getId(),i=t.queryId||n.getId(),r=this.context.resolveEndpoint("GetQuery",{modelId:o,queryId:i});return this.context.getServices().getHttpClient().get(r).then((function(t){return t.query}))},t.prototype.saveQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=t.queryId||e.getId();t.queryId&&e.setId(t.queryId);var o=t.modelId||e.getModel().getId();t.queryId&&e.setId(t.queryId);var i={query:e.toJSONData()};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("SaveQuery",{modelId:o,queryId:n});return this.context.getServices().getHttpClient().put(r,i).then((function(t){return t.query}))},t.prototype.removeQuery=function(t){t=t||{};var e=this.context.getQuery(),n=t.modelId||e.getModel().getId(),o=t.queryId||e.getId(),i={modelId:n,queryId:o};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("RemoveQuery",{modelId:n,queryId:o});return this.context.getServices().getHttpClient().delete(r,i).getPromise()},t}(),m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),y=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return m(o,e),o.prototype.buildQueryPath=function(o){if(n.__kt<=1)return e.prototype.buildQueryPath.call(this,o);if(this.mainEntity)return e.prototype.buildQueryPath.call(this,o);var i=this.getEntitiesInQuery(o);if(0==i.length)throw Error("Cannon build path. Path is empty");for(var r=new t.Tree(i[0]),a=1;a<i.length;a++){var s=i[a];if(!r.contains(s)){var l=this.findPath(r.value,s);if(null==l)throw Error("Unable to build query. Cannot build path.");r=this.addPathToTree(r,l[0]===r.value?l.slice(1):l)}}return r.setParents(),r},o.prototype.addPathToTree=function(e,n){if(0!=n.length){for(var o=!1,i=0,r=e.childs;i<r.length;i++){var a=r[i];if(a.value===n[0]){o=!0,n.length>1&&(a=this.addPathToTree(a,n.slice(1)));break}}if(!o)if(this.findLink(e.value,n[0])){var s=new t.Tree(n[0]);e.addChild(s),n.length>1&&(s=this.addPathToTree(s,n.slice(1)))}else{if(e.parent)throw Error("Unable to build query. Cannot build path.");var l=new t.Tree(e);(e=new t.Tree(n[0])).addChild(l),n.length>1&&(e=this.addPathToTree(e,n.slice(1)))}return e}},o.prototype.findPath=function(t,e){var n=[],o=[],i=[],r=[],a=!1;for(n.push(t),o.push(n),r.push(t);!a;){i=[];for(var s=0,l=o;s<l.length;s++){var c=l[s];if(a=this.checkPath(c,e,i,r)){c.push(e),n=c;break}}if(o=[],!a){if(0==i.length)return null;for(var u=0,d=i;u<d.length;u++){c=d[u];o.push(c)}}}return n},o.prototype.checkPath=function(t,e,n,o){for(var i=t[t.length-1],r=0,a=this.getLinksByEntity(i);r<a.length;r++){var s=a[r],l=null;if((l=s.entityFrom==i?s.entityTo:s.entityFrom)==e)return n=[],!0;if(t.indexOf(l)<0&&o.indexOf(l)<0){o.push(l);var c=new Array;(c=c.concat(t)).push(l),n.push(c)}}return!1},o.prototype.createQuery=function(){return new f(this)},o}(t.DataModel),v=function(){function e(e){this.context=e,this.levelsTotals=[],this.prevRow=null,this.aggrContainer=new t.EqAggregatesContainer(e)}return e.prototype.getAggrContainer=function(){return this.aggrContainer},e.prototype.initObjects=function(){var t=this;this.aggrSettings=this.context.getQuery().getAggregationSettings(),this.groups=this.aggrSettings.getGroups(),this.aggregates=this.aggrSettings.getAggregates(),this.aggrColIds=this.aggrSettings.getAggregates().map((function(t){return t.colId})),this.aggrCols=this.context.resultTable.columns.getItems().filter((function(e){return t.aggrColIds.indexOf(e.id)>=0})),this.levelsTotals=[],this.prevRow=null},e.prototype.createColumnAggregatesObject=function(){return{sum:0,min:Number.MAX_VALUE,max:Number.MIN_VALUE}},e.prototype.calculate=function(t){this.initObjects(),this.aggrContainer.clear(),(t=t||{}).maxLevel=t.maxLevel>=0?t.maxLevel:0;for(var e=this.groups.length+1,n=0;n<e;n++){var o={count:0,columns:{}};this.resetLevelTotals(o),this.levelsTotals.push(o)}var i=this.context.resultTable.getCachedRows();if(i.length>0){for(var r=0,a=i;r<a.length;r++){var s=a[r];this.processDataRow(s)}for(n=1;n<e;n++)this.flushLevelTotals(n);this.aggrSettings.hasGrandTotals()&&this.flushLevelTotals(0)}return Promise.resolve()},e.prototype.resetLevelTotals=function(t){for(var e=0,n=this.aggrCols;e<n.length;e++){var o=n[e];t.columns[o.id]=this.createColumnAggregatesObject()}t.count=0},e.prototype.processDataRow=function(t){var e=this.checkLevelChange(t);if(e>=0)for(var n=e;n<this.levelsTotals.length;n++)this.flushLevelTotals(n);this.aggrSettings.hasGrandTotals()&&this.updateLevelTotals(0,t);for(var o=1,i=0,r=this.groups;i<r.length;i++){r[i];this.updateLevelTotals(o,t),o++}this.prevRow=t},e.prototype.checkLevelChange=function(t){if(null==this.prevRow)return-1;for(var e=0;e<this.groups.length;e++)for(var n=0,o=this.groups[e].columns;n<o.length;n++){var i=o[n],r=t.getValue(i),a=this.prevRow.getValue(i);if(!this.aggrSettings.compareValues(a,r))return e+1}return-1},e.prototype.flushLevelTotals=function(t){for(var e=this.levelsTotals[t],n=t>0?this.groups[t-1]:null,o=this.aggrSettings.buildGroupKey(n,this.prevRow),i={},r=0,a=this.aggregates;r<a.length;r++){var s=a[r],l=e.columns[s.colId];i[s.colId]=this.applyAggrFunc(s.funcId,l,e)}this.aggrSettings.hasRecordCount()&&(i[this.aggrSettings.COUNT_FIELD_NAME]=e.count),this.aggrContainer.updateAggregateData(t,o,i),this.resetLevelTotals(e)},e.prototype.applyAggrFunc=function(t,e,n){switch(t){case"SUM":return e.sum;case"AVG":return e.sum/n.count;case"COUNT":case"CNTDST":return n.count;case"MIN":return e.min;case"MAX":return e.max}},e.prototype.updateLevelTotals=function(t,e){var n=this.levelsTotals[t];n.count+=1;for(var o=0,i=this.aggregates;o<i.length;o++){var r=i[o],a=e.getValue(r.colId),s=n.columns[r.colId];s.sum+=a,a<s.min&&(s.min=a),a>s.max&&(s.max=a)}},e.prototype.needRecalculation=function(){return!0},e.prototype.reset=function(){},e}();!function(t){t[t.Unknown=0]="Unknown",t[t.String=1]="String",t[t.Byte=2]="Byte",t[t.Word=3]="Word",t[t.Int32=4]="Int32",t[t.Int64=5]="Int64",t[t.Bool=6]="Bool",t[t.Float=7]="Float",t[t.Currency=8]="Currency",t[t.BCD=9]="BCD",t[t.Date=10]="Date",t[t.Time=11]="Time",t[t.DateTime=12]="DateTime",t[t.Autoinc=13]="Autoinc",t[t.Memo=14]="Memo",t[t.Blob=15]="Blob",t[t.FixedChar=16]="FixedChar",t[t.Guid=17]="Guid",t[t.Geometry=18]="Geometry",t[t.Geography=19]="Geography"}(s||(s={})),function(t){t[t.Data=0]="Data",t[t.Virtual=1]="Virtual",t[t.Lookup=2]="Lookup"}(l||(l={}));var b,C="Unknown",w="EDIT",D="DATETIME";!function(t){t.Trace="TRACE",t.Options="OPTIONS",t.Get="GET",t.Put="PUT",t.Post="POST",t.Delete="DELETE"}(b||(b={}));var x,E,T=function(){function t(t,e){this.xhr=t,this.method=e.method,this.url=e.url,this.headers=e.headers,this.queryParams=e.queryParams,this.data=e.data}return t.prototype.setHeader=function(t,e){this.headers[t]=e},t.prototype.setQueryParam=function(t,e){this.queryParams[t]=e},t.prototype.getXMLHttpRequest=function(){return this.xhr},t.prototype.getResponseHeaders=function(){if(this.xhr.readyState==this.xhr.HEADERS_RECEIVED){for(var t={},e=0,n=this.xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);e<n.length;e++){var o=n[e].split(": "),i=o.shift(),r=o.join(": ");t[i]=r}return t}return{}},t.prototype.open=function(){var t=this;if(this.xhr.readyState===this.xhr.UNSENT){var e=this.url;for(var n in this.queryParams&&Object.keys(this.queryParams).length>0&&(e+=encodeURI("?"+Object.keys(this.queryParams).map((function(e){return e+"="+t.queryParams[e]})).join("&"))),this.xhr.open(this.method,e,!0),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.headers)this.xhr.setRequestHeader(n,this.headers[n])}},t.prototype.abort=function(){this.xhr.abort()},t}();!function(t){var e,n={shortDateFormat:"MM/dd/yyyy",longDateFormat:"dd MMM, yyyy",editDateFormat:"MM/dd/yyyy",shortTimeFormat:"HH:mm",editTimeFormat:"HH:mm",longTimeFormat:"HH:mm:ss",shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longMonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],shortWeekDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longWeekDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalSeparator:".",currency:"USD"},o={localeId:"en-US",englishName:"English",displayName:"English",texts:{ButtonOK:"OK",ButtonCancel:"Cancel",Yes:"Yes",No:"No",True:"True",False:"False"},settings:n},i={"en-US":o},r=[];function a(t){for(var e=0,n=r;e<n.length;e++){(0,n[e])(t)}}function l(){return e.localeId}function c(t){var n=i[t];n?E.assignDeep(e,n):(e.englishName=t,e.displayName=t,e.texts=E.assignDeep({},o.texts)),e.localeId=t}function u(){return e.settings}function d(t){e.settings||(e.settings=E.assignDeep({},n)),e.settings=E.assignDeep(e.settings,t)}function h(t,n){a(n);var r=e;t&&(n.localeId||(n.localeId=t),(r=i[t])||(r=E.assignDeep({},o),i[t]=r)),E.assignDeep(r,n)}function p(){var t,n,o,i,r,a,s="object"==typeof navigator?navigator.language:void 0;t=s,n=new Date(2020,5,7,19,34,56,88),o=n.toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"}),i=n.toLocaleTimeString(t,{hour:"numeric",minute:"numeric",second:"numeric"}),r=o.replace("07","dd").replace("7","d").replace("06","MM").replace("6","M").replace("2020","yyyy").replace("20","yy"),a=i.replace("19","HH").replace("07","hh").replace("7","h").replace("34","mm").replace("56","ss").replace("PM","tt"),e.settings||(e.settings={}),d({shortDateFormat:r,shortTimeFormat:a})}function f(t){var e,n=u();switch(t){case s.Date:e=n.shortDateFormat;break;case s.Time:e=n.shortTimeFormat;break;default:e=n.shortDateFormat+" "+n.shortTimeFormat}return e}function g(t){var e,n=u();switch(t){case s.Date:e=n.longDateFormat;break;case s.Time:e=n.longTimeFormat;break;default:e=n.longDateFormat+" "+n.longTimeFormat}return e}t.addMapper=function(t){r.push(t)},t.getLocales=function(){var t=[];for(var e in i)t.push({locale:e,englishName:i[e].englishName,displayName:i[e].displayName});return t.sort((function(t,e){return t.englishName>e.englishName?1:t.englishName===e.englishName?0:-1}))},t.getCurrentLocale=l,t.setLocale=function(t){console.warn("This method is deprecated. Use setCurrentLocale instead"),c(t)},t.setCurrentLocale=c,t.getText=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e.texts,i="";if(t&&t.length)for(var r=t.length,a=0;a<r&&"object"==typeof(i=o[t[a]]);a++)o=i;return i},t.getLocaleSettings=u,t.getOneLocaleSetting=function(t){return e.settings[t]},t.getShortMonthName=function(t){var e=u();if(t>0&&t<13)return e.shortMonthNames[t-1];throw"Wrong month number: "+t},t.getLongMonthName=function(t){var e=u();if(t>0&&t<13)return e.longMonthNames[t-1];throw"Wrong month number: "+t},t.getShortWeekDayName=function(t){var e=u();if(t>0&&t<8)return e.shortWeekDayNames.length>=t?e.shortWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.getLongWeekDayName=function(t){var e=u();if(t>0&&t<8)return e.longWeekDayNames.length>=t?e.longWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.updateLocaleSettings=d,t.updateLocaleTexts=function(t){"object"==typeof t?(a({localeId:e.localeId,texts:t}),E.assignDeep(e.texts,t)):console.error("Wrong parameter type in updateLocaleTexts function call.The first parameter (localeId) is not necessary. Use updateLocaleTexts(texts) instead")},t.updateDefaultTexts=function(t){for(var n in i){var o=i[n];o.texts=E.assignDeep({},t,o.texts)}e.texts=E.assignDeep({},t,e.texts)},t.updateLocaleInfo=h,t.addLocale=function(t,e){h(t,e)},t.resetLocales=function(){e||(e=E.assignDeep({},o),p())},t.dateTimeToStr=function(t,e,n){return n?"d"==n?n=f(s.Date):"D"==n?n=g(s.Date):"f"==n?n=f(s.DateTime):"F"==n&&(n=g(s.DateTime)):n=f(e),E.dateTimeToStr(t,n)},t.numberToStr=function(e,n){if(n&&n.length>0){var o=n.charAt(0).toUpperCase();if("S"===o)return function(e,n){if(!m[n]){var o=n.split("|").filter((function(t){return t.length>0})).map((function(t){return t.split("=")}));if(m[n]={},o.length>0)if(o[0].length>1)for(var i=0,r=o;i<r.length;i++){var a=r[i];m[n][Number.parseInt(a[1])]=a[0]}else o.forEach((function(t,e){m[n][e]=t[0]}))}var s=m[n];if(void 0!==s[e]){a=s[e];return t.getText(a)||a}return e.toString()}(e,n.slice(1));if(["D","F","C"].indexOf(o)>=0){var i=l();return e.toLocaleString(i,function(t){var e=u(),n=t[0].toUpperCase(),o=t.length>1?Number.parseInt(t.slice(1)):"D"==n?1:2;switch(n){case"D":return{style:"decimal",useGrouping:!1,minimumIntegerDigits:o};case"C":return{style:"currency",currency:e.currency,minimumFractionDigits:o};default:return{style:"decimal",minimumFractionDigits:o,maximumFractionDigits:o}}}(n))}return function(t,e){for(var n=t.toString(),o="",i=n.length-1,r=e.length-1;r>=0;r--){var a=e.charAt(r);"#"===a||"0"===a?i>=0?(o+=n.charAt(i),i--):"0"===a&&(o+=0):o+=a}return o.split("").reverse().join("")}(Math.trunc(e),n)}var r=u();return E.numberToStr(e,r.decimalSeparator)},t.booleanToStr=function(e,n){if(n&&n.length>0&&"S"===n.charAt(0).toUpperCase()){var o=n.slice(1).split("|");if(o.length>1){var i=o[e?1:0];return t.getText(i)||i}}return"".concat(e)};var m={}}(x||(x={})),function(t){t.getAllDataTypes=function(){return Object.values(s).filter((function(t){return"number"==typeof t}))},t.getDateDataTypes=function(){return[s.Time,s.Date,s.DateTime]},t.getStringDataTypes=function(){return[s.String,s.Memo,s.FixedChar]};var e=[s.Byte,s.Word,s.Int32,s.Int64,s.Float,s.Currency,s.Autoinc];t.getNumericDataTypes=function(){return e};var n=[s.Byte,s.Word,s.Int32,s.Int64,s.Autoinc];function o(t,e,n){e||(e={});for(var r=0,a=n;r<a.length;r++){var s=a[r];if(s)for(var l in s)if(s.hasOwnProperty(l)){var c=s[l];null!==c&&"object"==typeof c?t.has(c)?e[l]=t.get(c):Array.isArray(c)?(e[l]=i(c),t.set(c,e[l])):(void 0!==e[l]&&null!=e[l]||(e[l]=Object.create(Object.getPrototypeOf(c))),t.set(c,e[l]),o(t,e[l],[c])):e[l]=c}}return e}function i(t){for(var e=[],n=0,o=t;n<o.length;n++){var i=o[n];e.push(i)}return e}t.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0;o<e.length;o++){var i=e[o];if(i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t},t.assignDeep=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return o(new WeakMap,t,e)},t.getIfDefined=function(t,e){return void 0!==t?t:e},t.IsDefinedAndNotNull=function(t){return null!=t},t.copyArrayTo=function(t,e){for(var n=t.length,o=e.length,i=0;i<n&&i<o;i++)e[i]=t[i]},t.createArrayFrom=i,t.findItemById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return t[o];return null},t.findItemIndexById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return o;return-1},t.indexOfArrayItem=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=t.length,o=0;o<n;o++)if(e==t[o])return o;return-1},t.moveArrayItem=function(t,e,n){if(e>=t.length)throw"Index out of bounds: "+e;n>=t.length&&(n=t.length-1);var o=t.splice(e,1)[0];t.splice(n,0,o)},t.removeArrayItem=function(t,e){var n=t.indexOf(e);if(-1!=n)return t.splice(n,1)[0]},t.insertArrayItem=function(t,e,n){t.splice(e,0,n)},t.fillArray=function(t,e,n,o){void 0===n&&(n=0);for(var i=t.length>>>0,r=n>>0,a=r<0?Math.max(i+r,0):Math.min(r,i),s=void 0===o?i:o>>0,l=s<0?Math.max(i+s,0):Math.min(s,i);a<l;)t[a]=e,a++;return t},t.shiftToFitWindow=function(t,e){var n=document.getElementsByTagName("body")[0],o=window.innerWidth||document.documentElement.clientWidth||n.clientWidth,i=t+e,r=0;return i>o&&t+(r=o-i-10)<0&&(r=10-t),r},t.isObject=function(t){return null!==t&&("function"==typeof t||"object"==typeof t)},t.isNumericType=function(t){return e.indexOf(t)>=0},t.isIntType=function(t){return n.indexOf(t)>=0},t.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},t.areCompatibleDataTypes=function(t,e){return void 0===t||void 0===e||t==s.Unknown||e==s.Unknown||t==e||t==s.Date&&e==s.DateTime||t==s.DateTime&&e==s.Date},t.isPropSet=function(t,e){return t[e]||t[e.toLowerCase()]||t[e.toUpperCase()]};var r="0123456789abcdefghijklmnopqrstuvwxyz";function a(t,e){var n=t.length;if(n>e){var o=n/e,i="";i+=t[0];for(var r=o,a=void 0,s=1;s<n;s++)a=t[s],s+1>r&&(i+=a,r+=o);return i}return t}function l(t,e){return Math.floor(Math.random()*(e-t))+t}function c(t){var e=parseInt(t);if(isNaN(e))throw'"'.concat(t,'" is not a valid number');return e}t.generateId=function(t){t||(t="easy");var e=t.length>4?function(t,e){var n=t.split("-"),o=1,i=e;n.length<e&&(o=e/n.length,i=n.length);for(var r="",s=0;s<i;s++)r+=a(n[s],o);return r}(t,4):t;e&&e.length>0&&(e+="-");var n=r[l(0,r.length)]+r[l(0,r.length)]+r[l(0,r.length)],o=l(0,1e4);return e+n+function(t,e){void 0===e&&(e=36);var n="",o=t;do{n=r[o%e]+n,o=Math.floor(o/=e)}while(o>0);return n}(621355968e9+1e4*(new Date).getTime()-0x8d60e562e627800-o)},t.strToDateTime=function(t,e){if(!t||0==t.length)return new Date;var n=t.replace(/[^a-zA-Z0-9_]/g,"-"),o=e.replace(/[^a-zA-Z0-9_]/g,"-").split("-"),i=n.split("-"),r=o.indexOf("MM"),a=o.indexOf("dd"),s=o.indexOf("yyyy"),l=o.indexOf("HH"),u=o.indexOf("mm"),d=o.indexOf("ss"),h=new Date;try{var p=s>-1&&s<i.length?c(i[s]):h.getFullYear(),f=r>-1&&r<i.length?c(i[r])-1:h.getMonth()-1;if(f>11)throw"";var g=a>-1&&a<i.length?c(i[a]):h.getDate();if(g>function(t,e){return new Date(e,t+1,0).getDate()}(f,p))throw"";var m=l>-1&&l<i.length?c(i[l]):0;if(m>23)throw"";var y=u>-1&&u<i.length?c(i[u]):0;if(y>59)throw"";var v=d>-1&&d<i.length?c(i[d]):0;if(v>59)throw"";return new Date(p,f,g,m,y,v)}catch(e){throw"".concat(t," is not a valid date.")}},t.strToTime=function(t){var e=t.split(":");try{var n=e.length>0?c(e[0]):0;if(n>23)throw"";var o=e.length>1?c(e[1]):0;if(o>59)throw"";var i=e.length>1?c(e[1]):0;if(i>59)throw"";return new Date(0,0,0,n,o,i)}catch(e){throw"".concat(t," is not a valid time.")}};var u=/\[([^\]]+)]|y{2,4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{2}|s{2}|t{2}/g;t.dateTimeToStr=function(t,e){var n=t.getFullYear().toString(),o=t.getMonth()+1,i=t.getDate(),r=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),l=r%12||12,c=r>11,d={yyyy:n,yy:n.substring(n.length-2),MMMM:x.getLongMonthName(o),MMM:x.getShortMonthName(o),MM:o<10?"0"+o:o.toString(),M:o.toString(),dd:i<10?"0"+i:i.toString(),d:i.toString(),HH:r<10?"0"+r:r.toString(),H:r.toString(),hh:l<10?"0"+l:l.toString(),h:l.toString(),tt:c?"PM":"AM",mm:a<10?"0"+a:a.toString(),ss:s<10?"0"+s:s.toString()};return e.replace(u,(function(t,e){return e||d[t]}))},t.numberToStr=function(t,e){return e=e||x.getLocaleSettings().decimalSeparator,t.toString().replace(".",e)}}(E||(E={}));var I,S=function(){function t(t,e){this.request=t,this.promise=e}return t.prototype.getPromise=function(){return this.promise},t.prototype.getRequest=function(){return this.request},t.prototype.then=function(t,e){return this.promise.then(t,e)},t.prototype.catch=function(t){return this.promise.catch(t)},t.prototype.finally=function(t){return this.promise.finally(t)},t}(),_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),O=function(){return O=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},O.apply(this,arguments)},M=function(t){function e(e,n){var o=t.call(this,n)||this;return o.status=e,o}return _(e,t),e}(Error),P=function(){function t(){this.defaultHeaders={},this.customPayload=void 0}return Object.defineProperty(t.prototype,"responseBody",{get:function(){return this._responseBody},enumerable:!1,configurable:!0}),t.prototype.get=function(t,e){return this.send(b.Get,t,null,e)},t.prototype.post=function(t,e,n){return this.send(b.Post,t,e,n)},t.prototype.put=function(t,e,n){return this.send(b.Put,t,e,n)},t.prototype.delete=function(t,e,n){return this.send(b.Delete,t,e,n)},t.prototype.send=function(e,n,o,i){var r=this,a=(i=i||{}).dataType||"json",s=i.contentType||"form-data"!==a?"application/json":null;o&&"form-data"!=a&&this.customPayload&&(o.data=E.assignDeep(o.data||{},this.customPayload));var l=new("onload"in new XMLHttpRequest?XMLHttpRequest:window.XDomainRequest),c={method:e,url:n,headers:O(O({},this.defaultHeaders),i.headers||{}),queryParams:i.queryParams||{},data:o};s&&(c.headers["Content-Type"]=s);var u=new T(l,c);this.beforeEachRequest&&(console.warn("HttpClient: 'beforeEachRequest' is deprecated and will be removed in future updates.\n Use 'onRequest' instead"),this.beforeEachRequest(u)),this.onRequest&&this.onRequest(u);var d=u.data&&"string"!=typeof u.data&&"json"==a?JSON.stringify(u.data):u.data;return u.open(),new S(u,new Promise((function(e,o){i.responseType&&(l.responseType=i.responseType),l.onerror=function(t){o(new M(l.status,l.responseText))},l.onreadystatechange=function(){if(4==l.readyState){var i=l.getResponseHeader("Content-Type")||"",a=l.status;if(0===a)o(new M(a,"Network error or the request was aborted"));else if(a>=200&&a<400){var s="arraybuffer"===l.responseType||"blob"===l.responseType?l.response:0==i.indexOf("application/json")?JSON.parse(l.responseText):l.responseText;r._responseBody=s,r.onResponse&&r.onResponse(l),e(s)}else{("arraybuffer"===l.responseType||"blob"===l.responseType?t.decodeArrayBuffer(l.response):Promise.resolve(l.responseText)).then((function(t){var e=0==i.indexOf("application/json")?JSON.parse(t):t;r._responseBody=e;var s=e.message||(404==a?"No such endpoint: ".concat(n):e);o(new M(a,s))}))}}},l.send(d)})))},t.decodeArrayBuffer=function(t){var e=new FileReader;return new Promise((function(n){e.onloadend=function(){e.readyState==FileReader.DONE&&n(e.result)},e.readAsText(new Blob([t]))}))},t}(),k=function(){function t(t){this.isEditable=!0,this.name="",this.caption="",this.description="",this.parent=t,this.attributes=new Array,this.subEntities=new Array}return t.prototype.loadFromData=function(t,e){if(e){if(this.id=e.id,this.name=e.name,this.captionPlural=e.namePlur,this.caption=e.name,this.description=e.desc,void 0!==e.ied&&(this.isEditable=e.ied),this.subEntities=new Array,e.ents)for(var n=0;n<e.ents.length;n++){var o=t.createEntity(this);o.loadFromData(t,e.ents[n]),this.subEntities.push(o)}if(this.attributes=new Array,e.attrs)for(n=0;n<e.attrs.length;n++){var i=t.createEntityAttr(this);i.loadFromData(t,e.attrs[n]),this.attributes.push(i)}}},t.prototype.scan=function(t,e){var n={stop:!1},o=function(i){if(e&&e(i,n),i.attributes)for(var r=i.attributes.length,a=0;a<r&&!n.stop;a++){var s=i.attributes[a];if(t&&t(s,n),n.stop)return}if(i.subEntities){var l=i.subEntities.length;for(a=0;a<l&&!n.stop;a++)o(i.subEntities[a])}};o(this)},t.prototype.getFirstPrimaryAttr=function(){return this.getPrimaryAttrs()[0]},t.prototype.getPrimaryAttrs=function(){return this.attributes.filter((function(t){return t.isPrimaryKey}))},t}(),R=function(){function t(t){this.id="",this.caption="{Unrecognized attribute}",this.dataType=s.String,this.size=0,this.isPrimaryKey=!1,this.isForeignKey=!1,this.isNullable=!0,this.showOnView=!0,this.isEditable=!0,this.showOnCreate=!0,this.showOnEdit=!0,this.showInLookup=!1,this.lookupAttr="",this.expr="",this.entity=t,this.kind=l.Data}return t.prototype.loadFromData=function(t,e){if(e){this.id=e.id,this.description=e.desc,this.caption=e.cptn,this.dataType=e.dtype,this.isPrimaryKey=e.ipk,this.isForeignKey=e.ifk,this.size=e.size,this.lookupAttr=e.lattr,this.lookupEntity=e.lent,this.dataAttr=e.dattr,this.lookupDataAttr=e.ldattr;var n=E.getDateDataTypes().indexOf(this.dataType);this.defaultValue=e.defVal&&n?new Date(e.defVal):e.defVal,this.isNullable=E.getIfDefined(e.nul,this.isNullable),this.isEditable=E.getIfDefined(e.ied,this.isEditable),this.showOnView=E.getIfDefined(e.ivis||e.sov,this.showOnView),this.showOnCreate=E.getIfDefined(e.soc,this.showOnCreate),this.showOnEdit=E.getIfDefined(e.soe,this.showOnEdit),this.showInLookup=E.getIfDefined(e.sil,this.showInLookup),this.kind=e.kind,this.displayFormat=e.dfmt,e.udata&&(this.userData=e.udata),e.edtr&&(this.defaultEditor=t.getEditorById(e.edtr)||t.createValueEditor())}},t}(),A=function(){function t(){this.id="",this.tag=C,this.resType=s.Unknown,this.defValue=""}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.tag=t.tag,this.defValue=t.defval,this.resType=t.rtype,this.accept=t.accept,this.multiline=t.multiline,t.subType&&(this.resType=t.subType),t.name&&(this.name=t.name),t.values&&(this.values=t.values))},t.prototype.getValueText=function(t){var e="";if(!this.values)return e;if(Array.isArray(t))for(var n=0,o=this.values;n<o.length;n++){var i=o[n];t.indexOf(i.id)>=0&&(e+=i.text+",")}else for(var r=0,a=this.values;r<a.length;r++){(i=a[r]).id===t&&(e+=i.text+",")}return e&&(e=e.substring(0,e.length-1)),e},t}(),L=(function(){function t(){this.mainEntity=null,this.id="__none",this.name="Empty model",this.rootEntity=this.createEntity(),this.displayFormats=new Map}t.prototype.getMainEntity=function(){return this.mainEntity},t.prototype.createEntity=function(t){return new k(t)},t.prototype.createEntityAttr=function(t){return new R(t)},t.prototype.createValueEditor=function(){return new A},t.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},t.prototype.loadFromData=function(t){if(this.id=t.id,this.name=t.name,this.version=t.vers,this.editors=new Array,t.editors)for(var e=0;e<t.editors.length;e++){var n=this.createValueEditor();n.loadFromData(t.editors[e]),this.editors.push(n)}if(this.rootEntity.loadFromData(this,t.entroot),this.displayFormats=new Map,t.displayFormats)for(var o in t.displayFormats){var i=s[o],r=t.displayFormats[o]||new Array;this.displayFormats.set(i,r)}},t.prototype.getDisplayFormats=function(){return this.displayFormats},t.prototype.getDisplayFormatsForType=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t):[]},t.prototype.getDefaultFormat=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t).filter((function(t){return t.isdef}))[0]:null},t.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},t.prototype.isEmpty=function(){return 0===this.rootEntity.subEntities.length&&0===this.rootEntity.attributes.length},t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getRootEntity=function(){return this.rootEntity},t.prototype.getEditorById=function(t){for(var e=0,n=this.editors;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},t.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},t.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},t.prototype.getEntityAttrById=function(t,e){var n,o;if(t.attributes){var i=t.attributes.length;for(n=0;n<i;n++)if(t.attributes[n].id==e)return t.attributes[n]}if(t.subEntities){var r=t.subEntities.length;for(n=0;n<r;n++)if(o=this.getEntityAttrById(t.subEntities[n],e))return o}return null},t.prototype.listByEntityWithFilter=function(t,e){var n,o=new Array,i=null;if(t.subEntities)for(var r=t.subEntities.length,a=0;a<r;a++){if(i=t.subEntities[a],!e||e(i,null))(n=x.getText("Entities",i.name))||(n=i.caption),(u=E.assign(this.createEntity(),{id:i.name,text:n,items:[],isEntity:!0})).items=this.listByEntityWithFilter(i,e),u.items.length>0&&o.push(u)}var s=null;if(t.attributes)for(var l=t.attributes.length,c=0;c<l;c++)if(s=t.attributes[c],!e||e(t,s)){(n=x.getText("Attributes",s.id))||(n=s.caption);var u=E.assign(this.createEntity(),{id:s.id,text:n,dataType:s.dataType});o.push(u)}return o},t.prototype.listByEntity=function(t,e,n){e=e||{};var o,i=[],r=[],a=null;if(t.subEntities)for(var s=t.subEntities.length,l=0;l<s;l++)if(a=t.subEntities[l],!n||n(a,null)){o=x.getText("Entities",a.name)||a.caption;var c=E.assign(this.createEntity(),{id:a.name,text:o,items:[],isEntity:!0,description:a.description}),u=E.assign({},e);u.includeRootData=!1,c.items=this.listByEntity(a,u,n),c.items.length>0&&i.push(c)}var d=null;if(t.attributes)for(var h=t.attributes.length,p=0;p<h;p++)d=t.attributes[p],n&&!n(t,d)||(o=x.getText("Attributes",d.id)||d.caption,r.push(E.assign(this.createEntityAttr(t),{id:d.id,text:o,dataType:d.dataType,lookupAttr:d.lookupAttr,description:d.description})));var f,g=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(i.sort(g),r.sort(g)),f=e.attrPlacement&&0!=e.attrPlacement?r.concat(i):i.concat(r),2==e.attrPlacement&&f.sort(g),e.includeRootData?((o=x.getText("Entities",t.name))||(o=t.caption),{id:t.name,text:o,items:f}):f},t.prototype.clear=function(){this.rootEntity=this.createEntity(),this.editors=[],this.version=""},t.prototype.addDefaultValueEditors=function(){this.addOrUpdateValueEditor("_DTE",w,s.String).defValue="",this.addOrUpdateValueEditor("_DPDE",D,s.DateTime),this.addOrUpdateValueEditor("_DPTE",D,s.DateTime)},t.prototype.addOrUpdateValueEditor=function(t,e,n){var o=E.findItemById(this.editors,t);return o||((o=this.createValueEditor()).id=t,this.editors.push(o)),o.tag=e,o.resType=n,o},t.prototype.getEntitiesTree=function(t,e){return this.listByEntity(this.getRootEntity(),t,e)},t.prototype.getEntitiesTreeWithFilter=function(t){return this.listByEntityWithFilter(this.getRootEntity(),t)},t.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},t.prototype.getEntityPathByAttr=function(t,e,n,o){if(!t)return"";n=n||" ";var i="";if(t.caption&&!o){var r=x.getText("Entities",t.caption);i=r||t.caption}if(t.attributes)for(var a=t.attributes.length,s=0;s<a;s++)if(t.attributes[s].id==e)return i;if(t.subEntities){var l=t.subEntities.length;for(s=0;s<l;s++){var c=t.subEntities[s],u=this.getEntityPathByAttr(c,e,n,!1);if(""!==u)return""!==i&&(u=i+n+u),u}}return""},t.prototype.getAttributeText=function(t,e){var n=x.getText("Attributes",t.id);if(n||(n=t.caption),!e)return n;var o=this.getFullEntityPathByAttr(t.id," ");return(o?e.replace(new RegExp("{attr}","g"),n).replace(new RegExp("{entity}","g"),o):n).trim()},t.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},t.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,o){t(n)&&(o.stop=!0,e=n)}),null),e}}(),function(){return L=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},L.apply(this,arguments)});!function(){function t(t){this.colStore=t,this.aggregates=[],this.groups=[],this.useGrandTotals=!1,this.useRecordCount=!1,this._caseSensitiveGroups=!1,this.COUNT_FIELD_NAME="GRPRECCNT"}Object.defineProperty(t.prototype,"caseSensitiveGroups",{get:function(){return this._caseSensitiveGroups},set:function(t){this._caseSensitiveGroups=t,this.updateCompareProc()},enumerable:!1,configurable:!0}),t.prototype.updateCompareProc=function(){this.compareValues=this._caseSensitiveGroups?this.strictCompare:this.caseInsensitiveCompare},t.prototype.addGroup=function(t){var e=t.columns||this.colStore.getColumnIds(t.from,t.to);if(!this.colStore.validateColumns(e))throw"Invalid columns: "+e;if(this.hasColumnsInUse(e))throw"Can't add same columns to different groups/aggregates";return this.groups.push(L({columns:e},t)),this},t.prototype.addAggregateColumn=function(t,e){var n="string"==typeof t?t:this.colStore.getColumnIds(t,t)[0];if(this.hasColumnsInUse([n])||!this.colStore.validateAggregate(n,e))throw"Invalid aggregation function for the column: "+n;return this.aggregates.push({colId:n,funcId:e}),this},t.prototype.addGrandTotals=function(){return this.useGrandTotals=!0,this},t.prototype.addCounts=function(){return this.useRecordCount=!0,this},t.prototype.getGroups=function(){var t=this,e=[];return this.groups.map((function(n){return e=e.concat(n.columns),L(L({},n),{columns:Array.from(e),aggregates:Array.from(t.aggregates)})}))},t.prototype.getInternalGroups=function(){return this.groups},t.prototype.lastGroup=function(){var t=this.getGroups();return t[t.length-1]},t.prototype.getAggregates=function(){return this.aggregates},t.prototype.hasAggregates=function(){return this.aggregates.length>0},t.prototype.hasGroups=function(){return this.groups.length>0},t.prototype.hasGrandTotals=function(){return this.useGrandTotals},t.prototype.hasRecordCount=function(){return this.useRecordCount},t.prototype.isEmpty=function(){return!(this.hasAggregates()||this.hasGroups()||this.hasAggregates()||this.hasRecordCount())},t.prototype.drop=function(){console.warn('"drop()" method is obsolete. Use "clear()" instead'),this.clear()},t.prototype.clear=function(){return this.groups=[],this.aggregates=[],this.useGrandTotals=!1,this.useRecordCount=!1,this.caseSensitiveGroups=!1,this},t.prototype.hasColumnsInUse=function(t){for(var e=0,n=this.groups;e<n.length;e++){if(n[e].columns.filter((function(e){return t.indexOf(e)>=0})).length>0)return!0}for(var o=0,i=this.aggregates;o<i.length;o++){var r=i[o];if(t.indexOf(r.colId)>=0)return!0}return!1},t.prototype.needAggrCalculation=function(){return(this.hasAggregates()||this.hasRecordCount())&&(this.hasGrandTotals()||this.hasGroups())},t.prototype.saveToData=function(){return{groups:Array.from(this.groups),ugt:this.useGrandTotals,urc:this.useRecordCount,csg:this.caseSensitiveGroups,aggregates:Array.from(this.aggregates)}},t.prototype.loadFromData=function(t){t&&(void 0!==t.ugt&&(this.useGrandTotals=t.ugt),void 0!==t.urc&&(this.useRecordCount=t.urc),void 0!==t.csg&&(this.caseSensitiveGroups=t.csg),t.groups&&(this.groups=Array.from(t.groups)),t.aggregates&&(this.aggregates=Array.from(t.aggregates)))},t.prototype.buildGroupKey=function(t,e){var n=!this.caseSensitiveGroups,o={};if(t)for(var i=0,r=t.columns;i<r.length;i++){var a=r[i],s=e.getValue(a);n&&"string"==typeof s&&(s=s.toLowerCase()),o[a]=s}return o},t.prototype.strictCompare=function(t,e){return t instanceof Date?t.getTime()===e.getTime():t===e},t.prototype.caseInsensitiveCompare=function(t,e){return t instanceof Date?t.getTime()===e.getTime():("string"==typeof t?t.toLowerCase():t)===("string"==typeof e?e.toLowerCase():e)}}();!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(I||(I={}));var N,F=function(t){if(!t)throw Error("Options are required");if(!t.id)throw Error("Field Id is required");if(!t.label)throw Error("Label is required");this.id=t.id,this.type=E.getIfDefined(t.type,s.String),this.label=t.label,this.originAttrId=t.originAttrId,this.isAggr=t.isAggr||!1,this.displayFormat=t.dfmt,this.groupFooterColumnTemplate=t.gfct,this.style=t.style||{},this.description=t.description,this.calculatedWidth=0},B=function(){function t(){this.items=[],this.mapper={},this._dateColumnIdx=[]}return Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var e;e=t instanceof F?t:new F(t);var n=this.items.length;return this.items.push(e),this.mapper[e.id]=n,[s.Date,s.DateTime,s.Time].indexOf(e.type)>=0&&this._dateColumnIdx.push(n),n},t.prototype.updateDateColumnIdx=function(){this._dateColumnIdx=this.getItems().filter((function(t){return[s.Date,s.DateTime,s.Time].indexOf(t.type)>=0})).map((function(t,e){return e}))},t.prototype.put=function(t,e){t>=0&&t<this.count&&(this.items[t]=e,this.updateDateColumnIdx())},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&(E.moveArrayItem(this.items,n,e),this.updateDateColumnIdx())},t.prototype.get=function(t){return t>=0&&t<this.count?this.items[t]:null},t.prototype.getIndex=function(t){return this.mapper[t]},t.prototype.getItems=function(){return this.items},t.prototype.getDateColumnIndexes=function(){return this._dateColumnIdx},t.prototype.removeAt=function(t){var e=this.get(t);this.items.splice(t,1);var n=this._dateColumnIdx.indexOf(t);n>=0&&this._dateColumnIdx.splice(n,1),delete this.mapper[e.id]},t.prototype.clear=function(){this.items=[],this._dateColumnIdx=[],this.mapper={}},t}(),q=function(){function t(t,e){this.columns=t,this.values=e}return t.prototype.toArray=function(){return Array.from(this.values)},t.prototype.size=function(){return this.values.length},t.prototype.getValue=function(t){var e;if("string"==typeof t){if(void 0===(e=this.columns.getIndex(t)))throw new RangeError("No column with id '".concat(t,"'"))}else e=t;if(e>=this.values.length)throw new RangeError("Out of range: "+e);return this.values[e]},t.prototype.setValue=function(t,e){var n;if("string"==typeof t){if(void 0===(n=this.columns.getIndex(t)))throw new RangeError("No column with id '".concat(t,"'"))}else n=t;if(n>=this.values.length)throw new RangeError("Out of range: "+n);this.values[n]=e},t}(),H=function(){function t(t){if(this._chunkSize=1e3,this._elasticChunks=!1,this.cachedRows=[],this.total=0,this.loader=null,this.needTotal=!0,this.isInMemory=!1,t=t||{},this._chunkSize=t.chunkSize||this._chunkSize,this._elasticChunks=t.elasticChunks||this._elasticChunks,this.loader=t.loader,void 0!==t.inMemory&&(this.isInMemory=t.inMemory),this.isInMemory&&(this.needTotal=!1),this._columns=new B,this.onUpdate=t.onUpdate,t.columns)for(var e=0,n=t.columns;e<n.length;e++){var o=n[e];this._columns.add(o)}if(t.rows)for(var i=0,r=t.rows;i<r.length;i++){var a=r[i],s=this.createRow(a);this.addRow(s)}this.needTotal=!this._elasticChunks}return Object.defineProperty(t.prototype,"columns",{get:function(){return this._columns},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"chunkSize",{get:function(){return this._chunkSize},set:function(t){this._chunkSize=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"elasticChunks",{get:function(){return this._elasticChunks},set:function(t){this._elasticChunks=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!1,configurable:!0}),t.prototype.getRows=function(t){var e=this,n=0,o=this._chunkSize;t&&("page"in t?(n=t.pageSize*(t.page-1),o=t.pageSize):(n=t.offset,o=t.limit));var i=n+o;if(!this.needTotal&&!this.elasticChunks){if(n>=this.total)return Promise.resolve([]);i>this.total&&(i=this.total)}if(this.isInMemory&&i>this.cachedRows.length&&(i=this.cachedRows.length),i<=this.cachedRows.length)return Promise.resolve(this.cachedRows.slice(n,i));if(!this.loader)throw"Loader is not defined. Can't get the rows from ".concat(n," to ").concat(i);var r=this.needTotal;this.needTotal&&(this.needTotal=!1);var a=this.cachedRows.length,s=i-a;return s<this._chunkSize&&(s=this._chunkSize),this.loader.loadChunk({offset:a,limit:s,needTotal:r}).then((function(t){(r&&(e.total=t.total),Array.prototype.push.apply(e.cachedRows,t.table.getCachedRows()),i>e.cachedRows.length&&(i=e.cachedRows.length),e.elasticChunks)&&(t.table.getCachedCount()<s&&(e.total=e.cachedRows.length));return e.fireUpdated(),e.cachedRows.slice(n,i)}))},t.prototype.getRow=function(t){return this.getRows({offset:t,limit:1}).then((function(t){return t.length>0?t[0]:null}))},t.prototype.getTotal=function(){return this.total},t.prototype.setTotal=function(t){this.total=t,this.needTotal=!1},t.prototype.getCachedCount=function(){return this.cachedRows.length},t.prototype.clear=function(){this.columns.clear(),this.cachedRows=[],this.total=0,this.needTotal=!this._elasticChunks,this.fireUpdated()},t.prototype.createRow=function(t){var e=this,n=this._columns.getDateColumnIndexes(),o=new Array(this._columns.count),i=t instanceof q?function(e){return t.getValue(e)}:function(e){return t[e]};return t&&this.columns.getItems().forEach((function(t){var r=i(t.id),a=e.columns.getIndex(t.id);o[a]=n.indexOf(a)>=0?e.mapDate(r,t.type):r})),new q(this._columns,o)},t.prototype.mapDate=function(t,e){if(t){var n=new Date(t);return isNaN(n.getTime())&&e==s.Time&&(n=E.strToTime(t)),n}return null},t.prototype.addRow=function(t){var e;if(Array.isArray(t)){var n=t,o=this._columns.getDateColumnIndexes();if(o.length>0)for(var i=0,r=o;i<r.length;i++){var a=r[i];n[a]&&(n[a]=this.mapDate(n[a],this._columns.get(a).type))}e=new q(this._columns,n)}else e=this.createRow(t);this.cachedRows.push(e);var s=this.getCachedCount();return s>this.total&&(this.total=s),e},t.prototype.getCachedRows=function(){return this.cachedRows},t.prototype.totalIsKnown=function(){return this.elasticChunks?this.getCachedCount()===this.total:!this.needTotal},t.prototype.fireUpdated=function(){this.onUpdate&&this.onUpdate(this)},t}(),j=function(){function t(){}return t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t}(),z=function(){function t(t){this.silentMode=0,this.events=new Array,this.source=t}return t.prototype.subscribe=function(t,e){var n=this.getEventRecByType(t),o={id:j.newGuid(),callback:e};return n?n.eventCallbacks.push(o):(n={type:t,eventCallbacks:new Array(o)},this.events.push(n)),o.id},t.prototype.unsubscribe=function(t,e){var n=this.getEventRecByType(t);if(n){var o=-1;for(o=0;o<n.eventCallbacks.length&&n.eventCallbacks[o].id!==e;o++);o>=0&&n.eventCallbacks.splice(o,1)}},t.prototype.fire=function(t,e,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),!this.silentMode||o){var i=this.getEventRecByType(t);if(i){var r={type:t,source:this.source,data:e},a=function(){for(var t=0,e=i.eventCallbacks;t<e.length;t++){e[t].callback(r)}};n>0?setTimeout(a,n):a()}}},t.prototype.enterSilentMode=function(){this.silentMode++},t.prototype.exitSilentMode=function(){this.silentMode&&this.silentMode--},t.prototype.isSilent=function(){return this.silentMode>0},t.prototype.getEventRecByType=function(t){for(var e=0,n=this.events;e<n.length;e++){var o=n[e];if(o.type==t)return o}return null},t}();!function(t){t.renderLiquidTemplate=function(t,e){var n=t;if(e)for(var o in e){var i=new RegExp("{{"+o+"}}","g");n=n.replace(i,e[o])}return n}}(N||(N={})),x.resetLocales(),"function"!=typeof Object.values&&(Object.values=function(t){return Object.keys(t).map((function(e){return t[e]}))}),"function"!=typeof Math.trunc&&(Math.trunc=function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)});__webpack_require__(789);function G(t){var e={x:0,y:0};if(null!==t){var n=function(t){var e,n={top:0,right:0,bottom:0,left:0,width:0,height:0};try{e=t.getBoundingClientRect()}catch(t){e=n}var o=document.body,i=document.documentElement,r=function(){var t=document.body,e=document.documentElement;return{top:window.pageYOffset||e.scrollTop||t.scrollTop,left:window.pageXOffset||e.scrollLeft||t.scrollLeft}}(),a=r.top,s=r.left,l=i.clientTop||o.clientTop||0,c=i.clientLeft||o.clientLeft||0,u=e.top+a-l,d=e.left+s-c;return{top:Math.round(u),left:Math.round(d)}}(t);e={x:n.left,y:n.top}}return e}var V="eqjs";var U=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),W=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},Y=function(){function t(t,e){this.element="string"==typeof t?document.createElement(t):t,e&&this.element.parentElement!==e&&e.appendChild(this.element)}return t.prototype.addChild=function(t,e){var n=X(t,this.element);return e&&e(n),this},t.prototype.addChildElement=function(t){return t&&this.element.appendChild(t),this},t.prototype.attr=function(t,e){return this.element.setAttribute(t,e),this},t.prototype.id=function(t){return this.attr("id",t)},t.prototype.focus=function(){return this.element.focus(),this},t.prototype.title=function(t){return this.attr("title",t)},t.prototype.data=function(t,e){return void 0===e&&(e=null),null===e?(this.element.removeAttribute("data-"+t),this):this.attr("data-"+t,e)},t.prototype.show=function(){return this.removeStyle("display")},t.prototype.hide=function(t){return void 0===t&&(t=!0),t?this.setStyle("display","none"):this},t.prototype.visible=function(t){return void 0===t&&(t=!0),t?this.setStyle("visibility","visible"):this.setStyle("visibility","hidden")},t.prototype.isVisible=function(){return!!(this.element.offsetWidth||this.element.offsetHeight||this.element.getClientRects().length)},t.prototype.addClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=W(W([],t.trim().split(" "),!0),e,!0),i=0;i<o.length;i++)this.element.classList.add(o[i]);return this},t.prototype.removeClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=W(W([],t.trim().split(" "),!0),e,!0),i=0;i<o.length;i++)this.element.classList.remove(o[i]);return this},t.prototype.toggleClass=function(t,e){return void 0===e&&(e=void 0),t&&this.element.classList.toggle(t,e),this},t.prototype.on=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.addEventListener(n[o],e);return this},t.prototype.off=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.removeEventListener(n[o],e);return this},t.prototype.setStyle=function(t,e){return this.element.style.setProperty(t,e),this},t.prototype.removeStyle=function(t){return this.element.style.removeProperty(t),this},t.prototype.text=function(t){return this.element.innerText=t,this},t.prototype.html=function(t){return this.element.innerHTML=t,this},t.prototype.clear=function(){var t=this.element;this.element=document.createElement(this.element.tagName),t.replaceWith(this.element)},t.prototype.addText=function(t){var e=document.createTextNode(t);return this.element.appendChild(e),this},t.prototype.addHtml=function(t){return this.element.innerHTML+=t,this},t.prototype.toDOM=function(){return this.element},t.prototype.appendTo=function(t){return t&&t.appendChild(this.element),this},t}(),Q=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"textarea",n)||this}return U(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.rows=function(t){return this.element.rows=t,this},e.prototype.cols=function(t){return this.element.cols=t,this},e.prototype.value=function(t){return this.element.value=t,this},e}(Y),J=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"input",n)||this}return U(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.type=function(t){return this.element.type=t,this},e.prototype.size=function(t){return this.element.size=t,this},e.prototype.value=function(t){return t instanceof Date?this.element.valueAsDate=t:"number"==typeof t?this.element.valueAsNumber=t:this.element.value=t,this},e.prototype.mask=function(t){return function(t,e){var n={9:"[0-9]",a:"[a-z]"},o=e.split(""),i=function(e){if("focus"!==e.type||""===t.value){var i=[],r=t.selectionStart;o.forEach((function(e,o){if(n[e]){var r=new RegExp(n[e],"i").test(t.value.charAt(o));i.push(r?t.value.charAt(o):"_")}else i.push(e)})),t.value=i.join(""),t.selectionStart=t.selectionEnd=r}};t.addEventListener("keydown",(function(e){if(8===e.keyCode||46===e.keyCode){e.preventDefault();var i=[],r=t.selectionStart;if(0==r)return;for(var a=r,s=!0,l=o.length-1;l>=0;l--){var c=o[l];if(n[c]){var u=new RegExp(n[c],"i").test(t.value.charAt(l));u&&l!=r-1&&(s=!1),l===r-1&&a--,i.push(u&&l!=r-1?t.value.charAt(l):"_")}else l===a-1&&a--,r-1===l&&r--,i.push(c)}t.value=s?"":i.reverse().join(""),t.selectionStart=t.selectionEnd=a<0?0:a;var d=document.createEvent("Event");d.initEvent("input",!0,!0),t.dispatchEvent(d)}})),t.addEventListener("keypress",(function(e){var i=String.fromCharCode(e.charCode);if(i){e.preventDefault();var r=[],a=t.selectionStart,s=a;o.forEach((function(e,o){if(n[e]){var l=o!=a?t.value.charAt(o):i,c=new RegExp(n[e],"i").test(l);r.push(c?l:"_"),c&&a===o&&s++}else r.push(e),s===o&&s++,a===o&&a++})),t.value=r.join(""),t.selectionStart=t.selectionEnd=s;var l=document.createEvent("Event");l.initEvent("input",!0,!0),t.dispatchEvent(l)}})),t.addEventListener("input",i),t.addEventListener("focus",i)}(this.element,t),this},e}(Y),K=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"select",n)||this}return U(e,t),e.prototype.addOption=function(t){var e=document.createElement("option");return"string"==typeof t?(e.value=t,e.innerHTML=t):(e.value=t.value,e.innerHTML=t.title||t.value,e.selected=t.selected||!1),this.element.appendChild(e),this},e.prototype.value=function(t){return this.element.value=t,this},e}(Y);function X(t,e){return"div"===t||t instanceof HTMLDivElement||"span"===t||t instanceof HTMLSpanElement||"a"===t||t instanceof HTMLAnchorElement||"button"===t||t instanceof HTMLButtonElement||"img"===t||t instanceof HTMLImageElement?new Y(t,e):"input"===t||t instanceof HTMLInputElement?new J(t instanceof HTMLInputElement?t:null,e):"textarea"===t||t instanceof HTMLTextAreaElement?new Q(t instanceof HTMLTextAreaElement?t:null,e):"select"===t||t instanceof HTMLSelectElement?new K(t instanceof HTMLSelectElement?t:null,e):new Y(t,e)}var Z,$="undefined"!=typeof TouchEvent;!function(t){t.None="none",t.Allow="allow",t.Forbid="forbid"}(Z||(Z={}));var tt,et=function(t,e,n){this.dropEffect=Z.Allow,this.pageX=0,this.pageY=0,this.item=t,this.dragImage=e,this.data=t.data,this.sourceEvent=n,n&&n instanceof MouseEvent&&(this.pageX=n.pageX,this.pageY=n.pageY),n&&$&&n instanceof TouchEvent&&n.touches[0]&&(this.pageX=n.touches[0].pageX,this.pageY=n.touches[0].pageY)},nt=function(t){t&&t instanceof MouseEvent&&(this.x=t.pageX,this.y=t.pageY),t&&$&&t instanceof TouchEvent&&t.touches[0]&&(this.x=t.touches[0].pageX,this.y=t.touches[0].pageY)},ot=new(function(){function t(){this.delta=5,this.draggableItem=null,this.dragImage=null,this.finishedSuccessfully=!1,this.mouseDownPosition=null,this.containerDescriptors=[],this.containerDescriptorIndex=-1,this.dropEffect=Z.None,this.classPrefix="eqjs-drop",this.DRAG_DISABLED_ATTR="drag-disabled"}return t.prototype.registerDraggableItem=function(t){var e=this,n=t.element;if(!n)throw Error("Element in draggle item is null or undefined");n.ondragstart=function(){return!1};var o=function(t){if(!n.hasAttribute(e.DRAG_DISABLED_ATTR)){t.preventDefault(),t instanceof MouseEvent&&t.stopPropagation();var o=new nt(t);(Math.abs(o.x-e.mouseDownPosition.x)>e.delta||Math.abs(o.y-e.mouseDownPosition.y)>e.delta)&&r(t)}},i=function(t){e.mouseMoveDragListener(t)},r=function(r){r.preventDefault(),r.stopPropagation(),n.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),e.finishedSuccessfully=!1,t.beforeDragStart&&t.beforeDragStart(),e.dragImage=X("div").setStyle("position","absolute").setStyle("z-index","65530").toDOM(),document.body.appendChild(e.dragImage),e.dragImage.appendChild(n.cloneNode(!0)),t.renderer&&t.renderer(e.dragImage),e.dropEffect=Z.None,e.updateCusror(e.dropEffect),e.updateImageClass(e.dropEffect),e.draggableItem={element:n,scope:t.scope,data:t.data},e.updateDragItemPosition(r);var a=new et(e.draggableItem,e.dragImage,r);a.dropEffect=e.dropEffect,t.onDragStart&&t.onDragStart(a),e.dropEffect!==a.dropEffect&&(e.dropEffect=a.dropEffect,e.updateImageClass(e.dropEffect)),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0)},a=function(t){$&&t instanceof TouchEvent&&t.preventDefault(),e.mouseDownPosition=new nt(t),n.addEventListener("mousemove",o),n.addEventListener("touchmove",o),document.addEventListener("mouseup",s),document.addEventListener("touchend",s)};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a);var s=function(t){e.mouseDownPosition=null,n.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),document.removeEventListener("mousemove",i,!0),document.removeEventListener("touchmove",i,!0),e.draggableItem&&l(t)},l=function(n){try{if(e.containerDescriptorIndex>=0){var o=e.containerDescriptors[e.containerDescriptorIndex],i={element:o.element,scopes:o.scopes,data:o.data},r=new et(e.draggableItem,e.dragImage,n);try{i.scopes.indexOf(e.draggableItem.scope)>=0&&e.dropEffect===Z.Allow&&(e.finishedSuccessfully=!0,o.onDrop&&o.onDrop(i,r))}finally{o.onDragLeave&&o.onDragLeave(i,r)}}}finally{try{var a=new et(e.draggableItem,e.dragImage,n);a.data.finishedSuccessfully=e.finishedSuccessfully,t.onDragEnd&&t.onDragEnd(a)}finally{e.draggableItem=null,e.dragImage&&e.dragImage.parentElement&&e.dragImage.parentElement.removeChild(e.dragImage),e.dragImage=null,e.finishedSuccessfully=!1,document.removeEventListener("mouseup",s),document.removeEventListener("touchend",s)}}}},t.prototype.registerDropContainer=function(t){if(!t.element)throw Error("Element in drop container is null or undefined");this.containerDescriptors.push(t)},t.prototype.removeDropContainer=function(t){var e=this.containerDescriptors.filter((function(e){return e===t||e.element==t}));if(e)for(var n=0,o=e;n<o.length;n++){var i=o[n];E.removeArrayItem(this.containerDescriptors,i)}},t.prototype.mouseMoveDragListener=function(t){if(t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation(),this.updateDragItemPosition(t),-1==this.containerDescriptorIndex){for(var e=0;e<this.containerDescriptors.length;e++){var n=this.containerDescriptors[e];if(this.detectDragEnterEvent(n.element,t)){this.containerDescriptorIndex=e;break}}this.containerDescriptorIndex>=0&&this.dragEnterEvent(t)}else{n=this.containerDescriptors[this.containerDescriptorIndex];this.detectDragLeaveEvent(n.element,t)&&(this.dragLeaveEvent(t),this.containerDescriptorIndex=-1)}if(this.containerDescriptorIndex>=0){var o={element:(n=this.containerDescriptors[this.containerDescriptorIndex]).element,scopes:n.scopes,data:n.data};if(o.scopes.indexOf(this.draggableItem.scope)>=0){var i=new et(this.draggableItem,this.dragImage,t);i.dropEffect=this.dropEffect,n.onDragOver&&n.onDragOver(o,i)}}},t.prototype.updateCusror=function(t){switch(t){case Z.Allow:this.setCursorStyle(this.dragImage,"grabbing");break;case Z.Forbid:this.setCursorStyle(this.dragImage,"no-drop");break;default:this.setCursorStyle(this.dragImage,"grabbing")}},t.prototype.updateImageClass=function(t){switch(this.dragImage.classList.remove("".concat(this.classPrefix,"-allow")),this.dragImage.classList.remove("".concat(this.classPrefix,"-forbid")),this.dragImage.classList.remove("".concat(this.classPrefix,"-none")),t){case Z.Allow:this.dragImage.classList.add("".concat(this.classPrefix,"-allow"));break;case Z.None:this.dragImage.classList.add("".concat(this.classPrefix,"-none"));break;case Z.Forbid:this.dragImage.classList.add("".concat(this.classPrefix,"-forbid"));break;default:this.dragImage.classList.add("".concat(this.classPrefix,"-none"))}},t.prototype.setCursorStyle=function(t,e){if(t){t.style.cursor=e;for(var n=0;n<t.children.length;n++)this.setCursorStyle(t.children[n],e)}},t.prototype.updateDragItemPosition=function(t){if(this.dragImage){var e=new nt(t);this.dragImage.style.top=e.y-this.dragImage.offsetHeight/2+"px",this.dragImage.style.left=e.x-this.dragImage.offsetWidth/2+"px"}},t.prototype.dragEnterEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var o=new et(this.draggableItem,this.dragImage,t);o.dropEffect=Z.Allow,e.onDragEnter&&e.onDragEnter(n,o),this.dropEffect=o.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}else this.dropEffect!==Z.Forbid&&(this.dropEffect=Z.None,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect))},t.prototype.dragLeaveEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var o=new et(this.draggableItem,this.dragImage,t);o.dropEffect=Z.None,e.onDragLeave&&e.onDragLeave(n,o),this.dropEffect=o.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}},t.prototype.detectDragEnterEvent=function(t,e){var n=G(t),o=new nt(e);return!(o.y<n.y||o.y>n.y+t.offsetHeight)&&!(o.x<n.x||o.x>n.x+t.offsetWidth)},t.prototype.detectDragLeaveEvent=function(t,e){var n=G(t),o=new nt(e);return!(o.y>n.y&&o.y<n.y+t.offsetHeight&&o.x>n.x&&o.x<n.x+t.offsetWidth)},t}());!function(t){t[t.Always=0]="Always",t[t.Once=1]="Once",t[t.Never=2]="Never"}(tt||(tt={}));var it,rt="keg",at=/{0:(.*?)}/g;!function(t){t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.DATETIME=3]="DATETIME",t[t.BOOL=4]="BOOL"}(it||(it={}));var st,lt=function(t,e,n,o){var i=t?t.toString().replace(/\n/g,"↵ "):"";n.innerText=i,n.title=i,e.align==st.NONE&&n.classList.add("".concat(rt,"-cell-value-align-left"))},ct=function(t,e,n,o){var i=(t||"").toString();"number"==typeof t&&(i=e.dataColumn&&e.dataColumn.displayFormat&&at.test(e.dataColumn.displayFormat)?e.dataColumn.displayFormat.replace(at,(function(e,n){return x.numberToStr(t,n)})):t.toLocaleString()),n.innerText=i,n.title=i,e.align==st.NONE&&n.classList.add("".concat(rt,"-cell-value-align-right"))},ut=function(t,e,n,o){var i="[object Date]"===Object.prototype.toString.call(t),r=(t||"").toString();if(i)if(e.dataColumn&&e.dataColumn.displayFormat&&at.test(e.dataColumn.displayFormat))r=e.dataColumn.displayFormat.replace(at,(function(n,o){return x.dateTimeToStr(t,e.type,o)}));else{var a=x.getCurrentLocale(),l={hour:"numeric",minute:"numeric",second:"numeric"};switch(e.type){case s.Date:r=t.toLocaleDateString(a);break;case s.Time:r=t.toLocaleTimeString(a,l);break;case s.DateTime:r="".concat(t.toLocaleDateString(a)," ").concat(t.toLocaleTimeString(a,l))}}n.innerText=r,n.title=r,e.align==st.NONE&&n.classList.add("".concat(rt,"-cell-value-align-right"))},dt=function(t,e,n,o){if(e.dataColumn&&e.dataColumn.displayFormat&&at.test(e.dataColumn.displayFormat)){var i=e.dataColumn.displayFormat.replace(at,(function(e,n){return x.booleanToStr(t,n)}));return lt(i,e,n)}n.classList.add("".concat(rt,"-cell-value-bool")),n.classList.add("".concat(rt,"-").concat(t?"cell-value-true":"cell-value-false"))},ht=function(){function t(t){this.renderers={},this.defaultRenderers={},this.registerRenderer("StringDefault",lt),this.setDefaultRenderer(it.STRING,lt),this.registerRenderer("NumberDefault",ct),this.setDefaultRenderer(it.NUMBER,ct),this.registerRenderer("DateTimeDefault",ut),this.setDefaultRenderer(it.DATETIME,ut),this.registerRenderer("BoolDefault",dt),this.setDefaultRenderer(it.BOOL,dt)}return t.prototype.getDefaultRenderer=function(t){var e=this.getCellType(t);return this.defaultRenderers[it[e]]},t.prototype.getDefaultRendererByType=function(t){return this.defaultRenderers[it[t]]},t.prototype.setDefaultRenderer=function(t,e){e&&(this.defaultRenderers[it[t]]=e)},t.prototype.getRenderer=function(t){return this.renderers[t]},t.prototype.registerRenderer=function(t,e){this.renderers[t]=e},t.prototype.getCellType=function(t){switch(t){case s.Autoinc:case s.Byte:case s.Word:case s.Currency:case s.Float:case s.Int32:case s.Int64:return it.NUMBER;case s.Date:case s.DateTime:case s.Time:return it.DATETIME;case s.Bool:return it.BOOL;default:return it.STRING}},t}();!function(t){t[t.NONE=1]="NONE",t[t.LEFT=2]="LEFT",t[t.CENTER=3]="CENTER",t[t.RIGHT=4]="RIGHT"}(st||(st={}));var pt,ft=function(){function t(t,e,n){void 0===n&&(n=!1),this._label=null,this._description=null,this.align=st.NONE,this.isVisible=!0,this.isRowNum=!1,this.dataColumn=t,this.grid=e;var o=e.options.columnWidths||{};t?(t.style.alignment&&(this.align=function(t){switch(t){case I.Left:return st.LEFT;case I.Center:return st.CENTER;case I.Right:return st.RIGHT;default:return st.NONE}}(t.style.alignment)),this.width=o&&o[this.type]?o[this.type].default:250,this.cellRenderer=this.grid.cellRendererStore.getDefaultRenderer(t.type),this._description=t.description):n&&(this.isRowNum=!0,this.width=o&&o.rowNumColumn?o.rowNumColumn.default:60,this._label="",this.cellRenderer=this.grid.cellRendererStore.getDefaultRendererByType(it.NUMBER)),e&&e.options&&e.options.onGetCellRenderer&&(this.cellRenderer=e.options.onGetCellRenderer(this,this.cellRenderer)||this.cellRenderer)}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label?this._label:this.isRowNum?"":this.dataColumn.label},set:function(t){this._label=this.label},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this._description},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.dataColumn?this.dataColumn.type:null},enumerable:!1,configurable:!0}),t}(),gt=function(){function t(t,e){this.items=[],this.grid=e,this.sync(t)}return t.prototype.sync=function(t,e){void 0===e&&(e=!0),this.clear();var n=new ft(null,this.grid,!0);if(this.add(n),e||(n.isVisible=!1),t)for(var o=0,i=t.getItems();o<i.length;o++){var r=i[o],a=new ft(r,this.grid);this.grid.options.onSyncGridColumn&&this.grid.options.onSyncGridColumn(a),this.add(a)}},Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var e=this.items.length;return this.items.push(t),e},t.prototype.put=function(t,e){t>=0&&t<this.items.length&&(this.items[t]=e)},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&E.moveArrayItem(this.items,n,e)},t.prototype.get=function(t){return t>=0&&t<this.items.length?this.items[t]:null},t.prototype.getItems=function(){return this.items},t.prototype.removeAt=function(t){this.get(t);this.items.splice(t,1)},t.prototype.clear=function(){this.items=[]},t}(),mt=function(){return mt=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},mt.apply(this,arguments)},yt=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},vt=(function(){function t(t){if(this.cssPrefix="keg",this.pagination={page:1,pageSize:30,total:0},this.paginationOptions={maxButtonCount:10,useBootstrap:!1},this.defaultDataGridOptions={slot:null,dataTable:null,fixHeightOnFirstRender:!1,syncGridColumns:!0,useRowNumeration:!0,allowDragDrop:!1,aggregates:{settings:null,calculator:null},paging:{enabled:!0,pageSize:30,pageSizeItems:[20,30,50,100,200]},columnWidths:{autoResize:tt.Always,stringColumns:{min:100,max:500,default:250},numberColumns:{min:60,default:120},boolColumns:{min:50,default:80},dateColumns:{min:80,default:200},otherColumns:{min:100,max:500,default:250},rowNumColumn:{min:40,default:60}},showPlusButton:!1,viewportRowsCount:null,showActiveRow:!0},this.rowsOnPagePromise=null,this.containerInitialHeight=0,this.firstRender=!0,this.prevRowTotals=null,this.landingIndex=-1,this.landingSlot=X("div").addClass("".concat(this.cssPrefix,"-col-landing-slot")).addChildElement(X("div").toDOM()).toDOM(),this._activeRowIndex=-1,t&&t.paging&&(t.paging=E.assign(this.defaultDataGridOptions.paging,t.paging)),this.options=this.mergeOptions(t),this.processColumnWidthsOptions(),!this.options.slot)throw Error('"slot" parameter is required to initialize EasyDataGrid');if(!this.options.dataTable)throw Error('"dataTable" parameter is required to initialize EasyDataGrid');this.dataTable=t.dataTable,this.eventEmitter=new z(this),this.cellRendererStore=new ht(t),this.columns=new gt(this.dataTable.columns,this),this.setSlot(this.options.slot),this.init(this.options)}t.prototype.mergeOptions=function(t){var e=E.assignDeep({},this.defaultDataGridOptions.columnWidths,t.columnWidths),n=E.assignDeep({},this.defaultDataGridOptions.paging,t.paging),o=E.assign({},this.defaultDataGridOptions,t);return o.columnWidths=e,o.paging=n,o},t.prototype.processColumnWidthsOptions=function(){var t=this.options.columnWidths;if(t){E.getStringDataTypes().forEach((function(e){t[e]=mt(mt({},t.stringColumns),t[e])})),E.getNumericDataTypes().forEach((function(e){t[e]=mt(mt({},t.numberColumns),t[e])})),t[s.Bool]=mt(mt({},t.boolColumns),t[s.Bool]),E.getDateDataTypes().forEach((function(e){t[e]=mt(mt({},t.dateColumns),t[e])}));var e=yt(yt(yt(yt([],E.getStringDataTypes(),!0),E.getNumericDataTypes(),!0),E.getDateDataTypes(),!0),[s.Bool],!1);E.getAllDataTypes().forEach((function(n){n in e||(t[n]=mt(mt({},t.otherColumns),t[n]))})),t[s.Unknown]=t.otherColumns}},t.prototype.setSlot=function(t){if("string"==typeof t){if(t.length)if("#"===t[0])this.slot=document.getElementById(t.substring(1));else{if("."!==t[0])throw Error("Unrecognized slot parameter (Must be id, class or HTMLElement): "+t);var e=document.getElementsByClassName(t.substring(1));e.length&&(this.slot=e[0])}}else this.slot=t},t.prototype.init=function(t){var e=this;t.onInit&&this.addEventListener("init",t.onInit),t.onRowClick&&this.addEventListener("rowClick",t.onRowClick),t.onRowDbClick&&this.addEventListener("rowDbClick",t.onRowDbClick),t.onPlusButtonClick&&this.addEventListener("plusButtonClick",t.onPlusButtonClick),t.onColumnChanged&&this.addEventListener("columnChanged",t.onColumnChanged),t.onColumnDeleted&&this.addEventListener("columnDeleted",t.onColumnDeleted),t.onColumnMoved&&this.addEventListener("columnMoved",t.onColumnMoved),t.onPageChanged&&this.addEventListener("pageChanged",t.onPageChanged),t.onActiveRowChanged&&this.addEventListener("activeRowChanged",t.onActiveRowChanged),this.addEventListener("pageChanged",(function(t){return e.activeRowIndex=-1})),E.assignDeep(this.paginationOptions,t.pagination),this.pagination.pageSize=this.options.paging.pageSize||this.pagination.pageSize,this.options.allowDragDrop&&ot.registerDropContainer({element:this.slot,scopes:["gridColumnMove"],onDragEnter:function(t,n){e.slot.classList.add("".concat(V,"-drophover")),e.showLandingSlot(n.pageX,n.pageY)},onDragOver:function(t,n){e.showLandingSlot(n.pageX,n.pageY)},onDragLeave:function(t,n){n.dropEffect=Z.Forbid,e.slot.classList.remove("".concat(V,"-drophover")),e.hideLandingSlot()},onDrop:function(t,n){e.dataTable.columns.move(n.data.column,e.landingIndex),e.refresh(),e.fireEvent({type:"columnMoved",columnId:n.data.column.id,newIndex:e.landingIndex})}}),this.refresh(),this.fireEvent("init")},t.prototype.fireEvent=function(t){"string"==typeof t?this.eventEmitter.fire(t):this.eventEmitter.fire(t.type,t)},t.prototype.setData=function(t){this.dataTable=t,this.clear(),this.refresh()},t.prototype.getData=function(){return this.dataTable},t.prototype.getColumns=function(){return this.columns},t.prototype.destroy=function(){this.slot.innerHTML=""},t.prototype.refresh=function(){this.clearDOM(),this.render()},t.prototype.clearDOM=function(){this.slot.innerHTML=""},t.prototype.clear=function(){this.pagination.page=1,this.clearDOM()},t.prototype.render=function(){var t=this;if(this.hasData()||this.options.showPlusButton){this.containerInitialHeight=this.slot.clientHeight,this.rootDiv=document.createElement("div"),this.rootDiv.style.width="100%",this.rootDiv.classList.add("".concat(this.cssPrefix,"-root")),this.columns.sync(this.dataTable.columns,this.options.useRowNumeration),this.renderHeader(),this.rootDiv.appendChild(this.headerDiv),this.renderBody(),this.rootDiv.appendChild(this.bodyDiv),this.renderFooter(),this.rootDiv.appendChild(this.footerDiv);var e=document.createElement("div");e.classList.add("".concat(this.cssPrefix,"-container")),e.appendChild(this.rootDiv),this.slot.appendChild(e);var n=this.options.columnWidths.autoResize!==tt.Never;this.rowsOnPagePromise?this.rowsOnPagePromise.then((function(){return t.updateHeight()})).then((function(){t.firstRender=!1,t.rowsOnPagePromise=null})):setTimeout((function(){t.updateHeight().then((function(){t.firstRender=!1,n&&t.resizeColumns()}))}),100)}},t.prototype.updateHeight=function(){var t=this;return new Promise((function(e){if(t.options.viewportRowsCount){var n=t.bodyCellContainerDiv.firstElementChild,o=(n?n.offsetHeight:36)*t.options.viewportRowsCount;return X(t.bodyViewportDiv).setStyle("height","".concat(o,"px")),void setTimeout((function(){var n=t.bodyViewportDiv.offsetHeight-t.bodyViewportDiv.clientHeight;o+=n,X(t.bodyViewportDiv).setStyle("height","".concat(o,"px")),e()}),100)}t.containerInitialHeight,e()})).then((function(){t.options.fixHeightOnFirstRender&&t.firstRender&&(t.slot.style.height="".concat(t.slot.offsetHeight,"px"))}))},t.prototype.getContainerWidth=function(){return this.columns.getItems().filter((function(t){return t.isVisible})).map((function(t){return t.width})).reduce((function(t,e){return t+e}))},t.prototype.renderHeader=function(){var t=this;this.headerDiv=X("div").addClass("".concat(this.cssPrefix,"-header")).toDOM(),this.headerViewportDiv=X("div",this.headerDiv).addClass("".concat(this.cssPrefix,"-header-viewport")).toDOM(),this.headerCellContainerDiv=X("div",this.headerViewportDiv).addClass("".concat(this.cssPrefix,"-header-cell-container")).toDOM(),this.headerRowDiv=X("div",this.headerCellContainerDiv).addClass("".concat(this.cssPrefix,"-header-row")).toDOM(),this.columns.getItems().forEach((function(e,n){if(e.isVisible){var o=t.renderColumnHeader(e,n);t.headerRowDiv.appendChild(o),e.isRowNum&&X(o).addChildElement(t.renderHeaderButtons())}}));var e=this.getContainerWidth();X(this.headerCellContainerDiv).setStyle("width","".concat(e,"px"))},t.prototype.hasData=function(){return this.dataTable.columns.count>0},t.prototype.renderColumnHeader=function(t,e){var n=this,o=X("div").addClass("".concat(this.cssPrefix,"-header-cell")).data("col-idx","".concat(e)).setStyle("width","".concat(t.width,"px"));t.dataColumn&&o.data("col-id","".concat(t.dataColumn.id));var i=o.toDOM();return X("div",i).addClass("".concat(this.cssPrefix,"-header-cell-resize")),t.isRowNum||X("div",i).addClass("".concat(this.cssPrefix,"-header-cell-label")).text(t.label),t.description&&X("div",i).addClass("question-mark").title(t.description),this.options.allowDragDrop&&ot.registerDraggableItem({element:i,scope:"gridColumnMove",data:{column:t},renderer:function(e){e.innerHTML="";var o=document.createElement("div");o.innerText=t.label,e.classList.add("".concat(n.cssPrefix,"-sortable-helper")),e.appendChild(o)},onDragStart:function(t){t.dropEffect=Z.Allow}}),i},t.prototype.renderBody=function(){var t=this;this.bodyDiv=X("div").addClass("".concat(this.cssPrefix,"-body")).toDOM(),this.bodyViewportDiv=X("div",this.bodyDiv).addClass("".concat(this.cssPrefix,"-body-viewport")).attr("tabIndex","0").toDOM(),this.bodyCellContainerDiv=X("div",this.bodyViewportDiv).addClass("".concat(this.cssPrefix,"-cell-container")).toDOM();var e=this.canShowAggregates();this.dataTable&&(this.showProgress(),this.rowsOnPagePromise=this.getRowsToRender().then((function(n){t.pagination.total=t.dataTable.getTotal(),t.hideProgress(),t.bodyCellContainerDiv.innerHTML="",t.prevRowTotals=null;var o=0;if(n.length){var i=e?t.options.aggregates.settings.getGroups():[];o=n.length<t.pagination.pageSize?n.length:t.pagination.pageSize,n.forEach((function(n,r){if(e&&t.updateTotalsState(i,n),r<o){var a=t.renderRow(n,r);t.bodyCellContainerDiv.appendChild(a)}}));var r=t.options.aggregates&&t.options.aggregates.showGrandTotalsOnEachPage;if(e&&(t.isLastPage()||r)){var a=new q(t.dataTable.columns,new Array(t.dataTable.columns.count));t.updateTotalsState(i,a,!0)}}if(t.options.columnWidths.autoResize!==tt.Never)t.resizeColumns();else{var s=t.getContainerWidth();X(t.bodyCellContainerDiv).setStyle("width","".concat(s,"px"))}return o})).catch((function(t){return console.error(t),0}))),this.bodyViewportDiv.addEventListener("scroll",(function(e){X(t.headerViewportDiv).setStyle("margin-left","-".concat(t.bodyViewportDiv.scrollLeft,"px"))})),this.bodyViewportDiv.addEventListener("keydown",this.onViewportKeydown.bind(this))},t.prototype.isLastPage=function(){return this.dataTable.elasticChunks?this.dataTable.totalIsKnown()&&this.pagination.page*this.pagination.pageSize>=this.pagination.total:this.pagination.page*this.pagination.pageSize>=this.pagination.total},t.prototype.canShowAggregates=function(){if(!this.options||!this.options.aggregates||!this.options.aggregates.settings)return!1;var t=this.options.aggregates.settings;return(t.hasAggregates()||t.hasRecordCount())&&(t.hasGroups()||t.hasGrandTotals())},t.prototype.updateTotalsState=function(t,e,n){void 0===n&&(n=!1);var o=this.options.aggregates.settings;if(this.prevRowTotals&&o.hasGroups()){for(var i=-1,r=1;r<=t.length;r++){for(var a=0,s=t[r-1].columns;a<s.length;a++){var l=s[a];if(!o.compareValues(this.prevRowTotals.getValue(l),e.getValue(l))){i=r;break}}if(-1!==i)break}if(-1!==i)for(r=t.length;r>=i;r--){var c=new q(this.dataTable.columns,this.prevRowTotals.toArray()),u=this.renderTotalsRow(r,c);this.bodyCellContainerDiv.appendChild(u)}}if(n&&o.hasGrandTotals()&&o.hasAggregates()){u=this.renderTotalsRow(0,e);this.bodyCellContainerDiv.appendChild(u)}this.prevRowTotals=e},t.prototype.applyGroupColumnTemplate=function(t,e,n){var o=t.replace(/{{\s*GroupValue\s*}}/g,e?"".concat(e):"-");return o=o.replace(/{{\s*GroupCount\s*}}/g,n?"".concat(n):"-")},t.prototype.renderTotalsRow=function(t,e){var n=this,o=this.options.aggregates.settings,i=t>0?o.getGroups()[t-1]:{columns:[],aggregates:o.getAggregates()},r=X("div").addClass("".concat(this.cssPrefix,"-row")).addClass("".concat(this.cssPrefix,"-row-totals")).addClass("".concat(this.cssPrefix,"-totals-lv").concat(t)).data("totals-level","".concat(t)).attr("tabindex","-1").toDOM();this.columns.getItems().forEach((function(t,o){if(t.isVisible){var a="",s=t.isRowNum?-1:n.dataTable.columns.getIndex(t.dataColumn.id);!t.isRowNum&&t.dataColumn&&i.columns.indexOf(t.dataColumn.id)>=0&&(a=e.getValue(s)),s==n.dataTable.columns.count-1&&(a=". . . . . ."),r.appendChild(n.renderCell(t,o,a,r))}}));var a=this.options.aggregates.calculator.getAggrContainer(),s=o.getAggregates().map((function(t){return t.colId})),l=o.buildGroupKey(i,e);return a.getAggregateData(t,l).then((function(a){for(var l=0,c=s;l<c.length;l++){var u=c[l];e.setValue(u,a[u])}r.innerHTML="",n.columns.getItems().forEach((function(l,c){if(l.isVisible){var u="",d=l.isRowNum?-1:n.dataTable.columns.getIndex(l.dataColumn.id);if(!l.isRowNum){var h=!1;if(l.dataColumn){var p=i.columns.indexOf(l.dataColumn.id),f=s.indexOf(l.dataColumn.id);h=t>0?p==i.columns.length-1:0==d,(p>=0||f>=0)&&(u=e.getValue(d))}var g="";if(t>0&&!(g=l.dataColumn.groupFooterColumnTemplate)&&o.hasRecordCount()&&h&&(g="{{GroupValue}} ({{GroupCount}})"),g)u=n.renderCell(l,c,u,r).firstChild.innerHTML,u=n.applyGroupColumnTemplate(g,u,a[o.COUNT_FIELD_NAME])}var m=n.renderCell(l,c,u,r);r.appendChild(m)}}))})).catch((function(t){return console.error(t)})),r},t.prototype.onViewportKeydown=function(t){if(this.options.showActiveRow){var e=this.bodyCellContainerDiv.querySelectorAll(".".concat(this.cssPrefix,"-row")).length,n=void 0;switch(t.key){case"ArrowLeft":case"ArrowRight":break;case"ArrowUp":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?e-1:this.activeRowIndex-1,this.activeRowIndex=n>=0?n:0;break;case"ArrowDown":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?0:this.activeRowIndex+1,this.activeRowIndex=n<e?n:e-1}}},t.prototype.ensureRowVisibility=function(t){var e="number"==typeof t?this.getDataRow(t):t;if(e){var n=e.getBoundingClientRect(),o=this.bodyViewportDiv.getBoundingClientRect(),i=n.top-o.top,r=n.bottom-o.top,a=this.bodyViewportDiv.clientHeight,s=window.innerHeight||document.documentElement.clientHeight;if(i>0&&r<=a&&n.top>0&&n.bottom<s)return;i<0?this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+i:r>a&&(this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+r-a),(n=e.getBoundingClientRect()).top<0?document.documentElement.scrollTop=document.documentElement.scrollTop+n.top:n.bottom>s&&(document.documentElement.scrollTop=document.documentElement.scrollTop+n.bottom-s)}},t.prototype.getRowsToRender=function(){return!1===this.options.paging.enabled?Promise.resolve(this.dataTable.getCachedRows()):this.dataTable.getRows({offset:(this.pagination.page-1)*this.pagination.pageSize,limit:this.pagination.pageSize+1}).catch((function(t){return console.error(t),[]}))},t.prototype.renderFooter=function(){var t=this;this.footerDiv=X("div").addClass("".concat(this.cssPrefix,"-footer")).toDOM(),this.rowsOnPagePromise&&this.rowsOnPagePromise.then((function(e){t.footerDiv.innerHTML="",t.footerPaginateDiv=t.renderPageNavigator(),t.footerDiv.appendChild(t.footerPaginateDiv);var n=t.renderPageInfoBlock(e);t.footerDiv.appendChild(n)}))},t.prototype.renderPageInfoBlock=function(t){var e=X("div").addClass("".concat(this.cssPrefix,"-page-info")).toDOM();if(this.dataTable.getTotal()>0){var n=t?(this.pagination.page-1)*this.pagination.pageSize+1:0,o=t?n+t-1:0,i=this.dataTable.getTotal().toString();if(this.dataTable.elasticChunks)this.dataTable.getCachedCount()!==this.dataTable.getTotal()&&(i="?");e.innerHTML=x.getText("GridPageInfo").replace("{FirstPageRecordNum}","<span>".concat(n.toString(),"</span>")).replace("{LastPageRecordNum}","<span>".concat(o.toString(),"</span>")).replace("{Total}","<span>".concat(i,"</span>"))}return e},t.prototype.showProgress=function(){},t.prototype.hideProgress=function(){},t.prototype.getLocalIndexByGlobal=function(t){return this.pagination?t%this.pagination.pageSize:t},t.prototype.getGlobalIndexByLocal=function(t){return this.pagination?(this.pagination.page-1)*this.pagination.pageSize+t:t},t.prototype.renderRow=function(t,e){var n=this,o=this.getGlobalIndexByLocal(e),i=X("div").addClass("".concat(this.cssPrefix,"-row")).addClass("".concat(this.cssPrefix,"-row-").concat(e%2==1?"odd":"even")).data("row-idx","".concat(o)).attr("tabindex","-1").on("click",(function(o){n.activeRowIndex=e,n.fireEvent({type:"rowClick",row:t,rowIndex:e,sourceEvent:o})})).on("dblclick",(function(o){n.fireEvent({type:"rowDbClick",row:t,rowIndex:e,sourceEvent:o})}));0==e&&i.addClass("".concat(this.cssPrefix,"-row-first"));var r=i.toDOM();return this.options.showActiveRow&&e==this.activeRowIndex&&i.addClass("".concat(this.cssPrefix,"-row-active")),this.columns.getItems().forEach((function(e,i){if(e.isVisible){var a=e.isRowNum?-1:n.dataTable.columns.getIndex(e.dataColumn.id),s=e.isRowNum?o+1:t.getValue(a);r.appendChild(n.renderCell(e,i,s,r))}})),r},t.prototype.renderCell=function(t,e,n,o){var i=X("div").addClass("".concat(this.cssPrefix,"-cell")).data("col-idx","".concat(e)).attr("tabindex","-1").setStyle("width","".concat(t.width,"px"));t.align==st.LEFT?i.addClass("".concat(this.cssPrefix,"-cell-align-left")):t.align==st.RIGHT?i.addClass("".concat(this.cssPrefix,"-cell-align-right")):t.align==st.CENTER&&i.addClass("".concat(this.cssPrefix,"-cell-align-center"));var r=i.toDOM(),a=r.appendChild(X("div").addClass("".concat(this.cssPrefix,"-cell-value")).toDOM());return t.cellRenderer&&t.cellRenderer(n,t,a,o),r},t.prototype.setPage=function(t){this.pagination.page=t,this.fireEvent({type:"pageChanged",page:t}),this.refresh(),this.bodyViewportDiv.focus()},t.prototype.renderPageNavigator=function(){var t=this,e=document.createElement("div");e.className="".concat(this.cssPrefix,"-pagination-wrapper");var n=this.dataTable.getTotal();if(this.options.paging&&this.options.paging.enabled&&n>0){var o=this.paginationOptions.useBootstrap?"":"".concat(this.cssPrefix,"-"),i=function(e){var n=e.target;if(n.hasAttribute("data-page")){var o=parseInt(n.getAttribute("data-page"));t.setPage(o)}},r=function(e,n,r,a,s){var l=document.createElement("li");if(l.className="".concat(o,"page-item"),!a){s&&(l.className+=" active");var c=document.createElement("a");return c.setAttribute("href","javascript:void(0)"),c.innerHTML=n||e.toString(),c.setAttribute("data-page","".concat(e)),c.className="".concat(o,"page-link"),c.addEventListener("click",i),l.appendChild(c),l}var u=document.createElement("span");if(u.setAttribute("aria-hidden","true"),u.className="".concat(o,"page-link"),r)l.className+=" disabled";else{if(t.paginationOptions.useBootstrap)(u=document.createElement("a")).setAttribute("href","javascript:void(0)"),u.setAttribute("data-page","".concat(e));else{var d=document.createElement("a");d.setAttribute("href","javascript:void(0)"),d.setAttribute("data-page","".concat(e)),u=d}u.className="".concat(o,"page-link"),u.addEventListener("click",i)}return u.innerHTML=n,l.appendChild(u),l};if(this.dataTable.elasticChunks){var a=this.pagination.page||1;(l=document.createElement("ul")).className="".concat(o,"pagination");var s=r(a-1,"«",1==a,!0,!1);l.appendChild(s),s=r(a+1,"»",this.isLastPage(),!0,!1),l.appendChild(s),e.appendChild(l)}else if(this.pagination.total>this.pagination.pageSize){a=this.pagination.page||1;var l,c=Math.ceil(this.pagination.total/this.pagination.pageSize)||1,u=this.paginationOptions.maxButtonCount||10,d=a-1,h=d-d%u+1,p=h+u-1;p>c&&(p=c),(l=document.createElement("ul")).className="".concat(o,"pagination");s=r(h-1,"«",1==h,!0,!1);l.appendChild(s);for(var f=h;f<=p;f++)s=r(f,f.toString(),!1,!1,f==a),l.appendChild(s);s=r(p+1,"»",p==c,!0,!1),l.appendChild(s),e.appendChild(l)}if(this.options.paging.allowPageSizeChange){var g=document.createElement("div");g.className="".concat(this.cssPrefix,"-page-sizes");var m=document.createElement("div");m.className="kfrm-select ".concat(this.cssPrefix,"-page-sizes-select"),g.appendChild(m);var y=document.createElement("select"),v=this.options.paging.pageSizeItems||[],b=new Set(v);b.add(this.options.paging.pageSize||20),Array.from(b).forEach((function(t){var e=document.createElement("option");e.value=t.toString(),e.text=t.toString(),y.appendChild(e)})),y.value=(this.pagination.pageSize||20).toString(),m.appendChild(y),y.addEventListener("change",(function(e){var n=parseInt(e.target.value);t.pagination.pageSize=n,t.pagination.page=1,t.refresh()}));var C=document.createElement("div");C.className="".concat(this.cssPrefix,"-page-sizes-label"),g.appendChild(C);var w=document.createElement("span");w.innerText=x.getText("GridItemsPerPage"),C.appendChild(w),e.appendChild(g)}}return e},t.prototype.addEventListener=function(t,e){return this.eventEmitter.subscribe(t,(function(t){return e(t.data)}))},t.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},t.prototype.renderHeaderButtons=function(){var t=this;return this.options.showPlusButton?X("div").addClass("".concat(this.cssPrefix,"-header-btn-plus")).title(this.options.plusButtonTitle||"Add").addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.fireEvent({type:"plusButtonClick",sourceEvent:e})}))})).toDOM():X("span").addText("#").toDOM()},t.prototype.showLandingSlot=function(t,e){for(var n=this.headerRowDiv.querySelectorAll("[class*=".concat(this.cssPrefix,"-table-col]")),o=[],i=1;i<n.length;i++){var r=n[i];"none"!==r.style.display&&o.push(r)}if(0===o.length)return this.landingIndex=0,void this.headerRowDiv.appendChild(this.landingSlot);var a=G(this.landingSlot);if(!(t>=a.x&&t<=a.x+this.landingSlot.offsetWidth)){for(var s=this.landingIndex,l=0,c=o;l<c.length;l++){var u=c[l],d=G(u),h=u.offsetWidth;t>d.x&&t<d.x+h&&(s=parseInt(u.getAttribute("data-col-idx"))-1)}s!=this.landingIndex&&(this.landingIndex=s,this.landingIndex<o.length?this.headerRowDiv.insertBefore(this.landingSlot,o[this.landingIndex]):this.headerRowDiv.appendChild(this.landingSlot))}},t.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},Object.defineProperty(t.prototype,"activeRowIndex",{get:function(){return this._activeRowIndex},set:function(t){if(t!==this._activeRowIndex){var e=this._activeRowIndex;this._activeRowIndex=t,this.updateActiveRow(),this.fireEvent({type:"activeRowChanged",oldValue:e,newValue:this.activeRowIndex,rowIndex:this.getGlobalIndexByLocal(this.activeRowIndex)})}},enumerable:!1,configurable:!0}),t.prototype.updateActiveRow=function(){var t=this;if(this.options.showActiveRow){this.bodyCellContainerDiv.querySelectorAll("[class*=".concat(this.cssPrefix,"-row-active]")).forEach((function(e){e.classList.remove("".concat(t.cssPrefix,"-row-active"))}));var e=this.getActiveRow();e&&(e.classList.add("".concat(this.cssPrefix,"-row-active")),this.ensureRowVisibility(this.activeRowIndex))}},t.prototype.getActiveRow=function(){return this.getDataRow(this.activeRowIndex)},t.prototype.getDataRow=function(t){var e=Array.from(this.bodyCellContainerDiv.querySelectorAll(".".concat(this.cssPrefix,"-row:not(.").concat(this.cssPrefix,"-row-totals)")));return t>=0&&t<e.length?e[t]:null},t.prototype.focus=function(){this.bodyViewportDiv.focus()},t.prototype.resizeColumns=function(){if(this.options.columnWidths.autoResize!==tt.Never){var t=this.bodyCellContainerDiv.style.width;this.bodyCellContainerDiv.style.visibility="hidden",this.bodyCellContainerDiv.style.width="1px",this.headerRowDiv.style.width="1px";for(var e=0,n=this.columns.getItems(),o=this.headerCellContainerDiv.querySelectorAll(".".concat(this.cssPrefix,"-header-cell")),i=0,r=function(t){var r=n[t];if(!r.isVisible)return"continue";var s=a.options.columnWidths.autoResize!==tt.Always&&r.dataColumn?r.dataColumn.calculatedWidth:0,l=a.bodyCellContainerDiv.querySelectorAll(".".concat(a.cssPrefix,'-cell[data-col-idx="').concat(t,'"] > .').concat(a.cssPrefix,"-cell-value")),c=0;if(s>0)e+=s,r.width=s,l.forEach((function(t){t.parentElement.style.width="".concat(s,"px")})),o[i].style.width="".concat(s,"px");else if(0==l.length&&(o[i].style.width=null,o[i].style.whiteSpace="nowrap"),c=o[i].offsetWidth,l.length>0){l.forEach((function(t){t.parentElement.style.width=null;var e=t.parentElement.offsetWidth;e>c&&(c=e)})),c+=3;var u=r.isRowNum?a.options.columnWidths.rowNumColumn.max||500:a.options.columnWidths[r.dataColumn.type].max||2e3,d=r.isRowNum?a.options.columnWidths.rowNumColumn.min||0:a.options.columnWidths[r.dataColumn.type].min||20;c>u&&(c=u),c<d&&(c=d),E.isNumericType(r.type)&&(c=Math.round(1.3*c)),e+=c,r.width=c,l.forEach((function(t){t.parentElement.style.width="".concat(c,"px")})),o[i].style.width="".concat(c,"px"),r.dataColumn&&(r.dataColumn.calculatedWidth=c)}else e+=c;i++},a=this,s=0;s<this.columns.count;s++)r(s);e>0?(this.bodyCellContainerDiv.style.width="".concat(e,"px"),this.headerCellContainerDiv.style.width="".concat(e,"px")):(this.bodyCellContainerDiv.style.width=t,this.headerCellContainerDiv.style.width=t),this.bodyCellContainerDiv.style.visibility=null,this.headerRowDiv.removeAttribute("style")}}}(),function(){function t(t,e){this.slot=t,this.options=e||{},this.options.yearRange||(this.options.yearRange="c-10:c+10")}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-cal"},enumerable:!1,configurable:!0}),t.prototype.setDate=function(t){this.currentDate=new Date(t)},t.prototype.getDate=function(){return new Date(this.currentDate)},t.prototype.dateChanged=function(t){this.options.onDateChanged&&this.options.onDateChanged(this.currentDate,t)},t}()),bt=function(){function t(t){this.calendar=null,this.timePicker=null,this.options=t,this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp"},enumerable:!1,configurable:!0}),t.prototype.setDateTime=function(t){this.currentDateTime=new Date(t),this.calendar&&this.calendar.setDate(this.currentDateTime),this.timePicker&&this.timePicker.setTime(this.currentDateTime)},t.prototype.getDateTime=function(){return new Date(this.currentDateTime)},t.prototype.render=function(){var t=this;this.options.showCalendar&&(this.calendar=this.createCalendar({yearRange:this.options.yearRange,showDateTimeInput:this.options.showDateTimeInput,timePickerIsUsed:this.options.showTimePicker,oneClickDateSelection:this.options.oneClickDateSelection,onDateChanged:function(e,n){t.currentDateTime=e,t.timePicker&&t.timePicker.setTime(t.currentDateTime),t.options.showTimePicker&&t.dateTimeChanged(),n&&t.apply(t.currentDateTime)}}),this.calendar&&this.calendar.render()),this.options.showTimePicker&&(this.timePicker=this.createTimePicker({onTimeChanged:function(e){t.currentDateTime.setHours(e.getHours()),t.currentDateTime.setMinutes(e.getMinutes()),t.calendar&&t.calendar.setDate(t.currentDateTime),t.dateTimeChanged()}}),this.timePicker&&this.timePicker.render()),this.setDateTime(new Date)},t.prototype.createCalendar=function(t){return null},t.prototype.createTimePicker=function(t){return null},t.prototype.show=function(t){this.options.beforeShow&&this.options.beforeShow();var e=G(t||document.body);this.slot.style.top=e.y+t.clientHeight+"px",this.slot.style.left=e.x+"px"},t.prototype.apply=function(t){this.options.onApply&&this.options.onApply(t),this.destroy()},t.prototype.cancel=function(){this.options.onCancel&&this.options.onCancel(),this.destroy()},t.prototype.destroy=function(){this.slot&&this.slot.parentElement&&this.slot.parentElement.removeChild(this.slot)},t.prototype.dateTimeChanged=function(){this.options.onDateTimeChanged&&this.options.onDateTimeChanged(this.currentDateTime)},t}(),Ct=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),wt=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.daysOfWeek=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o.calendarBody=null,o.isManualInputChanging=!1;for(var i=0;i<o.daysOfWeek.length;i++)o.daysOfWeek[i]=x.getShortWeekDayName(i+1);for(i=0;i<o.months.length;i++)o.months[i]=x.getLongMonthName(i+1);return o}return Ct(e,t),e.prototype.setDate=function(e){t.prototype.setDate.call(this,e),this.selectedMonth=this.currentDate.getMonth(),this.selectedYear=this.currentDate.getFullYear(),this.rerenderMonth()},e.prototype.render=function(){var t=this,e=X("div",this.slot).addClass("".concat(this.cssPrefix,"-header"));this.options.showDateTimeInput?e.addChildElement(this.renderManualDateInput()):e.addChild("span",(function(e){return t.headerTextElem=e.toDOM()})),X(this.slot).addChildElement(this.renderCalendarButtons()),this.calendarBody=X("div",this.slot).addClass("".concat(this.cssPrefix,"-body")).toDOM()},e.prototype.getInputDateFormat=function(){var t=x.getLocaleSettings();return this.options.timePickerIsUsed?"".concat(t.editDateFormat," ").concat(t.editTimeFormat):t.editDateFormat},e.prototype.renderManualDateInput=function(){var t=this,e=this.getInputDateFormat(),n=X("input").attr("placeholder",e).addClass("".concat(this.cssPrefix,"-header-input"));return n.mask(e.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99")).on("input",(function(o){n.removeClass("error");try{t.isManualInputChanging=!0;var i=E.strToDateTime(t.manualInputElem.value,e);t.currentDate=i,t.jump(t.currentDate.getFullYear(),t.currentDate.getMonth()),t.dateChanged(!1)}catch(t){n.addClass("error")}finally{t.isManualInputChanging=!1}})).on("keydown",(function(e){13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),t.manualInputElem.className.indexOf("error")<0&&!t.isManualInputChanging&&t.dateChanged(!0))})).on("focus",(function(){setTimeout((function(){t.manualInputElem.selectionStart=0,t.manualInputElem.selectionEnd=0}),50)})),this.manualInputElem=n.toDOM(),this.manualInputElem},e.prototype.updateDisplayedDateValue=function(){if(this.manualInputElem){if(!this.isManualInputChanging){var t=this.getInputDateFormat();this.manualInputElem.value=E.dateTimeToStr(this.currentDate,t),this.manualInputElem.focus()}}else if(this.headerTextElem){var e=x.getCurrentLocale();this.headerTextElem.innerText=this.currentDate.toLocaleString("en"==e?void 0:e,{year:"numeric",month:"long",day:"numeric"})}},e.prototype.renderCalendarButtons=function(){var t=this;return X("nav").addClass("".concat(this.cssPrefix,"-nav")).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-prev")).on("click",(function(){t.prev()})).addChild("span",(function(t){return t.html("‹")}))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-selectors")).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-month")).addChild("select",(function(e){e.on("change",(function(){t.jump(t.selectedYear,parseInt(t.selectMonthElem.value))}));for(var n=function(n){e.addChild("option",(function(e){return e.attr("value",n.toString()).text(t.months[n])}))},o=0;o<t.months.length;o++)n(o);t.selectMonthElem=e.toDOM()}))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-year")).addChild("select",(function(e){return t.selectYearElem=e.on("change",(function(){t.jump(parseInt(t.selectYearElem.value),t.selectedMonth)})).toDOM()}))}))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-next")).on("click",(function(){t.next()})).addChild("span",(function(t){return t.html("›")}))})).toDOM()},e.prototype.prev=function(){this.selectedYear=0===this.selectedMonth?this.selectedYear-1:this.selectedYear,this.selectedMonth=0===this.selectedMonth?11:this.selectedMonth-1,this.rerenderMonth()},e.prototype.next=function(){this.selectedYear=11===this.selectedMonth?this.selectedYear+1:this.selectedYear,this.selectedMonth=(this.selectedMonth+1)%12,this.rerenderMonth()},e.prototype.rerenderSelectYear=function(){var t=/c-(\d*):c\+(\d*)/g.exec(this.options.yearRange),e=0,n=1;null!==t&&(e=parseInt(t[1]),n=parseInt(t[2])),this.selectYearElem.innerHTML="";for(var o=0;o<=e+n;o++){var i=document.createElement("option"),r=this.selectedYear-e+o;i.value=r.toString(),i.innerText=r.toString(),this.selectYearElem.appendChild(i)}},e.prototype.jump=function(t,e){this.selectedYear=t,this.selectedMonth=e,this.rerenderMonth()},e.prototype.rerenderMonth=function(){var t=this;this.updateDisplayedDateValue(),this.rerenderSelectYear();var e=new Date(this.selectedYear,this.selectedMonth).getDay(),n=new Date(this.selectedYear,this.selectedMonth+1,0).getDate();this.calendarBody.innerHTML="",this.selectYearElem.value=this.selectedYear.toString(),this.selectMonthElem.value=this.selectedMonth.toString(),this.daysOfWeek.forEach((function(e,n){X("div",t.calendarBody).addClass("".concat(t.cssPrefix,"-weekday")).addClass(0==n||6==n?"".concat(t.cssPrefix,"-weekend"):"").text(e)}));for(var o=0;o<e;o++)X("div",this.calendarBody).addClass("".concat(this.cssPrefix,"-day-empty"));for(var i=new Date,r=1;r<=n;r++){var a=X("div",this.calendarBody).addClass("".concat(this.cssPrefix,"-day")).attr("data-date",r.toString()).text(r.toString()).on("click",(function(e){t.currentDate.setFullYear(t.selectedYear),t.currentDate.setMonth(t.selectedMonth),t.currentDate.setDate(parseInt(e.target.getAttribute("data-date"))),t.dateChanged(t.options.oneClickDateSelection)}));r===i.getDate()&&this.selectedYear===i.getFullYear()&&this.selectedMonth===i.getMonth()&&a.addClass("".concat(this.cssPrefix,"-day-current")),r===this.currentDate.getDate()&&this.selectedYear===this.currentDate.getFullYear()&&this.selectedMonth===this.currentDate.getMonth()&&a.addClass("".concat(this.cssPrefix,"-day-selected"));var s=(e+r-1)%7;0!=s&&6!=s||a.addClass("".concat(this.cssPrefix,"-weekend"))}var l=(e+n)%7,c=0==l?0:7-l;for(o=0;o<c;o++)X("div",this.calendarBody).addClass("".concat(this.cssPrefix,"-day-empty"))},e.prototype.dateChanged=function(e){t.prototype.dateChanged.call(this,e),this.rerenderMonth()},e}(vt),Dt=function(){function t(t,e){this.slot=t,this.options=e||{}}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-tp"},enumerable:!1,configurable:!0}),t.prototype.setTime=function(t){this.currentTime=new Date(t)},t.prototype.getTime=function(){return new Date(this.currentTime)},t.prototype.timeChanged=function(){this.options.onTimeChanged&&this.options.onTimeChanged(this.currentTime)},t}(),xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xt(e,t),e.prototype.setTime=function(e){t.prototype.setTime.call(this,e),this.updateDisplayedTime(),this.hoursInput.valueAsNumber=e.getHours(),this.minutesInput.valueAsNumber=e.getMinutes()},e.prototype.render=function(){var t=this;X("div",this.slot).addClass("".concat(this.cssPrefix,"-time")).addChild("span",(function(e){return t.timeText=e.toDOM()})).toDOM();var e=X("div",this.slot).addClass("".concat(this.cssPrefix,"-sliders"));return e.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-time-row")).title("Hours").addChild("input",(function(e){return t.hoursInput=e.addClass("".concat(t.cssPrefix,"-input-hours")).type("range").attr("min","0").attr("max","23").attr("step","1").on("input",(function(e){t.currentTime.setHours(t.hoursInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),e.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-time-row")).title("Minutes").addChild("input",(function(e){return t.minutesInput=e.addClass("".concat(t.cssPrefix,"-input-minutes")).type("range").attr("min","0").attr("max","59").attr("step","1").on("input",(function(e){t.currentTime.setMinutes(t.minutesInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),this.slot},e.prototype.updateDisplayedTime=function(){var t=x.getCurrentLocale(),e=this.currentTime.toLocaleString("en"==t?void 0:t,{hour:"numeric",minute:"numeric"});this.timeText.innerText=e},e}(Dt),Tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Tt(e,t),e.prototype.render=function(){var e=this,n=X("div",document.body).addClass("".concat(this.cssPrefix)).attr("tabIndex","0").setStyle("position","absolute").setStyle("top","-1000px").setStyle("left","-1000px").on("keydown",(function(t){return 27===t.keyCode?e.cancel():13===t.keyCode&&e.apply(e.getDateTime()),!1}));this.options.zIndex&&n.setStyle("z-index","".concat(this.options.zIndex)),this.slot=n.toDOM(),t.prototype.render.call(this),this.renderButtons(),this.globalMouseDownHandler=function(t){var n=window.event||t;n.srcElement||n.target;return!e.slot.contains(n.target)&&(document.removeEventListener("mousedown",e.globalMouseDownHandler,!0),e.cancel()),!0}},e.prototype.renderButtons=function(){var t=this,e=X("div",this.slot).addClass("".concat(this.cssPrefix,"-buttons")).addChild("button",(function(e){return t.nowButton=e.addClass("".concat(t.cssPrefix,"-button ").concat(t.cssPrefix,"-button-now")).text(x.getText("ButtonNow")).on("click",(function(){return t.setDateTime(new Date),t.dateTimeChanged(),!1})).toDOM()}));!this.options.showTimePicker&&this.options.oneClickDateSelection||e.addChild("button",(function(e){return t.submitButton=e.addClass("".concat(t.cssPrefix,"-button ").concat(t.cssPrefix,"-button-apply")).text(x.getText("ButtonApply")).on("click",(function(){return t.apply(t.getDateTime()),!1})).toDOM()})),e.addChild("button",(function(e){return t.submitButton=e.addClass("".concat(t.cssPrefix,"-button ").concat(t.cssPrefix,"-button-cancel")).text(x.getText("ButtonCancel")).on("click",(function(){return t.cancel(),!1})).toDOM()}))},e.prototype.createCalendar=function(t){return this.calendarSlot=X("div",this.slot).addClass("".concat(this.cssPrefix,"-cal")).toDOM(),new wt(this.calendarSlot,t)},e.prototype.createTimePicker=function(t){return this.timePickerSlot=X("div",this.slot).addClass("".concat(this.cssPrefix,"-tp")).toDOM(),new Et(this.timePickerSlot,t)},e.prototype.show=function(e){var n=this;if(this.options.showDateTimeInput){this.options.beforeShow&&this.options.beforeShow();var o=G(e||document.body),i=G(e?e.parentElement||e:document.body);this.slot.style.top=i.y+"px",this.slot.style.left=o.x+"px"}else t.prototype.show.call(this,e),this.slot.focus();setTimeout((function(){document.addEventListener("mousedown",n.globalMouseDownHandler,!0)}),1)}}(bt);!function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(pt||(pt={}));var It=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),St="kdlg",_t=function(){function t(){}return t.prototype.openConfirm=function(t,e,n){var o=this,i={title:t,closable:!1,submitable:!0,cancelable:!0,body:'<div id="'.concat(St,'-dialog-confirm">').concat(e,"</div>")};return n?(i.onSubmit=function(){n(!0)},i.onCancel=function(){n(!1)},void this.open(i)):new Promise((function(t){i.onSubmit=function(){t(!0)},i.onCancel=function(){t(!1)},o.open(i)}))},t.prototype.openPrompt=function(t,e,n,o){var i=this,r={title:t,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,body:'<div id="'.concat(St,'-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="').concat(St,'-dialog-form-input" id="').concat(St,'-dialog-form-content">').concat(e,'</label>\n <input type="text" name="').concat(St,'-dialog-form-input" id="').concat(St,'-dialog-form-input" />\n </div>\n </div>'),arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("".concat(St,"-dialog-form-input"));n&&(t.value=n),t.focus()}},a=function(t){var e=document.getElementById("".concat(St,"-dialog-form-input")),n=e.value;return n&&n.replace(/\s/g,"").length>0?(t(n),!0):(e.classList.add("eqjs-invalid"),!1)};return o?(r.onSubmit=function(){return a(o)},r.onCancel=function(){o("")},void this.open(r)):new Promise((function(t){r.onSubmit=function(){return a(t)},r.onCancel=function(){t("")},i.open(r)}))},t.prototype.open=function(t,e){var n=this,o=new Ot(t,e),i=t.onDestroy;return t.onDestroy=function(t){n.untrack(t),i&&i(t)},o.open(),this.track(o),o},t.prototype.createSet=function(t){return new Pt(t,this)},t.prototype.untrack=function(e){var n=t.openDialogs.indexOf(e);n>=0&&t.openDialogs.splice(n,1)},t.prototype.track=function(e){t.openDialogs.push(e)},t.prototype.openProgress=function(t){var e=this,n=new Mt(t),o=t.onDestroy;return t.onDestroy=function(t){e.untrack(t),o&&o(t)},n.open(),this.track(n),n},t.prototype.getAllDialogs=function(){return Array.from(t.openDialogs)},t.prototype.closeAllDialogs=function(){for(var e=0,n=Array.from(t.openDialogs);e<n.length;e++){n[e].close()}},t.openDialogs=[],t}(),Ot=function(){function t(t,e){var n=this;this.options=t,this.submitHandler=function(t){return(!n.options.onSubmit||!1!==n.options.onSubmit(n,t))&&(n.destroy(),!0)},this.cancelHandler=function(){n.options.onCancel&&n.options.onCancel(n),n.destroy()},this.keydownHandler=function(t){return 13!=t.keyCode||!n.isActiveDialog()||(t.preventDefault(),t.stopPropagation(),!n.submitHandler())||(window.removeEventListener("keydown",n.keydownHandler,!1),!1)},this.dialogId=E.generateId("dlg"),this.data=e,this.slot=X("div",document.body).attr("tab-index","-1").data("dialog-id",this.dialogId).addClass("".concat(St,"-modal"),"is-active").focus().addChild("div",(function(t){return t.addClass("kdlg-modal-background")})).addChild("div",(function(o){return n.windowElement=o.addClass("".concat(St,"-modal-window")).addChild("header",(function(e){n.headerElement=e.addClass("".concat(St,"-header")).addChild("p",(function(e){return e.addClass("".concat(St,"-header-title")).addText(t.title)})).toDOM(),!1!==t.closable&&e.addChild("button",(function(t){return t.addClass("".concat(St,"-modal-close")).on("click",(function(){n.cancelHandler()})).focus()}))})).addChild("div",(function(t){t.addClass("".concat(St,"-alert-container")),n.alertElement=t.toDOM()})).addChild("section",(function(o){if(n.bodyElement=o.addClass("".concat(St,"-body")).toDOM(),"string"==typeof t.body){var i=N.renderLiquidTemplate(t.body,e);o.addHtml(i)}else o.addChildElement(t.body)})).addChild("footer",(function(e){var o=null;o=t.footerAlignment&&t.footerAlignment==pt.Center?"align-center":"align-right",n.footerElement=e.addClass("".concat(St,"-footer")).toDOM(),e.addClass(o),!1!==t.submitable&&(e.addChild("button",(function(e){e.id(n.dialogId+"-btn-submit").addClass("kfrm-button","is-info").addText(t.submitButtonText||x.getText("ButtonOK")),t.recaptchaSiteKey?(e.data("sitekey",t.recaptchaSiteKey),e.addClass("g-recaptcha"),e.on("click",(function(e){grecaptcha?grecaptcha.ready((function(){grecaptcha.execute(t.recaptchaSiteKey,{action:"submit"}).then((function(t){n.submitHandler(t)}))})):n.submitHandler()}))):e.on("click",(function(t){n.submitHandler()})),e.focus()})),!1!==t.cancelable&&e.addChild("button",(function(e){return e.id(n.dialogId+"-btn-cancel").addClass("kfrm-button").addText(t.cancelButtonText||x.getText("ButtonCancel")).on("click",(function(t){n.cancelHandler()}))})))})).toDOM()})).toDOM()}return t.prototype.getData=function(){return this.data},t.prototype.getRootElement=function(){return this.slot},t.prototype.getSubmitButtonElement=function(){return document.getElementById(this.dialogId+"-btn-submit")},t.prototype.getCancelButtonElement=function(){return document.getElementById(this.dialogId+"-btn-cancel")},t.prototype.open=function(){var t=this;this.options.beforeOpen&&this.options.beforeOpen(this),X(this.slot).show(),this.options.arrangeParents&&this.arrangeParents(!0);var e=this.slot.querySelector(".".concat(St,"-modal-window"));this.options.height&&(e.style.height="string"==typeof this.options.height?this.options.height:"".concat(this.options.height,"px")),this.options.width&&(e.style.width="string"==typeof this.options.width?this.options.width:"".concat(this.options.width,"px")),this.options.submitOnEnter&&window.addEventListener("keydown",this.keydownHandler,!1),this.slot.querySelectorAll("input").forEach((function(e){return e.addEventListener("input",(function(){t.clearAlert(),t.options.onInput&&t.options.onInput(t)}))})),this.options.onShow&&this.options.onShow(this)},t.prototype.submit=function(){this.submitHandler()},t.prototype.cancel=function(){this.cancelHandler()},t.prototype.close=function(){this.destroy()},t.prototype.disableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!0}))},t.prototype.enableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!1}))},t.prototype.showAlert=function(t,e,n){var o=X("div").addClass("".concat(St,"-alert ").concat(e||"")).addChild("span",(function(t){return t.addClass("".concat(St,"-alert-closebtn")).text("×").on("click",(function(t){var e=t.target.parentElement;e.parentElement.removeChild(e)}))})).addText(t).toDOM();!0===n&&this.clearAlert(),this.alertElement.appendChild(o)},t.prototype.clearAlert=function(){this.alertElement.innerHTML=""},t.prototype.destroy=function(){document.querySelectorAll('[data-dialog-id="'.concat(this.dialogId,'"]')).length<=0||(this.options.arrangeParents&&this.arrangeParents(!1),document.body.removeChild(this.slot),this.options.submitOnEnter&&window.removeEventListener("keydown",this.keydownHandler,!1),this.options.onDestroy&&this.options.onDestroy(this))},t.prototype.isActiveDialog=function(){var t=document.documentElement.querySelectorAll(".kdlg-modal");return t[t.length-1]===this.slot},t.prototype.arrangeParents=function(t){for(var e=document.documentElement.querySelectorAll(".kdlg-modal-window"),n=0;n<e.length-1;n++)if(t){var o=0==n?20:40*n+20;X(e[n]).setStyle("margin-top","".concat(o,"px")).setStyle("margin-left","".concat(o,"px"))}else X(e[n]).removeStyle("margin-top").removeStyle("margin-left")},t}(),Mt=function(t){function e(e,n){var o,i,r=this,a=X("div").addChild("div",(function(t){return o=t.text(e.content||"").toDOM()})).addChild("div",(function(t){t.addClass("".concat(St,"-progress-line")).addChild("div",(function(t){i=t.addClass("fill").toDOM(),e.determinated?t.setStyle("width","0%"):t.addClass("indeterminate")}))})).toDOM();return(r=t.call(this,{title:e.title,body:a,beforeOpen:e.beforeOpen,onSubmit:e.onSubmit,width:e.width,height:e.height,submitable:!1,cancelable:!1,closable:!1,onDestroy:e.onDestroy},n)||this).contentElement=o,r.progressElement=i,r}return It(e,t),e.prototype.updateContent=function(t){this.contentElement.innerText=t},e.prototype.updateProgress=function(t){var e=this;t=this.in01(t),this.progressElement.style.width="".concat(100*t,"%"),1===t&&setTimeout((function(){e.submit()}),500)},e.prototype.in01=function(t){return t>1?1:t<0?0:t},e}(Ot),Pt=function(){function t(t,e){this.options=t,this.dialogService=e,this.currentDialog=null,this.currentIndex=0,this.options=t,this.dialogService=e}return t.prototype.getCurrent=function(){return this.currentDialog},t.prototype.openNext=function(t){return this.open(this.currentIndex+1,t)},t.prototype.openPrev=function(t){return this.open(this.currentIndex-1,t)},t.prototype.open=function(t,e){if(t<0?this.currentIndex=0:t>=this.options.length?this.currentIndex=this.options.length-1:this.currentIndex=t,this.currentDialog)try{this.currentDialog.close()}catch(t){}var n=this.options[this.currentIndex];return this.currentDialog=this.dialogService.open(n,e),this.currentDialog},t.prototype.close=function(){this.currentDialog&&(this.currentDialog.close(),this.currentDialog=null)},t}();x.updateDefaultTexts({GridPageInfo:"{FirstPageRecordNum} - {LastPageRecordNum} of {Total} records",GridItemsPerPage:"items per page",ButtonOK:"OK",ButtonCancel:"Cancel",ButtonApply:"Apply",ButtonNow:"Now",LblTotal:"Total"});new _t;function kt(t){return!t||""===t.trim()}var Rt,At="https://account.korzh.com/api/license",Lt=n.versionNum,Nt=function(){function e(t){this.http=new P,this.context=t}return e.prototype.show=function(){var t=this,e=new _t;this.dialogSet=e.createSet([{closable:!1,cancelable:!1,submitOnEnter:!0,title:"No license key for EasyQuery",body:this.buildStartPage(),submitButtonText:"Submit",onInput:this.validateForm.bind(this),onSubmit:this.startPageOnSubmit.bind(this)},{closable:!1,cancelable:!1,submitOnEnter:!0,title:"Please check your inbox",body:this.buildCodePage(),submitButtonText:"Get License Key",onInput:this.validateForm.bind(this),onSubmit:this.codePageOnSubmit.bind(this)},{closable:!1,cancelable:!1,submitable:!1,title:"Success",body:this.buildSuccessPage()},{closable:!1,cancelable:!1,submitable:!1,title:"Failure",body:this.buildFailurePage()}]);var n=this.dialogSet.open(0);setTimeout((function(){t.validateForm(n);var e=document.getElementById("eqAuthEmail");e&&e.focus()}),200)},e.prototype.isValidForm=function(t){var e=t.querySelector("#eqAuthEmail");if(e)return!kt(e.value)&&e.value.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);var n=t.querySelector("#eqAuthCode");return!n||!kt(n.value)&&!isNaN(+n.value)&&n.value==n.value.trim()&&6===n.value.length},e.prototype.validateForm=function(t){t.getSubmitButtonElement().disabled=!this.isValidForm(t.getRootElement())},e.prototype.addInputField=function(t,e){t.addChild("label",(function(t){return t.attr("for",e.id).addHtml("".concat(e.label," ").concat(e.required?'<sup style="color: red">*</sup>':"",": "))})).addChild("input",(function(t){t.id(e.id),t.name(e.name||e.id),t.type(e.type||"text"),void 0!==e.value&&t.value(e.value),e.onInput&&t.on("input",e.onInput)}))},e.prototype.buildStartPage=function(){var t,e=X("div");return e.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">The EasyQuery license key is either absent, invalid or was issued for a different version of the library.</div><div style="font-size:1.2em">Please fill out the form to obtain a valid trial license key.</div>')})),e.addClass("kfrm-form").addChild("div",(function(e){t=e,e.addClass("kfrm-fields label-above"),e.addClass("kfrm-break-20")})),this.addInputField(t,{id:"eqAuthEmail",name:"email",label:"Email",required:!0}),this.addInputField(t,{id:"eqAuthName",name:"contactName",label:"Name (optional)",required:!1}),e.addChild("div",(function(t){return t.html('<div style="margin-top:20px;font-size:0.9em">* By clicking Submit, you agree with Korzh.com <a href="https://korzh.com/terms-of-use">Terms of use</a> and <a href="https://korzh.com/privacy">Privacy policy</a>.</div><div style="font-size:0.9em">You also agree to receive email messages from Korzh.com. This consent may be revoked at any time.</div>')})),e.toDOM()},e.prototype.buildCodePage=function(){var t,e=X("div");return e.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">We sent a confirmation code to <strong>{{email}}</strong>.</div><div style="font-size:1.2em">Please find it in the email and enter to the text box below</div>')})),e.addClass("kfrm-form").addChild("div",(function(e){t=e,e.addClass("kfrm-fields label-above"),e.addClass("kfrm-break-20")})),this.addInputField(t,{id:"eqAuthCode",name:"code",label:"Confirmation code",required:!0}),e.addChild("div",(function(t){return t.html('<div style="margin-top:20px;font-size:0.9em">NB: Don\'t forget to check your SPAM folder if the message does not arrive within the next 5 minutes, and mark it as "Not Spam" if it\'s found there.</div>')})),e.toDOM().outerHTML},e.prototype.buildSuccessPage=function(){var t=X("div");return t.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">You have successfully completed the registration.</div>{{message}}')})),t.toDOM().outerHTML},e.prototype.buildFailurePage=function(){var t=X("div");return t.addChild("div",(function(t){return t.html("{{message}}")})),t.toDOM().outerHTML},e.prototype.startPageOnSubmit=function(e){var n=this,o=document.getElementById("eqAuthEmail"),i=document.getElementById("eqAuthName"),r=o.value,a=i.value;return e.disableButtons(),this.http.post(t.equtils.combinePath(At,"get-code"),{email:r,name:a,data:{ptag:this.context.backendInfo.type,apptype:this.context.backendInfo.subType}},{dataType:"json"}).then((function(t){if(0!==t.status)throw new Error(t.message);var e=n.dialogSet.openNext({email:r});setTimeout((function(){n.validateForm(e);var t=document.getElementById("eqAuthCode");t&&t.focus()}),200)})).catch((function(t){e.showAlert(t.message,"error",!0),e.enableButtons()})),!1},e.prototype.codePageOnSubmit=function(e){var n=this,o=document.getElementById("eqAuthCode").value;return e.disableButtons(),this.http.post(t.equtils.combinePath(At,"get-key"),{token:o,ptag:this.context.backendInfo.type,version:Lt},{dataType:"json"}).then((function(e){switch(e.status){case 0:var o=t.equtils.combinePath(n.context.getBaseEndpoint(),"lck");n.http.post(o,{version:Lt,key:e.key},{dataType:"json"}).then((function(t){return n.dialogSet.open(2,{message:'<div style="font-size:1.2em">Please restart your web application to get the key applied.</div>'})}),(function(t){return n.dialogSet.open(2,{message:'<div style="font-size:1.2em">Please visit <a href="https://account.korzh.com">your account page on Korzh.com</a> to get the key and then add it to the <i>appsettings.json</i> file (in the <i>EasyQuery/LicenseKey</i> option).</div>'})}));break;case 2:n.dialogSet.open(3,{message:'<div style="font-size:1.2em">Your trial license for EasyQuery has expired.</div><div style="font-size:1.2em">Please <a href="https://korzh.com/support">contact us</a> if you want to extend the trial period.</div>'});break;case 3:n.dialogSet.open(3,{message:'<div style="font-size:1.2em">The maintenance subscription for your EasyQuery license has expired.</div><div style="font-size:1.2em">You need to <a href="https://account.korzh.com">renew the subscription</a> to get a valid license.</div>'});break;default:throw new Error(e.message)}})).catch((function(t){e.showAlert(t.message,"error",!0),e.enableButtons()})),!1},e}();function Ft(){Rt&&(Rt.style.right="-400px",setTimeout((function(){Rt.parentNode.removeChild(Rt)}),5e3))}t.EqContext.prototype.setLicenseKeyEndpoint=function(t){console.warn("This method is deprecated and will be ignored.\n The main EasyQuery endpoint (set via useEndpoint() function) is used to get the license since version 7.0.\n So, you can simply remove this function call")},t.EqContext.prototype.useEnterprise=function(e){var o=this,i=function(t){if(n.ck(t),n.__kt>1){var e=o.getServices();e.registerDataModelResolver((function(t){return new y})),e.registerQueryResolver((function(t){return new f(t.getModel(),{context:t})})),e.registerQueryStorageResolver((function(t){return new g(t)})),e.registerAggregatesCalculator((function(t){return new v(t)})),2===n.__kt&&(console.warn("EasyQuery.JS is working in the TRIAL MODE!\nPlease order a license (https://korzh.com/eq) to get a proper product key."),function(){(Rt=document.createElement("div")).style.position="fixed",Rt.style.bottom="0",Rt.style.right="-400px",Rt.style.width="400px",Rt.style.height="100px",Rt.style.color="grey",Rt.style.textAlign="center",Rt.style.opacity="0.7",Rt.style.font="bold 1em Trebuchet MS, Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif",Rt.style.transition="right 3s ease-out";var t=document.createElement("div"),e=document.createElement("span");e.innerText="EasyQuery",e.style.color="#3A94D4",e.style.lineHeight="50px",t.appendChild(e);var n=document.createElement("span");n.innerText="by Korzh.com",n.style.marginLeft="10px",t.appendChild(n),Rt.appendChild(t);var o=document.createElement("div");o.innerText="FOR TRIAL USE ONLY",o.style.fontSize="1.2em",o.style.fontWeight="1000",Rt.appendChild(o),document.body.appendChild(Rt)}(),setTimeout((function(){Rt&&(Rt.style.right="0"),setTimeout(Ft,6e3)}),3e3))}else!function(t){if(-3==n.__kt)new Nt(t).show();else{var e,o,i=void 0,r=void 0;1===n.__kt?(i="EasyQuery trial has expired",r='Your trial period for EasyQuery has expired. \n You can <a href="https://korzh.com/support">submit a request to extend your trial</a> or <a href="https://korzh.com/easyquery#licensing">buy a license</a> to get rid of all limitations.',e="Buy a license",o="#licensing"):(i="Invalid key for EasyQuery!",r="The EasyQuery product key is either invalid or was issued for a different version of the library.\n The version you are using now is ".concat(Lt,',\n so please <a href="https://account.korzh.com">login to your account</a> to get a proper key for version ').concat(Lt),e="Get key",o="https://account.korzh.com");var a=(new _t).open({closable:!1,cancelable:!1,submitable:!1,title:i,body:r}).getRootElement().querySelector("footer");X(a).removeClass("align-right").setStyle("justify-content","center").addChild("button",(function(t){return t.addClass("kfrm-button","is-info").addText(e).on("click",(function(t){window.location.href=o}))})),1==n.__kt&&X(a).addChild("button",(function(t){return t.addClass("kfrm-button").addText("Extend trial").on("click",(function(t){window.location.href="https://account.korzh.com"}))}))}}(o)};if("string"==typeof e)i(e);else{if("function"!=typeof e)throw new Error("Wrong type of 'keyOrInitCallback' parameter. It must be a string with a license key or a callback function.");var r=this.getServices().getHttpClient(),a=t.equtils.combinePath(this.getBaseEndpoint(),"lck2");r.get(a).then((function(t){i(t.key.split("").reverse().join("")),o.useBackend({type:t.backendType,subType:t.appType}),e()})).catch((function(n){a=t.equtils.combinePath(o.getBaseEndpoint(),"lck"),r.get(a).then((function(t){i(t.split("").reverse().join("")),e()})).catch((function(t){return o.throwError({action:"LCK",sourceError:t})}))}))}};var Bt=function(){return Bt=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Bt.apply(this,arguments)},qt=function(){function e(e){this.context=e,this._needRecalculation=!0,this.aggrContainer=new t.EqAggregatesContainer(e)}return e.prototype.getAggrContainer=function(){return this.aggrContainer},e.prototype.calculate=function(e){this._needRecalculation=!1,this.aggrContainer.clear(),(e=e||{}).maxLevel=e.maxLevel>=0?e.maxLevel:0;var n=[],o=this.context.createQuery();o.loadFromData(this.context.getQuery().toJSONData());for(var i=this.context.getQuery().getAggregationSettings(),r=i.getAggregates(),a=i.getAggregates().map((function(t){return t.colId})),s=o.getColumns().filter((function(t){return a.indexOf(t.id)>=0})),l=function(e){o.changeColumnType(e,t.ExprTag.AggregateFunction,{funcId:r.filter((function(t){return t.colId==e.id}))[0].funcId})},c=0,u=s;c<u.length;c++){l(C=u[c])}for(var d=o.getColumns().filter((function(e){return e.expr.tag!==t.ExprTag.AggregateFunction})),h=0,p=d;h<p.length;h++){(C=p[h]).setHidden(!0)}if(i.hasRecordCount()){(C=o.createColumn()).caption=i.COUNT_FIELD_NAME,C._id=i.COUNT_FIELD_NAME;var f=new t.Expression(C);f.tag=t.ExprTag.CustomSql,f.sql="COUNT(*)",f.baseAttrId=null,C.expr=f,o.getColumns().push(C)}i.hasGrandTotals()&&n.push(this.processLevel({query:o,level:0,groupName:"Grand Totals",resultObtainedCallback:e.resultObtained,errorOccurredCallback:e.errorOccurred}));for(var g=i.getGroups(),m=1;m<=g.length;m++){for(var y=g[m-1],v=0,b=d;v<b.length;v++){var C;(C=b[v]).setHidden(y.columns.indexOf(C.id)<0)}n.push(this.processLevel({query:o,level:m,groupName:y.name,resultObtainedCallback:e.resultObtained,errorOccurredCallback:e.errorOccurred}))}return Promise.all(n).then((function(){})).catch((function(t){return console.error(t)}))},e.prototype.processLevel=function(t){var e=this,n=this.context.getServices().getDataFetcher(),o={aux:!0,query:t.query};return this.context.debugMode&&(o.debug="Fetching group data. Group: '".concat(t.groupName,"', level: ").concat(t.level)),n.fetchData(o).then((function(n){for(var o=new H({elasticChunks:!0}),i=n.resultSet,r=0,a=i.cols;r<a.length;r++){var s=a[r];o.columns.add(s)}for(var l=0,c=i.rows;l<c.length;l++){var u=c[l];o.addRow(u)}var d=e.buildLevelData(t.level,o);e.aggrContainer.setAggregateData(t.level,d),t.resultObtainedCallback&&t.resultObtainedCallback(n,t.level)})).catch((function(e){t.errorOccurredCallback&&t.errorOccurredCallback(Bt(Bt({},e),{level:t.level}))}))},e.prototype.buildLevelData=function(t,e){var n=this.context.getQuery().getAggregationSettings(),o=t>0?n.getGroups()[t-1].columns:[],i=n.getAggregates().map((function(t){return t.colId}));n.hasRecordCount()&&i.push(n.COUNT_FIELD_NAME);for(var r=new Map,a=0,s=e.getCachedRows();a<s.length;a++){for(var l=s[a],c={},u={},d=0,h=o;d<h.length;d++){var p=h[d];if(e.columns.getIndex(p)>=0){var f=l.getValue(p);n.caseSensitiveGroups||"string"!=typeof f||(f=f.toLowerCase()),c[p]=f}}for(var g=0,m=i;g<m.length;g++){var y=m[g];u[y]=l.getValue(y)}r.set(JSON.stringify(c),u)}return r},e.prototype.needRecalculation=function(){return this._needRecalculation},e.prototype.reset=function(){this._needRecalculation=!0},e}()})(),__webpack_exports__})()));
|
|
3
|
-
//# sourceMappingURL=easyquery.enterprise.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// return eval('/*@cc_on!@*/false || !!document.documentMode');
|