@ngrx/data 11.0.0-rc.0 → 11.1.1
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/ngrx-data.umd.js +902 -4475
- package/bundles/ngrx-data.umd.js.map +1 -1
- package/bundles/ngrx-data.umd.min.js +15 -1
- package/bundles/ngrx-data.umd.min.js.map +1 -1
- package/esm2015/index.js +2 -7
- package/esm2015/ngrx-data.js +2 -7
- package/esm2015/public_api.js +2 -7
- package/esm2015/src/actions/entity-action-factory.js +6 -31
- package/esm2015/src/actions/entity-action-guard.js +23 -130
- package/esm2015/src/actions/entity-action-operators.js +11 -64
- package/esm2015/src/actions/entity-action.js +2 -68
- package/esm2015/src/actions/entity-cache-action.js +14 -125
- package/esm2015/src/actions/entity-cache-change-set.js +15 -126
- package/esm2015/src/actions/entity-op.js +70 -89
- package/esm2015/src/actions/merge-strategy.js +8 -16
- package/esm2015/src/actions/update-response-data.js +2 -36
- package/esm2015/src/dataservices/data-service-error.js +1 -34
- package/esm2015/src/dataservices/default-data-service-config.js +1 -41
- package/esm2015/src/dataservices/default-data.service.js +5 -163
- package/esm2015/src/dataservices/entity-cache-data.service.js +17 -103
- package/esm2015/src/dataservices/entity-data.service.js +5 -31
- package/esm2015/src/dataservices/http-url-generator.js +11 -97
- package/esm2015/src/dataservices/interfaces.js +2 -71
- package/esm2015/src/dataservices/persistence-result-handler.service.js +7 -66
- package/esm2015/src/dispatchers/entity-cache-dispatcher.js +40 -97
- package/esm2015/src/dispatchers/entity-commands.js +2 -247
- package/esm2015/src/dispatchers/entity-dispatcher-base.js +65 -287
- package/esm2015/src/dispatchers/entity-dispatcher-default-options.js +6 -48
- package/esm2015/src/dispatchers/entity-dispatcher-factory.js +2 -64
- package/esm2015/src/dispatchers/entity-dispatcher.js +1 -74
- package/esm2015/src/effects/entity-cache-effects.js +21 -135
- package/esm2015/src/effects/entity-effects-scheduler.js +2 -10
- package/esm2015/src/effects/entity-effects.js +18 -128
- package/esm2015/src/entity-data-without-effects.module.js +7 -79
- package/esm2015/src/entity-data.module.js +3 -25
- package/esm2015/src/entity-metadata/entity-definition.js +2 -42
- package/esm2015/src/entity-metadata/entity-definition.service.js +14 -52
- package/esm2015/src/entity-metadata/entity-filters.js +5 -33
- package/esm2015/src/entity-metadata/entity-metadata.js +1 -34
- package/esm2015/src/entity-services/entity-collection-service-base.js +56 -208
- package/esm2015/src/entity-services/entity-collection-service-elements-factory.js +3 -60
- package/esm2015/src/entity-services/entity-collection-service-factory.js +5 -20
- package/esm2015/src/entity-services/entity-collection-service.js +2 -53
- package/esm2015/src/entity-services/entity-services-base.js +18 -78
- package/esm2015/src/entity-services/entity-services-elements.js +9 -44
- package/esm2015/src/entity-services/entity-services.js +1 -70
- package/esm2015/src/index.js +1 -6
- package/esm2015/src/reducers/constants.js +1 -11
- package/esm2015/src/reducers/entity-cache-reducer.js +33 -175
- package/esm2015/src/reducers/entity-cache.js +2 -10
- package/esm2015/src/reducers/entity-change-tracker-base.js +115 -262
- package/esm2015/src/reducers/entity-change-tracker.js +2 -179
- package/esm2015/src/reducers/entity-collection-creator.js +5 -29
- package/esm2015/src/reducers/entity-collection-reducer-methods.js +44 -503
- package/esm2015/src/reducers/entity-collection-reducer-registry.js +8 -50
- package/esm2015/src/reducers/entity-collection-reducer.js +5 -34
- package/esm2015/src/reducers/entity-collection.js +9 -65
- package/esm2015/src/selectors/entity-cache-selector.js +1 -12
- package/esm2015/src/selectors/entity-selectors$.js +11 -137
- package/esm2015/src/selectors/entity-selectors.js +23 -262
- package/esm2015/src/utils/correlation-id-generator.js +4 -30
- package/esm2015/src/utils/default-logger.js +1 -21
- package/esm2015/src/utils/default-pluralizer.js +3 -24
- package/esm2015/src/utils/guid-fns.js +9 -41
- package/esm2015/src/utils/interfaces.js +1 -49
- package/esm2015/src/utils/utilities.js +6 -25
- package/fesm2015/ngrx-data.js +721 -4410
- package/fesm2015/ngrx-data.js.map +1 -1
- package/package.json +5 -5
- package/schematics-core/index.js +4 -1
- package/schematics-core/index.js.map +1 -1
- package/schematics-core/utility/ast-utils.js +127 -1
- package/schematics-core/utility/ast-utils.js.map +1 -1
- package/schematics-core/utility/config.js +1 -1
- package/schematics-core/utility/config.js.map +1 -1
- package/schematics-core/utility/find-component.js +101 -0
- package/schematics-core/utility/find-component.js.map +1 -0
- package/schematics-core/utility/libs-version.js +1 -1
- package/schematics-core/utility/libs-version.js.map +1 -1
- package/schematics-core/utility/project.js +4 -2
- package/schematics-core/utility/project.js.map +1 -1
- package/CHANGELOG.md +0 -3
- package/esm2015/index.ngsummary.json +0 -1
- package/esm2015/ngrx-data.ngsummary.json +0 -1
- package/esm2015/public_api.ngsummary.json +0 -1
- package/esm2015/src/actions/entity-action-factory.ngsummary.json +0 -1
- package/esm2015/src/actions/entity-action-guard.ngsummary.json +0 -1
- package/esm2015/src/actions/entity-action-operators.ngsummary.json +0 -1
- package/esm2015/src/actions/entity-action.ngsummary.json +0 -1
- package/esm2015/src/actions/entity-cache-action.ngsummary.json +0 -1
- package/esm2015/src/actions/entity-cache-change-set.ngsummary.json +0 -1
- package/esm2015/src/actions/entity-op.ngsummary.json +0 -1
- package/esm2015/src/actions/merge-strategy.ngsummary.json +0 -1
- package/esm2015/src/actions/update-response-data.ngsummary.json +0 -1
- package/esm2015/src/dataservices/data-service-error.ngsummary.json +0 -1
- package/esm2015/src/dataservices/default-data-service-config.ngsummary.json +0 -1
- package/esm2015/src/dataservices/default-data.service.ngsummary.json +0 -1
- package/esm2015/src/dataservices/entity-cache-data.service.ngsummary.json +0 -1
- package/esm2015/src/dataservices/entity-data.service.ngsummary.json +0 -1
- package/esm2015/src/dataservices/http-url-generator.ngsummary.json +0 -1
- package/esm2015/src/dataservices/interfaces.ngsummary.json +0 -1
- package/esm2015/src/dataservices/persistence-result-handler.service.ngsummary.json +0 -1
- package/esm2015/src/dispatchers/entity-cache-dispatcher.ngsummary.json +0 -1
- package/esm2015/src/dispatchers/entity-commands.ngsummary.json +0 -1
- package/esm2015/src/dispatchers/entity-dispatcher-base.ngsummary.json +0 -1
- package/esm2015/src/dispatchers/entity-dispatcher-default-options.ngsummary.json +0 -1
- package/esm2015/src/dispatchers/entity-dispatcher-factory.ngsummary.json +0 -1
- package/esm2015/src/dispatchers/entity-dispatcher.ngsummary.json +0 -1
- package/esm2015/src/effects/entity-cache-effects.ngsummary.json +0 -1
- package/esm2015/src/effects/entity-effects-scheduler.ngsummary.json +0 -1
- package/esm2015/src/effects/entity-effects.ngsummary.json +0 -1
- package/esm2015/src/entity-data-without-effects.module.ngfactory.js +0 -36
- package/esm2015/src/entity-data-without-effects.module.ngsummary.json +0 -1
- package/esm2015/src/entity-data.module.ngfactory.js +0 -48
- package/esm2015/src/entity-data.module.ngsummary.json +0 -1
- package/esm2015/src/entity-metadata/entity-definition.ngsummary.json +0 -1
- package/esm2015/src/entity-metadata/entity-definition.service.ngsummary.json +0 -1
- package/esm2015/src/entity-metadata/entity-filters.ngsummary.json +0 -1
- package/esm2015/src/entity-metadata/entity-metadata.ngsummary.json +0 -1
- package/esm2015/src/entity-services/entity-collection-service-base.ngsummary.json +0 -1
- package/esm2015/src/entity-services/entity-collection-service-elements-factory.ngsummary.json +0 -1
- package/esm2015/src/entity-services/entity-collection-service-factory.ngsummary.json +0 -1
- package/esm2015/src/entity-services/entity-collection-service.ngsummary.json +0 -1
- package/esm2015/src/entity-services/entity-services-base.ngsummary.json +0 -1
- package/esm2015/src/entity-services/entity-services-elements.ngsummary.json +0 -1
- package/esm2015/src/entity-services/entity-services.ngsummary.json +0 -1
- package/esm2015/src/index.ngsummary.json +0 -1
- package/esm2015/src/reducers/constants.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-cache-reducer.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-cache.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-change-tracker-base.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-change-tracker.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-collection-creator.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-collection-reducer-methods.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-collection-reducer-registry.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-collection-reducer.ngsummary.json +0 -1
- package/esm2015/src/reducers/entity-collection.ngsummary.json +0 -1
- package/esm2015/src/selectors/entity-cache-selector.ngsummary.json +0 -1
- package/esm2015/src/selectors/entity-selectors$.ngsummary.json +0 -1
- package/esm2015/src/selectors/entity-selectors.ngsummary.json +0 -1
- package/esm2015/src/utils/correlation-id-generator.ngsummary.json +0 -1
- package/esm2015/src/utils/default-logger.ngsummary.json +0 -1
- package/esm2015/src/utils/default-pluralizer.ngsummary.json +0 -1
- package/esm2015/src/utils/guid-fns.ngsummary.json +0 -1
- package/esm2015/src/utils/interfaces.ngsummary.json +0 -1
- package/esm2015/src/utils/utilities.ngsummary.json +0 -1
- package/schematics/ng-add/files/entity-metadata.ts.template +0 -10
- package/src/entity-data-without-effects.module.ngfactory.d.ts +0 -3
- package/src/entity-data.module.ngfactory.d.ts +0 -3
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs/operators"),require("@angular/common/http"),require("rxjs"),require("@ngrx/entity"),require("@ngrx/store"),require("@ngrx/effects")):"function"==typeof define&&define.amd?define("@ngrx/data",["exports","@angular/core","rxjs/operators","@angular/common/http","rxjs","@ngrx/entity","@ngrx/store","@ngrx/effects"],e):e(((t=t||self).ngrx=t.ngrx||{},t.ngrx.data={}),t.ng.core,t.rxjs.operators,t.ng.common.http,t.rxjs,t.ngrx.entity,t.ngrx.store,t.ngrx.effects)}(this,(function(t,e,r,n,i,a,s,o){"use strict";var c=function(){function t(){}return t.prototype.create=function(t,e,r,n){var i="string"==typeof t?Object.assign(Object.assign({},n||{}),{entityName:t,entityOp:e,data:r}):t;return this.createCore(i)},t.prototype.createCore=function(t){var e=t.entityName,r=t.entityOp,n=t.tag;if(!e)throw new Error("Missing entity name for new action");if(null==r)throw new Error("Missing EntityOp for new action");return{type:this.formatActionType(r,n||e),payload:t}},t.prototype.createFromAction=function(t,e){return this.create(Object.assign(Object.assign({},t.payload),e))},t.prototype.formatActionType=function(t,e){return"["+e+"] "+t},t}();c.decorators=[{type:e.Injectable}];var u=function(){function t(t,e){this.entityName=t,this.selectId=e}return t.prototype.mustBeEntity=function(t){var e=this.extractData(t);if(!e)return this.throwError(t,"should have a single entity.");var r=this.selectId(e);return this.isNotKeyType(r)&&this.throwError(t,"has a missing or invalid entity key (id)"),e},t.prototype.mustBeEntities=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){var i=e.selectId(r);if(e.isNotKeyType(i)){var a=", item "+(n+1)+", does not have a valid entity key (id)";e.throwError(t,a)}})),r):this.throwError(t,"should be an array of entities")},t.prototype.mustBeKey=function(t){var e=this.extractData(t);if(!e)throw new Error("should be a single entity key");if(this.isNotKeyType(e))throw new Error("is not a valid key (id)");return e},t.prototype.mustBeKeys=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){if(e.isNotKeyType(r)){var i=e.entityName+" ', item "+(n+1)+", is not a valid entity key (id)";e.throwError(t,i)}})),r):this.throwError(t,"should be an array of entity keys (id)")},t.prototype.mustBeUpdate=function(t){var e=this.extractData(t);if(!e)return this.throwError(t,"should be a single entity update");var r=e.id,n=e.changes,i=this.selectId(n);return(this.isNotKeyType(r)||this.isNotKeyType(i))&&this.throwError(t,"has a missing or invalid entity key (id)"),e},t.prototype.mustBeUpdates=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){var i=r.id,a=r.changes,s=e.selectId(a);(e.isNotKeyType(i)||e.isNotKeyType(s))&&e.throwError(t,", item "+(n+1)+", has a missing or invalid entity key (id)")})),r):this.throwError(t,"should be an array of entity updates")},t.prototype.mustBeUpdateResponse=function(t){var e=this.extractData(t);if(!e)return this.throwError(t,"should be a single entity update");var r=e.id,n=e.changes,i=this.selectId(n);return(this.isNotKeyType(r)||this.isNotKeyType(i))&&this.throwError(t,"has a missing or invalid entity key (id)"),e},t.prototype.mustBeUpdateResponses=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){var i=r.id,a=r.changes,s=e.selectId(a);(e.isNotKeyType(i)||e.isNotKeyType(s))&&e.throwError(t,", item "+(n+1)+", has a missing or invalid entity key (id)")})),r):this.throwError(t,"should be an array of entity updates")},t.prototype.extractData=function(t){return t.payload&&t.payload.data},t.prototype.isNotKeyType=function(t){return"string"!=typeof t&&"number"!=typeof t},t.prototype.throwError=function(t,e){throw new Error(this.entityName+' EntityAction guard for "'+t.type+'": payload '+e)},t}();Object.create;function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s}Object.create;function h(t){return null==t?void 0:t.id}function y(t){if(null==t)return[];if(Array.isArray(t[0])){var e=p(t);t=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}(e[0],e.slice(1))}return t}function d(t){return t=t||h,function(e){var r=t(e);if(null==r)throw new Error("Primary key may not be null/undefined.");return e&&{id:r,changes:e}}}function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=y(t);switch(n.length){case 0:return r.filter((function(t){return t.payload&&null!=t.payload.entityOp}));case 1:var i=n[0];return r.filter((function(t){return t.payload&&i===t.payload.entityOp}));default:return r.filter((function(t){var e=t.payload&&t.payload.entityOp;return e&&n.some((function(t){return t===e}))}))}}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=y(t);switch(n.length){case 0:return r.filter((function(t){return t.payload&&null!=t.payload.entityName}));case 1:var i=n[0];return r.filter((function(t){return t.payload&&i===t.payload.entityName}));default:return r.filter((function(t){var e=t.payload&&t.payload.entityName;return!!e&&n.some((function(t){return t===e}))}))}}var E={Add:"Add",Delete:"Delete",Update:"Update",Upsert:"Upsert"};var f=function(){function t(){}return t.prototype.add=function(t,e){return e=Array.isArray(e)?e:e?[e]:[],{entityName:t,op:E.Add,entities:e}},t.prototype.delete=function(t,e){var r=Array.isArray(e)?e:e?[e]:[];return{entityName:t,op:E.Delete,entities:r}},t.prototype.update=function(t,e){return e=Array.isArray(e)?e:e?[e]:[],{entityName:t,op:E.Update,entities:e}},t.prototype.upsert=function(t,e){return e=Array.isArray(e)?e:e?[e]:[],{entityName:t,op:E.Upsert,entities:e}},t}(),v=new f;function S(t){var e=(t=t&&t.changes?t:{changes:[]}).changes.filter((function(t){return null!=t&&t.entities&&t.entities.length>0}));return Object.assign(Object.assign({},t),{changes:e})}var O={IgnoreChanges:0,PreserveChanges:1,OverwriteChanges:2};O[O.IgnoreChanges]="IgnoreChanges",O[O.PreserveChanges]="PreserveChanges",O[O.OverwriteChanges]="OverwriteChanges";var m={CLEAR_COLLECTIONS:"@ngrx/data/entity-cache/clear-collections",LOAD_COLLECTIONS:"@ngrx/data/entity-cache/load-collections",MERGE_QUERY_SET:"@ngrx/data/entity-cache/merge-query-set",SET_ENTITY_CACHE:"@ngrx/data/entity-cache/set-cache",SAVE_ENTITIES:"@ngrx/data/entity-cache/save-entities",SAVE_ENTITIES_CANCEL:"@ngrx/data/entity-cache/save-entities-cancel",SAVE_ENTITIES_CANCELED:"@ngrx/data/entity-cache/save-entities-canceled",SAVE_ENTITIES_ERROR:"@ngrx/data/entity-cache/save-entities-error",SAVE_ENTITIES_SUCCESS:"@ngrx/data/entity-cache/save-entities-success"};var A=function(t,e){this.type=m.CLEAR_COLLECTIONS,this.payload={collections:t,tag:e}};var C=function(t,e){this.type=m.LOAD_COLLECTIONS,this.payload={collections:t,tag:e}};var _=function(t,e,r){this.type=m.MERGE_QUERY_SET,this.payload={querySet:t,mergeStrategy:null===e?O.PreserveChanges:e,tag:r}};var D=function(t,e){this.cache=t,this.type=m.SET_ENTITY_CACHE,this.payload={cache:t,tag:e}};var T=function(t,e,r){this.type=m.SAVE_ENTITIES,r=r||{},t&&(t.tag=t.tag||r.tag),this.payload=Object.assign(Object.assign({changeSet:t,url:e},r),{tag:t.tag})};var R=function(t,e,r,n){this.type=m.SAVE_ENTITIES_CANCEL,this.payload={correlationId:t,reason:e,entityNames:r,tag:n}};var N=function(t,e,r){this.type=m.SAVE_ENTITIES_CANCEL,this.payload={correlationId:t,reason:e,tag:r}};var b=function(t,e){this.type=m.SAVE_ENTITIES_ERROR;var r=e.payload.correlationId;this.payload={error:t,originalAction:e,correlationId:r}};var M=function(t,e,r){this.type=m.SAVE_ENTITIES_SUCCESS,r=r||{},t&&(t.tag=t.tag||r.tag),this.payload=Object.assign(Object.assign({changeSet:t,url:e},r),{tag:t.tag})};var U={CANCEL_PERSIST:"@ngrx/data/cancel-persist",CANCELED_PERSIST:"@ngrx/data/canceled-persist",QUERY_ALL:"@ngrx/data/query-all",QUERY_ALL_SUCCESS:"@ngrx/data/query-all/success",QUERY_ALL_ERROR:"@ngrx/data/query-all/error",QUERY_LOAD:"@ngrx/data/query-load",QUERY_LOAD_SUCCESS:"@ngrx/data/query-load/success",QUERY_LOAD_ERROR:"@ngrx/data/query-load/error",QUERY_MANY:"@ngrx/data/query-many",QUERY_MANY_SUCCESS:"@ngrx/data/query-many/success",QUERY_MANY_ERROR:"@ngrx/data/query-many/error",QUERY_BY_KEY:"@ngrx/data/query-by-key",QUERY_BY_KEY_SUCCESS:"@ngrx/data/query-by-key/success",QUERY_BY_KEY_ERROR:"@ngrx/data/query-by-key/error",SAVE_ADD_MANY:"@ngrx/data/save/add-many",SAVE_ADD_MANY_ERROR:"@ngrx/data/save/add-many/error",SAVE_ADD_MANY_SUCCESS:"@ngrx/data/save/add-many/success",SAVE_ADD_ONE:"@ngrx/data/save/add-one",SAVE_ADD_ONE_ERROR:"@ngrx/data/save/add-one/error",SAVE_ADD_ONE_SUCCESS:"@ngrx/data/save/add-one/success",SAVE_DELETE_MANY:"@ngrx/data/save/delete-many",SAVE_DELETE_MANY_SUCCESS:"@ngrx/data/save/delete-many/success",SAVE_DELETE_MANY_ERROR:"@ngrx/data/save/delete-many/error",SAVE_DELETE_ONE:"@ngrx/data/save/delete-one",SAVE_DELETE_ONE_SUCCESS:"@ngrx/data/save/delete-one/success",SAVE_DELETE_ONE_ERROR:"@ngrx/data/save/delete-one/error",SAVE_UPDATE_MANY:"@ngrx/data/save/update-many",SAVE_UPDATE_MANY_SUCCESS:"@ngrx/data/save/update-many/success",SAVE_UPDATE_MANY_ERROR:"@ngrx/data/save/update-many/error",SAVE_UPDATE_ONE:"@ngrx/data/save/update-one",SAVE_UPDATE_ONE_SUCCESS:"@ngrx/data/save/update-one/success",SAVE_UPDATE_ONE_ERROR:"@ngrx/data/save/update-one/error",SAVE_UPSERT_MANY:"@ngrx/data/save/upsert-many",SAVE_UPSERT_MANY_SUCCESS:"@ngrx/data/save/upsert-many/success",SAVE_UPSERT_MANY_ERROR:"@ngrx/data/save/upsert-many/error",SAVE_UPSERT_ONE:"@ngrx/data/save/upsert-one",SAVE_UPSERT_ONE_SUCCESS:"@ngrx/data/save/upsert-one/success",SAVE_UPSERT_ONE_ERROR:"@ngrx/data/save/upsert-one/error",ADD_ALL:"@ngrx/data/add-all",ADD_MANY:"@ngrx/data/add-many",ADD_ONE:"@ngrx/data/add-one",REMOVE_ALL:"@ngrx/data/remove-all",REMOVE_MANY:"@ngrx/data/remove-many",REMOVE_ONE:"@ngrx/data/remove-one",UPDATE_MANY:"@ngrx/data/update-many",UPDATE_ONE:"@ngrx/data/update-one",UPSERT_MANY:"@ngrx/data/upsert-many",UPSERT_ONE:"@ngrx/data/upsert-one",COMMIT_ALL:"@ngrx/data/commit-all",COMMIT_MANY:"@ngrx/data/commit-many",COMMIT_ONE:"@ngrx/data/commit-one",UNDO_ALL:"@ngrx/data/undo-all",UNDO_MANY:"@ngrx/data/undo-many",UNDO_ONE:"@ngrx/data/undo-one",SET_CHANGE_STATE:"@ngrx/data/set-change-state",SET_COLLECTION:"@ngrx/data/set-collection",SET_FILTER:"@ngrx/data/set-filter",SET_LOADED:"@ngrx/data/set-loaded",SET_LOADING:"@ngrx/data/set-loading"},I="/success",x="/error";function L(t){return t+x}function j(t){return t+I}var k=function(t,e){this.error=t,this.requestData=e,this.message="string"==typeof t?t:function(t){var e=t.error,r=t.body,n=t.message,i=null;return e?i="string"==typeof e?e:e.message:n?i=n:r&&(i="string"==typeof r?r:r.error),"string"==typeof i?i:i?JSON.stringify(i):null}(t)};var w=function(){};var Y=function(){};var P=new e.InjectionToken("@ngrx/data Plural Names"),V=function(){};var F=function(){};var $=function(){};var Q=function(){function t(t){this.pluralizer=t,this.knownHttpResourceUrls={}}return t.prototype.getResourceUrls=function(t,e){var r,n=this.knownHttpResourceUrls[t];if(!n){var i=B(e);n={entityResourceUrl:(i+"/"+t+"/").toLowerCase(),collectionResourceUrl:(i+"/"+this.pluralizer.pluralize(t)+"/").toLowerCase()},this.registerHttpResourceUrls(((r={})[t]=n,r))}return n},t.prototype.entityResource=function(t,e){return this.getResourceUrls(t,e).entityResourceUrl},t.prototype.collectionResource=function(t,e){return this.getResourceUrls(t,e).collectionResourceUrl},t.prototype.registerHttpResourceUrls=function(t){this.knownHttpResourceUrls=Object.assign(Object.assign({},this.knownHttpResourceUrls),t||{})},t}();function B(t){return t.replace(/^[\/\s]+|[\/\s]+$/g,"")}Q.decorators=[{type:e.Injectable}],Q.ctorParameters=function(){return[{type:V}]};var q=function(){function t(t,e,r,n){this.http=e,this.httpUrlGenerator=r,this.getDelay=0,this.saveDelay=0,this.timeout=0,this._name=t+" DefaultDataService",this.entityName=t;var i=n||{},a=i.root,s=void 0===a?"api":a,o=i.delete404OK,c=void 0===o||o,u=i.getDelay,p=void 0===u?0:u,h=i.saveDelay,y=void 0===h?0:h,d=i.timeout,l=void 0===d?0:d;this.delete404OK=c,this.entityUrl=r.entityResource(t,s),this.entitiesUrl=r.collectionResource(t,s),this.getDelay=p,this.saveDelay=y,this.timeout=l}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var e=t||new Error('No "'+this.entityName+'" entity to add');return this.execute("POST",this.entityUrl,e)},t.prototype.delete=function(t){var e;return null==t&&(e=new Error('No "'+this.entityName+'" key to delete')),this.execute("DELETE",this.entityUrl+t,e).pipe(r.map((function(e){return t})))},t.prototype.getAll=function(){return this.execute("GET",this.entitiesUrl)},t.prototype.getById=function(t){var e;return null==t&&(e=new Error('No "'+this.entityName+'" key to get')),this.execute("GET",this.entityUrl+t,e)},t.prototype.getWithQuery=function(t){var e="string"==typeof t?{fromString:t}:{fromObject:t},r=new n.HttpParams(e);return this.execute("GET",this.entitiesUrl,void 0,{params:r})},t.prototype.update=function(t){var e=t&&t.id,r=null==e?new Error('No "'+this.entityName+'" update data or id'):t.changes;return this.execute("PUT",this.entityUrl+e,r)},t.prototype.upsert=function(t){var e=t||new Error('No "'+this.entityName+'" entity to upsert');return this.execute("POST",this.entityUrl,e)},t.prototype.execute=function(t,e,n,a){var s,o={method:t,url:e,data:n,options:a};if(n instanceof Error)return this.handleError(o)(n);switch(t){case"DELETE":s=this.http.delete(e,a),this.saveDelay&&(s=s.pipe(r.delay(this.saveDelay)));break;case"GET":s=this.http.get(e,a),this.getDelay&&(s=s.pipe(r.delay(this.getDelay)));break;case"POST":s=this.http.post(e,n,a),this.saveDelay&&(s=s.pipe(r.delay(this.saveDelay)));break;case"PUT":s=this.http.put(e,n,a),this.saveDelay&&(s=s.pipe(r.delay(this.saveDelay)));break;default:var c=new Error("Unimplemented HTTP method, "+t);s=i.throwError(c)}return this.timeout&&(s=s.pipe(r.timeout(this.timeout+this.saveDelay))),s.pipe(r.catchError(this.handleError(o)))},t.prototype.handleError=function(t){var e=this;return function(r){var n=e.handleDelete404(r,t);if(n)return n;var a=new k(r,t);return i.throwError(a)}},t.prototype.handleDelete404=function(t,e){if(404===t.status&&"DELETE"===e.method&&this.delete404OK)return i.of({})},t}();var K=function(){function t(t,e,r){this.http=t,this.httpUrlGenerator=e,this.config=r,r=r||{},e.registerHttpResourceUrls(r.entityHttpResourceUrls)}return t.prototype.create=function(t){return new q(t,this.http,this.httpUrlGenerator,this.config)},t}();function H(t){var e=t.entityName;if(!e)throw new Error("Missing required entityName");t.entityName=e=e.trim();var r=t.selectId||h,n=t.sortComparer=t.sortComparer||!1,i=a.createEntityAdapter({selectId:r,sortComparer:n}),s=t.entityDispatcherOptions||{},o=i.getInitialState(Object.assign({entityName:e,filter:"",loaded:!1,loading:!1,changeState:{}},t.additionalCollectionState||{}));return{entityName:e,entityAdapter:i,entityDispatcherOptions:s,initialState:o,metadata:t,noChangeTracking:!0===t.noChangeTracking,selectId:r,sortComparer:n}}K.decorators=[{type:e.Injectable}],K.ctorParameters=function(){return[{type:n.HttpClient},{type:$},{type:w,decorators:[{type:e.Optional}]}]};var G=new e.InjectionToken("@ngrx/data Entity Metadata");var W=function(){function t(t){var e=this;this.definitions={},t&&t.forEach((function(t){return e.registerMetadataMap(t)}))}return t.prototype.getDefinition=function(t,e){void 0===e&&(e=!0),t=t.trim();var r=this.definitions[t];if(!r&&e)throw new Error('No EntityDefinition for entity type "'+t+'".');return r},t.prototype.registerMetadata=function(t){if(t){var e=H(t);this.registerDefinition(e)}},t.prototype.registerMetadataMap=function(t){var e=this;void 0===t&&(t={}),Object.keys(t||{}).forEach((function(r){return e.registerMetadata(Object.assign({entityName:r},t[r]))}))},t.prototype.registerDefinition=function(t){this.definitions[t.entityName]=t},t.prototype.registerDefinitions=function(t){Object.assign(this.definitions,t)},t}();W.decorators=[{type:e.Injectable}],W.ctorParameters=function(){return[{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[G]}]}]};var z=E.Update,J=function(){function t(t,e,r){this.entityDefinitionService=t,this.http=e,this.idSelectors={},this.saveDelay=0,this.timeout=0;var n=r||{},i=n.saveDelay,a=void 0===i?0:i,s=n.timeout,o=void 0===s?0:s;this.saveDelay=a,this.timeout=o}return t.prototype.saveEntities=function(t,e){var n=this;t=this.filterChangeSet(t),t=this.flattenUpdates(t);var i=this.http.post(e,t).pipe(r.map((function(t){return n.restoreUpdates(t)})),r.catchError(this.handleError({method:"POST",url:e,data:t})));return this.timeout&&(i=i.pipe(r.timeout(this.timeout))),this.saveDelay&&(i=i.pipe(r.delay(this.saveDelay))),i},t.prototype.handleError=function(t){return function(e){var r=new k(e,t);return i.throwError(r)}},t.prototype.filterChangeSet=function(t){return S(t)},t.prototype.flattenUpdates=function(t){var e=t.changes;if(0===e.length)return t;var r=!1;return e=e.map((function(t){return t.op===z&&t.entities.length>0?(r=!0,Object.assign(Object.assign({},t),{entities:t.entities.map((function(t){return t.changes}))})):t})),r?Object.assign(Object.assign({},t),{changes:e}):t},t.prototype.restoreUpdates=function(t){var e=this;if(null==t)return t;var r=t.changes;if(0===r.length)return t;var n=!1;return r=r.map((function(t){if(t.op===z){n=!0;var r=e.getIdSelector(t.entityName);return Object.assign(Object.assign({},t),{entities:t.entities.map((function(t){return{id:r(t),changes:t}}))})}return t})),n?Object.assign(Object.assign({},t),{changes:r}):t},t.prototype.getIdSelector=function(t){var e=this.idSelectors[t];return e||(e=this.entityDefinitionService.getDefinition(t).selectId,this.idSelectors[t]=e),e},t}();J.decorators=[{type:e.Injectable}],J.ctorParameters=function(){return[{type:W},{type:n.HttpClient},{type:w,decorators:[{type:e.Optional}]}]};var X=function(){function t(t){this.defaultDataServiceFactory=t,this.services={}}return t.prototype.getService=function(t){t=t.trim();var e=this.services[t];return e||(e=this.defaultDataServiceFactory.create(t),this.services[t]=e),e},t.prototype.registerService=function(t,e){this.services[t.trim()]=e},t.prototype.registerServices=function(t){this.services=Object.assign(Object.assign({},this.services),t)},t}();X.decorators=[{type:e.Injectable}],X.ctorParameters=function(){return[{type:K}]};var Z=function(){};var tt=function(){function t(t,e){this.logger=t,this.entityActionFactory=e}return t.prototype.handleSuccess=function(t){var e=this,r=j(t.payload.entityOp);return function(n){return e.entityActionFactory.createFromAction(t,{entityOp:r,data:n})}},t.prototype.handleError=function(t){var e=this,r=L(t.payload.entityOp);return function(n){var i={error:n instanceof k?n:new k(n,null),originalAction:t};return e.logger.error(i),e.entityActionFactory.createFromAction(t,{entityOp:r,data:i})}},t}();tt.decorators=[{type:e.Injectable}],tt.ctorParameters=function(){return[{type:Y},{type:c}]};var et=function(){function t(){this.seed=0,this.prefix="CRID"}return t.prototype.next=function(){return this.seed+=1,this.prefix+this.seed},t}();et.decorators=[{type:e.Injectable}];var rt=function(){this.optimisticAdd=!1,this.optimisticDelete=!0,this.optimisticUpdate=!1,this.optimisticUpsert=!1,this.optimisticSaveEntities=!1};rt.decorators=[{type:e.Injectable}];var nt=function(t){this.message=t,this.message=t||"Canceled by user"};var it=function(){function t(t,e,n,i){this.correlationIdGenerator=t,this.defaultDispatcherOptions=e,this.store=i,this.reducedActions$=n.pipe(r.shareReplay(1)),this.raSubscription=this.reducedActions$.subscribe()}return t.prototype.dispatch=function(t){return this.store.dispatch(t),t},t.prototype.cancelSaveEntities=function(t,e,r,n){if(!t)throw new Error("Missing correlationId");var i=new R(t,e,r,n);this.dispatch(i)},t.prototype.clearCollections=function(t,e){this.dispatch(new A(t,e))},t.prototype.loadCollections=function(t,e){this.dispatch(new C(t,e))},t.prototype.mergeQuerySet=function(t,e,r){this.dispatch(new _(t,e,r))},t.prototype.setEntityCache=function(t,e){this.dispatch(new D(t,e))},t.prototype.saveEntities=function(t,e,n){var i=Array.isArray(t)?{changes:t}:t,a=null==(n=n||{}).correlationId?this.correlationIdGenerator.next():n.correlationId,s=null==n.isOptimistic?this.defaultDispatcherOptions.optimisticSaveEntities||!1:!0===n.isOptimistic,o=n.tag||"Save Entities";n=Object.assign(Object.assign({},n),{correlationId:a,isOptimistic:s,tag:o});var c=new T(i,e,n);return this.dispatch(c),this.getSaveEntitiesResponseData$(n.correlationId).pipe(r.shareReplay(1))},t.prototype.getSaveEntitiesResponseData$=function(t){return this.reducedActions$.pipe(r.filter((function(t){return t.type===m.SAVE_ENTITIES_SUCCESS||t.type===m.SAVE_ENTITIES_ERROR||t.type===m.SAVE_ENTITIES_CANCEL})),r.filter((function(e){return t===e.payload.correlationId})),r.take(1),r.mergeMap((function(t){return t.type===m.SAVE_ENTITIES_CANCEL?i.throwError(new nt(t.payload.reason)):t.type===m.SAVE_ENTITIES_SUCCESS?i.of(t.payload.changeSet):i.throwError(t.payload)})))},t}();it.decorators=[{type:e.Injectable}],it.ctorParameters=function(){return[{type:et},{type:rt},{type:i.Observable,decorators:[{type:e.Inject,args:[s.ScannedActionsSubject]}]},{type:s.Store}]};var at=function(){function t(t,e,r,n,i,a,o,c){void 0===n&&(n=h),this.entityName=t,this.entityActionFactory=e,this.store=r,this.selectId=n,this.defaultDispatcherOptions=i,this.reducedActions$=a,this.correlationIdGenerator=c,this.guard=new u(t,n),this.toUpdate=d(n);var p=s.createSelector(o,(function(e){return e[t]}));this.entityCollection$=r.select(p)}return t.prototype.createEntityAction=function(t,e,r){return this.entityActionFactory.create(Object.assign({entityName:this.entityName,entityOp:t,data:e},r))},t.prototype.createAndDispatch=function(t,e,r){var n=this.createEntityAction(t,e,r);return this.dispatch(n),n},t.prototype.dispatch=function(t){return this.store.dispatch(t),t},t.prototype.add=function(t,e){var n=this;e=this.setSaveEntityActionOptions(e,this.defaultDispatcherOptions.optimisticAdd);var i=this.createEntityAction(U.SAVE_ADD_ONE,t,e);return e.isOptimistic&&this.guard.mustBeEntity(i),this.dispatch(i),this.getResponseData$(e.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=p(t,2),r=e[0];return e[1].entities[n.selectId(r)]})),r.shareReplay(1))},t.prototype.cancel=function(t,e,r){if(!t)throw new Error("Missing correlationId");this.createAndDispatch(U.CANCEL_PERSIST,e,{correlationId:t})},t.prototype.delete=function(t,e){e=this.setSaveEntityActionOptions(e,this.defaultDispatcherOptions.optimisticDelete);var n=this.getKey(t),i=this.createEntityAction(U.SAVE_DELETE_ONE,n,e);return this.guard.mustBeKey(i),this.dispatch(i),this.getResponseData$(e.correlationId).pipe(r.map((function(){return n})),r.shareReplay(1))},t.prototype.getAll=function(t){var e=this;t=this.setQueryEntityActionOptions(t);var n=this.createEntityAction(U.QUERY_ALL,null,t);return this.dispatch(n),this.getResponseData$(t.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var r=p(t,2),n=r[0],i=r[1];return n.reduce((function(t,r){var n=i.entities[e.selectId(r)];return n&&t.push(n),t}),[])})),r.shareReplay(1))},t.prototype.getByKey=function(t,e){var n=this;e=this.setQueryEntityActionOptions(e);var i=this.createEntityAction(U.QUERY_BY_KEY,t,e);return this.dispatch(i),this.getResponseData$(e.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=p(t,2),r=e[0];return e[1].entities[n.selectId(r)]})),r.shareReplay(1))},t.prototype.getWithQuery=function(t,e){var n=this;e=this.setQueryEntityActionOptions(e);var i=this.createEntityAction(U.QUERY_MANY,t,e);return this.dispatch(i),this.getResponseData$(e.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=p(t,2),r=e[0],i=e[1];return r.reduce((function(t,e){var r=i.entities[n.selectId(e)];return r&&t.push(r),t}),[])})),r.shareReplay(1))},t.prototype.load=function(t){t=this.setQueryEntityActionOptions(t);var e=this.createEntityAction(U.QUERY_LOAD,null,t);return this.dispatch(e),this.getResponseData$(t.correlationId).pipe(r.shareReplay(1))},t.prototype.update=function(t,e){var n=this,i=this.toUpdate(t);e=this.setSaveEntityActionOptions(e,this.defaultDispatcherOptions.optimisticUpdate);var a=this.createEntityAction(U.SAVE_UPDATE_ONE,i,e);return e.isOptimistic&&this.guard.mustBeUpdate(a),this.dispatch(a),this.getResponseData$(e.correlationId).pipe(r.map((function(t){return t.changes})),r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=p(t,2),r=e[0];return e[1].entities[n.selectId(r)]})),r.shareReplay(1))},t.prototype.upsert=function(t,e){var n=this;e=this.setSaveEntityActionOptions(e,this.defaultDispatcherOptions.optimisticUpsert);var i=this.createEntityAction(U.SAVE_UPSERT_ONE,t,e);return e.isOptimistic&&this.guard.mustBeEntity(i),this.dispatch(i),this.getResponseData$(e.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=p(t,2),r=e[0];return e[1].entities[n.selectId(r)]})),r.shareReplay(1))},t.prototype.addAllToCache=function(t,e){this.createAndDispatch(U.ADD_ALL,t,e)},t.prototype.addOneToCache=function(t,e){this.createAndDispatch(U.ADD_ONE,t,e)},t.prototype.addManyToCache=function(t,e){this.createAndDispatch(U.ADD_MANY,t,e)},t.prototype.clearCache=function(t){this.createAndDispatch(U.REMOVE_ALL,void 0,t)},t.prototype.removeOneFromCache=function(t,e){this.createAndDispatch(U.REMOVE_ONE,this.getKey(t),e)},t.prototype.removeManyFromCache=function(t,e){var r=this;if(t&&0!==t.length){var n="object"==typeof t[0]?t.map((function(t){return r.getKey(t)})):t;this.createAndDispatch(U.REMOVE_MANY,n,e)}},t.prototype.updateOneInCache=function(t,e){var r=this.toUpdate(t);this.createAndDispatch(U.UPDATE_ONE,r,e)},t.prototype.updateManyInCache=function(t,e){var r=this;if(t&&0!==t.length){var n=t.map((function(t){return r.toUpdate(t)}));this.createAndDispatch(U.UPDATE_MANY,n,e)}},t.prototype.upsertOneInCache=function(t,e){this.createAndDispatch(U.UPSERT_ONE,t,e)},t.prototype.upsertManyInCache=function(t,e){t&&0!==t.length&&this.createAndDispatch(U.UPSERT_MANY,t,e)},t.prototype.setFilter=function(t){this.createAndDispatch(U.SET_FILTER,t)},t.prototype.setLoaded=function(t){this.createAndDispatch(U.SET_LOADED,!!t)},t.prototype.setLoading=function(t){this.createAndDispatch(U.SET_LOADING,!!t)},t.prototype.getKey=function(t){return"object"==typeof t?this.selectId(t):t},t.prototype.getResponseData$=function(t){var e=this;return this.reducedActions$.pipe(r.filter((function(t){return!!t.payload})),r.filter((function(r){var n=r.payload,i=n.correlationId,a=n.entityName,s=n.entityOp;return a===e.entityName&&i===t&&(s.endsWith(I)||s.endsWith(x)||s===U.CANCEL_PERSIST)})),r.take(1),r.mergeMap((function(t){var e=t.payload.entityOp;return e===U.CANCEL_PERSIST?i.throwError(new nt(t.payload.data)):e.endsWith(I)?i.of(t.payload.data):i.throwError(t.payload.data.error)})))},t.prototype.setQueryEntityActionOptions=function(t){var e=null==(t=t||{}).correlationId?this.correlationIdGenerator.next():t.correlationId;return Object.assign(Object.assign({},t),{correlationId:e})},t.prototype.setSaveEntityActionOptions=function(t,e){var r=null==(t=t||{}).correlationId?this.correlationIdGenerator.next():t.correlationId,n=null==t.isOptimistic?e||!1:!0===t.isOptimistic;return Object.assign(Object.assign({},t),{correlationId:r,isOptimistic:n})},t}();var st="entityCache",ot=new e.InjectionToken("@ngrx/data Entity Cache Name"),ct=new e.InjectionToken("@ngrx/data Entity Cache Meta Reducers"),ut=new e.InjectionToken("@ngrx/data Entity Collection Meta Reducers"),pt=new e.InjectionToken("@ngrx/data Initial Entity Cache State"),ht=new e.InjectionToken("@ngrx/data Entity Cache Selector"),yt={provide:ht,useFactory:dt,deps:[[new e.Optional,ot]]};function dt(t){return t=t||st,s.createFeatureSelector(t)}var lt=function(){function t(t,e,n,i,a,s){this.entityActionFactory=t,this.store=e,this.entityDispatcherDefaultOptions=n,this.entityCacheSelector=a,this.correlationIdGenerator=s,this.reducedActions$=i.pipe(r.shareReplay(1)),this.raSubscription=this.reducedActions$.subscribe()}return t.prototype.create=function(t,e,r){void 0===e&&(e=h),void 0===r&&(r={});var n=Object.assign(Object.assign({},this.entityDispatcherDefaultOptions),r);return new at(t,this.entityActionFactory,this.store,e,n,this.reducedActions$,this.entityCacheSelector,this.correlationIdGenerator)},t.prototype.ngOnDestroy=function(){this.raSubscription.unsubscribe()},t}();lt.decorators=[{type:e.Injectable}],lt.ctorParameters=function(){return[{type:c},{type:s.Store},{type:rt},{type:i.Observable,decorators:[{type:e.Inject,args:[s.ScannedActionsSubject]}]},{type:void 0,decorators:[{type:e.Inject,args:[ht]}]},{type:et}]};var gt=new e.InjectionToken("@ngrx/data Entity Effects Scheduler"),Et=function(){function t(t,e,n,i,a){var s=this;this.actions=t,this.dataService=e,this.entityActionFactory=n,this.logger=i,this.scheduler=a,this.responseDelay=10,this.saveEntitiesCancel$=o.createEffect((function(){return s.actions.pipe(o.ofType(m.SAVE_ENTITIES_CANCEL),r.filter((function(t){return null!=t.payload.correlationId})))}),{dispatch:!1}),this.saveEntities$=o.createEffect((function(){return s.actions.pipe(o.ofType(m.SAVE_ENTITIES),r.mergeMap((function(t){return s.saveEntities(t)})))}))}return t.prototype.saveEntities=function(t){var e=this,n=t.payload.error;if(n)return this.handleSaveEntitiesError$(t)(n);try{var a=S(t.payload.changeSet),s=t.payload,o=s.correlationId,c=s.mergeStrategy,u=s.tag,p=s.url,h={correlationId:o,mergeStrategy:c,tag:u};if(0===a.changes.length)return i.of(new M(a,p,h));var y=this.saveEntitiesCancel$.pipe(r.filter((function(t){return o===t.payload.correlationId})),r.map((function(t){return new N(o,t.payload.reason,t.payload.tag)}))),d=this.dataService.saveEntities(a,p).pipe(r.concatMap((function(r){return e.handleSaveEntitiesSuccess$(t,e.entityActionFactory)(r)})),r.catchError(this.handleSaveEntitiesError$(t)));return i.race(y,d)}catch(e){return this.handleSaveEntitiesError$(t)(e)}},t.prototype.handleSaveEntitiesError$=function(t){var e=this;return function(n){var a=n instanceof k?n:new k(n,null);return i.of(new b(a,t)).pipe(r.delay(e.responseDelay,e.scheduler||i.asyncScheduler))}},t.prototype.handleSaveEntitiesSuccess$=function(t,e){var r=t.payload,n=r.url,a={correlationId:r.correlationId,mergeStrategy:r.mergeStrategy,tag:r.tag};return function(r){if(r)return i.of(new M(r,n,a));if(r=t.payload.changeSet,!t.payload.isOptimistic)return i.of(new M(r,n,a));var s=r.changes.reduce((function(t,e){return-1===t.indexOf(e.entityName)?t.concat(e.entityName):t}),[]);return i.merge(s.map((function(t){return e.create(t,U.SET_LOADING,!1)})))}},t}();Et.decorators=[{type:e.Injectable}],Et.ctorParameters=function(){return[{type:o.Actions},{type:J},{type:c},{type:Y},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[gt]}]}]};var ft=[U.QUERY_ALL,U.QUERY_LOAD,U.QUERY_BY_KEY,U.QUERY_MANY,U.SAVE_ADD_ONE,U.SAVE_DELETE_ONE,U.SAVE_UPDATE_ONE,U.SAVE_UPSERT_ONE],vt=function(){function t(t,e,n,i,a){var s=this;this.actions=t,this.dataService=e,this.entityActionFactory=n,this.resultHandler=i,this.scheduler=a,this.responseDelay=10,this.cancel$=o.createEffect((function(){return s.actions.pipe(l(U.CANCEL_PERSIST),r.map((function(t){return t.payload.correlationId})),r.filter((function(t){return null!=t})))}),{dispatch:!1}),this.persist$=o.createEffect((function(){return s.actions.pipe(l(ft),r.mergeMap((function(t){return s.persist(t)})))}))}return t.prototype.persist=function(t){var e=this;if(t.payload.skip)return this.handleSkipSuccess$(t);if(t.payload.error)return this.handleError$(t)(t.payload.error);try{var n=this.cancel$.pipe(r.filter((function(e){return t.payload.correlationId===e})),r.map((function(r){return e.entityActionFactory.createFromAction(t,{entityOp:U.CANCELED_PERSIST})}))),a=this.callDataService(t).pipe(r.map(this.resultHandler.handleSuccess(t)),r.catchError(this.handleError$(t)));return i.race(n,a)}catch(e){return this.handleError$(t)(e)}},t.prototype.callDataService=function(t){var e=t.payload,n=e.entityName,i=e.entityOp,a=e.data,s=this.dataService.getService(n);switch(i){case U.QUERY_ALL:case U.QUERY_LOAD:return s.getAll();case U.QUERY_BY_KEY:return s.getById(a);case U.QUERY_MANY:return s.getWithQuery(a);case U.SAVE_ADD_ONE:return s.add(a);case U.SAVE_DELETE_ONE:return s.delete(a);case U.SAVE_UPDATE_ONE:var o=a,c=o.id,u=o.changes;return s.update(a).pipe(r.map((function(t){return t&&Object.keys(t).length>0?{id:c,changes:Object.assign(Object.assign({},u),t),changed:!0}:{id:c,changes:u,changed:!1}})));case U.SAVE_UPSERT_ONE:return s.upsert(a).pipe(r.map((function(t){return t&&Object.keys(t).length>0?t:a})));default:throw new Error('Persistence action "'+i+'" is not implemented.')}},t.prototype.handleError$=function(t){var e=this;return function(n){return i.of(e.resultHandler.handleError(t)(n)).pipe(r.delay(e.responseDelay,e.scheduler||i.asyncScheduler))}},t.prototype.handleSkipSuccess$=function(t){var e=j(t.payload.entityOp),n=this.entityActionFactory.createFromAction(t,{entityOp:e});return i.of(n).pipe(r.delay(this.responseDelay,this.scheduler||i.asyncScheduler))},t}();vt.decorators=[{type:e.Injectable}],vt.ctorParameters=function(){return[{type:o.Actions},{type:X},{type:c},{type:Z},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[gt]}]}]};var St=function(){function t(t,e){this.entityName=t,t=t.trim();var r=e.create(t),n=r.dispatcher,i=r.selectors,a=r.selectors$;this.entityName=t,this.dispatcher=n,this.guard=n.guard,this.selectId=n.selectId,this.toUpdate=n.toUpdate,this.selectors=i,this.selectors$=a,this.collection$=a.collection$,this.count$=a.count$,this.entities$=a.entities$,this.entityActions$=a.entityActions$,this.entityMap$=a.entityMap$,this.errors$=a.errors$,this.filter$=a.filter$,this.filteredEntities$=a.filteredEntities$,this.keys$=a.keys$,this.loaded$=a.loaded$,this.loading$=a.loading$,this.changeState$=a.changeState$}return t.prototype.createEntityAction=function(t,e,r){return this.dispatcher.createEntityAction(t,e,r)},t.prototype.createAndDispatch=function(t,e,r){return this.dispatcher.createAndDispatch(t,e,r)},t.prototype.dispatch=function(t){return this.dispatcher.dispatch(t)},Object.defineProperty(t.prototype,"store",{get:function(){return this.dispatcher.store},enumerable:!1,configurable:!0}),t.prototype.add=function(t,e){return this.dispatcher.add(t,e)},t.prototype.cancel=function(t,e,r){this.dispatcher.cancel(t,e,r)},t.prototype.delete=function(t,e){return this.dispatcher.delete(t,e)},t.prototype.getAll=function(t){return this.dispatcher.getAll(t)},t.prototype.getByKey=function(t,e){return this.dispatcher.getByKey(t,e)},t.prototype.getWithQuery=function(t,e){return this.dispatcher.getWithQuery(t,e)},t.prototype.load=function(t){return this.dispatcher.load(t)},t.prototype.update=function(t,e){return this.dispatcher.update(t,e)},t.prototype.upsert=function(t,e){return this.dispatcher.upsert(t,e)},t.prototype.addAllToCache=function(t,e){this.dispatcher.addAllToCache(t,e)},t.prototype.addOneToCache=function(t,e){this.dispatcher.addOneToCache(t,e)},t.prototype.addManyToCache=function(t,e){this.dispatcher.addManyToCache(t,e)},t.prototype.clearCache=function(){this.dispatcher.clearCache()},t.prototype.removeOneFromCache=function(t,e){this.dispatcher.removeOneFromCache(t,e)},t.prototype.removeManyFromCache=function(t,e){this.dispatcher.removeManyFromCache(t,e)},t.prototype.updateOneInCache=function(t,e){this.dispatcher.updateOneInCache(t,e)},t.prototype.updateManyInCache=function(t,e){this.dispatcher.updateManyInCache(t,e)},t.prototype.upsertOneInCache=function(t,e){this.dispatcher.upsertOneInCache(t,e)},t.prototype.upsertManyInCache=function(t,e){this.dispatcher.upsertManyInCache(t,e)},t.prototype.setFilter=function(t){this.dispatcher.setFilter(t)},t.prototype.setLoaded=function(t){this.dispatcher.setLoaded(!!t)},t.prototype.setLoading=function(t){this.dispatcher.setLoading(!!t)},t}();var Ot=function(){function t(t){this.entityDefinitionService=t}return t.prototype.create=function(t){var e=this.entityDefinitionService&&this.entityDefinitionService.getDefinition(t,!1);return e&&e.initialState||mt(t)},t}();function mt(t){return{entityName:t,ids:[],entities:{},filter:void 0,loaded:!1,loading:!1,changeState:{}}}Ot.decorators=[{type:e.Injectable}],Ot.ctorParameters=function(){return[{type:W,decorators:[{type:e.Optional}]}]};var At=function(){function t(t,e){this.entityCollectionCreator=t||new Ot,this.selectEntityCache=e||dt(st)}return t.prototype.createCollectionSelector=function(t){var e=this;return s.createSelector(this.selectEntityCache,(function(r){return void 0===r&&(r={}),r[t]||e.entityCollectionCreator.create(t)}))},t.prototype.createCollectionSelectors=function(t){var e="string"==typeof t?{entityName:t}:t,r=function(t){return t.ids},n=function(t){return t.entities},i=s.createSelector(r,n,(function(t,e){return t.map((function(t){return e[t]}))})),a=s.createSelector(r,(function(t){return t.length})),o=function(t){return t.filter},c=e.filterFn,u=c?s.createSelector(i,o,(function(t,e){return c(t,e)})):i,p=e.additionalCollectionState||{},h={};return Object.keys(p).forEach((function(t){h["select"+t[0].toUpperCase()+t.slice(1)]=function(e){return e[t]}})),Object.assign({selectCount:a,selectEntities:i,selectEntityMap:n,selectFilter:o,selectFilteredEntities:u,selectKeys:r,selectLoaded:function(t){return t.loaded},selectLoading:function(t){return t.loading},selectChangeState:function(t){return t.changeState}},h)},t.prototype.create=function(t){var e="string"==typeof t?{entityName:t}:t,r=e.entityName,n=this.createCollectionSelector(r),i=this.createCollectionSelectors(e),a={};return Object.keys(i).forEach((function(t){a[t]=s.createSelector(n,i[t])})),Object.assign({entityName:r,selectCollection:n,selectEntityCache:this.selectEntityCache},a)},t}();At.decorators=[{type:e.Injectable}],At.ctorParameters=function(){return[{type:Ot,decorators:[{type:e.Optional}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[ht]}]}]};var Ct=function(){function t(t,e,n){this.store=t,this.actions=e,this.selectEntityCache=n,this.entityCache$=this.store.select(this.selectEntityCache),this.entityActionErrors$=e.pipe(r.filter((function(t){return t.payload&&t.payload.entityOp&&t.payload.entityOp.endsWith(x)})),r.shareReplay(1))}return t.prototype.create=function(t,e){var r=this,n={entityName:t};return Object.keys(e).forEach((function(t){if(t.startsWith("select")){var i=t[6].toLowerCase()+t.substr(7)+"$";n[i]=r.store.select(e[t])}})),n.entityActions$=this.actions.pipe(g(t)),n.errors$=this.entityActionErrors$.pipe(g(t)),n},t}();Ct.decorators=[{type:e.Injectable}],Ct.ctorParameters=function(){return[{type:s.Store},{type:o.Actions},{type:void 0,decorators:[{type:e.Inject,args:[ht]}]}]};var _t=function(){function t(t,e,r,n){this.entityDispatcherFactory=t,this.entityDefinitionService=e,this.entitySelectorsFactory=r,this.entitySelectors$Factory=n}return t.prototype.create=function(t){t=t.trim();var e=this.entityDefinitionService.getDefinition(t),r=this.entityDispatcherFactory.create(t,e.selectId,e.entityDispatcherOptions),n=this.entitySelectorsFactory.create(e.metadata);return{dispatcher:r,entityName:t,selectors:n,selectors$:this.entitySelectors$Factory.create(t,n)}},t}();_t.decorators=[{type:e.Injectable}],_t.ctorParameters=function(){return[{type:lt},{type:W},{type:At},{type:Ct}]};var Dt=function(){function t(t){this.entityCollectionServiceElementsFactory=t}return t.prototype.create=function(t){return new St(t,this.entityCollectionServiceElementsFactory)},t}();Dt.decorators=[{type:e.Injectable}],Dt.ctorParameters=function(){return[{type:_t}]};var Tt=function(t,e,r,n){this.entityCollectionServiceFactory=t,this.store=n,this.entityActionErrors$=r.entityActionErrors$,this.entityCache$=r.entityCache$,this.reducedActions$=e.reducedActions$};Tt.decorators=[{type:e.Injectable}],Tt.ctorParameters=function(){return[{type:Dt},{type:lt},{type:Ct},{type:s.Store}]};var Rt=function(){function t(t){this.entityServicesElements=t,this.EntityCollectionServices={}}return Object.defineProperty(t.prototype,"entityActionErrors$",{get:function(){return this.entityServicesElements.entityActionErrors$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entityCache$",{get:function(){return this.entityServicesElements.entityCache$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entityCollectionServiceFactory",{get:function(){return this.entityServicesElements.entityCollectionServiceFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reducedActions$",{get:function(){return this.entityServicesElements.reducedActions$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"store",{get:function(){return this.entityServicesElements.store},enumerable:!1,configurable:!0}),t.prototype.dispatch=function(t){this.store.dispatch(t)},t.prototype.createEntityCollectionService=function(t){return this.entityCollectionServiceFactory.create(t)},t.prototype.getEntityCollectionService=function(t){var e=this.EntityCollectionServices[t];return e||(e=this.createEntityCollectionService(t),this.EntityCollectionServices[t]=e),e},t.prototype.registerEntityCollectionService=function(t,e){this.EntityCollectionServices[e||t.entityName]=t},t.prototype.registerEntityCollectionServices=function(t){var e=this;Array.isArray(t)?t.forEach((function(t){return e.registerEntityCollectionService(t)})):Object.keys(t||{}).forEach((function(r){e.registerEntityCollectionService(t[r],r)}))},t}();Rt.decorators=[{type:e.Injectable}],Rt.ctorParameters=function(){return[{type:Tt}]};var Nt=function(){};var bt={Unchanged:0,Added:1,Deleted:2,Updated:3};bt[bt.Unchanged]="Unchanged",bt[bt.Added]="Added",bt[bt.Deleted]="Deleted",bt[bt.Updated]="Updated";var Mt=function(){function t(t,e){this.adapter=t,this.selectId=e,this.selectId=e||h}return t.prototype.commitAll=function(t){return 0===Object.keys(t.changeState).length?t:Object.assign(Object.assign({},t),{changeState:{}})},t.prototype.commitMany=function(t,e){var r=this;if(null==t||0===t.length)return e;var n=!1,i=t.reduce((function(t,e){var i="object"==typeof e?r.selectId(e):e;return t[i]&&(n||(t=Object.assign({},t),n=!0),delete t[i]),t}),e.changeState);return n?Object.assign(Object.assign({},e),{changeState:i}):e},t.prototype.commitOne=function(t,e){return null==t?e:this.commitMany([t],e)},t.prototype.mergeQueryResults=function(t,e,r){return this.mergeServerUpserts(t,e,O.PreserveChanges,r)},t.prototype.mergeSaveAdds=function(t,e,r){return this.mergeServerUpserts(t,e,O.OverwriteChanges,r)},t.prototype.mergeSaveDeletes=function(t,e,r){var n=t;return e=(r=null==r?O.OverwriteChanges:r)===O.IgnoreChanges?e:this.commitMany(n,e),this.adapter.removeMany(n,e)},t.prototype.mergeSaveUpdates=function(t,e,r,n){var i=this;if(void 0===n&&(n=!1),null==t||0===t.length)return e;var a,s=!1,o=e.changeState;switch(r=null==r?O.OverwriteChanges:r){case O.IgnoreChanges:return a=u(t),this.adapter.updateMany(a,e);case O.OverwriteChanges:return o=t.reduce((function(t,e){var r=e.id;return t[r]&&(s||(t=Object.assign({},t),s=!0),delete t[r]),t}),e.changeState),e=s?Object.assign(Object.assign({},e),{changeState:o}):e,a=u(t),this.adapter.updateMany(a,e);case O.PreserveChanges:var c=[];return o=t.reduce((function(t,e){var r=e.id,n=t[r];if(n){s||(t=Object.assign({},t),s=!0);var a=i.selectId(e.changes),o=n;a!==r&&delete t[r];var u=Object.assign(Object.assign({},o.originalValue),e.changes);t[a]=Object.assign(Object.assign({},o),{originalValue:u})}else c.push(e);return t}),e.changeState),e=s?Object.assign(Object.assign({},e),{changeState:o}):e,a=u(c),this.adapter.updateMany(a,e)}function u(t){return!0===n&&(t=t.filter((function(t){return!0===t.changed}))),t.map((function(t){return{id:t.id,changes:t.changes}}))}},t.prototype.mergeSaveUpserts=function(t,e,r){return this.mergeServerUpserts(t,e,O.OverwriteChanges,r)},t.prototype.mergeServerUpserts=function(t,e,r,n){var i=this;if(null==t||0===t.length)return e;var a=!1,s=e.changeState;switch(n=null==n?r:n){case O.IgnoreChanges:return this.adapter.upsertMany(t,e);case O.OverwriteChanges:return e=this.adapter.upsertMany(t,e),s=t.reduce((function(t,e){var r=i.selectId(e);return t[r]&&(a||(t=Object.assign({},t),a=!0),delete t[r]),t}),e.changeState),a?Object.assign(Object.assign({},e),{changeState:s}):e;case O.PreserveChanges:var o=[];return s=t.reduce((function(t,e){var r,n=i.selectId(e);return t[n]?a||(t=Object.assign(Object.assign({},t),((r={})[n]=Object.assign(Object.assign({},t[n]),{originalValue:e}),r)),a=!0):o.push(e),t}),e.changeState),e=this.adapter.upsertMany(o,e),a?Object.assign(Object.assign({},e),{changeState:s}):e}},t.prototype.trackAddMany=function(t,e,r){var n=this;if(r===O.IgnoreChanges||null==t||0===t.length)return e;var i=!1,a=t.reduce((function(t,r){var a=n.selectId(r);if(null==a||""===a)throw new Error(e.entityName+" entity add requires a key to be tracked");return t[a]||(i||(i=!0,t=Object.assign({},t)),t[a]={changeType:bt.Added}),t}),e.changeState);return i?Object.assign(Object.assign({},e),{changeState:a}):e},t.prototype.trackAddOne=function(t,e,r){return null==t?e:this.trackAddMany([t],e,r)},t.prototype.trackDeleteMany=function(t,e,r){if(r===O.IgnoreChanges||null==t||0===t.length)return e;var n=!1,i=e.entities,a=t.reduce((function(t,e){var r=i[e];if(r){var a=t[e];a?a.changeType===bt.Added?(s(),delete t[e]):a.changeType===bt.Updated&&(s(),a.changeType=bt.Deleted):(s(),t[e]={changeType:bt.Deleted,originalValue:r})}return t;function s(){n||(n=!0,t=Object.assign({},t))}}),e.changeState);return n?Object.assign(Object.assign({},e),{changeState:a}):e},t.prototype.trackDeleteOne=function(t,e,r){return null==t?e:this.trackDeleteMany([t],e,r)},t.prototype.trackUpdateMany=function(t,e,r){if(r===O.IgnoreChanges||null==t||0===t.length)return e;var n=!1,i=e.entities,a=t.reduce((function(t,r){var a=r.id;r.changes;if(null==a||""===a)throw new Error(e.entityName+" entity update requires a key to be tracked");var s=i[a];s&&(t[a]||(n||(n=!0,t=Object.assign({},t)),t[a]={changeType:bt.Updated,originalValue:s}));return t}),e.changeState);return n?Object.assign(Object.assign({},e),{changeState:a}):e},t.prototype.trackUpdateOne=function(t,e,r){return null==t?e:this.trackUpdateMany([t],e,r)},t.prototype.trackUpsertMany=function(t,e,r){var n=this;if(r===O.IgnoreChanges||null==t||0===t.length)return e;var i=!1,a=e.entities,s=t.reduce((function(t,r){var s=n.selectId(r);if(null==s||""===s)throw new Error(e.entityName+" entity upsert requires a key to be tracked");if(!t[s]){i||(i=!0,t=Object.assign({},t));var o=a[s];t[s]=null==o?{changeType:bt.Added}:{changeType:bt.Updated,originalValue:o}}return t}),e.changeState);return i?Object.assign(Object.assign({},e),{changeState:s}):e},t.prototype.trackUpsertOne=function(t,e,r){return null==t?e:this.trackUpsertMany([t],e,r)},t.prototype.undoAll=function(t){var e=Object.keys(t.changeState).reduce((function(t,e){var r=t.chgState[e];switch(r.changeType){case bt.Added:t.remove.push(e);break;case bt.Deleted:var n=r.originalValue;n&&t.upsert.push(n);break;case bt.Updated:t.upsert.push(r.originalValue)}return t}),{remove:[],upsert:[],chgState:t.changeState}),r=e.remove,n=e.upsert;return t=this.adapter.removeMany(r,t),t=this.adapter.upsertMany(n,t),Object.assign(Object.assign({},t),{changeState:{}})},t.prototype.undoMany=function(t,e){var r=this;if(null==t||0===t.length)return e;var n=!1,i=t.reduce((function(t,e){var i=t.changeState,a="object"==typeof e?r.selectId(e):e,s=i[a];if(s)switch(n||(i=Object.assign({},i),n=!0),delete i[a],t.changeState=i,s.changeType){case bt.Added:t.remove.push(a);break;case bt.Deleted:var o=s.originalValue;o&&t.upsert.push(o);break;case bt.Updated:t.upsert.push(s.originalValue)}return t}),{remove:[],upsert:[],changeState:e.changeState}),a=i.changeState,s=i.remove,o=i.upsert;return e=this.adapter.removeMany(s,e),e=this.adapter.upsertMany(o,e),n?Object.assign(Object.assign({},e),{changeState:a}):e},t.prototype.undoOne=function(t,e){return null==t?e:this.undoMany([t],e)},t}();var Ut=function(){function t(t,e,r){var n;this.entityName=t,this.definition=e,this.methods=((n={})[U.CANCEL_PERSIST]=this.cancelPersist.bind(this),n[U.QUERY_ALL]=this.queryAll.bind(this),n[U.QUERY_ALL_ERROR]=this.queryAllError.bind(this),n[U.QUERY_ALL_SUCCESS]=this.queryAllSuccess.bind(this),n[U.QUERY_BY_KEY]=this.queryByKey.bind(this),n[U.QUERY_BY_KEY_ERROR]=this.queryByKeyError.bind(this),n[U.QUERY_BY_KEY_SUCCESS]=this.queryByKeySuccess.bind(this),n[U.QUERY_LOAD]=this.queryLoad.bind(this),n[U.QUERY_LOAD_ERROR]=this.queryLoadError.bind(this),n[U.QUERY_LOAD_SUCCESS]=this.queryLoadSuccess.bind(this),n[U.QUERY_MANY]=this.queryMany.bind(this),n[U.QUERY_MANY_ERROR]=this.queryManyError.bind(this),n[U.QUERY_MANY_SUCCESS]=this.queryManySuccess.bind(this),n[U.SAVE_ADD_MANY]=this.saveAddMany.bind(this),n[U.SAVE_ADD_MANY_ERROR]=this.saveAddManyError.bind(this),n[U.SAVE_ADD_MANY_SUCCESS]=this.saveAddManySuccess.bind(this),n[U.SAVE_ADD_ONE]=this.saveAddOne.bind(this),n[U.SAVE_ADD_ONE_ERROR]=this.saveAddOneError.bind(this),n[U.SAVE_ADD_ONE_SUCCESS]=this.saveAddOneSuccess.bind(this),n[U.SAVE_DELETE_MANY]=this.saveDeleteMany.bind(this),n[U.SAVE_DELETE_MANY_ERROR]=this.saveDeleteManyError.bind(this),n[U.SAVE_DELETE_MANY_SUCCESS]=this.saveDeleteManySuccess.bind(this),n[U.SAVE_DELETE_ONE]=this.saveDeleteOne.bind(this),n[U.SAVE_DELETE_ONE_ERROR]=this.saveDeleteOneError.bind(this),n[U.SAVE_DELETE_ONE_SUCCESS]=this.saveDeleteOneSuccess.bind(this),n[U.SAVE_UPDATE_MANY]=this.saveUpdateMany.bind(this),n[U.SAVE_UPDATE_MANY_ERROR]=this.saveUpdateManyError.bind(this),n[U.SAVE_UPDATE_MANY_SUCCESS]=this.saveUpdateManySuccess.bind(this),n[U.SAVE_UPDATE_ONE]=this.saveUpdateOne.bind(this),n[U.SAVE_UPDATE_ONE_ERROR]=this.saveUpdateOneError.bind(this),n[U.SAVE_UPDATE_ONE_SUCCESS]=this.saveUpdateOneSuccess.bind(this),n[U.SAVE_UPSERT_MANY]=this.saveUpsertMany.bind(this),n[U.SAVE_UPSERT_MANY_ERROR]=this.saveUpsertManyError.bind(this),n[U.SAVE_UPSERT_MANY_SUCCESS]=this.saveUpsertManySuccess.bind(this),n[U.SAVE_UPSERT_ONE]=this.saveUpsertOne.bind(this),n[U.SAVE_UPSERT_ONE_ERROR]=this.saveUpsertOneError.bind(this),n[U.SAVE_UPSERT_ONE_SUCCESS]=this.saveUpsertOneSuccess.bind(this),n[U.ADD_ALL]=this.addAll.bind(this),n[U.ADD_MANY]=this.addMany.bind(this),n[U.ADD_ONE]=this.addOne.bind(this),n[U.REMOVE_ALL]=this.removeAll.bind(this),n[U.REMOVE_MANY]=this.removeMany.bind(this),n[U.REMOVE_ONE]=this.removeOne.bind(this),n[U.UPDATE_MANY]=this.updateMany.bind(this),n[U.UPDATE_ONE]=this.updateOne.bind(this),n[U.UPSERT_MANY]=this.upsertMany.bind(this),n[U.UPSERT_ONE]=this.upsertOne.bind(this),n[U.COMMIT_ALL]=this.commitAll.bind(this),n[U.COMMIT_MANY]=this.commitMany.bind(this),n[U.COMMIT_ONE]=this.commitOne.bind(this),n[U.UNDO_ALL]=this.undoAll.bind(this),n[U.UNDO_MANY]=this.undoMany.bind(this),n[U.UNDO_ONE]=this.undoOne.bind(this),n[U.SET_CHANGE_STATE]=this.setChangeState.bind(this),n[U.SET_COLLECTION]=this.setCollection.bind(this),n[U.SET_FILTER]=this.setFilter.bind(this),n[U.SET_LOADED]=this.setLoaded.bind(this),n[U.SET_LOADING]=this.setLoading.bind(this),n),this.adapter=e.entityAdapter,this.isChangeTracking=!0!==e.noChangeTracking,this.selectId=e.selectId,this.guard=new u(t,this.selectId),this.toUpdate=d(this.selectId),this.entityChangeTracker=r||new Mt(this.adapter,this.selectId)}return t.prototype.cancelPersist=function(t){return this.setLoadingFalse(t)},t.prototype.queryAll=function(t){return this.setLoadingTrue(t)},t.prototype.queryAllError=function(t,e){return this.setLoadingFalse(t)},t.prototype.queryAllSuccess=function(t,e){var r=this.extractData(e),n=this.extractMergeStrategy(e);return Object.assign(Object.assign({},this.entityChangeTracker.mergeQueryResults(r,t,n)),{loaded:!0,loading:!1})},t.prototype.queryByKey=function(t,e){return this.setLoadingTrue(t)},t.prototype.queryByKeyError=function(t,e){return this.setLoadingFalse(t)},t.prototype.queryByKeySuccess=function(t,e){var r=this.extractData(e),n=this.extractMergeStrategy(e);return t=null==r?t:this.entityChangeTracker.mergeQueryResults([r],t,n),this.setLoadingFalse(t)},t.prototype.queryLoad=function(t){return this.setLoadingTrue(t)},t.prototype.queryLoadError=function(t,e){return this.setLoadingFalse(t)},t.prototype.queryLoadSuccess=function(t,e){var r=this.extractData(e);return Object.assign(Object.assign({},this.adapter.setAll(r,t)),{loading:!1,loaded:!0,changeState:{}})},t.prototype.queryMany=function(t,e){return this.setLoadingTrue(t)},t.prototype.queryManyError=function(t,e){return this.setLoadingFalse(t)},t.prototype.queryManySuccess=function(t,e){var r=this.extractData(e),n=this.extractMergeStrategy(e);return Object.assign(Object.assign({},this.entityChangeTracker.mergeQueryResults(r,t,n)),{loading:!1})},t.prototype.saveAddMany=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackAddMany(r,t,n),t=this.adapter.addMany(r,t)}return this.setLoadingTrue(t)},t.prototype.saveAddManyError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveAddManySuccess=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.isOptimistic(e)?this.entityChangeTracker.mergeSaveUpserts(r,t,n):this.entityChangeTracker.mergeSaveAdds(r,t,n),this.setLoadingFalse(t)},t.prototype.saveAddOne=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackAddOne(r,t,n),t=this.adapter.addOne(r,t)}return this.setLoadingTrue(t)},t.prototype.saveAddOneError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveAddOneSuccess=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);if(this.isOptimistic(e)){var i=this.toUpdate(r);t=this.entityChangeTracker.mergeSaveUpdates([i],t,n,!1)}else t=this.entityChangeTracker.mergeSaveAdds([r],t,n);return this.setLoadingFalse(t)},t.prototype.saveDeleteOne=function(t,e){var r=this.extractData(e),n="object"==typeof r?this.selectId(r):r,i=t.changeState[n];if(i&&(i.changeType===bt.Added?(t=this.adapter.removeOne(n,t),t=this.entityChangeTracker.commitOne(n,t),e.payload.skip=!0):t=this.entityChangeTracker.trackDeleteOne(n,t)),this.isOptimistic(e)){var a=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackDeleteOne(n,t,a),t=this.adapter.removeOne(n,t)}return this.setLoadingTrue(t)},t.prototype.saveDeleteOneError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveDeleteOneSuccess=function(t,e){var r=this.extractData(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.mergeSaveDeletes([r],t,n)}else t=this.adapter.removeOne(r,t),t=this.entityChangeTracker.commitOne(r,t);return this.setLoadingFalse(t)},t.prototype.saveDeleteMany=function(t,e){var r=this,n=this.extractData(e).map((function(t){return"object"==typeof t?r.selectId(t):t}));if(n.forEach((function(n){var i=t.changeState[n];i&&(i.changeType===bt.Added?(t=r.adapter.removeOne(n,t),t=r.entityChangeTracker.commitOne(n,t),e.payload.skip=!0):t=r.entityChangeTracker.trackDeleteOne(n,t))})),this.isOptimistic(e)){var i=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackDeleteMany(n,t,i),t=this.adapter.removeMany(n,t)}return this.setLoadingTrue(t)},t.prototype.saveDeleteManyError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveDeleteManySuccess=function(t,e){var r=this.extractData(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.mergeSaveDeletes(r,t,n)}else t=this.adapter.removeMany(r,t),t=this.entityChangeTracker.commitMany(r,t);return this.setLoadingFalse(t)},t.prototype.saveUpdateOne=function(t,e){var r=this.guard.mustBeUpdate(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpdateOne(r,t,n),t=this.adapter.updateOne(r,t)}return this.setLoadingTrue(t)},t.prototype.saveUpdateOneError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveUpdateOneSuccess=function(t,e){var r=this.guard.mustBeUpdateResponse(e),n=this.isOptimistic(e),i=this.extractMergeStrategy(e);return t=this.entityChangeTracker.mergeSaveUpdates([r],t,i,n),this.setLoadingFalse(t)},t.prototype.saveUpdateMany=function(t,e){var r=this.guard.mustBeUpdates(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpdateMany(r,t,n),t=this.adapter.updateMany(r,t)}return this.setLoadingTrue(t)},t.prototype.saveUpdateManyError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveUpdateManySuccess=function(t,e){var r=this.guard.mustBeUpdateResponses(e),n=(this.isOptimistic(e),this.extractMergeStrategy(e));return t=this.entityChangeTracker.mergeSaveUpdates(r,t,n,!1),this.setLoadingFalse(t)},t.prototype.saveUpsertOne=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpsertOne(r,t,n),t=this.adapter.upsertOne(r,t)}return this.setLoadingTrue(t)},t.prototype.saveUpsertOneError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveUpsertOneSuccess=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.mergeSaveUpserts([r],t,n),this.setLoadingFalse(t)},t.prototype.saveUpsertMany=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpsertMany(r,t,n),t=this.adapter.upsertMany(r,t)}return this.setLoadingTrue(t)},t.prototype.saveUpsertManyError=function(t,e){return this.setLoadingFalse(t)},t.prototype.saveUpsertManySuccess=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.mergeSaveUpserts(r,t,n),this.setLoadingFalse(t)},t.prototype.addAll=function(t,e){var r=this.guard.mustBeEntities(e);return Object.assign(Object.assign({},this.adapter.setAll(r,t)),{loading:!1,loaded:!0,changeState:{}})},t.prototype.addMany=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackAddMany(r,t,n),this.adapter.addMany(r,t)},t.prototype.addOne=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackAddOne(r,t,n),this.adapter.addOne(r,t)},t.prototype.removeMany=function(t,e){var r=this.guard.mustBeKeys(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackDeleteMany(r,t,n),this.adapter.removeMany(r,t)},t.prototype.removeOne=function(t,e){var r=this.guard.mustBeKey(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackDeleteOne(r,t,n),this.adapter.removeOne(r,t)},t.prototype.removeAll=function(t,e){return Object.assign(Object.assign({},this.adapter.removeAll(t)),{loaded:!1,loading:!1,changeState:{}})},t.prototype.updateMany=function(t,e){var r=this.guard.mustBeUpdates(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpdateMany(r,t,n),this.adapter.updateMany(r,t)},t.prototype.updateOne=function(t,e){var r=this.guard.mustBeUpdate(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpdateOne(r,t,n),this.adapter.updateOne(r,t)},t.prototype.upsertMany=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpsertMany(r,t,n),this.adapter.upsertMany(r,t)},t.prototype.upsertOne=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpsertOne(r,t,n),this.adapter.upsertOne(r,t)},t.prototype.commitAll=function(t){return this.entityChangeTracker.commitAll(t)},t.prototype.commitMany=function(t,e){return this.entityChangeTracker.commitMany(this.extractData(e),t)},t.prototype.commitOne=function(t,e){return this.entityChangeTracker.commitOne(this.extractData(e),t)},t.prototype.undoAll=function(t){return this.entityChangeTracker.undoAll(t)},t.prototype.undoMany=function(t,e){return this.entityChangeTracker.undoMany(this.extractData(e),t)},t.prototype.undoOne=function(t,e){return this.entityChangeTracker.undoOne(this.extractData(e),t)},t.prototype.setChangeState=function(t,e){var r=this.extractData(e);return t.changeState===r?t:Object.assign(Object.assign({},t),{changeState:r})},t.prototype.setCollection=function(t,e){var r=this.extractData(e);return t===r?t:r},t.prototype.setFilter=function(t,e){var r=this.extractData(e);return t.filter===r?t:Object.assign(Object.assign({},t),{filter:r})},t.prototype.setLoaded=function(t,e){var r=!0===this.extractData(e)||!1;return t.loaded===r?t:Object.assign(Object.assign({},t),{loaded:r})},t.prototype.setLoading=function(t,e){return this.setLoadingFlag(t,this.extractData(e))},t.prototype.setLoadingFalse=function(t){return this.setLoadingFlag(t,!1)},t.prototype.setLoadingTrue=function(t){return this.setLoadingFlag(t,!0)},t.prototype.setLoadingFlag=function(t,e){return e=!0===e,t.loading===e?t:Object.assign(Object.assign({},t),{loading:e})},t.prototype.extractData=function(t){return t.payload&&t.payload.data},t.prototype.extractMergeStrategy=function(t){return this.isChangeTracking?t.payload&&t.payload.mergeStrategy:O.IgnoreChanges},t.prototype.isOptimistic=function(t){return t.payload&&!0===t.payload.isOptimistic},t}();var It=function(){function t(t){this.entityDefinitionService=t}return t.prototype.create=function(t){var e=this.entityDefinitionService.getDefinition(t);return new Ut(t,e).methods},t}();It.decorators=[{type:e.Injectable}],It.ctorParameters=function(){return[{type:W}]};var xt=function(){function t(t){this.methodsFactory=t}return t.prototype.create=function(t){var e=this.methodsFactory.create(t);return function(t,r){var n=e[r.payload.entityOp];return n?n(t,r):t}},t}();xt.decorators=[{type:e.Injectable}],xt.ctorParameters=function(){return[{type:It}]};var Lt=function(){function t(t,e){this.entityCollectionReducerFactory=t,this.entityCollectionReducers={},this.entityCollectionMetaReducer=s.compose.apply(null,e||[])}return t.prototype.getOrCreateReducer=function(t){var e=this.entityCollectionReducers[t];return e||(e=this.entityCollectionReducerFactory.create(t),e=this.registerReducer(t,e),this.entityCollectionReducers[t]=e),e},t.prototype.registerReducer=function(t,e){return e=this.entityCollectionMetaReducer(e),this.entityCollectionReducers[t.trim()]=e},t.prototype.registerReducers=function(t){var e=this;(t?Object.keys(t):[]).forEach((function(r){return e.registerReducer(r,t[r])}))},t}();Lt.decorators=[{type:e.Injectable}],Lt.ctorParameters=function(){return[{type:xt},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[ut]}]}]};var jt=function(){function t(t,e,r){this.entityCollectionCreator=t,this.entityCollectionReducerRegistry=e,this.logger=r}return t.prototype.create=function(){return function(t,e){void 0===t&&(t={});switch(e.type){case m.CLEAR_COLLECTIONS:return this.clearCollectionsReducer(t,e);case m.LOAD_COLLECTIONS:return this.loadCollectionsReducer(t,e);case m.MERGE_QUERY_SET:return this.mergeQuerySetReducer(t,e);case m.SAVE_ENTITIES:return this.saveEntitiesReducer(t,e);case m.SAVE_ENTITIES_CANCEL:return this.saveEntitiesCancelReducer(t,e);case m.SAVE_ENTITIES_ERROR:return this.saveEntitiesErrorReducer(t,e);case m.SAVE_ENTITIES_SUCCESS:return this.saveEntitiesSuccessReducer(t,e);case m.SET_ENTITY_CACHE:return e.payload.cache}var r=e.payload;if(r&&r.entityName&&r.entityOp&&!r.error)return this.applyCollectionReducer(t,e);return t}.bind(this)},t.prototype.clearCollectionsReducer=function(t,e){var r=this,n=e.payload,i=n.collections,a=(n.tag,U.REMOVE_ALL);return i||(i=Object.keys(t)),t=i.reduce((function(t,n){var i={entityName:n,entityOp:a},s={type:"["+n+"] "+e.type,payload:i};return t=r.applyCollectionReducer(t,s)}),t)},t.prototype.loadCollectionsReducer=function(t,e){var r=this,n=e.payload,i=n.collections,a=(n.tag,U.ADD_ALL);return t=Object.keys(i).reduce((function(t,n){var s={entityName:n,entityOp:a,data:i[n]},o={type:"["+n+"] "+e.type,payload:s};return t=r.applyCollectionReducer(t,o)}),t)},t.prototype.mergeQuerySetReducer=function(t,e){var r=this,n=e.payload,i=n.mergeStrategy,a=n.querySet;n.tag;i=null===i?O.PreserveChanges:i;var s=U.QUERY_MANY_SUCCESS;return t=Object.keys(a).reduce((function(t,n){var o={entityName:n,entityOp:s,data:a[n],mergeStrategy:i},c={type:"["+n+"] "+e.type,payload:o};return t=r.applyCollectionReducer(t,c)}),t)},t.prototype.saveEntitiesReducer=function(t,e){var r=this,n=e.payload,i=n.changeSet,a=n.correlationId,s=n.isOptimistic,o=n.mergeStrategy,c=n.tag;try{i.changes.forEach((function(n){var i=n.entityName,p={entityName:i,entityOp:u(n),data:n.entities,correlationId:a,isOptimistic:s,mergeStrategy:o,tag:c},h={type:"["+i+"] "+e.type,payload:p};if(t=r.applyCollectionReducer(t,h),h.payload.error)throw h.payload.error}))}catch(t){e.payload.error=t}return t;function u(t){switch(t.op){case E.Add:return U.SAVE_ADD_MANY;case E.Delete:return U.SAVE_DELETE_MANY;case E.Update:return U.SAVE_UPDATE_MANY;case E.Upsert:return U.SAVE_UPSERT_MANY}}},t.prototype.saveEntitiesCancelReducer=function(t,e){return this.clearLoadingFlags(t,e.payload.entityNames||[])},t.prototype.saveEntitiesErrorReducer=function(t,e){var r=e.payload.originalAction.payload.changeSet.changes.map((function(t){return t.entityName}));return this.clearLoadingFlags(t,r)},t.prototype.saveEntitiesSuccessReducer=function(t,e){var r=this,n=e.payload,i=n.changeSet,a=n.correlationId,s=n.isOptimistic,o=n.mergeStrategy,c=n.tag;return i.changes.forEach((function(n){var i=n.entityName,p={entityName:i,entityOp:u(n),data:n.entities,correlationId:a,isOptimistic:s,mergeStrategy:o,tag:c},h={type:"["+i+"] "+e.type,payload:p};t=r.applyCollectionReducer(t,h)})),t;function u(t){switch(t.op){case E.Add:return U.SAVE_ADD_MANY_SUCCESS;case E.Delete:return U.SAVE_DELETE_MANY_SUCCESS;case E.Update:return U.SAVE_UPDATE_MANY_SUCCESS;case E.Upsert:return U.SAVE_UPSERT_MANY_SUCCESS}}},t.prototype.applyCollectionReducer=function(t,e){var r;void 0===t&&(t={});var n,i=e.payload.entityName,a=t[i],s=this.entityCollectionReducerRegistry.getOrCreateReducer(i);try{n=s(a||this.entityCollectionCreator.create(i),e)}catch(t){this.logger.error(t),e.payload.error=t}return e.payload.error||a===n?t:Object.assign(Object.assign({},t),((r={})[i]=n,r))},t.prototype.clearLoadingFlags=function(t,e){var r=!1;return e.forEach((function(e){var n=t[e];n.loading&&(r||(t=Object.assign({},t),r=!0),t[e]=Object.assign(Object.assign({},n),{loading:!1}))})),t},t}();jt.decorators=[{type:e.Injectable}],jt.ctorParameters=function(){return[{type:Ot},{type:Lt},{type:Y}]};var kt=function(){function t(){}return t.prototype.error=function(t,e){t&&(e?console.error(t,e):console.error(t))},t.prototype.log=function(t,e){t&&(e?console.log(t,e):console.log(t))},t.prototype.warn=function(t,e){t&&(e?console.warn(t,e):console.warn(t))},t}();kt.decorators=[{type:e.Injectable}];var wt=["equipment","information","money","series"],Yt=function(){function t(t){var e=this;this.pluralNames={},t&&t.forEach((function(t){return e.registerPluralNames(t)}))}return t.prototype.pluralize=function(t){var e=this.pluralNames[t];return e||(wt.indexOf(t.toLowerCase())>=0?t:/[aeiou]y$/.test(t)?t+"s":t.endsWith("y")?t.substr(0,t.length-1)+"ies":/[s|ss|sh|ch|x|z]$/.test(t)?t+"es":t+"s")},t.prototype.registerPluralNames=function(t){this.pluralNames=Object.assign(Object.assign({},this.pluralNames),t||{})},t}();Yt.decorators=[{type:e.Injectable}],Yt.ctorParameters=function(){return[{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[P]}]}]};var Pt=function(){function t(t,r,n,i,a,o){this.reducerManager=t,this.injector=n,this.entityCacheName=i,this.initialState=a,this.metaReducers=o;var c=i||st;a="function"==typeof a?a():a;var u=(o||[]).map((function(t){return t instanceof e.InjectionToken?n.get(t):t}));this.entityCacheFeature={key:c,reducers:r.create(),reducerFactory:s.combineReducers,initialState:a||{},metaReducers:u},t.addFeature(this.entityCacheFeature)}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:ct,useValue:e.entityCacheMetaReducers?e.entityCacheMetaReducers:[]},{provide:ut,useValue:e.entityCollectionMetaReducers?e.entityCollectionMetaReducers:[]},{provide:P,multi:!0,useValue:e.pluralNames?e.pluralNames:{}}]}},t.prototype.ngOnDestroy=function(){this.reducerManager.removeFeature(this.entityCacheFeature)},t}();Pt.decorators=[{type:e.NgModule,args:[{imports:[s.StoreModule],providers:[et,rt,c,it,jt,yt,Ot,xt,It,Lt,_t,Dt,W,lt,At,Ct,Tt,{provide:ot,useValue:"entityCache"},{provide:Nt,useClass:Rt},{provide:Y,useClass:kt}]}]}],Pt.ctorParameters=function(){return[{type:s.ReducerManager},{type:jt},{type:e.Injector},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[ot]}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[pt]}]},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[ct]}]}]};var Vt=function(){function t(t,e,r){this.effectSources=t,this.addEffects(e),this.addEffects(r)}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:G,multi:!0,useValue:e.entityMetadata?e.entityMetadata:[]},{provide:ct,useValue:e.entityCacheMetaReducers?e.entityCacheMetaReducers:[]},{provide:ut,useValue:e.entityCollectionMetaReducers?e.entityCollectionMetaReducers:[]},{provide:P,multi:!0,useValue:e.pluralNames?e.pluralNames:{}}]}},t.prototype.addEffects=function(t){this.effectSources.addEffects(t)},t}();Vt.decorators=[{type:e.NgModule,args:[{imports:[Pt,o.EffectsModule],providers:[K,J,X,Et,vt,{provide:$,useClass:Q},{provide:Z,useClass:tt},{provide:V,useClass:Yt}]}]}],Vt.ctorParameters=function(){return[{type:o.EffectSources},{type:Et},{type:vt}]},t.ChangeSetItemFactory=f,t.ChangeSetOperation=E,t.ChangeType=bt,t.ClearCollections=A,t.CorrelationIdGenerator=et,t.DataServiceError=k,t.DefaultDataService=q,t.DefaultDataServiceConfig=w,t.DefaultDataServiceFactory=K,t.DefaultHttpUrlGenerator=Q,t.DefaultLogger=kt,t.DefaultPersistenceResultHandler=tt,t.DefaultPluralizer=Yt,t.ENTITY_CACHE_META_REDUCERS=ct,t.ENTITY_CACHE_NAME=st,t.ENTITY_CACHE_NAME_TOKEN=ot,t.ENTITY_CACHE_SELECTOR_TOKEN=ht,t.ENTITY_COLLECTION_META_REDUCERS=ut,t.ENTITY_METADATA_TOKEN=G,t.EntityActionFactory=c,t.EntityActionGuard=u,t.EntityCacheAction=m,t.EntityCacheDataService=J,t.EntityCacheDispatcher=it,t.EntityCacheEffects=Et,t.EntityCacheReducerFactory=jt,t.EntityChangeTrackerBase=Mt,t.EntityCollectionCreator=Ot,t.EntityCollectionReducerFactory=xt,t.EntityCollectionReducerMethods=Ut,t.EntityCollectionReducerMethodsFactory=It,t.EntityCollectionReducerRegistry=Lt,t.EntityCollectionServiceBase=St,t.EntityCollectionServiceElementsFactory=_t,t.EntityCollectionServiceFactory=Dt,t.EntityDataModule=Vt,t.EntityDataModuleWithoutEffects=Pt,t.EntityDataService=X,t.EntityDefinitionService=W,t.EntityDispatcherBase=at,t.EntityDispatcherDefaultOptions=rt,t.EntityDispatcherFactory=lt,t.EntityEffects=vt,t.EntityHttpResourceUrls=F,t.EntityOp=U,t.EntitySelectors$Factory=Ct,t.EntitySelectorsFactory=At,t.EntityServices=Nt,t.EntityServicesBase=Rt,t.EntityServicesElements=Tt,t.HttpUrlGenerator=$,t.INITIAL_ENTITY_CACHE_STATE=pt,t.LoadCollections=C,t.Logger=Y,t.MergeQuerySet=_,t.MergeStrategy=O,t.OP_ERROR=x,t.OP_SUCCESS=I,t.PLURAL_NAMES_TOKEN=P,t.PersistanceCanceled=nt,t.PersistenceResultHandler=Z,t.Pluralizer=V,t.PropsFilterFnFactory=function(t){return void 0===t&&(t=[]),0===t.length?function(t,e){return t}:function(e,r){if(!e)return[];var n="string"==typeof r?new RegExp(r,"i"):r;if(n){return e.filter((function(e){return t.some((function(t){return n.test(e[t])}))}))}return e}},t.SaveEntities=T,t.SaveEntitiesCancel=R,t.SaveEntitiesCanceled=N,t.SaveEntitiesError=b,t.SaveEntitiesSuccess=M,t.SetEntityCache=D,t.changeSetItemFactory=v,t.createEmptyEntityCollection=mt,t.createEntityCacheSelector=dt,t.createEntityDefinition=H,t.defaultSelectId=h,t.entityCacheSelectorProvider=yt,t.excludeEmptyChangeSetItems=S,t.flattenArgs=y,t.getGuid=function(){return"xxxxxxxxxx4xxyxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.getGuidComb=function(t){var e=("00"+(t||(new Date).getTime()).toString(16)).slice(-12);return"xxxxxxxxxx4xxyxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))+e},t.guidComparer=function(t,e){var r=t.slice(-12),n=e.slice(-12);return r!==n?r<n?-1:+(r!==n):t<e?-1:+(t!==e)},t.makeErrorOp=L,t.makeSuccessOp=j,t.normalizeRoot=B,t.ofEntityOp=l,t.ofEntityType=g,t.persistOps=ft,t.toUpdateFactory=d,t.ɵa=gt,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs/operators"),require("@angular/common/http"),require("rxjs"),require("@ngrx/entity"),require("@ngrx/store"),require("@ngrx/effects")):"function"==typeof define&&define.amd?define("@ngrx/data",["exports","@angular/core","rxjs/operators","@angular/common/http","rxjs","@ngrx/entity","@ngrx/store","@ngrx/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ngrx=t.ngrx||{},t.ngrx.data={}),t.ng.core,t.rxjs.operators,t.ng.common.http,t.rxjs,t.ngrx.entity,t.ngrx.store,t.ngrx.effects)}(this,(function(t,e,r,n,i,a,s,o){"use strict";var c=function(){function t(){}return t.prototype.create=function(t,e,r,n){var i="string"==typeof t?Object.assign(Object.assign({},n||{}),{entityName:t,entityOp:e,data:r}):t;return this.createCore(i)},t.prototype.createCore=function(t){var e=t.entityName,r=t.entityOp,n=t.tag;if(!e)throw new Error("Missing entity name for new action");if(null==r)throw new Error("Missing EntityOp for new action");return{type:this.formatActionType(r,n||e),payload:t}},t.prototype.createFromAction=function(t,e){return this.create(Object.assign(Object.assign({},t.payload),e))},t.prototype.formatActionType=function(t,e){return"["+e+"] "+t},t}();c.decorators=[{type:e.Injectable}];var p=function(){function t(t,e){this.entityName=t,this.selectId=e}return t.prototype.mustBeEntity=function(t){var e=this.extractData(t);if(!e)return this.throwError(t,"should have a single entity.");var r=this.selectId(e);return this.isNotKeyType(r)&&this.throwError(t,"has a missing or invalid entity key (id)"),e},t.prototype.mustBeEntities=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){var i=e.selectId(r);if(e.isNotKeyType(i)){var a=", item "+(n+1)+", does not have a valid entity key (id)";e.throwError(t,a)}})),r):this.throwError(t,"should be an array of entities")},t.prototype.mustBeKey=function(t){var e=this.extractData(t);if(!e)throw new Error("should be a single entity key");if(this.isNotKeyType(e))throw new Error("is not a valid key (id)");return e},t.prototype.mustBeKeys=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){if(e.isNotKeyType(r)){var i=e.entityName+" ', item "+(n+1)+", is not a valid entity key (id)";e.throwError(t,i)}})),r):this.throwError(t,"should be an array of entity keys (id)")},t.prototype.mustBeUpdate=function(t){var e=this.extractData(t);if(!e)return this.throwError(t,"should be a single entity update");var r=e.id,n=e.changes,i=this.selectId(n);return(this.isNotKeyType(r)||this.isNotKeyType(i))&&this.throwError(t,"has a missing or invalid entity key (id)"),e},t.prototype.mustBeUpdates=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){var i=r.id,a=r.changes,s=e.selectId(a);(e.isNotKeyType(i)||e.isNotKeyType(s))&&e.throwError(t,", item "+(n+1)+", has a missing or invalid entity key (id)")})),r):this.throwError(t,"should be an array of entity updates")},t.prototype.mustBeUpdateResponse=function(t){var e=this.extractData(t);if(!e)return this.throwError(t,"should be a single entity update");var r=e.id,n=e.changes,i=this.selectId(n);return(this.isNotKeyType(r)||this.isNotKeyType(i))&&this.throwError(t,"has a missing or invalid entity key (id)"),e},t.prototype.mustBeUpdateResponses=function(t){var e=this,r=this.extractData(t);return Array.isArray(r)?(r.forEach((function(r,n){var i=r.id,a=r.changes,s=e.selectId(a);(e.isNotKeyType(i)||e.isNotKeyType(s))&&e.throwError(t,", item "+(n+1)+", has a missing or invalid entity key (id)")})),r):this.throwError(t,"should be an array of entity updates")},t.prototype.extractData=function(t){return t.payload&&t.payload.data},t.prototype.isNotKeyType=function(t){return"string"!=typeof t&&"number"!=typeof t},t.prototype.throwError=function(t,e){throw new Error(this.entityName+' EntityAction guard for "'+t.type+'": payload '+e)},t}();
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */Object.create;function u(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s}var y;Object.create;function h(t){return null==t?void 0:t.id}function d(t){if(null==t)return[];if(Array.isArray(t[0])){var e=u(t);t=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}(e[0],e.slice(1))}return t}function l(t){return t=t||h,function(e){var r=t(e);if(null==r)throw new Error("Primary key may not be null/undefined.");return e&&{id:r,changes:e}}}function E(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=d(t);switch(n.length){case 0:return r.filter((function(t){return t.payload&&null!=t.payload.entityOp}));case 1:var i=n[0];return r.filter((function(t){return t.payload&&i===t.payload.entityOp}));default:return r.filter((function(t){var e=t.payload&&t.payload.entityOp;return e&&n.some((function(t){return t===e}))}))}}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=d(t);switch(n.length){case 0:return r.filter((function(t){return t.payload&&null!=t.payload.entityName}));case 1:var i=n[0];return r.filter((function(t){return t.payload&&i===t.payload.entityName}));default:return r.filter((function(t){var e=t.payload&&t.payload.entityName;return!!e&&n.some((function(t){return t===e}))}))}}t.ChangeSetOperation=void 0,(y=t.ChangeSetOperation||(t.ChangeSetOperation={})).Add="Add",y.Delete="Delete",y.Update="Update",y.Upsert="Upsert";var f,S,O=function(){function e(){}return e.prototype.add=function(e,r){return r=Array.isArray(r)?r:r?[r]:[],{entityName:e,op:t.ChangeSetOperation.Add,entities:r}},e.prototype.delete=function(e,r){var n=Array.isArray(r)?r:r?[r]:[];return{entityName:e,op:t.ChangeSetOperation.Delete,entities:n}},e.prototype.update=function(e,r){return r=Array.isArray(r)?r:r?[r]:[],{entityName:e,op:t.ChangeSetOperation.Update,entities:r}},e.prototype.upsert=function(e,r){return r=Array.isArray(r)?r:r?[r]:[],{entityName:e,op:t.ChangeSetOperation.Upsert,entities:r}},e}(),v=new O;function A(t){var e=(t=t&&t.changes?t:{changes:[]}).changes.filter((function(t){return null!=t&&t.entities&&t.entities.length>0}));return Object.assign(Object.assign({},t),{changes:e})}t.MergeStrategy=void 0,(f=t.MergeStrategy||(t.MergeStrategy={}))[f.IgnoreChanges=0]="IgnoreChanges",f[f.PreserveChanges=1]="PreserveChanges",f[f.OverwriteChanges=2]="OverwriteChanges",t.EntityCacheAction=void 0,(S=t.EntityCacheAction||(t.EntityCacheAction={})).CLEAR_COLLECTIONS="@ngrx/data/entity-cache/clear-collections",S.LOAD_COLLECTIONS="@ngrx/data/entity-cache/load-collections",S.MERGE_QUERY_SET="@ngrx/data/entity-cache/merge-query-set",S.SET_ENTITY_CACHE="@ngrx/data/entity-cache/set-cache",S.SAVE_ENTITIES="@ngrx/data/entity-cache/save-entities",S.SAVE_ENTITIES_CANCEL="@ngrx/data/entity-cache/save-entities-cancel",S.SAVE_ENTITIES_CANCELED="@ngrx/data/entity-cache/save-entities-canceled",S.SAVE_ENTITIES_ERROR="@ngrx/data/entity-cache/save-entities-error",S.SAVE_ENTITIES_SUCCESS="@ngrx/data/entity-cache/save-entities-success";var m,C=function(e,r){this.type=t.EntityCacheAction.CLEAR_COLLECTIONS,this.payload={collections:e,tag:r}},_=function(e,r){this.type=t.EntityCacheAction.LOAD_COLLECTIONS,this.payload={collections:e,tag:r}},T=function(e,r,n){this.type=t.EntityCacheAction.MERGE_QUERY_SET,this.payload={querySet:e,mergeStrategy:null===r?t.MergeStrategy.PreserveChanges:r,tag:n}},D=function(e,r){this.cache=e,this.type=t.EntityCacheAction.SET_ENTITY_CACHE,this.payload={cache:e,tag:r}},R=function(e,r,n){this.type=t.EntityCacheAction.SAVE_ENTITIES,n=n||{},e&&(e.tag=e.tag||n.tag),this.payload=Object.assign(Object.assign({changeSet:e,url:r},n),{tag:e.tag})},M=function(e,r,n,i){this.type=t.EntityCacheAction.SAVE_ENTITIES_CANCEL,this.payload={correlationId:e,reason:r,entityNames:n,tag:i}},b=function(e,r,n){this.type=t.EntityCacheAction.SAVE_ENTITIES_CANCEL,this.payload={correlationId:e,reason:r,tag:n}},N=function(e,r){this.type=t.EntityCacheAction.SAVE_ENTITIES_ERROR;var n=r.payload.correlationId;this.payload={error:e,originalAction:r,correlationId:n}},U=function(e,r,n){this.type=t.EntityCacheAction.SAVE_ENTITIES_SUCCESS,n=n||{},e&&(e.tag=e.tag||n.tag),this.payload=Object.assign(Object.assign({changeSet:e,url:r},n),{tag:e.tag})};t.EntityOp=void 0,(m=t.EntityOp||(t.EntityOp={})).CANCEL_PERSIST="@ngrx/data/cancel-persist",m.CANCELED_PERSIST="@ngrx/data/canceled-persist",m.QUERY_ALL="@ngrx/data/query-all",m.QUERY_ALL_SUCCESS="@ngrx/data/query-all/success",m.QUERY_ALL_ERROR="@ngrx/data/query-all/error",m.QUERY_LOAD="@ngrx/data/query-load",m.QUERY_LOAD_SUCCESS="@ngrx/data/query-load/success",m.QUERY_LOAD_ERROR="@ngrx/data/query-load/error",m.QUERY_MANY="@ngrx/data/query-many",m.QUERY_MANY_SUCCESS="@ngrx/data/query-many/success",m.QUERY_MANY_ERROR="@ngrx/data/query-many/error",m.QUERY_BY_KEY="@ngrx/data/query-by-key",m.QUERY_BY_KEY_SUCCESS="@ngrx/data/query-by-key/success",m.QUERY_BY_KEY_ERROR="@ngrx/data/query-by-key/error",m.SAVE_ADD_MANY="@ngrx/data/save/add-many",m.SAVE_ADD_MANY_ERROR="@ngrx/data/save/add-many/error",m.SAVE_ADD_MANY_SUCCESS="@ngrx/data/save/add-many/success",m.SAVE_ADD_ONE="@ngrx/data/save/add-one",m.SAVE_ADD_ONE_ERROR="@ngrx/data/save/add-one/error",m.SAVE_ADD_ONE_SUCCESS="@ngrx/data/save/add-one/success",m.SAVE_DELETE_MANY="@ngrx/data/save/delete-many",m.SAVE_DELETE_MANY_SUCCESS="@ngrx/data/save/delete-many/success",m.SAVE_DELETE_MANY_ERROR="@ngrx/data/save/delete-many/error",m.SAVE_DELETE_ONE="@ngrx/data/save/delete-one",m.SAVE_DELETE_ONE_SUCCESS="@ngrx/data/save/delete-one/success",m.SAVE_DELETE_ONE_ERROR="@ngrx/data/save/delete-one/error",m.SAVE_UPDATE_MANY="@ngrx/data/save/update-many",m.SAVE_UPDATE_MANY_SUCCESS="@ngrx/data/save/update-many/success",m.SAVE_UPDATE_MANY_ERROR="@ngrx/data/save/update-many/error",m.SAVE_UPDATE_ONE="@ngrx/data/save/update-one",m.SAVE_UPDATE_ONE_SUCCESS="@ngrx/data/save/update-one/success",m.SAVE_UPDATE_ONE_ERROR="@ngrx/data/save/update-one/error",m.SAVE_UPSERT_MANY="@ngrx/data/save/upsert-many",m.SAVE_UPSERT_MANY_SUCCESS="@ngrx/data/save/upsert-many/success",m.SAVE_UPSERT_MANY_ERROR="@ngrx/data/save/upsert-many/error",m.SAVE_UPSERT_ONE="@ngrx/data/save/upsert-one",m.SAVE_UPSERT_ONE_SUCCESS="@ngrx/data/save/upsert-one/success",m.SAVE_UPSERT_ONE_ERROR="@ngrx/data/save/upsert-one/error",m.ADD_ALL="@ngrx/data/add-all",m.ADD_MANY="@ngrx/data/add-many",m.ADD_ONE="@ngrx/data/add-one",m.REMOVE_ALL="@ngrx/data/remove-all",m.REMOVE_MANY="@ngrx/data/remove-many",m.REMOVE_ONE="@ngrx/data/remove-one",m.UPDATE_MANY="@ngrx/data/update-many",m.UPDATE_ONE="@ngrx/data/update-one",m.UPSERT_MANY="@ngrx/data/upsert-many",m.UPSERT_ONE="@ngrx/data/upsert-one",m.COMMIT_ALL="@ngrx/data/commit-all",m.COMMIT_MANY="@ngrx/data/commit-many",m.COMMIT_ONE="@ngrx/data/commit-one",m.UNDO_ALL="@ngrx/data/undo-all",m.UNDO_MANY="@ngrx/data/undo-many",m.UNDO_ONE="@ngrx/data/undo-one",m.SET_CHANGE_STATE="@ngrx/data/set-change-state",m.SET_COLLECTION="@ngrx/data/set-collection",m.SET_FILTER="@ngrx/data/set-filter",m.SET_LOADED="@ngrx/data/set-loaded",m.SET_LOADING="@ngrx/data/set-loading";var I="/success",x="/error";function L(t){return t+x}function j(t){return t+I}var k=function(t,e){this.error=t,this.requestData=e,this.message="string"==typeof t?t:function(t){var e=t.error,r=t.body,n=t.message,i=null;return e?i="string"==typeof e?e:e.message:n?i=n:r&&(i="string"==typeof r?r:r.error),"string"==typeof i?i:i?JSON.stringify(i):null}(t)};var w=function(){},Y=function(){},P=new e.InjectionToken("@ngrx/data Plural Names"),V=function(){},F=function(){},$=function(){},Q=function(){function t(t){this.pluralizer=t,this.knownHttpResourceUrls={}}return t.prototype.getResourceUrls=function(t,e){var r,n=this.knownHttpResourceUrls[t];if(!n){var i=B(e);n={entityResourceUrl:(i+"/"+t+"/").toLowerCase(),collectionResourceUrl:(i+"/"+this.pluralizer.pluralize(t)+"/").toLowerCase()},this.registerHttpResourceUrls(((r={})[t]=n,r))}return n},t.prototype.entityResource=function(t,e){return this.getResourceUrls(t,e).entityResourceUrl},t.prototype.collectionResource=function(t,e){return this.getResourceUrls(t,e).collectionResourceUrl},t.prototype.registerHttpResourceUrls=function(t){this.knownHttpResourceUrls=Object.assign(Object.assign({},this.knownHttpResourceUrls),t||{})},t}();function B(t){return t.replace(/^[\/\s]+|[\/\s]+$/g,"")}Q.decorators=[{type:e.Injectable}],Q.ctorParameters=function(){return[{type:V}]};var q=function(){function t(t,e,r,n){this.http=e,this.httpUrlGenerator=r,this.getDelay=0,this.saveDelay=0,this.timeout=0,this._name=t+" DefaultDataService",this.entityName=t;var i=n||{},a=i.root,s=void 0===a?"api":a,o=i.delete404OK,c=void 0===o||o,p=i.getDelay,u=void 0===p?0:p,y=i.saveDelay,h=void 0===y?0:y,d=i.timeout,l=void 0===d?0:d;this.delete404OK=c,this.entityUrl=r.entityResource(t,s),this.entitiesUrl=r.collectionResource(t,s),this.getDelay=u,this.saveDelay=h,this.timeout=l}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var e=t||new Error('No "'+this.entityName+'" entity to add');return this.execute("POST",this.entityUrl,e)},t.prototype.delete=function(t){var e;return null==t&&(e=new Error('No "'+this.entityName+'" key to delete')),this.execute("DELETE",this.entityUrl+t,e).pipe(r.map((function(e){return t})))},t.prototype.getAll=function(){return this.execute("GET",this.entitiesUrl)},t.prototype.getById=function(t){var e;return null==t&&(e=new Error('No "'+this.entityName+'" key to get')),this.execute("GET",this.entityUrl+t,e)},t.prototype.getWithQuery=function(t){var e="string"==typeof t?{fromString:t}:{fromObject:t},r=new n.HttpParams(e);return this.execute("GET",this.entitiesUrl,void 0,{params:r})},t.prototype.update=function(t){var e=t&&t.id,r=null==e?new Error('No "'+this.entityName+'" update data or id'):t.changes;return this.execute("PUT",this.entityUrl+e,r)},t.prototype.upsert=function(t){var e=t||new Error('No "'+this.entityName+'" entity to upsert');return this.execute("POST",this.entityUrl,e)},t.prototype.execute=function(t,e,n,a){var s,o={method:t,url:e,data:n,options:a};if(n instanceof Error)return this.handleError(o)(n);switch(t){case"DELETE":s=this.http.delete(e,a),this.saveDelay&&(s=s.pipe(r.delay(this.saveDelay)));break;case"GET":s=this.http.get(e,a),this.getDelay&&(s=s.pipe(r.delay(this.getDelay)));break;case"POST":s=this.http.post(e,n,a),this.saveDelay&&(s=s.pipe(r.delay(this.saveDelay)));break;case"PUT":s=this.http.put(e,n,a),this.saveDelay&&(s=s.pipe(r.delay(this.saveDelay)));break;default:var c=new Error("Unimplemented HTTP method, "+t);s=i.throwError(c)}return this.timeout&&(s=s.pipe(r.timeout(this.timeout+this.saveDelay))),s.pipe(r.catchError(this.handleError(o)))},t.prototype.handleError=function(t){var e=this;return function(r){var n=e.handleDelete404(r,t);if(n)return n;var a=new k(r,t);return i.throwError(a)}},t.prototype.handleDelete404=function(t,e){if(404===t.status&&"DELETE"===e.method&&this.delete404OK)return i.of({})},t}(),K=function(){function t(t,e,r){this.http=t,this.httpUrlGenerator=e,this.config=r,r=r||{},e.registerHttpResourceUrls(r.entityHttpResourceUrls)}return t.prototype.create=function(t){return new q(t,this.http,this.httpUrlGenerator,this.config)},t}();function H(t){var e=t.entityName;if(!e)throw new Error("Missing required entityName");t.entityName=e=e.trim();var r=t.selectId||h,n=t.sortComparer=t.sortComparer||!1,i=a.createEntityAdapter({selectId:r,sortComparer:n}),s=t.entityDispatcherOptions||{},o=i.getInitialState(Object.assign({entityName:e,filter:"",loaded:!1,loading:!1,changeState:{}},t.additionalCollectionState||{}));return{entityName:e,entityAdapter:i,entityDispatcherOptions:s,initialState:o,metadata:t,noChangeTracking:!0===t.noChangeTracking,selectId:r,sortComparer:n}}K.decorators=[{type:e.Injectable}],K.ctorParameters=function(){return[{type:n.HttpClient},{type:$},{type:w,decorators:[{type:e.Optional}]}]};var G=new e.InjectionToken("@ngrx/data Entity Metadata"),W=function(){function t(t){var e=this;this.definitions={},t&&t.forEach((function(t){return e.registerMetadataMap(t)}))}return t.prototype.getDefinition=function(t,e){void 0===e&&(e=!0),t=t.trim();var r=this.definitions[t];if(!r&&e)throw new Error('No EntityDefinition for entity type "'+t+'".');return r},t.prototype.registerMetadata=function(t){if(t){var e=H(t);this.registerDefinition(e)}},t.prototype.registerMetadataMap=function(t){var e=this;void 0===t&&(t={}),Object.keys(t||{}).forEach((function(r){return e.registerMetadata(Object.assign({entityName:r},t[r]))}))},t.prototype.registerDefinition=function(t){this.definitions[t.entityName]=t},t.prototype.registerDefinitions=function(t){Object.assign(this.definitions,t)},t}();W.decorators=[{type:e.Injectable}],W.ctorParameters=function(){return[{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[G]}]}]};var z=t.ChangeSetOperation.Update,J=function(){function t(t,e,r){this.entityDefinitionService=t,this.http=e,this.idSelectors={},this.saveDelay=0,this.timeout=0;var n=r||{},i=n.saveDelay,a=void 0===i?0:i,s=n.timeout,o=void 0===s?0:s;this.saveDelay=a,this.timeout=o}return t.prototype.saveEntities=function(t,e){var n=this;t=this.filterChangeSet(t),t=this.flattenUpdates(t);var i=this.http.post(e,t).pipe(r.map((function(t){return n.restoreUpdates(t)})),r.catchError(this.handleError({method:"POST",url:e,data:t})));return this.timeout&&(i=i.pipe(r.timeout(this.timeout))),this.saveDelay&&(i=i.pipe(r.delay(this.saveDelay))),i},t.prototype.handleError=function(t){return function(e){var r=new k(e,t);return i.throwError(r)}},t.prototype.filterChangeSet=function(t){return A(t)},t.prototype.flattenUpdates=function(t){var e=t.changes;if(0===e.length)return t;var r=!1;return e=e.map((function(t){return t.op===z&&t.entities.length>0?(r=!0,Object.assign(Object.assign({},t),{entities:t.entities.map((function(t){return t.changes}))})):t})),r?Object.assign(Object.assign({},t),{changes:e}):t},t.prototype.restoreUpdates=function(t){var e=this;if(null==t)return t;var r=t.changes;if(0===r.length)return t;var n=!1;return r=r.map((function(t){if(t.op===z){n=!0;var r=e.getIdSelector(t.entityName);return Object.assign(Object.assign({},t),{entities:t.entities.map((function(t){return{id:r(t),changes:t}}))})}return t})),n?Object.assign(Object.assign({},t),{changes:r}):t},t.prototype.getIdSelector=function(t){var e=this.idSelectors[t];return e||(e=this.entityDefinitionService.getDefinition(t).selectId,this.idSelectors[t]=e),e},t}();J.decorators=[{type:e.Injectable}],J.ctorParameters=function(){return[{type:W},{type:n.HttpClient},{type:w,decorators:[{type:e.Optional}]}]};var X=function(){function t(t){this.defaultDataServiceFactory=t,this.services={}}return t.prototype.getService=function(t){t=t.trim();var e=this.services[t];return e||(e=this.defaultDataServiceFactory.create(t),this.services[t]=e),e},t.prototype.registerService=function(t,e){this.services[t.trim()]=e},t.prototype.registerServices=function(t){this.services=Object.assign(Object.assign({},this.services),t)},t}();X.decorators=[{type:e.Injectable}],X.ctorParameters=function(){return[{type:K}]};var Z=function(){},tt=function(){function t(t,e){this.logger=t,this.entityActionFactory=e}return t.prototype.handleSuccess=function(t){var e=this,r=j(t.payload.entityOp);return function(n){return e.entityActionFactory.createFromAction(t,{entityOp:r,data:n})}},t.prototype.handleError=function(t){var e=this,r=L(t.payload.entityOp);return function(n){var i={error:n instanceof k?n:new k(n,null),originalAction:t};return e.logger.error(i),e.entityActionFactory.createFromAction(t,{entityOp:r,data:i})}},t}();tt.decorators=[{type:e.Injectable}],tt.ctorParameters=function(){return[{type:Y},{type:c}]};var et=function(){function t(){this.seed=0,this.prefix="CRID"}return t.prototype.next=function(){return this.seed+=1,this.prefix+this.seed},t}();et.decorators=[{type:e.Injectable}];var rt=function(){this.optimisticAdd=!1,this.optimisticDelete=!0,this.optimisticUpdate=!1,this.optimisticUpsert=!1,this.optimisticSaveEntities=!1};rt.decorators=[{type:e.Injectable}];var nt=function(t){this.message=t,this.message=t||"Canceled by user"},it=function(){function e(t,e,n,i){this.correlationIdGenerator=t,this.defaultDispatcherOptions=e,this.store=i,this.reducedActions$=n.pipe(r.shareReplay(1)),this.raSubscription=this.reducedActions$.subscribe()}return e.prototype.dispatch=function(t){return this.store.dispatch(t),t},e.prototype.cancelSaveEntities=function(t,e,r,n){if(!t)throw new Error("Missing correlationId");var i=new M(t,e,r,n);this.dispatch(i)},e.prototype.clearCollections=function(t,e){this.dispatch(new C(t,e))},e.prototype.loadCollections=function(t,e){this.dispatch(new _(t,e))},e.prototype.mergeQuerySet=function(t,e,r){this.dispatch(new T(t,e,r))},e.prototype.setEntityCache=function(t,e){this.dispatch(new D(t,e))},e.prototype.saveEntities=function(t,e,n){var i=Array.isArray(t)?{changes:t}:t,a=null==(n=n||{}).correlationId?this.correlationIdGenerator.next():n.correlationId,s=null==n.isOptimistic?this.defaultDispatcherOptions.optimisticSaveEntities||!1:!0===n.isOptimistic,o=n.tag||"Save Entities";n=Object.assign(Object.assign({},n),{correlationId:a,isOptimistic:s,tag:o});var c=new R(i,e,n);return this.dispatch(c),this.getSaveEntitiesResponseData$(n.correlationId).pipe(r.shareReplay(1))},e.prototype.getSaveEntitiesResponseData$=function(e){return this.reducedActions$.pipe(r.filter((function(e){return e.type===t.EntityCacheAction.SAVE_ENTITIES_SUCCESS||e.type===t.EntityCacheAction.SAVE_ENTITIES_ERROR||e.type===t.EntityCacheAction.SAVE_ENTITIES_CANCEL})),r.filter((function(t){return e===t.payload.correlationId})),r.take(1),r.mergeMap((function(e){return e.type===t.EntityCacheAction.SAVE_ENTITIES_CANCEL?i.throwError(new nt(e.payload.reason)):e.type===t.EntityCacheAction.SAVE_ENTITIES_SUCCESS?i.of(e.payload.changeSet):i.throwError(e.payload)})))},e}();it.decorators=[{type:e.Injectable}],it.ctorParameters=function(){return[{type:et},{type:rt},{type:i.Observable,decorators:[{type:e.Inject,args:[s.ScannedActionsSubject]}]},{type:s.Store}]};var at=function(){function e(t,e,r,n,i,a,o,c){void 0===n&&(n=h),this.entityName=t,this.entityActionFactory=e,this.store=r,this.selectId=n,this.defaultDispatcherOptions=i,this.reducedActions$=a,this.correlationIdGenerator=c,this.guard=new p(t,n),this.toUpdate=l(n);var u=s.createSelector(o,(function(e){return e[t]}));this.entityCollection$=r.select(u)}return e.prototype.createEntityAction=function(t,e,r){return this.entityActionFactory.create(Object.assign({entityName:this.entityName,entityOp:t,data:e},r))},e.prototype.createAndDispatch=function(t,e,r){var n=this.createEntityAction(t,e,r);return this.dispatch(n),n},e.prototype.dispatch=function(t){return this.store.dispatch(t),t},e.prototype.add=function(e,n){var i=this;n=this.setSaveEntityActionOptions(n,this.defaultDispatcherOptions.optimisticAdd);var a=this.createEntityAction(t.EntityOp.SAVE_ADD_ONE,e,n);return n.isOptimistic&&this.guard.mustBeEntity(a),this.dispatch(a),this.getResponseData$(n.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=u(t,2),r=e[0];return e[1].entities[i.selectId(r)]})),r.shareReplay(1))},e.prototype.cancel=function(e,r,n){if(!e)throw new Error("Missing correlationId");this.createAndDispatch(t.EntityOp.CANCEL_PERSIST,r,{correlationId:e})},e.prototype.delete=function(e,n){n=this.setSaveEntityActionOptions(n,this.defaultDispatcherOptions.optimisticDelete);var i=this.getKey(e),a=this.createEntityAction(t.EntityOp.SAVE_DELETE_ONE,i,n);return this.guard.mustBeKey(a),this.dispatch(a),this.getResponseData$(n.correlationId).pipe(r.map((function(){return i})),r.shareReplay(1))},e.prototype.getAll=function(e){var n=this;e=this.setQueryEntityActionOptions(e);var i=this.createEntityAction(t.EntityOp.QUERY_ALL,null,e);return this.dispatch(i),this.getResponseData$(e.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=u(t,2),r=e[0],i=e[1];return r.reduce((function(t,e){var r=i.entities[n.selectId(e)];return r&&t.push(r),t}),[])})),r.shareReplay(1))},e.prototype.getByKey=function(e,n){var i=this;n=this.setQueryEntityActionOptions(n);var a=this.createEntityAction(t.EntityOp.QUERY_BY_KEY,e,n);return this.dispatch(a),this.getResponseData$(n.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=u(t,2),r=e[0];return e[1].entities[i.selectId(r)]})),r.shareReplay(1))},e.prototype.getWithQuery=function(e,n){var i=this;n=this.setQueryEntityActionOptions(n);var a=this.createEntityAction(t.EntityOp.QUERY_MANY,e,n);return this.dispatch(a),this.getResponseData$(n.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=u(t,2),r=e[0],n=e[1];return r.reduce((function(t,e){var r=n.entities[i.selectId(e)];return r&&t.push(r),t}),[])})),r.shareReplay(1))},e.prototype.load=function(e){e=this.setQueryEntityActionOptions(e);var n=this.createEntityAction(t.EntityOp.QUERY_LOAD,null,e);return this.dispatch(n),this.getResponseData$(e.correlationId).pipe(r.shareReplay(1))},e.prototype.update=function(e,n){var i=this,a=this.toUpdate(e);n=this.setSaveEntityActionOptions(n,this.defaultDispatcherOptions.optimisticUpdate);var s=this.createEntityAction(t.EntityOp.SAVE_UPDATE_ONE,a,n);return n.isOptimistic&&this.guard.mustBeUpdate(s),this.dispatch(s),this.getResponseData$(n.correlationId).pipe(r.map((function(t){return t.changes})),r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=u(t,2),r=e[0];return e[1].entities[i.selectId(r)]})),r.shareReplay(1))},e.prototype.upsert=function(e,n){var i=this;n=this.setSaveEntityActionOptions(n,this.defaultDispatcherOptions.optimisticUpsert);var a=this.createEntityAction(t.EntityOp.SAVE_UPSERT_ONE,e,n);return n.isOptimistic&&this.guard.mustBeEntity(a),this.dispatch(a),this.getResponseData$(n.correlationId).pipe(r.withLatestFrom(this.entityCollection$),r.map((function(t){var e=u(t,2),r=e[0];return e[1].entities[i.selectId(r)]})),r.shareReplay(1))},e.prototype.addAllToCache=function(e,r){this.createAndDispatch(t.EntityOp.ADD_ALL,e,r)},e.prototype.addOneToCache=function(e,r){this.createAndDispatch(t.EntityOp.ADD_ONE,e,r)},e.prototype.addManyToCache=function(e,r){this.createAndDispatch(t.EntityOp.ADD_MANY,e,r)},e.prototype.clearCache=function(e){this.createAndDispatch(t.EntityOp.REMOVE_ALL,void 0,e)},e.prototype.removeOneFromCache=function(e,r){this.createAndDispatch(t.EntityOp.REMOVE_ONE,this.getKey(e),r)},e.prototype.removeManyFromCache=function(e,r){var n=this;if(e&&0!==e.length){var i="object"==typeof e[0]?e.map((function(t){return n.getKey(t)})):e;this.createAndDispatch(t.EntityOp.REMOVE_MANY,i,r)}},e.prototype.updateOneInCache=function(e,r){var n=this.toUpdate(e);this.createAndDispatch(t.EntityOp.UPDATE_ONE,n,r)},e.prototype.updateManyInCache=function(e,r){var n=this;if(e&&0!==e.length){var i=e.map((function(t){return n.toUpdate(t)}));this.createAndDispatch(t.EntityOp.UPDATE_MANY,i,r)}},e.prototype.upsertOneInCache=function(e,r){this.createAndDispatch(t.EntityOp.UPSERT_ONE,e,r)},e.prototype.upsertManyInCache=function(e,r){e&&0!==e.length&&this.createAndDispatch(t.EntityOp.UPSERT_MANY,e,r)},e.prototype.setFilter=function(e){this.createAndDispatch(t.EntityOp.SET_FILTER,e)},e.prototype.setLoaded=function(e){this.createAndDispatch(t.EntityOp.SET_LOADED,!!e)},e.prototype.setLoading=function(e){this.createAndDispatch(t.EntityOp.SET_LOADING,!!e)},e.prototype.getKey=function(t){return"object"==typeof t?this.selectId(t):t},e.prototype.getResponseData$=function(e){var n=this;return this.reducedActions$.pipe(r.filter((function(t){return!!t.payload})),r.filter((function(r){var i=r.payload,a=i.correlationId,s=i.entityName,o=i.entityOp;return s===n.entityName&&a===e&&(o.endsWith(I)||o.endsWith(x)||o===t.EntityOp.CANCEL_PERSIST)})),r.take(1),r.mergeMap((function(e){var r=e.payload.entityOp;return r===t.EntityOp.CANCEL_PERSIST?i.throwError(new nt(e.payload.data)):r.endsWith(I)?i.of(e.payload.data):i.throwError(e.payload.data.error)})))},e.prototype.setQueryEntityActionOptions=function(t){var e=null==(t=t||{}).correlationId?this.correlationIdGenerator.next():t.correlationId;return Object.assign(Object.assign({},t),{correlationId:e})},e.prototype.setSaveEntityActionOptions=function(t,e){var r=null==(t=t||{}).correlationId?this.correlationIdGenerator.next():t.correlationId,n=null==t.isOptimistic?e||!1:!0===t.isOptimistic;return Object.assign(Object.assign({},t),{correlationId:r,isOptimistic:n})},e}(),st="entityCache",ot=new e.InjectionToken("@ngrx/data Entity Cache Name"),ct=new e.InjectionToken("@ngrx/data Entity Cache Meta Reducers"),pt=new e.InjectionToken("@ngrx/data Entity Collection Meta Reducers"),ut=new e.InjectionToken("@ngrx/data Initial Entity Cache State"),yt=new e.InjectionToken("@ngrx/data Entity Cache Selector"),ht={provide:yt,useFactory:dt,deps:[[new e.Optional,ot]]};function dt(t){return t=t||st,s.createFeatureSelector(t)}var lt=function(){function t(t,e,n,i,a,s){this.entityActionFactory=t,this.store=e,this.entityDispatcherDefaultOptions=n,this.entityCacheSelector=a,this.correlationIdGenerator=s,this.reducedActions$=i.pipe(r.shareReplay(1)),this.raSubscription=this.reducedActions$.subscribe()}return t.prototype.create=function(t,e,r){void 0===e&&(e=h),void 0===r&&(r={});var n=Object.assign(Object.assign({},this.entityDispatcherDefaultOptions),r);return new at(t,this.entityActionFactory,this.store,e,n,this.reducedActions$,this.entityCacheSelector,this.correlationIdGenerator)},t.prototype.ngOnDestroy=function(){this.raSubscription.unsubscribe()},t}();lt.decorators=[{type:e.Injectable}],lt.ctorParameters=function(){return[{type:c},{type:s.Store},{type:rt},{type:i.Observable,decorators:[{type:e.Inject,args:[s.ScannedActionsSubject]}]},{type:void 0,decorators:[{type:e.Inject,args:[yt]}]},{type:et}]};var Et=new e.InjectionToken("@ngrx/data Entity Effects Scheduler"),gt=function(){function e(e,n,i,a,s){var c=this;this.actions=e,this.dataService=n,this.entityActionFactory=i,this.logger=a,this.scheduler=s,this.responseDelay=10,this.saveEntitiesCancel$=o.createEffect((function(){return c.actions.pipe(o.ofType(t.EntityCacheAction.SAVE_ENTITIES_CANCEL),r.filter((function(t){return null!=t.payload.correlationId})))}),{dispatch:!1}),this.saveEntities$=o.createEffect((function(){return c.actions.pipe(o.ofType(t.EntityCacheAction.SAVE_ENTITIES),r.mergeMap((function(t){return c.saveEntities(t)})))}))}return e.prototype.saveEntities=function(t){var e=this,n=t.payload.error;if(n)return this.handleSaveEntitiesError$(t)(n);try{var a=A(t.payload.changeSet),s=t.payload,o=s.correlationId,c=s.mergeStrategy,p=s.tag,u=s.url,y={correlationId:o,mergeStrategy:c,tag:p};if(0===a.changes.length)return i.of(new U(a,u,y));var h=this.saveEntitiesCancel$.pipe(r.filter((function(t){return o===t.payload.correlationId})),r.map((function(t){return new b(o,t.payload.reason,t.payload.tag)}))),d=this.dataService.saveEntities(a,u).pipe(r.concatMap((function(r){return e.handleSaveEntitiesSuccess$(t,e.entityActionFactory)(r)})),r.catchError(this.handleSaveEntitiesError$(t)));return i.race(h,d)}catch(e){return this.handleSaveEntitiesError$(t)(e)}},e.prototype.handleSaveEntitiesError$=function(t){var e=this;return function(n){var a=n instanceof k?n:new k(n,null);return i.of(new N(a,t)).pipe(r.delay(e.responseDelay,e.scheduler||i.asyncScheduler))}},e.prototype.handleSaveEntitiesSuccess$=function(e,r){var n=e.payload,a=n.url,s={correlationId:n.correlationId,mergeStrategy:n.mergeStrategy,tag:n.tag};return function(n){if(n)return i.of(new U(n,a,s));if(n=e.payload.changeSet,!e.payload.isOptimistic)return i.of(new U(n,a,s));var o=n.changes.reduce((function(t,e){return-1===t.indexOf(e.entityName)?t.concat(e.entityName):t}),[]);return i.merge(o.map((function(e){return r.create(e,t.EntityOp.SET_LOADING,!1)})))}},e}();gt.decorators=[{type:e.Injectable}],gt.ctorParameters=function(){return[{type:o.Actions},{type:J},{type:c},{type:Y},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[Et]}]}]};var ft=[t.EntityOp.QUERY_ALL,t.EntityOp.QUERY_LOAD,t.EntityOp.QUERY_BY_KEY,t.EntityOp.QUERY_MANY,t.EntityOp.SAVE_ADD_ONE,t.EntityOp.SAVE_DELETE_ONE,t.EntityOp.SAVE_UPDATE_ONE,t.EntityOp.SAVE_UPSERT_ONE],St=function(){function e(e,n,i,a,s){var c=this;this.actions=e,this.dataService=n,this.entityActionFactory=i,this.resultHandler=a,this.scheduler=s,this.responseDelay=10,this.cancel$=o.createEffect((function(){return c.actions.pipe(E(t.EntityOp.CANCEL_PERSIST),r.map((function(t){return t.payload.correlationId})),r.filter((function(t){return null!=t})))}),{dispatch:!1}),this.persist$=o.createEffect((function(){return c.actions.pipe(E(ft),r.mergeMap((function(t){return c.persist(t)})))}))}return e.prototype.persist=function(e){var n=this;if(e.payload.skip)return this.handleSkipSuccess$(e);if(e.payload.error)return this.handleError$(e)(e.payload.error);try{var a=this.cancel$.pipe(r.filter((function(t){return e.payload.correlationId===t})),r.map((function(r){return n.entityActionFactory.createFromAction(e,{entityOp:t.EntityOp.CANCELED_PERSIST})}))),s=this.callDataService(e).pipe(r.map(this.resultHandler.handleSuccess(e)),r.catchError(this.handleError$(e)));return i.race(a,s)}catch(t){return this.handleError$(e)(t)}},e.prototype.callDataService=function(e){var n=e.payload,i=n.entityName,a=n.entityOp,s=n.data,o=this.dataService.getService(i);switch(a){case t.EntityOp.QUERY_ALL:case t.EntityOp.QUERY_LOAD:return o.getAll();case t.EntityOp.QUERY_BY_KEY:return o.getById(s);case t.EntityOp.QUERY_MANY:return o.getWithQuery(s);case t.EntityOp.SAVE_ADD_ONE:return o.add(s);case t.EntityOp.SAVE_DELETE_ONE:return o.delete(s);case t.EntityOp.SAVE_UPDATE_ONE:var c=s.id,p=s.changes;return o.update(s).pipe(r.map((function(t){return t&&Object.keys(t).length>0?{id:c,changes:Object.assign(Object.assign({},p),t),changed:!0}:{id:c,changes:p,changed:!1}})));case t.EntityOp.SAVE_UPSERT_ONE:return o.upsert(s).pipe(r.map((function(t){return t&&Object.keys(t).length>0?t:s})));default:throw new Error('Persistence action "'+a+'" is not implemented.')}},e.prototype.handleError$=function(t){var e=this;return function(n){return i.of(e.resultHandler.handleError(t)(n)).pipe(r.delay(e.responseDelay,e.scheduler||i.asyncScheduler))}},e.prototype.handleSkipSuccess$=function(t){var e=j(t.payload.entityOp),n=this.entityActionFactory.createFromAction(t,{entityOp:e});return i.of(n).pipe(r.delay(this.responseDelay,this.scheduler||i.asyncScheduler))},e}();St.decorators=[{type:e.Injectable}],St.ctorParameters=function(){return[{type:o.Actions},{type:X},{type:c},{type:Z},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[Et]}]}]};var Ot=function(){function t(t,e){this.entityName=t,t=t.trim();var r=e.create(t),n=r.dispatcher,i=r.selectors,a=r.selectors$;this.entityName=t,this.dispatcher=n,this.guard=n.guard,this.selectId=n.selectId,this.toUpdate=n.toUpdate,this.selectors=i,this.selectors$=a,this.collection$=a.collection$,this.count$=a.count$,this.entities$=a.entities$,this.entityActions$=a.entityActions$,this.entityMap$=a.entityMap$,this.errors$=a.errors$,this.filter$=a.filter$,this.filteredEntities$=a.filteredEntities$,this.keys$=a.keys$,this.loaded$=a.loaded$,this.loading$=a.loading$,this.changeState$=a.changeState$}return t.prototype.createEntityAction=function(t,e,r){return this.dispatcher.createEntityAction(t,e,r)},t.prototype.createAndDispatch=function(t,e,r){return this.dispatcher.createAndDispatch(t,e,r)},t.prototype.dispatch=function(t){return this.dispatcher.dispatch(t)},Object.defineProperty(t.prototype,"store",{get:function(){return this.dispatcher.store},enumerable:!1,configurable:!0}),t.prototype.add=function(t,e){return this.dispatcher.add(t,e)},t.prototype.cancel=function(t,e,r){this.dispatcher.cancel(t,e,r)},t.prototype.delete=function(t,e){return this.dispatcher.delete(t,e)},t.prototype.getAll=function(t){return this.dispatcher.getAll(t)},t.prototype.getByKey=function(t,e){return this.dispatcher.getByKey(t,e)},t.prototype.getWithQuery=function(t,e){return this.dispatcher.getWithQuery(t,e)},t.prototype.load=function(t){return this.dispatcher.load(t)},t.prototype.update=function(t,e){return this.dispatcher.update(t,e)},t.prototype.upsert=function(t,e){return this.dispatcher.upsert(t,e)},t.prototype.addAllToCache=function(t,e){this.dispatcher.addAllToCache(t,e)},t.prototype.addOneToCache=function(t,e){this.dispatcher.addOneToCache(t,e)},t.prototype.addManyToCache=function(t,e){this.dispatcher.addManyToCache(t,e)},t.prototype.clearCache=function(){this.dispatcher.clearCache()},t.prototype.removeOneFromCache=function(t,e){this.dispatcher.removeOneFromCache(t,e)},t.prototype.removeManyFromCache=function(t,e){this.dispatcher.removeManyFromCache(t,e)},t.prototype.updateOneInCache=function(t,e){this.dispatcher.updateOneInCache(t,e)},t.prototype.updateManyInCache=function(t,e){this.dispatcher.updateManyInCache(t,e)},t.prototype.upsertOneInCache=function(t,e){this.dispatcher.upsertOneInCache(t,e)},t.prototype.upsertManyInCache=function(t,e){this.dispatcher.upsertManyInCache(t,e)},t.prototype.setFilter=function(t){this.dispatcher.setFilter(t)},t.prototype.setLoaded=function(t){this.dispatcher.setLoaded(!!t)},t.prototype.setLoading=function(t){this.dispatcher.setLoading(!!t)},t}(),vt=function(){function t(t){this.entityDefinitionService=t}return t.prototype.create=function(t){var e=this.entityDefinitionService&&this.entityDefinitionService.getDefinition(t,!1);return e&&e.initialState||At(t)},t}();function At(t){return{entityName:t,ids:[],entities:{},filter:void 0,loaded:!1,loading:!1,changeState:{}}}vt.decorators=[{type:e.Injectable}],vt.ctorParameters=function(){return[{type:W,decorators:[{type:e.Optional}]}]};var mt=function(){function t(t,e){this.entityCollectionCreator=t||new vt,this.selectEntityCache=e||dt(st)}return t.prototype.createCollectionSelector=function(t){var e=this;return s.createSelector(this.selectEntityCache,(function(r){return void 0===r&&(r={}),r[t]||e.entityCollectionCreator.create(t)}))},t.prototype.createCollectionSelectors=function(t){var e="string"==typeof t?{entityName:t}:t,r=function(t){return t.ids},n=function(t){return t.entities},i=s.createSelector(r,n,(function(t,e){return t.map((function(t){return e[t]}))})),a=s.createSelector(r,(function(t){return t.length})),o=function(t){return t.filter},c=e.filterFn,p=c?s.createSelector(i,o,(function(t,e){return c(t,e)})):i,u=e.additionalCollectionState||{},y={};return Object.keys(u).forEach((function(t){y["select"+t[0].toUpperCase()+t.slice(1)]=function(e){return e[t]}})),Object.assign({selectCount:a,selectEntities:i,selectEntityMap:n,selectFilter:o,selectFilteredEntities:p,selectKeys:r,selectLoaded:function(t){return t.loaded},selectLoading:function(t){return t.loading},selectChangeState:function(t){return t.changeState}},y)},t.prototype.create=function(t){var e="string"==typeof t?{entityName:t}:t,r=e.entityName,n=this.createCollectionSelector(r),i=this.createCollectionSelectors(e),a={};return Object.keys(i).forEach((function(t){a[t]=s.createSelector(n,i[t])})),Object.assign({entityName:r,selectCollection:n,selectEntityCache:this.selectEntityCache},a)},t}();mt.decorators=[{type:e.Injectable}],mt.ctorParameters=function(){return[{type:vt,decorators:[{type:e.Optional}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[yt]}]}]};var Ct=function(){function t(t,e,n){this.store=t,this.actions=e,this.selectEntityCache=n,this.entityCache$=this.store.select(this.selectEntityCache),this.entityActionErrors$=e.pipe(r.filter((function(t){return t.payload&&t.payload.entityOp&&t.payload.entityOp.endsWith(x)})),r.shareReplay(1))}return t.prototype.create=function(t,e){var r=this,n={entityName:t};return Object.keys(e).forEach((function(t){if(t.startsWith("select")){var i=t[6].toLowerCase()+t.substr(7)+"$";n[i]=r.store.select(e[t])}})),n.entityActions$=this.actions.pipe(g(t)),n.errors$=this.entityActionErrors$.pipe(g(t)),n},t}();Ct.decorators=[{type:e.Injectable}],Ct.ctorParameters=function(){return[{type:s.Store},{type:o.Actions},{type:void 0,decorators:[{type:e.Inject,args:[yt]}]}]};var _t=function(){function t(t,e,r,n){this.entityDispatcherFactory=t,this.entityDefinitionService=e,this.entitySelectorsFactory=r,this.entitySelectors$Factory=n}return t.prototype.create=function(t){t=t.trim();var e=this.entityDefinitionService.getDefinition(t),r=this.entityDispatcherFactory.create(t,e.selectId,e.entityDispatcherOptions),n=this.entitySelectorsFactory.create(e.metadata);return{dispatcher:r,entityName:t,selectors:n,selectors$:this.entitySelectors$Factory.create(t,n)}},t}();_t.decorators=[{type:e.Injectable}],_t.ctorParameters=function(){return[{type:lt},{type:W},{type:mt},{type:Ct}]};var Tt=function(){function t(t){this.entityCollectionServiceElementsFactory=t}return t.prototype.create=function(t){return new Ot(t,this.entityCollectionServiceElementsFactory)},t}();Tt.decorators=[{type:e.Injectable}],Tt.ctorParameters=function(){return[{type:_t}]};var Dt=function(t,e,r,n){this.entityCollectionServiceFactory=t,this.store=n,this.entityActionErrors$=r.entityActionErrors$,this.entityCache$=r.entityCache$,this.reducedActions$=e.reducedActions$};Dt.decorators=[{type:e.Injectable}],Dt.ctorParameters=function(){return[{type:Tt},{type:lt},{type:Ct},{type:s.Store}]};var Rt=function(){function t(t){this.entityServicesElements=t,this.EntityCollectionServices={}}return Object.defineProperty(t.prototype,"entityActionErrors$",{get:function(){return this.entityServicesElements.entityActionErrors$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entityCache$",{get:function(){return this.entityServicesElements.entityCache$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entityCollectionServiceFactory",{get:function(){return this.entityServicesElements.entityCollectionServiceFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reducedActions$",{get:function(){return this.entityServicesElements.reducedActions$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"store",{get:function(){return this.entityServicesElements.store},enumerable:!1,configurable:!0}),t.prototype.dispatch=function(t){this.store.dispatch(t)},t.prototype.createEntityCollectionService=function(t){return this.entityCollectionServiceFactory.create(t)},t.prototype.getEntityCollectionService=function(t){var e=this.EntityCollectionServices[t];return e||(e=this.createEntityCollectionService(t),this.EntityCollectionServices[t]=e),e},t.prototype.registerEntityCollectionService=function(t,e){this.EntityCollectionServices[e||t.entityName]=t},t.prototype.registerEntityCollectionServices=function(t){var e=this;Array.isArray(t)?t.forEach((function(t){return e.registerEntityCollectionService(t)})):Object.keys(t||{}).forEach((function(r){e.registerEntityCollectionService(t[r],r)}))},t}();Rt.decorators=[{type:e.Injectable}],Rt.ctorParameters=function(){return[{type:Dt}]};var Mt,bt=function(){};t.ChangeType=void 0,(Mt=t.ChangeType||(t.ChangeType={}))[Mt.Unchanged=0]="Unchanged",Mt[Mt.Added=1]="Added",Mt[Mt.Deleted=2]="Deleted",Mt[Mt.Updated=3]="Updated";var Nt=function(){function e(t,e){this.adapter=t,this.selectId=e,this.selectId=e||h}return e.prototype.commitAll=function(t){return 0===Object.keys(t.changeState).length?t:Object.assign(Object.assign({},t),{changeState:{}})},e.prototype.commitMany=function(t,e){var r=this;if(null==t||0===t.length)return e;var n=!1,i=t.reduce((function(t,e){var i="object"==typeof e?r.selectId(e):e;return t[i]&&(n||(t=Object.assign({},t),n=!0),delete t[i]),t}),e.changeState);return n?Object.assign(Object.assign({},e),{changeState:i}):e},e.prototype.commitOne=function(t,e){return null==t?e:this.commitMany([t],e)},e.prototype.mergeQueryResults=function(e,r,n){return this.mergeServerUpserts(e,r,t.MergeStrategy.PreserveChanges,n)},e.prototype.mergeSaveAdds=function(e,r,n){return this.mergeServerUpserts(e,r,t.MergeStrategy.OverwriteChanges,n)},e.prototype.mergeSaveDeletes=function(e,r,n){var i=e;return r=(n=null==n?t.MergeStrategy.OverwriteChanges:n)===t.MergeStrategy.IgnoreChanges?r:this.commitMany(i,r),this.adapter.removeMany(i,r)},e.prototype.mergeSaveUpdates=function(e,r,n,i){var a=this;if(void 0===i&&(i=!1),null==e||0===e.length)return r;var s,o=!1,c=r.changeState;switch(n=null==n?t.MergeStrategy.OverwriteChanges:n){case t.MergeStrategy.IgnoreChanges:return s=u(e),this.adapter.updateMany(s,r);case t.MergeStrategy.OverwriteChanges:return c=e.reduce((function(t,e){var r=e.id;return t[r]&&(o||(t=Object.assign({},t),o=!0),delete t[r]),t}),r.changeState),r=o?Object.assign(Object.assign({},r),{changeState:c}):r,s=u(e),this.adapter.updateMany(s,r);case t.MergeStrategy.PreserveChanges:var p=[];return c=e.reduce((function(t,e){var r=e.id,n=t[r];if(n){o||(t=Object.assign({},t),o=!0);var i=a.selectId(e.changes),s=n;i!==r&&delete t[r];var c=Object.assign(Object.assign({},s.originalValue),e.changes);t[i]=Object.assign(Object.assign({},s),{originalValue:c})}else p.push(e);return t}),r.changeState),r=o?Object.assign(Object.assign({},r),{changeState:c}):r,s=u(p),this.adapter.updateMany(s,r)}function u(t){return!0===i&&(t=t.filter((function(t){return!0===t.changed}))),t.map((function(t){return{id:t.id,changes:t.changes}}))}},e.prototype.mergeSaveUpserts=function(e,r,n){return this.mergeServerUpserts(e,r,t.MergeStrategy.OverwriteChanges,n)},e.prototype.mergeServerUpserts=function(e,r,n,i){var a=this;if(null==e||0===e.length)return r;var s=!1,o=r.changeState;switch(i=null==i?n:i){case t.MergeStrategy.IgnoreChanges:return this.adapter.upsertMany(e,r);case t.MergeStrategy.OverwriteChanges:return r=this.adapter.upsertMany(e,r),o=e.reduce((function(t,e){var r=a.selectId(e);return t[r]&&(s||(t=Object.assign({},t),s=!0),delete t[r]),t}),r.changeState),s?Object.assign(Object.assign({},r),{changeState:o}):r;case t.MergeStrategy.PreserveChanges:var c=[];return o=e.reduce((function(t,e){var r,n=a.selectId(e);return t[n]?s||(t=Object.assign(Object.assign({},t),((r={})[n]=Object.assign(Object.assign({},t[n]),{originalValue:e}),r)),s=!0):c.push(e),t}),r.changeState),r=this.adapter.upsertMany(c,r),s?Object.assign(Object.assign({},r),{changeState:o}):r}},e.prototype.trackAddMany=function(e,r,n){var i=this;if(n===t.MergeStrategy.IgnoreChanges||null==e||0===e.length)return r;var a=!1,s=e.reduce((function(e,n){var s=i.selectId(n);if(null==s||""===s)throw new Error(r.entityName+" entity add requires a key to be tracked");return e[s]||(a||(a=!0,e=Object.assign({},e)),e[s]={changeType:t.ChangeType.Added}),e}),r.changeState);return a?Object.assign(Object.assign({},r),{changeState:s}):r},e.prototype.trackAddOne=function(t,e,r){return null==t?e:this.trackAddMany([t],e,r)},e.prototype.trackDeleteMany=function(e,r,n){if(n===t.MergeStrategy.IgnoreChanges||null==e||0===e.length)return r;var i=!1,a=r.entities,s=e.reduce((function(e,r){var n=a[r];if(n){var s=e[r];s?s.changeType===t.ChangeType.Added?(o(),delete e[r]):s.changeType===t.ChangeType.Updated&&(o(),s.changeType=t.ChangeType.Deleted):(o(),e[r]={changeType:t.ChangeType.Deleted,originalValue:n})}return e;function o(){i||(i=!0,e=Object.assign({},e))}}),r.changeState);return i?Object.assign(Object.assign({},r),{changeState:s}):r},e.prototype.trackDeleteOne=function(t,e,r){return null==t?e:this.trackDeleteMany([t],e,r)},e.prototype.trackUpdateMany=function(e,r,n){if(n===t.MergeStrategy.IgnoreChanges||null==e||0===e.length)return r;var i=!1,a=r.entities,s=e.reduce((function(e,n){var s=n.id;n.changes;if(null==s||""===s)throw new Error(r.entityName+" entity update requires a key to be tracked");var o=a[s];o&&(e[s]||(i||(i=!0,e=Object.assign({},e)),e[s]={changeType:t.ChangeType.Updated,originalValue:o}));return e}),r.changeState);return i?Object.assign(Object.assign({},r),{changeState:s}):r},e.prototype.trackUpdateOne=function(t,e,r){return null==t?e:this.trackUpdateMany([t],e,r)},e.prototype.trackUpsertMany=function(e,r,n){var i=this;if(n===t.MergeStrategy.IgnoreChanges||null==e||0===e.length)return r;var a=!1,s=r.entities,o=e.reduce((function(e,n){var o=i.selectId(n);if(null==o||""===o)throw new Error(r.entityName+" entity upsert requires a key to be tracked");if(!e[o]){a||(a=!0,e=Object.assign({},e));var c=s[o];e[o]=null==c?{changeType:t.ChangeType.Added}:{changeType:t.ChangeType.Updated,originalValue:c}}return e}),r.changeState);return a?Object.assign(Object.assign({},r),{changeState:o}):r},e.prototype.trackUpsertOne=function(t,e,r){return null==t?e:this.trackUpsertMany([t],e,r)},e.prototype.undoAll=function(e){var r=Object.keys(e.changeState).reduce((function(e,r){var n=e.chgState[r];switch(n.changeType){case t.ChangeType.Added:e.remove.push(r);break;case t.ChangeType.Deleted:var i=n.originalValue;i&&e.upsert.push(i);break;case t.ChangeType.Updated:e.upsert.push(n.originalValue)}return e}),{remove:[],upsert:[],chgState:e.changeState}),n=r.remove,i=r.upsert;return e=this.adapter.removeMany(n,e),e=this.adapter.upsertMany(i,e),Object.assign(Object.assign({},e),{changeState:{}})},e.prototype.undoMany=function(e,r){var n=this;if(null==e||0===e.length)return r;var i=!1,a=e.reduce((function(e,r){var a=e.changeState,s="object"==typeof r?n.selectId(r):r,o=a[s];if(o)switch(i||(a=Object.assign({},a),i=!0),delete a[s],e.changeState=a,o.changeType){case t.ChangeType.Added:e.remove.push(s);break;case t.ChangeType.Deleted:var c=o.originalValue;c&&e.upsert.push(c);break;case t.ChangeType.Updated:e.upsert.push(o.originalValue)}return e}),{remove:[],upsert:[],changeState:r.changeState}),s=a.changeState,o=a.remove,c=a.upsert;return r=this.adapter.removeMany(o,r),r=this.adapter.upsertMany(c,r),i?Object.assign(Object.assign({},r),{changeState:s}):r},e.prototype.undoOne=function(t,e){return null==t?e:this.undoMany([t],e)},e}(),Ut=function(){function e(e,r,n){var i;this.entityName=e,this.definition=r,this.methods=((i={})[t.EntityOp.CANCEL_PERSIST]=this.cancelPersist.bind(this),i[t.EntityOp.QUERY_ALL]=this.queryAll.bind(this),i[t.EntityOp.QUERY_ALL_ERROR]=this.queryAllError.bind(this),i[t.EntityOp.QUERY_ALL_SUCCESS]=this.queryAllSuccess.bind(this),i[t.EntityOp.QUERY_BY_KEY]=this.queryByKey.bind(this),i[t.EntityOp.QUERY_BY_KEY_ERROR]=this.queryByKeyError.bind(this),i[t.EntityOp.QUERY_BY_KEY_SUCCESS]=this.queryByKeySuccess.bind(this),i[t.EntityOp.QUERY_LOAD]=this.queryLoad.bind(this),i[t.EntityOp.QUERY_LOAD_ERROR]=this.queryLoadError.bind(this),i[t.EntityOp.QUERY_LOAD_SUCCESS]=this.queryLoadSuccess.bind(this),i[t.EntityOp.QUERY_MANY]=this.queryMany.bind(this),i[t.EntityOp.QUERY_MANY_ERROR]=this.queryManyError.bind(this),i[t.EntityOp.QUERY_MANY_SUCCESS]=this.queryManySuccess.bind(this),i[t.EntityOp.SAVE_ADD_MANY]=this.saveAddMany.bind(this),i[t.EntityOp.SAVE_ADD_MANY_ERROR]=this.saveAddManyError.bind(this),i[t.EntityOp.SAVE_ADD_MANY_SUCCESS]=this.saveAddManySuccess.bind(this),i[t.EntityOp.SAVE_ADD_ONE]=this.saveAddOne.bind(this),i[t.EntityOp.SAVE_ADD_ONE_ERROR]=this.saveAddOneError.bind(this),i[t.EntityOp.SAVE_ADD_ONE_SUCCESS]=this.saveAddOneSuccess.bind(this),i[t.EntityOp.SAVE_DELETE_MANY]=this.saveDeleteMany.bind(this),i[t.EntityOp.SAVE_DELETE_MANY_ERROR]=this.saveDeleteManyError.bind(this),i[t.EntityOp.SAVE_DELETE_MANY_SUCCESS]=this.saveDeleteManySuccess.bind(this),i[t.EntityOp.SAVE_DELETE_ONE]=this.saveDeleteOne.bind(this),i[t.EntityOp.SAVE_DELETE_ONE_ERROR]=this.saveDeleteOneError.bind(this),i[t.EntityOp.SAVE_DELETE_ONE_SUCCESS]=this.saveDeleteOneSuccess.bind(this),i[t.EntityOp.SAVE_UPDATE_MANY]=this.saveUpdateMany.bind(this),i[t.EntityOp.SAVE_UPDATE_MANY_ERROR]=this.saveUpdateManyError.bind(this),i[t.EntityOp.SAVE_UPDATE_MANY_SUCCESS]=this.saveUpdateManySuccess.bind(this),i[t.EntityOp.SAVE_UPDATE_ONE]=this.saveUpdateOne.bind(this),i[t.EntityOp.SAVE_UPDATE_ONE_ERROR]=this.saveUpdateOneError.bind(this),i[t.EntityOp.SAVE_UPDATE_ONE_SUCCESS]=this.saveUpdateOneSuccess.bind(this),i[t.EntityOp.SAVE_UPSERT_MANY]=this.saveUpsertMany.bind(this),i[t.EntityOp.SAVE_UPSERT_MANY_ERROR]=this.saveUpsertManyError.bind(this),i[t.EntityOp.SAVE_UPSERT_MANY_SUCCESS]=this.saveUpsertManySuccess.bind(this),i[t.EntityOp.SAVE_UPSERT_ONE]=this.saveUpsertOne.bind(this),i[t.EntityOp.SAVE_UPSERT_ONE_ERROR]=this.saveUpsertOneError.bind(this),i[t.EntityOp.SAVE_UPSERT_ONE_SUCCESS]=this.saveUpsertOneSuccess.bind(this),i[t.EntityOp.ADD_ALL]=this.addAll.bind(this),i[t.EntityOp.ADD_MANY]=this.addMany.bind(this),i[t.EntityOp.ADD_ONE]=this.addOne.bind(this),i[t.EntityOp.REMOVE_ALL]=this.removeAll.bind(this),i[t.EntityOp.REMOVE_MANY]=this.removeMany.bind(this),i[t.EntityOp.REMOVE_ONE]=this.removeOne.bind(this),i[t.EntityOp.UPDATE_MANY]=this.updateMany.bind(this),i[t.EntityOp.UPDATE_ONE]=this.updateOne.bind(this),i[t.EntityOp.UPSERT_MANY]=this.upsertMany.bind(this),i[t.EntityOp.UPSERT_ONE]=this.upsertOne.bind(this),i[t.EntityOp.COMMIT_ALL]=this.commitAll.bind(this),i[t.EntityOp.COMMIT_MANY]=this.commitMany.bind(this),i[t.EntityOp.COMMIT_ONE]=this.commitOne.bind(this),i[t.EntityOp.UNDO_ALL]=this.undoAll.bind(this),i[t.EntityOp.UNDO_MANY]=this.undoMany.bind(this),i[t.EntityOp.UNDO_ONE]=this.undoOne.bind(this),i[t.EntityOp.SET_CHANGE_STATE]=this.setChangeState.bind(this),i[t.EntityOp.SET_COLLECTION]=this.setCollection.bind(this),i[t.EntityOp.SET_FILTER]=this.setFilter.bind(this),i[t.EntityOp.SET_LOADED]=this.setLoaded.bind(this),i[t.EntityOp.SET_LOADING]=this.setLoading.bind(this),i),this.adapter=r.entityAdapter,this.isChangeTracking=!0!==r.noChangeTracking,this.selectId=r.selectId,this.guard=new p(e,this.selectId),this.toUpdate=l(this.selectId),this.entityChangeTracker=n||new Nt(this.adapter,this.selectId)}return e.prototype.cancelPersist=function(t){return this.setLoadingFalse(t)},e.prototype.queryAll=function(t){return this.setLoadingTrue(t)},e.prototype.queryAllError=function(t,e){return this.setLoadingFalse(t)},e.prototype.queryAllSuccess=function(t,e){var r=this.extractData(e),n=this.extractMergeStrategy(e);return Object.assign(Object.assign({},this.entityChangeTracker.mergeQueryResults(r,t,n)),{loaded:!0,loading:!1})},e.prototype.queryByKey=function(t,e){return this.setLoadingTrue(t)},e.prototype.queryByKeyError=function(t,e){return this.setLoadingFalse(t)},e.prototype.queryByKeySuccess=function(t,e){var r=this.extractData(e),n=this.extractMergeStrategy(e);return t=null==r?t:this.entityChangeTracker.mergeQueryResults([r],t,n),this.setLoadingFalse(t)},e.prototype.queryLoad=function(t){return this.setLoadingTrue(t)},e.prototype.queryLoadError=function(t,e){return this.setLoadingFalse(t)},e.prototype.queryLoadSuccess=function(t,e){var r=this.extractData(e);return Object.assign(Object.assign({},this.adapter.setAll(r,t)),{loading:!1,loaded:!0,changeState:{}})},e.prototype.queryMany=function(t,e){return this.setLoadingTrue(t)},e.prototype.queryManyError=function(t,e){return this.setLoadingFalse(t)},e.prototype.queryManySuccess=function(t,e){var r=this.extractData(e),n=this.extractMergeStrategy(e);return Object.assign(Object.assign({},this.entityChangeTracker.mergeQueryResults(r,t,n)),{loading:!1})},e.prototype.saveAddMany=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackAddMany(r,t,n),t=this.adapter.addMany(r,t)}return this.setLoadingTrue(t)},e.prototype.saveAddManyError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveAddManySuccess=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.isOptimistic(e)?this.entityChangeTracker.mergeSaveUpserts(r,t,n):this.entityChangeTracker.mergeSaveAdds(r,t,n),this.setLoadingFalse(t)},e.prototype.saveAddOne=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackAddOne(r,t,n),t=this.adapter.addOne(r,t)}return this.setLoadingTrue(t)},e.prototype.saveAddOneError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveAddOneSuccess=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);if(this.isOptimistic(e)){var i=this.toUpdate(r);t=this.entityChangeTracker.mergeSaveUpdates([i],t,n,!1)}else t=this.entityChangeTracker.mergeSaveAdds([r],t,n);return this.setLoadingFalse(t)},e.prototype.saveDeleteOne=function(e,r){var n=this.extractData(r),i="object"==typeof n?this.selectId(n):n,a=e.changeState[i];if(a&&(a.changeType===t.ChangeType.Added?(e=this.adapter.removeOne(i,e),e=this.entityChangeTracker.commitOne(i,e),r.payload.skip=!0):e=this.entityChangeTracker.trackDeleteOne(i,e)),this.isOptimistic(r)){var s=this.extractMergeStrategy(r);e=this.entityChangeTracker.trackDeleteOne(i,e,s),e=this.adapter.removeOne(i,e)}return this.setLoadingTrue(e)},e.prototype.saveDeleteOneError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveDeleteOneSuccess=function(t,e){var r=this.extractData(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.mergeSaveDeletes([r],t,n)}else t=this.adapter.removeOne(r,t),t=this.entityChangeTracker.commitOne(r,t);return this.setLoadingFalse(t)},e.prototype.saveDeleteMany=function(e,r){var n=this,i=this.extractData(r).map((function(t){return"object"==typeof t?n.selectId(t):t}));if(i.forEach((function(i){var a=e.changeState[i];a&&(a.changeType===t.ChangeType.Added?(e=n.adapter.removeOne(i,e),e=n.entityChangeTracker.commitOne(i,e),r.payload.skip=!0):e=n.entityChangeTracker.trackDeleteOne(i,e))})),this.isOptimistic(r)){var a=this.extractMergeStrategy(r);e=this.entityChangeTracker.trackDeleteMany(i,e,a),e=this.adapter.removeMany(i,e)}return this.setLoadingTrue(e)},e.prototype.saveDeleteManyError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveDeleteManySuccess=function(t,e){var r=this.extractData(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.mergeSaveDeletes(r,t,n)}else t=this.adapter.removeMany(r,t),t=this.entityChangeTracker.commitMany(r,t);return this.setLoadingFalse(t)},e.prototype.saveUpdateOne=function(t,e){var r=this.guard.mustBeUpdate(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpdateOne(r,t,n),t=this.adapter.updateOne(r,t)}return this.setLoadingTrue(t)},e.prototype.saveUpdateOneError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveUpdateOneSuccess=function(t,e){var r=this.guard.mustBeUpdateResponse(e),n=this.isOptimistic(e),i=this.extractMergeStrategy(e);return t=this.entityChangeTracker.mergeSaveUpdates([r],t,i,n),this.setLoadingFalse(t)},e.prototype.saveUpdateMany=function(t,e){var r=this.guard.mustBeUpdates(e);if(this.isOptimistic(e)){var n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpdateMany(r,t,n),t=this.adapter.updateMany(r,t)}return this.setLoadingTrue(t)},e.prototype.saveUpdateManyError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveUpdateManySuccess=function(t,e){var r=this.guard.mustBeUpdateResponses(e),n=(this.isOptimistic(e),this.extractMergeStrategy(e));return t=this.entityChangeTracker.mergeSaveUpdates(r,t,n,!1),this.setLoadingFalse(t)},e.prototype.saveUpsertOne=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpsertOne(r,t,n),t=this.adapter.upsertOne(r,t)}return this.setLoadingTrue(t)},e.prototype.saveUpsertOneError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveUpsertOneSuccess=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.mergeSaveUpserts([r],t,n),this.setLoadingFalse(t)},e.prototype.saveUpsertMany=function(t,e){if(this.isOptimistic(e)){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);t=this.entityChangeTracker.trackUpsertMany(r,t,n),t=this.adapter.upsertMany(r,t)}return this.setLoadingTrue(t)},e.prototype.saveUpsertManyError=function(t,e){return this.setLoadingFalse(t)},e.prototype.saveUpsertManySuccess=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.mergeSaveUpserts(r,t,n),this.setLoadingFalse(t)},e.prototype.addAll=function(t,e){var r=this.guard.mustBeEntities(e);return Object.assign(Object.assign({},this.adapter.setAll(r,t)),{loading:!1,loaded:!0,changeState:{}})},e.prototype.addMany=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackAddMany(r,t,n),this.adapter.addMany(r,t)},e.prototype.addOne=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackAddOne(r,t,n),this.adapter.addOne(r,t)},e.prototype.removeMany=function(t,e){var r=this.guard.mustBeKeys(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackDeleteMany(r,t,n),this.adapter.removeMany(r,t)},e.prototype.removeOne=function(t,e){var r=this.guard.mustBeKey(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackDeleteOne(r,t,n),this.adapter.removeOne(r,t)},e.prototype.removeAll=function(t,e){return Object.assign(Object.assign({},this.adapter.removeAll(t)),{loaded:!1,loading:!1,changeState:{}})},e.prototype.updateMany=function(t,e){var r=this.guard.mustBeUpdates(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpdateMany(r,t,n),this.adapter.updateMany(r,t)},e.prototype.updateOne=function(t,e){var r=this.guard.mustBeUpdate(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpdateOne(r,t,n),this.adapter.updateOne(r,t)},e.prototype.upsertMany=function(t,e){var r=this.guard.mustBeEntities(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpsertMany(r,t,n),this.adapter.upsertMany(r,t)},e.prototype.upsertOne=function(t,e){var r=this.guard.mustBeEntity(e),n=this.extractMergeStrategy(e);return t=this.entityChangeTracker.trackUpsertOne(r,t,n),this.adapter.upsertOne(r,t)},e.prototype.commitAll=function(t){return this.entityChangeTracker.commitAll(t)},e.prototype.commitMany=function(t,e){return this.entityChangeTracker.commitMany(this.extractData(e),t)},e.prototype.commitOne=function(t,e){return this.entityChangeTracker.commitOne(this.extractData(e),t)},e.prototype.undoAll=function(t){return this.entityChangeTracker.undoAll(t)},e.prototype.undoMany=function(t,e){return this.entityChangeTracker.undoMany(this.extractData(e),t)},e.prototype.undoOne=function(t,e){return this.entityChangeTracker.undoOne(this.extractData(e),t)},e.prototype.setChangeState=function(t,e){var r=this.extractData(e);return t.changeState===r?t:Object.assign(Object.assign({},t),{changeState:r})},e.prototype.setCollection=function(t,e){var r=this.extractData(e);return t===r?t:r},e.prototype.setFilter=function(t,e){var r=this.extractData(e);return t.filter===r?t:Object.assign(Object.assign({},t),{filter:r})},e.prototype.setLoaded=function(t,e){var r=!0===this.extractData(e)||!1;return t.loaded===r?t:Object.assign(Object.assign({},t),{loaded:r})},e.prototype.setLoading=function(t,e){return this.setLoadingFlag(t,this.extractData(e))},e.prototype.setLoadingFalse=function(t){return this.setLoadingFlag(t,!1)},e.prototype.setLoadingTrue=function(t){return this.setLoadingFlag(t,!0)},e.prototype.setLoadingFlag=function(t,e){return e=!0===e,t.loading===e?t:Object.assign(Object.assign({},t),{loading:e})},e.prototype.extractData=function(t){return t.payload&&t.payload.data},e.prototype.extractMergeStrategy=function(e){return this.isChangeTracking?e.payload&&e.payload.mergeStrategy:t.MergeStrategy.IgnoreChanges},e.prototype.isOptimistic=function(t){return t.payload&&!0===t.payload.isOptimistic},e}(),It=function(){function t(t){this.entityDefinitionService=t}return t.prototype.create=function(t){var e=this.entityDefinitionService.getDefinition(t);return new Ut(t,e).methods},t}();It.decorators=[{type:e.Injectable}],It.ctorParameters=function(){return[{type:W}]};var xt=function(){function t(t){this.methodsFactory=t}return t.prototype.create=function(t){var e=this.methodsFactory.create(t);return function(t,r){var n=e[r.payload.entityOp];return n?n(t,r):t}},t}();xt.decorators=[{type:e.Injectable}],xt.ctorParameters=function(){return[{type:It}]};var Lt=function(){function t(t,e){this.entityCollectionReducerFactory=t,this.entityCollectionReducers={},this.entityCollectionMetaReducer=s.compose.apply(null,e||[])}return t.prototype.getOrCreateReducer=function(t){var e=this.entityCollectionReducers[t];return e||(e=this.entityCollectionReducerFactory.create(t),e=this.registerReducer(t,e),this.entityCollectionReducers[t]=e),e},t.prototype.registerReducer=function(t,e){return e=this.entityCollectionMetaReducer(e),this.entityCollectionReducers[t.trim()]=e},t.prototype.registerReducers=function(t){var e=this;(t?Object.keys(t):[]).forEach((function(r){return e.registerReducer(r,t[r])}))},t}();Lt.decorators=[{type:e.Injectable}],Lt.ctorParameters=function(){return[{type:xt},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[pt]}]}]};var jt=function(){function e(t,e,r){this.entityCollectionCreator=t,this.entityCollectionReducerRegistry=e,this.logger=r}return e.prototype.create=function(){return function(e,r){void 0===e&&(e={});switch(r.type){case t.EntityCacheAction.CLEAR_COLLECTIONS:return this.clearCollectionsReducer(e,r);case t.EntityCacheAction.LOAD_COLLECTIONS:return this.loadCollectionsReducer(e,r);case t.EntityCacheAction.MERGE_QUERY_SET:return this.mergeQuerySetReducer(e,r);case t.EntityCacheAction.SAVE_ENTITIES:return this.saveEntitiesReducer(e,r);case t.EntityCacheAction.SAVE_ENTITIES_CANCEL:return this.saveEntitiesCancelReducer(e,r);case t.EntityCacheAction.SAVE_ENTITIES_ERROR:return this.saveEntitiesErrorReducer(e,r);case t.EntityCacheAction.SAVE_ENTITIES_SUCCESS:return this.saveEntitiesSuccessReducer(e,r);case t.EntityCacheAction.SET_ENTITY_CACHE:return r.payload.cache}var n=r.payload;if(n&&n.entityName&&n.entityOp&&!n.error)return this.applyCollectionReducer(e,r);return e}.bind(this)},e.prototype.clearCollectionsReducer=function(e,r){var n=this,i=r.payload,a=i.collections,s=(i.tag,t.EntityOp.REMOVE_ALL);return a||(a=Object.keys(e)),e=a.reduce((function(t,e){var i={entityName:e,entityOp:s},a={type:"["+e+"] "+r.type,payload:i};return t=n.applyCollectionReducer(t,a)}),e)},e.prototype.loadCollectionsReducer=function(e,r){var n=this,i=r.payload,a=i.collections,s=(i.tag,t.EntityOp.ADD_ALL);return e=Object.keys(a).reduce((function(t,e){var i={entityName:e,entityOp:s,data:a[e]},o={type:"["+e+"] "+r.type,payload:i};return t=n.applyCollectionReducer(t,o)}),e)},e.prototype.mergeQuerySetReducer=function(e,r){var n=this,i=r.payload,a=i.mergeStrategy,s=i.querySet;i.tag;a=null===a?t.MergeStrategy.PreserveChanges:a;var o=t.EntityOp.QUERY_MANY_SUCCESS;return e=Object.keys(s).reduce((function(t,e){var i={entityName:e,entityOp:o,data:s[e],mergeStrategy:a},c={type:"["+e+"] "+r.type,payload:i};return t=n.applyCollectionReducer(t,c)}),e)},e.prototype.saveEntitiesReducer=function(e,r){var n=this,i=r.payload,a=i.changeSet,s=i.correlationId,o=i.isOptimistic,c=i.mergeStrategy,p=i.tag;try{a.changes.forEach((function(t){var i=t.entityName,a={entityName:i,entityOp:u(t),data:t.entities,correlationId:s,isOptimistic:o,mergeStrategy:c,tag:p},y={type:"["+i+"] "+r.type,payload:a};if(e=n.applyCollectionReducer(e,y),y.payload.error)throw y.payload.error}))}catch(t){r.payload.error=t}return e;function u(e){switch(e.op){case t.ChangeSetOperation.Add:return t.EntityOp.SAVE_ADD_MANY;case t.ChangeSetOperation.Delete:return t.EntityOp.SAVE_DELETE_MANY;case t.ChangeSetOperation.Update:return t.EntityOp.SAVE_UPDATE_MANY;case t.ChangeSetOperation.Upsert:return t.EntityOp.SAVE_UPSERT_MANY}}},e.prototype.saveEntitiesCancelReducer=function(t,e){return this.clearLoadingFlags(t,e.payload.entityNames||[])},e.prototype.saveEntitiesErrorReducer=function(t,e){var r=e.payload.originalAction.payload.changeSet.changes.map((function(t){return t.entityName}));return this.clearLoadingFlags(t,r)},e.prototype.saveEntitiesSuccessReducer=function(e,r){var n=this,i=r.payload,a=i.changeSet,s=i.correlationId,o=i.isOptimistic,c=i.mergeStrategy,p=i.tag;return a.changes.forEach((function(t){var i=t.entityName,a={entityName:i,entityOp:u(t),data:t.entities,correlationId:s,isOptimistic:o,mergeStrategy:c,tag:p},y={type:"["+i+"] "+r.type,payload:a};e=n.applyCollectionReducer(e,y)})),e;function u(e){switch(e.op){case t.ChangeSetOperation.Add:return t.EntityOp.SAVE_ADD_MANY_SUCCESS;case t.ChangeSetOperation.Delete:return t.EntityOp.SAVE_DELETE_MANY_SUCCESS;case t.ChangeSetOperation.Update:return t.EntityOp.SAVE_UPDATE_MANY_SUCCESS;case t.ChangeSetOperation.Upsert:return t.EntityOp.SAVE_UPSERT_MANY_SUCCESS}}},e.prototype.applyCollectionReducer=function(t,e){var r;void 0===t&&(t={});var n,i=e.payload.entityName,a=t[i],s=this.entityCollectionReducerRegistry.getOrCreateReducer(i);try{n=s(a||this.entityCollectionCreator.create(i),e)}catch(t){this.logger.error(t),e.payload.error=t}return e.payload.error||a===n?t:Object.assign(Object.assign({},t),((r={})[i]=n,r))},e.prototype.clearLoadingFlags=function(t,e){var r=!1;return e.forEach((function(e){var n=t[e];n.loading&&(r||(t=Object.assign({},t),r=!0),t[e]=Object.assign(Object.assign({},n),{loading:!1}))})),t},e}();jt.decorators=[{type:e.Injectable}],jt.ctorParameters=function(){return[{type:vt},{type:Lt},{type:Y}]};var kt=function(){function t(){}return t.prototype.error=function(t,e){t&&(e?console.error(t,e):console.error(t))},t.prototype.log=function(t,e){t&&(e?console.log(t,e):console.log(t))},t.prototype.warn=function(t,e){t&&(e?console.warn(t,e):console.warn(t))},t}();kt.decorators=[{type:e.Injectable}];var wt=["equipment","information","money","series"],Yt=function(){function t(t){var e=this;this.pluralNames={},t&&t.forEach((function(t){return e.registerPluralNames(t)}))}return t.prototype.pluralize=function(t){var e=this.pluralNames[t];return e||(wt.indexOf(t.toLowerCase())>=0?t:/[aeiou]y$/.test(t)?t+"s":t.endsWith("y")?t.substr(0,t.length-1)+"ies":/[s|ss|sh|ch|x|z]$/.test(t)?t+"es":t+"s")},t.prototype.registerPluralNames=function(t){this.pluralNames=Object.assign(Object.assign({},this.pluralNames),t||{})},t}();Yt.decorators=[{type:e.Injectable}],Yt.ctorParameters=function(){return[{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[P]}]}]};var Pt=function(){function t(t,r,n,i,a,o){this.reducerManager=t,this.injector=n,this.entityCacheName=i,this.initialState=a,this.metaReducers=o;var c=i||st;a="function"==typeof a?a():a;var p=(o||[]).map((function(t){return t instanceof e.InjectionToken?n.get(t):t}));this.entityCacheFeature={key:c,reducers:r.create(),reducerFactory:s.combineReducers,initialState:a||{},metaReducers:p},t.addFeature(this.entityCacheFeature)}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:ct,useValue:e.entityCacheMetaReducers?e.entityCacheMetaReducers:[]},{provide:pt,useValue:e.entityCollectionMetaReducers?e.entityCollectionMetaReducers:[]},{provide:P,multi:!0,useValue:e.pluralNames?e.pluralNames:{}}]}},t.prototype.ngOnDestroy=function(){this.reducerManager.removeFeature(this.entityCacheFeature)},t}();Pt.decorators=[{type:e.NgModule,args:[{imports:[s.StoreModule],providers:[et,rt,c,it,jt,ht,vt,xt,It,Lt,_t,Tt,W,lt,mt,Ct,Dt,{provide:ot,useValue:"entityCache"},{provide:bt,useClass:Rt},{provide:Y,useClass:kt}]}]}],Pt.ctorParameters=function(){return[{type:s.ReducerManager},{type:jt},{type:e.Injector},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[ot]}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[ut]}]},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[ct]}]}]};var Vt=function(){function t(t,e,r){this.effectSources=t,this.addEffects(e),this.addEffects(r)}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:G,multi:!0,useValue:e.entityMetadata?e.entityMetadata:[]},{provide:ct,useValue:e.entityCacheMetaReducers?e.entityCacheMetaReducers:[]},{provide:pt,useValue:e.entityCollectionMetaReducers?e.entityCollectionMetaReducers:[]},{provide:P,multi:!0,useValue:e.pluralNames?e.pluralNames:{}}]}},t.prototype.addEffects=function(t){this.effectSources.addEffects(t)},t}();Vt.decorators=[{type:e.NgModule,args:[{imports:[Pt,o.EffectsModule],providers:[K,J,X,gt,St,{provide:$,useClass:Q},{provide:Z,useClass:tt},{provide:V,useClass:Yt}]}]}],Vt.ctorParameters=function(){return[{type:o.EffectSources},{type:gt},{type:St}]},t.ChangeSetItemFactory=O,t.ClearCollections=C,t.CorrelationIdGenerator=et,t.DataServiceError=k,t.DefaultDataService=q,t.DefaultDataServiceConfig=w,t.DefaultDataServiceFactory=K,t.DefaultHttpUrlGenerator=Q,t.DefaultLogger=kt,t.DefaultPersistenceResultHandler=tt,t.DefaultPluralizer=Yt,t.ENTITY_CACHE_META_REDUCERS=ct,t.ENTITY_CACHE_NAME=st,t.ENTITY_CACHE_NAME_TOKEN=ot,t.ENTITY_CACHE_SELECTOR_TOKEN=yt,t.ENTITY_COLLECTION_META_REDUCERS=pt,t.ENTITY_METADATA_TOKEN=G,t.EntityActionFactory=c,t.EntityActionGuard=p,t.EntityCacheDataService=J,t.EntityCacheDispatcher=it,t.EntityCacheEffects=gt,t.EntityCacheReducerFactory=jt,t.EntityChangeTrackerBase=Nt,t.EntityCollectionCreator=vt,t.EntityCollectionReducerFactory=xt,t.EntityCollectionReducerMethods=Ut,t.EntityCollectionReducerMethodsFactory=It,t.EntityCollectionReducerRegistry=Lt,t.EntityCollectionServiceBase=Ot,t.EntityCollectionServiceElementsFactory=_t,t.EntityCollectionServiceFactory=Tt,t.EntityDataModule=Vt,t.EntityDataModuleWithoutEffects=Pt,t.EntityDataService=X,t.EntityDefinitionService=W,t.EntityDispatcherBase=at,t.EntityDispatcherDefaultOptions=rt,t.EntityDispatcherFactory=lt,t.EntityEffects=St,t.EntityHttpResourceUrls=F,t.EntitySelectors$Factory=Ct,t.EntitySelectorsFactory=mt,t.EntityServices=bt,t.EntityServicesBase=Rt,t.EntityServicesElements=Dt,t.HttpUrlGenerator=$,t.INITIAL_ENTITY_CACHE_STATE=ut,t.LoadCollections=_,t.Logger=Y,t.MergeQuerySet=T,t.OP_ERROR=x,t.OP_SUCCESS=I,t.PLURAL_NAMES_TOKEN=P,t.PersistanceCanceled=nt,t.PersistenceResultHandler=Z,t.Pluralizer=V,t.PropsFilterFnFactory=function(t){return void 0===t&&(t=[]),0===t.length?function(t,e){return t}:function(e,r){if(!e)return[];var n="string"==typeof r?new RegExp(r,"i"):r;if(n){return e.filter((function(e){return t.some((function(t){return n.test(e[t])}))}))}return e}},t.SaveEntities=R,t.SaveEntitiesCancel=M,t.SaveEntitiesCanceled=b,t.SaveEntitiesError=N,t.SaveEntitiesSuccess=U,t.SetEntityCache=D,t.changeSetItemFactory=v,t.createEmptyEntityCollection=At,t.createEntityCacheSelector=dt,t.createEntityDefinition=H,t.defaultSelectId=h,t.entityCacheSelectorProvider=ht,t.excludeEmptyChangeSetItems=A,t.flattenArgs=d,t.getGuid=function(){return"xxxxxxxxxx4xxyxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.getGuidComb=function(t){var e=("00"+(t||(new Date).getTime()).toString(16)).slice(-12);return"xxxxxxxxxx4xxyxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))+e},t.guidComparer=function(t,e){var r=t.slice(-12),n=e.slice(-12);return r!==n?r<n?-1:+(r!==n):t<e?-1:+(t!==e)},t.makeErrorOp=L,t.makeSuccessOp=j,t.normalizeRoot=B,t.ofEntityOp=E,t.ofEntityType=g,t.persistOps=ft,t.toUpdateFactory=l,t.ɵa=Et,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
16
|
//# sourceMappingURL=ngrx-data.umd.min.js.map
|