@ngrx/signals 17.1.1 → 18.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/entities/src/models.d.ts +2 -4
- package/esm2022/entities/src/helpers.mjs +1 -1
- package/esm2022/entities/src/models.mjs +1 -1
- package/esm2022/rxjs-interop/src/rx-method.mjs +1 -1
- package/esm2022/src/deep-signal.mjs +1 -1
- package/esm2022/src/helpers.mjs +1 -1
- package/esm2022/src/patch-state.mjs +1 -1
- package/esm2022/src/signal-store.mjs +4 -4
- package/esm2022/src/with-hooks.mjs +1 -1
- package/fesm2022/ngrx-signals-entities.mjs +191 -174
- package/fesm2022/ngrx-signals-entities.mjs.map +7 -1
- package/fesm2022/ngrx-signals-rxjs-interop.mjs +33 -36
- package/fesm2022/ngrx-signals-rxjs-interop.mjs.map +7 -1
- package/fesm2022/ngrx-signals.mjs +176 -162
- package/fesm2022/ngrx-signals.mjs.map +7 -1
- package/package.json +2 -2
- package/schematics-core/utility/ast-utils.js.map +1 -1
- package/schematics-core/utility/change.js.map +1 -1
- package/schematics-core/utility/config.js.map +1 -1
- package/schematics-core/utility/find-component.js.map +1 -1
- package/schematics-core/utility/find-module.js.map +1 -1
- package/schematics-core/utility/json-utilts.js.map +1 -1
- package/schematics-core/utility/libs-version.js +1 -1
- package/schematics-core/utility/libs-version.js.map +1 -1
- package/schematics-core/utility/ngrx-utils.js.map +1 -1
- package/schematics-core/utility/package.js.map +1 -1
- package/schematics-core/utility/project.js.map +1 -1
- package/schematics-core/utility/strings.js.map +1 -1
- package/schematics-core/utility/update.js.map +1 -1
- package/schematics-core/utility/visitors.js.map +1 -1
- package/src/patch-state.d.ts +2 -1
|
@@ -1,241 +1,258 @@
|
|
|
1
|
-
|
|
2
|
-
import { withState, withComputed, signalStoreFeature } from '@ngrx/signals';
|
|
3
|
-
|
|
1
|
+
// src/models.mjs
|
|
4
2
|
var DidMutate;
|
|
5
|
-
(function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
(function(DidMutate2) {
|
|
4
|
+
DidMutate2[DidMutate2["None"] = 0] = "None";
|
|
5
|
+
DidMutate2[DidMutate2["Entities"] = 1] = "Entities";
|
|
6
|
+
DidMutate2[DidMutate2["Both"] = 2] = "Both";
|
|
9
7
|
})(DidMutate || (DidMutate = {}));
|
|
10
8
|
|
|
9
|
+
// src/helpers.mjs
|
|
11
10
|
function getEntityIdKey(config) {
|
|
12
|
-
|
|
11
|
+
return config?.idKey ?? "id";
|
|
13
12
|
}
|
|
14
13
|
function getEntityStateKeys(config) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const collection = config?.collection;
|
|
15
|
+
const entityMapKey = collection === void 0 ? "entityMap" : `${collection}EntityMap`;
|
|
16
|
+
const idsKey = collection === void 0 ? "ids" : `${collection}Ids`;
|
|
17
|
+
const entitiesKey = collection === void 0 ? "entities" : `${collection}Entities`;
|
|
18
|
+
return { entityMapKey, idsKey, entitiesKey };
|
|
20
19
|
}
|
|
21
20
|
function cloneEntityState(state, stateKeys) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
return {
|
|
22
|
+
entityMap: { ...state[stateKeys.entityMapKey] },
|
|
23
|
+
ids: [...state[stateKeys.idsKey]]
|
|
24
|
+
};
|
|
26
25
|
}
|
|
27
26
|
function getEntityUpdaterResult(state, stateKeys, didMutate) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
default: {
|
|
39
|
-
return {};
|
|
40
|
-
}
|
|
27
|
+
switch (didMutate) {
|
|
28
|
+
case DidMutate.Both: {
|
|
29
|
+
return {
|
|
30
|
+
[stateKeys.entityMapKey]: state.entityMap,
|
|
31
|
+
[stateKeys.idsKey]: state.ids
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
case DidMutate.Entities: {
|
|
35
|
+
return { [stateKeys.entityMapKey]: state.entityMap };
|
|
41
36
|
}
|
|
37
|
+
default: {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
42
41
|
}
|
|
43
42
|
function addEntityMutably(state, entity, idKey) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const id = entity[idKey];
|
|
44
|
+
if (state.entityMap[id]) {
|
|
45
|
+
return DidMutate.None;
|
|
46
|
+
}
|
|
47
|
+
state.entityMap[id] = entity;
|
|
48
|
+
state.ids.push(id);
|
|
49
|
+
return DidMutate.Both;
|
|
51
50
|
}
|
|
52
51
|
function addEntitiesMutably(state, entities, idKey) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
52
|
+
let didMutate = DidMutate.None;
|
|
53
|
+
for (const entity of entities) {
|
|
54
|
+
const result = addEntityMutably(state, entity, idKey);
|
|
55
|
+
if (result === DidMutate.Both) {
|
|
56
|
+
didMutate = result;
|
|
59
57
|
}
|
|
60
|
-
|
|
58
|
+
}
|
|
59
|
+
return didMutate;
|
|
61
60
|
}
|
|
62
61
|
function setEntityMutably(state, entity, idKey) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
state.entityMap[id] = entity;
|
|
66
|
-
return DidMutate.Entities;
|
|
67
|
-
}
|
|
62
|
+
const id = entity[idKey];
|
|
63
|
+
if (state.entityMap[id]) {
|
|
68
64
|
state.entityMap[id] = entity;
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
return DidMutate.Entities;
|
|
66
|
+
}
|
|
67
|
+
state.entityMap[id] = entity;
|
|
68
|
+
state.ids.push(id);
|
|
69
|
+
return DidMutate.Both;
|
|
71
70
|
}
|
|
72
71
|
function setEntitiesMutably(state, entities, idKey) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
didMutate = result;
|
|
72
|
+
let didMutate = DidMutate.None;
|
|
73
|
+
for (const entity of entities) {
|
|
74
|
+
const result = setEntityMutably(state, entity, idKey);
|
|
75
|
+
if (didMutate === DidMutate.Both) {
|
|
76
|
+
continue;
|
|
80
77
|
}
|
|
81
|
-
|
|
78
|
+
didMutate = result;
|
|
79
|
+
}
|
|
80
|
+
return didMutate;
|
|
82
81
|
}
|
|
83
82
|
function removeEntitiesMutably(state, idsOrPredicate) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
delete state.entityMap[id];
|
|
91
|
-
didMutate = DidMutate.Both;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (didMutate === DidMutate.Both) {
|
|
95
|
-
state.ids = state.ids.filter((id) => id in state.entityMap);
|
|
83
|
+
const ids = Array.isArray(idsOrPredicate) ? idsOrPredicate : state.ids.filter((id) => idsOrPredicate(state.entityMap[id]));
|
|
84
|
+
let didMutate = DidMutate.None;
|
|
85
|
+
for (const id of ids) {
|
|
86
|
+
if (state.entityMap[id]) {
|
|
87
|
+
delete state.entityMap[id];
|
|
88
|
+
didMutate = DidMutate.Both;
|
|
96
89
|
}
|
|
97
|
-
|
|
90
|
+
}
|
|
91
|
+
if (didMutate === DidMutate.Both) {
|
|
92
|
+
state.ids = state.ids.filter((id) => id in state.entityMap);
|
|
93
|
+
}
|
|
94
|
+
return didMutate;
|
|
98
95
|
}
|
|
99
96
|
function updateEntitiesMutably(state, idsOrPredicate, changes) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
state.entityMap[id] = { ...entity, ...changesRecord };
|
|
109
|
-
didMutate = DidMutate.Entities;
|
|
110
|
-
}
|
|
97
|
+
const ids = Array.isArray(idsOrPredicate) ? idsOrPredicate : state.ids.filter((id) => idsOrPredicate(state.entityMap[id]));
|
|
98
|
+
let didMutate = DidMutate.None;
|
|
99
|
+
for (const id of ids) {
|
|
100
|
+
const entity = state.entityMap[id];
|
|
101
|
+
if (entity) {
|
|
102
|
+
const changesRecord = typeof changes === "function" ? changes(entity) : changes;
|
|
103
|
+
state.entityMap[id] = { ...entity, ...changesRecord };
|
|
104
|
+
didMutate = DidMutate.Entities;
|
|
111
105
|
}
|
|
112
|
-
|
|
106
|
+
}
|
|
107
|
+
return didMutate;
|
|
113
108
|
}
|
|
114
109
|
|
|
110
|
+
// src/updaters/add-entity.mjs
|
|
115
111
|
function addEntity(entity, config) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
112
|
+
const idKey = getEntityIdKey(config);
|
|
113
|
+
const stateKeys = getEntityStateKeys(config);
|
|
114
|
+
return (state) => {
|
|
115
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
116
|
+
const didMutate = addEntityMutably(clonedState, entity, idKey);
|
|
117
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
118
|
+
};
|
|
123
119
|
}
|
|
124
120
|
|
|
121
|
+
// src/updaters/add-entities.mjs
|
|
125
122
|
function addEntities(entities, config) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
const idKey = getEntityIdKey(config);
|
|
124
|
+
const stateKeys = getEntityStateKeys(config);
|
|
125
|
+
return (state) => {
|
|
126
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
127
|
+
const didMutate = addEntitiesMutably(clonedState, entities, idKey);
|
|
128
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
129
|
+
};
|
|
133
130
|
}
|
|
134
131
|
|
|
132
|
+
// src/updaters/remove-entity.mjs
|
|
135
133
|
function removeEntity(id, config) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
const stateKeys = getEntityStateKeys(config);
|
|
135
|
+
return (state) => {
|
|
136
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
137
|
+
const didMutate = removeEntitiesMutably(clonedState, [id]);
|
|
138
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
139
|
+
};
|
|
142
140
|
}
|
|
143
141
|
|
|
142
|
+
// src/updaters/remove-entities.mjs
|
|
144
143
|
function removeEntities(idsOrPredicate, config) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
const stateKeys = getEntityStateKeys(config);
|
|
145
|
+
return (state) => {
|
|
146
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
147
|
+
const didMutate = removeEntitiesMutably(clonedState, idsOrPredicate);
|
|
148
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
149
|
+
};
|
|
151
150
|
}
|
|
152
151
|
|
|
152
|
+
// src/updaters/remove-all-entities.mjs
|
|
153
153
|
function removeAllEntities(config) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
const stateKeys = getEntityStateKeys(config);
|
|
155
|
+
return () => ({
|
|
156
|
+
[stateKeys.entityMapKey]: {},
|
|
157
|
+
[stateKeys.idsKey]: []
|
|
158
|
+
});
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
// src/updaters/set-entity.mjs
|
|
161
162
|
function setEntity(entity, config) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
const idKey = getEntityIdKey(config);
|
|
164
|
+
const stateKeys = getEntityStateKeys(config);
|
|
165
|
+
return (state) => {
|
|
166
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
167
|
+
const didMutate = setEntityMutably(clonedState, entity, idKey);
|
|
168
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
169
|
+
};
|
|
169
170
|
}
|
|
170
171
|
|
|
172
|
+
// src/updaters/set-entities.mjs
|
|
171
173
|
function setEntities(entities, config) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
const idKey = getEntityIdKey(config);
|
|
175
|
+
const stateKeys = getEntityStateKeys(config);
|
|
176
|
+
return (state) => {
|
|
177
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
178
|
+
const didMutate = setEntitiesMutably(clonedState, entities, idKey);
|
|
179
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
180
|
+
};
|
|
179
181
|
}
|
|
180
182
|
|
|
183
|
+
// src/updaters/set-all-entities.mjs
|
|
181
184
|
function setAllEntities(entities, config) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
};
|
|
185
|
+
const idKey = getEntityIdKey(config);
|
|
186
|
+
const stateKeys = getEntityStateKeys(config);
|
|
187
|
+
return () => {
|
|
188
|
+
const state = { entityMap: {}, ids: [] };
|
|
189
|
+
setEntitiesMutably(state, entities, idKey);
|
|
190
|
+
return {
|
|
191
|
+
[stateKeys.entityMapKey]: state.entityMap,
|
|
192
|
+
[stateKeys.idsKey]: state.ids
|
|
191
193
|
};
|
|
194
|
+
};
|
|
192
195
|
}
|
|
193
196
|
|
|
197
|
+
// src/updaters/update-entity.mjs
|
|
194
198
|
function updateEntity(update, config) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
const stateKeys = getEntityStateKeys(config);
|
|
200
|
+
return (state) => {
|
|
201
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
202
|
+
const didMutate = updateEntitiesMutably(clonedState, [update.id], update.changes);
|
|
203
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
204
|
+
};
|
|
201
205
|
}
|
|
202
206
|
|
|
207
|
+
// src/updaters/update-entities.mjs
|
|
203
208
|
function updateEntities(update, config) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
const stateKeys = getEntityStateKeys(config);
|
|
210
|
+
const idsOrPredicate = "ids" in update ? update.ids : update.predicate;
|
|
211
|
+
return (state) => {
|
|
212
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
213
|
+
const didMutate = updateEntitiesMutably(clonedState, idsOrPredicate, update.changes);
|
|
214
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
215
|
+
};
|
|
211
216
|
}
|
|
212
217
|
|
|
218
|
+
// src/updaters/update-all-entities.mjs
|
|
213
219
|
function updateAllEntities(changes, config) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
+
const stateKeys = getEntityStateKeys(config);
|
|
221
|
+
return (state) => {
|
|
222
|
+
const clonedState = cloneEntityState(state, stateKeys);
|
|
223
|
+
const didMutate = updateEntitiesMutably(clonedState, state[stateKeys.idsKey], changes);
|
|
224
|
+
return getEntityUpdaterResult(clonedState, stateKeys, didMutate);
|
|
225
|
+
};
|
|
220
226
|
}
|
|
221
227
|
|
|
228
|
+
// src/with-entities.mjs
|
|
229
|
+
import { computed } from "@angular/core";
|
|
230
|
+
import { signalStoreFeature, withComputed, withState } from "@ngrx/signals";
|
|
222
231
|
function withEntities(config) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
const { entityMapKey, idsKey, entitiesKey } = getEntityStateKeys(config);
|
|
233
|
+
return signalStoreFeature(withState({
|
|
234
|
+
[entityMapKey]: {},
|
|
235
|
+
[idsKey]: []
|
|
236
|
+
}), withComputed((store) => ({
|
|
237
|
+
[entitiesKey]: computed(() => {
|
|
238
|
+
const entityMap = store[entityMapKey]();
|
|
239
|
+
const ids = store[idsKey]();
|
|
240
|
+
return ids.map((id) => entityMap[id]);
|
|
241
|
+
})
|
|
242
|
+
})));
|
|
234
243
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
244
|
+
export {
|
|
245
|
+
addEntities,
|
|
246
|
+
addEntity,
|
|
247
|
+
removeAllEntities,
|
|
248
|
+
removeEntities,
|
|
249
|
+
removeEntity,
|
|
250
|
+
setAllEntities,
|
|
251
|
+
setEntities,
|
|
252
|
+
setEntity,
|
|
253
|
+
updateAllEntities,
|
|
254
|
+
updateEntities,
|
|
255
|
+
updateEntity,
|
|
256
|
+
withEntities
|
|
257
|
+
};
|
|
241
258
|
//# sourceMappingURL=ngrx-signals-entities.mjs.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"file":"ngrx-signals-entities.mjs","sources":["../../../../modules/signals/entities/src/models.ts","../../../../modules/signals/entities/src/helpers.ts","../../../../modules/signals/entities/src/updaters/add-entity.ts","../../../../modules/signals/entities/src/updaters/add-entities.ts","../../../../modules/signals/entities/src/updaters/remove-entity.ts","../../../../modules/signals/entities/src/updaters/remove-entities.ts","../../../../modules/signals/entities/src/updaters/remove-all-entities.ts","../../../../modules/signals/entities/src/updaters/set-entity.ts","../../../../modules/signals/entities/src/updaters/set-entities.ts","../../../../modules/signals/entities/src/updaters/set-all-entities.ts","../../../../modules/signals/entities/src/updaters/update-entity.ts","../../../../modules/signals/entities/src/updaters/update-entities.ts","../../../../modules/signals/entities/src/updaters/update-all-entities.ts","../../../../modules/signals/entities/src/with-entities.ts","../../../../modules/signals/entities/ngrx-signals-entities.ts"],"sourcesContent":["import { Signal } from '@angular/core';\n\nexport type EntityId = string | number;\n\nexport type EntityMap<Entity> = Record<EntityId, Entity>;\n\nexport type EntityState<Entity> = {\n entityMap: EntityMap<Entity>;\n ids: EntityId[];\n};\n\nexport type NamedEntityState<Entity, Collection extends string> = {\n [K in Collection as `${K}EntityMap`]: EntityMap<Entity>;\n} & { [K in Collection as `${K}Ids`]: EntityId[] };\n\nexport type EntitySignals<Entity> = {\n entities: Signal<Entity[]>;\n};\n\nexport type NamedEntitySignals<Entity, Collection extends string> = {\n [K in Collection as `${K}Entities`]: Signal<Entity[]>;\n};\n\nexport type EntityIdProps<Entity> = {\n [K in keyof Entity as Entity[K] extends EntityId ? K : never]: Entity[K];\n};\n\nexport type EntityIdKey<Entity> = keyof EntityIdProps<Entity> & string;\n\nexport type EntityPredicate<Entity> = (entity: Entity) => boolean;\n\nexport type EntityChanges<Entity> =\n | Partial<Entity>\n | ((entity: Entity) => Partial<Entity>);\n\nexport enum DidMutate {\n None,\n Entities,\n Both,\n}\n","import {\n DidMutate,\n EntityChanges,\n EntityId,\n EntityPredicate,\n EntityState,\n} from './models';\n\nexport function getEntityIdKey(config?: { idKey?: string }): string {\n return config?.idKey ?? 'id';\n}\n\nexport function getEntityStateKeys(config?: { collection?: string }): {\n entityMapKey: string;\n idsKey: string;\n entitiesKey: string;\n} {\n const collection = config?.collection;\n const entityMapKey =\n collection === undefined ? 'entityMap' : `${collection}EntityMap`;\n const idsKey = collection === undefined ? 'ids' : `${collection}Ids`;\n const entitiesKey =\n collection === undefined ? 'entities' : `${collection}Entities`;\n\n return { entityMapKey, idsKey, entitiesKey };\n}\n\nexport function cloneEntityState(\n state: Record<string, any>,\n stateKeys: {\n entityMapKey: string;\n idsKey: string;\n }\n): EntityState<any> {\n return {\n entityMap: { ...state[stateKeys.entityMapKey] },\n ids: [...state[stateKeys.idsKey]],\n };\n}\n\nexport function getEntityUpdaterResult(\n state: EntityState<any>,\n stateKeys: {\n entityMapKey: string;\n idsKey: string;\n },\n didMutate: DidMutate\n): Record<string, any> {\n switch (didMutate) {\n case DidMutate.Both: {\n return {\n [stateKeys.entityMapKey]: state.entityMap,\n [stateKeys.idsKey]: state.ids,\n };\n }\n case DidMutate.Entities: {\n return { [stateKeys.entityMapKey]: state.entityMap };\n }\n default: {\n return {};\n }\n }\n}\n\nexport function addEntityMutably(\n state: EntityState<any>,\n entity: any,\n idKey: string\n): DidMutate {\n const id = entity[idKey];\n\n if (state.entityMap[id]) {\n return DidMutate.None;\n }\n\n state.entityMap[id] = entity;\n state.ids.push(id);\n\n return DidMutate.Both;\n}\n\nexport function addEntitiesMutably(\n state: EntityState<any>,\n entities: any[],\n idKey: string\n): DidMutate {\n let didMutate = DidMutate.None;\n\n for (const entity of entities) {\n const result = addEntityMutably(state, entity, idKey);\n\n if (result === DidMutate.Both) {\n didMutate = result;\n }\n }\n\n return didMutate;\n}\n\nexport function setEntityMutably(\n state: EntityState<any>,\n entity: any,\n idKey: string\n): DidMutate {\n const id = entity[idKey];\n\n if (state.entityMap[id]) {\n state.entityMap[id] = entity;\n return DidMutate.Entities;\n }\n\n state.entityMap[id] = entity;\n state.ids.push(id);\n\n return DidMutate.Both;\n}\n\nexport function setEntitiesMutably(\n state: EntityState<any>,\n entities: any[],\n idKey: string\n): DidMutate {\n let didMutate = DidMutate.None;\n\n for (const entity of entities) {\n const result = setEntityMutably(state, entity, idKey);\n\n if (didMutate === DidMutate.Both) {\n continue;\n }\n\n didMutate = result;\n }\n\n return didMutate;\n}\n\nexport function removeEntitiesMutably(\n state: EntityState<any>,\n idsOrPredicate: EntityId[] | EntityPredicate<any>\n): DidMutate {\n const ids = Array.isArray(idsOrPredicate)\n ? idsOrPredicate\n : state.ids.filter((id) => idsOrPredicate(state.entityMap[id]));\n let didMutate = DidMutate.None;\n\n for (const id of ids) {\n if (state.entityMap[id]) {\n delete state.entityMap[id];\n didMutate = DidMutate.Both;\n }\n }\n\n if (didMutate === DidMutate.Both) {\n state.ids = state.ids.filter((id) => id in state.entityMap);\n }\n\n return didMutate;\n}\n\nexport function updateEntitiesMutably(\n state: EntityState<any>,\n idsOrPredicate: EntityId[] | EntityPredicate<any>,\n changes: EntityChanges<any>\n): DidMutate {\n const ids = Array.isArray(idsOrPredicate)\n ? idsOrPredicate\n : state.ids.filter((id) => idsOrPredicate(state.entityMap[id]));\n let didMutate = DidMutate.None;\n\n for (const id of ids) {\n const entity = state.entityMap[id];\n\n if (entity) {\n const changesRecord =\n typeof changes === 'function' ? changes(entity) : changes;\n state.entityMap[id] = { ...entity, ...changesRecord };\n didMutate = DidMutate.Entities;\n }\n }\n\n return didMutate;\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n addEntityMutably,\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n} from '../helpers';\n\nexport function addEntity<Entity extends { id: EntityId }>(\n entity: Entity\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntity<Entity, Collection extends string>(\n entity: Entity,\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntity<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entity: Entity,\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntity<Entity>(\n entity: Entity,\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntity(\n entity: any,\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = addEntityMutably(clonedState, entity, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n addEntitiesMutably,\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n} from '../helpers';\n\nexport function addEntities<Entity extends { id: EntityId }>(\n entities: Entity[]\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntities<Entity, Collection extends string>(\n entities: Entity[],\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntities<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entities: Entity[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntities<Entity>(\n entities: Entity[],\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntities(\n entities: any[],\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = addEntitiesMutably(clonedState, entities, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport { EntityId, EntityState, NamedEntityState } from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n removeEntitiesMutably,\n} from '../helpers';\n\nexport function removeEntity(\n id: EntityId\n): PartialStateUpdater<EntityState<any>>;\nexport function removeEntity<Collection extends string>(\n id: EntityId,\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<any, Collection>>;\nexport function removeEntity(\n id: EntityId,\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = removeEntitiesMutably(clonedState, [id]);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityPredicate,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n removeEntitiesMutably,\n} from '../helpers';\n\nexport function removeEntities(\n ids: EntityId[]\n): PartialStateUpdater<EntityState<any>>;\nexport function removeEntities<Entity>(\n predicate: EntityPredicate<Entity>\n): PartialStateUpdater<EntityState<Entity>>;\nexport function removeEntities<Collection extends string>(\n ids: EntityId[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<any, Collection>>;\nexport function removeEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n predicate: EntityPredicate<Entity>,\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function removeEntities(\n idsOrPredicate: EntityId[] | EntityPredicate<any>,\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = removeEntitiesMutably(clonedState, idsOrPredicate);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport { EntityState, NamedEntityState } from '../models';\nimport { getEntityStateKeys } from '../helpers';\n\nexport function removeAllEntities(): PartialStateUpdater<EntityState<any>>;\nexport function removeAllEntities<Collection extends string>(config: {\n collection: Collection;\n}): PartialStateUpdater<NamedEntityState<any, Collection>>;\nexport function removeAllEntities(config?: {\n collection?: string;\n}): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return () => ({\n [stateKeys.entityMapKey]: {},\n [stateKeys.idsKey]: [],\n });\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n setEntityMutably,\n} from '../helpers';\n\nexport function setEntity<Entity extends { id: EntityId }>(\n entity: Entity\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntity<Entity, Collection extends string>(\n entity: Entity,\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntity<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entity: Entity,\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntity<Entity>(\n entity: Entity,\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntity(\n entity: any,\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = setEntityMutably(clonedState, entity, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n setEntitiesMutably,\n} from '../helpers';\n\nexport function setEntities<Entity extends { id: EntityId }>(\n entities: Entity[]\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntities<Entity, Collection extends string>(\n entities: Entity[],\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntities<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entities: Entity[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntities<Entity>(\n entities: Entity[],\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntities(\n entities: any[],\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = setEntitiesMutably(clonedState, entities, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n getEntityIdKey,\n getEntityStateKeys,\n setEntitiesMutably,\n} from '../helpers';\n\nexport function setAllEntities<Entity extends { id: EntityId }>(\n entities: Entity[]\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setAllEntities<Entity, Collection extends string>(\n entities: Entity[],\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setAllEntities<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entities: Entity[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setAllEntities<Entity>(\n entities: Entity[],\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setAllEntities(\n entities: any[],\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return () => {\n const state: EntityState<any> = { entityMap: {}, ids: [] };\n setEntitiesMutably(state, entities, idKey);\n\n return {\n [stateKeys.entityMapKey]: state.entityMap,\n [stateKeys.idsKey]: state.ids,\n };\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityChanges,\n EntityId,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n updateEntitiesMutably,\n} from '../helpers';\n\nexport function updateEntity<Entity>(update: {\n id: EntityId;\n changes: EntityChanges<Entity & {}>;\n}): PartialStateUpdater<EntityState<Entity>>;\nexport function updateEntity<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n update: {\n id: EntityId;\n changes: EntityChanges<Entity & {}>;\n },\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateEntity(\n update: {\n id: EntityId;\n changes: EntityChanges<any>;\n },\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = updateEntitiesMutably(\n clonedState,\n [update.id],\n update.changes\n );\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityChanges,\n EntityId,\n EntityPredicate,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n updateEntitiesMutably,\n} from '../helpers';\n\nexport function updateEntities<Entity>(update: {\n ids: EntityId[];\n changes: EntityChanges<Entity & {}>;\n}): PartialStateUpdater<EntityState<Entity>>;\nexport function updateEntities<Entity>(update: {\n predicate: EntityPredicate<Entity>;\n changes: EntityChanges<Entity & {}>;\n}): PartialStateUpdater<EntityState<Entity>>;\nexport function updateEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n update: {\n ids: EntityId[];\n changes: EntityChanges<Entity & {}>;\n },\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n update: {\n predicate: EntityPredicate<Entity>;\n changes: EntityChanges<Entity & {}>;\n },\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateEntities(\n update: ({ ids: EntityId[] } | { predicate: EntityPredicate<any> }) & {\n changes: EntityChanges<any>;\n },\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n const idsOrPredicate = 'ids' in update ? update.ids : update.predicate;\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = updateEntitiesMutably(\n clonedState,\n idsOrPredicate,\n update.changes\n );\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { PartialStateUpdater } from '@ngrx/signals';\nimport { EntityChanges, EntityState, NamedEntityState } from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n updateEntitiesMutably,\n} from '../helpers';\n\nexport function updateAllEntities<Entity>(\n changes: EntityChanges<Entity & {}>\n): PartialStateUpdater<EntityState<Entity>>;\nexport function updateAllEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n changes: EntityChanges<Entity & {}>,\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateAllEntities(\n changes: EntityChanges<any>,\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = updateEntitiesMutably(\n clonedState,\n (state as Record<string, any>)[stateKeys.idsKey],\n changes\n );\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n","import { computed, Signal } from '@angular/core';\nimport {\n SignalStoreFeature,\n signalStoreFeature,\n withComputed,\n withState,\n} from '@ngrx/signals';\nimport {\n EntityId,\n EntityMap,\n EntitySignals,\n EntityState,\n NamedEntitySignals,\n NamedEntityState,\n} from './models';\nimport { getEntityStateKeys } from './helpers';\n\nexport function withEntities<Entity>(): SignalStoreFeature<\n { state: {}; signals: {}; methods: {} },\n {\n state: EntityState<Entity>;\n signals: EntitySignals<Entity>;\n methods: {};\n }\n>;\nexport function withEntities<Entity, Collection extends string>(config: {\n entity: Entity;\n collection: Collection;\n}): SignalStoreFeature<\n { state: {}; signals: {}; methods: {} },\n {\n state: NamedEntityState<Entity, Collection>;\n signals: NamedEntitySignals<Entity, Collection>;\n methods: {};\n }\n>;\nexport function withEntities<Entity>(config: {\n entity: Entity;\n}): SignalStoreFeature<\n { state: {}; signals: {}; methods: {} },\n {\n state: EntityState<Entity>;\n signals: EntitySignals<Entity>;\n methods: {};\n }\n>;\nexport function withEntities<Entity>(config?: {\n entity: Entity;\n collection?: string;\n}): SignalStoreFeature {\n const { entityMapKey, idsKey, entitiesKey } = getEntityStateKeys(config);\n\n return signalStoreFeature(\n withState({\n [entityMapKey]: {},\n [idsKey]: [],\n }),\n withComputed((store: Record<string, Signal<unknown>>) => ({\n [entitiesKey]: computed(() => {\n const entityMap = store[entityMapKey]() as EntityMap<Entity>;\n const ids = store[idsKey]() as EntityId[];\n\n return ids.map((id) => entityMap[id]);\n }),\n }))\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAmCA,IAAY,SAIX,CAAA;AAJD,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,SAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACJ,IAAA,SAAA,CAAA,SAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ,CAAA;AACR,IAAA,SAAA,CAAA,SAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AAC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EAAE,CAAC,CAAC,CAAC;AACxC,SAAC,CAAC;KACH,CAAC,CAAC,CACJ,CAAC;AACJ;;AClEA;;AAEG;;;;"}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../modules/signals/entities/src/models.ts", "../../../../modules/signals/entities/src/helpers.ts", "../../../../modules/signals/entities/src/updaters/add-entity.ts", "../../../../modules/signals/entities/src/updaters/add-entities.ts", "../../../../modules/signals/entities/src/updaters/remove-entity.ts", "../../../../modules/signals/entities/src/updaters/remove-entities.ts", "../../../../modules/signals/entities/src/updaters/remove-all-entities.ts", "../../../../modules/signals/entities/src/updaters/set-entity.ts", "../../../../modules/signals/entities/src/updaters/set-entities.ts", "../../../../modules/signals/entities/src/updaters/set-all-entities.ts", "../../../../modules/signals/entities/src/updaters/update-entity.ts", "../../../../modules/signals/entities/src/updaters/update-entities.ts", "../../../../modules/signals/entities/src/updaters/update-all-entities.ts", "../../../../modules/signals/entities/src/with-entities.ts"],
|
|
4
|
+
"sourcesContent": ["import { Signal } from '@angular/core';\n\nexport type EntityId = string | number;\n\nexport type EntityMap<Entity> = Record<EntityId, Entity>;\n\nexport type EntityState<Entity> = {\n entityMap: EntityMap<Entity>;\n ids: EntityId[];\n};\n\nexport type NamedEntityState<Entity, Collection extends string> = {\n [K in keyof EntityState<Entity> as `${Collection}${Capitalize<K>}`]: EntityState<Entity>[K];\n};\n\nexport type EntitySignals<Entity> = {\n entities: Signal<Entity[]>;\n};\n\nexport type NamedEntitySignals<Entity, Collection extends string> = {\n [K in keyof EntitySignals<Entity> as `${Collection}${Capitalize<K>}`]: EntitySignals<Entity>[K];\n};\n\nexport type EntityIdProps<Entity> = {\n [K in keyof Entity as Entity[K] extends EntityId ? K : never]: Entity[K];\n};\n\nexport type EntityIdKey<Entity> = keyof EntityIdProps<Entity> & string;\n\nexport type EntityPredicate<Entity> = (entity: Entity) => boolean;\n\nexport type EntityChanges<Entity> =\n | Partial<Entity>\n | ((entity: Entity) => Partial<Entity>);\n\nexport enum DidMutate {\n None,\n Entities,\n Both,\n}\n", "import {\n DidMutate,\n EntityChanges,\n EntityId,\n EntityPredicate,\n EntityState,\n} from './models';\n\nexport function getEntityIdKey(config?: { idKey?: string }): string {\n return config?.idKey ?? 'id';\n}\n\nexport function getEntityStateKeys(config?: { collection?: string }): {\n entityMapKey: string;\n idsKey: string;\n entitiesKey: string;\n} {\n const collection = config?.collection;\n const entityMapKey =\n collection === undefined ? 'entityMap' : `${collection}EntityMap`;\n const idsKey = collection === undefined ? 'ids' : `${collection}Ids`;\n const entitiesKey =\n collection === undefined ? 'entities' : `${collection}Entities`;\n\n return { entityMapKey, idsKey, entitiesKey };\n}\n\nexport function cloneEntityState(\n state: Record<string, any>,\n stateKeys: {\n entityMapKey: string;\n idsKey: string;\n }\n): EntityState<any> {\n return {\n entityMap: { ...state[stateKeys.entityMapKey] },\n ids: [...state[stateKeys.idsKey]],\n };\n}\n\nexport function getEntityUpdaterResult(\n state: EntityState<any>,\n stateKeys: {\n entityMapKey: string;\n idsKey: string;\n },\n didMutate: DidMutate\n): Record<string, any> {\n switch (didMutate) {\n case DidMutate.Both: {\n return {\n [stateKeys.entityMapKey]: state.entityMap,\n [stateKeys.idsKey]: state.ids,\n };\n }\n case DidMutate.Entities: {\n return { [stateKeys.entityMapKey]: state.entityMap };\n }\n default: {\n return {};\n }\n }\n}\n\nexport function addEntityMutably(\n state: EntityState<any>,\n entity: any,\n idKey: string\n): DidMutate {\n const id = entity[idKey];\n\n if (state.entityMap[id]) {\n return DidMutate.None;\n }\n\n state.entityMap[id] = entity;\n state.ids.push(id);\n\n return DidMutate.Both;\n}\n\nexport function addEntitiesMutably(\n state: EntityState<any>,\n entities: any[],\n idKey: string\n): DidMutate {\n let didMutate = DidMutate.None;\n\n for (const entity of entities) {\n const result = addEntityMutably(state, entity, idKey);\n\n if (result === DidMutate.Both) {\n didMutate = result;\n }\n }\n\n return didMutate;\n}\n\nexport function setEntityMutably(\n state: EntityState<any>,\n entity: any,\n idKey: string\n): DidMutate {\n const id = entity[idKey];\n\n if (state.entityMap[id]) {\n state.entityMap[id] = entity;\n return DidMutate.Entities;\n }\n\n state.entityMap[id] = entity;\n state.ids.push(id);\n\n return DidMutate.Both;\n}\n\nexport function setEntitiesMutably(\n state: EntityState<any>,\n entities: any[],\n idKey: string\n): DidMutate {\n let didMutate = DidMutate.None;\n\n for (const entity of entities) {\n const result = setEntityMutably(state, entity, idKey);\n\n if (didMutate === DidMutate.Both) {\n continue;\n }\n\n didMutate = result;\n }\n\n return didMutate;\n}\n\nexport function removeEntitiesMutably(\n state: EntityState<any>,\n idsOrPredicate: EntityId[] | EntityPredicate<any>\n): DidMutate {\n const ids = Array.isArray(idsOrPredicate)\n ? idsOrPredicate\n : state.ids.filter((id) => idsOrPredicate(state.entityMap[id]));\n let didMutate = DidMutate.None;\n\n for (const id of ids) {\n if (state.entityMap[id]) {\n delete state.entityMap[id];\n didMutate = DidMutate.Both;\n }\n }\n\n if (didMutate === DidMutate.Both) {\n state.ids = state.ids.filter((id) => id in state.entityMap);\n }\n\n return didMutate;\n}\n\nexport function updateEntitiesMutably(\n state: EntityState<any>,\n idsOrPredicate: EntityId[] | EntityPredicate<any>,\n changes: EntityChanges<any>\n): DidMutate {\n const ids = Array.isArray(idsOrPredicate)\n ? idsOrPredicate\n : state.ids.filter((id) => idsOrPredicate(state.entityMap[id]));\n let didMutate = DidMutate.None;\n\n for (const id of ids) {\n const entity = state.entityMap[id];\n\n if (entity) {\n const changesRecord =\n typeof changes === 'function' ? changes(entity) : changes;\n state.entityMap[id] = { ...entity, ...changesRecord };\n didMutate = DidMutate.Entities;\n }\n }\n\n return didMutate;\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n addEntityMutably,\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n} from '../helpers';\n\nexport function addEntity<Entity extends { id: EntityId }>(\n entity: Entity\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntity<Entity, Collection extends string>(\n entity: Entity,\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntity<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entity: Entity,\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntity<Entity>(\n entity: Entity,\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntity(\n entity: any,\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = addEntityMutably(clonedState, entity, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n addEntitiesMutably,\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n} from '../helpers';\n\nexport function addEntities<Entity extends { id: EntityId }>(\n entities: Entity[]\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntities<Entity, Collection extends string>(\n entities: Entity[],\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntities<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entities: Entity[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function addEntities<Entity>(\n entities: Entity[],\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function addEntities(\n entities: any[],\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = addEntitiesMutably(clonedState, entities, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport { EntityId, EntityState, NamedEntityState } from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n removeEntitiesMutably,\n} from '../helpers';\n\nexport function removeEntity(\n id: EntityId\n): PartialStateUpdater<EntityState<any>>;\nexport function removeEntity<Collection extends string>(\n id: EntityId,\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<any, Collection>>;\nexport function removeEntity(\n id: EntityId,\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = removeEntitiesMutably(clonedState, [id]);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityPredicate,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n removeEntitiesMutably,\n} from '../helpers';\n\nexport function removeEntities(\n ids: EntityId[]\n): PartialStateUpdater<EntityState<any>>;\nexport function removeEntities<Entity>(\n predicate: EntityPredicate<Entity>\n): PartialStateUpdater<EntityState<Entity>>;\nexport function removeEntities<Collection extends string>(\n ids: EntityId[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<any, Collection>>;\nexport function removeEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n predicate: EntityPredicate<Entity>,\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function removeEntities(\n idsOrPredicate: EntityId[] | EntityPredicate<any>,\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = removeEntitiesMutably(clonedState, idsOrPredicate);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport { EntityState, NamedEntityState } from '../models';\nimport { getEntityStateKeys } from '../helpers';\n\nexport function removeAllEntities(): PartialStateUpdater<EntityState<any>>;\nexport function removeAllEntities<Collection extends string>(config: {\n collection: Collection;\n}): PartialStateUpdater<NamedEntityState<any, Collection>>;\nexport function removeAllEntities(config?: {\n collection?: string;\n}): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return () => ({\n [stateKeys.entityMapKey]: {},\n [stateKeys.idsKey]: [],\n });\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n setEntityMutably,\n} from '../helpers';\n\nexport function setEntity<Entity extends { id: EntityId }>(\n entity: Entity\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntity<Entity, Collection extends string>(\n entity: Entity,\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntity<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entity: Entity,\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntity<Entity>(\n entity: Entity,\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntity(\n entity: any,\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = setEntityMutably(clonedState, entity, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityIdKey,\n getEntityStateKeys,\n getEntityUpdaterResult,\n setEntitiesMutably,\n} from '../helpers';\n\nexport function setEntities<Entity extends { id: EntityId }>(\n entities: Entity[]\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntities<Entity, Collection extends string>(\n entities: Entity[],\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntities<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entities: Entity[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setEntities<Entity>(\n entities: Entity[],\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setEntities(\n entities: any[],\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = setEntitiesMutably(clonedState, entities, idKey);\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityId,\n EntityIdKey,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n getEntityIdKey,\n getEntityStateKeys,\n setEntitiesMutably,\n} from '../helpers';\n\nexport function setAllEntities<Entity extends { id: EntityId }>(\n entities: Entity[]\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setAllEntities<Entity, Collection extends string>(\n entities: Entity[],\n config: { collection: Collection; idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setAllEntities<\n Entity extends { id: EntityId },\n Collection extends string\n>(\n entities: Entity[],\n config: { collection: Collection }\n): PartialStateUpdater<NamedEntityState<Entity, Collection>>;\nexport function setAllEntities<Entity>(\n entities: Entity[],\n config: { idKey: EntityIdKey<Entity> }\n): PartialStateUpdater<EntityState<Entity>>;\nexport function setAllEntities(\n entities: any[],\n config?: { collection?: string; idKey?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const idKey = getEntityIdKey(config);\n const stateKeys = getEntityStateKeys(config);\n\n return () => {\n const state: EntityState<any> = { entityMap: {}, ids: [] };\n setEntitiesMutably(state, entities, idKey);\n\n return {\n [stateKeys.entityMapKey]: state.entityMap,\n [stateKeys.idsKey]: state.ids,\n };\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityChanges,\n EntityId,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n updateEntitiesMutably,\n} from '../helpers';\n\nexport function updateEntity<Entity>(update: {\n id: EntityId;\n changes: EntityChanges<Entity & {}>;\n}): PartialStateUpdater<EntityState<Entity>>;\nexport function updateEntity<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n update: {\n id: EntityId;\n changes: EntityChanges<Entity & {}>;\n },\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateEntity(\n update: {\n id: EntityId;\n changes: EntityChanges<any>;\n },\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = updateEntitiesMutably(\n clonedState,\n [update.id],\n update.changes\n );\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport {\n EntityChanges,\n EntityId,\n EntityPredicate,\n EntityState,\n NamedEntityState,\n} from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n updateEntitiesMutably,\n} from '../helpers';\n\nexport function updateEntities<Entity>(update: {\n ids: EntityId[];\n changes: EntityChanges<Entity & {}>;\n}): PartialStateUpdater<EntityState<Entity>>;\nexport function updateEntities<Entity>(update: {\n predicate: EntityPredicate<Entity>;\n changes: EntityChanges<Entity & {}>;\n}): PartialStateUpdater<EntityState<Entity>>;\nexport function updateEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n update: {\n ids: EntityId[];\n changes: EntityChanges<Entity & {}>;\n },\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n update: {\n predicate: EntityPredicate<Entity>;\n changes: EntityChanges<Entity & {}>;\n },\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateEntities(\n update: ({ ids: EntityId[] } | { predicate: EntityPredicate<any> }) & {\n changes: EntityChanges<any>;\n },\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n const idsOrPredicate = 'ids' in update ? update.ids : update.predicate;\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = updateEntitiesMutably(\n clonedState,\n idsOrPredicate,\n update.changes\n );\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { PartialStateUpdater } from '@ngrx/signals';\nimport { EntityChanges, EntityState, NamedEntityState } from '../models';\nimport {\n cloneEntityState,\n getEntityStateKeys,\n getEntityUpdaterResult,\n updateEntitiesMutably,\n} from '../helpers';\n\nexport function updateAllEntities<Entity>(\n changes: EntityChanges<Entity & {}>\n): PartialStateUpdater<EntityState<Entity>>;\nexport function updateAllEntities<\n Collection extends string,\n State extends NamedEntityState<any, Collection>,\n Entity = State extends NamedEntityState<infer E, Collection> ? E : never\n>(\n changes: EntityChanges<Entity & {}>,\n config: { collection: Collection }\n): PartialStateUpdater<State>;\nexport function updateAllEntities(\n changes: EntityChanges<any>,\n config?: { collection?: string }\n): PartialStateUpdater<EntityState<any> | NamedEntityState<any, string>> {\n const stateKeys = getEntityStateKeys(config);\n\n return (state) => {\n const clonedState = cloneEntityState(state, stateKeys);\n const didMutate = updateEntitiesMutably(\n clonedState,\n (state as Record<string, any>)[stateKeys.idsKey],\n changes\n );\n\n return getEntityUpdaterResult(clonedState, stateKeys, didMutate);\n };\n}\n", "import { computed, Signal } from '@angular/core';\nimport {\n SignalStoreFeature,\n signalStoreFeature,\n withComputed,\n withState,\n} from '@ngrx/signals';\nimport {\n EntityId,\n EntityMap,\n EntitySignals,\n EntityState,\n NamedEntitySignals,\n NamedEntityState,\n} from './models';\nimport { getEntityStateKeys } from './helpers';\n\nexport function withEntities<Entity>(): SignalStoreFeature<\n { state: {}; signals: {}; methods: {} },\n {\n state: EntityState<Entity>;\n signals: EntitySignals<Entity>;\n methods: {};\n }\n>;\nexport function withEntities<Entity, Collection extends string>(config: {\n entity: Entity;\n collection: Collection;\n}): SignalStoreFeature<\n { state: {}; signals: {}; methods: {} },\n {\n state: NamedEntityState<Entity, Collection>;\n signals: NamedEntitySignals<Entity, Collection>;\n methods: {};\n }\n>;\nexport function withEntities<Entity>(config: {\n entity: Entity;\n}): SignalStoreFeature<\n { state: {}; signals: {}; methods: {} },\n {\n state: EntityState<Entity>;\n signals: EntitySignals<Entity>;\n methods: {};\n }\n>;\nexport function withEntities<Entity>(config?: {\n entity: Entity;\n collection?: string;\n}): SignalStoreFeature {\n const { entityMapKey, idsKey, entitiesKey } = getEntityStateKeys(config);\n\n return signalStoreFeature(\n withState({\n [entityMapKey]: {},\n [idsKey]: [],\n }),\n withComputed((store: Record<string, Signal<unknown>>) => ({\n [entitiesKey]: computed(() => {\n const entityMap = store[entityMapKey]() as EntityMap<Entity>;\n const ids = store[idsKey]() as EntityId[];\n\n return ids.map((id) => entityMap[id]);\n }),\n }))\n );\n}\n"],
|
|
5
|
+
"mappings": ";AAmCA,IAAY;CAAZ,SAAYA,YAAS;AACnB,EAAAA,WAAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACA,EAAAA,WAAAA,WAAA,UAAA,IAAA,CAAA,IAAA;AACA,EAAAA,WAAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACF,GAJY,cAAA,YAAS,CAAA,EAAA;;;AC3Bf,SAAU,eAAe,QAA2B;AACxD,SAAO,QAAQ,SAAS;AAC1B;AAEM,SAAU,mBAAmB,QAAgC;AAKjE,QAAM,aAAa,QAAQ;AAC3B,QAAM,eACJ,eAAe,SAAY,cAAc,GAAG,UAAU;AACxD,QAAM,SAAS,eAAe,SAAY,QAAQ,GAAG,UAAU;AAC/D,QAAM,cACJ,eAAe,SAAY,aAAa,GAAG,UAAU;AAEvD,SAAO,EAAE,cAAc,QAAQ,YAAW;AAC5C;AAEM,SAAU,iBACd,OACA,WAGC;AAED,SAAO;IACL,WAAW,EAAE,GAAG,MAAM,UAAU,YAAY,EAAC;IAC7C,KAAK,CAAC,GAAG,MAAM,UAAU,MAAM,CAAC;;AAEpC;AAEM,SAAU,uBACd,OACA,WAIA,WAAoB;AAEpB,UAAQ,WAAW;IACjB,KAAK,UAAU,MAAM;AACnB,aAAO;QACL,CAAC,UAAU,YAAY,GAAG,MAAM;QAChC,CAAC,UAAU,MAAM,GAAG,MAAM;;IAE9B;IACA,KAAK,UAAU,UAAU;AACvB,aAAO,EAAE,CAAC,UAAU,YAAY,GAAG,MAAM,UAAS;IACpD;IACA,SAAS;AACP,aAAO,CAAA;IACT;EACF;AACF;AAEM,SAAU,iBACd,OACA,QACA,OAAa;AAE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