swr-resource 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2991 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+
31
+ // node_modules/react/cjs/react.production.js
32
+ var require_react_production = __commonJS({
33
+ "node_modules/react/cjs/react.production.js"(exports) {
34
+ "use strict";
35
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
36
+ var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
37
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
38
+ var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
39
+ var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
40
+ var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
41
+ var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
42
+ var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
43
+ var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
44
+ var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
45
+ var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
46
+ var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
47
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
48
+ function getIteratorFn(maybeIterable) {
49
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
50
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
51
+ return "function" === typeof maybeIterable ? maybeIterable : null;
52
+ }
53
+ var ReactNoopUpdateQueue = {
54
+ isMounted: function() {
55
+ return false;
56
+ },
57
+ enqueueForceUpdate: function() {
58
+ },
59
+ enqueueReplaceState: function() {
60
+ },
61
+ enqueueSetState: function() {
62
+ }
63
+ };
64
+ var assign = Object.assign;
65
+ var emptyObject = {};
66
+ function Component(props, context, updater) {
67
+ this.props = props;
68
+ this.context = context;
69
+ this.refs = emptyObject;
70
+ this.updater = updater || ReactNoopUpdateQueue;
71
+ }
72
+ Component.prototype.isReactComponent = {};
73
+ Component.prototype.setState = function(partialState, callback) {
74
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
75
+ throw Error(
76
+ "takes an object of state variables to update or a function which returns an object of state variables."
77
+ );
78
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
79
+ };
80
+ Component.prototype.forceUpdate = function(callback) {
81
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
82
+ };
83
+ function ComponentDummy() {
84
+ }
85
+ ComponentDummy.prototype = Component.prototype;
86
+ function PureComponent(props, context, updater) {
87
+ this.props = props;
88
+ this.context = context;
89
+ this.refs = emptyObject;
90
+ this.updater = updater || ReactNoopUpdateQueue;
91
+ }
92
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
93
+ pureComponentPrototype.constructor = PureComponent;
94
+ assign(pureComponentPrototype, Component.prototype);
95
+ pureComponentPrototype.isPureReactComponent = true;
96
+ var isArrayImpl = Array.isArray;
97
+ function noop3() {
98
+ }
99
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null };
100
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
101
+ function ReactElement(type, key, props) {
102
+ var refProp = props.ref;
103
+ return {
104
+ $$typeof: REACT_ELEMENT_TYPE,
105
+ type,
106
+ key,
107
+ ref: void 0 !== refProp ? refProp : null,
108
+ props
109
+ };
110
+ }
111
+ function cloneAndReplaceKey(oldElement, newKey) {
112
+ return ReactElement(oldElement.type, newKey, oldElement.props);
113
+ }
114
+ function isValidElement(object) {
115
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
116
+ }
117
+ function escape(key) {
118
+ var escaperLookup = { "=": "=0", ":": "=2" };
119
+ return "$" + key.replace(/[=:]/g, function(match) {
120
+ return escaperLookup[match];
121
+ });
122
+ }
123
+ var userProvidedKeyEscapeRegex = /\/+/g;
124
+ function getElementKey(element, index) {
125
+ return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
126
+ }
127
+ function resolveThenable(thenable) {
128
+ switch (thenable.status) {
129
+ case "fulfilled":
130
+ return thenable.value;
131
+ case "rejected":
132
+ throw thenable.reason;
133
+ default:
134
+ switch ("string" === typeof thenable.status ? thenable.then(noop3, noop3) : (thenable.status = "pending", thenable.then(
135
+ function(fulfilledValue) {
136
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
137
+ },
138
+ function(error) {
139
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
140
+ }
141
+ )), thenable.status) {
142
+ case "fulfilled":
143
+ return thenable.value;
144
+ case "rejected":
145
+ throw thenable.reason;
146
+ }
147
+ }
148
+ throw thenable;
149
+ }
150
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
151
+ var type = typeof children;
152
+ if ("undefined" === type || "boolean" === type) children = null;
153
+ var invokeCallback = false;
154
+ if (null === children) invokeCallback = true;
155
+ else
156
+ switch (type) {
157
+ case "bigint":
158
+ case "string":
159
+ case "number":
160
+ invokeCallback = true;
161
+ break;
162
+ case "object":
163
+ switch (children.$$typeof) {
164
+ case REACT_ELEMENT_TYPE:
165
+ case REACT_PORTAL_TYPE:
166
+ invokeCallback = true;
167
+ break;
168
+ case REACT_LAZY_TYPE:
169
+ return invokeCallback = children._init, mapIntoArray(
170
+ invokeCallback(children._payload),
171
+ array,
172
+ escapedPrefix,
173
+ nameSoFar,
174
+ callback
175
+ );
176
+ }
177
+ }
178
+ if (invokeCallback)
179
+ 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) {
180
+ return c;
181
+ })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
182
+ callback,
183
+ escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
184
+ userProvidedKeyEscapeRegex,
185
+ "$&/"
186
+ ) + "/") + invokeCallback
187
+ )), array.push(callback)), 1;
188
+ invokeCallback = 0;
189
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
190
+ if (isArrayImpl(children))
191
+ for (var i = 0; i < children.length; i++)
192
+ nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
193
+ nameSoFar,
194
+ array,
195
+ escapedPrefix,
196
+ type,
197
+ callback
198
+ );
199
+ else if (i = getIteratorFn(children), "function" === typeof i)
200
+ for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
201
+ nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
202
+ nameSoFar,
203
+ array,
204
+ escapedPrefix,
205
+ type,
206
+ callback
207
+ );
208
+ else if ("object" === type) {
209
+ if ("function" === typeof children.then)
210
+ return mapIntoArray(
211
+ resolveThenable(children),
212
+ array,
213
+ escapedPrefix,
214
+ nameSoFar,
215
+ callback
216
+ );
217
+ array = String(children);
218
+ throw Error(
219
+ "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."
220
+ );
221
+ }
222
+ return invokeCallback;
223
+ }
224
+ function mapChildren(children, func, context) {
225
+ if (null == children) return children;
226
+ var result = [], count = 0;
227
+ mapIntoArray(children, result, "", "", function(child) {
228
+ return func.call(context, child, count++);
229
+ });
230
+ return result;
231
+ }
232
+ function lazyInitializer(payload) {
233
+ if (-1 === payload._status) {
234
+ var ctor = payload._result;
235
+ ctor = ctor();
236
+ ctor.then(
237
+ function(moduleObject) {
238
+ if (0 === payload._status || -1 === payload._status)
239
+ payload._status = 1, payload._result = moduleObject;
240
+ },
241
+ function(error) {
242
+ if (0 === payload._status || -1 === payload._status)
243
+ payload._status = 2, payload._result = error;
244
+ }
245
+ );
246
+ -1 === payload._status && (payload._status = 0, payload._result = ctor);
247
+ }
248
+ if (1 === payload._status) return payload._result.default;
249
+ throw payload._result;
250
+ }
251
+ var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
252
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
253
+ var event = new window.ErrorEvent("error", {
254
+ bubbles: true,
255
+ cancelable: true,
256
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
257
+ error
258
+ });
259
+ if (!window.dispatchEvent(event)) return;
260
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
261
+ process.emit("uncaughtException", error);
262
+ return;
263
+ }
264
+ console.error(error);
265
+ };
266
+ var Children = {
267
+ map: mapChildren,
268
+ forEach: function(children, forEachFunc, forEachContext) {
269
+ mapChildren(
270
+ children,
271
+ function() {
272
+ forEachFunc.apply(this, arguments);
273
+ },
274
+ forEachContext
275
+ );
276
+ },
277
+ count: function(children) {
278
+ var n = 0;
279
+ mapChildren(children, function() {
280
+ n++;
281
+ });
282
+ return n;
283
+ },
284
+ toArray: function(children) {
285
+ return mapChildren(children, function(child) {
286
+ return child;
287
+ }) || [];
288
+ },
289
+ only: function(children) {
290
+ if (!isValidElement(children))
291
+ throw Error(
292
+ "React.Children.only expected to receive a single React element child."
293
+ );
294
+ return children;
295
+ }
296
+ };
297
+ exports.Activity = REACT_ACTIVITY_TYPE;
298
+ exports.Children = Children;
299
+ exports.Component = Component;
300
+ exports.Fragment = REACT_FRAGMENT_TYPE;
301
+ exports.Profiler = REACT_PROFILER_TYPE;
302
+ exports.PureComponent = PureComponent;
303
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
304
+ exports.Suspense = REACT_SUSPENSE_TYPE;
305
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
306
+ exports.__COMPILER_RUNTIME = {
307
+ __proto__: null,
308
+ c: function(size) {
309
+ return ReactSharedInternals.H.useMemoCache(size);
310
+ }
311
+ };
312
+ exports.cache = function(fn) {
313
+ return function() {
314
+ return fn.apply(null, arguments);
315
+ };
316
+ };
317
+ exports.cacheSignal = function() {
318
+ return null;
319
+ };
320
+ exports.cloneElement = function(element, config, children) {
321
+ if (null === element || void 0 === element)
322
+ throw Error(
323
+ "The argument must be a React element, but you passed " + element + "."
324
+ );
325
+ var props = assign({}, element.props), key = element.key;
326
+ if (null != config)
327
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
328
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
329
+ var propName = arguments.length - 2;
330
+ if (1 === propName) props.children = children;
331
+ else if (1 < propName) {
332
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
333
+ childArray[i] = arguments[i + 2];
334
+ props.children = childArray;
335
+ }
336
+ return ReactElement(element.type, key, props);
337
+ };
338
+ exports.createContext = function(defaultValue) {
339
+ defaultValue = {
340
+ $$typeof: REACT_CONTEXT_TYPE,
341
+ _currentValue: defaultValue,
342
+ _currentValue2: defaultValue,
343
+ _threadCount: 0,
344
+ Provider: null,
345
+ Consumer: null
346
+ };
347
+ defaultValue.Provider = defaultValue;
348
+ defaultValue.Consumer = {
349
+ $$typeof: REACT_CONSUMER_TYPE,
350
+ _context: defaultValue
351
+ };
352
+ return defaultValue;
353
+ };
354
+ exports.createElement = function(type, config, children) {
355
+ var propName, props = {}, key = null;
356
+ if (null != config)
357
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
358
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
359
+ var childrenLength = arguments.length - 2;
360
+ if (1 === childrenLength) props.children = children;
361
+ else if (1 < childrenLength) {
362
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
363
+ childArray[i] = arguments[i + 2];
364
+ props.children = childArray;
365
+ }
366
+ if (type && type.defaultProps)
367
+ for (propName in childrenLength = type.defaultProps, childrenLength)
368
+ void 0 === props[propName] && (props[propName] = childrenLength[propName]);
369
+ return ReactElement(type, key, props);
370
+ };
371
+ exports.createRef = function() {
372
+ return { current: null };
373
+ };
374
+ exports.forwardRef = function(render) {
375
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render };
376
+ };
377
+ exports.isValidElement = isValidElement;
378
+ exports.lazy = function(ctor) {
379
+ return {
380
+ $$typeof: REACT_LAZY_TYPE,
381
+ _payload: { _status: -1, _result: ctor },
382
+ _init: lazyInitializer
383
+ };
384
+ };
385
+ exports.memo = function(type, compare2) {
386
+ return {
387
+ $$typeof: REACT_MEMO_TYPE,
388
+ type,
389
+ compare: void 0 === compare2 ? null : compare2
390
+ };
391
+ };
392
+ exports.startTransition = function(scope) {
393
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
394
+ ReactSharedInternals.T = currentTransition;
395
+ try {
396
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
397
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
398
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop3, reportGlobalError);
399
+ } catch (error) {
400
+ reportGlobalError(error);
401
+ } finally {
402
+ null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
403
+ }
404
+ };
405
+ exports.unstable_useCacheRefresh = function() {
406
+ return ReactSharedInternals.H.useCacheRefresh();
407
+ };
408
+ exports.use = function(usable) {
409
+ return ReactSharedInternals.H.use(usable);
410
+ };
411
+ exports.useActionState = function(action, initialState, permalink) {
412
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
413
+ };
414
+ exports.useCallback = function(callback, deps) {
415
+ return ReactSharedInternals.H.useCallback(callback, deps);
416
+ };
417
+ exports.useContext = function(Context) {
418
+ return ReactSharedInternals.H.useContext(Context);
419
+ };
420
+ exports.useDebugValue = function() {
421
+ };
422
+ exports.useDeferredValue = function(value, initialValue) {
423
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
424
+ };
425
+ exports.useEffect = function(create, deps) {
426
+ return ReactSharedInternals.H.useEffect(create, deps);
427
+ };
428
+ exports.useEffectEvent = function(callback) {
429
+ return ReactSharedInternals.H.useEffectEvent(callback);
430
+ };
431
+ exports.useId = function() {
432
+ return ReactSharedInternals.H.useId();
433
+ };
434
+ exports.useImperativeHandle = function(ref, create, deps) {
435
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
436
+ };
437
+ exports.useInsertionEffect = function(create, deps) {
438
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
439
+ };
440
+ exports.useLayoutEffect = function(create, deps) {
441
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
442
+ };
443
+ exports.useMemo = function(create, deps) {
444
+ return ReactSharedInternals.H.useMemo(create, deps);
445
+ };
446
+ exports.useOptimistic = function(passthrough, reducer) {
447
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
448
+ };
449
+ exports.useReducer = function(reducer, initialArg, init) {
450
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
451
+ };
452
+ exports.useRef = function(initialValue) {
453
+ return ReactSharedInternals.H.useRef(initialValue);
454
+ };
455
+ exports.useState = function(initialState) {
456
+ return ReactSharedInternals.H.useState(initialState);
457
+ };
458
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
459
+ return ReactSharedInternals.H.useSyncExternalStore(
460
+ subscribe,
461
+ getSnapshot,
462
+ getServerSnapshot
463
+ );
464
+ };
465
+ exports.useTransition = function() {
466
+ return ReactSharedInternals.H.useTransition();
467
+ };
468
+ exports.version = "19.2.7";
469
+ }
470
+ });
471
+
472
+ // node_modules/react/cjs/react.development.js
473
+ var require_react_development = __commonJS({
474
+ "node_modules/react/cjs/react.development.js"(exports, module) {
475
+ "use strict";
476
+ "production" !== process.env.NODE_ENV && (function() {
477
+ function defineDeprecationWarning(methodName, info) {
478
+ Object.defineProperty(Component.prototype, methodName, {
479
+ get: function() {
480
+ console.warn(
481
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
482
+ info[0],
483
+ info[1]
484
+ );
485
+ }
486
+ });
487
+ }
488
+ function getIteratorFn(maybeIterable) {
489
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
490
+ return null;
491
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
492
+ return "function" === typeof maybeIterable ? maybeIterable : null;
493
+ }
494
+ function warnNoop(publicInstance, callerName) {
495
+ publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
496
+ var warningKey = publicInstance + "." + callerName;
497
+ didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
498
+ "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.",
499
+ callerName,
500
+ publicInstance
501
+ ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
502
+ }
503
+ function Component(props, context, updater) {
504
+ this.props = props;
505
+ this.context = context;
506
+ this.refs = emptyObject;
507
+ this.updater = updater || ReactNoopUpdateQueue;
508
+ }
509
+ function ComponentDummy() {
510
+ }
511
+ function PureComponent(props, context, updater) {
512
+ this.props = props;
513
+ this.context = context;
514
+ this.refs = emptyObject;
515
+ this.updater = updater || ReactNoopUpdateQueue;
516
+ }
517
+ function noop3() {
518
+ }
519
+ function testStringCoercion(value) {
520
+ return "" + value;
521
+ }
522
+ function checkKeyStringCoercion(value) {
523
+ try {
524
+ testStringCoercion(value);
525
+ var JSCompiler_inline_result = false;
526
+ } catch (e) {
527
+ JSCompiler_inline_result = true;
528
+ }
529
+ if (JSCompiler_inline_result) {
530
+ JSCompiler_inline_result = console;
531
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
532
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
533
+ JSCompiler_temp_const.call(
534
+ JSCompiler_inline_result,
535
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
536
+ JSCompiler_inline_result$jscomp$0
537
+ );
538
+ return testStringCoercion(value);
539
+ }
540
+ }
541
+ function getComponentNameFromType(type) {
542
+ if (null == type) return null;
543
+ if ("function" === typeof type)
544
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
545
+ if ("string" === typeof type) return type;
546
+ switch (type) {
547
+ case REACT_FRAGMENT_TYPE:
548
+ return "Fragment";
549
+ case REACT_PROFILER_TYPE:
550
+ return "Profiler";
551
+ case REACT_STRICT_MODE_TYPE:
552
+ return "StrictMode";
553
+ case REACT_SUSPENSE_TYPE:
554
+ return "Suspense";
555
+ case REACT_SUSPENSE_LIST_TYPE:
556
+ return "SuspenseList";
557
+ case REACT_ACTIVITY_TYPE:
558
+ return "Activity";
559
+ }
560
+ if ("object" === typeof type)
561
+ switch ("number" === typeof type.tag && console.error(
562
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
563
+ ), type.$$typeof) {
564
+ case REACT_PORTAL_TYPE:
565
+ return "Portal";
566
+ case REACT_CONTEXT_TYPE:
567
+ return type.displayName || "Context";
568
+ case REACT_CONSUMER_TYPE:
569
+ return (type._context.displayName || "Context") + ".Consumer";
570
+ case REACT_FORWARD_REF_TYPE:
571
+ var innerType = type.render;
572
+ type = type.displayName;
573
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
574
+ return type;
575
+ case REACT_MEMO_TYPE:
576
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
577
+ case REACT_LAZY_TYPE:
578
+ innerType = type._payload;
579
+ type = type._init;
580
+ try {
581
+ return getComponentNameFromType(type(innerType));
582
+ } catch (x) {
583
+ }
584
+ }
585
+ return null;
586
+ }
587
+ function getTaskName(type) {
588
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
589
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
590
+ return "<...>";
591
+ try {
592
+ var name = getComponentNameFromType(type);
593
+ return name ? "<" + name + ">" : "<...>";
594
+ } catch (x) {
595
+ return "<...>";
596
+ }
597
+ }
598
+ function getOwner() {
599
+ var dispatcher = ReactSharedInternals.A;
600
+ return null === dispatcher ? null : dispatcher.getOwner();
601
+ }
602
+ function UnknownOwner() {
603
+ return Error("react-stack-top-frame");
604
+ }
605
+ function hasValidKey(config) {
606
+ if (hasOwnProperty.call(config, "key")) {
607
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
608
+ if (getter && getter.isReactWarning) return false;
609
+ }
610
+ return void 0 !== config.key;
611
+ }
612
+ function defineKeyPropWarningGetter(props, displayName) {
613
+ function warnAboutAccessingKey() {
614
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
615
+ "%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)",
616
+ displayName
617
+ ));
618
+ }
619
+ warnAboutAccessingKey.isReactWarning = true;
620
+ Object.defineProperty(props, "key", {
621
+ get: warnAboutAccessingKey,
622
+ configurable: true
623
+ });
624
+ }
625
+ function elementRefGetterWithDeprecationWarning() {
626
+ var componentName = getComponentNameFromType(this.type);
627
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
628
+ "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."
629
+ ));
630
+ componentName = this.props.ref;
631
+ return void 0 !== componentName ? componentName : null;
632
+ }
633
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
634
+ var refProp = props.ref;
635
+ type = {
636
+ $$typeof: REACT_ELEMENT_TYPE,
637
+ type,
638
+ key,
639
+ props,
640
+ _owner: owner
641
+ };
642
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
643
+ enumerable: false,
644
+ get: elementRefGetterWithDeprecationWarning
645
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
646
+ type._store = {};
647
+ Object.defineProperty(type._store, "validated", {
648
+ configurable: false,
649
+ enumerable: false,
650
+ writable: true,
651
+ value: 0
652
+ });
653
+ Object.defineProperty(type, "_debugInfo", {
654
+ configurable: false,
655
+ enumerable: false,
656
+ writable: true,
657
+ value: null
658
+ });
659
+ Object.defineProperty(type, "_debugStack", {
660
+ configurable: false,
661
+ enumerable: false,
662
+ writable: true,
663
+ value: debugStack
664
+ });
665
+ Object.defineProperty(type, "_debugTask", {
666
+ configurable: false,
667
+ enumerable: false,
668
+ writable: true,
669
+ value: debugTask
670
+ });
671
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
672
+ return type;
673
+ }
674
+ function cloneAndReplaceKey(oldElement, newKey) {
675
+ newKey = ReactElement(
676
+ oldElement.type,
677
+ newKey,
678
+ oldElement.props,
679
+ oldElement._owner,
680
+ oldElement._debugStack,
681
+ oldElement._debugTask
682
+ );
683
+ oldElement._store && (newKey._store.validated = oldElement._store.validated);
684
+ return newKey;
685
+ }
686
+ function validateChildKeys(node) {
687
+ 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));
688
+ }
689
+ function isValidElement(object) {
690
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
691
+ }
692
+ function escape(key) {
693
+ var escaperLookup = { "=": "=0", ":": "=2" };
694
+ return "$" + key.replace(/[=:]/g, function(match) {
695
+ return escaperLookup[match];
696
+ });
697
+ }
698
+ function getElementKey(element, index) {
699
+ return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
700
+ }
701
+ function resolveThenable(thenable) {
702
+ switch (thenable.status) {
703
+ case "fulfilled":
704
+ return thenable.value;
705
+ case "rejected":
706
+ throw thenable.reason;
707
+ default:
708
+ switch ("string" === typeof thenable.status ? thenable.then(noop3, noop3) : (thenable.status = "pending", thenable.then(
709
+ function(fulfilledValue) {
710
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
711
+ },
712
+ function(error) {
713
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
714
+ }
715
+ )), thenable.status) {
716
+ case "fulfilled":
717
+ return thenable.value;
718
+ case "rejected":
719
+ throw thenable.reason;
720
+ }
721
+ }
722
+ throw thenable;
723
+ }
724
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
725
+ var type = typeof children;
726
+ if ("undefined" === type || "boolean" === type) children = null;
727
+ var invokeCallback = false;
728
+ if (null === children) invokeCallback = true;
729
+ else
730
+ switch (type) {
731
+ case "bigint":
732
+ case "string":
733
+ case "number":
734
+ invokeCallback = true;
735
+ break;
736
+ case "object":
737
+ switch (children.$$typeof) {
738
+ case REACT_ELEMENT_TYPE:
739
+ case REACT_PORTAL_TYPE:
740
+ invokeCallback = true;
741
+ break;
742
+ case REACT_LAZY_TYPE:
743
+ return invokeCallback = children._init, mapIntoArray(
744
+ invokeCallback(children._payload),
745
+ array,
746
+ escapedPrefix,
747
+ nameSoFar,
748
+ callback
749
+ );
750
+ }
751
+ }
752
+ if (invokeCallback) {
753
+ invokeCallback = children;
754
+ callback = callback(invokeCallback);
755
+ var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
756
+ isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
757
+ return c;
758
+ })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
759
+ callback,
760
+ escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
761
+ userProvidedKeyEscapeRegex,
762
+ "$&/"
763
+ ) + "/") + childKey
764
+ ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
765
+ return 1;
766
+ }
767
+ invokeCallback = 0;
768
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
769
+ if (isArrayImpl(children))
770
+ for (var i = 0; i < children.length; i++)
771
+ nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
772
+ nameSoFar,
773
+ array,
774
+ escapedPrefix,
775
+ type,
776
+ callback
777
+ );
778
+ else if (i = getIteratorFn(children), "function" === typeof i)
779
+ for (i === children.entries && (didWarnAboutMaps || console.warn(
780
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
781
+ ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
782
+ nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
783
+ nameSoFar,
784
+ array,
785
+ escapedPrefix,
786
+ type,
787
+ callback
788
+ );
789
+ else if ("object" === type) {
790
+ if ("function" === typeof children.then)
791
+ return mapIntoArray(
792
+ resolveThenable(children),
793
+ array,
794
+ escapedPrefix,
795
+ nameSoFar,
796
+ callback
797
+ );
798
+ array = String(children);
799
+ throw Error(
800
+ "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."
801
+ );
802
+ }
803
+ return invokeCallback;
804
+ }
805
+ function mapChildren(children, func, context) {
806
+ if (null == children) return children;
807
+ var result = [], count = 0;
808
+ mapIntoArray(children, result, "", "", function(child) {
809
+ return func.call(context, child, count++);
810
+ });
811
+ return result;
812
+ }
813
+ function lazyInitializer(payload) {
814
+ if (-1 === payload._status) {
815
+ var ioInfo = payload._ioInfo;
816
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
817
+ ioInfo = payload._result;
818
+ var thenable = ioInfo();
819
+ thenable.then(
820
+ function(moduleObject) {
821
+ if (0 === payload._status || -1 === payload._status) {
822
+ payload._status = 1;
823
+ payload._result = moduleObject;
824
+ var _ioInfo = payload._ioInfo;
825
+ null != _ioInfo && (_ioInfo.end = performance.now());
826
+ void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
827
+ }
828
+ },
829
+ function(error) {
830
+ if (0 === payload._status || -1 === payload._status) {
831
+ payload._status = 2;
832
+ payload._result = error;
833
+ var _ioInfo2 = payload._ioInfo;
834
+ null != _ioInfo2 && (_ioInfo2.end = performance.now());
835
+ void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
836
+ }
837
+ }
838
+ );
839
+ ioInfo = payload._ioInfo;
840
+ if (null != ioInfo) {
841
+ ioInfo.value = thenable;
842
+ var displayName = thenable.displayName;
843
+ "string" === typeof displayName && (ioInfo.name = displayName);
844
+ }
845
+ -1 === payload._status && (payload._status = 0, payload._result = thenable);
846
+ }
847
+ if (1 === payload._status)
848
+ return ioInfo = payload._result, void 0 === ioInfo && console.error(
849
+ "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?",
850
+ ioInfo
851
+ ), "default" in ioInfo || console.error(
852
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
853
+ ioInfo
854
+ ), ioInfo.default;
855
+ throw payload._result;
856
+ }
857
+ function resolveDispatcher() {
858
+ var dispatcher = ReactSharedInternals.H;
859
+ null === dispatcher && console.error(
860
+ "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."
861
+ );
862
+ return dispatcher;
863
+ }
864
+ function releaseAsyncTransition() {
865
+ ReactSharedInternals.asyncTransitions--;
866
+ }
867
+ function enqueueTask(task) {
868
+ if (null === enqueueTaskImpl)
869
+ try {
870
+ var requireString = ("require" + Math.random()).slice(0, 7);
871
+ enqueueTaskImpl = (module && module[requireString]).call(
872
+ module,
873
+ "timers"
874
+ ).setImmediate;
875
+ } catch (_err) {
876
+ enqueueTaskImpl = function(callback) {
877
+ false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
878
+ "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."
879
+ ));
880
+ var channel = new MessageChannel();
881
+ channel.port1.onmessage = callback;
882
+ channel.port2.postMessage(void 0);
883
+ };
884
+ }
885
+ return enqueueTaskImpl(task);
886
+ }
887
+ function aggregateErrors(errors) {
888
+ return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
889
+ }
890
+ function popActScope(prevActQueue, prevActScopeDepth) {
891
+ prevActScopeDepth !== actScopeDepth - 1 && console.error(
892
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
893
+ );
894
+ actScopeDepth = prevActScopeDepth;
895
+ }
896
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
897
+ var queue = ReactSharedInternals.actQueue;
898
+ if (null !== queue)
899
+ if (0 !== queue.length)
900
+ try {
901
+ flushActQueue(queue);
902
+ enqueueTask(function() {
903
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
904
+ });
905
+ return;
906
+ } catch (error) {
907
+ ReactSharedInternals.thrownErrors.push(error);
908
+ }
909
+ else ReactSharedInternals.actQueue = null;
910
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
911
+ }
912
+ function flushActQueue(queue) {
913
+ if (!isFlushing) {
914
+ isFlushing = true;
915
+ var i = 0;
916
+ try {
917
+ for (; i < queue.length; i++) {
918
+ var callback = queue[i];
919
+ do {
920
+ ReactSharedInternals.didUsePromise = false;
921
+ var continuation = callback(false);
922
+ if (null !== continuation) {
923
+ if (ReactSharedInternals.didUsePromise) {
924
+ queue[i] = callback;
925
+ queue.splice(0, i);
926
+ return;
927
+ }
928
+ callback = continuation;
929
+ } else break;
930
+ } while (1);
931
+ }
932
+ queue.length = 0;
933
+ } catch (error) {
934
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
935
+ } finally {
936
+ isFlushing = false;
937
+ }
938
+ }
939
+ }
940
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
941
+ 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 = {
942
+ isMounted: function() {
943
+ return false;
944
+ },
945
+ enqueueForceUpdate: function(publicInstance) {
946
+ warnNoop(publicInstance, "forceUpdate");
947
+ },
948
+ enqueueReplaceState: function(publicInstance) {
949
+ warnNoop(publicInstance, "replaceState");
950
+ },
951
+ enqueueSetState: function(publicInstance) {
952
+ warnNoop(publicInstance, "setState");
953
+ }
954
+ }, assign = Object.assign, emptyObject = {};
955
+ Object.freeze(emptyObject);
956
+ Component.prototype.isReactComponent = {};
957
+ Component.prototype.setState = function(partialState, callback) {
958
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
959
+ throw Error(
960
+ "takes an object of state variables to update or a function which returns an object of state variables."
961
+ );
962
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
963
+ };
964
+ Component.prototype.forceUpdate = function(callback) {
965
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
966
+ };
967
+ var deprecatedAPIs = {
968
+ isMounted: [
969
+ "isMounted",
970
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
971
+ ],
972
+ replaceState: [
973
+ "replaceState",
974
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
975
+ ]
976
+ };
977
+ for (fnName in deprecatedAPIs)
978
+ deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
979
+ ComponentDummy.prototype = Component.prototype;
980
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
981
+ deprecatedAPIs.constructor = PureComponent;
982
+ assign(deprecatedAPIs, Component.prototype);
983
+ deprecatedAPIs.isPureReactComponent = true;
984
+ var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
985
+ H: null,
986
+ A: null,
987
+ T: null,
988
+ S: null,
989
+ actQueue: null,
990
+ asyncTransitions: 0,
991
+ isBatchingLegacy: false,
992
+ didScheduleLegacyUpdate: false,
993
+ didUsePromise: false,
994
+ thrownErrors: [],
995
+ getCurrentStack: null,
996
+ recentlyCreatedOwnerStacks: 0
997
+ }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
998
+ return null;
999
+ };
1000
+ deprecatedAPIs = {
1001
+ react_stack_bottom_frame: function(callStackForError) {
1002
+ return callStackForError();
1003
+ }
1004
+ };
1005
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1006
+ var didWarnAboutElementRef = {};
1007
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1008
+ deprecatedAPIs,
1009
+ UnknownOwner
1010
+ )();
1011
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1012
+ var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1013
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1014
+ var event = new window.ErrorEvent("error", {
1015
+ bubbles: true,
1016
+ cancelable: true,
1017
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1018
+ error
1019
+ });
1020
+ if (!window.dispatchEvent(event)) return;
1021
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
1022
+ process.emit("uncaughtException", error);
1023
+ return;
1024
+ }
1025
+ console.error(error);
1026
+ }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1027
+ queueMicrotask(function() {
1028
+ return queueMicrotask(callback);
1029
+ });
1030
+ } : enqueueTask;
1031
+ deprecatedAPIs = Object.freeze({
1032
+ __proto__: null,
1033
+ c: function(size) {
1034
+ return resolveDispatcher().useMemoCache(size);
1035
+ }
1036
+ });
1037
+ var fnName = {
1038
+ map: mapChildren,
1039
+ forEach: function(children, forEachFunc, forEachContext) {
1040
+ mapChildren(
1041
+ children,
1042
+ function() {
1043
+ forEachFunc.apply(this, arguments);
1044
+ },
1045
+ forEachContext
1046
+ );
1047
+ },
1048
+ count: function(children) {
1049
+ var n = 0;
1050
+ mapChildren(children, function() {
1051
+ n++;
1052
+ });
1053
+ return n;
1054
+ },
1055
+ toArray: function(children) {
1056
+ return mapChildren(children, function(child) {
1057
+ return child;
1058
+ }) || [];
1059
+ },
1060
+ only: function(children) {
1061
+ if (!isValidElement(children))
1062
+ throw Error(
1063
+ "React.Children.only expected to receive a single React element child."
1064
+ );
1065
+ return children;
1066
+ }
1067
+ };
1068
+ exports.Activity = REACT_ACTIVITY_TYPE;
1069
+ exports.Children = fnName;
1070
+ exports.Component = Component;
1071
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1072
+ exports.Profiler = REACT_PROFILER_TYPE;
1073
+ exports.PureComponent = PureComponent;
1074
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1075
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1076
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1077
+ exports.__COMPILER_RUNTIME = deprecatedAPIs;
1078
+ exports.act = function(callback) {
1079
+ var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1080
+ actScopeDepth++;
1081
+ var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1082
+ try {
1083
+ var result = callback();
1084
+ } catch (error) {
1085
+ ReactSharedInternals.thrownErrors.push(error);
1086
+ }
1087
+ if (0 < ReactSharedInternals.thrownErrors.length)
1088
+ throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1089
+ if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1090
+ var thenable = result;
1091
+ queueSeveralMicrotasks(function() {
1092
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1093
+ "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 () => ...);"
1094
+ ));
1095
+ });
1096
+ return {
1097
+ then: function(resolve, reject) {
1098
+ didAwaitActCall = true;
1099
+ thenable.then(
1100
+ function(returnValue) {
1101
+ popActScope(prevActQueue, prevActScopeDepth);
1102
+ if (0 === prevActScopeDepth) {
1103
+ try {
1104
+ flushActQueue(queue), enqueueTask(function() {
1105
+ return recursivelyFlushAsyncActWork(
1106
+ returnValue,
1107
+ resolve,
1108
+ reject
1109
+ );
1110
+ });
1111
+ } catch (error$0) {
1112
+ ReactSharedInternals.thrownErrors.push(error$0);
1113
+ }
1114
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1115
+ var _thrownError = aggregateErrors(
1116
+ ReactSharedInternals.thrownErrors
1117
+ );
1118
+ ReactSharedInternals.thrownErrors.length = 0;
1119
+ reject(_thrownError);
1120
+ }
1121
+ } else resolve(returnValue);
1122
+ },
1123
+ function(error) {
1124
+ popActScope(prevActQueue, prevActScopeDepth);
1125
+ 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1126
+ ReactSharedInternals.thrownErrors
1127
+ ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1128
+ }
1129
+ );
1130
+ }
1131
+ };
1132
+ }
1133
+ var returnValue$jscomp$0 = result;
1134
+ popActScope(prevActQueue, prevActScopeDepth);
1135
+ 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1136
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1137
+ "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(() => ...)"
1138
+ ));
1139
+ }), ReactSharedInternals.actQueue = null);
1140
+ if (0 < ReactSharedInternals.thrownErrors.length)
1141
+ throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1142
+ return {
1143
+ then: function(resolve, reject) {
1144
+ didAwaitActCall = true;
1145
+ 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1146
+ return recursivelyFlushAsyncActWork(
1147
+ returnValue$jscomp$0,
1148
+ resolve,
1149
+ reject
1150
+ );
1151
+ })) : resolve(returnValue$jscomp$0);
1152
+ }
1153
+ };
1154
+ };
1155
+ exports.cache = function(fn) {
1156
+ return function() {
1157
+ return fn.apply(null, arguments);
1158
+ };
1159
+ };
1160
+ exports.cacheSignal = function() {
1161
+ return null;
1162
+ };
1163
+ exports.captureOwnerStack = function() {
1164
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1165
+ return null === getCurrentStack ? null : getCurrentStack();
1166
+ };
1167
+ exports.cloneElement = function(element, config, children) {
1168
+ if (null === element || void 0 === element)
1169
+ throw Error(
1170
+ "The argument must be a React element, but you passed " + element + "."
1171
+ );
1172
+ var props = assign({}, element.props), key = element.key, owner = element._owner;
1173
+ if (null != config) {
1174
+ var JSCompiler_inline_result;
1175
+ a: {
1176
+ if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1177
+ config,
1178
+ "ref"
1179
+ ).get) && JSCompiler_inline_result.isReactWarning) {
1180
+ JSCompiler_inline_result = false;
1181
+ break a;
1182
+ }
1183
+ JSCompiler_inline_result = void 0 !== config.ref;
1184
+ }
1185
+ JSCompiler_inline_result && (owner = getOwner());
1186
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1187
+ for (propName in config)
1188
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1189
+ }
1190
+ var propName = arguments.length - 2;
1191
+ if (1 === propName) props.children = children;
1192
+ else if (1 < propName) {
1193
+ JSCompiler_inline_result = Array(propName);
1194
+ for (var i = 0; i < propName; i++)
1195
+ JSCompiler_inline_result[i] = arguments[i + 2];
1196
+ props.children = JSCompiler_inline_result;
1197
+ }
1198
+ props = ReactElement(
1199
+ element.type,
1200
+ key,
1201
+ props,
1202
+ owner,
1203
+ element._debugStack,
1204
+ element._debugTask
1205
+ );
1206
+ for (key = 2; key < arguments.length; key++)
1207
+ validateChildKeys(arguments[key]);
1208
+ return props;
1209
+ };
1210
+ exports.createContext = function(defaultValue) {
1211
+ defaultValue = {
1212
+ $$typeof: REACT_CONTEXT_TYPE,
1213
+ _currentValue: defaultValue,
1214
+ _currentValue2: defaultValue,
1215
+ _threadCount: 0,
1216
+ Provider: null,
1217
+ Consumer: null
1218
+ };
1219
+ defaultValue.Provider = defaultValue;
1220
+ defaultValue.Consumer = {
1221
+ $$typeof: REACT_CONSUMER_TYPE,
1222
+ _context: defaultValue
1223
+ };
1224
+ defaultValue._currentRenderer = null;
1225
+ defaultValue._currentRenderer2 = null;
1226
+ return defaultValue;
1227
+ };
1228
+ exports.createElement = function(type, config, children) {
1229
+ for (var i = 2; i < arguments.length; i++)
1230
+ validateChildKeys(arguments[i]);
1231
+ i = {};
1232
+ var key = null;
1233
+ if (null != config)
1234
+ for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1235
+ "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"
1236
+ )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1237
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1238
+ var childrenLength = arguments.length - 2;
1239
+ if (1 === childrenLength) i.children = children;
1240
+ else if (1 < childrenLength) {
1241
+ for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1242
+ childArray[_i] = arguments[_i + 2];
1243
+ Object.freeze && Object.freeze(childArray);
1244
+ i.children = childArray;
1245
+ }
1246
+ if (type && type.defaultProps)
1247
+ for (propName in childrenLength = type.defaultProps, childrenLength)
1248
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1249
+ key && defineKeyPropWarningGetter(
1250
+ i,
1251
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1252
+ );
1253
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1254
+ return ReactElement(
1255
+ type,
1256
+ key,
1257
+ i,
1258
+ getOwner(),
1259
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1260
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1261
+ );
1262
+ };
1263
+ exports.createRef = function() {
1264
+ var refObject = { current: null };
1265
+ Object.seal(refObject);
1266
+ return refObject;
1267
+ };
1268
+ exports.forwardRef = function(render) {
1269
+ null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1270
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1271
+ ) : "function" !== typeof render ? console.error(
1272
+ "forwardRef requires a render function but was given %s.",
1273
+ null === render ? "null" : typeof render
1274
+ ) : 0 !== render.length && 2 !== render.length && console.error(
1275
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1276
+ 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1277
+ );
1278
+ null != render && null != render.defaultProps && console.error(
1279
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1280
+ );
1281
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1282
+ Object.defineProperty(elementType, "displayName", {
1283
+ enumerable: false,
1284
+ configurable: true,
1285
+ get: function() {
1286
+ return ownName;
1287
+ },
1288
+ set: function(name) {
1289
+ ownName = name;
1290
+ render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1291
+ }
1292
+ });
1293
+ return elementType;
1294
+ };
1295
+ exports.isValidElement = isValidElement;
1296
+ exports.lazy = function(ctor) {
1297
+ ctor = { _status: -1, _result: ctor };
1298
+ var lazyType = {
1299
+ $$typeof: REACT_LAZY_TYPE,
1300
+ _payload: ctor,
1301
+ _init: lazyInitializer
1302
+ }, ioInfo = {
1303
+ name: "lazy",
1304
+ start: -1,
1305
+ end: -1,
1306
+ value: null,
1307
+ owner: null,
1308
+ debugStack: Error("react-stack-top-frame"),
1309
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1310
+ };
1311
+ ctor._ioInfo = ioInfo;
1312
+ lazyType._debugInfo = [{ awaited: ioInfo }];
1313
+ return lazyType;
1314
+ };
1315
+ exports.memo = function(type, compare2) {
1316
+ null == type && console.error(
1317
+ "memo: The first argument must be a component. Instead received: %s",
1318
+ null === type ? "null" : typeof type
1319
+ );
1320
+ compare2 = {
1321
+ $$typeof: REACT_MEMO_TYPE,
1322
+ type,
1323
+ compare: void 0 === compare2 ? null : compare2
1324
+ };
1325
+ var ownName;
1326
+ Object.defineProperty(compare2, "displayName", {
1327
+ enumerable: false,
1328
+ configurable: true,
1329
+ get: function() {
1330
+ return ownName;
1331
+ },
1332
+ set: function(name) {
1333
+ ownName = name;
1334
+ type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1335
+ }
1336
+ });
1337
+ return compare2;
1338
+ };
1339
+ exports.startTransition = function(scope) {
1340
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
1341
+ currentTransition._updatedFibers = /* @__PURE__ */ new Set();
1342
+ ReactSharedInternals.T = currentTransition;
1343
+ try {
1344
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
1345
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
1346
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop3, reportGlobalError));
1347
+ } catch (error) {
1348
+ reportGlobalError(error);
1349
+ } finally {
1350
+ null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
1351
+ "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."
1352
+ )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
1353
+ "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."
1354
+ ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
1355
+ }
1356
+ };
1357
+ exports.unstable_useCacheRefresh = function() {
1358
+ return resolveDispatcher().useCacheRefresh();
1359
+ };
1360
+ exports.use = function(usable) {
1361
+ return resolveDispatcher().use(usable);
1362
+ };
1363
+ exports.useActionState = function(action, initialState, permalink) {
1364
+ return resolveDispatcher().useActionState(
1365
+ action,
1366
+ initialState,
1367
+ permalink
1368
+ );
1369
+ };
1370
+ exports.useCallback = function(callback, deps) {
1371
+ return resolveDispatcher().useCallback(callback, deps);
1372
+ };
1373
+ exports.useContext = function(Context) {
1374
+ var dispatcher = resolveDispatcher();
1375
+ Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1376
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1377
+ );
1378
+ return dispatcher.useContext(Context);
1379
+ };
1380
+ exports.useDebugValue = function(value, formatterFn) {
1381
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1382
+ };
1383
+ exports.useDeferredValue = function(value, initialValue) {
1384
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1385
+ };
1386
+ exports.useEffect = function(create, deps) {
1387
+ null == create && console.warn(
1388
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1389
+ );
1390
+ return resolveDispatcher().useEffect(create, deps);
1391
+ };
1392
+ exports.useEffectEvent = function(callback) {
1393
+ return resolveDispatcher().useEffectEvent(callback);
1394
+ };
1395
+ exports.useId = function() {
1396
+ return resolveDispatcher().useId();
1397
+ };
1398
+ exports.useImperativeHandle = function(ref, create, deps) {
1399
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1400
+ };
1401
+ exports.useInsertionEffect = function(create, deps) {
1402
+ null == create && console.warn(
1403
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1404
+ );
1405
+ return resolveDispatcher().useInsertionEffect(create, deps);
1406
+ };
1407
+ exports.useLayoutEffect = function(create, deps) {
1408
+ null == create && console.warn(
1409
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1410
+ );
1411
+ return resolveDispatcher().useLayoutEffect(create, deps);
1412
+ };
1413
+ exports.useMemo = function(create, deps) {
1414
+ return resolveDispatcher().useMemo(create, deps);
1415
+ };
1416
+ exports.useOptimistic = function(passthrough, reducer) {
1417
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1418
+ };
1419
+ exports.useReducer = function(reducer, initialArg, init) {
1420
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1421
+ };
1422
+ exports.useRef = function(initialValue) {
1423
+ return resolveDispatcher().useRef(initialValue);
1424
+ };
1425
+ exports.useState = function(initialState) {
1426
+ return resolveDispatcher().useState(initialState);
1427
+ };
1428
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1429
+ return resolveDispatcher().useSyncExternalStore(
1430
+ subscribe,
1431
+ getSnapshot,
1432
+ getServerSnapshot
1433
+ );
1434
+ };
1435
+ exports.useTransition = function() {
1436
+ return resolveDispatcher().useTransition();
1437
+ };
1438
+ exports.version = "19.2.7";
1439
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1440
+ })();
1441
+ }
1442
+ });
1443
+
1444
+ // node_modules/react/index.js
1445
+ var require_react = __commonJS({
1446
+ "node_modules/react/index.js"(exports, module) {
1447
+ "use strict";
1448
+ if (process.env.NODE_ENV === "production") {
1449
+ module.exports = require_react_production();
1450
+ } else {
1451
+ module.exports = require_react_development();
1452
+ }
1453
+ }
1454
+ });
1455
+
1456
+ // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
1457
+ var require_use_sync_external_store_shim_production = __commonJS({
1458
+ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
1459
+ "use strict";
1460
+ var React4 = require_react();
1461
+ function is(x, y) {
1462
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
1463
+ }
1464
+ var objectIs = "function" === typeof Object.is ? Object.is : is;
1465
+ var useState = React4.useState;
1466
+ var useEffect2 = React4.useEffect;
1467
+ var useLayoutEffect2 = React4.useLayoutEffect;
1468
+ var useDebugValue2 = React4.useDebugValue;
1469
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
1470
+ var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
1471
+ useLayoutEffect2(
1472
+ function() {
1473
+ inst.value = value;
1474
+ inst.getSnapshot = getSnapshot;
1475
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
1476
+ },
1477
+ [subscribe, value, getSnapshot]
1478
+ );
1479
+ useEffect2(
1480
+ function() {
1481
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
1482
+ return subscribe(function() {
1483
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
1484
+ });
1485
+ },
1486
+ [subscribe]
1487
+ );
1488
+ useDebugValue2(value);
1489
+ return value;
1490
+ }
1491
+ function checkIfSnapshotChanged(inst) {
1492
+ var latestGetSnapshot = inst.getSnapshot;
1493
+ inst = inst.value;
1494
+ try {
1495
+ var nextValue = latestGetSnapshot();
1496
+ return !objectIs(inst, nextValue);
1497
+ } catch (error) {
1498
+ return true;
1499
+ }
1500
+ }
1501
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
1502
+ return getSnapshot();
1503
+ }
1504
+ var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
1505
+ exports.useSyncExternalStore = void 0 !== React4.useSyncExternalStore ? React4.useSyncExternalStore : shim;
1506
+ }
1507
+ });
1508
+
1509
+ // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
1510
+ var require_use_sync_external_store_shim_development = __commonJS({
1511
+ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
1512
+ "use strict";
1513
+ "production" !== process.env.NODE_ENV && (function() {
1514
+ function is(x, y) {
1515
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
1516
+ }
1517
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
1518
+ didWarnOld18Alpha || void 0 === React4.startTransition || (didWarnOld18Alpha = true, console.error(
1519
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
1520
+ ));
1521
+ var value = getSnapshot();
1522
+ if (!didWarnUncachedGetSnapshot) {
1523
+ var cachedValue = getSnapshot();
1524
+ objectIs(value, cachedValue) || (console.error(
1525
+ "The result of getSnapshot should be cached to avoid an infinite loop"
1526
+ ), didWarnUncachedGetSnapshot = true);
1527
+ }
1528
+ cachedValue = useState({
1529
+ inst: { value, getSnapshot }
1530
+ });
1531
+ var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
1532
+ useLayoutEffect2(
1533
+ function() {
1534
+ inst.value = value;
1535
+ inst.getSnapshot = getSnapshot;
1536
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
1537
+ },
1538
+ [subscribe, value, getSnapshot]
1539
+ );
1540
+ useEffect2(
1541
+ function() {
1542
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
1543
+ return subscribe(function() {
1544
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
1545
+ });
1546
+ },
1547
+ [subscribe]
1548
+ );
1549
+ useDebugValue2(value);
1550
+ return value;
1551
+ }
1552
+ function checkIfSnapshotChanged(inst) {
1553
+ var latestGetSnapshot = inst.getSnapshot;
1554
+ inst = inst.value;
1555
+ try {
1556
+ var nextValue = latestGetSnapshot();
1557
+ return !objectIs(inst, nextValue);
1558
+ } catch (error) {
1559
+ return true;
1560
+ }
1561
+ }
1562
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
1563
+ return getSnapshot();
1564
+ }
1565
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1566
+ var React4 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState = React4.useState, useEffect2 = React4.useEffect, useLayoutEffect2 = React4.useLayoutEffect, useDebugValue2 = React4.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
1567
+ exports.useSyncExternalStore = void 0 !== React4.useSyncExternalStore ? React4.useSyncExternalStore : shim;
1568
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1569
+ })();
1570
+ }
1571
+ });
1572
+
1573
+ // node_modules/use-sync-external-store/shim/index.js
1574
+ var require_shim = __commonJS({
1575
+ "node_modules/use-sync-external-store/shim/index.js"(exports, module) {
1576
+ "use strict";
1577
+ if (process.env.NODE_ENV === "production") {
1578
+ module.exports = require_use_sync_external_store_shim_production();
1579
+ } else {
1580
+ module.exports = require_use_sync_external_store_shim_development();
1581
+ }
1582
+ }
1583
+ });
1584
+
1585
+ // node_modules/react/cjs/react-jsx-runtime.production.js
1586
+ var require_react_jsx_runtime_production = __commonJS({
1587
+ "node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
1588
+ "use strict";
1589
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
1590
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
1591
+ function jsxProd(type, config, maybeKey) {
1592
+ var key = null;
1593
+ void 0 !== maybeKey && (key = "" + maybeKey);
1594
+ void 0 !== config.key && (key = "" + config.key);
1595
+ if ("key" in config) {
1596
+ maybeKey = {};
1597
+ for (var propName in config)
1598
+ "key" !== propName && (maybeKey[propName] = config[propName]);
1599
+ } else maybeKey = config;
1600
+ config = maybeKey.ref;
1601
+ return {
1602
+ $$typeof: REACT_ELEMENT_TYPE,
1603
+ type,
1604
+ key,
1605
+ ref: void 0 !== config ? config : null,
1606
+ props: maybeKey
1607
+ };
1608
+ }
1609
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1610
+ exports.jsx = jsxProd;
1611
+ exports.jsxs = jsxProd;
1612
+ }
1613
+ });
1614
+
1615
+ // node_modules/react/cjs/react-jsx-runtime.development.js
1616
+ var require_react_jsx_runtime_development = __commonJS({
1617
+ "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
1618
+ "use strict";
1619
+ "production" !== process.env.NODE_ENV && (function() {
1620
+ function getComponentNameFromType(type) {
1621
+ if (null == type) return null;
1622
+ if ("function" === typeof type)
1623
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
1624
+ if ("string" === typeof type) return type;
1625
+ switch (type) {
1626
+ case REACT_FRAGMENT_TYPE:
1627
+ return "Fragment";
1628
+ case REACT_PROFILER_TYPE:
1629
+ return "Profiler";
1630
+ case REACT_STRICT_MODE_TYPE:
1631
+ return "StrictMode";
1632
+ case REACT_SUSPENSE_TYPE:
1633
+ return "Suspense";
1634
+ case REACT_SUSPENSE_LIST_TYPE:
1635
+ return "SuspenseList";
1636
+ case REACT_ACTIVITY_TYPE:
1637
+ return "Activity";
1638
+ }
1639
+ if ("object" === typeof type)
1640
+ switch ("number" === typeof type.tag && console.error(
1641
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
1642
+ ), type.$$typeof) {
1643
+ case REACT_PORTAL_TYPE:
1644
+ return "Portal";
1645
+ case REACT_CONTEXT_TYPE:
1646
+ return type.displayName || "Context";
1647
+ case REACT_CONSUMER_TYPE:
1648
+ return (type._context.displayName || "Context") + ".Consumer";
1649
+ case REACT_FORWARD_REF_TYPE:
1650
+ var innerType = type.render;
1651
+ type = type.displayName;
1652
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
1653
+ return type;
1654
+ case REACT_MEMO_TYPE:
1655
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
1656
+ case REACT_LAZY_TYPE:
1657
+ innerType = type._payload;
1658
+ type = type._init;
1659
+ try {
1660
+ return getComponentNameFromType(type(innerType));
1661
+ } catch (x) {
1662
+ }
1663
+ }
1664
+ return null;
1665
+ }
1666
+ function testStringCoercion(value) {
1667
+ return "" + value;
1668
+ }
1669
+ function checkKeyStringCoercion(value) {
1670
+ try {
1671
+ testStringCoercion(value);
1672
+ var JSCompiler_inline_result = false;
1673
+ } catch (e) {
1674
+ JSCompiler_inline_result = true;
1675
+ }
1676
+ if (JSCompiler_inline_result) {
1677
+ JSCompiler_inline_result = console;
1678
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
1679
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
1680
+ JSCompiler_temp_const.call(
1681
+ JSCompiler_inline_result,
1682
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
1683
+ JSCompiler_inline_result$jscomp$0
1684
+ );
1685
+ return testStringCoercion(value);
1686
+ }
1687
+ }
1688
+ function getTaskName(type) {
1689
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
1690
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
1691
+ return "<...>";
1692
+ try {
1693
+ var name = getComponentNameFromType(type);
1694
+ return name ? "<" + name + ">" : "<...>";
1695
+ } catch (x) {
1696
+ return "<...>";
1697
+ }
1698
+ }
1699
+ function getOwner() {
1700
+ var dispatcher = ReactSharedInternals.A;
1701
+ return null === dispatcher ? null : dispatcher.getOwner();
1702
+ }
1703
+ function UnknownOwner() {
1704
+ return Error("react-stack-top-frame");
1705
+ }
1706
+ function hasValidKey(config) {
1707
+ if (hasOwnProperty.call(config, "key")) {
1708
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
1709
+ if (getter && getter.isReactWarning) return false;
1710
+ }
1711
+ return void 0 !== config.key;
1712
+ }
1713
+ function defineKeyPropWarningGetter(props, displayName) {
1714
+ function warnAboutAccessingKey() {
1715
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
1716
+ "%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)",
1717
+ displayName
1718
+ ));
1719
+ }
1720
+ warnAboutAccessingKey.isReactWarning = true;
1721
+ Object.defineProperty(props, "key", {
1722
+ get: warnAboutAccessingKey,
1723
+ configurable: true
1724
+ });
1725
+ }
1726
+ function elementRefGetterWithDeprecationWarning() {
1727
+ var componentName = getComponentNameFromType(this.type);
1728
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
1729
+ "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."
1730
+ ));
1731
+ componentName = this.props.ref;
1732
+ return void 0 !== componentName ? componentName : null;
1733
+ }
1734
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
1735
+ var refProp = props.ref;
1736
+ type = {
1737
+ $$typeof: REACT_ELEMENT_TYPE,
1738
+ type,
1739
+ key,
1740
+ props,
1741
+ _owner: owner
1742
+ };
1743
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
1744
+ enumerable: false,
1745
+ get: elementRefGetterWithDeprecationWarning
1746
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
1747
+ type._store = {};
1748
+ Object.defineProperty(type._store, "validated", {
1749
+ configurable: false,
1750
+ enumerable: false,
1751
+ writable: true,
1752
+ value: 0
1753
+ });
1754
+ Object.defineProperty(type, "_debugInfo", {
1755
+ configurable: false,
1756
+ enumerable: false,
1757
+ writable: true,
1758
+ value: null
1759
+ });
1760
+ Object.defineProperty(type, "_debugStack", {
1761
+ configurable: false,
1762
+ enumerable: false,
1763
+ writable: true,
1764
+ value: debugStack
1765
+ });
1766
+ Object.defineProperty(type, "_debugTask", {
1767
+ configurable: false,
1768
+ enumerable: false,
1769
+ writable: true,
1770
+ value: debugTask
1771
+ });
1772
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
1773
+ return type;
1774
+ }
1775
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
1776
+ var children = config.children;
1777
+ if (void 0 !== children)
1778
+ if (isStaticChildren)
1779
+ if (isArrayImpl(children)) {
1780
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
1781
+ validateChildKeys(children[isStaticChildren]);
1782
+ Object.freeze && Object.freeze(children);
1783
+ } else
1784
+ console.error(
1785
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
1786
+ );
1787
+ else validateChildKeys(children);
1788
+ if (hasOwnProperty.call(config, "key")) {
1789
+ children = getComponentNameFromType(type);
1790
+ var keys = Object.keys(config).filter(function(k) {
1791
+ return "key" !== k;
1792
+ });
1793
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
1794
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
1795
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
1796
+ isStaticChildren,
1797
+ children,
1798
+ keys,
1799
+ children
1800
+ ), didWarnAboutKeySpread[children + isStaticChildren] = true);
1801
+ }
1802
+ children = null;
1803
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
1804
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
1805
+ if ("key" in config) {
1806
+ maybeKey = {};
1807
+ for (var propName in config)
1808
+ "key" !== propName && (maybeKey[propName] = config[propName]);
1809
+ } else maybeKey = config;
1810
+ children && defineKeyPropWarningGetter(
1811
+ maybeKey,
1812
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1813
+ );
1814
+ return ReactElement(
1815
+ type,
1816
+ children,
1817
+ maybeKey,
1818
+ getOwner(),
1819
+ debugStack,
1820
+ debugTask
1821
+ );
1822
+ }
1823
+ function validateChildKeys(node) {
1824
+ 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));
1825
+ }
1826
+ function isValidElement(object) {
1827
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
1828
+ }
1829
+ var React4 = require_react(), 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"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React4.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
1830
+ return null;
1831
+ };
1832
+ React4 = {
1833
+ react_stack_bottom_frame: function(callStackForError) {
1834
+ return callStackForError();
1835
+ }
1836
+ };
1837
+ var specialPropKeyWarningShown;
1838
+ var didWarnAboutElementRef = {};
1839
+ var unknownOwnerDebugStack = React4.react_stack_bottom_frame.bind(
1840
+ React4,
1841
+ UnknownOwner
1842
+ )();
1843
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1844
+ var didWarnAboutKeySpread = {};
1845
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1846
+ exports.jsx = function(type, config, maybeKey) {
1847
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1848
+ return jsxDEVImpl(
1849
+ type,
1850
+ config,
1851
+ maybeKey,
1852
+ false,
1853
+ trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1854
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1855
+ );
1856
+ };
1857
+ exports.jsxs = function(type, config, maybeKey) {
1858
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1859
+ return jsxDEVImpl(
1860
+ type,
1861
+ config,
1862
+ maybeKey,
1863
+ true,
1864
+ trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1865
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1866
+ );
1867
+ };
1868
+ })();
1869
+ }
1870
+ });
1871
+
1872
+ // node_modules/react/jsx-runtime.js
1873
+ var require_jsx_runtime = __commonJS({
1874
+ "node_modules/react/jsx-runtime.js"(exports, module) {
1875
+ "use strict";
1876
+ if (process.env.NODE_ENV === "production") {
1877
+ module.exports = require_react_jsx_runtime_production();
1878
+ } else {
1879
+ module.exports = require_react_jsx_runtime_development();
1880
+ }
1881
+ }
1882
+ });
1883
+
1884
+ // node_modules/swr/dist/index/index.mjs
1885
+ var import_react3 = __toESM(require_react(), 1);
1886
+ var import_shim = __toESM(require_shim(), 1);
1887
+
1888
+ // node_modules/swr/dist/_internal/config-context-12s-fLme8m6q.mjs
1889
+ var import_react = __toESM(require_react(), 1);
1890
+
1891
+ // node_modules/swr/dist/_internal/events.mjs
1892
+ var events_exports = {};
1893
+ __export(events_exports, {
1894
+ ERROR_REVALIDATE_EVENT: () => ERROR_REVALIDATE_EVENT,
1895
+ FOCUS_EVENT: () => FOCUS_EVENT,
1896
+ MUTATE_EVENT: () => MUTATE_EVENT,
1897
+ RECONNECT_EVENT: () => RECONNECT_EVENT
1898
+ });
1899
+ var FOCUS_EVENT = 0;
1900
+ var RECONNECT_EVENT = 1;
1901
+ var MUTATE_EVENT = 2;
1902
+ var ERROR_REVALIDATE_EVENT = 3;
1903
+
1904
+ // node_modules/dequal/lite/index.mjs
1905
+ var has = Object.prototype.hasOwnProperty;
1906
+ function dequal(foo, bar) {
1907
+ var ctor, len;
1908
+ if (foo === bar) return true;
1909
+ if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
1910
+ if (ctor === Date) return foo.getTime() === bar.getTime();
1911
+ if (ctor === RegExp) return foo.toString() === bar.toString();
1912
+ if (ctor === Array) {
1913
+ if ((len = foo.length) === bar.length) {
1914
+ while (len-- && dequal(foo[len], bar[len])) ;
1915
+ }
1916
+ return len === -1;
1917
+ }
1918
+ if (!ctor || typeof foo === "object") {
1919
+ len = 0;
1920
+ for (ctor in foo) {
1921
+ if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
1922
+ if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
1923
+ }
1924
+ return Object.keys(bar).length === len;
1925
+ }
1926
+ }
1927
+ return foo !== foo && bar !== bar;
1928
+ }
1929
+
1930
+ // node_modules/swr/dist/_internal/config-context-12s-fLme8m6q.mjs
1931
+ var SWRGlobalState = /* @__PURE__ */ new WeakMap();
1932
+ var noop = () => {
1933
+ };
1934
+ var UNDEFINED = (
1935
+ /*#__NOINLINE__*/
1936
+ noop()
1937
+ );
1938
+ var OBJECT = Object;
1939
+ var isUndefined = (v) => v === UNDEFINED;
1940
+ var isFunction = (v) => typeof v == "function";
1941
+ var mergeObjects = (a, b) => ({
1942
+ ...a,
1943
+ ...b
1944
+ });
1945
+ var isPromiseLike = (x) => isFunction(x.then);
1946
+ var EMPTY_CACHE = {};
1947
+ var INITIAL_CACHE = {};
1948
+ var STR_UNDEFINED = "undefined";
1949
+ var isWindowDefined = typeof window != STR_UNDEFINED;
1950
+ var isDocumentDefined = typeof document != STR_UNDEFINED;
1951
+ var isLegacyDeno = isWindowDefined && "Deno" in window;
1952
+ var hasRequestAnimationFrame = () => isWindowDefined && typeof window["requestAnimationFrame"] != STR_UNDEFINED;
1953
+ var createCacheHelper = (cache2, key) => {
1954
+ const state = SWRGlobalState.get(cache2);
1955
+ return [
1956
+ // Getter
1957
+ () => !isUndefined(key) && cache2.get(key) || EMPTY_CACHE,
1958
+ // Setter
1959
+ (info) => {
1960
+ if (!isUndefined(key)) {
1961
+ const prev = cache2.get(key);
1962
+ if (!(key in INITIAL_CACHE)) {
1963
+ INITIAL_CACHE[key] = prev;
1964
+ }
1965
+ state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);
1966
+ }
1967
+ },
1968
+ // Subscriber
1969
+ state[6],
1970
+ // Get server cache snapshot
1971
+ () => {
1972
+ if (!isUndefined(key)) {
1973
+ if (key in INITIAL_CACHE) return INITIAL_CACHE[key];
1974
+ }
1975
+ return !isUndefined(key) && cache2.get(key) || EMPTY_CACHE;
1976
+ }
1977
+ ];
1978
+ };
1979
+ var online = true;
1980
+ var isOnline = () => online;
1981
+ var [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [
1982
+ window.addEventListener.bind(window),
1983
+ window.removeEventListener.bind(window)
1984
+ ] : [
1985
+ noop,
1986
+ noop
1987
+ ];
1988
+ var isVisible = () => {
1989
+ const visibilityState = isDocumentDefined && document.visibilityState;
1990
+ return isUndefined(visibilityState) || visibilityState !== "hidden";
1991
+ };
1992
+ var initFocus = (callback) => {
1993
+ if (isDocumentDefined) {
1994
+ document.addEventListener("visibilitychange", callback);
1995
+ }
1996
+ onWindowEvent("focus", callback);
1997
+ return () => {
1998
+ if (isDocumentDefined) {
1999
+ document.removeEventListener("visibilitychange", callback);
2000
+ }
2001
+ offWindowEvent("focus", callback);
2002
+ };
2003
+ };
2004
+ var initReconnect = (callback) => {
2005
+ const onOnline = () => {
2006
+ online = true;
2007
+ callback();
2008
+ };
2009
+ const onOffline = () => {
2010
+ online = false;
2011
+ };
2012
+ onWindowEvent("online", onOnline);
2013
+ onWindowEvent("offline", onOffline);
2014
+ return () => {
2015
+ offWindowEvent("online", onOnline);
2016
+ offWindowEvent("offline", onOffline);
2017
+ };
2018
+ };
2019
+ var preset = {
2020
+ isOnline,
2021
+ isVisible
2022
+ };
2023
+ var defaultConfigOptions = {
2024
+ initFocus,
2025
+ initReconnect
2026
+ };
2027
+ var IS_REACT_LEGACY = !import_react.default.useId;
2028
+ var IS_SERVER = !isWindowDefined || isLegacyDeno;
2029
+ var rAF = (f) => hasRequestAnimationFrame() ? window["requestAnimationFrame"](f) : setTimeout(f, 1);
2030
+ var useIsomorphicLayoutEffect = IS_SERVER ? import_react.useEffect : import_react.useLayoutEffect;
2031
+ var navigatorConnection = typeof navigator !== "undefined" && navigator.connection;
2032
+ var slowConnection = !IS_SERVER && navigatorConnection && ([
2033
+ "slow-2g",
2034
+ "2g"
2035
+ ].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);
2036
+ var table = /* @__PURE__ */ new WeakMap();
2037
+ var getTypeName = (value) => OBJECT.prototype.toString.call(value);
2038
+ var isObjectTypeName = (typeName, type) => typeName === `[object ${type}]`;
2039
+ var counter = 0;
2040
+ var stableHash = (arg) => {
2041
+ const type = typeof arg;
2042
+ const typeName = getTypeName(arg);
2043
+ const isDate = isObjectTypeName(typeName, "Date");
2044
+ const isRegex = isObjectTypeName(typeName, "RegExp");
2045
+ const isPlainObject = isObjectTypeName(typeName, "Object");
2046
+ let result;
2047
+ let index;
2048
+ if (OBJECT(arg) === arg && !isDate && !isRegex) {
2049
+ result = table.get(arg);
2050
+ if (result) return result;
2051
+ result = ++counter + "~";
2052
+ table.set(arg, result);
2053
+ if (Array.isArray(arg)) {
2054
+ result = "@";
2055
+ for (index = 0; index < arg.length; index++) {
2056
+ result += stableHash(arg[index]) + ",";
2057
+ }
2058
+ table.set(arg, result);
2059
+ }
2060
+ if (isPlainObject) {
2061
+ result = "#";
2062
+ const keys = OBJECT.keys(arg).sort();
2063
+ while (!isUndefined(index = keys.pop())) {
2064
+ if (!isUndefined(arg[index])) {
2065
+ result += index + ":" + stableHash(arg[index]) + ",";
2066
+ }
2067
+ }
2068
+ table.set(arg, result);
2069
+ }
2070
+ } else {
2071
+ result = isDate ? arg.toJSON() : type == "symbol" ? arg.toString() : type == "string" ? JSON.stringify(arg) : "" + arg;
2072
+ }
2073
+ return result;
2074
+ };
2075
+ var serialize = (key) => {
2076
+ if (isFunction(key)) {
2077
+ try {
2078
+ key = key();
2079
+ } catch (err) {
2080
+ key = "";
2081
+ }
2082
+ }
2083
+ const args = key;
2084
+ key = typeof key == "string" ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : "";
2085
+ return [
2086
+ key,
2087
+ args
2088
+ ];
2089
+ };
2090
+ var __timestamp = 0;
2091
+ var getTimestamp = () => ++__timestamp;
2092
+ async function internalMutate(...args) {
2093
+ const [cache2, _key, _data, _opts] = args;
2094
+ const options = mergeObjects({
2095
+ populateCache: true,
2096
+ throwOnError: true
2097
+ }, typeof _opts === "boolean" ? {
2098
+ revalidate: _opts
2099
+ } : _opts || {});
2100
+ let populateCache = options.populateCache;
2101
+ const rollbackOnErrorOption = options.rollbackOnError;
2102
+ let optimisticData = options.optimisticData;
2103
+ const rollbackOnError = (error) => {
2104
+ return typeof rollbackOnErrorOption === "function" ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;
2105
+ };
2106
+ const throwOnError = options.throwOnError;
2107
+ if (isFunction(_key)) {
2108
+ const keyFilter = _key;
2109
+ const matchedKeys = [];
2110
+ const it = cache2.keys();
2111
+ for (const key of it) {
2112
+ if (
2113
+ // Skip the special useSWRInfinite and useSWRSubscription keys.
2114
+ !/^\$(inf|sub)\$/.test(key) && keyFilter(cache2.get(key)._k)
2115
+ ) {
2116
+ matchedKeys.push(key);
2117
+ }
2118
+ }
2119
+ return Promise.all(matchedKeys.map(mutateByKey));
2120
+ }
2121
+ return mutateByKey(_key);
2122
+ async function mutateByKey(_k) {
2123
+ const [key] = serialize(_k);
2124
+ if (!key) return;
2125
+ const [get, set] = createCacheHelper(cache2, key);
2126
+ const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache2);
2127
+ const startRevalidate = () => {
2128
+ const revalidators = EVENT_REVALIDATORS[key];
2129
+ const revalidate = isFunction(options.revalidate) ? options.revalidate(get().data, _k) : options.revalidate !== false;
2130
+ if (revalidate) {
2131
+ delete FETCH[key];
2132
+ delete PRELOAD[key];
2133
+ if (revalidators && revalidators[0]) {
2134
+ return revalidators[0](MUTATE_EVENT).then(() => get().data);
2135
+ }
2136
+ }
2137
+ return get().data;
2138
+ };
2139
+ if (args.length < 3) {
2140
+ return startRevalidate();
2141
+ }
2142
+ let data = _data;
2143
+ let error;
2144
+ let isError = false;
2145
+ const beforeMutationTs = getTimestamp();
2146
+ MUTATION[key] = [
2147
+ beforeMutationTs,
2148
+ 0
2149
+ ];
2150
+ const hasOptimisticData = !isUndefined(optimisticData);
2151
+ const state = get();
2152
+ const displayedData = state.data;
2153
+ const currentData = state._c;
2154
+ const committedData = isUndefined(currentData) ? displayedData : currentData;
2155
+ if (hasOptimisticData) {
2156
+ optimisticData = isFunction(optimisticData) ? optimisticData(committedData, displayedData) : optimisticData;
2157
+ set({
2158
+ data: optimisticData,
2159
+ _c: committedData
2160
+ });
2161
+ }
2162
+ if (isFunction(data)) {
2163
+ try {
2164
+ data = data(committedData);
2165
+ } catch (err) {
2166
+ error = err;
2167
+ isError = true;
2168
+ }
2169
+ }
2170
+ if (data && isPromiseLike(data)) {
2171
+ data = await data.catch((err) => {
2172
+ error = err;
2173
+ isError = true;
2174
+ });
2175
+ if (beforeMutationTs !== MUTATION[key][0]) {
2176
+ if (isError) throw error;
2177
+ return data;
2178
+ } else if (isError && hasOptimisticData && rollbackOnError(error)) {
2179
+ populateCache = true;
2180
+ set({
2181
+ data: committedData,
2182
+ _c: UNDEFINED
2183
+ });
2184
+ }
2185
+ }
2186
+ if (populateCache) {
2187
+ if (!isError) {
2188
+ if (isFunction(populateCache)) {
2189
+ const populateCachedData = populateCache(data, committedData);
2190
+ set({
2191
+ data: populateCachedData,
2192
+ error: UNDEFINED,
2193
+ _c: UNDEFINED
2194
+ });
2195
+ } else {
2196
+ set({
2197
+ data,
2198
+ error: UNDEFINED,
2199
+ _c: UNDEFINED
2200
+ });
2201
+ }
2202
+ }
2203
+ }
2204
+ MUTATION[key][1] = getTimestamp();
2205
+ Promise.resolve(startRevalidate()).then(() => {
2206
+ set({
2207
+ _c: UNDEFINED
2208
+ });
2209
+ });
2210
+ if (isError) {
2211
+ if (throwOnError) throw error;
2212
+ return;
2213
+ }
2214
+ return data;
2215
+ }
2216
+ }
2217
+ var revalidateAllKeys = (revalidators, type) => {
2218
+ for (const key in revalidators) {
2219
+ if (revalidators[key][0]) revalidators[key][0](type);
2220
+ }
2221
+ };
2222
+ var initCache = (provider, options) => {
2223
+ if (!SWRGlobalState.has(provider)) {
2224
+ const opts = mergeObjects(defaultConfigOptions, options);
2225
+ const EVENT_REVALIDATORS = /* @__PURE__ */ Object.create(null);
2226
+ const mutate2 = internalMutate.bind(UNDEFINED, provider);
2227
+ let unmount = noop;
2228
+ const subscriptions = /* @__PURE__ */ Object.create(null);
2229
+ const subscribe = (key, callback) => {
2230
+ const subs = subscriptions[key] || [];
2231
+ subscriptions[key] = subs;
2232
+ subs.push(callback);
2233
+ return () => {
2234
+ const index = subs.indexOf(callback);
2235
+ if (index >= 0) {
2236
+ subs[index] = subs[subs.length - 1];
2237
+ subs.pop();
2238
+ }
2239
+ };
2240
+ };
2241
+ const setter = (key, value, prev) => {
2242
+ provider.set(key, value);
2243
+ const subs = subscriptions[key];
2244
+ if (subs) {
2245
+ for (const fn of subs) {
2246
+ fn(value, prev);
2247
+ }
2248
+ }
2249
+ };
2250
+ const initProvider = () => {
2251
+ if (!SWRGlobalState.has(provider)) {
2252
+ SWRGlobalState.set(provider, [
2253
+ EVENT_REVALIDATORS,
2254
+ /* @__PURE__ */ Object.create(null),
2255
+ /* @__PURE__ */ Object.create(null),
2256
+ /* @__PURE__ */ Object.create(null),
2257
+ mutate2,
2258
+ setter,
2259
+ subscribe
2260
+ ]);
2261
+ if (!IS_SERVER) {
2262
+ const releaseFocus = opts.initFocus(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT)));
2263
+ const releaseReconnect = opts.initReconnect(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT)));
2264
+ unmount = () => {
2265
+ releaseFocus && releaseFocus();
2266
+ releaseReconnect && releaseReconnect();
2267
+ SWRGlobalState.delete(provider);
2268
+ };
2269
+ }
2270
+ }
2271
+ };
2272
+ initProvider();
2273
+ return [
2274
+ provider,
2275
+ mutate2,
2276
+ initProvider,
2277
+ unmount
2278
+ ];
2279
+ }
2280
+ return [
2281
+ provider,
2282
+ SWRGlobalState.get(provider)[4]
2283
+ ];
2284
+ };
2285
+ var onErrorRetry = (_, __, config, revalidate, opts) => {
2286
+ const maxRetryCount = config.errorRetryCount;
2287
+ const currentRetryCount = opts.retryCount;
2288
+ const timeout = ~~((Math.random() + 0.5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
2289
+ if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) {
2290
+ return;
2291
+ }
2292
+ setTimeout(revalidate, timeout, opts);
2293
+ };
2294
+ var compare = dequal;
2295
+ var [cache, mutate] = initCache(/* @__PURE__ */ new Map());
2296
+ var defaultConfig = mergeObjects(
2297
+ {
2298
+ // events
2299
+ onLoadingSlow: noop,
2300
+ onSuccess: noop,
2301
+ onError: noop,
2302
+ onErrorRetry,
2303
+ onDiscarded: noop,
2304
+ // switches
2305
+ revalidateOnFocus: true,
2306
+ revalidateOnReconnect: true,
2307
+ revalidateIfStale: true,
2308
+ shouldRetryOnError: true,
2309
+ // timeouts
2310
+ errorRetryInterval: slowConnection ? 1e4 : 5e3,
2311
+ focusThrottleInterval: 5 * 1e3,
2312
+ dedupingInterval: 2 * 1e3,
2313
+ loadingTimeout: slowConnection ? 5e3 : 3e3,
2314
+ // providers
2315
+ compare,
2316
+ isPaused: () => false,
2317
+ cache,
2318
+ mutate,
2319
+ fallback: {}
2320
+ },
2321
+ // use web preset by default
2322
+ preset
2323
+ );
2324
+ var mergeConfigs = (a, b) => {
2325
+ const v = mergeObjects(a, b);
2326
+ if (b) {
2327
+ const { use: u1, fallback: f1 } = a;
2328
+ const { use: u2, fallback: f2 } = b;
2329
+ if (u1 && u2) {
2330
+ v.use = u1.concat(u2);
2331
+ }
2332
+ if (f1 && f2) {
2333
+ v.fallback = mergeObjects(f1, f2);
2334
+ }
2335
+ }
2336
+ return v;
2337
+ };
2338
+ var SWRConfigContext = (0, import_react.createContext)({});
2339
+ var SWRConfig = (props) => {
2340
+ const { value } = props;
2341
+ const parentConfig = (0, import_react.useContext)(SWRConfigContext);
2342
+ const isFunctionalConfig = isFunction(value);
2343
+ const config = (0, import_react.useMemo)(() => isFunctionalConfig ? value(parentConfig) : value, [
2344
+ isFunctionalConfig,
2345
+ parentConfig,
2346
+ value
2347
+ ]);
2348
+ const extendedConfig = (0, import_react.useMemo)(() => isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [
2349
+ isFunctionalConfig,
2350
+ parentConfig,
2351
+ config
2352
+ ]);
2353
+ const provider = config && config.provider;
2354
+ const cacheContextRef = (0, import_react.useRef)(UNDEFINED);
2355
+ if (provider && !cacheContextRef.current) {
2356
+ cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);
2357
+ }
2358
+ const cacheContext = cacheContextRef.current;
2359
+ if (cacheContext) {
2360
+ extendedConfig.cache = cacheContext[0];
2361
+ extendedConfig.mutate = cacheContext[1];
2362
+ }
2363
+ useIsomorphicLayoutEffect(() => {
2364
+ if (cacheContext) {
2365
+ cacheContext[2] && cacheContext[2]();
2366
+ return cacheContext[3];
2367
+ }
2368
+ }, []);
2369
+ return (0, import_react.createElement)(SWRConfigContext.Provider, mergeObjects(props, {
2370
+ value: extendedConfig
2371
+ }));
2372
+ };
2373
+
2374
+ // node_modules/swr/dist/_internal/constants.mjs
2375
+ var INFINITE_PREFIX = "$inf$";
2376
+
2377
+ // node_modules/swr/dist/_internal/index.mjs
2378
+ var import_react2 = __toESM(require_react(), 1);
2379
+ var enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
2380
+ var use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
2381
+ var setupDevTools = () => {
2382
+ if (enableDevtools) {
2383
+ window.__SWR_DEVTOOLS_REACT__ = import_react2.default;
2384
+ }
2385
+ };
2386
+ var normalize = (args) => {
2387
+ return isFunction(args[1]) ? [
2388
+ args[0],
2389
+ args[1],
2390
+ args[2] || {}
2391
+ ] : [
2392
+ args[0],
2393
+ null,
2394
+ (args[1] === null ? args[2] : args[1]) || {}
2395
+ ];
2396
+ };
2397
+ var useSWRConfig = () => {
2398
+ const parentConfig = (0, import_react2.useContext)(SWRConfigContext);
2399
+ const mergedConfig = (0, import_react2.useMemo)(() => mergeObjects(defaultConfig, parentConfig), [
2400
+ parentConfig
2401
+ ]);
2402
+ return mergedConfig;
2403
+ };
2404
+ var middleware = (useSWRNext) => (key_, fetcher_, config) => {
2405
+ const fetcher = fetcher_ && ((...args) => {
2406
+ const [key] = serialize(key_);
2407
+ const [, , , PRELOAD] = SWRGlobalState.get(cache);
2408
+ if (key.startsWith(INFINITE_PREFIX)) {
2409
+ return fetcher_(...args);
2410
+ }
2411
+ const req = PRELOAD[key];
2412
+ if (isUndefined(req)) return fetcher_(...args);
2413
+ delete PRELOAD[key];
2414
+ return req;
2415
+ });
2416
+ return useSWRNext(key_, fetcher, config);
2417
+ };
2418
+ var BUILT_IN_MIDDLEWARE = use.concat(middleware);
2419
+ var withArgs = (hook) => {
2420
+ return function useSWRArgs(...args) {
2421
+ const fallbackConfig = useSWRConfig();
2422
+ const [key, fn, _config] = normalize(args);
2423
+ const config = mergeConfigs(fallbackConfig, _config);
2424
+ let next = hook;
2425
+ const { use: use3 } = config;
2426
+ const middleware2 = (use3 || []).concat(BUILT_IN_MIDDLEWARE);
2427
+ for (let i = middleware2.length; i--; ) {
2428
+ next = middleware2[i](next);
2429
+ }
2430
+ return next(key, fn || config.fetcher || null, config);
2431
+ };
2432
+ };
2433
+ var subscribeCallback = (key, callbacks, callback) => {
2434
+ const keyedRevalidators = callbacks[key] || (callbacks[key] = []);
2435
+ keyedRevalidators.push(callback);
2436
+ return () => {
2437
+ const index = keyedRevalidators.indexOf(callback);
2438
+ if (index >= 0) {
2439
+ keyedRevalidators[index] = keyedRevalidators[keyedRevalidators.length - 1];
2440
+ keyedRevalidators.pop();
2441
+ }
2442
+ };
2443
+ };
2444
+ setupDevTools();
2445
+
2446
+ // node_modules/swr/dist/index/index.mjs
2447
+ var noop2 = () => {
2448
+ };
2449
+ var UNDEFINED2 = (
2450
+ /*#__NOINLINE__*/
2451
+ noop2()
2452
+ );
2453
+ var use2 = import_react3.default.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
2454
+ // and emitting an error.
2455
+ // We assume that this is only for the `use(thenable)` case, not `use(context)`.
2456
+ // https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
2457
+ ((thenable) => {
2458
+ switch (thenable.status) {
2459
+ case "pending":
2460
+ throw thenable;
2461
+ case "fulfilled":
2462
+ return thenable.value;
2463
+ case "rejected":
2464
+ throw thenable.reason;
2465
+ default:
2466
+ thenable.status = "pending";
2467
+ thenable.then((v) => {
2468
+ thenable.status = "fulfilled";
2469
+ thenable.value = v;
2470
+ }, (e) => {
2471
+ thenable.status = "rejected";
2472
+ thenable.reason = e;
2473
+ });
2474
+ throw thenable;
2475
+ }
2476
+ });
2477
+ var WITH_DEDUPE = {
2478
+ dedupe: true
2479
+ };
2480
+ var resolvedUndef = Promise.resolve(UNDEFINED);
2481
+ resolvedUndef.status = "fulfilled";
2482
+ resolvedUndef.value = UNDEFINED;
2483
+ var sub = () => noop;
2484
+ var useSWRHandler = (_key, fetcher, config) => {
2485
+ const { cache: cache2, compare: compare2, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData, strictServerPrefetchWarning } = config;
2486
+ const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache2);
2487
+ const [key, fnArg] = serialize(_key);
2488
+ const initialMountedRef = (0, import_react3.useRef)(false);
2489
+ const unmountedRef = (0, import_react3.useRef)(false);
2490
+ const keyRef = (0, import_react3.useRef)(key);
2491
+ const fetcherRef = (0, import_react3.useRef)(fetcher);
2492
+ const configRef = (0, import_react3.useRef)(config);
2493
+ const getConfig = () => configRef.current;
2494
+ const isActive = () => getConfig().isVisible() && getConfig().isOnline();
2495
+ const [getCache, setCache, subscribeCache, getInitialCache] = createCacheHelper(cache2, key);
2496
+ const stateDependencies = (0, import_react3.useRef)({}).current;
2497
+ const fallback = isUndefined(fallbackData) ? isUndefined(config.fallback) ? UNDEFINED : config.fallback[key] : fallbackData;
2498
+ const isEqual = (prev, current) => {
2499
+ for (const _ in stateDependencies) {
2500
+ const t = _;
2501
+ if (t === "data") {
2502
+ if (!compare2(prev[t], current[t])) {
2503
+ if (!isUndefined(prev[t])) {
2504
+ return false;
2505
+ }
2506
+ if (!compare2(returnedData, current[t])) {
2507
+ return false;
2508
+ }
2509
+ }
2510
+ } else {
2511
+ if (current[t] !== prev[t]) {
2512
+ return false;
2513
+ }
2514
+ }
2515
+ }
2516
+ return true;
2517
+ };
2518
+ const isInitialMount = !initialMountedRef.current;
2519
+ const getSnapshot = (0, import_react3.useMemo)(() => {
2520
+ const cachedData2 = getCache();
2521
+ const initialData = getInitialCache();
2522
+ const getSelectedCache = (state) => {
2523
+ const snapshot = mergeObjects(state);
2524
+ delete snapshot._k;
2525
+ const shouldStartRequest = (() => {
2526
+ if (!key) return false;
2527
+ if (!fetcher) return false;
2528
+ if (getConfig().isPaused()) return false;
2529
+ if (isInitialMount && !isUndefined(revalidateOnMount)) return revalidateOnMount;
2530
+ const data2 = !isUndefined(fallback) ? fallback : snapshot.data;
2531
+ if (suspense) return isUndefined(data2) || revalidateIfStale;
2532
+ return isUndefined(data2) || revalidateIfStale;
2533
+ })();
2534
+ if (!shouldStartRequest) {
2535
+ return snapshot;
2536
+ }
2537
+ return {
2538
+ isValidating: true,
2539
+ isLoading: true,
2540
+ ...snapshot
2541
+ };
2542
+ };
2543
+ const clientSnapshot = getSelectedCache(cachedData2);
2544
+ const serverSnapshot = cachedData2 === initialData ? clientSnapshot : getSelectedCache(initialData);
2545
+ let memorizedSnapshot = clientSnapshot;
2546
+ return [
2547
+ () => {
2548
+ const newSnapshot = getSelectedCache(getCache());
2549
+ const compareResult = isEqual(newSnapshot, memorizedSnapshot);
2550
+ if (compareResult) {
2551
+ memorizedSnapshot.data = newSnapshot.data;
2552
+ memorizedSnapshot.isLoading = newSnapshot.isLoading;
2553
+ memorizedSnapshot.isValidating = newSnapshot.isValidating;
2554
+ memorizedSnapshot.error = newSnapshot.error;
2555
+ return memorizedSnapshot;
2556
+ } else {
2557
+ memorizedSnapshot = newSnapshot;
2558
+ return newSnapshot;
2559
+ }
2560
+ },
2561
+ () => serverSnapshot
2562
+ ];
2563
+ }, [
2564
+ cache2,
2565
+ key
2566
+ ]);
2567
+ const cached = (0, import_shim.useSyncExternalStore)((0, import_react3.useCallback)(
2568
+ (callback) => subscribeCache(key, (current, prev) => {
2569
+ if (!isEqual(prev, current)) callback();
2570
+ }),
2571
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2572
+ [
2573
+ cache2,
2574
+ key
2575
+ ]
2576
+ ), getSnapshot[0], getSnapshot[1]);
2577
+ const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;
2578
+ const cachedData = cached.data;
2579
+ const data = isUndefined(cachedData) ? fallback && isPromiseLike(fallback) ? use2(fallback) : fallback : cachedData;
2580
+ const error = cached.error;
2581
+ const laggyDataRef = (0, import_react3.useRef)(data);
2582
+ const returnedData = keepPreviousData ? isUndefined(cachedData) ? isUndefined(laggyDataRef.current) ? data : laggyDataRef.current : cachedData : data;
2583
+ const hasKeyButNoData = key && isUndefined(data);
2584
+ const hydrationRef = (0, import_react3.useRef)(null);
2585
+ !IS_SERVER && // getServerSnapshot is only called during hydration
2586
+ // eslint-disable-next-line react-hooks/rules-of-hooks
2587
+ (0, import_shim.useSyncExternalStore)(sub, () => {
2588
+ hydrationRef.current = false;
2589
+ return hydrationRef;
2590
+ }, () => {
2591
+ hydrationRef.current = true;
2592
+ return hydrationRef;
2593
+ });
2594
+ const isHydration = hydrationRef.current;
2595
+ if (strictServerPrefetchWarning && isHydration && !suspense && hasKeyButNoData) {
2596
+ console.warn(`Missing pre-initiated data for serialized key "${key}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
2597
+ }
2598
+ const shouldDoInitialRevalidation = (() => {
2599
+ if (!key || !fetcher) return false;
2600
+ if (getConfig().isPaused()) return false;
2601
+ if (hasRevalidator && !isUndefined(error)) return false;
2602
+ if (isInitialMount && !isUndefined(revalidateOnMount)) return revalidateOnMount;
2603
+ if (suspense) return isUndefined(data) ? false : revalidateIfStale;
2604
+ return isUndefined(data) || revalidateIfStale;
2605
+ })();
2606
+ const defaultValidatingState = isInitialMount && shouldDoInitialRevalidation;
2607
+ const isValidating = isUndefined(cached.isValidating) ? defaultValidatingState : cached.isValidating;
2608
+ const isLoading = isUndefined(cached.isLoading) ? defaultValidatingState : cached.isLoading;
2609
+ const revalidate = (0, import_react3.useCallback)(
2610
+ async (revalidateOpts) => {
2611
+ const currentFetcher = fetcherRef.current;
2612
+ if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) {
2613
+ return false;
2614
+ }
2615
+ let newData;
2616
+ let startAt;
2617
+ let loading = true;
2618
+ const opts = revalidateOpts || {};
2619
+ const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;
2620
+ const callbackSafeguard = () => {
2621
+ if (IS_REACT_LEGACY) {
2622
+ return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;
2623
+ }
2624
+ return key === keyRef.current;
2625
+ };
2626
+ const finalState = {
2627
+ isValidating: false,
2628
+ isLoading: false
2629
+ };
2630
+ const finishRequestAndUpdateState = () => {
2631
+ setCache(finalState);
2632
+ };
2633
+ const cleanupState = () => {
2634
+ const requestInfo = FETCH[key];
2635
+ if (requestInfo && requestInfo[1] === startAt) {
2636
+ delete FETCH[key];
2637
+ }
2638
+ };
2639
+ const initialState = {
2640
+ isValidating: true
2641
+ };
2642
+ if (isUndefined(getCache().data)) {
2643
+ initialState.isLoading = true;
2644
+ }
2645
+ try {
2646
+ if (shouldStartNewRequest) {
2647
+ setCache(initialState);
2648
+ if (config.loadingTimeout && isUndefined(getCache().data)) {
2649
+ setTimeout(() => {
2650
+ if (loading && callbackSafeguard()) {
2651
+ getConfig().onLoadingSlow(key, config);
2652
+ }
2653
+ }, config.loadingTimeout);
2654
+ }
2655
+ FETCH[key] = [
2656
+ currentFetcher(fnArg),
2657
+ getTimestamp()
2658
+ ];
2659
+ }
2660
+ ;
2661
+ [newData, startAt] = FETCH[key];
2662
+ newData = await newData;
2663
+ if (shouldStartNewRequest) {
2664
+ setTimeout(cleanupState, config.dedupingInterval);
2665
+ }
2666
+ if (!FETCH[key] || FETCH[key][1] !== startAt) {
2667
+ if (shouldStartNewRequest) {
2668
+ if (callbackSafeguard()) {
2669
+ getConfig().onDiscarded(key);
2670
+ }
2671
+ }
2672
+ return false;
2673
+ }
2674
+ finalState.error = UNDEFINED;
2675
+ const mutationInfo = MUTATION[key];
2676
+ if (!isUndefined(mutationInfo) && // case 1
2677
+ (startAt <= mutationInfo[0] || // case 2
2678
+ startAt <= mutationInfo[1] || // case 3
2679
+ mutationInfo[1] === 0)) {
2680
+ finishRequestAndUpdateState();
2681
+ if (shouldStartNewRequest) {
2682
+ if (callbackSafeguard()) {
2683
+ getConfig().onDiscarded(key);
2684
+ }
2685
+ }
2686
+ return false;
2687
+ }
2688
+ const cacheData = getCache().data;
2689
+ finalState.data = compare2(cacheData, newData) ? cacheData : newData;
2690
+ if (shouldStartNewRequest) {
2691
+ if (callbackSafeguard()) {
2692
+ getConfig().onSuccess(newData, key, config);
2693
+ }
2694
+ }
2695
+ } catch (err) {
2696
+ cleanupState();
2697
+ const currentConfig = getConfig();
2698
+ const { shouldRetryOnError } = currentConfig;
2699
+ if (!currentConfig.isPaused()) {
2700
+ finalState.error = err;
2701
+ if (shouldStartNewRequest && callbackSafeguard()) {
2702
+ currentConfig.onError(err, key, currentConfig);
2703
+ if (shouldRetryOnError === true || isFunction(shouldRetryOnError) && shouldRetryOnError(err)) {
2704
+ if (!getConfig().revalidateOnFocus || !getConfig().revalidateOnReconnect || isActive()) {
2705
+ currentConfig.onErrorRetry(err, key, currentConfig, (_opts) => {
2706
+ const revalidators = EVENT_REVALIDATORS[key];
2707
+ if (revalidators && revalidators[0]) {
2708
+ revalidators[0](events_exports.ERROR_REVALIDATE_EVENT, _opts);
2709
+ }
2710
+ }, {
2711
+ retryCount: (opts.retryCount || 0) + 1,
2712
+ dedupe: true
2713
+ });
2714
+ }
2715
+ }
2716
+ }
2717
+ }
2718
+ }
2719
+ loading = false;
2720
+ finishRequestAndUpdateState();
2721
+ return true;
2722
+ },
2723
+ // `setState` is immutable, and `eventsCallback`, `fnArg`, and
2724
+ // `keyValidating` are depending on `key`, so we can exclude them from
2725
+ // the deps array.
2726
+ //
2727
+ // FIXME:
2728
+ // `fn` and `config` might be changed during the lifecycle,
2729
+ // but they might be changed every render like this.
2730
+ // `useSWR('key', () => fetch('/api/'), { suspense: true })`
2731
+ // So we omit the values from the deps array
2732
+ // even though it might cause unexpected behaviors.
2733
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2734
+ [
2735
+ key,
2736
+ cache2
2737
+ ]
2738
+ );
2739
+ const boundMutate = (0, import_react3.useCallback)(
2740
+ // Use callback to make sure `keyRef.current` returns latest result every time
2741
+ (...args) => {
2742
+ return internalMutate(cache2, keyRef.current, ...args);
2743
+ },
2744
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2745
+ []
2746
+ );
2747
+ useIsomorphicLayoutEffect(() => {
2748
+ fetcherRef.current = fetcher;
2749
+ configRef.current = config;
2750
+ if (!isUndefined(cachedData)) {
2751
+ laggyDataRef.current = cachedData;
2752
+ }
2753
+ });
2754
+ useIsomorphicLayoutEffect(() => {
2755
+ if (!key) return;
2756
+ const softRevalidate = revalidate.bind(UNDEFINED, WITH_DEDUPE);
2757
+ let nextFocusRevalidatedAt = 0;
2758
+ if (getConfig().revalidateOnFocus) {
2759
+ const initNow = Date.now();
2760
+ nextFocusRevalidatedAt = initNow + getConfig().focusThrottleInterval;
2761
+ }
2762
+ const onRevalidate = (type, opts = {}) => {
2763
+ if (type == events_exports.FOCUS_EVENT) {
2764
+ const now = Date.now();
2765
+ if (getConfig().revalidateOnFocus && now > nextFocusRevalidatedAt && isActive()) {
2766
+ nextFocusRevalidatedAt = now + getConfig().focusThrottleInterval;
2767
+ softRevalidate();
2768
+ }
2769
+ } else if (type == events_exports.RECONNECT_EVENT) {
2770
+ if (getConfig().revalidateOnReconnect && isActive()) {
2771
+ softRevalidate();
2772
+ }
2773
+ } else if (type == events_exports.MUTATE_EVENT) {
2774
+ return revalidate();
2775
+ } else if (type == events_exports.ERROR_REVALIDATE_EVENT) {
2776
+ return revalidate(opts);
2777
+ }
2778
+ return;
2779
+ };
2780
+ const unsubEvents = subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);
2781
+ unmountedRef.current = false;
2782
+ keyRef.current = key;
2783
+ initialMountedRef.current = true;
2784
+ setCache({
2785
+ _k: fnArg
2786
+ });
2787
+ if (shouldDoInitialRevalidation) {
2788
+ if (!FETCH[key]) {
2789
+ if (isUndefined(data) || IS_SERVER) {
2790
+ softRevalidate();
2791
+ } else {
2792
+ rAF(softRevalidate);
2793
+ }
2794
+ }
2795
+ }
2796
+ return () => {
2797
+ unmountedRef.current = true;
2798
+ unsubEvents();
2799
+ };
2800
+ }, [
2801
+ key
2802
+ ]);
2803
+ useIsomorphicLayoutEffect(() => {
2804
+ let timer;
2805
+ function next() {
2806
+ const interval = isFunction(refreshInterval) ? refreshInterval(getCache().data) : refreshInterval;
2807
+ if (interval && timer !== -1) {
2808
+ timer = setTimeout(execute, interval);
2809
+ }
2810
+ }
2811
+ function execute() {
2812
+ if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) {
2813
+ revalidate(WITH_DEDUPE).then(next);
2814
+ } else {
2815
+ next();
2816
+ }
2817
+ }
2818
+ next();
2819
+ return () => {
2820
+ if (timer) {
2821
+ clearTimeout(timer);
2822
+ timer = -1;
2823
+ }
2824
+ };
2825
+ }, [
2826
+ refreshInterval,
2827
+ refreshWhenHidden,
2828
+ refreshWhenOffline,
2829
+ key
2830
+ ]);
2831
+ (0, import_react3.useDebugValue)(returnedData);
2832
+ if (suspense) {
2833
+ if (!IS_REACT_LEGACY && IS_SERVER && hasKeyButNoData) {
2834
+ throw new Error("Fallback data is required when using Suspense in SSR.");
2835
+ }
2836
+ if (hasKeyButNoData) {
2837
+ fetcherRef.current = fetcher;
2838
+ configRef.current = config;
2839
+ unmountedRef.current = false;
2840
+ }
2841
+ const req = PRELOAD[key];
2842
+ const mutateReq = !isUndefined(req) && hasKeyButNoData ? boundMutate(req) : resolvedUndef;
2843
+ use2(mutateReq);
2844
+ if (!isUndefined(error) && hasKeyButNoData) {
2845
+ throw error;
2846
+ }
2847
+ const revalidation = hasKeyButNoData ? revalidate(WITH_DEDUPE) : resolvedUndef;
2848
+ if (!isUndefined(returnedData) && hasKeyButNoData) {
2849
+ revalidation.status = "fulfilled";
2850
+ revalidation.value = true;
2851
+ }
2852
+ use2(revalidation);
2853
+ }
2854
+ const swrResponse = {
2855
+ mutate: boundMutate,
2856
+ get data() {
2857
+ stateDependencies.data = true;
2858
+ return returnedData;
2859
+ },
2860
+ get error() {
2861
+ stateDependencies.error = true;
2862
+ return error;
2863
+ },
2864
+ get isValidating() {
2865
+ stateDependencies.isValidating = true;
2866
+ return isValidating;
2867
+ },
2868
+ get isLoading() {
2869
+ stateDependencies.isLoading = true;
2870
+ return isLoading;
2871
+ }
2872
+ };
2873
+ return swrResponse;
2874
+ };
2875
+ var SWRConfig2 = OBJECT.defineProperty(SWRConfig, "defaultValue", {
2876
+ value: defaultConfig
2877
+ });
2878
+ var useSWR = withArgs(useSWRHandler);
2879
+
2880
+ // src/ApiProvider.tsx
2881
+ var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
2882
+ var ApiProvider = ({ children, baseURL = "", getAuthToken }) => {
2883
+ const defaultFetcher = async (endpoint) => {
2884
+ const url = `${baseURL}${endpoint}`;
2885
+ const token = getAuthToken ? getAuthToken() : null;
2886
+ const headers = { "Content-Type": "application/json" };
2887
+ if (token) headers["Authorization"] = `Bearer ${token}`;
2888
+ const response = await fetch(url, { headers });
2889
+ if (!response.ok) throw new Error("Failed to fetch resource");
2890
+ return response.json();
2891
+ };
2892
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SWRConfig2, { value: { fetcher: defaultFetcher }, children });
2893
+ };
2894
+
2895
+ // src/useResource.ts
2896
+ function useResource(endpoint) {
2897
+ const { mutate: globalMutate } = useSWRConfig();
2898
+ const { data, error, isLoading, isValidating, mutate: mutate2 } = useSWR(endpoint);
2899
+ const executeApi = async (method, payload, resourceId) => {
2900
+ const url = resourceId ? `${endpoint}/${resourceId}` : endpoint;
2901
+ const response = await fetch(url, {
2902
+ method,
2903
+ headers: { "Content-Type": "application/json" },
2904
+ body: payload ? JSON.stringify(payload) : void 0
2905
+ });
2906
+ globalMutate(endpoint);
2907
+ return response.json();
2908
+ };
2909
+ return {
2910
+ data,
2911
+ isLoading,
2912
+ isValidating,
2913
+ error,
2914
+ refresh: () => mutate2(),
2915
+ create: (payload) => executeApi("POST", payload),
2916
+ update: (id, payload) => executeApi("PUT", payload, id),
2917
+ remove: (id) => executeApi("DELETE", void 0, id)
2918
+ };
2919
+ }
2920
+ export {
2921
+ ApiProvider,
2922
+ useResource
2923
+ };
2924
+ /*! Bundled license information:
2925
+
2926
+ react/cjs/react.production.js:
2927
+ (**
2928
+ * @license React
2929
+ * react.production.js
2930
+ *
2931
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2932
+ *
2933
+ * This source code is licensed under the MIT license found in the
2934
+ * LICENSE file in the root directory of this source tree.
2935
+ *)
2936
+
2937
+ react/cjs/react.development.js:
2938
+ (**
2939
+ * @license React
2940
+ * react.development.js
2941
+ *
2942
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2943
+ *
2944
+ * This source code is licensed under the MIT license found in the
2945
+ * LICENSE file in the root directory of this source tree.
2946
+ *)
2947
+
2948
+ use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
2949
+ (**
2950
+ * @license React
2951
+ * use-sync-external-store-shim.production.js
2952
+ *
2953
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2954
+ *
2955
+ * This source code is licensed under the MIT license found in the
2956
+ * LICENSE file in the root directory of this source tree.
2957
+ *)
2958
+
2959
+ use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
2960
+ (**
2961
+ * @license React
2962
+ * use-sync-external-store-shim.development.js
2963
+ *
2964
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2965
+ *
2966
+ * This source code is licensed under the MIT license found in the
2967
+ * LICENSE file in the root directory of this source tree.
2968
+ *)
2969
+
2970
+ react/cjs/react-jsx-runtime.production.js:
2971
+ (**
2972
+ * @license React
2973
+ * react-jsx-runtime.production.js
2974
+ *
2975
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2976
+ *
2977
+ * This source code is licensed under the MIT license found in the
2978
+ * LICENSE file in the root directory of this source tree.
2979
+ *)
2980
+
2981
+ react/cjs/react-jsx-runtime.development.js:
2982
+ (**
2983
+ * @license React
2984
+ * react-jsx-runtime.development.js
2985
+ *
2986
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2987
+ *
2988
+ * This source code is licensed under the MIT license found in the
2989
+ * LICENSE file in the root directory of this source tree.
2990
+ *)
2991
+ */