@qidcloud/sdk 1.1.1 → 1.2.1

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/index.mjs ADDED
@@ -0,0 +1,2425 @@
1
+ import axios from 'axios';
2
+ import { io } from 'socket.io-client';
3
+ import { QRCodeSVG } from 'qrcode.react';
4
+
5
+ class AuthModule {
6
+ sdk;
7
+ socket = null;
8
+ constructor(sdk) {
9
+ this.sdk = sdk;
10
+ }
11
+ /**
12
+ * Initialize a new handshake session for QR login
13
+ */
14
+ async createSession() {
15
+ const resp = await this.sdk.api.post('/api/initiate-generic');
16
+ const { sessionId, nonce } = resp.data;
17
+ // Construct QR data
18
+ const qrData = `qid: handshake:${sessionId}:${nonce} `;
19
+ return {
20
+ sessionId,
21
+ qrData,
22
+ expiresAt: Date.now() + 120000 // 2 minutes
23
+ };
24
+ }
25
+ /**
26
+ * Listen for authorization events for a specific session
27
+ */
28
+ listen(sessionId, onAuthorized, onDenied) {
29
+ if (!this.socket) {
30
+ const baseUrl = this.sdk.getConfig().baseUrl || 'https://api.qidcloud.com';
31
+ this.socket = io(baseUrl);
32
+ }
33
+ this.socket.emit('join', sessionId);
34
+ this.socket.on('authenticated', (token) => {
35
+ onAuthorized(token);
36
+ });
37
+ this.socket.on('identity_authorized', (data) => {
38
+ // Some backend routes wrap the token in an object
39
+ const token = typeof data === 'string' ? data : data.token;
40
+ onAuthorized(token);
41
+ });
42
+ this.socket.on('identity_denied', (data) => {
43
+ if (onDenied)
44
+ onDenied(data.message || 'Authorization denied');
45
+ });
46
+ }
47
+ /**
48
+ * Stop listening and disconnect socket
49
+ */
50
+ disconnect() {
51
+ if (this.socket) {
52
+ this.socket.disconnect();
53
+ this.socket = null;
54
+ }
55
+ }
56
+ /**
57
+ * Fetch user profile using a session token
58
+ */
59
+ async getProfile(token) {
60
+ const resp = await this.sdk.api.get('/api/me', {
61
+ headers: {
62
+ 'Authorization': `Bearer ${token}`
63
+ }
64
+ });
65
+ return resp.data;
66
+ }
67
+ }
68
+
69
+ class DbModule {
70
+ sdk;
71
+ constructor(sdk) {
72
+ this.sdk = sdk;
73
+ }
74
+ /**
75
+ * Execute a SQL query against the project's enclave database
76
+ * @param sql The SQL query string
77
+ * @param params Parameterized values for the query
78
+ * @param userToken Optional session token for user-scoped access
79
+ */
80
+ async query(sql, params = [], userToken) {
81
+ const headers = {};
82
+ if (userToken) {
83
+ headers['Authorization'] = `Bearer ${userToken}`;
84
+ }
85
+ const resp = await this.sdk.api.post('/api/db/query', { sql, params }, { headers });
86
+ return resp.data;
87
+ }
88
+ /**
89
+ * Initialize the project's enclave database schema
90
+ * Useful for first-time project setup
91
+ */
92
+ async setup(userToken) {
93
+ const headers = {};
94
+ if (userToken) {
95
+ headers['Authorization'] = `Bearer ${userToken}`;
96
+ }
97
+ const resp = await this.sdk.api.post('/api/db/setup', {}, { headers });
98
+ return resp.data;
99
+ }
100
+ }
101
+
102
+ class EdgeModule {
103
+ sdk;
104
+ constructor(sdk) {
105
+ this.sdk = sdk;
106
+ }
107
+ /**
108
+ * Invoke a serverless edge function
109
+ * @param name Name of the function to invoke
110
+ * @param params Arguments passed to the function
111
+ * @param userToken Optional session token for user-scoped access
112
+ */
113
+ async invoke(name, params = {}, userToken) {
114
+ const headers = {};
115
+ if (userToken) {
116
+ headers['Authorization'] = `Bearer ${userToken}`;
117
+ }
118
+ const resp = await this.sdk.api.post('/api/edge/invoke', { name, params }, { headers });
119
+ return resp.data;
120
+ }
121
+ /**
122
+ * List all functions in the project enclave
123
+ */
124
+ async list() {
125
+ const resp = await this.sdk.api.get('/api/edge/list');
126
+ return resp.data;
127
+ }
128
+ /**
129
+ * Get logs for a specific function
130
+ * @param name Function name
131
+ * @param userToken Optional session token
132
+ */
133
+ async getLogs(name, userToken) {
134
+ const headers = {};
135
+ if (userToken)
136
+ headers['Authorization'] = `Bearer ${userToken}`;
137
+ const resp = await this.sdk.api.get(`/api/edge/${name}/logs`, { headers });
138
+ return resp.data;
139
+ }
140
+ /**
141
+ * Get project-wide enclave logs
142
+ */
143
+ async getProjectLogs(userToken) {
144
+ const headers = {};
145
+ if (userToken)
146
+ headers['Authorization'] = `Bearer ${userToken}`;
147
+ const resp = await this.sdk.api.get('/api/edge/logs/project', { headers });
148
+ return resp.data;
149
+ }
150
+ /**
151
+ * Delete a function from the enclave
152
+ */
153
+ async delete(name, userToken) {
154
+ const headers = {};
155
+ if (userToken)
156
+ headers['Authorization'] = `Bearer ${userToken}`;
157
+ const resp = await this.sdk.api.delete(`/api/edge/${name}`, { headers });
158
+ return resp.data;
159
+ }
160
+ /**
161
+ * Deploy a new function or update an existing one
162
+ * @param data Deployment data including name, code, and optional envVars
163
+ * @param userToken Optional session token
164
+ */
165
+ async deploy(data, userToken) {
166
+ const headers = {};
167
+ if (userToken)
168
+ headers['Authorization'] = `Bearer ${userToken}`;
169
+ const resp = await this.sdk.api.post('/api/edge/deploy', data, { headers });
170
+ return resp.data;
171
+ }
172
+ /**
173
+ * Get available serverless runtimes
174
+ */
175
+ async getRuntimes() {
176
+ const resp = await this.sdk.api.get('/api/edge/runtimes');
177
+ return resp.data;
178
+ }
179
+ /**
180
+ * Toggle centralized logging for the project's edge functions
181
+ * @param enabled Whether to enable or disable logging
182
+ * @param userToken Optional session token
183
+ */
184
+ async toggleLogging(enabled, userToken) {
185
+ const headers = {};
186
+ if (userToken)
187
+ headers['Authorization'] = `Bearer ${userToken}`;
188
+ const resp = await this.sdk.api.post('/api/edge/logs/settings', { enabled }, { headers });
189
+ return resp.data;
190
+ }
191
+ }
192
+
193
+ class VaultModule {
194
+ sdk;
195
+ constructor(sdk) {
196
+ this.sdk = sdk;
197
+ }
198
+ /**
199
+ * Upload a file to the project's secure enclave storage
200
+ * @param file The file data (Buffer or Blob)
201
+ * @param fileName Name of the file
202
+ * @param metadata Optional E2EE metadata or custom tags
203
+ * @param userToken Session token for user-scoped storage
204
+ */
205
+ async upload(file, fileName, metadata = {}, userToken) {
206
+ const formData = new FormData();
207
+ formData.append('file', file, fileName);
208
+ formData.append('metadata', JSON.stringify(metadata));
209
+ const headers = {
210
+ 'Content-Type': 'multipart/form-data'
211
+ };
212
+ if (userToken) {
213
+ headers['Authorization'] = `Bearer ${userToken}`;
214
+ }
215
+ const resp = await this.sdk.api.post('/api/storage/upload', formData, { headers });
216
+ return resp.data;
217
+ }
218
+ /**
219
+ * List files in the project enclave
220
+ * @param userToken Session token for user-scoped storage
221
+ */
222
+ async list(userToken) {
223
+ const headers = {};
224
+ if (userToken) {
225
+ headers['Authorization'] = `Bearer ${userToken}`;
226
+ }
227
+ const resp = await this.sdk.api.get('/api/storage/list', { headers });
228
+ return resp.data;
229
+ }
230
+ /**
231
+ * Download a file from storage
232
+ * @param fileId Unique ID of the file
233
+ * @param userToken Session token for user-scoped storage
234
+ */
235
+ async download(fileId, userToken) {
236
+ const headers = {};
237
+ if (userToken) {
238
+ headers['Authorization'] = `Bearer ${userToken}`;
239
+ }
240
+ const resp = await this.sdk.api.get(`/api/storage/${fileId}`, {
241
+ headers,
242
+ responseType: 'arraybuffer'
243
+ });
244
+ return resp.data;
245
+ }
246
+ /**
247
+ * Delete a file from storage (Soft Delete)
248
+ * @param fileId Unique ID of the file
249
+ * @param userToken Session token for user-scoped storage
250
+ */
251
+ async delete(fileId, userToken) {
252
+ const headers = {};
253
+ if (userToken) {
254
+ headers['Authorization'] = `Bearer ${userToken}`;
255
+ }
256
+ const resp = await this.sdk.api.delete(`/api/storage/${fileId}`, { headers });
257
+ return resp.data;
258
+ }
259
+ /**
260
+ * List deleted files in the project enclave (Recycle Bin)
261
+ * @param userToken Session token for user-scoped storage
262
+ */
263
+ async listDeleted(userToken) {
264
+ const headers = {};
265
+ if (userToken) {
266
+ headers['Authorization'] = `Bearer ${userToken}`;
267
+ }
268
+ const resp = await this.sdk.api.get('/api/storage/deleted', { headers });
269
+ return resp.data;
270
+ }
271
+ /**
272
+ * Restore a deleted file from the recycle bin
273
+ * @param fileId Unique ID of the file
274
+ * @param userToken Session token for user-scoped storage
275
+ */
276
+ async restore(fileId, userToken) {
277
+ const headers = {};
278
+ if (userToken) {
279
+ headers['Authorization'] = `Bearer ${userToken}`;
280
+ }
281
+ const resp = await this.sdk.api.post(`/api/storage/restore/${fileId}`, {}, { headers });
282
+ return resp.data;
283
+ }
284
+ /**
285
+ * Permanently purge a deleted file
286
+ * @param fileId Unique ID of the file
287
+ * @param userToken Session token for user-scoped storage
288
+ */
289
+ async purge(fileId, userToken) {
290
+ const headers = {};
291
+ if (userToken) {
292
+ headers['Authorization'] = `Bearer ${userToken}`;
293
+ }
294
+ const resp = await this.sdk.api.delete(`/api/storage/purge/${fileId}`, { headers });
295
+ return resp.data;
296
+ }
297
+ }
298
+
299
+ class LogsModule {
300
+ sdk;
301
+ constructor(sdk) {
302
+ this.sdk = sdk;
303
+ }
304
+ /**
305
+ * Write a custom application log to the project enclave
306
+ * @param message The log message
307
+ * @param source The source of the log (e.g. 'auth-service', 'frontend')
308
+ * @param level Log level (info, warn, error)
309
+ * @param metadata Structured data for searching/filtering
310
+ */
311
+ async write(message, source = 'app', level = 'info', metadata = {}) {
312
+ const resp = await this.sdk.api.post('/api/logs', { message, source, level, metadata });
313
+ return resp.data;
314
+ }
315
+ /**
316
+ * Retrieve application logs for the project
317
+ * @param query Filters (limit, level, etc.)
318
+ */
319
+ async fetch(query = {}) {
320
+ const resp = await this.sdk.api.get('/api/logs', { params: query });
321
+ return resp.data;
322
+ }
323
+ }
324
+
325
+ function getDefaultExportFromCjs (x) {
326
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
327
+ }
328
+
329
+ var react = {exports: {}};
330
+
331
+ var react_production = {};
332
+
333
+ /**
334
+ * @license React
335
+ * react.production.js
336
+ *
337
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
338
+ *
339
+ * This source code is licensed under the MIT license found in the
340
+ * LICENSE file in the root directory of this source tree.
341
+ */
342
+
343
+ var hasRequiredReact_production;
344
+
345
+ function requireReact_production () {
346
+ if (hasRequiredReact_production) return react_production;
347
+ hasRequiredReact_production = 1;
348
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
349
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
350
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
351
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
352
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
353
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
354
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
355
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
356
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
357
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
358
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
359
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
360
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
361
+ function getIteratorFn(maybeIterable) {
362
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
363
+ maybeIterable =
364
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
365
+ maybeIterable["@@iterator"];
366
+ return "function" === typeof maybeIterable ? maybeIterable : null;
367
+ }
368
+ var ReactNoopUpdateQueue = {
369
+ isMounted: function () {
370
+ return false;
371
+ },
372
+ enqueueForceUpdate: function () {},
373
+ enqueueReplaceState: function () {},
374
+ enqueueSetState: function () {}
375
+ },
376
+ assign = Object.assign,
377
+ emptyObject = {};
378
+ function Component(props, context, updater) {
379
+ this.props = props;
380
+ this.context = context;
381
+ this.refs = emptyObject;
382
+ this.updater = updater || ReactNoopUpdateQueue;
383
+ }
384
+ Component.prototype.isReactComponent = {};
385
+ Component.prototype.setState = function (partialState, callback) {
386
+ if (
387
+ "object" !== typeof partialState &&
388
+ "function" !== typeof partialState &&
389
+ null != partialState
390
+ )
391
+ throw Error(
392
+ "takes an object of state variables to update or a function which returns an object of state variables."
393
+ );
394
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
395
+ };
396
+ Component.prototype.forceUpdate = function (callback) {
397
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
398
+ };
399
+ function ComponentDummy() {}
400
+ ComponentDummy.prototype = Component.prototype;
401
+ function PureComponent(props, context, updater) {
402
+ this.props = props;
403
+ this.context = context;
404
+ this.refs = emptyObject;
405
+ this.updater = updater || ReactNoopUpdateQueue;
406
+ }
407
+ var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
408
+ pureComponentPrototype.constructor = PureComponent;
409
+ assign(pureComponentPrototype, Component.prototype);
410
+ pureComponentPrototype.isPureReactComponent = true;
411
+ var isArrayImpl = Array.isArray;
412
+ function noop() {}
413
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null },
414
+ hasOwnProperty = Object.prototype.hasOwnProperty;
415
+ function ReactElement(type, key, props) {
416
+ var refProp = props.ref;
417
+ return {
418
+ $$typeof: REACT_ELEMENT_TYPE,
419
+ type: type,
420
+ key: key,
421
+ ref: void 0 !== refProp ? refProp : null,
422
+ props: props
423
+ };
424
+ }
425
+ function cloneAndReplaceKey(oldElement, newKey) {
426
+ return ReactElement(oldElement.type, newKey, oldElement.props);
427
+ }
428
+ function isValidElement(object) {
429
+ return (
430
+ "object" === typeof object &&
431
+ null !== object &&
432
+ object.$$typeof === REACT_ELEMENT_TYPE
433
+ );
434
+ }
435
+ function escape(key) {
436
+ var escaperLookup = { "=": "=0", ":": "=2" };
437
+ return (
438
+ "$" +
439
+ key.replace(/[=:]/g, function (match) {
440
+ return escaperLookup[match];
441
+ })
442
+ );
443
+ }
444
+ var userProvidedKeyEscapeRegex = /\/+/g;
445
+ function getElementKey(element, index) {
446
+ return "object" === typeof element && null !== element && null != element.key
447
+ ? escape("" + element.key)
448
+ : index.toString(36);
449
+ }
450
+ function resolveThenable(thenable) {
451
+ switch (thenable.status) {
452
+ case "fulfilled":
453
+ return thenable.value;
454
+ case "rejected":
455
+ throw thenable.reason;
456
+ default:
457
+ switch (
458
+ ("string" === typeof thenable.status
459
+ ? thenable.then(noop, noop)
460
+ : ((thenable.status = "pending"),
461
+ thenable.then(
462
+ function (fulfilledValue) {
463
+ "pending" === thenable.status &&
464
+ ((thenable.status = "fulfilled"),
465
+ (thenable.value = fulfilledValue));
466
+ },
467
+ function (error) {
468
+ "pending" === thenable.status &&
469
+ ((thenable.status = "rejected"), (thenable.reason = error));
470
+ }
471
+ )),
472
+ thenable.status)
473
+ ) {
474
+ case "fulfilled":
475
+ return thenable.value;
476
+ case "rejected":
477
+ throw thenable.reason;
478
+ }
479
+ }
480
+ throw thenable;
481
+ }
482
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
483
+ var type = typeof children;
484
+ if ("undefined" === type || "boolean" === type) children = null;
485
+ var invokeCallback = false;
486
+ if (null === children) invokeCallback = true;
487
+ else
488
+ switch (type) {
489
+ case "bigint":
490
+ case "string":
491
+ case "number":
492
+ invokeCallback = true;
493
+ break;
494
+ case "object":
495
+ switch (children.$$typeof) {
496
+ case REACT_ELEMENT_TYPE:
497
+ case REACT_PORTAL_TYPE:
498
+ invokeCallback = true;
499
+ break;
500
+ case REACT_LAZY_TYPE:
501
+ return (
502
+ (invokeCallback = children._init),
503
+ mapIntoArray(
504
+ invokeCallback(children._payload),
505
+ array,
506
+ escapedPrefix,
507
+ nameSoFar,
508
+ callback
509
+ )
510
+ );
511
+ }
512
+ }
513
+ if (invokeCallback)
514
+ return (
515
+ (callback = callback(children)),
516
+ (invokeCallback =
517
+ "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
518
+ isArrayImpl(callback)
519
+ ? ((escapedPrefix = ""),
520
+ null != invokeCallback &&
521
+ (escapedPrefix =
522
+ invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
523
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
524
+ return c;
525
+ }))
526
+ : null != callback &&
527
+ (isValidElement(callback) &&
528
+ (callback = cloneAndReplaceKey(
529
+ callback,
530
+ escapedPrefix +
531
+ (null == callback.key ||
532
+ (children && children.key === callback.key)
533
+ ? ""
534
+ : ("" + callback.key).replace(
535
+ userProvidedKeyEscapeRegex,
536
+ "$&/"
537
+ ) + "/") +
538
+ invokeCallback
539
+ )),
540
+ array.push(callback)),
541
+ 1
542
+ );
543
+ invokeCallback = 0;
544
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
545
+ if (isArrayImpl(children))
546
+ for (var i = 0; i < children.length; i++)
547
+ (nameSoFar = children[i]),
548
+ (type = nextNamePrefix + getElementKey(nameSoFar, i)),
549
+ (invokeCallback += mapIntoArray(
550
+ nameSoFar,
551
+ array,
552
+ escapedPrefix,
553
+ type,
554
+ callback
555
+ ));
556
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
557
+ for (
558
+ children = i.call(children), i = 0;
559
+ !(nameSoFar = children.next()).done;
560
+
561
+ )
562
+ (nameSoFar = nameSoFar.value),
563
+ (type = nextNamePrefix + getElementKey(nameSoFar, i++)),
564
+ (invokeCallback += mapIntoArray(
565
+ nameSoFar,
566
+ array,
567
+ escapedPrefix,
568
+ type,
569
+ callback
570
+ ));
571
+ else if ("object" === type) {
572
+ if ("function" === typeof children.then)
573
+ return mapIntoArray(
574
+ resolveThenable(children),
575
+ array,
576
+ escapedPrefix,
577
+ nameSoFar,
578
+ callback
579
+ );
580
+ array = String(children);
581
+ throw Error(
582
+ "Objects are not valid as a React child (found: " +
583
+ ("[object Object]" === array
584
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
585
+ : array) +
586
+ "). If you meant to render a collection of children, use an array instead."
587
+ );
588
+ }
589
+ return invokeCallback;
590
+ }
591
+ function mapChildren(children, func, context) {
592
+ if (null == children) return children;
593
+ var result = [],
594
+ count = 0;
595
+ mapIntoArray(children, result, "", "", function (child) {
596
+ return func.call(context, child, count++);
597
+ });
598
+ return result;
599
+ }
600
+ function lazyInitializer(payload) {
601
+ if (-1 === payload._status) {
602
+ var ctor = payload._result;
603
+ ctor = ctor();
604
+ ctor.then(
605
+ function (moduleObject) {
606
+ if (0 === payload._status || -1 === payload._status)
607
+ (payload._status = 1), (payload._result = moduleObject);
608
+ },
609
+ function (error) {
610
+ if (0 === payload._status || -1 === payload._status)
611
+ (payload._status = 2), (payload._result = error);
612
+ }
613
+ );
614
+ -1 === payload._status && ((payload._status = 0), (payload._result = ctor));
615
+ }
616
+ if (1 === payload._status) return payload._result.default;
617
+ throw payload._result;
618
+ }
619
+ var reportGlobalError =
620
+ "function" === typeof reportError
621
+ ? reportError
622
+ : function (error) {
623
+ if (
624
+ "object" === typeof window &&
625
+ "function" === typeof window.ErrorEvent
626
+ ) {
627
+ var event = new window.ErrorEvent("error", {
628
+ bubbles: true,
629
+ cancelable: true,
630
+ message:
631
+ "object" === typeof error &&
632
+ null !== error &&
633
+ "string" === typeof error.message
634
+ ? String(error.message)
635
+ : String(error),
636
+ error: error
637
+ });
638
+ if (!window.dispatchEvent(event)) return;
639
+ } else if (
640
+ "object" === typeof process &&
641
+ "function" === typeof process.emit
642
+ ) {
643
+ process.emit("uncaughtException", error);
644
+ return;
645
+ }
646
+ console.error(error);
647
+ },
648
+ Children = {
649
+ map: mapChildren,
650
+ forEach: function (children, forEachFunc, forEachContext) {
651
+ mapChildren(
652
+ children,
653
+ function () {
654
+ forEachFunc.apply(this, arguments);
655
+ },
656
+ forEachContext
657
+ );
658
+ },
659
+ count: function (children) {
660
+ var n = 0;
661
+ mapChildren(children, function () {
662
+ n++;
663
+ });
664
+ return n;
665
+ },
666
+ toArray: function (children) {
667
+ return (
668
+ mapChildren(children, function (child) {
669
+ return child;
670
+ }) || []
671
+ );
672
+ },
673
+ only: function (children) {
674
+ if (!isValidElement(children))
675
+ throw Error(
676
+ "React.Children.only expected to receive a single React element child."
677
+ );
678
+ return children;
679
+ }
680
+ };
681
+ react_production.Activity = REACT_ACTIVITY_TYPE;
682
+ react_production.Children = Children;
683
+ react_production.Component = Component;
684
+ react_production.Fragment = REACT_FRAGMENT_TYPE;
685
+ react_production.Profiler = REACT_PROFILER_TYPE;
686
+ react_production.PureComponent = PureComponent;
687
+ react_production.StrictMode = REACT_STRICT_MODE_TYPE;
688
+ react_production.Suspense = REACT_SUSPENSE_TYPE;
689
+ react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
690
+ ReactSharedInternals;
691
+ react_production.__COMPILER_RUNTIME = {
692
+ __proto__: null,
693
+ c: function (size) {
694
+ return ReactSharedInternals.H.useMemoCache(size);
695
+ }
696
+ };
697
+ react_production.cache = function (fn) {
698
+ return function () {
699
+ return fn.apply(null, arguments);
700
+ };
701
+ };
702
+ react_production.cacheSignal = function () {
703
+ return null;
704
+ };
705
+ react_production.cloneElement = function (element, config, children) {
706
+ if (null === element || void 0 === element)
707
+ throw Error(
708
+ "The argument must be a React element, but you passed " + element + "."
709
+ );
710
+ var props = assign({}, element.props),
711
+ key = element.key;
712
+ if (null != config)
713
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
714
+ !hasOwnProperty.call(config, propName) ||
715
+ "key" === propName ||
716
+ "__self" === propName ||
717
+ "__source" === propName ||
718
+ ("ref" === propName && void 0 === config.ref) ||
719
+ (props[propName] = config[propName]);
720
+ var propName = arguments.length - 2;
721
+ if (1 === propName) props.children = children;
722
+ else if (1 < propName) {
723
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
724
+ childArray[i] = arguments[i + 2];
725
+ props.children = childArray;
726
+ }
727
+ return ReactElement(element.type, key, props);
728
+ };
729
+ react_production.createContext = function (defaultValue) {
730
+ defaultValue = {
731
+ $$typeof: REACT_CONTEXT_TYPE,
732
+ _currentValue: defaultValue,
733
+ _currentValue2: defaultValue,
734
+ _threadCount: 0,
735
+ Provider: null,
736
+ Consumer: null
737
+ };
738
+ defaultValue.Provider = defaultValue;
739
+ defaultValue.Consumer = {
740
+ $$typeof: REACT_CONSUMER_TYPE,
741
+ _context: defaultValue
742
+ };
743
+ return defaultValue;
744
+ };
745
+ react_production.createElement = function (type, config, children) {
746
+ var propName,
747
+ props = {},
748
+ key = null;
749
+ if (null != config)
750
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
751
+ hasOwnProperty.call(config, propName) &&
752
+ "key" !== propName &&
753
+ "__self" !== propName &&
754
+ "__source" !== propName &&
755
+ (props[propName] = config[propName]);
756
+ var childrenLength = arguments.length - 2;
757
+ if (1 === childrenLength) props.children = children;
758
+ else if (1 < childrenLength) {
759
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
760
+ childArray[i] = arguments[i + 2];
761
+ props.children = childArray;
762
+ }
763
+ if (type && type.defaultProps)
764
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
765
+ void 0 === props[propName] &&
766
+ (props[propName] = childrenLength[propName]);
767
+ return ReactElement(type, key, props);
768
+ };
769
+ react_production.createRef = function () {
770
+ return { current: null };
771
+ };
772
+ react_production.forwardRef = function (render) {
773
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
774
+ };
775
+ react_production.isValidElement = isValidElement;
776
+ react_production.lazy = function (ctor) {
777
+ return {
778
+ $$typeof: REACT_LAZY_TYPE,
779
+ _payload: { _status: -1, _result: ctor },
780
+ _init: lazyInitializer
781
+ };
782
+ };
783
+ react_production.memo = function (type, compare) {
784
+ return {
785
+ $$typeof: REACT_MEMO_TYPE,
786
+ type: type,
787
+ compare: void 0 === compare ? null : compare
788
+ };
789
+ };
790
+ react_production.startTransition = function (scope) {
791
+ var prevTransition = ReactSharedInternals.T,
792
+ currentTransition = {};
793
+ ReactSharedInternals.T = currentTransition;
794
+ try {
795
+ var returnValue = scope(),
796
+ onStartTransitionFinish = ReactSharedInternals.S;
797
+ null !== onStartTransitionFinish &&
798
+ onStartTransitionFinish(currentTransition, returnValue);
799
+ "object" === typeof returnValue &&
800
+ null !== returnValue &&
801
+ "function" === typeof returnValue.then &&
802
+ returnValue.then(noop, reportGlobalError);
803
+ } catch (error) {
804
+ reportGlobalError(error);
805
+ } finally {
806
+ null !== prevTransition &&
807
+ null !== currentTransition.types &&
808
+ (prevTransition.types = currentTransition.types),
809
+ (ReactSharedInternals.T = prevTransition);
810
+ }
811
+ };
812
+ react_production.unstable_useCacheRefresh = function () {
813
+ return ReactSharedInternals.H.useCacheRefresh();
814
+ };
815
+ react_production.use = function (usable) {
816
+ return ReactSharedInternals.H.use(usable);
817
+ };
818
+ react_production.useActionState = function (action, initialState, permalink) {
819
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
820
+ };
821
+ react_production.useCallback = function (callback, deps) {
822
+ return ReactSharedInternals.H.useCallback(callback, deps);
823
+ };
824
+ react_production.useContext = function (Context) {
825
+ return ReactSharedInternals.H.useContext(Context);
826
+ };
827
+ react_production.useDebugValue = function () {};
828
+ react_production.useDeferredValue = function (value, initialValue) {
829
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
830
+ };
831
+ react_production.useEffect = function (create, deps) {
832
+ return ReactSharedInternals.H.useEffect(create, deps);
833
+ };
834
+ react_production.useEffectEvent = function (callback) {
835
+ return ReactSharedInternals.H.useEffectEvent(callback);
836
+ };
837
+ react_production.useId = function () {
838
+ return ReactSharedInternals.H.useId();
839
+ };
840
+ react_production.useImperativeHandle = function (ref, create, deps) {
841
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
842
+ };
843
+ react_production.useInsertionEffect = function (create, deps) {
844
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
845
+ };
846
+ react_production.useLayoutEffect = function (create, deps) {
847
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
848
+ };
849
+ react_production.useMemo = function (create, deps) {
850
+ return ReactSharedInternals.H.useMemo(create, deps);
851
+ };
852
+ react_production.useOptimistic = function (passthrough, reducer) {
853
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
854
+ };
855
+ react_production.useReducer = function (reducer, initialArg, init) {
856
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
857
+ };
858
+ react_production.useRef = function (initialValue) {
859
+ return ReactSharedInternals.H.useRef(initialValue);
860
+ };
861
+ react_production.useState = function (initialState) {
862
+ return ReactSharedInternals.H.useState(initialState);
863
+ };
864
+ react_production.useSyncExternalStore = function (
865
+ subscribe,
866
+ getSnapshot,
867
+ getServerSnapshot
868
+ ) {
869
+ return ReactSharedInternals.H.useSyncExternalStore(
870
+ subscribe,
871
+ getSnapshot,
872
+ getServerSnapshot
873
+ );
874
+ };
875
+ react_production.useTransition = function () {
876
+ return ReactSharedInternals.H.useTransition();
877
+ };
878
+ react_production.version = "19.2.4";
879
+ return react_production;
880
+ }
881
+
882
+ var react_development = {exports: {}};
883
+
884
+ /**
885
+ * @license React
886
+ * react.development.js
887
+ *
888
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
889
+ *
890
+ * This source code is licensed under the MIT license found in the
891
+ * LICENSE file in the root directory of this source tree.
892
+ */
893
+ react_development.exports;
894
+
895
+ var hasRequiredReact_development;
896
+
897
+ function requireReact_development () {
898
+ if (hasRequiredReact_development) return react_development.exports;
899
+ hasRequiredReact_development = 1;
900
+ (function (module, exports$1) {
901
+ "production" !== process.env.NODE_ENV &&
902
+ (function () {
903
+ function defineDeprecationWarning(methodName, info) {
904
+ Object.defineProperty(Component.prototype, methodName, {
905
+ get: function () {
906
+ console.warn(
907
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
908
+ info[0],
909
+ info[1]
910
+ );
911
+ }
912
+ });
913
+ }
914
+ function getIteratorFn(maybeIterable) {
915
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
916
+ return null;
917
+ maybeIterable =
918
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
919
+ maybeIterable["@@iterator"];
920
+ return "function" === typeof maybeIterable ? maybeIterable : null;
921
+ }
922
+ function warnNoop(publicInstance, callerName) {
923
+ publicInstance =
924
+ ((publicInstance = publicInstance.constructor) &&
925
+ (publicInstance.displayName || publicInstance.name)) ||
926
+ "ReactClass";
927
+ var warningKey = publicInstance + "." + callerName;
928
+ didWarnStateUpdateForUnmountedComponent[warningKey] ||
929
+ (console.error(
930
+ "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.",
931
+ callerName,
932
+ publicInstance
933
+ ),
934
+ (didWarnStateUpdateForUnmountedComponent[warningKey] = true));
935
+ }
936
+ function Component(props, context, updater) {
937
+ this.props = props;
938
+ this.context = context;
939
+ this.refs = emptyObject;
940
+ this.updater = updater || ReactNoopUpdateQueue;
941
+ }
942
+ function ComponentDummy() {}
943
+ function PureComponent(props, context, updater) {
944
+ this.props = props;
945
+ this.context = context;
946
+ this.refs = emptyObject;
947
+ this.updater = updater || ReactNoopUpdateQueue;
948
+ }
949
+ function noop() {}
950
+ function testStringCoercion(value) {
951
+ return "" + value;
952
+ }
953
+ function checkKeyStringCoercion(value) {
954
+ try {
955
+ testStringCoercion(value);
956
+ var JSCompiler_inline_result = !1;
957
+ } catch (e) {
958
+ JSCompiler_inline_result = true;
959
+ }
960
+ if (JSCompiler_inline_result) {
961
+ JSCompiler_inline_result = console;
962
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
963
+ var JSCompiler_inline_result$jscomp$0 =
964
+ ("function" === typeof Symbol &&
965
+ Symbol.toStringTag &&
966
+ value[Symbol.toStringTag]) ||
967
+ value.constructor.name ||
968
+ "Object";
969
+ JSCompiler_temp_const.call(
970
+ JSCompiler_inline_result,
971
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
972
+ JSCompiler_inline_result$jscomp$0
973
+ );
974
+ return testStringCoercion(value);
975
+ }
976
+ }
977
+ function getComponentNameFromType(type) {
978
+ if (null == type) return null;
979
+ if ("function" === typeof type)
980
+ return type.$$typeof === REACT_CLIENT_REFERENCE
981
+ ? null
982
+ : type.displayName || type.name || null;
983
+ if ("string" === typeof type) return type;
984
+ switch (type) {
985
+ case REACT_FRAGMENT_TYPE:
986
+ return "Fragment";
987
+ case REACT_PROFILER_TYPE:
988
+ return "Profiler";
989
+ case REACT_STRICT_MODE_TYPE:
990
+ return "StrictMode";
991
+ case REACT_SUSPENSE_TYPE:
992
+ return "Suspense";
993
+ case REACT_SUSPENSE_LIST_TYPE:
994
+ return "SuspenseList";
995
+ case REACT_ACTIVITY_TYPE:
996
+ return "Activity";
997
+ }
998
+ if ("object" === typeof type)
999
+ switch (
1000
+ ("number" === typeof type.tag &&
1001
+ console.error(
1002
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
1003
+ ),
1004
+ type.$$typeof)
1005
+ ) {
1006
+ case REACT_PORTAL_TYPE:
1007
+ return "Portal";
1008
+ case REACT_CONTEXT_TYPE:
1009
+ return type.displayName || "Context";
1010
+ case REACT_CONSUMER_TYPE:
1011
+ return (type._context.displayName || "Context") + ".Consumer";
1012
+ case REACT_FORWARD_REF_TYPE:
1013
+ var innerType = type.render;
1014
+ type = type.displayName;
1015
+ type ||
1016
+ ((type = innerType.displayName || innerType.name || ""),
1017
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
1018
+ return type;
1019
+ case REACT_MEMO_TYPE:
1020
+ return (
1021
+ (innerType = type.displayName || null),
1022
+ null !== innerType
1023
+ ? innerType
1024
+ : getComponentNameFromType(type.type) || "Memo"
1025
+ );
1026
+ case REACT_LAZY_TYPE:
1027
+ innerType = type._payload;
1028
+ type = type._init;
1029
+ try {
1030
+ return getComponentNameFromType(type(innerType));
1031
+ } catch (x) {}
1032
+ }
1033
+ return null;
1034
+ }
1035
+ function getTaskName(type) {
1036
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
1037
+ if (
1038
+ "object" === typeof type &&
1039
+ null !== type &&
1040
+ type.$$typeof === REACT_LAZY_TYPE
1041
+ )
1042
+ return "<...>";
1043
+ try {
1044
+ var name = getComponentNameFromType(type);
1045
+ return name ? "<" + name + ">" : "<...>";
1046
+ } catch (x) {
1047
+ return "<...>";
1048
+ }
1049
+ }
1050
+ function getOwner() {
1051
+ var dispatcher = ReactSharedInternals.A;
1052
+ return null === dispatcher ? null : dispatcher.getOwner();
1053
+ }
1054
+ function UnknownOwner() {
1055
+ return Error("react-stack-top-frame");
1056
+ }
1057
+ function hasValidKey(config) {
1058
+ if (hasOwnProperty.call(config, "key")) {
1059
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
1060
+ if (getter && getter.isReactWarning) return false;
1061
+ }
1062
+ return void 0 !== config.key;
1063
+ }
1064
+ function defineKeyPropWarningGetter(props, displayName) {
1065
+ function warnAboutAccessingKey() {
1066
+ specialPropKeyWarningShown ||
1067
+ ((specialPropKeyWarningShown = true),
1068
+ console.error(
1069
+ "%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)",
1070
+ displayName
1071
+ ));
1072
+ }
1073
+ warnAboutAccessingKey.isReactWarning = true;
1074
+ Object.defineProperty(props, "key", {
1075
+ get: warnAboutAccessingKey,
1076
+ configurable: true
1077
+ });
1078
+ }
1079
+ function elementRefGetterWithDeprecationWarning() {
1080
+ var componentName = getComponentNameFromType(this.type);
1081
+ didWarnAboutElementRef[componentName] ||
1082
+ ((didWarnAboutElementRef[componentName] = true),
1083
+ console.error(
1084
+ "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."
1085
+ ));
1086
+ componentName = this.props.ref;
1087
+ return void 0 !== componentName ? componentName : null;
1088
+ }
1089
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
1090
+ var refProp = props.ref;
1091
+ type = {
1092
+ $$typeof: REACT_ELEMENT_TYPE,
1093
+ type: type,
1094
+ key: key,
1095
+ props: props,
1096
+ _owner: owner
1097
+ };
1098
+ null !== (void 0 !== refProp ? refProp : null)
1099
+ ? Object.defineProperty(type, "ref", {
1100
+ enumerable: false,
1101
+ get: elementRefGetterWithDeprecationWarning
1102
+ })
1103
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
1104
+ type._store = {};
1105
+ Object.defineProperty(type._store, "validated", {
1106
+ configurable: false,
1107
+ enumerable: false,
1108
+ writable: true,
1109
+ value: 0
1110
+ });
1111
+ Object.defineProperty(type, "_debugInfo", {
1112
+ configurable: false,
1113
+ enumerable: false,
1114
+ writable: true,
1115
+ value: null
1116
+ });
1117
+ Object.defineProperty(type, "_debugStack", {
1118
+ configurable: false,
1119
+ enumerable: false,
1120
+ writable: true,
1121
+ value: debugStack
1122
+ });
1123
+ Object.defineProperty(type, "_debugTask", {
1124
+ configurable: false,
1125
+ enumerable: false,
1126
+ writable: true,
1127
+ value: debugTask
1128
+ });
1129
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
1130
+ return type;
1131
+ }
1132
+ function cloneAndReplaceKey(oldElement, newKey) {
1133
+ newKey = ReactElement(
1134
+ oldElement.type,
1135
+ newKey,
1136
+ oldElement.props,
1137
+ oldElement._owner,
1138
+ oldElement._debugStack,
1139
+ oldElement._debugTask
1140
+ );
1141
+ oldElement._store &&
1142
+ (newKey._store.validated = oldElement._store.validated);
1143
+ return newKey;
1144
+ }
1145
+ function validateChildKeys(node) {
1146
+ isValidElement(node)
1147
+ ? node._store && (node._store.validated = 1)
1148
+ : "object" === typeof node &&
1149
+ null !== node &&
1150
+ node.$$typeof === REACT_LAZY_TYPE &&
1151
+ ("fulfilled" === node._payload.status
1152
+ ? isValidElement(node._payload.value) &&
1153
+ node._payload.value._store &&
1154
+ (node._payload.value._store.validated = 1)
1155
+ : node._store && (node._store.validated = 1));
1156
+ }
1157
+ function isValidElement(object) {
1158
+ return (
1159
+ "object" === typeof object &&
1160
+ null !== object &&
1161
+ object.$$typeof === REACT_ELEMENT_TYPE
1162
+ );
1163
+ }
1164
+ function escape(key) {
1165
+ var escaperLookup = { "=": "=0", ":": "=2" };
1166
+ return (
1167
+ "$" +
1168
+ key.replace(/[=:]/g, function (match) {
1169
+ return escaperLookup[match];
1170
+ })
1171
+ );
1172
+ }
1173
+ function getElementKey(element, index) {
1174
+ return "object" === typeof element &&
1175
+ null !== element &&
1176
+ null != element.key
1177
+ ? (checkKeyStringCoercion(element.key), escape("" + element.key))
1178
+ : index.toString(36);
1179
+ }
1180
+ function resolveThenable(thenable) {
1181
+ switch (thenable.status) {
1182
+ case "fulfilled":
1183
+ return thenable.value;
1184
+ case "rejected":
1185
+ throw thenable.reason;
1186
+ default:
1187
+ switch (
1188
+ ("string" === typeof thenable.status
1189
+ ? thenable.then(noop, noop)
1190
+ : ((thenable.status = "pending"),
1191
+ thenable.then(
1192
+ function (fulfilledValue) {
1193
+ "pending" === thenable.status &&
1194
+ ((thenable.status = "fulfilled"),
1195
+ (thenable.value = fulfilledValue));
1196
+ },
1197
+ function (error) {
1198
+ "pending" === thenable.status &&
1199
+ ((thenable.status = "rejected"),
1200
+ (thenable.reason = error));
1201
+ }
1202
+ )),
1203
+ thenable.status)
1204
+ ) {
1205
+ case "fulfilled":
1206
+ return thenable.value;
1207
+ case "rejected":
1208
+ throw thenable.reason;
1209
+ }
1210
+ }
1211
+ throw thenable;
1212
+ }
1213
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1214
+ var type = typeof children;
1215
+ if ("undefined" === type || "boolean" === type) children = null;
1216
+ var invokeCallback = false;
1217
+ if (null === children) invokeCallback = true;
1218
+ else
1219
+ switch (type) {
1220
+ case "bigint":
1221
+ case "string":
1222
+ case "number":
1223
+ invokeCallback = true;
1224
+ break;
1225
+ case "object":
1226
+ switch (children.$$typeof) {
1227
+ case REACT_ELEMENT_TYPE:
1228
+ case REACT_PORTAL_TYPE:
1229
+ invokeCallback = true;
1230
+ break;
1231
+ case REACT_LAZY_TYPE:
1232
+ return (
1233
+ (invokeCallback = children._init),
1234
+ mapIntoArray(
1235
+ invokeCallback(children._payload),
1236
+ array,
1237
+ escapedPrefix,
1238
+ nameSoFar,
1239
+ callback
1240
+ )
1241
+ );
1242
+ }
1243
+ }
1244
+ if (invokeCallback) {
1245
+ invokeCallback = children;
1246
+ callback = callback(invokeCallback);
1247
+ var childKey =
1248
+ "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
1249
+ isArrayImpl(callback)
1250
+ ? ((escapedPrefix = ""),
1251
+ null != childKey &&
1252
+ (escapedPrefix =
1253
+ childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
1254
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
1255
+ return c;
1256
+ }))
1257
+ : null != callback &&
1258
+ (isValidElement(callback) &&
1259
+ (null != callback.key &&
1260
+ ((invokeCallback && invokeCallback.key === callback.key) ||
1261
+ checkKeyStringCoercion(callback.key)),
1262
+ (escapedPrefix = cloneAndReplaceKey(
1263
+ callback,
1264
+ escapedPrefix +
1265
+ (null == callback.key ||
1266
+ (invokeCallback && invokeCallback.key === callback.key)
1267
+ ? ""
1268
+ : ("" + callback.key).replace(
1269
+ userProvidedKeyEscapeRegex,
1270
+ "$&/"
1271
+ ) + "/") +
1272
+ childKey
1273
+ )),
1274
+ "" !== nameSoFar &&
1275
+ null != invokeCallback &&
1276
+ isValidElement(invokeCallback) &&
1277
+ null == invokeCallback.key &&
1278
+ invokeCallback._store &&
1279
+ !invokeCallback._store.validated &&
1280
+ (escapedPrefix._store.validated = 2),
1281
+ (callback = escapedPrefix)),
1282
+ array.push(callback));
1283
+ return 1;
1284
+ }
1285
+ invokeCallback = 0;
1286
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
1287
+ if (isArrayImpl(children))
1288
+ for (var i = 0; i < children.length; i++)
1289
+ (nameSoFar = children[i]),
1290
+ (type = childKey + getElementKey(nameSoFar, i)),
1291
+ (invokeCallback += mapIntoArray(
1292
+ nameSoFar,
1293
+ array,
1294
+ escapedPrefix,
1295
+ type,
1296
+ callback
1297
+ ));
1298
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
1299
+ for (
1300
+ i === children.entries &&
1301
+ (didWarnAboutMaps ||
1302
+ console.warn(
1303
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
1304
+ ),
1305
+ (didWarnAboutMaps = true)),
1306
+ children = i.call(children),
1307
+ i = 0;
1308
+ !(nameSoFar = children.next()).done;
1309
+
1310
+ )
1311
+ (nameSoFar = nameSoFar.value),
1312
+ (type = childKey + getElementKey(nameSoFar, i++)),
1313
+ (invokeCallback += mapIntoArray(
1314
+ nameSoFar,
1315
+ array,
1316
+ escapedPrefix,
1317
+ type,
1318
+ callback
1319
+ ));
1320
+ else if ("object" === type) {
1321
+ if ("function" === typeof children.then)
1322
+ return mapIntoArray(
1323
+ resolveThenable(children),
1324
+ array,
1325
+ escapedPrefix,
1326
+ nameSoFar,
1327
+ callback
1328
+ );
1329
+ array = String(children);
1330
+ throw Error(
1331
+ "Objects are not valid as a React child (found: " +
1332
+ ("[object Object]" === array
1333
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
1334
+ : array) +
1335
+ "). If you meant to render a collection of children, use an array instead."
1336
+ );
1337
+ }
1338
+ return invokeCallback;
1339
+ }
1340
+ function mapChildren(children, func, context) {
1341
+ if (null == children) return children;
1342
+ var result = [],
1343
+ count = 0;
1344
+ mapIntoArray(children, result, "", "", function (child) {
1345
+ return func.call(context, child, count++);
1346
+ });
1347
+ return result;
1348
+ }
1349
+ function lazyInitializer(payload) {
1350
+ if (-1 === payload._status) {
1351
+ var ioInfo = payload._ioInfo;
1352
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
1353
+ ioInfo = payload._result;
1354
+ var thenable = ioInfo();
1355
+ thenable.then(
1356
+ function (moduleObject) {
1357
+ if (0 === payload._status || -1 === payload._status) {
1358
+ payload._status = 1;
1359
+ payload._result = moduleObject;
1360
+ var _ioInfo = payload._ioInfo;
1361
+ null != _ioInfo && (_ioInfo.end = performance.now());
1362
+ void 0 === thenable.status &&
1363
+ ((thenable.status = "fulfilled"),
1364
+ (thenable.value = moduleObject));
1365
+ }
1366
+ },
1367
+ function (error) {
1368
+ if (0 === payload._status || -1 === payload._status) {
1369
+ payload._status = 2;
1370
+ payload._result = error;
1371
+ var _ioInfo2 = payload._ioInfo;
1372
+ null != _ioInfo2 && (_ioInfo2.end = performance.now());
1373
+ void 0 === thenable.status &&
1374
+ ((thenable.status = "rejected"), (thenable.reason = error));
1375
+ }
1376
+ }
1377
+ );
1378
+ ioInfo = payload._ioInfo;
1379
+ if (null != ioInfo) {
1380
+ ioInfo.value = thenable;
1381
+ var displayName = thenable.displayName;
1382
+ "string" === typeof displayName && (ioInfo.name = displayName);
1383
+ }
1384
+ -1 === payload._status &&
1385
+ ((payload._status = 0), (payload._result = thenable));
1386
+ }
1387
+ if (1 === payload._status)
1388
+ return (
1389
+ (ioInfo = payload._result),
1390
+ void 0 === ioInfo &&
1391
+ console.error(
1392
+ "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?",
1393
+ ioInfo
1394
+ ),
1395
+ "default" in ioInfo ||
1396
+ console.error(
1397
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
1398
+ ioInfo
1399
+ ),
1400
+ ioInfo.default
1401
+ );
1402
+ throw payload._result;
1403
+ }
1404
+ function resolveDispatcher() {
1405
+ var dispatcher = ReactSharedInternals.H;
1406
+ null === dispatcher &&
1407
+ console.error(
1408
+ "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."
1409
+ );
1410
+ return dispatcher;
1411
+ }
1412
+ function releaseAsyncTransition() {
1413
+ ReactSharedInternals.asyncTransitions--;
1414
+ }
1415
+ function enqueueTask(task) {
1416
+ if (null === enqueueTaskImpl)
1417
+ try {
1418
+ var requireString = ("require" + Math.random()).slice(0, 7);
1419
+ enqueueTaskImpl = (module && module[requireString]).call(
1420
+ module,
1421
+ "timers"
1422
+ ).setImmediate;
1423
+ } catch (_err) {
1424
+ enqueueTaskImpl = function (callback) {
1425
+ false === didWarnAboutMessageChannel &&
1426
+ ((didWarnAboutMessageChannel = true),
1427
+ "undefined" === typeof MessageChannel &&
1428
+ console.error(
1429
+ "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."
1430
+ ));
1431
+ var channel = new MessageChannel();
1432
+ channel.port1.onmessage = callback;
1433
+ channel.port2.postMessage(void 0);
1434
+ };
1435
+ }
1436
+ return enqueueTaskImpl(task);
1437
+ }
1438
+ function aggregateErrors(errors) {
1439
+ return 1 < errors.length && "function" === typeof AggregateError
1440
+ ? new AggregateError(errors)
1441
+ : errors[0];
1442
+ }
1443
+ function popActScope(prevActQueue, prevActScopeDepth) {
1444
+ prevActScopeDepth !== actScopeDepth - 1 &&
1445
+ console.error(
1446
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
1447
+ );
1448
+ actScopeDepth = prevActScopeDepth;
1449
+ }
1450
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
1451
+ var queue = ReactSharedInternals.actQueue;
1452
+ if (null !== queue)
1453
+ if (0 !== queue.length)
1454
+ try {
1455
+ flushActQueue(queue);
1456
+ enqueueTask(function () {
1457
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
1458
+ });
1459
+ return;
1460
+ } catch (error) {
1461
+ ReactSharedInternals.thrownErrors.push(error);
1462
+ }
1463
+ else ReactSharedInternals.actQueue = null;
1464
+ 0 < ReactSharedInternals.thrownErrors.length
1465
+ ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),
1466
+ (ReactSharedInternals.thrownErrors.length = 0),
1467
+ reject(queue))
1468
+ : resolve(returnValue);
1469
+ }
1470
+ function flushActQueue(queue) {
1471
+ if (!isFlushing) {
1472
+ isFlushing = true;
1473
+ var i = 0;
1474
+ try {
1475
+ for (; i < queue.length; i++) {
1476
+ var callback = queue[i];
1477
+ do {
1478
+ ReactSharedInternals.didUsePromise = !1;
1479
+ var continuation = callback(!1);
1480
+ if (null !== continuation) {
1481
+ if (ReactSharedInternals.didUsePromise) {
1482
+ queue[i] = callback;
1483
+ queue.splice(0, i);
1484
+ return;
1485
+ }
1486
+ callback = continuation;
1487
+ } else break;
1488
+ } while (1);
1489
+ }
1490
+ queue.length = 0;
1491
+ } catch (error) {
1492
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
1493
+ } finally {
1494
+ isFlushing = false;
1495
+ }
1496
+ }
1497
+ }
1498
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1499
+ "function" ===
1500
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
1501
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1502
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
1503
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
1504
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
1505
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
1506
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
1507
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
1508
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
1509
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
1510
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
1511
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
1512
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
1513
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
1514
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
1515
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
1516
+ didWarnStateUpdateForUnmountedComponent = {},
1517
+ ReactNoopUpdateQueue = {
1518
+ isMounted: function () {
1519
+ return false;
1520
+ },
1521
+ enqueueForceUpdate: function (publicInstance) {
1522
+ warnNoop(publicInstance, "forceUpdate");
1523
+ },
1524
+ enqueueReplaceState: function (publicInstance) {
1525
+ warnNoop(publicInstance, "replaceState");
1526
+ },
1527
+ enqueueSetState: function (publicInstance) {
1528
+ warnNoop(publicInstance, "setState");
1529
+ }
1530
+ },
1531
+ assign = Object.assign,
1532
+ emptyObject = {};
1533
+ Object.freeze(emptyObject);
1534
+ Component.prototype.isReactComponent = {};
1535
+ Component.prototype.setState = function (partialState, callback) {
1536
+ if (
1537
+ "object" !== typeof partialState &&
1538
+ "function" !== typeof partialState &&
1539
+ null != partialState
1540
+ )
1541
+ throw Error(
1542
+ "takes an object of state variables to update or a function which returns an object of state variables."
1543
+ );
1544
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
1545
+ };
1546
+ Component.prototype.forceUpdate = function (callback) {
1547
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1548
+ };
1549
+ var deprecatedAPIs = {
1550
+ isMounted: [
1551
+ "isMounted",
1552
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1553
+ ],
1554
+ replaceState: [
1555
+ "replaceState",
1556
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1557
+ ]
1558
+ };
1559
+ for (fnName in deprecatedAPIs)
1560
+ deprecatedAPIs.hasOwnProperty(fnName) &&
1561
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1562
+ ComponentDummy.prototype = Component.prototype;
1563
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1564
+ deprecatedAPIs.constructor = PureComponent;
1565
+ assign(deprecatedAPIs, Component.prototype);
1566
+ deprecatedAPIs.isPureReactComponent = true;
1567
+ var isArrayImpl = Array.isArray,
1568
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
1569
+ ReactSharedInternals = {
1570
+ H: null,
1571
+ A: null,
1572
+ T: null,
1573
+ S: null,
1574
+ actQueue: null,
1575
+ asyncTransitions: 0,
1576
+ isBatchingLegacy: false,
1577
+ didScheduleLegacyUpdate: false,
1578
+ didUsePromise: false,
1579
+ thrownErrors: [],
1580
+ getCurrentStack: null,
1581
+ recentlyCreatedOwnerStacks: 0
1582
+ },
1583
+ hasOwnProperty = Object.prototype.hasOwnProperty,
1584
+ createTask = console.createTask
1585
+ ? console.createTask
1586
+ : function () {
1587
+ return null;
1588
+ };
1589
+ deprecatedAPIs = {
1590
+ react_stack_bottom_frame: function (callStackForError) {
1591
+ return callStackForError();
1592
+ }
1593
+ };
1594
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1595
+ var didWarnAboutElementRef = {};
1596
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1597
+ deprecatedAPIs,
1598
+ UnknownOwner
1599
+ )();
1600
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1601
+ var didWarnAboutMaps = false,
1602
+ userProvidedKeyEscapeRegex = /\/+/g,
1603
+ reportGlobalError =
1604
+ "function" === typeof reportError
1605
+ ? reportError
1606
+ : function (error) {
1607
+ if (
1608
+ "object" === typeof window &&
1609
+ "function" === typeof window.ErrorEvent
1610
+ ) {
1611
+ var event = new window.ErrorEvent("error", {
1612
+ bubbles: true,
1613
+ cancelable: true,
1614
+ message:
1615
+ "object" === typeof error &&
1616
+ null !== error &&
1617
+ "string" === typeof error.message
1618
+ ? String(error.message)
1619
+ : String(error),
1620
+ error: error
1621
+ });
1622
+ if (!window.dispatchEvent(event)) return;
1623
+ } else if (
1624
+ "object" === typeof process &&
1625
+ "function" === typeof process.emit
1626
+ ) {
1627
+ process.emit("uncaughtException", error);
1628
+ return;
1629
+ }
1630
+ console.error(error);
1631
+ },
1632
+ didWarnAboutMessageChannel = false,
1633
+ enqueueTaskImpl = null,
1634
+ actScopeDepth = 0,
1635
+ didWarnNoAwaitAct = false,
1636
+ isFlushing = false,
1637
+ queueSeveralMicrotasks =
1638
+ "function" === typeof queueMicrotask
1639
+ ? function (callback) {
1640
+ queueMicrotask(function () {
1641
+ return queueMicrotask(callback);
1642
+ });
1643
+ }
1644
+ : enqueueTask;
1645
+ deprecatedAPIs = Object.freeze({
1646
+ __proto__: null,
1647
+ c: function (size) {
1648
+ return resolveDispatcher().useMemoCache(size);
1649
+ }
1650
+ });
1651
+ var fnName = {
1652
+ map: mapChildren,
1653
+ forEach: function (children, forEachFunc, forEachContext) {
1654
+ mapChildren(
1655
+ children,
1656
+ function () {
1657
+ forEachFunc.apply(this, arguments);
1658
+ },
1659
+ forEachContext
1660
+ );
1661
+ },
1662
+ count: function (children) {
1663
+ var n = 0;
1664
+ mapChildren(children, function () {
1665
+ n++;
1666
+ });
1667
+ return n;
1668
+ },
1669
+ toArray: function (children) {
1670
+ return (
1671
+ mapChildren(children, function (child) {
1672
+ return child;
1673
+ }) || []
1674
+ );
1675
+ },
1676
+ only: function (children) {
1677
+ if (!isValidElement(children))
1678
+ throw Error(
1679
+ "React.Children.only expected to receive a single React element child."
1680
+ );
1681
+ return children;
1682
+ }
1683
+ };
1684
+ exports$1.Activity = REACT_ACTIVITY_TYPE;
1685
+ exports$1.Children = fnName;
1686
+ exports$1.Component = Component;
1687
+ exports$1.Fragment = REACT_FRAGMENT_TYPE;
1688
+ exports$1.Profiler = REACT_PROFILER_TYPE;
1689
+ exports$1.PureComponent = PureComponent;
1690
+ exports$1.StrictMode = REACT_STRICT_MODE_TYPE;
1691
+ exports$1.Suspense = REACT_SUSPENSE_TYPE;
1692
+ exports$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
1693
+ ReactSharedInternals;
1694
+ exports$1.__COMPILER_RUNTIME = deprecatedAPIs;
1695
+ exports$1.act = function (callback) {
1696
+ var prevActQueue = ReactSharedInternals.actQueue,
1697
+ prevActScopeDepth = actScopeDepth;
1698
+ actScopeDepth++;
1699
+ var queue = (ReactSharedInternals.actQueue =
1700
+ null !== prevActQueue ? prevActQueue : []),
1701
+ didAwaitActCall = false;
1702
+ try {
1703
+ var result = callback();
1704
+ } catch (error) {
1705
+ ReactSharedInternals.thrownErrors.push(error);
1706
+ }
1707
+ if (0 < ReactSharedInternals.thrownErrors.length)
1708
+ throw (
1709
+ (popActScope(prevActQueue, prevActScopeDepth),
1710
+ (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1711
+ (ReactSharedInternals.thrownErrors.length = 0),
1712
+ callback)
1713
+ );
1714
+ if (
1715
+ null !== result &&
1716
+ "object" === typeof result &&
1717
+ "function" === typeof result.then
1718
+ ) {
1719
+ var thenable = result;
1720
+ queueSeveralMicrotasks(function () {
1721
+ didAwaitActCall ||
1722
+ didWarnNoAwaitAct ||
1723
+ ((didWarnNoAwaitAct = true),
1724
+ console.error(
1725
+ "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 () => ...);"
1726
+ ));
1727
+ });
1728
+ return {
1729
+ then: function (resolve, reject) {
1730
+ didAwaitActCall = true;
1731
+ thenable.then(
1732
+ function (returnValue) {
1733
+ popActScope(prevActQueue, prevActScopeDepth);
1734
+ if (0 === prevActScopeDepth) {
1735
+ try {
1736
+ flushActQueue(queue),
1737
+ enqueueTask(function () {
1738
+ return recursivelyFlushAsyncActWork(
1739
+ returnValue,
1740
+ resolve,
1741
+ reject
1742
+ );
1743
+ });
1744
+ } catch (error$0) {
1745
+ ReactSharedInternals.thrownErrors.push(error$0);
1746
+ }
1747
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1748
+ var _thrownError = aggregateErrors(
1749
+ ReactSharedInternals.thrownErrors
1750
+ );
1751
+ ReactSharedInternals.thrownErrors.length = 0;
1752
+ reject(_thrownError);
1753
+ }
1754
+ } else resolve(returnValue);
1755
+ },
1756
+ function (error) {
1757
+ popActScope(prevActQueue, prevActScopeDepth);
1758
+ 0 < ReactSharedInternals.thrownErrors.length
1759
+ ? ((error = aggregateErrors(
1760
+ ReactSharedInternals.thrownErrors
1761
+ )),
1762
+ (ReactSharedInternals.thrownErrors.length = 0),
1763
+ reject(error))
1764
+ : reject(error);
1765
+ }
1766
+ );
1767
+ }
1768
+ };
1769
+ }
1770
+ var returnValue$jscomp$0 = result;
1771
+ popActScope(prevActQueue, prevActScopeDepth);
1772
+ 0 === prevActScopeDepth &&
1773
+ (flushActQueue(queue),
1774
+ 0 !== queue.length &&
1775
+ queueSeveralMicrotasks(function () {
1776
+ didAwaitActCall ||
1777
+ didWarnNoAwaitAct ||
1778
+ ((didWarnNoAwaitAct = true),
1779
+ console.error(
1780
+ "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(() => ...)"
1781
+ ));
1782
+ }),
1783
+ (ReactSharedInternals.actQueue = null));
1784
+ if (0 < ReactSharedInternals.thrownErrors.length)
1785
+ throw (
1786
+ ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1787
+ (ReactSharedInternals.thrownErrors.length = 0),
1788
+ callback)
1789
+ );
1790
+ return {
1791
+ then: function (resolve, reject) {
1792
+ didAwaitActCall = true;
1793
+ 0 === prevActScopeDepth
1794
+ ? ((ReactSharedInternals.actQueue = queue),
1795
+ enqueueTask(function () {
1796
+ return recursivelyFlushAsyncActWork(
1797
+ returnValue$jscomp$0,
1798
+ resolve,
1799
+ reject
1800
+ );
1801
+ }))
1802
+ : resolve(returnValue$jscomp$0);
1803
+ }
1804
+ };
1805
+ };
1806
+ exports$1.cache = function (fn) {
1807
+ return function () {
1808
+ return fn.apply(null, arguments);
1809
+ };
1810
+ };
1811
+ exports$1.cacheSignal = function () {
1812
+ return null;
1813
+ };
1814
+ exports$1.captureOwnerStack = function () {
1815
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1816
+ return null === getCurrentStack ? null : getCurrentStack();
1817
+ };
1818
+ exports$1.cloneElement = function (element, config, children) {
1819
+ if (null === element || void 0 === element)
1820
+ throw Error(
1821
+ "The argument must be a React element, but you passed " +
1822
+ element +
1823
+ "."
1824
+ );
1825
+ var props = assign({}, element.props),
1826
+ key = element.key,
1827
+ owner = element._owner;
1828
+ if (null != config) {
1829
+ var JSCompiler_inline_result;
1830
+ a: {
1831
+ if (
1832
+ hasOwnProperty.call(config, "ref") &&
1833
+ (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1834
+ config,
1835
+ "ref"
1836
+ ).get) &&
1837
+ JSCompiler_inline_result.isReactWarning
1838
+ ) {
1839
+ JSCompiler_inline_result = false;
1840
+ break a;
1841
+ }
1842
+ JSCompiler_inline_result = void 0 !== config.ref;
1843
+ }
1844
+ JSCompiler_inline_result && (owner = getOwner());
1845
+ hasValidKey(config) &&
1846
+ (checkKeyStringCoercion(config.key), (key = "" + config.key));
1847
+ for (propName in config)
1848
+ !hasOwnProperty.call(config, propName) ||
1849
+ "key" === propName ||
1850
+ "__self" === propName ||
1851
+ "__source" === propName ||
1852
+ ("ref" === propName && void 0 === config.ref) ||
1853
+ (props[propName] = config[propName]);
1854
+ }
1855
+ var propName = arguments.length - 2;
1856
+ if (1 === propName) props.children = children;
1857
+ else if (1 < propName) {
1858
+ JSCompiler_inline_result = Array(propName);
1859
+ for (var i = 0; i < propName; i++)
1860
+ JSCompiler_inline_result[i] = arguments[i + 2];
1861
+ props.children = JSCompiler_inline_result;
1862
+ }
1863
+ props = ReactElement(
1864
+ element.type,
1865
+ key,
1866
+ props,
1867
+ owner,
1868
+ element._debugStack,
1869
+ element._debugTask
1870
+ );
1871
+ for (key = 2; key < arguments.length; key++)
1872
+ validateChildKeys(arguments[key]);
1873
+ return props;
1874
+ };
1875
+ exports$1.createContext = function (defaultValue) {
1876
+ defaultValue = {
1877
+ $$typeof: REACT_CONTEXT_TYPE,
1878
+ _currentValue: defaultValue,
1879
+ _currentValue2: defaultValue,
1880
+ _threadCount: 0,
1881
+ Provider: null,
1882
+ Consumer: null
1883
+ };
1884
+ defaultValue.Provider = defaultValue;
1885
+ defaultValue.Consumer = {
1886
+ $$typeof: REACT_CONSUMER_TYPE,
1887
+ _context: defaultValue
1888
+ };
1889
+ defaultValue._currentRenderer = null;
1890
+ defaultValue._currentRenderer2 = null;
1891
+ return defaultValue;
1892
+ };
1893
+ exports$1.createElement = function (type, config, children) {
1894
+ for (var i = 2; i < arguments.length; i++)
1895
+ validateChildKeys(arguments[i]);
1896
+ i = {};
1897
+ var key = null;
1898
+ if (null != config)
1899
+ for (propName in (didWarnAboutOldJSXRuntime ||
1900
+ !("__self" in config) ||
1901
+ "key" in config ||
1902
+ ((didWarnAboutOldJSXRuntime = true),
1903
+ console.warn(
1904
+ "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"
1905
+ )),
1906
+ hasValidKey(config) &&
1907
+ (checkKeyStringCoercion(config.key), (key = "" + config.key)),
1908
+ config))
1909
+ hasOwnProperty.call(config, propName) &&
1910
+ "key" !== propName &&
1911
+ "__self" !== propName &&
1912
+ "__source" !== propName &&
1913
+ (i[propName] = config[propName]);
1914
+ var childrenLength = arguments.length - 2;
1915
+ if (1 === childrenLength) i.children = children;
1916
+ else if (1 < childrenLength) {
1917
+ for (
1918
+ var childArray = Array(childrenLength), _i = 0;
1919
+ _i < childrenLength;
1920
+ _i++
1921
+ )
1922
+ childArray[_i] = arguments[_i + 2];
1923
+ Object.freeze && Object.freeze(childArray);
1924
+ i.children = childArray;
1925
+ }
1926
+ if (type && type.defaultProps)
1927
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
1928
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1929
+ key &&
1930
+ defineKeyPropWarningGetter(
1931
+ i,
1932
+ "function" === typeof type
1933
+ ? type.displayName || type.name || "Unknown"
1934
+ : type
1935
+ );
1936
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1937
+ return ReactElement(
1938
+ type,
1939
+ key,
1940
+ i,
1941
+ getOwner(),
1942
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1943
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1944
+ );
1945
+ };
1946
+ exports$1.createRef = function () {
1947
+ var refObject = { current: null };
1948
+ Object.seal(refObject);
1949
+ return refObject;
1950
+ };
1951
+ exports$1.forwardRef = function (render) {
1952
+ null != render && render.$$typeof === REACT_MEMO_TYPE
1953
+ ? console.error(
1954
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1955
+ )
1956
+ : "function" !== typeof render
1957
+ ? console.error(
1958
+ "forwardRef requires a render function but was given %s.",
1959
+ null === render ? "null" : typeof render
1960
+ )
1961
+ : 0 !== render.length &&
1962
+ 2 !== render.length &&
1963
+ console.error(
1964
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1965
+ 1 === render.length
1966
+ ? "Did you forget to use the ref parameter?"
1967
+ : "Any additional parameter will be undefined."
1968
+ );
1969
+ null != render &&
1970
+ null != render.defaultProps &&
1971
+ console.error(
1972
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1973
+ );
1974
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
1975
+ ownName;
1976
+ Object.defineProperty(elementType, "displayName", {
1977
+ enumerable: false,
1978
+ configurable: true,
1979
+ get: function () {
1980
+ return ownName;
1981
+ },
1982
+ set: function (name) {
1983
+ ownName = name;
1984
+ render.name ||
1985
+ render.displayName ||
1986
+ (Object.defineProperty(render, "name", { value: name }),
1987
+ (render.displayName = name));
1988
+ }
1989
+ });
1990
+ return elementType;
1991
+ };
1992
+ exports$1.isValidElement = isValidElement;
1993
+ exports$1.lazy = function (ctor) {
1994
+ ctor = { _status: -1, _result: ctor };
1995
+ var lazyType = {
1996
+ $$typeof: REACT_LAZY_TYPE,
1997
+ _payload: ctor,
1998
+ _init: lazyInitializer
1999
+ },
2000
+ ioInfo = {
2001
+ name: "lazy",
2002
+ start: -1,
2003
+ end: -1,
2004
+ value: null,
2005
+ owner: null,
2006
+ debugStack: Error("react-stack-top-frame"),
2007
+ debugTask: console.createTask ? console.createTask("lazy()") : null
2008
+ };
2009
+ ctor._ioInfo = ioInfo;
2010
+ lazyType._debugInfo = [{ awaited: ioInfo }];
2011
+ return lazyType;
2012
+ };
2013
+ exports$1.memo = function (type, compare) {
2014
+ null == type &&
2015
+ console.error(
2016
+ "memo: The first argument must be a component. Instead received: %s",
2017
+ null === type ? "null" : typeof type
2018
+ );
2019
+ compare = {
2020
+ $$typeof: REACT_MEMO_TYPE,
2021
+ type: type,
2022
+ compare: void 0 === compare ? null : compare
2023
+ };
2024
+ var ownName;
2025
+ Object.defineProperty(compare, "displayName", {
2026
+ enumerable: false,
2027
+ configurable: true,
2028
+ get: function () {
2029
+ return ownName;
2030
+ },
2031
+ set: function (name) {
2032
+ ownName = name;
2033
+ type.name ||
2034
+ type.displayName ||
2035
+ (Object.defineProperty(type, "name", { value: name }),
2036
+ (type.displayName = name));
2037
+ }
2038
+ });
2039
+ return compare;
2040
+ };
2041
+ exports$1.startTransition = function (scope) {
2042
+ var prevTransition = ReactSharedInternals.T,
2043
+ currentTransition = {};
2044
+ currentTransition._updatedFibers = new Set();
2045
+ ReactSharedInternals.T = currentTransition;
2046
+ try {
2047
+ var returnValue = scope(),
2048
+ onStartTransitionFinish = ReactSharedInternals.S;
2049
+ null !== onStartTransitionFinish &&
2050
+ onStartTransitionFinish(currentTransition, returnValue);
2051
+ "object" === typeof returnValue &&
2052
+ null !== returnValue &&
2053
+ "function" === typeof returnValue.then &&
2054
+ (ReactSharedInternals.asyncTransitions++,
2055
+ returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
2056
+ returnValue.then(noop, reportGlobalError));
2057
+ } catch (error) {
2058
+ reportGlobalError(error);
2059
+ } finally {
2060
+ null === prevTransition &&
2061
+ currentTransition._updatedFibers &&
2062
+ ((scope = currentTransition._updatedFibers.size),
2063
+ currentTransition._updatedFibers.clear(),
2064
+ 10 < scope &&
2065
+ console.warn(
2066
+ "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."
2067
+ )),
2068
+ null !== prevTransition &&
2069
+ null !== currentTransition.types &&
2070
+ (null !== prevTransition.types &&
2071
+ prevTransition.types !== currentTransition.types &&
2072
+ console.error(
2073
+ "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."
2074
+ ),
2075
+ (prevTransition.types = currentTransition.types)),
2076
+ (ReactSharedInternals.T = prevTransition);
2077
+ }
2078
+ };
2079
+ exports$1.unstable_useCacheRefresh = function () {
2080
+ return resolveDispatcher().useCacheRefresh();
2081
+ };
2082
+ exports$1.use = function (usable) {
2083
+ return resolveDispatcher().use(usable);
2084
+ };
2085
+ exports$1.useActionState = function (action, initialState, permalink) {
2086
+ return resolveDispatcher().useActionState(
2087
+ action,
2088
+ initialState,
2089
+ permalink
2090
+ );
2091
+ };
2092
+ exports$1.useCallback = function (callback, deps) {
2093
+ return resolveDispatcher().useCallback(callback, deps);
2094
+ };
2095
+ exports$1.useContext = function (Context) {
2096
+ var dispatcher = resolveDispatcher();
2097
+ Context.$$typeof === REACT_CONSUMER_TYPE &&
2098
+ console.error(
2099
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
2100
+ );
2101
+ return dispatcher.useContext(Context);
2102
+ };
2103
+ exports$1.useDebugValue = function (value, formatterFn) {
2104
+ return resolveDispatcher().useDebugValue(value, formatterFn);
2105
+ };
2106
+ exports$1.useDeferredValue = function (value, initialValue) {
2107
+ return resolveDispatcher().useDeferredValue(value, initialValue);
2108
+ };
2109
+ exports$1.useEffect = function (create, deps) {
2110
+ null == create &&
2111
+ console.warn(
2112
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2113
+ );
2114
+ return resolveDispatcher().useEffect(create, deps);
2115
+ };
2116
+ exports$1.useEffectEvent = function (callback) {
2117
+ return resolveDispatcher().useEffectEvent(callback);
2118
+ };
2119
+ exports$1.useId = function () {
2120
+ return resolveDispatcher().useId();
2121
+ };
2122
+ exports$1.useImperativeHandle = function (ref, create, deps) {
2123
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
2124
+ };
2125
+ exports$1.useInsertionEffect = function (create, deps) {
2126
+ null == create &&
2127
+ console.warn(
2128
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2129
+ );
2130
+ return resolveDispatcher().useInsertionEffect(create, deps);
2131
+ };
2132
+ exports$1.useLayoutEffect = function (create, deps) {
2133
+ null == create &&
2134
+ console.warn(
2135
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2136
+ );
2137
+ return resolveDispatcher().useLayoutEffect(create, deps);
2138
+ };
2139
+ exports$1.useMemo = function (create, deps) {
2140
+ return resolveDispatcher().useMemo(create, deps);
2141
+ };
2142
+ exports$1.useOptimistic = function (passthrough, reducer) {
2143
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
2144
+ };
2145
+ exports$1.useReducer = function (reducer, initialArg, init) {
2146
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
2147
+ };
2148
+ exports$1.useRef = function (initialValue) {
2149
+ return resolveDispatcher().useRef(initialValue);
2150
+ };
2151
+ exports$1.useState = function (initialState) {
2152
+ return resolveDispatcher().useState(initialState);
2153
+ };
2154
+ exports$1.useSyncExternalStore = function (
2155
+ subscribe,
2156
+ getSnapshot,
2157
+ getServerSnapshot
2158
+ ) {
2159
+ return resolveDispatcher().useSyncExternalStore(
2160
+ subscribe,
2161
+ getSnapshot,
2162
+ getServerSnapshot
2163
+ );
2164
+ };
2165
+ exports$1.useTransition = function () {
2166
+ return resolveDispatcher().useTransition();
2167
+ };
2168
+ exports$1.version = "19.2.4";
2169
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2170
+ "function" ===
2171
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
2172
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2173
+ })();
2174
+ } (react_development, react_development.exports));
2175
+ return react_development.exports;
2176
+ }
2177
+
2178
+ var hasRequiredReact;
2179
+
2180
+ function requireReact () {
2181
+ if (hasRequiredReact) return react.exports;
2182
+ hasRequiredReact = 1;
2183
+
2184
+ if (process.env.NODE_ENV === 'production') {
2185
+ react.exports = requireReact_production();
2186
+ } else {
2187
+ react.exports = requireReact_development();
2188
+ }
2189
+ return react.exports;
2190
+ }
2191
+
2192
+ var reactExports = requireReact();
2193
+ var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
2194
+
2195
+ /**
2196
+ * A React hook for managing QidCloud authentication lifecycle.
2197
+ * Handles handshake initialization, WebSocket listeners, and profile fetching.
2198
+ */
2199
+ function useQidAuth(sdk) {
2200
+ const [user, setUser] = reactExports.useState(null);
2201
+ const [token, setToken] = reactExports.useState(null);
2202
+ const [session, setSession] = reactExports.useState(null);
2203
+ const [loading, setLoading] = reactExports.useState(false);
2204
+ const [initializing, setInitializing] = reactExports.useState(false);
2205
+ const [error, setError] = reactExports.useState(null);
2206
+ // Use ref to track if we should still be listening (to avoid state updates after unmount/cancel)
2207
+ const activeSessionId = reactExports.useRef(null);
2208
+ const logout = reactExports.useCallback(() => {
2209
+ setUser(null);
2210
+ setToken(null);
2211
+ setSession(null);
2212
+ sdk.auth.disconnect();
2213
+ }, [sdk]);
2214
+ const cancel = reactExports.useCallback(() => {
2215
+ activeSessionId.current = null;
2216
+ setSession(null);
2217
+ setInitializing(false);
2218
+ sdk.auth.disconnect();
2219
+ }, [sdk]);
2220
+ const login = reactExports.useCallback(async () => {
2221
+ setInitializing(true);
2222
+ setError(null);
2223
+ try {
2224
+ const newSession = await sdk.auth.createSession();
2225
+ setSession(newSession);
2226
+ activeSessionId.current = newSession.sessionId;
2227
+ sdk.auth.listen(newSession.sessionId, async (receivedToken) => {
2228
+ // Safety check: is this still the active session?
2229
+ if (activeSessionId.current !== newSession.sessionId)
2230
+ return;
2231
+ setLoading(true);
2232
+ setInitializing(false);
2233
+ try {
2234
+ const profile = await sdk.auth.getProfile(receivedToken);
2235
+ setToken(receivedToken);
2236
+ setUser(profile);
2237
+ }
2238
+ catch (err) {
2239
+ setError(err.message || 'Failed to fetch user profile');
2240
+ }
2241
+ finally {
2242
+ setLoading(false);
2243
+ setSession(null);
2244
+ }
2245
+ }, (err) => {
2246
+ if (activeSessionId.current !== newSession.sessionId)
2247
+ return;
2248
+ setError(err);
2249
+ setInitializing(false);
2250
+ setSession(null);
2251
+ });
2252
+ }
2253
+ catch (err) {
2254
+ setError(err.message || 'Failed to initiate login handshake');
2255
+ setInitializing(false);
2256
+ }
2257
+ }, [sdk]);
2258
+ // Cleanup on unmount
2259
+ reactExports.useEffect(() => {
2260
+ return () => {
2261
+ sdk.auth.disconnect();
2262
+ };
2263
+ }, [sdk]);
2264
+ return {
2265
+ user,
2266
+ token,
2267
+ loading,
2268
+ error,
2269
+ session,
2270
+ initializing,
2271
+ login,
2272
+ logout,
2273
+ cancel
2274
+ };
2275
+ }
2276
+
2277
+ /**
2278
+ * A ready-to-use React component for QidCloud QR identity authentication.
2279
+ */
2280
+ const QidSignInButton = ({ sdk, onSuccess, onError, className, buttonText = 'Login with QidCloud' }) => {
2281
+ const { user, token, error, session, initializing, login, cancel } = useQidAuth(sdk);
2282
+ // Watch for success
2283
+ React.useEffect(() => {
2284
+ if (user && token) {
2285
+ onSuccess(user, token);
2286
+ }
2287
+ }, [user, token, onSuccess]);
2288
+ // Watch for errors
2289
+ React.useEffect(() => {
2290
+ if (error && onError) {
2291
+ onError(error);
2292
+ }
2293
+ }, [error, onError]);
2294
+ return (React.createElement(React.Fragment, null,
2295
+ React.createElement("button", { onClick: login, disabled: initializing || !!session, className: className || 'qid-signin-btn', style: {
2296
+ backgroundColor: '#00e5ff',
2297
+ color: '#000',
2298
+ padding: '12px 24px',
2299
+ borderRadius: '12px',
2300
+ border: 'none',
2301
+ fontWeight: '900',
2302
+ cursor: (initializing || !!session) ? 'not-allowed' : 'pointer',
2303
+ display: 'flex',
2304
+ alignItems: 'center',
2305
+ gap: '10px',
2306
+ textTransform: 'uppercase',
2307
+ fontSize: '0.85rem',
2308
+ letterSpacing: '0.5px',
2309
+ boxShadow: '0 4px 15px rgba(0, 229, 255, 0.3)',
2310
+ transition: 'all 0.2s'
2311
+ } },
2312
+ React.createElement("div", { style: {
2313
+ width: '8px',
2314
+ height: '8px',
2315
+ borderRadius: '50%',
2316
+ backgroundColor: (initializing || !!session) ? '#333' : '#000',
2317
+ boxShadow: (initializing || !!session) ? 'none' : '0 0 8px rgba(0,0,0,0.5)'
2318
+ } }),
2319
+ initializing ? 'Preparing Handshake...' : (session ? 'Awaiting Scan...' : buttonText)),
2320
+ session && (React.createElement("div", { className: "qid-modal-overlay", style: {
2321
+ position: 'fixed',
2322
+ top: 0, left: 0, right: 0, bottom: 0,
2323
+ backgroundColor: 'rgba(0,0,0,0.92)',
2324
+ display: 'flex',
2325
+ justifyContent: 'center',
2326
+ alignItems: 'center',
2327
+ zIndex: 9999,
2328
+ backdropFilter: 'blur(8px)'
2329
+ } },
2330
+ React.createElement("div", { className: "qid-modal-content", style: {
2331
+ backgroundColor: '#0a0a0a',
2332
+ padding: '40px',
2333
+ borderRadius: '28px',
2334
+ textAlign: 'center',
2335
+ color: '#fff',
2336
+ maxWidth: '420px',
2337
+ width: '90%',
2338
+ border: '1px solid rgba(0, 229, 255, 0.2)',
2339
+ boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.5)'
2340
+ } },
2341
+ React.createElement("div", { style: { marginBottom: '25px' } },
2342
+ React.createElement("div", { style: {
2343
+ display: 'inline-block',
2344
+ padding: '12px 20px',
2345
+ borderRadius: '30px',
2346
+ backgroundColor: 'rgba(0, 229, 255, 0.1)',
2347
+ border: '1px solid rgba(0, 229, 255, 0.3)',
2348
+ marginBottom: '15px'
2349
+ } },
2350
+ React.createElement("span", { style: { color: '#00e5ff', fontSize: '0.7rem', fontWeight: '900', letterSpacing: '2px' } }, "PQC ENCLAVE SECURED")),
2351
+ React.createElement("h2", { style: { fontSize: '1.75rem', fontWeight: '900', marginBottom: '10px', letterSpacing: '-0.5px' } }, "Identity Handshake"),
2352
+ React.createElement("p", { style: { fontSize: '0.95rem', color: '#94a3b8', lineHeight: '1.6' } }, "Scan this encrypted gateway with your QidCloud app to authorize access.")),
2353
+ React.createElement("div", { style: {
2354
+ backgroundColor: '#fff',
2355
+ padding: '24px',
2356
+ display: 'inline-block',
2357
+ borderRadius: '24px',
2358
+ marginBottom: '30px',
2359
+ boxShadow: '0 10px 40px rgba(0,0,0,0.3)'
2360
+ } },
2361
+ React.createElement(QRCodeSVG, { value: session.qrData, size: 220, level: "H", includeMargin: false, imageSettings: {
2362
+ src: "https://api.qidcloud.com/favicon.ico",
2363
+ x: undefined,
2364
+ y: undefined,
2365
+ height: 40,
2366
+ width: 40,
2367
+ excavate: true,
2368
+ } })),
2369
+ React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '15px' } },
2370
+ React.createElement("div", { style: { height: '4px', width: '60px', backgroundColor: '#00e5ff', margin: '0 auto', borderRadius: '2px', opacity: 0.5 } }),
2371
+ React.createElement("button", { onClick: cancel, style: {
2372
+ display: 'block',
2373
+ width: '100%',
2374
+ padding: '16px',
2375
+ backgroundColor: 'transparent',
2376
+ color: '#64748b',
2377
+ border: '1px solid rgba(148, 163, 184, 0.2)',
2378
+ borderRadius: '16px',
2379
+ cursor: 'pointer',
2380
+ fontWeight: '700',
2381
+ transition: 'all 0.2s',
2382
+ fontSize: '0.9rem'
2383
+ } }, "Cancel Handshake")),
2384
+ React.createElement("div", { style: { marginTop: '25px', fontSize: '0.75rem', color: '#475569' } },
2385
+ "Session ID: ",
2386
+ session.sessionId.slice(0, 8),
2387
+ "..."))))));
2388
+ };
2389
+
2390
+ class QidCloud {
2391
+ config;
2392
+ api;
2393
+ auth;
2394
+ db;
2395
+ edge;
2396
+ vault;
2397
+ logs;
2398
+ constructor(config) {
2399
+ this.config = {
2400
+ baseUrl: 'https://api.qidcloud.com',
2401
+ ...config,
2402
+ };
2403
+ this.api = axios.create({
2404
+ baseURL: this.config.baseUrl,
2405
+ headers: {
2406
+ 'x-api-key': this.config.apiKey,
2407
+ 'Content-Type': 'application/json',
2408
+ },
2409
+ });
2410
+ this.auth = new AuthModule(this);
2411
+ this.db = new DbModule(this);
2412
+ this.edge = new EdgeModule(this);
2413
+ this.vault = new VaultModule(this);
2414
+ this.logs = new LogsModule(this);
2415
+ }
2416
+ /**
2417
+ * Get the current project configuration
2418
+ */
2419
+ getConfig() {
2420
+ return { ...this.config };
2421
+ }
2422
+ }
2423
+
2424
+ export { QidCloud, QidSignInButton, QidCloud as default, useQidAuth };
2425
+ //# sourceMappingURL=index.mjs.map