@preeternal/jws-verifier 0.0.0-stage → 0.0.1-rc.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +85 -2
  4. package/dist/asn1/ber-reader.d.ts +57 -0
  5. package/dist/asn1/ber-reader.d.ts.map +1 -0
  6. package/dist/asn1/ber-reader.js +202 -0
  7. package/dist/asn1/der-reader.d.ts +68 -0
  8. package/dist/asn1/der-reader.d.ts.map +1 -0
  9. package/dist/asn1/der-reader.js +181 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +5 -0
  13. package/dist/jws/es256-signature.d.ts +3 -0
  14. package/dist/jws/es256-signature.d.ts.map +1 -0
  15. package/dist/jws/es256-signature.js +22 -0
  16. package/dist/jws/verifier.d.ts +94 -0
  17. package/dist/jws/verifier.d.ts.map +1 -0
  18. package/dist/jws/verifier.js +718 -0
  19. package/dist/ocsp/codec.d.ts +55 -0
  20. package/dist/ocsp/codec.d.ts.map +1 -0
  21. package/dist/ocsp/codec.js +465 -0
  22. package/dist/ocsp/transport.d.ts +6 -0
  23. package/dist/ocsp/transport.d.ts.map +1 -0
  24. package/dist/ocsp/transport.js +69 -0
  25. package/dist/receipt/utility.d.ts +27 -0
  26. package/dist/receipt/utility.d.ts.map +1 -0
  27. package/dist/receipt/utility.js +296 -0
  28. package/dist/types/index.d.ts +4 -0
  29. package/dist/types/index.d.ts.map +1 -0
  30. package/dist/types/index.js +1 -0
  31. package/dist/utils/formatting.d.ts +2 -0
  32. package/dist/utils/formatting.d.ts.map +1 -0
  33. package/dist/utils/formatting.js +9 -0
  34. package/dist/x509/certificate-metadata.d.ts +91 -0
  35. package/dist/x509/certificate-metadata.d.ts.map +1 -0
  36. package/dist/x509/certificate-metadata.js +588 -0
  37. package/dist/x509/prepared-certificates.d.ts +22 -0
  38. package/dist/x509/prepared-certificates.d.ts.map +1 -0
  39. package/dist/x509/prepared-certificates.js +27 -0
  40. package/package.json +81 -3
@@ -0,0 +1,296 @@
1
+ import { BerCursor, BerParseError, DEFAULT_BER_LIMITS, } from "../asn1/ber-reader.js";
2
+ const IN_APP_TYPE_ID = 17;
3
+ const TRANSACTION_IDENTIFIER_TYPE_ID = 1703;
4
+ const ORIGINAL_TRANSACTION_IDENTIFIER_TYPE_ID = 1705;
5
+ // biome-ignore lint/security/noSecrets: This is a public ASN.1 object identifier, not a secret.
6
+ const PKCS7_SIGNED_DATA_OID = "2a864886f70d010702";
7
+ // biome-ignore lint/security/noSecrets: This is a public ASN.1 object identifier, not a secret.
8
+ const PKCS7_DATA_OID = "2a864886f70d010701";
9
+ const BASE64_PATTERN = /^[A-Za-z0-9+/]+={0,2}$/u;
10
+ const PURCHASE_INFO_PATTERN = /"purchase-info"\s+=\s+"([A-Za-z0-9+/=]+)";/u;
11
+ const TRANSACTION_ID_PATTERN = /"transaction-id"\s+=\s+"([A-Za-z0-9+/=]+)";/u;
12
+ const utf8Decoder = new TextDecoder("utf-8", { fatal: true });
13
+ const universal = 0;
14
+ const contextSpecific = 2;
15
+ export class ReceiptFormatError extends Error {
16
+ code;
17
+ offset;
18
+ constructor(code, message, offset, cause) {
19
+ super(message, cause === undefined ? undefined : { cause });
20
+ this.name = "ReceiptFormatError";
21
+ this.code = code;
22
+ this.offset = offset;
23
+ }
24
+ }
25
+ const found = (transactionId) => Object.freeze({ kind: "found", transactionId });
26
+ const missing = () => Object.freeze({ kind: "missing" });
27
+ const fail = (message, offset) => {
28
+ throw new ReceiptFormatError("invalid-structure", message, offset);
29
+ };
30
+ const checkReceiptSize = (byteLength) => {
31
+ if (byteLength > DEFAULT_BER_LIMITS.maxInputBytes) {
32
+ throw new ReceiptFormatError("limit-exceeded", "Receipt exceeds the configured size limit");
33
+ }
34
+ };
35
+ const decodeBase64 = (value) => {
36
+ const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
37
+ checkReceiptSize(Math.floor(value.length / 4) * 3 - padding);
38
+ if (value.length % 4 !== 0 || !BASE64_PATTERN.test(value)) {
39
+ throw new ReceiptFormatError("invalid-base64", "Receipt is not valid canonical base64");
40
+ }
41
+ const bytes = Buffer.from(value, "base64");
42
+ if (bytes.toString("base64") !== value) {
43
+ throw new ReceiptFormatError("invalid-base64", "Receipt is not valid canonical base64");
44
+ }
45
+ return bytes;
46
+ };
47
+ const appReceiptBytes = (input) => {
48
+ if (typeof input === "string")
49
+ return decodeBase64(input);
50
+ checkReceiptSize(input.byteLength);
51
+ return new Uint8Array(input);
52
+ };
53
+ const decodeUtf8 = (bytes) => {
54
+ try {
55
+ return utf8Decoder.decode(bytes);
56
+ }
57
+ catch (error) {
58
+ throw new ReceiptFormatError("invalid-utf8", "Receipt contains invalid UTF-8", undefined, error);
59
+ }
60
+ };
61
+ const isTag = (element, tagClass, tagNumber, constructed) => element.tagClass === tagClass &&
62
+ element.tagNumber === tagNumber &&
63
+ (constructed === undefined || element.constructed === constructed);
64
+ const requireTag = (element, tagClass, tagNumber, name, constructed) => {
65
+ if (!isTag(element, tagClass, tagNumber, constructed)) {
66
+ fail(`${name} has an unexpected BER tag`, element.start);
67
+ }
68
+ };
69
+ const childrenOf = (input, element, name) => {
70
+ if (!element.constructed)
71
+ fail(`${name} must be constructed`, element.start);
72
+ const cursor = new BerCursor(input, element.limits, element.valueStart, element.contentEnd);
73
+ const children = [];
74
+ while (cursor.remaining > 0)
75
+ children.push(cursor.readElement());
76
+ cursor.assertEnd();
77
+ return children;
78
+ };
79
+ const oneChild = (input, element, name) => {
80
+ const children = childrenOf(input, element, name);
81
+ if (children.length !== 1)
82
+ fail(`${name} must contain exactly one element`, element.start);
83
+ return children[0];
84
+ };
85
+ const oneRoot = (input, name) => {
86
+ const cursor = new BerCursor(input);
87
+ const root = cursor.readElement();
88
+ cursor.assertEnd();
89
+ if (root.start !== 0)
90
+ fail(`${name} has an invalid root`, root.start);
91
+ return root;
92
+ };
93
+ const oidHex = (element, name) => {
94
+ requireTag(element, universal, 6, name, false);
95
+ return Buffer.from(element.value).toString("hex");
96
+ };
97
+ const requireOid = (element, expected, name) => {
98
+ if (oidHex(element, name) !== expected)
99
+ fail(`${name} has an unexpected object identifier`, element.start);
100
+ };
101
+ const integerValue = (element, name) => {
102
+ requireTag(element, universal, 2, name, false);
103
+ if (element.value.length === 0 ||
104
+ (element.value.length > 1 && element.value[0] === 0 && (element.value[1] ?? 0) < 0x80) ||
105
+ (element.value[0] ?? 0) >= 0x80 ||
106
+ element.value.length > 6) {
107
+ fail(`${name} is not a supported non-negative INTEGER`, element.start);
108
+ }
109
+ let value = 0;
110
+ for (const byte of element.value)
111
+ value = value * 256 + byte;
112
+ if (!Number.isSafeInteger(value))
113
+ fail(`${name} is outside the supported range`, element.start);
114
+ return value;
115
+ };
116
+ const concat = (parts, maxBytes) => {
117
+ const size = parts.reduce((total, part) => total + part.byteLength, 0);
118
+ if (size > maxBytes) {
119
+ throw new ReceiptFormatError("limit-exceeded", "Receipt OCTET STRING exceeds the configured size limit");
120
+ }
121
+ const result = new Uint8Array(size);
122
+ let offset = 0;
123
+ for (const part of parts) {
124
+ result.set(part, offset);
125
+ offset += part.byteLength;
126
+ }
127
+ return result;
128
+ };
129
+ const visitOctetFragments = (input, element, visit) => {
130
+ requireTag(element, universal, 4, "OCTET STRING");
131
+ if (!element.constructed) {
132
+ visit?.(element.value);
133
+ return;
134
+ }
135
+ for (const child of childrenOf(input, element, "constructed OCTET STRING")) {
136
+ visitOctetFragments(input, child, visit);
137
+ }
138
+ };
139
+ const octetStringBytes = (input, element) => {
140
+ requireTag(element, universal, 4, "OCTET STRING");
141
+ if (!element.constructed)
142
+ return element.value;
143
+ const parts = [];
144
+ visitOctetFragments(input, element, (part) => parts.push(part));
145
+ if (parts.length === 1 && parts[0] !== undefined)
146
+ return parts[0];
147
+ return concat(parts, DEFAULT_BER_LIMITS.maxInputBytes);
148
+ };
149
+ const transactionIdFromUtf8Value = (input, element) => {
150
+ const bytes = octetStringBytes(input, element);
151
+ const value = oneRoot(bytes, "transaction identifier value");
152
+ requireTag(value, universal, 12, "transaction identifier", false);
153
+ return decodeUtf8(value.value);
154
+ };
155
+ function* receiptAttributes(input, set) {
156
+ requireTag(set, universal, 17, "receipt attribute set", true);
157
+ for (const entry of childrenOf(input, set, "receipt attribute set")) {
158
+ requireTag(entry, universal, 16, "receipt attribute", true);
159
+ const [type, version, value, extra] = childrenOf(input, entry, "receipt attribute");
160
+ if (!type || !version || !value || extra) {
161
+ throw new ReceiptFormatError("invalid-structure", "Receipt attribute must contain three fields", entry.start);
162
+ }
163
+ integerValue(version, "receipt attribute version");
164
+ yield { type: integerValue(type, "receipt attribute type"), value };
165
+ }
166
+ }
167
+ const extractFromInAppSet = (input, set) => {
168
+ let firstId;
169
+ for (const { type, value } of receiptAttributes(input, set)) {
170
+ if (type !== TRANSACTION_IDENTIFIER_TYPE_ID &&
171
+ type !== ORIGINAL_TRANSACTION_IDENTIFIER_TYPE_ID) {
172
+ visitOctetFragments(input, value);
173
+ continue;
174
+ }
175
+ const id = transactionIdFromUtf8Value(input, value);
176
+ firstId ??= id;
177
+ }
178
+ return firstId;
179
+ };
180
+ const extractFromReceiptSet = (input, set) => {
181
+ let firstId;
182
+ for (const { type, value } of receiptAttributes(input, set)) {
183
+ if (type !== IN_APP_TYPE_ID) {
184
+ visitOctetFragments(input, value);
185
+ continue;
186
+ }
187
+ const inAppBytes = octetStringBytes(input, value);
188
+ const inApp = oneRoot(inAppBytes, "in-app purchase payload");
189
+ const transactionId = extractFromInAppSet(inAppBytes, inApp);
190
+ firstId ??= transactionId;
191
+ }
192
+ return firstId === undefined ? missing() : found(firstId);
193
+ };
194
+ const readSignedDataContent = (input, signedData) => {
195
+ requireTag(signedData, universal, 16, "CMS SignedData", true);
196
+ const fields = childrenOf(input, signedData, "CMS SignedData");
197
+ const [version, algorithms, content] = fields;
198
+ if (!version || !algorithms || !content) {
199
+ throw new ReceiptFormatError("invalid-structure", "CMS SignedData is incomplete", signedData.start);
200
+ }
201
+ if (![1, 3, 4, 5].includes(integerValue(version, "CMS version"))) {
202
+ fail("Unsupported CMS version", version.start);
203
+ }
204
+ requireTag(algorithms, universal, 17, "CMS digestAlgorithms", true);
205
+ let index = 3;
206
+ for (const tag of [0, 1]) {
207
+ const field = fields[index];
208
+ if (field && isTag(field, contextSpecific, tag, true))
209
+ index += 1;
210
+ }
211
+ const signers = fields[index];
212
+ if (!signers || index !== fields.length - 1) {
213
+ throw new ReceiptFormatError("invalid-structure", "CMS SignedData must end with signerInfos", signedData.start);
214
+ }
215
+ requireTag(signers, universal, 17, "CMS signerInfos", true);
216
+ return content;
217
+ };
218
+ const parseAppReceiptOrThrow = (input) => {
219
+ const bytes = appReceiptBytes(input);
220
+ try {
221
+ const root = oneRoot(bytes, "CMS receipt");
222
+ requireTag(root, universal, 16, "CMS ContentInfo", true);
223
+ const contentInfo = childrenOf(bytes, root, "CMS ContentInfo");
224
+ if (contentInfo.length !== 2)
225
+ fail("CMS ContentInfo must contain two fields", root.start);
226
+ requireOid(contentInfo[0], PKCS7_SIGNED_DATA_OID, "CMS content type");
227
+ requireTag(contentInfo[1], contextSpecific, 0, "CMS signed data wrapper", true);
228
+ const signedData = oneChild(bytes, contentInfo[1], "CMS signed data wrapper");
229
+ const encapsulated = readSignedDataContent(bytes, signedData);
230
+ requireTag(encapsulated, universal, 16, "CMS encapsulated content", true);
231
+ const encapsulatedFields = childrenOf(bytes, encapsulated, "CMS encapsulated content");
232
+ if (encapsulatedFields.length !== 2)
233
+ fail("CMS encapsulated content is incomplete", encapsulated.start);
234
+ requireOid(encapsulatedFields[0], PKCS7_DATA_OID, "CMS encapsulated content type");
235
+ requireTag(encapsulatedFields[1], contextSpecific, 0, "CMS receipt wrapper", true);
236
+ const payload = oneChild(bytes, encapsulatedFields[1], "CMS receipt wrapper");
237
+ const receiptBytes = octetStringBytes(bytes, payload);
238
+ const receiptSet = oneRoot(receiptBytes, "receipt payload");
239
+ return extractFromReceiptSet(receiptBytes, receiptSet);
240
+ }
241
+ catch (error) {
242
+ if (error instanceof ReceiptFormatError)
243
+ throw error;
244
+ if (error instanceof BerParseError) {
245
+ const code = error.code === "limit-exceeded" ? "limit-exceeded" : "invalid-structure";
246
+ throw new ReceiptFormatError(code, error.message, error.offset, error);
247
+ }
248
+ throw new ReceiptFormatError("invalid-structure", "Receipt has an invalid structure", undefined, error);
249
+ }
250
+ };
251
+ export const parseAppReceiptTransactionId = (input) => {
252
+ try {
253
+ return parseAppReceiptOrThrow(input);
254
+ }
255
+ catch (error) {
256
+ if (error instanceof ReceiptFormatError)
257
+ return { kind: "error", error };
258
+ throw error;
259
+ }
260
+ };
261
+ export const extractTransactionIdFromAppReceipt = (input) => {
262
+ const result = parseAppReceiptOrThrow(input);
263
+ return result.kind === "found" ? result.transactionId : null;
264
+ };
265
+ const parseTransactionReceiptOrThrow = (transactionReceipt) => {
266
+ const topLevel = decodeUtf8(decodeBase64(transactionReceipt));
267
+ const topLevelMatch = topLevel.match(PURCHASE_INFO_PATTERN);
268
+ const purchaseInfoBase64 = topLevelMatch?.[1] ?? fail("Transaction receipt does not contain purchase-info");
269
+ const purchaseInfo = decodeUtf8(decodeBase64(purchaseInfoBase64));
270
+ const transactionIdMatch = purchaseInfo.match(TRANSACTION_ID_PATTERN);
271
+ const transactionId = transactionIdMatch?.[1];
272
+ return transactionId === undefined ? missing() : found(transactionId);
273
+ };
274
+ export const parseTransactionReceiptTransactionId = (transactionReceipt) => {
275
+ try {
276
+ return parseTransactionReceiptOrThrow(transactionReceipt);
277
+ }
278
+ catch (error) {
279
+ if (error instanceof ReceiptFormatError)
280
+ return { kind: "error", error };
281
+ throw error;
282
+ }
283
+ };
284
+ export const extractTransactionIdFromTransactionReceipt = (transactionReceipt) => {
285
+ const result = parseTransactionReceiptOrThrow(transactionReceipt);
286
+ return result.kind === "found" ? result.transactionId : null;
287
+ };
288
+ /** Compatibility facade matching Apple's receipt utility method names. */
289
+ export class ReceiptUtility {
290
+ extractTransactionIdFromAppReceipt(input) {
291
+ return extractTransactionIdFromAppReceipt(input);
292
+ }
293
+ extractTransactionIdFromTransactionReceipt(transactionReceipt) {
294
+ return extractTransactionIdFromTransactionReceipt(transactionReceipt);
295
+ }
296
+ }
@@ -0,0 +1,4 @@
1
+ export type BrandedId<T extends string> = string & {
2
+ readonly __brand: T;
3
+ };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,GAAG;IACjD,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACrB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const formatValue: (value: unknown) => string;
2
+ //# sourceMappingURL=formatting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../source/utils/formatting.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MAU5C,CAAC"}
@@ -0,0 +1,9 @@
1
+ export const formatValue = (value) => {
2
+ if (value === undefined) {
3
+ return "";
4
+ }
5
+ if (typeof value === "string") {
6
+ return value;
7
+ }
8
+ return JSON.stringify(value) ?? "";
9
+ };
@@ -0,0 +1,91 @@
1
+ import { type ByteRange, type DerLimits } from "../asn1/der-reader.js";
2
+ declare const OIDS: Readonly<{
3
+ authorityInfoAccess: "1.3.6.1.5.5.7.1.1";
4
+ basicConstraints: "2.5.29.19";
5
+ extendedKeyUsage: "2.5.29.37";
6
+ keyUsage: "2.5.29.15";
7
+ ocsp: "1.3.6.1.5.5.7.48.1";
8
+ ocspSigning: "1.3.6.1.5.5.7.3.9";
9
+ appleLeaf: "1.2.840.113635.100.6.11.1";
10
+ appleIntermediate: "1.2.840.113635.100.6.2.1";
11
+ }>;
12
+ export interface X509MetadataLimits extends DerLimits {
13
+ readonly maxExtensions?: number;
14
+ readonly maxAiaEntries?: number;
15
+ readonly maxOidArcs?: number;
16
+ }
17
+ export interface X509SerialNumber {
18
+ readonly tlv: ByteRange;
19
+ readonly value: ByteRange;
20
+ }
21
+ export interface X509SubjectPublicKey {
22
+ readonly bitString: ByteRange;
23
+ readonly value: ByteRange;
24
+ readonly unusedBits: number;
25
+ }
26
+ export interface X509Validity {
27
+ readonly notBefore: ByteRange;
28
+ readonly notBeforeMs: number;
29
+ readonly notAfter: ByteRange;
30
+ readonly notAfterMs: number;
31
+ }
32
+ export interface X509AuthorityInfoAccess {
33
+ readonly ocspUrls: readonly X509Uri[];
34
+ }
35
+ export interface X509Uri {
36
+ readonly value: string;
37
+ readonly range: ByteRange;
38
+ }
39
+ export interface X509BasicConstraints {
40
+ readonly ca: boolean;
41
+ readonly pathLenConstraint?: number;
42
+ }
43
+ export type X509KeyUsageName = "digitalSignature" | "contentCommitment" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly";
44
+ export interface X509KeyUsage {
45
+ readonly names: readonly X509KeyUsageName[];
46
+ }
47
+ export interface X509ExtendedKeyUsage {
48
+ readonly oids: readonly string[];
49
+ readonly ocspSigning: boolean;
50
+ }
51
+ export type X509ParsedExtension = {
52
+ readonly kind: "authorityInfoAccess";
53
+ readonly value: X509AuthorityInfoAccess;
54
+ } | {
55
+ readonly kind: "basicConstraints";
56
+ readonly value: X509BasicConstraints;
57
+ } | {
58
+ readonly kind: "extendedKeyUsage";
59
+ readonly value: X509ExtendedKeyUsage;
60
+ } | {
61
+ readonly kind: "keyUsage";
62
+ readonly value: X509KeyUsage;
63
+ };
64
+ export interface X509ExtensionMetadata {
65
+ readonly oid: string;
66
+ readonly oidValue: ByteRange;
67
+ readonly critical: boolean;
68
+ readonly tlv: ByteRange;
69
+ readonly value: ByteRange;
70
+ readonly parsed?: X509ParsedExtension;
71
+ }
72
+ export interface X509CertificateMetadata {
73
+ readonly version: 0 | 1 | 2;
74
+ readonly issuer: ByteRange;
75
+ readonly subject: ByteRange;
76
+ readonly serial: X509SerialNumber;
77
+ readonly validity: X509Validity;
78
+ readonly subjectPublicKey: X509SubjectPublicKey;
79
+ readonly extensions: readonly X509ExtensionMetadata[];
80
+ readonly authorityInfoAccess?: X509AuthorityInfoAccess;
81
+ readonly basicConstraints?: X509BasicConstraints;
82
+ readonly keyUsage?: X509KeyUsage;
83
+ readonly extendedKeyUsage?: X509ExtendedKeyUsage;
84
+ readonly apple: {
85
+ readonly leaf: boolean;
86
+ readonly intermediate: boolean;
87
+ };
88
+ }
89
+ export declare const parseX509CertificateMetadata: (input: Uint8Array, options?: X509MetadataLimits) => X509CertificateMetadata;
90
+ export { OIDS as X509_EXTENSION_OIDS };
91
+ //# sourceMappingURL=certificate-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"certificate-metadata.d.ts","sourceRoot":"","sources":["../../source/x509/certificate-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAGd,KAAK,SAAS,EAIf,MAAM,uBAAuB,CAAC;AAE/B,QAAA,MAAM,IAAI;;;;;;;;;EASR,CAAC;AAEH,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;I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