@weaverse/core 5.22.1 → 5.24.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 CHANGED
@@ -1,1736 +1,1358 @@
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
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
-
32
- // ../../node_modules/react/cjs/react.production.js
33
- var require_react_production = __commonJS({
34
- "../../node_modules/react/cjs/react.production.js"(exports2) {
35
- "use strict";
36
- var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
37
- var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
38
- var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
39
- var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
40
- var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
41
- var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
42
- var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
43
- var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
44
- var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
45
- var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
46
- var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
47
- var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
48
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
49
- function getIteratorFn(maybeIterable) {
50
- if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
51
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
52
- return "function" === typeof maybeIterable ? maybeIterable : null;
53
- }
54
- var ReactNoopUpdateQueue = {
55
- isMounted: function() {
56
- return false;
57
- },
58
- enqueueForceUpdate: function() {
59
- },
60
- enqueueReplaceState: function() {
61
- },
62
- enqueueSetState: function() {
63
- }
64
- };
65
- var assign = Object.assign;
66
- var emptyObject = {};
67
- function Component(props, context, updater) {
68
- this.props = props;
69
- this.context = context;
70
- this.refs = emptyObject;
71
- this.updater = updater || ReactNoopUpdateQueue;
72
- }
73
- Component.prototype.isReactComponent = {};
74
- Component.prototype.setState = function(partialState, callback) {
75
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
76
- throw Error(
77
- "takes an object of state variables to update or a function which returns an object of state variables."
78
- );
79
- this.updater.enqueueSetState(this, partialState, callback, "setState");
80
- };
81
- Component.prototype.forceUpdate = function(callback) {
82
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
83
- };
84
- function ComponentDummy() {
85
- }
86
- ComponentDummy.prototype = Component.prototype;
87
- function PureComponent(props, context, updater) {
88
- this.props = props;
89
- this.context = context;
90
- this.refs = emptyObject;
91
- this.updater = updater || ReactNoopUpdateQueue;
92
- }
93
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
94
- pureComponentPrototype.constructor = PureComponent;
95
- assign(pureComponentPrototype, Component.prototype);
96
- pureComponentPrototype.isPureReactComponent = true;
97
- var isArrayImpl = Array.isArray;
98
- function noop() {
99
- }
100
- var ReactSharedInternals = { H: null, A: null, T: null, S: null };
101
- var hasOwnProperty = Object.prototype.hasOwnProperty;
102
- function ReactElement(type, key, props) {
103
- var refProp = props.ref;
104
- return {
105
- $$typeof: REACT_ELEMENT_TYPE,
106
- type,
107
- key,
108
- ref: void 0 !== refProp ? refProp : null,
109
- props
110
- };
111
- }
112
- function cloneAndReplaceKey(oldElement, newKey) {
113
- return ReactElement(oldElement.type, newKey, oldElement.props);
114
- }
115
- function isValidElement(object) {
116
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
117
- }
118
- function escape(key) {
119
- var escaperLookup = { "=": "=0", ":": "=2" };
120
- return "$" + key.replace(/[=:]/g, function(match) {
121
- return escaperLookup[match];
122
- });
123
- }
124
- var userProvidedKeyEscapeRegex = /\/+/g;
125
- function getElementKey(element, index) {
126
- return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
127
- }
128
- function resolveThenable(thenable) {
129
- switch (thenable.status) {
130
- case "fulfilled":
131
- return thenable.value;
132
- case "rejected":
133
- throw thenable.reason;
134
- default:
135
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
136
- function(fulfilledValue) {
137
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
138
- },
139
- function(error) {
140
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
141
- }
142
- )), thenable.status) {
143
- case "fulfilled":
144
- return thenable.value;
145
- case "rejected":
146
- throw thenable.reason;
147
- }
148
- }
149
- throw thenable;
150
- }
151
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
152
- var type = typeof children;
153
- if ("undefined" === type || "boolean" === type) children = null;
154
- var invokeCallback = false;
155
- if (null === children) invokeCallback = true;
156
- else
157
- switch (type) {
158
- case "bigint":
159
- case "string":
160
- case "number":
161
- invokeCallback = true;
162
- break;
163
- case "object":
164
- switch (children.$$typeof) {
165
- case REACT_ELEMENT_TYPE:
166
- case REACT_PORTAL_TYPE:
167
- invokeCallback = true;
168
- break;
169
- case REACT_LAZY_TYPE:
170
- return invokeCallback = children._init, mapIntoArray(
171
- invokeCallback(children._payload),
172
- array,
173
- escapedPrefix,
174
- nameSoFar,
175
- callback
176
- );
177
- }
178
- }
179
- if (invokeCallback)
180
- 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) {
181
- return c;
182
- })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
183
- callback,
184
- escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
185
- userProvidedKeyEscapeRegex,
186
- "$&/"
187
- ) + "/") + invokeCallback
188
- )), array.push(callback)), 1;
189
- invokeCallback = 0;
190
- var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
191
- if (isArrayImpl(children))
192
- for (var i = 0; i < children.length; i++)
193
- nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
194
- nameSoFar,
195
- array,
196
- escapedPrefix,
197
- type,
198
- callback
199
- );
200
- else if (i = getIteratorFn(children), "function" === typeof i)
201
- for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
202
- nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
203
- nameSoFar,
204
- array,
205
- escapedPrefix,
206
- type,
207
- callback
208
- );
209
- else if ("object" === type) {
210
- if ("function" === typeof children.then)
211
- return mapIntoArray(
212
- resolveThenable(children),
213
- array,
214
- escapedPrefix,
215
- nameSoFar,
216
- callback
217
- );
218
- array = String(children);
219
- throw Error(
220
- "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."
221
- );
222
- }
223
- return invokeCallback;
224
- }
225
- function mapChildren(children, func, context) {
226
- if (null == children) return children;
227
- var result = [], count = 0;
228
- mapIntoArray(children, result, "", "", function(child) {
229
- return func.call(context, child, count++);
230
- });
231
- return result;
232
- }
233
- function lazyInitializer(payload) {
234
- if (-1 === payload._status) {
235
- var ctor = payload._result;
236
- ctor = ctor();
237
- ctor.then(
238
- function(moduleObject) {
239
- if (0 === payload._status || -1 === payload._status)
240
- payload._status = 1, payload._result = moduleObject;
241
- },
242
- function(error) {
243
- if (0 === payload._status || -1 === payload._status)
244
- payload._status = 2, payload._result = error;
245
- }
246
- );
247
- -1 === payload._status && (payload._status = 0, payload._result = ctor);
248
- }
249
- if (1 === payload._status) return payload._result.default;
250
- throw payload._result;
251
- }
252
- var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
253
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
254
- var event = new window.ErrorEvent("error", {
255
- bubbles: true,
256
- cancelable: true,
257
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
258
- error
259
- });
260
- if (!window.dispatchEvent(event)) return;
261
- } else if ("object" === typeof process && "function" === typeof process.emit) {
262
- process.emit("uncaughtException", error);
263
- return;
264
- }
265
- console.error(error);
266
- };
267
- var Children = {
268
- map: mapChildren,
269
- forEach: function(children, forEachFunc, forEachContext) {
270
- mapChildren(
271
- children,
272
- function() {
273
- forEachFunc.apply(this, arguments);
274
- },
275
- forEachContext
276
- );
277
- },
278
- count: function(children) {
279
- var n = 0;
280
- mapChildren(children, function() {
281
- n++;
282
- });
283
- return n;
284
- },
285
- toArray: function(children) {
286
- return mapChildren(children, function(child) {
287
- return child;
288
- }) || [];
289
- },
290
- only: function(children) {
291
- if (!isValidElement(children))
292
- throw Error(
293
- "React.Children.only expected to receive a single React element child."
294
- );
295
- return children;
296
- }
297
- };
298
- exports2.Activity = REACT_ACTIVITY_TYPE;
299
- exports2.Children = Children;
300
- exports2.Component = Component;
301
- exports2.Fragment = REACT_FRAGMENT_TYPE;
302
- exports2.Profiler = REACT_PROFILER_TYPE;
303
- exports2.PureComponent = PureComponent;
304
- exports2.StrictMode = REACT_STRICT_MODE_TYPE;
305
- exports2.Suspense = REACT_SUSPENSE_TYPE;
306
- exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
307
- exports2.__COMPILER_RUNTIME = {
308
- __proto__: null,
309
- c: function(size) {
310
- return ReactSharedInternals.H.useMemoCache(size);
311
- }
312
- };
313
- exports2.cache = function(fn) {
314
- return function() {
315
- return fn.apply(null, arguments);
316
- };
317
- };
318
- exports2.cacheSignal = function() {
319
- return null;
320
- };
321
- exports2.cloneElement = function(element, config, children) {
322
- if (null === element || void 0 === element)
323
- throw Error(
324
- "The argument must be a React element, but you passed " + element + "."
325
- );
326
- var props = assign({}, element.props), key = element.key;
327
- if (null != config)
328
- for (propName in void 0 !== config.key && (key = "" + config.key), config)
329
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
330
- var propName = arguments.length - 2;
331
- if (1 === propName) props.children = children;
332
- else if (1 < propName) {
333
- for (var childArray = Array(propName), i = 0; i < propName; i++)
334
- childArray[i] = arguments[i + 2];
335
- props.children = childArray;
336
- }
337
- return ReactElement(element.type, key, props);
338
- };
339
- exports2.createContext = function(defaultValue) {
340
- defaultValue = {
341
- $$typeof: REACT_CONTEXT_TYPE,
342
- _currentValue: defaultValue,
343
- _currentValue2: defaultValue,
344
- _threadCount: 0,
345
- Provider: null,
346
- Consumer: null
347
- };
348
- defaultValue.Provider = defaultValue;
349
- defaultValue.Consumer = {
350
- $$typeof: REACT_CONSUMER_TYPE,
351
- _context: defaultValue
352
- };
353
- return defaultValue;
354
- };
355
- exports2.createElement = function(type, config, children) {
356
- var propName, props = {}, key = null;
357
- if (null != config)
358
- for (propName in void 0 !== config.key && (key = "" + config.key), config)
359
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
360
- var childrenLength = arguments.length - 2;
361
- if (1 === childrenLength) props.children = children;
362
- else if (1 < childrenLength) {
363
- for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
364
- childArray[i] = arguments[i + 2];
365
- props.children = childArray;
366
- }
367
- if (type && type.defaultProps)
368
- for (propName in childrenLength = type.defaultProps, childrenLength)
369
- void 0 === props[propName] && (props[propName] = childrenLength[propName]);
370
- return ReactElement(type, key, props);
371
- };
372
- exports2.createRef = function() {
373
- return { current: null };
374
- };
375
- exports2.forwardRef = function(render) {
376
- return { $$typeof: REACT_FORWARD_REF_TYPE, render };
377
- };
378
- exports2.isValidElement = isValidElement;
379
- exports2.lazy = function(ctor) {
380
- return {
381
- $$typeof: REACT_LAZY_TYPE,
382
- _payload: { _status: -1, _result: ctor },
383
- _init: lazyInitializer
384
- };
385
- };
386
- exports2.memo = function(type, compare) {
387
- return {
388
- $$typeof: REACT_MEMO_TYPE,
389
- type,
390
- compare: void 0 === compare ? null : compare
391
- };
392
- };
393
- exports2.startTransition = function(scope) {
394
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
395
- ReactSharedInternals.T = currentTransition;
396
- try {
397
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
398
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
399
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
400
- } catch (error) {
401
- reportGlobalError(error);
402
- } finally {
403
- null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
404
- }
405
- };
406
- exports2.unstable_useCacheRefresh = function() {
407
- return ReactSharedInternals.H.useCacheRefresh();
408
- };
409
- exports2.use = function(usable) {
410
- return ReactSharedInternals.H.use(usable);
411
- };
412
- exports2.useActionState = function(action, initialState, permalink) {
413
- return ReactSharedInternals.H.useActionState(action, initialState, permalink);
414
- };
415
- exports2.useCallback = function(callback, deps) {
416
- return ReactSharedInternals.H.useCallback(callback, deps);
417
- };
418
- exports2.useContext = function(Context) {
419
- return ReactSharedInternals.H.useContext(Context);
420
- };
421
- exports2.useDebugValue = function() {
422
- };
423
- exports2.useDeferredValue = function(value, initialValue) {
424
- return ReactSharedInternals.H.useDeferredValue(value, initialValue);
425
- };
426
- exports2.useEffect = function(create, deps) {
427
- return ReactSharedInternals.H.useEffect(create, deps);
428
- };
429
- exports2.useEffectEvent = function(callback) {
430
- return ReactSharedInternals.H.useEffectEvent(callback);
431
- };
432
- exports2.useId = function() {
433
- return ReactSharedInternals.H.useId();
434
- };
435
- exports2.useImperativeHandle = function(ref, create, deps) {
436
- return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
437
- };
438
- exports2.useInsertionEffect = function(create, deps) {
439
- return ReactSharedInternals.H.useInsertionEffect(create, deps);
440
- };
441
- exports2.useLayoutEffect = function(create, deps) {
442
- return ReactSharedInternals.H.useLayoutEffect(create, deps);
443
- };
444
- exports2.useMemo = function(create, deps) {
445
- return ReactSharedInternals.H.useMemo(create, deps);
446
- };
447
- exports2.useOptimistic = function(passthrough, reducer) {
448
- return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
449
- };
450
- exports2.useReducer = function(reducer, initialArg, init) {
451
- return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
452
- };
453
- exports2.useRef = function(initialValue) {
454
- return ReactSharedInternals.H.useRef(initialValue);
455
- };
456
- exports2.useState = function(initialState) {
457
- return ReactSharedInternals.H.useState(initialState);
458
- };
459
- exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
460
- return ReactSharedInternals.H.useSyncExternalStore(
461
- subscribe,
462
- getSnapshot,
463
- getServerSnapshot
464
- );
465
- };
466
- exports2.useTransition = function() {
467
- return ReactSharedInternals.H.useTransition();
468
- };
469
- exports2.version = "19.2.4";
470
- }
471
- });
472
-
473
- // ../../node_modules/react/cjs/react.development.js
474
- var require_react_development = __commonJS({
475
- "../../node_modules/react/cjs/react.development.js"(exports2, module2) {
476
- "use strict";
477
- "production" !== process.env.NODE_ENV && (function() {
478
- function defineDeprecationWarning(methodName, info) {
479
- Object.defineProperty(Component.prototype, methodName, {
480
- get: function() {
481
- console.warn(
482
- "%s(...) is deprecated in plain JavaScript React classes. %s",
483
- info[0],
484
- info[1]
485
- );
486
- }
487
- });
488
- }
489
- function getIteratorFn(maybeIterable) {
490
- if (null === maybeIterable || "object" !== typeof maybeIterable)
491
- return null;
492
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
493
- return "function" === typeof maybeIterable ? maybeIterable : null;
494
- }
495
- function warnNoop(publicInstance, callerName) {
496
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
497
- var warningKey = publicInstance + "." + callerName;
498
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
499
- "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.",
500
- callerName,
501
- publicInstance
502
- ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
503
- }
504
- function Component(props, context, updater) {
505
- this.props = props;
506
- this.context = context;
507
- this.refs = emptyObject;
508
- this.updater = updater || ReactNoopUpdateQueue;
509
- }
510
- function ComponentDummy() {
511
- }
512
- function PureComponent(props, context, updater) {
513
- this.props = props;
514
- this.context = context;
515
- this.refs = emptyObject;
516
- this.updater = updater || ReactNoopUpdateQueue;
517
- }
518
- function noop() {
519
- }
520
- function testStringCoercion(value) {
521
- return "" + value;
522
- }
523
- function checkKeyStringCoercion(value) {
524
- try {
525
- testStringCoercion(value);
526
- var JSCompiler_inline_result = false;
527
- } catch (e) {
528
- JSCompiler_inline_result = true;
529
- }
530
- if (JSCompiler_inline_result) {
531
- JSCompiler_inline_result = console;
532
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
533
- var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
534
- JSCompiler_temp_const.call(
535
- JSCompiler_inline_result,
536
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
537
- JSCompiler_inline_result$jscomp$0
538
- );
539
- return testStringCoercion(value);
540
- }
541
- }
542
- function getComponentNameFromType(type) {
543
- if (null == type) return null;
544
- if ("function" === typeof type)
545
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
546
- if ("string" === typeof type) return type;
547
- switch (type) {
548
- case REACT_FRAGMENT_TYPE:
549
- return "Fragment";
550
- case REACT_PROFILER_TYPE:
551
- return "Profiler";
552
- case REACT_STRICT_MODE_TYPE:
553
- return "StrictMode";
554
- case REACT_SUSPENSE_TYPE:
555
- return "Suspense";
556
- case REACT_SUSPENSE_LIST_TYPE:
557
- return "SuspenseList";
558
- case REACT_ACTIVITY_TYPE:
559
- return "Activity";
560
- }
561
- if ("object" === typeof type)
562
- switch ("number" === typeof type.tag && console.error(
563
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
564
- ), type.$$typeof) {
565
- case REACT_PORTAL_TYPE:
566
- return "Portal";
567
- case REACT_CONTEXT_TYPE:
568
- return type.displayName || "Context";
569
- case REACT_CONSUMER_TYPE:
570
- return (type._context.displayName || "Context") + ".Consumer";
571
- case REACT_FORWARD_REF_TYPE:
572
- var innerType = type.render;
573
- type = type.displayName;
574
- type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
575
- return type;
576
- case REACT_MEMO_TYPE:
577
- return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
578
- case REACT_LAZY_TYPE:
579
- innerType = type._payload;
580
- type = type._init;
581
- try {
582
- return getComponentNameFromType(type(innerType));
583
- } catch (x) {
584
- }
585
- }
586
- return null;
587
- }
588
- function getTaskName(type) {
589
- if (type === REACT_FRAGMENT_TYPE) return "<>";
590
- if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
591
- return "<...>";
592
- try {
593
- var name = getComponentNameFromType(type);
594
- return name ? "<" + name + ">" : "<...>";
595
- } catch (x) {
596
- return "<...>";
597
- }
598
- }
599
- function getOwner() {
600
- var dispatcher = ReactSharedInternals.A;
601
- return null === dispatcher ? null : dispatcher.getOwner();
602
- }
603
- function UnknownOwner() {
604
- return Error("react-stack-top-frame");
605
- }
606
- function hasValidKey(config) {
607
- if (hasOwnProperty.call(config, "key")) {
608
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
609
- if (getter && getter.isReactWarning) return false;
610
- }
611
- return void 0 !== config.key;
612
- }
613
- function defineKeyPropWarningGetter(props, displayName) {
614
- function warnAboutAccessingKey() {
615
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
616
- "%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)",
617
- displayName
618
- ));
619
- }
620
- warnAboutAccessingKey.isReactWarning = true;
621
- Object.defineProperty(props, "key", {
622
- get: warnAboutAccessingKey,
623
- configurable: true
624
- });
625
- }
626
- function elementRefGetterWithDeprecationWarning() {
627
- var componentName = getComponentNameFromType(this.type);
628
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
629
- "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."
630
- ));
631
- componentName = this.props.ref;
632
- return void 0 !== componentName ? componentName : null;
633
- }
634
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
635
- var refProp = props.ref;
636
- type = {
637
- $$typeof: REACT_ELEMENT_TYPE,
638
- type,
639
- key,
640
- props,
641
- _owner: owner
642
- };
643
- null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
644
- enumerable: false,
645
- get: elementRefGetterWithDeprecationWarning
646
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
647
- type._store = {};
648
- Object.defineProperty(type._store, "validated", {
649
- configurable: false,
650
- enumerable: false,
651
- writable: true,
652
- value: 0
653
- });
654
- Object.defineProperty(type, "_debugInfo", {
655
- configurable: false,
656
- enumerable: false,
657
- writable: true,
658
- value: null
659
- });
660
- Object.defineProperty(type, "_debugStack", {
661
- configurable: false,
662
- enumerable: false,
663
- writable: true,
664
- value: debugStack
665
- });
666
- Object.defineProperty(type, "_debugTask", {
667
- configurable: false,
668
- enumerable: false,
669
- writable: true,
670
- value: debugTask
671
- });
672
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
673
- return type;
674
- }
675
- function cloneAndReplaceKey(oldElement, newKey) {
676
- newKey = ReactElement(
677
- oldElement.type,
678
- newKey,
679
- oldElement.props,
680
- oldElement._owner,
681
- oldElement._debugStack,
682
- oldElement._debugTask
683
- );
684
- oldElement._store && (newKey._store.validated = oldElement._store.validated);
685
- return newKey;
686
- }
687
- function validateChildKeys(node) {
688
- 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));
689
- }
690
- function isValidElement(object) {
691
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
692
- }
693
- function escape(key) {
694
- var escaperLookup = { "=": "=0", ":": "=2" };
695
- return "$" + key.replace(/[=:]/g, function(match) {
696
- return escaperLookup[match];
697
- });
698
- }
699
- function getElementKey(element, index) {
700
- return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
701
- }
702
- function resolveThenable(thenable) {
703
- switch (thenable.status) {
704
- case "fulfilled":
705
- return thenable.value;
706
- case "rejected":
707
- throw thenable.reason;
708
- default:
709
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
710
- function(fulfilledValue) {
711
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
712
- },
713
- function(error) {
714
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
715
- }
716
- )), thenable.status) {
717
- case "fulfilled":
718
- return thenable.value;
719
- case "rejected":
720
- throw thenable.reason;
721
- }
722
- }
723
- throw thenable;
724
- }
725
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
726
- var type = typeof children;
727
- if ("undefined" === type || "boolean" === type) children = null;
728
- var invokeCallback = false;
729
- if (null === children) invokeCallback = true;
730
- else
731
- switch (type) {
732
- case "bigint":
733
- case "string":
734
- case "number":
735
- invokeCallback = true;
736
- break;
737
- case "object":
738
- switch (children.$$typeof) {
739
- case REACT_ELEMENT_TYPE:
740
- case REACT_PORTAL_TYPE:
741
- invokeCallback = true;
742
- break;
743
- case REACT_LAZY_TYPE:
744
- return invokeCallback = children._init, mapIntoArray(
745
- invokeCallback(children._payload),
746
- array,
747
- escapedPrefix,
748
- nameSoFar,
749
- callback
750
- );
751
- }
752
- }
753
- if (invokeCallback) {
754
- invokeCallback = children;
755
- callback = callback(invokeCallback);
756
- var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
757
- isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
758
- return c;
759
- })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
760
- callback,
761
- escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
762
- userProvidedKeyEscapeRegex,
763
- "$&/"
764
- ) + "/") + childKey
765
- ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
766
- return 1;
767
- }
768
- invokeCallback = 0;
769
- childKey = "" === nameSoFar ? "." : nameSoFar + ":";
770
- if (isArrayImpl(children))
771
- for (var i = 0; i < children.length; i++)
772
- nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
773
- nameSoFar,
774
- array,
775
- escapedPrefix,
776
- type,
777
- callback
778
- );
779
- else if (i = getIteratorFn(children), "function" === typeof i)
780
- for (i === children.entries && (didWarnAboutMaps || console.warn(
781
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
782
- ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
783
- nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
784
- nameSoFar,
785
- array,
786
- escapedPrefix,
787
- type,
788
- callback
789
- );
790
- else if ("object" === type) {
791
- if ("function" === typeof children.then)
792
- return mapIntoArray(
793
- resolveThenable(children),
794
- array,
795
- escapedPrefix,
796
- nameSoFar,
797
- callback
798
- );
799
- array = String(children);
800
- throw Error(
801
- "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."
802
- );
803
- }
804
- return invokeCallback;
805
- }
806
- function mapChildren(children, func, context) {
807
- if (null == children) return children;
808
- var result = [], count = 0;
809
- mapIntoArray(children, result, "", "", function(child) {
810
- return func.call(context, child, count++);
811
- });
812
- return result;
813
- }
814
- function lazyInitializer(payload) {
815
- if (-1 === payload._status) {
816
- var ioInfo = payload._ioInfo;
817
- null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
818
- ioInfo = payload._result;
819
- var thenable = ioInfo();
820
- thenable.then(
821
- function(moduleObject) {
822
- if (0 === payload._status || -1 === payload._status) {
823
- payload._status = 1;
824
- payload._result = moduleObject;
825
- var _ioInfo = payload._ioInfo;
826
- null != _ioInfo && (_ioInfo.end = performance.now());
827
- void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
828
- }
829
- },
830
- function(error) {
831
- if (0 === payload._status || -1 === payload._status) {
832
- payload._status = 2;
833
- payload._result = error;
834
- var _ioInfo2 = payload._ioInfo;
835
- null != _ioInfo2 && (_ioInfo2.end = performance.now());
836
- void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
837
- }
838
- }
839
- );
840
- ioInfo = payload._ioInfo;
841
- if (null != ioInfo) {
842
- ioInfo.value = thenable;
843
- var displayName = thenable.displayName;
844
- "string" === typeof displayName && (ioInfo.name = displayName);
845
- }
846
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
847
- }
848
- if (1 === payload._status)
849
- return ioInfo = payload._result, void 0 === ioInfo && console.error(
850
- "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?",
851
- ioInfo
852
- ), "default" in ioInfo || console.error(
853
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
854
- ioInfo
855
- ), ioInfo.default;
856
- throw payload._result;
857
- }
858
- function resolveDispatcher() {
859
- var dispatcher = ReactSharedInternals.H;
860
- null === dispatcher && console.error(
861
- "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."
862
- );
863
- return dispatcher;
864
- }
865
- function releaseAsyncTransition() {
866
- ReactSharedInternals.asyncTransitions--;
867
- }
868
- function enqueueTask(task) {
869
- if (null === enqueueTaskImpl)
870
- try {
871
- var requireString = ("require" + Math.random()).slice(0, 7);
872
- enqueueTaskImpl = (module2 && module2[requireString]).call(
873
- module2,
874
- "timers"
875
- ).setImmediate;
876
- } catch (_err) {
877
- enqueueTaskImpl = function(callback) {
878
- false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
879
- "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."
880
- ));
881
- var channel = new MessageChannel();
882
- channel.port1.onmessage = callback;
883
- channel.port2.postMessage(void 0);
884
- };
885
- }
886
- return enqueueTaskImpl(task);
887
- }
888
- function aggregateErrors(errors) {
889
- return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
890
- }
891
- function popActScope(prevActQueue, prevActScopeDepth) {
892
- prevActScopeDepth !== actScopeDepth - 1 && console.error(
893
- "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
894
- );
895
- actScopeDepth = prevActScopeDepth;
896
- }
897
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
898
- var queue = ReactSharedInternals.actQueue;
899
- if (null !== queue)
900
- if (0 !== queue.length)
901
- try {
902
- flushActQueue(queue);
903
- enqueueTask(function() {
904
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
905
- });
906
- return;
907
- } catch (error) {
908
- ReactSharedInternals.thrownErrors.push(error);
909
- }
910
- else ReactSharedInternals.actQueue = null;
911
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
912
- }
913
- function flushActQueue(queue) {
914
- if (!isFlushing) {
915
- isFlushing = true;
916
- var i = 0;
917
- try {
918
- for (; i < queue.length; i++) {
919
- var callback = queue[i];
920
- do {
921
- ReactSharedInternals.didUsePromise = false;
922
- var continuation = callback(false);
923
- if (null !== continuation) {
924
- if (ReactSharedInternals.didUsePromise) {
925
- queue[i] = callback;
926
- queue.splice(0, i);
927
- return;
928
- }
929
- callback = continuation;
930
- } else break;
931
- } while (1);
932
- }
933
- queue.length = 0;
934
- } catch (error) {
935
- queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
936
- } finally {
937
- isFlushing = false;
938
- }
939
- }
940
- }
941
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
942
- 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 = {
943
- isMounted: function() {
944
- return false;
945
- },
946
- enqueueForceUpdate: function(publicInstance) {
947
- warnNoop(publicInstance, "forceUpdate");
948
- },
949
- enqueueReplaceState: function(publicInstance) {
950
- warnNoop(publicInstance, "replaceState");
951
- },
952
- enqueueSetState: function(publicInstance) {
953
- warnNoop(publicInstance, "setState");
954
- }
955
- }, assign = Object.assign, emptyObject = {};
956
- Object.freeze(emptyObject);
957
- Component.prototype.isReactComponent = {};
958
- Component.prototype.setState = function(partialState, callback) {
959
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
960
- throw Error(
961
- "takes an object of state variables to update or a function which returns an object of state variables."
962
- );
963
- this.updater.enqueueSetState(this, partialState, callback, "setState");
964
- };
965
- Component.prototype.forceUpdate = function(callback) {
966
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
967
- };
968
- var deprecatedAPIs = {
969
- isMounted: [
970
- "isMounted",
971
- "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
972
- ],
973
- replaceState: [
974
- "replaceState",
975
- "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
976
- ]
977
- };
978
- for (fnName in deprecatedAPIs)
979
- deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
980
- ComponentDummy.prototype = Component.prototype;
981
- deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
982
- deprecatedAPIs.constructor = PureComponent;
983
- assign(deprecatedAPIs, Component.prototype);
984
- deprecatedAPIs.isPureReactComponent = true;
985
- var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
986
- H: null,
987
- A: null,
988
- T: null,
989
- S: null,
990
- actQueue: null,
991
- asyncTransitions: 0,
992
- isBatchingLegacy: false,
993
- didScheduleLegacyUpdate: false,
994
- didUsePromise: false,
995
- thrownErrors: [],
996
- getCurrentStack: null,
997
- recentlyCreatedOwnerStacks: 0
998
- }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
999
- return null;
1000
- };
1001
- deprecatedAPIs = {
1002
- react_stack_bottom_frame: function(callStackForError) {
1003
- return callStackForError();
1004
- }
1005
- };
1006
- var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1007
- var didWarnAboutElementRef = {};
1008
- var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1009
- deprecatedAPIs,
1010
- UnknownOwner
1011
- )();
1012
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1013
- var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1014
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1015
- var event = new window.ErrorEvent("error", {
1016
- bubbles: true,
1017
- cancelable: true,
1018
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1019
- error
1020
- });
1021
- if (!window.dispatchEvent(event)) return;
1022
- } else if ("object" === typeof process && "function" === typeof process.emit) {
1023
- process.emit("uncaughtException", error);
1024
- return;
1025
- }
1026
- console.error(error);
1027
- }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1028
- queueMicrotask(function() {
1029
- return queueMicrotask(callback);
1030
- });
1031
- } : enqueueTask;
1032
- deprecatedAPIs = Object.freeze({
1033
- __proto__: null,
1034
- c: function(size) {
1035
- return resolveDispatcher().useMemoCache(size);
1036
- }
1037
- });
1038
- var fnName = {
1039
- map: mapChildren,
1040
- forEach: function(children, forEachFunc, forEachContext) {
1041
- mapChildren(
1042
- children,
1043
- function() {
1044
- forEachFunc.apply(this, arguments);
1045
- },
1046
- forEachContext
1047
- );
1048
- },
1049
- count: function(children) {
1050
- var n = 0;
1051
- mapChildren(children, function() {
1052
- n++;
1053
- });
1054
- return n;
1055
- },
1056
- toArray: function(children) {
1057
- return mapChildren(children, function(child) {
1058
- return child;
1059
- }) || [];
1060
- },
1061
- only: function(children) {
1062
- if (!isValidElement(children))
1063
- throw Error(
1064
- "React.Children.only expected to receive a single React element child."
1065
- );
1066
- return children;
1067
- }
1068
- };
1069
- exports2.Activity = REACT_ACTIVITY_TYPE;
1070
- exports2.Children = fnName;
1071
- exports2.Component = Component;
1072
- exports2.Fragment = REACT_FRAGMENT_TYPE;
1073
- exports2.Profiler = REACT_PROFILER_TYPE;
1074
- exports2.PureComponent = PureComponent;
1075
- exports2.StrictMode = REACT_STRICT_MODE_TYPE;
1076
- exports2.Suspense = REACT_SUSPENSE_TYPE;
1077
- exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1078
- exports2.__COMPILER_RUNTIME = deprecatedAPIs;
1079
- exports2.act = function(callback) {
1080
- var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1081
- actScopeDepth++;
1082
- var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1083
- try {
1084
- var result = callback();
1085
- } catch (error) {
1086
- ReactSharedInternals.thrownErrors.push(error);
1087
- }
1088
- if (0 < ReactSharedInternals.thrownErrors.length)
1089
- throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1090
- if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1091
- var thenable = result;
1092
- queueSeveralMicrotasks(function() {
1093
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1094
- "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 () => ...);"
1095
- ));
1096
- });
1097
- return {
1098
- then: function(resolve, reject) {
1099
- didAwaitActCall = true;
1100
- thenable.then(
1101
- function(returnValue) {
1102
- popActScope(prevActQueue, prevActScopeDepth);
1103
- if (0 === prevActScopeDepth) {
1104
- try {
1105
- flushActQueue(queue), enqueueTask(function() {
1106
- return recursivelyFlushAsyncActWork(
1107
- returnValue,
1108
- resolve,
1109
- reject
1110
- );
1111
- });
1112
- } catch (error$0) {
1113
- ReactSharedInternals.thrownErrors.push(error$0);
1114
- }
1115
- if (0 < ReactSharedInternals.thrownErrors.length) {
1116
- var _thrownError = aggregateErrors(
1117
- ReactSharedInternals.thrownErrors
1118
- );
1119
- ReactSharedInternals.thrownErrors.length = 0;
1120
- reject(_thrownError);
1121
- }
1122
- } else resolve(returnValue);
1123
- },
1124
- function(error) {
1125
- popActScope(prevActQueue, prevActScopeDepth);
1126
- 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1127
- ReactSharedInternals.thrownErrors
1128
- ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1129
- }
1130
- );
1131
- }
1132
- };
1133
- }
1134
- var returnValue$jscomp$0 = result;
1135
- popActScope(prevActQueue, prevActScopeDepth);
1136
- 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1137
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1138
- "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(() => ...)"
1139
- ));
1140
- }), ReactSharedInternals.actQueue = null);
1141
- if (0 < ReactSharedInternals.thrownErrors.length)
1142
- throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1143
- return {
1144
- then: function(resolve, reject) {
1145
- didAwaitActCall = true;
1146
- 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1147
- return recursivelyFlushAsyncActWork(
1148
- returnValue$jscomp$0,
1149
- resolve,
1150
- reject
1151
- );
1152
- })) : resolve(returnValue$jscomp$0);
1153
- }
1154
- };
1155
- };
1156
- exports2.cache = function(fn) {
1157
- return function() {
1158
- return fn.apply(null, arguments);
1159
- };
1160
- };
1161
- exports2.cacheSignal = function() {
1162
- return null;
1163
- };
1164
- exports2.captureOwnerStack = function() {
1165
- var getCurrentStack = ReactSharedInternals.getCurrentStack;
1166
- return null === getCurrentStack ? null : getCurrentStack();
1167
- };
1168
- exports2.cloneElement = function(element, config, children) {
1169
- if (null === element || void 0 === element)
1170
- throw Error(
1171
- "The argument must be a React element, but you passed " + element + "."
1172
- );
1173
- var props = assign({}, element.props), key = element.key, owner = element._owner;
1174
- if (null != config) {
1175
- var JSCompiler_inline_result;
1176
- a: {
1177
- if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1178
- config,
1179
- "ref"
1180
- ).get) && JSCompiler_inline_result.isReactWarning) {
1181
- JSCompiler_inline_result = false;
1182
- break a;
1183
- }
1184
- JSCompiler_inline_result = void 0 !== config.ref;
1185
- }
1186
- JSCompiler_inline_result && (owner = getOwner());
1187
- hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1188
- for (propName in config)
1189
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1190
- }
1191
- var propName = arguments.length - 2;
1192
- if (1 === propName) props.children = children;
1193
- else if (1 < propName) {
1194
- JSCompiler_inline_result = Array(propName);
1195
- for (var i = 0; i < propName; i++)
1196
- JSCompiler_inline_result[i] = arguments[i + 2];
1197
- props.children = JSCompiler_inline_result;
1198
- }
1199
- props = ReactElement(
1200
- element.type,
1201
- key,
1202
- props,
1203
- owner,
1204
- element._debugStack,
1205
- element._debugTask
1206
- );
1207
- for (key = 2; key < arguments.length; key++)
1208
- validateChildKeys(arguments[key]);
1209
- return props;
1210
- };
1211
- exports2.createContext = function(defaultValue) {
1212
- defaultValue = {
1213
- $$typeof: REACT_CONTEXT_TYPE,
1214
- _currentValue: defaultValue,
1215
- _currentValue2: defaultValue,
1216
- _threadCount: 0,
1217
- Provider: null,
1218
- Consumer: null
1219
- };
1220
- defaultValue.Provider = defaultValue;
1221
- defaultValue.Consumer = {
1222
- $$typeof: REACT_CONSUMER_TYPE,
1223
- _context: defaultValue
1224
- };
1225
- defaultValue._currentRenderer = null;
1226
- defaultValue._currentRenderer2 = null;
1227
- return defaultValue;
1228
- };
1229
- exports2.createElement = function(type, config, children) {
1230
- for (var i = 2; i < arguments.length; i++)
1231
- validateChildKeys(arguments[i]);
1232
- i = {};
1233
- var key = null;
1234
- if (null != config)
1235
- for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1236
- "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"
1237
- )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1238
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1239
- var childrenLength = arguments.length - 2;
1240
- if (1 === childrenLength) i.children = children;
1241
- else if (1 < childrenLength) {
1242
- for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1243
- childArray[_i] = arguments[_i + 2];
1244
- Object.freeze && Object.freeze(childArray);
1245
- i.children = childArray;
1246
- }
1247
- if (type && type.defaultProps)
1248
- for (propName in childrenLength = type.defaultProps, childrenLength)
1249
- void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1250
- key && defineKeyPropWarningGetter(
1251
- i,
1252
- "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1253
- );
1254
- var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1255
- return ReactElement(
1256
- type,
1257
- key,
1258
- i,
1259
- getOwner(),
1260
- propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1261
- propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1262
- );
1263
- };
1264
- exports2.createRef = function() {
1265
- var refObject = { current: null };
1266
- Object.seal(refObject);
1267
- return refObject;
1268
- };
1269
- exports2.forwardRef = function(render) {
1270
- null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1271
- "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1272
- ) : "function" !== typeof render ? console.error(
1273
- "forwardRef requires a render function but was given %s.",
1274
- null === render ? "null" : typeof render
1275
- ) : 0 !== render.length && 2 !== render.length && console.error(
1276
- "forwardRef render functions accept exactly two parameters: props and ref. %s",
1277
- 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1278
- );
1279
- null != render && null != render.defaultProps && console.error(
1280
- "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1281
- );
1282
- var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1283
- Object.defineProperty(elementType, "displayName", {
1284
- enumerable: false,
1285
- configurable: true,
1286
- get: function() {
1287
- return ownName;
1288
- },
1289
- set: function(name) {
1290
- ownName = name;
1291
- render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1292
- }
1293
- });
1294
- return elementType;
1295
- };
1296
- exports2.isValidElement = isValidElement;
1297
- exports2.lazy = function(ctor) {
1298
- ctor = { _status: -1, _result: ctor };
1299
- var lazyType = {
1300
- $$typeof: REACT_LAZY_TYPE,
1301
- _payload: ctor,
1302
- _init: lazyInitializer
1303
- }, ioInfo = {
1304
- name: "lazy",
1305
- start: -1,
1306
- end: -1,
1307
- value: null,
1308
- owner: null,
1309
- debugStack: Error("react-stack-top-frame"),
1310
- debugTask: console.createTask ? console.createTask("lazy()") : null
1311
- };
1312
- ctor._ioInfo = ioInfo;
1313
- lazyType._debugInfo = [{ awaited: ioInfo }];
1314
- return lazyType;
1315
- };
1316
- exports2.memo = function(type, compare) {
1317
- null == type && console.error(
1318
- "memo: The first argument must be a component. Instead received: %s",
1319
- null === type ? "null" : typeof type
1320
- );
1321
- compare = {
1322
- $$typeof: REACT_MEMO_TYPE,
1323
- type,
1324
- compare: void 0 === compare ? null : compare
1325
- };
1326
- var ownName;
1327
- Object.defineProperty(compare, "displayName", {
1328
- enumerable: false,
1329
- configurable: true,
1330
- get: function() {
1331
- return ownName;
1332
- },
1333
- set: function(name) {
1334
- ownName = name;
1335
- type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1336
- }
1337
- });
1338
- return compare;
1339
- };
1340
- exports2.startTransition = function(scope) {
1341
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
1342
- currentTransition._updatedFibers = /* @__PURE__ */ new Set();
1343
- ReactSharedInternals.T = currentTransition;
1344
- try {
1345
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
1346
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
1347
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
1348
- } catch (error) {
1349
- reportGlobalError(error);
1350
- } finally {
1351
- null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
1352
- "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."
1353
- )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
1354
- "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."
1355
- ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
1356
- }
1357
- };
1358
- exports2.unstable_useCacheRefresh = function() {
1359
- return resolveDispatcher().useCacheRefresh();
1360
- };
1361
- exports2.use = function(usable) {
1362
- return resolveDispatcher().use(usable);
1363
- };
1364
- exports2.useActionState = function(action, initialState, permalink) {
1365
- return resolveDispatcher().useActionState(
1366
- action,
1367
- initialState,
1368
- permalink
1369
- );
1370
- };
1371
- exports2.useCallback = function(callback, deps) {
1372
- return resolveDispatcher().useCallback(callback, deps);
1373
- };
1374
- exports2.useContext = function(Context) {
1375
- var dispatcher = resolveDispatcher();
1376
- Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1377
- "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1378
- );
1379
- return dispatcher.useContext(Context);
1380
- };
1381
- exports2.useDebugValue = function(value, formatterFn) {
1382
- return resolveDispatcher().useDebugValue(value, formatterFn);
1383
- };
1384
- exports2.useDeferredValue = function(value, initialValue) {
1385
- return resolveDispatcher().useDeferredValue(value, initialValue);
1386
- };
1387
- exports2.useEffect = function(create, deps) {
1388
- null == create && console.warn(
1389
- "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1390
- );
1391
- return resolveDispatcher().useEffect(create, deps);
1392
- };
1393
- exports2.useEffectEvent = function(callback) {
1394
- return resolveDispatcher().useEffectEvent(callback);
1395
- };
1396
- exports2.useId = function() {
1397
- return resolveDispatcher().useId();
1398
- };
1399
- exports2.useImperativeHandle = function(ref, create, deps) {
1400
- return resolveDispatcher().useImperativeHandle(ref, create, deps);
1401
- };
1402
- exports2.useInsertionEffect = function(create, deps) {
1403
- null == create && console.warn(
1404
- "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1405
- );
1406
- return resolveDispatcher().useInsertionEffect(create, deps);
1407
- };
1408
- exports2.useLayoutEffect = function(create, deps) {
1409
- null == create && console.warn(
1410
- "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1411
- );
1412
- return resolveDispatcher().useLayoutEffect(create, deps);
1413
- };
1414
- exports2.useMemo = function(create, deps) {
1415
- return resolveDispatcher().useMemo(create, deps);
1416
- };
1417
- exports2.useOptimistic = function(passthrough, reducer) {
1418
- return resolveDispatcher().useOptimistic(passthrough, reducer);
1419
- };
1420
- exports2.useReducer = function(reducer, initialArg, init) {
1421
- return resolveDispatcher().useReducer(reducer, initialArg, init);
1422
- };
1423
- exports2.useRef = function(initialValue) {
1424
- return resolveDispatcher().useRef(initialValue);
1425
- };
1426
- exports2.useState = function(initialState) {
1427
- return resolveDispatcher().useState(initialState);
1428
- };
1429
- exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1430
- return resolveDispatcher().useSyncExternalStore(
1431
- subscribe,
1432
- getSnapshot,
1433
- getServerSnapshot
1434
- );
1435
- };
1436
- exports2.useTransition = function() {
1437
- return resolveDispatcher().useTransition();
1438
- };
1439
- exports2.version = "19.2.4";
1440
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1441
- })();
1442
- }
1443
- });
1444
-
1445
- // ../../node_modules/react/index.js
1446
- var require_react = __commonJS({
1447
- "../../node_modules/react/index.js"(exports2, module2) {
1448
- "use strict";
1449
- if (process.env.NODE_ENV === "production") {
1450
- module2.exports = require_react_production();
1451
- } else {
1452
- module2.exports = require_react_development();
1453
- }
1454
- }
1455
- });
1456
-
1457
- // src/index.ts
1458
- var index_exports = {};
1459
- __export(index_exports, {
1460
- EventEmitter: () => EventEmitter,
1461
- Weaverse: () => Weaverse,
1462
- WeaverseItemStore: () => WeaverseItemStore,
1463
- isBrowser: () => isBrowser,
1464
- isIframe: () => isIframe,
1465
- isReactNative: () => isReactNative,
1466
- loadScript: () => loadScript,
1467
- merge: () => merge,
1468
- registerElement: () => registerElement
1469
- });
1470
- module.exports = __toCommonJS(index_exports);
1471
-
1472
- // src/core.ts
1473
- var import_react = __toESM(require_react());
1474
-
1475
- // package.json
1476
- var version = "5.22.1";
1477
-
1478
- // src/utils/index.ts
1479
- var isReactNative = typeof navigator === "object" && navigator.product === "ReactNative";
1480
- var isBrowser = typeof window !== "undefined" && !isReactNative;
1481
- var isIframe = isBrowser && window.top !== window.self;
1482
- function merge(target, source) {
1483
- let t = { ...target || {} };
1484
- for (let key of Object.keys(source)) {
1485
- if (source[key] instanceof Object && !Array.isArray(source[key])) {
1486
- Object.assign(source[key], merge(t[key], source[key]));
1487
- }
1488
- }
1489
- Object.assign(t || {}, source);
1490
- return t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
4
+ //#endregion
5
+ //#region ../../node_modules/react/cjs/react.production.js
6
+ /**
7
+ * @license React
8
+ * react.production.js
9
+ *
10
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ var require_react_production = /* @__PURE__ */ __commonJSMin(((e) => {
16
+ var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.consumer"), s = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), f = Symbol.for("react.activity"), p = Symbol.iterator;
17
+ function getIteratorFn(e) {
18
+ if (null === e || "object" !== typeof e) return null;
19
+ e = p && e[p] || e["@@iterator"];
20
+ return "function" === typeof e ? e : null;
21
+ }
22
+ var m = {
23
+ isMounted: function() {
24
+ return !1;
25
+ },
26
+ enqueueForceUpdate: function() {},
27
+ enqueueReplaceState: function() {},
28
+ enqueueSetState: function() {}
29
+ }, h = Object.assign, g = {};
30
+ function Component(e, t, n) {
31
+ this.props = e;
32
+ this.context = t;
33
+ this.refs = g;
34
+ this.updater = n || m;
35
+ }
36
+ Component.prototype.isReactComponent = {};
37
+ Component.prototype.setState = function(e, t) {
38
+ if ("object" !== typeof e && "function" !== typeof e && null != e) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
39
+ this.updater.enqueueSetState(this, e, t, "setState");
40
+ };
41
+ Component.prototype.forceUpdate = function(e) {
42
+ this.updater.enqueueForceUpdate(this, e, "forceUpdate");
43
+ };
44
+ function ComponentDummy() {}
45
+ ComponentDummy.prototype = Component.prototype;
46
+ function PureComponent(e, t, n) {
47
+ this.props = e;
48
+ this.context = t;
49
+ this.refs = g;
50
+ this.updater = n || m;
51
+ }
52
+ var _ = PureComponent.prototype = new ComponentDummy();
53
+ _.constructor = PureComponent;
54
+ h(_, Component.prototype);
55
+ _.isPureReactComponent = !0;
56
+ var v = Array.isArray;
57
+ function noop() {}
58
+ var y = {
59
+ H: null,
60
+ A: null,
61
+ T: null,
62
+ S: null
63
+ }, b = Object.prototype.hasOwnProperty;
64
+ function ReactElement(e, n, r) {
65
+ var i = r.ref;
66
+ return {
67
+ $$typeof: t,
68
+ type: e,
69
+ key: n,
70
+ ref: void 0 !== i ? i : null,
71
+ props: r
72
+ };
73
+ }
74
+ function cloneAndReplaceKey(e, t) {
75
+ return ReactElement(e.type, t, e.props);
76
+ }
77
+ function isValidElement(e) {
78
+ return "object" === typeof e && null !== e && e.$$typeof === t;
79
+ }
80
+ function escape(e) {
81
+ var t = {
82
+ "=": "=0",
83
+ ":": "=2"
84
+ };
85
+ return "$" + e.replace(/[=:]/g, function(e) {
86
+ return t[e];
87
+ });
88
+ }
89
+ var x = /\/+/g;
90
+ function getElementKey(e, t) {
91
+ return "object" === typeof e && null !== e && null != e.key ? escape("" + e.key) : t.toString(36);
92
+ }
93
+ function resolveThenable(e) {
94
+ switch (e.status) {
95
+ case "fulfilled": return e.value;
96
+ case "rejected": throw e.reason;
97
+ default: switch ("string" === typeof e.status ? e.then(noop, noop) : (e.status = "pending", e.then(function(t) {
98
+ "pending" === e.status && (e.status = "fulfilled", e.value = t);
99
+ }, function(t) {
100
+ "pending" === e.status && (e.status = "rejected", e.reason = t);
101
+ })), e.status) {
102
+ case "fulfilled": return e.value;
103
+ case "rejected": throw e.reason;
104
+ }
105
+ }
106
+ throw e;
107
+ }
108
+ function mapIntoArray(e, r, i, a, o) {
109
+ var s = typeof e;
110
+ if ("undefined" === s || "boolean" === s) e = null;
111
+ var c = !1;
112
+ if (null === e) c = !0;
113
+ else switch (s) {
114
+ case "bigint":
115
+ case "string":
116
+ case "number":
117
+ c = !0;
118
+ break;
119
+ case "object": switch (e.$$typeof) {
120
+ case t:
121
+ case n:
122
+ c = !0;
123
+ break;
124
+ case d: return c = e._init, mapIntoArray(c(e._payload), r, i, a, o);
125
+ }
126
+ }
127
+ if (c) return o = o(e), c = "" === a ? "." + getElementKey(e, 0) : a, v(o) ? (i = "", null != c && (i = c.replace(x, "$&/") + "/"), mapIntoArray(o, r, i, "", function(e) {
128
+ return e;
129
+ })) : null != o && (isValidElement(o) && (o = cloneAndReplaceKey(o, i + (null == o.key || e && e.key === o.key ? "" : ("" + o.key).replace(x, "$&/") + "/") + c)), r.push(o)), 1;
130
+ c = 0;
131
+ var l = "" === a ? "." : a + ":";
132
+ if (v(e)) for (var u = 0; u < e.length; u++) a = e[u], s = l + getElementKey(a, u), c += mapIntoArray(a, r, i, s, o);
133
+ else if (u = getIteratorFn(e), "function" === typeof u) for (e = u.call(e), u = 0; !(a = e.next()).done;) a = a.value, s = l + getElementKey(a, u++), c += mapIntoArray(a, r, i, s, o);
134
+ else if ("object" === s) {
135
+ if ("function" === typeof e.then) return mapIntoArray(resolveThenable(e), r, i, a, o);
136
+ r = String(e);
137
+ throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === r ? "object with keys {" + Object.keys(e).join(", ") + "}" : r) + "). If you meant to render a collection of children, use an array instead.");
138
+ }
139
+ return c;
140
+ }
141
+ function mapChildren(e, t, n) {
142
+ if (null == e) return e;
143
+ var r = [], i = 0;
144
+ mapIntoArray(e, r, "", "", function(e) {
145
+ return t.call(n, e, i++);
146
+ });
147
+ return r;
148
+ }
149
+ function lazyInitializer(e) {
150
+ if (-1 === e._status) {
151
+ var t = e._result;
152
+ t = t();
153
+ t.then(function(t) {
154
+ if (0 === e._status || -1 === e._status) e._status = 1, e._result = t;
155
+ }, function(t) {
156
+ if (0 === e._status || -1 === e._status) e._status = 2, e._result = t;
157
+ });
158
+ -1 === e._status && (e._status = 0, e._result = t);
159
+ }
160
+ if (1 === e._status) return e._result.default;
161
+ throw e._result;
162
+ }
163
+ var S = "function" === typeof reportError ? reportError : function(e) {
164
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
165
+ var t = new window.ErrorEvent("error", {
166
+ bubbles: !0,
167
+ cancelable: !0,
168
+ message: "object" === typeof e && null !== e && "string" === typeof e.message ? String(e.message) : String(e),
169
+ error: e
170
+ });
171
+ if (!window.dispatchEvent(t)) return;
172
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
173
+ process.emit("uncaughtException", e);
174
+ return;
175
+ }
176
+ console.error(e);
177
+ }, C = {
178
+ map: mapChildren,
179
+ forEach: function(e, t, n) {
180
+ mapChildren(e, function() {
181
+ t.apply(this, arguments);
182
+ }, n);
183
+ },
184
+ count: function(e) {
185
+ var t = 0;
186
+ mapChildren(e, function() {
187
+ t++;
188
+ });
189
+ return t;
190
+ },
191
+ toArray: function(e) {
192
+ return mapChildren(e, function(e) {
193
+ return e;
194
+ }) || [];
195
+ },
196
+ only: function(e) {
197
+ if (!isValidElement(e)) throw Error("React.Children.only expected to receive a single React element child.");
198
+ return e;
199
+ }
200
+ };
201
+ e.Activity = f;
202
+ e.Children = C;
203
+ e.Component = Component;
204
+ e.Fragment = r;
205
+ e.Profiler = a;
206
+ e.PureComponent = PureComponent;
207
+ e.StrictMode = i;
208
+ e.Suspense = l;
209
+ e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = y;
210
+ e.__COMPILER_RUNTIME = {
211
+ __proto__: null,
212
+ c: function(e) {
213
+ return y.H.useMemoCache(e);
214
+ }
215
+ };
216
+ e.cache = function(e) {
217
+ return function() {
218
+ return e.apply(null, arguments);
219
+ };
220
+ };
221
+ e.cacheSignal = function() {
222
+ return null;
223
+ };
224
+ e.cloneElement = function(e, t, n) {
225
+ if (null === e || void 0 === e) throw Error("The argument must be a React element, but you passed " + e + ".");
226
+ var r = h({}, e.props), i = e.key;
227
+ if (null != t) for (a in void 0 !== t.key && (i = "" + t.key), t) !b.call(t, a) || "key" === a || "__self" === a || "__source" === a || "ref" === a && void 0 === t.ref || (r[a] = t[a]);
228
+ var a = arguments.length - 2;
229
+ if (1 === a) r.children = n;
230
+ else if (1 < a) {
231
+ for (var o = Array(a), s = 0; s < a; s++) o[s] = arguments[s + 2];
232
+ r.children = o;
233
+ }
234
+ return ReactElement(e.type, i, r);
235
+ };
236
+ e.createContext = function(e) {
237
+ e = {
238
+ $$typeof: s,
239
+ _currentValue: e,
240
+ _currentValue2: e,
241
+ _threadCount: 0,
242
+ Provider: null,
243
+ Consumer: null
244
+ };
245
+ e.Provider = e;
246
+ e.Consumer = {
247
+ $$typeof: o,
248
+ _context: e
249
+ };
250
+ return e;
251
+ };
252
+ e.createElement = function(e, t, n) {
253
+ var r, i = {}, a = null;
254
+ if (null != t) for (r in void 0 !== t.key && (a = "" + t.key), t) b.call(t, r) && "key" !== r && "__self" !== r && "__source" !== r && (i[r] = t[r]);
255
+ var o = arguments.length - 2;
256
+ if (1 === o) i.children = n;
257
+ else if (1 < o) {
258
+ for (var s = Array(o), c = 0; c < o; c++) s[c] = arguments[c + 2];
259
+ i.children = s;
260
+ }
261
+ if (e && e.defaultProps) for (r in o = e.defaultProps, o) void 0 === i[r] && (i[r] = o[r]);
262
+ return ReactElement(e, a, i);
263
+ };
264
+ e.createRef = function() {
265
+ return { current: null };
266
+ };
267
+ e.forwardRef = function(e) {
268
+ return {
269
+ $$typeof: c,
270
+ render: e
271
+ };
272
+ };
273
+ e.isValidElement = isValidElement;
274
+ e.lazy = function(e) {
275
+ return {
276
+ $$typeof: d,
277
+ _payload: {
278
+ _status: -1,
279
+ _result: e
280
+ },
281
+ _init: lazyInitializer
282
+ };
283
+ };
284
+ e.memo = function(e, t) {
285
+ return {
286
+ $$typeof: u,
287
+ type: e,
288
+ compare: void 0 === t ? null : t
289
+ };
290
+ };
291
+ e.startTransition = function(e) {
292
+ var t = y.T, n = {};
293
+ y.T = n;
294
+ try {
295
+ var r = e(), i = y.S;
296
+ null !== i && i(n, r);
297
+ "object" === typeof r && null !== r && "function" === typeof r.then && r.then(noop, S);
298
+ } catch (e) {
299
+ S(e);
300
+ } finally {
301
+ null !== t && null !== n.types && (t.types = n.types), y.T = t;
302
+ }
303
+ };
304
+ e.unstable_useCacheRefresh = function() {
305
+ return y.H.useCacheRefresh();
306
+ };
307
+ e.use = function(e) {
308
+ return y.H.use(e);
309
+ };
310
+ e.useActionState = function(e, t, n) {
311
+ return y.H.useActionState(e, t, n);
312
+ };
313
+ e.useCallback = function(e, t) {
314
+ return y.H.useCallback(e, t);
315
+ };
316
+ e.useContext = function(e) {
317
+ return y.H.useContext(e);
318
+ };
319
+ e.useDebugValue = function() {};
320
+ e.useDeferredValue = function(e, t) {
321
+ return y.H.useDeferredValue(e, t);
322
+ };
323
+ e.useEffect = function(e, t) {
324
+ return y.H.useEffect(e, t);
325
+ };
326
+ e.useEffectEvent = function(e) {
327
+ return y.H.useEffectEvent(e);
328
+ };
329
+ e.useId = function() {
330
+ return y.H.useId();
331
+ };
332
+ e.useImperativeHandle = function(e, t, n) {
333
+ return y.H.useImperativeHandle(e, t, n);
334
+ };
335
+ e.useInsertionEffect = function(e, t) {
336
+ return y.H.useInsertionEffect(e, t);
337
+ };
338
+ e.useLayoutEffect = function(e, t) {
339
+ return y.H.useLayoutEffect(e, t);
340
+ };
341
+ e.useMemo = function(e, t) {
342
+ return y.H.useMemo(e, t);
343
+ };
344
+ e.useOptimistic = function(e, t) {
345
+ return y.H.useOptimistic(e, t);
346
+ };
347
+ e.useReducer = function(e, t, n) {
348
+ return y.H.useReducer(e, t, n);
349
+ };
350
+ e.useRef = function(e) {
351
+ return y.H.useRef(e);
352
+ };
353
+ e.useState = function(e) {
354
+ return y.H.useState(e);
355
+ };
356
+ e.useSyncExternalStore = function(e, t, n) {
357
+ return y.H.useSyncExternalStore(e, t, n);
358
+ };
359
+ e.useTransition = function() {
360
+ return y.H.useTransition();
361
+ };
362
+ e.version = "19.2.4";
363
+ }));
364
+ //#endregion
365
+ //#region ../../node_modules/react/cjs/react.development.js
366
+ /**
367
+ * @license React
368
+ * react.development.js
369
+ *
370
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
371
+ *
372
+ * This source code is licensed under the MIT license found in the
373
+ * LICENSE file in the root directory of this source tree.
374
+ */
375
+ var require_react_development = /* @__PURE__ */ __commonJSMin(((e, t) => {
376
+ "production" !== process.env.NODE_ENV && (function() {
377
+ function defineDeprecationWarning(e, t) {
378
+ Object.defineProperty(Component.prototype, e, { get: function() {
379
+ console.warn("%s(...) is deprecated in plain JavaScript React classes. %s", t[0], t[1]);
380
+ } });
381
+ }
382
+ function getIteratorFn(e) {
383
+ if (null === e || "object" !== typeof e) return null;
384
+ e = h && e[h] || e["@@iterator"];
385
+ return "function" === typeof e ? e : null;
386
+ }
387
+ function warnNoop(e, t) {
388
+ e = (e = e.constructor) && (e.displayName || e.name) || "ReactClass";
389
+ var n = e + "." + t;
390
+ g[n] || (console.error("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.", t, e), g[n] = !0);
391
+ }
392
+ function Component(e, t, n) {
393
+ this.props = e;
394
+ this.context = t;
395
+ this.refs = y;
396
+ this.updater = n || _;
397
+ }
398
+ function ComponentDummy() {}
399
+ function PureComponent(e, t, n) {
400
+ this.props = e;
401
+ this.context = t;
402
+ this.refs = y;
403
+ this.updater = n || _;
404
+ }
405
+ function noop() {}
406
+ function testStringCoercion(e) {
407
+ return "" + e;
408
+ }
409
+ function checkKeyStringCoercion(e) {
410
+ try {
411
+ testStringCoercion(e);
412
+ var t = !1;
413
+ } catch (e) {
414
+ t = !0;
415
+ }
416
+ if (t) {
417
+ t = console;
418
+ var n = t.error;
419
+ var r = "function" === typeof Symbol && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
420
+ n.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", r);
421
+ return testStringCoercion(e);
422
+ }
423
+ }
424
+ function getComponentNameFromType(e) {
425
+ if (null == e) return null;
426
+ if ("function" === typeof e) return e.$$typeof === S ? null : e.displayName || e.name || null;
427
+ if ("string" === typeof e) return e;
428
+ switch (e) {
429
+ case i: return "Fragment";
430
+ case o: return "Profiler";
431
+ case a: return "StrictMode";
432
+ case u: return "Suspense";
433
+ case d: return "SuspenseList";
434
+ case m: return "Activity";
435
+ }
436
+ if ("object" === typeof e) switch ("number" === typeof e.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
437
+ case r: return "Portal";
438
+ case c: return e.displayName || "Context";
439
+ case s: return (e._context.displayName || "Context") + ".Consumer";
440
+ case l:
441
+ var t = e.render;
442
+ e = e.displayName;
443
+ e || (e = t.displayName || t.name || "", e = "" !== e ? "ForwardRef(" + e + ")" : "ForwardRef");
444
+ return e;
445
+ case f: return t = e.displayName || null, null !== t ? t : getComponentNameFromType(e.type) || "Memo";
446
+ case p:
447
+ t = e._payload;
448
+ e = e._init;
449
+ try {
450
+ return getComponentNameFromType(e(t));
451
+ } catch (e) {}
452
+ }
453
+ return null;
454
+ }
455
+ function getTaskName(e) {
456
+ if (e === i) return "<>";
457
+ if ("object" === typeof e && null !== e && e.$$typeof === p) return "<...>";
458
+ try {
459
+ var t = getComponentNameFromType(e);
460
+ return t ? "<" + t + ">" : "<...>";
461
+ } catch (e) {
462
+ return "<...>";
463
+ }
464
+ }
465
+ function getOwner() {
466
+ var e = C.A;
467
+ return null === e ? null : e.getOwner();
468
+ }
469
+ function UnknownOwner() {
470
+ return Error("react-stack-top-frame");
471
+ }
472
+ function hasValidKey(e) {
473
+ if (w.call(e, "key")) {
474
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
475
+ if (t && t.isReactWarning) return !1;
476
+ }
477
+ return void 0 !== e.key;
478
+ }
479
+ function defineKeyPropWarningGetter(e, t) {
480
+ function warnAboutAccessingKey() {
481
+ E || (E = !0, console.error("%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)", t));
482
+ }
483
+ warnAboutAccessingKey.isReactWarning = !0;
484
+ Object.defineProperty(e, "key", {
485
+ get: warnAboutAccessingKey,
486
+ configurable: !0
487
+ });
488
+ }
489
+ function elementRefGetterWithDeprecationWarning() {
490
+ var e = getComponentNameFromType(this.type);
491
+ O[e] || (O[e] = !0, console.error("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."));
492
+ e = this.props.ref;
493
+ return void 0 !== e ? e : null;
494
+ }
495
+ function ReactElement(e, t, r, i, a, o) {
496
+ var s = r.ref;
497
+ e = {
498
+ $$typeof: n,
499
+ type: e,
500
+ key: t,
501
+ props: r,
502
+ _owner: i
503
+ };
504
+ null !== (void 0 !== s ? s : null) ? Object.defineProperty(e, "ref", {
505
+ enumerable: !1,
506
+ get: elementRefGetterWithDeprecationWarning
507
+ }) : Object.defineProperty(e, "ref", {
508
+ enumerable: !1,
509
+ value: null
510
+ });
511
+ e._store = {};
512
+ Object.defineProperty(e._store, "validated", {
513
+ configurable: !1,
514
+ enumerable: !1,
515
+ writable: !0,
516
+ value: 0
517
+ });
518
+ Object.defineProperty(e, "_debugInfo", {
519
+ configurable: !1,
520
+ enumerable: !1,
521
+ writable: !0,
522
+ value: null
523
+ });
524
+ Object.defineProperty(e, "_debugStack", {
525
+ configurable: !1,
526
+ enumerable: !1,
527
+ writable: !0,
528
+ value: a
529
+ });
530
+ Object.defineProperty(e, "_debugTask", {
531
+ configurable: !1,
532
+ enumerable: !1,
533
+ writable: !0,
534
+ value: o
535
+ });
536
+ Object.freeze && (Object.freeze(e.props), Object.freeze(e));
537
+ return e;
538
+ }
539
+ function cloneAndReplaceKey(e, t) {
540
+ t = ReactElement(e.type, t, e.props, e._owner, e._debugStack, e._debugTask);
541
+ e._store && (t._store.validated = e._store.validated);
542
+ return t;
543
+ }
544
+ function validateChildKeys(e) {
545
+ isValidElement(e) ? e._store && (e._store.validated = 1) : "object" === typeof e && null !== e && e.$$typeof === p && ("fulfilled" === e._payload.status ? isValidElement(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
546
+ }
547
+ function isValidElement(e) {
548
+ return "object" === typeof e && null !== e && e.$$typeof === n;
549
+ }
550
+ function escape(e) {
551
+ var t = {
552
+ "=": "=0",
553
+ ":": "=2"
554
+ };
555
+ return "$" + e.replace(/[=:]/g, function(e) {
556
+ return t[e];
557
+ });
558
+ }
559
+ function getElementKey(e, t) {
560
+ return "object" === typeof e && null !== e && null != e.key ? (checkKeyStringCoercion(e.key), escape("" + e.key)) : t.toString(36);
561
+ }
562
+ function resolveThenable(e) {
563
+ switch (e.status) {
564
+ case "fulfilled": return e.value;
565
+ case "rejected": throw e.reason;
566
+ default: switch ("string" === typeof e.status ? e.then(noop, noop) : (e.status = "pending", e.then(function(t) {
567
+ "pending" === e.status && (e.status = "fulfilled", e.value = t);
568
+ }, function(t) {
569
+ "pending" === e.status && (e.status = "rejected", e.reason = t);
570
+ })), e.status) {
571
+ case "fulfilled": return e.value;
572
+ case "rejected": throw e.reason;
573
+ }
574
+ }
575
+ throw e;
576
+ }
577
+ function mapIntoArray(e, t, i, a, o) {
578
+ var s = typeof e;
579
+ if ("undefined" === s || "boolean" === s) e = null;
580
+ var c = !1;
581
+ if (null === e) c = !0;
582
+ else switch (s) {
583
+ case "bigint":
584
+ case "string":
585
+ case "number":
586
+ c = !0;
587
+ break;
588
+ case "object": switch (e.$$typeof) {
589
+ case n:
590
+ case r:
591
+ c = !0;
592
+ break;
593
+ case p: return c = e._init, mapIntoArray(c(e._payload), t, i, a, o);
594
+ }
595
+ }
596
+ if (c) {
597
+ c = e;
598
+ o = o(c);
599
+ var l = "" === a ? "." + getElementKey(c, 0) : a;
600
+ x(o) ? (i = "", null != l && (i = l.replace(M, "$&/") + "/"), mapIntoArray(o, t, i, "", function(e) {
601
+ return e;
602
+ })) : null != o && (isValidElement(o) && (null != o.key && (c && c.key === o.key || checkKeyStringCoercion(o.key)), i = cloneAndReplaceKey(o, i + (null == o.key || c && c.key === o.key ? "" : ("" + o.key).replace(M, "$&/") + "/") + l), "" !== a && null != c && isValidElement(c) && null == c.key && c._store && !c._store.validated && (i._store.validated = 2), o = i), t.push(o));
603
+ return 1;
604
+ }
605
+ c = 0;
606
+ l = "" === a ? "." : a + ":";
607
+ if (x(e)) for (var u = 0; u < e.length; u++) a = e[u], s = l + getElementKey(a, u), c += mapIntoArray(a, t, i, s, o);
608
+ else if (u = getIteratorFn(e), "function" === typeof u) for (u === e.entries && (j || console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), j = !0), e = u.call(e), u = 0; !(a = e.next()).done;) a = a.value, s = l + getElementKey(a, u++), c += mapIntoArray(a, t, i, s, o);
609
+ else if ("object" === s) {
610
+ if ("function" === typeof e.then) return mapIntoArray(resolveThenable(e), t, i, a, o);
611
+ t = String(e);
612
+ throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === t ? "object with keys {" + Object.keys(e).join(", ") + "}" : t) + "). If you meant to render a collection of children, use an array instead.");
613
+ }
614
+ return c;
615
+ }
616
+ function mapChildren(e, t, n) {
617
+ if (null == e) return e;
618
+ var r = [], i = 0;
619
+ mapIntoArray(e, r, "", "", function(e) {
620
+ return t.call(n, e, i++);
621
+ });
622
+ return r;
623
+ }
624
+ function lazyInitializer(e) {
625
+ if (-1 === e._status) {
626
+ var t = e._ioInfo;
627
+ null != t && (t.start = t.end = performance.now());
628
+ t = e._result;
629
+ var n = t();
630
+ n.then(function(t) {
631
+ if (0 === e._status || -1 === e._status) {
632
+ e._status = 1;
633
+ e._result = t;
634
+ var r = e._ioInfo;
635
+ null != r && (r.end = performance.now());
636
+ void 0 === n.status && (n.status = "fulfilled", n.value = t);
637
+ }
638
+ }, function(t) {
639
+ if (0 === e._status || -1 === e._status) {
640
+ e._status = 2;
641
+ e._result = t;
642
+ var r = e._ioInfo;
643
+ null != r && (r.end = performance.now());
644
+ void 0 === n.status && (n.status = "rejected", n.reason = t);
645
+ }
646
+ });
647
+ t = e._ioInfo;
648
+ if (null != t) {
649
+ t.value = n;
650
+ var r = n.displayName;
651
+ "string" === typeof r && (t.name = r);
652
+ }
653
+ -1 === e._status && (e._status = 0, e._result = n);
654
+ }
655
+ if (1 === e._status) return t = e._result, void 0 === t && console.error("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?", t), "default" in t || console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", t), t.default;
656
+ throw e._result;
657
+ }
658
+ function resolveDispatcher() {
659
+ var e = C.H;
660
+ null === e && console.error("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.");
661
+ return e;
662
+ }
663
+ function releaseAsyncTransition() {
664
+ C.asyncTransitions--;
665
+ }
666
+ function enqueueTask(e) {
667
+ if (null === enqueueTaskImpl) try {
668
+ var n = ("require" + Math.random()).slice(0, 7);
669
+ enqueueTaskImpl = (t && t[n]).call(t, "timers").setImmediate;
670
+ } catch (e) {
671
+ enqueueTaskImpl = function(e) {
672
+ !1 === P && (P = !0, "undefined" === typeof MessageChannel && console.error("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."));
673
+ var t = new MessageChannel();
674
+ t.port1.onmessage = e;
675
+ t.port2.postMessage(void 0);
676
+ };
677
+ }
678
+ return enqueueTaskImpl(e);
679
+ }
680
+ function aggregateErrors(e) {
681
+ return 1 < e.length && "function" === typeof AggregateError ? new AggregateError(e) : e[0];
682
+ }
683
+ function popActScope(e, t) {
684
+ t !== F - 1 && console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
685
+ F = t;
686
+ }
687
+ function recursivelyFlushAsyncActWork(e, t, n) {
688
+ var r = C.actQueue;
689
+ if (null !== r) if (0 !== r.length) try {
690
+ flushActQueue(r);
691
+ enqueueTask(function() {
692
+ return recursivelyFlushAsyncActWork(e, t, n);
693
+ });
694
+ return;
695
+ } catch (e) {
696
+ C.thrownErrors.push(e);
697
+ }
698
+ else C.actQueue = null;
699
+ 0 < C.thrownErrors.length ? (r = aggregateErrors(C.thrownErrors), C.thrownErrors.length = 0, n(r)) : t(e);
700
+ }
701
+ function flushActQueue(e) {
702
+ if (!L) {
703
+ L = !0;
704
+ var t = 0;
705
+ try {
706
+ for (; t < e.length; t++) {
707
+ var n = e[t];
708
+ do {
709
+ C.didUsePromise = !1;
710
+ var r = n(!1);
711
+ if (null !== r) {
712
+ if (C.didUsePromise) {
713
+ e[t] = n;
714
+ e.splice(0, t);
715
+ return;
716
+ }
717
+ n = r;
718
+ } else break;
719
+ } while (1);
720
+ }
721
+ e.length = 0;
722
+ } catch (n) {
723
+ e.splice(0, t + 1), C.thrownErrors.push(n);
724
+ } finally {
725
+ L = !1;
726
+ }
727
+ }
728
+ }
729
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
730
+ var n = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.consumer"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.activity"), h = Symbol.iterator, g = {}, _ = {
731
+ isMounted: function() {
732
+ return !1;
733
+ },
734
+ enqueueForceUpdate: function(e) {
735
+ warnNoop(e, "forceUpdate");
736
+ },
737
+ enqueueReplaceState: function(e) {
738
+ warnNoop(e, "replaceState");
739
+ },
740
+ enqueueSetState: function(e) {
741
+ warnNoop(e, "setState");
742
+ }
743
+ }, v = Object.assign, y = {};
744
+ Object.freeze(y);
745
+ Component.prototype.isReactComponent = {};
746
+ Component.prototype.setState = function(e, t) {
747
+ if ("object" !== typeof e && "function" !== typeof e && null != e) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
748
+ this.updater.enqueueSetState(this, e, t, "setState");
749
+ };
750
+ Component.prototype.forceUpdate = function(e) {
751
+ this.updater.enqueueForceUpdate(this, e, "forceUpdate");
752
+ };
753
+ var b = {
754
+ isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
755
+ replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
756
+ };
757
+ for (z in b) b.hasOwnProperty(z) && defineDeprecationWarning(z, b[z]);
758
+ ComponentDummy.prototype = Component.prototype;
759
+ b = PureComponent.prototype = new ComponentDummy();
760
+ b.constructor = PureComponent;
761
+ v(b, Component.prototype);
762
+ b.isPureReactComponent = !0;
763
+ var x = Array.isArray, S = Symbol.for("react.client.reference"), C = {
764
+ H: null,
765
+ A: null,
766
+ T: null,
767
+ S: null,
768
+ actQueue: null,
769
+ asyncTransitions: 0,
770
+ isBatchingLegacy: !1,
771
+ didScheduleLegacyUpdate: !1,
772
+ didUsePromise: !1,
773
+ thrownErrors: [],
774
+ getCurrentStack: null,
775
+ recentlyCreatedOwnerStacks: 0
776
+ }, w = Object.prototype.hasOwnProperty, T = console.createTask ? console.createTask : function() {
777
+ return null;
778
+ };
779
+ b = { react_stack_bottom_frame: function(e) {
780
+ return e();
781
+ } };
782
+ var E, D;
783
+ var O = {};
784
+ var k = b.react_stack_bottom_frame.bind(b, UnknownOwner)();
785
+ var A = T(getTaskName(UnknownOwner));
786
+ var j = !1, M = /\/+/g, N = "function" === typeof reportError ? reportError : function(e) {
787
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
788
+ var t = new window.ErrorEvent("error", {
789
+ bubbles: !0,
790
+ cancelable: !0,
791
+ message: "object" === typeof e && null !== e && "string" === typeof e.message ? String(e.message) : String(e),
792
+ error: e
793
+ });
794
+ if (!window.dispatchEvent(t)) return;
795
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
796
+ process.emit("uncaughtException", e);
797
+ return;
798
+ }
799
+ console.error(e);
800
+ }, P = !1, enqueueTaskImpl = null, F = 0, I = !1, L = !1, R = "function" === typeof queueMicrotask ? function(e) {
801
+ queueMicrotask(function() {
802
+ return queueMicrotask(e);
803
+ });
804
+ } : enqueueTask;
805
+ b = Object.freeze({
806
+ __proto__: null,
807
+ c: function(e) {
808
+ return resolveDispatcher().useMemoCache(e);
809
+ }
810
+ });
811
+ var z = {
812
+ map: mapChildren,
813
+ forEach: function(e, t, n) {
814
+ mapChildren(e, function() {
815
+ t.apply(this, arguments);
816
+ }, n);
817
+ },
818
+ count: function(e) {
819
+ var t = 0;
820
+ mapChildren(e, function() {
821
+ t++;
822
+ });
823
+ return t;
824
+ },
825
+ toArray: function(e) {
826
+ return mapChildren(e, function(e) {
827
+ return e;
828
+ }) || [];
829
+ },
830
+ only: function(e) {
831
+ if (!isValidElement(e)) throw Error("React.Children.only expected to receive a single React element child.");
832
+ return e;
833
+ }
834
+ };
835
+ e.Activity = m;
836
+ e.Children = z;
837
+ e.Component = Component;
838
+ e.Fragment = i;
839
+ e.Profiler = o;
840
+ e.PureComponent = PureComponent;
841
+ e.StrictMode = a;
842
+ e.Suspense = u;
843
+ e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = C;
844
+ e.__COMPILER_RUNTIME = b;
845
+ e.act = function(e) {
846
+ var t = C.actQueue, n = F;
847
+ F++;
848
+ var r = C.actQueue = null !== t ? t : [], i = !1;
849
+ try {
850
+ var a = e();
851
+ } catch (e) {
852
+ C.thrownErrors.push(e);
853
+ }
854
+ if (0 < C.thrownErrors.length) throw popActScope(t, n), e = aggregateErrors(C.thrownErrors), C.thrownErrors.length = 0, e;
855
+ if (null !== a && "object" === typeof a && "function" === typeof a.then) {
856
+ var o = a;
857
+ R(function() {
858
+ i || I || (I = !0, console.error("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 () => ...);"));
859
+ });
860
+ return { then: function(e, a) {
861
+ i = !0;
862
+ o.then(function(i) {
863
+ popActScope(t, n);
864
+ if (0 === n) {
865
+ try {
866
+ flushActQueue(r), enqueueTask(function() {
867
+ return recursivelyFlushAsyncActWork(i, e, a);
868
+ });
869
+ } catch (e) {
870
+ C.thrownErrors.push(e);
871
+ }
872
+ if (0 < C.thrownErrors.length) {
873
+ var o = aggregateErrors(C.thrownErrors);
874
+ C.thrownErrors.length = 0;
875
+ a(o);
876
+ }
877
+ } else e(i);
878
+ }, function(e) {
879
+ popActScope(t, n);
880
+ 0 < C.thrownErrors.length ? (e = aggregateErrors(C.thrownErrors), C.thrownErrors.length = 0, a(e)) : a(e);
881
+ });
882
+ } };
883
+ }
884
+ var s = a;
885
+ popActScope(t, n);
886
+ 0 === n && (flushActQueue(r), 0 !== r.length && R(function() {
887
+ i || I || (I = !0, console.error("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(() => ...)"));
888
+ }), C.actQueue = null);
889
+ if (0 < C.thrownErrors.length) throw e = aggregateErrors(C.thrownErrors), C.thrownErrors.length = 0, e;
890
+ return { then: function(e, t) {
891
+ i = !0;
892
+ 0 === n ? (C.actQueue = r, enqueueTask(function() {
893
+ return recursivelyFlushAsyncActWork(s, e, t);
894
+ })) : e(s);
895
+ } };
896
+ };
897
+ e.cache = function(e) {
898
+ return function() {
899
+ return e.apply(null, arguments);
900
+ };
901
+ };
902
+ e.cacheSignal = function() {
903
+ return null;
904
+ };
905
+ e.captureOwnerStack = function() {
906
+ var e = C.getCurrentStack;
907
+ return null === e ? null : e();
908
+ };
909
+ e.cloneElement = function(e, t, n) {
910
+ if (null === e || void 0 === e) throw Error("The argument must be a React element, but you passed " + e + ".");
911
+ var r = v({}, e.props), i = e.key, a = e._owner;
912
+ if (null != t) {
913
+ var o;
914
+ a: {
915
+ if (w.call(t, "ref") && (o = Object.getOwnPropertyDescriptor(t, "ref").get) && o.isReactWarning) {
916
+ o = !1;
917
+ break a;
918
+ }
919
+ o = void 0 !== t.ref;
920
+ }
921
+ o && (a = getOwner());
922
+ hasValidKey(t) && (checkKeyStringCoercion(t.key), i = "" + t.key);
923
+ for (s in t) !w.call(t, s) || "key" === s || "__self" === s || "__source" === s || "ref" === s && void 0 === t.ref || (r[s] = t[s]);
924
+ }
925
+ var s = arguments.length - 2;
926
+ if (1 === s) r.children = n;
927
+ else if (1 < s) {
928
+ o = Array(s);
929
+ for (var c = 0; c < s; c++) o[c] = arguments[c + 2];
930
+ r.children = o;
931
+ }
932
+ r = ReactElement(e.type, i, r, a, e._debugStack, e._debugTask);
933
+ for (i = 2; i < arguments.length; i++) validateChildKeys(arguments[i]);
934
+ return r;
935
+ };
936
+ e.createContext = function(e) {
937
+ e = {
938
+ $$typeof: c,
939
+ _currentValue: e,
940
+ _currentValue2: e,
941
+ _threadCount: 0,
942
+ Provider: null,
943
+ Consumer: null
944
+ };
945
+ e.Provider = e;
946
+ e.Consumer = {
947
+ $$typeof: s,
948
+ _context: e
949
+ };
950
+ e._currentRenderer = null;
951
+ e._currentRenderer2 = null;
952
+ return e;
953
+ };
954
+ e.createElement = function(e, t, n) {
955
+ for (var r = 2; r < arguments.length; r++) validateChildKeys(arguments[r]);
956
+ r = {};
957
+ var i = null;
958
+ if (null != t) for (c in D || !("__self" in t) || "key" in t || (D = !0, console.warn("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")), hasValidKey(t) && (checkKeyStringCoercion(t.key), i = "" + t.key), t) w.call(t, c) && "key" !== c && "__self" !== c && "__source" !== c && (r[c] = t[c]);
959
+ var a = arguments.length - 2;
960
+ if (1 === a) r.children = n;
961
+ else if (1 < a) {
962
+ for (var o = Array(a), s = 0; s < a; s++) o[s] = arguments[s + 2];
963
+ Object.freeze && Object.freeze(o);
964
+ r.children = o;
965
+ }
966
+ if (e && e.defaultProps) for (c in a = e.defaultProps, a) void 0 === r[c] && (r[c] = a[c]);
967
+ i && defineKeyPropWarningGetter(r, "function" === typeof e ? e.displayName || e.name || "Unknown" : e);
968
+ var c = 1e4 > C.recentlyCreatedOwnerStacks++;
969
+ return ReactElement(e, i, r, getOwner(), c ? Error("react-stack-top-frame") : k, c ? T(getTaskName(e)) : A);
970
+ };
971
+ e.createRef = function() {
972
+ var e = { current: null };
973
+ Object.seal(e);
974
+ return e;
975
+ };
976
+ e.forwardRef = function(e) {
977
+ null != e && e.$$typeof === f ? console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : "function" !== typeof e ? console.error("forwardRef requires a render function but was given %s.", null === e ? "null" : typeof e) : 0 !== e.length && 2 !== e.length && console.error("forwardRef render functions accept exactly two parameters: props and ref. %s", 1 === e.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
978
+ null != e && null != e.defaultProps && console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");
979
+ var t = {
980
+ $$typeof: l,
981
+ render: e
982
+ }, n;
983
+ Object.defineProperty(t, "displayName", {
984
+ enumerable: !1,
985
+ configurable: !0,
986
+ get: function() {
987
+ return n;
988
+ },
989
+ set: function(t) {
990
+ n = t;
991
+ e.name || e.displayName || (Object.defineProperty(e, "name", { value: t }), e.displayName = t);
992
+ }
993
+ });
994
+ return t;
995
+ };
996
+ e.isValidElement = isValidElement;
997
+ e.lazy = function(e) {
998
+ e = {
999
+ _status: -1,
1000
+ _result: e
1001
+ };
1002
+ var t = {
1003
+ $$typeof: p,
1004
+ _payload: e,
1005
+ _init: lazyInitializer
1006
+ }, n = {
1007
+ name: "lazy",
1008
+ start: -1,
1009
+ end: -1,
1010
+ value: null,
1011
+ owner: null,
1012
+ debugStack: Error("react-stack-top-frame"),
1013
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1014
+ };
1015
+ e._ioInfo = n;
1016
+ t._debugInfo = [{ awaited: n }];
1017
+ return t;
1018
+ };
1019
+ e.memo = function(e, t) {
1020
+ e ?? console.error("memo: The first argument must be a component. Instead received: %s", null === e ? "null" : typeof e);
1021
+ t = {
1022
+ $$typeof: f,
1023
+ type: e,
1024
+ compare: void 0 === t ? null : t
1025
+ };
1026
+ var n;
1027
+ Object.defineProperty(t, "displayName", {
1028
+ enumerable: !1,
1029
+ configurable: !0,
1030
+ get: function() {
1031
+ return n;
1032
+ },
1033
+ set: function(t) {
1034
+ n = t;
1035
+ e.name || e.displayName || (Object.defineProperty(e, "name", { value: t }), e.displayName = t);
1036
+ }
1037
+ });
1038
+ return t;
1039
+ };
1040
+ e.startTransition = function(e) {
1041
+ var t = C.T, n = {};
1042
+ n._updatedFibers = /* @__PURE__ */ new Set();
1043
+ C.T = n;
1044
+ try {
1045
+ var r = e(), i = C.S;
1046
+ null !== i && i(n, r);
1047
+ "object" === typeof r && null !== r && "function" === typeof r.then && (C.asyncTransitions++, r.then(releaseAsyncTransition, releaseAsyncTransition), r.then(noop, N));
1048
+ } catch (e) {
1049
+ N(e);
1050
+ } finally {
1051
+ null === t && n._updatedFibers && (e = n._updatedFibers.size, n._updatedFibers.clear(), 10 < e && console.warn("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.")), null !== t && null !== n.types && (null !== t.types && t.types !== n.types && console.error("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."), t.types = n.types), C.T = t;
1052
+ }
1053
+ };
1054
+ e.unstable_useCacheRefresh = function() {
1055
+ return resolveDispatcher().useCacheRefresh();
1056
+ };
1057
+ e.use = function(e) {
1058
+ return resolveDispatcher().use(e);
1059
+ };
1060
+ e.useActionState = function(e, t, n) {
1061
+ return resolveDispatcher().useActionState(e, t, n);
1062
+ };
1063
+ e.useCallback = function(e, t) {
1064
+ return resolveDispatcher().useCallback(e, t);
1065
+ };
1066
+ e.useContext = function(e) {
1067
+ var t = resolveDispatcher();
1068
+ e.$$typeof === s && console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?");
1069
+ return t.useContext(e);
1070
+ };
1071
+ e.useDebugValue = function(e, t) {
1072
+ return resolveDispatcher().useDebugValue(e, t);
1073
+ };
1074
+ e.useDeferredValue = function(e, t) {
1075
+ return resolveDispatcher().useDeferredValue(e, t);
1076
+ };
1077
+ e.useEffect = function(e, t) {
1078
+ e ?? console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");
1079
+ return resolveDispatcher().useEffect(e, t);
1080
+ };
1081
+ e.useEffectEvent = function(e) {
1082
+ return resolveDispatcher().useEffectEvent(e);
1083
+ };
1084
+ e.useId = function() {
1085
+ return resolveDispatcher().useId();
1086
+ };
1087
+ e.useImperativeHandle = function(e, t, n) {
1088
+ return resolveDispatcher().useImperativeHandle(e, t, n);
1089
+ };
1090
+ e.useInsertionEffect = function(e, t) {
1091
+ e ?? console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?");
1092
+ return resolveDispatcher().useInsertionEffect(e, t);
1093
+ };
1094
+ e.useLayoutEffect = function(e, t) {
1095
+ e ?? console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?");
1096
+ return resolveDispatcher().useLayoutEffect(e, t);
1097
+ };
1098
+ e.useMemo = function(e, t) {
1099
+ return resolveDispatcher().useMemo(e, t);
1100
+ };
1101
+ e.useOptimistic = function(e, t) {
1102
+ return resolveDispatcher().useOptimistic(e, t);
1103
+ };
1104
+ e.useReducer = function(e, t, n) {
1105
+ return resolveDispatcher().useReducer(e, t, n);
1106
+ };
1107
+ e.useRef = function(e) {
1108
+ return resolveDispatcher().useRef(e);
1109
+ };
1110
+ e.useState = function(e) {
1111
+ return resolveDispatcher().useState(e);
1112
+ };
1113
+ e.useSyncExternalStore = function(e, t, n) {
1114
+ return resolveDispatcher().useSyncExternalStore(e, t, n);
1115
+ };
1116
+ e.useTransition = function() {
1117
+ return resolveDispatcher().useTransition();
1118
+ };
1119
+ e.version = "19.2.4";
1120
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1121
+ })();
1122
+ }));
1123
+ //#endregion
1124
+ //#region ../../node_modules/react/index.js
1125
+ var require_react = /* @__PURE__ */ __commonJSMin(((n, r) => {
1126
+ if (process.env.NODE_ENV === "production") r.exports = require_react_production();
1127
+ else r.exports = require_react_development();
1128
+ }));
1129
+ //#endregion
1130
+ //#region package.json
1131
+ var import_react = require_react();
1132
+ var version = "5.24.0";
1133
+ //#endregion
1134
+ //#region src/utils/index.ts
1135
+ /** Whether the current runtime is React Native. */
1136
+ let isReactNative = typeof navigator === "object" && navigator.product === "ReactNative";
1137
+ /** Whether the current runtime provides a browser window. */
1138
+ let isBrowser = typeof window !== "undefined" && !isReactNative;
1139
+ /** Whether the current browser window is embedded in an iframe. */
1140
+ let isIframe = isBrowser && window.top !== window.self;
1141
+ /**
1142
+ * Recursively merges object properties from `source` into a copy of `target`.
1143
+ * Each nested non-array object owned by `source` is mutated in place and reused
1144
+ * in the result. Arrays and non-object values replace the target value.
1145
+ */
1146
+ function merge(e, t) {
1147
+ let n = { ...e || {} };
1148
+ for (let e of Object.keys(t)) if (t[e] instanceof Object && !Array.isArray(t[e])) Object.assign(t[e], merge(n[e], t[e]));
1149
+ Object.assign(n || {}, t);
1150
+ return n;
1491
1151
  }
1492
- var scriptLoadPromises = /* @__PURE__ */ new Map();
1493
- function loadScript(src) {
1494
- let pending = scriptLoadPromises.get(src);
1495
- if (pending) {
1496
- return pending;
1497
- }
1498
- let promise = new Promise((resolve, reject) => {
1499
- let currScript = document.querySelector(`script[src="${src}"]`);
1500
- if (currScript) {
1501
- return resolve(true);
1502
- }
1503
- let script = document.createElement("script");
1504
- script.src = src;
1505
- script.onload = resolve;
1506
- script.onerror = (error) => {
1507
- scriptLoadPromises.delete(src);
1508
- script.remove();
1509
- reject(error);
1510
- };
1511
- script.defer = true;
1512
- document.body.appendChild(script);
1513
- });
1514
- scriptLoadPromises.set(src, promise);
1515
- return promise;
1152
+ let scriptLoadPromises = /* @__PURE__ */ new Map();
1153
+ /**
1154
+ * Loads a script once and reuses the same promise for concurrent callers.
1155
+ * Failed loads are removed so a later call can retry.
1156
+ */
1157
+ function loadScript(e) {
1158
+ let t = scriptLoadPromises.get(e);
1159
+ if (t) return t;
1160
+ let n = new Promise((t, n) => {
1161
+ if (document.querySelector(`script[src="${e}"]`)) return t(true);
1162
+ let r = document.createElement("script");
1163
+ r.src = e;
1164
+ r.onload = t;
1165
+ r.onerror = (t) => {
1166
+ scriptLoadPromises.delete(e);
1167
+ r.remove();
1168
+ n(t);
1169
+ };
1170
+ r.defer = true;
1171
+ document.body.appendChild(r);
1172
+ });
1173
+ scriptLoadPromises.set(e, n);
1174
+ return n;
1516
1175
  }
1517
-
1518
- // src/utils/event-emitter.ts
1176
+ //#endregion
1177
+ //#region src/utils/event-emitter.ts
1178
+ /** Provides synchronous subscription and notification for runtime updates. */
1519
1179
  var EventEmitter = class {
1520
- /** Functions called when an update is emitted. */
1521
- listeners;
1522
- /** Creates an emitter with no listeners. */
1523
- constructor() {
1524
- this.listeners = /* @__PURE__ */ new Set();
1525
- }
1526
- /** Adds a listener and returns a function that removes it. */
1527
- subscribe = (fn) => {
1528
- this.listeners.add(fn);
1529
- return () => this.unsubscribe(fn);
1530
- };
1531
- /** Removes a previously subscribed listener. */
1532
- unsubscribe = (fn) => {
1533
- this.listeners.delete(fn);
1534
- };
1535
- /** Calls every subscribed listener with the supplied data. */
1536
- emit = (data) => {
1537
- for (const fn of this.listeners) {
1538
- fn(data);
1539
- }
1540
- };
1180
+ /** Functions called when an update is emitted. */
1181
+ listeners;
1182
+ /** Creates an emitter with no listeners. */
1183
+ constructor() {
1184
+ this.listeners = /* @__PURE__ */ new Set();
1185
+ }
1186
+ /** Adds a listener and returns a function that removes it. */
1187
+ subscribe = (e) => {
1188
+ this.listeners.add(e);
1189
+ return () => this.unsubscribe(e);
1190
+ };
1191
+ /** Removes a previously subscribed listener. */
1192
+ unsubscribe = (e) => {
1193
+ this.listeners.delete(e);
1194
+ };
1195
+ /** Calls every subscribed listener with the supplied data. */
1196
+ emit = (e) => {
1197
+ for (const t of this.listeners) t(e);
1198
+ };
1541
1199
  };
1542
-
1543
- // src/core.ts
1200
+ //#endregion
1201
+ //#region src/core.ts
1202
+ /** Holds the mutable runtime state for one rendered Weaverse element. */
1544
1203
  var WeaverseItemStore = class extends EventEmitter {
1545
- /** The Core runtime that owns this item. */
1546
- weaverse;
1547
- /** React ref for the element's rendered HTML node. */
1548
- ref = (0, import_react.createRef)();
1549
- /** The current serialized state of the element. */
1550
- _store = { id: "", type: "" };
1551
- /** Creates an item store and registers it with the owning runtime. */
1552
- constructor(initialData, weaverse) {
1553
- super();
1554
- const { type, id } = initialData || {};
1555
- this.weaverse = weaverse;
1556
- if (id && type) {
1557
- Weaverse.itemInstances.set(id, this);
1558
- Object.assign(this._store, initialData);
1559
- } else {
1560
- throw new Error(
1561
- `'id' and 'type' are required to create a new Weaverse item.`
1562
- );
1563
- }
1564
- this._store.css = this.getDefaultCss();
1565
- }
1566
- /** The element's unique identifier. */
1567
- get _id() {
1568
- return this._store.id;
1569
- }
1570
- /** The element's current rendered HTML node, if mounted. */
1571
- get _element() {
1572
- return this.ref.current;
1573
- }
1574
- /** The registered component definition for this element type. */
1575
- get Element() {
1576
- return this.weaverse.elementRegistry.get(this._store.type);
1577
- }
1578
- /** Returns registered default styles merged with the element's saved styles. */
1579
- getDefaultCss = () => {
1580
- const defaultCss = this.Element?.defaultCss || {};
1581
- const currentCss = this._store.css || {};
1582
- return merge(defaultCss, currentCss);
1583
- };
1584
- /**
1585
- * The element's current serialized data. Assigning a value merges it into
1586
- * the existing data.
1587
- */
1588
- get data() {
1589
- return this._store;
1590
- }
1591
- // Setter behavior is documented on the getter, which owns the property's JSDoc.
1592
- set data(update) {
1593
- this._store = { ...this._store, ...update };
1594
- }
1595
- /** Applies an element data update and notifies subscribers. */
1596
- setData = (update) => {
1597
- this.data = update;
1598
- this.triggerUpdate();
1599
- return this.data;
1600
- };
1601
- /** Returns the element's current serialized data. */
1602
- getSnapShot = () => this.data;
1603
- /** Notifies subscribers with the element's current data. */
1604
- triggerUpdate = () => {
1605
- this.emit(this._store);
1606
- };
1204
+ /** The Core runtime that owns this item. */
1205
+ weaverse;
1206
+ /** React ref for the element's rendered HTML node. */
1207
+ ref = (0, import_react.createRef)();
1208
+ /** The current serialized state of the element. */
1209
+ _store = {
1210
+ id: "",
1211
+ type: ""
1212
+ };
1213
+ /** Creates an item store and registers it with the owning runtime. */
1214
+ constructor(e, t) {
1215
+ super();
1216
+ const { type: n, id: r } = e || {};
1217
+ this.weaverse = t;
1218
+ if (r && n) {
1219
+ Weaverse.itemInstances.set(r, this);
1220
+ Object.assign(this._store, e);
1221
+ } else throw new Error(`'id' and 'type' are required to create a new Weaverse item.`);
1222
+ this._store.css = this.getDefaultCss();
1223
+ }
1224
+ /** The element's unique identifier. */
1225
+ get _id() {
1226
+ return this._store.id;
1227
+ }
1228
+ /** The element's current rendered HTML node, if mounted. */
1229
+ get _element() {
1230
+ return this.ref.current;
1231
+ }
1232
+ /** The registered component definition for this element type. */
1233
+ get Element() {
1234
+ return this.weaverse.elementRegistry.get(this._store.type);
1235
+ }
1236
+ /** Returns registered default styles merged with the element's saved styles. */
1237
+ getDefaultCss = () => {
1238
+ return merge(this.Element?.defaultCss || {}, this._store.css || {});
1239
+ };
1240
+ /**
1241
+ * The element's current serialized data. Assigning a value merges it into
1242
+ * the existing data.
1243
+ */
1244
+ get data() {
1245
+ return this._store;
1246
+ }
1247
+ set data(e) {
1248
+ this._store = {
1249
+ ...this._store,
1250
+ ...e
1251
+ };
1252
+ }
1253
+ /** Applies an element data update and notifies subscribers. */
1254
+ setData = (e) => {
1255
+ this.data = e;
1256
+ this.triggerUpdate();
1257
+ return this.data;
1258
+ };
1259
+ /** Returns the element's current serialized data. */
1260
+ getSnapShot = () => this.data;
1261
+ /** Notifies subscribers with the element's current data. */
1262
+ triggerUpdate = () => {
1263
+ this.emit(this._store);
1264
+ };
1607
1265
  };
1608
- var Weaverse = class _Weaverse extends EventEmitter {
1609
- /** The DOM node containing the rendered project, if mounted. */
1610
- contentRootElement = null;
1611
- /** Item stores keyed by element identifier. */
1612
- static itemInstances = /* @__PURE__ */ new Map();
1613
- /** Base URL of the Weaverse Studio host. */
1614
- weaverseHost = "https://studio.weaverse.io";
1615
- /** Version of the Weaverse runtime. */
1616
- weaverseVersion = version;
1617
- /** Version of the installed Core SDK. */
1618
- sdkVersion = version;
1619
- /** Identifier of the project being rendered. */
1620
- projectId = "";
1621
- /** Whether the runtime is connected to Studio design mode. */
1622
- isDesignMode = false;
1623
- /** Whether the runtime is rendering a preview. */
1624
- isPreviewMode = false;
1625
- /** Optional bridge used to communicate with Weaverse Studio. */
1626
- studioBridge;
1627
- /** Component definitions keyed by element type. */
1628
- static elementRegistry = /* @__PURE__ */ new Map();
1629
- /** Media queries used for responsive element styles. */
1630
- static mediaBreakPoints = {
1631
- desktop: "all",
1632
- // max-width need to subtract 0.02px to prevent bug
1633
- // ref: https://getbootstrap.com/docs/5.1/layout/breakpoints/#max-width
1634
- mobile: "(max-width: 767.98px)"
1635
- };
1636
- /** Creates a Core runtime from serialized project data. */
1637
- constructor(params) {
1638
- super();
1639
- for (const param of Object.entries(params)) {
1640
- const [key, value] = param;
1641
- this[key] = value || this[key];
1642
- }
1643
- this.initProject();
1644
- }
1645
- /** Returns the project's current serialized data. */
1646
- getSnapShot = () => this.data;
1647
- /** Creates or updates an item store for every serialized project item. */
1648
- initProject = () => {
1649
- const { data } = this;
1650
- const itemInstances = _Weaverse.itemInstances;
1651
- if (data?.items) {
1652
- for (const item of data.items) {
1653
- const itemInstance = itemInstances.get(item.id);
1654
- if (itemInstance) {
1655
- itemInstance.setData(item);
1656
- } else {
1657
- this.createItemInstance(item);
1658
- }
1659
- }
1660
- }
1661
- };
1662
- /** Item stores keyed by element identifier. */
1663
- get itemInstances() {
1664
- return _Weaverse.itemInstances;
1665
- }
1666
- /** Creates an item store for serialized element data. */
1667
- createItemInstance = (data) => new _Weaverse.ItemConstructor(data, this);
1668
- /** Registers a component definition for an element type. */
1669
- static registerElement = registerElement;
1670
- /** Component definitions keyed by element type. */
1671
- get elementRegistry() {
1672
- return _Weaverse.elementRegistry;
1673
- }
1674
- /** Replaces the project data reference and notifies subscribers. */
1675
- triggerUpdate = () => {
1676
- this.data = { ...this.data };
1677
- this.emit(this.data);
1678
- };
1679
- /** Notifies subscribers of every registered item store. */
1680
- refreshAllItems() {
1681
- for (const item of _Weaverse.itemInstances.values()) {
1682
- item.triggerUpdate();
1683
- }
1684
- }
1685
- /** Replaces the project data and initializes its item stores. */
1686
- setProjectData = (data) => {
1687
- this.data = data;
1688
- this.initProject();
1689
- };
1266
+ /** Coordinates project data, registered elements, and item stores at runtime. */
1267
+ var Weaverse = class Weaverse extends EventEmitter {
1268
+ /** The DOM node containing the rendered project, if mounted. */
1269
+ contentRootElement = null;
1270
+ /** Item stores keyed by element identifier. */
1271
+ static itemInstances = /* @__PURE__ */ new Map();
1272
+ /** Base URL of the Weaverse Studio host. */
1273
+ weaverseHost = "https://studio.weaverse.io";
1274
+ /** Version of the Weaverse runtime. */
1275
+ weaverseVersion = version;
1276
+ /** Version of the installed Core SDK. */
1277
+ sdkVersion = version;
1278
+ /** Identifier of the project being rendered. */
1279
+ projectId = "";
1280
+ /** Whether the runtime is connected to Studio design mode. */
1281
+ isDesignMode = false;
1282
+ /** Whether the runtime is rendering a preview. */
1283
+ isPreviewMode = false;
1284
+ /** Optional bridge used to communicate with Weaverse Studio. */
1285
+ studioBridge;
1286
+ /** Component definitions keyed by element type. */
1287
+ static elementRegistry = /* @__PURE__ */ new Map();
1288
+ /** Media queries used for responsive element styles. */
1289
+ static mediaBreakPoints = {
1290
+ desktop: "all",
1291
+ mobile: "(max-width: 767.98px)"
1292
+ };
1293
+ /** Creates a Core runtime from serialized project data. */
1294
+ constructor(e) {
1295
+ super();
1296
+ for (const t of Object.entries(e)) {
1297
+ const [e, n] = t;
1298
+ this[e] = n || this[e];
1299
+ }
1300
+ this.initProject();
1301
+ }
1302
+ /** Returns the project's current serialized data. */
1303
+ getSnapShot = () => this.data;
1304
+ /** Creates or updates an item store for every serialized project item. */
1305
+ initProject = () => {
1306
+ const { data: e } = this;
1307
+ const t = Weaverse.itemInstances;
1308
+ if (e?.items) for (const n of e.items) {
1309
+ const e = t.get(n.id);
1310
+ if (e) e.setData(n);
1311
+ else this.createItemInstance(n);
1312
+ }
1313
+ };
1314
+ /** Item stores keyed by element identifier. */
1315
+ get itemInstances() {
1316
+ return Weaverse.itemInstances;
1317
+ }
1318
+ /** Creates an item store for serialized element data. */
1319
+ createItemInstance = (e) => new Weaverse.ItemConstructor(e, this);
1320
+ /** Registers a component definition for an element type. */
1321
+ static registerElement = registerElement;
1322
+ /** Component definitions keyed by element type. */
1323
+ get elementRegistry() {
1324
+ return Weaverse.elementRegistry;
1325
+ }
1326
+ /** Replaces the project data reference and notifies subscribers. */
1327
+ triggerUpdate = () => {
1328
+ this.data = { ...this.data };
1329
+ this.emit(this.data);
1330
+ };
1331
+ /** Notifies subscribers of every registered item store. */
1332
+ refreshAllItems() {
1333
+ for (const e of Weaverse.itemInstances.values()) e.triggerUpdate();
1334
+ }
1335
+ /** Replaces the project data and initializes its item stores. */
1336
+ setProjectData = (e) => {
1337
+ this.data = e;
1338
+ this.initProject();
1339
+ };
1690
1340
  };
1691
- function registerElement(element) {
1692
- if (element?.type) {
1693
- if (!Weaverse.elementRegistry.has(element.type)) {
1694
- Weaverse.elementRegistry.set(element?.type, element);
1695
- }
1696
- } else {
1697
- console.error("Cannot register element without 'type'.");
1698
- }
1341
+ /** Registers a component definition for its declared element type. */
1342
+ function registerElement(e) {
1343
+ if (e?.type) {
1344
+ if (!Weaverse.elementRegistry.has(e.type)) Weaverse.elementRegistry.set(e?.type, e);
1345
+ } else console.error("Cannot register element without 'type'.");
1699
1346
  }
1700
- // Annotate the CommonJS export names for ESM import in node:
1701
- 0 && (module.exports = {
1702
- EventEmitter,
1703
- Weaverse,
1704
- WeaverseItemStore,
1705
- isBrowser,
1706
- isIframe,
1707
- isReactNative,
1708
- loadScript,
1709
- merge,
1710
- registerElement
1711
- });
1712
- /*! Bundled license information:
1347
+ //#endregion
1348
+ exports.EventEmitter = EventEmitter;
1349
+ exports.Weaverse = Weaverse;
1350
+ exports.WeaverseItemStore = WeaverseItemStore;
1351
+ exports.isBrowser = isBrowser;
1352
+ exports.isIframe = isIframe;
1353
+ exports.isReactNative = isReactNative;
1354
+ exports.loadScript = loadScript;
1355
+ exports.merge = merge;
1356
+ exports.registerElement = registerElement;
1713
1357
 
1714
- react/cjs/react.production.js:
1715
- (**
1716
- * @license React
1717
- * react.production.js
1718
- *
1719
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1720
- *
1721
- * This source code is licensed under the MIT license found in the
1722
- * LICENSE file in the root directory of this source tree.
1723
- *)
1724
-
1725
- react/cjs/react.development.js:
1726
- (**
1727
- * @license React
1728
- * react.development.js
1729
- *
1730
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1731
- *
1732
- * This source code is licensed under the MIT license found in the
1733
- * LICENSE file in the root directory of this source tree.
1734
- *)
1735
- */
1736
1358
  //# sourceMappingURL=index.js.map