@brass-build/client 0.1.0 → 0.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.
- package/AGENTS.md +72 -63
- package/CHANGELOG.md +86 -0
- package/README.md +317 -231
- package/dist/auth-flow.d.ts +10 -1
- package/dist/auth-flow.d.ts.map +1 -1
- package/dist/auth-flow.js +64 -20
- package/dist/auth-flow.js.map +1 -1
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +217 -75
- package/dist/client.js.map +1 -1
- package/dist/document-engine.d.ts +4 -0
- package/dist/document-engine.d.ts.map +1 -0
- package/dist/document-engine.js +9 -0
- package/dist/document-engine.js.map +1 -0
- package/dist/document-streams.d.ts +8 -1
- package/dist/document-streams.d.ts.map +1 -1
- package/dist/document-streams.js +79 -8
- package/dist/document-streams.js.map +1 -1
- package/dist/documents-namespace.d.ts.map +1 -1
- package/dist/documents-namespace.js +19 -3
- package/dist/documents-namespace.js.map +1 -1
- package/dist/documents.d.ts +43 -14
- package/dist/documents.d.ts.map +1 -1
- package/dist/documents.js +871 -223
- package/dist/documents.js.map +1 -1
- package/dist/embed-protocol.d.ts +3 -0
- package/dist/embed-protocol.d.ts.map +1 -0
- package/dist/embed-protocol.js +26 -0
- package/dist/embed-protocol.js.map +1 -0
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +8 -1
- package/dist/emitter.js.map +1 -1
- package/dist/export-guest.d.ts.map +1 -1
- package/dist/export-guest.js +14 -6
- package/dist/export-guest.js.map +1 -1
- package/dist/fetch-deadline.d.ts +22 -0
- package/dist/fetch-deadline.d.ts.map +1 -0
- package/dist/fetch-deadline.js +96 -0
- package/dist/fetch-deadline.js.map +1 -0
- package/dist/fetch-retry.d.ts +1 -0
- package/dist/fetch-retry.d.ts.map +1 -1
- package/dist/fetch-retry.js +12 -5
- package/dist/fetch-retry.js.map +1 -1
- package/dist/handle-types.d.ts +150 -0
- package/dist/handle-types.d.ts.map +1 -0
- package/dist/handle-types.js +8 -0
- package/dist/handle-types.js.map +1 -0
- package/dist/handles.d.ts +48 -48
- package/dist/handles.d.ts.map +1 -1
- package/dist/handles.js +3122 -501
- package/dist/handles.js.map +1 -1
- package/dist/hosted-runtime.d.ts.map +1 -1
- package/dist/hosted-runtime.js +8 -12
- package/dist/hosted-runtime.js.map +1 -1
- package/dist/hosted-ui.d.ts +0 -1
- package/dist/hosted-ui.d.ts.map +1 -1
- package/dist/hosted-ui.js +29 -24
- package/dist/hosted-ui.js.map +1 -1
- package/dist/importer.d.ts.map +1 -1
- package/dist/importer.js +253 -8
- package/dist/importer.js.map +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/join-coverage.d.ts +12 -0
- package/dist/join-coverage.d.ts.map +1 -0
- package/dist/join-coverage.js +37 -0
- package/dist/join-coverage.js.map +1 -0
- package/dist/jwt.d.ts.map +1 -1
- package/dist/jwt.js +5 -1
- package/dist/jwt.js.map +1 -1
- package/dist/launch-context.js +2 -2
- package/dist/launch-context.js.map +1 -1
- package/dist/mutate-batching.d.ts +25 -2
- package/dist/mutate-batching.d.ts.map +1 -1
- package/dist/mutate-batching.js +57 -10
- package/dist/mutate-batching.js.map +1 -1
- package/dist/open-document.d.ts +15 -1
- package/dist/open-document.d.ts.map +1 -1
- package/dist/open-document.js +1851 -321
- package/dist/open-document.js.map +1 -1
- package/dist/presence.d.ts +28 -0
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +149 -7
- package/dist/presence.js.map +1 -1
- package/dist/record-paging.d.ts +336 -71
- package/dist/record-paging.d.ts.map +1 -1
- package/dist/record-paging.js +591 -127
- package/dist/record-paging.js.map +1 -1
- package/dist/selection-persistence.d.ts.map +1 -1
- package/dist/selection-persistence.js +11 -1
- package/dist/selection-persistence.js.map +1 -1
- package/dist/serializer.d.ts +30 -1
- package/dist/serializer.d.ts.map +1 -1
- package/dist/session-persistence.d.ts.map +1 -1
- package/dist/session-persistence.js +9 -8
- package/dist/session-persistence.js.map +1 -1
- package/dist/session-toolbar.d.ts +0 -1
- package/dist/session-toolbar.d.ts.map +1 -1
- package/dist/session-toolbar.js +226 -75
- package/dist/session-toolbar.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +87 -18
- package/dist/session.js.map +1 -1
- package/dist/tail-ops.d.ts +14 -4
- package/dist/tail-ops.d.ts.map +1 -1
- package/dist/tail-ops.js +75 -15
- package/dist/tail-ops.js.map +1 -1
- package/dist/topic-lifecycle.d.ts +4 -0
- package/dist/topic-lifecycle.d.ts.map +1 -1
- package/dist/topic-lifecycle.js +25 -1
- package/dist/topic-lifecycle.js.map +1 -1
- package/dist/types.d.ts +47 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/undo.d.ts +2 -3
- package/dist/undo.d.ts.map +1 -1
- package/dist/undo.js +11 -0
- package/dist/undo.js.map +1 -1
- package/dist/unload-guard.d.ts +5 -0
- package/dist/unload-guard.d.ts.map +1 -0
- package/dist/unload-guard.js +88 -0
- package/dist/unload-guard.js.map +1 -0
- package/dist/version-bar.d.ts +4 -3
- package/dist/version-bar.d.ts.map +1 -1
- package/dist/version-bar.js +140 -19
- package/dist/version-bar.js.map +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/dist/vite.d.ts +18 -2
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +133 -8
- package/dist/vite.js.map +1 -1
- package/dist/ws-client.d.ts +23 -3
- package/dist/ws-client.d.ts.map +1 -1
- package/dist/ws-client.js +339 -89
- package/dist/ws-client.js.map +1 -1
- package/dist/ws-frame-limit.d.ts.map +1 -1
- package/dist/ws-frame-limit.js +19 -12
- package/dist/ws-frame-limit.js.map +1 -1
- package/docs/app-manifest.md +7 -8
- package/docs/custom-chrome.md +17 -20
- package/docs/hosted-ui-advanced.md +14 -17
- package/docs/imported-documents.md +53 -197
- package/docs/presence.md +45 -21
- package/docs/schemas.md +12 -17
- package/docs/streams.md +55 -57
- package/package.json +4 -3
- package/src/auth-flow.ts +90 -23
- package/src/client.ts +225 -78
- package/src/document-engine.ts +15 -0
- package/src/document-signals.ts +7 -7
- package/src/document-streams.ts +95 -9
- package/src/documents-namespace.ts +18 -3
- package/src/documents.ts +983 -277
- package/src/embed-protocol.ts +25 -0
- package/src/emitter.ts +8 -1
- package/src/export-guest.ts +15 -9
- package/src/fetch-deadline.ts +119 -0
- package/src/fetch-retry.ts +14 -5
- package/src/handle-types.ts +303 -0
- package/src/handles.ts +3406 -683
- package/src/hosted-runtime.ts +8 -12
- package/src/hosted-ui.ts +28 -32
- package/src/importer.ts +261 -8
- package/src/index.ts +29 -18
- package/src/internal.ts +1 -0
- package/src/join-coverage.ts +42 -0
- package/src/jwt.ts +8 -1
- package/src/launch-context.ts +2 -2
- package/src/mutate-batching.ts +60 -11
- package/src/open-document.ts +2355 -515
- package/src/presence.ts +210 -11
- package/src/record-paging.ts +687 -137
- package/src/selection-persistence.ts +10 -1
- package/src/serializer.ts +33 -1
- package/src/session-persistence.ts +9 -8
- package/src/session-toolbar.ts +249 -80
- package/src/session.ts +91 -17
- package/src/tail-ops.ts +76 -10
- package/src/topic-lifecycle.ts +31 -1
- package/src/types.ts +56 -4
- package/src/undo.ts +13 -5
- package/src/unload-guard.ts +91 -0
- package/src/version-bar.ts +163 -25
- package/src/version.ts +1 -1
- package/src/vite.ts +175 -10
- package/src/ws-client.ts +392 -92
- package/src/ws-frame-limit.ts +19 -12
package/dist/version-bar.js
CHANGED
|
@@ -9,12 +9,21 @@
|
|
|
9
9
|
// grow with no SDK or app change.
|
|
10
10
|
//
|
|
11
11
|
// Bridge protocol (shared envelope `__brass_embed: 1`):
|
|
12
|
-
// host -> iframe: init{surface,params}
|
|
13
|
-
//
|
|
14
|
-
//
|
|
12
|
+
// host -> iframe: init{surface,params}
|
|
13
|
+
// | version-changed{version, requestId?, ok?}
|
|
14
|
+
// iframe -> host: ready | resize{height} | preview{version, requestId?}
|
|
15
|
+
// | return-to-head{requestId?} | fork{fromVersion} | browse
|
|
15
16
|
// | error{code,message}
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
//
|
|
18
|
+
// A navigating intent (`preview` / `return-to-head`) is CONFIRMED: the host
|
|
19
|
+
// awaits the document method it routes to and answers with the version the
|
|
20
|
+
// document actually shows afterwards, plus whether the intent was accepted.
|
|
21
|
+
// The bar moves optimistically on the click, so without that answer a refused
|
|
22
|
+
// checkout (a document pinned to a version, a materialise that failed) leaves
|
|
23
|
+
// it naming a version nothing is showing, and nothing later corrects it: the
|
|
24
|
+
// host's own re-render is driven by the session, which does not notify on a
|
|
25
|
+
// preview -> preview step.
|
|
26
|
+
import { EMBED_ENVELOPE, EMBED_PROTOCOL_VERSION } from './embed-protocol.js';
|
|
18
27
|
// Collapsed until the embed reports `ready`, so the load moment shows a
|
|
19
28
|
// themed placeholder strip rather than an empty white iframe (no flash, no
|
|
20
29
|
// layout jump: the placeholder reserves the strip's height).
|
|
@@ -26,6 +35,9 @@ function clampHeight(h) {
|
|
|
26
35
|
return READY_HEIGHT;
|
|
27
36
|
return Math.max(MIN_HEIGHT, Math.min(MAX_HEIGHT, Math.round(h)));
|
|
28
37
|
}
|
|
38
|
+
// How long the embed has to say it is ready before the SDK-drawn fallback
|
|
39
|
+
// takes the strip. Matches the hosted-UI launcher's own long window.
|
|
40
|
+
const VERSION_BAR_READY_TIMEOUT_MS = 10_000;
|
|
29
41
|
export function createVersionBarFrame(root, deps) {
|
|
30
42
|
const origin = new URL(deps.dashboardBaseUrl).origin;
|
|
31
43
|
const base = deps.dashboardBaseUrl.replace(/\/$/, '');
|
|
@@ -35,6 +47,35 @@ export function createVersionBarFrame(root, deps) {
|
|
|
35
47
|
const placeholder = document.createElement('div');
|
|
36
48
|
placeholder.className = 'b-version-loading';
|
|
37
49
|
placeholder.textContent = 'Loading version controls...';
|
|
50
|
+
// Shown when the embed reports it cannot render (not signed in in this
|
|
51
|
+
// framing context, an account mismatch). The bar is the only surface that
|
|
52
|
+
// returns a document to its live head, so collapsing the strip on that
|
|
53
|
+
// failure would leave the reader in a read-only preview with nothing to
|
|
54
|
+
// leave it by; this carries the two controls that need no timeline.
|
|
55
|
+
const fallback = document.createElement('div');
|
|
56
|
+
fallback.className = 'b-version-fallback';
|
|
57
|
+
fallback.hidden = true;
|
|
58
|
+
const fallbackText = document.createElement('span');
|
|
59
|
+
fallbackText.className = 'b-version-fallback-msg';
|
|
60
|
+
const fallbackHead = document.createElement('button');
|
|
61
|
+
fallbackHead.type = 'button';
|
|
62
|
+
fallbackHead.textContent = 'Return to latest';
|
|
63
|
+
fallbackHead.onclick = () => {
|
|
64
|
+
void deps.returnToHead().catch(() => { });
|
|
65
|
+
};
|
|
66
|
+
const fallbackClose = document.createElement('button');
|
|
67
|
+
fallbackClose.type = 'button';
|
|
68
|
+
fallbackClose.textContent = 'Close';
|
|
69
|
+
fallbackClose.onclick = () => deps.close();
|
|
70
|
+
fallback.append(fallbackText, fallbackHead, fallbackClose);
|
|
71
|
+
function renderFallback() {
|
|
72
|
+
const pinned = ctx?.pinned === true;
|
|
73
|
+
const previewing = deps.currentVersion() !== null;
|
|
74
|
+
fallbackText.textContent = previewing
|
|
75
|
+
? 'Viewing an earlier version'
|
|
76
|
+
: 'Latest version';
|
|
77
|
+
fallbackHead.hidden = !previewing || pinned;
|
|
78
|
+
}
|
|
38
79
|
const iframe = document.createElement('iframe');
|
|
39
80
|
const url = new URL(`${base}/embed/version-bar`);
|
|
40
81
|
url.searchParams.set('theme', theme);
|
|
@@ -48,9 +89,46 @@ export function createVersionBarFrame(root, deps) {
|
|
|
48
89
|
colorScheme: theme === 'auto' ? 'light dark' : theme,
|
|
49
90
|
background: 'transparent',
|
|
50
91
|
});
|
|
51
|
-
root.append(placeholder, iframe);
|
|
92
|
+
root.append(placeholder, fallback, iframe);
|
|
52
93
|
let ctx = null;
|
|
53
94
|
let ready = false;
|
|
95
|
+
// Set once the embed reports it cannot render, so the fallback strip owns
|
|
96
|
+
// the surface and a later `update` does not restore the dead iframe.
|
|
97
|
+
let failed = false;
|
|
98
|
+
let destroyed = false;
|
|
99
|
+
// Armed whenever the iframe is pointed at the embed. Returning a document to
|
|
100
|
+
// its live head is this bar's exclusive capability, so an embed that never
|
|
101
|
+
// loads at all (a host CSP that refuses the frame, an offline reader, a
|
|
102
|
+
// blocking extension) would otherwise leave the placeholder up forever and
|
|
103
|
+
// the reader in a read-only preview with no control to leave it by. The
|
|
104
|
+
// `error` message covers an embed that loaded and refused; nothing covers
|
|
105
|
+
// one that never answers, which is why this is a timer rather than a
|
|
106
|
+
// handler.
|
|
107
|
+
let readyTimer;
|
|
108
|
+
// Hand the strip to the SDK-drawn fallback, which carries the two controls
|
|
109
|
+
// that need no timeline (return to latest, close).
|
|
110
|
+
function enterFallback() {
|
|
111
|
+
if (destroyed || failed)
|
|
112
|
+
return;
|
|
113
|
+
failed = true;
|
|
114
|
+
if (readyTimer !== undefined) {
|
|
115
|
+
clearTimeout(readyTimer);
|
|
116
|
+
readyTimer = undefined;
|
|
117
|
+
}
|
|
118
|
+
placeholder.style.display = 'none';
|
|
119
|
+
iframe.style.height = '0';
|
|
120
|
+
fallback.hidden = false;
|
|
121
|
+
renderFallback();
|
|
122
|
+
}
|
|
123
|
+
function armReadyTimer() {
|
|
124
|
+
if (readyTimer !== undefined)
|
|
125
|
+
clearTimeout(readyTimer);
|
|
126
|
+
readyTimer = setTimeout(() => {
|
|
127
|
+
readyTimer = undefined;
|
|
128
|
+
if (!ready)
|
|
129
|
+
enterFallback();
|
|
130
|
+
}, VERSION_BAR_READY_TIMEOUT_MS);
|
|
131
|
+
}
|
|
54
132
|
// The version last delivered to the embed (via `init` or `version-changed`).
|
|
55
133
|
// The host re-renders on many events (a commit, a saving-count bump, ...),
|
|
56
134
|
// each calling `update`, but only an ACTUAL version change should reach the
|
|
@@ -58,11 +136,10 @@ export function createVersionBarFrame(root, deps) {
|
|
|
58
136
|
// stale one clobber its optimistic state; `undefined` = nothing delivered yet.
|
|
59
137
|
let deliveredVersion = undefined;
|
|
60
138
|
function postInit() {
|
|
61
|
-
const sid = deps.getSessionToken?.();
|
|
62
139
|
if (!ctx)
|
|
63
140
|
return;
|
|
64
141
|
iframe.contentWindow?.postMessage({
|
|
65
|
-
[
|
|
142
|
+
[EMBED_ENVELOPE]: EMBED_PROTOCOL_VERSION,
|
|
66
143
|
type: 'init',
|
|
67
144
|
surface: 'version-bar',
|
|
68
145
|
params: {
|
|
@@ -70,22 +147,51 @@ export function createVersionBarFrame(root, deps) {
|
|
|
70
147
|
...(ctx.branch !== undefined ? { branch: ctx.branch } : {}),
|
|
71
148
|
version: ctx.version,
|
|
72
149
|
...(ctx.branchName !== undefined ? { branchName: ctx.branchName } : {}),
|
|
73
|
-
...(
|
|
150
|
+
...(ctx.pinned ? { pinned: true } : {}),
|
|
74
151
|
},
|
|
75
152
|
}, origin);
|
|
76
153
|
deliveredVersion = ctx.version;
|
|
77
154
|
}
|
|
155
|
+
// Answer a navigating intent with what the document shows now. `ok` is
|
|
156
|
+
// whether the intent itself was accepted, which the version alone cannot
|
|
157
|
+
// say: a checkout the server rounded down and one that was refused both
|
|
158
|
+
// report a version other than the requested one, and the bar keeps the
|
|
159
|
+
// reader's step position for the first and reverts it for the second.
|
|
160
|
+
function confirmIntent(requestId, ok) {
|
|
161
|
+
// An intent settles a turn after it was routed, by which time the bar may
|
|
162
|
+
// have been torn down (the reader closed it, the document changed). There
|
|
163
|
+
// is nothing listening then, and posting into a removed frame is an error
|
|
164
|
+
// that would surface as an unhandled rejection in the app.
|
|
165
|
+
if (!ready || destroyed)
|
|
166
|
+
return;
|
|
167
|
+
const version = deps.currentVersion();
|
|
168
|
+
deliveredVersion = version;
|
|
169
|
+
iframe.contentWindow?.postMessage({
|
|
170
|
+
[EMBED_ENVELOPE]: EMBED_PROTOCOL_VERSION,
|
|
171
|
+
type: 'version-changed',
|
|
172
|
+
version,
|
|
173
|
+
ok,
|
|
174
|
+
...(typeof requestId === 'string' ? { requestId } : {}),
|
|
175
|
+
}, origin);
|
|
176
|
+
}
|
|
177
|
+
function runIntent(requestId, intent) {
|
|
178
|
+
void intent().then(() => confirmIntent(requestId, true), () => confirmIntent(requestId, false));
|
|
179
|
+
}
|
|
78
180
|
function onMessage(event) {
|
|
79
181
|
if (event.origin !== origin)
|
|
80
182
|
return;
|
|
81
183
|
if (event.source !== iframe.contentWindow)
|
|
82
184
|
return;
|
|
83
185
|
const data = event.data;
|
|
84
|
-
if (!data || data[
|
|
186
|
+
if (!data || data[EMBED_ENVELOPE] !== EMBED_PROTOCOL_VERSION)
|
|
85
187
|
return;
|
|
86
188
|
switch (data['type']) {
|
|
87
189
|
case 'ready': {
|
|
88
190
|
ready = true;
|
|
191
|
+
if (readyTimer !== undefined) {
|
|
192
|
+
clearTimeout(readyTimer);
|
|
193
|
+
readyTimer = undefined;
|
|
194
|
+
}
|
|
89
195
|
placeholder.style.display = 'none';
|
|
90
196
|
iframe.style.height = `${READY_HEIGHT}px`;
|
|
91
197
|
postInit();
|
|
@@ -100,12 +206,12 @@ export function createVersionBarFrame(root, deps) {
|
|
|
100
206
|
case 'preview': {
|
|
101
207
|
const v = data['version'];
|
|
102
208
|
if (typeof v === 'number' && Number.isInteger(v) && v >= 0) {
|
|
103
|
-
deps.checkoutVersion(v);
|
|
209
|
+
runIntent(data['requestId'], () => deps.checkoutVersion(v));
|
|
104
210
|
}
|
|
105
211
|
break;
|
|
106
212
|
}
|
|
107
213
|
case 'return-to-head': {
|
|
108
|
-
deps.returnToHead();
|
|
214
|
+
runIntent(data['requestId'], () => deps.returnToHead());
|
|
109
215
|
break;
|
|
110
216
|
}
|
|
111
217
|
case 'fork': {
|
|
@@ -125,15 +231,16 @@ export function createVersionBarFrame(root, deps) {
|
|
|
125
231
|
break;
|
|
126
232
|
}
|
|
127
233
|
case 'error': {
|
|
128
|
-
// The embed
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
placeholder.style.display = 'none';
|
|
132
|
-
iframe.style.height = '0';
|
|
234
|
+
// The embed loaded and reported it cannot render (not signed in in
|
|
235
|
+
// this context, an account mismatch).
|
|
236
|
+
enterFallback();
|
|
133
237
|
break;
|
|
134
238
|
}
|
|
135
239
|
}
|
|
136
240
|
}
|
|
241
|
+
// Armed here rather than beside the `src` assignment above, which runs
|
|
242
|
+
// before `readyTimer` is initialised.
|
|
243
|
+
armReadyTimer();
|
|
137
244
|
window.addEventListener('message', onMessage);
|
|
138
245
|
return {
|
|
139
246
|
update(next) {
|
|
@@ -144,25 +251,39 @@ export function createVersionBarFrame(root, deps) {
|
|
|
144
251
|
// just pushes the new version down.
|
|
145
252
|
if (prev && (prev.docId !== next.docId || prev.branch !== next.branch)) {
|
|
146
253
|
// Reload the iframe: reset ready, restore the placeholder, and the
|
|
147
|
-
// new page will `ready` -> we re-`init` with the new context.
|
|
254
|
+
// new page will `ready` -> we re-`init` with the new context. A fresh
|
|
255
|
+
// page gets a fresh verdict, so the failed state resets with it.
|
|
148
256
|
ready = false;
|
|
257
|
+
failed = false;
|
|
149
258
|
deliveredVersion = undefined;
|
|
259
|
+
fallback.hidden = true;
|
|
150
260
|
placeholder.style.display = '';
|
|
151
261
|
iframe.style.height = '0';
|
|
152
262
|
iframe.src = url.toString();
|
|
263
|
+
armReadyTimer();
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (failed) {
|
|
267
|
+
renderFallback();
|
|
153
268
|
return;
|
|
154
269
|
}
|
|
155
270
|
// Only an actual version change reaches the embed (dedup), so a
|
|
156
271
|
// re-render that didn't move the version can't clobber the bar's state.
|
|
157
272
|
if (ready && next.version !== deliveredVersion) {
|
|
158
273
|
deliveredVersion = next.version;
|
|
159
|
-
iframe.contentWindow?.postMessage({ [
|
|
274
|
+
iframe.contentWindow?.postMessage({ [EMBED_ENVELOPE]: EMBED_PROTOCOL_VERSION, type: 'version-changed', version: next.version }, origin);
|
|
160
275
|
}
|
|
161
276
|
},
|
|
162
277
|
destroy() {
|
|
278
|
+
destroyed = true;
|
|
279
|
+
if (readyTimer !== undefined) {
|
|
280
|
+
clearTimeout(readyTimer);
|
|
281
|
+
readyTimer = undefined;
|
|
282
|
+
}
|
|
163
283
|
window.removeEventListener('message', onMessage);
|
|
164
284
|
iframe.remove();
|
|
165
285
|
placeholder.remove();
|
|
286
|
+
fallback.remove();
|
|
166
287
|
},
|
|
167
288
|
};
|
|
168
289
|
}
|
package/dist/version-bar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-bar.js","sourceRoot":"","sources":["../src/version-bar.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAqE;AACrE,yEAAyE;AACzE,4EAA4E;AAC5E,kCAAkC;AAClC,EAAE;AACF,wDAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"version-bar.js","sourceRoot":"","sources":["../src/version-bar.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAqE;AACrE,yEAAyE;AACzE,4EAA4E;AAC5E,kCAAkC;AAClC,EAAE;AACF,wDAAwD;AACxD,0CAA0C;AAC1C,iEAAiE;AACjE,2EAA2E;AAC3E,+EAA+E;AAC/E,2CAA2C;AAC3C,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,2BAA2B;AAE3B,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,wEAAwE;AACxE,2EAA2E;AAC3E,6DAA6D;AAC7D,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,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;YACT,CAAC;YACD,gEAAgE;YAChE,wEAAwE;YACxE,IAAI,KAAK,IAAI,IAAI,CAAC,OAAO,KAAK,gBAAgB,EAAE,CAAC;gBAC/C,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC;gBAChC,MAAM,CAAC,aAAa,EAAE,WAAW,CAC/B,EAAE,CAAC,cAAc,CAAC,EAAE,sBAAsB,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAC5F,MAAM,CACP,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO;YACL,SAAS,GAAG,IAAI,CAAC;YACjB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;gBAC7B,YAAY,CAAC,UAAU,CAAC,CAAC;gBACzB,UAAU,GAAG,SAAS,CAAC;YACzB,CAAC;YACD,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACjD,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,MAAM,EAAE,CAAC;YACrB,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
2
|
-
export declare const SDK_CLIENT_ID = "sdk/0.
|
|
1
|
+
export declare const SDK_VERSION = "0.2.0";
|
|
2
|
+
export declare const SDK_CLIENT_ID = "sdk/0.2.0";
|
|
3
3
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
// can measure the version distribution of deployed apps and time
|
|
4
4
|
// compatibility windows against it. A unit test pins this to
|
|
5
5
|
// package.json's version; the release bump touches both together.
|
|
6
|
-
export const SDK_VERSION = '0.
|
|
6
|
+
export const SDK_VERSION = '0.2.0';
|
|
7
7
|
export const SDK_CLIENT_ID = `sdk/${SDK_VERSION}`;
|
|
8
8
|
//# sourceMappingURL=version.js.map
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
+
interface ViteAliasEntry {
|
|
2
|
+
find: string | RegExp;
|
|
3
|
+
replacement: string;
|
|
4
|
+
}
|
|
5
|
+
interface ViteBuildOptions {
|
|
6
|
+
target?: string | string[] | false;
|
|
7
|
+
}
|
|
1
8
|
interface ViteUserConfig {
|
|
9
|
+
build?: ViteBuildOptions;
|
|
10
|
+
environments?: {
|
|
11
|
+
client?: {
|
|
12
|
+
build?: ViteBuildOptions;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
resolve?: {
|
|
16
|
+
alias?: Record<string, string> | readonly ViteAliasEntry[];
|
|
17
|
+
};
|
|
2
18
|
optimizeDeps?: {
|
|
3
19
|
exclude?: string[];
|
|
4
20
|
esbuildOptions?: {
|
|
5
|
-
target?: string;
|
|
21
|
+
target?: string | string[];
|
|
6
22
|
};
|
|
7
23
|
};
|
|
8
24
|
}
|
|
9
25
|
interface VitePlugin {
|
|
10
26
|
name: string;
|
|
11
|
-
config(config: ViteUserConfig): ViteUserConfig
|
|
27
|
+
config(config: ViteUserConfig): Promise<ViteUserConfig>;
|
|
12
28
|
}
|
|
13
29
|
export declare function brassVite(): VitePlugin;
|
|
14
30
|
export {};
|
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AA+CA,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;CACpC;AAED,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAGzB,YAAY,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;SAAE,CAAA;KAAE,CAAC;IACzD,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,cAAc,EAAE,CAAC;KAC5D,CAAC;IACF,YAAY,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,cAAc,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;SAAE,CAAC;KACjD,CAAC;CACH;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACzD;AAoGD,wBAAgB,SAAS,IAAI,UAAU,CAwCtC"}
|
package/dist/vite.js
CHANGED
|
@@ -8,23 +8,148 @@
|
|
|
8
8
|
// plugin excludes the dep from prebundling (leaving it for the build-time
|
|
9
9
|
// WASM loaders) and bumps the prebundle target to es2022.
|
|
10
10
|
//
|
|
11
|
-
// `vite-plugin-wasm`
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// installed during a migration window needs both
|
|
16
|
-
|
|
11
|
+
// `vite-plugin-wasm` remains the caller's responsibility: it must land before
|
|
12
|
+
// `brassVite()` in the plugin list.
|
|
13
|
+
// Every WASM-shipping dep the SDK pulls in, and the entry that loads it
|
|
14
|
+
// asynchronously. Add an entry rather than replacing the list: a consumer who
|
|
15
|
+
// has two installed during a migration window needs both handled, and this is
|
|
16
|
+
// the one place any of them is named, so an app's own config never is.
|
|
17
|
+
//
|
|
18
|
+
// A default browser entry fetches its module with a SYNCHRONOUS
|
|
19
|
+
// XMLHttpRequest while it evaluates, so an app freezes its main thread for the
|
|
20
|
+
// whole download before it paints, whether or not anyone opens a document, and
|
|
21
|
+
// the freeze grows with the reader's latency rather than with the app. An
|
|
22
|
+
// `asyncEntry` hands the same module to the bundler's own asset pipeline,
|
|
23
|
+
// which loads it asynchronously and leaves the main thread free. Selecting one
|
|
24
|
+
// emits a top-level await, so it is reachable only on a build target that
|
|
25
|
+
// accepts one, and the synchronous entry is what keeps every other target
|
|
26
|
+
// building.
|
|
27
|
+
const WASM_DEPS = [
|
|
28
|
+
{ specifier: 'loro-crdt', asyncEntry: 'loro-crdt/bundler' },
|
|
29
|
+
];
|
|
30
|
+
// A specifier matched whole. A string `find` matches by prefix, which would
|
|
31
|
+
// also catch the async entry the alias points AT and resolve it to itself.
|
|
32
|
+
const wholeSpecifier = (specifier) => new RegExp(`^${specifier.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}$`);
|
|
33
|
+
// Vite 8 prebundles with rolldown, which handles top-level await on its own
|
|
34
|
+
// and deprecates `optimizeDeps.esbuildOptions`. Setting it there does nothing
|
|
35
|
+
// except print a deprecation warning naming this plugin, on every `vite dev`
|
|
36
|
+
// and every `vite build` a consumer runs. Read from the running Vite rather
|
|
37
|
+
// than from the consumer's manifest, and treat an unreadable version as an
|
|
38
|
+
// older Vite, where the target bump is what makes the WASM dep load at all.
|
|
39
|
+
//
|
|
40
|
+
// The specifier is held in a variable so `tsc` does not resolve it. Vite is
|
|
41
|
+
// neither a dependency nor a peer dependency here (the config shapes above are
|
|
42
|
+
// declared for the same reason), so a literal specifier fails the build
|
|
43
|
+
// wherever Vite is absent, which includes `npm install` in this package
|
|
44
|
+
// itself. At runtime the import reaches the Vite running the build.
|
|
45
|
+
const VITE_PACKAGE = 'vite';
|
|
46
|
+
async function viteMajor() {
|
|
47
|
+
try {
|
|
48
|
+
const { version } = (await import(VITE_PACKAGE));
|
|
49
|
+
const major = Number.parseInt(version ?? '', 10);
|
|
50
|
+
return Number.isFinite(major) ? major : null;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Browser versions that first shipped top-level await, by the engine names
|
|
57
|
+
// esbuild accepts in a target string. A target naming an engine absent here is
|
|
58
|
+
// read as unsupported.
|
|
59
|
+
const TOP_LEVEL_AWAIT_SINCE = {
|
|
60
|
+
chrome: 89,
|
|
61
|
+
edge: 89,
|
|
62
|
+
firefox: 89,
|
|
63
|
+
safari: 15,
|
|
64
|
+
ios: 15,
|
|
65
|
+
opera: 75,
|
|
66
|
+
node: 14.8,
|
|
67
|
+
es: 2022,
|
|
68
|
+
hermes: Number.POSITIVE_INFINITY,
|
|
69
|
+
ie: Number.POSITIVE_INFINITY,
|
|
70
|
+
};
|
|
71
|
+
// Vite's own named targets. `modules` (the Vite 5 / 6 default) resolves to
|
|
72
|
+
// browsers predating top-level await; `baseline-widely-available` (the Vite 7 /
|
|
73
|
+
// 8 default) resolves to ones that carry it.
|
|
74
|
+
const NAMED_TARGET_SUPPORT = {
|
|
75
|
+
esnext: true,
|
|
76
|
+
'baseline-widely-available': true,
|
|
77
|
+
modules: false,
|
|
78
|
+
};
|
|
79
|
+
function targetSupportsTopLevelAwait(target) {
|
|
80
|
+
const t = target.trim().toLowerCase();
|
|
81
|
+
const named = NAMED_TARGET_SUPPORT[t];
|
|
82
|
+
if (named !== undefined)
|
|
83
|
+
return named;
|
|
84
|
+
const parsed = /^([a-z]+)([\d.]+)$/.exec(t);
|
|
85
|
+
if (!parsed)
|
|
86
|
+
return false;
|
|
87
|
+
const since = TOP_LEVEL_AWAIT_SINCE[parsed[1]];
|
|
88
|
+
if (since === undefined)
|
|
89
|
+
return false;
|
|
90
|
+
const version = Number.parseFloat(parsed[2]);
|
|
91
|
+
return Number.isFinite(version) && version >= since;
|
|
92
|
+
}
|
|
93
|
+
// Whether the build this plugin is configuring can carry a top-level await.
|
|
94
|
+
// An unreadable or unrecognised target answers `false`, so the worst a wrong
|
|
95
|
+
// reading costs is the synchronous entry a consumer already has.
|
|
96
|
+
function buildAcceptsTopLevelAwait(config, major) {
|
|
97
|
+
const target = config.environments?.client?.build?.target ?? config.build?.target;
|
|
98
|
+
// No explicit target: the answer is Vite's own default, which carries
|
|
99
|
+
// top-level await from Vite 7 (`baseline-widely-available`) and not before
|
|
100
|
+
// (`modules`).
|
|
101
|
+
if (target === undefined)
|
|
102
|
+
return major !== null && major >= 7;
|
|
103
|
+
if (target === false)
|
|
104
|
+
return false;
|
|
105
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
106
|
+
return targets.length > 0 && targets.every(targetSupportsTopLevelAwait);
|
|
107
|
+
}
|
|
108
|
+
// A consumer who already resolves the WASM dep themselves owns that decision,
|
|
109
|
+
// so the plugin adds nothing that would take it over.
|
|
110
|
+
function aliasesWasmDep(config) {
|
|
111
|
+
const alias = config.resolve?.alias;
|
|
112
|
+
if (!alias)
|
|
113
|
+
return false;
|
|
114
|
+
const specifiers = WASM_DEPS.map((dep) => dep.specifier);
|
|
115
|
+
if (Array.isArray(alias)) {
|
|
116
|
+
return alias.some((entry) => specifiers.some((specifier) => typeof entry.find === 'string'
|
|
117
|
+
? entry.find === specifier
|
|
118
|
+
: entry.find.test(specifier)));
|
|
119
|
+
}
|
|
120
|
+
return Object.keys(alias).some((key) => specifiers.includes(key));
|
|
121
|
+
}
|
|
17
122
|
export function brassVite() {
|
|
18
123
|
return {
|
|
19
124
|
name: 'brass-build:vite',
|
|
20
|
-
config(config) {
|
|
125
|
+
async config(config) {
|
|
126
|
+
const major = await viteMajor();
|
|
127
|
+
const useAsyncEntry = buildAcceptsTopLevelAwait(config, major) && !aliasesWasmDep(config);
|
|
21
128
|
const existingExclude = config.optimizeDeps?.exclude ?? [];
|
|
22
|
-
const exclude = Array.from(new Set([
|
|
129
|
+
const exclude = Array.from(new Set([
|
|
130
|
+
...existingExclude,
|
|
131
|
+
...WASM_DEPS.map((dep) => dep.specifier),
|
|
132
|
+
...(useAsyncEntry ? WASM_DEPS.map((dep) => dep.asyncEntry) : []),
|
|
133
|
+
]));
|
|
134
|
+
const resolve = useAsyncEntry
|
|
135
|
+
? {
|
|
136
|
+
resolve: {
|
|
137
|
+
alias: WASM_DEPS.map((dep) => ({
|
|
138
|
+
find: wholeSpecifier(dep.specifier),
|
|
139
|
+
replacement: dep.asyncEntry,
|
|
140
|
+
})),
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
: {};
|
|
144
|
+
if (major !== null && major >= 8) {
|
|
145
|
+
return { ...resolve, optimizeDeps: { exclude } };
|
|
146
|
+
}
|
|
23
147
|
const existingTarget = config.optimizeDeps?.esbuildOptions?.target;
|
|
24
148
|
// Don't downgrade if a consumer has already pinned a newer
|
|
25
149
|
// target; only raise from the Vite default (which lacks TLA).
|
|
26
150
|
const target = existingTarget ?? 'es2022';
|
|
27
151
|
return {
|
|
152
|
+
...resolve,
|
|
28
153
|
optimizeDeps: {
|
|
29
154
|
exclude,
|
|
30
155
|
esbuildOptions: { target },
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,kEAAkE;AAClE,oBAAoB;AACpB,EAAE;AACF,4EAA4E;AAC5E,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,0DAA0D;AAC1D,EAAE;AACF,2EAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,kEAAkE;AAClE,oBAAoB;AACpB,EAAE;AACF,4EAA4E;AAC5E,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,0DAA0D;AAC1D,EAAE;AACF,8EAA8E;AAC9E,oCAAoC;AAEpC,wEAAwE;AACxE,8EAA8E;AAC9E,8EAA8E;AAC9E,uEAAuE;AACvE,EAAE;AACF,gEAAgE;AAChE,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,0E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;iBAC3B;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/ws-client.d.ts
CHANGED
|
@@ -8,6 +8,15 @@ interface WsClientOptions {
|
|
|
8
8
|
fireError: (error: Error) => void;
|
|
9
9
|
}
|
|
10
10
|
export type WsTopicCallback = (frame: unknown) => void;
|
|
11
|
+
export interface SubscribeOptions {
|
|
12
|
+
onSubscribed?: (info: {
|
|
13
|
+
resubscribed: boolean;
|
|
14
|
+
}) => void;
|
|
15
|
+
onEnded?: (info: {
|
|
16
|
+
reason: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
ownsFrameRetry?: boolean;
|
|
19
|
+
}
|
|
11
20
|
export declare class BrassWsClient {
|
|
12
21
|
private readonly opts;
|
|
13
22
|
private ws;
|
|
@@ -17,17 +26,20 @@ export declare class BrassWsClient {
|
|
|
17
26
|
private listeners;
|
|
18
27
|
private outboundQueue;
|
|
19
28
|
private pendingTopicSends;
|
|
29
|
+
private ownFrameRetryTopics;
|
|
20
30
|
private heldOverflowReported;
|
|
21
|
-
private
|
|
22
|
-
private
|
|
31
|
+
private failedAttempts;
|
|
32
|
+
private reportedFailing;
|
|
33
|
+
private creditsThisSocket;
|
|
23
34
|
private reconnectTimer;
|
|
35
|
+
private socketsOpened;
|
|
24
36
|
private outboundOverflowReported;
|
|
25
37
|
private heartbeatTimer;
|
|
26
38
|
private closedByUser;
|
|
27
39
|
private visibilityListener;
|
|
28
40
|
private onlineListener;
|
|
29
41
|
constructor(opts: WsClientOptions);
|
|
30
|
-
subscribe(topic: string, callback: WsTopicCallback): () => void;
|
|
42
|
+
subscribe(topic: string, callback: WsTopicCallback, options?: SubscribeOptions): () => void;
|
|
31
43
|
private dispatch;
|
|
32
44
|
private runEffect;
|
|
33
45
|
send(frame: unknown): void;
|
|
@@ -38,9 +50,17 @@ export declare class BrassWsClient {
|
|
|
38
50
|
private onOpen;
|
|
39
51
|
private flushOutbound;
|
|
40
52
|
private onMessage;
|
|
53
|
+
private fanOut;
|
|
41
54
|
private onClose;
|
|
55
|
+
private reportFailing;
|
|
42
56
|
private scheduleReconnect;
|
|
43
57
|
private resume;
|
|
58
|
+
/** Reconnects this client has made: every socket after the first. */
|
|
59
|
+
get reconnectCount(): number;
|
|
60
|
+
/** Whether the page is hidden right now. */
|
|
61
|
+
get pageHidden(): boolean;
|
|
62
|
+
/** Whether a socket is open right now. */
|
|
63
|
+
get connected(): boolean;
|
|
44
64
|
private isHidden;
|
|
45
65
|
private ensureLifecycleListeners;
|
|
46
66
|
private removeLifecycleListeners;
|
package/dist/ws-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws-client.d.ts","sourceRoot":"","sources":["../src/ws-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ws-client.d.ts","sourceRoot":"","sources":["../src/ws-client.ts"],"names":[],"mappings":"AAkCA,UAAU,eAAe;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAQ7C,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAO/C,iBAAiB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAGxC,aAAa,CAAC,EAAE,OAAO,SAAS,CAAC;IAGjC,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AA+DvD,MAAM,WAAW,gBAAgB;IAO/B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,YAAY,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAYzD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,C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