@acorex-platform/module-location-management-client 0.0.15 → 0.0.21

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 (60) hide show
  1. package/fesm2022/acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs +163 -0
  2. package/fesm2022/acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-location-management-client-contracts.mjs +351 -0
  4. package/fesm2022/acorex-platform-module-location-management-client-contracts.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs +200 -0
  6. package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-location-management-client.mjs +1701 -0
  8. package/fesm2022/acorex-platform-module-location-management-client.mjs.map +1 -0
  9. package/package.json +21 -5
  10. package/types/acorex-platform-module-location-management-client-contracts.d.ts +277 -0
  11. package/types/acorex-platform-module-location-management-client.d.ts +42 -0
  12. package/contracts/datasource.keys.d.ts +0 -6
  13. package/contracts/datasource.keys.js +0 -8
  14. package/contracts/entities/geographic-region/geographic-region.entity.d.ts +0 -2
  15. package/contracts/entities/geographic-region/geographic-region.entity.js +0 -725
  16. package/contracts/entities/geographic-region/geographic-region.types.d.ts +0 -27
  17. package/contracts/entities/geographic-region/geographic-region.types.js +0 -1
  18. package/contracts/entities/geographic-region/index.d.ts +0 -2
  19. package/contracts/entities/geographic-region/index.js +0 -2
  20. package/contracts/entities/index.d.ts +0 -5
  21. package/contracts/entities/index.js +0 -5
  22. package/contracts/entities/location/index.d.ts +0 -2
  23. package/contracts/entities/location/index.js +0 -2
  24. package/contracts/entities/location/location.entity.d.ts +0 -2
  25. package/contracts/entities/location/location.entity.js +0 -1075
  26. package/contracts/entities/location/location.types.d.ts +0 -30
  27. package/contracts/entities/location/location.types.js +0 -1
  28. package/contracts/entities/location-assignment/index.d.ts +0 -2
  29. package/contracts/entities/location-assignment/index.js +0 -2
  30. package/contracts/entities/location-assignment/location-assignment.entity.d.ts +0 -2
  31. package/contracts/entities/location-assignment/location-assignment.entity.js +0 -194
  32. package/contracts/entities/location-assignment/location-assignment.types.d.ts +0 -35
  33. package/contracts/entities/location-assignment/location-assignment.types.js +0 -2
  34. package/contracts/entities/location-role/index.d.ts +0 -2
  35. package/contracts/entities/location-role/index.js +0 -2
  36. package/contracts/entities/location-role/location-role.entity.d.ts +0 -2
  37. package/contracts/entities/location-role/location-role.entity.js +0 -143
  38. package/contracts/entities/location-role/location-role.types.d.ts +0 -6
  39. package/contracts/entities/location-role/location-role.types.js +0 -1
  40. package/contracts/entities/location-type/index.d.ts +0 -2
  41. package/contracts/entities/location-type/index.js +0 -2
  42. package/contracts/entities/location-type/location-type.entity.d.ts +0 -2
  43. package/contracts/entities/location-type/location-type.entity.js +0 -237
  44. package/contracts/entities/location-type/location-type.types.d.ts +0 -8
  45. package/contracts/entities/location-type/location-type.types.js +0 -1
  46. package/contracts/features.keys.d.ts +0 -1
  47. package/contracts/features.keys.js +0 -2
  48. package/contracts/index.d.ts +0 -8
  49. package/contracts/index.js +0 -10
  50. package/contracts/location-assignment.actions.d.ts +0 -8
  51. package/contracts/location-assignment.actions.js +0 -73
  52. package/contracts/location-assignment.utils.d.ts +0 -53
  53. package/contracts/location-assignment.utils.js +0 -145
  54. package/contracts/menu.keys.d.ts +0 -8
  55. package/contracts/menu.keys.js +0 -8
  56. package/contracts/package.json +0 -5
  57. package/contracts/permission.keys.d.ts +0 -33
  58. package/contracts/permission.keys.js +0 -42
  59. package/contracts/root-config.d.ts +0 -42
  60. package/contracts/root-config.js +0 -43
@@ -0,0 +1,200 @@
1
+ import { AXToastService } from '@acorex/components/toast';
2
+ import { AXTranslationService } from '@acorex/core/translation';
3
+ import { runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Injectable } from '@angular/core';
6
+ import { get } from 'lodash';
7
+ import { AXPEntityFormBuilderService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
8
+ import { RootConfig, buildLocationAssignmentLocationSnapshot, buildLocationAssignmentPersonSnapshot, LOCATION_ASSIGNMENT_PARTY_TYPE, resolveLocationAssignmentDisplayTitle } from '@acorex-platform/module-location-management-client/contracts';
9
+ import { resolveEntityActionCommandInput, mergeEntityActionProcessData } from '@acorex-platform/framework-shared/runtime';
10
+
11
+ //#region ---- Imports ----
12
+ //#endregion
13
+ //#region ---- Command ----
14
+ class AXMLocationAssignmentCreateWithNewLocationCommand {
15
+ constructor() {
16
+ this.entityForm = inject(AXPEntityFormBuilderService);
17
+ this.entityService = inject(AXPEntityDefinitionRegistryService);
18
+ this.toastService = inject(AXToastService);
19
+ this.translationService = inject(AXTranslationService);
20
+ }
21
+ async execute(input) {
22
+ const resolved = resolveEntityActionCommandInput(input);
23
+ const processData = mergeEntityActionProcessData(input);
24
+ const entity = resolved.entity;
25
+ const ownerRef = this.resolveOwnerRef(processData);
26
+ if (!ownerRef.id) {
27
+ return {
28
+ success: false,
29
+ message: {
30
+ text: await this.translationService.translateAsync('@location-management:location-assignments.messages.missing-party-context'),
31
+ },
32
+ };
33
+ }
34
+ const [assignmentModuleName, assignmentEntityName] = (entity || '').split('.');
35
+ if (!assignmentModuleName || !assignmentEntityName) {
36
+ return {
37
+ success: false,
38
+ message: {
39
+ text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),
40
+ },
41
+ };
42
+ }
43
+ const locationDialogTitle = await this.translationService.translateAsync('@location-management:location-assignments.actions.create-with-new-location.location-dialog-title');
44
+ const locationResult = (await this.entityForm
45
+ .entity(`${RootConfig.module.name}.${RootConfig.entities.location.name}`)
46
+ .create({})
47
+ .title(locationDialogTitle)
48
+ .actions((actions) => {
49
+ actions.cancel('@general:actions.cancel.title');
50
+ actions.submit('@general:actions.create.title');
51
+ })
52
+ .onAction(async (dialogRef) => {
53
+ if (dialogRef.action() === 'cancel') {
54
+ return { success: false };
55
+ }
56
+ const locationEntity = await this.entityService.resolve(RootConfig.module.name, RootConfig.entities.location.name);
57
+ const createLocationFn = locationEntity?.commands?.create?.execute;
58
+ if (!createLocationFn) {
59
+ const msg = await this.translationService.translateAsync('@general:messages.entity.create-command-unavailable');
60
+ this.toastService.show({
61
+ color: 'danger',
62
+ title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
63
+ content: msg,
64
+ });
65
+ throw new Error(msg);
66
+ }
67
+ dialogRef.setLoading(true);
68
+ try {
69
+ const context = dialogRef.context();
70
+ const createResult = await createLocationFn(context);
71
+ const locationRow = runtimeCommandPayloadData(createResult);
72
+ if (!locationRow?.id && !locationRow?._id) {
73
+ return {
74
+ success: false,
75
+ message: {
76
+ text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),
77
+ },
78
+ };
79
+ }
80
+ return { success: true, kind: 'object', data: locationRow };
81
+ }
82
+ catch (error) {
83
+ const errorMsg = error instanceof Error
84
+ ? error.message
85
+ : await this.translationService.translateAsync('@general:messages.entity.create-failed');
86
+ this.toastService.show({
87
+ color: 'danger',
88
+ title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
89
+ content: errorMsg,
90
+ });
91
+ throw error;
92
+ }
93
+ finally {
94
+ dialogRef.setLoading(false);
95
+ }
96
+ })
97
+ .show());
98
+ const locationRow = runtimeCommandPayloadData(locationResult);
99
+ if (!locationRow) {
100
+ return { success: false };
101
+ }
102
+ const locationId = (locationRow['id'] ?? locationRow['_id']);
103
+ const locationSnapshot = buildLocationAssignmentLocationSnapshot(locationRow, locationId);
104
+ const assignmentFormTitle = await this.translationService.translateAsync('@location-management:location-assignments.actions.create-with-new-location.assignment-dialog-title');
105
+ const assignmentResult = (await this.entityForm
106
+ .entity(`${assignmentModuleName}.${assignmentEntityName}`)
107
+ .create({
108
+ locationId,
109
+ location: locationSnapshot,
110
+ ownerRef,
111
+ })
112
+ .include('roleId', 'personId', 'notes')
113
+ .title(assignmentFormTitle)
114
+ .actions((actions) => {
115
+ actions.cancel('@general:actions.cancel.title');
116
+ actions.submit('@general:actions.create.title');
117
+ })
118
+ .onAction(async (dialogRef) => {
119
+ if (dialogRef.action() === 'cancel') {
120
+ return { success: false };
121
+ }
122
+ const locationAssignmentEntity = await this.entityService.resolve(assignmentModuleName, assignmentEntityName);
123
+ const createAssignmentFn = locationAssignmentEntity?.commands?.create?.execute;
124
+ if (!createAssignmentFn) {
125
+ const msg = await this.translationService.translateAsync('@general:messages.entity.create-command-unavailable');
126
+ this.toastService.show({
127
+ color: 'danger',
128
+ title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
129
+ content: msg,
130
+ });
131
+ throw new Error(msg);
132
+ }
133
+ dialogRef.setLoading(true);
134
+ try {
135
+ const context = dialogRef.context();
136
+ const personId = (context['personId'] ?? get(context, 'person.id'));
137
+ const personInContext = get(context, 'person');
138
+ const personSnapshot = personId && personInContext
139
+ ? buildLocationAssignmentPersonSnapshot({ ...personInContext, id: personId }, personId)
140
+ : undefined;
141
+ const createResult = await createAssignmentFn({
142
+ ...context,
143
+ locationId,
144
+ ownerRef,
145
+ location: locationSnapshot,
146
+ ...(personId ? { personId, person: personSnapshot } : {}),
147
+ });
148
+ const __single_createResult = runtimeCommandPayloadData(createResult);
149
+ if (__single_createResult) {
150
+ return { success: true, kind: 'object',
151
+ data: runtimeCommandPayloadData(createResult),
152
+ message: {
153
+ text: await this.translationService.translateAsync('@general:messages.generic.success.description'),
154
+ },
155
+ };
156
+ }
157
+ return {
158
+ success: false,
159
+ message: {
160
+ text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),
161
+ },
162
+ };
163
+ }
164
+ catch (error) {
165
+ const errorMsg = error instanceof Error
166
+ ? error.message
167
+ : await this.translationService.translateAsync('@general:messages.entity.create-failed');
168
+ this.toastService.show({
169
+ color: 'danger',
170
+ title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
171
+ content: errorMsg,
172
+ });
173
+ throw error;
174
+ }
175
+ finally {
176
+ dialogRef.setLoading(false);
177
+ }
178
+ })
179
+ .show());
180
+ return assignmentResult;
181
+ }
182
+ resolveOwnerRef(processData) {
183
+ const nestedOwner = get(processData, 'ownerRef');
184
+ const locale = this.translationService.getActiveLang?.() ?? 'en-US';
185
+ return {
186
+ type: processData['ownerRef.type'] ?? nestedOwner?.type ?? LOCATION_ASSIGNMENT_PARTY_TYPE,
187
+ id: processData['ownerRef.id'] ?? nestedOwner?.id ?? '',
188
+ title: resolveLocationAssignmentDisplayTitle(locale, processData['ownerRef.title'], nestedOwner?.title, get(processData, 'party.title'), get(processData, 'title')),
189
+ };
190
+ }
191
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMLocationAssignmentCreateWithNewLocationCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
192
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMLocationAssignmentCreateWithNewLocationCommand, providedIn: 'root' }); }
193
+ }
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMLocationAssignmentCreateWithNewLocationCommand, decorators: [{
195
+ type: Injectable,
196
+ args: [{ providedIn: 'root' }]
197
+ }] });
198
+
199
+ export { AXMLocationAssignmentCreateWithNewLocationCommand };
200
+ //# sourceMappingURL=acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/commands/create-location-with-assignment.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, runtimeCommandPayloadData} from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\nimport { get } from 'lodash';\nimport { AXPEntityDefinitionRegistryService, AXPEntityFormBuilderService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { RootConfig, LOCATION_ASSIGNMENT_PARTY_TYPE, resolveLocationAssignmentDisplayTitle, buildLocationAssignmentLocationSnapshot, buildLocationAssignmentPersonSnapshot } from '@acorex-platform/module-location-management-client/contracts';\nimport {\n AXPCommand,\n mergeEntityActionProcessData,\n resolveEntityActionCommandInput,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMLocationAssignmentCreateWithNewLocationCommand implements AXPCommand<any, any> {\n private readonly entityForm = inject(AXPEntityFormBuilderService);\n private readonly entityService = inject(AXPEntityDefinitionRegistryService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: any): AXPCommandExecuteResultPromise<any> {\n const resolved = resolveEntityActionCommandInput(input);\n const processData = mergeEntityActionProcessData(input);\n const entity = resolved.entity;\n const ownerRef = this.resolveOwnerRef(processData);\n if (!ownerRef.id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@location-management:location-assignments.messages.missing-party-context',\n ),\n },\n };\n }\n\n const [assignmentModuleName, assignmentEntityName] = (entity || '').split('.');\n if (!assignmentModuleName || !assignmentEntityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),\n },\n };\n }\n\n const locationDialogTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.location-dialog-title',\n );\n\n const locationResult = (await this.entityForm\n .entity(`${RootConfig.module.name}.${RootConfig.entities.location.name}`)\n .create({})\n .title(locationDialogTitle)\n .actions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.create.title');\n })\n .onAction<AXPRuntimeCommandResult<any>>(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const locationEntity = await this.entityService.resolve(\n RootConfig.module.name,\n RootConfig.entities.location.name,\n );\n const createLocationFn = locationEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createLocationFn) {\n const msg = await this.translationService.translateAsync(\n '@general:messages.entity.create-command-unavailable',\n );\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: msg,\n });\n throw new Error(msg);\n }\n\n dialogRef.setLoading(true);\n try {\n const context = dialogRef.context();\n const createResult = await createLocationFn(context);\n const locationRow = runtimeCommandPayloadData(createResult);\n if (!locationRow?.id && !locationRow?._id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n }\n return { success: true, kind: 'object', data: locationRow };\n } catch (error: unknown) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.entity.create-failed');\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: errorMsg,\n });\n throw error;\n } finally {\n dialogRef.setLoading(false);\n }\n })\n .show()) as unknown as AXPRuntimeCommandResult<any>;\n\n const locationRow = runtimeCommandPayloadData(locationResult) as Record<string, unknown> | undefined;\n if (!locationRow) {\n return { success: false };\n }\n const locationId = (locationRow['id'] ?? locationRow['_id']) as string;\n const locationSnapshot = buildLocationAssignmentLocationSnapshot(locationRow, locationId);\n\n const assignmentFormTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.assignment-dialog-title',\n );\n\n const assignmentResult = (await this.entityForm\n .entity(`${assignmentModuleName}.${assignmentEntityName}`)\n .create({\n locationId,\n location: locationSnapshot,\n ownerRef,\n })\n .include('roleId', 'personId', 'notes')\n .title(assignmentFormTitle)\n .actions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.create.title');\n })\n .onAction<AXPRuntimeCommandResult<any>>(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const locationAssignmentEntity = await this.entityService.resolve(\n assignmentModuleName,\n assignmentEntityName,\n );\n const createAssignmentFn = locationAssignmentEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createAssignmentFn) {\n const msg = await this.translationService.translateAsync(\n '@general:messages.entity.create-command-unavailable',\n );\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: msg,\n });\n throw new Error(msg);\n }\n\n dialogRef.setLoading(true);\n try {\n const context = dialogRef.context();\n const personId = (context['personId'] ?? get(context, 'person.id')) as string | undefined;\n const personInContext = get(context, 'person') as Record<string, unknown> | undefined;\n const personSnapshot =\n personId && personInContext\n ? buildLocationAssignmentPersonSnapshot({ ...personInContext, id: personId }, personId)\n : undefined;\n\n const createResult = await createAssignmentFn({\n ...context,\n locationId,\n ownerRef,\n location: locationSnapshot,\n ...(personId ? { personId, person: personSnapshot } : {}),\n });\n const __single_createResult = runtimeCommandPayloadData(createResult);\n if (__single_createResult) {\n return { success: true, kind: 'object',\n data: runtimeCommandPayloadData(createResult),\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n };\n }\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n } catch (error: unknown) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.entity.create-failed');\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: errorMsg,\n });\n throw error;\n } finally {\n dialogRef.setLoading(false);\n }\n })\n .show()) as unknown as AXPRuntimeCommandResult<any>;\n\n return assignmentResult;\n }\n\n private resolveOwnerRef(processData: Record<string, unknown>) {\n const nestedOwner = get(processData, 'ownerRef') as { type?: string; id?: string; title?: unknown } | undefined;\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n\n return {\n type: (processData['ownerRef.type'] as string) ?? nestedOwner?.type ?? LOCATION_ASSIGNMENT_PARTY_TYPE,\n id: (processData['ownerRef.id'] as string) ?? nestedOwner?.id ?? '',\n title: resolveLocationAssignmentDisplayTitle(\n locale,\n processData['ownerRef.title'],\n nestedOwner?.title,\n get(processData, 'party.title'),\n get(processData, 'title'),\n ),\n };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAiBA;AAEA;MAGa,iDAAiD,CAAA;AAD9D,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAChD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC1D,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAqNnE,IAAA;IAnNC,MAAM,OAAO,CAAC,KAAU,EAAA;AACtB,QAAA,MAAM,QAAQ,GAAG,+BAA+B,CAAC,KAAK,CAAC;AACvD,QAAA,MAAM,WAAW,GAAG,4BAA4B,CAAC,KAAK,CAAC;AACvD,QAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;AAClD,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,0EAA0E,CAC3E;AACF,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,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