igniteui-webcomponents-datasources 4.2.4-alpha → 4.3.0-beta.0
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/bundles/igniteui-webcomponents-datasources.umd.js +194 -194
- package/bundles/igniteui-webcomponents-datasources.umd.min.js +1 -1
- package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js +37 -37
- package/esm2015/lib/RestVirtualDataSourceDataProviderWorker.js +40 -40
- package/esm2015/lib/util.js +5 -5
- package/esm5/lib/Entity.js +3 -3
- package/esm5/lib/EntityProperty.js +3 -3
- package/esm5/lib/EntitySet.js +4 -4
- package/esm5/lib/ODataSchemaProvider.js +4 -4
- package/esm5/lib/ODataVirtualDataSource.js +10 -10
- package/esm5/lib/ODataVirtualDataSourceDataProvider.js +27 -27
- package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js +26 -26
- package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +12 -12
- package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +2 -2
- package/esm5/lib/RestVirtualDataSource.js +22 -22
- package/esm5/lib/RestVirtualDataSourceDataProvider.js +38 -38
- package/esm5/lib/RestVirtualDataSourceDataProviderWorker.js +18 -18
- package/esm5/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +23 -23
- package/esm5/lib/RestVirtualDataSourceProviderTaskDataHolder.js +2 -2
- package/esm5/lib/Schema.js +3 -3
- package/esm5/lib/util.js +7 -7
- package/fesm2015/igniteui-webcomponents-datasources.js +82 -82
- package/fesm5/igniteui-webcomponents-datasources.js +157 -157
- package/lib/Entity.d.ts +4 -3
- package/lib/EntityProperty.d.ts +6 -3
- package/lib/EntitySet.d.ts +8 -4
- package/lib/ODataSchemaProvider.d.ts +2 -1
- package/lib/ODataVirtualDataSource.d.ts +13 -8
- package/lib/ODataVirtualDataSourceDataProvider.d.ts +38 -25
- package/lib/ODataVirtualDataSourceDataProviderWorker.d.ts +3 -3
- package/lib/ODataVirtualDataSourceDataProviderWorkerSettings.d.ts +20 -10
- package/lib/RestVirtualDataSource.d.ts +46 -20
- package/lib/RestVirtualDataSourceDataProvider.d.ts +69 -36
- package/lib/RestVirtualDataSourceDataProviderWorker.d.ts +3 -3
- package/lib/RestVirtualDataSourceDataProviderWorkerSettings.d.ts +51 -21
- package/lib/Schema.d.ts +4 -3
- package/lib/util.d.ts +8 -5
- package/package.json +2 -2
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
https://www.infragistics.com/legal/license/igultimate-eula
|
|
5
5
|
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
|
|
6
6
|
*/
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("igniteui-webcomponents-core"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","igniteui-webcomponents-core","tslib"],t):t((e=e||self)["igniteui-webcomponents-datasources"]={},e.igniteuiWebcomponentsCore,e.tslib_1)}(this,(function(e,t,r){"use strict";var i=function(){function e(e,t){this._name=null,this._isNullable=!1,this._type=null,this.name=e,this.type=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isNullable",{get:function(){return this._isNullable},set:function(e){this._isNullable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},set:function(e){this._type=e},enumerable:!0,configurable:!0}),e}();function o(e){return Array.from(t.fromEnum(e))}function n(e){var t,i;try{for(var o=r.__values(e),n=o.next();!n.done;n=o.next()){return n.value}}catch(e){t={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}throw new Error("Iterable contained no elements, expected at least one")}var s=function(){function e(){}return Object.defineProperty(e.prototype,"first",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this._last},enumerable:!0,configurable:!0}),e.prototype.addFirst=function(e){if(null==this._first)this._first=new a(e),this._last=this._first;else{var t=this._first;this._first=new a(e),this._first.next=t,t.prev=this._first}},e.prototype.addLast=function(e){if(null==this._last)this._first=new a(e),this._last=this._first;else{var t=this._last;this._last=new a(e),this._last.prev=t,t.next=this._last}},e.prototype.removeFirst=function(){this.remove(this.first)},e.prototype.clear=function(){this._first=null,this._last=null},e.prototype.contains=function(e){for(var t=this.first;null!=t;){if(t.value===e)return!0;t=t.next}return!1},e.prototype.removeValue=function(e){for(var t=this.first;null!=t;){if(t.value===e)return void this.remove(t);t=t.next}},e.prototype.remove=function(e){this._first==e&&(this._first=e.next,null!=e.next&&(e.next.prev=null)),this._last==e&&(this._last=e.prev,null!=e.prev&&(e.prev.next=null)),null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e.next=null,e.prev=null},e}(),a=function(){function e(e){void 0!==e&&(this.value=e)}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"prev",{get:function(){return this._prev},set:function(e){this._prev=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"next",{get:function(){return this._next},set:function(e){this._next=e},enumerable:!0,configurable:!0}),e}(),u=function(){function e(e,t){this._properties=null,this._primaryKey=null,this._name=null,this.name=e,this.loadProperties(t),this.loadPrimaryKey(t)}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return null==this._properties&&(this._properties=new Map),this._properties},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"primaryKey",{get:function(){return null==this._primaryKey&&(this._primaryKey=[]),this._primaryKey},enumerable:!0,configurable:!0}),e.prototype.loadProperties=function(e){for(var r=o(e.elements()),n=r.length,s=t.XName.get("Name",""),a=t.XName.get("Type",""),u=0;u<n;u++){var p=r[u];if("Property"==p.name.localName){var l=p.attribute(s).value,c=p.attribute(a).value;this.properties.set(l,new i(l,c))}}},e.prototype.loadPrimaryKey=function(e){for(var r=o(e.elements()),i=r.length,n=t.XName.get("Name",""),s=0;s<i;s++){var a=r[s];if("Key"==a.name.localName)for(var u=o(a.elements()),p=u.length,l=0;l<p;l++){var c=u[l];"PropertyRef"==c.name.localName&&this.primaryKey.push(c.attribute(n).value)}}},e}(),p=function(){function e(e,t){if(this._entityName=null,this._entityNamespace=null,this._entityType=null,this._name=null,this.name=e,this.entityType=t,t.indexOf(".")>=0){var r=t.split(".");if(2==r.length)this.entityNamespace=r[0],this.entityName=r[1];else{var i=t.lastIndexOf(".");this.entityNamespace=t.substr(0,i),this.entityName=t.substr(i+1)}}else this.entityNamespace=t,this.entityName=t}return Object.defineProperty(e.prototype,"entityName",{get:function(){return this._entityName},set:function(e){this._entityName=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"entityNamespace",{get:function(){return this._entityNamespace},set:function(e){this._entityNamespace=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"entityType",{get:function(){return this._entityType},set:function(e){this._entityType=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!0,configurable:!0}),e}(),l=function(){function e(e,r,i,o,n){if(this._actualData=null,this._schema=null,this._pageIndex=0,this._groupInformation=null,this._summaryInformation=null,null==e)this._actualData=null;else{var s=e.value.length;this._actualData=[];for(var a=new Set,u=0;u<r.propertyNames.length;u++)r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeValue&&r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeOffsetValue||a.add(r.propertyNames[u]);for(var p=void 0,l=function(t){for(var r=e.value[t],i=new Map,o=Array.from(Object.keys(r)),n=o.map((function(e){return r[e]})),s=0;s<o.length;s++)p=n[s],a.has(o[s])&&(p=new Date(p)),i.set(o[s],p);c._actualData[t]=i},c=this,h=0;h<s;h++)l(h)}this._schema=r,this._groupInformation=i,this._summaryInformation=o,this._pageIndex=n}return e.prototype.count=function(){return this._actualData.length},e.prototype.getItemAtIndex=function(e){return this._actualData[e]},e.prototype.getItemValueAtIndex=function(e,t){var r=this._actualData[e];return r.has(t)?r.get(t):null},e.prototype.pageIndex=function(){return this._pageIndex},e.prototype.schema=function(){return this._schema},e.prototype.getGroupInformation=function(){return this._groupInformation},e.prototype.getSummaryInformation=function(){return this._summaryInformation},e}(),c=function(){function e(e,t,r){this._entities=null,this._entitySets=null,this._namespace=null,this.namespace=e,this.loadEntities(t),this.loadEntitySets(r)}return Object.defineProperty(e.prototype,"entities",{get:function(){return null==this._entities&&(this._entities=new Map),this._entities},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"entitySets",{get:function(){return null==this._entitySets&&(this._entitySets=new Map),this._entitySets},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"namespace",{get:function(){return this._namespace},set:function(e){this._namespace=e},enumerable:!0,configurable:!0}),e.prototype.loadEntities=function(e){for(var r=e,i=r.length,o=t.XName.get("Name",""),n=0;n<i;n++){var s=r[n],a=new u(s.attribute(o).value,s);this.entities.set(a.name,a)}},e.prototype.loadEntitySets=function(e){for(var r=e,i=r.length,o=t.XName.get("Name",""),n=t.XName.get("EntityType",""),s=0;s<i;s++){var a=r[s],u=new p(a.attribute(o).value,a.attribute(n).value);this.entitySets.set(u.name,u)}},e}(),h=function(){function e(r){if(this._entityTypeSchemaNamespace=null,this._entitySetSchemaNamespace=null,this._schema=null,null!=r){var i=t.XDocument.parse(r),s=o(n(t.fromEnum(n(t.fromEnum(i.elements())).elements())).elements1(t.XName.get("Schema",e.nS.namespaceName)));if(null!=s){for(var a=null,u=null,p=s.length,l=t.XName.get("EntityContainer",e.nS.namespaceName),h=t.XName.get("EntitySet",e.nS.namespaceName),f=t.XName.get("Namespace",""),d=t.XName.get("EntityType",e.nS.namespaceName),m=0;m<p;m++){if(s[m].nodeType==t.XmlNodeType.Element){var y=s[m];if(null==a){var g=o(y.elements1(l));null!=g&&g.length>0&&null!=(a=o(t.typeCast(t.XElement.$type,g[0]).elements1(h)))&&(this._entitySetSchemaNamespace=y.attribute(f).value)}null==u&&null!=(u=o(y.elements1(d)))&&(this._entityTypeSchemaNamespace=y.attribute(f).value)}}null!=a&&null!=u&&(this.schema=new c(this._entityTypeSchemaNamespace,u,a))}}}return Object.defineProperty(e.prototype,"schema",{get:function(){return this._schema},set:function(e){this._schema=e},enumerable:!0,configurable:!0}),e.prototype.getODataDataSourceSchema=function(e){var i,o,n,s;if(null==this.schema)return null;var a=[],u=[],p=[],l=this.schema.entitySets.get(e);if(null!=l){var c=this.schema.entities.get(l.entityName);if(null!=c){try{for(var h=r.__values(c.properties.values()),f=h.next();!f.done;f=h.next()){var d=f.value;a.push(d.name),"Edm.String"==d.type?u.push(t.DataSourceSchemaPropertyType.StringValue):"Edm.Int16"==d.type||"Edm.Int32"==d.type?u.push(t.DataSourceSchemaPropertyType.IntValue):"Edm.Double"==d.type?u.push(t.DataSourceSchemaPropertyType.DoubleValue):"Edm.Single"==d.type?u.push(t.DataSourceSchemaPropertyType.SingleValue):"Edm.Boolean"==d.type?u.push(t.DataSourceSchemaPropertyType.BooleanValue):"Edm.Byte"==d.type?u.push(t.DataSourceSchemaPropertyType.ShortValue):"Edm.DateTime"==d.type||"Edm.DateTimeOffset"==d.type?u.push(t.DataSourceSchemaPropertyType.DateTimeValue):"Edm.Int64"==d.type?u.push(t.DataSourceSchemaPropertyType.LongValue):"Edm.Decimal"==d.type?u.push(t.DataSourceSchemaPropertyType.DecimalValue):"Edm.SByte"==d.type?u.push(t.DataSourceSchemaPropertyType.ShortValue):u.push(t.DataSourceSchemaPropertyType.ObjectValue)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}try{for(var m=r.__values(c.primaryKey),y=m.next();!y.done;y=m.next()){var g=y.value;p.push(g)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(n)throw n.error}}}}return new t.ODataDataSourceSchema(a,u,p)},e.nS=t.XNamespace.get("http://docs.oasis-open.org/odata/ns/edm"),e}(),f=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(i,e),i.$t=t.markType(i,"ODataVirtualDataSourceProviderTaskDataHolder",t.AsyncVirtualDataSourceProviderTaskDataHolder.$type),i}(t.AsyncVirtualDataSourceProviderTaskDataHolder),d=function(e){function i(i){var o,n,s=e.call(this,i)||this;if(s._baseUri=null,s._entitySet=null,s._sortDescriptions=null,s._groupDescriptions=null,s._filterExpressions=null,s._summaryDescriptions=null,s._desiredPropeties=null,s._enableJsonp=!0,s._isAggregationSupported=!1,s._groupInformation=null,s._summaryInformation=null,s._filterString=null,s._selectedString=null,s.doWork=s.doWork.bind(s),s._baseUri=i.baseUri,s._entitySet=i.entitySet,s._sortDescriptions=i.sortDescriptions,s._groupDescriptions=i.groupDescriptions,null!=s._groupDescriptions&&s._groupDescriptions.size()>0){s._sortDescriptions=new t.SortDescriptionCollection;try{for(var a=r.__values(s.iter(i.sortDescriptions)),u=a.next();!u.done;u=a.next()){var p=u.value;s._sortDescriptions.add(p)}}catch(e){o={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}for(var l=0;l<s._groupDescriptions.size();l++)s._sortDescriptions.insert(l,s._groupDescriptions.get(l))}return s._filterExpressions=i.filterExpressions,s._desiredPropeties=i.propertiesRequested,s._summaryDescriptions=i.summaryDescriptions,s._summaryScope=i.summaryScope,s._enableJsonp=i.enableJsonp,s._isAggregationSupported=i.isAggregationSupported,window.setTimeout(s.doWork,100),s}return r.__extends(i,e),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"desiredProperties",{get:function(){return this._desiredPropeties},enumerable:!0,configurable:!0}),i.prototype.initialize=function(){e.prototype.initialize.call(this)},i.prototype.getTaskDataHolder=function(){return new f},i.prototype.getCompletedTaskData=function(t,r){e.prototype.getCompletedTaskData.call(this,t,r)},i.prototype.removeCompletedTaskData=function(t,r){e.prototype.removeCompletedTaskData.call(this,t,r)},i.prototype.getTasksData=function(t){e.prototype.getTasksData.call(this,t)},i.prototype.iter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterFilter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterSummaries=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.processCompletedTask=function(e,t,r,o){var n,s=this,a=null,u=-1,p=e.task;try{if(p.hasErrors)return void this.retryIndex(r,t);r==i.schemaRequestIndex?u=(a=p.result)["@odata.count"]:a=p.result}catch(e){return void this.retryIndex(r,t)}if(this.actualCount=u>=0?u:a["@odata.count"],null!=(n=this.actualSchema))this.finishProcessingCompletedTask(p,r,n,a);else{var l=0;this.resolveSchema((function(e){s.actualSchema=e,!s._isAggregationSupported||0===s._groupDescriptions.size()&&0===s._summaryDescriptions.size()?s.finishProcessingCompletedTask(p,r,e,a):(s._groupDescriptions.size()>0&&(l++,s.resolveGroupInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))),s._summaryDescriptions.size()>0&&(l++,s.resolveSummaryInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))))}),(function(){s.retryIndex(r,t)}))}},i.prototype.finishProcessingCompletedTask=function(e,t,r,i){var o,n,s,a,u=this;this.actualSchema=r,o=this.executionContext,s=this._groupInformation,a=this._summaryInformation,n=this.pageLoaded;var p=null;if(null!=i?(p=new l(i,r,s,a,t),!this.isLastPage(t)&&p.count()>0&&!this.populatedActualPageSize&&(this.populatedActualPageSize=!0,this.actualPageSize=p.count())):p=new l(null,r,s,a,t),null!=this.pageLoaded)if(null!=this.executionContext){if(null==o||null==n)return void this.shutdown();o.execute((function(){return n(p,u.actualCount,u.actualPageSize)}))}else{if(null==n)return void this.shutdown();n(p,this.actualCount,this.actualPageSize)}},i.prototype.resolveGroupInformation=function(e,i){var o,n,s=this;if(null==this._groupInformation){var a,u="",p="",l="";if(null!=this._groupDescriptions&&0!=this._groupDescriptions.size()){if(a=this._filterString,this.updateFilterString(),null!=this._groupDescriptions){var c=!0;try{for(var h=r.__values(this.iter(this._groupDescriptions)),f=h.next();!f.done;f=h.next()){var d=f.value;c?c=!1:(u+=", ",p+=", "),p+=d.propertyName,d.direction===t.ListSortDirection.Descending?u+=d.propertyName+" desc":u+=d.propertyName+" asc"}}catch(e){o={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(o)throw o.error}}}if(this._summaryScope===t.DataSourceSummaryScope.Both||this._summaryScope===t.DataSourceSummaryScope.Groups){var m=this.getSummaryQueryParameters(!0);t.stringIsNullOrEmpty(m)||(l=", "+m)}var y=this._entitySet+"?$orderby="+u+"&$apply=";t.stringIsNullOrEmpty(a)||(y+="filter("+a+")/"),y+="groupby(("+p+"), aggregate($count as $__count"+l+"))";try{var g=[],_=function(t,r){return s.groupSuccess(t,r,e,i,g)},v=function(t){return s.groupError(t,e,i,g)},b={requestUri:this._baseUri+"/"+y,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){odatajs.oData.request(b,_,v)})()}catch(e){i()}}else e(null)}else e(this._groupInformation)},i.prototype.groupError=function(e,t,r,i){this._groupInformation=null},i.prototype.groupSuccess=function(e,t,i,o,n){var s,a,u=[];try{for(var p=r.__values(this.iter(this._groupDescriptions)),l=p.next();!l.done;l=p.next()){var c=l.value;u.push(c.propertyName)}}catch(e){s={error:e}}finally{try{l&&!l.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}if(e&&e.value&&e.value.length>0)for(var h=0;h<e.value.length;h++)this.addGroup(n,u,u,0,e.value[h]);this._groupInformation=n,i(this._groupInformation)},i.prototype.addGroup=function(e,i,o,n,s){var a,u,p=[];try{for(var l=r.__values(i),c=l.next();!c.done;c=l.next()){var h=c.value;s[h]&&p.push(s[h])}}catch(e){a={error:e}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(a)throw a.error}}var f=0;s.$__count&&(f=t.Convert.toInt321(s.$__count));var d=null;this._summaryScope!=t.DataSourceSummaryScope.Both&&this._summaryScope!=t.DataSourceSummaryScope.Groups||(d=this.createSummaryResults(s));var m=new t.DefaultSectionInformation(n,n+(f-1),o,p,d);e.push(m)},i.prototype.resolveSummaryInformation=function(e,r){var i=this;if(null==this._summaryInformation){var o,n;if(null!=this._summaryDescriptions&&0!=this._summaryDescriptions.size()&&this._summaryScope!=t.DataSourceSummaryScope.Groups&&this._summaryScope!=t.DataSourceSummaryScope.None){o=this._filterString,this.updateFilterString(),n=this.getSummaryQueryParameters(!1);var s=this._entitySet+"?$apply=";t.stringIsNullOrEmpty(o)||(s+="filter("+o+")/"),s+="aggregate("+n+")";try{var a=[],u=function(t,o){return i.summarySuccess(t,o,e,r,a)},p=function(t){return i.summaryError(t,e,r,a)},l={requestUri:this._baseUri+"/"+s,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){odatajs.oData.request(l,u,p)})()}catch(e){r()}}else e(null)}else e(this._summaryInformation)},i.prototype.summarySuccess=function(e,t,r,i,o){e&&e.value&&e.value.length>0&&(o=this.createSummaryResults(e.value[0])),this._summaryInformation=o,r(this._summaryInformation)},i.prototype.summaryError=function(e,t,r,i){this._summaryInformation=null},i.prototype.getSummaryQueryParameters=function(e){var i,o,n="";if(null!=this._summaryDescriptions){var s=!0,a=!1;try{for(var u=r.__values(this.iterSummaries(this._summaryDescriptions)),p=u.next();!p.done;p=u.next()){var l=p.value;if(l.operand!=t.DataSourceSummaryOperand.Count||!e&&!a){switch(s||(n+=", "),l.operand){case t.DataSourceSummaryOperand.Average:n+=l.propertyName+" with average as "+l.propertyName+"Average";break;case t.DataSourceSummaryOperand.Min:n+=l.propertyName+" with min as "+l.propertyName+"Min";break;case t.DataSourceSummaryOperand.Max:n+=l.propertyName+" with max as "+l.propertyName+"Max";break;case t.DataSourceSummaryOperand.Sum:n+=l.propertyName+" with sum as "+l.propertyName+"Sum";break;case t.DataSourceSummaryOperand.Count:n+="$count as $__count",a=!0}s=!1}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}return n},i.prototype.createSummaryResults=function(e){var i,o,n=[];try{for(var s=r.__values(this.iterSummaries(this._summaryDescriptions)),a=s.next();!a.done;a=s.next()){var u=a.value,p=u.propertyName;switch(u.operand){case t.DataSourceSummaryOperand.Average:p+="Average";break;case t.DataSourceSummaryOperand.Min:p+="Min";break;case t.DataSourceSummaryOperand.Max:p+="Max";break;case t.DataSourceSummaryOperand.Sum:p+="Sum";break;case t.DataSourceSummaryOperand.Count:p="$__count"}var l=null;e&&e[p]&&(l=e[p]);var c=new t.DefaultSummaryResult(u.propertyName,u.operand,l);n.push(c)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return n},i.prototype.resolveSchema=function(e,t){var r=this,i=this._baseUri,o=new XMLHttpRequest;o.onreadystatechange=function(){var i,n;4===o.readyState&&(200===o.status?(i=o.responseText,n=new h(i).getODataDataSourceSchema(r._entitySet),e(n)):t())},o.open("Get",i+"/$metadata"),o.send()},i.prototype.makeTaskForRequest=function(e,o){var n,s,a;a=this.actualPageSize,this.sortDescriptions;var u=this._baseUri;u+="/"+this._entitySet;var p=!1;if(this.updateFilterString(),null!=this._filterString&&(p?u+="&":(p=!0,u+="?"),u+="$filter="+this._filterString),null!=this.sortDescriptions){var l=null;try{for(var c=r.__values(this.iter(this.sortDescriptions)),h=c.next();!h.done;h=c.next()){var f=h.value;null==l?l="":l+=", ",f.direction==t.ListSortDirection.Descending?l+=f.propertyName+" desc":l+=f.propertyName}}catch(e){n={error:e}}finally{try{h&&!h.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}null!=l&&(p?u+="&":(p=!0,u+="?"),u+="$orderby="+l)}if(null!=this.desiredProperties&&this.desiredProperties.length>0){for(var d="",m=!0,y=this.desiredProperties,g=0;g<y.length;g++){m?m=!1:d+=", ",d+=y[g]}p?u+="&":(p=!0,u+="?"),u+="$select="+d}var _=new t.AsyncVirtualDataTask;e.index==i.schemaRequestIndex?this.executeRequest(u,p,0,a,_):this.executeRequest(u,p,e.index*a,a,_),e.taskHolder=new t.AsyncDataSourcePageTaskHolder,e.taskHolder.task=_,this.tasks.add(e)},i.prototype.updateFilterString=function(){var e,i;if(null!=this.filterExpressions&&this.filterExpressions.size()>0&&null==this._filterString){var o="",n=!0;try{for(var s=r.__values(this.iterFilter(this.filterExpressions)),a=s.next();!a.done;a=s.next()){var u=a.value;n?n=!1:o+=" AND ";var p=new t.ODataDataSourceFilterExpressionVisitor(0);p.visit(u);var l=p.toString();this.filterExpressions.size()>1&&(l="("+l+")"),o+=l}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}this._filterString=o}},i.prototype.executeRequest=function(e,t,r,i,o){var n=this;t?e+="&":(t=!0,e+="?");var s,a=function(e,t){return n.success(o,e,t)},u=function(e){return n.error(o,e)},p={requestUri:e+="$skip="+r+"&$top="+i+"&$count=true",enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};s=function(){odatajs.oData.request(p,a,u)},o.run=s},i.prototype.success=function(e,t,r){e.result=t,e.isCompleted=!0},i.prototype.error=function(e,t){e.isCompleted=!0,e.hasErrors=!0},i.prototype.createBatchRequest=function(e){for(var r=[],i=0;i<e.length;i++){var o=e[i],n={"Content-Type":"application/json","odata-version":"4.0"};o.transactionType===t.TransactionType.Add?r.push({method:"POST",id:"r"+i,atomicityGroup:"g1",url:this._baseUri+"/"+this._entitySet,headers:n,body:o.value}):o.transactionType===t.TransactionType.Update?(o.version&&(n["If-Match"]=o.version),r.push({method:"PATCH",id:"r"+i,atomicityGroup:"g1",url:this._baseUri+"/"+this.getRequestUriWithKey(o.id),headers:n,body:o.value})):o.transactionType===t.TransactionType.Delete&&(o.version&&(n["If-Match"]=o.version),r.push({method:"DELETE",id:"r"+i,atomicityGroup:"g1",url:this._baseUri+"/"+this.getRequestUriWithKey(o.id),headers:n}))}var s={requestUri:this._baseUri+"/$batch",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requests:r})},a=this;odatajs.oData.request(s,(function(e){if(e&&e.responses)if(e.responses.length>0){for(var t=!0,i=[],o=function(o){if(200!==e.responses[o].status&&204!==e.responses[o].status){t=!1;var n=r.filter((function(t){return t.id==e.responses[o].id}))[0];if(n){var s=n.method+" request failed with code "+e.responses[o].status;i.push(s),console.error(s)}return"break"}},n=0;n<e.responses.length;n++){if("break"===o(n))break}t?a.batchCompleted(!0,!0,null):a.batchCompleted(!1,!0,i)}else a.batchCompleted(!1,!0,null)}),(function(e){var t=[];e&&e.message&&t.push(e.message),a.batchCompleted(!1,!0,t)}))},i.prototype.getRequestUriWithKey=function(e){for(var t="",r=Object.keys(e),i=0;i<r.length;i++)i>0&&(t+=","),t+=r[i]+"="+e[r[i]];return this._entitySet+"("+t+")"},i.schemaRequestIndex=-1,i}(t.AsyncVirtualDataSourceProviderWorker),m=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._baseUri=null,t._entitySet=null,t._sortDescriptions=null,t._filterExpressions=null,t._propertiesRequested=null,t._groupDescriptions=null,t._summaryDescriptions=null,t}return r.__extends(i,e),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){this._baseUri=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){this._entitySet=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},set:function(e){this._sortDescriptions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},set:function(e){this._filterExpressions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},set:function(e){this._groupDescriptions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},set:function(e){this._summaryDescriptions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryscope},set:function(e){this._summaryscope=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!0,configurable:!0}),i.$t=t.markType(i,"ODataVirtualDataSourceDataProviderWorkerSettings",t.AsyncVirtualDataSourceDataProviderWorkerSettings.$type),i}(t.AsyncVirtualDataSourceDataProviderWorkerSettings),y=function(e){function i(){var r=e.call(this)||this;return r._worker=null,r._requests=new s,r._callback=null,r._pageLoaded=null,r._pageSizeRequested=50,r._baseUri=null,r._entitySet=null,r._timeoutMilliseconds=1e4,r.schemaChanged=null,r._currentFullCount=0,r._currentSchema=null,r._executionContext=null,r._updateNotifier=null,r._deferAutoRefresh=!1,r._sortDescriptions=null,r._groupDescriptions=null,r._propertiesRequested=null,r._filterExpressions=null,r._summaryDescriptions=null,r._enableJsonp=!0,r._schemaFetchQueued=!1,r._autoRefreshQueued=!1,r._batchCompleted=null,r._sortDescriptions=new t.SortDescriptionCollection,r._sortDescriptions.onChanged=function(){return r.sortDescriptions_CollectionChanged(null,null)},r._groupDescriptions=new t.SortDescriptionCollection,r._groupDescriptions.onChanged=function(){return r.groupDescriptions_CollectionChanged(null,null)},r._filterExpressions=new t.FilterExpressionCollection,r._filterExpressions.onChanged=function(){return r.filterExpressions_CollectionChanged(null,null)},r._summaryDescriptions=new t.SummaryDescriptionCollection,r._summaryDescriptions.onChanged=function(){return r.summaryDescriptions_CollectionChanged(null,null)},r}return r.__extends(i,e),i.prototype.filterExpressions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.sortDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.groupDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.summaryDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.addPageRequest=function(e,r){this.deferAutoRefresh||(null!=this._worker&&this._worker.isShutdown&&(this._worker=null,this._callback=null),null==this._worker&&this.createWorker(),r==t.DataSourcePageRequestPriority.High?this._requests.addFirst(e):this._requests.addLast(e),this._worker.addPageRequest(e,r)||(this._worker=null,this._callback=null,this.addPageRequest(e,r)))},i.prototype.createWorker=function(){if(this.valid()){this._callback=t.runOn(this,this.raisePageLoaded);var e=this.getWorkerSettings();this._worker=new d(e)}},i.prototype.valid=function(){return null!=this.entitySet&&null!=this.baseUri},i.prototype.getWorkerSettings=function(){var e,t=this;return(e=new m).baseUri=t._baseUri,e.entitySet=t._entitySet,e.pageSizeRequested=t._pageSizeRequested,e.timeoutMilliseconds=t._timeoutMilliseconds,e.pageLoaded=t._callback,e.batchCompleted=t._batchCompleted,e.executionContext=t._executionContext,e.sortDescriptions=t._sortDescriptions,e.groupDescriptions=t._groupDescriptions,e.filterExpressions=t._filterExpressions,e.propertiesRequested=t._propertiesRequested,e.summaryDescriptions=t._summaryDescriptions,e.summaryScope=t._summaryScope,e.enableJsonp=t._enableJsonp,e.isAggregationSupported=t.isAggregationSupported,e},i.prototype.removePageRequest=function(e){for(var t=this._requests.first;null!=t;)t.value==e&&this._requests.remove(t),t=t.next;null!=this._worker&&this._worker.removePageRequest(e)},i.prototype.removeAllPageRequests=function(){this._requests.clear(),null!=this._worker&&this._worker.removeAllPageRequests()},i.prototype.close=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageLoaded",{get:function(){return this._pageLoaded},set:function(e){this._pageLoaded=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),i.prototype.raisePageLoaded=function(e,r,i){if(null!=this._pageLoaded){if(this._currentFullCount=r,null==this._currentSchema){var o=null;null!=e&&(o=e.schema()),this._currentSchema=o,null!=this.schemaChanged&&this.schemaChanged(this,new t.DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema,this._currentFullCount))}e.pageIndex()!=d.schemaRequestIndex&&this._pageLoaded(e,r,i)}},i.prototype.killWorker=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageSizeRequested",{get:function(){return this._pageSizeRequested},set:function(e){this._pageSizeRequested=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,t!=this._entitySet&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){this._timeoutMilliseconds=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),i.prototype.getItemValue=function(e,t){var r=e;return r.has(t)?r.get(t):null},i.prototype.setItemValue=function(e,t,r){},i.prototype.removeItem=function(e){},i.prototype.addItem=function(e){},Object.defineProperty(i.prototype,"actualCount",{get:function(){return this._currentFullCount},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"actualSchema",{get:function(){return this._currentSchema},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"executionContext",{get:function(){return this._executionContext},set:function(e){this._executionContext=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"updateNotifier",{get:function(){return this._updateNotifier},set:function(e){this._updateNotifier=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"deferAutoRefresh",{get:function(){return this._deferAutoRefresh},set:function(e){this._deferAutoRefresh=e,this._deferAutoRefresh||this.queueAutoRefresh(),this._deferAutoRefresh&&this.valid()&&null==this._currentSchema&&this.queueSchemaFetch()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isSortingSupported",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isGroupingSupported",{get:function(){return this.isAggregationSupported},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFilteringSupported",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryScope},set:function(e){this._summaryScope=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"notifyUsingSourceIndexes",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isItemIndexLookupSupported",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isKeyIndexLookupSupported",{get:function(){return!1},enumerable:!0,configurable:!0}),i.prototype.notifySetItem=function(e,t,r){null!=this.updateNotifier&&this.updateNotifier.notifySetItem(e,t,r)},i.prototype.notifyClearItems=function(){null!=this.updateNotifier&&this.updateNotifier.notifyClearItems()},i.prototype.notifyInsertItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyInsertItem(e,t)},i.prototype.notifyRemoveItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyRemoveItem(e,t)},i.prototype.queueSchemaFetch=function(){this._schemaFetchQueued||null!=this.executionContext&&(this._schemaFetchQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doSchemaFetchInternal)))},i.prototype.doSchemaFetchInternal=function(){this._schemaFetchQueued&&(this._schemaFetchQueued=!1,this.schemaFetchInternal())},i.prototype.schemaFetchInternal=function(){this.schemaFetchInternalOverride()},i.prototype.schemaFetchInternalOverride=function(){this.deferAutoRefresh&&(this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this.addSchemaRequest())},i.prototype.addSchemaRequest=function(){this._worker.addPageRequest(d.schemaRequestIndex,t.DataSourcePageRequestPriority.High)},i.prototype.queueAutoRefresh=function(){this.deferAutoRefresh||this._autoRefreshQueued||null!=this.executionContext&&(this._autoRefreshQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doRefreshInternal)))},i.prototype.doRefreshInternal=function(){this.deferAutoRefresh?this._autoRefreshQueued=!1:this._autoRefreshQueued&&(this._autoRefreshQueued=!1,this.refreshInternal())},i.prototype.refreshInternal=function(){this.refreshInternalOverride()},i.prototype.refreshInternalOverride=function(){this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this._worker.addPageRequest(0,t.DataSourcePageRequestPriority.Normal)},i.prototype.flushAutoRefresh=function(){this.doRefreshInternal()},i.prototype.refresh=function(){this.refreshInternal()},i.prototype.indexOfItem=function(e){return-1},i.prototype.indexOfKey=function(e){return-1},i.prototype.resolveSchemaPropertyType=function(e){if(null==this.actualSchema)return t.DataSourceSchemaPropertyType.ObjectValue;if(t.stringContains(e,"."))return t.DataSourceSchemaPropertyType.ObjectValue;for(var r=0;r<this.actualSchema.propertyNames.length;r++){if(this.actualSchema.propertyNames[r]==e)return this.actualSchema.propertyTypes[r]}return t.DataSourceSchemaPropertyType.ObjectValue},i.prototype.createBatchRequest=function(e){this._worker&&this._worker.createBatchRequest(e)},Object.defineProperty(i.prototype,"batchCompleted",{get:function(){return this._batchCompleted},set:function(e){this._batchCompleted=e},enumerable:!0,configurable:!0}),i.$t=t.markType(i,"ODataVirtualDataSourceDataProvider",t.Base.$type,[t.IDataSourceVirtualDataProvider_$type]),i}(t.Base),g=function(e){function i(){var t,r=e.call(this)||this;return r._baseUri=null,r._entitySet=null,r._timeoutMilliseconds=1e4,r._isAggregationSupportedByServer=!1,r._enableJsonp=!0,r.dataProvider=((t=new y).executionContext=r.executionContext,t.enableJsonp=r.enableJsonp,t.isAggregationSupported=r.isGroupingSupported,t),r.externalDataSource=r,r}return r.__extends(i,e),i.prototype.onBaseUriChanged=function(e,r){null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.baseUri=this.baseUri),this.queueAutoRefresh()},Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&this.onBaseUriChanged(t,this._baseUri)},enumerable:!0,configurable:!0}),i.prototype.onEntitySetChanged=function(e,r){null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.entitySet=this.entitySet),this.queueAutoRefresh()},Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,this._entitySet!=t&&this.onEntitySetChanged(t,this._entitySet)},enumerable:!0,configurable:!0}),i.prototype.onTimeoutMillisecondsChanged=function(e,r){null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.timeoutMilliseconds=this.timeoutMilliseconds)},Object.defineProperty(i.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){var t=this._timeoutMilliseconds;this._timeoutMilliseconds=e,t!=this._timeoutMilliseconds&&this.onTimeoutMillisecondsChanged(t,this._timeoutMilliseconds)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isSortingSupportedOverride",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFilteringSupportedOverride",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isGroupingSupportedOverride",{get:function(){return this.isAggregationSupportedByServer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupportedByServer",{get:function(){return this._isAggregationSupportedByServer},set:function(e){this._isAggregationSupportedByServer=e,null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.isAggregationSupported=e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e,null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.enableJsonp=e)},enumerable:!0,configurable:!0}),i.prototype.clone=function(){var e=new i;e.executionContext=this.executionContext,e.includeSummaryRowsInSection=this.includeSummaryRowsInSection,e.isSectionCollapsable=this.isSectionCollapsable,e.isSectionExpandedDefault=this.isSectionExpandedDefault,e.isSectionSummaryRowsAtBottom=this.isSectionSummaryRowsAtBottom,e.primaryKey=this.primaryKey,e.propertiesRequested=this.propertiesRequested,e.sectionHeaderDisplayMode=this.sectionHeaderDisplayMode,e.shouldEmitSectionFooters=this.shouldEmitSectionFooters,e.shouldEmitSectionHeaders=this.shouldEmitSectionHeaders,e.shouldEmitShiftedRows=this.shouldEmitShiftedRows,e.summaryScope=this.summaryScope;for(var t=0;t<this.groupDescriptions.size();t++)e.groupDescriptions.add(this.groupDescriptions.get(t));for(t=0;t<this.sortDescriptions.size();t++)e.sortDescriptions.add(this.sortDescriptions.get(t));for(t=0;t<this.filterExpressions.size();t++)e.filterExpressions.add(this.filterExpressions.get(t));for(t=0;t<this.summaryDescriptions.size();t++)e.summaryDescriptions.add(this.summaryDescriptions.get(t));return e.pageSizeRequested=this.pageSizeRequested,e.maxCachedPages=this.maxCachedPages,e.baseUri=this.baseUri,e.entitySet=this.entitySet,e.timeoutMilliseconds=this.timeoutMilliseconds,e.isAggregationSupportedByServer=this.isAggregationSupportedByServer,e.enableJsonp=this.enableJsonp,e},i}(t.VirtualDataSource),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(i,e),i.$t=t.markType(i,"ODataVirtualDataSourceProviderTaskDataHolder",t.AsyncVirtualDataSourceProviderTaskDataHolder.$type),i}(t.AsyncVirtualDataSourceProviderTaskDataHolder),v=function(){function e(e,r,i,o,n){if(this._actualData=null,this._schema=null,this._pageIndex=0,this._groupInformation=null,this._summaryInformation=null,null==e)this._actualData=null;else{var s=e.items.length;this._actualData=[];for(var a=new Set,u=0;u<r.propertyNames.length;u++)r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeValue&&r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeOffsetValue||a.add(r.propertyNames[u]);for(var p=void 0,l=function(t){for(var r=e.items[t],i=new Map,o=Array.from(Object.keys(r)),n=o.map((function(e){return r[e]})),s=0;s<o.length;s++)p=n[s],a.has(o[s])&&(p=new Date(p)),i.set(o[s],p);c._actualData[t]=i},c=this,h=0;h<s;h++)l(h)}this._schema=r,this._groupInformation=i,this._summaryInformation=o,this._pageIndex=n}return e.prototype.count=function(){return this._actualData.length},e.prototype.getItemAtIndex=function(e){return this._actualData[e]},e.prototype.getItemValueAtIndex=function(e,t){var r=this._actualData[e];return r.has(t)?r.get(t):null},e.prototype.pageIndex=function(){return this._pageIndex},e.prototype.schema=function(){return this._schema},e.prototype.getGroupInformation=function(){return this._groupInformation},e.prototype.getSummaryInformation=function(){return this._summaryInformation},e}(),b=function(e){function i(i){var o,n,s=e.call(this,i)||this;if(s._baseUri=null,s._entitySet=null,s._sortDescriptions=null,s._groupDescriptions=null,s._filterExpressions=null,s._summaryDescriptions=null,s._desiredPropeties=null,s._enableJsonp=!0,s._isAggregationSupported=!1,s._provideFullCount=null,s._provideOrderByParameter=null,s._provideFilterParameter=null,s._provideAggregationParameter=null,s._provideAggregatedCount=null,s._providePagingParameter=null,s._provideDesiredPropertiesParameter=null,s._provideUri=null,s._performFetch=null,s._fixedFullCount=-1,s._groupInformation=null,s._summaryInformation=null,s._filterString=null,s._selectedString=null,s.doWork=s.doWork.bind(s),s._baseUri=i.baseUri,s._entitySet=i.entitySet,s._sortDescriptions=i.sortDescriptions,s._groupDescriptions=i.groupDescriptions,null!=s._groupDescriptions&&s._groupDescriptions.size()>0){s._sortDescriptions=new t.SortDescriptionCollection;try{for(var a=r.__values(s.iter(i.sortDescriptions)),u=a.next();!u.done;u=a.next()){var p=u.value;s._sortDescriptions.add(p)}}catch(e){o={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}for(var l=0;l<s._groupDescriptions.size();l++)s._sortDescriptions.insert(l,s._groupDescriptions.get(l))}return s._filterExpressions=i.filterExpressions,s._desiredPropeties=i.propertiesRequested,s._summaryDescriptions=i.summaryDescriptions,s._fixedFullCount=i.fixedFullCount,s._summaryScope=i.summaryScope,s._enableJsonp=i.enableJsonp,s._provideFullCount=i.provideFullCount,s._performFetch=i.performFetch,s._provideAggregationParameter=i.provideAggregationParameter,s._provideFilterParameter=i.provideFilterParameter,s._provideOrderByParameter=i.provideOrderByParameter,s._provideUri=i.provideUri,s._providePagingParameter=i.providePagingParameter,s._provideDesiredPropertiesParameter=i.provideDesiredPropertiesParameter,s._provideItems=i.provideItems,s._provideAggregatedCount=i.provideAggregatedCount,s._provideItems||(s._provideItems=function(e){return e?e.items:null}),s._provideFullCount||(s._provideFullCount=function(e){return e.fullCount?e.fullCount:s._fixedFullCount>=0?s._fixedFullCount:0}),s._provideOrderByParameter||(s._provideOrderByParameter=function(e,t,r){e.push({name:"orderBy",value:encodeURIComponent(t)})}),s._providePagingParameter||(s._providePagingParameter=function(e,t,r){e.push({name:"skip",value:t}),e.push({name:"take",value:r})}),s._provideAggregationParameter||(s._provideAggregationParameter=function(e,t,r,i,o,n){e.push({name:"groupBy",value:r}),e.push({name:"aggregate",value:"count"})}),s._provideUri||(s._provideUri=function(e,t,r){var i=e;i+="/"+t,r.length>0&&(i+="?");for(var o="",n=0;n<r.length;n++)n>0&&(o+="&"),o+=r[n].name+"="+r[n].value;return i+o}),s._isAggregationSupported=i.isAggregationSupported,window.setTimeout(s.doWork,100),s}return r.__extends(i,e),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"desiredProperties",{get:function(){return this._desiredPropeties},enumerable:!0,configurable:!0}),i.prototype.initialize=function(){e.prototype.initialize.call(this)},i.prototype.getTaskDataHolder=function(){return new _},i.prototype.getCompletedTaskData=function(t,r){e.prototype.getCompletedTaskData.call(this,t,r)},i.prototype.removeCompletedTaskData=function(t,r){e.prototype.removeCompletedTaskData.call(this,t,r)},i.prototype.getTasksData=function(t){e.prototype.getTasksData.call(this,t)},i.prototype.iter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterFilter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterSummaries=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.processCompletedTask=function(e,t,r,o){var n,s=this,a=null,u=-1,p=e.task;try{if(p.hasErrors)return void this.retryIndex(r,t);r==i.schemaRequestIndex?(a=p.result,u=this._provideFullCount(a)):a=p.result}catch(e){return void this.retryIndex(r,t)}if(this.actualCount=u>=0?u:this._provideFullCount(a),null!=(n=this.actualSchema))this.finishProcessingCompletedTask(p,r,n,a);else{var l=0;this.resolveSchema((function(e){s.actualSchema=e,!s._isAggregationSupported||0===s._groupDescriptions.size()&&0===s._summaryDescriptions.size()?s.finishProcessingCompletedTask(p,r,e,a):(s._groupDescriptions.size()>0&&(l++,s.resolveGroupInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))),s._summaryDescriptions.size()>0&&(l++,s.resolveSummaryInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))))}),(function(){s.retryIndex(r,t)}))}},i.prototype.finishProcessingCompletedTask=function(e,t,r,i){var o,n,s,a,u=this;this.actualSchema=r,o=this.executionContext,s=this._groupInformation,a=this._summaryInformation,n=this.pageLoaded;var p=null;if(null!=i?(p=new v(i,r,s,a,t),!this.isLastPage(t)&&p.count()>0&&!this.populatedActualPageSize&&(this.populatedActualPageSize=!0,this.actualPageSize=p.count())):p=new v(null,r,s,a,t),null!=this.pageLoaded)if(null!=this.executionContext){if(null==o||null==n)return void this.shutdown();o.execute((function(){return n(p,u.actualCount,u.actualPageSize)}))}else{if(null==n)return void this.shutdown();n(p,this.actualCount,this.actualPageSize)}},i.prototype.resolveGroupInformation=function(e,i){var o,n,s=this;if(null==this._groupInformation){var a,u="",p="",l="";if(null!=this._groupDescriptions&&0!=this._groupDescriptions.size())if(null!=this._provideAggregationParameter){if(a=this._filterString,this.updateFilterString(),null!=this._groupDescriptions){var c=!0;try{for(var h=r.__values(this.iter(this._groupDescriptions)),f=h.next();!f.done;f=h.next()){var d=f.value;c?c=!1:(u+=", ",p+=", "),p+=d.propertyName,d.direction===t.ListSortDirection.Descending?u+=d.propertyName+" desc":u+=d.propertyName+" asc"}}catch(e){o={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(o)throw o.error}}}if(this._summaryScope===t.DataSourceSummaryScope.Both||this._summaryScope===t.DataSourceSummaryScope.Groups){var m=this.getSummaryQueryParameters(!0);t.stringIsNullOrEmpty(m)||(l=", "+m)}var y=[];this._provideOrderByParameter&&this._provideOrderByParameter(y,u,this._groupDescriptions),this._provideFilterParameter&&null!=a&&this._provideFilterParameter(y,a,this._filterExpressions),this._provideAggregationParameter&&this._provideAggregationParameter(y,!0,p,this._groupDescriptions,l,this._summaryDescriptions);var g=this._provideUri(this._baseUri,this._entitySet,y);try{var _=[],v=function(t,r){return s.groupSuccess(t,r,e,i,_)},b=function(t){return s.groupError(t,e,i,_)},S={requestUri:g,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){s.fetchUri(S,v,b)})()}catch(e){i()}}else e(null);else e(null)}else e(this._groupInformation)},i.prototype.fetchUri=function(e,t,r){this._performFetch?this._performFetch(e,t,r):fetch(e.requestUri,{method:e.method,headers:e.headers}).then((function(e){e.json().then((function(r){t(r,e)}))})).catch((function(e){r(e)}))},i.prototype.groupError=function(e,t,r,i){this._groupInformation=null},i.prototype.groupSuccess=function(e,t,i,o,n){var s,a,u=[];try{for(var p=r.__values(this.iter(this._groupDescriptions)),l=p.next();!l.done;l=p.next()){var c=l.value;u.push(c.propertyName)}}catch(e){s={error:e}}finally{try{l&&!l.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}var h=this._provideItems(e);if(h&&h.length>0)for(var f=0;f<h.length;f++)this.addGroup(n,u,u,0,h[f]);this._groupInformation=n,i(this._groupInformation)},i.prototype.addGroup=function(e,i,o,n,s){var a,u,p=[];try{for(var l=r.__values(i),c=l.next();!c.done;c=l.next()){var h=c.value;s[h]&&p.push(s[h])}}catch(e){a={error:e}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(a)throw a.error}}var f=0;if(this._provideAggregatedCount)this._provideAggregatedCount(s);else s.aggregatedCount&&(f=t.Convert.toInt321(s.aggregatedCount));var d=null;this._summaryScope!=t.DataSourceSummaryScope.Both&&this._summaryScope!=t.DataSourceSummaryScope.Groups||(d=this.createSummaryResults(s));var m=new t.DefaultSectionInformation(n,n+(f-1),o,p,d);e.push(m)},i.prototype.resolveSummaryInformation=function(e,r){var i=this;if(null==this._summaryInformation){var o,n;if(null!=this._summaryDescriptions&&0!=this._summaryDescriptions.size()&&this._summaryScope!=t.DataSourceSummaryScope.Groups&&this._summaryScope!=t.DataSourceSummaryScope.None){o=this._filterString,this.updateFilterString(),n=this.getSummaryQueryParameters(!1);var s=[];this._provideFilterParameter&&null!=o&&this._provideFilterParameter(s,o,this._filterExpressions),this._provideAggregationParameter&&this._provideAggregationParameter(s,!0,null,null,n,this._summaryDescriptions);var a=this._provideUri(this._baseUri,this._entitySet,s);try{var u=[],p=function(t,o){return i.summarySuccess(t,o,e,r,u)},l=function(t){return i.summaryError(t,e,r,u)},c={requestUri:a,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){i.fetchUri(c,p,l)})()}catch(e){r()}}else e(null)}else e(this._summaryInformation)},i.prototype.summarySuccess=function(e,t,r,i,o){e&&e.value&&e.value.length>0&&(o=this.createSummaryResults(e.value[0])),this._summaryInformation=o,r(this._summaryInformation)},i.prototype.summaryError=function(e,t,r,i){this._summaryInformation=null},i.prototype.getSummaryQueryParameters=function(e){var i,o,n="";if(null!=this._summaryDescriptions){var s=!0,a=!1;try{for(var u=r.__values(this.iterSummaries(this._summaryDescriptions)),p=u.next();!p.done;p=u.next()){var l=p.value;if(l.operand!=t.DataSourceSummaryOperand.Count||!e&&!a){switch(s||(n+=", "),l.operand){case t.DataSourceSummaryOperand.Average:n+=l.propertyName+" with average as "+l.propertyName+"Average";break;case t.DataSourceSummaryOperand.Min:n+=l.propertyName+" with min as "+l.propertyName+"Min";break;case t.DataSourceSummaryOperand.Max:n+=l.propertyName+" with max as "+l.propertyName+"Max";break;case t.DataSourceSummaryOperand.Sum:n+=l.propertyName+" with sum as "+l.propertyName+"Sum";break;case t.DataSourceSummaryOperand.Count:n+="$count as $__count",a=!0}s=!1}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}return n},i.prototype.createSummaryResults=function(e){var i,o,n=[];try{for(var s=r.__values(this.iterSummaries(this._summaryDescriptions)),a=s.next();!a.done;a=s.next()){var u=a.value,p=u.propertyName;switch(u.operand){case t.DataSourceSummaryOperand.Average:p+="Average";break;case t.DataSourceSummaryOperand.Min:p+="Min";break;case t.DataSourceSummaryOperand.Max:p+="Max";break;case t.DataSourceSummaryOperand.Sum:p+="Sum";break;case t.DataSourceSummaryOperand.Count:p="$__count"}var l=null;e&&e[p]&&(l=e[p]);var c=new t.DefaultSummaryResult(u.propertyName,u.operand,l);n.push(c)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return n},i.prototype.resolveSchemaFromItems=function(e){var r=new t.LocalDataSource;return r.dataSource=e,r.flushAutoRefresh(),r.actualSchema},i.prototype.resolveSchema=function(e,t){var r=this;if(this._provideItems&&this._providePagingParameter){var i=function(i){var o=r._provideItems(i);if(o&&o.length>0){var n=r.resolveSchemaFromItems(o);e(n)}else t("could not find items to resolve schema")},o=function(e){return t(e)},n=[];this._providePagingParameter&&this._providePagingParameter(n,0,this.actualPageSize);var s=this._provideUri(this._baseUri,this._entitySet,n);try{var a={requestUri:s,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){r.fetchUri(a,i,o)})()}catch(e){t(e)}}else t("required providers for items and paging are not specified")},i.prototype.makeTaskForRequest=function(e,o){var n,s,a,u=[];a=this.actualPageSize,this.sortDescriptions;if(this.updateFilterString(),null!=this._filterString&&this._provideFilterParameter&&this._provideFilterParameter(u,this._filterString,this._filterExpressions),null!=this.sortDescriptions){var p=null;try{for(var l=r.__values(this.iter(this.sortDescriptions)),c=l.next();!c.done;c=l.next()){var h=c.value;null==p?p="":p+=", ",h.direction==t.ListSortDirection.Descending?p+=h.propertyName+" desc":p+=h.propertyName}}catch(e){n={error:e}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(n)throw n.error}}null!=p&&this._provideOrderByParameter&&this._provideOrderByParameter(u,p,this._sortDescriptions)}if(null!=this.desiredProperties&&this.desiredProperties.length>0){for(var f="",d=!0,m=this.desiredProperties,y=0;y<m.length;y++){d?d=!1:f+=", ",f+=m[y]}this._provideDesiredPropertiesParameter&&this._provideDesiredPropertiesParameter(u,f,this._desiredPropeties)}this._providePagingParameter&&(e.index==i.schemaRequestIndex?this._providePagingParameter(u,0,a):this._providePagingParameter(u,e.index*a,a));var g=new t.AsyncVirtualDataTask,_=this._provideUri(this._baseUri,this._entitySet,u);e.index==i.schemaRequestIndex?this.executeRequest(_,!1,0,a,g):this.executeRequest(_,!1,e.index*a,a,g),e.taskHolder=new t.AsyncDataSourcePageTaskHolder,e.taskHolder.task=g,this.tasks.add(e)},i.prototype.updateFilterString=function(){var e,i;if(null!=this.filterExpressions&&this.filterExpressions.size()>0&&null==this._filterString){var o="",n=!0;try{for(var s=r.__values(this.iterFilter(this.filterExpressions)),a=s.next();!a.done;a=s.next()){var u=a.value;n?n=!1:o+=" AND ";var p=new t.ODataDataSourceFilterExpressionVisitor(0);p.visit(u);var l=p.toString();this.filterExpressions.size()>1&&(l="("+l+")"),o+=l}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}this._filterString=o}},i.prototype.executeRequest=function(e,t,r,i,o){var n,s=this,a=function(e,t){return s.success(o,e,t)},u=function(e){return s.error(o,e)},p={requestUri:e,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};n=function(){s.fetchUri(p,a,u)},o.run=n},i.prototype.success=function(e,t,r){e.result=t,e.isCompleted=!0},i.prototype.error=function(e,t){e.isCompleted=!0,e.hasErrors=!0},i.prototype.createBatchRequest=function(e){},i.prototype.getRequestUriWithKey=function(e){for(var t="",r=Object.keys(e),i=0;i<r.length;i++)i>0&&(t+=","),t+=r[i]+"="+e[r[i]];return this._entitySet+"("+t+")"},i.schemaRequestIndex=-1,i}(t.AsyncVirtualDataSourceProviderWorker),S=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._baseUri=null,t._entitySet=null,t._sortDescriptions=null,t._filterExpressions=null,t._propertiesRequested=null,t._groupDescriptions=null,t._summaryDescriptions=null,t._fixedFullCount=-1,t._provideFullCount=null,t._provideOrderByParameter=null,t._provideFilterParameter=null,t._provideAggregationParameter=null,t._provideAggregatedCount=null,t._provideUri=null,t._providePagingParameter=null,t._provideDesiredPropertiesParameter=null,t._performFetch=null,t}return r.__extends(i,e),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){this._baseUri=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){this._entitySet=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},set:function(e){this._sortDescriptions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},set:function(e){this._filterExpressions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},set:function(e){this._groupDescriptions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},set:function(e){this._summaryDescriptions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryscope},set:function(e){this._summaryscope=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fixedFullCount",{get:function(){return this._fixedFullCount},set:function(e){this._fixedFullCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideFullCount",{get:function(){return this._provideFullCount},set:function(e){this._provideFullCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideOrderByParameter",{get:function(){return this._provideOrderByParameter},set:function(e){this._provideOrderByParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideFilterParameter",{get:function(){return this._provideFilterParameter},set:function(e){this._provideFilterParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregationParameter",{get:function(){return this._provideAggregationParameter},set:function(e){this._provideAggregationParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregatedCount",{get:function(){return this._provideAggregatedCount},set:function(e){this._provideAggregatedCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideUri",{get:function(){return this._provideUri},set:function(e){this._provideUri=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"providePagingParameter",{get:function(){return this._providePagingParameter},set:function(e){this._providePagingParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideDesiredPropertiesParameter",{get:function(){return this._provideDesiredPropertiesParameter},set:function(e){this._provideDesiredPropertiesParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideItems",{get:function(){return this._provideItems},set:function(e){this._provideItems=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"performFetch",{get:function(){return this._performFetch},set:function(e){this._performFetch=e},enumerable:!0,configurable:!0}),i.$t=t.markType(i,"RestVirtualDataSourceDataProviderWorkerSettings",t.AsyncVirtualDataSourceDataProviderWorkerSettings.$type),i}(t.AsyncVirtualDataSourceDataProviderWorkerSettings),P=function(e){function i(){var r=e.call(this)||this;return r._worker=null,r._requests=new s,r._callback=null,r._pageLoaded=null,r._pageSizeRequested=50,r._baseUri=null,r._entitySet=null,r._timeoutMilliseconds=1e4,r.schemaChanged=null,r._currentFullCount=0,r._currentSchema=null,r._executionContext=null,r._updateNotifier=null,r._deferAutoRefresh=!1,r._sortDescriptions=null,r._groupDescriptions=null,r._propertiesRequested=null,r._filterExpressions=null,r._summaryDescriptions=null,r._enableJsonp=!0,r._fixedFullCount=-1,r._provideFullCount=null,r._provideOrderByParameter=null,r._provideFilterParameter=null,r._provideAggregationParameter=null,r._provideAggregatedCount=null,r._provideUri=null,r._performFetch=null,r._providePagingParameter=null,r._provideDesiredPropertiesParameter=null,r._schemaFetchQueued=!1,r._autoRefreshQueued=!1,r._sortDescriptions=new t.SortDescriptionCollection,r._sortDescriptions.onChanged=function(){return r.sortDescriptions_CollectionChanged(null,null)},r._groupDescriptions=new t.SortDescriptionCollection,r._groupDescriptions.onChanged=function(){return r.groupDescriptions_CollectionChanged(null,null)},r._filterExpressions=new t.FilterExpressionCollection,r._filterExpressions.onChanged=function(){return r.filterExpressions_CollectionChanged(null,null)},r._summaryDescriptions=new t.SummaryDescriptionCollection,r._summaryDescriptions.onChanged=function(){return r.summaryDescriptions_CollectionChanged(null,null)},r}return r.__extends(i,e),i.prototype.filterExpressions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.sortDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.groupDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.summaryDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.addPageRequest=function(e,r){this.deferAutoRefresh||(null!=this._worker&&this._worker.isShutdown&&(this._worker=null,this._callback=null),null==this._worker&&this.createWorker(),r==t.DataSourcePageRequestPriority.High?this._requests.addFirst(e):this._requests.addLast(e),this._worker.addPageRequest(e,r)||(this._worker=null,this._callback=null,this.addPageRequest(e,r)))},i.prototype.createWorker=function(){if(this.valid()){this._callback=t.runOn(this,this.raisePageLoaded);var e=this.getWorkerSettings();this._worker=new b(e)}},i.prototype.valid=function(){return null!=this.entitySet&&null!=this.baseUri},i.prototype.getWorkerSettings=function(){var e,t=this;return(e=new S).baseUri=t._baseUri,e.entitySet=t._entitySet,e.pageSizeRequested=t._pageSizeRequested,e.timeoutMilliseconds=t._timeoutMilliseconds,e.pageLoaded=t._callback,e.executionContext=t._executionContext,e.sortDescriptions=t._sortDescriptions,e.groupDescriptions=t._groupDescriptions,e.filterExpressions=t._filterExpressions,e.propertiesRequested=t._propertiesRequested,e.summaryDescriptions=t._summaryDescriptions,e.summaryScope=t._summaryScope,e.enableJsonp=t._enableJsonp,e.isAggregationSupported=t.isAggregationSupported,e.performFetch=t.performFetch,e.provideAggregationParameter=t.provideAggregationParameter,e.provideAggregatedCount=t.provideAggregatedCount,e.provideDesiredPropertiesParameter=t.provideDesiredPropertiesParameter,e.provideFilterParameter=t.provideFilterParameter,e.provideFullCount=t.provideFullCount,e.provideItems=t.provideItems,e.provideOrderByParameter=t.provideOrderByParameter,e.providePagingParameter=t.providePagingParameter,e.provideUri=t.provideUri,e.fixedFullCount=t.fixedFullCount,e},i.prototype.removePageRequest=function(e){for(var t=this._requests.first;null!=t;)t.value==e&&this._requests.remove(t),t=t.next;null!=this._worker&&this._worker.removePageRequest(e)},i.prototype.removeAllPageRequests=function(){this._requests.clear(),null!=this._worker&&this._worker.removeAllPageRequests()},i.prototype.close=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageLoaded",{get:function(){return this._pageLoaded},set:function(e){this._pageLoaded=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),i.prototype.raisePageLoaded=function(e,r,i){if(null!=this._pageLoaded){if(this._currentFullCount=r,null==this._currentSchema){var o=null;null!=e&&(o=e.schema()),this._currentSchema=o,null!=this.schemaChanged&&this.schemaChanged(this,new t.DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema,this._currentFullCount))}e.pageIndex()!=b.schemaRequestIndex&&this._pageLoaded(e,r,i)}},i.prototype.killWorker=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageSizeRequested",{get:function(){return this._pageSizeRequested},set:function(e){this._pageSizeRequested=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,t!=this._entitySet&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){this._timeoutMilliseconds=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),i.prototype.getItemValue=function(e,t){var r=e;return r.has(t)?r.get(t):null},Object.defineProperty(i.prototype,"actualCount",{get:function(){return this._currentFullCount},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"actualSchema",{get:function(){return this._currentSchema},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"executionContext",{get:function(){return this._executionContext},set:function(e){this._executionContext=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"updateNotifier",{get:function(){return this._updateNotifier},set:function(e){this._updateNotifier=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"deferAutoRefresh",{get:function(){return this._deferAutoRefresh},set:function(e){this._deferAutoRefresh=e,this._deferAutoRefresh||this.queueAutoRefresh(),this._deferAutoRefresh&&this.valid()&&null==this._currentSchema&&this.queueSchemaFetch()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isSortingSupported",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isGroupingSupported",{get:function(){return this.isAggregationSupported},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFilteringSupported",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e,this.queueAutoRefresh()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryScope},set:function(e){this._summaryScope=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fixedFullCount",{get:function(){return this._fixedFullCount},set:function(e){this._fixedFullCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideFullCount",{get:function(){return this._provideFullCount},set:function(e){this._provideFullCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideOrderByParameter",{get:function(){return this._provideOrderByParameter},set:function(e){this._provideOrderByParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideFilterParameter",{get:function(){return this._provideFilterParameter},set:function(e){this._provideFilterParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregationParameter",{get:function(){return this._provideAggregationParameter},set:function(e){this._provideAggregationParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregatedCount",{get:function(){return this._provideAggregatedCount},set:function(e){this._provideAggregatedCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideUri",{get:function(){return this._provideUri},set:function(e){this._provideUri=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"performFetch",{get:function(){return this._performFetch},set:function(e){this._performFetch=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"providePagingParameter",{get:function(){return this._providePagingParameter},set:function(e){this._providePagingParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideDesiredPropertiesParameter",{get:function(){return this._provideDesiredPropertiesParameter},set:function(e){this._provideDesiredPropertiesParameter=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"provideItems",{get:function(){return this._provideItems},set:function(e){this._provideItems=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"notifyUsingSourceIndexes",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isItemIndexLookupSupported",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isKeyIndexLookupSupported",{get:function(){return!1},enumerable:!0,configurable:!0}),i.prototype.notifySetItem=function(e,t,r){null!=this.updateNotifier&&this.updateNotifier.notifySetItem(e,t,r)},i.prototype.notifyClearItems=function(){null!=this.updateNotifier&&this.updateNotifier.notifyClearItems()},i.prototype.notifyInsertItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyInsertItem(e,t)},i.prototype.notifyRemoveItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyRemoveItem(e,t)},i.prototype.queueSchemaFetch=function(){this._schemaFetchQueued||null!=this.executionContext&&(this._schemaFetchQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doSchemaFetchInternal)))},i.prototype.doSchemaFetchInternal=function(){this._schemaFetchQueued&&(this._schemaFetchQueued=!1,this.schemaFetchInternal())},i.prototype.schemaFetchInternal=function(){this.schemaFetchInternalOverride()},i.prototype.schemaFetchInternalOverride=function(){this.deferAutoRefresh&&(this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this.addSchemaRequest())},i.prototype.addSchemaRequest=function(){this._worker.addPageRequest(b.schemaRequestIndex,t.DataSourcePageRequestPriority.High)},i.prototype.queueAutoRefresh=function(){this.deferAutoRefresh||this._autoRefreshQueued||null!=this.executionContext&&(this._autoRefreshQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doRefreshInternal)))},i.prototype.doRefreshInternal=function(){this.deferAutoRefresh?this._autoRefreshQueued=!1:this._autoRefreshQueued&&(this._autoRefreshQueued=!1,this.refreshInternal())},i.prototype.refreshInternal=function(){this.refreshInternalOverride()},i.prototype.refreshInternalOverride=function(){this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this._worker.addPageRequest(0,t.DataSourcePageRequestPriority.Normal)},i.prototype.flushAutoRefresh=function(){this.doRefreshInternal()},i.prototype.refresh=function(){this.refreshInternal()},i.prototype.indexOfItem=function(e){return-1},i.prototype.indexOfKey=function(e){return-1},i.prototype.resolveSchemaPropertyType=function(e){if(null==this.actualSchema)return t.DataSourceSchemaPropertyType.ObjectValue;if(t.stringContains(e,"."))return t.DataSourceSchemaPropertyType.ObjectValue;for(var r=0;r<this.actualSchema.propertyNames.length;r++){if(this.actualSchema.propertyNames[r]==e)return this.actualSchema.propertyTypes[r]}return t.DataSourceSchemaPropertyType.ObjectValue},i.prototype.setItemValue=function(e,t,r){},i.prototype.removeItem=function(e){},i.prototype.addItem=function(e){},i.prototype.createBatchRequest=function(e){null!=this._worker&&this._worker.createBatchRequest(e)},Object.defineProperty(i.prototype,"batchCompleted",{get:function(){return this._batchCompleted},set:function(e){this._batchCompleted=e},enumerable:!0,configurable:!0}),i.$t=t.markType(i,"ODataVirtualDataSourceDataProvider",t.Base.$type,[t.IDataSourceVirtualDataProvider_$type]),i}(t.Base),D=function(e){function t(){var t,r=e.call(this)||this;return r._baseUri=null,r._isFilteringSupportedByServer=!1,r._entitySet=null,r._timeoutMilliseconds=1e4,r._isAggregationSupportedByServer=!1,r._enableJsonp=!0,r._fixedFullCount=-1,r._provideFullCount=null,r._provideOrderByParameter=null,r._provideFilterParameter=null,r._provideAggregationParameter=null,r._provideAggregatedCount=null,r._provideUri=null,r._performFetch=null,r._providePagingParameter=null,r._provideDesiredPropertiesParameter=null,r.dataProvider=((t=new P).executionContext=r.executionContext,t.enableJsonp=r.enableJsonp,t.isAggregationSupported=r.isGroupingSupported,t),r.externalDataSource=r,r}return r.__extends(t,e),t.prototype.onBaseUriChanged=function(e,t){this.actualDataProvider&&(this.actualDataProvider.baseUri=this.baseUri,this.queueAutoRefresh())},Object.defineProperty(t.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&this.onBaseUriChanged(t,this._baseUri)},enumerable:!0,configurable:!0}),t.prototype.onEntitySetChanged=function(e,t){this.actualDataProvider&&(this.actualDataProvider.entitySet=this.entitySet,this.queueAutoRefresh()),this.queueAutoRefresh()},Object.defineProperty(t.prototype,"isFilteringSupportedByServer",{get:function(){return this._isFilteringSupportedByServer},set:function(e){this._isFilteringSupportedByServer=e},enumerable:!0,configurable:!0}),t.prototype.get_isFilteringSupported=function(){return!!this._isFilteringSupportedByServer},Object.defineProperty(t.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,this._entitySet!=t&&this.onEntitySetChanged(t,this._entitySet)},enumerable:!0,configurable:!0}),t.prototype.onTimeoutMillisecondsChanged=function(e,t){this.actualDataProvider&&(this.actualDataProvider.timeoutMilliseconds=this.timeoutMilliseconds)},Object.defineProperty(t.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){var t=this._timeoutMilliseconds;this._timeoutMilliseconds=e,t!=this._timeoutMilliseconds&&this.onTimeoutMillisecondsChanged(t,this._timeoutMilliseconds)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSortingSupportedOverride",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFilteringSupportedOverride",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isGroupingSupportedOverride",{get:function(){return this.isAggregationSupportedByServer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAggregationSupportedByServer",{get:function(){return this._isAggregationSupportedByServer},set:function(e){this._isAggregationSupportedByServer=e,this.actualDataProvider&&(this.actualDataProvider.isAggregationSupported=this.isAggregationSupportedByServer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e,this.actualDataProvider&&(this.actualDataProvider.enableJsonp=this.enableJsonp)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fixedFullCount",{get:function(){return this._fixedFullCount},set:function(e){this._fixedFullCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideFullCount",{get:function(){return this._provideFullCount},set:function(e){this._provideFullCount=e,this.actualDataProvider&&(this.actualDataProvider.provideFullCount=this.provideFullCount,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideOrderByParameter",{get:function(){return this._provideOrderByParameter},set:function(e){this._provideOrderByParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideOrderByParameter=this.provideOrderByParameter,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideFilterParameter",{get:function(){return this._provideFilterParameter},set:function(e){this._provideFilterParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideFilterParameter=this.provideFilterParameter,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideAggregationParameter",{get:function(){return this._provideAggregationParameter},set:function(e){this._provideAggregationParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideAggregationParameter=this.provideAggregationParameter,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideAggregatedCount",{get:function(){return this._provideAggregatedCount},set:function(e){this._provideAggregatedCount=e,this.actualDataProvider&&(this.actualDataProvider.provideAggregatedCount=this.provideAggregatedCount,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideUri",{get:function(){return this._provideUri},set:function(e){this._provideUri=e,this.actualDataProvider&&(this.actualDataProvider.provideUri=this.provideUri,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"performFetch",{get:function(){return this._performFetch},set:function(e){this._performFetch=e,this.actualDataProvider&&(this.actualDataProvider.performFetch=this.performFetch,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providePagingParameter",{get:function(){return this._providePagingParameter},set:function(e){this._providePagingParameter=e,this.actualDataProvider&&(this.actualDataProvider.providePagingParameter=this.providePagingParameter,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideDesiredPropertiesParameter",{get:function(){return this._provideDesiredPropertiesParameter},set:function(e){this._provideDesiredPropertiesParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideDesiredPropertiesParameter=this.provideDesiredPropertiesParameter,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"provideItems",{get:function(){return this._provideItems},set:function(e){this._provideItems=e,this.actualDataProvider&&(this.actualDataProvider.provideItems=this.provideItems,this.queueAutoRefresh())},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;e.executionContext=this.executionContext,e.includeSummaryRowsInSection=this.includeSummaryRowsInSection,e.isSectionCollapsable=this.isSectionCollapsable,e.isSectionExpandedDefault=this.isSectionExpandedDefault,e.isSectionSummaryRowsAtBottom=this.isSectionSummaryRowsAtBottom,e.primaryKey=this.primaryKey,e.propertiesRequested=this.propertiesRequested,e.sectionHeaderDisplayMode=this.sectionHeaderDisplayMode,e.shouldEmitSectionFooters=this.shouldEmitSectionFooters,e.shouldEmitSectionHeaders=this.shouldEmitSectionHeaders,e.shouldEmitShiftedRows=this.shouldEmitShiftedRows,e.summaryScope=this.summaryScope;for(var r=0;r<this.groupDescriptions.size();r++)e.groupDescriptions.add(this.groupDescriptions.get(r));for(r=0;r<this.sortDescriptions.size();r++)e.sortDescriptions.add(this.sortDescriptions.get(r));for(r=0;r<this.filterExpressions.size();r++)e.filterExpressions.add(this.filterExpressions.get(r));for(r=0;r<this.summaryDescriptions.size();r++)e.summaryDescriptions.add(this.summaryDescriptions.get(r));return e.pageSizeRequested=this.pageSizeRequested,e.maxCachedPages=this.maxCachedPages,e.baseUri=this.baseUri,e.entitySet=this.entitySet,e.timeoutMilliseconds=this.timeoutMilliseconds,e.isAggregationSupportedByServer=this.isAggregationSupportedByServer,e.enableJsonp=this.enableJsonp,e.fixedFullCount=this.fixedFullCount,e.provideAggregationParameter=this.provideAggregationParameter,e.provideAggregatedCount=this.provideAggregatedCount,e.provideFilterParameter=this.provideFilterParameter,e.provideFullCount=this.provideFullCount,e.provideOrderByParameter=this.provideOrderByParameter,e.provideUri=this.provideUri,e.performFetch=this.performFetch,e.providePagingParameter=this.providePagingParameter,e.provideItems=this.provideItems,e.provideDesiredPropertiesParameter=this.provideDesiredPropertiesParameter,e},t}(t.VirtualDataSource);e.Entity=u,e.EntityProperty=i,e.EntitySet=p,e.LinkedList=s,e.LinkedListNode=a,e.ODataDataSourcePage=l,e.ODataSchemaProvider=h,e.ODataVirtualDataSource=g,e.ODataVirtualDataSourceDataProvider=y,e.ODataVirtualDataSourceDataProviderWorker=d,e.ODataVirtualDataSourceDataProviderWorkerSettings=m,e.ODataVirtualDataSourceProviderTaskDataHolder=f,e.RestVirtualDataSource=D,e.RestVirtualDataSourceDataProvider=P,e.RestVirtualDataSourceDataProviderWorker=b,e.RestVirtualDataSourceDataProviderWorkerSettings=S,e.RestVirtualDataSourcePage=v,e.RestVirtualDataSourceProviderTaskDataHolder=_,e.Schema=c,e.first=n,e.toArray=o,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("igniteui-webcomponents-core"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","igniteui-webcomponents-core","tslib"],t):t((e=e||self)["igniteui-webcomponents-datasources"]={},e.igniteuiWebcomponentsCore,e.tslib)}(this,(function(e,t,r){"use strict";var i=function(){function e(e,t){this._name=null,this._isNullable=!1,this._type=null,this.name=e,this.type=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isNullable",{get:function(){return this._isNullable},set:function(e){this._isNullable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},set:function(e){this._type=e},enumerable:!1,configurable:!0}),e}();function o(e){return Array.from(t.fromEnum(e))}function n(e){var t,i;try{for(var o=r.__values(e),n=o.next();!n.done;n=o.next()){return n.value}}catch(e){t={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}throw new Error("Iterable contained no elements, expected at least one")}var s=function(){function e(){}return Object.defineProperty(e.prototype,"first",{get:function(){return this._first},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this._last},enumerable:!1,configurable:!0}),e.prototype.addFirst=function(e){if(null==this._first)this._first=new a(e),this._last=this._first;else{var t=this._first;this._first=new a(e),this._first.next=t,t.prev=this._first}},e.prototype.addLast=function(e){if(null==this._last)this._first=new a(e),this._last=this._first;else{var t=this._last;this._last=new a(e),this._last.prev=t,t.next=this._last}},e.prototype.removeFirst=function(){this.remove(this.first)},e.prototype.clear=function(){this._first=null,this._last=null},e.prototype.contains=function(e){for(var t=this.first;null!=t;){if(t.value===e)return!0;t=t.next}return!1},e.prototype.removeValue=function(e){for(var t=this.first;null!=t;){if(t.value===e)return void this.remove(t);t=t.next}},e.prototype.remove=function(e){this._first==e&&(this._first=e.next,null!=e.next&&(e.next.prev=null)),this._last==e&&(this._last=e.prev,null!=e.prev&&(e.prev.next=null)),null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e.next=null,e.prev=null},e}(),a=function(){function e(e){void 0!==e&&(this.value=e)}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prev",{get:function(){return this._prev},set:function(e){this._prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"next",{get:function(){return this._next},set:function(e){this._next=e},enumerable:!1,configurable:!0}),e}(),u=function(){function e(e,t){this._properties=null,this._primaryKey=null,this._name=null,this.name=e,this.loadProperties(t),this.loadPrimaryKey(t)}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return null==this._properties&&(this._properties=new Map),this._properties},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"primaryKey",{get:function(){return null==this._primaryKey&&(this._primaryKey=[]),this._primaryKey},enumerable:!1,configurable:!0}),e.prototype.loadProperties=function(e){for(var r=o(e.elements()),n=r.length,s=t.XName.get("Name",""),a=t.XName.get("Type",""),u=0;u<n;u++){var p=r[u];if("Property"==p.name.localName){var l=p.attribute(s).value,c=p.attribute(a).value;this.properties.set(l,new i(l,c))}}},e.prototype.loadPrimaryKey=function(e){for(var r=o(e.elements()),i=r.length,n=t.XName.get("Name",""),s=0;s<i;s++){var a=r[s];if("Key"==a.name.localName)for(var u=o(a.elements()),p=u.length,l=0;l<p;l++){var c=u[l];"PropertyRef"==c.name.localName&&this.primaryKey.push(c.attribute(n).value)}}},e}(),p=function(){function e(e,t){if(this._entityName=null,this._entityNamespace=null,this._entityType=null,this._name=null,this.name=e,this.entityType=t,t.indexOf(".")>=0){var r=t.split(".");if(2==r.length)this.entityNamespace=r[0],this.entityName=r[1];else{var i=t.lastIndexOf(".");this.entityNamespace=t.substr(0,i),this.entityName=t.substr(i+1)}}else this.entityNamespace=t,this.entityName=t}return Object.defineProperty(e.prototype,"entityName",{get:function(){return this._entityName},set:function(e){this._entityName=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"entityNamespace",{get:function(){return this._entityNamespace},set:function(e){this._entityNamespace=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"entityType",{get:function(){return this._entityType},set:function(e){this._entityType=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!1,configurable:!0}),e}(),l=function(){function e(e,r,i,o,n){if(this._actualData=null,this._schema=null,this._pageIndex=0,this._groupInformation=null,this._summaryInformation=null,null==e)this._actualData=null;else{var s=e.value.length;this._actualData=[];for(var a=new Set,u=0;u<r.propertyNames.length;u++)r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeValue&&r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeOffsetValue||a.add(r.propertyNames[u]);for(var p=void 0,l=function(t){for(var r=e.value[t],i=new Map,o=Array.from(Object.keys(r)),n=o.map((function(e){return r[e]})),s=0;s<o.length;s++)p=n[s],a.has(o[s])&&(p=new Date(p)),i.set(o[s],p);c._actualData[t]=i},c=this,h=0;h<s;h++)l(h)}this._schema=r,this._groupInformation=i,this._summaryInformation=o,this._pageIndex=n}return e.prototype.count=function(){return this._actualData.length},e.prototype.getItemAtIndex=function(e){return this._actualData[e]},e.prototype.getItemValueAtIndex=function(e,t){var r=this._actualData[e];return r.has(t)?r.get(t):null},e.prototype.pageIndex=function(){return this._pageIndex},e.prototype.schema=function(){return this._schema},e.prototype.getGroupInformation=function(){return this._groupInformation},e.prototype.getSummaryInformation=function(){return this._summaryInformation},e}(),c=function(){function e(e,t,r){this._entities=null,this._entitySets=null,this._namespace=null,this.namespace=e,this.loadEntities(t),this.loadEntitySets(r)}return Object.defineProperty(e.prototype,"entities",{get:function(){return null==this._entities&&(this._entities=new Map),this._entities},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"entitySets",{get:function(){return null==this._entitySets&&(this._entitySets=new Map),this._entitySets},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"namespace",{get:function(){return this._namespace},set:function(e){this._namespace=e},enumerable:!1,configurable:!0}),e.prototype.loadEntities=function(e){for(var r=e,i=r.length,o=t.XName.get("Name",""),n=0;n<i;n++){var s=r[n],a=new u(s.attribute(o).value,s);this.entities.set(a.name,a)}},e.prototype.loadEntitySets=function(e){for(var r=e,i=r.length,o=t.XName.get("Name",""),n=t.XName.get("EntityType",""),s=0;s<i;s++){var a=r[s],u=new p(a.attribute(o).value,a.attribute(n).value);this.entitySets.set(u.name,u)}},e}(),h=function(){function e(r){if(this._entityTypeSchemaNamespace=null,this._entitySetSchemaNamespace=null,this._schema=null,null!=r){var i=t.XDocument.parse(r),s=o(n(t.fromEnum(n(t.fromEnum(i.elements())).elements())).elements1(t.XName.get("Schema",e.nS.namespaceName)));if(null!=s){for(var a=null,u=null,p=s.length,l=t.XName.get("EntityContainer",e.nS.namespaceName),h=t.XName.get("EntitySet",e.nS.namespaceName),f=t.XName.get("Namespace",""),d=t.XName.get("EntityType",e.nS.namespaceName),m=0;m<p;m++){if(s[m].nodeType==t.XmlNodeType.Element){var y=s[m];if(null==a){var g=o(y.elements1(l));null!=g&&g.length>0&&null!=(a=o(t.typeCast(t.XElement.$type,g[0]).elements1(h)))&&(this._entitySetSchemaNamespace=y.attribute(f).value)}null==u&&null!=(u=o(y.elements1(d)))&&(this._entityTypeSchemaNamespace=y.attribute(f).value)}}null!=a&&null!=u&&(this.schema=new c(this._entityTypeSchemaNamespace,u,a))}}}return Object.defineProperty(e.prototype,"schema",{get:function(){return this._schema},set:function(e){this._schema=e},enumerable:!1,configurable:!0}),e.prototype.getODataDataSourceSchema=function(e){var i,o,n,s;if(null==this.schema)return null;var a=[],u=[],p=[],l=this.schema.entitySets.get(e);if(null!=l){var c=this.schema.entities.get(l.entityName);if(null!=c){try{for(var h=r.__values(c.properties.values()),f=h.next();!f.done;f=h.next()){var d=f.value;a.push(d.name),"Edm.String"==d.type?u.push(t.DataSourceSchemaPropertyType.StringValue):"Edm.Int16"==d.type||"Edm.Int32"==d.type?u.push(t.DataSourceSchemaPropertyType.IntValue):"Edm.Double"==d.type?u.push(t.DataSourceSchemaPropertyType.DoubleValue):"Edm.Single"==d.type?u.push(t.DataSourceSchemaPropertyType.SingleValue):"Edm.Boolean"==d.type?u.push(t.DataSourceSchemaPropertyType.BooleanValue):"Edm.Byte"==d.type?u.push(t.DataSourceSchemaPropertyType.ShortValue):"Edm.DateTime"==d.type||"Edm.DateTimeOffset"==d.type?u.push(t.DataSourceSchemaPropertyType.DateTimeValue):"Edm.Int64"==d.type?u.push(t.DataSourceSchemaPropertyType.LongValue):"Edm.Decimal"==d.type?u.push(t.DataSourceSchemaPropertyType.DecimalValue):"Edm.SByte"==d.type?u.push(t.DataSourceSchemaPropertyType.ShortValue):u.push(t.DataSourceSchemaPropertyType.ObjectValue)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}try{for(var m=r.__values(c.primaryKey),y=m.next();!y.done;y=m.next()){var g=y.value;p.push(g)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(n)throw n.error}}}}return new t.ODataDataSourceSchema(a,u,p)},e.nS=t.XNamespace.get("http://docs.oasis-open.org/odata/ns/edm"),e}(),f=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(i,e),i.$t=t.markType(i,"ODataVirtualDataSourceProviderTaskDataHolder",t.AsyncVirtualDataSourceProviderTaskDataHolder.$type),i}(t.AsyncVirtualDataSourceProviderTaskDataHolder),d=function(e){function i(i){var o,n,s=e.call(this,i)||this;if(s._baseUri=null,s._entitySet=null,s._sortDescriptions=null,s._groupDescriptions=null,s._filterExpressions=null,s._summaryDescriptions=null,s._desiredPropeties=null,s._enableJsonp=!0,s._isAggregationSupported=!1,s._groupInformation=null,s._summaryInformation=null,s._filterString=null,s._selectedString=null,s.doWork=s.doWork.bind(s),s._baseUri=i.baseUri,s._entitySet=i.entitySet,s._sortDescriptions=i.sortDescriptions,s._groupDescriptions=i.groupDescriptions,null!=s._groupDescriptions&&s._groupDescriptions.size()>0){s._sortDescriptions=new t.SortDescriptionCollection;try{for(var a=r.__values(s.iter(i.sortDescriptions)),u=a.next();!u.done;u=a.next()){var p=u.value;s._sortDescriptions.add(p)}}catch(e){o={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}for(var l=0;l<s._groupDescriptions.size();l++)s._sortDescriptions.insert(l,s._groupDescriptions.get(l))}return s._filterExpressions=i.filterExpressions,s._desiredPropeties=i.propertiesRequested,s._summaryDescriptions=i.summaryDescriptions,s._summaryScope=i.summaryScope,s._enableJsonp=i.enableJsonp,s._isAggregationSupported=i.isAggregationSupported,window.setTimeout(s.doWork,100),s}return r.__extends(i,e),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"desiredProperties",{get:function(){return this._desiredPropeties},enumerable:!1,configurable:!0}),i.prototype.initialize=function(){e.prototype.initialize.call(this)},i.prototype.getTaskDataHolder=function(){return new f},i.prototype.getCompletedTaskData=function(t,r){e.prototype.getCompletedTaskData.call(this,t,r)},i.prototype.removeCompletedTaskData=function(t,r){e.prototype.removeCompletedTaskData.call(this,t,r)},i.prototype.getTasksData=function(t){e.prototype.getTasksData.call(this,t)},i.prototype.iter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterFilter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterSummaries=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.processCompletedTask=function(e,t,r,o){var n,s=this,a=null,u=-1,p=e.task;try{if(p.hasErrors)return void this.retryIndex(r,t);r==i.schemaRequestIndex?u=(a=p.result)["@odata.count"]:a=p.result}catch(e){return void this.retryIndex(r,t)}if(this.actualCount=u>=0?u:a["@odata.count"],null!=(n=this.actualSchema))this.finishProcessingCompletedTask(p,r,n,a);else{var l=0;this.resolveSchema((function(e){s.actualSchema=e,!s._isAggregationSupported||0===s._groupDescriptions.size()&&0===s._summaryDescriptions.size()?s.finishProcessingCompletedTask(p,r,e,a):(s._groupDescriptions.size()>0&&(l++,s.resolveGroupInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))),s._summaryDescriptions.size()>0&&(l++,s.resolveSummaryInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))))}),(function(){s.retryIndex(r,t)}))}},i.prototype.finishProcessingCompletedTask=function(e,t,r,i){var o,n,s,a,u=this;this.actualSchema=r,o=this.executionContext,s=this._groupInformation,a=this._summaryInformation,n=this.pageLoaded;var p=null;if(null!=i?(p=new l(i,r,s,a,t),!this.isLastPage(t)&&p.count()>0&&!this.populatedActualPageSize&&(this.populatedActualPageSize=!0,this.actualPageSize=p.count())):p=new l(null,r,s,a,t),null!=this.pageLoaded)if(null!=this.executionContext){if(null==o||null==n)return void this.shutdown();o.execute((function(){return n(p,u.actualCount,u.actualPageSize)}))}else{if(null==n)return void this.shutdown();n(p,this.actualCount,this.actualPageSize)}},i.prototype.resolveGroupInformation=function(e,i){var o,n,s=this;if(null==this._groupInformation){var a,u="",p="",l="";if(null!=this._groupDescriptions&&0!=this._groupDescriptions.size()){if(a=this._filterString,this.updateFilterString(),null!=this._groupDescriptions){var c=!0;try{for(var h=r.__values(this.iter(this._groupDescriptions)),f=h.next();!f.done;f=h.next()){var d=f.value;c?c=!1:(u+=", ",p+=", "),p+=d.propertyName,d.direction===t.ListSortDirection.Descending?u+=d.propertyName+" desc":u+=d.propertyName+" asc"}}catch(e){o={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(o)throw o.error}}}if(this._summaryScope===t.DataSourceSummaryScope.Both||this._summaryScope===t.DataSourceSummaryScope.Groups){var m=this.getSummaryQueryParameters(!0);t.stringIsNullOrEmpty(m)||(l=", "+m)}var y=this._entitySet+"?$orderby="+u+"&$apply=";t.stringIsNullOrEmpty(a)||(y+="filter("+a+")/"),y+="groupby(("+p+"), aggregate($count as $__count"+l+"))";try{var g=[],_=function(t,r){return s.groupSuccess(t,r,e,i,g)},v=function(t){return s.groupError(t,e,i,g)},b={requestUri:this._baseUri+"/"+y,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){odatajs.oData.request(b,_,v)})()}catch(e){i()}}else e(null)}else e(this._groupInformation)},i.prototype.groupError=function(e,t,r,i){this._groupInformation=null},i.prototype.groupSuccess=function(e,t,i,o,n){var s,a,u=[];try{for(var p=r.__values(this.iter(this._groupDescriptions)),l=p.next();!l.done;l=p.next()){var c=l.value;u.push(c.propertyName)}}catch(e){s={error:e}}finally{try{l&&!l.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}if(e&&e.value&&e.value.length>0)for(var h=0;h<e.value.length;h++)this.addGroup(n,u,u,0,e.value[h]);this._groupInformation=n,i(this._groupInformation)},i.prototype.addGroup=function(e,i,o,n,s){var a,u,p=[];try{for(var l=r.__values(i),c=l.next();!c.done;c=l.next()){var h=c.value;s[h]&&p.push(s[h])}}catch(e){a={error:e}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(a)throw a.error}}var f=0;s.$__count&&(f=t.Convert.toInt321(s.$__count));var d=null;this._summaryScope!=t.DataSourceSummaryScope.Both&&this._summaryScope!=t.DataSourceSummaryScope.Groups||(d=this.createSummaryResults(s));var m=new t.DefaultSectionInformation(n,n+(f-1),o,p,d);e.push(m)},i.prototype.resolveSummaryInformation=function(e,r){var i=this;if(null==this._summaryInformation){var o,n;if(null!=this._summaryDescriptions&&0!=this._summaryDescriptions.size()&&this._summaryScope!=t.DataSourceSummaryScope.Groups&&this._summaryScope!=t.DataSourceSummaryScope.None){o=this._filterString,this.updateFilterString(),n=this.getSummaryQueryParameters(!1);var s=this._entitySet+"?$apply=";t.stringIsNullOrEmpty(o)||(s+="filter("+o+")/"),s+="aggregate("+n+")";try{var a=[],u=function(t,o){return i.summarySuccess(t,o,e,r,a)},p=function(t){return i.summaryError(t,e,r,a)},l={requestUri:this._baseUri+"/"+s,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){odatajs.oData.request(l,u,p)})()}catch(e){r()}}else e(null)}else e(this._summaryInformation)},i.prototype.summarySuccess=function(e,t,r,i,o){e&&e.value&&e.value.length>0&&(o=this.createSummaryResults(e.value[0])),this._summaryInformation=o,r(this._summaryInformation)},i.prototype.summaryError=function(e,t,r,i){this._summaryInformation=null},i.prototype.getSummaryQueryParameters=function(e){var i,o,n="";if(null!=this._summaryDescriptions){var s=!0,a=!1;try{for(var u=r.__values(this.iterSummaries(this._summaryDescriptions)),p=u.next();!p.done;p=u.next()){var l=p.value;if(l.operand!=t.DataSourceSummaryOperand.Count||!e&&!a){switch(s||(n+=", "),l.operand){case t.DataSourceSummaryOperand.Average:n+=l.propertyName+" with average as "+l.propertyName+"Average";break;case t.DataSourceSummaryOperand.Min:n+=l.propertyName+" with min as "+l.propertyName+"Min";break;case t.DataSourceSummaryOperand.Max:n+=l.propertyName+" with max as "+l.propertyName+"Max";break;case t.DataSourceSummaryOperand.Sum:n+=l.propertyName+" with sum as "+l.propertyName+"Sum";break;case t.DataSourceSummaryOperand.Count:n+="$count as $__count",a=!0}s=!1}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}return n},i.prototype.createSummaryResults=function(e){var i,o,n=[];try{for(var s=r.__values(this.iterSummaries(this._summaryDescriptions)),a=s.next();!a.done;a=s.next()){var u=a.value,p=u.propertyName;switch(u.operand){case t.DataSourceSummaryOperand.Average:p+="Average";break;case t.DataSourceSummaryOperand.Min:p+="Min";break;case t.DataSourceSummaryOperand.Max:p+="Max";break;case t.DataSourceSummaryOperand.Sum:p+="Sum";break;case t.DataSourceSummaryOperand.Count:p="$__count"}var l=null;e&&e[p]&&(l=e[p]);var c=new t.DefaultSummaryResult(u.propertyName,u.operand,l);n.push(c)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return n},i.prototype.resolveSchema=function(e,t){var r=this,i=this._baseUri,o=new XMLHttpRequest;o.onreadystatechange=function(){var i,n;4===o.readyState&&(200===o.status?(i=o.responseText,n=new h(i).getODataDataSourceSchema(r._entitySet),e(n)):t())},o.open("Get",i+"/$metadata"),o.send()},i.prototype.makeTaskForRequest=function(e,o){var n,s,a;a=this.actualPageSize,this.sortDescriptions;var u=this._baseUri;u+="/"+this._entitySet;var p=!1;if(this.updateFilterString(),null!=this._filterString&&(p?u+="&":(p=!0,u+="?"),u+="$filter="+this._filterString),null!=this.sortDescriptions){var l=null;try{for(var c=r.__values(this.iter(this.sortDescriptions)),h=c.next();!h.done;h=c.next()){var f=h.value;null==l?l="":l+=", ",f.direction==t.ListSortDirection.Descending?l+=f.propertyName+" desc":l+=f.propertyName}}catch(e){n={error:e}}finally{try{h&&!h.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}null!=l&&(p?u+="&":(p=!0,u+="?"),u+="$orderby="+l)}if(null!=this.desiredProperties&&this.desiredProperties.length>0){for(var d="",m=!0,y=this.desiredProperties,g=0;g<y.length;g++){m?m=!1:d+=", ",d+=y[g]}p?u+="&":(p=!0,u+="?"),u+="$select="+d}var _=new t.AsyncVirtualDataTask;e.index==i.schemaRequestIndex?this.executeRequest(u,p,0,a,_):this.executeRequest(u,p,e.index*a,a,_),e.taskHolder=new t.AsyncDataSourcePageTaskHolder,e.taskHolder.task=_,this.tasks.add(e)},i.prototype.updateFilterString=function(){var e,i;if(null!=this.filterExpressions&&this.filterExpressions.size()>0&&null==this._filterString){var o="",n=!0;try{for(var s=r.__values(this.iterFilter(this.filterExpressions)),a=s.next();!a.done;a=s.next()){var u=a.value;n?n=!1:o+=" AND ";var p=new t.ODataDataSourceFilterExpressionVisitor(0);p.visit(u);var l=p.toString();this.filterExpressions.size()>1&&(l="("+l+")"),o+=l}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}this._filterString=o}},i.prototype.executeRequest=function(e,t,r,i,o){var n=this;t?e+="&":(t=!0,e+="?");var s,a=function(e,t){return n.success(o,e,t)},u=function(e){return n.error(o,e)},p={requestUri:e+="$skip="+r+"&$top="+i+"&$count=true",enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};s=function(){odatajs.oData.request(p,a,u)},o.run=s},i.prototype.success=function(e,t,r){e.result=t,e.isCompleted=!0},i.prototype.error=function(e,t){e.isCompleted=!0,e.hasErrors=!0},i.prototype.createBatchRequest=function(e){for(var r=[],i=0;i<e.length;i++){var o=e[i],n={"Content-Type":"application/json","odata-version":"4.0"};o.transactionType===t.TransactionType.Add?r.push({method:"POST",id:"r".concat(i),atomicityGroup:"g1",url:"".concat(this._baseUri,"/").concat(this._entitySet),headers:n,body:o.value}):o.transactionType===t.TransactionType.Update?(o.version&&(n["If-Match"]=o.version),r.push({method:"PATCH",id:"r".concat(i),atomicityGroup:"g1",url:"".concat(this._baseUri,"/").concat(this.getRequestUriWithKey(o.id)),headers:n,body:o.value})):o.transactionType===t.TransactionType.Delete&&(o.version&&(n["If-Match"]=o.version),r.push({method:"DELETE",id:"r".concat(i),atomicityGroup:"g1",url:"".concat(this._baseUri,"/").concat(this.getRequestUriWithKey(o.id)),headers:n}))}var s={requestUri:"".concat(this._baseUri,"/$batch"),method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requests:r})},a=this;odatajs.oData.request(s,(function(e){if(e&&e.responses)if(e.responses.length>0){for(var t=!0,i=[],o=function(o){if(200!==e.responses[o].status&&204!==e.responses[o].status){t=!1;var n=r.filter((function(t){return t.id==e.responses[o].id}))[0];if(n){var s="".concat(n.method," request failed with code ").concat(e.responses[o].status);i.push(s),console.error(s)}return"break"}},n=0;n<e.responses.length;n++){if("break"===o(n))break}t?a.batchCompleted(!0,!0,null):a.batchCompleted(!1,!0,i)}else a.batchCompleted(!1,!0,null)}),(function(e){var t=[];e&&e.message&&t.push(e.message),a.batchCompleted(!1,!0,t)}))},i.prototype.getRequestUriWithKey=function(e){for(var t="",r=Object.keys(e),i=0;i<r.length;i++)i>0&&(t+=","),t+="".concat(r[i],"=").concat(e[r[i]]);return"".concat(this._entitySet,"(").concat(t,")")},i.schemaRequestIndex=-1,i}(t.AsyncVirtualDataSourceProviderWorker),m=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._baseUri=null,t._entitySet=null,t._sortDescriptions=null,t._filterExpressions=null,t._propertiesRequested=null,t._groupDescriptions=null,t._summaryDescriptions=null,t}return r.__extends(i,e),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){this._baseUri=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){this._entitySet=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},set:function(e){this._sortDescriptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},set:function(e){this._filterExpressions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},set:function(e){this._groupDescriptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},set:function(e){this._summaryDescriptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryscope},set:function(e){this._summaryscope=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!1,configurable:!0}),i.$t=t.markType(i,"ODataVirtualDataSourceDataProviderWorkerSettings",t.AsyncVirtualDataSourceDataProviderWorkerSettings.$type),i}(t.AsyncVirtualDataSourceDataProviderWorkerSettings),y=function(e){function i(){var r=e.call(this)||this;return r._worker=null,r._requests=new s,r._callback=null,r._pageLoaded=null,r._pageSizeRequested=50,r._baseUri=null,r._entitySet=null,r._timeoutMilliseconds=1e4,r.schemaChanged=null,r._currentFullCount=0,r._currentSchema=null,r._executionContext=null,r._updateNotifier=null,r._deferAutoRefresh=!1,r._sortDescriptions=null,r._groupDescriptions=null,r._propertiesRequested=null,r._filterExpressions=null,r._summaryDescriptions=null,r._enableJsonp=!0,r._schemaFetchQueued=!1,r._autoRefreshQueued=!1,r._batchCompleted=null,r._sortDescriptions=new t.SortDescriptionCollection,r._sortDescriptions.onChanged=function(){return r.sortDescriptions_CollectionChanged(null,null)},r._groupDescriptions=new t.SortDescriptionCollection,r._groupDescriptions.onChanged=function(){return r.groupDescriptions_CollectionChanged(null,null)},r._filterExpressions=new t.FilterExpressionCollection,r._filterExpressions.onChanged=function(){return r.filterExpressions_CollectionChanged(null,null)},r._summaryDescriptions=new t.SummaryDescriptionCollection,r._summaryDescriptions.onChanged=function(){return r.summaryDescriptions_CollectionChanged(null,null)},r}return r.__extends(i,e),i.prototype.filterExpressions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.sortDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.groupDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.summaryDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.addPageRequest=function(e,r){this.deferAutoRefresh||(null!=this._worker&&this._worker.isShutdown&&(this._worker=null,this._callback=null),null==this._worker&&this.createWorker(),r==t.DataSourcePageRequestPriority.High?this._requests.addFirst(e):this._requests.addLast(e),this._worker.addPageRequest(e,r)||(this._worker=null,this._callback=null,this.addPageRequest(e,r)))},i.prototype.createWorker=function(){if(this.valid()){this._callback=t.runOn(this,this.raisePageLoaded);var e=this.getWorkerSettings();this._worker=new d(e)}},i.prototype.valid=function(){return null!=this.entitySet&&null!=this.baseUri},i.prototype.getWorkerSettings=function(){var e,t=this;return(e=new m).baseUri=t._baseUri,e.entitySet=t._entitySet,e.pageSizeRequested=t._pageSizeRequested,e.timeoutMilliseconds=t._timeoutMilliseconds,e.pageLoaded=t._callback,e.batchCompleted=t._batchCompleted,e.executionContext=t._executionContext,e.sortDescriptions=t._sortDescriptions,e.groupDescriptions=t._groupDescriptions,e.filterExpressions=t._filterExpressions,e.propertiesRequested=t._propertiesRequested,e.summaryDescriptions=t._summaryDescriptions,e.summaryScope=t._summaryScope,e.enableJsonp=t._enableJsonp,e.isAggregationSupported=t.isAggregationSupported,e},i.prototype.removePageRequest=function(e){for(var t=this._requests.first;null!=t;)t.value==e&&this._requests.remove(t),t=t.next;null!=this._worker&&this._worker.removePageRequest(e)},i.prototype.removeAllPageRequests=function(){this._requests.clear(),null!=this._worker&&this._worker.removeAllPageRequests()},i.prototype.close=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageLoaded",{get:function(){return this._pageLoaded},set:function(e){this._pageLoaded=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),i.prototype.raisePageLoaded=function(e,r,i){if(null!=this._pageLoaded){if(this._currentFullCount=r,null==this._currentSchema){var o=null;null!=e&&(o=e.schema()),this._currentSchema=o,null!=this.schemaChanged&&this.schemaChanged(this,new t.DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema,this._currentFullCount))}e.pageIndex()!=d.schemaRequestIndex&&this._pageLoaded(e,r,i)}},i.prototype.killWorker=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageSizeRequested",{get:function(){return this._pageSizeRequested},set:function(e){this._pageSizeRequested=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,t!=this._entitySet&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){this._timeoutMilliseconds=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),i.prototype.getItemValue=function(e,t){var r=e;return r.has(t)?r.get(t):null},i.prototype.setItemValue=function(e,t,r){},i.prototype.removeItem=function(e){},i.prototype.addItem=function(e){},Object.defineProperty(i.prototype,"actualCount",{get:function(){return this._currentFullCount},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"actualSchema",{get:function(){return this._currentSchema},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"executionContext",{get:function(){return this._executionContext},set:function(e){this._executionContext=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"updateNotifier",{get:function(){return this._updateNotifier},set:function(e){this._updateNotifier=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"deferAutoRefresh",{get:function(){return this._deferAutoRefresh},set:function(e){this._deferAutoRefresh=e,this._deferAutoRefresh||this.queueAutoRefresh(),this._deferAutoRefresh&&this.valid()&&null==this._currentSchema&&this.queueSchemaFetch()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isSortingSupported",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isGroupingSupported",{get:function(){return this.isAggregationSupported},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isFilteringSupported",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryScope},set:function(e){this._summaryScope=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"notifyUsingSourceIndexes",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isItemIndexLookupSupported",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isKeyIndexLookupSupported",{get:function(){return!1},enumerable:!1,configurable:!0}),i.prototype.notifySetItem=function(e,t,r){null!=this.updateNotifier&&this.updateNotifier.notifySetItem(e,t,r)},i.prototype.notifyClearItems=function(){null!=this.updateNotifier&&this.updateNotifier.notifyClearItems()},i.prototype.notifyInsertItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyInsertItem(e,t)},i.prototype.notifyRemoveItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyRemoveItem(e,t)},i.prototype.queueSchemaFetch=function(){this._schemaFetchQueued||null!=this.executionContext&&(this._schemaFetchQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doSchemaFetchInternal)))},i.prototype.doSchemaFetchInternal=function(){this._schemaFetchQueued&&(this._schemaFetchQueued=!1,this.schemaFetchInternal())},i.prototype.schemaFetchInternal=function(){this.schemaFetchInternalOverride()},i.prototype.schemaFetchInternalOverride=function(){this.deferAutoRefresh&&(this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this.addSchemaRequest())},i.prototype.addSchemaRequest=function(){this._worker.addPageRequest(d.schemaRequestIndex,t.DataSourcePageRequestPriority.High)},i.prototype.queueAutoRefresh=function(){this.deferAutoRefresh||this._autoRefreshQueued||null!=this.executionContext&&(this._autoRefreshQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doRefreshInternal)))},i.prototype.doRefreshInternal=function(){this.deferAutoRefresh?this._autoRefreshQueued=!1:this._autoRefreshQueued&&(this._autoRefreshQueued=!1,this.refreshInternal())},i.prototype.refreshInternal=function(){this.refreshInternalOverride()},i.prototype.refreshInternalOverride=function(){this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this._worker.addPageRequest(0,t.DataSourcePageRequestPriority.Normal)},i.prototype.flushAutoRefresh=function(){this.doRefreshInternal()},i.prototype.refresh=function(){this.refreshInternal()},i.prototype.indexOfItem=function(e){return-1},i.prototype.indexOfKey=function(e){return-1},i.prototype.resolveSchemaPropertyType=function(e){if(null==this.actualSchema)return t.DataSourceSchemaPropertyType.ObjectValue;if(t.stringContains(e,"."))return t.DataSourceSchemaPropertyType.ObjectValue;for(var r=0;r<this.actualSchema.propertyNames.length;r++){if(this.actualSchema.propertyNames[r]==e)return this.actualSchema.propertyTypes[r]}return t.DataSourceSchemaPropertyType.ObjectValue},i.prototype.createBatchRequest=function(e){this._worker&&this._worker.createBatchRequest(e)},Object.defineProperty(i.prototype,"batchCompleted",{get:function(){return this._batchCompleted},set:function(e){this._batchCompleted=e},enumerable:!1,configurable:!0}),i.$t=t.markType(i,"ODataVirtualDataSourceDataProvider",t.Base.$type,[t.IDataSourceVirtualDataProvider_$type]),i}(t.Base),g=function(e){function i(){var t,r=e.call(this)||this;return r._baseUri=null,r._entitySet=null,r._timeoutMilliseconds=1e4,r._isAggregationSupportedByServer=!1,r._enableJsonp=!0,r.dataProvider=((t=new y).executionContext=r.executionContext,t.enableJsonp=r.enableJsonp,t.isAggregationSupported=r.isGroupingSupported,t),r.externalDataSource=r,r}return r.__extends(i,e),i.prototype.onBaseUriChanged=function(e,r){null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.baseUri=this.baseUri),this.queueAutoRefresh()},Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&this.onBaseUriChanged(t,this._baseUri)},enumerable:!1,configurable:!0}),i.prototype.onEntitySetChanged=function(e,r){null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.entitySet=this.entitySet),this.queueAutoRefresh()},Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,this._entitySet!=t&&this.onEntitySetChanged(t,this._entitySet)},enumerable:!1,configurable:!0}),i.prototype.onTimeoutMillisecondsChanged=function(e,r){null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.timeoutMilliseconds=this.timeoutMilliseconds)},Object.defineProperty(i.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){var t=this._timeoutMilliseconds;this._timeoutMilliseconds=e,t!=this._timeoutMilliseconds&&this.onTimeoutMillisecondsChanged(t,this._timeoutMilliseconds)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isSortingSupportedOverride",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isFilteringSupportedOverride",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isGroupingSupportedOverride",{get:function(){return this.isAggregationSupportedByServer},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupportedByServer",{get:function(){return this._isAggregationSupportedByServer},set:function(e){this._isAggregationSupportedByServer=e,null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.isAggregationSupported=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e,null!==t.typeCast(y.$type,this.actualDataProvider)&&(this.actualDataProvider.enableJsonp=e)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){var e=new i;e.executionContext=this.executionContext,e.includeSummaryRowsInSection=this.includeSummaryRowsInSection,e.isSectionCollapsable=this.isSectionCollapsable,e.isSectionExpandedDefault=this.isSectionExpandedDefault,e.isSectionSummaryRowsAtBottom=this.isSectionSummaryRowsAtBottom,e.primaryKey=this.primaryKey,e.propertiesRequested=this.propertiesRequested,e.sectionHeaderDisplayMode=this.sectionHeaderDisplayMode,e.shouldEmitSectionFooters=this.shouldEmitSectionFooters,e.shouldEmitSectionHeaders=this.shouldEmitSectionHeaders,e.shouldEmitShiftedRows=this.shouldEmitShiftedRows,e.summaryScope=this.summaryScope;for(var t=0;t<this.groupDescriptions.size();t++)e.groupDescriptions.add(this.groupDescriptions.get(t));for(t=0;t<this.sortDescriptions.size();t++)e.sortDescriptions.add(this.sortDescriptions.get(t));for(t=0;t<this.filterExpressions.size();t++)e.filterExpressions.add(this.filterExpressions.get(t));for(t=0;t<this.summaryDescriptions.size();t++)e.summaryDescriptions.add(this.summaryDescriptions.get(t));return e.pageSizeRequested=this.pageSizeRequested,e.maxCachedPages=this.maxCachedPages,e.baseUri=this.baseUri,e.entitySet=this.entitySet,e.timeoutMilliseconds=this.timeoutMilliseconds,e.isAggregationSupportedByServer=this.isAggregationSupportedByServer,e.enableJsonp=this.enableJsonp,e},i}(t.VirtualDataSource),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(i,e),i.$t=t.markType(i,"ODataVirtualDataSourceProviderTaskDataHolder",t.AsyncVirtualDataSourceProviderTaskDataHolder.$type),i}(t.AsyncVirtualDataSourceProviderTaskDataHolder),v=function(){function e(e,r,i,o,n){if(this._actualData=null,this._schema=null,this._pageIndex=0,this._groupInformation=null,this._summaryInformation=null,null==e)this._actualData=null;else{var s=e.items.length;this._actualData=[];for(var a=new Set,u=0;u<r.propertyNames.length;u++)r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeValue&&r.propertyTypes[u]!=t.DataSourceSchemaPropertyType.DateTimeOffsetValue||a.add(r.propertyNames[u]);for(var p=void 0,l=function(t){for(var r=e.items[t],i=new Map,o=Array.from(Object.keys(r)),n=o.map((function(e){return r[e]})),s=0;s<o.length;s++)p=n[s],a.has(o[s])&&(p=new Date(p)),i.set(o[s],p);c._actualData[t]=i},c=this,h=0;h<s;h++)l(h)}this._schema=r,this._groupInformation=i,this._summaryInformation=o,this._pageIndex=n}return e.prototype.count=function(){return this._actualData.length},e.prototype.getItemAtIndex=function(e){return this._actualData[e]},e.prototype.getItemValueAtIndex=function(e,t){var r=this._actualData[e];return r.has(t)?r.get(t):null},e.prototype.pageIndex=function(){return this._pageIndex},e.prototype.schema=function(){return this._schema},e.prototype.getGroupInformation=function(){return this._groupInformation},e.prototype.getSummaryInformation=function(){return this._summaryInformation},e}(),b=function(e){function i(i){var o,n,s=e.call(this,i)||this;if(s._baseUri=null,s._entitySet=null,s._sortDescriptions=null,s._groupDescriptions=null,s._filterExpressions=null,s._summaryDescriptions=null,s._desiredPropeties=null,s._enableJsonp=!0,s._isAggregationSupported=!1,s._provideFullCount=null,s._provideOrderByParameter=null,s._provideFilterParameter=null,s._provideAggregationParameter=null,s._provideAggregatedCount=null,s._providePagingParameter=null,s._provideDesiredPropertiesParameter=null,s._provideUri=null,s._performFetch=null,s._fixedFullCount=-1,s._groupInformation=null,s._summaryInformation=null,s._filterString=null,s._selectedString=null,s.doWork=s.doWork.bind(s),s._baseUri=i.baseUri,s._entitySet=i.entitySet,s._sortDescriptions=i.sortDescriptions,s._groupDescriptions=i.groupDescriptions,null!=s._groupDescriptions&&s._groupDescriptions.size()>0){s._sortDescriptions=new t.SortDescriptionCollection;try{for(var a=r.__values(s.iter(i.sortDescriptions)),u=a.next();!u.done;u=a.next()){var p=u.value;s._sortDescriptions.add(p)}}catch(e){o={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}for(var l=0;l<s._groupDescriptions.size();l++)s._sortDescriptions.insert(l,s._groupDescriptions.get(l))}return s._filterExpressions=i.filterExpressions,s._desiredPropeties=i.propertiesRequested,s._summaryDescriptions=i.summaryDescriptions,s._fixedFullCount=i.fixedFullCount,s._summaryScope=i.summaryScope,s._enableJsonp=i.enableJsonp,s._provideFullCount=i.provideFullCount,s._performFetch=i.performFetch,s._provideAggregationParameter=i.provideAggregationParameter,s._provideFilterParameter=i.provideFilterParameter,s._provideOrderByParameter=i.provideOrderByParameter,s._provideUri=i.provideUri,s._providePagingParameter=i.providePagingParameter,s._provideDesiredPropertiesParameter=i.provideDesiredPropertiesParameter,s._provideItems=i.provideItems,s._provideAggregatedCount=i.provideAggregatedCount,s._provideItems||(s._provideItems=function(e){return e?e.items:null}),s._provideFullCount||(s._provideFullCount=function(e){return e.fullCount?e.fullCount:s._fixedFullCount>=0?s._fixedFullCount:0}),s._provideOrderByParameter||(s._provideOrderByParameter=function(e,t,r){e.push({name:"orderBy",value:encodeURIComponent(t)})}),s._providePagingParameter||(s._providePagingParameter=function(e,t,r){e.push({name:"skip",value:t}),e.push({name:"take",value:r})}),s._provideAggregationParameter||(s._provideAggregationParameter=function(e,t,r,i,o,n){e.push({name:"groupBy",value:r}),e.push({name:"aggregate",value:"count"})}),s._provideUri||(s._provideUri=function(e,t,r){var i=e;i+="/"+t,r.length>0&&(i+="?");for(var o="",n=0;n<r.length;n++)n>0&&(o+="&"),o+=r[n].name+"="+r[n].value;return i+o}),s._isAggregationSupported=i.isAggregationSupported,window.setTimeout(s.doWork,100),s}return r.__extends(i,e),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"desiredProperties",{get:function(){return this._desiredPropeties},enumerable:!1,configurable:!0}),i.prototype.initialize=function(){e.prototype.initialize.call(this)},i.prototype.getTaskDataHolder=function(){return new _},i.prototype.getCompletedTaskData=function(t,r){e.prototype.getCompletedTaskData.call(this,t,r)},i.prototype.removeCompletedTaskData=function(t,r){e.prototype.removeCompletedTaskData.call(this,t,r)},i.prototype.getTasksData=function(t){e.prototype.getTasksData.call(this,t)},i.prototype.iter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterFilter=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.iterSummaries=function(e){var t;return r.__generator(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<e.size()?[4,e.get(t)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},i.prototype.processCompletedTask=function(e,t,r,o){var n,s=this,a=null,u=-1,p=e.task;try{if(p.hasErrors)return void this.retryIndex(r,t);r==i.schemaRequestIndex?(a=p.result,u=this._provideFullCount(a)):a=p.result}catch(e){return void this.retryIndex(r,t)}if(this.actualCount=u>=0?u:this._provideFullCount(a),null!=(n=this.actualSchema))this.finishProcessingCompletedTask(p,r,n,a);else{var l=0;this.resolveSchema((function(e){s.actualSchema=e,!s._isAggregationSupported||0===s._groupDescriptions.size()&&0===s._summaryDescriptions.size()?s.finishProcessingCompletedTask(p,r,e,a):(s._groupDescriptions.size()>0&&(l++,s.resolveGroupInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))),s._summaryDescriptions.size()>0&&(l++,s.resolveSummaryInformation((function(t){0===--l&&s.finishProcessingCompletedTask(p,r,e,a)}),(function(){s.retryIndex(r,t)}))))}),(function(){s.retryIndex(r,t)}))}},i.prototype.finishProcessingCompletedTask=function(e,t,r,i){var o,n,s,a,u=this;this.actualSchema=r,o=this.executionContext,s=this._groupInformation,a=this._summaryInformation,n=this.pageLoaded;var p=null;if(null!=i?(p=new v(i,r,s,a,t),!this.isLastPage(t)&&p.count()>0&&!this.populatedActualPageSize&&(this.populatedActualPageSize=!0,this.actualPageSize=p.count())):p=new v(null,r,s,a,t),null!=this.pageLoaded)if(null!=this.executionContext){if(null==o||null==n)return void this.shutdown();o.execute((function(){return n(p,u.actualCount,u.actualPageSize)}))}else{if(null==n)return void this.shutdown();n(p,this.actualCount,this.actualPageSize)}},i.prototype.resolveGroupInformation=function(e,i){var o,n,s=this;if(null==this._groupInformation){var a,u="",p="",l="";if(null!=this._groupDescriptions&&0!=this._groupDescriptions.size())if(null!=this._provideAggregationParameter){if(a=this._filterString,this.updateFilterString(),null!=this._groupDescriptions){var c=!0;try{for(var h=r.__values(this.iter(this._groupDescriptions)),f=h.next();!f.done;f=h.next()){var d=f.value;c?c=!1:(u+=", ",p+=", "),p+=d.propertyName,d.direction===t.ListSortDirection.Descending?u+=d.propertyName+" desc":u+=d.propertyName+" asc"}}catch(e){o={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(o)throw o.error}}}if(this._summaryScope===t.DataSourceSummaryScope.Both||this._summaryScope===t.DataSourceSummaryScope.Groups){var m=this.getSummaryQueryParameters(!0);t.stringIsNullOrEmpty(m)||(l=", "+m)}var y=[];this._provideOrderByParameter&&this._provideOrderByParameter(y,u,this._groupDescriptions),this._provideFilterParameter&&null!=a&&this._provideFilterParameter(y,a,this._filterExpressions),this._provideAggregationParameter&&this._provideAggregationParameter(y,!0,p,this._groupDescriptions,l,this._summaryDescriptions);var g=this._provideUri(this._baseUri,this._entitySet,y);try{var _=[],v=function(t,r){return s.groupSuccess(t,r,e,i,_)},b=function(t){return s.groupError(t,e,i,_)},S={requestUri:g,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){s.fetchUri(S,v,b)})()}catch(e){i()}}else e(null);else e(null)}else e(this._groupInformation)},i.prototype.fetchUri=function(e,t,r){this._performFetch?this._performFetch(e,t,r):fetch(e.requestUri,{method:e.method,headers:e.headers}).then((function(e){e.json().then((function(r){t(r,e)}))})).catch((function(e){r(e)}))},i.prototype.groupError=function(e,t,r,i){this._groupInformation=null},i.prototype.groupSuccess=function(e,t,i,o,n){var s,a,u=[];try{for(var p=r.__values(this.iter(this._groupDescriptions)),l=p.next();!l.done;l=p.next()){var c=l.value;u.push(c.propertyName)}}catch(e){s={error:e}}finally{try{l&&!l.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}var h=this._provideItems(e);if(h&&h.length>0)for(var f=0;f<h.length;f++)this.addGroup(n,u,u,0,h[f]);this._groupInformation=n,i(this._groupInformation)},i.prototype.addGroup=function(e,i,o,n,s){var a,u,p=[];try{for(var l=r.__values(i),c=l.next();!c.done;c=l.next()){var h=c.value;s[h]&&p.push(s[h])}}catch(e){a={error:e}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(a)throw a.error}}var f=0;if(this._provideAggregatedCount)this._provideAggregatedCount(s);else s.aggregatedCount&&(f=t.Convert.toInt321(s.aggregatedCount));var d=null;this._summaryScope!=t.DataSourceSummaryScope.Both&&this._summaryScope!=t.DataSourceSummaryScope.Groups||(d=this.createSummaryResults(s));var m=new t.DefaultSectionInformation(n,n+(f-1),o,p,d);e.push(m)},i.prototype.resolveSummaryInformation=function(e,r){var i=this;if(null==this._summaryInformation){var o,n;if(null!=this._summaryDescriptions&&0!=this._summaryDescriptions.size()&&this._summaryScope!=t.DataSourceSummaryScope.Groups&&this._summaryScope!=t.DataSourceSummaryScope.None){o=this._filterString,this.updateFilterString(),n=this.getSummaryQueryParameters(!1);var s=[];this._provideFilterParameter&&null!=o&&this._provideFilterParameter(s,o,this._filterExpressions),this._provideAggregationParameter&&this._provideAggregationParameter(s,!0,null,null,n,this._summaryDescriptions);var a=this._provideUri(this._baseUri,this._entitySet,s);try{var u=[],p=function(t,o){return i.summarySuccess(t,o,e,r,u)},l=function(t){return i.summaryError(t,e,r,u)},c={requestUri:a,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){i.fetchUri(c,p,l)})()}catch(e){r()}}else e(null)}else e(this._summaryInformation)},i.prototype.summarySuccess=function(e,t,r,i,o){e&&e.value&&e.value.length>0&&(o=this.createSummaryResults(e.value[0])),this._summaryInformation=o,r(this._summaryInformation)},i.prototype.summaryError=function(e,t,r,i){this._summaryInformation=null},i.prototype.getSummaryQueryParameters=function(e){var i,o,n="";if(null!=this._summaryDescriptions){var s=!0,a=!1;try{for(var u=r.__values(this.iterSummaries(this._summaryDescriptions)),p=u.next();!p.done;p=u.next()){var l=p.value;if(l.operand!=t.DataSourceSummaryOperand.Count||!e&&!a){switch(s||(n+=", "),l.operand){case t.DataSourceSummaryOperand.Average:n+=l.propertyName+" with average as "+l.propertyName+"Average";break;case t.DataSourceSummaryOperand.Min:n+=l.propertyName+" with min as "+l.propertyName+"Min";break;case t.DataSourceSummaryOperand.Max:n+=l.propertyName+" with max as "+l.propertyName+"Max";break;case t.DataSourceSummaryOperand.Sum:n+=l.propertyName+" with sum as "+l.propertyName+"Sum";break;case t.DataSourceSummaryOperand.Count:n+="$count as $__count",a=!0}s=!1}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}return n},i.prototype.createSummaryResults=function(e){var i,o,n=[];try{for(var s=r.__values(this.iterSummaries(this._summaryDescriptions)),a=s.next();!a.done;a=s.next()){var u=a.value,p=u.propertyName;switch(u.operand){case t.DataSourceSummaryOperand.Average:p+="Average";break;case t.DataSourceSummaryOperand.Min:p+="Min";break;case t.DataSourceSummaryOperand.Max:p+="Max";break;case t.DataSourceSummaryOperand.Sum:p+="Sum";break;case t.DataSourceSummaryOperand.Count:p="$__count"}var l=null;e&&e[p]&&(l=e[p]);var c=new t.DefaultSummaryResult(u.propertyName,u.operand,l);n.push(c)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return n},i.prototype.resolveSchemaFromItems=function(e){var r=new t.LocalDataSource;return r.dataSource=e,r.flushAutoRefresh(),r.actualSchema},i.prototype.resolveSchema=function(e,t){var r=this;if(this._provideItems&&this._providePagingParameter){var i=function(i){var o=r._provideItems(i);if(o&&o.length>0){var n=r.resolveSchemaFromItems(o);e(n)}else t("could not find items to resolve schema")},o=function(e){return t(e)},n=[];this._providePagingParameter&&this._providePagingParameter(n,0,this.actualPageSize);var s=this._provideUri(this._baseUri,this._entitySet,n);try{var a={requestUri:s,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};(function(){r.fetchUri(a,i,o)})()}catch(e){t(e)}}else t("required providers for items and paging are not specified")},i.prototype.makeTaskForRequest=function(e,o){var n,s,a,u=[];a=this.actualPageSize,this.sortDescriptions;if(this.updateFilterString(),null!=this._filterString&&this._provideFilterParameter&&this._provideFilterParameter(u,this._filterString,this._filterExpressions),null!=this.sortDescriptions){var p=null;try{for(var l=r.__values(this.iter(this.sortDescriptions)),c=l.next();!c.done;c=l.next()){var h=c.value;null==p?p="":p+=", ",h.direction==t.ListSortDirection.Descending?p+=h.propertyName+" desc":p+=h.propertyName}}catch(e){n={error:e}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(n)throw n.error}}null!=p&&this._provideOrderByParameter&&this._provideOrderByParameter(u,p,this._sortDescriptions)}if(null!=this.desiredProperties&&this.desiredProperties.length>0){for(var f="",d=!0,m=this.desiredProperties,y=0;y<m.length;y++){d?d=!1:f+=", ",f+=m[y]}this._provideDesiredPropertiesParameter&&this._provideDesiredPropertiesParameter(u,f,this._desiredPropeties)}this._providePagingParameter&&(e.index==i.schemaRequestIndex?this._providePagingParameter(u,0,a):this._providePagingParameter(u,e.index*a,a));var g=new t.AsyncVirtualDataTask,_=this._provideUri(this._baseUri,this._entitySet,u);e.index==i.schemaRequestIndex?this.executeRequest(_,!1,0,a,g):this.executeRequest(_,!1,e.index*a,a,g),e.taskHolder=new t.AsyncDataSourcePageTaskHolder,e.taskHolder.task=g,this.tasks.add(e)},i.prototype.updateFilterString=function(){var e,i;if(null!=this.filterExpressions&&this.filterExpressions.size()>0&&null==this._filterString){var o="",n=!0;try{for(var s=r.__values(this.iterFilter(this.filterExpressions)),a=s.next();!a.done;a=s.next()){var u=a.value;n?n=!1:o+=" AND ";var p=new t.ODataDataSourceFilterExpressionVisitor(0);p.visit(u);var l=p.toString();this.filterExpressions.size()>1&&(l="("+l+")"),o+=l}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}this._filterString=o}},i.prototype.executeRequest=function(e,t,r,i,o){var n,s=this,a=function(e,t){return s.success(o,e,t)},u=function(e){return s.error(o,e)},p={requestUri:e,enableJsonpCallback:this._enableJsonp,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},data:null};n=function(){s.fetchUri(p,a,u)},o.run=n},i.prototype.success=function(e,t,r){e.result=t,e.isCompleted=!0},i.prototype.error=function(e,t){e.isCompleted=!0,e.hasErrors=!0},i.prototype.createBatchRequest=function(e){},i.prototype.getRequestUriWithKey=function(e){for(var t="",r=Object.keys(e),i=0;i<r.length;i++)i>0&&(t+=","),t+="".concat(r[i],"=").concat(e[r[i]]);return"".concat(this._entitySet,"(").concat(t,")")},i.schemaRequestIndex=-1,i}(t.AsyncVirtualDataSourceProviderWorker),S=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._baseUri=null,t._entitySet=null,t._sortDescriptions=null,t._filterExpressions=null,t._propertiesRequested=null,t._groupDescriptions=null,t._summaryDescriptions=null,t._fixedFullCount=-1,t._provideFullCount=null,t._provideOrderByParameter=null,t._provideFilterParameter=null,t._provideAggregationParameter=null,t._provideAggregatedCount=null,t._provideUri=null,t._providePagingParameter=null,t._provideDesiredPropertiesParameter=null,t._performFetch=null,t}return r.__extends(i,e),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){this._baseUri=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){this._entitySet=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},set:function(e){this._sortDescriptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},set:function(e){this._filterExpressions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},set:function(e){this._groupDescriptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},set:function(e){this._summaryDescriptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryscope},set:function(e){this._summaryscope=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fixedFullCount",{get:function(){return this._fixedFullCount},set:function(e){this._fixedFullCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideFullCount",{get:function(){return this._provideFullCount},set:function(e){this._provideFullCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideOrderByParameter",{get:function(){return this._provideOrderByParameter},set:function(e){this._provideOrderByParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideFilterParameter",{get:function(){return this._provideFilterParameter},set:function(e){this._provideFilterParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregationParameter",{get:function(){return this._provideAggregationParameter},set:function(e){this._provideAggregationParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregatedCount",{get:function(){return this._provideAggregatedCount},set:function(e){this._provideAggregatedCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideUri",{get:function(){return this._provideUri},set:function(e){this._provideUri=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"providePagingParameter",{get:function(){return this._providePagingParameter},set:function(e){this._providePagingParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideDesiredPropertiesParameter",{get:function(){return this._provideDesiredPropertiesParameter},set:function(e){this._provideDesiredPropertiesParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideItems",{get:function(){return this._provideItems},set:function(e){this._provideItems=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"performFetch",{get:function(){return this._performFetch},set:function(e){this._performFetch=e},enumerable:!1,configurable:!0}),i.$t=t.markType(i,"RestVirtualDataSourceDataProviderWorkerSettings",t.AsyncVirtualDataSourceDataProviderWorkerSettings.$type),i}(t.AsyncVirtualDataSourceDataProviderWorkerSettings),P=function(e){function i(){var r=e.call(this)||this;return r._worker=null,r._requests=new s,r._callback=null,r._pageLoaded=null,r._pageSizeRequested=50,r._baseUri=null,r._entitySet=null,r._timeoutMilliseconds=1e4,r.schemaChanged=null,r._currentFullCount=0,r._currentSchema=null,r._executionContext=null,r._updateNotifier=null,r._deferAutoRefresh=!1,r._sortDescriptions=null,r._groupDescriptions=null,r._propertiesRequested=null,r._filterExpressions=null,r._summaryDescriptions=null,r._enableJsonp=!0,r._fixedFullCount=-1,r._provideFullCount=null,r._provideOrderByParameter=null,r._provideFilterParameter=null,r._provideAggregationParameter=null,r._provideAggregatedCount=null,r._provideUri=null,r._performFetch=null,r._providePagingParameter=null,r._provideDesiredPropertiesParameter=null,r._schemaFetchQueued=!1,r._autoRefreshQueued=!1,r._sortDescriptions=new t.SortDescriptionCollection,r._sortDescriptions.onChanged=function(){return r.sortDescriptions_CollectionChanged(null,null)},r._groupDescriptions=new t.SortDescriptionCollection,r._groupDescriptions.onChanged=function(){return r.groupDescriptions_CollectionChanged(null,null)},r._filterExpressions=new t.FilterExpressionCollection,r._filterExpressions.onChanged=function(){return r.filterExpressions_CollectionChanged(null,null)},r._summaryDescriptions=new t.SummaryDescriptionCollection,r._summaryDescriptions.onChanged=function(){return r.summaryDescriptions_CollectionChanged(null,null)},r}return r.__extends(i,e),i.prototype.filterExpressions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.sortDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.groupDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.summaryDescriptions_CollectionChanged=function(e,t){this.queueAutoRefresh()},i.prototype.addPageRequest=function(e,r){this.deferAutoRefresh||(null!=this._worker&&this._worker.isShutdown&&(this._worker=null,this._callback=null),null==this._worker&&this.createWorker(),r==t.DataSourcePageRequestPriority.High?this._requests.addFirst(e):this._requests.addLast(e),this._worker.addPageRequest(e,r)||(this._worker=null,this._callback=null,this.addPageRequest(e,r)))},i.prototype.createWorker=function(){if(this.valid()){this._callback=t.runOn(this,this.raisePageLoaded);var e=this.getWorkerSettings();this._worker=new b(e)}},i.prototype.valid=function(){return null!=this.entitySet&&null!=this.baseUri},i.prototype.getWorkerSettings=function(){var e,t=this;return(e=new S).baseUri=t._baseUri,e.entitySet=t._entitySet,e.pageSizeRequested=t._pageSizeRequested,e.timeoutMilliseconds=t._timeoutMilliseconds,e.pageLoaded=t._callback,e.executionContext=t._executionContext,e.sortDescriptions=t._sortDescriptions,e.groupDescriptions=t._groupDescriptions,e.filterExpressions=t._filterExpressions,e.propertiesRequested=t._propertiesRequested,e.summaryDescriptions=t._summaryDescriptions,e.summaryScope=t._summaryScope,e.enableJsonp=t._enableJsonp,e.isAggregationSupported=t.isAggregationSupported,e.performFetch=t.performFetch,e.provideAggregationParameter=t.provideAggregationParameter,e.provideAggregatedCount=t.provideAggregatedCount,e.provideDesiredPropertiesParameter=t.provideDesiredPropertiesParameter,e.provideFilterParameter=t.provideFilterParameter,e.provideFullCount=t.provideFullCount,e.provideItems=t.provideItems,e.provideOrderByParameter=t.provideOrderByParameter,e.providePagingParameter=t.providePagingParameter,e.provideUri=t.provideUri,e.fixedFullCount=t.fixedFullCount,e},i.prototype.removePageRequest=function(e){for(var t=this._requests.first;null!=t;)t.value==e&&this._requests.remove(t),t=t.next;null!=this._worker&&this._worker.removePageRequest(e)},i.prototype.removeAllPageRequests=function(){this._requests.clear(),null!=this._worker&&this._worker.removeAllPageRequests()},i.prototype.close=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageLoaded",{get:function(){return this._pageLoaded},set:function(e){this._pageLoaded=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),i.prototype.raisePageLoaded=function(e,r,i){if(null!=this._pageLoaded){if(this._currentFullCount=r,null==this._currentSchema){var o=null;null!=e&&(o=e.schema()),this._currentSchema=o,null!=this.schemaChanged&&this.schemaChanged(this,new t.DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema,this._currentFullCount))}e.pageIndex()!=b.schemaRequestIndex&&this._pageLoaded(e,r,i)}},i.prototype.killWorker=function(){null!=this._worker&&(this._worker.shutdown(),this._worker=null,this._callback=null)},Object.defineProperty(i.prototype,"pageSizeRequested",{get:function(){return this._pageSizeRequested},set:function(e){this._pageSizeRequested=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,t!=this._entitySet&&(this.queueAutoRefresh(),this.valid()&&this.deferAutoRefresh&&this.queueSchemaFetch())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){this._timeoutMilliseconds=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),i.prototype.getItemValue=function(e,t){var r=e;return r.has(t)?r.get(t):null},Object.defineProperty(i.prototype,"actualCount",{get:function(){return this._currentFullCount},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"actualSchema",{get:function(){return this._currentSchema},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"executionContext",{get:function(){return this._executionContext},set:function(e){this._executionContext=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"updateNotifier",{get:function(){return this._updateNotifier},set:function(e){this._updateNotifier=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"deferAutoRefresh",{get:function(){return this._deferAutoRefresh},set:function(e){this._deferAutoRefresh=e,this._deferAutoRefresh||this.queueAutoRefresh(),this._deferAutoRefresh&&this.valid()&&null==this._currentSchema&&this.queueSchemaFetch()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isSortingSupported",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isGroupingSupported",{get:function(){return this.isAggregationSupported},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isFilteringSupported",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isAggregationSupported",{get:function(){return this._isAggregationSupported},set:function(e){this._isAggregationSupported=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortDescriptions",{get:function(){return this._sortDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"groupDescriptions",{get:function(){return this._groupDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"propertiesRequested",{get:function(){return this._propertiesRequested},set:function(e){this._propertiesRequested=e,this.queueAutoRefresh()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filterExpressions",{get:function(){return this._filterExpressions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryDescriptions",{get:function(){return this._summaryDescriptions},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"summaryScope",{get:function(){return this._summaryScope},set:function(e){this._summaryScope=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fixedFullCount",{get:function(){return this._fixedFullCount},set:function(e){this._fixedFullCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideFullCount",{get:function(){return this._provideFullCount},set:function(e){this._provideFullCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideOrderByParameter",{get:function(){return this._provideOrderByParameter},set:function(e){this._provideOrderByParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideFilterParameter",{get:function(){return this._provideFilterParameter},set:function(e){this._provideFilterParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregationParameter",{get:function(){return this._provideAggregationParameter},set:function(e){this._provideAggregationParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideAggregatedCount",{get:function(){return this._provideAggregatedCount},set:function(e){this._provideAggregatedCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideUri",{get:function(){return this._provideUri},set:function(e){this._provideUri=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"performFetch",{get:function(){return this._performFetch},set:function(e){this._performFetch=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"providePagingParameter",{get:function(){return this._providePagingParameter},set:function(e){this._providePagingParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideDesiredPropertiesParameter",{get:function(){return this._provideDesiredPropertiesParameter},set:function(e){this._provideDesiredPropertiesParameter=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"provideItems",{get:function(){return this._provideItems},set:function(e){this._provideItems=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"notifyUsingSourceIndexes",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isItemIndexLookupSupported",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isKeyIndexLookupSupported",{get:function(){return!1},enumerable:!1,configurable:!0}),i.prototype.notifySetItem=function(e,t,r){null!=this.updateNotifier&&this.updateNotifier.notifySetItem(e,t,r)},i.prototype.notifyClearItems=function(){null!=this.updateNotifier&&this.updateNotifier.notifyClearItems()},i.prototype.notifyInsertItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyInsertItem(e,t)},i.prototype.notifyRemoveItem=function(e,t){null!=this.updateNotifier&&this.updateNotifier.notifyRemoveItem(e,t)},i.prototype.queueSchemaFetch=function(){this._schemaFetchQueued||null!=this.executionContext&&(this._schemaFetchQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doSchemaFetchInternal)))},i.prototype.doSchemaFetchInternal=function(){this._schemaFetchQueued&&(this._schemaFetchQueued=!1,this.schemaFetchInternal())},i.prototype.schemaFetchInternal=function(){this.schemaFetchInternalOverride()},i.prototype.schemaFetchInternalOverride=function(){this.deferAutoRefresh&&(this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this.addSchemaRequest())},i.prototype.addSchemaRequest=function(){this._worker.addPageRequest(b.schemaRequestIndex,t.DataSourcePageRequestPriority.High)},i.prototype.queueAutoRefresh=function(){this.deferAutoRefresh||this._autoRefreshQueued||null!=this.executionContext&&(this._autoRefreshQueued=!0,this.executionContext.enqueueAction(t.runOn(this,this.doRefreshInternal)))},i.prototype.doRefreshInternal=function(){this.deferAutoRefresh?this._autoRefreshQueued=!1:this._autoRefreshQueued&&(this._autoRefreshQueued=!1,this.refreshInternal())},i.prototype.refreshInternal=function(){this.refreshInternalOverride()},i.prototype.refreshInternalOverride=function(){this.removeAllPageRequests(),this.killWorker(),this.createWorker(),this._worker.addPageRequest(0,t.DataSourcePageRequestPriority.Normal)},i.prototype.flushAutoRefresh=function(){this.doRefreshInternal()},i.prototype.refresh=function(){this.refreshInternal()},i.prototype.indexOfItem=function(e){return-1},i.prototype.indexOfKey=function(e){return-1},i.prototype.resolveSchemaPropertyType=function(e){if(null==this.actualSchema)return t.DataSourceSchemaPropertyType.ObjectValue;if(t.stringContains(e,"."))return t.DataSourceSchemaPropertyType.ObjectValue;for(var r=0;r<this.actualSchema.propertyNames.length;r++){if(this.actualSchema.propertyNames[r]==e)return this.actualSchema.propertyTypes[r]}return t.DataSourceSchemaPropertyType.ObjectValue},i.prototype.setItemValue=function(e,t,r){},i.prototype.removeItem=function(e){},i.prototype.addItem=function(e){},i.prototype.createBatchRequest=function(e){null!=this._worker&&this._worker.createBatchRequest(e)},Object.defineProperty(i.prototype,"batchCompleted",{get:function(){return this._batchCompleted},set:function(e){this._batchCompleted=e},enumerable:!1,configurable:!0}),i.$t=t.markType(i,"ODataVirtualDataSourceDataProvider",t.Base.$type,[t.IDataSourceVirtualDataProvider_$type]),i}(t.Base),D=function(e){function t(){var t,r=e.call(this)||this;return r._baseUri=null,r._isFilteringSupportedByServer=!1,r._entitySet=null,r._timeoutMilliseconds=1e4,r._isAggregationSupportedByServer=!1,r._enableJsonp=!0,r._fixedFullCount=-1,r._provideFullCount=null,r._provideOrderByParameter=null,r._provideFilterParameter=null,r._provideAggregationParameter=null,r._provideAggregatedCount=null,r._provideUri=null,r._performFetch=null,r._providePagingParameter=null,r._provideDesiredPropertiesParameter=null,r.dataProvider=((t=new P).executionContext=r.executionContext,t.enableJsonp=r.enableJsonp,t.isAggregationSupported=r.isGroupingSupported,t),r.externalDataSource=r,r}return r.__extends(t,e),t.prototype.onBaseUriChanged=function(e,t){this.actualDataProvider&&(this.actualDataProvider.baseUri=this.baseUri,this.queueAutoRefresh())},Object.defineProperty(t.prototype,"baseUri",{get:function(){return this._baseUri},set:function(e){var t=this._baseUri;this._baseUri=e,t!=this._baseUri&&this.onBaseUriChanged(t,this._baseUri)},enumerable:!1,configurable:!0}),t.prototype.onEntitySetChanged=function(e,t){this.actualDataProvider&&(this.actualDataProvider.entitySet=this.entitySet,this.queueAutoRefresh()),this.queueAutoRefresh()},Object.defineProperty(t.prototype,"isFilteringSupportedByServer",{get:function(){return this._isFilteringSupportedByServer},set:function(e){this._isFilteringSupportedByServer=e},enumerable:!1,configurable:!0}),t.prototype.get_isFilteringSupported=function(){return!!this._isFilteringSupportedByServer},Object.defineProperty(t.prototype,"entitySet",{get:function(){return this._entitySet},set:function(e){var t=this._entitySet;this._entitySet=e,this._entitySet!=t&&this.onEntitySetChanged(t,this._entitySet)},enumerable:!1,configurable:!0}),t.prototype.onTimeoutMillisecondsChanged=function(e,t){this.actualDataProvider&&(this.actualDataProvider.timeoutMilliseconds=this.timeoutMilliseconds)},Object.defineProperty(t.prototype,"timeoutMilliseconds",{get:function(){return this._timeoutMilliseconds},set:function(e){var t=this._timeoutMilliseconds;this._timeoutMilliseconds=e,t!=this._timeoutMilliseconds&&this.onTimeoutMillisecondsChanged(t,this._timeoutMilliseconds)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSortingSupportedOverride",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilteringSupportedOverride",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGroupingSupportedOverride",{get:function(){return this.isAggregationSupportedByServer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAggregationSupportedByServer",{get:function(){return this._isAggregationSupportedByServer},set:function(e){this._isAggregationSupportedByServer=e,this.actualDataProvider&&(this.actualDataProvider.isAggregationSupported=this.isAggregationSupportedByServer)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableJsonp",{get:function(){return this._enableJsonp},set:function(e){this._enableJsonp=e,this.actualDataProvider&&(this.actualDataProvider.enableJsonp=this.enableJsonp)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fixedFullCount",{get:function(){return this._fixedFullCount},set:function(e){this._fixedFullCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideFullCount",{get:function(){return this._provideFullCount},set:function(e){this._provideFullCount=e,this.actualDataProvider&&(this.actualDataProvider.provideFullCount=this.provideFullCount,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideOrderByParameter",{get:function(){return this._provideOrderByParameter},set:function(e){this._provideOrderByParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideOrderByParameter=this.provideOrderByParameter,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideFilterParameter",{get:function(){return this._provideFilterParameter},set:function(e){this._provideFilterParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideFilterParameter=this.provideFilterParameter,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideAggregationParameter",{get:function(){return this._provideAggregationParameter},set:function(e){this._provideAggregationParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideAggregationParameter=this.provideAggregationParameter,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideAggregatedCount",{get:function(){return this._provideAggregatedCount},set:function(e){this._provideAggregatedCount=e,this.actualDataProvider&&(this.actualDataProvider.provideAggregatedCount=this.provideAggregatedCount,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideUri",{get:function(){return this._provideUri},set:function(e){this._provideUri=e,this.actualDataProvider&&(this.actualDataProvider.provideUri=this.provideUri,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"performFetch",{get:function(){return this._performFetch},set:function(e){this._performFetch=e,this.actualDataProvider&&(this.actualDataProvider.performFetch=this.performFetch,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"providePagingParameter",{get:function(){return this._providePagingParameter},set:function(e){this._providePagingParameter=e,this.actualDataProvider&&(this.actualDataProvider.providePagingParameter=this.providePagingParameter,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideDesiredPropertiesParameter",{get:function(){return this._provideDesiredPropertiesParameter},set:function(e){this._provideDesiredPropertiesParameter=e,this.actualDataProvider&&(this.actualDataProvider.provideDesiredPropertiesParameter=this.provideDesiredPropertiesParameter,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"provideItems",{get:function(){return this._provideItems},set:function(e){this._provideItems=e,this.actualDataProvider&&(this.actualDataProvider.provideItems=this.provideItems,this.queueAutoRefresh())},enumerable:!1,configurable:!0}),t.prototype.clone=function(){var e=new t;e.executionContext=this.executionContext,e.includeSummaryRowsInSection=this.includeSummaryRowsInSection,e.isSectionCollapsable=this.isSectionCollapsable,e.isSectionExpandedDefault=this.isSectionExpandedDefault,e.isSectionSummaryRowsAtBottom=this.isSectionSummaryRowsAtBottom,e.primaryKey=this.primaryKey,e.propertiesRequested=this.propertiesRequested,e.sectionHeaderDisplayMode=this.sectionHeaderDisplayMode,e.shouldEmitSectionFooters=this.shouldEmitSectionFooters,e.shouldEmitSectionHeaders=this.shouldEmitSectionHeaders,e.shouldEmitShiftedRows=this.shouldEmitShiftedRows,e.summaryScope=this.summaryScope;for(var r=0;r<this.groupDescriptions.size();r++)e.groupDescriptions.add(this.groupDescriptions.get(r));for(r=0;r<this.sortDescriptions.size();r++)e.sortDescriptions.add(this.sortDescriptions.get(r));for(r=0;r<this.filterExpressions.size();r++)e.filterExpressions.add(this.filterExpressions.get(r));for(r=0;r<this.summaryDescriptions.size();r++)e.summaryDescriptions.add(this.summaryDescriptions.get(r));return e.pageSizeRequested=this.pageSizeRequested,e.maxCachedPages=this.maxCachedPages,e.baseUri=this.baseUri,e.entitySet=this.entitySet,e.timeoutMilliseconds=this.timeoutMilliseconds,e.isAggregationSupportedByServer=this.isAggregationSupportedByServer,e.enableJsonp=this.enableJsonp,e.fixedFullCount=this.fixedFullCount,e.provideAggregationParameter=this.provideAggregationParameter,e.provideAggregatedCount=this.provideAggregatedCount,e.provideFilterParameter=this.provideFilterParameter,e.provideFullCount=this.provideFullCount,e.provideOrderByParameter=this.provideOrderByParameter,e.provideUri=this.provideUri,e.performFetch=this.performFetch,e.providePagingParameter=this.providePagingParameter,e.provideItems=this.provideItems,e.provideDesiredPropertiesParameter=this.provideDesiredPropertiesParameter,e},t}(t.VirtualDataSource);e.Entity=u,e.EntityProperty=i,e.EntitySet=p,e.LinkedList=s,e.LinkedListNode=a,e.ODataDataSourcePage=l,e.ODataSchemaProvider=h,e.ODataVirtualDataSource=g,e.ODataVirtualDataSourceDataProvider=y,e.ODataVirtualDataSourceDataProviderWorker=d,e.ODataVirtualDataSourceDataProviderWorkerSettings=m,e.ODataVirtualDataSourceProviderTaskDataHolder=f,e.RestVirtualDataSource=D,e.RestVirtualDataSourceDataProvider=P,e.RestVirtualDataSourceDataProviderWorker=b,e.RestVirtualDataSourceDataProviderWorkerSettings=S,e.RestVirtualDataSourcePage=v,e.RestVirtualDataSourceProviderTaskDataHolder=_,e.Schema=c,e.first=n,e.toArray=o,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -16,43 +16,6 @@ import { DefaultSummaryResult } from "igniteui-webcomponents-core";
|
|
|
16
16
|
import { TransactionType } from "igniteui-webcomponents-core";
|
|
17
17
|
export let ODataVirtualDataSourceDataProviderWorker = /*@__PURE__*/ (() => {
|
|
18
18
|
class ODataVirtualDataSourceDataProviderWorker extends AsyncVirtualDataSourceProviderWorker {
|
|
19
|
-
constructor(settings) {
|
|
20
|
-
super(settings);
|
|
21
|
-
this._baseUri = null;
|
|
22
|
-
this._entitySet = null;
|
|
23
|
-
this._sortDescriptions = null;
|
|
24
|
-
this._groupDescriptions = null;
|
|
25
|
-
this._filterExpressions = null;
|
|
26
|
-
this._summaryDescriptions = null;
|
|
27
|
-
this._desiredPropeties = null;
|
|
28
|
-
this._enableJsonp = true;
|
|
29
|
-
this._isAggregationSupported = false;
|
|
30
|
-
this._groupInformation = null;
|
|
31
|
-
this._summaryInformation = null;
|
|
32
|
-
this._filterString = null;
|
|
33
|
-
this._selectedString = null;
|
|
34
|
-
this.doWork = this.doWork.bind(this);
|
|
35
|
-
this._baseUri = settings.baseUri;
|
|
36
|
-
this._entitySet = settings.entitySet;
|
|
37
|
-
this._sortDescriptions = settings.sortDescriptions;
|
|
38
|
-
this._groupDescriptions = settings.groupDescriptions;
|
|
39
|
-
if (this._groupDescriptions != null && this._groupDescriptions.size() > 0) {
|
|
40
|
-
this._sortDescriptions = new SortDescriptionCollection();
|
|
41
|
-
for (let sd of this.iter(settings.sortDescriptions)) {
|
|
42
|
-
this._sortDescriptions.add(sd);
|
|
43
|
-
}
|
|
44
|
-
for (let i = 0; i < this._groupDescriptions.size(); i++) {
|
|
45
|
-
this._sortDescriptions.insert(i, this._groupDescriptions.get(i));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
this._filterExpressions = settings.filterExpressions;
|
|
49
|
-
this._desiredPropeties = settings.propertiesRequested;
|
|
50
|
-
this._summaryDescriptions = settings.summaryDescriptions;
|
|
51
|
-
this._summaryScope = settings.summaryScope;
|
|
52
|
-
this._enableJsonp = settings.enableJsonp;
|
|
53
|
-
this._isAggregationSupported = settings.isAggregationSupported;
|
|
54
|
-
window.setTimeout(this.doWork, 100);
|
|
55
|
-
}
|
|
56
19
|
get sortDescriptions() {
|
|
57
20
|
return this._sortDescriptions;
|
|
58
21
|
}
|
|
@@ -93,6 +56,43 @@ export let ODataVirtualDataSourceDataProviderWorker = /*@__PURE__*/ (() => {
|
|
|
93
56
|
yield summaries.get(i);
|
|
94
57
|
}
|
|
95
58
|
}
|
|
59
|
+
constructor(settings) {
|
|
60
|
+
super(settings);
|
|
61
|
+
this._baseUri = null;
|
|
62
|
+
this._entitySet = null;
|
|
63
|
+
this._sortDescriptions = null;
|
|
64
|
+
this._groupDescriptions = null;
|
|
65
|
+
this._filterExpressions = null;
|
|
66
|
+
this._summaryDescriptions = null;
|
|
67
|
+
this._desiredPropeties = null;
|
|
68
|
+
this._enableJsonp = true;
|
|
69
|
+
this._isAggregationSupported = false;
|
|
70
|
+
this._groupInformation = null;
|
|
71
|
+
this._summaryInformation = null;
|
|
72
|
+
this._filterString = null;
|
|
73
|
+
this._selectedString = null;
|
|
74
|
+
this.doWork = this.doWork.bind(this);
|
|
75
|
+
this._baseUri = settings.baseUri;
|
|
76
|
+
this._entitySet = settings.entitySet;
|
|
77
|
+
this._sortDescriptions = settings.sortDescriptions;
|
|
78
|
+
this._groupDescriptions = settings.groupDescriptions;
|
|
79
|
+
if (this._groupDescriptions != null && this._groupDescriptions.size() > 0) {
|
|
80
|
+
this._sortDescriptions = new SortDescriptionCollection();
|
|
81
|
+
for (let sd of this.iter(settings.sortDescriptions)) {
|
|
82
|
+
this._sortDescriptions.add(sd);
|
|
83
|
+
}
|
|
84
|
+
for (let i = 0; i < this._groupDescriptions.size(); i++) {
|
|
85
|
+
this._sortDescriptions.insert(i, this._groupDescriptions.get(i));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
this._filterExpressions = settings.filterExpressions;
|
|
89
|
+
this._desiredPropeties = settings.propertiesRequested;
|
|
90
|
+
this._summaryDescriptions = settings.summaryDescriptions;
|
|
91
|
+
this._summaryScope = settings.summaryScope;
|
|
92
|
+
this._enableJsonp = settings.enableJsonp;
|
|
93
|
+
this._isAggregationSupported = settings.isAggregationSupported;
|
|
94
|
+
window.setTimeout(this.doWork, 100);
|
|
95
|
+
}
|
|
96
96
|
processCompletedTask(completedTask, currentDelay, pageIndex, taskDataHolder) {
|
|
97
97
|
let h = taskDataHolder;
|
|
98
98
|
let schema = null;
|
|
@@ -15,6 +15,46 @@ import { DefaultSummaryResult } from "igniteui-webcomponents-core";
|
|
|
15
15
|
import { LocalDataSource } from "igniteui-webcomponents-core";
|
|
16
16
|
export let RestVirtualDataSourceDataProviderWorker = /*@__PURE__*/ (() => {
|
|
17
17
|
class RestVirtualDataSourceDataProviderWorker extends AsyncVirtualDataSourceProviderWorker {
|
|
18
|
+
get sortDescriptions() {
|
|
19
|
+
return this._sortDescriptions;
|
|
20
|
+
}
|
|
21
|
+
get filterExpressions() {
|
|
22
|
+
return this._filterExpressions;
|
|
23
|
+
}
|
|
24
|
+
get desiredProperties() {
|
|
25
|
+
return this._desiredPropeties;
|
|
26
|
+
}
|
|
27
|
+
initialize() {
|
|
28
|
+
super.initialize();
|
|
29
|
+
}
|
|
30
|
+
getTaskDataHolder() {
|
|
31
|
+
let holder = new RestVirtualDataSourceProviderTaskDataHolder();
|
|
32
|
+
return holder;
|
|
33
|
+
}
|
|
34
|
+
getCompletedTaskData(holder, completed) {
|
|
35
|
+
super.getCompletedTaskData(holder, completed);
|
|
36
|
+
}
|
|
37
|
+
removeCompletedTaskData(holder, completed) {
|
|
38
|
+
super.removeCompletedTaskData(holder, completed);
|
|
39
|
+
}
|
|
40
|
+
getTasksData(holder) {
|
|
41
|
+
super.getTasksData(holder);
|
|
42
|
+
}
|
|
43
|
+
*iter(coll) {
|
|
44
|
+
for (let i = 0; i < coll.size(); i++) {
|
|
45
|
+
yield coll.get(i);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
*iterFilter(coll) {
|
|
49
|
+
for (let i = 0; i < coll.size(); i++) {
|
|
50
|
+
yield coll.get(i);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
*iterSummaries(summaries) {
|
|
54
|
+
for (let i = 0; i < summaries.size(); i++) {
|
|
55
|
+
yield summaries.get(i);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
18
58
|
constructor(settings) {
|
|
19
59
|
super(settings);
|
|
20
60
|
this._baseUri = null;
|
|
@@ -122,46 +162,6 @@ export let RestVirtualDataSourceDataProviderWorker = /*@__PURE__*/ (() => {
|
|
|
122
162
|
this._isAggregationSupported = settings.isAggregationSupported;
|
|
123
163
|
window.setTimeout(this.doWork, 100);
|
|
124
164
|
}
|
|
125
|
-
get sortDescriptions() {
|
|
126
|
-
return this._sortDescriptions;
|
|
127
|
-
}
|
|
128
|
-
get filterExpressions() {
|
|
129
|
-
return this._filterExpressions;
|
|
130
|
-
}
|
|
131
|
-
get desiredProperties() {
|
|
132
|
-
return this._desiredPropeties;
|
|
133
|
-
}
|
|
134
|
-
initialize() {
|
|
135
|
-
super.initialize();
|
|
136
|
-
}
|
|
137
|
-
getTaskDataHolder() {
|
|
138
|
-
let holder = new RestVirtualDataSourceProviderTaskDataHolder();
|
|
139
|
-
return holder;
|
|
140
|
-
}
|
|
141
|
-
getCompletedTaskData(holder, completed) {
|
|
142
|
-
super.getCompletedTaskData(holder, completed);
|
|
143
|
-
}
|
|
144
|
-
removeCompletedTaskData(holder, completed) {
|
|
145
|
-
super.removeCompletedTaskData(holder, completed);
|
|
146
|
-
}
|
|
147
|
-
getTasksData(holder) {
|
|
148
|
-
super.getTasksData(holder);
|
|
149
|
-
}
|
|
150
|
-
*iter(coll) {
|
|
151
|
-
for (let i = 0; i < coll.size(); i++) {
|
|
152
|
-
yield coll.get(i);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
*iterFilter(coll) {
|
|
156
|
-
for (let i = 0; i < coll.size(); i++) {
|
|
157
|
-
yield coll.get(i);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
*iterSummaries(summaries) {
|
|
161
|
-
for (let i = 0; i < summaries.size(); i++) {
|
|
162
|
-
yield summaries.get(i);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
165
|
processCompletedTask(completedTask, currentDelay, pageIndex, taskDataHolder) {
|
|
166
166
|
let h = taskDataHolder;
|
|
167
167
|
let schema = null;
|
package/esm2015/lib/util.js
CHANGED
|
@@ -90,11 +90,6 @@ export class LinkedList {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
export class LinkedListNode {
|
|
93
|
-
constructor(item) {
|
|
94
|
-
if (item !== undefined) {
|
|
95
|
-
this.value = item;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
93
|
get value() {
|
|
99
94
|
return this._value;
|
|
100
95
|
}
|
|
@@ -113,4 +108,9 @@ export class LinkedListNode {
|
|
|
113
108
|
set next(value) {
|
|
114
109
|
this._next = value;
|
|
115
110
|
}
|
|
111
|
+
constructor(item) {
|
|
112
|
+
if (item !== undefined) {
|
|
113
|
+
this.value = item;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
116
|
}
|