@scayle/storefront-devtools 0.2.0-alpha.4 → 0.2.0-alpha.6
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/CHANGELOG.md +77 -0
- package/README.md +234 -111
- package/dist/_chunks/{coalesce-D-Q8NzYg.mjs → coalesce-PetLUcf2.mjs} +388 -404
- package/dist/_chunks/frame-nav-DctWjxeG.mjs +3 -0
- package/dist/group.d.ts +14 -26
- package/dist/group.d.ts.map +1 -1
- package/dist/index.d.ts +29 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +80 -116
- package/dist/inertia/channel.d.ts +18 -5
- package/dist/inertia/channel.d.ts.map +1 -1
- package/dist/inertia/client/index.mjs +242 -210
- package/dist/inertia/client/messages.d.ts +28 -0
- package/dist/inertia/client/messages.d.ts.map +1 -0
- package/dist/inertia/client/publish.d.ts +4 -2
- package/dist/inertia/client/publish.d.ts.map +1 -1
- package/dist/inertia/core/capture.d.ts.map +1 -1
- package/dist/inertia/core/correlator.d.ts +16 -0
- package/dist/inertia/core/correlator.d.ts.map +1 -1
- package/dist/inertia/core/diagnostics.d.ts.map +1 -1
- package/dist/inertia/core/diff.d.ts +2 -1
- package/dist/inertia/core/diff.d.ts.map +1 -1
- package/dist/inertia/core/feature-info.d.ts +9 -5
- package/dist/inertia/core/feature-info.d.ts.map +1 -1
- package/dist/inertia/core/features.d.ts.map +1 -1
- package/dist/inertia/core/history-capture.d.ts.map +1 -1
- package/dist/inertia/core/interceptors.d.ts +1 -0
- package/dist/inertia/core/interceptors.d.ts.map +1 -1
- package/dist/inertia/core/markdown.d.ts.map +1 -1
- package/dist/inertia/core/protocol.d.ts +1 -1
- package/dist/inertia/core/protocol.d.ts.map +1 -1
- package/dist/inertia/core/request-filters.d.ts +19 -0
- package/dist/inertia/core/request-filters.d.ts.map +1 -0
- package/dist/inertia/core/request-tree.d.ts +6 -3
- package/dist/inertia/core/request-tree.d.ts.map +1 -1
- package/dist/inertia/core/response.d.ts +3 -2
- package/dist/inertia/core/response.d.ts.map +1 -1
- package/dist/inertia/core/store.d.ts +1 -0
- package/dist/inertia/core/store.d.ts.map +1 -1
- package/dist/inertia/core/types.d.ts +2 -2
- package/dist/inertia/core/types.d.ts.map +1 -1
- package/dist/inertia/core/url.d.ts +12 -0
- package/dist/inertia/core/url.d.ts.map +1 -1
- package/dist/inject.d.ts +3 -4
- package/dist/inject.d.ts.map +1 -1
- package/dist/og.d.ts +12 -0
- package/dist/og.d.ts.map +1 -0
- package/dist/orpc/channel.d.ts +9 -1
- package/dist/orpc/channel.d.ts.map +1 -1
- package/dist/orpc/client/index.mjs +118 -102
- package/dist/orpc/client/publish.d.ts +3 -1
- package/dist/orpc/client/publish.d.ts.map +1 -1
- package/dist/orpc/core/session.d.ts +1 -8
- package/dist/orpc/core/session.d.ts.map +1 -1
- package/dist/orpc/core/stats.d.ts +1 -1
- package/dist/orpc/core/stats.d.ts.map +1 -1
- package/dist/orpc/core/store.d.ts +1 -0
- package/dist/orpc/core/store.d.ts.map +1 -1
- package/dist/shared/clipboard.d.ts +23 -3
- package/dist/shared/clipboard.d.ts.map +1 -1
- package/dist/shared/panel-channel.d.ts +27 -1
- package/dist/shared/panel-channel.d.ts.map +1 -1
- package/dist/shared/prefs.d.ts +49 -0
- package/dist/shared/prefs.d.ts.map +1 -0
- package/dist/shared/redact.d.ts +6 -3
- package/dist/shared/redact.d.ts.map +1 -1
- package/dist/shared/safe-clone.d.ts +2 -1
- package/dist/shared/safe-clone.d.ts.map +1 -1
- package/dist/ui/assets/App-BDAG24ch.js +4 -0
- package/dist/ui/assets/App-CBJXphAE.css +1 -0
- package/dist/ui/assets/App-CoMIIpFn.js +5 -0
- package/dist/ui/assets/App-CrZKW7ZD.js +1 -0
- package/dist/ui/assets/App-D9h2xKeA.css +1 -0
- package/dist/ui/assets/App-DIxgDJPh.css +1 -0
- package/dist/ui/assets/HeadersTab-BAgPi_LJ.css +1 -0
- package/dist/ui/assets/HeadersTab-YiDZOc7w.js +1 -0
- package/dist/ui/assets/_plugin-vue_export-helper-DnlXueOW.js +2 -0
- package/dist/ui/assets/panels-BZNAuOBL.css +1 -0
- package/dist/ui/assets/panels-X7JpniLo.js +3 -0
- package/dist/ui/assets/store-CmrV1otI.js +1 -0
- package/dist/ui/panels/index.html +2 -3
- package/package.json +23 -26
- package/dist/inertia/plugin.d.ts +0 -13
- package/dist/inertia/plugin.d.ts.map +0 -1
- package/dist/orpc/plugin.d.ts +0 -13
- package/dist/orpc/plugin.d.ts.map +0 -1
- package/dist/storefront/plugin.d.ts +0 -11
- package/dist/storefront/plugin.d.ts.map +0 -1
- package/dist/ui/assets/App-BMyWBnLQ.js +0 -4
- package/dist/ui/assets/App-C5-JscO0.css +0 -1
- package/dist/ui/assets/App-CCUPtzNx.js +0 -5
- package/dist/ui/assets/App-Ct7Za--B.css +0 -1
- package/dist/ui/assets/App-Ctfis9Sq.js +0 -1
- package/dist/ui/assets/App-jiQKInbo.css +0 -1
- package/dist/ui/assets/_plugin-vue_export-helper-BDNMzG2s.js +0 -1
- package/dist/ui/assets/channel-D7V7aU79.js +0 -1
- package/dist/ui/assets/clipboard-BY7CN-yK.js +0 -1
- package/dist/ui/assets/clipboard-BnEeWyfh.css +0 -1
- package/dist/ui/assets/css-8QJvnqUH.js +0 -1
- package/dist/ui/assets/css-lJZLS6R3.js +0 -1
- package/dist/ui/assets/diff-woXpYk--.js +0 -1
- package/dist/ui/assets/html-GueGcY0x.js +0 -1
- package/dist/ui/assets/html-WzJrCOnD.js +0 -1
- package/dist/ui/assets/javascript-BzbQS41l.js +0 -1
- package/dist/ui/assets/javascript-CpIGwZ_Y.js +0 -1
- package/dist/ui/assets/json-B88Oqtu5.js +0 -1
- package/dist/ui/assets/json-C3WlssX3.js +0 -1
- package/dist/ui/assets/panel-channel-qxy-vGGq.js +0 -2
- package/dist/ui/assets/panels-B4LTsmli.css +0 -1
- package/dist/ui/assets/panels-BcOW2Xog.js +0 -2
- package/dist/ui/assets/preload-helper-CSlQMSTd.js +0 -2
- package/dist/ui/assets/shellscript-CLZ0U2zV.js +0 -1
- package/dist/ui/assets/typescript-Bb1J8qyy.js +0 -1
- package/dist/ui/assets/typescript-j_1H8WHN.js +0 -1
- package/dist/ui/assets/vitesse-dark-BZCL-v6S.js +0 -1
- package/dist/ui/assets/vitesse-light-VbXTXTou.js +0 -1
- package/dist/ui/assets/vue-B1Tf5CHw.js +0 -1
- package/dist/ui/assets/vue-C0gCEhF7.js +0 -155
- package/dist/ui/assets/vue-Kq4tvBbL.css +0 -1
- package/dist/ui/assets/vue-html-CGMs_6qn.js +0 -1
- package/dist/ui/assets/yaml-rwi0_p6S.js +0 -1
- package/dist/ui/vue/index.html +0 -15
- package/dist/vue-devtools/client/index.mjs +0 -4899
- package/dist/vue-devtools/client.d.ts +0 -2
- package/dist/vue-devtools/client.d.ts.map +0 -1
- package/dist/vue-devtools/plugin.d.ts +0 -15
- package/dist/vue-devtools/plugin.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, n as r, o as i, r as a, t as o } from "../../_chunks/coalesce-
|
|
2
|
-
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, t as o } from "../../_chunks/coalesce-PetLUcf2.mjs";
|
|
2
|
+
// src/orpc/core/session.ts
|
|
3
3
|
var s = t("orpc-devtools-session");
|
|
4
4
|
function c(e) {
|
|
5
5
|
return {
|
|
@@ -23,8 +23,7 @@ function u() {
|
|
|
23
23
|
function d() {
|
|
24
24
|
s.clear();
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
//#region src/orpc/core/store.ts
|
|
26
|
+
// src/orpc/core/store.ts
|
|
28
27
|
var f = 200, p = { redactKey: n };
|
|
29
28
|
function m(e) {
|
|
30
29
|
return i(e, p);
|
|
@@ -46,6 +45,9 @@ var g = class {
|
|
|
46
45
|
get calls() {
|
|
47
46
|
return this.ordered.slice();
|
|
48
47
|
}
|
|
48
|
+
getCall(e) {
|
|
49
|
+
return this.ordered.find((t) => t.id === e);
|
|
50
|
+
}
|
|
49
51
|
get paused() {
|
|
50
52
|
return this._paused;
|
|
51
53
|
}
|
|
@@ -73,7 +75,7 @@ var g = class {
|
|
|
73
75
|
return this.ordered.push(r), this.ordered.length > this.maxCalls && this.evictOldest(), this.notify(), n;
|
|
74
76
|
}
|
|
75
77
|
finishCall(e, t) {
|
|
76
|
-
let n = this.
|
|
78
|
+
let n = this.getCall(e);
|
|
77
79
|
n && (n.finishedAt = performance.now(), n.duration = n.finishedAt - n.startedAt, n.status = t.status, n.ok = t.ok, n.output = m(t.output), n.error = m(t.error), n.errorKind = t.errorKind, n.streaming = t.streaming, n.rawOutput = m(t.rawOutput), n.rawError = m(t.rawError), n.responseHeaders = t.responseHeaders, this.notify());
|
|
78
80
|
}
|
|
79
81
|
subscribe(e) {
|
|
@@ -116,8 +118,7 @@ function y(e) {
|
|
|
116
118
|
for (; t > 0 && e[t - 1] === "/";) t--;
|
|
117
119
|
return e.slice(0, t);
|
|
118
120
|
}
|
|
119
|
-
|
|
120
|
-
//#region src/orpc/core/classify.ts
|
|
121
|
+
// src/orpc/core/classify.ts
|
|
121
122
|
function b(e) {
|
|
122
123
|
if (typeof e == "object" && e && "code" in e) {
|
|
123
124
|
let t = e.code;
|
|
@@ -127,12 +128,17 @@ function b(e) {
|
|
|
127
128
|
function x(e, t, n) {
|
|
128
129
|
return n ? "network" : e === 422 || b(t) === "INPUT_VALIDATION_FAILED" ? "validation" : "server";
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
+
// ../../../node_modules/.pnpm/@orpc+shared@1.16.2_@opentelemetry+api@1.10.0/node_modules/@orpc/shared/dist/index.mjs
|
|
132
|
+
var S = 4300, C = /^-?(?:0|[1-9]\d*)$/;
|
|
133
|
+
function w(e, t) {
|
|
134
|
+
if (!((e.startsWith("-") ? e.length - 1 : e.length) > t || !C.test(e))) return BigInt(e);
|
|
135
|
+
}
|
|
136
|
+
function T(e) {
|
|
131
137
|
if (!e || typeof e != "object") return !1;
|
|
132
138
|
let t = Object.getPrototypeOf(e);
|
|
133
139
|
return t === Object.prototype || !t || !t.constructor;
|
|
134
140
|
}
|
|
135
|
-
function
|
|
141
|
+
function E(e, t, n) {
|
|
136
142
|
t === "__proto__" ? Object.defineProperty(e, t, {
|
|
137
143
|
value: n,
|
|
138
144
|
writable: !0,
|
|
@@ -140,20 +146,20 @@ function C(e, t, n) {
|
|
|
140
146
|
configurable: !0
|
|
141
147
|
}) : e[t] = n;
|
|
142
148
|
}
|
|
143
|
-
function
|
|
149
|
+
function D(e, t, n) {
|
|
144
150
|
let r = e[t];
|
|
145
151
|
if (r !== n) return r;
|
|
146
152
|
let i;
|
|
147
153
|
if (Array.isArray(r)) i = r.slice();
|
|
148
|
-
else if (
|
|
154
|
+
else if (T(r)) i = { ...r };
|
|
149
155
|
else return r;
|
|
150
|
-
return
|
|
156
|
+
return E(e, t, i), i;
|
|
151
157
|
}
|
|
152
|
-
var
|
|
153
|
-
function
|
|
154
|
-
return
|
|
158
|
+
var O = /^[dgimsuvy]*$/;
|
|
159
|
+
function k(e) {
|
|
160
|
+
return O.test(e) && new Set(e).size === e.length && !(e.includes("u") && e.includes("v"));
|
|
155
161
|
}
|
|
156
|
-
function
|
|
162
|
+
function A(e, t) {
|
|
157
163
|
let n, r = 0, i = () => (n === void 0 && (n = new RegExp(e, t), n.lastIndex = r), n);
|
|
158
164
|
return new Proxy(Object.create(RegExp.prototype), {
|
|
159
165
|
get(e, t) {
|
|
@@ -175,9 +181,8 @@ function D(e, t) {
|
|
|
175
181
|
}
|
|
176
182
|
});
|
|
177
183
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
var O = {
|
|
184
|
+
// ../../../node_modules/.pnpm/@orpc+client@1.16.2_@opentelemetry+api@1.10.0/node_modules/@orpc/client/dist/shared/client.BmCiDGqJ.mjs
|
|
185
|
+
var j = {
|
|
181
186
|
BIGINT: 0,
|
|
182
187
|
DATE: 1,
|
|
183
188
|
NAN: 2,
|
|
@@ -186,16 +191,15 @@ var O = {
|
|
|
186
191
|
REGEXP: 5,
|
|
187
192
|
SET: 6,
|
|
188
193
|
MAP: 7
|
|
189
|
-
},
|
|
190
|
-
function
|
|
194
|
+
}, M = new Set(Object.values(j)), N = /^\/(.*)\/([a-z]*)$/;
|
|
195
|
+
function P(e) {
|
|
191
196
|
return /* @__PURE__ */ TypeError(`Invalid RPC serialized data: ${e}`);
|
|
192
197
|
}
|
|
193
|
-
function
|
|
194
|
-
return
|
|
198
|
+
function F(e, t, n) {
|
|
199
|
+
return P(`type ${e} (${t}) expects ${n}.`);
|
|
195
200
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var N = new class {
|
|
201
|
+
// src/orpc/core/serialize.ts
|
|
202
|
+
var I = new class {
|
|
199
203
|
customSerializers;
|
|
200
204
|
constructor(e = {}) {
|
|
201
205
|
if (this.customSerializers = e.customJsonSerializers ?? [], this.customSerializers.length !== new Set(this.customSerializers.map((e) => e.type)).size) throw Error("Custom serializer type must be unique.");
|
|
@@ -211,13 +215,13 @@ var N = new class {
|
|
|
211
215
|
r,
|
|
212
216
|
i
|
|
213
217
|
];
|
|
214
|
-
if (typeof e == "bigint") return n.push([
|
|
218
|
+
if (typeof e == "bigint") return n.push([j.BIGINT, ...t]), [
|
|
215
219
|
e.toString(),
|
|
216
220
|
n,
|
|
217
221
|
r,
|
|
218
222
|
i
|
|
219
223
|
];
|
|
220
|
-
if (e instanceof Date) return n.push([
|
|
224
|
+
if (e instanceof Date) return n.push([j.DATE, ...t]), Number.isNaN(e.getTime()) ? [
|
|
221
225
|
null,
|
|
222
226
|
n,
|
|
223
227
|
r,
|
|
@@ -228,19 +232,19 @@ var N = new class {
|
|
|
228
232
|
r,
|
|
229
233
|
i
|
|
230
234
|
];
|
|
231
|
-
if (Number.isNaN(e)) return n.push([
|
|
235
|
+
if (Number.isNaN(e)) return n.push([j.NAN, ...t]), [
|
|
232
236
|
null,
|
|
233
237
|
n,
|
|
234
238
|
r,
|
|
235
239
|
i
|
|
236
240
|
];
|
|
237
|
-
if (e instanceof URL) return n.push([
|
|
241
|
+
if (e instanceof URL) return n.push([j.URL, ...t]), [
|
|
238
242
|
e.toString(),
|
|
239
243
|
n,
|
|
240
244
|
r,
|
|
241
245
|
i
|
|
242
246
|
];
|
|
243
|
-
if (e instanceof RegExp) return n.push([
|
|
247
|
+
if (e instanceof RegExp) return n.push([j.REGEXP, ...t]), [
|
|
244
248
|
e.toString(),
|
|
245
249
|
n,
|
|
246
250
|
r,
|
|
@@ -248,15 +252,15 @@ var N = new class {
|
|
|
248
252
|
];
|
|
249
253
|
if (e instanceof Set) {
|
|
250
254
|
let a = this.serialize(Array.from(e), t, n, r, i);
|
|
251
|
-
return n.push([
|
|
255
|
+
return n.push([j.SET, ...t]), a;
|
|
252
256
|
}
|
|
253
257
|
if (e instanceof Map) {
|
|
254
258
|
let a = this.serialize(Array.from(e.entries()), t, n, r, i);
|
|
255
|
-
return n.push([
|
|
259
|
+
return n.push([j.MAP, ...t]), a;
|
|
256
260
|
}
|
|
257
261
|
if (Array.isArray(e)) return [
|
|
258
262
|
e.map((e, a) => e === void 0 ? (n.push([
|
|
259
|
-
|
|
263
|
+
j.UNDEFINED,
|
|
260
264
|
...t,
|
|
261
265
|
a
|
|
262
266
|
]), null) : this.serialize(e, [...t, a], n, r, i)[0]),
|
|
@@ -264,7 +268,7 @@ var N = new class {
|
|
|
264
268
|
r,
|
|
265
269
|
i
|
|
266
270
|
];
|
|
267
|
-
if (
|
|
271
|
+
if (T(e)) {
|
|
268
272
|
let a = {};
|
|
269
273
|
for (let o in e) (o !== "toJSON" || typeof e[o] != "function") && (a[o] = this.serialize(e[o], [...t, o], n, r, i)[0]);
|
|
270
274
|
return [
|
|
@@ -285,76 +289,78 @@ var N = new class {
|
|
|
285
289
|
let i = { data: e }, a = { data: e };
|
|
286
290
|
n && r && n.forEach((e, t) => {
|
|
287
291
|
let n = r(t);
|
|
288
|
-
if (!(n instanceof Blob)) throw
|
|
292
|
+
if (!(n instanceof Blob)) throw P(`blob ${t} is not a Blob.`);
|
|
289
293
|
let o = a, s = i, c = "data";
|
|
290
294
|
e.forEach((e) => {
|
|
291
|
-
if (o = o[c], s =
|
|
295
|
+
if (o = o[c], s = D(s, c, o), c = e, !Object.hasOwn(s, c)) throw P(`segment "${c}" does not exist.`);
|
|
292
296
|
}), s[c] = n;
|
|
293
297
|
});
|
|
294
298
|
for (let e of t) {
|
|
295
299
|
let t = e[0], n = this.customSerializers.find((e) => e.type === t);
|
|
296
|
-
if (n === void 0 && !
|
|
300
|
+
if (n === void 0 && !M.has(t)) continue;
|
|
297
301
|
let r = a, o = i, s = "data";
|
|
298
|
-
for (let t = 1; t < e.length; t++) if (r = r[s], o =
|
|
302
|
+
for (let t = 1; t < e.length; t++) if (r = r[s], o = D(o, s, r), s = e[t], !Object.hasOwn(o, s)) throw P(`segment "${s}" does not exist.`);
|
|
299
303
|
if (n !== void 0) {
|
|
300
304
|
o[s] = n.deserialize(o[s]);
|
|
301
305
|
continue;
|
|
302
306
|
}
|
|
303
307
|
let c = o[s];
|
|
304
308
|
switch (t) {
|
|
305
|
-
case
|
|
306
|
-
if (typeof c != "string") throw
|
|
307
|
-
|
|
309
|
+
case j.BIGINT: {
|
|
310
|
+
if (typeof c != "string") throw F(t, "bigint", "a string");
|
|
311
|
+
let e = w(c, S);
|
|
312
|
+
if (e === void 0) throw F(t, "bigint", `a decimal integer string of at most ${S} digits`);
|
|
313
|
+
o[s] = e;
|
|
308
314
|
break;
|
|
309
|
-
|
|
310
|
-
|
|
315
|
+
}
|
|
316
|
+
case j.DATE:
|
|
317
|
+
if (typeof c != "string" && c !== null) throw F(t, "date", "a string or null");
|
|
311
318
|
o[s] = new Date(c ?? NaN);
|
|
312
319
|
break;
|
|
313
|
-
case
|
|
314
|
-
if (c !== null) throw
|
|
320
|
+
case j.NAN:
|
|
321
|
+
if (c !== null) throw F(t, "nan", "null");
|
|
315
322
|
o[s] = NaN;
|
|
316
323
|
break;
|
|
317
|
-
case
|
|
318
|
-
if (c !== null) throw
|
|
324
|
+
case j.UNDEFINED:
|
|
325
|
+
if (c !== null) throw F(t, "undefined", "null");
|
|
319
326
|
o[s] = void 0;
|
|
320
327
|
break;
|
|
321
|
-
case
|
|
322
|
-
if (typeof c != "string") throw
|
|
328
|
+
case j.URL:
|
|
329
|
+
if (typeof c != "string") throw F(t, "url", "a string");
|
|
323
330
|
o[s] = new URL(c);
|
|
324
331
|
break;
|
|
325
|
-
case
|
|
326
|
-
if (typeof c != "string") throw
|
|
327
|
-
let e = c.match(
|
|
328
|
-
if (e === null || !
|
|
329
|
-
o[s] =
|
|
332
|
+
case j.REGEXP: {
|
|
333
|
+
if (typeof c != "string") throw F(t, "regexp", "a string");
|
|
334
|
+
let e = c.match(N);
|
|
335
|
+
if (e === null || !k(e[2])) throw P(`type ${t} (regexp) expects a "/pattern/flags" string.`);
|
|
336
|
+
o[s] = A(e[1], e[2]);
|
|
330
337
|
break;
|
|
331
338
|
}
|
|
332
|
-
case
|
|
333
|
-
if (!Array.isArray(c)) throw
|
|
339
|
+
case j.SET:
|
|
340
|
+
if (!Array.isArray(c)) throw F(t, "set", "an array");
|
|
334
341
|
o[s] = new Set(c);
|
|
335
342
|
break;
|
|
336
|
-
case
|
|
337
|
-
if (!Array.isArray(c)) throw
|
|
343
|
+
case j.MAP:
|
|
344
|
+
if (!Array.isArray(c)) throw F(t, "map", "an array");
|
|
338
345
|
o[s] = new Map(c);
|
|
339
346
|
}
|
|
340
347
|
}
|
|
341
348
|
return i.data;
|
|
342
349
|
}
|
|
343
350
|
}();
|
|
344
|
-
function
|
|
351
|
+
function L(e) {
|
|
345
352
|
return typeof e == "object" && !!e && "json" in e && "meta" in e && Array.isArray(e.meta);
|
|
346
353
|
}
|
|
347
|
-
function
|
|
348
|
-
if (!
|
|
354
|
+
function R(e) {
|
|
355
|
+
if (!L(e)) return e;
|
|
349
356
|
try {
|
|
350
|
-
return
|
|
357
|
+
return I.deserialize(e.json, e.meta);
|
|
351
358
|
} catch {
|
|
352
359
|
return e;
|
|
353
360
|
}
|
|
354
361
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
function I(e, t) {
|
|
362
|
+
// src/orpc/core/capture.ts
|
|
363
|
+
function z(e, t) {
|
|
358
364
|
return typeof e == "string" ? {
|
|
359
365
|
url: e,
|
|
360
366
|
method: t?.method ?? "GET"
|
|
@@ -366,11 +372,11 @@ function I(e, t) {
|
|
|
366
372
|
method: e.method ?? t?.method ?? "GET"
|
|
367
373
|
};
|
|
368
374
|
}
|
|
369
|
-
function
|
|
375
|
+
function B(e, t) {
|
|
370
376
|
let n = e instanceof Request ? e.headers : t?.headers;
|
|
371
377
|
return Object.fromEntries(Array.from(new Headers(n ?? {}), ([e, t]) => [e.toLowerCase(), t]));
|
|
372
378
|
}
|
|
373
|
-
function
|
|
379
|
+
function V(e) {
|
|
374
380
|
return Object.fromEntries([
|
|
375
381
|
"cache-control",
|
|
376
382
|
"age",
|
|
@@ -383,7 +389,7 @@ function R(e) {
|
|
|
383
389
|
"content-type"
|
|
384
390
|
].map((t) => [t, e.get(t)]).filter((e) => e[1] !== null));
|
|
385
391
|
}
|
|
386
|
-
async function
|
|
392
|
+
async function H(e, t) {
|
|
387
393
|
try {
|
|
388
394
|
let n;
|
|
389
395
|
return e instanceof Request ? n = await e.clone().text() : typeof t?.body == "string" && (n = t.body), n ? JSON.parse(n) : void 0;
|
|
@@ -391,7 +397,7 @@ async function z(e, t) {
|
|
|
391
397
|
return;
|
|
392
398
|
}
|
|
393
399
|
}
|
|
394
|
-
async function
|
|
400
|
+
async function U(e) {
|
|
395
401
|
if (e.headers.get("content-type")?.includes("text/event-stream")) return {
|
|
396
402
|
body: void 0,
|
|
397
403
|
streaming: !0
|
|
@@ -416,26 +422,26 @@ async function B(e) {
|
|
|
416
422
|
};
|
|
417
423
|
}
|
|
418
424
|
}
|
|
419
|
-
async function
|
|
425
|
+
async function W(e, t, n, r) {
|
|
420
426
|
try {
|
|
421
|
-
let { url: i, method: a } =
|
|
427
|
+
let { url: i, method: a } = z(e, t), o = v(i, r);
|
|
422
428
|
if (o !== null && o !== "spec.json" && o !== "docs") {
|
|
423
|
-
let r = await
|
|
429
|
+
let r = await H(e, t);
|
|
424
430
|
return n.startCall({
|
|
425
431
|
procedure: o,
|
|
426
432
|
method: a,
|
|
427
433
|
url: i,
|
|
428
|
-
input:
|
|
434
|
+
input: R(r),
|
|
429
435
|
rawInput: r,
|
|
430
|
-
headers:
|
|
436
|
+
headers: B(e, t)
|
|
431
437
|
});
|
|
432
438
|
}
|
|
433
439
|
} catch {}
|
|
434
440
|
return -1;
|
|
435
441
|
}
|
|
436
|
-
function
|
|
442
|
+
function G(e, t, n, r, i) {
|
|
437
443
|
if (e !== -1) try {
|
|
438
|
-
let a = t.ok, o =
|
|
444
|
+
let a = t.ok, o = R(r);
|
|
439
445
|
n.finishCall(e, {
|
|
440
446
|
status: t.status,
|
|
441
447
|
ok: a,
|
|
@@ -445,20 +451,20 @@ function H(e, t, n, r, i) {
|
|
|
445
451
|
rawError: a ? void 0 : r,
|
|
446
452
|
errorKind: a ? void 0 : x(t.status, o, !1),
|
|
447
453
|
streaming: i,
|
|
448
|
-
responseHeaders:
|
|
454
|
+
responseHeaders: V(t.headers)
|
|
449
455
|
});
|
|
450
456
|
} catch {}
|
|
451
457
|
}
|
|
452
|
-
function
|
|
458
|
+
function K(e, t) {
|
|
453
459
|
if (typeof window > "u") return () => {};
|
|
454
460
|
let n = window.fetch.bind(window);
|
|
455
461
|
return window.fetch = async (r, i) => {
|
|
456
|
-
let a = await
|
|
462
|
+
let a = await W(r, i, e, t);
|
|
457
463
|
try {
|
|
458
464
|
let t = await n(r, i);
|
|
459
465
|
if (a !== -1) {
|
|
460
|
-
let { body: n, streaming: r } = await
|
|
461
|
-
|
|
466
|
+
let { body: n, streaming: r } = await U(t);
|
|
467
|
+
G(a, t, e, n, r);
|
|
462
468
|
}
|
|
463
469
|
return t;
|
|
464
470
|
} catch (t) {
|
|
@@ -475,25 +481,35 @@ function U(e, t) {
|
|
|
475
481
|
window.fetch = n;
|
|
476
482
|
};
|
|
477
483
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
+
// src/orpc/channel.ts
|
|
485
|
+
var q = "storefront-devtools:orpc";
|
|
486
|
+
// src/orpc/client/publish.ts
|
|
487
|
+
function J(e) {
|
|
488
|
+
return {
|
|
489
|
+
id: e.id,
|
|
490
|
+
procedure: e.procedure,
|
|
491
|
+
method: e.method,
|
|
492
|
+
status: e.status,
|
|
493
|
+
ok: e.ok,
|
|
494
|
+
duration: e.duration,
|
|
495
|
+
errorKind: e.errorKind
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
function Y(e) {
|
|
484
499
|
let { calls: t, paused: n } = e.getState();
|
|
485
500
|
return {
|
|
486
|
-
calls: t,
|
|
501
|
+
calls: t.map(J),
|
|
487
502
|
paused: n,
|
|
488
503
|
previousSession: e.previousSessionCalls
|
|
489
504
|
};
|
|
490
505
|
}
|
|
491
|
-
function
|
|
506
|
+
function X(e, t = {}) {
|
|
492
507
|
let n = r({
|
|
493
508
|
...t,
|
|
494
|
-
name:
|
|
509
|
+
name: q,
|
|
495
510
|
functions: {
|
|
496
|
-
getState: { handler: () =>
|
|
511
|
+
getState: { handler: () => Y(e) },
|
|
512
|
+
getCall: { handler: (t) => e.getCall(t) ?? null },
|
|
497
513
|
clear: {
|
|
498
514
|
type: "action",
|
|
499
515
|
handler: () => e.clear()
|
|
@@ -506,15 +522,15 @@ function K(e, t = {}) {
|
|
|
506
522
|
events: {}
|
|
507
523
|
});
|
|
508
524
|
return n.events.on("panel:connected", () => {
|
|
509
|
-
n.emit("state",
|
|
510
|
-
}), e.subscribe(o(() =>
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
525
|
+
n.emit("state", Y(e));
|
|
526
|
+
}), e.subscribe(o(() => {
|
|
527
|
+
n.panels.length > 0 && n.emit("state", Y(e));
|
|
528
|
+
}, 16)), n;
|
|
529
|
+
}
|
|
530
|
+
// src/orpc/client/index.ts
|
|
531
|
+
var Z = "/api", Q = Symbol.for("@scayle/storefront-devtools/orpc"), $ = globalThis;
|
|
532
|
+
if (typeof window < "u" && typeof document < "u" && !$[Q]) {
|
|
533
|
+
$[Q] = !0;
|
|
517
534
|
let e = new g();
|
|
518
|
-
|
|
535
|
+
K(e, Z), X(e);
|
|
519
536
|
}
|
|
520
|
-
//#endregion
|
|
@@ -5,7 +5,9 @@ import { OrpcChannelProtocol } from '../channel';
|
|
|
5
5
|
/**
|
|
6
6
|
* Serves the oRPC capture to the oRPC panel over an in-page channel. The oRPC
|
|
7
7
|
* page script calls it once at startup. Each panel gets the current snapshot
|
|
8
|
-
* when it connects, and store updates go out as coalesced `state` snapshots
|
|
8
|
+
* when it connects, and store updates go out as coalesced `state` snapshots
|
|
9
|
+
* while a panel is connected. A snapshot lists calls by their list fields
|
|
10
|
+
* only, and the panel loads the selected call in full with `getCall`.
|
|
9
11
|
*
|
|
10
12
|
* @param store - The oRPC capture store to publish.
|
|
11
13
|
* @param options - Endpoint options, used by tests to skip the window handshake.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/orpc/client/publish.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/orpc/client/publish.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAEV,mBAAmB,EAEpB,MAAM,YAAY,CAAA;AAuBnB;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,OAAO,GAAE,cAAmB,GAC3B,iBAAiB,CAAC,mBAAmB,CAAC,CA+BxC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import { OrpcCall,
|
|
2
|
-
/**
|
|
3
|
-
* Converts a full call to its compact session summary.
|
|
4
|
-
*
|
|
5
|
-
* @param call - The captured call to summarize.
|
|
6
|
-
* @returns The call's id, procedure, method, status, duration, and error kind.
|
|
7
|
-
*/
|
|
8
|
-
export declare function summarizeCall(call: OrpcCall): OrpcCallSummary;
|
|
1
|
+
import { OrpcCall, OrpcSnapshot } from './types';
|
|
9
2
|
/** Saves the current calls to sessionStorage as compact summaries. */
|
|
10
3
|
export declare function saveSession(calls: OrpcCall[]): void;
|
|
11
4
|
/** Loads the previous session; returns null if expired or missing. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,YAAY,EAAE,MAAM,SAAS,CAAA;AAqBtE,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAEnD;AAED,sEAAsE;AACtE,wBAAgB,WAAW,IAAI,YAAY,GAAG,IAAI,CAEjD;AAED,oCAAoC;AACpC,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
|
@@ -6,5 +6,5 @@ import { OrpcCall, ProcedureStat } from './types';
|
|
|
6
6
|
* @param calls - Captured calls, oldest first.
|
|
7
7
|
* @returns One entry per procedure, in order of first appearance.
|
|
8
8
|
*/
|
|
9
|
-
export declare function procedureStats(calls: readonly OrpcCall[]): ProcedureStat[];
|
|
9
|
+
export declare function procedureStats(calls: readonly Pick<OrpcCall, 'procedure' | 'ok' | 'duration'>[]): ProcedureStat[];
|
|
10
10
|
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEtD;;;;;;GAMG;AACH,wBAAgB,cAAc,
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEtD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,GAAG,UAAU,CAAC,EAAE,GAChE,aAAa,EAAE,CA0CjB"}
|
|
@@ -34,6 +34,7 @@ export declare class OrpcStore {
|
|
|
34
34
|
private saveTimer;
|
|
35
35
|
constructor(maxCalls?: number);
|
|
36
36
|
get calls(): OrpcCall[];
|
|
37
|
+
getCall(id: number): OrpcCall | undefined;
|
|
37
38
|
get paused(): boolean;
|
|
38
39
|
get previousSessionCalls(): OrpcCallSummary[];
|
|
39
40
|
getState(): OrpcState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,eAAe,EA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O,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,SAAS,CAA2C;gBAEhD,QAAQ,GAAE,MAAkB;IAKxC,IAAI,KAAK,IAAI,QAAQ,EAAE,CAOtB;IAED,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAIzC,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,oBAAoB,IAAI,eAAe,EAAE,CAE5C;IAED,QAAQ,IAAI,SAAS;IAOrB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAuBlC,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI;IAmBlD,SAAS,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,IAAI;IAOrC,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAK/B,KAAK,IAAI,IAAI;IAQb,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,MAAM;CAYf"}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
1
2
|
/**
|
|
2
|
-
* Writes text to the clipboard for the panels' copy buttons.
|
|
3
|
-
* Clipboard API is unavailable, as it is outside a secure context.
|
|
3
|
+
* Writes text to the clipboard for the panels' copy buttons.
|
|
4
4
|
*
|
|
5
5
|
* @param text - The text to copy.
|
|
6
|
+
* @returns Resolves to `true` once the text is on the clipboard, `false` when
|
|
7
|
+
* the Clipboard API is unavailable (outside a secure context) or the write
|
|
8
|
+
* fails, so the caller confirms only a copy that happened.
|
|
6
9
|
*/
|
|
7
|
-
export declare function copyText(text: string):
|
|
10
|
+
export declare function copyText(text: string): Promise<boolean>;
|
|
11
|
+
/** What a panel shows after a copy: `null` while no status shows. */
|
|
12
|
+
export type CopyOutcome = 'copied' | 'failed' | null;
|
|
13
|
+
/** The copy status a panel shows next to its copy buttons. */
|
|
14
|
+
export interface CopyStatus {
|
|
15
|
+
/** The outcome of the last copy, reset to `null` after two seconds. */
|
|
16
|
+
status: Ref<CopyOutcome>;
|
|
17
|
+
/** Copies the text and shows the outcome for two seconds. */
|
|
18
|
+
copy: (text: string) => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Tracks the "Copied" or "Copy failed" status of a panel's copy buttons. Used
|
|
22
|
+
* by the Inertia.js and oRPC detail views and the tree view, which render it
|
|
23
|
+
* with `CopyStatus.vue`.
|
|
24
|
+
*
|
|
25
|
+
* @returns The status ref to render and the `copy` function to call.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useCopyStatus(): CopyStatus;
|
|
8
28
|
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/shared/clipboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/shared/clipboard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI9B;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW7D;AAED,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAA;AAEpD,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,uEAAuE;IACvE,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;IACxB,6DAA6D;IAC7D,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAa1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PanelChannel } from 'devframe/in-page-channel';
|
|
2
|
-
import { ShallowRef } from 'vue';
|
|
2
|
+
import { InjectionKey, Ref, ShallowRef } from 'vue';
|
|
3
3
|
/**
|
|
4
4
|
* A panel channel whose page script answers `getState` and pushes `state`
|
|
5
5
|
* snapshots. Every panel channel in this package has that shape.
|
|
@@ -36,6 +36,32 @@ export interface CaptureControls {
|
|
|
36
36
|
* @returns A ref with the latest page state, `null` until the page script answers.
|
|
37
37
|
*/
|
|
38
38
|
export declare function mirrorPageState<TState>(channel: StatePanelChannel<TState>): ShallowRef<TState | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Tells a panel view whether the dock shows it. `ui/panels/main.ts` provides it
|
|
41
|
+
* to every view it mounts, because hidden views stay mounted, and
|
|
42
|
+
* {@link mirrorSelection} reads it. Without a provider, such as in a component
|
|
43
|
+
* test, a view counts as shown.
|
|
44
|
+
* A registered symbol, so separate module copies (after `vi.resetModules`)
|
|
45
|
+
* still agree on the key.
|
|
46
|
+
*/
|
|
47
|
+
export declare const VIEW_VISIBLE: InjectionKey<Readonly<Ref<boolean>>>;
|
|
48
|
+
/**
|
|
49
|
+
* Loads the full record of the item selected in a capture panel's list. State
|
|
50
|
+
* snapshots carry list fields only, so the Inertia and oRPC panels fetch the
|
|
51
|
+
* selected item from the page script with this. The ref turns `undefined` when
|
|
52
|
+
* the selection changes and loads again after every snapshot while `active`
|
|
53
|
+
* is true and the view is shown ({@link VIEW_VISIBLE}), because the selected
|
|
54
|
+
* request can still gain events, headers, or timing. Otherwise it keeps the
|
|
55
|
+
* last record and loads nothing. Call it from a component's `setup`.
|
|
56
|
+
*
|
|
57
|
+
* @param state - The mirrored page state, see {@link mirrorPageState}.
|
|
58
|
+
* @param selectedId - Id of the selected item, `null` when nothing is selected.
|
|
59
|
+
* @param active - Whether the view's list and detail tab is open.
|
|
60
|
+
* @param load - Asks the page script for one item by id.
|
|
61
|
+
* @returns A ref with the selected item, `undefined` while it loads, and
|
|
62
|
+
* `null` when nothing is selected or the page script no longer has it.
|
|
63
|
+
*/
|
|
64
|
+
export declare function mirrorSelection<TItem>(state: Readonly<Ref<unknown>>, selectedId: Readonly<Ref<number | null>>, active: Readonly<Ref<boolean>>, load: (id: number) => Promise<TItem | null>): ShallowRef<TItem | null | undefined>;
|
|
39
65
|
/**
|
|
40
66
|
* Creates the Clear and Pause actions of a capture panel. The Inertia and oRPC
|
|
41
67
|
* panels use it. A failed call only logs a warning, because the next snapshot
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-channel.d.ts","sourceRoot":"","sources":["../../src/shared/panel-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"panel-channel.d.ts","sourceRoot":"","sources":["../../src/shared/panel-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM;IACvC,kDAAkD;IAClD,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3C,2EAA2E;IAC3E,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;IACpE,iCAAiC;IACjC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACrD,0CAA0C;IAC1C,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;CACtD;AAED,qFAAqF;AACrF,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