@terminals-tech/sdk 1.0.0-rc.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WebContainerManager-SHXC5VKI.js +22 -0
- package/dist/browser-http-client-ZQLDWZMU.js +317 -0
- package/dist/cache-VKYSQRXX.js +45 -0
- package/dist/capabilities-MIPUMBLL.js +96 -0
- package/dist/chunk-2ESYSVXG.js +48 -0
- package/dist/chunk-2WTYE4SW.js +190 -0
- package/dist/chunk-3CEM77QZ.js +474 -0
- package/dist/chunk-3LFMIVJM.js +40 -0
- package/dist/chunk-ABCK4FWN.js +136 -0
- package/dist/chunk-AFDUOYHD.js +2060 -0
- package/dist/chunk-BCOQMFKT.js +265 -0
- package/dist/chunk-BKB3MD5Y.js +723 -0
- package/dist/chunk-BYXBJQAS.js +0 -0
- package/dist/chunk-DKFJIILR.js +9798 -0
- package/dist/chunk-EXI3LJVJ.js +51 -0
- package/dist/chunk-FOXUEYWK.js +42 -0
- package/dist/chunk-GJWAJAX3.js +173 -0
- package/dist/chunk-H3POJCFA.js +333 -0
- package/dist/chunk-KHR7ZYCX.js +4034 -0
- package/dist/chunk-NTMBOESX.js +152 -0
- package/dist/chunk-OSSRZOGC.js +190 -0
- package/dist/chunk-PUZ2S62E.js +977 -0
- package/dist/chunk-PWAHFID5.js +381 -0
- package/dist/chunk-Q2VI6ICE.js +188 -0
- package/dist/chunk-Q4B7YS7T.js +557 -0
- package/dist/chunk-QJFKEQHF.js +6460 -0
- package/dist/chunk-QWXPVB2L.js +320 -0
- package/dist/chunk-QWZRZKLZ.js +896 -0
- package/dist/chunk-SHPGIVDH.js +5521 -0
- package/dist/chunk-TSQ3BGLA.js +11945 -0
- package/dist/chunk-UJDUQNE2.js +79 -0
- package/dist/chunk-UKVUPKZP.js +296 -0
- package/dist/chunk-VZA2NUH3.js +118 -0
- package/dist/chunk-WGBCRNMB.js +1817 -0
- package/dist/chunk-WU4OTGJE.js +752 -0
- package/dist/chunk-XPJ63Y6T.js +70 -0
- package/dist/chunk-Y2EULKA2.js +172 -0
- package/dist/chunk-YJEZWCYV.js +94 -0
- package/dist/chunk-ZVO47SQV.js +150 -0
- package/dist/container-lite-KQX3NMPY.js +327 -0
- package/dist/core-H2UUDATO.js +146 -0
- package/dist/crypto-D4LMI2RN.js +45 -0
- package/dist/db-BWC2GGBN.js +50 -0
- package/dist/demo-VXMGMJNK.js +87 -0
- package/dist/diagnostics-6RQTBR6I.js +113 -0
- package/dist/dist-OPDCWARF.js +727 -0
- package/dist/dist-VXJEKX3T.js +2441 -0
- package/dist/dist-VYGJXGUS.js +1008 -0
- package/dist/embeddings-7QXTXUMC.js +15 -0
- package/dist/embeddings-MAEWWUHW.js +9 -0
- package/dist/graph-RKMNE2X5.js +36 -0
- package/dist/hvm-DRQK2MUT.js +126 -0
- package/dist/index.cjs +11706 -4004
- package/dist/index.d.cts +1299 -1339
- package/dist/index.d.ts +1299 -1339
- package/dist/index.js +189 -7938
- package/dist/mcp-NK34ZNM5.js +101 -0
- package/dist/mcp-client-service-browser-SGB2K3VZ.js +14 -0
- package/dist/neuro-state-XHRGIRVO.js +498 -0
- package/dist/nodes-DXKYDTVO.js +224 -0
- package/dist/package-EXUIU2RL.js +93 -0
- package/dist/package-VGL7HYTO.js +106 -0
- package/dist/package-XHMLOAQ4.js +98 -0
- package/dist/pg-events-QJAM2HIP.js +15 -0
- package/dist/pgliteService-IUGNNOVU.js +258 -0
- package/dist/policy-IRJCM6FS.js +13 -0
- package/dist/registry-BL3TDQDB.js +26 -0
- package/dist/registry-FW63E7FE.js +16 -0
- package/dist/registry-ZQ2IBLF6.js +9 -0
- package/dist/scheduler-H6Q53IMI.js +122 -0
- package/dist/secret-store-H7273UIT.js +18 -0
- package/dist/server-7DM74VFW.js +18 -0
- package/dist/skills-KLTTT2RM.js +6375 -0
- package/dist/stack-CHDAFU2S.js +103 -0
- package/dist/storage-L7MWNSPG.js +13 -0
- package/dist/supabaseService-6AYP2VY3.js +476 -0
- package/dist/topology-CIWWNVAN.js +13 -0
- package/dist/webcontainer-3LDJVIIL.js +281 -0
- package/package.json +2 -2
|
@@ -0,0 +1,2441 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-2ESYSVXG.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/@terminals-tech/core/dist/core/EventStore.js
|
|
6
|
+
var require_EventStore = __commonJS({
|
|
7
|
+
"../../node_modules/@terminals-tech/core/dist/core/EventStore.js"(exports) {
|
|
8
|
+
"use strict";
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.EventStore = void 0;
|
|
11
|
+
var EventStore = class _EventStore {
|
|
12
|
+
constructor(initialState, reducer, options = {}) {
|
|
13
|
+
this.initialState = initialState;
|
|
14
|
+
this.reducer = reducer;
|
|
15
|
+
this.options = options;
|
|
16
|
+
this.events = [];
|
|
17
|
+
this.index = -1;
|
|
18
|
+
this.checkpoints = /* @__PURE__ */ new Map();
|
|
19
|
+
this.idCounter = 0;
|
|
20
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
21
|
+
this.metadata = /* @__PURE__ */ new Map();
|
|
22
|
+
if (options.enableCheckpoints) {
|
|
23
|
+
this.checkpoints.set(-1, initialState);
|
|
24
|
+
}
|
|
25
|
+
this.options = {
|
|
26
|
+
maxEvents: 1e4,
|
|
27
|
+
enableCheckpoints: true,
|
|
28
|
+
checkpointInterval: 100,
|
|
29
|
+
...options
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Append a new event, truncating any future history
|
|
34
|
+
*/
|
|
35
|
+
append(eventPayload) {
|
|
36
|
+
if (this.index < this.events.length - 1) {
|
|
37
|
+
this.events = this.events.slice(0, this.index + 1);
|
|
38
|
+
for (const [idx] of this.checkpoints) {
|
|
39
|
+
if (idx > this.index) {
|
|
40
|
+
this.checkpoints.delete(idx);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const event = {
|
|
45
|
+
...eventPayload,
|
|
46
|
+
id: `evt-${Date.now()}-${this.idCounter++}`,
|
|
47
|
+
timestamp: Date.now()
|
|
48
|
+
};
|
|
49
|
+
if (this.options.maxEvents && this.events.length >= this.options.maxEvents) {
|
|
50
|
+
const midpoint = Math.floor(this.events.length / 2);
|
|
51
|
+
if (this.options.enableCheckpoints) {
|
|
52
|
+
const checkpointState = this.projectAtIndex(midpoint);
|
|
53
|
+
this.checkpoints.clear();
|
|
54
|
+
this.checkpoints.set(0, checkpointState);
|
|
55
|
+
}
|
|
56
|
+
this.events = this.events.slice(midpoint);
|
|
57
|
+
this.index = this.events.length - 1;
|
|
58
|
+
}
|
|
59
|
+
this.events.push(event);
|
|
60
|
+
this.index++;
|
|
61
|
+
if (this.options.enableCheckpoints && this.options.checkpointInterval && this.index % this.options.checkpointInterval === 0) {
|
|
62
|
+
this.checkpoints.set(this.index, this.project());
|
|
63
|
+
}
|
|
64
|
+
const newState = this.project();
|
|
65
|
+
this.listeners.forEach((listener) => listener(event, newState));
|
|
66
|
+
return event;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Project current state from events
|
|
70
|
+
*/
|
|
71
|
+
project() {
|
|
72
|
+
return this.projectAtIndex(this.index);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Project state at specific index
|
|
76
|
+
*/
|
|
77
|
+
projectAtIndex(targetIndex) {
|
|
78
|
+
if (targetIndex < 0)
|
|
79
|
+
return this.initialState;
|
|
80
|
+
if (this.options.enableCheckpoints) {
|
|
81
|
+
let nearestCheckpoint = -1;
|
|
82
|
+
let nearestState = this.initialState;
|
|
83
|
+
for (const [index, state] of this.checkpoints.entries()) {
|
|
84
|
+
if (index <= targetIndex && index > nearestCheckpoint) {
|
|
85
|
+
nearestCheckpoint = index;
|
|
86
|
+
nearestState = state;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const startIndex = nearestCheckpoint + 1;
|
|
90
|
+
return this.events.slice(startIndex, targetIndex + 1).reduce(this.reducer, nearestState);
|
|
91
|
+
}
|
|
92
|
+
return this.events.slice(0, targetIndex + 1).reduce(this.reducer, this.initialState);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Undo last action
|
|
96
|
+
*/
|
|
97
|
+
undo() {
|
|
98
|
+
if (this.index >= 0) {
|
|
99
|
+
this.index--;
|
|
100
|
+
const newState = this.project();
|
|
101
|
+
this.listeners.forEach((listener) => listener({ type: "__UNDO__", id: "undo", timestamp: Date.now() }, newState));
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Redo next action
|
|
108
|
+
*/
|
|
109
|
+
redo() {
|
|
110
|
+
if (this.index < this.events.length - 1) {
|
|
111
|
+
this.index++;
|
|
112
|
+
const newState = this.project();
|
|
113
|
+
this.listeners.forEach((listener) => listener({ type: "__REDO__", id: "redo", timestamp: Date.now() }, newState));
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Navigate to specific index
|
|
120
|
+
*/
|
|
121
|
+
navigate(index) {
|
|
122
|
+
const oldIndex = this.index;
|
|
123
|
+
this.index = Math.max(-1, Math.min(index, this.events.length - 1));
|
|
124
|
+
if (oldIndex !== this.index) {
|
|
125
|
+
const newState = this.project();
|
|
126
|
+
this.listeners.forEach((listener) => listener({ type: "__NAVIGATE__", id: "nav", timestamp: Date.now() }, newState));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Navigate to specific timestamp
|
|
131
|
+
*/
|
|
132
|
+
navigateToTime(timestamp) {
|
|
133
|
+
let targetIndex = -1;
|
|
134
|
+
for (let i = 0; i < this.events.length; i++) {
|
|
135
|
+
if (this.events[i].timestamp <= timestamp) {
|
|
136
|
+
targetIndex = i;
|
|
137
|
+
} else {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
this.navigate(targetIndex);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Subscribe to events
|
|
145
|
+
*/
|
|
146
|
+
subscribe(listener) {
|
|
147
|
+
this.listeners.add(listener);
|
|
148
|
+
return () => this.listeners.delete(listener);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get current event index
|
|
152
|
+
*/
|
|
153
|
+
getIndex() {
|
|
154
|
+
return this.index;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get all events
|
|
158
|
+
*/
|
|
159
|
+
getEvents() {
|
|
160
|
+
return [...this.events];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Get active events (up to current index)
|
|
164
|
+
*/
|
|
165
|
+
getActiveEvents() {
|
|
166
|
+
return this.events.slice(0, this.index + 1);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Get events in time range
|
|
170
|
+
*/
|
|
171
|
+
getEventsInRange(start, end) {
|
|
172
|
+
return this.events.filter((e) => e.timestamp >= start && e.timestamp <= end);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Check if can undo
|
|
176
|
+
*/
|
|
177
|
+
canUndo() {
|
|
178
|
+
return this.index >= 0;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Check if can redo
|
|
182
|
+
*/
|
|
183
|
+
canRedo() {
|
|
184
|
+
return this.index < this.events.length - 1;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Create a snapshot for persistence
|
|
188
|
+
*/
|
|
189
|
+
snapshot() {
|
|
190
|
+
return {
|
|
191
|
+
events: [...this.events],
|
|
192
|
+
index: this.index,
|
|
193
|
+
state: this.project(),
|
|
194
|
+
timestamp: Date.now(),
|
|
195
|
+
metadata: Object.fromEntries(this.metadata)
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Restore from snapshot
|
|
200
|
+
*/
|
|
201
|
+
restore(snapshot) {
|
|
202
|
+
this.events = [...snapshot.events];
|
|
203
|
+
this.index = snapshot.index;
|
|
204
|
+
this.metadata = new Map(Object.entries(snapshot.metadata || {}));
|
|
205
|
+
this.checkpoints.clear();
|
|
206
|
+
if (this.options.enableCheckpoints) {
|
|
207
|
+
this.checkpoints.set(-1, this.initialState);
|
|
208
|
+
if (this.options.checkpointInterval) {
|
|
209
|
+
for (let i = this.options.checkpointInterval - 1; i <= this.index; i += this.options.checkpointInterval) {
|
|
210
|
+
this.checkpoints.set(i, this.projectAtIndex(i));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Fork the store at current state
|
|
217
|
+
*/
|
|
218
|
+
fork() {
|
|
219
|
+
const forked = new _EventStore(this.initialState, this.reducer, this.options);
|
|
220
|
+
forked.events = this.getActiveEvents();
|
|
221
|
+
forked.index = forked.events.length - 1;
|
|
222
|
+
forked.metadata = new Map(this.metadata);
|
|
223
|
+
if (this.options.enableCheckpoints && this.options.checkpointInterval) {
|
|
224
|
+
forked.checkpoints.set(-1, this.initialState);
|
|
225
|
+
for (let i = this.options.checkpointInterval - 1; i <= forked.index; i += this.options.checkpointInterval) {
|
|
226
|
+
forked.checkpoints.set(i, forked.projectAtIndex(i));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return forked;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Clear all events and reset
|
|
233
|
+
*/
|
|
234
|
+
clear() {
|
|
235
|
+
this.events = [];
|
|
236
|
+
this.index = -1;
|
|
237
|
+
this.checkpoints.clear();
|
|
238
|
+
this.metadata.clear();
|
|
239
|
+
if (this.options.enableCheckpoints) {
|
|
240
|
+
this.checkpoints.set(-1, this.initialState);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Set metadata
|
|
245
|
+
*/
|
|
246
|
+
setMetadata(key, value) {
|
|
247
|
+
this.metadata.set(key, value);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Get metadata
|
|
251
|
+
*/
|
|
252
|
+
getMetadata(key) {
|
|
253
|
+
return this.metadata.get(key);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get store statistics
|
|
257
|
+
*/
|
|
258
|
+
getStats() {
|
|
259
|
+
const memoryUsage = JSON.stringify(this.events).length + JSON.stringify(Array.from(this.checkpoints.values())).length;
|
|
260
|
+
return {
|
|
261
|
+
eventCount: this.events.length,
|
|
262
|
+
activeEventCount: this.index + 1,
|
|
263
|
+
checkpointCount: this.checkpoints.size,
|
|
264
|
+
memoryUsage,
|
|
265
|
+
oldestEvent: this.events[0]?.timestamp || null,
|
|
266
|
+
newestEvent: this.events[this.events.length - 1]?.timestamp || null
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
exports.EventStore = EventStore;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
// ../../node_modules/@terminals-tech/core/dist/replay/ReplayManager.js
|
|
275
|
+
var require_ReplayManager = __commonJS({
|
|
276
|
+
"../../node_modules/@terminals-tech/core/dist/replay/ReplayManager.js"(exports) {
|
|
277
|
+
"use strict";
|
|
278
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
279
|
+
exports.ReplayManager = void 0;
|
|
280
|
+
var ReplayManager = class {
|
|
281
|
+
constructor(store, config = {}) {
|
|
282
|
+
this.store = store;
|
|
283
|
+
this.uploadQueue = [];
|
|
284
|
+
this.isUploading = false;
|
|
285
|
+
this.config = {
|
|
286
|
+
endpoint: "https://replay.terminals.tech/api/v1",
|
|
287
|
+
redact: [],
|
|
288
|
+
maxEvents: 1e4,
|
|
289
|
+
uploadOn: ["error"],
|
|
290
|
+
...config
|
|
291
|
+
};
|
|
292
|
+
if (this.config.uploadOn?.includes("error")) {
|
|
293
|
+
this.setupErrorCapture();
|
|
294
|
+
}
|
|
295
|
+
if (this.config.uploadOn?.includes("interval")) {
|
|
296
|
+
this.setupIntervalUpload();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Generate a replay from current store state
|
|
301
|
+
*/
|
|
302
|
+
generateReplay(error) {
|
|
303
|
+
const events = this.store.getActiveEvents();
|
|
304
|
+
const snapshot = this.store.snapshot();
|
|
305
|
+
const redactedEvents = this.redactEvents(events);
|
|
306
|
+
const replay = {
|
|
307
|
+
id: `replay-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
308
|
+
url: "",
|
|
309
|
+
// Will be set after upload
|
|
310
|
+
events: redactedEvents,
|
|
311
|
+
initialState: snapshot.state,
|
|
312
|
+
finalState: snapshot.state,
|
|
313
|
+
duration: events.length > 0 ? events[events.length - 1].timestamp - events[0].timestamp : 0,
|
|
314
|
+
timestamp: Date.now(),
|
|
315
|
+
error,
|
|
316
|
+
metadata: {
|
|
317
|
+
...this.config.metadata,
|
|
318
|
+
sessionId: this.config.sessionId,
|
|
319
|
+
userId: this.config.userId,
|
|
320
|
+
eventCount: events.length,
|
|
321
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : void 0,
|
|
322
|
+
url: typeof window !== "undefined" ? window.location.href : void 0
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
return replay;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Upload replay to cloud
|
|
329
|
+
*/
|
|
330
|
+
async upload(replay) {
|
|
331
|
+
if (!this.config.apiKey) {
|
|
332
|
+
return this.saveLocal(replay);
|
|
333
|
+
}
|
|
334
|
+
try {
|
|
335
|
+
const response = await fetch(`${this.config.endpoint}/replays`, {
|
|
336
|
+
method: "POST",
|
|
337
|
+
headers: {
|
|
338
|
+
"Content-Type": "application/json",
|
|
339
|
+
"Authorization": `Bearer ${this.config.apiKey}`
|
|
340
|
+
},
|
|
341
|
+
body: JSON.stringify(replay)
|
|
342
|
+
});
|
|
343
|
+
if (!response.ok) {
|
|
344
|
+
throw new Error(`Upload failed: ${response.statusText}`);
|
|
345
|
+
}
|
|
346
|
+
const result = await response.json();
|
|
347
|
+
replay.url = result.url || `https://replay.terminals.tech/${replay.id}`;
|
|
348
|
+
return replay.url;
|
|
349
|
+
} catch (error) {
|
|
350
|
+
console.error("Failed to upload replay:", error);
|
|
351
|
+
return this.saveLocal(replay);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Generate and upload replay in one step
|
|
356
|
+
*/
|
|
357
|
+
async captureAndUpload(error) {
|
|
358
|
+
const replay = this.generateReplay(error);
|
|
359
|
+
const url = await this.upload(replay);
|
|
360
|
+
if (typeof console !== "undefined") {
|
|
361
|
+
console.log(`%c\u{1F3AC} Replay captured: ${url}`, "color: #667eea; font-size: 14px; font-weight: bold;");
|
|
362
|
+
}
|
|
363
|
+
return url;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Save replay to local storage
|
|
367
|
+
*/
|
|
368
|
+
saveLocal(replay) {
|
|
369
|
+
if (typeof localStorage === "undefined") {
|
|
370
|
+
return `terminals://local/${replay.id}`;
|
|
371
|
+
}
|
|
372
|
+
try {
|
|
373
|
+
const data = JSON.stringify(replay);
|
|
374
|
+
if (data.length > 1024 * 1024) {
|
|
375
|
+
replay.events = replay.events.slice(-100);
|
|
376
|
+
}
|
|
377
|
+
localStorage.setItem(`terminals-replay-${replay.id}`, JSON.stringify(replay));
|
|
378
|
+
this.cleanOldReplays();
|
|
379
|
+
return `terminals://local/${replay.id}`;
|
|
380
|
+
} catch (error) {
|
|
381
|
+
console.error("Failed to save replay locally:", error);
|
|
382
|
+
return `terminals://memory/${replay.id}`;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Load replay from ID
|
|
387
|
+
*/
|
|
388
|
+
async loadReplay(id) {
|
|
389
|
+
if (id.startsWith("terminals://local/")) {
|
|
390
|
+
const localId = id.replace("terminals://local/", "");
|
|
391
|
+
const data = localStorage.getItem(`terminals-replay-${localId}`);
|
|
392
|
+
return data ? JSON.parse(data) : null;
|
|
393
|
+
}
|
|
394
|
+
try {
|
|
395
|
+
const response = await fetch(`${this.config.endpoint}/replays/${id}`, {
|
|
396
|
+
headers: this.config.apiKey ? {
|
|
397
|
+
"Authorization": `Bearer ${this.config.apiKey}`
|
|
398
|
+
} : {}
|
|
399
|
+
});
|
|
400
|
+
if (!response.ok) {
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
return await response.json();
|
|
404
|
+
} catch (error) {
|
|
405
|
+
console.error("Failed to load replay:", error);
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Playback a replay
|
|
411
|
+
*/
|
|
412
|
+
playback(replay, speed = 1) {
|
|
413
|
+
let currentIndex = 0;
|
|
414
|
+
let isPlaying = true;
|
|
415
|
+
let timeoutId = null;
|
|
416
|
+
const play = () => {
|
|
417
|
+
if (!isPlaying || currentIndex >= replay.events.length) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
this.store.navigate(currentIndex);
|
|
421
|
+
currentIndex++;
|
|
422
|
+
if (currentIndex < replay.events.length) {
|
|
423
|
+
const currentEvent = replay.events[currentIndex - 1];
|
|
424
|
+
const nextEvent = replay.events[currentIndex];
|
|
425
|
+
const delay = (nextEvent.timestamp - currentEvent.timestamp) / speed;
|
|
426
|
+
timeoutId = setTimeout(play, Math.max(delay, 16));
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
play();
|
|
430
|
+
return {
|
|
431
|
+
stop: () => {
|
|
432
|
+
isPlaying = false;
|
|
433
|
+
if (timeoutId)
|
|
434
|
+
clearTimeout(timeoutId);
|
|
435
|
+
currentIndex = 0;
|
|
436
|
+
},
|
|
437
|
+
pause: () => {
|
|
438
|
+
isPlaying = false;
|
|
439
|
+
if (timeoutId)
|
|
440
|
+
clearTimeout(timeoutId);
|
|
441
|
+
},
|
|
442
|
+
resume: () => {
|
|
443
|
+
isPlaying = true;
|
|
444
|
+
play();
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Redact sensitive fields from events
|
|
450
|
+
*/
|
|
451
|
+
redactEvents(events) {
|
|
452
|
+
if (!this.config.redact || this.config.redact.length === 0) {
|
|
453
|
+
return events;
|
|
454
|
+
}
|
|
455
|
+
return events.map((event) => {
|
|
456
|
+
const redacted = { ...event };
|
|
457
|
+
const redactObject = (obj, path = "") => {
|
|
458
|
+
for (const key in obj) {
|
|
459
|
+
const fullPath = path ? `${path}.${key}` : key;
|
|
460
|
+
if (this.config.redact?.includes(fullPath) || this.config.redact?.includes(key)) {
|
|
461
|
+
obj[key] = "[REDACTED]";
|
|
462
|
+
} else if (typeof obj[key] === "object" && obj[key] !== null) {
|
|
463
|
+
redactObject(obj[key], fullPath);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
redactObject(redacted);
|
|
468
|
+
return redacted;
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Setup automatic error capture
|
|
473
|
+
*/
|
|
474
|
+
setupErrorCapture() {
|
|
475
|
+
if (typeof window === "undefined")
|
|
476
|
+
return;
|
|
477
|
+
window.addEventListener("error", async (event) => {
|
|
478
|
+
const error = new Error(event.message);
|
|
479
|
+
error.stack = event.error?.stack || "";
|
|
480
|
+
const url = await this.captureAndUpload(error);
|
|
481
|
+
console.error(`Error captured. Debug at: ${url}`);
|
|
482
|
+
});
|
|
483
|
+
window.addEventListener("unhandledrejection", async (event) => {
|
|
484
|
+
const error = new Error(`Unhandled Promise: ${event.reason}`);
|
|
485
|
+
const url = await this.captureAndUpload(error);
|
|
486
|
+
console.error(`Promise rejection captured. Debug at: ${url}`);
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Setup interval upload
|
|
491
|
+
*/
|
|
492
|
+
setupIntervalUpload() {
|
|
493
|
+
setInterval(() => {
|
|
494
|
+
this.processUploadQueue();
|
|
495
|
+
}, 6e4);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Process upload queue
|
|
499
|
+
*/
|
|
500
|
+
async processUploadQueue() {
|
|
501
|
+
if (this.isUploading || this.uploadQueue.length === 0) {
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
this.isUploading = true;
|
|
505
|
+
while (this.uploadQueue.length > 0) {
|
|
506
|
+
const replay = this.uploadQueue.shift();
|
|
507
|
+
await this.upload(replay);
|
|
508
|
+
}
|
|
509
|
+
this.isUploading = false;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Clean old replays from localStorage
|
|
513
|
+
*/
|
|
514
|
+
cleanOldReplays() {
|
|
515
|
+
if (typeof localStorage === "undefined")
|
|
516
|
+
return;
|
|
517
|
+
const keys = Object.keys(localStorage);
|
|
518
|
+
const replayKeys = keys.filter((k) => k.startsWith("terminals-replay-"));
|
|
519
|
+
if (replayKeys.length > 10) {
|
|
520
|
+
const sorted = replayKeys.sort();
|
|
521
|
+
const toDelete = sorted.slice(0, sorted.length - 10);
|
|
522
|
+
toDelete.forEach((key) => localStorage.removeItem(key));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Get replay statistics
|
|
527
|
+
*/
|
|
528
|
+
getStats() {
|
|
529
|
+
const localReplays = typeof localStorage !== "undefined" ? Object.keys(localStorage).filter((k) => k.startsWith("terminals-replay-")).length : 0;
|
|
530
|
+
const totalSize = typeof localStorage !== "undefined" ? Object.keys(localStorage).filter((k) => k.startsWith("terminals-replay-")).reduce((sum, k) => sum + (localStorage.getItem(k)?.length || 0), 0) : 0;
|
|
531
|
+
return {
|
|
532
|
+
localReplays,
|
|
533
|
+
queuedUploads: this.uploadQueue.length,
|
|
534
|
+
totalSize
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
exports.ReplayManager = ReplayManager;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
// ../../node_modules/@terminals-tech/core/dist/adapters/BaseAdapter.js
|
|
543
|
+
var require_BaseAdapter = __commonJS({
|
|
544
|
+
"../../node_modules/@terminals-tech/core/dist/adapters/BaseAdapter.js"(exports) {
|
|
545
|
+
"use strict";
|
|
546
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
547
|
+
exports.BaseAdapter = void 0;
|
|
548
|
+
var EventStore_1 = require_EventStore();
|
|
549
|
+
var BaseAdapter = class {
|
|
550
|
+
constructor(initialState, reducer, options) {
|
|
551
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
552
|
+
this.store = new EventStore_1.EventStore(initialState, reducer, options);
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Subscribe to state changes
|
|
556
|
+
*/
|
|
557
|
+
subscribe(listener) {
|
|
558
|
+
this.listeners.add(listener);
|
|
559
|
+
return () => this.listeners.delete(listener);
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Notify all listeners of state change
|
|
563
|
+
*/
|
|
564
|
+
notifyListeners() {
|
|
565
|
+
const state = this.store.project();
|
|
566
|
+
this.listeners.forEach((listener) => listener(state));
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Dispatch an event
|
|
570
|
+
*/
|
|
571
|
+
dispatch(event) {
|
|
572
|
+
this.store.append(event);
|
|
573
|
+
this.notifyListeners();
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Undo last action
|
|
577
|
+
*/
|
|
578
|
+
undo() {
|
|
579
|
+
if (this.store.undo()) {
|
|
580
|
+
this.notifyListeners();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Redo next action
|
|
585
|
+
*/
|
|
586
|
+
redo() {
|
|
587
|
+
if (this.store.redo()) {
|
|
588
|
+
this.notifyListeners();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Get current state
|
|
593
|
+
*/
|
|
594
|
+
getState() {
|
|
595
|
+
return this.store.project();
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Check if can undo
|
|
599
|
+
*/
|
|
600
|
+
canUndo() {
|
|
601
|
+
return this.store.canUndo();
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Check if can redo
|
|
605
|
+
*/
|
|
606
|
+
canRedo() {
|
|
607
|
+
return this.store.canRedo();
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Get all events
|
|
611
|
+
*/
|
|
612
|
+
getEvents() {
|
|
613
|
+
return this.store.getEvents();
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Navigate to specific time
|
|
617
|
+
*/
|
|
618
|
+
navigateToTime(timestamp) {
|
|
619
|
+
this.store.navigateToTime(timestamp);
|
|
620
|
+
this.notifyListeners();
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
exports.BaseAdapter = BaseAdapter;
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
// ../../node_modules/react/cjs/react.production.js
|
|
628
|
+
var require_react_production = __commonJS({
|
|
629
|
+
"../../node_modules/react/cjs/react.production.js"(exports) {
|
|
630
|
+
"use strict";
|
|
631
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
632
|
+
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
633
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
634
|
+
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
635
|
+
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
636
|
+
var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
|
|
637
|
+
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
638
|
+
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
639
|
+
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
640
|
+
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
641
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
642
|
+
var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
|
|
643
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
644
|
+
function getIteratorFn(maybeIterable) {
|
|
645
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
646
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
647
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
648
|
+
}
|
|
649
|
+
var ReactNoopUpdateQueue = {
|
|
650
|
+
isMounted: function() {
|
|
651
|
+
return false;
|
|
652
|
+
},
|
|
653
|
+
enqueueForceUpdate: function() {
|
|
654
|
+
},
|
|
655
|
+
enqueueReplaceState: function() {
|
|
656
|
+
},
|
|
657
|
+
enqueueSetState: function() {
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
var assign = Object.assign;
|
|
661
|
+
var emptyObject = {};
|
|
662
|
+
function Component(props, context, updater) {
|
|
663
|
+
this.props = props;
|
|
664
|
+
this.context = context;
|
|
665
|
+
this.refs = emptyObject;
|
|
666
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
667
|
+
}
|
|
668
|
+
Component.prototype.isReactComponent = {};
|
|
669
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
670
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
671
|
+
throw Error(
|
|
672
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
673
|
+
);
|
|
674
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
675
|
+
};
|
|
676
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
677
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
678
|
+
};
|
|
679
|
+
function ComponentDummy() {
|
|
680
|
+
}
|
|
681
|
+
ComponentDummy.prototype = Component.prototype;
|
|
682
|
+
function PureComponent(props, context, updater) {
|
|
683
|
+
this.props = props;
|
|
684
|
+
this.context = context;
|
|
685
|
+
this.refs = emptyObject;
|
|
686
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
687
|
+
}
|
|
688
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
689
|
+
pureComponentPrototype.constructor = PureComponent;
|
|
690
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
691
|
+
pureComponentPrototype.isPureReactComponent = true;
|
|
692
|
+
var isArrayImpl = Array.isArray;
|
|
693
|
+
function noop() {
|
|
694
|
+
}
|
|
695
|
+
var ReactSharedInternals = { H: null, A: null, T: null, S: null };
|
|
696
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
697
|
+
function ReactElement(type, key, props) {
|
|
698
|
+
var refProp = props.ref;
|
|
699
|
+
return {
|
|
700
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
701
|
+
type,
|
|
702
|
+
key,
|
|
703
|
+
ref: void 0 !== refProp ? refProp : null,
|
|
704
|
+
props
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
708
|
+
return ReactElement(oldElement.type, newKey, oldElement.props);
|
|
709
|
+
}
|
|
710
|
+
function isValidElement(object) {
|
|
711
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
712
|
+
}
|
|
713
|
+
function escape(key) {
|
|
714
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
715
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
716
|
+
return escaperLookup[match];
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
720
|
+
function getElementKey(element, index) {
|
|
721
|
+
return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
|
|
722
|
+
}
|
|
723
|
+
function resolveThenable(thenable) {
|
|
724
|
+
switch (thenable.status) {
|
|
725
|
+
case "fulfilled":
|
|
726
|
+
return thenable.value;
|
|
727
|
+
case "rejected":
|
|
728
|
+
throw thenable.reason;
|
|
729
|
+
default:
|
|
730
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
|
|
731
|
+
function(fulfilledValue) {
|
|
732
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
733
|
+
},
|
|
734
|
+
function(error) {
|
|
735
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
736
|
+
}
|
|
737
|
+
)), thenable.status) {
|
|
738
|
+
case "fulfilled":
|
|
739
|
+
return thenable.value;
|
|
740
|
+
case "rejected":
|
|
741
|
+
throw thenable.reason;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
throw thenable;
|
|
745
|
+
}
|
|
746
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
747
|
+
var type = typeof children;
|
|
748
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
749
|
+
var invokeCallback = false;
|
|
750
|
+
if (null === children) invokeCallback = true;
|
|
751
|
+
else
|
|
752
|
+
switch (type) {
|
|
753
|
+
case "bigint":
|
|
754
|
+
case "string":
|
|
755
|
+
case "number":
|
|
756
|
+
invokeCallback = true;
|
|
757
|
+
break;
|
|
758
|
+
case "object":
|
|
759
|
+
switch (children.$$typeof) {
|
|
760
|
+
case REACT_ELEMENT_TYPE:
|
|
761
|
+
case REACT_PORTAL_TYPE:
|
|
762
|
+
invokeCallback = true;
|
|
763
|
+
break;
|
|
764
|
+
case REACT_LAZY_TYPE:
|
|
765
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
766
|
+
invokeCallback(children._payload),
|
|
767
|
+
array,
|
|
768
|
+
escapedPrefix,
|
|
769
|
+
nameSoFar,
|
|
770
|
+
callback
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
if (invokeCallback)
|
|
775
|
+
return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
776
|
+
return c;
|
|
777
|
+
})) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
|
|
778
|
+
callback,
|
|
779
|
+
escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
|
|
780
|
+
userProvidedKeyEscapeRegex,
|
|
781
|
+
"$&/"
|
|
782
|
+
) + "/") + invokeCallback
|
|
783
|
+
)), array.push(callback)), 1;
|
|
784
|
+
invokeCallback = 0;
|
|
785
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
786
|
+
if (isArrayImpl(children))
|
|
787
|
+
for (var i = 0; i < children.length; i++)
|
|
788
|
+
nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
789
|
+
nameSoFar,
|
|
790
|
+
array,
|
|
791
|
+
escapedPrefix,
|
|
792
|
+
type,
|
|
793
|
+
callback
|
|
794
|
+
);
|
|
795
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
796
|
+
for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
797
|
+
nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
798
|
+
nameSoFar,
|
|
799
|
+
array,
|
|
800
|
+
escapedPrefix,
|
|
801
|
+
type,
|
|
802
|
+
callback
|
|
803
|
+
);
|
|
804
|
+
else if ("object" === type) {
|
|
805
|
+
if ("function" === typeof children.then)
|
|
806
|
+
return mapIntoArray(
|
|
807
|
+
resolveThenable(children),
|
|
808
|
+
array,
|
|
809
|
+
escapedPrefix,
|
|
810
|
+
nameSoFar,
|
|
811
|
+
callback
|
|
812
|
+
);
|
|
813
|
+
array = String(children);
|
|
814
|
+
throw Error(
|
|
815
|
+
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
return invokeCallback;
|
|
819
|
+
}
|
|
820
|
+
function mapChildren(children, func, context) {
|
|
821
|
+
if (null == children) return children;
|
|
822
|
+
var result = [], count = 0;
|
|
823
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
824
|
+
return func.call(context, child, count++);
|
|
825
|
+
});
|
|
826
|
+
return result;
|
|
827
|
+
}
|
|
828
|
+
function lazyInitializer(payload) {
|
|
829
|
+
if (-1 === payload._status) {
|
|
830
|
+
var ctor = payload._result;
|
|
831
|
+
ctor = ctor();
|
|
832
|
+
ctor.then(
|
|
833
|
+
function(moduleObject) {
|
|
834
|
+
if (0 === payload._status || -1 === payload._status)
|
|
835
|
+
payload._status = 1, payload._result = moduleObject;
|
|
836
|
+
},
|
|
837
|
+
function(error) {
|
|
838
|
+
if (0 === payload._status || -1 === payload._status)
|
|
839
|
+
payload._status = 2, payload._result = error;
|
|
840
|
+
}
|
|
841
|
+
);
|
|
842
|
+
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
|
843
|
+
}
|
|
844
|
+
if (1 === payload._status) return payload._result.default;
|
|
845
|
+
throw payload._result;
|
|
846
|
+
}
|
|
847
|
+
var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
848
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
849
|
+
var event = new window.ErrorEvent("error", {
|
|
850
|
+
bubbles: true,
|
|
851
|
+
cancelable: true,
|
|
852
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
853
|
+
error
|
|
854
|
+
});
|
|
855
|
+
if (!window.dispatchEvent(event)) return;
|
|
856
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
857
|
+
process.emit("uncaughtException", error);
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
console.error(error);
|
|
861
|
+
};
|
|
862
|
+
var Children = {
|
|
863
|
+
map: mapChildren,
|
|
864
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
865
|
+
mapChildren(
|
|
866
|
+
children,
|
|
867
|
+
function() {
|
|
868
|
+
forEachFunc.apply(this, arguments);
|
|
869
|
+
},
|
|
870
|
+
forEachContext
|
|
871
|
+
);
|
|
872
|
+
},
|
|
873
|
+
count: function(children) {
|
|
874
|
+
var n = 0;
|
|
875
|
+
mapChildren(children, function() {
|
|
876
|
+
n++;
|
|
877
|
+
});
|
|
878
|
+
return n;
|
|
879
|
+
},
|
|
880
|
+
toArray: function(children) {
|
|
881
|
+
return mapChildren(children, function(child) {
|
|
882
|
+
return child;
|
|
883
|
+
}) || [];
|
|
884
|
+
},
|
|
885
|
+
only: function(children) {
|
|
886
|
+
if (!isValidElement(children))
|
|
887
|
+
throw Error(
|
|
888
|
+
"React.Children.only expected to receive a single React element child."
|
|
889
|
+
);
|
|
890
|
+
return children;
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
894
|
+
exports.Children = Children;
|
|
895
|
+
exports.Component = Component;
|
|
896
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
897
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
898
|
+
exports.PureComponent = PureComponent;
|
|
899
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
900
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
901
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
902
|
+
exports.__COMPILER_RUNTIME = {
|
|
903
|
+
__proto__: null,
|
|
904
|
+
c: function(size) {
|
|
905
|
+
return ReactSharedInternals.H.useMemoCache(size);
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
exports.cache = function(fn) {
|
|
909
|
+
return function() {
|
|
910
|
+
return fn.apply(null, arguments);
|
|
911
|
+
};
|
|
912
|
+
};
|
|
913
|
+
exports.cacheSignal = function() {
|
|
914
|
+
return null;
|
|
915
|
+
};
|
|
916
|
+
exports.cloneElement = function(element, config, children) {
|
|
917
|
+
if (null === element || void 0 === element)
|
|
918
|
+
throw Error(
|
|
919
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
920
|
+
);
|
|
921
|
+
var props = assign({}, element.props), key = element.key;
|
|
922
|
+
if (null != config)
|
|
923
|
+
for (propName in void 0 !== config.key && (key = "" + config.key), config)
|
|
924
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
925
|
+
var propName = arguments.length - 2;
|
|
926
|
+
if (1 === propName) props.children = children;
|
|
927
|
+
else if (1 < propName) {
|
|
928
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++)
|
|
929
|
+
childArray[i] = arguments[i + 2];
|
|
930
|
+
props.children = childArray;
|
|
931
|
+
}
|
|
932
|
+
return ReactElement(element.type, key, props);
|
|
933
|
+
};
|
|
934
|
+
exports.createContext = function(defaultValue) {
|
|
935
|
+
defaultValue = {
|
|
936
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
937
|
+
_currentValue: defaultValue,
|
|
938
|
+
_currentValue2: defaultValue,
|
|
939
|
+
_threadCount: 0,
|
|
940
|
+
Provider: null,
|
|
941
|
+
Consumer: null
|
|
942
|
+
};
|
|
943
|
+
defaultValue.Provider = defaultValue;
|
|
944
|
+
defaultValue.Consumer = {
|
|
945
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
946
|
+
_context: defaultValue
|
|
947
|
+
};
|
|
948
|
+
return defaultValue;
|
|
949
|
+
};
|
|
950
|
+
exports.createElement = function(type, config, children) {
|
|
951
|
+
var propName, props = {}, key = null;
|
|
952
|
+
if (null != config)
|
|
953
|
+
for (propName in void 0 !== config.key && (key = "" + config.key), config)
|
|
954
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
|
|
955
|
+
var childrenLength = arguments.length - 2;
|
|
956
|
+
if (1 === childrenLength) props.children = children;
|
|
957
|
+
else if (1 < childrenLength) {
|
|
958
|
+
for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
|
|
959
|
+
childArray[i] = arguments[i + 2];
|
|
960
|
+
props.children = childArray;
|
|
961
|
+
}
|
|
962
|
+
if (type && type.defaultProps)
|
|
963
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
964
|
+
void 0 === props[propName] && (props[propName] = childrenLength[propName]);
|
|
965
|
+
return ReactElement(type, key, props);
|
|
966
|
+
};
|
|
967
|
+
exports.createRef = function() {
|
|
968
|
+
return { current: null };
|
|
969
|
+
};
|
|
970
|
+
exports.forwardRef = function(render) {
|
|
971
|
+
return { $$typeof: REACT_FORWARD_REF_TYPE, render };
|
|
972
|
+
};
|
|
973
|
+
exports.isValidElement = isValidElement;
|
|
974
|
+
exports.lazy = function(ctor) {
|
|
975
|
+
return {
|
|
976
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
977
|
+
_payload: { _status: -1, _result: ctor },
|
|
978
|
+
_init: lazyInitializer
|
|
979
|
+
};
|
|
980
|
+
};
|
|
981
|
+
exports.memo = function(type, compare) {
|
|
982
|
+
return {
|
|
983
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
984
|
+
type,
|
|
985
|
+
compare: void 0 === compare ? null : compare
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
exports.startTransition = function(scope) {
|
|
989
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
990
|
+
ReactSharedInternals.T = currentTransition;
|
|
991
|
+
try {
|
|
992
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
993
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
994
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
|
|
995
|
+
} catch (error) {
|
|
996
|
+
reportGlobalError(error);
|
|
997
|
+
} finally {
|
|
998
|
+
null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
exports.unstable_useCacheRefresh = function() {
|
|
1002
|
+
return ReactSharedInternals.H.useCacheRefresh();
|
|
1003
|
+
};
|
|
1004
|
+
exports.use = function(usable) {
|
|
1005
|
+
return ReactSharedInternals.H.use(usable);
|
|
1006
|
+
};
|
|
1007
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
1008
|
+
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
|
1009
|
+
};
|
|
1010
|
+
exports.useCallback = function(callback, deps) {
|
|
1011
|
+
return ReactSharedInternals.H.useCallback(callback, deps);
|
|
1012
|
+
};
|
|
1013
|
+
exports.useContext = function(Context) {
|
|
1014
|
+
return ReactSharedInternals.H.useContext(Context);
|
|
1015
|
+
};
|
|
1016
|
+
exports.useDebugValue = function() {
|
|
1017
|
+
};
|
|
1018
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
1019
|
+
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
|
|
1020
|
+
};
|
|
1021
|
+
exports.useEffect = function(create, deps) {
|
|
1022
|
+
return ReactSharedInternals.H.useEffect(create, deps);
|
|
1023
|
+
};
|
|
1024
|
+
exports.useEffectEvent = function(callback) {
|
|
1025
|
+
return ReactSharedInternals.H.useEffectEvent(callback);
|
|
1026
|
+
};
|
|
1027
|
+
exports.useId = function() {
|
|
1028
|
+
return ReactSharedInternals.H.useId();
|
|
1029
|
+
};
|
|
1030
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
1031
|
+
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
|
|
1032
|
+
};
|
|
1033
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
1034
|
+
return ReactSharedInternals.H.useInsertionEffect(create, deps);
|
|
1035
|
+
};
|
|
1036
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
1037
|
+
return ReactSharedInternals.H.useLayoutEffect(create, deps);
|
|
1038
|
+
};
|
|
1039
|
+
exports.useMemo = function(create, deps) {
|
|
1040
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
|
1041
|
+
};
|
|
1042
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
1043
|
+
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
|
|
1044
|
+
};
|
|
1045
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
1046
|
+
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
|
|
1047
|
+
};
|
|
1048
|
+
exports.useRef = function(initialValue) {
|
|
1049
|
+
return ReactSharedInternals.H.useRef(initialValue);
|
|
1050
|
+
};
|
|
1051
|
+
exports.useState = function(initialState) {
|
|
1052
|
+
return ReactSharedInternals.H.useState(initialState);
|
|
1053
|
+
};
|
|
1054
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
1055
|
+
return ReactSharedInternals.H.useSyncExternalStore(
|
|
1056
|
+
subscribe,
|
|
1057
|
+
getSnapshot,
|
|
1058
|
+
getServerSnapshot
|
|
1059
|
+
);
|
|
1060
|
+
};
|
|
1061
|
+
exports.useTransition = function() {
|
|
1062
|
+
return ReactSharedInternals.H.useTransition();
|
|
1063
|
+
};
|
|
1064
|
+
exports.version = "19.2.3";
|
|
1065
|
+
}
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
// ../../node_modules/react/cjs/react.development.js
|
|
1069
|
+
var require_react_development = __commonJS({
|
|
1070
|
+
"../../node_modules/react/cjs/react.development.js"(exports, module) {
|
|
1071
|
+
"use strict";
|
|
1072
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
1073
|
+
function defineDeprecationWarning(methodName, info) {
|
|
1074
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
1075
|
+
get: function() {
|
|
1076
|
+
console.warn(
|
|
1077
|
+
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
1078
|
+
info[0],
|
|
1079
|
+
info[1]
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
function getIteratorFn(maybeIterable) {
|
|
1085
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
|
1086
|
+
return null;
|
|
1087
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
1088
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
1089
|
+
}
|
|
1090
|
+
function warnNoop(publicInstance, callerName) {
|
|
1091
|
+
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
|
1092
|
+
var warningKey = publicInstance + "." + callerName;
|
|
1093
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
|
|
1094
|
+
"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
|
1095
|
+
callerName,
|
|
1096
|
+
publicInstance
|
|
1097
|
+
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
|
1098
|
+
}
|
|
1099
|
+
function Component(props, context, updater) {
|
|
1100
|
+
this.props = props;
|
|
1101
|
+
this.context = context;
|
|
1102
|
+
this.refs = emptyObject;
|
|
1103
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
1104
|
+
}
|
|
1105
|
+
function ComponentDummy() {
|
|
1106
|
+
}
|
|
1107
|
+
function PureComponent(props, context, updater) {
|
|
1108
|
+
this.props = props;
|
|
1109
|
+
this.context = context;
|
|
1110
|
+
this.refs = emptyObject;
|
|
1111
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
1112
|
+
}
|
|
1113
|
+
function noop() {
|
|
1114
|
+
}
|
|
1115
|
+
function testStringCoercion(value) {
|
|
1116
|
+
return "" + value;
|
|
1117
|
+
}
|
|
1118
|
+
function checkKeyStringCoercion(value) {
|
|
1119
|
+
try {
|
|
1120
|
+
testStringCoercion(value);
|
|
1121
|
+
var JSCompiler_inline_result = false;
|
|
1122
|
+
} catch (e) {
|
|
1123
|
+
JSCompiler_inline_result = true;
|
|
1124
|
+
}
|
|
1125
|
+
if (JSCompiler_inline_result) {
|
|
1126
|
+
JSCompiler_inline_result = console;
|
|
1127
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
1128
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
1129
|
+
JSCompiler_temp_const.call(
|
|
1130
|
+
JSCompiler_inline_result,
|
|
1131
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
1132
|
+
JSCompiler_inline_result$jscomp$0
|
|
1133
|
+
);
|
|
1134
|
+
return testStringCoercion(value);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
function getComponentNameFromType(type) {
|
|
1138
|
+
if (null == type) return null;
|
|
1139
|
+
if ("function" === typeof type)
|
|
1140
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
1141
|
+
if ("string" === typeof type) return type;
|
|
1142
|
+
switch (type) {
|
|
1143
|
+
case REACT_FRAGMENT_TYPE:
|
|
1144
|
+
return "Fragment";
|
|
1145
|
+
case REACT_PROFILER_TYPE:
|
|
1146
|
+
return "Profiler";
|
|
1147
|
+
case REACT_STRICT_MODE_TYPE:
|
|
1148
|
+
return "StrictMode";
|
|
1149
|
+
case REACT_SUSPENSE_TYPE:
|
|
1150
|
+
return "Suspense";
|
|
1151
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1152
|
+
return "SuspenseList";
|
|
1153
|
+
case REACT_ACTIVITY_TYPE:
|
|
1154
|
+
return "Activity";
|
|
1155
|
+
}
|
|
1156
|
+
if ("object" === typeof type)
|
|
1157
|
+
switch ("number" === typeof type.tag && console.error(
|
|
1158
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
1159
|
+
), type.$$typeof) {
|
|
1160
|
+
case REACT_PORTAL_TYPE:
|
|
1161
|
+
return "Portal";
|
|
1162
|
+
case REACT_CONTEXT_TYPE:
|
|
1163
|
+
return type.displayName || "Context";
|
|
1164
|
+
case REACT_CONSUMER_TYPE:
|
|
1165
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
1166
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1167
|
+
var innerType = type.render;
|
|
1168
|
+
type = type.displayName;
|
|
1169
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
1170
|
+
return type;
|
|
1171
|
+
case REACT_MEMO_TYPE:
|
|
1172
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
1173
|
+
case REACT_LAZY_TYPE:
|
|
1174
|
+
innerType = type._payload;
|
|
1175
|
+
type = type._init;
|
|
1176
|
+
try {
|
|
1177
|
+
return getComponentNameFromType(type(innerType));
|
|
1178
|
+
} catch (x) {
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
return null;
|
|
1182
|
+
}
|
|
1183
|
+
function getTaskName(type) {
|
|
1184
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
1185
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
1186
|
+
return "<...>";
|
|
1187
|
+
try {
|
|
1188
|
+
var name = getComponentNameFromType(type);
|
|
1189
|
+
return name ? "<" + name + ">" : "<...>";
|
|
1190
|
+
} catch (x) {
|
|
1191
|
+
return "<...>";
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
function getOwner() {
|
|
1195
|
+
var dispatcher = ReactSharedInternals.A;
|
|
1196
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
1197
|
+
}
|
|
1198
|
+
function UnknownOwner() {
|
|
1199
|
+
return Error("react-stack-top-frame");
|
|
1200
|
+
}
|
|
1201
|
+
function hasValidKey(config) {
|
|
1202
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
1203
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
1204
|
+
if (getter && getter.isReactWarning) return false;
|
|
1205
|
+
}
|
|
1206
|
+
return void 0 !== config.key;
|
|
1207
|
+
}
|
|
1208
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
1209
|
+
function warnAboutAccessingKey() {
|
|
1210
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
1211
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
1212
|
+
displayName
|
|
1213
|
+
));
|
|
1214
|
+
}
|
|
1215
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
1216
|
+
Object.defineProperty(props, "key", {
|
|
1217
|
+
get: warnAboutAccessingKey,
|
|
1218
|
+
configurable: true
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
1222
|
+
var componentName = getComponentNameFromType(this.type);
|
|
1223
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
1224
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
1225
|
+
));
|
|
1226
|
+
componentName = this.props.ref;
|
|
1227
|
+
return void 0 !== componentName ? componentName : null;
|
|
1228
|
+
}
|
|
1229
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
1230
|
+
var refProp = props.ref;
|
|
1231
|
+
type = {
|
|
1232
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
1233
|
+
type,
|
|
1234
|
+
key,
|
|
1235
|
+
props,
|
|
1236
|
+
_owner: owner
|
|
1237
|
+
};
|
|
1238
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
1239
|
+
enumerable: false,
|
|
1240
|
+
get: elementRefGetterWithDeprecationWarning
|
|
1241
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
1242
|
+
type._store = {};
|
|
1243
|
+
Object.defineProperty(type._store, "validated", {
|
|
1244
|
+
configurable: false,
|
|
1245
|
+
enumerable: false,
|
|
1246
|
+
writable: true,
|
|
1247
|
+
value: 0
|
|
1248
|
+
});
|
|
1249
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
1250
|
+
configurable: false,
|
|
1251
|
+
enumerable: false,
|
|
1252
|
+
writable: true,
|
|
1253
|
+
value: null
|
|
1254
|
+
});
|
|
1255
|
+
Object.defineProperty(type, "_debugStack", {
|
|
1256
|
+
configurable: false,
|
|
1257
|
+
enumerable: false,
|
|
1258
|
+
writable: true,
|
|
1259
|
+
value: debugStack
|
|
1260
|
+
});
|
|
1261
|
+
Object.defineProperty(type, "_debugTask", {
|
|
1262
|
+
configurable: false,
|
|
1263
|
+
enumerable: false,
|
|
1264
|
+
writable: true,
|
|
1265
|
+
value: debugTask
|
|
1266
|
+
});
|
|
1267
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
1268
|
+
return type;
|
|
1269
|
+
}
|
|
1270
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
1271
|
+
newKey = ReactElement(
|
|
1272
|
+
oldElement.type,
|
|
1273
|
+
newKey,
|
|
1274
|
+
oldElement.props,
|
|
1275
|
+
oldElement._owner,
|
|
1276
|
+
oldElement._debugStack,
|
|
1277
|
+
oldElement._debugTask
|
|
1278
|
+
);
|
|
1279
|
+
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
|
1280
|
+
return newKey;
|
|
1281
|
+
}
|
|
1282
|
+
function validateChildKeys(node) {
|
|
1283
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
1284
|
+
}
|
|
1285
|
+
function isValidElement(object) {
|
|
1286
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1287
|
+
}
|
|
1288
|
+
function escape(key) {
|
|
1289
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
1290
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
1291
|
+
return escaperLookup[match];
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
function getElementKey(element, index) {
|
|
1295
|
+
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
|
1296
|
+
}
|
|
1297
|
+
function resolveThenable(thenable) {
|
|
1298
|
+
switch (thenable.status) {
|
|
1299
|
+
case "fulfilled":
|
|
1300
|
+
return thenable.value;
|
|
1301
|
+
case "rejected":
|
|
1302
|
+
throw thenable.reason;
|
|
1303
|
+
default:
|
|
1304
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
|
|
1305
|
+
function(fulfilledValue) {
|
|
1306
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
1307
|
+
},
|
|
1308
|
+
function(error) {
|
|
1309
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
1310
|
+
}
|
|
1311
|
+
)), thenable.status) {
|
|
1312
|
+
case "fulfilled":
|
|
1313
|
+
return thenable.value;
|
|
1314
|
+
case "rejected":
|
|
1315
|
+
throw thenable.reason;
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
throw thenable;
|
|
1319
|
+
}
|
|
1320
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
1321
|
+
var type = typeof children;
|
|
1322
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
1323
|
+
var invokeCallback = false;
|
|
1324
|
+
if (null === children) invokeCallback = true;
|
|
1325
|
+
else
|
|
1326
|
+
switch (type) {
|
|
1327
|
+
case "bigint":
|
|
1328
|
+
case "string":
|
|
1329
|
+
case "number":
|
|
1330
|
+
invokeCallback = true;
|
|
1331
|
+
break;
|
|
1332
|
+
case "object":
|
|
1333
|
+
switch (children.$$typeof) {
|
|
1334
|
+
case REACT_ELEMENT_TYPE:
|
|
1335
|
+
case REACT_PORTAL_TYPE:
|
|
1336
|
+
invokeCallback = true;
|
|
1337
|
+
break;
|
|
1338
|
+
case REACT_LAZY_TYPE:
|
|
1339
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
1340
|
+
invokeCallback(children._payload),
|
|
1341
|
+
array,
|
|
1342
|
+
escapedPrefix,
|
|
1343
|
+
nameSoFar,
|
|
1344
|
+
callback
|
|
1345
|
+
);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
if (invokeCallback) {
|
|
1349
|
+
invokeCallback = children;
|
|
1350
|
+
callback = callback(invokeCallback);
|
|
1351
|
+
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
|
1352
|
+
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
1353
|
+
return c;
|
|
1354
|
+
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
|
|
1355
|
+
callback,
|
|
1356
|
+
escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
|
|
1357
|
+
userProvidedKeyEscapeRegex,
|
|
1358
|
+
"$&/"
|
|
1359
|
+
) + "/") + childKey
|
|
1360
|
+
), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
|
1361
|
+
return 1;
|
|
1362
|
+
}
|
|
1363
|
+
invokeCallback = 0;
|
|
1364
|
+
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
1365
|
+
if (isArrayImpl(children))
|
|
1366
|
+
for (var i = 0; i < children.length; i++)
|
|
1367
|
+
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
1368
|
+
nameSoFar,
|
|
1369
|
+
array,
|
|
1370
|
+
escapedPrefix,
|
|
1371
|
+
type,
|
|
1372
|
+
callback
|
|
1373
|
+
);
|
|
1374
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
1375
|
+
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
|
1376
|
+
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
1377
|
+
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
1378
|
+
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
1379
|
+
nameSoFar,
|
|
1380
|
+
array,
|
|
1381
|
+
escapedPrefix,
|
|
1382
|
+
type,
|
|
1383
|
+
callback
|
|
1384
|
+
);
|
|
1385
|
+
else if ("object" === type) {
|
|
1386
|
+
if ("function" === typeof children.then)
|
|
1387
|
+
return mapIntoArray(
|
|
1388
|
+
resolveThenable(children),
|
|
1389
|
+
array,
|
|
1390
|
+
escapedPrefix,
|
|
1391
|
+
nameSoFar,
|
|
1392
|
+
callback
|
|
1393
|
+
);
|
|
1394
|
+
array = String(children);
|
|
1395
|
+
throw Error(
|
|
1396
|
+
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1399
|
+
return invokeCallback;
|
|
1400
|
+
}
|
|
1401
|
+
function mapChildren(children, func, context) {
|
|
1402
|
+
if (null == children) return children;
|
|
1403
|
+
var result = [], count = 0;
|
|
1404
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
1405
|
+
return func.call(context, child, count++);
|
|
1406
|
+
});
|
|
1407
|
+
return result;
|
|
1408
|
+
}
|
|
1409
|
+
function lazyInitializer(payload) {
|
|
1410
|
+
if (-1 === payload._status) {
|
|
1411
|
+
var ioInfo = payload._ioInfo;
|
|
1412
|
+
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
|
|
1413
|
+
ioInfo = payload._result;
|
|
1414
|
+
var thenable = ioInfo();
|
|
1415
|
+
thenable.then(
|
|
1416
|
+
function(moduleObject) {
|
|
1417
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
1418
|
+
payload._status = 1;
|
|
1419
|
+
payload._result = moduleObject;
|
|
1420
|
+
var _ioInfo = payload._ioInfo;
|
|
1421
|
+
null != _ioInfo && (_ioInfo.end = performance.now());
|
|
1422
|
+
void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
|
1423
|
+
}
|
|
1424
|
+
},
|
|
1425
|
+
function(error) {
|
|
1426
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
1427
|
+
payload._status = 2;
|
|
1428
|
+
payload._result = error;
|
|
1429
|
+
var _ioInfo2 = payload._ioInfo;
|
|
1430
|
+
null != _ioInfo2 && (_ioInfo2.end = performance.now());
|
|
1431
|
+
void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
);
|
|
1435
|
+
ioInfo = payload._ioInfo;
|
|
1436
|
+
if (null != ioInfo) {
|
|
1437
|
+
ioInfo.value = thenable;
|
|
1438
|
+
var displayName = thenable.displayName;
|
|
1439
|
+
"string" === typeof displayName && (ioInfo.name = displayName);
|
|
1440
|
+
}
|
|
1441
|
+
-1 === payload._status && (payload._status = 0, payload._result = thenable);
|
|
1442
|
+
}
|
|
1443
|
+
if (1 === payload._status)
|
|
1444
|
+
return ioInfo = payload._result, void 0 === ioInfo && console.error(
|
|
1445
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
|
|
1446
|
+
ioInfo
|
|
1447
|
+
), "default" in ioInfo || console.error(
|
|
1448
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
|
1449
|
+
ioInfo
|
|
1450
|
+
), ioInfo.default;
|
|
1451
|
+
throw payload._result;
|
|
1452
|
+
}
|
|
1453
|
+
function resolveDispatcher() {
|
|
1454
|
+
var dispatcher = ReactSharedInternals.H;
|
|
1455
|
+
null === dispatcher && console.error(
|
|
1456
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
1457
|
+
);
|
|
1458
|
+
return dispatcher;
|
|
1459
|
+
}
|
|
1460
|
+
function releaseAsyncTransition() {
|
|
1461
|
+
ReactSharedInternals.asyncTransitions--;
|
|
1462
|
+
}
|
|
1463
|
+
function enqueueTask(task) {
|
|
1464
|
+
if (null === enqueueTaskImpl)
|
|
1465
|
+
try {
|
|
1466
|
+
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
1467
|
+
enqueueTaskImpl = (module && module[requireString]).call(
|
|
1468
|
+
module,
|
|
1469
|
+
"timers"
|
|
1470
|
+
).setImmediate;
|
|
1471
|
+
} catch (_err) {
|
|
1472
|
+
enqueueTaskImpl = function(callback) {
|
|
1473
|
+
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
|
|
1474
|
+
"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
|
|
1475
|
+
));
|
|
1476
|
+
var channel = new MessageChannel();
|
|
1477
|
+
channel.port1.onmessage = callback;
|
|
1478
|
+
channel.port2.postMessage(void 0);
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
return enqueueTaskImpl(task);
|
|
1482
|
+
}
|
|
1483
|
+
function aggregateErrors(errors) {
|
|
1484
|
+
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
|
1485
|
+
}
|
|
1486
|
+
function popActScope(prevActQueue, prevActScopeDepth) {
|
|
1487
|
+
prevActScopeDepth !== actScopeDepth - 1 && console.error(
|
|
1488
|
+
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
|
1489
|
+
);
|
|
1490
|
+
actScopeDepth = prevActScopeDepth;
|
|
1491
|
+
}
|
|
1492
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
1493
|
+
var queue = ReactSharedInternals.actQueue;
|
|
1494
|
+
if (null !== queue)
|
|
1495
|
+
if (0 !== queue.length)
|
|
1496
|
+
try {
|
|
1497
|
+
flushActQueue(queue);
|
|
1498
|
+
enqueueTask(function() {
|
|
1499
|
+
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
1500
|
+
});
|
|
1501
|
+
return;
|
|
1502
|
+
} catch (error) {
|
|
1503
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
1504
|
+
}
|
|
1505
|
+
else ReactSharedInternals.actQueue = null;
|
|
1506
|
+
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
|
1507
|
+
}
|
|
1508
|
+
function flushActQueue(queue) {
|
|
1509
|
+
if (!isFlushing) {
|
|
1510
|
+
isFlushing = true;
|
|
1511
|
+
var i = 0;
|
|
1512
|
+
try {
|
|
1513
|
+
for (; i < queue.length; i++) {
|
|
1514
|
+
var callback = queue[i];
|
|
1515
|
+
do {
|
|
1516
|
+
ReactSharedInternals.didUsePromise = false;
|
|
1517
|
+
var continuation = callback(false);
|
|
1518
|
+
if (null !== continuation) {
|
|
1519
|
+
if (ReactSharedInternals.didUsePromise) {
|
|
1520
|
+
queue[i] = callback;
|
|
1521
|
+
queue.splice(0, i);
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
callback = continuation;
|
|
1525
|
+
} else break;
|
|
1526
|
+
} while (1);
|
|
1527
|
+
}
|
|
1528
|
+
queue.length = 0;
|
|
1529
|
+
} catch (error) {
|
|
1530
|
+
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
|
1531
|
+
} finally {
|
|
1532
|
+
isFlushing = false;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1537
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
1538
|
+
isMounted: function() {
|
|
1539
|
+
return false;
|
|
1540
|
+
},
|
|
1541
|
+
enqueueForceUpdate: function(publicInstance) {
|
|
1542
|
+
warnNoop(publicInstance, "forceUpdate");
|
|
1543
|
+
},
|
|
1544
|
+
enqueueReplaceState: function(publicInstance) {
|
|
1545
|
+
warnNoop(publicInstance, "replaceState");
|
|
1546
|
+
},
|
|
1547
|
+
enqueueSetState: function(publicInstance) {
|
|
1548
|
+
warnNoop(publicInstance, "setState");
|
|
1549
|
+
}
|
|
1550
|
+
}, assign = Object.assign, emptyObject = {};
|
|
1551
|
+
Object.freeze(emptyObject);
|
|
1552
|
+
Component.prototype.isReactComponent = {};
|
|
1553
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
1554
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
1555
|
+
throw Error(
|
|
1556
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
1557
|
+
);
|
|
1558
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
1559
|
+
};
|
|
1560
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
1561
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
1562
|
+
};
|
|
1563
|
+
var deprecatedAPIs = {
|
|
1564
|
+
isMounted: [
|
|
1565
|
+
"isMounted",
|
|
1566
|
+
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
|
1567
|
+
],
|
|
1568
|
+
replaceState: [
|
|
1569
|
+
"replaceState",
|
|
1570
|
+
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
|
1571
|
+
]
|
|
1572
|
+
};
|
|
1573
|
+
for (fnName in deprecatedAPIs)
|
|
1574
|
+
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
1575
|
+
ComponentDummy.prototype = Component.prototype;
|
|
1576
|
+
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
|
1577
|
+
deprecatedAPIs.constructor = PureComponent;
|
|
1578
|
+
assign(deprecatedAPIs, Component.prototype);
|
|
1579
|
+
deprecatedAPIs.isPureReactComponent = true;
|
|
1580
|
+
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
1581
|
+
H: null,
|
|
1582
|
+
A: null,
|
|
1583
|
+
T: null,
|
|
1584
|
+
S: null,
|
|
1585
|
+
actQueue: null,
|
|
1586
|
+
asyncTransitions: 0,
|
|
1587
|
+
isBatchingLegacy: false,
|
|
1588
|
+
didScheduleLegacyUpdate: false,
|
|
1589
|
+
didUsePromise: false,
|
|
1590
|
+
thrownErrors: [],
|
|
1591
|
+
getCurrentStack: null,
|
|
1592
|
+
recentlyCreatedOwnerStacks: 0
|
|
1593
|
+
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
|
1594
|
+
return null;
|
|
1595
|
+
};
|
|
1596
|
+
deprecatedAPIs = {
|
|
1597
|
+
react_stack_bottom_frame: function(callStackForError) {
|
|
1598
|
+
return callStackForError();
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
|
1602
|
+
var didWarnAboutElementRef = {};
|
|
1603
|
+
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
|
|
1604
|
+
deprecatedAPIs,
|
|
1605
|
+
UnknownOwner
|
|
1606
|
+
)();
|
|
1607
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
1608
|
+
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
1609
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
1610
|
+
var event = new window.ErrorEvent("error", {
|
|
1611
|
+
bubbles: true,
|
|
1612
|
+
cancelable: true,
|
|
1613
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
1614
|
+
error
|
|
1615
|
+
});
|
|
1616
|
+
if (!window.dispatchEvent(event)) return;
|
|
1617
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
1618
|
+
process.emit("uncaughtException", error);
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
console.error(error);
|
|
1622
|
+
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
|
1623
|
+
queueMicrotask(function() {
|
|
1624
|
+
return queueMicrotask(callback);
|
|
1625
|
+
});
|
|
1626
|
+
} : enqueueTask;
|
|
1627
|
+
deprecatedAPIs = Object.freeze({
|
|
1628
|
+
__proto__: null,
|
|
1629
|
+
c: function(size) {
|
|
1630
|
+
return resolveDispatcher().useMemoCache(size);
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
var fnName = {
|
|
1634
|
+
map: mapChildren,
|
|
1635
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
1636
|
+
mapChildren(
|
|
1637
|
+
children,
|
|
1638
|
+
function() {
|
|
1639
|
+
forEachFunc.apply(this, arguments);
|
|
1640
|
+
},
|
|
1641
|
+
forEachContext
|
|
1642
|
+
);
|
|
1643
|
+
},
|
|
1644
|
+
count: function(children) {
|
|
1645
|
+
var n = 0;
|
|
1646
|
+
mapChildren(children, function() {
|
|
1647
|
+
n++;
|
|
1648
|
+
});
|
|
1649
|
+
return n;
|
|
1650
|
+
},
|
|
1651
|
+
toArray: function(children) {
|
|
1652
|
+
return mapChildren(children, function(child) {
|
|
1653
|
+
return child;
|
|
1654
|
+
}) || [];
|
|
1655
|
+
},
|
|
1656
|
+
only: function(children) {
|
|
1657
|
+
if (!isValidElement(children))
|
|
1658
|
+
throw Error(
|
|
1659
|
+
"React.Children.only expected to receive a single React element child."
|
|
1660
|
+
);
|
|
1661
|
+
return children;
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
1665
|
+
exports.Children = fnName;
|
|
1666
|
+
exports.Component = Component;
|
|
1667
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1668
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
1669
|
+
exports.PureComponent = PureComponent;
|
|
1670
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1671
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
1672
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
1673
|
+
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
|
1674
|
+
exports.act = function(callback) {
|
|
1675
|
+
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
|
1676
|
+
actScopeDepth++;
|
|
1677
|
+
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
|
1678
|
+
try {
|
|
1679
|
+
var result = callback();
|
|
1680
|
+
} catch (error) {
|
|
1681
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
1682
|
+
}
|
|
1683
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1684
|
+
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1685
|
+
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
|
1686
|
+
var thenable = result;
|
|
1687
|
+
queueSeveralMicrotasks(function() {
|
|
1688
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1689
|
+
"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
|
|
1690
|
+
));
|
|
1691
|
+
});
|
|
1692
|
+
return {
|
|
1693
|
+
then: function(resolve, reject) {
|
|
1694
|
+
didAwaitActCall = true;
|
|
1695
|
+
thenable.then(
|
|
1696
|
+
function(returnValue) {
|
|
1697
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1698
|
+
if (0 === prevActScopeDepth) {
|
|
1699
|
+
try {
|
|
1700
|
+
flushActQueue(queue), enqueueTask(function() {
|
|
1701
|
+
return recursivelyFlushAsyncActWork(
|
|
1702
|
+
returnValue,
|
|
1703
|
+
resolve,
|
|
1704
|
+
reject
|
|
1705
|
+
);
|
|
1706
|
+
});
|
|
1707
|
+
} catch (error$0) {
|
|
1708
|
+
ReactSharedInternals.thrownErrors.push(error$0);
|
|
1709
|
+
}
|
|
1710
|
+
if (0 < ReactSharedInternals.thrownErrors.length) {
|
|
1711
|
+
var _thrownError = aggregateErrors(
|
|
1712
|
+
ReactSharedInternals.thrownErrors
|
|
1713
|
+
);
|
|
1714
|
+
ReactSharedInternals.thrownErrors.length = 0;
|
|
1715
|
+
reject(_thrownError);
|
|
1716
|
+
}
|
|
1717
|
+
} else resolve(returnValue);
|
|
1718
|
+
},
|
|
1719
|
+
function(error) {
|
|
1720
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1721
|
+
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
|
1722
|
+
ReactSharedInternals.thrownErrors
|
|
1723
|
+
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
|
1724
|
+
}
|
|
1725
|
+
);
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
var returnValue$jscomp$0 = result;
|
|
1730
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1731
|
+
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
|
1732
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1733
|
+
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
|
|
1734
|
+
));
|
|
1735
|
+
}), ReactSharedInternals.actQueue = null);
|
|
1736
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1737
|
+
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1738
|
+
return {
|
|
1739
|
+
then: function(resolve, reject) {
|
|
1740
|
+
didAwaitActCall = true;
|
|
1741
|
+
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
|
1742
|
+
return recursivelyFlushAsyncActWork(
|
|
1743
|
+
returnValue$jscomp$0,
|
|
1744
|
+
resolve,
|
|
1745
|
+
reject
|
|
1746
|
+
);
|
|
1747
|
+
})) : resolve(returnValue$jscomp$0);
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
};
|
|
1751
|
+
exports.cache = function(fn) {
|
|
1752
|
+
return function() {
|
|
1753
|
+
return fn.apply(null, arguments);
|
|
1754
|
+
};
|
|
1755
|
+
};
|
|
1756
|
+
exports.cacheSignal = function() {
|
|
1757
|
+
return null;
|
|
1758
|
+
};
|
|
1759
|
+
exports.captureOwnerStack = function() {
|
|
1760
|
+
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
1761
|
+
return null === getCurrentStack ? null : getCurrentStack();
|
|
1762
|
+
};
|
|
1763
|
+
exports.cloneElement = function(element, config, children) {
|
|
1764
|
+
if (null === element || void 0 === element)
|
|
1765
|
+
throw Error(
|
|
1766
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
1767
|
+
);
|
|
1768
|
+
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
|
1769
|
+
if (null != config) {
|
|
1770
|
+
var JSCompiler_inline_result;
|
|
1771
|
+
a: {
|
|
1772
|
+
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
|
1773
|
+
config,
|
|
1774
|
+
"ref"
|
|
1775
|
+
).get) && JSCompiler_inline_result.isReactWarning) {
|
|
1776
|
+
JSCompiler_inline_result = false;
|
|
1777
|
+
break a;
|
|
1778
|
+
}
|
|
1779
|
+
JSCompiler_inline_result = void 0 !== config.ref;
|
|
1780
|
+
}
|
|
1781
|
+
JSCompiler_inline_result && (owner = getOwner());
|
|
1782
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
|
1783
|
+
for (propName in config)
|
|
1784
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
1785
|
+
}
|
|
1786
|
+
var propName = arguments.length - 2;
|
|
1787
|
+
if (1 === propName) props.children = children;
|
|
1788
|
+
else if (1 < propName) {
|
|
1789
|
+
JSCompiler_inline_result = Array(propName);
|
|
1790
|
+
for (var i = 0; i < propName; i++)
|
|
1791
|
+
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
1792
|
+
props.children = JSCompiler_inline_result;
|
|
1793
|
+
}
|
|
1794
|
+
props = ReactElement(
|
|
1795
|
+
element.type,
|
|
1796
|
+
key,
|
|
1797
|
+
props,
|
|
1798
|
+
owner,
|
|
1799
|
+
element._debugStack,
|
|
1800
|
+
element._debugTask
|
|
1801
|
+
);
|
|
1802
|
+
for (key = 2; key < arguments.length; key++)
|
|
1803
|
+
validateChildKeys(arguments[key]);
|
|
1804
|
+
return props;
|
|
1805
|
+
};
|
|
1806
|
+
exports.createContext = function(defaultValue) {
|
|
1807
|
+
defaultValue = {
|
|
1808
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1809
|
+
_currentValue: defaultValue,
|
|
1810
|
+
_currentValue2: defaultValue,
|
|
1811
|
+
_threadCount: 0,
|
|
1812
|
+
Provider: null,
|
|
1813
|
+
Consumer: null
|
|
1814
|
+
};
|
|
1815
|
+
defaultValue.Provider = defaultValue;
|
|
1816
|
+
defaultValue.Consumer = {
|
|
1817
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
1818
|
+
_context: defaultValue
|
|
1819
|
+
};
|
|
1820
|
+
defaultValue._currentRenderer = null;
|
|
1821
|
+
defaultValue._currentRenderer2 = null;
|
|
1822
|
+
return defaultValue;
|
|
1823
|
+
};
|
|
1824
|
+
exports.createElement = function(type, config, children) {
|
|
1825
|
+
for (var i = 2; i < arguments.length; i++)
|
|
1826
|
+
validateChildKeys(arguments[i]);
|
|
1827
|
+
i = {};
|
|
1828
|
+
var key = null;
|
|
1829
|
+
if (null != config)
|
|
1830
|
+
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
|
|
1831
|
+
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
|
1832
|
+
)), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
|
|
1833
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
|
1834
|
+
var childrenLength = arguments.length - 2;
|
|
1835
|
+
if (1 === childrenLength) i.children = children;
|
|
1836
|
+
else if (1 < childrenLength) {
|
|
1837
|
+
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
|
1838
|
+
childArray[_i] = arguments[_i + 2];
|
|
1839
|
+
Object.freeze && Object.freeze(childArray);
|
|
1840
|
+
i.children = childArray;
|
|
1841
|
+
}
|
|
1842
|
+
if (type && type.defaultProps)
|
|
1843
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
1844
|
+
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
|
1845
|
+
key && defineKeyPropWarningGetter(
|
|
1846
|
+
i,
|
|
1847
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1848
|
+
);
|
|
1849
|
+
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1850
|
+
return ReactElement(
|
|
1851
|
+
type,
|
|
1852
|
+
key,
|
|
1853
|
+
i,
|
|
1854
|
+
getOwner(),
|
|
1855
|
+
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1856
|
+
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1857
|
+
);
|
|
1858
|
+
};
|
|
1859
|
+
exports.createRef = function() {
|
|
1860
|
+
var refObject = { current: null };
|
|
1861
|
+
Object.seal(refObject);
|
|
1862
|
+
return refObject;
|
|
1863
|
+
};
|
|
1864
|
+
exports.forwardRef = function(render) {
|
|
1865
|
+
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
|
1866
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
|
1867
|
+
) : "function" !== typeof render ? console.error(
|
|
1868
|
+
"forwardRef requires a render function but was given %s.",
|
|
1869
|
+
null === render ? "null" : typeof render
|
|
1870
|
+
) : 0 !== render.length && 2 !== render.length && console.error(
|
|
1871
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
|
1872
|
+
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
|
1873
|
+
);
|
|
1874
|
+
null != render && null != render.defaultProps && console.error(
|
|
1875
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
|
1876
|
+
);
|
|
1877
|
+
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
|
1878
|
+
Object.defineProperty(elementType, "displayName", {
|
|
1879
|
+
enumerable: false,
|
|
1880
|
+
configurable: true,
|
|
1881
|
+
get: function() {
|
|
1882
|
+
return ownName;
|
|
1883
|
+
},
|
|
1884
|
+
set: function(name) {
|
|
1885
|
+
ownName = name;
|
|
1886
|
+
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
return elementType;
|
|
1890
|
+
};
|
|
1891
|
+
exports.isValidElement = isValidElement;
|
|
1892
|
+
exports.lazy = function(ctor) {
|
|
1893
|
+
ctor = { _status: -1, _result: ctor };
|
|
1894
|
+
var lazyType = {
|
|
1895
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
1896
|
+
_payload: ctor,
|
|
1897
|
+
_init: lazyInitializer
|
|
1898
|
+
}, ioInfo = {
|
|
1899
|
+
name: "lazy",
|
|
1900
|
+
start: -1,
|
|
1901
|
+
end: -1,
|
|
1902
|
+
value: null,
|
|
1903
|
+
owner: null,
|
|
1904
|
+
debugStack: Error("react-stack-top-frame"),
|
|
1905
|
+
debugTask: console.createTask ? console.createTask("lazy()") : null
|
|
1906
|
+
};
|
|
1907
|
+
ctor._ioInfo = ioInfo;
|
|
1908
|
+
lazyType._debugInfo = [{ awaited: ioInfo }];
|
|
1909
|
+
return lazyType;
|
|
1910
|
+
};
|
|
1911
|
+
exports.memo = function(type, compare) {
|
|
1912
|
+
null == type && console.error(
|
|
1913
|
+
"memo: The first argument must be a component. Instead received: %s",
|
|
1914
|
+
null === type ? "null" : typeof type
|
|
1915
|
+
);
|
|
1916
|
+
compare = {
|
|
1917
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
1918
|
+
type,
|
|
1919
|
+
compare: void 0 === compare ? null : compare
|
|
1920
|
+
};
|
|
1921
|
+
var ownName;
|
|
1922
|
+
Object.defineProperty(compare, "displayName", {
|
|
1923
|
+
enumerable: false,
|
|
1924
|
+
configurable: true,
|
|
1925
|
+
get: function() {
|
|
1926
|
+
return ownName;
|
|
1927
|
+
},
|
|
1928
|
+
set: function(name) {
|
|
1929
|
+
ownName = name;
|
|
1930
|
+
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
|
1931
|
+
}
|
|
1932
|
+
});
|
|
1933
|
+
return compare;
|
|
1934
|
+
};
|
|
1935
|
+
exports.startTransition = function(scope) {
|
|
1936
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
1937
|
+
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
1938
|
+
ReactSharedInternals.T = currentTransition;
|
|
1939
|
+
try {
|
|
1940
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
1941
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
1942
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
|
|
1943
|
+
} catch (error) {
|
|
1944
|
+
reportGlobalError(error);
|
|
1945
|
+
} finally {
|
|
1946
|
+
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
|
1947
|
+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
1948
|
+
)), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
|
|
1949
|
+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
|
|
1950
|
+
), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
1951
|
+
}
|
|
1952
|
+
};
|
|
1953
|
+
exports.unstable_useCacheRefresh = function() {
|
|
1954
|
+
return resolveDispatcher().useCacheRefresh();
|
|
1955
|
+
};
|
|
1956
|
+
exports.use = function(usable) {
|
|
1957
|
+
return resolveDispatcher().use(usable);
|
|
1958
|
+
};
|
|
1959
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
1960
|
+
return resolveDispatcher().useActionState(
|
|
1961
|
+
action,
|
|
1962
|
+
initialState,
|
|
1963
|
+
permalink
|
|
1964
|
+
);
|
|
1965
|
+
};
|
|
1966
|
+
exports.useCallback = function(callback, deps) {
|
|
1967
|
+
return resolveDispatcher().useCallback(callback, deps);
|
|
1968
|
+
};
|
|
1969
|
+
exports.useContext = function(Context) {
|
|
1970
|
+
var dispatcher = resolveDispatcher();
|
|
1971
|
+
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
|
1972
|
+
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
|
1973
|
+
);
|
|
1974
|
+
return dispatcher.useContext(Context);
|
|
1975
|
+
};
|
|
1976
|
+
exports.useDebugValue = function(value, formatterFn) {
|
|
1977
|
+
return resolveDispatcher().useDebugValue(value, formatterFn);
|
|
1978
|
+
};
|
|
1979
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
1980
|
+
return resolveDispatcher().useDeferredValue(value, initialValue);
|
|
1981
|
+
};
|
|
1982
|
+
exports.useEffect = function(create, deps) {
|
|
1983
|
+
null == create && console.warn(
|
|
1984
|
+
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1985
|
+
);
|
|
1986
|
+
return resolveDispatcher().useEffect(create, deps);
|
|
1987
|
+
};
|
|
1988
|
+
exports.useEffectEvent = function(callback) {
|
|
1989
|
+
return resolveDispatcher().useEffectEvent(callback);
|
|
1990
|
+
};
|
|
1991
|
+
exports.useId = function() {
|
|
1992
|
+
return resolveDispatcher().useId();
|
|
1993
|
+
};
|
|
1994
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
1995
|
+
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
|
1996
|
+
};
|
|
1997
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
1998
|
+
null == create && console.warn(
|
|
1999
|
+
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
2000
|
+
);
|
|
2001
|
+
return resolveDispatcher().useInsertionEffect(create, deps);
|
|
2002
|
+
};
|
|
2003
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
2004
|
+
null == create && console.warn(
|
|
2005
|
+
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
2006
|
+
);
|
|
2007
|
+
return resolveDispatcher().useLayoutEffect(create, deps);
|
|
2008
|
+
};
|
|
2009
|
+
exports.useMemo = function(create, deps) {
|
|
2010
|
+
return resolveDispatcher().useMemo(create, deps);
|
|
2011
|
+
};
|
|
2012
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
2013
|
+
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
|
2014
|
+
};
|
|
2015
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
2016
|
+
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
|
2017
|
+
};
|
|
2018
|
+
exports.useRef = function(initialValue) {
|
|
2019
|
+
return resolveDispatcher().useRef(initialValue);
|
|
2020
|
+
};
|
|
2021
|
+
exports.useState = function(initialState) {
|
|
2022
|
+
return resolveDispatcher().useState(initialState);
|
|
2023
|
+
};
|
|
2024
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
2025
|
+
return resolveDispatcher().useSyncExternalStore(
|
|
2026
|
+
subscribe,
|
|
2027
|
+
getSnapshot,
|
|
2028
|
+
getServerSnapshot
|
|
2029
|
+
);
|
|
2030
|
+
};
|
|
2031
|
+
exports.useTransition = function() {
|
|
2032
|
+
return resolveDispatcher().useTransition();
|
|
2033
|
+
};
|
|
2034
|
+
exports.version = "19.2.3";
|
|
2035
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
2036
|
+
})();
|
|
2037
|
+
}
|
|
2038
|
+
});
|
|
2039
|
+
|
|
2040
|
+
// ../../node_modules/react/index.js
|
|
2041
|
+
var require_react = __commonJS({
|
|
2042
|
+
"../../node_modules/react/index.js"(exports, module) {
|
|
2043
|
+
"use strict";
|
|
2044
|
+
if (process.env.NODE_ENV === "production") {
|
|
2045
|
+
module.exports = require_react_production();
|
|
2046
|
+
} else {
|
|
2047
|
+
module.exports = require_react_development();
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
});
|
|
2051
|
+
|
|
2052
|
+
// ../../node_modules/@terminals-tech/core/dist/adapters/ReactAdapter.js
|
|
2053
|
+
var require_ReactAdapter = __commonJS({
|
|
2054
|
+
"../../node_modules/@terminals-tech/core/dist/adapters/ReactAdapter.js"(exports) {
|
|
2055
|
+
"use strict";
|
|
2056
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2057
|
+
exports.ReactAdapter = void 0;
|
|
2058
|
+
exports.useEventStore = useEventStore;
|
|
2059
|
+
exports.createEventStoreHook = createEventStoreHook;
|
|
2060
|
+
var react_1 = require_react();
|
|
2061
|
+
var BaseAdapter_1 = require_BaseAdapter();
|
|
2062
|
+
var ReactAdapter = class extends BaseAdapter_1.BaseAdapter {
|
|
2063
|
+
async save() {
|
|
2064
|
+
const snapshot = this.store.snapshot();
|
|
2065
|
+
localStorage.setItem("event-store", JSON.stringify(snapshot));
|
|
2066
|
+
}
|
|
2067
|
+
async load() {
|
|
2068
|
+
const saved = localStorage.getItem("event-store");
|
|
2069
|
+
if (saved) {
|
|
2070
|
+
const snapshot = JSON.parse(saved);
|
|
2071
|
+
this.store.restore(snapshot);
|
|
2072
|
+
this.notifyListeners();
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
exports.ReactAdapter = ReactAdapter;
|
|
2077
|
+
function useEventStore(initialState, reducer, options) {
|
|
2078
|
+
const adapter = (0, react_1.useCallback)(() => {
|
|
2079
|
+
return new ReactAdapter(initialState, reducer, options);
|
|
2080
|
+
}, []);
|
|
2081
|
+
const instance = adapter();
|
|
2082
|
+
const state = (0, react_1.useSyncExternalStore)((callback) => instance.subscribe(callback), () => instance.getState(), () => instance.getState());
|
|
2083
|
+
return {
|
|
2084
|
+
state,
|
|
2085
|
+
dispatch: (0, react_1.useCallback)((event) => instance.dispatch(event), [instance]),
|
|
2086
|
+
undo: (0, react_1.useCallback)(() => instance.undo(), [instance]),
|
|
2087
|
+
redo: (0, react_1.useCallback)(() => instance.redo(), [instance]),
|
|
2088
|
+
canUndo: instance.canUndo(),
|
|
2089
|
+
canRedo: instance.canRedo(),
|
|
2090
|
+
events: instance.getEvents(),
|
|
2091
|
+
navigateToTime: (0, react_1.useCallback)((timestamp) => instance.navigateToTime(timestamp), [instance])
|
|
2092
|
+
};
|
|
2093
|
+
}
|
|
2094
|
+
function createEventStoreHook(initialState, reducer, options) {
|
|
2095
|
+
let adapter = null;
|
|
2096
|
+
return function useStore() {
|
|
2097
|
+
if (!adapter) {
|
|
2098
|
+
adapter = new ReactAdapter(initialState, reducer, options);
|
|
2099
|
+
}
|
|
2100
|
+
const state = (0, react_1.useSyncExternalStore)((callback) => adapter.subscribe(callback), () => adapter.getState(), () => adapter.getState());
|
|
2101
|
+
return {
|
|
2102
|
+
state,
|
|
2103
|
+
dispatch: (event) => adapter.dispatch(event),
|
|
2104
|
+
undo: () => adapter.undo(),
|
|
2105
|
+
redo: () => adapter.redo(),
|
|
2106
|
+
canUndo: adapter.canUndo(),
|
|
2107
|
+
canRedo: adapter.canRedo(),
|
|
2108
|
+
events: adapter.getEvents(),
|
|
2109
|
+
navigateToTime: (timestamp) => adapter.navigateToTime(timestamp),
|
|
2110
|
+
save: () => adapter.save(),
|
|
2111
|
+
load: () => adapter.load()
|
|
2112
|
+
};
|
|
2113
|
+
};
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
|
|
2118
|
+
// ../../node_modules/@terminals-tech/core/dist/semantic/Embedder.js
|
|
2119
|
+
var require_Embedder = __commonJS({
|
|
2120
|
+
"../../node_modules/@terminals-tech/core/dist/semantic/Embedder.js"(exports) {
|
|
2121
|
+
"use strict";
|
|
2122
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2123
|
+
exports.EventEmbedder = exports.OpenAIEmbedder = exports.MockEmbedder = void 0;
|
|
2124
|
+
var MockEmbedder = class {
|
|
2125
|
+
constructor() {
|
|
2126
|
+
this.model = "mock";
|
|
2127
|
+
this.dimensions = 768;
|
|
2128
|
+
}
|
|
2129
|
+
async embed(text) {
|
|
2130
|
+
const vector = new Array(this.dimensions);
|
|
2131
|
+
let hash = 0;
|
|
2132
|
+
for (let i = 0; i < text.length; i++) {
|
|
2133
|
+
hash = (hash << 5) - hash + text.charCodeAt(i);
|
|
2134
|
+
hash = hash & hash;
|
|
2135
|
+
}
|
|
2136
|
+
for (let i = 0; i < this.dimensions; i++) {
|
|
2137
|
+
vector[i] = Math.sin(hash * (i + 1)) * 0.5 + 0.5;
|
|
2138
|
+
}
|
|
2139
|
+
return vector;
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2142
|
+
exports.MockEmbedder = MockEmbedder;
|
|
2143
|
+
var OpenAIEmbedder = class {
|
|
2144
|
+
constructor(apiKey) {
|
|
2145
|
+
this.apiKey = apiKey;
|
|
2146
|
+
this.model = "text-embedding-ada-002";
|
|
2147
|
+
this.dimensions = 1536;
|
|
2148
|
+
}
|
|
2149
|
+
async embed(text) {
|
|
2150
|
+
const response = await fetch("https://api.openai.com/v1/embeddings", {
|
|
2151
|
+
method: "POST",
|
|
2152
|
+
headers: {
|
|
2153
|
+
"Content-Type": "application/json",
|
|
2154
|
+
"Authorization": `Bearer ${this.apiKey}`
|
|
2155
|
+
},
|
|
2156
|
+
body: JSON.stringify({
|
|
2157
|
+
model: this.model,
|
|
2158
|
+
input: text
|
|
2159
|
+
})
|
|
2160
|
+
});
|
|
2161
|
+
const data = await response.json();
|
|
2162
|
+
return data.data[0].embedding;
|
|
2163
|
+
}
|
|
2164
|
+
};
|
|
2165
|
+
exports.OpenAIEmbedder = OpenAIEmbedder;
|
|
2166
|
+
var EventEmbedder = class {
|
|
2167
|
+
constructor(provider, eventToText) {
|
|
2168
|
+
this.provider = provider;
|
|
2169
|
+
this.eventToText = eventToText;
|
|
2170
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* Get embedding for an event
|
|
2174
|
+
*/
|
|
2175
|
+
async embed(event) {
|
|
2176
|
+
if (this.cache.has(event.id)) {
|
|
2177
|
+
return this.cache.get(event.id);
|
|
2178
|
+
}
|
|
2179
|
+
const text = this.eventToText(event);
|
|
2180
|
+
const vector = await this.provider.embed(text);
|
|
2181
|
+
this.cache.set(event.id, vector);
|
|
2182
|
+
return vector;
|
|
2183
|
+
}
|
|
2184
|
+
/**
|
|
2185
|
+
* Batch embed multiple events
|
|
2186
|
+
*/
|
|
2187
|
+
async embedBatch(events) {
|
|
2188
|
+
const results = /* @__PURE__ */ new Map();
|
|
2189
|
+
for (const event of events) {
|
|
2190
|
+
const vector = await this.embed(event);
|
|
2191
|
+
results.set(event.id, vector);
|
|
2192
|
+
}
|
|
2193
|
+
return results;
|
|
2194
|
+
}
|
|
2195
|
+
/**
|
|
2196
|
+
* Clear embedding cache
|
|
2197
|
+
*/
|
|
2198
|
+
clearCache() {
|
|
2199
|
+
this.cache.clear();
|
|
2200
|
+
}
|
|
2201
|
+
};
|
|
2202
|
+
exports.EventEmbedder = EventEmbedder;
|
|
2203
|
+
}
|
|
2204
|
+
});
|
|
2205
|
+
|
|
2206
|
+
// ../../node_modules/@terminals-tech/core/dist/semantic/SemanticSearch.js
|
|
2207
|
+
var require_SemanticSearch = __commonJS({
|
|
2208
|
+
"../../node_modules/@terminals-tech/core/dist/semantic/SemanticSearch.js"(exports) {
|
|
2209
|
+
"use strict";
|
|
2210
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2211
|
+
exports.SemanticSearch = void 0;
|
|
2212
|
+
exports.cosineSimilarity = cosineSimilarity;
|
|
2213
|
+
function cosineSimilarity(a, b) {
|
|
2214
|
+
if (a.length !== b.length) {
|
|
2215
|
+
throw new Error("Vectors must have same dimensions");
|
|
2216
|
+
}
|
|
2217
|
+
let dotProduct = 0;
|
|
2218
|
+
let normA = 0;
|
|
2219
|
+
let normB = 0;
|
|
2220
|
+
for (let i = 0; i < a.length; i++) {
|
|
2221
|
+
dotProduct += a[i] * b[i];
|
|
2222
|
+
normA += a[i] * a[i];
|
|
2223
|
+
normB += b[i] * b[i];
|
|
2224
|
+
}
|
|
2225
|
+
normA = Math.sqrt(normA);
|
|
2226
|
+
normB = Math.sqrt(normB);
|
|
2227
|
+
if (normA === 0 || normB === 0) {
|
|
2228
|
+
return 0;
|
|
2229
|
+
}
|
|
2230
|
+
return dotProduct / (normA * normB);
|
|
2231
|
+
}
|
|
2232
|
+
var SemanticSearch = class {
|
|
2233
|
+
constructor(events, embeddings) {
|
|
2234
|
+
this.events = events;
|
|
2235
|
+
this.embeddings = embeddings;
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* Find k most similar events to query vector
|
|
2239
|
+
*/
|
|
2240
|
+
findSimilar(queryVector, k = 10) {
|
|
2241
|
+
const results = this.events.map((event) => {
|
|
2242
|
+
const embedding = this.embeddings.get(event.id);
|
|
2243
|
+
if (!embedding)
|
|
2244
|
+
return null;
|
|
2245
|
+
return {
|
|
2246
|
+
event,
|
|
2247
|
+
similarity: cosineSimilarity(queryVector, embedding)
|
|
2248
|
+
};
|
|
2249
|
+
}).filter((item) => item !== null).sort((a, b) => b.similarity - a.similarity).slice(0, k);
|
|
2250
|
+
return results;
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Find events within similarity threshold
|
|
2254
|
+
*/
|
|
2255
|
+
findWithinThreshold(queryVector, threshold = 0.8) {
|
|
2256
|
+
return this.events.filter((event) => {
|
|
2257
|
+
const embedding = this.embeddings.get(event.id);
|
|
2258
|
+
if (!embedding)
|
|
2259
|
+
return false;
|
|
2260
|
+
const similarity = cosineSimilarity(queryVector, embedding);
|
|
2261
|
+
return similarity >= threshold;
|
|
2262
|
+
});
|
|
2263
|
+
}
|
|
2264
|
+
/**
|
|
2265
|
+
* Cluster events by similarity
|
|
2266
|
+
*/
|
|
2267
|
+
cluster(threshold = 0.8) {
|
|
2268
|
+
const clusters = [];
|
|
2269
|
+
const visited = /* @__PURE__ */ new Set();
|
|
2270
|
+
for (const event of this.events) {
|
|
2271
|
+
if (visited.has(event.id))
|
|
2272
|
+
continue;
|
|
2273
|
+
const cluster = [event];
|
|
2274
|
+
visited.add(event.id);
|
|
2275
|
+
const eventEmbedding = this.embeddings.get(event.id);
|
|
2276
|
+
if (!eventEmbedding)
|
|
2277
|
+
continue;
|
|
2278
|
+
for (const other of this.events) {
|
|
2279
|
+
if (visited.has(other.id))
|
|
2280
|
+
continue;
|
|
2281
|
+
const otherEmbedding = this.embeddings.get(other.id);
|
|
2282
|
+
if (!otherEmbedding)
|
|
2283
|
+
continue;
|
|
2284
|
+
const similarity = cosineSimilarity(eventEmbedding, otherEmbedding);
|
|
2285
|
+
if (similarity >= threshold) {
|
|
2286
|
+
cluster.push(other);
|
|
2287
|
+
visited.add(other.id);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
clusters.push(cluster);
|
|
2291
|
+
}
|
|
2292
|
+
return clusters;
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Find events in time window with semantic filter
|
|
2296
|
+
*/
|
|
2297
|
+
findInTimeWindow(startTime, endTime, queryVector, minSimilarity) {
|
|
2298
|
+
let filtered = this.events.filter((event) => event.timestamp >= startTime && event.timestamp <= endTime);
|
|
2299
|
+
if (queryVector && minSimilarity) {
|
|
2300
|
+
filtered = filtered.filter((event) => {
|
|
2301
|
+
const embedding = this.embeddings.get(event.id);
|
|
2302
|
+
if (!embedding)
|
|
2303
|
+
return false;
|
|
2304
|
+
const similarity = cosineSimilarity(queryVector, embedding);
|
|
2305
|
+
return similarity >= minSimilarity;
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2308
|
+
return filtered;
|
|
2309
|
+
}
|
|
2310
|
+
};
|
|
2311
|
+
exports.SemanticSearch = SemanticSearch;
|
|
2312
|
+
}
|
|
2313
|
+
});
|
|
2314
|
+
|
|
2315
|
+
// ../../node_modules/@terminals-tech/core/dist/index.js
|
|
2316
|
+
var require_dist = __commonJS({
|
|
2317
|
+
"../../node_modules/@terminals-tech/core/dist/index.js"(exports) {
|
|
2318
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2319
|
+
exports.cosineSimilarity = exports.SemanticSearch = exports.EventEmbedder = exports.OpenAIEmbedder = exports.MockEmbedder = exports.createEventStoreHook = exports.useEventStore = exports.ReactAdapter = exports.BaseAdapter = void 0;
|
|
2320
|
+
var EventStore_1 = require_EventStore();
|
|
2321
|
+
var ReplayManager_1 = require_ReplayManager();
|
|
2322
|
+
function createStore(initialState, reducer, options) {
|
|
2323
|
+
return new EventStore_1.EventStore(initialState, reducer, options);
|
|
2324
|
+
}
|
|
2325
|
+
function createReplayManager(store, config) {
|
|
2326
|
+
return new ReplayManager_1.ReplayManager(store, config);
|
|
2327
|
+
}
|
|
2328
|
+
function init(config = {}) {
|
|
2329
|
+
const defaultReducer = (state, event) => ({ ...state, lastEvent: event });
|
|
2330
|
+
const initialState = config.initialState || {};
|
|
2331
|
+
const reducer = config.reducer || defaultReducer;
|
|
2332
|
+
const storeOptions = {
|
|
2333
|
+
maxEvents: config.maxEvents || 1e4,
|
|
2334
|
+
enableCheckpoints: config.enableCheckpoints !== false,
|
|
2335
|
+
checkpointInterval: 100,
|
|
2336
|
+
redactFields: config.redact,
|
|
2337
|
+
captureErrors: config.uploadOn?.includes("error"),
|
|
2338
|
+
uploadOn: config.uploadOn
|
|
2339
|
+
};
|
|
2340
|
+
const store = new EventStore_1.EventStore(initialState, reducer, storeOptions);
|
|
2341
|
+
const replayConfig = {
|
|
2342
|
+
apiKey: config.apiKey,
|
|
2343
|
+
endpoint: config.endpoint,
|
|
2344
|
+
redact: config.redact,
|
|
2345
|
+
maxEvents: config.maxEvents,
|
|
2346
|
+
uploadOn: config.uploadOn || ["error"],
|
|
2347
|
+
sessionId: config.sessionId || `session-${Date.now()}`,
|
|
2348
|
+
userId: config.userId,
|
|
2349
|
+
metadata: config.metadata
|
|
2350
|
+
};
|
|
2351
|
+
const replay = new ReplayManager_1.ReplayManager(store, replayConfig);
|
|
2352
|
+
const api = {
|
|
2353
|
+
store,
|
|
2354
|
+
replay,
|
|
2355
|
+
dispatch: (event) => store.append(event),
|
|
2356
|
+
undo: () => store.undo(),
|
|
2357
|
+
redo: () => store.redo(),
|
|
2358
|
+
generateReplay: async (error) => replay.captureAndUpload(error),
|
|
2359
|
+
rewind: (steps) => {
|
|
2360
|
+
const newIndex = Math.max(-1, store.getIndex() - steps);
|
|
2361
|
+
store.navigate(newIndex);
|
|
2362
|
+
},
|
|
2363
|
+
export: () => store.snapshot()
|
|
2364
|
+
};
|
|
2365
|
+
if (typeof window !== "undefined") {
|
|
2366
|
+
window.terminals = {
|
|
2367
|
+
...terminals,
|
|
2368
|
+
// Main object
|
|
2369
|
+
...api
|
|
2370
|
+
// Instance methods
|
|
2371
|
+
};
|
|
2372
|
+
}
|
|
2373
|
+
return api;
|
|
2374
|
+
}
|
|
2375
|
+
var terminals = {
|
|
2376
|
+
init,
|
|
2377
|
+
createStore,
|
|
2378
|
+
createReplayManager,
|
|
2379
|
+
version: "1.0.0",
|
|
2380
|
+
EventStore: EventStore_1.EventStore,
|
|
2381
|
+
ReplayManager: ReplayManager_1.ReplayManager
|
|
2382
|
+
};
|
|
2383
|
+
exports.default = terminals;
|
|
2384
|
+
var BaseAdapter_1 = require_BaseAdapter();
|
|
2385
|
+
Object.defineProperty(exports, "BaseAdapter", { enumerable: true, get: function() {
|
|
2386
|
+
return BaseAdapter_1.BaseAdapter;
|
|
2387
|
+
} });
|
|
2388
|
+
var ReactAdapter_1 = require_ReactAdapter();
|
|
2389
|
+
Object.defineProperty(exports, "ReactAdapter", { enumerable: true, get: function() {
|
|
2390
|
+
return ReactAdapter_1.ReactAdapter;
|
|
2391
|
+
} });
|
|
2392
|
+
Object.defineProperty(exports, "useEventStore", { enumerable: true, get: function() {
|
|
2393
|
+
return ReactAdapter_1.useEventStore;
|
|
2394
|
+
} });
|
|
2395
|
+
Object.defineProperty(exports, "createEventStoreHook", { enumerable: true, get: function() {
|
|
2396
|
+
return ReactAdapter_1.createEventStoreHook;
|
|
2397
|
+
} });
|
|
2398
|
+
var Embedder_1 = require_Embedder();
|
|
2399
|
+
Object.defineProperty(exports, "MockEmbedder", { enumerable: true, get: function() {
|
|
2400
|
+
return Embedder_1.MockEmbedder;
|
|
2401
|
+
} });
|
|
2402
|
+
Object.defineProperty(exports, "OpenAIEmbedder", { enumerable: true, get: function() {
|
|
2403
|
+
return Embedder_1.OpenAIEmbedder;
|
|
2404
|
+
} });
|
|
2405
|
+
Object.defineProperty(exports, "EventEmbedder", { enumerable: true, get: function() {
|
|
2406
|
+
return Embedder_1.EventEmbedder;
|
|
2407
|
+
} });
|
|
2408
|
+
var SemanticSearch_1 = require_SemanticSearch();
|
|
2409
|
+
Object.defineProperty(exports, "SemanticSearch", { enumerable: true, get: function() {
|
|
2410
|
+
return SemanticSearch_1.SemanticSearch;
|
|
2411
|
+
} });
|
|
2412
|
+
Object.defineProperty(exports, "cosineSimilarity", { enumerable: true, get: function() {
|
|
2413
|
+
return SemanticSearch_1.cosineSimilarity;
|
|
2414
|
+
} });
|
|
2415
|
+
}
|
|
2416
|
+
});
|
|
2417
|
+
export default require_dist();
|
|
2418
|
+
/*! Bundled license information:
|
|
2419
|
+
|
|
2420
|
+
react/cjs/react.production.js:
|
|
2421
|
+
(**
|
|
2422
|
+
* @license React
|
|
2423
|
+
* react.production.js
|
|
2424
|
+
*
|
|
2425
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2426
|
+
*
|
|
2427
|
+
* This source code is licensed under the MIT license found in the
|
|
2428
|
+
* LICENSE file in the root directory of this source tree.
|
|
2429
|
+
*)
|
|
2430
|
+
|
|
2431
|
+
react/cjs/react.development.js:
|
|
2432
|
+
(**
|
|
2433
|
+
* @license React
|
|
2434
|
+
* react.development.js
|
|
2435
|
+
*
|
|
2436
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2437
|
+
*
|
|
2438
|
+
* This source code is licensed under the MIT license found in the
|
|
2439
|
+
* LICENSE file in the root directory of this source tree.
|
|
2440
|
+
*)
|
|
2441
|
+
*/
|