@ninesstudios/whiteboard 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/whiteboard.es.js +444 -420
- package/dist/whiteboard.es.js.map +1 -1
- package/dist/whiteboard.umd.js +16 -16
- package/dist/whiteboard.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/whiteboard.es.js
CHANGED
|
@@ -95,42 +95,42 @@ function No() {
|
|
|
95
95
|
process.env.NODE_ENV !== "production" && (function() {
|
|
96
96
|
var t = Se, r = Xn(), n = 60103, i = 60106;
|
|
97
97
|
e.Fragment = 60107;
|
|
98
|
-
var a = 60108, l = 60114, u = 60109, p = 60110, c = 60112, v = 60113, b = 60120, s = 60115, S = 60116,
|
|
98
|
+
var a = 60108, l = 60114, u = 60109, p = 60110, c = 60112, v = 60113, b = 60120, s = 60115, S = 60116, g = 60121, y = 60122, E = 60117, C = 60129, O = 60131;
|
|
99
99
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
100
100
|
var T = Symbol.for;
|
|
101
|
-
n = T("react.element"), i = T("react.portal"), e.Fragment = T("react.fragment"), a = T("react.strict_mode"), l = T("react.profiler"), u = T("react.provider"), p = T("react.context"), c = T("react.forward_ref"), v = T("react.suspense"), b = T("react.suspense_list"), s = T("react.memo"), S = T("react.lazy"),
|
|
101
|
+
n = T("react.element"), i = T("react.portal"), e.Fragment = T("react.fragment"), a = T("react.strict_mode"), l = T("react.profiler"), u = T("react.provider"), p = T("react.context"), c = T("react.forward_ref"), v = T("react.suspense"), b = T("react.suspense_list"), s = T("react.memo"), S = T("react.lazy"), g = T("react.block"), y = T("react.server.block"), E = T("react.fundamental"), T("react.scope"), T("react.opaque.id"), C = T("react.debug_trace_mode"), T("react.offscreen"), O = T("react.legacy_hidden");
|
|
102
102
|
}
|
|
103
103
|
var A = typeof Symbol == "function" && Symbol.iterator, x = "@@iterator";
|
|
104
104
|
function I(d) {
|
|
105
105
|
if (d === null || typeof d != "object")
|
|
106
106
|
return null;
|
|
107
|
-
var
|
|
108
|
-
return typeof
|
|
107
|
+
var k = A && d[A] || d[x];
|
|
108
|
+
return typeof k == "function" ? k : null;
|
|
109
109
|
}
|
|
110
110
|
var $ = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
111
111
|
function j(d) {
|
|
112
112
|
{
|
|
113
|
-
for (var
|
|
113
|
+
for (var k = arguments.length, L = new Array(k > 1 ? k - 1 : 0), B = 1; B < k; B++)
|
|
114
114
|
L[B - 1] = arguments[B];
|
|
115
115
|
F("error", d, L);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
function F(d,
|
|
118
|
+
function F(d, k, L) {
|
|
119
119
|
{
|
|
120
120
|
var B = $.ReactDebugCurrentFrame, J = B.getStackAddendum();
|
|
121
|
-
J !== "" && (
|
|
121
|
+
J !== "" && (k += "%s", L = L.concat([J]));
|
|
122
122
|
var Z = L.map(function(K) {
|
|
123
123
|
return "" + K;
|
|
124
124
|
});
|
|
125
|
-
Z.unshift("Warning: " +
|
|
125
|
+
Z.unshift("Warning: " + k), Function.prototype.apply.call(console[d], console, Z);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
var R = !1;
|
|
129
129
|
function Q(d) {
|
|
130
|
-
return !!(typeof d == "string" || typeof d == "function" || d === e.Fragment || d === l || d === C || d === a || d === v || d === b || d === O || R || typeof d == "object" && d !== null && (d.$$typeof === S || d.$$typeof === s || d.$$typeof === u || d.$$typeof === p || d.$$typeof === c || d.$$typeof === E || d.$$typeof ===
|
|
130
|
+
return !!(typeof d == "string" || typeof d == "function" || d === e.Fragment || d === l || d === C || d === a || d === v || d === b || d === O || R || typeof d == "object" && d !== null && (d.$$typeof === S || d.$$typeof === s || d.$$typeof === u || d.$$typeof === p || d.$$typeof === c || d.$$typeof === E || d.$$typeof === g || d[0] === y));
|
|
131
131
|
}
|
|
132
|
-
function ue(d,
|
|
133
|
-
var B =
|
|
132
|
+
function ue(d, k, L) {
|
|
133
|
+
var B = k.displayName || k.name || "";
|
|
134
134
|
return d.displayName || (B !== "" ? L + "(" + B + ")" : L);
|
|
135
135
|
}
|
|
136
136
|
function pe(d) {
|
|
@@ -160,8 +160,8 @@ function No() {
|
|
|
160
160
|
if (typeof d == "object")
|
|
161
161
|
switch (d.$$typeof) {
|
|
162
162
|
case p:
|
|
163
|
-
var
|
|
164
|
-
return pe(
|
|
163
|
+
var k = d;
|
|
164
|
+
return pe(k) + ".Consumer";
|
|
165
165
|
case u:
|
|
166
166
|
var L = d;
|
|
167
167
|
return pe(L._context) + ".Provider";
|
|
@@ -169,7 +169,7 @@ function No() {
|
|
|
169
169
|
return ue(d, d.render, "ForwardRef");
|
|
170
170
|
case s:
|
|
171
171
|
return ve(d.type);
|
|
172
|
-
case
|
|
172
|
+
case g:
|
|
173
173
|
return ve(d._render);
|
|
174
174
|
case S: {
|
|
175
175
|
var B = d, J = B._payload, Z = B._init;
|
|
@@ -245,7 +245,7 @@ function No() {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
var Ue = $.ReactCurrentDispatcher, qe;
|
|
248
|
-
function Ie(d,
|
|
248
|
+
function Ie(d, k, L) {
|
|
249
249
|
{
|
|
250
250
|
if (qe === void 0)
|
|
251
251
|
try {
|
|
@@ -263,7 +263,7 @@ function No() {
|
|
|
263
263
|
var et = typeof WeakMap == "function" ? WeakMap : Map;
|
|
264
264
|
De = new et();
|
|
265
265
|
}
|
|
266
|
-
function Y(d,
|
|
266
|
+
function Y(d, k) {
|
|
267
267
|
if (!d || je)
|
|
268
268
|
return "";
|
|
269
269
|
{
|
|
@@ -278,7 +278,7 @@ function No() {
|
|
|
278
278
|
var Z;
|
|
279
279
|
Z = Ue.current, Ue.current = null, Qe();
|
|
280
280
|
try {
|
|
281
|
-
if (
|
|
281
|
+
if (k) {
|
|
282
282
|
var K = function() {
|
|
283
283
|
throw Error();
|
|
284
284
|
};
|
|
@@ -334,14 +334,14 @@ function No() {
|
|
|
334
334
|
var Ge = d ? d.displayName || d.name : "", qt = Ge ? Ie(Ge) : "";
|
|
335
335
|
return typeof d == "function" && De.set(d, qt), qt;
|
|
336
336
|
}
|
|
337
|
-
function Ce(d,
|
|
337
|
+
function Ce(d, k, L) {
|
|
338
338
|
return Y(d, !1);
|
|
339
339
|
}
|
|
340
340
|
function V(d) {
|
|
341
|
-
var
|
|
342
|
-
return !!(
|
|
341
|
+
var k = d.prototype;
|
|
342
|
+
return !!(k && k.isReactComponent);
|
|
343
343
|
}
|
|
344
|
-
function be(d,
|
|
344
|
+
function be(d, k, L) {
|
|
345
345
|
if (d == null)
|
|
346
346
|
return "";
|
|
347
347
|
if (typeof d == "function")
|
|
@@ -359,13 +359,13 @@ function No() {
|
|
|
359
359
|
case c:
|
|
360
360
|
return Ce(d.render);
|
|
361
361
|
case s:
|
|
362
|
-
return be(d.type,
|
|
363
|
-
case
|
|
362
|
+
return be(d.type, k, L);
|
|
363
|
+
case g:
|
|
364
364
|
return Ce(d._render);
|
|
365
365
|
case S: {
|
|
366
366
|
var B = d, J = B._payload, Z = B._init;
|
|
367
367
|
try {
|
|
368
|
-
return be(Z(J),
|
|
368
|
+
return be(Z(J), k, L);
|
|
369
369
|
} catch {
|
|
370
370
|
}
|
|
371
371
|
}
|
|
@@ -375,12 +375,12 @@ function No() {
|
|
|
375
375
|
var Pe = {}, ze = $.ReactDebugCurrentFrame;
|
|
376
376
|
function gt(d) {
|
|
377
377
|
if (d) {
|
|
378
|
-
var
|
|
378
|
+
var k = d._owner, L = be(d.type, d._source, k ? k.type : null);
|
|
379
379
|
ze.setExtraStackFrame(L);
|
|
380
380
|
} else
|
|
381
381
|
ze.setExtraStackFrame(null);
|
|
382
382
|
}
|
|
383
|
-
function Xt(d,
|
|
383
|
+
function Xt(d, k, L, B, J) {
|
|
384
384
|
{
|
|
385
385
|
var Z = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
386
386
|
for (var K in d)
|
|
@@ -391,7 +391,7 @@ function No() {
|
|
|
391
391
|
var le = Error((B || "React class") + ": " + L + " type `" + K + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof d[K] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
392
392
|
throw le.name = "Invariant Violation", le;
|
|
393
393
|
}
|
|
394
|
-
q = d[K](
|
|
394
|
+
q = d[K](k, K, B, L, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
395
395
|
} catch (ie) {
|
|
396
396
|
q = ie;
|
|
397
397
|
}
|
|
@@ -407,27 +407,27 @@ function No() {
|
|
|
407
407
|
}, At, It;
|
|
408
408
|
function Bt(d) {
|
|
409
409
|
if (bt.call(d, "ref")) {
|
|
410
|
-
var
|
|
411
|
-
if (
|
|
410
|
+
var k = Object.getOwnPropertyDescriptor(d, "ref").get;
|
|
411
|
+
if (k && k.isReactWarning)
|
|
412
412
|
return !1;
|
|
413
413
|
}
|
|
414
414
|
return d.ref !== void 0;
|
|
415
415
|
}
|
|
416
416
|
function wt(d) {
|
|
417
417
|
if (bt.call(d, "key")) {
|
|
418
|
-
var
|
|
419
|
-
if (
|
|
418
|
+
var k = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
419
|
+
if (k && k.isReactWarning)
|
|
420
420
|
return !1;
|
|
421
421
|
}
|
|
422
422
|
return d.key !== void 0;
|
|
423
423
|
}
|
|
424
|
-
function Ut(d,
|
|
424
|
+
function Ut(d, k) {
|
|
425
425
|
typeof d.ref == "string" && me.current;
|
|
426
426
|
}
|
|
427
|
-
function ae(d,
|
|
427
|
+
function ae(d, k) {
|
|
428
428
|
{
|
|
429
429
|
var L = function() {
|
|
430
|
-
At || (At = !0, j("%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://reactjs.org/link/special-props)",
|
|
430
|
+
At || (At = !0, j("%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://reactjs.org/link/special-props)", k));
|
|
431
431
|
};
|
|
432
432
|
L.isReactWarning = !0, Object.defineProperty(d, "key", {
|
|
433
433
|
get: L,
|
|
@@ -435,10 +435,10 @@ function No() {
|
|
|
435
435
|
});
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
function Dt(d,
|
|
438
|
+
function Dt(d, k) {
|
|
439
439
|
{
|
|
440
440
|
var L = function() {
|
|
441
|
-
It || (It = !0, j("%s: `ref` 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://reactjs.org/link/special-props)",
|
|
441
|
+
It || (It = !0, j("%s: `ref` 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://reactjs.org/link/special-props)", k));
|
|
442
442
|
};
|
|
443
443
|
L.isReactWarning = !0, Object.defineProperty(d, "ref", {
|
|
444
444
|
get: L,
|
|
@@ -446,13 +446,13 @@ function No() {
|
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
var lr = function(d,
|
|
449
|
+
var lr = function(d, k, L, B, J, Z, K) {
|
|
450
450
|
var q = {
|
|
451
451
|
// This tag allows us to uniquely identify this as a React Element
|
|
452
452
|
$$typeof: n,
|
|
453
453
|
// Built-in properties that belong on the element
|
|
454
454
|
type: d,
|
|
455
|
-
key:
|
|
455
|
+
key: k,
|
|
456
456
|
ref: L,
|
|
457
457
|
props: K,
|
|
458
458
|
// Record the component responsible for creating this element.
|
|
@@ -475,12 +475,12 @@ function No() {
|
|
|
475
475
|
value: J
|
|
476
476
|
}), Object.freeze && (Object.freeze(q.props), Object.freeze(q)), q;
|
|
477
477
|
};
|
|
478
|
-
function ut(d,
|
|
478
|
+
function ut(d, k, L, B, J) {
|
|
479
479
|
{
|
|
480
480
|
var Z, K = {}, q = null, le = null;
|
|
481
|
-
L !== void 0 && (q = "" + L), wt(
|
|
482
|
-
for (Z in
|
|
483
|
-
bt.call(
|
|
481
|
+
L !== void 0 && (q = "" + L), wt(k) && (q = "" + k.key), Bt(k) && (le = k.ref, Ut(k, J));
|
|
482
|
+
for (Z in k)
|
|
483
|
+
bt.call(k, Z) && !Nt.hasOwnProperty(Z) && (K[Z] = k[Z]);
|
|
484
484
|
if (d && d.defaultProps) {
|
|
485
485
|
var ie = d.defaultProps;
|
|
486
486
|
for (Z in ie)
|
|
@@ -496,7 +496,7 @@ function No() {
|
|
|
496
496
|
var xt = $.ReactCurrentOwner, zt = $.ReactDebugCurrentFrame;
|
|
497
497
|
function Le(d) {
|
|
498
498
|
if (d) {
|
|
499
|
-
var
|
|
499
|
+
var k = d._owner, L = be(d.type, d._source, k ? k.type : null);
|
|
500
500
|
zt.setExtraStackFrame(L);
|
|
501
501
|
} else
|
|
502
502
|
zt.setExtraStackFrame(null);
|
|
@@ -524,22 +524,22 @@ Check the render method of \`` + d + "`.";
|
|
|
524
524
|
var ft = {};
|
|
525
525
|
function St(d) {
|
|
526
526
|
{
|
|
527
|
-
var
|
|
528
|
-
if (!
|
|
527
|
+
var k = Lt();
|
|
528
|
+
if (!k) {
|
|
529
529
|
var L = typeof d == "string" ? d : d.displayName || d.name;
|
|
530
|
-
L && (
|
|
530
|
+
L && (k = `
|
|
531
531
|
|
|
532
532
|
Check the top-level render call using <` + L + ">.");
|
|
533
533
|
}
|
|
534
|
-
return
|
|
534
|
+
return k;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
function dt(d,
|
|
537
|
+
function dt(d, k) {
|
|
538
538
|
{
|
|
539
539
|
if (!d._store || d._store.validated || d.key != null)
|
|
540
540
|
return;
|
|
541
541
|
d._store.validated = !0;
|
|
542
|
-
var L = St(
|
|
542
|
+
var L = St(k);
|
|
543
543
|
if (ft[L])
|
|
544
544
|
return;
|
|
545
545
|
ft[L] = !0;
|
|
@@ -547,14 +547,14 @@ Check the top-level render call using <` + L + ">.");
|
|
|
547
547
|
d && d._owner && d._owner !== xt.current && (B = " It was passed a child from " + ve(d._owner.type) + "."), Le(d), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', L, B), Le(null);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
function ht(d,
|
|
550
|
+
function ht(d, k) {
|
|
551
551
|
{
|
|
552
552
|
if (typeof d != "object")
|
|
553
553
|
return;
|
|
554
554
|
if (Array.isArray(d))
|
|
555
555
|
for (var L = 0; L < d.length; L++) {
|
|
556
556
|
var B = d[L];
|
|
557
|
-
rt(B) && dt(B,
|
|
557
|
+
rt(B) && dt(B, k);
|
|
558
558
|
}
|
|
559
559
|
else if (rt(d))
|
|
560
560
|
d._store && (d._store.validated = !0);
|
|
@@ -562,39 +562,39 @@ Check the top-level render call using <` + L + ">.");
|
|
|
562
562
|
var J = I(d);
|
|
563
563
|
if (typeof J == "function" && J !== d.entries)
|
|
564
564
|
for (var Z = J.call(d), K; !(K = Z.next()).done; )
|
|
565
|
-
rt(K.value) && dt(K.value,
|
|
565
|
+
rt(K.value) && dt(K.value, k);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
function Ct(d) {
|
|
570
570
|
{
|
|
571
|
-
var
|
|
572
|
-
if (
|
|
571
|
+
var k = d.type;
|
|
572
|
+
if (k == null || typeof k == "string")
|
|
573
573
|
return;
|
|
574
574
|
var L;
|
|
575
|
-
if (typeof
|
|
576
|
-
L =
|
|
577
|
-
else if (typeof
|
|
575
|
+
if (typeof k == "function")
|
|
576
|
+
L = k.propTypes;
|
|
577
|
+
else if (typeof k == "object" && (k.$$typeof === c || // Note: Memo only checks outer props here.
|
|
578
578
|
// Inner props are checked in the reconciler.
|
|
579
|
-
|
|
580
|
-
L =
|
|
579
|
+
k.$$typeof === s))
|
|
580
|
+
L = k.propTypes;
|
|
581
581
|
else
|
|
582
582
|
return;
|
|
583
583
|
if (L) {
|
|
584
|
-
var B = ve(
|
|
584
|
+
var B = ve(k);
|
|
585
585
|
Xt(L, d.props, "prop", B, d);
|
|
586
|
-
} else if (
|
|
586
|
+
} else if (k.PropTypes !== void 0 && !tt) {
|
|
587
587
|
tt = !0;
|
|
588
|
-
var J = ve(
|
|
588
|
+
var J = ve(k);
|
|
589
589
|
j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", J || "Unknown");
|
|
590
590
|
}
|
|
591
|
-
typeof
|
|
591
|
+
typeof k.getDefaultProps == "function" && !k.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
function _t(d) {
|
|
595
595
|
{
|
|
596
|
-
for (var
|
|
597
|
-
var B =
|
|
596
|
+
for (var k = Object.keys(d.props), L = 0; L < k.length; L++) {
|
|
597
|
+
var B = k[L];
|
|
598
598
|
if (B !== "children" && B !== "key") {
|
|
599
599
|
Le(d), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", B), Le(null);
|
|
600
600
|
break;
|
|
@@ -603,7 +603,7 @@ Check the top-level render call using <` + L + ">.");
|
|
|
603
603
|
d.ref !== null && (Le(d), j("Invalid attribute `ref` supplied to `React.Fragment`."), Le(null));
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
function pt(d,
|
|
606
|
+
function pt(d, k, L, B, J, Z) {
|
|
607
607
|
{
|
|
608
608
|
var K = Q(d);
|
|
609
609
|
if (!K) {
|
|
@@ -614,11 +614,11 @@ Check the top-level render call using <` + L + ">.");
|
|
|
614
614
|
var ie;
|
|
615
615
|
d === null ? ie = "null" : Array.isArray(d) ? ie = "array" : d !== void 0 && d.$$typeof === n ? (ie = "<" + (ve(d.type) || "Unknown") + " />", q = " Did you accidentally export a JSX literal instead of a component?") : ie = typeof d, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ie, q);
|
|
616
616
|
}
|
|
617
|
-
var he = ut(d,
|
|
617
|
+
var he = ut(d, k, L, J, Z);
|
|
618
618
|
if (he == null)
|
|
619
619
|
return he;
|
|
620
620
|
if (K) {
|
|
621
|
-
var We =
|
|
621
|
+
var We = k.children;
|
|
622
622
|
if (We !== void 0)
|
|
623
623
|
if (B)
|
|
624
624
|
if (Array.isArray(We)) {
|
|
@@ -633,11 +633,11 @@ Check the top-level render call using <` + L + ">.");
|
|
|
633
633
|
return d === e.Fragment ? _t(he) : Ct(he), he;
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
function Wt(d,
|
|
637
|
-
return pt(d,
|
|
636
|
+
function Wt(d, k, L) {
|
|
637
|
+
return pt(d, k, L, !0);
|
|
638
638
|
}
|
|
639
|
-
function Ht(d,
|
|
640
|
-
return pt(d,
|
|
639
|
+
function Ht(d, k, L) {
|
|
640
|
+
return pt(d, k, L, !1);
|
|
641
641
|
}
|
|
642
642
|
var Ot = Ht, ur = Wt;
|
|
643
643
|
e.jsx = Ot, e.jsxs = ur;
|
|
@@ -668,7 +668,7 @@ function Io() {
|
|
|
668
668
|
}
|
|
669
669
|
var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, i = e.useEffect, a = e.useLayoutEffect, l = e.useDebugValue;
|
|
670
670
|
function u(b, s) {
|
|
671
|
-
var S = s(),
|
|
671
|
+
var S = s(), g = n({ inst: { value: S, getSnapshot: s } }), y = g[0].inst, E = g[1];
|
|
672
672
|
return a(
|
|
673
673
|
function() {
|
|
674
674
|
y.value = S, y.getSnapshot = s, p(y) && E({ inst: y });
|
|
@@ -712,29 +712,29 @@ var yr = {};
|
|
|
712
712
|
var on;
|
|
713
713
|
function Do() {
|
|
714
714
|
return on || (on = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
715
|
-
function e(S,
|
|
716
|
-
return S ===
|
|
715
|
+
function e(S, g) {
|
|
716
|
+
return S === g && (S !== 0 || 1 / S === 1 / g) || S !== S && g !== g;
|
|
717
717
|
}
|
|
718
|
-
function t(S,
|
|
718
|
+
function t(S, g) {
|
|
719
719
|
v || i.startTransition === void 0 || (v = !0, console.error(
|
|
720
720
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
721
721
|
));
|
|
722
|
-
var y =
|
|
722
|
+
var y = g();
|
|
723
723
|
if (!b) {
|
|
724
|
-
var E =
|
|
724
|
+
var E = g();
|
|
725
725
|
a(y, E) || (console.error(
|
|
726
726
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
727
727
|
), b = !0);
|
|
728
728
|
}
|
|
729
729
|
E = l({
|
|
730
|
-
inst: { value: y, getSnapshot:
|
|
730
|
+
inst: { value: y, getSnapshot: g }
|
|
731
731
|
});
|
|
732
732
|
var C = E[0].inst, O = E[1];
|
|
733
733
|
return p(
|
|
734
734
|
function() {
|
|
735
|
-
C.value = y, C.getSnapshot =
|
|
735
|
+
C.value = y, C.getSnapshot = g, r(C) && O({ inst: C });
|
|
736
736
|
},
|
|
737
|
-
[S, y,
|
|
737
|
+
[S, y, g]
|
|
738
738
|
), u(
|
|
739
739
|
function() {
|
|
740
740
|
return r(C) && O({ inst: C }), S(function() {
|
|
@@ -745,17 +745,17 @@ function Do() {
|
|
|
745
745
|
), c(y), y;
|
|
746
746
|
}
|
|
747
747
|
function r(S) {
|
|
748
|
-
var
|
|
748
|
+
var g = S.getSnapshot;
|
|
749
749
|
S = S.value;
|
|
750
750
|
try {
|
|
751
|
-
var y =
|
|
751
|
+
var y = g();
|
|
752
752
|
return !a(S, y);
|
|
753
753
|
} catch {
|
|
754
754
|
return !0;
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
function n(S,
|
|
758
|
-
return
|
|
757
|
+
function n(S, g) {
|
|
758
|
+
return g();
|
|
759
759
|
}
|
|
760
760
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
761
761
|
var i = Se, a = typeof Object.is == "function" ? Object.is : e, l = i.useState, u = i.useEffect, p = i.useLayoutEffect, c = i.useDebugValue, v = !1, b = !1, s = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : t;
|
|
@@ -787,12 +787,12 @@ function zo() {
|
|
|
787
787
|
}
|
|
788
788
|
var n = typeof Object.is == "function" ? Object.is : r, i = t.useSyncExternalStore, a = e.useRef, l = e.useEffect, u = e.useMemo, p = e.useDebugValue;
|
|
789
789
|
return mr.useSyncExternalStoreWithSelector = function(c, v, b, s, S) {
|
|
790
|
-
var
|
|
791
|
-
if (
|
|
790
|
+
var g = a(null);
|
|
791
|
+
if (g.current === null) {
|
|
792
792
|
var y = { hasValue: !1, value: null };
|
|
793
|
-
|
|
794
|
-
} else y =
|
|
795
|
-
|
|
793
|
+
g.current = y;
|
|
794
|
+
} else y = g.current;
|
|
795
|
+
g = u(
|
|
796
796
|
function() {
|
|
797
797
|
function C(I) {
|
|
798
798
|
if (!O) {
|
|
@@ -819,7 +819,7 @@ function zo() {
|
|
|
819
819
|
},
|
|
820
820
|
[v, b, s, S]
|
|
821
821
|
);
|
|
822
|
-
var E = i(c,
|
|
822
|
+
var E = i(c, g[0], g[1]);
|
|
823
823
|
return l(
|
|
824
824
|
function() {
|
|
825
825
|
y.hasValue = !0, y.value = E;
|
|
@@ -847,12 +847,12 @@ function Lo() {
|
|
|
847
847
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
848
848
|
var t = Se, r = zr(), n = typeof Object.is == "function" ? Object.is : e, i = r.useSyncExternalStore, a = t.useRef, l = t.useEffect, u = t.useMemo, p = t.useDebugValue;
|
|
849
849
|
gr.useSyncExternalStoreWithSelector = function(c, v, b, s, S) {
|
|
850
|
-
var
|
|
851
|
-
if (
|
|
850
|
+
var g = a(null);
|
|
851
|
+
if (g.current === null) {
|
|
852
852
|
var y = { hasValue: !1, value: null };
|
|
853
|
-
|
|
854
|
-
} else y =
|
|
855
|
-
|
|
853
|
+
g.current = y;
|
|
854
|
+
} else y = g.current;
|
|
855
|
+
g = u(
|
|
856
856
|
function() {
|
|
857
857
|
function C(I) {
|
|
858
858
|
if (!O) {
|
|
@@ -880,7 +880,7 @@ function Lo() {
|
|
|
880
880
|
},
|
|
881
881
|
[v, b, s, S]
|
|
882
882
|
);
|
|
883
|
-
var E = i(c,
|
|
883
|
+
var E = i(c, g[0], g[1]);
|
|
884
884
|
return l(
|
|
885
885
|
function() {
|
|
886
886
|
y.hasValue = !0, y.value = E;
|
|
@@ -950,7 +950,7 @@ function qo(e = st) {
|
|
|
950
950
|
getServerState: v,
|
|
951
951
|
stabilityCheck: b,
|
|
952
952
|
noopCheck: s
|
|
953
|
-
} = t(), S = $e(!0),
|
|
953
|
+
} = t(), S = $e(!0), g = se({
|
|
954
954
|
[n.name](E) {
|
|
955
955
|
const C = n(E);
|
|
956
956
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -994,7 +994,7 @@ Selectors that return the entire state are almost certainly a mistake, as they w
|
|
|
994
994
|
}
|
|
995
995
|
return C;
|
|
996
996
|
}
|
|
997
|
-
}[n.name], [n, b, l]), y = Hn(c.addNestedSub, p.getState, v || p.getState,
|
|
997
|
+
}[n.name], [n, b, l]), y = Hn(c.addNestedSub, p.getState, v || p.getState, g, a);
|
|
998
998
|
return Oo(y), y;
|
|
999
999
|
};
|
|
1000
1000
|
}
|
|
@@ -1012,7 +1012,7 @@ var dn;
|
|
|
1012
1012
|
function Go() {
|
|
1013
1013
|
if (dn) return te;
|
|
1014
1014
|
dn = 1;
|
|
1015
|
-
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, l = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, p = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, b = e ? Symbol.for("react.suspense") : 60113, s = e ? Symbol.for("react.suspense_list") : 60120, S = e ? Symbol.for("react.memo") : 60115,
|
|
1015
|
+
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, l = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, p = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, b = e ? Symbol.for("react.suspense") : 60113, s = e ? Symbol.for("react.suspense_list") : 60120, S = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, y = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, C = e ? Symbol.for("react.responder") : 60118, O = e ? Symbol.for("react.scope") : 60119;
|
|
1016
1016
|
function T(x) {
|
|
1017
1017
|
if (typeof x == "object" && x !== null) {
|
|
1018
1018
|
var I = x.$$typeof;
|
|
@@ -1030,7 +1030,7 @@ function Go() {
|
|
|
1030
1030
|
switch (x = x && x.$$typeof, x) {
|
|
1031
1031
|
case u:
|
|
1032
1032
|
case v:
|
|
1033
|
-
case
|
|
1033
|
+
case g:
|
|
1034
1034
|
case S:
|
|
1035
1035
|
case l:
|
|
1036
1036
|
return x;
|
|
@@ -1046,7 +1046,7 @@ function Go() {
|
|
|
1046
1046
|
function A(x) {
|
|
1047
1047
|
return T(x) === c;
|
|
1048
1048
|
}
|
|
1049
|
-
return te.AsyncMode = p, te.ConcurrentMode = c, te.ContextConsumer = u, te.ContextProvider = l, te.Element = t, te.ForwardRef = v, te.Fragment = n, te.Lazy =
|
|
1049
|
+
return te.AsyncMode = p, te.ConcurrentMode = c, te.ContextConsumer = u, te.ContextProvider = l, te.Element = t, te.ForwardRef = v, te.Fragment = n, te.Lazy = g, te.Memo = S, te.Portal = r, te.Profiler = a, te.StrictMode = i, te.Suspense = b, te.isAsyncMode = function(x) {
|
|
1050
1050
|
return A(x) || T(x) === p;
|
|
1051
1051
|
}, te.isConcurrentMode = A, te.isContextConsumer = function(x) {
|
|
1052
1052
|
return T(x) === u;
|
|
@@ -1059,7 +1059,7 @@ function Go() {
|
|
|
1059
1059
|
}, te.isFragment = function(x) {
|
|
1060
1060
|
return T(x) === n;
|
|
1061
1061
|
}, te.isLazy = function(x) {
|
|
1062
|
-
return T(x) ===
|
|
1062
|
+
return T(x) === g;
|
|
1063
1063
|
}, te.isMemo = function(x) {
|
|
1064
1064
|
return T(x) === S;
|
|
1065
1065
|
}, te.isPortal = function(x) {
|
|
@@ -1071,7 +1071,7 @@ function Go() {
|
|
|
1071
1071
|
}, te.isSuspense = function(x) {
|
|
1072
1072
|
return T(x) === b;
|
|
1073
1073
|
}, te.isValidElementType = function(x) {
|
|
1074
|
-
return typeof x == "string" || typeof x == "function" || x === n || x === c || x === a || x === i || x === b || x === s || typeof x == "object" && x !== null && (x.$$typeof ===
|
|
1074
|
+
return typeof x == "string" || typeof x == "function" || x === n || x === c || x === a || x === i || x === b || x === s || typeof x == "object" && x !== null && (x.$$typeof === g || x.$$typeof === S || x.$$typeof === l || x.$$typeof === u || x.$$typeof === v || x.$$typeof === E || x.$$typeof === C || x.$$typeof === O || x.$$typeof === y);
|
|
1075
1075
|
}, te.typeOf = T, te;
|
|
1076
1076
|
}
|
|
1077
1077
|
var re = {};
|
|
@@ -1086,10 +1086,10 @@ var re = {};
|
|
|
1086
1086
|
var hn;
|
|
1087
1087
|
function Ko() {
|
|
1088
1088
|
return hn || (hn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1089
|
-
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, l = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, p = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, b = e ? Symbol.for("react.suspense") : 60113, s = e ? Symbol.for("react.suspense_list") : 60120, S = e ? Symbol.for("react.memo") : 60115,
|
|
1089
|
+
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, l = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, p = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, b = e ? Symbol.for("react.suspense") : 60113, s = e ? Symbol.for("react.suspense_list") : 60120, S = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, y = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, C = e ? Symbol.for("react.responder") : 60118, O = e ? Symbol.for("react.scope") : 60119;
|
|
1090
1090
|
function T(Y) {
|
|
1091
1091
|
return typeof Y == "string" || typeof Y == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1092
|
-
Y === n || Y === c || Y === a || Y === i || Y === b || Y === s || typeof Y == "object" && Y !== null && (Y.$$typeof ===
|
|
1092
|
+
Y === n || Y === c || Y === a || Y === i || Y === b || Y === s || typeof Y == "object" && Y !== null && (Y.$$typeof === g || Y.$$typeof === S || Y.$$typeof === l || Y.$$typeof === u || Y.$$typeof === v || Y.$$typeof === E || Y.$$typeof === C || Y.$$typeof === O || Y.$$typeof === y);
|
|
1093
1093
|
}
|
|
1094
1094
|
function A(Y) {
|
|
1095
1095
|
if (typeof Y == "object" && Y !== null) {
|
|
@@ -1110,7 +1110,7 @@ function Ko() {
|
|
|
1110
1110
|
switch (be) {
|
|
1111
1111
|
case u:
|
|
1112
1112
|
case v:
|
|
1113
|
-
case
|
|
1113
|
+
case g:
|
|
1114
1114
|
case S:
|
|
1115
1115
|
case l:
|
|
1116
1116
|
return be;
|
|
@@ -1123,7 +1123,7 @@ function Ko() {
|
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
|
-
var x = p, I = c, $ = u, j = l, F = t, R = v, Q = n, ue =
|
|
1126
|
+
var x = p, I = c, $ = u, j = l, F = t, R = v, Q = n, ue = g, pe = S, ve = r, we = a, Re = i, Me = b, ke = !1;
|
|
1127
1127
|
function Fe(Y) {
|
|
1128
1128
|
return ke || (ke = !0, 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.")), Ne(Y) || A(Y) === p;
|
|
1129
1129
|
}
|
|
@@ -1146,7 +1146,7 @@ function Ko() {
|
|
|
1146
1146
|
return A(Y) === n;
|
|
1147
1147
|
}
|
|
1148
1148
|
function Ue(Y) {
|
|
1149
|
-
return A(Y) ===
|
|
1149
|
+
return A(Y) === g;
|
|
1150
1150
|
}
|
|
1151
1151
|
function qe(Y) {
|
|
1152
1152
|
return A(Y) === S;
|
|
@@ -1209,30 +1209,30 @@ function Zo() {
|
|
|
1209
1209
|
type: !0
|
|
1210
1210
|
}, a = {};
|
|
1211
1211
|
a[e.ForwardRef] = n, a[e.Memo] = i;
|
|
1212
|
-
function l(
|
|
1213
|
-
return e.isMemo(
|
|
1212
|
+
function l(g) {
|
|
1213
|
+
return e.isMemo(g) ? i : a[g.$$typeof] || t;
|
|
1214
1214
|
}
|
|
1215
1215
|
var u = Object.defineProperty, p = Object.getOwnPropertyNames, c = Object.getOwnPropertySymbols, v = Object.getOwnPropertyDescriptor, b = Object.getPrototypeOf, s = Object.prototype;
|
|
1216
|
-
function S(
|
|
1216
|
+
function S(g, y, E) {
|
|
1217
1217
|
if (typeof y != "string") {
|
|
1218
1218
|
if (s) {
|
|
1219
1219
|
var C = b(y);
|
|
1220
|
-
C && C !== s && S(
|
|
1220
|
+
C && C !== s && S(g, C, E);
|
|
1221
1221
|
}
|
|
1222
1222
|
var O = p(y);
|
|
1223
1223
|
c && (O = O.concat(c(y)));
|
|
1224
|
-
for (var T = l(
|
|
1224
|
+
for (var T = l(g), A = l(y), x = 0; x < O.length; ++x) {
|
|
1225
1225
|
var I = O[x];
|
|
1226
1226
|
if (!r[I] && !(E && E[I]) && !(A && A[I]) && !(T && T[I])) {
|
|
1227
1227
|
var $ = v(y, I);
|
|
1228
1228
|
try {
|
|
1229
|
-
u(
|
|
1229
|
+
u(g, I, $);
|
|
1230
1230
|
} catch {
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
return
|
|
1235
|
+
return g;
|
|
1236
1236
|
}
|
|
1237
1237
|
return br = S, br;
|
|
1238
1238
|
}
|
|
@@ -1251,8 +1251,8 @@ var yn;
|
|
|
1251
1251
|
function Qo() {
|
|
1252
1252
|
if (yn) return ne;
|
|
1253
1253
|
yn = 1;
|
|
1254
|
-
var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.server_context"), p = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), s = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"),
|
|
1255
|
-
|
|
1254
|
+
var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.server_context"), p = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), s = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), g;
|
|
1255
|
+
g = Symbol.for("react.module.reference");
|
|
1256
1256
|
function y(E) {
|
|
1257
1257
|
if (typeof E == "object" && E !== null) {
|
|
1258
1258
|
var C = E.$$typeof;
|
|
@@ -1312,7 +1312,7 @@ function Qo() {
|
|
|
1312
1312
|
}, ne.isSuspenseList = function(E) {
|
|
1313
1313
|
return y(E) === v;
|
|
1314
1314
|
}, ne.isValidElementType = function(E) {
|
|
1315
|
-
return typeof E == "string" || typeof E == "function" || E === r || E === i || E === n || E === c || E === v || E === S || typeof E == "object" && E !== null && (E.$$typeof === s || E.$$typeof === b || E.$$typeof === a || E.$$typeof === l || E.$$typeof === p || E.$$typeof ===
|
|
1315
|
+
return typeof E == "string" || typeof E == "function" || E === r || E === i || E === n || E === c || E === v || E === S || typeof E == "object" && E !== null && (E.$$typeof === s || E.$$typeof === b || E.$$typeof === a || E.$$typeof === l || E.$$typeof === p || E.$$typeof === g || E.getModuleId !== void 0);
|
|
1316
1316
|
}, ne.typeOf = y, ne;
|
|
1317
1317
|
}
|
|
1318
1318
|
var oe = {};
|
|
@@ -1328,10 +1328,10 @@ var oe = {};
|
|
|
1328
1328
|
var mn;
|
|
1329
1329
|
function ei() {
|
|
1330
1330
|
return mn || (mn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1331
|
-
var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.server_context"), p = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), s = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"),
|
|
1331
|
+
var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.server_context"), p = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), s = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), g = !1, y = !1, E = !1, C = !1, O = !1, T;
|
|
1332
1332
|
T = Symbol.for("react.module.reference");
|
|
1333
1333
|
function A(V) {
|
|
1334
|
-
return !!(typeof V == "string" || typeof V == "function" || V === r || V === i || O || V === n || V === c || V === v || C || V === S ||
|
|
1334
|
+
return !!(typeof V == "string" || typeof V == "function" || V === r || V === i || O || V === n || V === c || V === v || C || V === S || g || y || E || typeof V == "object" && V !== null && (V.$$typeof === s || V.$$typeof === b || V.$$typeof === a || V.$$typeof === l || V.$$typeof === p || // This needs to include all possible module reference object
|
|
1335
1335
|
// types supported by any Flight configuration anywhere since
|
|
1336
1336
|
// we don't know which Flight build this will end up being used
|
|
1337
1337
|
// with.
|
|
@@ -1471,7 +1471,7 @@ function ni(e, t) {
|
|
|
1471
1471
|
n.notify();
|
|
1472
1472
|
}
|
|
1473
1473
|
function p() {
|
|
1474
|
-
|
|
1474
|
+
g.onStateChange && g.onStateChange();
|
|
1475
1475
|
}
|
|
1476
1476
|
function c() {
|
|
1477
1477
|
return a;
|
|
@@ -1488,7 +1488,7 @@ function ni(e, t) {
|
|
|
1488
1488
|
function S() {
|
|
1489
1489
|
a && (a = !1, b());
|
|
1490
1490
|
}
|
|
1491
|
-
const
|
|
1491
|
+
const g = {
|
|
1492
1492
|
addNestedSub: l,
|
|
1493
1493
|
notifyNestedSubs: u,
|
|
1494
1494
|
handleChangeWrapper: p,
|
|
@@ -1497,7 +1497,7 @@ function ni(e, t) {
|
|
|
1497
1497
|
tryUnsubscribe: S,
|
|
1498
1498
|
getListeners: () => n
|
|
1499
1499
|
};
|
|
1500
|
-
return
|
|
1500
|
+
return g;
|
|
1501
1501
|
}
|
|
1502
1502
|
const oi = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", ii = oi ? Je.useLayoutEffect : Je.useEffect;
|
|
1503
1503
|
function ai({
|
|
@@ -1881,8 +1881,8 @@ function mi() {
|
|
|
1881
1881
|
if (b !== fe) {
|
|
1882
1882
|
var s = u[b];
|
|
1883
1883
|
if (s === void 0 && !Pt(u, b)) return !0;
|
|
1884
|
-
var S = p[b],
|
|
1885
|
-
if (
|
|
1884
|
+
var S = p[b], g = S && S[fe];
|
|
1885
|
+
if (g ? g.t !== s : !Qn(S, s)) return !0;
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
1888
1888
|
var y = !!u[fe];
|
|
@@ -1903,7 +1903,7 @@ function mi() {
|
|
|
1903
1903
|
pi("ES5", { J: function(l, u) {
|
|
1904
1904
|
var p = Array.isArray(l), c = (function(b, s) {
|
|
1905
1905
|
if (b) {
|
|
1906
|
-
for (var S = Array(s.length),
|
|
1906
|
+
for (var S = Array(s.length), g = 0; g < s.length; g++) Object.defineProperty(S, "" + g, e(g, !0));
|
|
1907
1907
|
return S;
|
|
1908
1908
|
}
|
|
1909
1909
|
var y = to(s);
|
|
@@ -1920,16 +1920,16 @@ function mi() {
|
|
|
1920
1920
|
if (v && typeof v == "object") {
|
|
1921
1921
|
var b = v[fe];
|
|
1922
1922
|
if (b) {
|
|
1923
|
-
var s = b.t, S = b.k,
|
|
1923
|
+
var s = b.t, S = b.k, g = b.R, y = b.i;
|
|
1924
1924
|
if (y === 4) mt(S, (function(A) {
|
|
1925
|
-
A !== fe && (s[A] !== void 0 || Pt(s, A) ?
|
|
1925
|
+
A !== fe && (s[A] !== void 0 || Pt(s, A) ? g[A] || c(S[A]) : (g[A] = !0, ot(b)));
|
|
1926
1926
|
})), mt(s, (function(A) {
|
|
1927
|
-
S[A] !== void 0 || Pt(S, A) || (
|
|
1927
|
+
S[A] !== void 0 || Pt(S, A) || (g[A] = !1, ot(b));
|
|
1928
1928
|
}));
|
|
1929
1929
|
else if (y === 5) {
|
|
1930
|
-
if (n(b) && (ot(b),
|
|
1931
|
-
else for (var C = s.length; C < S.length; C++)
|
|
1932
|
-
for (var O = Math.min(S.length, s.length), T = 0; T < O; T++) S.hasOwnProperty(T) || (
|
|
1930
|
+
if (n(b) && (ot(b), g.length = !0), S.length < s.length) for (var E = S.length; E < s.length; E++) g[E] = !1;
|
|
1931
|
+
else for (var C = s.length; C < S.length; C++) g[C] = !0;
|
|
1932
|
+
for (var O = Math.min(S.length, s.length), T = 0; T < O; T++) S.hasOwnProperty(T) || (g[T] = !0), g[T] === void 0 && c(S[T]);
|
|
1933
1933
|
}
|
|
1934
1934
|
}
|
|
1935
1935
|
}
|
|
@@ -2037,8 +2037,8 @@ var Ei = (function() {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
if (!i || typeof i != "object") {
|
|
2039
2039
|
if ((c = a(i)) === void 0 && (c = i), c === eo && (c = void 0), n.D && Fr(c, !0), l) {
|
|
2040
|
-
var S = [],
|
|
2041
|
-
He("Patches").M(i, c, S,
|
|
2040
|
+
var S = [], g = [];
|
|
2041
|
+
He("Patches").M(i, c, S, g), l(S, g);
|
|
2042
2042
|
}
|
|
2043
2043
|
return c;
|
|
2044
2044
|
}
|
|
@@ -2266,7 +2266,7 @@ function oo(e, t, r) {
|
|
|
2266
2266
|
type: yt.REPLACE
|
|
2267
2267
|
});
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function g() {
|
|
2270
2270
|
var y, E = b;
|
|
2271
2271
|
return y = {
|
|
2272
2272
|
/**
|
|
@@ -2300,7 +2300,7 @@ function oo(e, t, r) {
|
|
|
2300
2300
|
subscribe: b,
|
|
2301
2301
|
getState: v,
|
|
2302
2302
|
replaceReducer: S
|
|
2303
|
-
}, n[Tn] =
|
|
2303
|
+
}, n[Tn] = g, n;
|
|
2304
2304
|
}
|
|
2305
2305
|
function Rn(e) {
|
|
2306
2306
|
typeof console < "u" && typeof console.error == "function" && console.error(e);
|
|
@@ -2356,8 +2356,8 @@ function ki(e) {
|
|
|
2356
2356
|
var b = Ri(c, r, v, l);
|
|
2357
2357
|
b && Rn(b);
|
|
2358
2358
|
}
|
|
2359
|
-
for (var s = !1, S = {},
|
|
2360
|
-
var y = a[
|
|
2359
|
+
for (var s = !1, S = {}, g = 0; g < a.length; g++) {
|
|
2360
|
+
var y = a[g], E = r[y], C = c[y], O = E(C, v);
|
|
2361
2361
|
if (typeof O > "u") {
|
|
2362
2362
|
var T = v && v.type;
|
|
2363
2363
|
throw new Error(process.env.NODE_ENV === "production" ? Ee(14) : "When called with an action of type " + (T ? '"' + String(T) + '"' : "(unknown type)") + ', the slice reducer for key "' + y + '" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.');
|
|
@@ -2721,15 +2721,15 @@ function uo(e, t, r, n, i, a) {
|
|
|
2721
2721
|
for (var c in n)
|
|
2722
2722
|
p[c] = !0;
|
|
2723
2723
|
var v = t.length > 0, b = function(S) {
|
|
2724
|
-
var
|
|
2724
|
+
var g = a ? a + "." + S : S;
|
|
2725
2725
|
if (v) {
|
|
2726
2726
|
var y = t.some(function(C) {
|
|
2727
|
-
return C instanceof RegExp ? C.test(
|
|
2727
|
+
return C instanceof RegExp ? C.test(g) : g === C;
|
|
2728
2728
|
});
|
|
2729
2729
|
if (y)
|
|
2730
2730
|
return "continue";
|
|
2731
2731
|
}
|
|
2732
|
-
var E = uo(e, t, r.children[S], n[S], u,
|
|
2732
|
+
var E = uo(e, t, r.children[S], n[S], u, g);
|
|
2733
2733
|
if (E.wasMutated)
|
|
2734
2734
|
return { value: E };
|
|
2735
2735
|
};
|
|
@@ -2755,14 +2755,14 @@ function Qi(e) {
|
|
|
2755
2755
|
return function(p) {
|
|
2756
2756
|
var c = p.getState, v = c(), b = u(v), s;
|
|
2757
2757
|
return function(S) {
|
|
2758
|
-
return function(
|
|
2758
|
+
return function(g) {
|
|
2759
2759
|
var y = co(a, "ImmutableStateInvariantMiddleware");
|
|
2760
2760
|
y.measureTime(function() {
|
|
2761
2761
|
v = c(), s = b.detectMutations(), b = u(v), An(!s.wasMutated, "A state mutation was detected between dispatches, in the path '" + (s.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
|
|
2762
2762
|
});
|
|
2763
|
-
var E = S(
|
|
2763
|
+
var E = S(g);
|
|
2764
2764
|
return y.measureTime(function() {
|
|
2765
|
-
v = c(), s = b.detectMutations(), b = u(v), s.wasMutated && An(!s.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (s.path || "") + ". Take a look at the reducer(s) handling the action " + Gi(
|
|
2765
|
+
v = c(), s = b.detectMutations(), b = u(v), s.wasMutated && An(!s.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (s.path || "") + ". Take a look at the reducer(s) handling the action " + Gi(g) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
|
|
2766
2766
|
}), y.warnIfExceeded(), E;
|
|
2767
2767
|
};
|
|
2768
2768
|
};
|
|
@@ -2799,7 +2799,7 @@ function Ir(e, t, r, n, i, a) {
|
|
|
2799
2799
|
if (typeof C == "object" && (l = Ir(C, O, r, n, i, a), l))
|
|
2800
2800
|
return { value: l };
|
|
2801
2801
|
}, v = 0, b = u; v < b.length; v++) {
|
|
2802
|
-
var s = b[v], S = s[0],
|
|
2802
|
+
var s = b[v], S = s[0], g = s[1], y = c(S, g);
|
|
2803
2803
|
if (typeof y == "object")
|
|
2804
2804
|
return y.value;
|
|
2805
2805
|
}
|
|
@@ -2824,7 +2824,7 @@ function ea(e) {
|
|
|
2824
2824
|
};
|
|
2825
2825
|
};
|
|
2826
2826
|
};
|
|
2827
|
-
var t = e.isSerializable, r = t === void 0 ? fo : t, n = e.getEntries, i = e.ignoredActions, a = i === void 0 ? [] : i, l = e.ignoredActionPaths, u = l === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : l, p = e.ignoredPaths, c = p === void 0 ? [] : p, v = e.warnAfter, b = v === void 0 ? 32 : v, s = e.ignoreState, S = s === void 0 ? !1 : s,
|
|
2827
|
+
var t = e.isSerializable, r = t === void 0 ? fo : t, n = e.getEntries, i = e.ignoredActions, a = i === void 0 ? [] : i, l = e.ignoredActionPaths, u = l === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : l, p = e.ignoredPaths, c = p === void 0 ? [] : p, v = e.warnAfter, b = v === void 0 ? 32 : v, s = e.ignoreState, S = s === void 0 ? !1 : s, g = e.ignoreActions, y = g === void 0 ? !1 : g, E = e.disableCache, C = E === void 0 ? !1 : E, O = !C && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;
|
|
2828
2828
|
return function(T) {
|
|
2829
2829
|
return function(A) {
|
|
2830
2830
|
return function(x) {
|
|
@@ -2887,14 +2887,14 @@ function na(e) {
|
|
|
2887
2887
|
S = ki(i);
|
|
2888
2888
|
else
|
|
2889
2889
|
throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
|
|
2890
|
-
var
|
|
2891
|
-
if (typeof
|
|
2890
|
+
var g = l;
|
|
2891
|
+
if (typeof g == "function" && (g = g(t), !Or && !Array.isArray(g)))
|
|
2892
2892
|
throw new Error("when using a middleware builder function, an array of middleware must be returned");
|
|
2893
|
-
if (!Or &&
|
|
2893
|
+
if (!Or && g.some(function(A) {
|
|
2894
2894
|
return typeof A != "function";
|
|
2895
2895
|
}))
|
|
2896
2896
|
throw new Error("each middleware provided to configureStore must be a function");
|
|
2897
|
-
var y = Ni.apply(void 0,
|
|
2897
|
+
var y = Ni.apply(void 0, g), E = ir;
|
|
2898
2898
|
p && (E = Vi(it({
|
|
2899
2899
|
trace: !Or
|
|
2900
2900
|
}, typeof p == "object" && p)));
|
|
@@ -2953,34 +2953,34 @@ function ia(e, t, r, n) {
|
|
|
2953
2953
|
b === void 0 && (b = p());
|
|
2954
2954
|
var S = Mt([
|
|
2955
2955
|
a[s.type]
|
|
2956
|
-
], l.filter(function(
|
|
2957
|
-
var y =
|
|
2956
|
+
], l.filter(function(g) {
|
|
2957
|
+
var y = g.matcher;
|
|
2958
2958
|
return y(s);
|
|
2959
|
-
}).map(function(
|
|
2960
|
-
var y =
|
|
2959
|
+
}).map(function(g) {
|
|
2960
|
+
var y = g.reducer;
|
|
2961
2961
|
return y;
|
|
2962
2962
|
}));
|
|
2963
|
-
return S.filter(function(
|
|
2964
|
-
return !!
|
|
2965
|
-
}).length === 0 && (S = [u]), S.reduce(function(
|
|
2963
|
+
return S.filter(function(g) {
|
|
2964
|
+
return !!g;
|
|
2965
|
+
}).length === 0 && (S = [u]), S.reduce(function(g, y) {
|
|
2966
2966
|
if (y)
|
|
2967
|
-
if (ct(
|
|
2968
|
-
var E =
|
|
2969
|
-
return C === void 0 ?
|
|
2967
|
+
if (ct(g)) {
|
|
2968
|
+
var E = g, C = y(E, s);
|
|
2969
|
+
return C === void 0 ? g : C;
|
|
2970
2970
|
} else {
|
|
2971
|
-
if (Ze(
|
|
2972
|
-
return ro(
|
|
2971
|
+
if (Ze(g))
|
|
2972
|
+
return ro(g, function(O) {
|
|
2973
2973
|
return y(O, s);
|
|
2974
2974
|
});
|
|
2975
|
-
var C = y(
|
|
2975
|
+
var C = y(g, s);
|
|
2976
2976
|
if (C === void 0) {
|
|
2977
|
-
if (
|
|
2978
|
-
return
|
|
2977
|
+
if (g === null)
|
|
2978
|
+
return g;
|
|
2979
2979
|
throw Error("A case reducer on a non-draftable value must not return undefined");
|
|
2980
2980
|
}
|
|
2981
2981
|
return C;
|
|
2982
2982
|
}
|
|
2983
|
-
return
|
|
2983
|
+
return g;
|
|
2984
2984
|
}, b);
|
|
2985
2985
|
}
|
|
2986
2986
|
return v.getInitialState = p, v;
|
|
@@ -2994,16 +2994,16 @@ function sa(e) {
|
|
|
2994
2994
|
typeof process < "u" && process.env.NODE_ENV === "development" && e.initialState === void 0 && console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
|
|
2995
2995
|
var r = typeof e.initialState == "function" ? e.initialState : Ar(e.initialState), n = e.reducers || {}, i = Object.keys(n), a = {}, l = {}, u = {};
|
|
2996
2996
|
i.forEach(function(v) {
|
|
2997
|
-
var b = n[v], s = aa(t, v), S,
|
|
2998
|
-
"reducer" in b ? (S = b.reducer,
|
|
2997
|
+
var b = n[v], s = aa(t, v), S, g;
|
|
2998
|
+
"reducer" in b ? (S = b.reducer, g = b.prepare) : S = b, a[v] = S, l[s] = S, u[v] = g ? at(s, g) : at(s);
|
|
2999
2999
|
});
|
|
3000
3000
|
function p() {
|
|
3001
3001
|
process.env.NODE_ENV !== "production" && typeof e.extraReducers == "object" && (Dn || (Dn = !0, console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice")));
|
|
3002
|
-
var v = typeof e.extraReducers == "function" ? po(e.extraReducers) : [e.extraReducers], b = v[0], s = b === void 0 ? {} : b, S = v[1],
|
|
3002
|
+
var v = typeof e.extraReducers == "function" ? po(e.extraReducers) : [e.extraReducers], b = v[0], s = b === void 0 ? {} : b, S = v[1], g = S === void 0 ? [] : S, y = v[2], E = y === void 0 ? void 0 : y, C = it(it({}, s), l);
|
|
3003
3003
|
return ia(r, function(O) {
|
|
3004
3004
|
for (var T in C)
|
|
3005
3005
|
O.addCase(T, C[T]);
|
|
3006
|
-
for (var A = 0, x =
|
|
3006
|
+
for (var A = 0, x = g; A < x.length; A++) {
|
|
3007
3007
|
var I = x[A];
|
|
3008
3008
|
O.addMatcher(I.matcher, I.reducer);
|
|
3009
3009
|
}
|
|
@@ -3079,11 +3079,11 @@ var ca = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", la
|
|
|
3079
3079
|
requestStatus: "pending"
|
|
3080
3080
|
})
|
|
3081
3081
|
};
|
|
3082
|
-
}), l = at(t + "/rejected", function(v, b, s, S,
|
|
3082
|
+
}), l = at(t + "/rejected", function(v, b, s, S, g) {
|
|
3083
3083
|
return {
|
|
3084
3084
|
payload: S,
|
|
3085
3085
|
error: (n && n.serializeError || fa)(v || "Rejected"),
|
|
3086
|
-
meta: _r(it({},
|
|
3086
|
+
meta: _r(it({}, g || {}), {
|
|
3087
3087
|
arg: s,
|
|
3088
3088
|
requestId: b,
|
|
3089
3089
|
rejectedWithValue: !!S,
|
|
@@ -3119,7 +3119,7 @@ var ca = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", la
|
|
|
3119
3119
|
);
|
|
3120
3120
|
function c(v) {
|
|
3121
3121
|
return function(b, s, S) {
|
|
3122
|
-
var
|
|
3122
|
+
var g = n != null && n.idGenerator ? n.idGenerator(v) : la(), y = new p(), E;
|
|
3123
3123
|
function C(T) {
|
|
3124
3124
|
E = T, y.abort();
|
|
3125
3125
|
}
|
|
@@ -3145,13 +3145,13 @@ var ca = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", la
|
|
|
3145
3145
|
message: E || "Aborted"
|
|
3146
3146
|
});
|
|
3147
3147
|
});
|
|
3148
|
-
}), b(a(
|
|
3148
|
+
}), b(a(g, v, (A = n == null ? void 0 : n.getPendingMeta) == null ? void 0 : A.call(n, { requestId: g, arg: v }, { getState: s, extra: S }))), [4, Promise.race([
|
|
3149
3149
|
$,
|
|
3150
3150
|
Promise.resolve(r(v, {
|
|
3151
3151
|
dispatch: b,
|
|
3152
3152
|
getState: s,
|
|
3153
3153
|
extra: S,
|
|
3154
|
-
requestId:
|
|
3154
|
+
requestId: g,
|
|
3155
3155
|
signal: y.signal,
|
|
3156
3156
|
abort: C,
|
|
3157
3157
|
rejectWithValue: function(Q, ue) {
|
|
@@ -3163,13 +3163,13 @@ var ca = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", la
|
|
|
3163
3163
|
})).then(function(Q) {
|
|
3164
3164
|
if (Q instanceof jr)
|
|
3165
3165
|
throw Q;
|
|
3166
|
-
return Q instanceof zn ? i(Q.payload,
|
|
3166
|
+
return Q instanceof zn ? i(Q.payload, g, v, Q.meta) : i(Q, g, v);
|
|
3167
3167
|
})
|
|
3168
3168
|
])];
|
|
3169
3169
|
case 3:
|
|
3170
3170
|
return x = R.sent(), [3, 5];
|
|
3171
3171
|
case 4:
|
|
3172
|
-
return j = R.sent(), x = j instanceof jr ? l(null,
|
|
3172
|
+
return j = R.sent(), x = j instanceof jr ? l(null, g, v, j.payload, j.meta) : l(j, g, v), [3, 5];
|
|
3173
3173
|
case 5:
|
|
3174
3174
|
return F = n && !n.dispatchConditionRejection && l.match(x) && x.meta.condition, F || b(x), [2, x];
|
|
3175
3175
|
}
|
|
@@ -3178,7 +3178,7 @@ var ca = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", la
|
|
|
3178
3178
|
})();
|
|
3179
3179
|
return Object.assign(O, {
|
|
3180
3180
|
abort: C,
|
|
3181
|
-
requestId:
|
|
3181
|
+
requestId: g,
|
|
3182
3182
|
arg: v,
|
|
3183
3183
|
unwrap: function() {
|
|
3184
3184
|
return O.then(da);
|
|
@@ -3413,7 +3413,7 @@ const Hr = sa({
|
|
|
3413
3413
|
const v = p - l, b = c - u;
|
|
3414
3414
|
if (v <= 0 || b <= 0)
|
|
3415
3415
|
return;
|
|
3416
|
-
const s = r - i * 2, S = n - i * 2,
|
|
3416
|
+
const s = r - i * 2, S = n - i * 2, g = s / v, y = S / b, E = Math.min(g, y, 5), C = (l + p) / 2, O = (u + c) / 2, T = r / 2 - C * E, A = n / 2 - O * E;
|
|
3417
3417
|
e.viewport.zoom = Math.max(0.1, E), e.viewport.panX = T, e.viewport.panY = A;
|
|
3418
3418
|
},
|
|
3419
3419
|
setLocked(e, t) {
|
|
@@ -3711,7 +3711,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
3711
3711
|
}, us = ({ mode: e = "user", onImageUpload: t }) => {
|
|
3712
3712
|
const r = Wr(), { t: n, language: i, changeLanguage: a } = cr(), l = _e(
|
|
3713
3713
|
(F) => F.whiteboard.toolbar.selectedTool
|
|
3714
|
-
), u = _e((F) => F.whiteboard.lock.isLocked), [p, c] = ce(!1), [v, b] = ce(!1), [s, S] = ce(!1),
|
|
3714
|
+
), u = _e((F) => F.whiteboard.lock.isLocked), [p, c] = ce(!1), [v, b] = ce(!1), [s, S] = ce(!1), g = $e(null), y = $e(null), E = $e(null), C = $e(null), O = $e(null), T = async (F) => {
|
|
3715
3715
|
var Q;
|
|
3716
3716
|
const R = (Q = F.target.files) == null ? void 0 : Q[0];
|
|
3717
3717
|
if (R) {
|
|
@@ -3764,7 +3764,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
3764
3764
|
xe(() => {
|
|
3765
3765
|
const F = (R) => {
|
|
3766
3766
|
const Q = R.target;
|
|
3767
|
-
|
|
3767
|
+
g.current && !g.current.contains(Q) && y.current && !y.current.contains(Q) && c(!1), C.current && !C.current.contains(Q) && E.current && !E.current.contains(Q) && b(!1);
|
|
3768
3768
|
};
|
|
3769
3769
|
return document.addEventListener("mousedown", F), () => document.removeEventListener("mousedown", F);
|
|
3770
3770
|
}, []);
|
|
@@ -3873,7 +3873,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
3873
3873
|
children: /* @__PURE__ */ h.jsx(ns, {})
|
|
3874
3874
|
}
|
|
3875
3875
|
),
|
|
3876
|
-
p && /* @__PURE__ */ h.jsxs("div", { className: "wb-shapes-popup", ref:
|
|
3876
|
+
p && /* @__PURE__ */ h.jsxs("div", { className: "wb-shapes-popup", ref: g, children: [
|
|
3877
3877
|
/* @__PURE__ */ h.jsx("div", { className: "wb-shapes-popup-header", children: n("moreShapes") }),
|
|
3878
3878
|
/* @__PURE__ */ h.jsx("div", { className: "wb-shapes-popup-grid", children: I.map((F) => /* @__PURE__ */ h.jsx(
|
|
3879
3879
|
"button",
|
|
@@ -3968,15 +3968,15 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
3968
3968
|
(s) => s.whiteboard.toolProperties
|
|
3969
3969
|
), a = _e(
|
|
3970
3970
|
(s) => s.whiteboard.selectedElementIds || []
|
|
3971
|
-
), l = _e((s) => s.whiteboard.elements), u = a.length > 0 ? l.find((s) => s.id === a[0]) : null, p = (s, S,
|
|
3972
|
-
t(ma({ tool: s, property: S, value:
|
|
3971
|
+
), l = _e((s) => s.whiteboard.elements), u = a.length > 0 ? l.find((s) => s.id === a[0]) : null, p = (s, S, g) => {
|
|
3972
|
+
t(ma({ tool: s, property: S, value: g }));
|
|
3973
3973
|
}, c = (s, S) => {
|
|
3974
3974
|
if (a.length > 0) {
|
|
3975
|
-
const
|
|
3975
|
+
const g = a.map((y) => ({
|
|
3976
3976
|
id: y,
|
|
3977
3977
|
updates: { [s]: S }
|
|
3978
3978
|
}));
|
|
3979
|
-
t(vo(
|
|
3979
|
+
t(vo(g));
|
|
3980
3980
|
}
|
|
3981
3981
|
}, v = () => {
|
|
3982
3982
|
a.forEach((s) => {
|
|
@@ -4101,7 +4101,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4101
4101
|
{
|
|
4102
4102
|
type: "color",
|
|
4103
4103
|
value: u.strokeColor,
|
|
4104
|
-
onChange: (
|
|
4104
|
+
onChange: (g) => c("strokeColor", g.target.value)
|
|
4105
4105
|
}
|
|
4106
4106
|
)
|
|
4107
4107
|
] }),
|
|
@@ -4112,7 +4112,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4112
4112
|
{
|
|
4113
4113
|
type: "color",
|
|
4114
4114
|
value: u.fillColor,
|
|
4115
|
-
onChange: (
|
|
4115
|
+
onChange: (g) => c("fillColor", g.target.value)
|
|
4116
4116
|
}
|
|
4117
4117
|
)
|
|
4118
4118
|
] }),
|
|
@@ -4123,9 +4123,9 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4123
4123
|
{
|
|
4124
4124
|
className: "stroke-width-selector",
|
|
4125
4125
|
value: u.lineWidth,
|
|
4126
|
-
onChange: (
|
|
4126
|
+
onChange: (g) => c(
|
|
4127
4127
|
"lineWidth",
|
|
4128
|
-
parseInt(
|
|
4128
|
+
parseInt(g.target.value)
|
|
4129
4129
|
),
|
|
4130
4130
|
children: [
|
|
4131
4131
|
/* @__PURE__ */ h.jsx("option", { value: "1", children: "1 px" }),
|
|
@@ -4145,7 +4145,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4145
4145
|
{
|
|
4146
4146
|
type: "color",
|
|
4147
4147
|
value: u.strokeColor,
|
|
4148
|
-
onChange: (
|
|
4148
|
+
onChange: (g) => c("strokeColor", g.target.value)
|
|
4149
4149
|
}
|
|
4150
4150
|
)
|
|
4151
4151
|
] }),
|
|
@@ -4156,9 +4156,9 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4156
4156
|
{
|
|
4157
4157
|
className: "brush-size-selector",
|
|
4158
4158
|
value: u.lineWidth,
|
|
4159
|
-
onChange: (
|
|
4159
|
+
onChange: (g) => c(
|
|
4160
4160
|
"lineWidth",
|
|
4161
|
-
parseInt(
|
|
4161
|
+
parseInt(g.target.value)
|
|
4162
4162
|
),
|
|
4163
4163
|
children: [
|
|
4164
4164
|
/* @__PURE__ */ h.jsx("option", { value: "1", children: "1 px" }),
|
|
@@ -4364,7 +4364,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4364
4364
|
] });
|
|
4365
4365
|
}, wo = Fn(({ watermark: e, isLocked: t, lockText: r, onLockChange: n, isWatermarkEnabled: i, watermarkText: a, mode: l, initialElements: u, onAfterMount: p, onImageUpload: c }, v) => {
|
|
4366
4366
|
var Jr;
|
|
4367
|
-
const b = $e(null), s = Wr(), S = Gn(),
|
|
4367
|
+
const b = $e(null), s = Wr(), S = Gn(), g = _e((o) => o.whiteboard.grid), y = _e(
|
|
4368
4368
|
(o) => o.whiteboard.toolbar.selectedTool
|
|
4369
4369
|
), E = _e((o) => o.whiteboard.elements), C = _e((o) => o.whiteboard.viewport), O = _e(
|
|
4370
4370
|
(o) => o.whiteboard.toolProperties
|
|
@@ -4444,176 +4444,187 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4444
4444
|
}, 0);
|
|
4445
4445
|
}, []);
|
|
4446
4446
|
const xt = se(
|
|
4447
|
-
(o, f,
|
|
4448
|
-
const w = o.canvas, _ = w.width, P = w.height,
|
|
4447
|
+
(o, f, m) => {
|
|
4448
|
+
const w = o.canvas, _ = w.width, P = w.height, N = Math.floor(-C.panX / C.zoom / f) * f, M = Math.floor(-C.panY / C.zoom / f) * f, D = Math.ceil(
|
|
4449
4449
|
(_ / C.zoom - C.panX / C.zoom) / f
|
|
4450
4450
|
) * f, X = Math.ceil(
|
|
4451
4451
|
(P / C.zoom - C.panY / C.zoom) / f
|
|
4452
4452
|
) * f;
|
|
4453
|
-
o.strokeStyle =
|
|
4454
|
-
for (let W =
|
|
4455
|
-
o.beginPath(), o.moveTo(W,
|
|
4456
|
-
for (let W =
|
|
4457
|
-
o.beginPath(), o.moveTo(
|
|
4453
|
+
o.strokeStyle = m, o.lineWidth = 0.5 / C.zoom;
|
|
4454
|
+
for (let W = N; W <= D; W += f)
|
|
4455
|
+
o.beginPath(), o.moveTo(W, M), o.lineTo(W, X), o.stroke();
|
|
4456
|
+
for (let W = M; W <= X; W += f)
|
|
4457
|
+
o.beginPath(), o.moveTo(N, W), o.lineTo(D, W), o.stroke();
|
|
4458
4458
|
},
|
|
4459
4459
|
[C]
|
|
4460
|
-
), zt = se((o, f,
|
|
4461
|
-
const w = Math.min(f.x,
|
|
4462
|
-
o.strokeStyle = "#0066cc", o.lineWidth = 1, o.setLineDash([5, 5]), o.strokeRect(w, _, P,
|
|
4460
|
+
), zt = se((o, f, m) => {
|
|
4461
|
+
const w = Math.min(f.x, m.x), _ = Math.min(f.y, m.y), P = Math.abs(m.x - f.x), N = Math.abs(m.y - f.y);
|
|
4462
|
+
o.strokeStyle = "#0066cc", o.lineWidth = 1, o.setLineDash([5, 5]), o.strokeRect(w, _, P, N), o.fillStyle = "rgba(0, 102, 204, 0.1)", o.fillRect(w, _, P, N), o.setLineDash([]);
|
|
4463
4463
|
}, []), Le = se((o, f) => {
|
|
4464
4464
|
const {
|
|
4465
|
-
x:
|
|
4465
|
+
x: m = 0,
|
|
4466
4466
|
y: w = 0,
|
|
4467
4467
|
width: _ = 0,
|
|
4468
4468
|
height: P = 0,
|
|
4469
|
-
fillColor:
|
|
4470
|
-
strokeColor:
|
|
4469
|
+
fillColor: N = "#000",
|
|
4470
|
+
strokeColor: M = "#000",
|
|
4471
4471
|
lineWidth: D = 2
|
|
4472
4472
|
} = f;
|
|
4473
|
-
o.fillStyle =
|
|
4473
|
+
o.fillStyle = N, o.fillRect(m, w, _, P), o.strokeStyle = M, o.lineWidth = D, o.strokeRect(m, w, _, P);
|
|
4474
4474
|
}, []), tt = se((o, f) => {
|
|
4475
4475
|
const {
|
|
4476
|
-
centerX:
|
|
4476
|
+
centerX: m = 0,
|
|
4477
4477
|
centerY: w = 0,
|
|
4478
4478
|
radius: _ = 0,
|
|
4479
4479
|
fillColor: P = "#000",
|
|
4480
|
-
strokeColor:
|
|
4481
|
-
lineWidth:
|
|
4480
|
+
strokeColor: N = "#000",
|
|
4481
|
+
lineWidth: M = 2
|
|
4482
4482
|
} = f;
|
|
4483
|
-
o.beginPath(), o.arc(
|
|
4483
|
+
o.beginPath(), o.arc(m, w, _, 0, Math.PI * 2), o.fillStyle = P, o.fill(), o.strokeStyle = N, o.lineWidth = M, o.stroke();
|
|
4484
4484
|
}, []), rt = se((o, f) => {
|
|
4485
|
-
const { points:
|
|
4486
|
-
if (!(
|
|
4487
|
-
o.strokeStyle = w, o.lineWidth = _, o.lineCap = "round", o.lineJoin = "round", o.beginPath(), o.moveTo(
|
|
4488
|
-
for (let P = 1; P <
|
|
4489
|
-
|
|
4485
|
+
const { points: m = [], strokeColor: w = "#000", lineWidth: _ = 2 } = f;
|
|
4486
|
+
if (!(m.length < 2)) {
|
|
4487
|
+
o.strokeStyle = w, o.lineWidth = _, o.lineCap = "round", o.lineJoin = "round", o.beginPath(), o.moveTo(m[0].x, m[0].y);
|
|
4488
|
+
for (let P = 1; P < m.length; P++)
|
|
4489
|
+
m[P] && o.lineTo(m[P].x, m[P].y);
|
|
4490
4490
|
o.stroke();
|
|
4491
4491
|
}
|
|
4492
4492
|
}, []), Lt = se((o, f) => {
|
|
4493
|
-
const { x:
|
|
4494
|
-
o.font = `${P}px sans-serif`, o.fillStyle =
|
|
4493
|
+
const { x: m = 0, y: w = 0, text: _ = "", fontSize: P = 16, fontColor: N = "#000" } = f;
|
|
4494
|
+
o.font = `${P}px sans-serif`, o.fillStyle = N, o.textBaseline = "top", o.fillText(_, m, w);
|
|
4495
4495
|
}, []), Et = se((o, f) => {
|
|
4496
4496
|
const {
|
|
4497
|
-
x:
|
|
4497
|
+
x: m = 0,
|
|
4498
4498
|
y: w = 0,
|
|
4499
4499
|
width: _ = 0,
|
|
4500
4500
|
height: P = 0,
|
|
4501
|
-
fillColor:
|
|
4502
|
-
strokeColor:
|
|
4501
|
+
fillColor: N = "#fff",
|
|
4502
|
+
strokeColor: M = "#000",
|
|
4503
4503
|
lineWidth: D = 2
|
|
4504
4504
|
} = f;
|
|
4505
|
-
o.beginPath(), o.moveTo(
|
|
4505
|
+
o.beginPath(), o.moveTo(m + _ / 2, w), o.lineTo(m + _, w + P), o.lineTo(m, w + P), o.closePath(), o.fillStyle = N, o.fill(), o.strokeStyle = M, o.lineWidth = D, o.stroke();
|
|
4506
4506
|
}, []), ft = se((o, f) => {
|
|
4507
4507
|
const {
|
|
4508
|
-
x:
|
|
4508
|
+
x: m = 0,
|
|
4509
4509
|
y: w = 0,
|
|
4510
4510
|
width: _ = 0,
|
|
4511
4511
|
height: P = 0,
|
|
4512
|
-
fillColor:
|
|
4513
|
-
strokeColor:
|
|
4512
|
+
fillColor: N = "#fff",
|
|
4513
|
+
strokeColor: M = "#000",
|
|
4514
4514
|
lineWidth: D = 2
|
|
4515
4515
|
} = f;
|
|
4516
|
-
o.beginPath(), o.moveTo(
|
|
4516
|
+
o.beginPath(), o.moveTo(m + _ / 2, w), o.lineTo(m + _, w + P / 2), o.lineTo(m + _ / 2, w + P), o.lineTo(m, w + P / 2), o.closePath(), o.fillStyle = N, o.fill(), o.strokeStyle = M, o.lineWidth = D, o.stroke();
|
|
4517
4517
|
}, []), St = se((o, f) => {
|
|
4518
4518
|
const {
|
|
4519
|
-
centerX:
|
|
4519
|
+
centerX: m = 0,
|
|
4520
4520
|
centerY: w = 0,
|
|
4521
4521
|
size: _ = 0,
|
|
4522
4522
|
fillColor: P = "#ffff00",
|
|
4523
|
-
strokeColor:
|
|
4524
|
-
lineWidth:
|
|
4523
|
+
strokeColor: N = "#000",
|
|
4524
|
+
lineWidth: M = 2
|
|
4525
4525
|
} = f, D = 5, X = _, W = _ / 2;
|
|
4526
4526
|
o.beginPath();
|
|
4527
4527
|
for (let z = 0; z < D * 2; z++) {
|
|
4528
|
-
const U = z % 2 === 0 ? X : W, H = Math.PI / D * z - Math.PI / 2, G =
|
|
4528
|
+
const U = z % 2 === 0 ? X : W, H = Math.PI / D * z - Math.PI / 2, G = m + Math.cos(H) * U, ee = w + Math.sin(H) * U;
|
|
4529
4529
|
z === 0 ? o.moveTo(G, ee) : o.lineTo(G, ee);
|
|
4530
4530
|
}
|
|
4531
|
-
o.closePath(), o.fillStyle = P, o.fill(), o.strokeStyle =
|
|
4531
|
+
o.closePath(), o.fillStyle = P, o.fill(), o.strokeStyle = N, o.lineWidth = M, o.stroke();
|
|
4532
4532
|
}, []), dt = se((o, f) => {
|
|
4533
4533
|
const {
|
|
4534
|
-
centerX:
|
|
4534
|
+
centerX: m = 0,
|
|
4535
4535
|
centerY: w = 0,
|
|
4536
4536
|
size: _ = 0,
|
|
4537
4537
|
fillColor: P = "#ff6b6b",
|
|
4538
|
-
strokeColor:
|
|
4539
|
-
lineWidth:
|
|
4538
|
+
strokeColor: N = "#000",
|
|
4539
|
+
lineWidth: M = 2
|
|
4540
4540
|
} = f;
|
|
4541
4541
|
o.beginPath();
|
|
4542
4542
|
const D = w - _ / 2;
|
|
4543
|
-
o.moveTo(
|
|
4544
|
-
|
|
4543
|
+
o.moveTo(m, D + _ / 4), o.bezierCurveTo(
|
|
4544
|
+
m - _ / 2,
|
|
4545
4545
|
D,
|
|
4546
|
-
|
|
4546
|
+
m - _,
|
|
4547
4547
|
D + _ / 2,
|
|
4548
|
-
|
|
4548
|
+
m,
|
|
4549
4549
|
w + _ / 2
|
|
4550
4550
|
), o.bezierCurveTo(
|
|
4551
|
-
|
|
4551
|
+
m + _,
|
|
4552
4552
|
D + _ / 2,
|
|
4553
|
-
|
|
4553
|
+
m + _ / 2,
|
|
4554
4554
|
D,
|
|
4555
|
-
|
|
4555
|
+
m,
|
|
4556
4556
|
D + _ / 4
|
|
4557
|
-
), o.fillStyle = P, o.fill(), o.strokeStyle =
|
|
4557
|
+
), o.fillStyle = P, o.fill(), o.strokeStyle = N, o.lineWidth = M, o.stroke();
|
|
4558
4558
|
}, []), ht = se((o, f) => {
|
|
4559
4559
|
const {
|
|
4560
|
-
x:
|
|
4560
|
+
x: m = 0,
|
|
4561
4561
|
y: w = 0,
|
|
4562
4562
|
width: _ = 0,
|
|
4563
4563
|
height: P = 0,
|
|
4564
|
-
fillColor:
|
|
4565
|
-
strokeColor:
|
|
4564
|
+
fillColor: N = "#fff",
|
|
4565
|
+
strokeColor: M = "#000",
|
|
4566
4566
|
lineWidth: D = 2
|
|
4567
|
-
} = f, X =
|
|
4567
|
+
} = f, X = m + _ / 2, W = w + P / 2, z = _ / 2, U = P / 2;
|
|
4568
4568
|
o.beginPath();
|
|
4569
4569
|
for (let H = 0; H < 6; H++) {
|
|
4570
4570
|
const G = Math.PI / 3 * H - Math.PI / 2, ee = X + Math.cos(G) * z, ye = W + Math.sin(G) * U;
|
|
4571
4571
|
H === 0 ? o.moveTo(ee, ye) : o.lineTo(ee, ye);
|
|
4572
4572
|
}
|
|
4573
|
-
o.closePath(), o.fillStyle =
|
|
4573
|
+
o.closePath(), o.fillStyle = N, o.fill(), o.strokeStyle = M, o.lineWidth = D, o.stroke();
|
|
4574
4574
|
}, []), Ct = se((o, f) => {
|
|
4575
4575
|
const {
|
|
4576
|
-
x:
|
|
4576
|
+
x: m = 0,
|
|
4577
4577
|
y: w = 0,
|
|
4578
4578
|
width: _ = 0,
|
|
4579
4579
|
height: P = 0,
|
|
4580
|
-
fillColor:
|
|
4581
|
-
strokeColor:
|
|
4580
|
+
fillColor: N = "#fff",
|
|
4581
|
+
strokeColor: M = "#000",
|
|
4582
4582
|
lineWidth: D = 2
|
|
4583
|
-
} = f, X =
|
|
4583
|
+
} = f, X = m + _ / 2, W = w + P / 2, z = _ / 2, U = P / 2;
|
|
4584
4584
|
o.beginPath();
|
|
4585
4585
|
for (let H = 0; H < 8; H++) {
|
|
4586
4586
|
const G = Math.PI / 4 * H - Math.PI / 2, ee = X + Math.cos(G) * z, ye = W + Math.sin(G) * U;
|
|
4587
4587
|
H === 0 ? o.moveTo(ee, ye) : o.lineTo(ee, ye);
|
|
4588
4588
|
}
|
|
4589
|
-
o.closePath(), o.fillStyle =
|
|
4589
|
+
o.closePath(), o.fillStyle = N, o.fill(), o.strokeStyle = M, o.lineWidth = D, o.stroke();
|
|
4590
4590
|
}, []), _t = se((o, f) => {
|
|
4591
4591
|
const {
|
|
4592
|
-
startX:
|
|
4592
|
+
startX: m = 0,
|
|
4593
4593
|
startY: w = 0,
|
|
4594
4594
|
endX: _ = 0,
|
|
4595
4595
|
endY: P = 0,
|
|
4596
|
-
fillColor:
|
|
4597
|
-
strokeColor:
|
|
4596
|
+
fillColor: N = "#000",
|
|
4597
|
+
strokeColor: M = "#000",
|
|
4598
4598
|
lineWidth: D = 2
|
|
4599
|
-
} = f, X = 15, W = Math.atan2(P - w, _ -
|
|
4600
|
-
o.beginPath(), o.moveTo(
|
|
4599
|
+
} = f, X = 15, W = Math.atan2(P - w, _ - m);
|
|
4600
|
+
o.beginPath(), o.moveTo(m, w), o.lineTo(_, P), o.strokeStyle = M, o.lineWidth = D, o.stroke(), o.beginPath(), o.moveTo(_, P), o.lineTo(
|
|
4601
4601
|
_ - X * Math.cos(W - Math.PI / 6),
|
|
4602
4602
|
P - X * Math.sin(W - Math.PI / 6)
|
|
4603
4603
|
), o.lineTo(
|
|
4604
4604
|
_ - X * Math.cos(W + Math.PI / 6),
|
|
4605
4605
|
P - X * Math.sin(W + Math.PI / 6)
|
|
4606
|
-
), o.closePath(), o.fillStyle =
|
|
4606
|
+
), o.closePath(), o.fillStyle = N, o.fill();
|
|
4607
4607
|
}, []), pt = $e({}), Wt = $e(null), Ht = se((o, f) => {
|
|
4608
|
-
const { x:
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4608
|
+
const { x: m = 0, y: w = 0, width: _ = 0, height: P = 0, src: N = "" } = f;
|
|
4609
|
+
try {
|
|
4610
|
+
if (pt.current[N]) {
|
|
4611
|
+
const M = pt.current[N];
|
|
4612
|
+
if (M.complete && M.naturalWidth > 0)
|
|
4613
|
+
try {
|
|
4614
|
+
o.drawImage(M, m, w, _, P);
|
|
4615
|
+
} catch (D) {
|
|
4616
|
+
console.error("Failed to draw cached image:", D);
|
|
4617
|
+
}
|
|
4618
|
+
} else {
|
|
4619
|
+
const M = new Image();
|
|
4620
|
+
M.onload = () => {
|
|
4621
|
+
pt.current[N] = M, Wt.current && Wt.current();
|
|
4622
|
+
}, M.onerror = (D) => {
|
|
4623
|
+
console.error("Failed to load image:", N, D);
|
|
4624
|
+
}, M.src = N, pt.current[N] = M;
|
|
4625
|
+
}
|
|
4626
|
+
} catch (M) {
|
|
4627
|
+
console.error("Error in drawImage:", M);
|
|
4617
4628
|
}
|
|
4618
4629
|
}, []), Ot = se(
|
|
4619
4630
|
(o, f) => {
|
|
@@ -4675,11 +4686,11 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4675
4686
|
if (!o) return;
|
|
4676
4687
|
const f = document.createElement("canvas");
|
|
4677
4688
|
f.width = o.width, f.height = o.height;
|
|
4678
|
-
const
|
|
4679
|
-
if (!
|
|
4680
|
-
|
|
4681
|
-
Ot(
|
|
4682
|
-
}),
|
|
4689
|
+
const m = f.getContext("2d");
|
|
4690
|
+
if (!m) return;
|
|
4691
|
+
m.fillStyle = "#ffffff", m.fillRect(0, 0, f.width, f.height), m.save(), m.translate(C.panX, C.panY), m.scale(C.zoom, C.zoom), E.forEach((P) => {
|
|
4692
|
+
Ot(m, P);
|
|
4693
|
+
}), m.restore();
|
|
4683
4694
|
const w = f.toDataURL("image/png"), _ = document.createElement("a");
|
|
4684
4695
|
_.download = `whiteboard-${Date.now()}.png`, _.href = w, _.click();
|
|
4685
4696
|
}, [C, E, Ot]), d = se(() => {
|
|
@@ -4691,22 +4702,22 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4691
4702
|
padding: 50
|
|
4692
4703
|
})
|
|
4693
4704
|
);
|
|
4694
|
-
}, [s]),
|
|
4705
|
+
}, [s]), k = se(() => {
|
|
4695
4706
|
s(ya());
|
|
4696
|
-
}, [s]), L = (o, f,
|
|
4697
|
-
const
|
|
4707
|
+
}, [s]), L = (o, f, m, w, _, P) => {
|
|
4708
|
+
const N = o - m, M = f - w, D = _ - m, X = P - w, W = N * D + M * X, z = D * D + X * X;
|
|
4698
4709
|
let U = -1;
|
|
4699
4710
|
z !== 0 && (U = W / z);
|
|
4700
4711
|
let H, G;
|
|
4701
|
-
U < 0 ? (H =
|
|
4712
|
+
U < 0 ? (H = m, G = w) : U > 1 ? (H = _, G = P) : (H = m + U * D, G = w + U * X);
|
|
4702
4713
|
const ee = o - H, ye = f - G;
|
|
4703
4714
|
return Math.sqrt(ee * ee + ye * ye);
|
|
4704
4715
|
}, B = se(
|
|
4705
4716
|
(o, f) => {
|
|
4706
|
-
for (let
|
|
4707
|
-
const w = E[
|
|
4717
|
+
for (let m = E.length - 1; m >= 0; m--) {
|
|
4718
|
+
const w = E[m], _ = w.x ?? 0, P = w.y ?? 0, N = w.width ?? 0, M = w.height ?? 0, D = w.centerX ?? 0, X = w.centerY ?? 0, W = w.radius ?? 0;
|
|
4708
4719
|
if (w.type === "rectangle") {
|
|
4709
|
-
if (o >= _ && o <= _ +
|
|
4720
|
+
if (o >= _ && o <= _ + N && f >= P && f <= P + M)
|
|
4710
4721
|
return w;
|
|
4711
4722
|
} else if (w.type === "circle") {
|
|
4712
4723
|
if (Math.sqrt(
|
|
@@ -4733,7 +4744,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4733
4744
|
if (o >= _ && o <= _ + H && f >= P && f <= P + G)
|
|
4734
4745
|
return w;
|
|
4735
4746
|
} else if (w.type === "triangle" || w.type === "diamond" || w.type === "hexagon" || w.type === "octagon") {
|
|
4736
|
-
if (o >= _ && o <= _ +
|
|
4747
|
+
if (o >= _ && o <= _ + N && f >= P && f <= P + M)
|
|
4737
4748
|
return w;
|
|
4738
4749
|
} else if (w.type === "star" || w.type === "heart") {
|
|
4739
4750
|
const z = Math.sqrt(
|
|
@@ -4752,50 +4763,50 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4752
4763
|
ee
|
|
4753
4764
|
) <= 10)
|
|
4754
4765
|
return w;
|
|
4755
|
-
} else if (w.type === "image" && o >= _ && o <= _ +
|
|
4766
|
+
} else if (w.type === "image" && o >= _ && o <= _ + N && f >= P && f <= P + M)
|
|
4756
4767
|
return w;
|
|
4757
4768
|
}
|
|
4758
4769
|
return null;
|
|
4759
4770
|
},
|
|
4760
4771
|
[E]
|
|
4761
4772
|
), J = se((o) => {
|
|
4762
|
-
let f = 0,
|
|
4773
|
+
let f = 0, m = 0, w = 0, _ = 0;
|
|
4763
4774
|
if (o.type === "rectangle" || o.type === "image" || o.type === "text" || o.type === "triangle" || o.type === "diamond" || o.type === "hexagon" || o.type === "octagon")
|
|
4764
|
-
if (f = o.x ?? 0,
|
|
4775
|
+
if (f = o.x ?? 0, m = o.y ?? 0, o.type === "text") {
|
|
4765
4776
|
const P = o.fontSize || 16;
|
|
4766
4777
|
w = (o.text || "").length * P * 0.6, _ = P;
|
|
4767
4778
|
} else
|
|
4768
4779
|
w = o.width ?? 0, _ = o.height ?? 0;
|
|
4769
4780
|
else if (o.type === "circle") {
|
|
4770
4781
|
const P = o.radius ?? 0;
|
|
4771
|
-
f = (o.centerX ?? 0) - P,
|
|
4782
|
+
f = (o.centerX ?? 0) - P, m = (o.centerY ?? 0) - P, w = P * 2, _ = P * 2;
|
|
4772
4783
|
} else if (o.type === "star" || o.type === "heart") {
|
|
4773
4784
|
const P = o.size ?? 0;
|
|
4774
|
-
f = (o.centerX ?? 0) - P,
|
|
4785
|
+
f = (o.centerX ?? 0) - P, m = (o.centerY ?? 0) - P, w = P * 2, _ = P * 2;
|
|
4775
4786
|
} else if (o.type === "pencil" && o.points && o.points.length > 0) {
|
|
4776
|
-
const P = Math.min(...o.points.map((X) => X.x)),
|
|
4777
|
-
f = P,
|
|
4787
|
+
const P = Math.min(...o.points.map((X) => X.x)), N = Math.max(...o.points.map((X) => X.x)), M = Math.min(...o.points.map((X) => X.y)), D = Math.max(...o.points.map((X) => X.y));
|
|
4788
|
+
f = P, m = M, w = N - P, _ = D - M;
|
|
4778
4789
|
} else if (o.type === "arrow")
|
|
4779
4790
|
return null;
|
|
4780
|
-
return { x: f, y:
|
|
4791
|
+
return { x: f, y: m, w, h: _ };
|
|
4781
4792
|
}, []), Z = se((o) => {
|
|
4782
4793
|
const f = [];
|
|
4783
4794
|
if (o.type === "arrow")
|
|
4784
4795
|
return f.push({ type: "start", x: o.startX ?? 0, y: o.startY ?? 0 }), f.push({ type: "end", x: o.endX ?? 0, y: o.endY ?? 0 }), f;
|
|
4785
|
-
const
|
|
4786
|
-
if (!
|
|
4787
|
-
const { x: w, y: _, w: P, h:
|
|
4788
|
-
return f.push({ type: "nw", x: w, y: _ }), f.push({ type: "ne", x: w + P, y: _ }), f.push({ type: "se", x: w + P, y: _ +
|
|
4789
|
-
}, [J]), K = se((o, f,
|
|
4790
|
-
const _ = Z(
|
|
4791
|
-
for (const
|
|
4792
|
-
if (Math.abs(o -
|
|
4793
|
-
return
|
|
4796
|
+
const m = J(o);
|
|
4797
|
+
if (!m) return [];
|
|
4798
|
+
const { x: w, y: _, w: P, h: N } = m;
|
|
4799
|
+
return f.push({ type: "nw", x: w, y: _ }), f.push({ type: "ne", x: w + P, y: _ }), f.push({ type: "se", x: w + P, y: _ + N }), f.push({ type: "sw", x: w, y: _ + N }), f.push({ type: "n", x: w + P / 2, y: _ }), f.push({ type: "s", x: w + P / 2, y: _ + N }), f.push({ type: "e", x: w + P, y: _ + N / 2 }), f.push({ type: "w", x: w, y: _ + N / 2 }), f;
|
|
4800
|
+
}, [J]), K = se((o, f, m, w) => {
|
|
4801
|
+
const _ = Z(m), P = 10 / w;
|
|
4802
|
+
for (const N of _)
|
|
4803
|
+
if (Math.abs(o - N.x) <= P && Math.abs(f - N.y) <= P)
|
|
4804
|
+
return N.type;
|
|
4794
4805
|
return null;
|
|
4795
4806
|
}, [Z]), q = se((o, f) => {
|
|
4796
4807
|
o.strokeStyle = "#0066cc", o.lineWidth = 1 / C.zoom, o.setLineDash([5 / C.zoom, 5 / C.zoom]);
|
|
4797
|
-
const
|
|
4798
|
-
|
|
4808
|
+
const m = J(f);
|
|
4809
|
+
m ? o.strokeRect(m.x - 4 / C.zoom, m.y - 4 / C.zoom, m.w + 8 / C.zoom, m.h + 8 / C.zoom) : f.type, o.setLineDash([]);
|
|
4799
4810
|
const w = Z(f), _ = 8 / C.zoom;
|
|
4800
4811
|
o.fillStyle = "#ffffff", o.strokeStyle = "#0066cc", o.lineWidth = 1 / C.zoom;
|
|
4801
4812
|
for (const P of w)
|
|
@@ -4804,11 +4815,24 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4804
4815
|
const o = b.current;
|
|
4805
4816
|
if (!o) return;
|
|
4806
4817
|
const f = o.getContext("2d");
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4818
|
+
if (f)
|
|
4819
|
+
try {
|
|
4820
|
+
f.clearRect(0, 0, o.width, o.height), f.save(), f.translate(C.panX, C.panY), f.scale(C.zoom, C.zoom), g.enabled && xt(f, g.size, g.color), E.forEach((m) => {
|
|
4821
|
+
try {
|
|
4822
|
+
Ot(f, m), T.includes(m.id) && q(f, m);
|
|
4823
|
+
} catch (w) {
|
|
4824
|
+
console.error("Error drawing element:", m.id, w);
|
|
4825
|
+
}
|
|
4826
|
+
}), wt && ae && (f.fillStyle = "rgba(0, 102, 204, 0.1)", f.strokeStyle = "#0066cc", f.lineWidth = 1 / C.zoom, f.fillRect(ae.startX, ae.startY, ae.width, ae.height), f.strokeRect(ae.startX, ae.startY, ae.width, ae.height)), f.restore();
|
|
4827
|
+
} catch (m) {
|
|
4828
|
+
console.error("Error redrawing canvas:", m);
|
|
4829
|
+
try {
|
|
4830
|
+
f.restore();
|
|
4831
|
+
} catch {
|
|
4832
|
+
}
|
|
4833
|
+
}
|
|
4810
4834
|
}, [
|
|
4811
|
-
|
|
4835
|
+
g,
|
|
4812
4836
|
xt,
|
|
4813
4837
|
E,
|
|
4814
4838
|
Ot,
|
|
@@ -4825,13 +4849,13 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4825
4849
|
if (!o) return;
|
|
4826
4850
|
const f = o.parentElement;
|
|
4827
4851
|
if (!f) return;
|
|
4828
|
-
const
|
|
4852
|
+
const m = () => {
|
|
4829
4853
|
const _ = f.getBoundingClientRect();
|
|
4830
4854
|
o.width = _.width, o.height = _.height, le();
|
|
4831
4855
|
};
|
|
4832
|
-
|
|
4856
|
+
m();
|
|
4833
4857
|
const w = new ResizeObserver(() => {
|
|
4834
|
-
|
|
4858
|
+
m();
|
|
4835
4859
|
});
|
|
4836
4860
|
return w.observe(f), () => {
|
|
4837
4861
|
w.disconnect();
|
|
@@ -4839,10 +4863,10 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4839
4863
|
}, [le]), xe(() => {
|
|
4840
4864
|
le();
|
|
4841
4865
|
}, [le]), xe(() => {
|
|
4842
|
-
const o = (
|
|
4843
|
-
|
|
4844
|
-
}, f = (
|
|
4845
|
-
|
|
4866
|
+
const o = (m) => {
|
|
4867
|
+
m.target.tagName === "INPUT" || m.target.tagName === "TEXTAREA" || m.code === "Space" && !m.repeat && (m.preventDefault(), Fe(!0));
|
|
4868
|
+
}, f = (m) => {
|
|
4869
|
+
m.target.tagName === "INPUT" || m.target.tagName === "TEXTAREA" || m.code === "Space" && (m.preventDefault(), Fe(!1), Ae(!1), Be(!1));
|
|
4846
4870
|
};
|
|
4847
4871
|
return window.addEventListener("keydown", o), window.addEventListener("keyup", f), () => {
|
|
4848
4872
|
window.removeEventListener("keydown", o), window.removeEventListener("keyup", f);
|
|
@@ -4863,11 +4887,11 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4863
4887
|
if (le(), f.save(), f.translate(C.panX, C.panY), f.scale(C.zoom, C.zoom), y === "pointer")
|
|
4864
4888
|
zt(f, j, R);
|
|
4865
4889
|
else if (y === "rectangle") {
|
|
4866
|
-
const
|
|
4890
|
+
const m = Math.min(j.x, R.x), w = Math.min(j.y, R.y), _ = Math.abs(R.x - j.x), P = Math.abs(R.y - j.y);
|
|
4867
4891
|
Le(f, {
|
|
4868
4892
|
id: "preview",
|
|
4869
4893
|
type: "rectangle",
|
|
4870
|
-
x:
|
|
4894
|
+
x: m,
|
|
4871
4895
|
y: w,
|
|
4872
4896
|
width: _,
|
|
4873
4897
|
height: P,
|
|
@@ -4875,13 +4899,13 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4875
4899
|
lineWidth: O.rectangle.lineWidth
|
|
4876
4900
|
});
|
|
4877
4901
|
} else if (y === "circle") {
|
|
4878
|
-
const
|
|
4902
|
+
const m = j.x, w = j.y, _ = Math.sqrt(
|
|
4879
4903
|
Math.pow(R.x - j.x, 2) + Math.pow(R.y - j.y, 2)
|
|
4880
4904
|
);
|
|
4881
4905
|
tt(f, {
|
|
4882
4906
|
id: "preview",
|
|
4883
4907
|
type: "circle",
|
|
4884
|
-
centerX:
|
|
4908
|
+
centerX: m,
|
|
4885
4909
|
centerY: w,
|
|
4886
4910
|
radius: _,
|
|
4887
4911
|
strokeColor: O.circle.strokeColor,
|
|
@@ -4897,11 +4921,11 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4897
4921
|
lineWidth: O.pencil.lineWidth
|
|
4898
4922
|
});
|
|
4899
4923
|
else if (y === "triangle") {
|
|
4900
|
-
const
|
|
4924
|
+
const m = Math.min(j.x, R.x), w = Math.min(j.y, R.y), _ = Math.abs(R.x - j.x), P = Math.abs(R.y - j.y);
|
|
4901
4925
|
Et(f, {
|
|
4902
4926
|
id: "preview",
|
|
4903
4927
|
type: "triangle",
|
|
4904
|
-
x:
|
|
4928
|
+
x: m,
|
|
4905
4929
|
y: w,
|
|
4906
4930
|
width: _,
|
|
4907
4931
|
height: P,
|
|
@@ -4909,11 +4933,11 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4909
4933
|
lineWidth: O.triangle.lineWidth
|
|
4910
4934
|
});
|
|
4911
4935
|
} else if (y === "diamond") {
|
|
4912
|
-
const
|
|
4936
|
+
const m = Math.min(j.x, R.x), w = Math.min(j.y, R.y), _ = Math.abs(R.x - j.x), P = Math.abs(R.y - j.y);
|
|
4913
4937
|
ft(f, {
|
|
4914
4938
|
id: "preview",
|
|
4915
4939
|
type: "diamond",
|
|
4916
|
-
x:
|
|
4940
|
+
x: m,
|
|
4917
4941
|
y: w,
|
|
4918
4942
|
width: _,
|
|
4919
4943
|
height: P,
|
|
@@ -4921,37 +4945,37 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4921
4945
|
lineWidth: O.diamond.lineWidth
|
|
4922
4946
|
});
|
|
4923
4947
|
} else if (y === "star") {
|
|
4924
|
-
const
|
|
4948
|
+
const m = j.x, w = j.y, _ = Math.sqrt(
|
|
4925
4949
|
Math.pow(R.x - j.x, 2) + Math.pow(R.y - j.y, 2)
|
|
4926
4950
|
);
|
|
4927
4951
|
St(f, {
|
|
4928
4952
|
id: "preview",
|
|
4929
4953
|
type: "star",
|
|
4930
|
-
centerX:
|
|
4954
|
+
centerX: m,
|
|
4931
4955
|
centerY: w,
|
|
4932
4956
|
size: _,
|
|
4933
4957
|
fillColor: O.star.fillColor,
|
|
4934
4958
|
lineWidth: O.star.lineWidth
|
|
4935
4959
|
});
|
|
4936
4960
|
} else if (y === "heart") {
|
|
4937
|
-
const
|
|
4961
|
+
const m = j.x, w = j.y, _ = Math.sqrt(
|
|
4938
4962
|
Math.pow(R.x - j.x, 2) + Math.pow(R.y - j.y, 2)
|
|
4939
4963
|
);
|
|
4940
4964
|
dt(f, {
|
|
4941
4965
|
id: "preview",
|
|
4942
4966
|
type: "heart",
|
|
4943
|
-
centerX:
|
|
4967
|
+
centerX: m,
|
|
4944
4968
|
centerY: w,
|
|
4945
4969
|
size: _,
|
|
4946
4970
|
fillColor: O.heart.fillColor,
|
|
4947
4971
|
lineWidth: O.heart.lineWidth
|
|
4948
4972
|
});
|
|
4949
4973
|
} else if (y === "hexagon") {
|
|
4950
|
-
const
|
|
4974
|
+
const m = Math.min(j.x, R.x), w = Math.min(j.y, R.y), _ = Math.abs(R.x - j.x), P = Math.abs(R.y - j.y);
|
|
4951
4975
|
ht(f, {
|
|
4952
4976
|
id: "preview",
|
|
4953
4977
|
type: "hexagon",
|
|
4954
|
-
x:
|
|
4978
|
+
x: m,
|
|
4955
4979
|
y: w,
|
|
4956
4980
|
width: _,
|
|
4957
4981
|
height: P,
|
|
@@ -4959,11 +4983,11 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
4959
4983
|
lineWidth: O.hexagon.lineWidth
|
|
4960
4984
|
});
|
|
4961
4985
|
} else if (y === "octagon") {
|
|
4962
|
-
const
|
|
4986
|
+
const m = Math.min(j.x, R.x), w = Math.min(j.y, R.y), _ = Math.abs(R.x - j.x), P = Math.abs(R.y - j.y);
|
|
4963
4987
|
Ct(f, {
|
|
4964
4988
|
id: "preview",
|
|
4965
4989
|
type: "octagon",
|
|
4966
|
-
x:
|
|
4990
|
+
x: m,
|
|
4967
4991
|
y: w,
|
|
4968
4992
|
width: _,
|
|
4969
4993
|
height: P,
|
|
@@ -5006,7 +5030,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5006
5030
|
const he = (o) => {
|
|
5007
5031
|
const f = b.current;
|
|
5008
5032
|
if (!f) return;
|
|
5009
|
-
const
|
|
5033
|
+
const m = f.getBoundingClientRect(), w = o.clientX - m.left, _ = o.clientY - m.top;
|
|
5010
5034
|
if (Ie)
|
|
5011
5035
|
return;
|
|
5012
5036
|
if (ke) {
|
|
@@ -5014,26 +5038,26 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5014
5038
|
return;
|
|
5015
5039
|
}
|
|
5016
5040
|
if (x) return;
|
|
5017
|
-
const { x: P, y:
|
|
5041
|
+
const { x: P, y: N } = ie(w, _);
|
|
5018
5042
|
if (y === "pointer") {
|
|
5019
|
-
const
|
|
5043
|
+
const M = B(P, N);
|
|
5020
5044
|
let D = null;
|
|
5021
5045
|
if (T.length === 1) {
|
|
5022
5046
|
const X = T[0], W = E.find((z) => z.id === X);
|
|
5023
5047
|
if (W) {
|
|
5024
|
-
const z = K(P,
|
|
5048
|
+
const z = K(P, N, W, C.zoom);
|
|
5025
5049
|
z && (D = { element: W, handle: z });
|
|
5026
5050
|
}
|
|
5027
5051
|
}
|
|
5028
5052
|
if (D) {
|
|
5029
|
-
Xt(!0), bt(D.handle), At({ x: P, y:
|
|
5053
|
+
Xt(!0), bt(D.handle), At({ x: P, y: N }), Bt(JSON.parse(JSON.stringify(D.element)));
|
|
5030
5054
|
return;
|
|
5031
5055
|
}
|
|
5032
|
-
if (
|
|
5033
|
-
const X = T.includes(
|
|
5056
|
+
if (M) {
|
|
5057
|
+
const X = T.includes(M.id);
|
|
5034
5058
|
let W = T;
|
|
5035
|
-
if (o.shiftKey ? (X ? W = T.filter((z) => z !==
|
|
5036
|
-
we(!0), F({ x: P, y:
|
|
5059
|
+
if (o.shiftKey ? (X ? W = T.filter((z) => z !== M.id) : W = [...T, M.id], s(Ke(W))) : X || (W = [M.id], s(Ke(W))), W.length > 0) {
|
|
5060
|
+
we(!0), F({ x: P, y: N });
|
|
5037
5061
|
const z = {};
|
|
5038
5062
|
W.forEach((U) => {
|
|
5039
5063
|
const H = E.find((G) => G.id === U);
|
|
@@ -5046,27 +5070,27 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5046
5070
|
Dt({ startX: X, startY: W, width: 0, height: 0 });
|
|
5047
5071
|
}
|
|
5048
5072
|
} else if (y === "text") {
|
|
5049
|
-
const
|
|
5073
|
+
const M = Date.now().toString();
|
|
5050
5074
|
s(
|
|
5051
5075
|
Oe({
|
|
5052
|
-
id:
|
|
5076
|
+
id: M,
|
|
5053
5077
|
type: "text",
|
|
5054
5078
|
x: P,
|
|
5055
|
-
y:
|
|
5079
|
+
y: N,
|
|
5056
5080
|
text: "Text",
|
|
5057
5081
|
fontSize: O.text.fontSize,
|
|
5058
5082
|
fontColor: O.text.fontColor
|
|
5059
5083
|
})
|
|
5060
|
-
), s(Ve("pointer")), s(Ke([
|
|
5084
|
+
), s(Ve("pointer")), s(Ke([M])), be(M), Ce("Text"), et({ x: P, y: N }), je(!0);
|
|
5061
5085
|
} else if (y === "eraser") {
|
|
5062
|
-
const
|
|
5063
|
-
|
|
5086
|
+
const M = B(P, N);
|
|
5087
|
+
M && s(ga(M.id));
|
|
5064
5088
|
} else
|
|
5065
|
-
s(Ke([])), $(!0), F({ x: P, y:
|
|
5089
|
+
s(Ke([])), $(!0), F({ x: P, y: N }), Q({ x: P, y: N }), y === "pencil" && pe([{ x: P, y: N }]);
|
|
5066
5090
|
}, We = (o) => {
|
|
5067
5091
|
const f = b.current;
|
|
5068
5092
|
if (!f) return;
|
|
5069
|
-
const
|
|
5093
|
+
const m = f.getBoundingClientRect(), w = o.clientX - m.left, _ = o.clientY - m.top;
|
|
5070
5094
|
if (Ne) {
|
|
5071
5095
|
s(
|
|
5072
5096
|
ba({
|
|
@@ -5077,31 +5101,31 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5077
5101
|
return;
|
|
5078
5102
|
}
|
|
5079
5103
|
if (Xe) {
|
|
5080
|
-
const
|
|
5104
|
+
const M = Ue.y - _, X = Ue.initialZoom * (1 + M * 5e-3);
|
|
5081
5105
|
s(wa(X));
|
|
5082
5106
|
return;
|
|
5083
5107
|
}
|
|
5084
5108
|
if (x) return;
|
|
5085
|
-
const { x: P, y:
|
|
5109
|
+
const { x: P, y: N } = ie(w, _);
|
|
5086
5110
|
if (wt && ae) {
|
|
5087
|
-
const
|
|
5088
|
-
Dt({ ...ae, width:
|
|
5111
|
+
const M = P - ae.startX, D = N - ae.startY;
|
|
5112
|
+
Dt({ ...ae, width: M, height: D });
|
|
5089
5113
|
return;
|
|
5090
5114
|
}
|
|
5091
5115
|
if (ve && T.length > 0) {
|
|
5092
|
-
const
|
|
5116
|
+
const M = P - j.x, D = N - j.y, X = [];
|
|
5093
5117
|
T.forEach((W) => {
|
|
5094
5118
|
const z = Re[W];
|
|
5095
5119
|
if (!z) return;
|
|
5096
5120
|
let U = {};
|
|
5097
5121
|
if (z.type === "rectangle")
|
|
5098
5122
|
U = {
|
|
5099
|
-
x: (z.x ?? 0) +
|
|
5123
|
+
x: (z.x ?? 0) + M,
|
|
5100
5124
|
y: (z.y ?? 0) + D
|
|
5101
5125
|
};
|
|
5102
5126
|
else if (z.type === "circle")
|
|
5103
5127
|
U = {
|
|
5104
|
-
centerX: (z.centerX ?? 0) +
|
|
5128
|
+
centerX: (z.centerX ?? 0) + M,
|
|
5105
5129
|
centerY: (z.centerY ?? 0) + D
|
|
5106
5130
|
};
|
|
5107
5131
|
else if (z.type === "pencil") {
|
|
@@ -5109,26 +5133,26 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5109
5133
|
if (H.length === 0) return;
|
|
5110
5134
|
U = {
|
|
5111
5135
|
points: H.map((G) => ({
|
|
5112
|
-
x: G.x +
|
|
5136
|
+
x: G.x + M,
|
|
5113
5137
|
y: G.y + D
|
|
5114
5138
|
}))
|
|
5115
5139
|
};
|
|
5116
5140
|
} else z.type === "text" ? U = {
|
|
5117
|
-
x: (z.x ?? 0) +
|
|
5141
|
+
x: (z.x ?? 0) + M,
|
|
5118
5142
|
y: (z.y ?? 0) + D
|
|
5119
5143
|
} : z.type === "triangle" || z.type === "diamond" || z.type === "hexagon" || z.type === "octagon" ? U = {
|
|
5120
|
-
x: (z.x ?? 0) +
|
|
5144
|
+
x: (z.x ?? 0) + M,
|
|
5121
5145
|
y: (z.y ?? 0) + D
|
|
5122
5146
|
} : z.type === "star" || z.type === "heart" ? U = {
|
|
5123
|
-
centerX: (z.centerX ?? 0) +
|
|
5147
|
+
centerX: (z.centerX ?? 0) + M,
|
|
5124
5148
|
centerY: (z.centerY ?? 0) + D
|
|
5125
5149
|
} : z.type === "arrow" ? U = {
|
|
5126
|
-
startX: (z.startX ?? 0) +
|
|
5150
|
+
startX: (z.startX ?? 0) + M,
|
|
5127
5151
|
startY: (z.startY ?? 0) + D,
|
|
5128
|
-
endX: (z.endX ?? 0) +
|
|
5152
|
+
endX: (z.endX ?? 0) + M,
|
|
5129
5153
|
endY: (z.endY ?? 0) + D
|
|
5130
5154
|
} : z.type === "image" && (U = {
|
|
5131
|
-
x: (z.x ?? 0) +
|
|
5155
|
+
x: (z.x ?? 0) + M,
|
|
5132
5156
|
y: (z.y ?? 0) + D
|
|
5133
5157
|
});
|
|
5134
5158
|
X.push({ id: W, updates: U });
|
|
@@ -5136,16 +5160,16 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5136
5160
|
return;
|
|
5137
5161
|
}
|
|
5138
5162
|
if (gt && It && Nt && me) {
|
|
5139
|
-
let
|
|
5140
|
-
const D = P - Nt.x, X =
|
|
5163
|
+
let M = {};
|
|
5164
|
+
const D = P - Nt.x, X = N - Nt.y, W = It;
|
|
5141
5165
|
if (W.type === "arrow")
|
|
5142
|
-
me === "start" ?
|
|
5166
|
+
me === "start" ? M = { startX: (W.startX ?? 0) + D, startY: (W.startY ?? 0) + X } : me === "end" && (M = { endX: (W.endX ?? 0) + D, endY: (W.endY ?? 0) + X });
|
|
5143
5167
|
else if (W.type === "circle" || W.type === "star" || W.type === "heart") {
|
|
5144
5168
|
const z = W.radius || W.size || 0, U = me.includes("e"), H = me.includes("s"), G = me.includes("w"), ee = me.includes("n");
|
|
5145
5169
|
let ye = 0;
|
|
5146
5170
|
U && (ye += D), G && (ye -= D), H && (ye += X), ee && (ye -= X);
|
|
5147
5171
|
const Yt = Math.max(5, z + ye);
|
|
5148
|
-
W.type === "circle" ?
|
|
5172
|
+
W.type === "circle" ? M = { radius: Yt } : M = { size: Yt };
|
|
5149
5173
|
} else if (W.type === "pencil" && W.points) {
|
|
5150
5174
|
const z = J(W);
|
|
5151
5175
|
if (z) {
|
|
@@ -5153,7 +5177,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5153
5177
|
let ye = U, Yt = H, fr = G, dr = ee;
|
|
5154
5178
|
me.includes("e") && (fr = Math.max(5, G + D)), me.includes("w") && (fr = Math.max(5, G - D), ye = U + D), me.includes("s") && (dr = Math.max(5, ee + X)), me.includes("n") && (dr = Math.max(5, ee - X), Yt = H + X);
|
|
5155
5179
|
const Co = fr / G, _o = dr / ee;
|
|
5156
|
-
|
|
5180
|
+
M = { points: W.points.map((Zr) => ({
|
|
5157
5181
|
x: ye + (Zr.x - U) * Co,
|
|
5158
5182
|
y: Yt + (Zr.y - H) * _o
|
|
5159
5183
|
})) };
|
|
@@ -5168,12 +5192,12 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5168
5192
|
const ee = (W.height ?? 0) - X;
|
|
5169
5193
|
ee > 5 && (G = ee, U = (W.y ?? 0) + X);
|
|
5170
5194
|
}
|
|
5171
|
-
|
|
5195
|
+
M = { x: z, y: U, width: H, height: G };
|
|
5172
5196
|
}
|
|
5173
|
-
Object.keys(
|
|
5197
|
+
Object.keys(M).length > 0 && s(tr({ id: W.id, updates: M }));
|
|
5174
5198
|
return;
|
|
5175
5199
|
}
|
|
5176
|
-
I && (Q({ x: P, y:
|
|
5200
|
+
I && (Q({ x: P, y: N }), y === "pencil" && pe((M) => [...M, { x: P, y: N }]));
|
|
5177
5201
|
}, Ge = () => {
|
|
5178
5202
|
if (Ne || Xe) {
|
|
5179
5203
|
Ae(!1), Be(!1);
|
|
@@ -5184,24 +5208,24 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5184
5208
|
return;
|
|
5185
5209
|
}
|
|
5186
5210
|
if (ve && we(!1), wt && ae) {
|
|
5187
|
-
const o = ae.width > 0 ? ae.startX : ae.startX + ae.width, f = ae.height > 0 ? ae.startY : ae.startY + ae.height,
|
|
5211
|
+
const o = ae.width > 0 ? ae.startX : ae.startX + ae.width, f = ae.height > 0 ? ae.startY : ae.startY + ae.height, m = Math.abs(ae.width), w = Math.abs(ae.height), _ = [];
|
|
5188
5212
|
E.forEach((P) => {
|
|
5189
|
-
const
|
|
5190
|
-
|
|
5213
|
+
const N = J(P);
|
|
5214
|
+
N && N.x < o + m && N.x + N.w > o && N.y < f + w && N.y + N.h > f && _.push(P.id);
|
|
5191
5215
|
}), _.length > 0 && s(Ke(_));
|
|
5192
5216
|
}
|
|
5193
5217
|
if ($(!1), we(!1), Xt(!1), Ut(!1), Dt(null), bt(null), Bt(null), pe([]), F({ x: 0, y: 0 }), Me({}), At(null), Ae(!1), !!I) {
|
|
5194
5218
|
if (y === "pointer")
|
|
5195
5219
|
le();
|
|
5196
5220
|
else if (y === "rectangle") {
|
|
5197
|
-
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y),
|
|
5198
|
-
|
|
5221
|
+
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y), m = Math.abs(R.x - j.x), w = Math.abs(R.y - j.y);
|
|
5222
|
+
m > 0 && w > 0 && s(
|
|
5199
5223
|
Oe({
|
|
5200
5224
|
id: Date.now().toString(),
|
|
5201
5225
|
type: "rectangle",
|
|
5202
5226
|
x: o,
|
|
5203
5227
|
y: f,
|
|
5204
|
-
width:
|
|
5228
|
+
width: m,
|
|
5205
5229
|
height: w,
|
|
5206
5230
|
strokeColor: O.rectangle.strokeColor,
|
|
5207
5231
|
fillColor: O.rectangle.fillColor,
|
|
@@ -5209,16 +5233,16 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5209
5233
|
})
|
|
5210
5234
|
);
|
|
5211
5235
|
} else if (y === "circle") {
|
|
5212
|
-
const o = j.x, f = j.y,
|
|
5236
|
+
const o = j.x, f = j.y, m = Math.sqrt(
|
|
5213
5237
|
Math.pow(R.x - j.x, 2) + Math.pow(R.y - j.y, 2)
|
|
5214
5238
|
);
|
|
5215
|
-
|
|
5239
|
+
m > 0 && s(
|
|
5216
5240
|
Oe({
|
|
5217
5241
|
id: Date.now().toString(),
|
|
5218
5242
|
type: "circle",
|
|
5219
5243
|
centerX: o,
|
|
5220
5244
|
centerY: f,
|
|
5221
|
-
radius:
|
|
5245
|
+
radius: m,
|
|
5222
5246
|
strokeColor: O.circle.strokeColor,
|
|
5223
5247
|
fillColor: O.circle.fillColor,
|
|
5224
5248
|
lineWidth: O.circle.lineWidth
|
|
@@ -5235,14 +5259,14 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5235
5259
|
})
|
|
5236
5260
|
), pe([]);
|
|
5237
5261
|
else if (y === "triangle") {
|
|
5238
|
-
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y),
|
|
5239
|
-
|
|
5262
|
+
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y), m = Math.abs(R.x - j.x), w = Math.abs(R.y - j.y);
|
|
5263
|
+
m > 0 && w > 0 && s(
|
|
5240
5264
|
Oe({
|
|
5241
5265
|
id: Date.now().toString(),
|
|
5242
5266
|
type: "triangle",
|
|
5243
5267
|
x: o,
|
|
5244
5268
|
y: f,
|
|
5245
|
-
width:
|
|
5269
|
+
width: m,
|
|
5246
5270
|
height: w,
|
|
5247
5271
|
strokeColor: O.triangle.strokeColor,
|
|
5248
5272
|
fillColor: O.triangle.fillColor,
|
|
@@ -5250,14 +5274,14 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5250
5274
|
})
|
|
5251
5275
|
);
|
|
5252
5276
|
} else if (y === "diamond") {
|
|
5253
|
-
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y),
|
|
5254
|
-
|
|
5277
|
+
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y), m = Math.abs(R.x - j.x), w = Math.abs(R.y - j.y);
|
|
5278
|
+
m > 0 && w > 0 && s(
|
|
5255
5279
|
Oe({
|
|
5256
5280
|
id: Date.now().toString(),
|
|
5257
5281
|
type: "diamond",
|
|
5258
5282
|
x: o,
|
|
5259
5283
|
y: f,
|
|
5260
|
-
width:
|
|
5284
|
+
width: m,
|
|
5261
5285
|
height: w,
|
|
5262
5286
|
strokeColor: O.diamond.strokeColor,
|
|
5263
5287
|
fillColor: O.diamond.fillColor,
|
|
@@ -5265,46 +5289,46 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5265
5289
|
})
|
|
5266
5290
|
);
|
|
5267
5291
|
} else if (y === "star") {
|
|
5268
|
-
const o = j.x, f = j.y,
|
|
5292
|
+
const o = j.x, f = j.y, m = Math.sqrt(
|
|
5269
5293
|
Math.pow(R.x - j.x, 2) + Math.pow(R.y - j.y, 2)
|
|
5270
5294
|
);
|
|
5271
|
-
|
|
5295
|
+
m > 0 && s(
|
|
5272
5296
|
Oe({
|
|
5273
5297
|
id: Date.now().toString(),
|
|
5274
5298
|
type: "star",
|
|
5275
5299
|
centerX: o,
|
|
5276
5300
|
centerY: f,
|
|
5277
|
-
size:
|
|
5301
|
+
size: m,
|
|
5278
5302
|
strokeColor: O.star.strokeColor,
|
|
5279
5303
|
fillColor: O.star.fillColor,
|
|
5280
5304
|
lineWidth: O.star.lineWidth
|
|
5281
5305
|
})
|
|
5282
5306
|
);
|
|
5283
5307
|
} else if (y === "heart") {
|
|
5284
|
-
const o = j.x, f = j.y,
|
|
5308
|
+
const o = j.x, f = j.y, m = Math.sqrt(
|
|
5285
5309
|
Math.pow(R.x - j.x, 2) + Math.pow(R.y - j.y, 2)
|
|
5286
5310
|
);
|
|
5287
|
-
|
|
5311
|
+
m > 0 && s(
|
|
5288
5312
|
Oe({
|
|
5289
5313
|
id: Date.now().toString(),
|
|
5290
5314
|
type: "heart",
|
|
5291
5315
|
centerX: o,
|
|
5292
5316
|
centerY: f,
|
|
5293
|
-
size:
|
|
5317
|
+
size: m,
|
|
5294
5318
|
strokeColor: O.heart.strokeColor,
|
|
5295
5319
|
fillColor: O.heart.fillColor,
|
|
5296
5320
|
lineWidth: O.heart.lineWidth
|
|
5297
5321
|
})
|
|
5298
5322
|
);
|
|
5299
5323
|
} else if (y === "hexagon") {
|
|
5300
|
-
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y),
|
|
5301
|
-
|
|
5324
|
+
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y), m = Math.abs(R.x - j.x), w = Math.abs(R.y - j.y);
|
|
5325
|
+
m > 0 && w > 0 && s(
|
|
5302
5326
|
Oe({
|
|
5303
5327
|
id: Date.now().toString(),
|
|
5304
5328
|
type: "hexagon",
|
|
5305
5329
|
x: o,
|
|
5306
5330
|
y: f,
|
|
5307
|
-
width:
|
|
5331
|
+
width: m,
|
|
5308
5332
|
height: w,
|
|
5309
5333
|
strokeColor: O.hexagon.strokeColor,
|
|
5310
5334
|
fillColor: O.hexagon.fillColor,
|
|
@@ -5312,14 +5336,14 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5312
5336
|
})
|
|
5313
5337
|
);
|
|
5314
5338
|
} else if (y === "octagon") {
|
|
5315
|
-
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y),
|
|
5316
|
-
|
|
5339
|
+
const o = Math.min(j.x, R.x), f = Math.min(j.y, R.y), m = Math.abs(R.x - j.x), w = Math.abs(R.y - j.y);
|
|
5340
|
+
m > 0 && w > 0 && s(
|
|
5317
5341
|
Oe({
|
|
5318
5342
|
id: Date.now().toString(),
|
|
5319
5343
|
type: "octagon",
|
|
5320
5344
|
x: o,
|
|
5321
5345
|
y: f,
|
|
5322
|
-
width:
|
|
5346
|
+
width: m,
|
|
5323
5347
|
height: w,
|
|
5324
5348
|
strokeColor: O.octagon.strokeColor,
|
|
5325
5349
|
fillColor: O.octagon.fillColor,
|
|
@@ -5346,8 +5370,8 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5346
5370
|
}
|
|
5347
5371
|
}, qt = (o) => {
|
|
5348
5372
|
ke && o.preventDefault();
|
|
5349
|
-
}, Ye = (o, f,
|
|
5350
|
-
be(o.id), Ce(o.text || ""), et({ x: o.x || f, y: o.y ||
|
|
5373
|
+
}, Ye = (o, f, m) => {
|
|
5374
|
+
be(o.id), Ce(o.text || ""), et({ x: o.x || f, y: o.y || m }), ze.current = o.text || "", je(!0);
|
|
5351
5375
|
}, xo = () => {
|
|
5352
5376
|
if (ke)
|
|
5353
5377
|
return Ne ? "grabbing" : Xe ? "ns-resize" : "grab";
|
|
@@ -5370,41 +5394,41 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5370
5394
|
}
|
|
5371
5395
|
const f = document.getElementById("wb-canvas-container");
|
|
5372
5396
|
if (!f) return;
|
|
5373
|
-
const
|
|
5374
|
-
let P = !1,
|
|
5375
|
-
if (
|
|
5376
|
-
const
|
|
5397
|
+
const m = f.querySelector(".wb-toolbar"), w = f.querySelector(".wb-prop-tools"), _ = f.querySelector(".wb-lock-indicator");
|
|
5398
|
+
let P = !1, N = !1;
|
|
5399
|
+
if (m) {
|
|
5400
|
+
const M = m.getBoundingClientRect();
|
|
5377
5401
|
if (w) {
|
|
5378
5402
|
const D = w.getBoundingClientRect();
|
|
5379
|
-
|
|
5403
|
+
M.bottom > D.top - 10 && (P = !0);
|
|
5380
5404
|
}
|
|
5381
5405
|
if (_) {
|
|
5382
5406
|
const D = _.getBoundingClientRect();
|
|
5383
|
-
|
|
5407
|
+
M.top < D.bottom + 10 && (N = !0);
|
|
5384
5408
|
}
|
|
5385
5409
|
}
|
|
5386
|
-
Gr({ propTools: P, lockIndicator:
|
|
5410
|
+
Gr({ propTools: P, lockIndicator: N });
|
|
5387
5411
|
};
|
|
5388
5412
|
return o(), window.addEventListener("resize", o), () => {
|
|
5389
5413
|
window.removeEventListener("resize", o);
|
|
5390
5414
|
};
|
|
5391
5415
|
}, [y, x, T]);
|
|
5392
|
-
const Kr = async (o, f,
|
|
5416
|
+
const Kr = async (o, f, m) => {
|
|
5393
5417
|
try {
|
|
5394
5418
|
let w = "";
|
|
5395
5419
|
c ? w = await c(o) : w = URL.createObjectURL(o);
|
|
5396
5420
|
const _ = new Image();
|
|
5397
5421
|
_.onload = () => {
|
|
5398
|
-
const P = _.width / _.height,
|
|
5422
|
+
const P = _.width / _.height, N = 200, M = N / P;
|
|
5399
5423
|
s(
|
|
5400
5424
|
Oe({
|
|
5401
5425
|
id: Date.now().toString(),
|
|
5402
5426
|
type: "image",
|
|
5403
|
-
x: f -
|
|
5427
|
+
x: f - N / 2,
|
|
5404
5428
|
// Center at coordinates
|
|
5405
|
-
y:
|
|
5406
|
-
width:
|
|
5407
|
-
height:
|
|
5429
|
+
y: m - M / 2,
|
|
5430
|
+
width: N,
|
|
5431
|
+
height: M,
|
|
5408
5432
|
src: w
|
|
5409
5433
|
})
|
|
5410
5434
|
);
|
|
@@ -5416,13 +5440,13 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5416
5440
|
xe(() => {
|
|
5417
5441
|
const o = (f) => {
|
|
5418
5442
|
if (!(f.target.tagName === "INPUT" || f.target.tagName === "TEXTAREA") && !x && f.clipboardData && f.clipboardData.files.length > 0) {
|
|
5419
|
-
const
|
|
5420
|
-
if (
|
|
5443
|
+
const m = f.clipboardData.files[0];
|
|
5444
|
+
if (m.type.startsWith("image/")) {
|
|
5421
5445
|
f.preventDefault();
|
|
5422
5446
|
const w = b.current;
|
|
5423
5447
|
if (w) {
|
|
5424
|
-
const _ = w.getBoundingClientRect(), P = _.width / 2,
|
|
5425
|
-
Kr(
|
|
5448
|
+
const _ = w.getBoundingClientRect(), P = _.width / 2, N = _.height / 2, { x: M, y: D } = ie(P, N);
|
|
5449
|
+
Kr(m, M, D);
|
|
5426
5450
|
}
|
|
5427
5451
|
}
|
|
5428
5452
|
}
|
|
@@ -5435,10 +5459,10 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5435
5459
|
if (o.preventDefault(), !x && o.dataTransfer.files && o.dataTransfer.files.length > 0) {
|
|
5436
5460
|
const f = o.dataTransfer.files[0];
|
|
5437
5461
|
if (f.type.startsWith("image/")) {
|
|
5438
|
-
const
|
|
5439
|
-
if (
|
|
5440
|
-
const w =
|
|
5441
|
-
Kr(f,
|
|
5462
|
+
const m = b.current;
|
|
5463
|
+
if (m) {
|
|
5464
|
+
const w = m.getBoundingClientRect(), _ = o.clientX - w.left, P = o.clientY - w.top, { x: N, y: M } = ie(_, P);
|
|
5465
|
+
Kr(f, N, M);
|
|
5442
5466
|
}
|
|
5443
5467
|
}
|
|
5444
5468
|
}
|
|
@@ -5463,8 +5487,8 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5463
5487
|
if (x) return;
|
|
5464
5488
|
const f = b.current;
|
|
5465
5489
|
if (!f) return;
|
|
5466
|
-
const
|
|
5467
|
-
|
|
5490
|
+
const m = f.getBoundingClientRect(), w = o.clientX - m.left, _ = o.clientY - m.top, { x: P, y: N } = ie(w, _), M = B(P, N);
|
|
5491
|
+
M && M.type === "text" && Ye(M, P, N);
|
|
5468
5492
|
},
|
|
5469
5493
|
onContextMenu: qt,
|
|
5470
5494
|
style: { cursor: xo() }
|
|
@@ -5520,7 +5544,7 @@ const ls = ({ onClose: e, onConfirm: t }) => {
|
|
|
5520
5544
|
{
|
|
5521
5545
|
onFitToView: d,
|
|
5522
5546
|
onExport: ur,
|
|
5523
|
-
onToggleGrid:
|
|
5547
|
+
onToggleGrid: k
|
|
5524
5548
|
}
|
|
5525
5549
|
),
|
|
5526
5550
|
/* @__PURE__ */ h.jsx(us, { mode: l, onImageUpload: c }),
|