@open-e2ee/signal-protocol-sdk 13.0.0 → 13.2.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 (35) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/LICENSE +1 -1
  3. package/LICENSE-MIT +1 -1
  4. package/NOTICE +1 -1
  5. package/README.md +1 -1
  6. package/SECURITY.md +2 -2
  7. package/device/README.md +11 -1
  8. package/dist/client/config.d.ts +6 -2
  9. package/dist/client/config.d.ts.map +1 -1
  10. package/dist/client/config.js.map +1 -1
  11. package/dist/client/hosted-device-link-transport.d.ts +11 -0
  12. package/dist/client/hosted-device-link-transport.d.ts.map +1 -0
  13. package/dist/client/hosted-device-link-transport.js +25 -0
  14. package/dist/client/hosted-device-link-transport.js.map +1 -0
  15. package/dist/client/hosted-mailbox-subscription.d.ts +36 -4
  16. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  17. package/dist/client/hosted-mailbox-subscription.js +238 -69
  18. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  19. package/dist/client/hosted-push.d.ts +11 -0
  20. package/dist/client/hosted-push.d.ts.map +1 -1
  21. package/dist/client/hosted-push.js +12 -4
  22. package/dist/client/hosted-push.js.map +1 -1
  23. package/dist/client/hosted-transport.d.ts +16 -2
  24. package/dist/client/hosted-transport.d.ts.map +1 -1
  25. package/dist/client/hosted-transport.js +144 -6
  26. package/dist/client/hosted-transport.js.map +1 -1
  27. package/dist/client/hosted.d.ts +4 -1
  28. package/dist/client/hosted.d.ts.map +1 -1
  29. package/dist/client/hosted.js +14 -4
  30. package/dist/client/hosted.js.map +1 -1
  31. package/docs/ASSURANCE.md +5 -5
  32. package/docs/GETTING_STARTED.md +11 -1
  33. package/docs/RECIPES.md +44 -0
  34. package/local/store/web-sqlite/README.md +28 -0
  35. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # Changelog
2
2
 
3
+ ## 13.2.0
4
+
5
+ ### Added
6
+
7
+ - `HostedRelayWakeResult` has an optional `retainedWork` field. It copies the
8
+ Relay report of the wake pull. True means that the Relay keeps a message
9
+ after the page, or a Relay receipt that the page did not carry, so run
10
+ another `pullHostedRelayAfterWake()` pass. False means that the page carried
11
+ all retained work. A Relay that does not report it gives no field. Then the
12
+ retained work is unknown, so do not read an absent field as false.
13
+
14
+ ### Fixed
15
+
16
+ - A hosted mailbox subscription now acknowledges each recovery pull page in
17
+ one HTTP request, also while the socket is live, and waits for the response.
18
+ When the page was full, with 100 messages or 32 Relay receipts, and the
19
+ Relay removed work or issued a cursor, the next page follows at once. It
20
+ does not wait for a timer. So a backlog of Relay receipts drains on the same
21
+ socket, with no reconnect. A socket frame never starts a pull.
22
+ - A lost acknowledgment request or a lost acknowledgment response now starts
23
+ one pull from the mailbox head after a wait. The wait starts at 2 seconds
24
+ and doubles after each further loss, up to 64 seconds. An acknowledgment
25
+ whose requests all succeed starts it at 2 seconds again. A pull that is
26
+ requested while the acknowledgment fails waits for that head pull. So a
27
+ lasting acknowledgment failure backs off. A replayed Relay receipt is not
28
+ handed off again.
29
+ - A subscription now keeps at most 132 Relay receipts in memory while a
30
+ receipt listener is slow. One batch takes at most 32 receipts. When the
31
+ queue of 100 items is full, the rest stay in the Relay, and the subscription
32
+ pulls them when the queue is empty, with no wait.
33
+ - A pull page now decodes the optional `failedEntries` list of the Relay. It
34
+ holds each retained message that the Relay read and could not serve. The
35
+ subscription never acknowledges such a message. It pulls again from the
36
+ mailbox head after the failed-work wait, which starts at 2 seconds and
37
+ doubles up to 64 seconds. A page pulled with a cursor does not start that
38
+ wait again, so a long backlog does not cut the wait short. A page with a
39
+ `failedEntries` value that is not a list of entries is refused. A page that
40
+ holds only failed entries keeps its `nextCursor`, so the subscription and
41
+ `pullHostedRelayAfterWake()` continue past it with the cursor. The
42
+ subscription pulls such cursor pages to their end before the pull from the
43
+ head. It does not continue on a `nextCursor` that equals the cursor of the
44
+ pull.
45
+ - A recovery pull page whose `retainedWork` is true now continues at once
46
+ when the Relay removed work or issued a cursor, also when the page is not
47
+ full. A page without `retainedWork` uses the full-page rule.
48
+ - A subscription now keeps at most one HTTP acknowledgment in flight, and a
49
+ pull waits for its response. When a socket burst ends and a pull follows,
50
+ the Relay receipts of the burst are acknowledged over HTTP before the pull.
51
+ So the pull page does not offer those receipts again, and the next pages
52
+ follow.
53
+ - A pull that a subscription requests while a pull fails now waits for the
54
+ retry schedule of the failed pull. It does not run at once after the
55
+ failure.
56
+
57
+ ## 13.1.0
58
+
59
+ ### Added
60
+
61
+ - `linkHostedRelayDevice` now supplies the authenticated Signal Protocol Relay
62
+ transport when `hosted.adapter` is absent. Custom adapters keep their path.
63
+ Exact retries preserve registration material and linked prekey state. Token
64
+ renewal rebuilds both device proofs without another provider assertion.
65
+
3
66
  ## 13.0.0
4
67
 
5
68
  ### Breaking
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  OpenE2EE Signal Protocol SDK (@open-e2ee/signal-protocol-sdk)
2
2
 
3
- Copyright (c) 2026 OpenE2EE LLC
3
+ Copyright (c) 2026 OpenE2EE, Inc.
4
4
 
5
5
  This software is dual-licensed under either of
6
6
 
package/LICENSE-MIT CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 OpenE2EE LLC
3
+ Copyright (c) 2026 OpenE2EE, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/NOTICE CHANGED
@@ -1,6 +1,6 @@
1
1
  OpenE2EE (`@open-e2ee/signal-protocol-sdk`)
2
2
 
3
- Copyright (c) 2026 OpenE2EE LLC and contributors
3
+ Copyright (c) 2026 OpenE2EE, Inc. and contributors
4
4
 
5
5
  This is an independently maintained OpenE2EE project. It implements its own
6
6
  versioned messaging profile using public Signal Protocol specifications,
package/README.md CHANGED
@@ -39,7 +39,7 @@ The relay never needs message plaintext or device private keys.
39
39
 
40
40
  The OpenE2EE Signal Protocol SDK implements a versioned profile of the published Signal Protocol specifications. It is not affiliated with Signal Messenger and is **not wire-compatible with Signal Messenger or libsignal**. Messages, identities, and safety numbers do not interoperate. See the [notice](./NOTICE) and [documented deviations](./docs/DEVIATIONS.md).
41
41
 
42
- Version `13.0.x`. Public APIs and persisted formats follow semantic versioning.
42
+ Version `13.2.x`. Public APIs and persisted formats follow semantic versioning.
43
43
 
44
44
  ## Install
45
45
 
package/SECURITY.md CHANGED
@@ -7,8 +7,8 @@ backports.
7
7
 
8
8
  | Version | Supported |
9
9
  | -------- | ------------------ |
10
- | 13.0.x | :white_check_mark: |
11
- | < 13.0.0 | :x: |
10
+ | 13.2.x | :white_check_mark: |
11
+ | < 13.2.0 | :x: |
12
12
 
13
13
  ## Reporting a Vulnerability
14
14
 
package/device/README.md CHANGED
@@ -107,7 +107,7 @@ import { linkHostedRelayDevice } from "@open-e2ee/signal-protocol-sdk";
107
107
  const client = await linkHostedRelayDevice({
108
108
  adapters: { storage: linkedStorage },
109
109
  activeDeviceStorage,
110
- hosted: { relayUrl, adapter: managedLinkAdapter },
110
+ hosted: { relayUrl },
111
111
  });
112
112
  ```
113
113
 
@@ -118,6 +118,16 @@ challenge in the calling process. Thus that process must hold the active
118
118
  device's store, private keys included. The adapter's `linkDevice()` gets a
119
119
  challenge signer for each device and no private key.
120
120
 
121
+ Without `hosted.adapter`, the SDK uses the active device's stored Relay session
122
+ to submit both proofs and persists the linked device's session before synchronization.
123
+ It requests no second identity-provider assertion. Pass `hosted.adapter` to keep
124
+ an application-owned transport. That adapter needs no stored Relay session.
125
+
126
+ Retry with the same stores after an uncertain result. The SDK retains the
127
+ operation and registration material. Token renewal rebuilds both proofs without
128
+ replacing that operation. An expired replay response renews through the linked
129
+ device's key. Existing custom-adapter refusal and rollback rules still apply.
130
+
121
131
  The link copies the master key of each group that the active device's group
122
132
  store lists into the new device's group store. The copy runs in the calling
123
133
  process, so no master key crosses the Relay. A client with `groups` on the new
@@ -135,12 +135,16 @@ export interface DoubleRatchetConfig {
135
135
  /**
136
136
  * The client does not read this field. Each receiver chain keeps at most
137
137
  * 2000 skipped message keys. When a chain is full, the key with the lowest
138
- * index leaves first.
138
+ * index leaves first. A key older than 7 days also leaves, at the next
139
+ * expiry cleanup. See `keyExpirationMs`.
139
140
  */
140
141
  maxMessageKeysStored?: number;
141
142
  /**
142
143
  * The client does not read this field. The client deletes stored skipped
143
- * message keys after 7 days (604800000 ms).
144
+ * message keys that are older than 7 days (604800000 ms). The deletion is
145
+ * lazy. It runs before the client encrypts or decrypts a message in the
146
+ * session, and in `DefaultSignalProtocolClient.cleanupExpiredKeys()`. No
147
+ * timer runs it, so an old key stays stored until the next such call.
144
148
  */
145
149
  keyExpirationMs?: number;
146
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,CAAC;AACV,YAAY,EACV,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IACxC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,WAAW,GAAG,UAAU,CAAC;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,KAAK,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0CH,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,WAAW,EACX,+BAA+B,EAC/B,yBAAyB,EACzB,qBAAqB,EACrB,iCAAiC,EACjC,iBAAiB,EACjB,kBAAkB,EAClB,gCAAgC,EAChC,wBAAwB,EACxB,6BAA6B,EAC7B,eAAe,EACf,6BAA6B,EAC7B,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAkHlC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AA8tBlE;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAEtC;IACC,OAAO,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC,CAAC,CAAE,CAAC,KAAK,EAAE,KAAK,CAAW,CAAC,CAAC,CAAE,CAAC,KAAK,CAAW,CAAC;AACzF,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0CH,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,WAAW,EACX,+BAA+B,EAC/B,yBAAyB,EACzB,qBAAqB,EACrB,iCAAiC,EACjC,iBAAiB,EACjB,kBAAkB,EAClB,gCAAgC,EAChC,wBAAwB,EACxB,6BAA6B,EAC7B,eAAe,EACf,6BAA6B,EAC7B,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAkHlC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAkuBlE;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAEtC;IACC,OAAO,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC,CAAC,CAAE,CAAC,KAAK,EAAE,KAAK,CAAW,CAAC,CAAC,CAAE,CAAC,KAAK,CAAW,CAAC;AACzF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { HostedRelayManagedDeviceLinkRequest } from './hosted.js';
2
+ type JsonRecord = Record<string, unknown>;
3
+ /** Compose the existing link protocol under a private current-token capability. */
4
+ export declare function submitHostedRelayDeviceLink(request: HostedRelayManagedDeviceLinkRequest, protocol: {
5
+ readonly relayScopeId: string;
6
+ readonly materialFingerprint: string;
7
+ readonly signalRegistration: JsonRecord;
8
+ readonly post: (body: (tokenId: string) => Promise<JsonRecord>) => Promise<unknown>;
9
+ }): Promise<unknown>;
10
+ export {};
11
+ //# sourceMappingURL=hosted-device-link-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-device-link-transport.d.ts","sourceRoot":"","sources":["../../client/hosted-device-link-transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAEpE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAO1C,mFAAmF;AACnF,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,mCAAmC,EAC5C,QAAQ,EAAE;IACR,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACrF,GACA,OAAO,CAAC,OAAO,CAAC,CAqBlB"}
@@ -0,0 +1,25 @@
1
+ import { bytesToBase64, concatBytes, sha256, stringToBytes } from '../internal/crypto/index.js';
2
+ function lengthPrefixed(value) {
3
+ const size = value.length;
4
+ return concatBytes(new Uint8Array([size >>> 24, size >>> 16, size >>> 8, size]), value);
5
+ }
6
+ /** Compose the existing link protocol under a private current-token capability. */
7
+ export async function submitHostedRelayDeviceLink(request, protocol) {
8
+ return protocol.post(async (tokenId) => {
9
+ const challenge = await sha256(concatBytes(stringToBytes('OpenE2EE Relay device link challenge v1\0'), ...[protocol.relayScopeId, tokenId, request.operationId, protocol.materialFingerprint]
10
+ .map((value) => lengthPrefixed(stringToBytes(value))), lengthPrefixed(request.newDeviceAuthentication.publicKey)));
11
+ const [activeDeviceProof, newDeviceProof] = await Promise.all([
12
+ request.activeDeviceAuthentication.signChallenge(challenge),
13
+ request.newDeviceAuthentication.signChallenge(challenge),
14
+ ]);
15
+ return {
16
+ publishableKey: request.publishableKey,
17
+ operationId: request.operationId,
18
+ signalRegistration: protocol.signalRegistration,
19
+ newDeviceAuthenticationPublicKey: bytesToBase64(request.newDeviceAuthentication.publicKey),
20
+ activeDeviceProof: bytesToBase64(activeDeviceProof),
21
+ newDeviceProof: bytesToBase64(newDeviceProof),
22
+ };
23
+ });
24
+ }
25
+ //# sourceMappingURL=hosted-device-link-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-device-link-transport.js","sourceRoot":"","sources":["../../client/hosted-device-link-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKvF,SAAS,cAAc,CAAC,KAAiB;IACvC,MAAM,IA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J,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -39,11 +39,29 @@ export interface MailboxPage {
39
39
  * empty. A pull with it starts after that message.
40
40
  */
41
41
  readonly nextCursor?: string;
42
+ /**
43
+ * True when the Relay keeps work after the page. Absent when the Relay does
44
+ * not report it, so the retained work after the page is unknown.
45
+ */
46
+ readonly retainedWork?: boolean;
47
+ /**
48
+ * Each retained message that the page read and the Relay could not serve.
49
+ * The page omits it, and it stays in the mailbox. Absent when the Relay does
50
+ * not report it.
51
+ */
52
+ readonly failedEntries?: readonly {
53
+ readonly messageId: string;
54
+ readonly reason: string;
55
+ }[];
42
56
  }
43
57
  /** The Relay's answer to one HTTP acknowledgment. */
44
58
  export interface MailboxAcknowledgment {
45
59
  /** The acknowledged message ids whose delivery receipt the Relay owns. */
46
60
  readonly receipted: readonly string[];
61
+ /** The number of messages that the Relay removed for this request. */
62
+ readonly acknowledged: number;
63
+ /** The number of Relay receipts that the Relay removed for this request. */
64
+ readonly receiptsAcknowledged: number;
47
65
  }
48
66
  interface MailboxSubscription {
49
67
  /**
@@ -70,8 +88,8 @@ interface MailboxSubscription {
70
88
  */
71
89
  pull(cursor?: string): Promise<MailboxPage>;
72
90
  /**
73
- * Acknowledges messages and Relay receipts over HTTP when queued socket
74
- * acknowledgments lose their socket.
91
+ * Acknowledges messages and Relay receipts over HTTP: the work of a pull
92
+ * page, and queued socket acknowledgments that lose their socket.
75
93
  */
76
94
  acknowledge(messageIds: readonly string[], receiptIds: readonly string[]): Promise<MailboxAcknowledgment>;
77
95
  receive(envelope: Envelope): void | Promise<void>;
@@ -109,10 +127,18 @@ interface MailboxSubscription {
109
127
  export interface MailboxSubscriptionHandle {
110
128
  readonly unsubscribe: Unsubscribe;
111
129
  /**
112
- * Queues a socket acknowledgment and returns true while a socket is live.
113
- * Queued ids leave in one frame when the delivered frames are drained.
130
+ * Queues an acknowledgment and returns true while a socket is live or the
131
+ * batch of a pull page runs. Queued socket ids leave in one frame when the
132
+ * delivered frames are drained. The ids of a pull page leave in the HTTP
133
+ * acknowledgment of the page.
114
134
  */
115
135
  acknowledge(messageId: string): boolean;
136
+ /**
137
+ * Runs `send`, one HTTP acknowledgment for this subscription, after the
138
+ * HTTP acknowledgment in flight settles. So at most one is in flight.
139
+ * Resolves or rejects as `send` does.
140
+ */
141
+ acknowledgeOverHttp<T>(send: () => Promise<T>): Promise<T>;
116
142
  /**
117
143
  * Sends one presence request frame on the live socket and resolves with the
118
144
  * `result` of its answer. It rejects with a `HostedRelayPresenceError`: the
@@ -136,6 +162,12 @@ export interface MailboxSubscriptionHandle {
136
162
  * the cursor, and the next pull starts at the head again. The recovery pull
137
163
  * for failed work also starts at the head, so it offers the failed message
138
164
  * again.
165
+ *
166
+ * A pull page is acknowledged in one HTTP request after its batch, also while
167
+ * a socket is live. A full page pulls the next page at once after that
168
+ * response, when the Relay removed work or the page issued a cursor. A socket
169
+ * frame never starts a pull. One batch holds at most one frame of Relay
170
+ * receipts, so the batch and the queue hold at most 132 receipts.
139
171
  */
140
172
  export declare function subscribeHostedMailbox(options: MailboxSubscription): MailboxSubscriptionHandle;
141
173
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-mailbox-subscription.d.ts","sourceRoot":"","sources":["../../client/hosted-mailbox-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAOL,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AA8DhC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B,OAAQ,CAAC;AAClD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AA6BrD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,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