@weasel-js/kernel3d 1.9.3 → 1.9.4

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,1489 +1,8 @@
1
1
  import { lookAt, multiply, perspective, quatIdentity, compose, transformAabb, invert, transformPoint, normalize, sub, transformPoint4, intersectRayAabb, intersectRayPlane, len, add, scale, dot } from '@weasel-js/geom/3d';
2
2
  import { resolveOverlays, defineTool } from '@weasel-js/core';
3
+ import { useMemo } from 'react';
3
4
 
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __commonJS = (cb, mod) => function __require() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- __defProp(target, "default", { value: mod, enumerable: true }) ,
27
- mod
28
- ));
29
-
30
- // ../../node_modules/react/cjs/react.production.js
31
- var require_react_production = __commonJS({
32
- "../../node_modules/react/cjs/react.production.js"(exports) {
33
- var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
34
- var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
35
- var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
36
- var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
37
- var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
38
- var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
39
- var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
40
- var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
41
- var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
42
- var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
43
- var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
44
- var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
45
- var REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition");
46
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
47
- function getIteratorFn(maybeIterable) {
48
- if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
49
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
50
- return "function" === typeof maybeIterable ? maybeIterable : null;
51
- }
52
- var ReactNoopUpdateQueue = {
53
- isMounted: function() {
54
- return false;
55
- },
56
- enqueueForceUpdate: function() {
57
- },
58
- enqueueReplaceState: function() {
59
- },
60
- enqueueSetState: function() {
61
- }
62
- };
63
- var assign = Object.assign;
64
- var emptyObject = {};
65
- function Component(props, context, updater) {
66
- this.props = props;
67
- this.context = context;
68
- this.refs = emptyObject;
69
- this.updater = updater || ReactNoopUpdateQueue;
70
- }
71
- Component.prototype.isReactComponent = {};
72
- Component.prototype.setState = function(partialState, callback) {
73
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
74
- throw Error(
75
- "takes an object of state variables to update or a function which returns an object of state variables."
76
- );
77
- this.updater.enqueueSetState(this, partialState, callback, "setState");
78
- };
79
- Component.prototype.forceUpdate = function(callback) {
80
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
81
- };
82
- function ComponentDummy() {
83
- }
84
- ComponentDummy.prototype = Component.prototype;
85
- function PureComponent(props, context, updater) {
86
- this.props = props;
87
- this.context = context;
88
- this.refs = emptyObject;
89
- this.updater = updater || ReactNoopUpdateQueue;
90
- }
91
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
92
- pureComponentPrototype.constructor = PureComponent;
93
- assign(pureComponentPrototype, Component.prototype);
94
- pureComponentPrototype.isPureReactComponent = true;
95
- var isArrayImpl = Array.isArray;
96
- function noop() {
97
- }
98
- var ReactSharedInternals = { H: null, A: null, T: null, S: null };
99
- var hasOwnProperty = Object.prototype.hasOwnProperty;
100
- function ReactElement(type, key, props) {
101
- var refProp = props.ref;
102
- return {
103
- $$typeof: REACT_ELEMENT_TYPE,
104
- type,
105
- key,
106
- ref: void 0 !== refProp ? refProp : null,
107
- props
108
- };
109
- }
110
- function cloneAndReplaceKey(oldElement, newKey) {
111
- return ReactElement(oldElement.type, newKey, oldElement.props);
112
- }
113
- function isValidElement(object) {
114
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
115
- }
116
- function escape(key) {
117
- var escaperLookup = { "=": "=0", ":": "=2" };
118
- return "$" + key.replace(/[=:]/g, function(match) {
119
- return escaperLookup[match];
120
- });
121
- }
122
- var userProvidedKeyEscapeRegex = /\/+/g;
123
- function getElementKey(element, index) {
124
- return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
125
- }
126
- function resolveThenable(thenable) {
127
- switch (thenable.status) {
128
- case "fulfilled":
129
- return thenable.value;
130
- case "rejected":
131
- throw thenable.reason;
132
- default:
133
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
134
- function(fulfilledValue) {
135
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
136
- },
137
- function(error) {
138
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
139
- }
140
- )), thenable.status) {
141
- case "fulfilled":
142
- return thenable.value;
143
- case "rejected":
144
- throw thenable.reason;
145
- }
146
- }
147
- throw thenable;
148
- }
149
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
150
- var type = typeof children;
151
- if ("undefined" === type || "boolean" === type) children = null;
152
- var invokeCallback = false;
153
- if (null === children) invokeCallback = true;
154
- else
155
- switch (type) {
156
- case "bigint":
157
- case "string":
158
- case "number":
159
- invokeCallback = true;
160
- break;
161
- case "object":
162
- switch (children.$$typeof) {
163
- case REACT_ELEMENT_TYPE:
164
- case REACT_PORTAL_TYPE:
165
- invokeCallback = true;
166
- break;
167
- case REACT_LAZY_TYPE:
168
- return invokeCallback = children._init, mapIntoArray(
169
- invokeCallback(children._payload),
170
- array,
171
- escapedPrefix,
172
- nameSoFar,
173
- callback
174
- );
175
- }
176
- }
177
- if (invokeCallback)
178
- 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) {
179
- return c;
180
- })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
181
- callback,
182
- escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
183
- userProvidedKeyEscapeRegex,
184
- "$&/"
185
- ) + "/") + invokeCallback
186
- )), array.push(callback)), 1;
187
- invokeCallback = 0;
188
- var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
189
- if (isArrayImpl(children))
190
- for (var i = 0; i < children.length; i++)
191
- nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
192
- nameSoFar,
193
- array,
194
- escapedPrefix,
195
- type,
196
- callback
197
- );
198
- else if (i = getIteratorFn(children), "function" === typeof i)
199
- for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
200
- nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
201
- nameSoFar,
202
- array,
203
- escapedPrefix,
204
- type,
205
- callback
206
- );
207
- else if ("object" === type) {
208
- if ("function" === typeof children.then)
209
- return mapIntoArray(
210
- resolveThenable(children),
211
- array,
212
- escapedPrefix,
213
- nameSoFar,
214
- callback
215
- );
216
- array = String(children);
217
- throw Error(
218
- "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."
219
- );
220
- }
221
- return invokeCallback;
222
- }
223
- function mapChildren(children, func, context) {
224
- if (null == children) return children;
225
- var result = [], count = 0;
226
- mapIntoArray(children, result, "", "", function(child) {
227
- return func.call(context, child, count++);
228
- });
229
- return result;
230
- }
231
- function lazyInitializer(payload) {
232
- if (-1 === payload._status) {
233
- var ctor = payload._result, thenable = ctor();
234
- thenable.then(
235
- function(moduleObject) {
236
- if (0 === payload._status || -1 === payload._status)
237
- payload._status = 1, payload._result = moduleObject, void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
238
- },
239
- function(error) {
240
- if (0 === payload._status || -1 === payload._status)
241
- payload._status = 2, payload._result = error, void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
242
- }
243
- );
244
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
245
- }
246
- if (1 === payload._status) return payload._result.default;
247
- throw payload._result;
248
- }
249
- var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
250
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
251
- var event = new window.ErrorEvent("error", {
252
- bubbles: true,
253
- cancelable: true,
254
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
255
- error
256
- });
257
- if (!window.dispatchEvent(event)) return;
258
- } else if ("object" === typeof process && "function" === typeof process.emit) {
259
- process.emit("uncaughtException", error);
260
- return;
261
- }
262
- console.error(error);
263
- };
264
- function startTransition(scope) {
265
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
266
- currentTransition.types = null !== prevTransition ? prevTransition.types : null;
267
- ReactSharedInternals.T = currentTransition;
268
- try {
269
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
270
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
271
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
272
- } catch (error) {
273
- reportGlobalError(error);
274
- } finally {
275
- null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
276
- }
277
- }
278
- function addTransitionType(type) {
279
- var transition = ReactSharedInternals.T;
280
- if (null !== transition) {
281
- var transitionTypes = transition.types;
282
- null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
283
- } else startTransition(addTransitionType.bind(null, type));
284
- }
285
- var Children = {
286
- map: mapChildren,
287
- forEach: function(children, forEachFunc, forEachContext) {
288
- mapChildren(
289
- children,
290
- function() {
291
- forEachFunc.apply(this, arguments);
292
- },
293
- forEachContext
294
- );
295
- },
296
- count: function(children) {
297
- var n = 0;
298
- mapChildren(children, function() {
299
- n++;
300
- });
301
- return n;
302
- },
303
- toArray: function(children) {
304
- return mapChildren(children, function(child) {
305
- return child;
306
- }) || [];
307
- },
308
- only: function(children) {
309
- if (!isValidElement(children))
310
- throw Error(
311
- "React.Children.only expected to receive a single React element child."
312
- );
313
- return children;
314
- }
315
- };
316
- exports.Activity = REACT_ACTIVITY_TYPE;
317
- exports.Children = Children;
318
- exports.Component = Component;
319
- exports.Fragment = REACT_FRAGMENT_TYPE;
320
- exports.Profiler = REACT_PROFILER_TYPE;
321
- exports.PureComponent = PureComponent;
322
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
323
- exports.Suspense = REACT_SUSPENSE_TYPE;
324
- exports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
325
- exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
326
- exports.__COMPILER_RUNTIME = {
327
- __proto__: null,
328
- c: function(size) {
329
- return ReactSharedInternals.H.useMemoCache(size);
330
- }
331
- };
332
- exports.addTransitionType = addTransitionType;
333
- exports.cache = function(fn) {
334
- return function() {
335
- return fn.apply(null, arguments);
336
- };
337
- };
338
- exports.cacheSignal = function() {
339
- return null;
340
- };
341
- exports.cloneElement = function(element, config, children) {
342
- if (null === element || void 0 === element)
343
- throw Error(
344
- "The argument must be a React element, but you passed " + element + "."
345
- );
346
- var props = assign({}, element.props), key = element.key;
347
- if (null != config)
348
- for (propName in void 0 !== config.key && (key = "" + config.key), config)
349
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
350
- var propName = arguments.length - 2;
351
- if (1 === propName) props.children = children;
352
- else if (1 < propName) {
353
- for (var childArray = Array(propName), i = 0; i < propName; i++)
354
- childArray[i] = arguments[i + 2];
355
- props.children = childArray;
356
- }
357
- return ReactElement(element.type, key, props);
358
- };
359
- exports.createContext = function(defaultValue) {
360
- defaultValue = {
361
- $$typeof: REACT_CONTEXT_TYPE,
362
- _currentValue: defaultValue,
363
- _currentValue2: defaultValue,
364
- _threadCount: 0,
365
- Provider: null,
366
- Consumer: null
367
- };
368
- defaultValue.Provider = defaultValue;
369
- defaultValue.Consumer = {
370
- $$typeof: REACT_CONSUMER_TYPE,
371
- _context: defaultValue
372
- };
373
- return defaultValue;
374
- };
375
- exports.createElement = function(type, config, children) {
376
- var propName, props = {}, key = null;
377
- if (null != config)
378
- for (propName in void 0 !== config.key && (key = "" + config.key), config)
379
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
380
- var childrenLength = arguments.length - 2;
381
- if (1 === childrenLength) props.children = children;
382
- else if (1 < childrenLength) {
383
- for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
384
- childArray[i] = arguments[i + 2];
385
- props.children = childArray;
386
- }
387
- if (type && type.defaultProps)
388
- for (propName in childrenLength = type.defaultProps, childrenLength)
389
- void 0 === props[propName] && (props[propName] = childrenLength[propName]);
390
- return ReactElement(type, key, props);
391
- };
392
- exports.createRef = function() {
393
- return { current: null };
394
- };
395
- exports.forwardRef = function(render) {
396
- return { $$typeof: REACT_FORWARD_REF_TYPE, render };
397
- };
398
- exports.isValidElement = isValidElement;
399
- exports.lazy = function(ctor) {
400
- return {
401
- $$typeof: REACT_LAZY_TYPE,
402
- _payload: { _status: -1, _result: ctor },
403
- _init: lazyInitializer
404
- };
405
- };
406
- exports.memo = function(type, compare) {
407
- return {
408
- $$typeof: REACT_MEMO_TYPE,
409
- type,
410
- compare: void 0 === compare ? null : compare
411
- };
412
- };
413
- exports.startTransition = startTransition;
414
- exports.unstable_useCacheRefresh = function() {
415
- return ReactSharedInternals.H.useCacheRefresh();
416
- };
417
- exports.use = function(usable) {
418
- return ReactSharedInternals.H.use(usable);
419
- };
420
- exports.useActionState = function(action, initialState, permalink) {
421
- return ReactSharedInternals.H.useActionState(action, initialState, permalink);
422
- };
423
- exports.useCallback = function(callback, deps) {
424
- return ReactSharedInternals.H.useCallback(callback, deps);
425
- };
426
- exports.useContext = function(Context) {
427
- return ReactSharedInternals.H.useContext(Context);
428
- };
429
- exports.useDebugValue = function() {
430
- };
431
- exports.useDeferredValue = function(value, initialValue) {
432
- return ReactSharedInternals.H.useDeferredValue(value, initialValue);
433
- };
434
- exports.useEffect = function(create, deps) {
435
- return ReactSharedInternals.H.useEffect(create, deps);
436
- };
437
- exports.useEffectEvent = function(callback) {
438
- return ReactSharedInternals.H.useEffectEvent(callback);
439
- };
440
- exports.useId = function() {
441
- return ReactSharedInternals.H.useId();
442
- };
443
- exports.useImperativeHandle = function(ref, create, deps) {
444
- return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
445
- };
446
- exports.useInsertionEffect = function(create, deps) {
447
- return ReactSharedInternals.H.useInsertionEffect(create, deps);
448
- };
449
- exports.useLayoutEffect = function(create, deps) {
450
- return ReactSharedInternals.H.useLayoutEffect(create, deps);
451
- };
452
- exports.useMemo = function(create, deps) {
453
- return ReactSharedInternals.H.useMemo(create, deps);
454
- };
455
- exports.useOptimistic = function(passthrough, reducer) {
456
- return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
457
- };
458
- exports.useReducer = function(reducer, initialArg, init) {
459
- return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
460
- };
461
- exports.useRef = function(initialValue) {
462
- return ReactSharedInternals.H.useRef(initialValue);
463
- };
464
- exports.useState = function(initialState) {
465
- return ReactSharedInternals.H.useState(initialState);
466
- };
467
- exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
468
- return ReactSharedInternals.H.useSyncExternalStore(
469
- subscribe,
470
- getSnapshot,
471
- getServerSnapshot
472
- );
473
- };
474
- exports.useTransition = function() {
475
- return ReactSharedInternals.H.useTransition();
476
- };
477
- exports.version = "19.3.0";
478
- }
479
- });
480
-
481
- // ../../node_modules/react/cjs/react.development.js
482
- var require_react_development = __commonJS({
483
- "../../node_modules/react/cjs/react.development.js"(exports, module) {
484
- "production" !== process.env.NODE_ENV && (function() {
485
- function defineDeprecationWarning(methodName, info) {
486
- Object.defineProperty(Component.prototype, methodName, {
487
- get: function() {
488
- console.warn(
489
- "%s(...) is deprecated in plain JavaScript React classes. %s",
490
- info[0],
491
- info[1]
492
- );
493
- }
494
- });
495
- }
496
- function getIteratorFn(maybeIterable) {
497
- if (null === maybeIterable || "object" !== typeof maybeIterable)
498
- return null;
499
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
500
- return "function" === typeof maybeIterable ? maybeIterable : null;
501
- }
502
- function warnNoop(publicInstance, callerName) {
503
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
504
- var warningKey = publicInstance + "." + callerName;
505
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
506
- "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.",
507
- callerName,
508
- publicInstance
509
- ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
510
- }
511
- function Component(props, context, updater) {
512
- this.props = props;
513
- this.context = context;
514
- this.refs = emptyObject;
515
- this.updater = updater || ReactNoopUpdateQueue;
516
- }
517
- function ComponentDummy() {
518
- }
519
- function PureComponent(props, context, updater) {
520
- this.props = props;
521
- this.context = context;
522
- this.refs = emptyObject;
523
- this.updater = updater || ReactNoopUpdateQueue;
524
- }
525
- function noop() {
526
- }
527
- function testStringCoercion(value) {
528
- return "" + value;
529
- }
530
- function checkKeyStringCoercion(value) {
531
- try {
532
- testStringCoercion(value);
533
- var JSCompiler_inline_result = false;
534
- } catch (e) {
535
- JSCompiler_inline_result = true;
536
- }
537
- if (JSCompiler_inline_result) {
538
- JSCompiler_inline_result = console;
539
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
540
- var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
541
- JSCompiler_temp_const.call(
542
- JSCompiler_inline_result,
543
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
544
- JSCompiler_inline_result$jscomp$0
545
- );
546
- return testStringCoercion(value);
547
- }
548
- }
549
- function getComponentNameFromType(type) {
550
- if (null == type) return null;
551
- if ("function" === typeof type)
552
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
553
- if ("string" === typeof type) return type;
554
- switch (type) {
555
- case REACT_FRAGMENT_TYPE:
556
- return "Fragment";
557
- case REACT_PROFILER_TYPE:
558
- return "Profiler";
559
- case REACT_STRICT_MODE_TYPE:
560
- return "StrictMode";
561
- case REACT_SUSPENSE_TYPE:
562
- return "Suspense";
563
- case REACT_SUSPENSE_LIST_TYPE:
564
- return "SuspenseList";
565
- case REACT_ACTIVITY_TYPE:
566
- return "Activity";
567
- case REACT_VIEW_TRANSITION_TYPE:
568
- return "ViewTransition";
569
- }
570
- if ("object" === typeof type)
571
- switch ("number" === typeof type.tag && console.error(
572
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
573
- ), type.$$typeof) {
574
- case REACT_PORTAL_TYPE:
575
- return "Portal";
576
- case REACT_CONTEXT_TYPE:
577
- return type.displayName || "Context";
578
- case REACT_CONSUMER_TYPE:
579
- return (type._context.displayName || "Context") + ".Consumer";
580
- case REACT_FORWARD_REF_TYPE:
581
- var innerType = type.render;
582
- type = type.displayName;
583
- type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
584
- return type;
585
- case REACT_MEMO_TYPE:
586
- return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
587
- case REACT_LAZY_TYPE:
588
- innerType = type._payload;
589
- type = type._init;
590
- try {
591
- return getComponentNameFromType(type(innerType));
592
- } catch (x) {
593
- }
594
- }
595
- return null;
596
- }
597
- function getTaskName(type) {
598
- if (type === REACT_FRAGMENT_TYPE) return "<>";
599
- if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
600
- return "<...>";
601
- try {
602
- var name = getComponentNameFromType(type);
603
- return name ? "<" + name + ">" : "<...>";
604
- } catch (x) {
605
- return "<...>";
606
- }
607
- }
608
- function getOwner() {
609
- var dispatcher = ReactSharedInternals.A;
610
- return null === dispatcher ? null : dispatcher.getOwner();
611
- }
612
- function UnknownOwner() {
613
- return Error("react-stack-top-frame");
614
- }
615
- function hasValidKey(config) {
616
- if (hasOwnProperty.call(config, "key")) {
617
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
618
- if (getter && getter.isReactWarning) return false;
619
- }
620
- return void 0 !== config.key;
621
- }
622
- function defineKeyPropWarningGetter(props, displayName) {
623
- function warnAboutAccessingKey() {
624
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
625
- "%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)",
626
- displayName
627
- ));
628
- }
629
- warnAboutAccessingKey.isReactWarning = true;
630
- Object.defineProperty(props, "key", {
631
- get: warnAboutAccessingKey,
632
- configurable: true
633
- });
634
- }
635
- function elementRefGetterWithDeprecationWarning() {
636
- var componentName = getComponentNameFromType(this.type);
637
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
638
- "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."
639
- ));
640
- componentName = this.props.ref;
641
- return void 0 !== componentName ? componentName : null;
642
- }
643
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
644
- var refProp = props.ref;
645
- type = {
646
- $$typeof: REACT_ELEMENT_TYPE,
647
- type,
648
- key,
649
- props,
650
- _owner: owner
651
- };
652
- null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
653
- enumerable: false,
654
- get: elementRefGetterWithDeprecationWarning
655
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
656
- type._store = {};
657
- Object.defineProperty(type._store, "validated", {
658
- configurable: false,
659
- enumerable: false,
660
- writable: true,
661
- value: 0
662
- });
663
- Object.defineProperty(type, "_debugInfo", {
664
- configurable: false,
665
- enumerable: false,
666
- writable: true,
667
- value: null
668
- });
669
- Object.defineProperty(type, "_debugStack", {
670
- configurable: false,
671
- enumerable: false,
672
- writable: true,
673
- value: debugStack
674
- });
675
- Object.defineProperty(type, "_debugTask", {
676
- configurable: false,
677
- enumerable: false,
678
- writable: true,
679
- value: debugTask
680
- });
681
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
682
- return type;
683
- }
684
- function cloneAndReplaceKey(oldElement, newKey) {
685
- newKey = ReactElement(
686
- oldElement.type,
687
- newKey,
688
- oldElement.props,
689
- oldElement._owner,
690
- oldElement._debugStack,
691
- oldElement._debugTask
692
- );
693
- oldElement._store && (newKey._store.validated = oldElement._store.validated);
694
- return newKey;
695
- }
696
- function validateChildKeys(node) {
697
- 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));
698
- }
699
- function isValidElement(object) {
700
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
701
- }
702
- function escape(key) {
703
- var escaperLookup = { "=": "=0", ":": "=2" };
704
- return "$" + key.replace(/[=:]/g, function(match) {
705
- return escaperLookup[match];
706
- });
707
- }
708
- function getElementKey(element, index) {
709
- return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
710
- }
711
- function resolveThenable(thenable) {
712
- switch (thenable.status) {
713
- case "fulfilled":
714
- return thenable.value;
715
- case "rejected":
716
- throw thenable.reason;
717
- default:
718
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
719
- function(fulfilledValue) {
720
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
721
- },
722
- function(error) {
723
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
724
- }
725
- )), thenable.status) {
726
- case "fulfilled":
727
- return thenable.value;
728
- case "rejected":
729
- throw thenable.reason;
730
- }
731
- }
732
- throw thenable;
733
- }
734
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
735
- var type = typeof children;
736
- if ("undefined" === type || "boolean" === type) children = null;
737
- var invokeCallback = false;
738
- if (null === children) invokeCallback = true;
739
- else
740
- switch (type) {
741
- case "bigint":
742
- case "string":
743
- case "number":
744
- invokeCallback = true;
745
- break;
746
- case "object":
747
- switch (children.$$typeof) {
748
- case REACT_ELEMENT_TYPE:
749
- case REACT_PORTAL_TYPE:
750
- invokeCallback = true;
751
- break;
752
- case REACT_LAZY_TYPE:
753
- return invokeCallback = children._init, mapIntoArray(
754
- invokeCallback(children._payload),
755
- array,
756
- escapedPrefix,
757
- nameSoFar,
758
- callback
759
- );
760
- }
761
- }
762
- if (invokeCallback) {
763
- invokeCallback = children;
764
- callback = callback(invokeCallback);
765
- var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
766
- isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
767
- return c;
768
- })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
769
- callback,
770
- escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
771
- userProvidedKeyEscapeRegex,
772
- "$&/"
773
- ) + "/") + childKey
774
- ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
775
- return 1;
776
- }
777
- invokeCallback = 0;
778
- childKey = "" === nameSoFar ? "." : nameSoFar + ":";
779
- if (isArrayImpl(children))
780
- for (var i = 0; i < children.length; i++)
781
- nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
782
- nameSoFar,
783
- array,
784
- escapedPrefix,
785
- type,
786
- callback
787
- );
788
- else if (i = getIteratorFn(children), "function" === typeof i)
789
- for (i === children.entries && (didWarnAboutMaps || console.warn(
790
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
791
- ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
792
- nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
793
- nameSoFar,
794
- array,
795
- escapedPrefix,
796
- type,
797
- callback
798
- );
799
- else if ("object" === type) {
800
- if ("function" === typeof children.then)
801
- return mapIntoArray(
802
- resolveThenable(children),
803
- array,
804
- escapedPrefix,
805
- nameSoFar,
806
- callback
807
- );
808
- array = String(children);
809
- throw Error(
810
- "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."
811
- );
812
- }
813
- return invokeCallback;
814
- }
815
- function mapChildren(children, func, context) {
816
- if (null == children) return children;
817
- var result = [], count = 0;
818
- mapIntoArray(children, result, "", "", function(child) {
819
- return func.call(context, child, count++);
820
- });
821
- return result;
822
- }
823
- function lazyInitializer(payload) {
824
- if (-1 === payload._status) {
825
- var resolveDebugValue = null, rejectDebugValue = null, ioInfo = payload._ioInfo;
826
- null != ioInfo && (ioInfo.start = ioInfo.end = performance.now(), ioInfo.value = new Promise(function(resolve, reject) {
827
- resolveDebugValue = resolve;
828
- rejectDebugValue = reject;
829
- }));
830
- ioInfo = payload._result;
831
- var thenable = ioInfo();
832
- thenable.then(
833
- function(moduleObject) {
834
- if (0 === payload._status || -1 === payload._status) {
835
- payload._status = 1;
836
- payload._result = moduleObject;
837
- var _ioInfo = payload._ioInfo;
838
- if (null != _ioInfo) {
839
- _ioInfo.end = performance.now();
840
- var debugValue = null == moduleObject ? void 0 : moduleObject.default;
841
- resolveDebugValue(debugValue);
842
- _ioInfo.value.status = "fulfilled";
843
- _ioInfo.value.value = debugValue;
844
- }
845
- void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
846
- }
847
- },
848
- function(error) {
849
- if (0 === payload._status || -1 === payload._status) {
850
- payload._status = 2;
851
- payload._result = error;
852
- var _ioInfo2 = payload._ioInfo;
853
- null != _ioInfo2 && (_ioInfo2.end = performance.now(), _ioInfo2.value.then(noop, noop), rejectDebugValue(error), _ioInfo2.value.status = "rejected", _ioInfo2.value.reason = error);
854
- void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
855
- }
856
- }
857
- );
858
- ioInfo = payload._ioInfo;
859
- if (null != ioInfo) {
860
- var displayName = thenable.displayName;
861
- "string" === typeof displayName && (ioInfo.name = displayName);
862
- }
863
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
864
- }
865
- if (1 === payload._status)
866
- return ioInfo = payload._result, void 0 === ioInfo && console.error(
867
- "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?",
868
- ioInfo
869
- ), "default" in ioInfo || console.error(
870
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
871
- ioInfo
872
- ), ioInfo.default;
873
- throw payload._result;
874
- }
875
- function resolveDispatcher() {
876
- var dispatcher = ReactSharedInternals.H;
877
- null === dispatcher && console.error(
878
- "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."
879
- );
880
- return dispatcher;
881
- }
882
- function releaseAsyncTransition() {
883
- ReactSharedInternals.asyncTransitions--;
884
- }
885
- function startTransition(scope) {
886
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
887
- currentTransition.types = null !== prevTransition ? prevTransition.types : null;
888
- currentTransition._updatedFibers = /* @__PURE__ */ new Set();
889
- ReactSharedInternals.T = currentTransition;
890
- try {
891
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
892
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
893
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
894
- } catch (error) {
895
- reportGlobalError(error);
896
- } finally {
897
- null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
898
- "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."
899
- )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
900
- "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."
901
- ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
902
- }
903
- }
904
- function addTransitionType(type) {
905
- var transition = ReactSharedInternals.T;
906
- if (null !== transition) {
907
- var transitionTypes = transition.types;
908
- null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
909
- } else
910
- 0 === ReactSharedInternals.asyncTransitions && console.error(
911
- "addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
912
- ), startTransition(addTransitionType.bind(null, type));
913
- }
914
- function enqueueTask(task) {
915
- if (null === enqueueTaskImpl)
916
- try {
917
- var requireString = ("require" + Math.random()).slice(0, 7);
918
- enqueueTaskImpl = (module && module[requireString]).call(
919
- module,
920
- "timers"
921
- ).setImmediate;
922
- } catch (_err) {
923
- enqueueTaskImpl = function(callback) {
924
- false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
925
- "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."
926
- ));
927
- var channel = new MessageChannel();
928
- channel.port1.onmessage = callback;
929
- channel.port2.postMessage(void 0);
930
- };
931
- }
932
- return enqueueTaskImpl(task);
933
- }
934
- function aggregateErrors(errors) {
935
- return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
936
- }
937
- function popActScope(prevActQueue, prevActScopeDepth) {
938
- prevActScopeDepth !== actScopeDepth - 1 && console.error(
939
- "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
940
- );
941
- actScopeDepth = prevActScopeDepth;
942
- }
943
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
944
- var queue = ReactSharedInternals.actQueue;
945
- if (null !== queue)
946
- if (0 !== queue.length)
947
- try {
948
- flushActQueue(queue);
949
- enqueueTask(function() {
950
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
951
- });
952
- return;
953
- } catch (error) {
954
- ReactSharedInternals.thrownErrors.push(error);
955
- }
956
- else ReactSharedInternals.actQueue = null;
957
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
958
- }
959
- function flushActQueue(queue) {
960
- if (!isFlushing) {
961
- isFlushing = true;
962
- var i = 0;
963
- try {
964
- for (; i < queue.length; i++) {
965
- var callback = queue[i];
966
- do {
967
- ReactSharedInternals.didUsePromise = false;
968
- var continuation = callback(false);
969
- if (null !== continuation) {
970
- if (ReactSharedInternals.didUsePromise) {
971
- queue[i] = callback;
972
- queue.splice(0, i);
973
- return;
974
- }
975
- callback = continuation;
976
- } else break;
977
- } while (1);
978
- }
979
- queue.length = 0;
980
- } catch (error) {
981
- queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
982
- } finally {
983
- isFlushing = false;
984
- }
985
- }
986
- }
987
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
988
- 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"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
989
- isMounted: function() {
990
- return false;
991
- },
992
- enqueueForceUpdate: function(publicInstance) {
993
- warnNoop(publicInstance, "forceUpdate");
994
- },
995
- enqueueReplaceState: function(publicInstance) {
996
- warnNoop(publicInstance, "replaceState");
997
- },
998
- enqueueSetState: function(publicInstance) {
999
- warnNoop(publicInstance, "setState");
1000
- }
1001
- }, assign = Object.assign, emptyObject = {};
1002
- Object.freeze(emptyObject);
1003
- Component.prototype.isReactComponent = {};
1004
- Component.prototype.setState = function(partialState, callback) {
1005
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
1006
- throw Error(
1007
- "takes an object of state variables to update or a function which returns an object of state variables."
1008
- );
1009
- this.updater.enqueueSetState(this, partialState, callback, "setState");
1010
- };
1011
- Component.prototype.forceUpdate = function(callback) {
1012
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1013
- };
1014
- var deprecatedAPIs = {
1015
- isMounted: [
1016
- "isMounted",
1017
- "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1018
- ],
1019
- replaceState: [
1020
- "replaceState",
1021
- "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1022
- ]
1023
- };
1024
- for (fnName in deprecatedAPIs)
1025
- deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1026
- ComponentDummy.prototype = Component.prototype;
1027
- deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1028
- deprecatedAPIs.constructor = PureComponent;
1029
- assign(deprecatedAPIs, Component.prototype);
1030
- deprecatedAPIs.isPureReactComponent = true;
1031
- var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
1032
- H: null,
1033
- A: null,
1034
- T: null,
1035
- S: null,
1036
- actQueue: null,
1037
- asyncTransitions: 0,
1038
- isBatchingLegacy: false,
1039
- didScheduleLegacyUpdate: false,
1040
- didUsePromise: false,
1041
- thrownErrors: [],
1042
- getCurrentStack: null,
1043
- recentlyCreatedOwnerStacks: 0
1044
- }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
1045
- return null;
1046
- };
1047
- deprecatedAPIs = {
1048
- react_stack_bottom_frame: function(callStackForError) {
1049
- return callStackForError();
1050
- }
1051
- };
1052
- var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1053
- var didWarnAboutElementRef = {};
1054
- var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1055
- deprecatedAPIs,
1056
- UnknownOwner
1057
- )();
1058
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1059
- var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1060
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1061
- var event = new window.ErrorEvent("error", {
1062
- bubbles: true,
1063
- cancelable: true,
1064
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1065
- error
1066
- });
1067
- if (!window.dispatchEvent(event)) return;
1068
- } else if ("object" === typeof process && "function" === typeof process.emit) {
1069
- process.emit("uncaughtException", error);
1070
- return;
1071
- }
1072
- console.error(error);
1073
- }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1074
- queueMicrotask(function() {
1075
- return queueMicrotask(callback);
1076
- });
1077
- } : enqueueTask;
1078
- deprecatedAPIs = Object.freeze({
1079
- __proto__: null,
1080
- c: function(size) {
1081
- return resolveDispatcher().useMemoCache(size);
1082
- }
1083
- });
1084
- var fnName = {
1085
- map: mapChildren,
1086
- forEach: function(children, forEachFunc, forEachContext) {
1087
- mapChildren(
1088
- children,
1089
- function() {
1090
- forEachFunc.apply(this, arguments);
1091
- },
1092
- forEachContext
1093
- );
1094
- },
1095
- count: function(children) {
1096
- var n = 0;
1097
- mapChildren(children, function() {
1098
- n++;
1099
- });
1100
- return n;
1101
- },
1102
- toArray: function(children) {
1103
- return mapChildren(children, function(child) {
1104
- return child;
1105
- }) || [];
1106
- },
1107
- only: function(children) {
1108
- if (!isValidElement(children))
1109
- throw Error(
1110
- "React.Children.only expected to receive a single React element child."
1111
- );
1112
- return children;
1113
- }
1114
- };
1115
- exports.Activity = REACT_ACTIVITY_TYPE;
1116
- exports.Children = fnName;
1117
- exports.Component = Component;
1118
- exports.Fragment = REACT_FRAGMENT_TYPE;
1119
- exports.Profiler = REACT_PROFILER_TYPE;
1120
- exports.PureComponent = PureComponent;
1121
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
1122
- exports.Suspense = REACT_SUSPENSE_TYPE;
1123
- exports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1124
- exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1125
- exports.__COMPILER_RUNTIME = deprecatedAPIs;
1126
- exports.act = function(callback) {
1127
- var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1128
- actScopeDepth++;
1129
- var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1130
- try {
1131
- var result = callback();
1132
- } catch (error) {
1133
- ReactSharedInternals.thrownErrors.push(error);
1134
- }
1135
- if (0 < ReactSharedInternals.thrownErrors.length)
1136
- throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1137
- if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1138
- var thenable = result;
1139
- queueSeveralMicrotasks(function() {
1140
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1141
- "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 () => ...);"
1142
- ));
1143
- });
1144
- return {
1145
- then: function(resolve, reject) {
1146
- didAwaitActCall = true;
1147
- thenable.then(
1148
- function(returnValue) {
1149
- popActScope(prevActQueue, prevActScopeDepth);
1150
- if (0 === prevActScopeDepth) {
1151
- try {
1152
- flushActQueue(queue), enqueueTask(function() {
1153
- return recursivelyFlushAsyncActWork(
1154
- returnValue,
1155
- resolve,
1156
- reject
1157
- );
1158
- });
1159
- } catch (error$0) {
1160
- ReactSharedInternals.thrownErrors.push(error$0);
1161
- }
1162
- if (0 < ReactSharedInternals.thrownErrors.length) {
1163
- var _thrownError = aggregateErrors(
1164
- ReactSharedInternals.thrownErrors
1165
- );
1166
- ReactSharedInternals.thrownErrors.length = 0;
1167
- reject(_thrownError);
1168
- }
1169
- } else resolve(returnValue);
1170
- },
1171
- function(error) {
1172
- popActScope(prevActQueue, prevActScopeDepth);
1173
- 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1174
- ReactSharedInternals.thrownErrors
1175
- ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1176
- }
1177
- );
1178
- }
1179
- };
1180
- }
1181
- var returnValue$jscomp$0 = result;
1182
- popActScope(prevActQueue, prevActScopeDepth);
1183
- 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1184
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1185
- "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(() => ...)"
1186
- ));
1187
- }), ReactSharedInternals.actQueue = null);
1188
- if (0 < ReactSharedInternals.thrownErrors.length)
1189
- throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1190
- return {
1191
- then: function(resolve, reject) {
1192
- didAwaitActCall = true;
1193
- 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1194
- return recursivelyFlushAsyncActWork(
1195
- returnValue$jscomp$0,
1196
- resolve,
1197
- reject
1198
- );
1199
- })) : resolve(returnValue$jscomp$0);
1200
- }
1201
- };
1202
- };
1203
- exports.addTransitionType = addTransitionType;
1204
- exports.cache = function(fn) {
1205
- return function() {
1206
- return fn.apply(null, arguments);
1207
- };
1208
- };
1209
- exports.cacheSignal = function() {
1210
- return null;
1211
- };
1212
- exports.captureOwnerStack = function() {
1213
- var getCurrentStack = ReactSharedInternals.getCurrentStack;
1214
- return null === getCurrentStack ? null : getCurrentStack();
1215
- };
1216
- exports.cloneElement = function(element, config, children) {
1217
- if (null === element || void 0 === element)
1218
- throw Error(
1219
- "The argument must be a React element, but you passed " + element + "."
1220
- );
1221
- var props = assign({}, element.props), key = element.key, owner = element._owner;
1222
- if (null != config) {
1223
- var JSCompiler_inline_result;
1224
- a: {
1225
- if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1226
- config,
1227
- "ref"
1228
- ).get) && JSCompiler_inline_result.isReactWarning) {
1229
- JSCompiler_inline_result = false;
1230
- break a;
1231
- }
1232
- JSCompiler_inline_result = void 0 !== config.ref;
1233
- }
1234
- JSCompiler_inline_result && (owner = getOwner());
1235
- hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1236
- for (propName in config)
1237
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1238
- }
1239
- var propName = arguments.length - 2;
1240
- if (1 === propName) props.children = children;
1241
- else if (1 < propName) {
1242
- JSCompiler_inline_result = Array(propName);
1243
- for (var i = 0; i < propName; i++)
1244
- JSCompiler_inline_result[i] = arguments[i + 2];
1245
- props.children = JSCompiler_inline_result;
1246
- }
1247
- props = ReactElement(
1248
- element.type,
1249
- key,
1250
- props,
1251
- owner,
1252
- element._debugStack,
1253
- element._debugTask
1254
- );
1255
- for (key = 2; key < arguments.length; key++)
1256
- validateChildKeys(arguments[key]);
1257
- return props;
1258
- };
1259
- exports.createContext = function(defaultValue) {
1260
- defaultValue = {
1261
- $$typeof: REACT_CONTEXT_TYPE,
1262
- _currentValue: defaultValue,
1263
- _currentValue2: defaultValue,
1264
- _threadCount: 0,
1265
- Provider: null,
1266
- Consumer: null
1267
- };
1268
- defaultValue.Provider = defaultValue;
1269
- defaultValue.Consumer = {
1270
- $$typeof: REACT_CONSUMER_TYPE,
1271
- _context: defaultValue
1272
- };
1273
- defaultValue._currentRenderer = null;
1274
- defaultValue._currentRenderer2 = null;
1275
- return defaultValue;
1276
- };
1277
- exports.createElement = function(type, config, children) {
1278
- for (var i = 2; i < arguments.length; i++)
1279
- validateChildKeys(arguments[i]);
1280
- var propName;
1281
- i = {};
1282
- var key = null;
1283
- if (null != config)
1284
- for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1285
- "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"
1286
- )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1287
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1288
- var childrenLength = arguments.length - 2;
1289
- if (1 === childrenLength) i.children = children;
1290
- else if (1 < childrenLength) {
1291
- for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1292
- childArray[_i] = arguments[_i + 2];
1293
- Object.freeze && Object.freeze(childArray);
1294
- i.children = childArray;
1295
- }
1296
- if (type && type.defaultProps)
1297
- for (propName in childrenLength = type.defaultProps, childrenLength)
1298
- void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1299
- key && defineKeyPropWarningGetter(
1300
- i,
1301
- "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1302
- );
1303
- (propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++) ? (childArray = Error.stackTraceLimit, Error.stackTraceLimit = 10, childrenLength = Error("react-stack-top-frame"), Error.stackTraceLimit = childArray) : childrenLength = unknownOwnerDebugStack;
1304
- return ReactElement(
1305
- type,
1306
- key,
1307
- i,
1308
- getOwner(),
1309
- childrenLength,
1310
- propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1311
- );
1312
- };
1313
- exports.createRef = function() {
1314
- var refObject = { current: null };
1315
- Object.seal(refObject);
1316
- return refObject;
1317
- };
1318
- exports.forwardRef = function(render) {
1319
- null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1320
- "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1321
- ) : "function" !== typeof render ? console.error(
1322
- "forwardRef requires a render function but was given %s.",
1323
- null === render ? "null" : typeof render
1324
- ) : 0 !== render.length && 2 !== render.length && console.error(
1325
- "forwardRef render functions accept exactly two parameters: props and ref. %s",
1326
- 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1327
- );
1328
- null != render && null != render.defaultProps && console.error(
1329
- "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1330
- );
1331
- var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1332
- Object.defineProperty(elementType, "displayName", {
1333
- enumerable: false,
1334
- configurable: true,
1335
- get: function() {
1336
- return ownName;
1337
- },
1338
- set: function(name) {
1339
- ownName = name;
1340
- render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1341
- }
1342
- });
1343
- return elementType;
1344
- };
1345
- exports.isValidElement = isValidElement;
1346
- exports.lazy = function(ctor) {
1347
- ctor = { _status: -1, _result: ctor };
1348
- var lazyType = {
1349
- $$typeof: REACT_LAZY_TYPE,
1350
- _payload: ctor,
1351
- _init: lazyInitializer
1352
- }, ioInfo = {
1353
- name: "lazy",
1354
- start: -1,
1355
- end: -1,
1356
- value: null,
1357
- owner: null,
1358
- debugStack: Error("react-stack-top-frame"),
1359
- debugTask: console.createTask ? console.createTask("lazy()") : null
1360
- };
1361
- ctor._ioInfo = ioInfo;
1362
- lazyType._debugInfo = [{ awaited: ioInfo }];
1363
- return lazyType;
1364
- };
1365
- exports.memo = function(type, compare) {
1366
- null == type && console.error(
1367
- "memo: The first argument must be a component. Instead received: %s",
1368
- null === type ? "null" : typeof type
1369
- );
1370
- compare = {
1371
- $$typeof: REACT_MEMO_TYPE,
1372
- type,
1373
- compare: void 0 === compare ? null : compare
1374
- };
1375
- var ownName;
1376
- Object.defineProperty(compare, "displayName", {
1377
- enumerable: false,
1378
- configurable: true,
1379
- get: function() {
1380
- return ownName;
1381
- },
1382
- set: function(name) {
1383
- ownName = name;
1384
- type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1385
- }
1386
- });
1387
- return compare;
1388
- };
1389
- exports.startTransition = startTransition;
1390
- exports.unstable_useCacheRefresh = function() {
1391
- return resolveDispatcher().useCacheRefresh();
1392
- };
1393
- exports.use = function(usable) {
1394
- return resolveDispatcher().use(usable);
1395
- };
1396
- exports.useActionState = function(action, initialState, permalink) {
1397
- return resolveDispatcher().useActionState(
1398
- action,
1399
- initialState,
1400
- permalink
1401
- );
1402
- };
1403
- exports.useCallback = function(callback, deps) {
1404
- return resolveDispatcher().useCallback(callback, deps);
1405
- };
1406
- exports.useContext = function(Context) {
1407
- var dispatcher = resolveDispatcher();
1408
- Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1409
- "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1410
- );
1411
- return dispatcher.useContext(Context);
1412
- };
1413
- exports.useDebugValue = function(value, formatterFn) {
1414
- return resolveDispatcher().useDebugValue(value, formatterFn);
1415
- };
1416
- exports.useDeferredValue = function(value, initialValue) {
1417
- return resolveDispatcher().useDeferredValue(value, initialValue);
1418
- };
1419
- exports.useEffect = function(create, deps) {
1420
- null == create && console.warn(
1421
- "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1422
- );
1423
- return resolveDispatcher().useEffect(create, deps);
1424
- };
1425
- exports.useEffectEvent = function(callback) {
1426
- return resolveDispatcher().useEffectEvent(callback);
1427
- };
1428
- exports.useId = function() {
1429
- return resolveDispatcher().useId();
1430
- };
1431
- exports.useImperativeHandle = function(ref, create, deps) {
1432
- return resolveDispatcher().useImperativeHandle(ref, create, deps);
1433
- };
1434
- exports.useInsertionEffect = function(create, deps) {
1435
- null == create && console.warn(
1436
- "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1437
- );
1438
- return resolveDispatcher().useInsertionEffect(create, deps);
1439
- };
1440
- exports.useLayoutEffect = function(create, deps) {
1441
- null == create && console.warn(
1442
- "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1443
- );
1444
- return resolveDispatcher().useLayoutEffect(create, deps);
1445
- };
1446
- exports.useMemo = function(create, deps) {
1447
- return resolveDispatcher().useMemo(create, deps);
1448
- };
1449
- exports.useOptimistic = function(passthrough, reducer) {
1450
- return resolveDispatcher().useOptimistic(passthrough, reducer);
1451
- };
1452
- exports.useReducer = function(reducer, initialArg, init) {
1453
- return resolveDispatcher().useReducer(reducer, initialArg, init);
1454
- };
1455
- exports.useRef = function(initialValue) {
1456
- return resolveDispatcher().useRef(initialValue);
1457
- };
1458
- exports.useState = function(initialState) {
1459
- return resolveDispatcher().useState(initialState);
1460
- };
1461
- exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1462
- return resolveDispatcher().useSyncExternalStore(
1463
- subscribe,
1464
- getSnapshot,
1465
- getServerSnapshot
1466
- );
1467
- };
1468
- exports.useTransition = function() {
1469
- return resolveDispatcher().useTransition();
1470
- };
1471
- exports.version = "19.3.0";
1472
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1473
- })();
1474
- }
1475
- });
1476
-
1477
- // ../../node_modules/react/index.js
1478
- var require_react = __commonJS({
1479
- "../../node_modules/react/index.js"(exports, module) {
1480
- if (process.env.NODE_ENV === "production") {
1481
- module.exports = require_react_production();
1482
- } else {
1483
- module.exports = require_react_development();
1484
- }
1485
- }
1486
- });
5
+ // src/camera.ts
1487
6
  var MAX_PITCH = Math.PI / 2 - 0.01;
1488
7
  var MIN_DISTANCE = 0.5;
1489
8
  var MAX_DISTANCE = 500;
@@ -1912,9 +431,6 @@ function collectOverlayBoxes(handles, origin) {
1912
431
  }
1913
432
  return boxes;
1914
433
  }
1915
-
1916
- // src/tools.ts
1917
- var import_react = __toESM(require_react());
1918
434
  var ORBIT_RATE = 6e-3;
1919
435
  var DOLLY_RATE = 15e-4;
1920
436
  var orbitAction = {
@@ -1956,7 +472,7 @@ var dollyAction = {
1956
472
  }
1957
473
  };
1958
474
  function useOrbitTool() {
1959
- return (0, import_react.useMemo)(() => defineTool({
475
+ return useMemo(() => defineTool({
1960
476
  id: "orbit",
1961
477
  hookName: "useOrbitTool",
1962
478
  cursor: "grab",
@@ -1964,30 +480,6 @@ function useOrbitTool() {
1964
480
  bindings: [{ spec: { kind: "drag" }, actionId: "camera.orbit" }]
1965
481
  }), []);
1966
482
  }
1967
- /*! Bundled license information:
1968
-
1969
- react/cjs/react.production.js:
1970
- (**
1971
- * @license React
1972
- * react.production.js
1973
- *
1974
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1975
- *
1976
- * This source code is licensed under the MIT license found in the
1977
- * LICENSE file in the root directory of this source tree.
1978
- *)
1979
-
1980
- react/cjs/react.development.js:
1981
- (**
1982
- * @license React
1983
- * react.development.js
1984
- *
1985
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1986
- *
1987
- * This source code is licensed under the MIT license found in the
1988
- * LICENSE file in the root directory of this source tree.
1989
- *)
1990
- */
1991
483
 
1992
484
  export { MAX_PITCH, UNIT_CUBE, aabbOfPose, cameraEye, cameraView, cameraViewProjection, collectOverlayBoxes, createAreaSelect, createCamera, createInsert, createNodeAtPoint, createPoseDescriptor, createSnap, dollyAction, dollyBy, ndcToScreen, orbitAction, orbitBy, pose3, poseMatrix, projectAabbToScreen, rayThroughScreenPoint, screenBoxOf, screenToNdc, useOrbitTool };
1993
485
  //# sourceMappingURL=index.js.map