@timeax/form-palette 0.1.4 → 0.1.5

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/extra.mjs CHANGED
@@ -2,6 +2,7 @@ import * as React72 from 'react';
2
2
  import React72__default, { forwardRef, createElement, createContext, useMemo, useCallback, useRef, useState, useEffect, useLayoutEffect, useContext } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { createPortal } from 'react-dom';
5
+ import Draggable from 'react-draggable';
5
6
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
6
7
  import * as SelectPrimitive from '@radix-ui/react-select';
7
8
  import * as PopoverPrimitive from '@radix-ui/react-popover';
@@ -21,2019 +22,11 @@ import Ajv from 'ajv';
21
22
  import { Virtuoso } from 'react-virtuoso';
22
23
  import * as LabelPrimitive from '@radix-ui/react-label';
23
24
 
24
- var __create = Object.create;
25
25
  var __defProp = Object.defineProperty;
26
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
27
- var __getOwnPropNames = Object.getOwnPropertyNames;
28
- var __getProtoOf = Object.getPrototypeOf;
29
- var __hasOwnProp = Object.prototype.hasOwnProperty;
30
- var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
31
- get: (a3, b2) => (typeof require !== "undefined" ? require : a3)[b2]
32
- }) : x2)(function(x2) {
33
- if (typeof require !== "undefined") return require.apply(this, arguments);
34
- throw Error('Dynamic require of "' + x2 + '" is not supported');
35
- });
36
- var __commonJS = (cb, mod) => function __require2() {
37
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
38
- };
39
26
  var __export = (target, all) => {
40
27
  for (var name in all)
41
28
  __defProp(target, name, { get: all[name], enumerable: true });
42
29
  };
43
- var __copyProps = (to, from, except, desc) => {
44
- if (from && typeof from === "object" || typeof from === "function") {
45
- for (let key of __getOwnPropNames(from))
46
- if (!__hasOwnProp.call(to, key) && key !== except)
47
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
48
- }
49
- return to;
50
- };
51
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
52
- // If the importer is in node compatibility mode or this is not an ESM
53
- // file that has been converted to a CommonJS file using a Babel-
54
- // compatible transform (i.e. "__esModule" has not been set), then set
55
- // "default" to the CommonJS "module.exports" for node compatibility.
56
- !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
57
- mod
58
- ));
59
-
60
- // ../../node_modules/react-is/cjs/react-is.development.js
61
- var require_react_is_development = __commonJS({
62
- "../../node_modules/react-is/cjs/react-is.development.js"(exports$1) {
63
- {
64
- (function() {
65
- var hasSymbol = typeof Symbol === "function" && Symbol.for;
66
- var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
67
- var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
68
- var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
69
- var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
70
- var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
71
- var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
72
- var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
73
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
74
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
75
- var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
76
- var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
77
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
78
- var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
79
- var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
80
- var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
81
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
82
- var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
83
- var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
84
- function isValidElementType(type) {
85
- return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
86
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
87
- }
88
- function typeOf(object) {
89
- if (typeof object === "object" && object !== null) {
90
- var $$typeof = object.$$typeof;
91
- switch ($$typeof) {
92
- case REACT_ELEMENT_TYPE:
93
- var type = object.type;
94
- switch (type) {
95
- case REACT_ASYNC_MODE_TYPE:
96
- case REACT_CONCURRENT_MODE_TYPE:
97
- case REACT_FRAGMENT_TYPE:
98
- case REACT_PROFILER_TYPE:
99
- case REACT_STRICT_MODE_TYPE:
100
- case REACT_SUSPENSE_TYPE:
101
- return type;
102
- default:
103
- var $$typeofType = type && type.$$typeof;
104
- switch ($$typeofType) {
105
- case REACT_CONTEXT_TYPE:
106
- case REACT_FORWARD_REF_TYPE:
107
- case REACT_LAZY_TYPE:
108
- case REACT_MEMO_TYPE:
109
- case REACT_PROVIDER_TYPE:
110
- return $$typeofType;
111
- default:
112
- return $$typeof;
113
- }
114
- }
115
- case REACT_PORTAL_TYPE:
116
- return $$typeof;
117
- }
118
- }
119
- return void 0;
120
- }
121
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
122
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
123
- var ContextConsumer = REACT_CONTEXT_TYPE;
124
- var ContextProvider = REACT_PROVIDER_TYPE;
125
- var Element = REACT_ELEMENT_TYPE;
126
- var ForwardRef = REACT_FORWARD_REF_TYPE;
127
- var Fragment14 = REACT_FRAGMENT_TYPE;
128
- var Lazy = REACT_LAZY_TYPE;
129
- var Memo = REACT_MEMO_TYPE;
130
- var Portal5 = REACT_PORTAL_TYPE;
131
- var Profiler = REACT_PROFILER_TYPE;
132
- var StrictMode = REACT_STRICT_MODE_TYPE;
133
- var Suspense = REACT_SUSPENSE_TYPE;
134
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
135
- function isAsyncMode(object) {
136
- {
137
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
138
- hasWarnedAboutDeprecatedIsAsyncMode = true;
139
- console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
140
- }
141
- }
142
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
143
- }
144
- function isConcurrentMode(object) {
145
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
146
- }
147
- function isContextConsumer(object) {
148
- return typeOf(object) === REACT_CONTEXT_TYPE;
149
- }
150
- function isContextProvider(object) {
151
- return typeOf(object) === REACT_PROVIDER_TYPE;
152
- }
153
- function isElement(object) {
154
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
155
- }
156
- function isForwardRef(object) {
157
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
158
- }
159
- function isFragment(object) {
160
- return typeOf(object) === REACT_FRAGMENT_TYPE;
161
- }
162
- function isLazy(object) {
163
- return typeOf(object) === REACT_LAZY_TYPE;
164
- }
165
- function isMemo(object) {
166
- return typeOf(object) === REACT_MEMO_TYPE;
167
- }
168
- function isPortal(object) {
169
- return typeOf(object) === REACT_PORTAL_TYPE;
170
- }
171
- function isProfiler(object) {
172
- return typeOf(object) === REACT_PROFILER_TYPE;
173
- }
174
- function isStrictMode(object) {
175
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
176
- }
177
- function isSuspense(object) {
178
- return typeOf(object) === REACT_SUSPENSE_TYPE;
179
- }
180
- exports$1.AsyncMode = AsyncMode;
181
- exports$1.ConcurrentMode = ConcurrentMode;
182
- exports$1.ContextConsumer = ContextConsumer;
183
- exports$1.ContextProvider = ContextProvider;
184
- exports$1.Element = Element;
185
- exports$1.ForwardRef = ForwardRef;
186
- exports$1.Fragment = Fragment14;
187
- exports$1.Lazy = Lazy;
188
- exports$1.Memo = Memo;
189
- exports$1.Portal = Portal5;
190
- exports$1.Profiler = Profiler;
191
- exports$1.StrictMode = StrictMode;
192
- exports$1.Suspense = Suspense;
193
- exports$1.isAsyncMode = isAsyncMode;
194
- exports$1.isConcurrentMode = isConcurrentMode;
195
- exports$1.isContextConsumer = isContextConsumer;
196
- exports$1.isContextProvider = isContextProvider;
197
- exports$1.isElement = isElement;
198
- exports$1.isForwardRef = isForwardRef;
199
- exports$1.isFragment = isFragment;
200
- exports$1.isLazy = isLazy;
201
- exports$1.isMemo = isMemo;
202
- exports$1.isPortal = isPortal;
203
- exports$1.isProfiler = isProfiler;
204
- exports$1.isStrictMode = isStrictMode;
205
- exports$1.isSuspense = isSuspense;
206
- exports$1.isValidElementType = isValidElementType;
207
- exports$1.typeOf = typeOf;
208
- })();
209
- }
210
- }
211
- });
212
-
213
- // ../../node_modules/react-is/index.js
214
- var require_react_is = __commonJS({
215
- "../../node_modules/react-is/index.js"(exports$1, module2) {
216
- {
217
- module2.exports = require_react_is_development();
218
- }
219
- }
220
- });
221
-
222
- // ../../node_modules/object-assign/index.js
223
- var require_object_assign = __commonJS({
224
- "../../node_modules/object-assign/index.js"(exports$1, module2) {
225
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
226
- var hasOwnProperty = Object.prototype.hasOwnProperty;
227
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
228
- function toObject(val) {
229
- if (val === null || val === void 0) {
230
- throw new TypeError("Object.assign cannot be called with null or undefined");
231
- }
232
- return Object(val);
233
- }
234
- function shouldUseNative() {
235
- try {
236
- if (!Object.assign) {
237
- return false;
238
- }
239
- var test1 = new String("abc");
240
- test1[5] = "de";
241
- if (Object.getOwnPropertyNames(test1)[0] === "5") {
242
- return false;
243
- }
244
- var test2 = {};
245
- for (var i3 = 0; i3 < 10; i3++) {
246
- test2["_" + String.fromCharCode(i3)] = i3;
247
- }
248
- var order2 = Object.getOwnPropertyNames(test2).map(function(n3) {
249
- return test2[n3];
250
- });
251
- if (order2.join("") !== "0123456789") {
252
- return false;
253
- }
254
- var test3 = {};
255
- "abcdefghijklmnopqrst".split("").forEach(function(letter) {
256
- test3[letter] = letter;
257
- });
258
- if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
259
- return false;
260
- }
261
- return true;
262
- } catch (err) {
263
- return false;
264
- }
265
- }
266
- module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
267
- var from;
268
- var to = toObject(target);
269
- var symbols;
270
- for (var s3 = 1; s3 < arguments.length; s3++) {
271
- from = Object(arguments[s3]);
272
- for (var key in from) {
273
- if (hasOwnProperty.call(from, key)) {
274
- to[key] = from[key];
275
- }
276
- }
277
- if (getOwnPropertySymbols) {
278
- symbols = getOwnPropertySymbols(from);
279
- for (var i3 = 0; i3 < symbols.length; i3++) {
280
- if (propIsEnumerable.call(from, symbols[i3])) {
281
- to[symbols[i3]] = from[symbols[i3]];
282
- }
283
- }
284
- }
285
- }
286
- return to;
287
- };
288
- }
289
- });
290
-
291
- // ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
292
- var require_ReactPropTypesSecret = __commonJS({
293
- "../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports$1, module2) {
294
- var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
295
- module2.exports = ReactPropTypesSecret;
296
- }
297
- });
298
-
299
- // ../../node_modules/prop-types/lib/has.js
300
- var require_has = __commonJS({
301
- "../../node_modules/prop-types/lib/has.js"(exports$1, module2) {
302
- module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
303
- }
304
- });
305
-
306
- // ../../node_modules/prop-types/checkPropTypes.js
307
- var require_checkPropTypes = __commonJS({
308
- "../../node_modules/prop-types/checkPropTypes.js"(exports$1, module2) {
309
- var printWarning = function() {
310
- };
311
- {
312
- ReactPropTypesSecret = require_ReactPropTypesSecret();
313
- loggedTypeFailures = {};
314
- has = require_has();
315
- printWarning = function(text) {
316
- var message2 = "Warning: " + text;
317
- if (typeof console !== "undefined") {
318
- console.error(message2);
319
- }
320
- try {
321
- throw new Error(message2);
322
- } catch (x2) {
323
- }
324
- };
325
- }
326
- var ReactPropTypesSecret;
327
- var loggedTypeFailures;
328
- var has;
329
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
330
- {
331
- for (var typeSpecName in typeSpecs) {
332
- if (has(typeSpecs, typeSpecName)) {
333
- var error;
334
- try {
335
- if (typeof typeSpecs[typeSpecName] !== "function") {
336
- var err = Error(
337
- (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
338
- );
339
- err.name = "Invariant Violation";
340
- throw err;
341
- }
342
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
343
- } catch (ex) {
344
- error = ex;
345
- }
346
- if (error && !(error instanceof Error)) {
347
- printWarning(
348
- (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
349
- );
350
- }
351
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
352
- loggedTypeFailures[error.message] = true;
353
- var stack = getStack ? getStack() : "";
354
- printWarning(
355
- "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
356
- );
357
- }
358
- }
359
- }
360
- }
361
- }
362
- checkPropTypes.resetWarningCache = function() {
363
- {
364
- loggedTypeFailures = {};
365
- }
366
- };
367
- module2.exports = checkPropTypes;
368
- }
369
- });
370
-
371
- // ../../node_modules/prop-types/factoryWithTypeCheckers.js
372
- var require_factoryWithTypeCheckers = __commonJS({
373
- "../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports$1, module2) {
374
- var ReactIs = require_react_is();
375
- var assign = require_object_assign();
376
- var ReactPropTypesSecret = require_ReactPropTypesSecret();
377
- var has = require_has();
378
- var checkPropTypes = require_checkPropTypes();
379
- var printWarning = function() {
380
- };
381
- {
382
- printWarning = function(text) {
383
- var message2 = "Warning: " + text;
384
- if (typeof console !== "undefined") {
385
- console.error(message2);
386
- }
387
- try {
388
- throw new Error(message2);
389
- } catch (x2) {
390
- }
391
- };
392
- }
393
- function emptyFunctionThatReturnsNull() {
394
- return null;
395
- }
396
- module2.exports = function(isValidElement5, throwOnDirectAccess) {
397
- var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
398
- var FAUX_ITERATOR_SYMBOL = "@@iterator";
399
- function getIteratorFn(maybeIterable) {
400
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
401
- if (typeof iteratorFn === "function") {
402
- return iteratorFn;
403
- }
404
- }
405
- var ANONYMOUS = "<<anonymous>>";
406
- var ReactPropTypes = {
407
- array: createPrimitiveTypeChecker("array"),
408
- bigint: createPrimitiveTypeChecker("bigint"),
409
- bool: createPrimitiveTypeChecker("boolean"),
410
- func: createPrimitiveTypeChecker("function"),
411
- number: createPrimitiveTypeChecker("number"),
412
- object: createPrimitiveTypeChecker("object"),
413
- string: createPrimitiveTypeChecker("string"),
414
- symbol: createPrimitiveTypeChecker("symbol"),
415
- any: createAnyTypeChecker(),
416
- arrayOf: createArrayOfTypeChecker,
417
- element: createElementTypeChecker(),
418
- elementType: createElementTypeTypeChecker(),
419
- instanceOf: createInstanceTypeChecker,
420
- node: createNodeChecker(),
421
- objectOf: createObjectOfTypeChecker,
422
- oneOf: createEnumTypeChecker,
423
- oneOfType: createUnionTypeChecker,
424
- shape: createShapeTypeChecker,
425
- exact: createStrictShapeTypeChecker
426
- };
427
- function is(x2, y2) {
428
- if (x2 === y2) {
429
- return x2 !== 0 || 1 / x2 === 1 / y2;
430
- } else {
431
- return x2 !== x2 && y2 !== y2;
432
- }
433
- }
434
- function PropTypeError(message2, data) {
435
- this.message = message2;
436
- this.data = data && typeof data === "object" ? data : {};
437
- this.stack = "";
438
- }
439
- PropTypeError.prototype = Error.prototype;
440
- function createChainableTypeChecker(validate) {
441
- {
442
- var manualPropTypeCallCache = {};
443
- var manualPropTypeWarningCount = 0;
444
- }
445
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
446
- componentName = componentName || ANONYMOUS;
447
- propFullName = propFullName || propName;
448
- if (secret !== ReactPropTypesSecret) {
449
- if (throwOnDirectAccess) {
450
- var err = new Error(
451
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
452
- );
453
- err.name = "Invariant Violation";
454
- throw err;
455
- } else if (typeof console !== "undefined") {
456
- var cacheKey = componentName + ":" + propName;
457
- if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
458
- manualPropTypeWarningCount < 3) {
459
- printWarning(
460
- "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
461
- );
462
- manualPropTypeCallCache[cacheKey] = true;
463
- manualPropTypeWarningCount++;
464
- }
465
- }
466
- }
467
- if (props[propName] == null) {
468
- if (isRequired) {
469
- if (props[propName] === null) {
470
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
471
- }
472
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
473
- }
474
- return null;
475
- } else {
476
- return validate(props, propName, componentName, location, propFullName);
477
- }
478
- }
479
- var chainedCheckType = checkType.bind(null, false);
480
- chainedCheckType.isRequired = checkType.bind(null, true);
481
- return chainedCheckType;
482
- }
483
- function createPrimitiveTypeChecker(expectedType) {
484
- function validate(props, propName, componentName, location, propFullName, secret) {
485
- var propValue = props[propName];
486
- var propType = getPropType(propValue);
487
- if (propType !== expectedType) {
488
- var preciseType = getPreciseType(propValue);
489
- return new PropTypeError(
490
- "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
491
- { expectedType }
492
- );
493
- }
494
- return null;
495
- }
496
- return createChainableTypeChecker(validate);
497
- }
498
- function createAnyTypeChecker() {
499
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
500
- }
501
- function createArrayOfTypeChecker(typeChecker) {
502
- function validate(props, propName, componentName, location, propFullName) {
503
- if (typeof typeChecker !== "function") {
504
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
505
- }
506
- var propValue = props[propName];
507
- if (!Array.isArray(propValue)) {
508
- var propType = getPropType(propValue);
509
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
510
- }
511
- for (var i3 = 0; i3 < propValue.length; i3++) {
512
- var error = typeChecker(propValue, i3, componentName, location, propFullName + "[" + i3 + "]", ReactPropTypesSecret);
513
- if (error instanceof Error) {
514
- return error;
515
- }
516
- }
517
- return null;
518
- }
519
- return createChainableTypeChecker(validate);
520
- }
521
- function createElementTypeChecker() {
522
- function validate(props, propName, componentName, location, propFullName) {
523
- var propValue = props[propName];
524
- if (!isValidElement5(propValue)) {
525
- var propType = getPropType(propValue);
526
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
527
- }
528
- return null;
529
- }
530
- return createChainableTypeChecker(validate);
531
- }
532
- function createElementTypeTypeChecker() {
533
- function validate(props, propName, componentName, location, propFullName) {
534
- var propValue = props[propName];
535
- if (!ReactIs.isValidElementType(propValue)) {
536
- var propType = getPropType(propValue);
537
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
538
- }
539
- return null;
540
- }
541
- return createChainableTypeChecker(validate);
542
- }
543
- function createInstanceTypeChecker(expectedClass) {
544
- function validate(props, propName, componentName, location, propFullName) {
545
- if (!(props[propName] instanceof expectedClass)) {
546
- var expectedClassName = expectedClass.name || ANONYMOUS;
547
- var actualClassName = getClassName(props[propName]);
548
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
549
- }
550
- return null;
551
- }
552
- return createChainableTypeChecker(validate);
553
- }
554
- function createEnumTypeChecker(expectedValues) {
555
- if (!Array.isArray(expectedValues)) {
556
- {
557
- if (arguments.length > 1) {
558
- printWarning(
559
- "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
560
- );
561
- } else {
562
- printWarning("Invalid argument supplied to oneOf, expected an array.");
563
- }
564
- }
565
- return emptyFunctionThatReturnsNull;
566
- }
567
- function validate(props, propName, componentName, location, propFullName) {
568
- var propValue = props[propName];
569
- for (var i3 = 0; i3 < expectedValues.length; i3++) {
570
- if (is(propValue, expectedValues[i3])) {
571
- return null;
572
- }
573
- }
574
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
575
- var type = getPreciseType(value);
576
- if (type === "symbol") {
577
- return String(value);
578
- }
579
- return value;
580
- });
581
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
582
- }
583
- return createChainableTypeChecker(validate);
584
- }
585
- function createObjectOfTypeChecker(typeChecker) {
586
- function validate(props, propName, componentName, location, propFullName) {
587
- if (typeof typeChecker !== "function") {
588
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
589
- }
590
- var propValue = props[propName];
591
- var propType = getPropType(propValue);
592
- if (propType !== "object") {
593
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
594
- }
595
- for (var key in propValue) {
596
- if (has(propValue, key)) {
597
- var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
598
- if (error instanceof Error) {
599
- return error;
600
- }
601
- }
602
- }
603
- return null;
604
- }
605
- return createChainableTypeChecker(validate);
606
- }
607
- function createUnionTypeChecker(arrayOfTypeCheckers) {
608
- if (!Array.isArray(arrayOfTypeCheckers)) {
609
- printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") ;
610
- return emptyFunctionThatReturnsNull;
611
- }
612
- for (var i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) {
613
- var checker = arrayOfTypeCheckers[i3];
614
- if (typeof checker !== "function") {
615
- printWarning(
616
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i3 + "."
617
- );
618
- return emptyFunctionThatReturnsNull;
619
- }
620
- }
621
- function validate(props, propName, componentName, location, propFullName) {
622
- var expectedTypes = [];
623
- for (var i4 = 0; i4 < arrayOfTypeCheckers.length; i4++) {
624
- var checker2 = arrayOfTypeCheckers[i4];
625
- var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
626
- if (checkerResult == null) {
627
- return null;
628
- }
629
- if (checkerResult.data && has(checkerResult.data, "expectedType")) {
630
- expectedTypes.push(checkerResult.data.expectedType);
631
- }
632
- }
633
- var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
634
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
635
- }
636
- return createChainableTypeChecker(validate);
637
- }
638
- function createNodeChecker() {
639
- function validate(props, propName, componentName, location, propFullName) {
640
- if (!isNode(props[propName])) {
641
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
642
- }
643
- return null;
644
- }
645
- return createChainableTypeChecker(validate);
646
- }
647
- function invalidValidatorError(componentName, location, propFullName, key, type) {
648
- return new PropTypeError(
649
- (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
650
- );
651
- }
652
- function createShapeTypeChecker(shapeTypes) {
653
- function validate(props, propName, componentName, location, propFullName) {
654
- var propValue = props[propName];
655
- var propType = getPropType(propValue);
656
- if (propType !== "object") {
657
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
658
- }
659
- for (var key in shapeTypes) {
660
- var checker = shapeTypes[key];
661
- if (typeof checker !== "function") {
662
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
663
- }
664
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
665
- if (error) {
666
- return error;
667
- }
668
- }
669
- return null;
670
- }
671
- return createChainableTypeChecker(validate);
672
- }
673
- function createStrictShapeTypeChecker(shapeTypes) {
674
- function validate(props, propName, componentName, location, propFullName) {
675
- var propValue = props[propName];
676
- var propType = getPropType(propValue);
677
- if (propType !== "object") {
678
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
679
- }
680
- var allKeys = assign({}, props[propName], shapeTypes);
681
- for (var key in allKeys) {
682
- var checker = shapeTypes[key];
683
- if (has(shapeTypes, key) && typeof checker !== "function") {
684
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
685
- }
686
- if (!checker) {
687
- return new PropTypeError(
688
- "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
689
- );
690
- }
691
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
692
- if (error) {
693
- return error;
694
- }
695
- }
696
- return null;
697
- }
698
- return createChainableTypeChecker(validate);
699
- }
700
- function isNode(propValue) {
701
- switch (typeof propValue) {
702
- case "number":
703
- case "string":
704
- case "undefined":
705
- return true;
706
- case "boolean":
707
- return !propValue;
708
- case "object":
709
- if (Array.isArray(propValue)) {
710
- return propValue.every(isNode);
711
- }
712
- if (propValue === null || isValidElement5(propValue)) {
713
- return true;
714
- }
715
- var iteratorFn = getIteratorFn(propValue);
716
- if (iteratorFn) {
717
- var iterator = iteratorFn.call(propValue);
718
- var step;
719
- if (iteratorFn !== propValue.entries) {
720
- while (!(step = iterator.next()).done) {
721
- if (!isNode(step.value)) {
722
- return false;
723
- }
724
- }
725
- } else {
726
- while (!(step = iterator.next()).done) {
727
- var entry = step.value;
728
- if (entry) {
729
- if (!isNode(entry[1])) {
730
- return false;
731
- }
732
- }
733
- }
734
- }
735
- } else {
736
- return false;
737
- }
738
- return true;
739
- default:
740
- return false;
741
- }
742
- }
743
- function isSymbol(propType, propValue) {
744
- if (propType === "symbol") {
745
- return true;
746
- }
747
- if (!propValue) {
748
- return false;
749
- }
750
- if (propValue["@@toStringTag"] === "Symbol") {
751
- return true;
752
- }
753
- if (typeof Symbol === "function" && propValue instanceof Symbol) {
754
- return true;
755
- }
756
- return false;
757
- }
758
- function getPropType(propValue) {
759
- var propType = typeof propValue;
760
- if (Array.isArray(propValue)) {
761
- return "array";
762
- }
763
- if (propValue instanceof RegExp) {
764
- return "object";
765
- }
766
- if (isSymbol(propType, propValue)) {
767
- return "symbol";
768
- }
769
- return propType;
770
- }
771
- function getPreciseType(propValue) {
772
- if (typeof propValue === "undefined" || propValue === null) {
773
- return "" + propValue;
774
- }
775
- var propType = getPropType(propValue);
776
- if (propType === "object") {
777
- if (propValue instanceof Date) {
778
- return "date";
779
- } else if (propValue instanceof RegExp) {
780
- return "regexp";
781
- }
782
- }
783
- return propType;
784
- }
785
- function getPostfixForTypeWarning(value) {
786
- var type = getPreciseType(value);
787
- switch (type) {
788
- case "array":
789
- case "object":
790
- return "an " + type;
791
- case "boolean":
792
- case "date":
793
- case "regexp":
794
- return "a " + type;
795
- default:
796
- return type;
797
- }
798
- }
799
- function getClassName(propValue) {
800
- if (!propValue.constructor || !propValue.constructor.name) {
801
- return ANONYMOUS;
802
- }
803
- return propValue.constructor.name;
804
- }
805
- ReactPropTypes.checkPropTypes = checkPropTypes;
806
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
807
- ReactPropTypes.PropTypes = ReactPropTypes;
808
- return ReactPropTypes;
809
- };
810
- }
811
- });
812
-
813
- // ../../node_modules/prop-types/index.js
814
- var require_prop_types = __commonJS({
815
- "../../node_modules/prop-types/index.js"(exports$1, module2) {
816
- {
817
- ReactIs = require_react_is();
818
- throwOnDirectAccess = true;
819
- module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
820
- }
821
- var ReactIs;
822
- var throwOnDirectAccess;
823
- }
824
- });
825
-
826
- // ../../node_modules/clsx/dist/clsx.js
827
- var require_clsx = __commonJS({
828
- "../../node_modules/clsx/dist/clsx.js"(exports$1, module2) {
829
- function r5(e5) {
830
- var o3, t4, f2 = "";
831
- if ("string" == typeof e5 || "number" == typeof e5) f2 += e5;
832
- else if ("object" == typeof e5) if (Array.isArray(e5)) {
833
- var n3 = e5.length;
834
- for (o3 = 0; o3 < n3; o3++) e5[o3] && (t4 = r5(e5[o3])) && (f2 && (f2 += " "), f2 += t4);
835
- } else for (t4 in e5) e5[t4] && (f2 && (f2 += " "), f2 += t4);
836
- return f2;
837
- }
838
- function e4() {
839
- for (var e5, o3, t4 = 0, f2 = "", n3 = arguments.length; t4 < n3; t4++) (e5 = arguments[t4]) && (o3 = r5(e5)) && (f2 && (f2 += " "), f2 += o3);
840
- return f2;
841
- }
842
- module2.exports = e4, module2.exports.clsx = e4;
843
- }
844
- });
845
-
846
- // ../../node_modules/react-draggable/build/cjs/utils/shims.js
847
- var require_shims = __commonJS({
848
- "../../node_modules/react-draggable/build/cjs/utils/shims.js"(exports$1) {
849
- Object.defineProperty(exports$1, "__esModule", {
850
- value: true
851
- });
852
- exports$1.dontSetMe = dontSetMe;
853
- exports$1.findInArray = findInArray;
854
- exports$1.int = int;
855
- exports$1.isFunction = isFunction;
856
- exports$1.isNum = isNum;
857
- function findInArray(array, callback) {
858
- for (let i3 = 0, length = array.length; i3 < length; i3++) {
859
- if (callback.apply(callback, [array[i3], i3, array])) return array[i3];
860
- }
861
- }
862
- function isFunction(func) {
863
- return typeof func === "function" || Object.prototype.toString.call(func) === "[object Function]";
864
- }
865
- function isNum(num) {
866
- return typeof num === "number" && !isNaN(num);
867
- }
868
- function int(a3) {
869
- return parseInt(a3, 10);
870
- }
871
- function dontSetMe(props, propName, componentName) {
872
- if (props[propName]) {
873
- return new Error(`Invalid prop ${propName} passed to ${componentName} - do not set this, set it on the child.`);
874
- }
875
- }
876
- }
877
- });
878
-
879
- // ../../node_modules/react-draggable/build/cjs/utils/getPrefix.js
880
- var require_getPrefix = __commonJS({
881
- "../../node_modules/react-draggable/build/cjs/utils/getPrefix.js"(exports$1) {
882
- Object.defineProperty(exports$1, "__esModule", {
883
- value: true
884
- });
885
- exports$1.browserPrefixToKey = browserPrefixToKey;
886
- exports$1.browserPrefixToStyle = browserPrefixToStyle;
887
- exports$1.default = void 0;
888
- exports$1.getPrefix = getPrefix;
889
- var prefixes = ["Moz", "Webkit", "O", "ms"];
890
- function getPrefix() {
891
- var _a, _b;
892
- let prop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
893
- if (typeof window === "undefined") return "";
894
- const style = (_b = (_a = window.document) == null ? void 0 : _a.documentElement) == null ? void 0 : _b.style;
895
- if (!style) return "";
896
- if (prop in style) return "";
897
- for (let i3 = 0; i3 < prefixes.length; i3++) {
898
- if (browserPrefixToKey(prop, prefixes[i3]) in style) return prefixes[i3];
899
- }
900
- return "";
901
- }
902
- function browserPrefixToKey(prop, prefix) {
903
- return prefix ? `${prefix}${kebabToTitleCase(prop)}` : prop;
904
- }
905
- function browserPrefixToStyle(prop, prefix) {
906
- return prefix ? `-${prefix.toLowerCase()}-${prop}` : prop;
907
- }
908
- function kebabToTitleCase(str) {
909
- let out = "";
910
- let shouldCapitalize = true;
911
- for (let i3 = 0; i3 < str.length; i3++) {
912
- if (shouldCapitalize) {
913
- out += str[i3].toUpperCase();
914
- shouldCapitalize = false;
915
- } else if (str[i3] === "-") {
916
- shouldCapitalize = true;
917
- } else {
918
- out += str[i3];
919
- }
920
- }
921
- return out;
922
- }
923
- exports$1.default = getPrefix();
924
- }
925
- });
926
-
927
- // ../../node_modules/react-draggable/build/cjs/utils/domFns.js
928
- var require_domFns = __commonJS({
929
- "../../node_modules/react-draggable/build/cjs/utils/domFns.js"(exports$1) {
930
- Object.defineProperty(exports$1, "__esModule", {
931
- value: true
932
- });
933
- exports$1.addClassName = addClassName;
934
- exports$1.addEvent = addEvent;
935
- exports$1.addUserSelectStyles = addUserSelectStyles;
936
- exports$1.createCSSTransform = createCSSTransform;
937
- exports$1.createSVGTransform = createSVGTransform;
938
- exports$1.getTouch = getTouch;
939
- exports$1.getTouchIdentifier = getTouchIdentifier;
940
- exports$1.getTranslation = getTranslation;
941
- exports$1.innerHeight = innerHeight;
942
- exports$1.innerWidth = innerWidth;
943
- exports$1.matchesSelector = matchesSelector;
944
- exports$1.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
945
- exports$1.offsetXYFromParent = offsetXYFromParent;
946
- exports$1.outerHeight = outerHeight;
947
- exports$1.outerWidth = outerWidth;
948
- exports$1.removeClassName = removeClassName;
949
- exports$1.removeEvent = removeEvent;
950
- exports$1.scheduleRemoveUserSelectStyles = scheduleRemoveUserSelectStyles;
951
- var _shims = require_shims();
952
- var _getPrefix = _interopRequireWildcard(require_getPrefix());
953
- function _interopRequireWildcard(e4, t4) {
954
- if ("function" == typeof WeakMap) var r5 = /* @__PURE__ */ new WeakMap(), n3 = /* @__PURE__ */ new WeakMap();
955
- return (_interopRequireWildcard = function(e5, t5) {
956
- if (!t5 && e5 && e5.__esModule) return e5;
957
- var o3, i3, f2 = { __proto__: null, default: e5 };
958
- if (null === e5 || "object" != typeof e5 && "function" != typeof e5) return f2;
959
- if (o3 = t5 ? n3 : r5) {
960
- if (o3.has(e5)) return o3.get(e5);
961
- o3.set(e5, f2);
962
- }
963
- for (const t6 in e5) "default" !== t6 && {}.hasOwnProperty.call(e5, t6) && ((i3 = (o3 = Object.defineProperty) && Object.getOwnPropertyDescriptor(e5, t6)) && (i3.get || i3.set) ? o3(f2, t6, i3) : f2[t6] = e5[t6]);
964
- return f2;
965
- })(e4, t4);
966
- }
967
- var matchesSelectorFunc = "";
968
- function matchesSelector(el, selector) {
969
- if (!matchesSelectorFunc) {
970
- matchesSelectorFunc = (0, _shims.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(method) {
971
- return (0, _shims.isFunction)(el[method]);
972
- });
973
- }
974
- if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false;
975
- return el[matchesSelectorFunc](selector);
976
- }
977
- function matchesSelectorAndParentsTo(el, selector, baseNode) {
978
- let node = el;
979
- do {
980
- if (matchesSelector(node, selector)) return true;
981
- if (node === baseNode) return false;
982
- node = node.parentNode;
983
- } while (node);
984
- return false;
985
- }
986
- function addEvent(el, event, handler, inputOptions) {
987
- if (!el) return;
988
- const options = {
989
- capture: true,
990
- ...inputOptions
991
- };
992
- if (el.addEventListener) {
993
- el.addEventListener(event, handler, options);
994
- } else if (el.attachEvent) {
995
- el.attachEvent("on" + event, handler);
996
- } else {
997
- el["on" + event] = handler;
998
- }
999
- }
1000
- function removeEvent(el, event, handler, inputOptions) {
1001
- if (!el) return;
1002
- const options = {
1003
- capture: true,
1004
- ...inputOptions
1005
- };
1006
- if (el.removeEventListener) {
1007
- el.removeEventListener(event, handler, options);
1008
- } else if (el.detachEvent) {
1009
- el.detachEvent("on" + event, handler);
1010
- } else {
1011
- el["on" + event] = null;
1012
- }
1013
- }
1014
- function outerHeight(node) {
1015
- let height = node.clientHeight;
1016
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
1017
- height += (0, _shims.int)(computedStyle.borderTopWidth);
1018
- height += (0, _shims.int)(computedStyle.borderBottomWidth);
1019
- return height;
1020
- }
1021
- function outerWidth(node) {
1022
- let width = node.clientWidth;
1023
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
1024
- width += (0, _shims.int)(computedStyle.borderLeftWidth);
1025
- width += (0, _shims.int)(computedStyle.borderRightWidth);
1026
- return width;
1027
- }
1028
- function innerHeight(node) {
1029
- let height = node.clientHeight;
1030
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
1031
- height -= (0, _shims.int)(computedStyle.paddingTop);
1032
- height -= (0, _shims.int)(computedStyle.paddingBottom);
1033
- return height;
1034
- }
1035
- function innerWidth(node) {
1036
- let width = node.clientWidth;
1037
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
1038
- width -= (0, _shims.int)(computedStyle.paddingLeft);
1039
- width -= (0, _shims.int)(computedStyle.paddingRight);
1040
- return width;
1041
- }
1042
- function offsetXYFromParent(evt, offsetParent, scale) {
1043
- const isBody = offsetParent === offsetParent.ownerDocument.body;
1044
- const offsetParentRect = isBody ? {
1045
- left: 0,
1046
- top: 0
1047
- } : offsetParent.getBoundingClientRect();
1048
- const x2 = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
1049
- const y2 = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
1050
- return {
1051
- x: x2,
1052
- y: y2
1053
- };
1054
- }
1055
- function createCSSTransform(controlPos, positionOffset) {
1056
- const translation = getTranslation(controlPos, positionOffset, "px");
1057
- return {
1058
- [(0, _getPrefix.browserPrefixToKey)("transform", _getPrefix.default)]: translation
1059
- };
1060
- }
1061
- function createSVGTransform(controlPos, positionOffset) {
1062
- const translation = getTranslation(controlPos, positionOffset, "");
1063
- return translation;
1064
- }
1065
- function getTranslation(_ref, positionOffset, unitSuffix) {
1066
- let {
1067
- x: x2,
1068
- y: y2
1069
- } = _ref;
1070
- let translation = `translate(${x2}${unitSuffix},${y2}${unitSuffix})`;
1071
- if (positionOffset) {
1072
- const defaultX = `${typeof positionOffset.x === "string" ? positionOffset.x : positionOffset.x + unitSuffix}`;
1073
- const defaultY = `${typeof positionOffset.y === "string" ? positionOffset.y : positionOffset.y + unitSuffix}`;
1074
- translation = `translate(${defaultX}, ${defaultY})` + translation;
1075
- }
1076
- return translation;
1077
- }
1078
- function getTouch(e4, identifier) {
1079
- return e4.targetTouches && (0, _shims.findInArray)(e4.targetTouches, (t4) => identifier === t4.identifier) || e4.changedTouches && (0, _shims.findInArray)(e4.changedTouches, (t4) => identifier === t4.identifier);
1080
- }
1081
- function getTouchIdentifier(e4) {
1082
- if (e4.targetTouches && e4.targetTouches[0]) return e4.targetTouches[0].identifier;
1083
- if (e4.changedTouches && e4.changedTouches[0]) return e4.changedTouches[0].identifier;
1084
- }
1085
- function addUserSelectStyles(doc) {
1086
- if (!doc) return;
1087
- let styleEl = doc.getElementById("react-draggable-style-el");
1088
- if (!styleEl) {
1089
- styleEl = doc.createElement("style");
1090
- styleEl.type = "text/css";
1091
- styleEl.id = "react-draggable-style-el";
1092
- styleEl.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n";
1093
- styleEl.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n";
1094
- doc.getElementsByTagName("head")[0].appendChild(styleEl);
1095
- }
1096
- if (doc.body) addClassName(doc.body, "react-draggable-transparent-selection");
1097
- }
1098
- function scheduleRemoveUserSelectStyles(doc) {
1099
- if (window.requestAnimationFrame) {
1100
- window.requestAnimationFrame(() => {
1101
- removeUserSelectStyles(doc);
1102
- });
1103
- } else {
1104
- removeUserSelectStyles(doc);
1105
- }
1106
- }
1107
- function removeUserSelectStyles(doc) {
1108
- if (!doc) return;
1109
- try {
1110
- if (doc.body) removeClassName(doc.body, "react-draggable-transparent-selection");
1111
- if (doc.selection) {
1112
- doc.selection.empty();
1113
- } else {
1114
- const selection = (doc.defaultView || window).getSelection();
1115
- if (selection && selection.type !== "Caret") {
1116
- selection.removeAllRanges();
1117
- }
1118
- }
1119
- } catch (e4) {
1120
- }
1121
- }
1122
- function addClassName(el, className) {
1123
- if (el.classList) {
1124
- el.classList.add(className);
1125
- } else {
1126
- if (!el.className.match(new RegExp(`(?:^|\\s)${className}(?!\\S)`))) {
1127
- el.className += ` ${className}`;
1128
- }
1129
- }
1130
- }
1131
- function removeClassName(el, className) {
1132
- if (el.classList) {
1133
- el.classList.remove(className);
1134
- } else {
1135
- el.className = el.className.replace(new RegExp(`(?:^|\\s)${className}(?!\\S)`, "g"), "");
1136
- }
1137
- }
1138
- }
1139
- });
1140
-
1141
- // ../../node_modules/react-draggable/build/cjs/utils/positionFns.js
1142
- var require_positionFns = __commonJS({
1143
- "../../node_modules/react-draggable/build/cjs/utils/positionFns.js"(exports$1) {
1144
- Object.defineProperty(exports$1, "__esModule", {
1145
- value: true
1146
- });
1147
- exports$1.canDragX = canDragX;
1148
- exports$1.canDragY = canDragY;
1149
- exports$1.createCoreData = createCoreData;
1150
- exports$1.createDraggableData = createDraggableData;
1151
- exports$1.getBoundPosition = getBoundPosition;
1152
- exports$1.getControlPosition = getControlPosition;
1153
- exports$1.snapToGrid = snapToGrid;
1154
- var _shims = require_shims();
1155
- var _domFns = require_domFns();
1156
- function getBoundPosition(draggable, x2, y2) {
1157
- if (!draggable.props.bounds) return [x2, y2];
1158
- let {
1159
- bounds
1160
- } = draggable.props;
1161
- bounds = typeof bounds === "string" ? bounds : cloneBounds(bounds);
1162
- const node = findDOMNode(draggable);
1163
- if (typeof bounds === "string") {
1164
- const {
1165
- ownerDocument
1166
- } = node;
1167
- const ownerWindow = ownerDocument.defaultView;
1168
- let boundNode;
1169
- if (bounds === "parent") {
1170
- boundNode = node.parentNode;
1171
- } else {
1172
- const rootNode = node.getRootNode();
1173
- boundNode = rootNode.querySelector(bounds);
1174
- }
1175
- if (!(boundNode instanceof ownerWindow.HTMLElement)) {
1176
- throw new Error('Bounds selector "' + bounds + '" could not find an element.');
1177
- }
1178
- const boundNodeEl = boundNode;
1179
- const nodeStyle = ownerWindow.getComputedStyle(node);
1180
- const boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl);
1181
- bounds = {
1182
- left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
1183
- top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
1184
- right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
1185
- bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
1186
- };
1187
- }
1188
- if ((0, _shims.isNum)(bounds.right)) x2 = Math.min(x2, bounds.right);
1189
- if ((0, _shims.isNum)(bounds.bottom)) y2 = Math.min(y2, bounds.bottom);
1190
- if ((0, _shims.isNum)(bounds.left)) x2 = Math.max(x2, bounds.left);
1191
- if ((0, _shims.isNum)(bounds.top)) y2 = Math.max(y2, bounds.top);
1192
- return [x2, y2];
1193
- }
1194
- function snapToGrid(grid, pendingX, pendingY) {
1195
- const x2 = Math.round(pendingX / grid[0]) * grid[0];
1196
- const y2 = Math.round(pendingY / grid[1]) * grid[1];
1197
- return [x2, y2];
1198
- }
1199
- function canDragX(draggable) {
1200
- return draggable.props.axis === "both" || draggable.props.axis === "x";
1201
- }
1202
- function canDragY(draggable) {
1203
- return draggable.props.axis === "both" || draggable.props.axis === "y";
1204
- }
1205
- function getControlPosition(e4, touchIdentifier, draggableCore) {
1206
- const touchObj = typeof touchIdentifier === "number" ? (0, _domFns.getTouch)(e4, touchIdentifier) : null;
1207
- if (typeof touchIdentifier === "number" && !touchObj) return null;
1208
- const node = findDOMNode(draggableCore);
1209
- const offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
1210
- return (0, _domFns.offsetXYFromParent)(touchObj || e4, offsetParent, draggableCore.props.scale);
1211
- }
1212
- function createCoreData(draggable, x2, y2) {
1213
- const isStart = !(0, _shims.isNum)(draggable.lastX);
1214
- const node = findDOMNode(draggable);
1215
- if (isStart) {
1216
- return {
1217
- node,
1218
- deltaX: 0,
1219
- deltaY: 0,
1220
- lastX: x2,
1221
- lastY: y2,
1222
- x: x2,
1223
- y: y2
1224
- };
1225
- } else {
1226
- return {
1227
- node,
1228
- deltaX: x2 - draggable.lastX,
1229
- deltaY: y2 - draggable.lastY,
1230
- lastX: draggable.lastX,
1231
- lastY: draggable.lastY,
1232
- x: x2,
1233
- y: y2
1234
- };
1235
- }
1236
- }
1237
- function createDraggableData(draggable, coreData) {
1238
- const scale = draggable.props.scale;
1239
- return {
1240
- node: coreData.node,
1241
- x: draggable.state.x + coreData.deltaX / scale,
1242
- y: draggable.state.y + coreData.deltaY / scale,
1243
- deltaX: coreData.deltaX / scale,
1244
- deltaY: coreData.deltaY / scale,
1245
- lastX: draggable.state.x,
1246
- lastY: draggable.state.y
1247
- };
1248
- }
1249
- function cloneBounds(bounds) {
1250
- return {
1251
- left: bounds.left,
1252
- top: bounds.top,
1253
- right: bounds.right,
1254
- bottom: bounds.bottom
1255
- };
1256
- }
1257
- function findDOMNode(draggable) {
1258
- const node = draggable.findDOMNode();
1259
- if (!node) {
1260
- throw new Error("<DraggableCore>: Unmounted during event!");
1261
- }
1262
- return node;
1263
- }
1264
- }
1265
- });
1266
-
1267
- // ../../node_modules/react-draggable/build/cjs/utils/log.js
1268
- var require_log = __commonJS({
1269
- "../../node_modules/react-draggable/build/cjs/utils/log.js"(exports$1) {
1270
- Object.defineProperty(exports$1, "__esModule", {
1271
- value: true
1272
- });
1273
- exports$1.default = log;
1274
- function log() {
1275
- }
1276
- }
1277
- });
1278
-
1279
- // ../../node_modules/react-draggable/build/cjs/DraggableCore.js
1280
- var require_DraggableCore = __commonJS({
1281
- "../../node_modules/react-draggable/build/cjs/DraggableCore.js"(exports$1) {
1282
- Object.defineProperty(exports$1, "__esModule", {
1283
- value: true
1284
- });
1285
- exports$1.default = void 0;
1286
- var React73 = _interopRequireWildcard(__require("react"));
1287
- var _propTypes = _interopRequireDefault(require_prop_types());
1288
- var _reactDom = _interopRequireDefault(__require("react-dom"));
1289
- var _domFns = require_domFns();
1290
- var _positionFns = require_positionFns();
1291
- var _shims = require_shims();
1292
- var _log = _interopRequireDefault(require_log());
1293
- function _interopRequireDefault(e4) {
1294
- return e4 && e4.__esModule ? e4 : { default: e4 };
1295
- }
1296
- function _interopRequireWildcard(e4, t4) {
1297
- if ("function" == typeof WeakMap) var r5 = /* @__PURE__ */ new WeakMap(), n3 = /* @__PURE__ */ new WeakMap();
1298
- return (_interopRequireWildcard = function(e5, t5) {
1299
- if (!t5 && e5 && e5.__esModule) return e5;
1300
- var o3, i3, f2 = { __proto__: null, default: e5 };
1301
- if (null === e5 || "object" != typeof e5 && "function" != typeof e5) return f2;
1302
- if (o3 = t5 ? n3 : r5) {
1303
- if (o3.has(e5)) return o3.get(e5);
1304
- o3.set(e5, f2);
1305
- }
1306
- for (const t6 in e5) "default" !== t6 && {}.hasOwnProperty.call(e5, t6) && ((i3 = (o3 = Object.defineProperty) && Object.getOwnPropertyDescriptor(e5, t6)) && (i3.get || i3.set) ? o3(f2, t6, i3) : f2[t6] = e5[t6]);
1307
- return f2;
1308
- })(e4, t4);
1309
- }
1310
- function _defineProperty(e4, r5, t4) {
1311
- return (r5 = _toPropertyKey(r5)) in e4 ? Object.defineProperty(e4, r5, { value: t4, enumerable: true, configurable: true, writable: true }) : e4[r5] = t4, e4;
1312
- }
1313
- function _toPropertyKey(t4) {
1314
- var i3 = _toPrimitive(t4, "string");
1315
- return "symbol" == typeof i3 ? i3 : i3 + "";
1316
- }
1317
- function _toPrimitive(t4, r5) {
1318
- if ("object" != typeof t4 || !t4) return t4;
1319
- var e4 = t4[Symbol.toPrimitive];
1320
- if (void 0 !== e4) {
1321
- var i3 = e4.call(t4, r5);
1322
- if ("object" != typeof i3) return i3;
1323
- throw new TypeError("@@toPrimitive must return a primitive value.");
1324
- }
1325
- return ("string" === r5 ? String : Number)(t4);
1326
- }
1327
- var eventsFor = {
1328
- touch: {
1329
- start: "touchstart",
1330
- move: "touchmove",
1331
- stop: "touchend"
1332
- },
1333
- mouse: {
1334
- start: "mousedown",
1335
- move: "mousemove",
1336
- stop: "mouseup"
1337
- }
1338
- };
1339
- var dragEventFor = eventsFor.mouse;
1340
- var DraggableCore = class extends React73.Component {
1341
- constructor() {
1342
- super(...arguments);
1343
- _defineProperty(this, "dragging", false);
1344
- _defineProperty(this, "lastX", NaN);
1345
- _defineProperty(this, "lastY", NaN);
1346
- _defineProperty(this, "touchIdentifier", null);
1347
- _defineProperty(this, "mounted", false);
1348
- _defineProperty(this, "handleDragStart", (e4) => {
1349
- this.props.onMouseDown(e4);
1350
- if (!this.props.allowAnyClick && typeof e4.button === "number" && e4.button !== 0) return false;
1351
- const thisNode = this.findDOMNode();
1352
- if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
1353
- throw new Error("<DraggableCore> not mounted on DragStart!");
1354
- }
1355
- const {
1356
- ownerDocument
1357
- } = thisNode;
1358
- if (this.props.disabled || !(e4.target instanceof ownerDocument.defaultView.Node) || this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e4.target, this.props.handle, thisNode) || this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e4.target, this.props.cancel, thisNode)) {
1359
- return;
1360
- }
1361
- if (e4.type === "touchstart" && !this.props.allowMobileScroll) e4.preventDefault();
1362
- const touchIdentifier = (0, _domFns.getTouchIdentifier)(e4);
1363
- this.touchIdentifier = touchIdentifier;
1364
- const position = (0, _positionFns.getControlPosition)(e4, touchIdentifier, this);
1365
- if (position == null) return;
1366
- const {
1367
- x: x2,
1368
- y: y2
1369
- } = position;
1370
- const coreEvent = (0, _positionFns.createCoreData)(this, x2, y2);
1371
- (0, _log.default)("DraggableCore: handleDragStart: %j", coreEvent);
1372
- (0, _log.default)("calling", this.props.onStart);
1373
- const shouldUpdate = this.props.onStart(e4, coreEvent);
1374
- if (shouldUpdate === false || this.mounted === false) return;
1375
- if (this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument);
1376
- this.dragging = true;
1377
- this.lastX = x2;
1378
- this.lastY = y2;
1379
- (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, this.handleDrag);
1380
- (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, this.handleDragStop);
1381
- });
1382
- _defineProperty(this, "handleDrag", (e4) => {
1383
- const position = (0, _positionFns.getControlPosition)(e4, this.touchIdentifier, this);
1384
- if (position == null) return;
1385
- let {
1386
- x: x2,
1387
- y: y2
1388
- } = position;
1389
- if (Array.isArray(this.props.grid)) {
1390
- let deltaX = x2 - this.lastX, deltaY = y2 - this.lastY;
1391
- [deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
1392
- if (!deltaX && !deltaY) return;
1393
- x2 = this.lastX + deltaX, y2 = this.lastY + deltaY;
1394
- }
1395
- const coreEvent = (0, _positionFns.createCoreData)(this, x2, y2);
1396
- (0, _log.default)("DraggableCore: handleDrag: %j", coreEvent);
1397
- const shouldUpdate = this.props.onDrag(e4, coreEvent);
1398
- if (shouldUpdate === false || this.mounted === false) {
1399
- try {
1400
- this.handleDragStop(new MouseEvent("mouseup"));
1401
- } catch (err) {
1402
- const event = document.createEvent("MouseEvents");
1403
- event.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
1404
- this.handleDragStop(event);
1405
- }
1406
- return;
1407
- }
1408
- this.lastX = x2;
1409
- this.lastY = y2;
1410
- });
1411
- _defineProperty(this, "handleDragStop", (e4) => {
1412
- if (!this.dragging) return;
1413
- const position = (0, _positionFns.getControlPosition)(e4, this.touchIdentifier, this);
1414
- if (position == null) return;
1415
- let {
1416
- x: x2,
1417
- y: y2
1418
- } = position;
1419
- if (Array.isArray(this.props.grid)) {
1420
- let deltaX = x2 - this.lastX || 0;
1421
- let deltaY = y2 - this.lastY || 0;
1422
- [deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
1423
- x2 = this.lastX + deltaX, y2 = this.lastY + deltaY;
1424
- }
1425
- const coreEvent = (0, _positionFns.createCoreData)(this, x2, y2);
1426
- const shouldContinue = this.props.onStop(e4, coreEvent);
1427
- if (shouldContinue === false || this.mounted === false) return false;
1428
- const thisNode = this.findDOMNode();
1429
- if (thisNode) {
1430
- if (this.props.enableUserSelectHack) (0, _domFns.scheduleRemoveUserSelectStyles)(thisNode.ownerDocument);
1431
- }
1432
- (0, _log.default)("DraggableCore: handleDragStop: %j", coreEvent);
1433
- this.dragging = false;
1434
- this.lastX = NaN;
1435
- this.lastY = NaN;
1436
- if (thisNode) {
1437
- (0, _log.default)("DraggableCore: Removing handlers");
1438
- (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, this.handleDrag);
1439
- (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, this.handleDragStop);
1440
- }
1441
- });
1442
- _defineProperty(this, "onMouseDown", (e4) => {
1443
- dragEventFor = eventsFor.mouse;
1444
- return this.handleDragStart(e4);
1445
- });
1446
- _defineProperty(this, "onMouseUp", (e4) => {
1447
- dragEventFor = eventsFor.mouse;
1448
- return this.handleDragStop(e4);
1449
- });
1450
- _defineProperty(this, "onTouchStart", (e4) => {
1451
- dragEventFor = eventsFor.touch;
1452
- return this.handleDragStart(e4);
1453
- });
1454
- _defineProperty(this, "onTouchEnd", (e4) => {
1455
- dragEventFor = eventsFor.touch;
1456
- return this.handleDragStop(e4);
1457
- });
1458
- }
1459
- componentDidMount() {
1460
- this.mounted = true;
1461
- const thisNode = this.findDOMNode();
1462
- if (thisNode) {
1463
- (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
1464
- passive: false
1465
- });
1466
- }
1467
- }
1468
- componentWillUnmount() {
1469
- this.mounted = false;
1470
- const thisNode = this.findDOMNode();
1471
- if (thisNode) {
1472
- const {
1473
- ownerDocument
1474
- } = thisNode;
1475
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
1476
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
1477
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
1478
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
1479
- (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
1480
- passive: false
1481
- });
1482
- if (this.props.enableUserSelectHack) (0, _domFns.scheduleRemoveUserSelectStyles)(ownerDocument);
1483
- }
1484
- }
1485
- // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
1486
- // the underlying DOM node ourselves. See the README for more information.
1487
- findDOMNode() {
1488
- var _a, _b, _c;
1489
- return ((_a = this.props) == null ? void 0 : _a.nodeRef) ? (_c = (_b = this.props) == null ? void 0 : _b.nodeRef) == null ? void 0 : _c.current : _reactDom.default.findDOMNode(this);
1490
- }
1491
- render() {
1492
- return /* @__PURE__ */ React73.cloneElement(React73.Children.only(this.props.children), {
1493
- // Note: mouseMove handler is attached to document so it will still function
1494
- // when the user drags quickly and leaves the bounds of the element.
1495
- onMouseDown: this.onMouseDown,
1496
- onMouseUp: this.onMouseUp,
1497
- // onTouchStart is added on `componentDidMount` so they can be added with
1498
- // {passive: false}, which allows it to cancel. See
1499
- // https://developers.google.com/web/updates/2017/01/scrolling-intervention
1500
- onTouchEnd: this.onTouchEnd
1501
- });
1502
- }
1503
- };
1504
- exports$1.default = DraggableCore;
1505
- _defineProperty(DraggableCore, "displayName", "DraggableCore");
1506
- _defineProperty(DraggableCore, "propTypes", {
1507
- /**
1508
- * `allowAnyClick` allows dragging using any mouse button.
1509
- * By default, we only accept the left button.
1510
- *
1511
- * Defaults to `false`.
1512
- */
1513
- allowAnyClick: _propTypes.default.bool,
1514
- /**
1515
- * `allowMobileScroll` turns off cancellation of the 'touchstart' event
1516
- * on mobile devices. Only enable this if you are having trouble with click
1517
- * events. Prefer using 'handle' / 'cancel' instead.
1518
- *
1519
- * Defaults to `false`.
1520
- */
1521
- allowMobileScroll: _propTypes.default.bool,
1522
- children: _propTypes.default.node.isRequired,
1523
- /**
1524
- * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
1525
- * with the exception of `onMouseDown`, will not fire.
1526
- */
1527
- disabled: _propTypes.default.bool,
1528
- /**
1529
- * By default, we add 'user-select:none' attributes to the document body
1530
- * to prevent ugly text selection during drag. If this is causing problems
1531
- * for your app, set this to `false`.
1532
- */
1533
- enableUserSelectHack: _propTypes.default.bool,
1534
- /**
1535
- * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
1536
- * instead of using the parent node.
1537
- */
1538
- offsetParent: function(props, propName) {
1539
- if (props[propName] && props[propName].nodeType !== 1) {
1540
- throw new Error("Draggable's offsetParent must be a DOM Node.");
1541
- }
1542
- },
1543
- /**
1544
- * `grid` specifies the x and y that dragging should snap to.
1545
- */
1546
- grid: _propTypes.default.arrayOf(_propTypes.default.number),
1547
- /**
1548
- * `handle` specifies a selector to be used as the handle that initiates drag.
1549
- *
1550
- * Example:
1551
- *
1552
- * ```jsx
1553
- * let App = React.createClass({
1554
- * render: function () {
1555
- * return (
1556
- * <Draggable handle=".handle">
1557
- * <div>
1558
- * <div className="handle">Click me to drag</div>
1559
- * <div>This is some other content</div>
1560
- * </div>
1561
- * </Draggable>
1562
- * );
1563
- * }
1564
- * });
1565
- * ```
1566
- */
1567
- handle: _propTypes.default.string,
1568
- /**
1569
- * `cancel` specifies a selector to be used to prevent drag initialization.
1570
- *
1571
- * Example:
1572
- *
1573
- * ```jsx
1574
- * let App = React.createClass({
1575
- * render: function () {
1576
- * return(
1577
- * <Draggable cancel=".cancel">
1578
- * <div>
1579
- * <div className="cancel">You can't drag from here</div>
1580
- * <div>Dragging here works fine</div>
1581
- * </div>
1582
- * </Draggable>
1583
- * );
1584
- * }
1585
- * });
1586
- * ```
1587
- */
1588
- cancel: _propTypes.default.string,
1589
- /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
1590
- * Unfortunately, in order for <Draggable> to work properly, we need raw access
1591
- * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
1592
- * as in this example:
1593
- *
1594
- * function MyComponent() {
1595
- * const nodeRef = React.useRef(null);
1596
- * return (
1597
- * <Draggable nodeRef={nodeRef}>
1598
- * <div ref={nodeRef}>Example Target</div>
1599
- * </Draggable>
1600
- * );
1601
- * }
1602
- *
1603
- * This can be used for arbitrarily nested components, so long as the ref ends up
1604
- * pointing to the actual child DOM node and not a custom component.
1605
- */
1606
- nodeRef: _propTypes.default.object,
1607
- /**
1608
- * Called when dragging starts.
1609
- * If this function returns the boolean false, dragging will be canceled.
1610
- */
1611
- onStart: _propTypes.default.func,
1612
- /**
1613
- * Called while dragging.
1614
- * If this function returns the boolean false, dragging will be canceled.
1615
- */
1616
- onDrag: _propTypes.default.func,
1617
- /**
1618
- * Called when dragging stops.
1619
- * If this function returns the boolean false, the drag will remain active.
1620
- */
1621
- onStop: _propTypes.default.func,
1622
- /**
1623
- * A workaround option which can be passed if onMouseDown needs to be accessed,
1624
- * since it'll always be blocked (as there is internal use of onMouseDown)
1625
- */
1626
- onMouseDown: _propTypes.default.func,
1627
- /**
1628
- * `scale`, if set, applies scaling while dragging an element
1629
- */
1630
- scale: _propTypes.default.number,
1631
- /**
1632
- * These properties should be defined on the child, not here.
1633
- */
1634
- className: _shims.dontSetMe,
1635
- style: _shims.dontSetMe,
1636
- transform: _shims.dontSetMe
1637
- });
1638
- _defineProperty(DraggableCore, "defaultProps", {
1639
- allowAnyClick: false,
1640
- // by default only accept left click
1641
- allowMobileScroll: false,
1642
- disabled: false,
1643
- enableUserSelectHack: true,
1644
- onStart: function() {
1645
- },
1646
- onDrag: function() {
1647
- },
1648
- onStop: function() {
1649
- },
1650
- onMouseDown: function() {
1651
- },
1652
- scale: 1
1653
- });
1654
- }
1655
- });
1656
-
1657
- // ../../node_modules/react-draggable/build/cjs/Draggable.js
1658
- var require_Draggable = __commonJS({
1659
- "../../node_modules/react-draggable/build/cjs/Draggable.js"(exports$1) {
1660
- Object.defineProperty(exports$1, "__esModule", {
1661
- value: true
1662
- });
1663
- Object.defineProperty(exports$1, "DraggableCore", {
1664
- enumerable: true,
1665
- get: function() {
1666
- return _DraggableCore.default;
1667
- }
1668
- });
1669
- exports$1.default = void 0;
1670
- var React73 = _interopRequireWildcard(__require("react"));
1671
- var _propTypes = _interopRequireDefault(require_prop_types());
1672
- var _reactDom = _interopRequireDefault(__require("react-dom"));
1673
- var _clsx = require_clsx();
1674
- var _domFns = require_domFns();
1675
- var _positionFns = require_positionFns();
1676
- var _shims = require_shims();
1677
- var _DraggableCore = _interopRequireDefault(require_DraggableCore());
1678
- var _log = _interopRequireDefault(require_log());
1679
- function _interopRequireDefault(e4) {
1680
- return e4 && e4.__esModule ? e4 : { default: e4 };
1681
- }
1682
- function _interopRequireWildcard(e4, t4) {
1683
- if ("function" == typeof WeakMap) var r5 = /* @__PURE__ */ new WeakMap(), n3 = /* @__PURE__ */ new WeakMap();
1684
- return (_interopRequireWildcard = function(e5, t5) {
1685
- if (!t5 && e5 && e5.__esModule) return e5;
1686
- var o3, i3, f2 = { __proto__: null, default: e5 };
1687
- if (null === e5 || "object" != typeof e5 && "function" != typeof e5) return f2;
1688
- if (o3 = t5 ? n3 : r5) {
1689
- if (o3.has(e5)) return o3.get(e5);
1690
- o3.set(e5, f2);
1691
- }
1692
- for (const t6 in e5) "default" !== t6 && {}.hasOwnProperty.call(e5, t6) && ((i3 = (o3 = Object.defineProperty) && Object.getOwnPropertyDescriptor(e5, t6)) && (i3.get || i3.set) ? o3(f2, t6, i3) : f2[t6] = e5[t6]);
1693
- return f2;
1694
- })(e4, t4);
1695
- }
1696
- function _extends() {
1697
- return _extends = Object.assign ? Object.assign.bind() : function(n3) {
1698
- for (var e4 = 1; e4 < arguments.length; e4++) {
1699
- var t4 = arguments[e4];
1700
- for (var r5 in t4) ({}).hasOwnProperty.call(t4, r5) && (n3[r5] = t4[r5]);
1701
- }
1702
- return n3;
1703
- }, _extends.apply(null, arguments);
1704
- }
1705
- function _defineProperty(e4, r5, t4) {
1706
- return (r5 = _toPropertyKey(r5)) in e4 ? Object.defineProperty(e4, r5, { value: t4, enumerable: true, configurable: true, writable: true }) : e4[r5] = t4, e4;
1707
- }
1708
- function _toPropertyKey(t4) {
1709
- var i3 = _toPrimitive(t4, "string");
1710
- return "symbol" == typeof i3 ? i3 : i3 + "";
1711
- }
1712
- function _toPrimitive(t4, r5) {
1713
- if ("object" != typeof t4 || !t4) return t4;
1714
- var e4 = t4[Symbol.toPrimitive];
1715
- if (void 0 !== e4) {
1716
- var i3 = e4.call(t4, r5);
1717
- if ("object" != typeof i3) return i3;
1718
- throw new TypeError("@@toPrimitive must return a primitive value.");
1719
- }
1720
- return ("string" === r5 ? String : Number)(t4);
1721
- }
1722
- var Draggable2 = class extends React73.Component {
1723
- // React 16.3+
1724
- // Arity (props, state)
1725
- static getDerivedStateFromProps(_ref, _ref2) {
1726
- let {
1727
- position
1728
- } = _ref;
1729
- let {
1730
- prevPropsPosition
1731
- } = _ref2;
1732
- if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
1733
- (0, _log.default)("Draggable: getDerivedStateFromProps %j", {
1734
- position,
1735
- prevPropsPosition
1736
- });
1737
- return {
1738
- x: position.x,
1739
- y: position.y,
1740
- prevPropsPosition: {
1741
- ...position
1742
- }
1743
- };
1744
- }
1745
- return null;
1746
- }
1747
- constructor(props) {
1748
- super(props);
1749
- _defineProperty(this, "onDragStart", (e4, coreData) => {
1750
- (0, _log.default)("Draggable: onDragStart: %j", coreData);
1751
- const shouldStart = this.props.onStart(e4, (0, _positionFns.createDraggableData)(this, coreData));
1752
- if (shouldStart === false) return false;
1753
- this.setState({
1754
- dragging: true,
1755
- dragged: true
1756
- });
1757
- });
1758
- _defineProperty(this, "onDrag", (e4, coreData) => {
1759
- if (!this.state.dragging) return false;
1760
- (0, _log.default)("Draggable: onDrag: %j", coreData);
1761
- const uiData = (0, _positionFns.createDraggableData)(this, coreData);
1762
- const newState = {
1763
- x: uiData.x,
1764
- y: uiData.y,
1765
- slackX: 0,
1766
- slackY: 0
1767
- };
1768
- if (this.props.bounds) {
1769
- const {
1770
- x: x2,
1771
- y: y2
1772
- } = newState;
1773
- newState.x += this.state.slackX;
1774
- newState.y += this.state.slackY;
1775
- const [newStateX, newStateY] = (0, _positionFns.getBoundPosition)(this, newState.x, newState.y);
1776
- newState.x = newStateX;
1777
- newState.y = newStateY;
1778
- newState.slackX = this.state.slackX + (x2 - newState.x);
1779
- newState.slackY = this.state.slackY + (y2 - newState.y);
1780
- uiData.x = newState.x;
1781
- uiData.y = newState.y;
1782
- uiData.deltaX = newState.x - this.state.x;
1783
- uiData.deltaY = newState.y - this.state.y;
1784
- }
1785
- const shouldUpdate = this.props.onDrag(e4, uiData);
1786
- if (shouldUpdate === false) return false;
1787
- this.setState(newState);
1788
- });
1789
- _defineProperty(this, "onDragStop", (e4, coreData) => {
1790
- if (!this.state.dragging) return false;
1791
- const shouldContinue = this.props.onStop(e4, (0, _positionFns.createDraggableData)(this, coreData));
1792
- if (shouldContinue === false) return false;
1793
- (0, _log.default)("Draggable: onDragStop: %j", coreData);
1794
- const newState = {
1795
- dragging: false,
1796
- slackX: 0,
1797
- slackY: 0
1798
- };
1799
- const controlled = Boolean(this.props.position);
1800
- if (controlled) {
1801
- const {
1802
- x: x2,
1803
- y: y2
1804
- } = this.props.position;
1805
- newState.x = x2;
1806
- newState.y = y2;
1807
- }
1808
- this.setState(newState);
1809
- });
1810
- this.state = {
1811
- // Whether or not we are currently dragging.
1812
- dragging: false,
1813
- // Whether or not we have been dragged before.
1814
- dragged: false,
1815
- // Current transform x and y.
1816
- x: props.position ? props.position.x : props.defaultPosition.x,
1817
- y: props.position ? props.position.y : props.defaultPosition.y,
1818
- prevPropsPosition: {
1819
- ...props.position
1820
- },
1821
- // Used for compensating for out-of-bounds drags
1822
- slackX: 0,
1823
- slackY: 0,
1824
- // Can only determine if SVG after mounting
1825
- isElementSVG: false
1826
- };
1827
- if (props.position && !(props.onDrag || props.onStop)) {
1828
- console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
1829
- }
1830
- }
1831
- componentDidMount() {
1832
- if (typeof window.SVGElement !== "undefined" && this.findDOMNode() instanceof window.SVGElement) {
1833
- this.setState({
1834
- isElementSVG: true
1835
- });
1836
- }
1837
- }
1838
- componentWillUnmount() {
1839
- if (this.state.dragging) {
1840
- this.setState({
1841
- dragging: false
1842
- });
1843
- }
1844
- }
1845
- // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
1846
- // the underlying DOM node ourselves. See the README for more information.
1847
- findDOMNode() {
1848
- var _a, _b, _c;
1849
- return (_c = (_b = (_a = this.props) == null ? void 0 : _a.nodeRef) == null ? void 0 : _b.current) != null ? _c : _reactDom.default.findDOMNode(this);
1850
- }
1851
- render() {
1852
- const {
1853
- axis,
1854
- bounds,
1855
- children,
1856
- defaultPosition,
1857
- defaultClassName,
1858
- defaultClassNameDragging,
1859
- defaultClassNameDragged,
1860
- position,
1861
- positionOffset,
1862
- scale,
1863
- ...draggableCoreProps
1864
- } = this.props;
1865
- let style = {};
1866
- let svgTransform = null;
1867
- const controlled = Boolean(position);
1868
- const draggable = !controlled || this.state.dragging;
1869
- const validPosition = position || defaultPosition;
1870
- const transformOpts = {
1871
- // Set left if horizontal drag is enabled
1872
- x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
1873
- // Set top if vertical drag is enabled
1874
- y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
1875
- };
1876
- if (this.state.isElementSVG) {
1877
- svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
1878
- } else {
1879
- style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
1880
- }
1881
- const className = (0, _clsx.clsx)(children.props.className || "", defaultClassName, {
1882
- [defaultClassNameDragging]: this.state.dragging,
1883
- [defaultClassNameDragged]: this.state.dragged
1884
- });
1885
- return /* @__PURE__ */ React73.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
1886
- onStart: this.onDragStart,
1887
- onDrag: this.onDrag,
1888
- onStop: this.onDragStop
1889
- }), /* @__PURE__ */ React73.cloneElement(React73.Children.only(children), {
1890
- className,
1891
- style: {
1892
- ...children.props.style,
1893
- ...style
1894
- },
1895
- transform: svgTransform
1896
- }));
1897
- }
1898
- };
1899
- exports$1.default = Draggable2;
1900
- _defineProperty(Draggable2, "displayName", "Draggable");
1901
- _defineProperty(Draggable2, "propTypes", {
1902
- // Accepts all props <DraggableCore> accepts.
1903
- ..._DraggableCore.default.propTypes,
1904
- /**
1905
- * `axis` determines which axis the draggable can move.
1906
- *
1907
- * Note that all callbacks will still return data as normal. This only
1908
- * controls flushing to the DOM.
1909
- *
1910
- * 'both' allows movement horizontally and vertically.
1911
- * 'x' limits movement to horizontal axis.
1912
- * 'y' limits movement to vertical axis.
1913
- * 'none' limits all movement.
1914
- *
1915
- * Defaults to 'both'.
1916
- */
1917
- axis: _propTypes.default.oneOf(["both", "x", "y", "none"]),
1918
- /**
1919
- * `bounds` determines the range of movement available to the element.
1920
- * Available values are:
1921
- *
1922
- * 'parent' restricts movement within the Draggable's parent node.
1923
- *
1924
- * Alternatively, pass an object with the following properties, all of which are optional:
1925
- *
1926
- * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
1927
- *
1928
- * All values are in px.
1929
- *
1930
- * Example:
1931
- *
1932
- * ```jsx
1933
- * let App = React.createClass({
1934
- * render: function () {
1935
- * return (
1936
- * <Draggable bounds={{right: 300, bottom: 300}}>
1937
- * <div>Content</div>
1938
- * </Draggable>
1939
- * );
1940
- * }
1941
- * });
1942
- * ```
1943
- */
1944
- bounds: _propTypes.default.oneOfType([_propTypes.default.shape({
1945
- left: _propTypes.default.number,
1946
- right: _propTypes.default.number,
1947
- top: _propTypes.default.number,
1948
- bottom: _propTypes.default.number
1949
- }), _propTypes.default.string, _propTypes.default.oneOf([false])]),
1950
- defaultClassName: _propTypes.default.string,
1951
- defaultClassNameDragging: _propTypes.default.string,
1952
- defaultClassNameDragged: _propTypes.default.string,
1953
- /**
1954
- * `defaultPosition` specifies the x and y that the dragged item should start at
1955
- *
1956
- * Example:
1957
- *
1958
- * ```jsx
1959
- * let App = React.createClass({
1960
- * render: function () {
1961
- * return (
1962
- * <Draggable defaultPosition={{x: 25, y: 25}}>
1963
- * <div>I start with transformX: 25px and transformY: 25px;</div>
1964
- * </Draggable>
1965
- * );
1966
- * }
1967
- * });
1968
- * ```
1969
- */
1970
- defaultPosition: _propTypes.default.shape({
1971
- x: _propTypes.default.number,
1972
- y: _propTypes.default.number
1973
- }),
1974
- positionOffset: _propTypes.default.shape({
1975
- x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
1976
- y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
1977
- }),
1978
- /**
1979
- * `position`, if present, defines the current position of the element.
1980
- *
1981
- * This is similar to how form elements in React work - if no `position` is supplied, the component
1982
- * is uncontrolled.
1983
- *
1984
- * Example:
1985
- *
1986
- * ```jsx
1987
- * let App = React.createClass({
1988
- * render: function () {
1989
- * return (
1990
- * <Draggable position={{x: 25, y: 25}}>
1991
- * <div>I start with transformX: 25px and transformY: 25px;</div>
1992
- * </Draggable>
1993
- * );
1994
- * }
1995
- * });
1996
- * ```
1997
- */
1998
- position: _propTypes.default.shape({
1999
- x: _propTypes.default.number,
2000
- y: _propTypes.default.number
2001
- }),
2002
- /**
2003
- * These properties should be defined on the child, not here.
2004
- */
2005
- className: _shims.dontSetMe,
2006
- style: _shims.dontSetMe,
2007
- transform: _shims.dontSetMe
2008
- });
2009
- _defineProperty(Draggable2, "defaultProps", {
2010
- ..._DraggableCore.default.defaultProps,
2011
- axis: "both",
2012
- bounds: false,
2013
- defaultClassName: "react-draggable",
2014
- defaultClassNameDragging: "react-draggable-dragging",
2015
- defaultClassNameDragged: "react-draggable-dragged",
2016
- defaultPosition: {
2017
- x: 0,
2018
- y: 0
2019
- },
2020
- scale: 1
2021
- });
2022
- }
2023
- });
2024
-
2025
- // ../../node_modules/react-draggable/build/cjs/cjs.js
2026
- var require_cjs = __commonJS({
2027
- "../../node_modules/react-draggable/build/cjs/cjs.js"(exports$1, module2) {
2028
- var {
2029
- default: Draggable2,
2030
- DraggableCore
2031
- } = require_Draggable();
2032
- module2.exports = Draggable2;
2033
- module2.exports.default = Draggable2;
2034
- module2.exports.DraggableCore = DraggableCore;
2035
- }
2036
- });
2037
30
 
2038
31
  // src/presets/lister/runtime/session/store.ts
2039
32
  function createSessionStore(initial) {
@@ -3140,9 +1133,6 @@ function useListerRuntime() {
3140
1133
  return ctx;
3141
1134
  }
3142
1135
 
3143
- // src/presets/lister/lister-ui.tsx
3144
- var import_react_draggable = __toESM(require_cjs());
3145
-
3146
1136
  // ../../node_modules/clsx/dist/clsx.mjs
3147
1137
  function r(e4) {
3148
1138
  var t4, f2, n3 = "";
@@ -28243,7 +26233,7 @@ function ListerSessionPanel(props) {
28243
26233
  );
28244
26234
  }
28245
26235
  return /* @__PURE__ */ jsx(
28246
- import_react_draggable.default,
26236
+ Draggable,
28247
26237
  {
28248
26238
  nodeRef,
28249
26239
  bounds: "parent",
@@ -28719,23 +26709,6 @@ function useData(opts) {
28719
26709
  }
28720
26710
  /*! Bundled license information:
28721
26711
 
28722
- react-is/cjs/react-is.development.js:
28723
- (** @license React v16.13.1
28724
- * react-is.development.js
28725
- *
28726
- * Copyright (c) Facebook, Inc. and its affiliates.
28727
- *
28728
- * This source code is licensed under the MIT license found in the
28729
- * LICENSE file in the root directory of this source tree.
28730
- *)
28731
-
28732
- object-assign/index.js:
28733
- (*
28734
- object-assign
28735
- (c) Sindre Sorhus
28736
- @license MIT
28737
- *)
28738
-
28739
26712
  lucide-react/dist/esm/shared/src/utils.js:
28740
26713
  lucide-react/dist/esm/defaultAttributes.js:
28741
26714
  lucide-react/dist/esm/Icon.js: