@memberjunction/core-entities-server 6.2.0-edge.1 → 6.2.0-edge.2

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 (77) hide show
  1. package/dist/custom/MJActionEntityServer.server.js +1 -1
  2. package/dist/custom/MJActionEntityServer.server.js.map +1 -1
  3. package/dist/custom/MJComponentEntityServer.server.d.ts +2 -2
  4. package/dist/custom/MJComponentEntityServer.server.d.ts.map +1 -1
  5. package/dist/custom/MJComponentEntityServer.server.js +2 -2
  6. package/dist/custom/MJComponentEntityServer.server.js.map +1 -1
  7. package/dist/custom/MJDuplicateRunEntityServer.server.d.ts +2 -1
  8. package/dist/custom/MJDuplicateRunEntityServer.server.d.ts.map +1 -1
  9. package/dist/custom/MJDuplicateRunEntityServer.server.js +2 -2
  10. package/dist/custom/MJDuplicateRunEntityServer.server.js.map +1 -1
  11. package/dist/custom/MJRecordChangeEntityServer.server.d.ts +6 -0
  12. package/dist/custom/MJRecordChangeEntityServer.server.d.ts.map +1 -0
  13. package/dist/custom/MJRecordChangeEntityServer.server.js +74 -0
  14. package/dist/custom/MJRecordChangeEntityServer.server.js.map +1 -0
  15. package/dist/custom/MJRecordProcessEntityServer.server.d.ts +6 -2
  16. package/dist/custom/MJRecordProcessEntityServer.server.d.ts.map +1 -1
  17. package/dist/custom/MJRecordProcessEntityServer.server.js +6 -2
  18. package/dist/custom/MJRecordProcessEntityServer.server.js.map +1 -1
  19. package/dist/custom/MJRemoteOperationEntityServer.server.js +1 -1
  20. package/dist/custom/MJRemoteOperationEntityServer.server.js.map +1 -1
  21. package/dist/custom/MJRubricBandEntityServer.server.d.ts +9 -0
  22. package/dist/custom/MJRubricBandEntityServer.server.d.ts.map +1 -0
  23. package/dist/custom/MJRubricBandEntityServer.server.js +34 -0
  24. package/dist/custom/MJRubricBandEntityServer.server.js.map +1 -0
  25. package/dist/custom/MJRubricCriterionEntityServer.server.d.ts +16 -0
  26. package/dist/custom/MJRubricCriterionEntityServer.server.d.ts.map +1 -0
  27. package/dist/custom/MJRubricCriterionEntityServer.server.js +43 -0
  28. package/dist/custom/MJRubricCriterionEntityServer.server.js.map +1 -0
  29. package/dist/custom/MJRubricCriterionLevelEntityServer.server.d.ts +10 -0
  30. package/dist/custom/MJRubricCriterionLevelEntityServer.server.d.ts.map +1 -0
  31. package/dist/custom/MJRubricCriterionLevelEntityServer.server.js +43 -0
  32. package/dist/custom/MJRubricCriterionLevelEntityServer.server.js.map +1 -0
  33. package/dist/custom/MJRubricEvaluationEntityServer.server.d.ts +43 -0
  34. package/dist/custom/MJRubricEvaluationEntityServer.server.d.ts.map +1 -0
  35. package/dist/custom/MJRubricEvaluationEntityServer.server.js +243 -0
  36. package/dist/custom/MJRubricEvaluationEntityServer.server.js.map +1 -0
  37. package/dist/custom/MJRubricEvaluationScoreEntityServer.server.d.ts +26 -0
  38. package/dist/custom/MJRubricEvaluationScoreEntityServer.server.d.ts.map +1 -0
  39. package/dist/custom/MJRubricEvaluationScoreEntityServer.server.js +49 -0
  40. package/dist/custom/MJRubricEvaluationScoreEntityServer.server.js.map +1 -0
  41. package/dist/custom/MJRubricScaleEntityServer.server.d.ts +24 -0
  42. package/dist/custom/MJRubricScaleEntityServer.server.d.ts.map +1 -0
  43. package/dist/custom/MJRubricScaleEntityServer.server.js +88 -0
  44. package/dist/custom/MJRubricScaleEntityServer.server.js.map +1 -0
  45. package/dist/custom/MJRubricScaleLevelEntityServer.server.d.ts +16 -0
  46. package/dist/custom/MJRubricScaleLevelEntityServer.server.d.ts.map +1 -0
  47. package/dist/custom/MJRubricScaleLevelEntityServer.server.js +80 -0
  48. package/dist/custom/MJRubricScaleLevelEntityServer.server.js.map +1 -0
  49. package/dist/custom/MJRubricVersionEntityServer.server.d.ts +46 -0
  50. package/dist/custom/MJRubricVersionEntityServer.server.d.ts.map +1 -0
  51. package/dist/custom/MJRubricVersionEntityServer.server.js +131 -0
  52. package/dist/custom/MJRubricVersionEntityServer.server.js.map +1 -0
  53. package/dist/custom/MJVectorIndexEntityServer.server.d.ts +2 -1
  54. package/dist/custom/MJVectorIndexEntityServer.server.d.ts.map +1 -1
  55. package/dist/custom/MJVectorIndexEntityServer.server.js +6 -4
  56. package/dist/custom/MJVectorIndexEntityServer.server.js.map +1 -1
  57. package/dist/custom/rubrics/evaluationSubmit.d.ts +95 -0
  58. package/dist/custom/rubrics/evaluationSubmit.d.ts.map +1 -0
  59. package/dist/custom/rubrics/evaluationSubmit.js +142 -0
  60. package/dist/custom/rubrics/evaluationSubmit.js.map +1 -0
  61. package/dist/custom/rubrics/scaleFreeze.d.ts +21 -0
  62. package/dist/custom/rubrics/scaleFreeze.d.ts.map +1 -0
  63. package/dist/custom/rubrics/scaleFreeze.js +30 -0
  64. package/dist/custom/rubrics/scaleFreeze.js.map +1 -0
  65. package/dist/custom/rubrics/statusRules.d.ts +13 -0
  66. package/dist/custom/rubrics/statusRules.d.ts.map +1 -0
  67. package/dist/custom/rubrics/statusRules.js +57 -0
  68. package/dist/custom/rubrics/statusRules.js.map +1 -0
  69. package/dist/custom/rubrics/versionPublish.d.ts +67 -0
  70. package/dist/custom/rubrics/versionPublish.d.ts.map +1 -0
  71. package/dist/custom/rubrics/versionPublish.js +222 -0
  72. package/dist/custom/rubrics/versionPublish.js.map +1 -0
  73. package/dist/index.d.ts +12 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +12 -0
  76. package/dist/index.js.map +1 -1
  77. package/package.json +30 -28
@@ -0,0 +1,43 @@
1
+ import { type EntitySaveOptions, type ValidationResult } from '@memberjunction/core';
2
+ import { MJRubricEvaluationEntity } from '@memberjunction/core-entities';
3
+ import { type PersistedEvaluation, type PersistedScore, type SubmitEvaluationInput } from './rubrics/evaluationSubmit.js';
4
+ /**
5
+ * Creates and submits an evaluation.
6
+ *
7
+ * Submit refuses a draft version, a retired version that is not the one being
8
+ * superseded, a score for a criterion outside the version, a level from the
9
+ * wrong scale, a raw value on a levels scale, a client-written computed row,
10
+ * and a missing rationale or evidence when the criterion requires it.
11
+ * It calls RubricScoring.Compute and writes that result. It does not reimplement
12
+ * the math. Score rows must be saved while this evaluation is still Draft,
13
+ * because the score trigger rejects writes after submit.
14
+ */
15
+ export declare class MJRubricEvaluationEntityServer extends MJRubricEvaluationEntity {
16
+ /**
17
+ * Scores the draft and copies the computed fields onto this evaluation,
18
+ * including Status Submitted. Returns the score rows to persist first.
19
+ */
20
+ Submit(input: SubmitEvaluationInput): {
21
+ evaluation: PersistedEvaluation;
22
+ scores: PersistedScore[];
23
+ };
24
+ /**
25
+ * When Status moves Draft → Submitted, loads the pinned version and the
26
+ * score rows and calls {@link Submit}. Setting Status and saving is enough.
27
+ * Score rows are written before this row, while the stored status is still
28
+ * Draft. This evaluation is saved next. A supersede target is refused when
29
+ * the subject, context, rubric, or status does not match, and is marked
30
+ * Superseded only after this evaluation saves. A false Save throws, so a
31
+ * failed save does not leave the prior row Superseded. SubmittedAt is set
32
+ * with the status. The three writes share one entity transaction.
33
+ */
34
+ /**
35
+ * A new evaluation is Draft. Draft may be submitted or fail. Submitted may
36
+ * be superseded or withdrawn. Every other move is refused.
37
+ */
38
+ ValidateAsync(): Promise<ValidationResult>;
39
+ Save(options?: EntitySaveOptions): Promise<boolean>;
40
+ /** A row that does not exist yet can pin only a Published version. */
41
+ private assertNewPinPublished;
42
+ }
43
+ //# sourceMappingURL=MJRubricEvaluationEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricEvaluationEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJRubricEvaluationEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,OAAO,EAAsE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG9L;;;;;;;;;;GAUG;AACH,qBACa,8BAA+B,SAAQ,wBAAwB;IACxE;;;OAGG;IACI,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG;QAAE,UAAU,EAAE,mBAAmB,CAAC;QAAC,MAAM,EAAE,cAAc,EAAE,CAAA;KAAE;IAoB1G;;;;;;;;;OASG;IACH;;;OAGG;IACmB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAS1C,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAqGzE,sEAAsE;YACxD,qBAAqB;CAStC"}
@@ -0,0 +1,243 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BaseEntity, RunInEntityTransaction } from '@memberjunction/core';
8
+ import { IsValidUUID } from '@memberjunction/global';
9
+ import { MJRubricEvaluationEntity } from '@memberjunction/core-entities';
10
+ import { RegisterClass } from '@memberjunction/global';
11
+ import { LoadDraftForPublish } from './rubrics/versionPublish.js';
12
+ import { AssertCanSupersede, AssertPinnedVersionForCreate, SubmitEvaluation } from './rubrics/evaluationSubmit.js';
13
+ import { EvaluationStatusError, PushFailure } from './rubrics/statusRules.js';
14
+ /**
15
+ * Creates and submits an evaluation.
16
+ *
17
+ * Submit refuses a draft version, a retired version that is not the one being
18
+ * superseded, a score for a criterion outside the version, a level from the
19
+ * wrong scale, a raw value on a levels scale, a client-written computed row,
20
+ * and a missing rationale or evidence when the criterion requires it.
21
+ * It calls RubricScoring.Compute and writes that result. It does not reimplement
22
+ * the math. Score rows must be saved while this evaluation is still Draft,
23
+ * because the score trigger rejects writes after submit.
24
+ */
25
+ let MJRubricEvaluationEntityServer = class MJRubricEvaluationEntityServer extends MJRubricEvaluationEntity {
26
+ /**
27
+ * Scores the draft and copies the computed fields onto this evaluation,
28
+ * including Status Submitted. Returns the score rows to persist first.
29
+ */
30
+ Submit(input) {
31
+ const result = SubmitEvaluation(input);
32
+ const written = result.evaluation;
33
+ this.NormalizedScore = written.normalizedScore;
34
+ this.Completeness = written.completeness;
35
+ this.Outcome = written.outcome;
36
+ this.Passed = written.passed;
37
+ this.GateFailed = written.gateFailed;
38
+ this.PassThresholdApplied = written.passThresholdApplied;
39
+ this.BandID = written.bandId;
40
+ this.Confidence = written.confidence;
41
+ this.ScoredCriteriaCount = written.scoredCriteriaCount;
42
+ this.ApplicableCriteriaCount = written.applicableCriteriaCount;
43
+ this.TotalCriteriaCount = written.totalCriteriaCount;
44
+ this.ScoringEngineVersion = written.scoringEngineVersion;
45
+ this.Status = 'Submitted';
46
+ this.SubmittedAt = written.submittedAt;
47
+ return result;
48
+ }
49
+ /**
50
+ * When Status moves Draft → Submitted, loads the pinned version and the
51
+ * score rows and calls {@link Submit}. Setting Status and saving is enough.
52
+ * Score rows are written before this row, while the stored status is still
53
+ * Draft. This evaluation is saved next. A supersede target is refused when
54
+ * the subject, context, rubric, or status does not match, and is marked
55
+ * Superseded only after this evaluation saves. A false Save throws, so a
56
+ * failed save does not leave the prior row Superseded. SubmittedAt is set
57
+ * with the status. The three writes share one entity transaction.
58
+ */
59
+ /**
60
+ * A new evaluation is Draft. Draft may be submitted or fail. Submitted may
61
+ * be superseded or withdrawn. Every other move is refused.
62
+ */
63
+ async ValidateAsync() {
64
+ const result = await super.ValidateAsync();
65
+ const status = this.GetFieldByName('Status');
66
+ const previous = this.IsSaved === false ? null : String(status?.OldValue ?? this.Status);
67
+ const message = EvaluationStatusError(this.IsSaved === false, previous, String(this.Status));
68
+ if (message)
69
+ PushFailure(result, 'Status', message, this.Status);
70
+ return result;
71
+ }
72
+ async Save(options) {
73
+ if (this.IsSaved === false) {
74
+ await this.assertNewPinPublished();
75
+ }
76
+ const status = this.GetFieldByName('Status');
77
+ if (!(status?.Dirty && status.OldValue === 'Draft' && this.Status === 'Submitted')) {
78
+ return super.Save(options);
79
+ }
80
+ return RunInEntityTransaction(this.ProviderToUse, async () => {
81
+ const provider = this.ProviderToUse;
82
+ if (!provider?.RunView)
83
+ throw new Error('Submitting an evaluation requires a provider that can load the version and scores.');
84
+ const run = (entityName, filter) => provider.RunView({ EntityName: entityName, ExtraFilter: filter, ResultType: 'entity_object' }, this.ContextCurrentUser);
85
+ const versionId = requireId(this.RubricVersionID, 'rubric version');
86
+ const evaluationId = requireId(this.ID, 'evaluation');
87
+ const versionRows = await run('MJ: Rubric Versions', `ID='${versionId}'`);
88
+ const versionRow = versionRows.Results?.[0];
89
+ if (!versionRows.Success || !versionRow)
90
+ throw new Error('The pinned rubric version was not found.');
91
+ const loaded = await LoadDraftForPublish(run, versionId, String(versionRow.RubricID ?? this.RubricID), null);
92
+ const scoreRows = await run('MJ: Rubric Evaluation Scores', `EvaluationID='${evaluationId}'`);
93
+ if (!scoreRows.Success)
94
+ throw new Error('Could not read the scores.');
95
+ const clientScores = (scoreRows.Results ?? []).filter(row => !readScore(row).isComputed);
96
+ const prior = this.SupersedesEvaluationID ? await loadPrior(run, this.SupersedesEvaluationID) : null;
97
+ const input = {
98
+ version: loaded.draft,
99
+ versionStatus: versionRow.Status,
100
+ supersedesEvaluationId: this.SupersedesEvaluationID ? requireId(this.SupersedesEvaluationID, 'prior evaluation') : null,
101
+ priorVersionId: prior?.versionId ?? null,
102
+ scores: clientScores.map(row => readScore(row)),
103
+ passThresholdOverride: this.PassThresholdApplied == null ? null : Number(this.PassThresholdApplied),
104
+ };
105
+ if (prior) {
106
+ // RubricID on an evaluation is a view column. A record created in this
107
+ // session has the pinned version, not that column, until it is reloaded.
108
+ AssertCanSupersede(prior.target, {
109
+ status: 'Submitted',
110
+ subjectEntityId: this.SubjectEntityID,
111
+ subjectRecordId: this.SubjectRecordID,
112
+ contextEntityId: this.ContextEntityID,
113
+ contextRecordId: this.ContextRecordID,
114
+ rubricId: String(versionRow.RubricID ?? this.RubricID ?? ''),
115
+ });
116
+ }
117
+ const result = SubmitEvaluation(input);
118
+ const writtenIds = new Set();
119
+ for (const row of clientScores) {
120
+ const record = row;
121
+ const criterionId = String(record.CriterionID ?? record.Get?.('CriterionID'));
122
+ const computed = result.scores.find(score => score.criterionId === criterionId);
123
+ if (!computed)
124
+ continue;
125
+ record.NormalizedScore = computed.normalizedScore;
126
+ record.EffectiveWeight = computed.effectiveWeight;
127
+ record.OverallContribution = computed.overallContribution;
128
+ record.GateFailed = computed.gateFailed;
129
+ record.Completeness = computed.completeness;
130
+ record.Confidence = computed.confidence;
131
+ record.IsComputed = computed.isComputed;
132
+ if (computed.isComputed)
133
+ record.AllowServerComputedWrite = true;
134
+ writtenIds.add(criterionId);
135
+ await saveOrThrow(record, 'the score');
136
+ }
137
+ const providerWithCreate = provider;
138
+ for (const computed of result.scores) {
139
+ if (!computed.isComputed || writtenIds.has(computed.criterionId) || !providerWithCreate.GetEntityObject)
140
+ continue;
141
+ const created = await providerWithCreate.GetEntityObject('MJ: Rubric Evaluation Scores', this.ContextCurrentUser);
142
+ created.NewRecord?.();
143
+ created.EvaluationID = this.ID;
144
+ created.CriterionID = computed.criterionId;
145
+ created.NormalizedScore = computed.normalizedScore;
146
+ created.EffectiveWeight = computed.effectiveWeight;
147
+ created.OverallContribution = computed.overallContribution;
148
+ created.GateFailed = computed.gateFailed;
149
+ created.Completeness = computed.completeness;
150
+ created.Confidence = computed.confidence;
151
+ created.IsComputed = true;
152
+ created.AllowServerComputedWrite = true;
153
+ await saveOrThrow(created, 'the computed score');
154
+ }
155
+ const written = result.evaluation;
156
+ this.NormalizedScore = written.normalizedScore;
157
+ this.Completeness = written.completeness;
158
+ this.Outcome = written.outcome;
159
+ this.Passed = written.passed;
160
+ this.GateFailed = written.gateFailed;
161
+ this.PassThresholdApplied = written.passThresholdApplied;
162
+ this.BandID = written.bandId;
163
+ this.Confidence = written.confidence;
164
+ this.ScoredCriteriaCount = written.scoredCriteriaCount;
165
+ this.ApplicableCriteriaCount = written.applicableCriteriaCount;
166
+ this.TotalCriteriaCount = written.totalCriteriaCount;
167
+ this.ScoringEngineVersion = written.scoringEngineVersion;
168
+ this.Status = 'Submitted';
169
+ this.SubmittedAt = written.submittedAt;
170
+ if (!await super.Save(options))
171
+ throw new Error('Could not save the evaluation.');
172
+ if (prior) {
173
+ prior.row.Status = 'Superseded';
174
+ await saveOrThrow(prior.row, 'the previous evaluation');
175
+ }
176
+ return true;
177
+ });
178
+ }
179
+ /** A row that does not exist yet can pin only a Published version. */
180
+ async assertNewPinPublished() {
181
+ const provider = this.ProviderToUse;
182
+ if (!provider?.RunView)
183
+ throw new Error('Creating an evaluation requires a provider that can load the pinned version.');
184
+ const versionId = requireId(this.RubricVersionID, 'rubric version');
185
+ const versionRows = await provider.RunView({ EntityName: 'MJ: Rubric Versions', ExtraFilter: `ID='${versionId}'`, ResultType: 'entity_object' }, this.ContextCurrentUser);
186
+ const versionRow = versionRows.Results?.[0];
187
+ if (!versionRows.Success || !versionRow)
188
+ throw new Error('The pinned rubric version was not found.');
189
+ AssertPinnedVersionForCreate(String(versionRow.Status ?? ''));
190
+ }
191
+ };
192
+ MJRubricEvaluationEntityServer = __decorate([
193
+ RegisterClass(BaseEntity, 'MJ: Rubric Evaluations')
194
+ ], MJRubricEvaluationEntityServer);
195
+ export { MJRubricEvaluationEntityServer };
196
+ async function saveOrThrow(record, label) {
197
+ if (!record.Save || !await record.Save())
198
+ throw new Error(`Could not save ${label}.`);
199
+ }
200
+ async function loadPrior(run, id) {
201
+ const priorRows = await run('MJ: Rubric Evaluations', `ID='${id}'`);
202
+ const prior = priorRows.Results?.[0];
203
+ if (!prior?.Save)
204
+ throw new Error('The evaluation being superseded was not found.');
205
+ let rubricId = prior.RubricID ? String(prior.RubricID) : '';
206
+ if (!rubricId && prior.RubricVersionID) {
207
+ const versionRows = await run('MJ: Rubric Versions', `ID='${prior.RubricVersionID}'`);
208
+ const version = versionRows.Results?.[0];
209
+ rubricId = version?.RubricID ? String(version.RubricID) : '';
210
+ }
211
+ return {
212
+ versionId: prior.RubricVersionID ? String(prior.RubricVersionID) : null,
213
+ target: {
214
+ status: String(prior.Status),
215
+ subjectEntityId: String(prior.SubjectEntityID),
216
+ subjectRecordId: String(prior.SubjectRecordID),
217
+ contextEntityId: prior.ContextEntityID ?? null,
218
+ contextRecordId: prior.ContextRecordID ?? null,
219
+ rubricId,
220
+ },
221
+ row: prior,
222
+ };
223
+ }
224
+ function requireId(value, label) {
225
+ if (!value || !IsValidUUID(value))
226
+ throw new Error(`The ${label} id is not valid.`);
227
+ return value;
228
+ }
229
+ function readScore(row) {
230
+ const record = row;
231
+ const value = (name) => record[name] !== undefined ? record[name] : record.Get?.(name);
232
+ return {
233
+ criterionId: String(value('CriterionID')),
234
+ scaleLevelId: value('ScaleLevelID'),
235
+ rawValue: value('RawValue'),
236
+ isNotApplicable: Boolean(value('IsNotApplicable')),
237
+ confidence: value('Confidence'),
238
+ rationale: value('Rationale'),
239
+ evidence: value('Evidence'),
240
+ isComputed: Boolean(value('IsComputed')),
241
+ };
242
+ }
243
+ //# sourceMappingURL=MJRubricEvaluationEntityServer.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricEvaluationEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJRubricEvaluationEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAiD,MAAM,sBAAsB,CAAC;AACzH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB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;QAC3B,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;KAC3C,CAAC;AACN,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type ValidationResult } from '@memberjunction/core';
2
+ import { MJRubricEvaluationScoreEntity } from '@memberjunction/core-entities';
3
+ import { type SubmitEvaluationInput } from './rubrics/evaluationSubmit.js';
4
+ /**
5
+ * Validates one score row against its version.
6
+ *
7
+ * Refuses a criterion that is not on the version, a group row written by the
8
+ * client, a scale level that is not on the criterion's scale, and a raw value
9
+ * on a scale that is not numeric. The evaluation server writes computed group
10
+ * rows while the evaluation is still Draft.
11
+ */
12
+ export declare class MJRubricEvaluationScoreEntityServer extends MJRubricEvaluationScoreEntity {
13
+ /**
14
+ * Set by the evaluation server before it saves a group rollup row.
15
+ * A client save leaves this false, so IsComputed is refused.
16
+ */
17
+ AllowServerComputedWrite: boolean;
18
+ /** Throws RubricEvaluationError when this row is not a legal client write. */
19
+ AssertWritable(input: SubmitEvaluationInput): void;
20
+ /**
21
+ * Refuses a client-written computed row on every save. The evaluation
22
+ * server writes those rows itself while the evaluation is still Draft.
23
+ */
24
+ ValidateAsync(): Promise<ValidationResult>;
25
+ }
26
+ //# sourceMappingURL=MJRubricEvaluationScoreEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricEvaluationScoreEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJRubricEvaluationScoreEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,EAA4B,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAErG;;;;;;;GAOG;AACH,qBACa,mCAAoC,SAAQ,6BAA6B;IAClF;;;OAGG;IACI,wBAAwB,UAAS;IAExC,8EAA8E;IACvE,cAAc,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI;IAIzD;;;OAGG;IACmB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAQnE"}
@@ -0,0 +1,49 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BaseEntity } from '@memberjunction/core';
8
+ import { MJRubricEvaluationScoreEntity } from '@memberjunction/core-entities';
9
+ import { RegisterClass } from '@memberjunction/global';
10
+ import { ValidateEvaluationScores } from './rubrics/evaluationSubmit.js';
11
+ /**
12
+ * Validates one score row against its version.
13
+ *
14
+ * Refuses a criterion that is not on the version, a group row written by the
15
+ * client, a scale level that is not on the criterion's scale, and a raw value
16
+ * on a scale that is not numeric. The evaluation server writes computed group
17
+ * rows while the evaluation is still Draft.
18
+ */
19
+ let MJRubricEvaluationScoreEntityServer = class MJRubricEvaluationScoreEntityServer extends MJRubricEvaluationScoreEntity {
20
+ constructor() {
21
+ super(...arguments);
22
+ /**
23
+ * Set by the evaluation server before it saves a group rollup row.
24
+ * A client save leaves this false, so IsComputed is refused.
25
+ */
26
+ this.AllowServerComputedWrite = false;
27
+ }
28
+ /** Throws RubricEvaluationError when this row is not a legal client write. */
29
+ AssertWritable(input) {
30
+ ValidateEvaluationScores(input);
31
+ }
32
+ /**
33
+ * Refuses a client-written computed row on every save. The evaluation
34
+ * server writes those rows itself while the evaluation is still Draft.
35
+ */
36
+ async ValidateAsync() {
37
+ const result = await super.ValidateAsync();
38
+ if (this.IsComputed && !this.AllowServerComputedWrite) {
39
+ result.Success = false;
40
+ result.Errors.push({ Message: 'Computed score rows are written by the server.', FieldName: 'IsComputed' });
41
+ }
42
+ return result;
43
+ }
44
+ };
45
+ MJRubricEvaluationScoreEntityServer = __decorate([
46
+ RegisterClass(BaseEntity, 'MJ: Rubric Evaluation Scores')
47
+ ], MJRubricEvaluationScoreEntityServer);
48
+ export { MJRubricEvaluationScoreEntityServer };
49
+ //# sourceMappingURL=MJRubricEvaluationScoreEntityServer.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricEvaluationScoreEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJRubricEvaluationScoreEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAA8B,MAAM,+BAA+B,CAAC;AAErG;;;;;;;GAOG;AAEI,IAAM,mCAAmC,GAAzC,MAAM,mCAAoC,SAAQ,6BAA6B;IAA/E;;QACH;;;WAGG;QACI,6BAAwB,GAAG,KAAK,CAAC;IAmB5C,CAAC;IAjBG,8EAA8E;IACvE,cAAc,CAAC,KAA4B;QAC9C,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACa,KAAK,CAAC,aAAa;QAC/B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACpD,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;YACvB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gDAAgD,EAAE,SAAS,EAAE,YAAY,EAAW,CAAC,CAAC;QACxH,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AAxBY,mCAAmC;IAD/C,aAAa,CAAC,UAAU,EAAE,8BAA8B,CAAC;GAC7C,mCAAmC,CAwB/C"}
@@ -0,0 +1,24 @@
1
+ import { type ValidationResult } from '@memberjunction/core';
2
+ import { MJRubricScaleEntity } from '@memberjunction/core-entities';
3
+ import { type ScaleShape } from './rubrics/scaleFreeze.js';
4
+ /**
5
+ * Freezes a scale once any published version uses it.
6
+ *
7
+ * Refuses a change to type, range, step, direction, or level values.
8
+ * Label and description edits are allowed. When no published version uses
9
+ * the scale, any edit is allowed.
10
+ */
11
+ export declare class MJRubricScaleEntityServer extends MJRubricScaleEntity {
12
+ /**
13
+ * Returns a refusal message when this edit would change a frozen scale,
14
+ * otherwise null. The caller throws that message instead of saving.
15
+ */
16
+ refusalFor(usedByPublishedVersion: boolean, before: ScaleShape, after: ScaleShape): string | null;
17
+ /**
18
+ * Refuses a structural edit when any published version uses this scale.
19
+ * Label and description changes still pass. Runs on every save, not only
20
+ * when a caller remembers {@link refusalFor}.
21
+ */
22
+ ValidateAsync(): Promise<ValidationResult>;
23
+ }
24
+ //# sourceMappingURL=MJRubricScaleEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricScaleEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJRubricScaleEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE9E;;;;;;GAMG;AACH,qBACa,yBAA0B,SAAQ,mBAAmB;IAC9D;;;OAGG;IACI,UAAU,CAAC,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAIxG;;;;OAIG;IACmB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAgDnE"}
@@ -0,0 +1,88 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BaseEntity } from '@memberjunction/core';
8
+ import { MJRubricScaleEntity } from '@memberjunction/core-entities';
9
+ import { RegisterClass } from '@memberjunction/global';
10
+ import { FrozenScaleChange } from './rubrics/scaleFreeze.js';
11
+ /**
12
+ * Freezes a scale once any published version uses it.
13
+ *
14
+ * Refuses a change to type, range, step, direction, or level values.
15
+ * Label and description edits are allowed. When no published version uses
16
+ * the scale, any edit is allowed.
17
+ */
18
+ let MJRubricScaleEntityServer = class MJRubricScaleEntityServer extends MJRubricScaleEntity {
19
+ /**
20
+ * Returns a refusal message when this edit would change a frozen scale,
21
+ * otherwise null. The caller throws that message instead of saving.
22
+ */
23
+ refusalFor(usedByPublishedVersion, before, after) {
24
+ return FrozenScaleChange(usedByPublishedVersion, before, after);
25
+ }
26
+ /**
27
+ * Refuses a structural edit when any published version uses this scale.
28
+ * Label and description changes still pass. Runs on every save, not only
29
+ * when a caller remembers {@link refusalFor}.
30
+ */
31
+ async ValidateAsync() {
32
+ const result = await super.ValidateAsync();
33
+ const provider = this.ProviderToUse;
34
+ if (!provider?.RunView || !this.ID)
35
+ return result;
36
+ const criteria = await provider.RunView({ EntityName: 'MJ: Rubric Criteria', ExtraFilter: `ScaleID='${this.ID}'` }, this.ContextCurrentUser);
37
+ const versionIds = [...new Set((criteria.Results ?? []).map(row => String(row.RubricVersionID ?? '')).filter(id => id))];
38
+ let used = false;
39
+ for (const versionId of versionIds) {
40
+ const versions = await provider.RunView({ EntityName: 'MJ: Rubric Versions', ExtraFilter: `ID='${versionId}'` }, this.ContextCurrentUser);
41
+ if ((versions.Results ?? []).some(row => row.Status === 'Published'))
42
+ used = true;
43
+ }
44
+ if (!used)
45
+ return result;
46
+ const stored = await provider.RunView({ EntityName: 'MJ: Rubric Scales', ExtraFilter: `ID='${this.ID}'` }, this.ContextCurrentUser);
47
+ const levels = await provider.RunView({ EntityName: 'MJ: Rubric Scale Levels', ExtraFilter: `ScaleID='${this.ID}'` }, this.ContextCurrentUser);
48
+ const beforeRow = stored.Results?.[0];
49
+ if (!beforeRow)
50
+ return result;
51
+ const before = {
52
+ scaleType: String(beforeRow.ScaleType ?? beforeRow.scaleType),
53
+ minValue: (beforeRow.MinValue ?? beforeRow.minValue),
54
+ maxValue: (beforeRow.MaxValue ?? beforeRow.maxValue),
55
+ step: (beforeRow.Step ?? beforeRow.step),
56
+ higherIsBetter: Boolean(beforeRow.HigherIsBetter ?? beforeRow.higherIsBetter),
57
+ levels: (levels.Results ?? []).map(row => {
58
+ const level = row;
59
+ return {
60
+ id: String(level.ID ?? level.id),
61
+ value: Number(level.Value ?? level.value),
62
+ normalizedValue: Number(level.NormalizedValue ?? level.normalizedValue),
63
+ label: String(level.Label ?? level.label ?? ''),
64
+ description: (level.Description ?? level.description),
65
+ };
66
+ }),
67
+ };
68
+ const after = {
69
+ scaleType: this.ScaleType,
70
+ minValue: this.MinValue,
71
+ maxValue: this.MaxValue,
72
+ step: this.Step,
73
+ higherIsBetter: this.HigherIsBetter,
74
+ levels: before.levels,
75
+ };
76
+ const message = FrozenScaleChange(true, before, after);
77
+ if (message) {
78
+ result.Success = false;
79
+ result.Errors.push({ Message: message, FieldName: 'ScaleType' });
80
+ }
81
+ return result;
82
+ }
83
+ };
84
+ MJRubricScaleEntityServer = __decorate([
85
+ RegisterClass(BaseEntity, 'MJ: Rubric Scales')
86
+ ], MJRubricScaleEntityServer);
87
+ export { MJRubricScaleEntityServer };
88
+ //# sourceMappingURL=MJRubricScaleEntityServer.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricScaleEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJRubricScaleEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAE9E;;;;;;GAMG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,mBAAmB;IAC9D;;;OAGG;IACI,UAAU,CAAC,sBAA+B,EAAE,MAAkB,EAAE,KAAiB;QACpF,OAAO,iBAAiB,CAAC,sBAAsB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACa,KAAK,CAAC,aAAa;QAC/B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAiK,CAAC;QACxL,IAAI,CAAC,QAAQ,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,OAAO,MAAM,CAAC;QAClD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,qBAAqB,EAAE,WAAW,EAAE,YAAY,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC7I,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAE,GAAoC,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,CA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I,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAW,CAAC,CAAC;QAC9E,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AA9DY,yBAAyB;IADrC,aAAa,CAAC,UAAU,EAAE,mBAAmB,CAAC;GAClC,yBAAyB,CA8DrC"}
@@ -0,0 +1,16 @@
1
+ import { type ValidationResult } from '@memberjunction/core';
2
+ import { MJRubricScaleLevelEntity } from '@memberjunction/core-entities';
3
+ /**
4
+ * A level whose scale is used by a published version cannot change its value
5
+ * or normalized value. Label and description may change. The scale server
6
+ * covers the scale row; this server covers the level row, which is a
7
+ * separate save.
8
+ */
9
+ export declare class MJRubricScaleLevelEntityServer extends MJRubricScaleLevelEntity {
10
+ /**
11
+ * Refuses a value edit when a published version uses this scale.
12
+ * A description or label edit passes.
13
+ */
14
+ ValidateAsync(): Promise<ValidationResult>;
15
+ }
16
+ //# sourceMappingURL=MJRubricScaleLevelEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricScaleLevelEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJRubricScaleLevelEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAMzE;;;;;GAKG;AACH,qBACa,8BAA+B,SAAQ,wBAAwB;IACxE;;;OAGG;IACmB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAoDnE"}
@@ -0,0 +1,80 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BaseEntity } from '@memberjunction/core';
8
+ import { MJRubricScaleLevelEntity } from '@memberjunction/core-entities';
9
+ import { RegisterClass } from '@memberjunction/global';
10
+ import { FrozenScaleChange } from './rubrics/scaleFreeze.js';
11
+ /**
12
+ * A level whose scale is used by a published version cannot change its value
13
+ * or normalized value. Label and description may change. The scale server
14
+ * covers the scale row; this server covers the level row, which is a
15
+ * separate save.
16
+ */
17
+ let MJRubricScaleLevelEntityServer = class MJRubricScaleLevelEntityServer extends MJRubricScaleLevelEntity {
18
+ /**
19
+ * Refuses a value edit when a published version uses this scale.
20
+ * A description or label edit passes.
21
+ */
22
+ async ValidateAsync() {
23
+ const result = await super.ValidateAsync();
24
+ const provider = this.ProviderToUse;
25
+ if (!provider?.RunView || !this.ScaleID)
26
+ return result;
27
+ const criteria = await provider.RunView({ EntityName: 'MJ: Rubric Criteria', ExtraFilter: `ScaleID='${this.ScaleID}'` }, this.ContextCurrentUser);
28
+ const versionIds = [...new Set((criteria.Results ?? []).map(row => String(row.RubricVersionID ?? '')).filter(id => id))];
29
+ let used = false;
30
+ for (const versionId of versionIds) {
31
+ const versions = await provider.RunView({ EntityName: 'MJ: Rubric Versions', ExtraFilter: `ID='${versionId}'` }, this.ContextCurrentUser);
32
+ if ((versions.Results ?? []).some(row => row.Status === 'Published'))
33
+ used = true;
34
+ }
35
+ if (!used)
36
+ return result;
37
+ const stored = await provider.RunView({ EntityName: 'MJ: Rubric Scale Levels', ExtraFilter: `ID='${this.ID}'` }, this.ContextCurrentUser);
38
+ const scales = await provider.RunView({ EntityName: 'MJ: Rubric Scales', ExtraFilter: `ID='${this.ScaleID}'` }, this.ContextCurrentUser);
39
+ const storedLevel = stored.Results?.[0];
40
+ const scale = scales.Results?.[0];
41
+ if (!scale)
42
+ return result;
43
+ if (!storedLevel) {
44
+ result.Success = false;
45
+ result.Errors.push({ Message: 'A scale used by a published version cannot add a level.', FieldName: 'Value' });
46
+ return result;
47
+ }
48
+ const shape = (level) => ({
49
+ scaleType: String(scale.ScaleType ?? 'Levels'),
50
+ minValue: (scale.MinValue ?? null),
51
+ maxValue: (scale.MaxValue ?? null),
52
+ step: (scale.Step ?? null),
53
+ higherIsBetter: Boolean(scale.HigherIsBetter),
54
+ levels: [level],
55
+ });
56
+ const message = FrozenScaleChange(true, shape({
57
+ id: this.ID,
58
+ value: Number(storedLevel.Value),
59
+ normalizedValue: Number(storedLevel.NormalizedValue),
60
+ label: String(storedLevel.Label ?? ''),
61
+ description: (storedLevel.Description ?? null),
62
+ }), shape({
63
+ id: this.ID,
64
+ value: this.Value,
65
+ normalizedValue: this.NormalizedValue,
66
+ label: this.Label,
67
+ description: this.Description,
68
+ }));
69
+ if (message) {
70
+ result.Success = false;
71
+ result.Errors.push({ Message: message, FieldName: 'NormalizedValue' });
72
+ }
73
+ return result;
74
+ }
75
+ };
76
+ MJRubricScaleLevelEntityServer = __decorate([
77
+ RegisterClass(BaseEntity, 'MJ: Rubric Scale Levels')
78
+ ], MJRubricScaleLevelEntityServer);
79
+ export { MJRubricScaleLevelEntityServer };
80
+ //# sourceMappingURL=MJRubricScaleLevelEntityServer.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJRubricScaleLevelEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJRubricScaleLevelEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAI9E;;;;;GAKG;AAEI,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,wBAAwB;IACxE;;;OAGG;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