@daffodil/core 0.63.2 → 0.64.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.
Files changed (112) hide show
  1. package/collection/collection.interface.d.ts +1 -1
  2. package/collection/metadata.interface.d.ts +2 -2
  3. package/collection/request.interface.d.ts +1 -1
  4. package/errors/error-map.d.ts +1 -1
  5. package/esm2020/base64/browser/browser.service.mjs +3 -3
  6. package/esm2020/base64/server/server.service.mjs +3 -3
  7. package/esm2020/collection/build-request.mjs +1 -1
  8. package/esm2020/collection/collection.interface.mjs +1 -1
  9. package/esm2020/collection/metadata.interface.mjs +1 -1
  10. package/esm2020/collection/request.interface.mjs +1 -1
  11. package/esm2020/errors/error-map.mjs +1 -1
  12. package/esm2020/filterable/type/equal/filter.mjs +1 -1
  13. package/esm2020/filterable/type/range/filter-base.mjs +1 -1
  14. package/esm2020/filterable/type/range/pair.mjs +1 -1
  15. package/esm2020/filters/behaviors/apply/apply-request-to-filters.mjs +1 -1
  16. package/esm2020/filters/behaviors/apply/apply-requests-to-filters.mjs +1 -1
  17. package/esm2020/filters/behaviors/clear/clear-filters.mjs +1 -1
  18. package/esm2020/filters/behaviors/remove/remove-request-from-filters.mjs +1 -1
  19. package/esm2020/filters/behaviors/remove/remove-requests-from-filters.mjs +1 -1
  20. package/esm2020/filters/behaviors/toggle/toggle-request-on-filters.mjs +1 -1
  21. package/esm2020/filters/errors/filter-not-found.error.mjs +2 -2
  22. package/esm2020/filters/errors/request-name-mismatch.error.mjs +2 -2
  23. package/esm2020/filters/errors/request-type-mismatch.error.mjs +2 -2
  24. package/esm2020/filters/errors/unknown-filter-type.error.mjs +2 -2
  25. package/esm2020/filters/to-request/filters-to-requests.mjs +1 -1
  26. package/esm2020/graphql/apollo/queued-apollo/queued-apollo.service.mjs +3 -3
  27. package/esm2020/identifiable/array-to-dict.mjs +1 -1
  28. package/esm2020/routing/uri/normalizer.service.mjs +3 -3
  29. package/esm2020/state/operation/adapter.mjs +5 -5
  30. package/esm2020/state/operation/entity/adapter.mjs +11 -11
  31. package/esm2020/state/operation/entity/helpers.mjs +5 -5
  32. package/esm2020/state/operation/facade.type.mjs +1 -1
  33. package/esm2020/state/operation/selectors.mjs +4 -4
  34. package/esm2020/state/operation/state.mjs +2 -2
  35. package/esm2020/state/testing/mock-collection-facade.mjs +3 -3
  36. package/esm2020/state/testing/mock-operation-facade.mjs +5 -5
  37. package/esm2020/storage/error/error.service.mjs +4 -4
  38. package/esm2020/storage/localstorage/localstorage.service.mjs +3 -3
  39. package/esm2020/storage/noopstorage/noopstorage.service.mjs +3 -3
  40. package/esm2020/storage/server-error/server-error.service.mjs +4 -4
  41. package/esm2020/testing/angular/mocks/pipes/currency.mjs +3 -3
  42. package/esm2020/testing/factories/address.factory.mjs +3 -3
  43. package/esm2020/testing/factories/collection/metadata.factory.mjs +6 -6
  44. package/esm2020/testing/factories/collection/mock-collection.class.mjs +1 -1
  45. package/esm2020/testing/factories/collection/numerically-paginable.factory.mjs +3 -3
  46. package/esm2020/testing/factories/collection/request.factory.mjs +3 -3
  47. package/esm2020/testing/factories/collection/sort-option.factory.mjs +3 -3
  48. package/esm2020/testing/factories/collection/sort-options.factory.mjs +5 -5
  49. package/esm2020/testing/factories/collection/sortable.factory.mjs +5 -5
  50. package/esm2020/testing/factories/filters/filter.factory.mjs +5 -5
  51. package/esm2020/testing/factories/filters/request.factory.mjs +5 -5
  52. package/esm2020/testing/factories/filters/toggle-request.mjs +5 -5
  53. package/esm2020/testing/factories/filters/type/equal/option.mjs +3 -3
  54. package/esm2020/testing/factories/filters/type/equal/request.mjs +3 -3
  55. package/esm2020/testing/factories/filters/type/equal/toggle-request.mjs +3 -3
  56. package/esm2020/testing/factories/filters/type/equal.mjs +3 -3
  57. package/esm2020/testing/factories/filters/type/range-numeric/option.mjs +3 -3
  58. package/esm2020/testing/factories/filters/type/range-numeric/pair.mjs +5 -5
  59. package/esm2020/testing/factories/filters/type/range-numeric/request-option.mjs +3 -3
  60. package/esm2020/testing/factories/filters/type/range-numeric/request.mjs +5 -5
  61. package/esm2020/testing/factories/filters/type/range-numeric/toggle-request.mjs +5 -5
  62. package/esm2020/testing/factories/filters/type/range-numeric.mjs +3 -3
  63. package/esm2020/testing/factories/identifiable.factory.mjs +3 -3
  64. package/esm2020/testing/testing.module.mjs +4 -4
  65. package/fesm2015/daffodil-core-graphql.mjs +3 -3
  66. package/fesm2015/daffodil-core-routing.mjs +3 -3
  67. package/fesm2015/daffodil-core-state-testing.mjs +7 -7
  68. package/fesm2015/daffodil-core-state-testing.mjs.map +1 -1
  69. package/fesm2015/daffodil-core-state.mjs +22 -22
  70. package/fesm2015/daffodil-core-state.mjs.map +1 -1
  71. package/fesm2015/daffodil-core-testing.mjs +70 -70
  72. package/fesm2015/daffodil-core-testing.mjs.map +1 -1
  73. package/fesm2015/daffodil-core.mjs +18 -18
  74. package/fesm2015/daffodil-core.mjs.map +1 -1
  75. package/fesm2020/daffodil-core-graphql.mjs +3 -3
  76. package/fesm2020/daffodil-core-routing.mjs +3 -3
  77. package/fesm2020/daffodil-core-state-testing.mjs +7 -7
  78. package/fesm2020/daffodil-core-state-testing.mjs.map +1 -1
  79. package/fesm2020/daffodil-core-state.mjs +22 -22
  80. package/fesm2020/daffodil-core-state.mjs.map +1 -1
  81. package/fesm2020/daffodil-core-testing.mjs +70 -70
  82. package/fesm2020/daffodil-core-testing.mjs.map +1 -1
  83. package/fesm2020/daffodil-core.mjs +18 -18
  84. package/fesm2020/daffodil-core.mjs.map +1 -1
  85. package/filterable/type/equal/filter.d.ts +1 -1
  86. package/filterable/type/range/filter-base.d.ts +1 -1
  87. package/filterable/type/range/pair.d.ts +1 -1
  88. package/package.json +1 -1
  89. package/state/operation/entity/adapter.d.ts +1 -1
  90. package/state/operation/facade.type.d.ts +1 -1
  91. package/testing/angular/mocks/pipes/currency.d.ts +1 -1
  92. package/testing/factories/collection/metadata.factory.d.ts +2 -2
  93. package/testing/factories/collection/mock-collection.class.d.ts +1 -1
  94. package/testing/factories/collection/sort-options.factory.d.ts +1 -1
  95. package/testing/factories/collection/sortable.factory.d.ts +1 -1
  96. package/testing/factories/filters/filter.factory.d.ts +1 -1
  97. package/testing/factories/filters/request.factory.d.ts +1 -1
  98. package/testing/factories/filters/toggle-request.d.ts +1 -1
  99. package/testing/factories/filters/type/range-numeric/pair.d.ts +1 -1
  100. package/testing/factories/filters/type/range-numeric/request.d.ts +1 -1
  101. package/testing/factories/filters/type/range-numeric/toggle-request.d.ts +1 -1
  102. package/daffodil-core.d.ts +0 -5
  103. package/graphql/daffodil-core-graphql.d.ts +0 -5
  104. package/graphql/package.json +0 -1
  105. package/routing/daffodil-core-routing.d.ts +0 -5
  106. package/routing/package.json +0 -1
  107. package/state/daffodil-core-state.d.ts +0 -5
  108. package/state/package.json +0 -1
  109. package/state/testing/daffodil-core-state-testing.d.ts +0 -5
  110. package/state/testing/package.json +0 -1
  111. package/testing/daffodil-core-testing.d.ts +0 -5
  112. package/testing/package.json +0 -1
@@ -234,7 +234,7 @@ class DaffCollectionFacade {
234
234
  function daffStartResolution(state) {
235
235
  return {
236
236
  ...state,
237
- daffState: "Resolving" /* Resolving */,
237
+ daffState: "Resolving" /* DaffState.Resolving */,
238
238
  };
239
239
  }
240
240
  ;
@@ -244,7 +244,7 @@ function daffStartResolution(state) {
244
244
  function daffStartMutation(state) {
245
245
  return {
246
246
  ...state,
247
- daffState: "Mutating" /* Mutating */,
247
+ daffState: "Mutating" /* DaffState.Mutating */,
248
248
  };
249
249
  }
250
250
  ;
@@ -255,7 +255,7 @@ function daffStartMutation(state) {
255
255
  function daffCompleteOperation(state) {
256
256
  return {
257
257
  ...state,
258
- daffState: "Stable" /* Stable */,
258
+ daffState: "Stable" /* DaffState.Stable */,
259
259
  daffErrors: [],
260
260
  };
261
261
  }
@@ -267,7 +267,7 @@ function daffCompleteOperation(state) {
267
267
  function daffOperationFailed(errors, state) {
268
268
  return {
269
269
  ...state,
270
- daffState: "Stable" /* Stable */,
270
+ daffState: "Stable" /* DaffState.Stable */,
271
271
  daffErrors: errors,
272
272
  };
273
273
  }
@@ -284,7 +284,7 @@ function daffClearErrors(state) {
284
284
  ;
285
285
 
286
286
  const daffOperationInitialState = {
287
- daffState: "Stable" /* Stable */,
287
+ daffState: "Stable" /* DaffState.Stable */,
288
288
  daffErrors: [],
289
289
  };
290
290
 
@@ -295,9 +295,9 @@ const daffOperationInitialState = {
295
295
  */
296
296
  function daffOperationStateSelectorFactory(selectState) {
297
297
  const selectLoadingState = createSelector(selectState, state => state.daffState);
298
- const selectLoading = createSelector(selectLoadingState, loadingState => loadingState !== "Stable" /* Stable */);
299
- const selectResolving = createSelector(selectLoadingState, loadingState => loadingState === "Resolving" /* Resolving */);
300
- const selectMutating = createSelector(selectLoadingState, loadingState => loadingState === "Mutating" /* Mutating */);
298
+ const selectLoading = createSelector(selectLoadingState, loadingState => loadingState !== "Stable" /* DaffState.Stable */);
299
+ const selectResolving = createSelector(selectLoadingState, loadingState => loadingState === "Resolving" /* DaffState.Resolving */);
300
+ const selectMutating = createSelector(selectLoadingState, loadingState => loadingState === "Mutating" /* DaffState.Mutating */);
301
301
  const selectErrors = createSelector(selectState, state => state.daffErrors);
302
302
  const selectHasErrors = createSelector(selectErrors, errors => errors.length > 0);
303
303
  return {
@@ -334,20 +334,20 @@ function daffCreateOperationEntityStateAdapter(adapter = createEntityAdapter())
334
334
  return {
335
335
  list: (entities, state) => adapter.setAll(entities.map(entity => ({
336
336
  ...entity,
337
- daffState: "Stable" /* Stable */,
337
+ daffState: "Stable" /* DaffState.Stable */,
338
338
  daffErrors: [],
339
339
  daffTemp: false,
340
340
  })), state),
341
341
  preload: (key, state) => adapter.upsertOne({
342
342
  // TODO: allow for non identifiable entities?
343
343
  id: key,
344
- daffState: "Resolving" /* Resolving */,
344
+ daffState: "Resolving" /* DaffState.Resolving */,
345
345
  daffErrors: [],
346
346
  daffTemp: !state.entities[key],
347
347
  }, state),
348
348
  load: (entity, state) => adapter.upsertOne({
349
349
  ...entity,
350
- daffState: "Stable" /* Stable */,
350
+ daffState: "Stable" /* DaffState.Stable */,
351
351
  daffErrors: [],
352
352
  daffTemp: false,
353
353
  }, state),
@@ -356,27 +356,27 @@ function daffCreateOperationEntityStateAdapter(adapter = createEntityAdapter())
356
356
  ...entity,
357
357
  // TODO: allow for non identifiable entities?
358
358
  id: placeholderId,
359
- daffState: "Adding" /* Adding */,
359
+ daffState: "Adding" /* DaffState.Adding */,
360
360
  daffErrors: [],
361
361
  daffTemp: true,
362
362
  }, state)
363
363
  : state,
364
364
  add: (entity, state, placeholderId) => adapter.upsertOne({
365
365
  ...entity,
366
- daffState: "Added" /* Added */,
366
+ daffState: "Added" /* DaffState.Added */,
367
367
  daffErrors: [],
368
368
  daffTemp: false,
369
369
  }, placeholderId ? adapter.removeOne(placeholderId, state) : state),
370
370
  preupdate: (entity, state) => adapter.upsertOne({
371
371
  ...state.entities[entity.id],
372
- daffState: "Mutating" /* Mutating */,
372
+ daffState: "Mutating" /* DaffState.Mutating */,
373
373
  daffErrors: [],
374
374
  }, state),
375
375
  update: (entity, state) => adapter.updateOne({
376
376
  id: entity.id,
377
377
  changes: {
378
378
  ...entity,
379
- daffState: "Mutated" /* Mutated */,
379
+ daffState: "Mutated" /* DaffState.Mutated */,
380
380
  daffErrors: [],
381
381
  daffTemp: false,
382
382
  },
@@ -384,17 +384,17 @@ function daffCreateOperationEntityStateAdapter(adapter = createEntityAdapter())
384
384
  preremove: (key, state) => adapter.upsertOne({
385
385
  ...state.entities[key],
386
386
  daffErrors: [],
387
- daffState: "Deleting" /* Deleting */,
387
+ daffState: "Deleting" /* DaffState.Deleting */,
388
388
  }, state),
389
389
  remove: adapter.removeOne,
390
390
  operationFailed: (key, errors, state) => adapter.upsertOne({
391
391
  ...state.entities[key],
392
- daffState: "Stable" /* Stable */,
392
+ daffState: "Stable" /* DaffState.Stable */,
393
393
  daffErrors: errors,
394
394
  }, state),
395
395
  resetState: (key, state) => adapter.upsertOne({
396
396
  ...state.entities[key],
397
- daffState: "Stable" /* Stable */,
397
+ daffState: "Stable" /* DaffState.Stable */,
398
398
  }, state),
399
399
  getInitialState: adapter.getInitialState,
400
400
  getSelectors: (selectState) => daffOperationEntityStateSelectorFactory(adapter.getSelectors(selectState)),
@@ -405,10 +405,10 @@ function daffCreateOperationEntityStateAdapter(adapter = createEntityAdapter())
405
405
  * Returns whether the state is one that represents an operation in progress.
406
406
  */
407
407
  function daffStateIsLoading(daffState) {
408
- return daffState === "Adding" /* Adding */
409
- || daffState === "Mutating" /* Mutating */
410
- || daffState === "Resolving" /* Resolving */
411
- || daffState === "Deleting" /* Deleting */;
408
+ return daffState === "Adding" /* DaffState.Adding */
409
+ || daffState === "Mutating" /* DaffState.Mutating */
410
+ || daffState === "Resolving" /* DaffState.Resolving */
411
+ || daffState === "Deleting" /* DaffState.Deleting */;
412
412
  }
413
413
  /**
414
414
  * Generate a fake ID for use with placeholder entities.
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-state.mjs","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/reducers/identity.ts","../../../libs/core/state/src/collection/adapter.class.ts","../../../libs/core/state/src/collection/initial-state.ts","../../../libs/core/state/src/collection/selector-factory.ts","../../../libs/core/state/src/collection/facade.ts","../../../libs/core/state/src/operation/adapter.ts","../../../libs/core/state/src/operation/state.ts","../../../libs/core/state/src/operation/selectors.ts","../../../libs/core/state/src/operation/entity/selectors.ts","../../../libs/core/state/src/operation/entity/adapter.ts","../../../libs/core/state/src/operation/entity/helpers.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError {\n return { code, message, recoverable };\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","import { Action } from '@ngrx/store';\n\n/**\n * A simple reducer that simply returns the passed state.\n * This is useful for stubbing out parts of state that are not covered in an injected extra reducer map.\n */\nexport const daffIdentityReducer = <T = unknown>(state: T, action: Action): T => state;\n","import { defaultMemoize } from '@ngrx/store';\n\nimport {\n daffCollectionBuildMetadataFromRequest,\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * Provides an abstracted way to manage a collection state.\n */\nexport class DaffCollectionStateAdapter<T extends DaffCollectionMetadata = DaffCollectionMetadata> {\n /**\n * Stores a collection request in state.\n * This is useful when you want to preemptively reduce a request before waiting for a response.\n */\n storeRequest(request: DaffCollectionRequest, state: T): T {\n return {\n ...state,\n ...daffCollectionBuildMetadataFromRequest(request),\n };\n }\n\n /**\n * Sets the page size.\n */\n setPageSize(size: number, state: T): T {\n return {\n ...state,\n pageSize: size,\n currentPage: 1,\n };\n }\n\n /**\n * Sets the current page.\n */\n setCurrentPage(page: number, state: T): T {\n return {\n ...state,\n currentPage: page,\n };\n }\n\n /**\n * Sets the sorting option and direction.\n */\n setSort(option: string, direction: string, state: T): T {\n return {\n ...state,\n appliedSortOption: option,\n appliedSortDirection: direction,\n };\n }\n\n /**\n * Sets the collection filters.\n */\n setFilters(filters: DaffFilters, state: T): T {\n return {\n ...state,\n currentPage: 1,\n filters: filters || {},\n };\n }\n\n /**\n * Set the entire collection metadata at once.\n */\n setMetadata(metadata: DaffCollectionMetadata, state: T): T {\n return {\n ...state,\n ids: metadata.ids,\n count: metadata.count,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n sortOptions: metadata.sortOptions,\n totalPages: metadata.totalPages,\n appliedSortOption: metadata.appliedSortOption || state.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection || state.appliedSortDirection,\n filters: metadata.filters || {},\n };\n }\n}\n\n/**\n * Create the adapter for the collection state.\n */\nexport const getCollectionStateAdapter: <T extends DaffCollectionMetadata = DaffCollectionMetadata>() => DaffCollectionStateAdapter<T>\n = defaultMemoize(() => new DaffCollectionStateAdapter()).memoized;\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nexport const daffCollectionReducerInitialState: DaffCollectionMetadata = {\n count: 0,\n appliedSortOption: null,\n appliedSortDirection: null,\n currentPage: null,\n pageSize: null,\n totalPages: null,\n sortOptions: {\n default: null,\n options: [],\n },\n ids: [],\n filters: {},\n};\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n daffComputeAppliedFilters,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * An interface to describe all selectors related to the collection metadata.\n */\nexport interface DaffCollectionMemoizedSelectors<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> {\n /**\n * Selects the metadata for the collection.\n */\n selectCollectionMetadata: MemoizedSelector<TState, TMetadata>;\n /**\n * Builds a request that matches the current collection.\n */\n selectCollectionRequest: MemoizedSelector<TState, DaffCollectionRequest>;\n /**\n * Selects the total number of items of the collection.\n */\n selectCollectionCount: MemoizedSelector<TState, TMetadata['count']>;\n /**\n * Selects the current page of items of the collection.\n */\n selectCollectionCurrentPage: MemoizedSelector<TState, TMetadata['currentPage']>;\n /**\n * Selects the total number of pages of items that exist in the collection.\n */\n selectCollectionTotalPages: MemoizedSelector<TState, TMetadata['totalPages']>;\n /**\n * Selects the number of items on each collection.\n */\n selectCollectionPageSize: MemoizedSelector<TState, TMetadata['pageSize']>;\n /**\n * Selects the sort options that may be applied to the collection.\n */\n selectCollectionSortOptions: MemoizedSelector<TState, TMetadata['sortOptions']['options']>;\n /**\n * Selects the applied sorting option if one is applied.\n */\n selectCollectionAppliedSortOption: MemoizedSelector<TState, TMetadata['appliedSortOption']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionAppliedSortDirection: MemoizedSelector<TState, TMetadata['appliedSortDirection']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionIds: MemoizedSelector<TState, TMetadata['ids']>;\n /**\n * Selects the filters that may be applied to the collection.\n */\n selectCollectionFilters: MemoizedSelector<TState, TMetadata['filters']>;\n /**\n * Returns a dict of filters and only their applied options.\n * Filters with no applied options will be omitted.\n */\n selectCollectionAppliedFilters: MemoizedSelector<TState, DaffFilters>;\n}\n\n/**\n * Creates collection selectors.\n *\n * @param selectCollectionState A selector for the particular collection state upon which the returned selectors should operate.\n */\nexport const daffCollectionSelectorFactory = <\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n>(\n selectCollectionState: MemoizedSelector<TState, TMetadata>,\n): DaffCollectionMemoizedSelectors<TState, TMetadata> => {\n\n const selectCollectionMetadata = createSelector(\n selectCollectionState,\n state => state,\n );\n\n const selectCollectionRequest = createSelector(\n selectCollectionMetadata,\n metadata => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n }),\n );\n\n const selectCollectionCount = createSelector(\n selectCollectionMetadata,\n state => state.count,\n );\n\n const selectCollectionCurrentPage = createSelector(\n selectCollectionMetadata,\n state => state.currentPage,\n );\n\n const selectCollectionTotalPages = createSelector(\n selectCollectionMetadata,\n state => state.totalPages,\n );\n\n const selectCollectionPageSize = createSelector(\n selectCollectionMetadata,\n state => state.pageSize,\n );\n\n const selectCollectionSortOptions = createSelector(\n selectCollectionMetadata,\n state => state.sortOptions.options,\n );\n\n const selectCollectionAppliedSortOption = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortOption,\n );\n\n const selectCollectionAppliedSortDirection = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortDirection,\n );\n\n const selectCollectionIds = createSelector(\n selectCollectionMetadata,\n state => state.ids,\n );\n\n const selectCollectionFilters = createSelector(\n selectCollectionMetadata,\n state => state.filters,\n );\n\n const selectCollectionAppliedFilters = createSelector(\n selectCollectionFilters,\n filters => daffComputeAppliedFilters(filters),\n );\n\n return {\n selectCollectionMetadata,\n selectCollectionRequest,\n selectCollectionCount,\n selectCollectionCurrentPage,\n selectCollectionTotalPages,\n selectCollectionPageSize,\n selectCollectionSortOptions,\n selectCollectionAppliedSortOption,\n selectCollectionAppliedSortDirection,\n selectCollectionIds,\n selectCollectionFilters,\n selectCollectionAppliedFilters,\n };\n};\n","import {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\n\nimport { DaffCollectionFacadeInterface } from './facade.interface';\nimport { DaffCollectionMemoizedSelectors } from './selector-factory';\n\n/**\n * An abstract class for a collection facade.\n * It is configurable via its constructor parameters.\n * The particular collection state from which\n * this facade will read is determined by the selectors passed.\n *\n * @inheritdoc\n */\nexport abstract class DaffCollectionFacade<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> implements DaffCollectionFacadeInterface<TMetadata> {\n metadata$: Observable<TMetadata>;\n request$: Observable<DaffCollectionRequest>;\n count$: Observable<number>;\n currentPage$: Observable<number>;\n totalPages$: Observable<number>;\n pageSize$: Observable<number>;\n sortOptions$: Observable<DaffSortOption[]>;\n appliedSortOption$: Observable<string>;\n appliedSortDirection$: Observable<DaffSortDirectionEnum>;\n filters$: Observable<DaffFilters>;\n appliedFilters$: Observable<DaffFilters>;\n\n constructor(\n protected store: Store<TState>,\n selectors: DaffCollectionMemoizedSelectors<TState, TMetadata>,\n ) {\n\t this.metadata$ = this.store.pipe(select(selectors.selectCollectionMetadata));\n\t this.request$ = this.store.pipe(select(selectors.selectCollectionRequest));\n\t this.count$ = this.store.pipe(select(selectors.selectCollectionCount));\n\t this.currentPage$ = this.store.pipe(select(selectors.selectCollectionCurrentPage));\n\t this.totalPages$ = this.store.pipe(select(selectors.selectCollectionTotalPages));\n\t this.pageSize$ = this.store.pipe(select(selectors.selectCollectionPageSize));\n\t this.sortOptions$ = this.store.pipe(select(selectors.selectCollectionSortOptions));\n\t this.appliedSortOption$ = this.store.pipe(select(selectors.selectCollectionAppliedSortOption));\n\t this.appliedSortDirection$ = this.store.pipe(select(selectors.selectCollectionAppliedSortDirection));\n this.filters$ = this.store.pipe(select(selectors.selectCollectionFilters));\n\t this.appliedFilters$ = this.store.pipe(select(selectors.selectCollectionAppliedFilters));\n }\n\n /**\n * Dispatches the given action.\n *\n * @param action action to dispatch.\n */\n dispatch(action: Action) {\n\t this.store.dispatch(action);\n }\n}\n","import { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Puts the state in a \"resolving\" state that correspondes to loading platform data in a GET fashion.\n * Sets loading to `DaffState.Resolving`\n */\nexport function daffStartResolution <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Resolving,\n };\n};\n\n/**\n * Puts the state in a \"mutating\" state that correspondes to loading platform data in a POST or PUT fashion.\n */\nexport function daffStartMutation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Mutating,\n };\n};\n\n/**\n * Indicates a successfully completed operation.\n * Sets loading to stable and resets errors.\n */\nexport function daffCompleteOperation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: [],\n };\n};\n\n/**\n * Indicates a failed operation.\n * Sets loading to stable and stores errors.\n */\nexport function daffOperationFailed <T extends DaffOperationState = DaffOperationState>(errors: T['daffErrors'], state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: errors,\n };\n};\n\n/**\n * Resets errors.\n */\nexport function daffClearErrors <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffErrors: [],\n };\n};\n","import { DaffErrorable } from '../errors/public_api';\nimport {\n DaffState,\n DaffStateable,\n} from '../states/public_api';\n\n/**\n * A basic operation state.\n * Represents the current state of an operation and any associated errors.\n */\nexport interface DaffOperationState extends DaffErrorable, DaffStateable {}\n\nexport const daffOperationInitialState: DaffOperationState = {\n daffState: DaffState.Stable,\n daffErrors: [],\n};\n","import {\n createSelector,\n MemoizedSelector,\n Selector,\n} from '@ngrx/store';\n\nimport { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationStateSelectors<\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n> {\n /**\n * Selects the loading state enum.\n */\n selectLoadingState: MemoizedSelector<TRootState, TState['daffState']>;\n /**\n * Selects whether the operation state is in any of the loading states.\n */\n selectLoading: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is resolving.\n */\n selectResolving: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is mutating.\n */\n selectMutating: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects the errors in the operation state.\n */\n selectErrors: MemoizedSelector<TRootState, TState['daffErrors']>;\n /**\n * Selects whether the operation state has any errors.\n * If so, it should be considered to be in an \"error\" state.\n */\n selectHasErrors: MemoizedSelector<TRootState, boolean>;\n}\n\n/**\n * Creates a set of selectors for an operation state.\n *\n * @param selectState The feature selector for the operation state.\n */\nexport function daffOperationStateSelectorFactory <\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n>(\n selectState: Selector<TRootState, TState>,\n): DaffOperationStateSelectors<TRootState, TState> {\n const selectLoadingState = createSelector(\n selectState,\n state => state.daffState,\n );\n const selectLoading = createSelector(\n selectLoadingState,\n loadingState => loadingState !== DaffState.Stable,\n );\n const selectResolving = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Resolving,\n );\n const selectMutating = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Mutating,\n );\n const selectErrors = createSelector(\n selectState,\n state => state.daffErrors,\n );\n const selectHasErrors = createSelector(\n selectErrors,\n errors => errors.length > 0,\n );\n\n return {\n selectLoadingState,\n selectLoading,\n selectResolving,\n selectMutating,\n selectErrors,\n selectHasErrors,\n };\n};\n","import type { EntitySelectors } from '@ngrx/entity/src/models';\nimport {\n createSelector,\n defaultMemoize,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffOperationEntity } from './type';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationEntityStateSelectors<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n> {\n /**\n * Selects an entity by ID.\n */\n selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>;\n\n /**\n * Optimistically selects the list of entities.\n * This excludes temporary entities with errors.\n */\n selectOptimisticList: MemoizedSelector<TRootState, DaffOperationEntity<T>[]>;\n}\n\n/**\n * Creates a set of selectors for an entity operation state.\n *\n * @param selectState The feature selector for the entity operation state.\n */\nexport function daffOperationEntityStateSelectorFactory<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n>(\n entitySelectors: EntitySelectors<DaffOperationEntity<T>, TRootState>,\n): DaffOperationEntityStateSelectors<TRootState, T> {\n const selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>\n = defaultMemoize((id) => createSelector(\n entitySelectors.selectEntities,\n entities => entities[id],\n )).memoized;\n\n const selectOptimisticList = createSelector(\n entitySelectors.selectAll,\n (entities) => entities.filter(entity =>\n // ignore entities that are deleting\n // entity.daffState !== DaffState.Deleting &&\n // ignore placeholders with errors\n !(entity.daffTemp && entity.daffErrors.length > 0),\n ),\n );\n\n return {\n selectEntity,\n selectOptimisticList,\n };\n};\n","import {\n createEntityAdapter,\n EntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffStateError } from '../../errors/public_api';\nimport { DaffState } from '../../states/public_api';\nimport {\n daffOperationEntityStateSelectorFactory,\n DaffOperationEntityStateSelectors,\n} from './selectors';\nimport { DaffOperationEntityState } from './state.type';\nimport { DaffOperationEntity } from './type';\n\n/**\n * An entity state adapter that takes care of managing contextual operation and error state for entities.\n */\nexport interface DaffOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable> {\n /**\n * Stores a list of entities in state and resets them all to stable.\n */\n list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;\n /**\n * Optimistically adds a placeholder entity into state if necessary and sets the entity to resolving.\n */\n preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;\n /**\n * Upserts the entity into state and resets operation state and errors.\n */\n load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;\n /**\n * Adds a placeholder entity into state if `placeholderId` is specified and sets state to adding.\n */\n preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Adds the entity into state, sets operation state to added, and resets errors.\n */\n add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Sets the entity's operation state to mutating.\n */\n preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Upserts the entity into state, sets operation state to mutated, and resets errors.\n */\n update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Sets the entity's operation state to deleting.\n */\n preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Removes the entity from state.\n */\n remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Resets the entity's operation state and stores errors on the entity.\n */\n operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;\n /**\n * Resets the entity's operation state to stable.\n */\n resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Gets an empty entity state.\n */\n getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;\n /**\n * Gets entity selectors.\n */\n getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;\n}\n\nexport function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {\n return {\n list: (entities, state) => adapter.setAll(\n entities.map<DaffOperationEntity<T>>(entity => ({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n })),\n state,\n ),\n preload: (key, state) =>\n adapter.upsertOne(<DaffOperationEntity<T>>{\n // TODO: allow for non identifiable entities?\n id: key,\n daffState: DaffState.Resolving,\n daffErrors: [],\n daffTemp: !state.entities[key],\n }, state),\n load: (entity, state) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n }, state),\n preadd: (entity, state, placeholderId) =>\n placeholderId\n ? adapter.addOne({\n ...entity,\n // TODO: allow for non identifiable entities?\n id: placeholderId,\n daffState: DaffState.Adding,\n daffErrors: [],\n daffTemp: true,\n }, state)\n : state,\n add: (entity, state, placeholderId) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Added,\n daffErrors: [],\n daffTemp: false,\n }, placeholderId ? adapter.removeOne(placeholderId, state) : state),\n preupdate: (entity, state) =>\n adapter.upsertOne({\n ...state.entities[entity.id],\n daffState: DaffState.Mutating,\n daffErrors: [],\n }, state),\n update: (entity, state) =>\n adapter.updateOne({\n id: entity.id,\n changes: <Partial<DaffOperationEntity<T>>>{\n ...entity,\n daffState: DaffState.Mutated,\n daffErrors: [],\n daffTemp: false,\n },\n }, state),\n preremove: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffErrors: [],\n daffState: DaffState.Deleting,\n }, state),\n remove: adapter.removeOne,\n operationFailed: (key, errors, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n daffErrors: errors,\n }, state),\n resetState: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n }, state),\n getInitialState: adapter.getInitialState,\n getSelectors: <TRootState>(selectState) => daffOperationEntityStateSelectorFactory<TRootState, T>(adapter.getSelectors(selectState)),\n };\n}\n","import { DaffState } from '../../states/public_api';\n\n/**\n * Returns whether the state is one that represents an operation in progress.\n */\nexport function daffStateIsLoading(daffState: DaffState): boolean {\n return daffState === DaffState.Adding\n || daffState === DaffState.Mutating\n || daffState === DaffState.Resolving\n || daffState === DaffState.Deleting;\n}\n\n/**\n * Generate a fake ID for use with placeholder entities.\n *\n * @param key An optional key that can augment the randomly generated ID.\n * @returns A string cont\n */\nexport function daffOperationEntityCreateFakeId(key: string = ''): string {\n return `ε-${Date.now()}-${key}`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,CAAC;AAChE,MAAE,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;AAoBG;AACU,MAAA,SAAS,GAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB,KAAI;AAClF,IAAA,MAAM,WAAW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AAe;AACxC,QAAA,YAAY,EAAE,CAAa,WAAW,KAAK,uCAAuC,CAAgB,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;KACrI,CAAC;AACJ;;ACzJA;;AAEG;AACG,SAAU,kBAAkB,CAAC,SAAoB,EAAA;AACrD,IAAA,OAAO,SAAS,KAAqB,QAAA;AAChC,WAAA,SAAS,KAAuB,UAAA;AAChC,WAAA,SAAS,KAAwB,WAAA;AACjC,WAAA,SAAS,+BAAwB;AACxC,CAAC;AAED;;;;;AAKG;AACa,SAAA,+BAA+B,CAAC,GAAA,GAAc,EAAE,EAAA;IAC9D,OAAO,CAAA,EAAA,EAAK,IAAI,CAAC,GAAG,EAAE,CAAI,CAAA,EAAA,GAAG,EAAE,CAAC;AAClC;;ACpBA;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-core-state.mjs","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/reducers/identity.ts","../../../libs/core/state/src/collection/adapter.class.ts","../../../libs/core/state/src/collection/initial-state.ts","../../../libs/core/state/src/collection/selector-factory.ts","../../../libs/core/state/src/collection/facade.ts","../../../libs/core/state/src/operation/adapter.ts","../../../libs/core/state/src/operation/state.ts","../../../libs/core/state/src/operation/selectors.ts","../../../libs/core/state/src/operation/entity/selectors.ts","../../../libs/core/state/src/operation/entity/adapter.ts","../../../libs/core/state/src/operation/entity/helpers.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError {\n return { code, message, recoverable };\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","import { Action } from '@ngrx/store';\n\n/**\n * A simple reducer that simply returns the passed state.\n * This is useful for stubbing out parts of state that are not covered in an injected extra reducer map.\n */\nexport const daffIdentityReducer = <T = unknown>(state: T, action: Action): T => state;\n","import { defaultMemoize } from '@ngrx/store';\n\nimport {\n daffCollectionBuildMetadataFromRequest,\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * Provides an abstracted way to manage a collection state.\n */\nexport class DaffCollectionStateAdapter<T extends DaffCollectionMetadata = DaffCollectionMetadata> {\n /**\n * Stores a collection request in state.\n * This is useful when you want to preemptively reduce a request before waiting for a response.\n */\n storeRequest(request: DaffCollectionRequest, state: T): T {\n return {\n ...state,\n ...daffCollectionBuildMetadataFromRequest(request),\n };\n }\n\n /**\n * Sets the page size.\n */\n setPageSize(size: number, state: T): T {\n return {\n ...state,\n pageSize: size,\n currentPage: 1,\n };\n }\n\n /**\n * Sets the current page.\n */\n setCurrentPage(page: number, state: T): T {\n return {\n ...state,\n currentPage: page,\n };\n }\n\n /**\n * Sets the sorting option and direction.\n */\n setSort(option: string, direction: string, state: T): T {\n return {\n ...state,\n appliedSortOption: option,\n appliedSortDirection: direction,\n };\n }\n\n /**\n * Sets the collection filters.\n */\n setFilters(filters: DaffFilters, state: T): T {\n return {\n ...state,\n currentPage: 1,\n filters: filters || {},\n };\n }\n\n /**\n * Set the entire collection metadata at once.\n */\n setMetadata(metadata: DaffCollectionMetadata, state: T): T {\n return {\n ...state,\n ids: metadata.ids,\n count: metadata.count,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n sortOptions: metadata.sortOptions,\n totalPages: metadata.totalPages,\n appliedSortOption: metadata.appliedSortOption || state.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection || state.appliedSortDirection,\n filters: metadata.filters || {},\n };\n }\n}\n\n/**\n * Create the adapter for the collection state.\n */\nexport const getCollectionStateAdapter: <T extends DaffCollectionMetadata = DaffCollectionMetadata>() => DaffCollectionStateAdapter<T>\n = defaultMemoize(() => new DaffCollectionStateAdapter()).memoized;\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nexport const daffCollectionReducerInitialState: DaffCollectionMetadata = {\n count: 0,\n appliedSortOption: null,\n appliedSortDirection: null,\n currentPage: null,\n pageSize: null,\n totalPages: null,\n sortOptions: {\n default: null,\n options: [],\n },\n ids: [],\n filters: {},\n};\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n daffComputeAppliedFilters,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * An interface to describe all selectors related to the collection metadata.\n */\nexport interface DaffCollectionMemoizedSelectors<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> {\n /**\n * Selects the metadata for the collection.\n */\n selectCollectionMetadata: MemoizedSelector<TState, TMetadata>;\n /**\n * Builds a request that matches the current collection.\n */\n selectCollectionRequest: MemoizedSelector<TState, DaffCollectionRequest>;\n /**\n * Selects the total number of items of the collection.\n */\n selectCollectionCount: MemoizedSelector<TState, TMetadata['count']>;\n /**\n * Selects the current page of items of the collection.\n */\n selectCollectionCurrentPage: MemoizedSelector<TState, TMetadata['currentPage']>;\n /**\n * Selects the total number of pages of items that exist in the collection.\n */\n selectCollectionTotalPages: MemoizedSelector<TState, TMetadata['totalPages']>;\n /**\n * Selects the number of items on each collection.\n */\n selectCollectionPageSize: MemoizedSelector<TState, TMetadata['pageSize']>;\n /**\n * Selects the sort options that may be applied to the collection.\n */\n selectCollectionSortOptions: MemoizedSelector<TState, TMetadata['sortOptions']['options']>;\n /**\n * Selects the applied sorting option if one is applied.\n */\n selectCollectionAppliedSortOption: MemoizedSelector<TState, TMetadata['appliedSortOption']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionAppliedSortDirection: MemoizedSelector<TState, TMetadata['appliedSortDirection']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionIds: MemoizedSelector<TState, TMetadata['ids']>;\n /**\n * Selects the filters that may be applied to the collection.\n */\n selectCollectionFilters: MemoizedSelector<TState, TMetadata['filters']>;\n /**\n * Returns a dict of filters and only their applied options.\n * Filters with no applied options will be omitted.\n */\n selectCollectionAppliedFilters: MemoizedSelector<TState, DaffFilters>;\n}\n\n/**\n * Creates collection selectors.\n *\n * @param selectCollectionState A selector for the particular collection state upon which the returned selectors should operate.\n */\nexport const daffCollectionSelectorFactory = <\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n>(\n selectCollectionState: MemoizedSelector<TState, TMetadata>,\n): DaffCollectionMemoizedSelectors<TState, TMetadata> => {\n\n const selectCollectionMetadata = createSelector(\n selectCollectionState,\n state => state,\n );\n\n const selectCollectionRequest = createSelector(\n selectCollectionMetadata,\n metadata => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n }),\n );\n\n const selectCollectionCount = createSelector(\n selectCollectionMetadata,\n state => state.count,\n );\n\n const selectCollectionCurrentPage = createSelector(\n selectCollectionMetadata,\n state => state.currentPage,\n );\n\n const selectCollectionTotalPages = createSelector(\n selectCollectionMetadata,\n state => state.totalPages,\n );\n\n const selectCollectionPageSize = createSelector(\n selectCollectionMetadata,\n state => state.pageSize,\n );\n\n const selectCollectionSortOptions = createSelector(\n selectCollectionMetadata,\n state => state.sortOptions.options,\n );\n\n const selectCollectionAppliedSortOption = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortOption,\n );\n\n const selectCollectionAppliedSortDirection = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortDirection,\n );\n\n const selectCollectionIds = createSelector(\n selectCollectionMetadata,\n state => state.ids,\n );\n\n const selectCollectionFilters = createSelector(\n selectCollectionMetadata,\n state => state.filters,\n );\n\n const selectCollectionAppliedFilters = createSelector(\n selectCollectionFilters,\n filters => daffComputeAppliedFilters(filters),\n );\n\n return {\n selectCollectionMetadata,\n selectCollectionRequest,\n selectCollectionCount,\n selectCollectionCurrentPage,\n selectCollectionTotalPages,\n selectCollectionPageSize,\n selectCollectionSortOptions,\n selectCollectionAppliedSortOption,\n selectCollectionAppliedSortDirection,\n selectCollectionIds,\n selectCollectionFilters,\n selectCollectionAppliedFilters,\n };\n};\n","import {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\n\nimport { DaffCollectionFacadeInterface } from './facade.interface';\nimport { DaffCollectionMemoizedSelectors } from './selector-factory';\n\n/**\n * An abstract class for a collection facade.\n * It is configurable via its constructor parameters.\n * The particular collection state from which\n * this facade will read is determined by the selectors passed.\n *\n * @inheritdoc\n */\nexport abstract class DaffCollectionFacade<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> implements DaffCollectionFacadeInterface<TMetadata> {\n metadata$: Observable<TMetadata>;\n request$: Observable<DaffCollectionRequest>;\n count$: Observable<number>;\n currentPage$: Observable<number>;\n totalPages$: Observable<number>;\n pageSize$: Observable<number>;\n sortOptions$: Observable<DaffSortOption[]>;\n appliedSortOption$: Observable<string>;\n appliedSortDirection$: Observable<DaffSortDirectionEnum>;\n filters$: Observable<DaffFilters>;\n appliedFilters$: Observable<DaffFilters>;\n\n constructor(\n protected store: Store<TState>,\n selectors: DaffCollectionMemoizedSelectors<TState, TMetadata>,\n ) {\n\t this.metadata$ = this.store.pipe(select(selectors.selectCollectionMetadata));\n\t this.request$ = this.store.pipe(select(selectors.selectCollectionRequest));\n\t this.count$ = this.store.pipe(select(selectors.selectCollectionCount));\n\t this.currentPage$ = this.store.pipe(select(selectors.selectCollectionCurrentPage));\n\t this.totalPages$ = this.store.pipe(select(selectors.selectCollectionTotalPages));\n\t this.pageSize$ = this.store.pipe(select(selectors.selectCollectionPageSize));\n\t this.sortOptions$ = this.store.pipe(select(selectors.selectCollectionSortOptions));\n\t this.appliedSortOption$ = this.store.pipe(select(selectors.selectCollectionAppliedSortOption));\n\t this.appliedSortDirection$ = this.store.pipe(select(selectors.selectCollectionAppliedSortDirection));\n this.filters$ = this.store.pipe(select(selectors.selectCollectionFilters));\n\t this.appliedFilters$ = this.store.pipe(select(selectors.selectCollectionAppliedFilters));\n }\n\n /**\n * Dispatches the given action.\n *\n * @param action action to dispatch.\n */\n dispatch(action: Action) {\n\t this.store.dispatch(action);\n }\n}\n","import { DaffOperationState } from './state';\nimport { DaffState } from '../states/public_api';\n\n/**\n * Puts the state in a \"resolving\" state that correspondes to loading platform data in a GET fashion.\n * Sets loading to `DaffState.Resolving`\n */\nexport function daffStartResolution <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Resolving,\n };\n};\n\n/**\n * Puts the state in a \"mutating\" state that correspondes to loading platform data in a POST or PUT fashion.\n */\nexport function daffStartMutation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Mutating,\n };\n};\n\n/**\n * Indicates a successfully completed operation.\n * Sets loading to stable and resets errors.\n */\nexport function daffCompleteOperation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: [],\n };\n};\n\n/**\n * Indicates a failed operation.\n * Sets loading to stable and stores errors.\n */\nexport function daffOperationFailed <T extends DaffOperationState = DaffOperationState>(errors: T['daffErrors'], state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: errors,\n };\n};\n\n/**\n * Resets errors.\n */\nexport function daffClearErrors <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffErrors: [],\n };\n};\n","import { DaffErrorable } from '../errors/public_api';\nimport {\n DaffState,\n DaffStateable,\n} from '../states/public_api';\n\n/**\n * A basic operation state.\n * Represents the current state of an operation and any associated errors.\n */\nexport interface DaffOperationState extends DaffErrorable, DaffStateable {}\n\nexport const daffOperationInitialState: DaffOperationState = {\n daffState: DaffState.Stable,\n daffErrors: [],\n};\n","import {\n createSelector,\n MemoizedSelector,\n Selector,\n} from '@ngrx/store';\n\nimport { DaffOperationState } from './state';\nimport { DaffState } from '../states/public_api';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationStateSelectors<\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n> {\n /**\n * Selects the loading state enum.\n */\n selectLoadingState: MemoizedSelector<TRootState, TState['daffState']>;\n /**\n * Selects whether the operation state is in any of the loading states.\n */\n selectLoading: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is resolving.\n */\n selectResolving: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is mutating.\n */\n selectMutating: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects the errors in the operation state.\n */\n selectErrors: MemoizedSelector<TRootState, TState['daffErrors']>;\n /**\n * Selects whether the operation state has any errors.\n * If so, it should be considered to be in an \"error\" state.\n */\n selectHasErrors: MemoizedSelector<TRootState, boolean>;\n}\n\n/**\n * Creates a set of selectors for an operation state.\n *\n * @param selectState The feature selector for the operation state.\n */\nexport function daffOperationStateSelectorFactory <\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n>(\n selectState: Selector<TRootState, TState>,\n): DaffOperationStateSelectors<TRootState, TState> {\n const selectLoadingState = createSelector(\n selectState,\n state => state.daffState,\n );\n const selectLoading = createSelector(\n selectLoadingState,\n loadingState => loadingState !== DaffState.Stable,\n );\n const selectResolving = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Resolving,\n );\n const selectMutating = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Mutating,\n );\n const selectErrors = createSelector(\n selectState,\n state => state.daffErrors,\n );\n const selectHasErrors = createSelector(\n selectErrors,\n errors => errors.length > 0,\n );\n\n return {\n selectLoadingState,\n selectLoading,\n selectResolving,\n selectMutating,\n selectErrors,\n selectHasErrors,\n };\n};\n","import type { EntitySelectors } from '@ngrx/entity/src/models';\nimport {\n createSelector,\n defaultMemoize,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffOperationEntity } from './type';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationEntityStateSelectors<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n> {\n /**\n * Selects an entity by ID.\n */\n selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>;\n\n /**\n * Optimistically selects the list of entities.\n * This excludes temporary entities with errors.\n */\n selectOptimisticList: MemoizedSelector<TRootState, DaffOperationEntity<T>[]>;\n}\n\n/**\n * Creates a set of selectors for an entity operation state.\n *\n * @param selectState The feature selector for the entity operation state.\n */\nexport function daffOperationEntityStateSelectorFactory<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n>(\n entitySelectors: EntitySelectors<DaffOperationEntity<T>, TRootState>,\n): DaffOperationEntityStateSelectors<TRootState, T> {\n const selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>\n = defaultMemoize((id) => createSelector(\n entitySelectors.selectEntities,\n entities => entities[id],\n )).memoized;\n\n const selectOptimisticList = createSelector(\n entitySelectors.selectAll,\n (entities) => entities.filter(entity =>\n // ignore entities that are deleting\n // entity.daffState !== DaffState.Deleting &&\n // ignore placeholders with errors\n !(entity.daffTemp && entity.daffErrors.length > 0),\n ),\n );\n\n return {\n selectEntity,\n selectOptimisticList,\n };\n};\n","import {\n createEntityAdapter,\n EntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport {\n daffOperationEntityStateSelectorFactory,\n DaffOperationEntityStateSelectors,\n} from './selectors';\nimport { DaffOperationEntityState } from './state.type';\nimport { DaffOperationEntity } from './type';\nimport { DaffStateError } from '../../errors/public_api';\nimport { DaffState } from '../../states/public_api';\n\n/**\n * An entity state adapter that takes care of managing contextual operation and error state for entities.\n */\nexport interface DaffOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable> {\n /**\n * Stores a list of entities in state and resets them all to stable.\n */\n list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;\n /**\n * Optimistically adds a placeholder entity into state if necessary and sets the entity to resolving.\n */\n preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;\n /**\n * Upserts the entity into state and resets operation state and errors.\n */\n load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;\n /**\n * Adds a placeholder entity into state if `placeholderId` is specified and sets state to adding.\n */\n preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Adds the entity into state, sets operation state to added, and resets errors.\n */\n add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Sets the entity's operation state to mutating.\n */\n preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Upserts the entity into state, sets operation state to mutated, and resets errors.\n */\n update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Sets the entity's operation state to deleting.\n */\n preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Removes the entity from state.\n */\n remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Resets the entity's operation state and stores errors on the entity.\n */\n operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;\n /**\n * Resets the entity's operation state to stable.\n */\n resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Gets an empty entity state.\n */\n getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;\n /**\n * Gets entity selectors.\n */\n getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;\n}\n\nexport function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {\n return {\n list: (entities, state) => adapter.setAll(\n entities.map<DaffOperationEntity<T>>(entity => ({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n })),\n state,\n ),\n preload: (key, state) =>\n adapter.upsertOne(<DaffOperationEntity<T>>{\n // TODO: allow for non identifiable entities?\n id: key,\n daffState: DaffState.Resolving,\n daffErrors: [],\n daffTemp: !state.entities[key],\n }, state),\n load: (entity, state) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n }, state),\n preadd: (entity, state, placeholderId) =>\n placeholderId\n ? adapter.addOne({\n ...entity,\n // TODO: allow for non identifiable entities?\n id: placeholderId,\n daffState: DaffState.Adding,\n daffErrors: [],\n daffTemp: true,\n }, state)\n : state,\n add: (entity, state, placeholderId) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Added,\n daffErrors: [],\n daffTemp: false,\n }, placeholderId ? adapter.removeOne(placeholderId, state) : state),\n preupdate: (entity, state) =>\n adapter.upsertOne({\n ...state.entities[entity.id],\n daffState: DaffState.Mutating,\n daffErrors: [],\n }, state),\n update: (entity, state) =>\n adapter.updateOne({\n id: entity.id,\n changes: <Partial<DaffOperationEntity<T>>>{\n ...entity,\n daffState: DaffState.Mutated,\n daffErrors: [],\n daffTemp: false,\n },\n }, state),\n preremove: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffErrors: [],\n daffState: DaffState.Deleting,\n }, state),\n remove: adapter.removeOne,\n operationFailed: (key, errors, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n daffErrors: errors,\n }, state),\n resetState: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n }, state),\n getInitialState: adapter.getInitialState,\n getSelectors: <TRootState>(selectState) => daffOperationEntityStateSelectorFactory<TRootState, T>(adapter.getSelectors(selectState)),\n };\n}\n","import { DaffState } from '../../states/public_api';\n\n/**\n * Returns whether the state is one that represents an operation in progress.\n */\nexport function daffStateIsLoading(daffState: DaffState): boolean {\n return daffState === DaffState.Adding\n || daffState === DaffState.Mutating\n || daffState === DaffState.Resolving\n || daffState === DaffState.Deleting;\n}\n\n/**\n * Generate a fake ID for use with placeholder entities.\n *\n * @param key An optional key that can augment the randomly generated ID.\n * @returns A string cont\n */\nexport function daffOperationEntityCreateFakeId(key: string = ''): string {\n return `ε-${Date.now()}-${key}`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,CAAC;AAChE,MAAE,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;AAoBG;AACU,MAAA,SAAS,GAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB,KAAI;AAClF,IAAA,MAAM,WAAW,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;AACpF,IAAA,MAAM,0B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