react-sync-board 1.2.5 → 1.2.7

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.
@@ -5,7 +5,7 @@ import g, { useContext as _e, useDebugValue as Yr, useRef as Re, useMemo as lt,
5
5
  function Br(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
- var Ie = {}, Nr = {
8
+ var Ie = {}, Xr = {
9
9
  get exports() {
10
10
  return Ie;
11
11
  },
@@ -23,20 +23,20 @@ var Ie = {}, Nr = {
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  */
25
25
  var Pt;
26
- function Xr() {
26
+ function Nr() {
27
27
  if (Pt)
28
28
  return Ee;
29
29
  Pt = 1;
30
30
  var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
31
31
  function a(u, l, d) {
32
- var f, c = {}, h = null, _ = null;
33
- d !== void 0 && (h = "" + d), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (_ = l.ref);
32
+ var f, c = {}, h = null, S = null;
33
+ d !== void 0 && (h = "" + d), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (S = l.ref);
34
34
  for (f in l)
35
35
  n.call(l, f) && !s.hasOwnProperty(f) && (c[f] = l[f]);
36
36
  if (u && u.defaultProps)
37
37
  for (f in l = u.defaultProps, l)
38
38
  c[f] === void 0 && (c[f] = l[f]);
39
- return { $$typeof: t, type: u, key: h, ref: _, props: c, _owner: o.current };
39
+ return { $$typeof: t, type: u, key: h, ref: S, props: c, _owner: o.current };
40
40
  }
41
41
  return Ee.Fragment = r, Ee.jsx = a, Ee.jsxs = a, Ee;
42
42
  }
@@ -53,8 +53,8 @@ var we = {};
53
53
  var Mt;
54
54
  function Ur() {
55
55
  return Mt || (Mt = 1, process.env.NODE_ENV !== "production" && function() {
56
- var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), u = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), v = Symbol.iterator, E = "@@iterator";
57
- function I(i) {
56
+ var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), u = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), v = Symbol.iterator, E = "@@iterator";
57
+ function O(i) {
58
58
  if (i === null || typeof i != "object")
59
59
  return null;
60
60
  var b = v && i[v] || i[E];
@@ -63,41 +63,41 @@ function Ur() {
63
63
  var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
64
64
  function C(i) {
65
65
  {
66
- for (var b = arguments.length, R = new Array(b > 1 ? b - 1 : 0), D = 1; D < b; D++)
67
- R[D - 1] = arguments[D];
68
- x("error", i, R);
66
+ for (var b = arguments.length, I = new Array(b > 1 ? b - 1 : 0), D = 1; D < b; D++)
67
+ I[D - 1] = arguments[D];
68
+ x("error", i, I);
69
69
  }
70
70
  }
71
- function x(i, b, R) {
71
+ function x(i, b, I) {
72
72
  {
73
- var D = y.ReactDebugCurrentFrame, X = D.getStackAddendum();
74
- X !== "" && (b += "%s", R = R.concat([X]));
75
- var W = R.map(function(B) {
76
- return String(B);
73
+ var D = y.ReactDebugCurrentFrame, N = D.getStackAddendum();
74
+ N !== "" && (b += "%s", I = I.concat([N]));
75
+ var W = I.map(function(X) {
76
+ return String(X);
77
77
  });
78
78
  W.unshift("Warning: " + b), Function.prototype.apply.call(console[i], console, W);
79
79
  }
80
80
  }
81
- var p = !1, w = !1, m = !1, S = !1, O = !1, k;
82
- k = Symbol.for("react.module.reference");
81
+ var p = !1, _ = !1, m = !1, w = !1, R = !1, T;
82
+ T = Symbol.for("react.module.reference");
83
83
  function j(i) {
84
- return !!(typeof i == "string" || typeof i == "function" || i === n || i === s || O || i === o || i === d || i === f || S || i === _ || p || w || m || typeof i == "object" && i !== null && (i.$$typeof === h || i.$$typeof === c || i.$$typeof === a || i.$$typeof === u || i.$$typeof === l || // This needs to include all possible module reference object
84
+ return !!(typeof i == "string" || typeof i == "function" || i === n || i === s || R || i === o || i === d || i === f || w || i === S || p || _ || m || typeof i == "object" && i !== null && (i.$$typeof === h || i.$$typeof === c || i.$$typeof === a || i.$$typeof === u || i.$$typeof === l || // This needs to include all possible module reference object
85
85
  // types supported by any Flight configuration anywhere since
86
86
  // we don't know which Flight build this will end up being used
87
87
  // with.
88
- i.$$typeof === k || i.getModuleId !== void 0));
88
+ i.$$typeof === T || i.getModuleId !== void 0));
89
89
  }
90
- function M(i, b, R) {
90
+ function M(i, b, I) {
91
91
  var D = i.displayName;
92
92
  if (D)
93
93
  return D;
94
- var X = b.displayName || b.name || "";
95
- return X !== "" ? R + "(" + X + ")" : R;
94
+ var N = b.displayName || b.name || "";
95
+ return N !== "" ? I + "(" + N + ")" : I;
96
96
  }
97
97
  function A(i) {
98
98
  return i.displayName || "Context";
99
99
  }
100
- function N(i) {
100
+ function B(i) {
101
101
  if (i == null)
102
102
  return null;
103
103
  if (typeof i.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
@@ -124,17 +124,17 @@ function Ur() {
124
124
  var b = i;
125
125
  return A(b) + ".Consumer";
126
126
  case a:
127
- var R = i;
128
- return A(R._context) + ".Provider";
127
+ var I = i;
128
+ return A(I._context) + ".Provider";
129
129
  case l:
130
130
  return M(i, i.render, "ForwardRef");
131
131
  case c:
132
132
  var D = i.displayName || null;
133
- return D !== null ? D : N(i.type) || "Memo";
133
+ return D !== null ? D : B(i.type) || "Memo";
134
134
  case h: {
135
- var X = i, W = X._payload, B = X._init;
135
+ var N = i, W = N._payload, X = N._init;
136
136
  try {
137
- return N(B(W));
137
+ return B(X(W));
138
138
  } catch {
139
139
  return null;
140
140
  }
@@ -142,14 +142,14 @@ function Ur() {
142
142
  }
143
143
  return null;
144
144
  }
145
- var U = Object.assign, J = 0, P, $, z, V, Y, F, H;
145
+ var U = Object.assign, J = 0, P, $, Y, V, L, F, H;
146
146
  function te() {
147
147
  }
148
148
  te.__reactDisabledLog = !0;
149
- function Z() {
149
+ function Q() {
150
150
  {
151
151
  if (J === 0) {
152
- P = console.log, $ = console.info, z = console.warn, V = console.error, Y = console.group, F = console.groupCollapsed, H = console.groupEnd;
152
+ P = console.log, $ = console.info, Y = console.warn, V = console.error, L = console.group, F = console.groupCollapsed, H = console.groupEnd;
153
153
  var i = {
154
154
  configurable: !0,
155
155
  enumerable: !0,
@@ -185,13 +185,13 @@ function Ur() {
185
185
  value: $
186
186
  }),
187
187
  warn: U({}, i, {
188
- value: z
188
+ value: Y
189
189
  }),
190
190
  error: U({}, i, {
191
191
  value: V
192
192
  }),
193
193
  group: U({}, i, {
194
- value: Y
194
+ value: L
195
195
  }),
196
196
  groupCollapsed: U({}, i, {
197
197
  value: F
@@ -205,13 +205,13 @@ function Ur() {
205
205
  }
206
206
  }
207
207
  var ie = y.ReactCurrentDispatcher, me;
208
- function ge(i, b, R) {
208
+ function ge(i, b, I) {
209
209
  {
210
210
  if (me === void 0)
211
211
  try {
212
212
  throw Error();
213
- } catch (X) {
214
- var D = X.stack.trim().match(/\n( *(at )?)/);
213
+ } catch (N) {
214
+ var D = N.stack.trim().match(/\n( *(at )?)/);
215
215
  me = D && D[1] || "";
216
216
  }
217
217
  return `
@@ -227,39 +227,39 @@ function Ur() {
227
227
  if (!i || Ke)
228
228
  return "";
229
229
  {
230
- var R = je.get(i);
231
- if (R !== void 0)
232
- return R;
230
+ var I = je.get(i);
231
+ if (I !== void 0)
232
+ return I;
233
233
  }
234
234
  var D;
235
235
  Ke = !0;
236
- var X = Error.prepareStackTrace;
236
+ var N = Error.prepareStackTrace;
237
237
  Error.prepareStackTrace = void 0;
238
238
  var W;
239
- W = ie.current, ie.current = null, Z();
239
+ W = ie.current, ie.current = null, Q();
240
240
  try {
241
241
  if (b) {
242
- var B = function() {
242
+ var X = function() {
243
243
  throw Error();
244
244
  };
245
- if (Object.defineProperty(B.prototype, "props", {
245
+ if (Object.defineProperty(X.prototype, "props", {
246
246
  set: function() {
247
247
  throw Error();
248
248
  }
249
249
  }), typeof Reflect == "object" && Reflect.construct) {
250
250
  try {
251
- Reflect.construct(B, []);
251
+ Reflect.construct(X, []);
252
252
  } catch (ae) {
253
253
  D = ae;
254
254
  }
255
- Reflect.construct(i, [], B);
255
+ Reflect.construct(i, [], X);
256
256
  } else {
257
257
  try {
258
- B.call();
258
+ X.call();
259
259
  } catch (ae) {
260
260
  D = ae;
261
261
  }
262
- i.call(B.prototype);
262
+ i.call(X.prototype);
263
263
  }
264
264
  } else {
265
265
  try {
@@ -271,17 +271,17 @@ function Ur() {
271
271
  }
272
272
  } catch (ae) {
273
273
  if (ae && D && typeof ae.stack == "string") {
274
- for (var L = ae.stack.split(`
274
+ for (var z = ae.stack.split(`
275
275
  `), ee = D.stack.split(`
276
- `), q = L.length - 1, G = ee.length - 1; q >= 1 && G >= 0 && L[q] !== ee[G]; )
276
+ `), q = z.length - 1, G = ee.length - 1; q >= 1 && G >= 0 && z[q] !== ee[G]; )
277
277
  G--;
278
278
  for (; q >= 1 && G >= 0; q--, G--)
279
- if (L[q] !== ee[G]) {
279
+ if (z[q] !== ee[G]) {
280
280
  if (q !== 1 || G !== 1)
281
281
  do
282
- if (q--, G--, G < 0 || L[q] !== ee[G]) {
282
+ if (q--, G--, G < 0 || z[q] !== ee[G]) {
283
283
  var re = `
284
- ` + L[q].replace(" at new ", " at ");
284
+ ` + z[q].replace(" at new ", " at ");
285
285
  return i.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", i.displayName)), typeof i == "function" && je.set(i, re), re;
286
286
  }
287
287
  while (q >= 1 && G >= 0);
@@ -289,19 +289,19 @@ function Ur() {
289
289
  }
290
290
  }
291
291
  } finally {
292
- Ke = !1, ie.current = W, ne(), Error.prepareStackTrace = X;
292
+ Ke = !1, ie.current = W, ne(), Error.prepareStackTrace = N;
293
293
  }
294
294
  var ve = i ? i.displayName || i.name : "", Tt = ve ? ge(ve) : "";
295
295
  return typeof i == "function" && je.set(i, Tt), Tt;
296
296
  }
297
- function gr(i, b, R) {
297
+ function gr(i, b, I) {
298
298
  return ht(i, !1);
299
299
  }
300
300
  function hr(i) {
301
301
  var b = i.prototype;
302
302
  return !!(b && b.isReactComponent);
303
303
  }
304
- function De(i, b, R) {
304
+ function De(i, b, I) {
305
305
  if (i == null)
306
306
  return "";
307
307
  if (typeof i == "function")
@@ -319,11 +319,11 @@ function Ur() {
319
319
  case l:
320
320
  return gr(i.render);
321
321
  case c:
322
- return De(i.type, b, R);
322
+ return De(i.type, b, I);
323
323
  case h: {
324
- var D = i, X = D._payload, W = D._init;
324
+ var D = i, N = D._payload, W = D._init;
325
325
  try {
326
- return De(W(X), b, R);
326
+ return De(W(N), b, I);
327
327
  } catch {
328
328
  }
329
329
  }
@@ -333,27 +333,27 @@ function Ur() {
333
333
  var $e = Object.prototype.hasOwnProperty, vt = {}, yt = y.ReactDebugCurrentFrame;
334
334
  function Ae(i) {
335
335
  if (i) {
336
- var b = i._owner, R = De(i.type, i._source, b ? b.type : null);
337
- yt.setExtraStackFrame(R);
336
+ var b = i._owner, I = De(i.type, i._source, b ? b.type : null);
337
+ yt.setExtraStackFrame(I);
338
338
  } else
339
339
  yt.setExtraStackFrame(null);
340
340
  }
341
- function vr(i, b, R, D, X) {
341
+ function vr(i, b, I, D, N) {
342
342
  {
343
343
  var W = Function.call.bind($e);
344
- for (var B in i)
345
- if (W(i, B)) {
346
- var L = void 0;
344
+ for (var X in i)
345
+ if (W(i, X)) {
346
+ var z = void 0;
347
347
  try {
348
- if (typeof i[B] != "function") {
349
- var ee = Error((D || "React class") + ": " + R + " type `" + B + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[B] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
348
+ if (typeof i[X] != "function") {
349
+ var ee = Error((D || "React class") + ": " + I + " type `" + X + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[X] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
350
350
  throw ee.name = "Invariant Violation", ee;
351
351
  }
352
- L = i[B](b, B, D, R, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
352
+ z = i[X](b, X, D, I, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
353
353
  } catch (q) {
354
- L = q;
354
+ z = q;
355
355
  }
356
- L && !(L instanceof Error) && (Ae(X), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", D || "React class", R, B, typeof L), Ae(null)), L instanceof Error && !(L.message in vt) && (vt[L.message] = !0, Ae(X), C("Failed %s type: %s", R, L.message), Ae(null));
356
+ z && !(z instanceof Error) && (Ae(N), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", D || "React class", I, X, typeof z), Ae(null)), z instanceof Error && !(z.message in vt) && (vt[z.message] = !0, Ae(N), C("Failed %s type: %s", I, z.message), Ae(null));
357
357
  }
358
358
  }
359
359
  }
@@ -363,8 +363,8 @@ function Ur() {
363
363
  }
364
364
  function Sr(i) {
365
365
  {
366
- var b = typeof Symbol == "function" && Symbol.toStringTag, R = b && i[Symbol.toStringTag] || i.constructor.name || "Object";
367
- return R;
366
+ var b = typeof Symbol == "function" && Symbol.toStringTag, I = b && i[Symbol.toStringTag] || i.constructor.name || "Object";
367
+ return I;
368
368
  }
369
369
  }
370
370
  function _r(i) {
@@ -406,84 +406,84 @@ function Ur() {
406
406
  }
407
407
  function Cr(i, b) {
408
408
  if (typeof i.ref == "string" && be.current && b && be.current.stateNode !== b) {
409
- var R = N(be.current.type);
410
- qe[R] || (C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(be.current.type), i.ref), qe[R] = !0);
409
+ var I = B(be.current.type);
410
+ qe[I] || (C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', B(be.current.type), i.ref), qe[I] = !0);
411
411
  }
412
412
  }
413
413
  function xr(i, b) {
414
414
  {
415
- var R = function() {
415
+ var I = function() {
416
416
  bt || (bt = !0, C("%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)", b));
417
417
  };
418
- R.isReactWarning = !0, Object.defineProperty(i, "key", {
419
- get: R,
418
+ I.isReactWarning = !0, Object.defineProperty(i, "key", {
419
+ get: I,
420
420
  configurable: !0
421
421
  });
422
422
  }
423
423
  }
424
424
  function Rr(i, b) {
425
425
  {
426
- var R = function() {
426
+ var I = function() {
427
427
  Et || (Et = !0, C("%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)", b));
428
428
  };
429
- R.isReactWarning = !0, Object.defineProperty(i, "ref", {
430
- get: R,
429
+ I.isReactWarning = !0, Object.defineProperty(i, "ref", {
430
+ get: I,
431
431
  configurable: !0
432
432
  });
433
433
  }
434
434
  }
435
- var Ir = function(i, b, R, D, X, W, B) {
436
- var L = {
435
+ var Ir = function(i, b, I, D, N, W, X) {
436
+ var z = {
437
437
  // This tag allows us to uniquely identify this as a React Element
438
438
  $$typeof: t,
439
439
  // Built-in properties that belong on the element
440
440
  type: i,
441
441
  key: b,
442
- ref: R,
443
- props: B,
442
+ ref: I,
443
+ props: X,
444
444
  // Record the component responsible for creating this element.
445
445
  _owner: W
446
446
  };
447
- return L._store = {}, Object.defineProperty(L._store, "validated", {
447
+ return z._store = {}, Object.defineProperty(z._store, "validated", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
450
450
  writable: !0,
451
451
  value: !1
452
- }), Object.defineProperty(L, "_self", {
452
+ }), Object.defineProperty(z, "_self", {
453
453
  configurable: !1,
454
454
  enumerable: !1,
455
455
  writable: !1,
456
456
  value: D
457
- }), Object.defineProperty(L, "_source", {
457
+ }), Object.defineProperty(z, "_source", {
458
458
  configurable: !1,
459
459
  enumerable: !1,
460
460
  writable: !1,
461
- value: X
462
- }), Object.freeze && (Object.freeze(L.props), Object.freeze(L)), L;
461
+ value: N
462
+ }), Object.freeze && (Object.freeze(z.props), Object.freeze(z)), z;
463
463
  };
464
- function Or(i, b, R, D, X) {
464
+ function Or(i, b, I, D, N) {
465
465
  {
466
- var W, B = {}, L = null, ee = null;
467
- R !== void 0 && (_t(R), L = "" + R), wr(b) && (_t(b.key), L = "" + b.key), Er(b) && (ee = b.ref, Cr(b, X));
466
+ var W, X = {}, z = null, ee = null;
467
+ I !== void 0 && (_t(I), z = "" + I), wr(b) && (_t(b.key), z = "" + b.key), Er(b) && (ee = b.ref, Cr(b, N));
468
468
  for (W in b)
469
- $e.call(b, W) && !br.hasOwnProperty(W) && (B[W] = b[W]);
469
+ $e.call(b, W) && !br.hasOwnProperty(W) && (X[W] = b[W]);
470
470
  if (i && i.defaultProps) {
471
471
  var q = i.defaultProps;
472
472
  for (W in q)
473
- B[W] === void 0 && (B[W] = q[W]);
473
+ X[W] === void 0 && (X[W] = q[W]);
474
474
  }
475
- if (L || ee) {
475
+ if (z || ee) {
476
476
  var G = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
477
- L && xr(B, G), ee && Rr(B, G);
477
+ z && xr(X, G), ee && Rr(X, G);
478
478
  }
479
- return Ir(i, L, ee, X, D, be.current, B);
479
+ return Ir(i, z, ee, N, D, be.current, X);
480
480
  }
481
481
  }
482
482
  var Ge = y.ReactCurrentOwner, wt = y.ReactDebugCurrentFrame;
483
483
  function he(i) {
484
484
  if (i) {
485
- var b = i._owner, R = De(i.type, i._source, b ? b.type : null);
486
- wt.setExtraStackFrame(R);
485
+ var b = i._owner, I = De(i.type, i._source, b ? b.type : null);
486
+ wt.setExtraStackFrame(I);
487
487
  } else
488
488
  wt.setExtraStackFrame(null);
489
489
  }
@@ -495,7 +495,7 @@ function Ur() {
495
495
  function Ct() {
496
496
  {
497
497
  if (Ge.current) {
498
- var i = N(Ge.current.type);
498
+ var i = B(Ge.current.type);
499
499
  if (i)
500
500
  return `
501
501
 
@@ -507,10 +507,10 @@ Check the render method of \`` + i + "`.";
507
507
  function Tr(i) {
508
508
  {
509
509
  if (i !== void 0) {
510
- var b = i.fileName.replace(/^.*[\\\/]/, ""), R = i.lineNumber;
510
+ var b = i.fileName.replace(/^.*[\\\/]/, ""), I = i.lineNumber;
511
511
  return `
512
512
 
513
- Check your code at ` + b + ":" + R + ".";
513
+ Check your code at ` + b + ":" + I + ".";
514
514
  }
515
515
  return "";
516
516
  }
@@ -520,10 +520,10 @@ Check your code at ` + b + ":" + R + ".";
520
520
  {
521
521
  var b = Ct();
522
522
  if (!b) {
523
- var R = typeof i == "string" ? i : i.displayName || i.name;
524
- R && (b = `
523
+ var I = typeof i == "string" ? i : i.displayName || i.name;
524
+ I && (b = `
525
525
 
526
- Check the top-level render call using <` + R + ">.");
526
+ Check the top-level render call using <` + I + ">.");
527
527
  }
528
528
  return b;
529
529
  }
@@ -533,12 +533,12 @@ Check the top-level render call using <` + R + ">.");
533
533
  if (!i._store || i._store.validated || i.key != null)
534
534
  return;
535
535
  i._store.validated = !0;
536
- var R = kr(b);
537
- if (xt[R])
536
+ var I = kr(b);
537
+ if (xt[I])
538
538
  return;
539
- xt[R] = !0;
539
+ xt[I] = !0;
540
540
  var D = "";
541
- i && i._owner && i._owner !== Ge.current && (D = " It was passed a child from " + N(i._owner.type) + "."), he(i), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', R, D), he(null);
541
+ i && i._owner && i._owner !== Ge.current && (D = " It was passed a child from " + B(i._owner.type) + "."), he(i), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', I, D), he(null);
542
542
  }
543
543
  }
544
544
  function It(i, b) {
@@ -546,17 +546,17 @@ Check the top-level render call using <` + R + ">.");
546
546
  if (typeof i != "object")
547
547
  return;
548
548
  if (He(i))
549
- for (var R = 0; R < i.length; R++) {
550
- var D = i[R];
549
+ for (var I = 0; I < i.length; I++) {
550
+ var D = i[I];
551
551
  Ze(D) && Rt(D, b);
552
552
  }
553
553
  else if (Ze(i))
554
554
  i._store && (i._store.validated = !0);
555
555
  else if (i) {
556
- var X = I(i);
557
- if (typeof X == "function" && X !== i.entries)
558
- for (var W = X.call(i), B; !(B = W.next()).done; )
559
- Ze(B.value) && Rt(B.value, b);
556
+ var N = O(i);
557
+ if (typeof N == "function" && N !== i.entries)
558
+ for (var W = N.call(i), X; !(X = W.next()).done; )
559
+ Ze(X.value) && Rt(X.value, b);
560
560
  }
561
561
  }
562
562
  }
@@ -565,30 +565,30 @@ Check the top-level render call using <` + R + ">.");
565
565
  var b = i.type;
566
566
  if (b == null || typeof b == "string")
567
567
  return;
568
- var R;
568
+ var I;
569
569
  if (typeof b == "function")
570
- R = b.propTypes;
570
+ I = b.propTypes;
571
571
  else if (typeof b == "object" && (b.$$typeof === l || // Note: Memo only checks outer props here.
572
572
  // Inner props are checked in the reconciler.
573
573
  b.$$typeof === c))
574
- R = b.propTypes;
574
+ I = b.propTypes;
575
575
  else
576
576
  return;
577
- if (R) {
578
- var D = N(b);
579
- vr(R, i.props, "prop", D, i);
577
+ if (I) {
578
+ var D = B(b);
579
+ vr(I, i.props, "prop", D, i);
580
580
  } else if (b.PropTypes !== void 0 && !Je) {
581
581
  Je = !0;
582
- var X = N(b);
583
- C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", X || "Unknown");
582
+ var N = B(b);
583
+ C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", N || "Unknown");
584
584
  }
585
585
  typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
586
586
  }
587
587
  }
588
588
  function Mr(i) {
589
589
  {
590
- for (var b = Object.keys(i.props), R = 0; R < b.length; R++) {
591
- var D = b[R];
590
+ for (var b = Object.keys(i.props), I = 0; I < b.length; I++) {
591
+ var D = b[I];
592
592
  if (D !== "children" && D !== "key") {
593
593
  he(i), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", D), he(null);
594
594
  break;
@@ -597,21 +597,21 @@ Check the top-level render call using <` + R + ">.");
597
597
  i.ref !== null && (he(i), C("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
598
598
  }
599
599
  }
600
- function Ot(i, b, R, D, X, W) {
600
+ function Ot(i, b, I, D, N, W) {
601
601
  {
602
- var B = j(i);
603
- if (!B) {
604
- var L = "";
605
- (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (L += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
606
- var ee = Tr(X);
607
- ee ? L += ee : L += Ct();
602
+ var X = j(i);
603
+ if (!X) {
604
+ var z = "";
605
+ (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (z += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
606
+ var ee = Tr(N);
607
+ ee ? z += ee : z += Ct();
608
608
  var q;
609
- i === null ? q = "null" : He(i) ? q = "array" : i !== void 0 && i.$$typeof === t ? (q = "<" + (N(i.type) || "Unknown") + " />", L = " Did you accidentally export a JSX literal instead of a component?") : q = typeof i, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, L);
609
+ i === null ? q = "null" : He(i) ? q = "array" : i !== void 0 && i.$$typeof === t ? (q = "<" + (B(i.type) || "Unknown") + " />", z = " Did you accidentally export a JSX literal instead of a component?") : q = typeof i, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, z);
610
610
  }
611
- var G = Or(i, b, R, X, W);
611
+ var G = Or(i, b, I, N, W);
612
612
  if (G == null)
613
613
  return G;
614
- if (B) {
614
+ if (X) {
615
615
  var re = b.children;
616
616
  if (re !== void 0)
617
617
  if (D)
@@ -627,20 +627,20 @@ Check the top-level render call using <` + R + ">.");
627
627
  return i === n ? Mr(G) : Pr(G), G;
628
628
  }
629
629
  }
630
- function jr(i, b, R) {
631
- return Ot(i, b, R, !0);
630
+ function jr(i, b, I) {
631
+ return Ot(i, b, I, !0);
632
632
  }
633
- function Dr(i, b, R) {
634
- return Ot(i, b, R, !1);
633
+ function Dr(i, b, I) {
634
+ return Ot(i, b, I, !1);
635
635
  }
636
636
  var $r = Dr, Ar = jr;
637
637
  we.Fragment = n, we.jsx = $r, we.jsxs = Ar;
638
638
  }()), we;
639
639
  }
640
640
  (function(e) {
641
- process.env.NODE_ENV === "production" ? e.exports = Xr() : e.exports = Ur();
642
- })(Nr);
643
- const Wr = Ie.Fragment, T = Ie.jsx, le = Ie.jsxs;
641
+ process.env.NODE_ENV === "production" ? e.exports = Nr() : e.exports = Ur();
642
+ })(Xr);
643
+ const Wr = Ie.Fragment, k = Ie.jsx, le = Ie.jsxs;
644
644
  let Vr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, r) => (r &= 63, r < 36 ? t += r.toString(36) : r < 62 ? t += (r - 26).toString(36).toUpperCase() : r > 62 ? t += "-" : t += "_", t), "");
645
645
  class Fr {
646
646
  constructor(t, r, n = null) {
@@ -761,7 +761,7 @@ const Kr = ({
761
761
  });
762
762
  }), e.emit("joinSuperSocket", { room: t, userId: o });
763
763
  });
764
- }, it = g.createContext(), Hr = () => /* @__PURE__ */ T(
764
+ }, it = g.createContext(), Hr = () => /* @__PURE__ */ k(
765
765
  "div",
766
766
  {
767
767
  style: {
@@ -773,7 +773,7 @@ const Kr = ({
773
773
  justifyContent: "center",
774
774
  alignItems: "center"
775
775
  },
776
- children: /* @__PURE__ */ T("h2", { children: "🌀 Loading..." })
776
+ children: /* @__PURE__ */ k("h2", { children: "🌀 Loading..." })
777
777
  }
778
778
  ), nr = ({
779
779
  socket: e,
@@ -782,7 +782,7 @@ const Kr = ({
782
782
  LoadingComponent: n = Hr,
783
783
  children: o
784
784
  }) => {
785
- const [s, a] = g.useState(!1), [u, l] = g.useState(!1), [d, f] = g.useState(null), c = g.useRef(null), h = g.useRef(!1), _ = _e(it), v = g.useRef(!1);
785
+ const [s, a] = g.useState(!1), [u, l] = g.useState(!1), [d, f] = g.useState(null), c = g.useRef(null), h = g.useRef(!1), S = _e(it), v = g.useRef(!1);
786
786
  return g.useEffect(() => (h.current = !0, () => {
787
787
  h.current = !1;
788
788
  }), []), g.useEffect(() => {
@@ -806,14 +806,14 @@ const Kr = ({
806
806
  })), () => {
807
807
  var E;
808
808
  (E = c.current) == null || E.leave();
809
- }) : null, [r, t, e]), !s || !d ? /* @__PURE__ */ T(n, {}) : /* @__PURE__ */ T(
809
+ }) : null, [r, t, e]), !s || !d ? /* @__PURE__ */ k(n, {}) : /* @__PURE__ */ k(
810
810
  it.Provider,
811
811
  {
812
- value: { ..._, [r]: { wire: d, joined: s, isMaster: u, room: t } },
812
+ value: { ...S, [r]: { wire: d, joined: s, isMaster: u, room: t } },
813
813
  children: o
814
814
  }
815
815
  );
816
- }, Xe = (e = "default") => (_e(it) || {})[e], jt = (e) => {
816
+ }, Ne = (e = "default") => (_e(it) || {})[e], jt = (e) => {
817
817
  let t;
818
818
  const r = /* @__PURE__ */ new Set(), n = (l, d) => {
819
819
  const f = typeof l == "function" ? l(t) : l;
@@ -863,21 +863,21 @@ function Jr() {
863
863
  }
864
864
  var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, s = e.useLayoutEffect, a = e.useDebugValue;
865
865
  function u(c, h) {
866
- var _ = h(), v = n({ inst: { value: _, getSnapshot: h } }), E = v[0].inst, I = v[1];
866
+ var S = h(), v = n({ inst: { value: S, getSnapshot: h } }), E = v[0].inst, O = v[1];
867
867
  return s(function() {
868
- E.value = _, E.getSnapshot = h, l(E) && I({ inst: E });
869
- }, [c, _, h]), o(function() {
870
- return l(E) && I({ inst: E }), c(function() {
871
- l(E) && I({ inst: E });
868
+ E.value = S, E.getSnapshot = h, l(E) && O({ inst: E });
869
+ }, [c, S, h]), o(function() {
870
+ return l(E) && O({ inst: E }), c(function() {
871
+ l(E) && O({ inst: E });
872
872
  });
873
- }, [c]), a(_), _;
873
+ }, [c]), a(S), S;
874
874
  }
875
875
  function l(c) {
876
876
  var h = c.getSnapshot;
877
877
  c = c.value;
878
878
  try {
879
- var _ = h();
880
- return !r(c, _);
879
+ var S = h();
880
+ return !r(c, S);
881
881
  } catch {
882
882
  return !0;
883
883
  }
@@ -905,67 +905,67 @@ function Zr() {
905
905
  var e = g, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
906
906
  function r(x) {
907
907
  {
908
- for (var p = arguments.length, w = new Array(p > 1 ? p - 1 : 0), m = 1; m < p; m++)
909
- w[m - 1] = arguments[m];
910
- n("error", x, w);
908
+ for (var p = arguments.length, _ = new Array(p > 1 ? p - 1 : 0), m = 1; m < p; m++)
909
+ _[m - 1] = arguments[m];
910
+ n("error", x, _);
911
911
  }
912
912
  }
913
- function n(x, p, w) {
913
+ function n(x, p, _) {
914
914
  {
915
- var m = t.ReactDebugCurrentFrame, S = m.getStackAddendum();
916
- S !== "" && (p += "%s", w = w.concat([S]));
917
- var O = w.map(function(k) {
918
- return String(k);
915
+ var m = t.ReactDebugCurrentFrame, w = m.getStackAddendum();
916
+ w !== "" && (p += "%s", _ = _.concat([w]));
917
+ var R = _.map(function(T) {
918
+ return String(T);
919
919
  });
920
- O.unshift("Warning: " + p), Function.prototype.apply.call(console[x], console, O);
920
+ R.unshift("Warning: " + p), Function.prototype.apply.call(console[x], console, R);
921
921
  }
922
922
  }
923
923
  function o(x, p) {
924
924
  return x === p && (x !== 0 || 1 / x === 1 / p) || x !== x && p !== p;
925
925
  }
926
926
  var s = typeof Object.is == "function" ? Object.is : o, a = e.useState, u = e.useEffect, l = e.useLayoutEffect, d = e.useDebugValue, f = !1, c = !1;
927
- function h(x, p, w) {
927
+ function h(x, p, _) {
928
928
  f || e.startTransition !== void 0 && (f = !0, r("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."));
929
929
  var m = p();
930
930
  if (!c) {
931
- var S = p();
932
- s(m, S) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
931
+ var w = p();
932
+ s(m, w) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
933
933
  }
934
- var O = a({
934
+ var R = a({
935
935
  inst: {
936
936
  value: m,
937
937
  getSnapshot: p
938
938
  }
939
- }), k = O[0].inst, j = O[1];
939
+ }), T = R[0].inst, j = R[1];
940
940
  return l(function() {
941
- k.value = m, k.getSnapshot = p, _(k) && j({
942
- inst: k
941
+ T.value = m, T.getSnapshot = p, S(T) && j({
942
+ inst: T
943
943
  });
944
944
  }, [x, m, p]), u(function() {
945
- _(k) && j({
946
- inst: k
945
+ S(T) && j({
946
+ inst: T
947
947
  });
948
948
  var M = function() {
949
- _(k) && j({
950
- inst: k
949
+ S(T) && j({
950
+ inst: T
951
951
  });
952
952
  };
953
953
  return x(M);
954
954
  }, [x]), d(m), m;
955
955
  }
956
- function _(x) {
957
- var p = x.getSnapshot, w = x.value;
956
+ function S(x) {
957
+ var p = x.getSnapshot, _ = x.value;
958
958
  try {
959
959
  var m = p();
960
- return !s(w, m);
960
+ return !s(_, m);
961
961
  } catch {
962
962
  return !0;
963
963
  }
964
964
  }
965
- function v(x, p, w) {
965
+ function v(x, p, _) {
966
966
  return p();
967
967
  }
968
- var E = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", I = !E, y = I ? v : h, C = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : y;
968
+ var E = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", O = !E, y = O ? v : h, C = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : y;
969
969
  tt.useSyncExternalStore = C, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
970
970
  }()), tt;
971
971
  }
@@ -994,7 +994,7 @@ function Qr() {
994
994
  return d === f && (d !== 0 || 1 / d === 1 / f) || d !== d && f !== f;
995
995
  }
996
996
  var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, u = e.useMemo, l = e.useDebugValue;
997
- return Qe.useSyncExternalStoreWithSelector = function(d, f, c, h, _) {
997
+ return Qe.useSyncExternalStoreWithSelector = function(d, f, c, h, S) {
998
998
  var v = s(null);
999
999
  if (v.current === null) {
1000
1000
  var E = { hasValue: !1, value: null };
@@ -1004,29 +1004,29 @@ function Qr() {
1004
1004
  v = u(function() {
1005
1005
  function y(m) {
1006
1006
  if (!C) {
1007
- if (C = !0, x = m, m = h(m), _ !== void 0 && E.hasValue) {
1008
- var S = E.value;
1009
- if (_(S, m))
1010
- return p = S;
1007
+ if (C = !0, x = m, m = h(m), S !== void 0 && E.hasValue) {
1008
+ var w = E.value;
1009
+ if (S(w, m))
1010
+ return p = w;
1011
1011
  }
1012
1012
  return p = m;
1013
1013
  }
1014
- if (S = p, n(x, m))
1015
- return S;
1016
- var O = h(m);
1017
- return _ !== void 0 && _(S, O) ? S : (x = m, p = O);
1014
+ if (w = p, n(x, m))
1015
+ return w;
1016
+ var R = h(m);
1017
+ return S !== void 0 && S(w, R) ? w : (x = m, p = R);
1018
1018
  }
1019
- var C = !1, x, p, w = c === void 0 ? null : c;
1019
+ var C = !1, x, p, _ = c === void 0 ? null : c;
1020
1020
  return [function() {
1021
1021
  return y(f());
1022
- }, w === null ? void 0 : function() {
1023
- return y(w());
1022
+ }, _ === null ? void 0 : function() {
1023
+ return y(_());
1024
1024
  }];
1025
- }, [f, c, h, _]);
1026
- var I = o(d, v[0], v[1]);
1025
+ }, [f, c, h, S]);
1026
+ var O = o(d, v[0], v[1]);
1027
1027
  return a(function() {
1028
- E.hasValue = !0, E.value = I;
1029
- }, [I]), l(I), I;
1028
+ E.hasValue = !0, E.value = O;
1029
+ }, [O]), l(O), O;
1030
1030
  }, Qe;
1031
1031
  }
1032
1032
  var rt = {};
@@ -1048,38 +1048,38 @@ function en() {
1048
1048
  return f === c && (f !== 0 || 1 / f === 1 / c) || f !== f && c !== c;
1049
1049
  }
1050
1050
  var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, u = e.useMemo, l = e.useDebugValue;
1051
- function d(f, c, h, _, v) {
1052
- var E = s(null), I;
1053
- E.current === null ? (I = {
1051
+ function d(f, c, h, S, v) {
1052
+ var E = s(null), O;
1053
+ E.current === null ? (O = {
1054
1054
  hasValue: !1,
1055
1055
  value: null
1056
- }, E.current = I) : I = E.current;
1056
+ }, E.current = O) : O = E.current;
1057
1057
  var y = u(function() {
1058
- var w = !1, m, S, O = function(A) {
1059
- if (!w) {
1060
- w = !0, m = A;
1061
- var N = _(A);
1062
- if (v !== void 0 && I.hasValue) {
1063
- var U = I.value;
1064
- if (v(U, N))
1065
- return S = U, U;
1058
+ var _ = !1, m, w, R = function(A) {
1059
+ if (!_) {
1060
+ _ = !0, m = A;
1061
+ var B = S(A);
1062
+ if (v !== void 0 && O.hasValue) {
1063
+ var U = O.value;
1064
+ if (v(U, B))
1065
+ return w = U, U;
1066
1066
  }
1067
- return S = N, N;
1067
+ return w = B, B;
1068
1068
  }
1069
- var J = m, P = S;
1069
+ var J = m, P = w;
1070
1070
  if (n(J, A))
1071
1071
  return P;
1072
- var $ = _(A);
1073
- return v !== void 0 && v(P, $) ? P : (m = A, S = $, $);
1074
- }, k = h === void 0 ? null : h, j = function() {
1075
- return O(c());
1076
- }, M = k === null ? void 0 : function() {
1077
- return O(k());
1072
+ var $ = S(A);
1073
+ return v !== void 0 && v(P, $) ? P : (m = A, w = $, $);
1074
+ }, T = h === void 0 ? null : h, j = function() {
1075
+ return R(c());
1076
+ }, M = T === null ? void 0 : function() {
1077
+ return R(T());
1078
1078
  };
1079
1079
  return [j, M];
1080
- }, [c, h, _, v]), C = y[0], x = y[1], p = o(f, C, x);
1080
+ }, [c, h, S, v]), C = y[0], x = y[1], p = o(f, C, x);
1081
1081
  return a(function() {
1082
- I.hasValue = !0, I.value = p;
1082
+ O.hasValue = !0, O.value = p;
1083
1083
  }, [p]), l(p), p;
1084
1084
  }
1085
1085
  rt.useSyncExternalStoreWithSelector = d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
@@ -1112,7 +1112,7 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1112
1112
  const [a, u] = sr(e, t, n);
1113
1113
  return [a * r + o, u * r + s];
1114
1114
  }, Yt = (e, t, r, n) => {
1115
- const o = e.x, s = e.y, a = t.x, u = t.y, l = r.x, d = r.y, f = a - o, c = u - s, h = o - l, _ = s - d, v = f * f + c * c, E = 2 * (h * f + _ * c), I = h * h + _ * _ - n * n, y = E * E - 4 * v * I;
1115
+ const o = e.x, s = e.y, a = t.x, u = t.y, l = r.x, d = r.y, f = a - o, c = u - s, h = o - l, S = s - d, v = f * f + c * c, E = 2 * (h * f + S * c), O = h * h + S * S - n * n, y = E * E - 4 * v * O;
1116
1116
  if (y < 0)
1117
1117
  return [];
1118
1118
  const C = (-E + Math.sqrt(y)) / (2 * v), x = (-E - Math.sqrt(y)) / (2 * v), p = [];
@@ -1123,9 +1123,17 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1123
1123
  }), on = (e, t) => {
1124
1124
  const r = t.getBoundingClientRect();
1125
1125
  return nn(e, r);
1126
- }, Ne = (e, t) => {
1127
- const n = e.getElementsByClassName(`item ${t}`)[0];
1128
- return n || console.error(`Missing item ${t}`), n;
1126
+ }, Xe = (e, t) => {
1127
+ try {
1128
+ const r = document.getElementById(`${e}__${t}`);
1129
+ return r || console.error(`Missing item ${t}`), r;
1130
+ } catch {
1131
+ console.error(
1132
+ `Error while getting item with id ${t} inside wrapper`,
1133
+ e
1134
+ );
1135
+ return;
1136
+ }
1129
1137
  }, Te = (e) => {
1130
1138
  var r, n;
1131
1139
  const t = (r = e == null ? void 0 : e.dataset) == null ? void 0 : r.id;
@@ -1135,9 +1143,9 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1135
1143
  JSON.stringify(e == null ? void 0 : e.dataset),
1136
1144
  (n = e == null ? void 0 : e.dataset) == null ? void 0 : n.id
1137
1145
  ), t;
1138
- }, sn = (e, t = document) => {
1146
+ }, sn = (e, t) => {
1139
1147
  const r = e.reduce((n, o) => {
1140
- const s = Ne(t, o);
1148
+ const s = Xe(t, o);
1141
1149
  if (!s)
1142
1150
  return n || null;
1143
1151
  const { left: a, right: u, top: l, bottom: d } = s.getBoundingClientRect();
@@ -1150,14 +1158,14 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1150
1158
  }, f.left = Math.min(a, f.left), f.top = Math.min(l, f.top), f.right = Math.max(u, f.right), f.bottom = Math.max(d, f.bottom), f;
1151
1159
  }, null);
1152
1160
  return r && (r.width = r.right - r.left, r.height = r.bottom - r.top, r);
1153
- }, ir = (e, t, r = null) => (r === null && (r = /* @__PURE__ */ new Set()), !Array.isArray(t) || t.length === 0 ? [] : t.map((n) => r.has(n) ? [] : (r.add(n), [
1161
+ }, ir = (e, t, r = null) => (r === null && (r = /* @__PURE__ */ new Set()), !Array.isArray(t) || t.length === 0 ? [] : t.map((n) => r.has(n) ? [] : (r.add(n), e[n] ? [
1154
1162
  n,
1155
1163
  ...ir(
1156
1164
  e,
1157
1165
  e[n].linkedItems,
1158
1166
  r
1159
1167
  )
1160
- ])).flat()), Bt = (e, t, r) => {
1168
+ ] : [])).flat()), Bt = (e, t, r) => {
1161
1169
  const n = new Set(ir(e, r));
1162
1170
  return t.filter((o) => n.has(o));
1163
1171
  }, an = ({ x: e, y: t, width: r, height: n }, { type: o = "grid", size: s = 1, offset: a = { x: 0, y: 0 } }) => {
@@ -1165,17 +1173,17 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1165
1173
  e + r / 2 - a.x,
1166
1174
  t + n / 2 - a.y
1167
1175
  ];
1168
- let d, f, c, h, _, v, E, I, y, C;
1176
+ let d, f, c, h, S, v, E, O, y, C;
1169
1177
  const x = s / 1.1547;
1170
1178
  switch (o) {
1171
1179
  case "grid":
1172
1180
  d = Math.round(u / s) * s, f = Math.round(l / s) * s;
1173
1181
  break;
1174
1182
  case "hexH":
1175
- c = 2 * x, h = 3 * s, _ = Math.round(u / c) * c, E = Math.round(l / h) * h, v = _ > u ? _ - x : _ + x, I = E > l ? E - 1.5 * s : E + 1.5 * s, y = Math.hypot(_ - u, E - l), C = Math.hypot(v - u, I - l), y < C ? (d = _, f = E) : (d = v, f = I);
1183
+ c = 2 * x, h = 3 * s, S = Math.round(u / c) * c, E = Math.round(l / h) * h, v = S > u ? S - x : S + x, O = E > l ? E - 1.5 * s : E + 1.5 * s, y = Math.hypot(S - u, E - l), C = Math.hypot(v - u, O - l), y < C ? (d = S, f = E) : (d = v, f = O);
1176
1184
  break;
1177
1185
  case "hexV":
1178
- c = 3 * s, h = 2 * x, _ = Math.round(u / c) * c, E = Math.round(l / h) * h, v = _ > u ? _ - 1.5 * s : _ + 1.5 * s, I = E > l ? E - x : E + x, y = Math.hypot(_ - u, E - l), C = Math.hypot(v - u, I - l), y < C ? (d = _, f = E) : (d = v, f = I);
1186
+ c = 3 * s, h = 2 * x, S = Math.round(u / c) * c, E = Math.round(l / h) * h, v = S > u ? S - 1.5 * s : S + 1.5 * s, O = E > l ? E - x : E + x, y = Math.hypot(S - u, E - l), C = Math.hypot(v - u, O - l), y < C ? (d = S, f = E) : (d = v, f = O);
1179
1187
  break;
1180
1188
  default:
1181
1189
  d = e + r / 2, f = t + n / 2;
@@ -1184,7 +1192,7 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1184
1192
  x: d + a.x - r / 2,
1185
1193
  y: f + a.y - n / 2
1186
1194
  };
1187
- }, Nt = [
1195
+ }, Xt = [
1188
1196
  "#037758",
1189
1197
  "#99092a",
1190
1198
  "#067070",
@@ -1215,13 +1223,13 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1215
1223
  "#007a4b",
1216
1224
  "#bf0daa",
1217
1225
  "#af0ad8"
1218
- ], Xt = () => Nt[Math.floor(Math.random() * Nt.length)], cn = !1, dt = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s, a, u) => {
1226
+ ], Nt = () => Xt[Math.floor(Math.random() * Xt.length)], cn = !1, dt = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s, a, u) => {
1219
1227
  s({ ready: !1 });
1220
1228
  const l = [];
1221
1229
  (async () => {
1222
1230
  try {
1223
- const _ = await e.call(`${t}_getValue`);
1224
- cn && console.log("init from peer with value", _), s((v) => ({ ...v, ..._ }));
1231
+ const S = await e.call(`${t}_getValue`);
1232
+ cn && console.log("init from peer with value", S), s((v) => ({ ...v, ...S }));
1225
1233
  } catch {
1226
1234
  n !== void 0 && s(n);
1227
1235
  }
@@ -1230,26 +1238,26 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1230
1238
  `${t}_getValue`,
1231
1239
  () => Object.fromEntries(
1232
1240
  Object.entries(a()).filter(
1233
- ([_, v]) => typeof v != "function" && !r.includes(_)
1241
+ ([S, v]) => typeof v != "function" && !r.includes(S)
1234
1242
  )
1235
1243
  ),
1236
1244
  { invoke: "first" }
1237
1245
  )
1238
1246
  ), l.push(
1239
- e.subscribe(`${t}_call`, ([_, v]) => {
1240
- c[_](...v);
1247
+ e.subscribe(`${t}_call`, ([S, v]) => {
1248
+ c[S](...v);
1241
1249
  })
1242
1250
  ), s({ ready: !0 });
1243
1251
  })();
1244
1252
  const f = o(s, a, u), c = { ...f }, h = Object.fromEntries(
1245
1253
  // Send the update message on all method calls
1246
- Object.entries(f).map(([_, v]) => typeof v == "function" && !_.startsWith("get") && !r.includes(_) ? [_, (...I) => {
1247
- const y = v(...I);
1248
- return e.publish(`${t}_call`, [_, I]), y;
1249
- }] : [_, v])
1254
+ Object.entries(f).map(([S, v]) => typeof v == "function" && !S.startsWith("get") && !r.includes(S) ? [S, (...O) => {
1255
+ const y = v(...O);
1256
+ return e.publish(`${t}_call`, [S, O]), y;
1257
+ }] : [S, v])
1250
1258
  );
1251
1259
  return h.unsub = () => {
1252
- l.forEach((_) => _());
1260
+ l.forEach((S) => S());
1253
1261
  }, h;
1254
1262
  };
1255
1263
  function Ve(e, t) {
@@ -1363,7 +1371,7 @@ const ar = g.createContext(), un = (e, t) => ({
1363
1371
  setSessionInfo: (r) => e({ session: r }),
1364
1372
  updateSessionInfo: (r) => e((n) => ({ session: { ...n.session, ...r } }))
1365
1373
  }), Ut = ({ storeName: e, children: t, defaultValue: r }) => {
1366
- const { wire: n } = Xe("room"), [o, s] = g.useState(!1), [a] = g.useState(
1374
+ const { wire: n } = Ne("room"), [o, s] = g.useState(!1), [a] = g.useState(
1367
1375
  () => Ue(
1368
1376
  dt({ wire: n, storeName: e, defaultValue: r }, (...u) => ({
1369
1377
  ...un(...u),
@@ -1378,7 +1386,7 @@ const ar = g.createContext(), un = (e, t) => ({
1378
1386
  const u = a.subscribe((l) => {
1379
1387
  l.ready && (u(), s(!0));
1380
1388
  });
1381
- }, [a]), o ? /* @__PURE__ */ T(ar.Provider, { value: a, children: t }) : null;
1389
+ }, [a]), o ? /* @__PURE__ */ k(ar.Provider, { value: a, children: t }) : null;
1382
1390
  }, oe = (e, t) => {
1383
1391
  const r = _e(ar);
1384
1392
  return We(r, e, t || Ve);
@@ -1480,12 +1488,15 @@ const ar = g.createContext(), un = (e, t) => ({
1480
1488
  ...vn(...r)
1481
1489
  }))
1482
1490
  );
1483
- return /* @__PURE__ */ T(ur.Provider, { value: t, children: e });
1484
- }, Q = (e, t) => {
1491
+ return /* @__PURE__ */ k(ur.Provider, { value: t, children: e });
1492
+ }, Z = (e, t) => {
1485
1493
  const r = _e(ur);
1486
1494
  return We(r, e, t || Ve);
1487
1495
  }, ss = () => {
1488
- const [e] = Q((t) => [t.selection]);
1496
+ const [e] = Z((t) => [t.selection]);
1497
+ return e;
1498
+ }, is = () => {
1499
+ const [e] = Z((t) => [t.getSelection]);
1489
1500
  return e;
1490
1501
  };
1491
1502
  function pt(e) {
@@ -1548,7 +1559,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1548
1559
  }, c = {
1549
1560
  x: a / 2,
1550
1561
  y: a / 2
1551
- }, h = ze(d, [f.x, f.y]), _ = Math.min(s.width, s.height), v = o.radius + _ / 2 / r - Sn / r;
1562
+ }, h = ze(d, [f.x, f.y]), S = Math.min(s.width, s.height), v = o.radius + S / 2 / r - Sn / r;
1552
1563
  if (h > v) {
1553
1564
  const y = Yt(
1554
1565
  { x: d[0], y: d[1] },
@@ -1563,13 +1574,13 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1563
1574
  });
1564
1575
  u = C, l = x;
1565
1576
  }
1566
- const E = ze(d, [c.x, c.y]), I = a / 2 - ze([0, 0], [s.width, s.height]) / r;
1567
- if (E > I) {
1577
+ const E = ze(d, [c.x, c.y]), O = a / 2 - ze([0, 0], [s.width, s.height]) / r;
1578
+ if (E > O) {
1568
1579
  const y = Yt(
1569
1580
  { x: d[0], y: d[1] },
1570
1581
  c,
1571
1582
  c,
1572
- I - 1 / r
1583
+ O - 1 / r
1573
1584
  )[0];
1574
1585
  if (y) {
1575
1586
  const [C, x] = Be([-y.x, -y.y], {
@@ -1589,66 +1600,66 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1589
1600
  r,
1590
1601
  n,
1591
1602
  o
1592
- ] = Q((p) => [
1603
+ ] = Z((p) => [
1593
1604
  p.getBoardState,
1594
1605
  p.updateBoardState,
1595
1606
  p.config.itemExtent,
1596
1607
  p.getConfiguration,
1597
1608
  p.updateConfiguration
1598
1609
  ]), s = g.useRef([0.15, 5]), [a] = oe((p) => [p.getItemList]), u = g.useCallback(() => {
1599
- const { translateX: p, translateY: w, scale: m, rotate: S } = e();
1600
- return { translateX: p, translateY: w, scale: m, rotate: S };
1610
+ const { translateX: p, translateY: _, scale: m, rotate: w } = e();
1611
+ return { translateX: p, translateY: _, scale: m, rotate: w };
1601
1612
  }, [e]), l = g.useCallback(
1602
- (p, w) => ct([p, w], e()),
1613
+ (p, _) => ct([p, _], e()),
1603
1614
  [e]
1604
1615
  ), d = g.useCallback(
1605
- (p, w) => Be([p, w], e()),
1616
+ (p, _) => Be([p, _], e()),
1606
1617
  [e]
1607
1618
  ), f = g.useCallback(
1608
- (p, w) => {
1609
- const { scale: m, rotate: S } = e();
1610
- return ct([p, w], {
1619
+ (p, _) => {
1620
+ const { scale: m, rotate: w } = e();
1621
+ return ct([p, _], {
1611
1622
  translateX: 0,
1612
1623
  translateY: 0,
1613
- rotate: S,
1624
+ rotate: w,
1614
1625
  scale: m
1615
1626
  });
1616
1627
  },
1617
1628
  [e]
1618
1629
  ), c = g.useCallback((p) => p > s.current[1] ? s.current[1] : p < s.current[0] ? s.current[0] : p, []), h = g.useCallback(
1619
1630
  (p) => {
1620
- const { itemExtent: w, boardWrapperRect: m, boardSize: S } = n(), O = e(), {
1621
- translateX: k,
1631
+ const { itemExtent: _, boardWrapperRect: m, boardSize: w } = n(), R = e(), {
1632
+ translateX: T,
1622
1633
  translateY: j,
1623
1634
  scale: M,
1624
1635
  rotate: A
1625
1636
  } = {
1626
- ...O,
1627
- ...p(O)
1628
- }, N = c(M);
1629
- let [U, J] = [k, j];
1630
- (k !== O.translateX || j !== O.translateY) && ([U, J] = En({
1631
- x: k,
1637
+ ...R,
1638
+ ...p(R)
1639
+ }, B = c(M);
1640
+ let [U, J] = [T, j];
1641
+ (T !== R.translateX || j !== R.translateY) && ([U, J] = En({
1642
+ x: T,
1632
1643
  y: j,
1633
- scale: N,
1644
+ scale: B,
1634
1645
  rotate: A,
1635
- itemExtent: w,
1646
+ itemExtent: _,
1636
1647
  boardWrapperRect: m,
1637
- boardSize: S
1648
+ boardSize: w
1638
1649
  })), t({
1639
1650
  translateX: U,
1640
1651
  translateY: J,
1641
- scale: N,
1652
+ scale: B,
1642
1653
  rotate: A
1643
1654
  });
1644
1655
  },
1645
1656
  [c, e, n, t]
1646
- ), _ = g.useCallback(
1657
+ ), S = g.useCallback(
1647
1658
  (p) => {
1648
- let w = (m) => ({ ...m, ...p });
1649
- typeof p == "function" && (w = p), h((m) => ({
1659
+ let _ = (m) => ({ ...m, ...p });
1660
+ typeof p == "function" && (_ = p), h((m) => ({
1650
1661
  ...m,
1651
- ...w({
1662
+ ..._({
1652
1663
  translateX: m.translateX,
1653
1664
  translateY: m.translateY
1654
1665
  })
@@ -1656,75 +1667,75 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1656
1667
  },
1657
1668
  [h]
1658
1669
  ), v = g.useCallback(
1659
- ({ to: p, factor: w }) => {
1670
+ ({ to: p, factor: _ }) => {
1660
1671
  const { boardWrapperRect: m } = n();
1661
- let S = p;
1662
- S || (S = {
1672
+ let w = p;
1673
+ w || (w = {
1663
1674
  x: m.left + m.width / 2,
1664
1675
  y: m.top + m.height / 2
1665
1676
  });
1666
- const O = e(), k = c(O.scale * w), j = S.x - m.left, M = S.y - m.top, A = j - (j - O.translateX) * k / O.scale, N = M - (M - O.translateY) * k / O.scale;
1677
+ const R = e(), T = c(R.scale * _), j = w.x - m.left, M = w.y - m.top, A = j - (j - R.translateX) * T / R.scale, B = M - (M - R.translateY) * T / R.scale;
1667
1678
  h((U) => ({
1668
1679
  ...U,
1669
1680
  translateX: A,
1670
- translateY: N,
1671
- scale: k
1681
+ translateY: B,
1682
+ scale: T
1672
1683
  }));
1673
1684
  },
1674
1685
  [c, e, n, h]
1675
1686
  ), E = g.useCallback(
1676
- ({ x: p, y: w, radius: m }) => {
1677
- const { rotate: S } = e(), { boardWrapperRect: O, boardSize: k } = n(), j = O.width / (m * 2), M = O.height / (m * 2), A = c(Math.min(j, M) * bn), [N, U] = Be(
1678
- [-k / 2 - p, -k / 2 - w],
1687
+ ({ x: p, y: _, radius: m }) => {
1688
+ const { rotate: w } = e(), { boardWrapperRect: R, boardSize: T } = n(), j = R.width / (m * 2), M = R.height / (m * 2), A = c(Math.min(j, M) * bn), [B, U] = Be(
1689
+ [-T / 2 - p, -T / 2 - _],
1679
1690
  {
1680
- translateX: O.width / 2,
1681
- translateY: O.height / 2,
1691
+ translateX: R.width / 2,
1692
+ translateY: R.height / 2,
1682
1693
  scale: A,
1683
- rotate: S
1694
+ rotate: w
1684
1695
  }
1685
1696
  );
1686
- h((J) => ({ ...J, translateX: N, translateY: U, scale: A }));
1697
+ h((J) => ({ ...J, translateX: B, translateY: U, scale: A }));
1687
1698
  },
1688
1699
  [c, e, n, h]
1689
- ), I = g.useCallback(() => {
1690
- const { boardWrapperRect: p, boardSize: w } = n(), [m, S] = l(
1700
+ ), O = g.useCallback(() => {
1701
+ const { boardWrapperRect: p, boardSize: _ } = n(), [m, w] = l(
1691
1702
  p.width / 2,
1692
1703
  p.height / 2
1693
1704
  );
1694
1705
  return {
1695
- x: m - w / 2,
1696
- y: S - w / 2
1706
+ x: m - _ / 2,
1707
+ y: w - _ / 2
1697
1708
  };
1698
1709
  }, [l, n]), y = g.useCallback(() => {
1699
- const p = a(), { boardWrapper: w, boardSize: m } = n(), S = p.reduce(
1700
- (k, j) => {
1701
- const M = Ne(w, j.id);
1702
- return k.left = Math.min(j.x, k.left), k.top = Math.min(j.y, k.top), k.right = Math.max(
1710
+ const p = a(), { boardSize: _, uid: m } = n(), w = p.reduce(
1711
+ (T, j) => {
1712
+ const M = Xe(m, j.id);
1713
+ return M && (T.left = Math.min(j.x, T.left), T.top = Math.min(j.y, T.top), T.right = Math.max(
1703
1714
  j.x + M.offsetWidth,
1704
- k.right
1705
- ), k.bottom = Math.max(
1715
+ T.right
1716
+ ), T.bottom = Math.max(
1706
1717
  j.y + M.offsetHeight,
1707
- k.bottom
1708
- ), k;
1718
+ T.bottom
1719
+ )), T;
1709
1720
  },
1710
1721
  {
1711
- left: m / 2,
1712
- top: m / 2,
1713
- right: -m / 2,
1714
- bottom: -m / 2
1722
+ left: _ / 2,
1723
+ top: _ / 2,
1724
+ right: -_ / 2,
1725
+ bottom: -_ / 2
1715
1726
  }
1716
- ), O = {
1717
- x: (S.right + S.left) / 2,
1718
- y: (S.bottom + S.top) / 2
1727
+ ), R = {
1728
+ x: (w.right + w.left) / 2,
1729
+ y: (w.bottom + w.top) / 2
1719
1730
  };
1720
- O.radius = Math.max(
1721
- ze([O.x, O.y], [S.left, S.top]),
1731
+ R.radius = Math.max(
1732
+ ze([R.x, R.y], [w.left, w.top]),
1722
1733
  _n
1723
- ), o({ itemExtent: O });
1734
+ ), o({ itemExtent: R });
1724
1735
  }, [n, a, o]), C = g.useCallback(
1725
1736
  (p) => {
1726
- let w = () => p;
1727
- typeof p == "function" && (w = p), h((m) => ({ ...m, rotate: w(m.rotate) })), y(), E(r);
1737
+ let _ = () => p;
1738
+ typeof p == "function" && (_ = p), h((m) => ({ ...m, rotate: _(m.rotate) })), y(), E(r);
1728
1739
  },
1729
1740
  [r, h, y, E]
1730
1741
  ), x = mt(
@@ -1732,22 +1743,24 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1732
1743
  [y],
1733
1744
  200
1734
1745
  );
1735
- return {
1746
+ return g.useEffect(() => {
1747
+ window.debugUpdateExtent = () => y(), window.debugDisplayExtent = () => console.log(n().itemExtent);
1748
+ }, [n, y]), {
1736
1749
  setDim: h,
1737
1750
  rotateBoard: C,
1738
- moveBoard: _,
1751
+ moveBoard: S,
1739
1752
  getDim: u,
1740
1753
  zoomTo: v,
1741
1754
  zoomToCenter: v,
1742
1755
  zoomToExtent: E,
1743
- getCenter: I,
1756
+ getCenter: O,
1744
1757
  updateItemExtent: x,
1745
1758
  vectorFromWrapperToBoard: f,
1746
1759
  fromWrapperToBoard: l,
1747
1760
  fromBoardToWrapper: d
1748
1761
  };
1749
1762
  }, Vt = (e) => {
1750
- const [t, r, n] = Q(
1763
+ const [t, r, n] = Z(
1751
1764
  ({ register: a, unregister: u, callInteractions: l }) => [
1752
1765
  a,
1753
1766
  u,
@@ -1766,7 +1779,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1766
1779
  );
1767
1780
  return { register: o, call: s };
1768
1781
  }, gt = () => {
1769
- const { call: e } = Vt("place"), { call: t } = Vt("delete"), { getCenter: r, updateItemExtent: n } = Me(), [o, s, a, u] = Q((P) => [
1782
+ const { call: e } = Vt("place"), { call: t } = Vt("delete"), { getCenter: r, updateItemExtent: n } = Me(), [o, s, a, u] = Z((P) => [
1770
1783
  P.clear,
1771
1784
  P.reverse,
1772
1785
  P.unselect,
@@ -1777,54 +1790,54 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1777
1790
  setItemIds: f,
1778
1791
  updateItems: c,
1779
1792
  moveItems: h,
1780
- removeItemsById: _,
1793
+ removeItemsById: S,
1781
1794
  getItemList: v,
1782
1795
  insertItems: E,
1783
- setItemList: I
1796
+ setItemList: O
1784
1797
  } = oe(
1785
1798
  ({
1786
1799
  getItems: P,
1787
1800
  getItemIds: $,
1788
- setItemIds: z,
1801
+ setItemIds: Y,
1789
1802
  updateItems: V,
1790
- moveItems: Y,
1803
+ moveItems: L,
1791
1804
  removeItemsById: F,
1792
1805
  getItemList: H,
1793
1806
  insertItems: te,
1794
- setItemList: Z
1807
+ setItemList: Q
1795
1808
  }) => ({
1796
1809
  getItems: P,
1797
1810
  getItemIds: $,
1798
- setItemIds: z,
1811
+ setItemIds: Y,
1799
1812
  updateItems: V,
1800
- moveItems: Y,
1813
+ moveItems: L,
1801
1814
  removeItemsById: F,
1802
1815
  getItemList: H,
1803
1816
  insertItems: te,
1804
- setItemList: Z
1817
+ setItemList: Q
1805
1818
  })
1806
1819
  ), y = g.useCallback(
1807
- (P, $, z = !1) => {
1820
+ (P, $, Y = !1) => {
1808
1821
  let V = $;
1809
1822
  typeof $ == "object" && (V = () => $);
1810
- const Y = d().filter((Z) => P.includes(Z)), F = l(), H = Y.map((Z) => {
1811
- const ne = F[Z];
1812
- return z ? [Z, V(ne)] : [Z, V({ ...ne })];
1813
- }).filter(([, Z]) => Z);
1823
+ const L = d().filter((Q) => P.includes(Q)), F = l(), H = L.map((Q) => {
1824
+ const ne = F[Q];
1825
+ return Y ? [Q, V(ne)] : [Q, V({ ...ne })];
1826
+ }).filter(([, Q]) => Q);
1814
1827
  if (H.length === 0)
1815
1828
  return;
1816
1829
  const te = Object.fromEntries(H);
1817
- c(te, z), n();
1830
+ c(te, Y), n();
1818
1831
  },
1819
1832
  [d, l, n, c]
1820
1833
  ), C = g.useCallback(
1821
1834
  (P) => {
1822
- I(P), o(), n();
1835
+ O(P), o(), n();
1823
1836
  },
1824
- [o, I, n]
1837
+ [o, O, n]
1825
1838
  ), x = g.useCallback(
1826
- (P, $, z = !1) => {
1827
- y([P], $, z);
1839
+ (P, $, Y = !1) => {
1840
+ y([P], $, Y);
1828
1841
  },
1829
1842
  [y]
1830
1843
  ), p = g.useCallback(
@@ -1832,36 +1845,36 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1832
1845
  h(
1833
1846
  Bt(l(), d(), P),
1834
1847
  $
1835
- ), n();
1848
+ );
1836
1849
  },
1837
- [d, l, h, n]
1838
- ), w = g.useCallback(
1850
+ [d, l, h]
1851
+ ), _ = g.useCallback(
1839
1852
  (P) => {
1840
- const $ = d(), z = $.filter((Y) => !P.includes(Y)), V = $.filter(
1841
- (Y) => P.includes(Y)
1853
+ const $ = d(), Y = $.filter((L) => !P.includes(L)), V = $.filter(
1854
+ (L) => P.includes(L)
1842
1855
  );
1843
- f([...z, ...V]);
1856
+ f([...Y, ...V]);
1844
1857
  },
1845
1858
  [d, f]
1846
1859
  ), m = g.useCallback(
1847
- (P, { type: $, size: z } = {}) => {
1848
- const { boardWrapper: V } = u();
1860
+ (P, { type: $, size: Y } = {}) => {
1861
+ const { uid: V } = u();
1849
1862
  y(
1850
1863
  P,
1851
- (Y) => {
1852
- const F = Ne(V, Y.id);
1864
+ (L) => {
1865
+ const F = Xe(V, L.id);
1853
1866
  if (!F)
1854
1867
  return;
1855
1868
  const H = {
1856
1869
  type: $ || "grid",
1857
- size: z || 1,
1870
+ size: Y || 1,
1858
1871
  offset: { x: 0, y: 0 },
1859
- ...Y.grid
1872
+ ...L.grid
1860
1873
  };
1861
1874
  return an(
1862
1875
  {
1863
- x: Y.x,
1864
- y: Y.y,
1876
+ x: L.x,
1877
+ y: L.y,
1865
1878
  width: F.clientWidth,
1866
1879
  height: F.clientHeight
1867
1880
  },
@@ -1872,47 +1885,47 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1872
1885
  );
1873
1886
  },
1874
1887
  [u, y]
1875
- ), S = g.useCallback(
1888
+ ), w = g.useCallback(
1876
1889
  (P, $) => {
1877
- const z = Bt(
1890
+ const Y = Bt(
1878
1891
  l(),
1879
1892
  d(),
1880
1893
  P
1881
1894
  );
1882
- w(z), y(z, { moving: !1 }, !0), m(z, $), e(P), n();
1895
+ _(Y), y(Y, { moving: !1 }, !0), m(Y, $), e(P), n();
1883
1896
  },
1884
1897
  [
1885
1898
  y,
1886
1899
  e,
1887
1900
  d,
1888
1901
  l,
1889
- w,
1902
+ _,
1890
1903
  m,
1891
1904
  n
1892
1905
  ]
1893
- ), O = g.useCallback(
1906
+ ), R = g.useCallback(
1894
1907
  (P) => {
1895
1908
  f(P);
1896
1909
  },
1897
1910
  [f]
1898
- ), k = g.useCallback(
1911
+ ), T = g.useCallback(
1899
1912
  (P) => {
1900
- const $ = d(), z = $.filter(
1901
- (Y) => P.includes(Y)
1902
- ), V = $.map((Y) => P.includes(Y) ? z.pop() : Y);
1913
+ const $ = d(), Y = $.filter(
1914
+ (L) => P.includes(L)
1915
+ ), V = $.map((L) => P.includes(L) ? Y.pop() : L);
1903
1916
  f(V), s();
1904
1917
  },
1905
1918
  [d, s, f]
1906
1919
  ), j = g.useCallback(
1907
1920
  (P, $) => {
1908
- const z = l(), V = Object.fromEntries(
1921
+ const Y = l(), V = Object.fromEntries(
1909
1922
  $.map((H, te) => {
1910
- const Z = z[P[te]];
1923
+ const Q = Y[P[te]];
1911
1924
  return [
1912
1925
  H,
1913
1926
  {
1914
- x: Z.x,
1915
- y: Z.y
1927
+ x: Q.x,
1928
+ y: Q.y
1916
1929
  }
1917
1930
  ];
1918
1931
  })
@@ -1922,52 +1935,52 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1922
1935
  (H) => V[H.id],
1923
1936
  !0
1924
1937
  );
1925
- const Y = Object.fromEntries(
1938
+ const L = Object.fromEntries(
1926
1939
  P.map((H, te) => [H, $[te]])
1927
- ), F = d().map((H) => P.includes(H) ? Y[H] : H);
1940
+ ), F = d().map((H) => P.includes(H) ? L[H] : H);
1928
1941
  f(F);
1929
1942
  },
1930
1943
  [l, y, d, f]
1931
1944
  ), M = g.useCallback(
1932
1945
  (P, $) => {
1933
- const z = r(), V = P.map((Y, F) => !Y.x || !Y.y ? { ...Y, x: z.x + 2 * F, y: z.y + 2 * F } : Y);
1934
- E(V, $), n();
1946
+ const Y = r(), V = P.map((L, F) => !L.x || !L.y ? { ...L, x: Y.x + 2 * F, y: Y.y + 2 * F } : L);
1947
+ E(V, $), w(P.map(({ id: L }) => L));
1935
1948
  },
1936
- [r, E, n]
1949
+ [r, E, w]
1937
1950
  ), A = g.useCallback(
1938
1951
  (P, $) => {
1939
1952
  M([P], $);
1940
1953
  },
1941
1954
  [M]
1942
- ), N = g.useCallback(
1955
+ ), B = g.useCallback(
1943
1956
  (P) => {
1944
- a(P), _(P), t(P);
1957
+ a(P), S(P), t(P);
1945
1958
  },
1946
- [a, _, t]
1959
+ [a, S, t]
1947
1960
  ), U = g.useCallback(
1948
1961
  (P) => {
1949
1962
  const $ = l();
1950
- return P.map((z) => $[z]);
1963
+ return P.map((Y) => $[Y]);
1951
1964
  },
1952
1965
  [l]
1953
1966
  ), J = g.useCallback(
1954
- ({ target: P, clientX: $, clientY: z }, { returnLocked: V = !1, passLocked: Y = !1 } = {}) => {
1967
+ ({ target: P, clientX: $, clientY: Y }, { returnLocked: V = !1, passLocked: L = !1 } = {}) => {
1955
1968
  if (["INPUT", "TEXTAREA"].includes(P.tagName))
1956
1969
  return null;
1957
1970
  const F = Oe(P, "item");
1958
1971
  if (F) {
1959
1972
  if (ye(F, "selected"))
1960
1973
  return F;
1961
- if (!Y && ye(F, "locked") && !ye(P, "passthrough"))
1974
+ if (!L && ye(F, "locked") && !ye(P, "passthrough"))
1962
1975
  return V ? F : null;
1963
1976
  if (ye(P, "passthrough")) {
1964
- const H = d(), { boardWrapper: te } = u(), Z = H.reduce((ne, ie) => {
1965
- const me = Ne(te, ie), ge = me.getBoundingClientRect();
1966
- return ft({ x: $, y: z }, ge) && ne.unshift(me), ne;
1977
+ const H = d(), { uid: te } = u(), Q = H.reduce((ne, ie) => {
1978
+ const me = Xe(te, ie), ge = me.getBoundingClientRect();
1979
+ return ft({ x: $, y: Y }, ge) && ne.unshift(me), ne;
1967
1980
  }, []);
1968
- for (let ne = 0; ne < Z.length; ne += 1) {
1969
- const ie = Z[ne];
1970
- if (ie !== F && (Y || !ye(ie, "locked")))
1981
+ for (let ne = 0; ne < Q.length; ne += 1) {
1982
+ const ie = Q[ne];
1983
+ if (ie !== F && (L || !ye(ie, "locked")))
1971
1984
  return ie;
1972
1985
  }
1973
1986
  return null;
@@ -1978,18 +1991,18 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1978
1991
  [u, d]
1979
1992
  );
1980
1993
  return {
1981
- putItemsOnTop: w,
1994
+ putItemsOnTop: _,
1982
1995
  batchUpdateItems: y,
1983
- updateItemOrder: O,
1996
+ updateItemOrder: R,
1984
1997
  moveItems: p,
1985
- placeItems: S,
1998
+ placeItems: w,
1986
1999
  updateItem: x,
1987
2000
  swapItems: j,
1988
- reverseItemsOrder: k,
2001
+ reverseItemsOrder: T,
1989
2002
  setItemList: C,
1990
2003
  pushItem: A,
1991
2004
  pushItems: M,
1992
- removeItems: N,
2005
+ removeItems: B,
1993
2006
  getItemList: v,
1994
2007
  findElementUnderPointer: J,
1995
2008
  getItems: U
@@ -2069,11 +2082,11 @@ const xn = (e, t) => {
2069
2082
  }, Ft = (e, t) => {
2070
2083
  const { actions: r = xn(e, t) } = e;
2071
2084
  return r.map((n) => typeof n == "string" ? { name: n } : n);
2072
- }, is = () => {
2085
+ }, as = () => {
2073
2086
  const [e, t] = oe((c) => [
2074
2087
  c.items,
2075
2088
  c.getItems
2076
- ]), [r, n, o] = Q((c) => [
2089
+ ]), [r, n, o] = Z((c) => [
2077
2090
  c.config.itemTemplates,
2078
2091
  c.selection,
2079
2092
  c.getSelection
@@ -2086,8 +2099,8 @@ const xn = (e, t) => {
2086
2099
  const h = t();
2087
2100
  if (c)
2088
2101
  return [c, c.map((v) => h[v])];
2089
- const _ = o();
2090
- return [_, _.map((v) => h[v])];
2102
+ const S = o();
2103
+ return [S, S.map((v) => h[v])];
2091
2104
  },
2092
2105
  [t, o]
2093
2106
  ), f = tr(() => {
@@ -2095,14 +2108,14 @@ const xn = (e, t) => {
2095
2108
  if (c.length > 0) {
2096
2109
  if (!u.current)
2097
2110
  return;
2098
- const _ = h.reduce((v, E) => {
2099
- const I = Ft(E, r);
2111
+ const S = h.reduce((v, E) => {
2112
+ const O = Ft(E, r);
2100
2113
  return v.filter(
2101
- (y) => I.some((C) => wn(y, C))
2114
+ (y) => O.some((C) => wn(y, C))
2102
2115
  );
2103
2116
  }, Ft(h[0], r));
2104
2117
  l(() => {
2105
- a(_);
2118
+ a(S);
2106
2119
  });
2107
2120
  } else
2108
2121
  l(() => {
@@ -2116,8 +2129,8 @@ const xn = (e, t) => {
2116
2129
  ), {
2117
2130
  availableActions: s
2118
2131
  };
2119
- }, as = () => {
2120
- const [e] = Q((t) => [t.selectionBox]);
2132
+ }, cs = () => {
2133
+ const [e] = Z((t) => [t.selectionBox]);
2121
2134
  return e;
2122
2135
  };
2123
2136
  let pe = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, r) => (r &= 63, r < 36 ? t += r.toString(36) : r < 62 ? t += (r - 26).toString(36).toUpperCase() : r > 62 ? t += "-" : t += "_", t), "");
@@ -2127,7 +2140,7 @@ const lr = g.createContext(), ut = (e) => {
2127
2140
  if (localStorage.user) {
2128
2141
  const t = {
2129
2142
  name: "Player",
2130
- color: Xt(),
2143
+ color: Nt(),
2131
2144
  uid: pe(),
2132
2145
  ...JSON.parse(localStorage.user)
2133
2146
  };
@@ -2135,7 +2148,7 @@ const lr = g.createContext(), ut = (e) => {
2135
2148
  }
2136
2149
  const e = {
2137
2150
  name: "Player",
2138
- color: Xt(),
2151
+ color: Nt(),
2139
2152
  uid: pe()
2140
2153
  };
2141
2154
  return ut(e), e;
@@ -2192,7 +2205,7 @@ const lr = g.createContext(), ut = (e) => {
2192
2205
  return delete n[t], { cursors: n };
2193
2206
  })
2194
2207
  }), fr = ({ storeName: e, children: t }) => {
2195
- const { wire: r, isMaster: n } = Xe("room"), [o, s] = g.useState(null), [a, u] = g.useState(!1), l = g.useRef(!1);
2208
+ const { wire: r, isMaster: n } = Ne("room"), [o, s] = g.useState(null), [a, u] = g.useState(!1), l = g.useRef(!1);
2196
2209
  return g.useEffect(() => {
2197
2210
  let d = !0;
2198
2211
  const f = [];
@@ -2215,8 +2228,8 @@ const lr = g.createContext(), ut = (e) => {
2215
2228
  ...On(...v)
2216
2229
  })
2217
2230
  )
2218
- ), _ = h.subscribe((v) => {
2219
- v.ready && (_(), d && s(h));
2231
+ ), S = h.subscribe((v) => {
2232
+ v.ready && (S(), d && s(h));
2220
2233
  });
2221
2234
  })(), () => {
2222
2235
  d = !1, l.current = !1, f.forEach((h) => h());
@@ -2240,11 +2253,11 @@ const lr = g.createContext(), ut = (e) => {
2240
2253
  }
2241
2254
  }, [n, o, r]), g.useEffect(() => {
2242
2255
  n && o && o.getState().updateCurrentUser({ isMaster: n });
2243
- }, [n, o, r]), a ? /* @__PURE__ */ T(lr.Provider, { value: o, children: t }) : null;
2256
+ }, [n, o, r]), a ? /* @__PURE__ */ k(lr.Provider, { value: o, children: t }) : null;
2244
2257
  }, Se = (e, t) => {
2245
2258
  const r = _e(lr);
2246
2259
  return We(r, e, t || Ve);
2247
- }, cs = () => {
2260
+ }, us = () => {
2248
2261
  const [e, t, r, n, o] = Se((u) => [
2249
2262
  u.isSpaceMaster,
2250
2263
  u.getUser(),
@@ -2263,7 +2276,7 @@ const lr = g.createContext(), ut = (e) => {
2263
2276
  localUsers: a,
2264
2277
  joinSpace: o
2265
2278
  };
2266
- }, us = () => {
2279
+ }, ls = () => {
2267
2280
  const [e, t, r] = oe(
2268
2281
  (o) => [o.boardConfig, o.getBoardConfig, o.setBoardConfig]
2269
2282
  ), n = g.useCallback(
@@ -2276,10 +2289,10 @@ const lr = g.createContext(), ut = (e) => {
2276
2289
  [t, r]
2277
2290
  );
2278
2291
  return [e, n];
2279
- }, ls = () => {
2280
- const [e] = Q((t) => [t.boardState]);
2281
- return e;
2282
2292
  }, fs = () => {
2293
+ const [e] = Z((t) => [t.boardState]);
2294
+ return e;
2295
+ }, ds = () => {
2283
2296
  const [e, t, r, n] = oe((o) => [
2284
2297
  o.getSessionInfo,
2285
2298
  o.setSessionInfo,
@@ -2319,7 +2332,7 @@ const lr = g.createContext(), ut = (e) => {
2319
2332
  children: t,
2320
2333
  defaultValue: r = []
2321
2334
  }) => {
2322
- const { wire: n } = Xe("room"), [o] = g.useState(
2335
+ const { wire: n } = Ne("room"), [o] = g.useState(
2323
2336
  () => Ue(
2324
2337
  dt(
2325
2338
  { wire: n, storeName: e, defaultValue: r, noSync: ["sendMessage"] },
@@ -2329,12 +2342,12 @@ const lr = g.createContext(), ut = (e) => {
2329
2342
  )
2330
2343
  )
2331
2344
  );
2332
- return /* @__PURE__ */ T(dr.Provider, { value: o, children: t });
2345
+ return /* @__PURE__ */ k(dr.Provider, { value: o, children: t });
2333
2346
  }, Pn = (e, t) => {
2334
2347
  const r = _e(dr);
2335
2348
  return We(r, e, t || Ve);
2336
2349
  }, Mn = () => {
2337
- }, ds = (e = Mn) => {
2350
+ }, ps = (e = Mn) => {
2338
2351
  const t = Se((a) => a.getUser()), [r, n, o] = Pn((a) => [
2339
2352
  a.messages,
2340
2353
  a.setMessages,
@@ -2355,7 +2368,7 @@ const lr = g.createContext(), ut = (e) => {
2355
2368
  return g.useEffect(() => (r(t), () => {
2356
2369
  r(null);
2357
2370
  }), [r, t]), e;
2358
- }, ps = ({
2371
+ }, ms = ({
2359
2372
  socket: e,
2360
2373
  room: t,
2361
2374
  session: r,
@@ -2368,60 +2381,148 @@ const lr = g.createContext(), ut = (e) => {
2368
2381
  itemIds: n.map(({ id: c }) => c),
2369
2382
  items: Object.fromEntries(n.map((c) => [c.id, c]))
2370
2383
  }));
2371
- return Xe("room") ? /* @__PURE__ */ T(
2384
+ return Ne("room") ? /* @__PURE__ */ k(
2372
2385
  Kt,
2373
2386
  {
2374
2387
  storeName: `${l}_messages`,
2375
2388
  defaultValue: o,
2376
- children: /* @__PURE__ */ T(Wt, { children: /* @__PURE__ */ T(
2389
+ children: /* @__PURE__ */ k(Wt, { children: /* @__PURE__ */ k(
2377
2390
  Ut,
2378
2391
  {
2379
2392
  storeName: `${l}_item`,
2380
2393
  defaultValue: d,
2381
- children: /* @__PURE__ */ T(Ht, { ...a, session: l })
2394
+ children: /* @__PURE__ */ k(Ht, { ...a, session: l })
2382
2395
  }
2383
2396
  ) })
2384
2397
  }
2385
- ) : /* @__PURE__ */ T(
2398
+ ) : /* @__PURE__ */ k(
2386
2399
  nr,
2387
2400
  {
2388
2401
  room: u,
2389
2402
  channel: "room",
2390
2403
  socket: e,
2391
2404
  LoadingComponent: s,
2392
- children: /* @__PURE__ */ T(fr, { storeName: `${u}_users`, children: /* @__PURE__ */ T(
2405
+ children: /* @__PURE__ */ k(fr, { storeName: `${u}_users`, children: /* @__PURE__ */ k(
2393
2406
  Kt,
2394
2407
  {
2395
2408
  storeName: `${l}_messages`,
2396
2409
  defaultValue: o,
2397
- children: /* @__PURE__ */ T(Wt, { children: /* @__PURE__ */ T(
2410
+ children: /* @__PURE__ */ k(Wt, { children: /* @__PURE__ */ k(
2398
2411
  Ut,
2399
2412
  {
2400
2413
  storeName: `${l}_item`,
2401
2414
  defaultValue: d,
2402
- children: /* @__PURE__ */ T(Ht, { ...a, session: l })
2415
+ children: /* @__PURE__ */ k(Ht, { ...a, session: l })
2403
2416
  }
2404
2417
  ) })
2405
2418
  }
2406
2419
  ) })
2407
2420
  }
2408
2421
  );
2409
- }, ms = ({ socket: e, room: t, children: r, LoadingComponent: n }) => {
2422
+ }, gs = ({ socket: e, room: t, children: r, LoadingComponent: n }) => {
2410
2423
  const [o] = g.useState(t || pe());
2411
- return /* @__PURE__ */ T(
2424
+ return /* @__PURE__ */ k(
2412
2425
  nr,
2413
2426
  {
2414
2427
  room: o,
2415
2428
  channel: "room",
2416
2429
  socket: e,
2417
2430
  LoadingComponent: n,
2418
- children: /* @__PURE__ */ T(fr, { storeName: `${o}_users`, children: r })
2431
+ children: /* @__PURE__ */ k(fr, { storeName: `${o}_users`, children: r })
2419
2432
  }
2420
2433
  );
2421
- }, nt = () => {
2434
+ };
2435
+ let jn = { data: "" }, Dn = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || jn, $n = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, An = /\/\*[^]*?\*\/| +/g, qt = /\n+/g, fe = (e, t) => {
2436
+ let r = "", n = "", o = "";
2437
+ for (let s in e) {
2438
+ let a = e[s];
2439
+ s[0] == "@" ? s[1] == "i" ? r = s + " " + a + ";" : n += s[1] == "f" ? fe(a, s) : s + "{" + fe(a, s[1] == "k" ? "" : t) + "}" : typeof a == "object" ? n += fe(a, t ? t.replace(/([^,])+/g, (u) => s.replace(/(^:.*)|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, u) : u ? u + " " + l : l)) : s) : a != null && (s = /^--/.test(s) ? s : s.replace(/[A-Z]/g, "-$&").toLowerCase(), o += fe.p ? fe.p(s, a) : s + ":" + a + ";");
2440
+ }
2441
+ return r + (t && o ? t + "{" + o + "}" : o) + n;
2442
+ }, ce = {}, pr = (e) => {
2443
+ if (typeof e == "object") {
2444
+ let t = "";
2445
+ for (let r in e)
2446
+ t += r + pr(e[r]);
2447
+ return t;
2448
+ }
2449
+ return e;
2450
+ }, Ln = (e, t, r, n, o) => {
2451
+ let s = pr(e), a = ce[s] || (ce[s] = ((l) => {
2452
+ let d = 0, f = 11;
2453
+ for (; d < l.length; )
2454
+ f = 101 * f + l.charCodeAt(d++) >>> 0;
2455
+ return "go" + f;
2456
+ })(s));
2457
+ if (!ce[a]) {
2458
+ let l = s !== e ? e : ((d) => {
2459
+ let f, c, h = [{}];
2460
+ for (; f = $n.exec(d.replace(An, "")); )
2461
+ f[4] ? h.shift() : f[3] ? (c = f[3].replace(qt, " ").trim(), h.unshift(h[0][c] = h[0][c] || {})) : h[0][f[1]] = f[2].replace(qt, " ").trim();
2462
+ return h[0];
2463
+ })(e);
2464
+ ce[a] = fe(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
2465
+ }
2466
+ let u = r && ce.g ? ce.g : null;
2467
+ return r && (ce.g = ce[a]), ((l, d, f, c) => {
2468
+ c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = f ? l + d.data : d.data + l);
2469
+ })(ce[a], t, n, u), a;
2470
+ }, zn = (e, t, r) => e.reduce((n, o, s) => {
2471
+ let a = t[s];
2472
+ if (a && a.call) {
2473
+ let u = a(r), l = u && u.props && u.props.className || /^go/.test(u) && u;
2474
+ a = l ? "." + l : u && typeof u == "object" ? u.props ? "" : fe(u, "") : u === !1 ? "" : u;
2475
+ }
2476
+ return n + o + (a ?? "");
2477
+ }, "");
2478
+ function K(e) {
2479
+ let t = this || {}, r = e.call ? e(t.p) : e;
2480
+ return Ln(r.unshift ? r.raw ? zn(r, [].slice.call(arguments, 1), t.p) : r.reduce((n, o) => Object.assign(n, o && o.call ? o(t.p) : o), {}) : r, Dn(t.target), t.g, t.o, t.k);
2481
+ }
2482
+ K.bind({ g: 1 });
2483
+ K.bind({ k: 1 });
2484
+ function Yn(e, t, r, n) {
2485
+ fe.p = t;
2486
+ }
2487
+ var Bn = function e(t, r) {
2488
+ if (t === r)
2489
+ return !0;
2490
+ if (t && r && typeof t == "object" && typeof r == "object") {
2491
+ if (t.constructor !== r.constructor)
2492
+ return !1;
2493
+ var n, o, s;
2494
+ if (Array.isArray(t)) {
2495
+ if (n = t.length, n != r.length)
2496
+ return !1;
2497
+ for (o = n; o-- !== 0; )
2498
+ if (!e(t[o], r[o]))
2499
+ return !1;
2500
+ return !0;
2501
+ }
2502
+ if (t.constructor === RegExp)
2503
+ return t.source === r.source && t.flags === r.flags;
2504
+ if (t.valueOf !== Object.prototype.valueOf)
2505
+ return t.valueOf() === r.valueOf();
2506
+ if (t.toString !== Object.prototype.toString)
2507
+ return t.toString() === r.toString();
2508
+ if (s = Object.keys(t), n = s.length, n !== Object.keys(r).length)
2509
+ return !1;
2510
+ for (o = n; o-- !== 0; )
2511
+ if (!Object.prototype.hasOwnProperty.call(r, s[o]))
2512
+ return !1;
2513
+ for (o = n; o-- !== 0; ) {
2514
+ var a = s[o];
2515
+ if (!e(t[a], r[a]))
2516
+ return !1;
2517
+ }
2518
+ return !0;
2519
+ }
2520
+ return t !== t && r !== r;
2521
+ };
2522
+ const nt = () => {
2422
2523
  const e = navigator.userAgent.toLowerCase();
2423
2524
  return /mac os ?x 10/.test(e);
2424
- }, jn = () => {
2525
+ }, Xn = () => {
2425
2526
  const e = document.createElement("iframe");
2426
2527
  e.src = "#", document.body.appendChild(e);
2427
2528
  const t = e.contentWindow.document;
@@ -2430,34 +2531,34 @@ const lr = g.createContext(), ut = (e) => {
2430
2531
  ), t.close();
2431
2532
  const r = t.body.firstElementChild.offsetHeight;
2432
2533
  return document.body.removeChild(e), r;
2433
- }, Dn = jn(), $n = 800, qt = (e, t) => {
2534
+ }, Nn = Xn(), Un = 800, Gt = (e, t) => {
2434
2535
  const r = Object.keys(e).map((n) => Number(n)).find((n) => n !== t);
2435
2536
  return e[r];
2436
- }, Gt = ([e, t], [r, n]) => {
2537
+ }, Jt = ([e, t], [r, n]) => {
2437
2538
  const o = Math.abs(e - r), s = Math.abs(t - n);
2438
2539
  return Math.hypot(o, s);
2439
2540
  }, de = () => {
2440
- }, An = (e) => (t) => {
2541
+ }, Wn = (e) => (t) => {
2441
2542
  const { event: r } = t;
2442
2543
  return r.isPropagationStopped() ? null : e(t);
2443
- }, Ln = (e) => async (...t) => {
2544
+ }, Vn = (e) => async (...t) => {
2444
2545
  try {
2445
2546
  await e(...t);
2446
2547
  } catch (r) {
2447
2548
  console.error(r);
2448
2549
  }
2449
2550
  };
2450
- class zn {
2551
+ class Fn {
2451
2552
  constructor() {
2452
2553
  kt(this, "lastPromise", Promise.resolve(!0));
2453
2554
  }
2454
2555
  add(t, ...r) {
2455
2556
  return new Promise((n, o) => {
2456
- this.lastPromise = this.lastPromise.then(() => An(Ln(t))(...r)).then(n).catch(o);
2557
+ this.lastPromise = this.lastPromise.then(() => Wn(Vn(t))(...r)).then(n).catch(o);
2457
2558
  });
2458
2559
  }
2459
2560
  }
2460
- const se = new zn(), Fe = ({
2561
+ const se = new Fn(), Fe = ({
2461
2562
  children: e,
2462
2563
  onDrag: t = de,
2463
2564
  onDragStart: r = de,
@@ -2478,21 +2579,21 @@ const se = new zn(), Fe = ({
2478
2579
  deltaX: C,
2479
2580
  deltaY: x,
2480
2581
  clientX: p,
2481
- clientY: w,
2582
+ clientY: _,
2482
2583
  deltaMode: m,
2483
- ctrlKey: S,
2484
- altKey: O,
2485
- metaKey: k,
2584
+ ctrlKey: w,
2585
+ altKey: R,
2586
+ metaKey: T,
2486
2587
  target: j
2487
2588
  } = y;
2488
- if (!(O || S && !nt()))
2489
- if (nt() && !S)
2589
+ if (!(R || w && !nt()))
2590
+ if (nt() && !w)
2490
2591
  se.add(o, {
2491
2592
  deltaX: -2 * C,
2492
2593
  deltaY: -2 * x,
2493
2594
  button: 1,
2494
- ctrlKey: S,
2495
- metaKey: k,
2595
+ ctrlKey: w,
2596
+ metaKey: T,
2496
2597
  target: j,
2497
2598
  event: y
2498
2599
  });
@@ -2502,43 +2603,43 @@ const se = new zn(), Fe = ({
2502
2603
  let M = x;
2503
2604
  switch (m) {
2504
2605
  case 1:
2505
- M *= Dn;
2606
+ M *= Nn;
2506
2607
  break;
2507
2608
  case 2:
2508
- M *= $n;
2609
+ M *= Un;
2509
2610
  break;
2510
2611
  }
2511
- nt() && (M *= 2), se.add(l, { scale: M, clientX: p, clientY: w, event: y });
2612
+ nt() && (M *= 2), se.add(l, { scale: M, clientX: p, clientY: _, event: y });
2512
2613
  }
2513
- }, _ = (y) => {
2614
+ }, S = (y) => {
2514
2615
  const {
2515
2616
  target: C,
2516
2617
  button: x,
2517
2618
  clientX: p,
2518
- clientY: w,
2619
+ clientY: _,
2519
2620
  pointerId: m,
2520
- altKey: S,
2521
- ctrlKey: O,
2522
- metaKey: k,
2621
+ altKey: w,
2622
+ ctrlKey: R,
2623
+ metaKey: T,
2523
2624
  isPrimary: j
2524
2625
  } = y;
2525
- if (c.current.pointers[m] = { clientX: p, clientY: w }, j && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
2626
+ if (c.current.pointers[m] = { clientX: p, clientY: _ }, j && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
2526
2627
  if (c.current.mainPointer !== m)
2527
2628
  try {
2528
- const { clientX: M, clientY: A } = qt(
2629
+ const { clientX: M, clientY: A } = Gt(
2529
2630
  c.current.pointers,
2530
2631
  m
2531
- ), N = (M + p) / 2, U = (A + w) / 2, J = Gt(
2632
+ ), B = (M + p) / 2, U = (A + _) / 2, J = Jt(
2532
2633
  [M, A],
2533
- [p, w]
2634
+ [p, _]
2534
2635
  );
2535
2636
  Object.assign(c.current, {
2536
2637
  pressed: !0,
2537
2638
  moving: !1,
2538
2639
  gestureStart: !1,
2539
2640
  startX: p,
2540
- startY: w,
2541
- prevX: N,
2641
+ startY: _,
2642
+ prevX: B,
2542
2643
  prevY: U,
2543
2644
  startDistance: J,
2544
2645
  prevDistance: J
@@ -2553,9 +2654,9 @@ const se = new zn(), Fe = ({
2553
2654
  moving: !1,
2554
2655
  gestureStart: !1,
2555
2656
  startX: p,
2556
- startY: w,
2657
+ startY: _,
2557
2658
  prevX: p,
2558
- prevY: w,
2659
+ prevY: _,
2559
2660
  currentButton: x,
2560
2661
  pointerDownEvent: y,
2561
2662
  startDistance: 0,
@@ -2565,10 +2666,10 @@ const se = new zn(), Fe = ({
2565
2666
  longTapTimeout: setTimeout(async () => {
2566
2667
  c.current.noTap = !0, se.add(a, {
2567
2668
  clientX: p,
2568
- clientY: w,
2569
- altKey: S,
2570
- ctrlKey: O,
2571
- metaKey: k,
2669
+ clientY: _,
2670
+ altKey: w,
2671
+ ctrlKey: R,
2672
+ metaKey: T,
2572
2673
  target: C,
2573
2674
  event: y
2574
2675
  });
@@ -2585,30 +2686,30 @@ const se = new zn(), Fe = ({
2585
2686
  pointerId: C,
2586
2687
  clientX: x,
2587
2688
  clientY: p,
2588
- altKey: w,
2689
+ altKey: _,
2589
2690
  shiftKey: m,
2590
- ctrlKey: S,
2591
- metaKey: O,
2592
- buttons: k
2691
+ ctrlKey: w,
2692
+ metaKey: R,
2693
+ buttons: T
2593
2694
  } = y;
2594
2695
  c.current.pointers[C] = {
2595
2696
  clientX: x,
2596
2697
  clientY: p
2597
2698
  }, c.current.moving = !0;
2598
2699
  const j = Object.keys(c.current.pointers).length === 2;
2599
- let M, A, N = 0;
2700
+ let M, A, B = 0;
2600
2701
  if (j) {
2601
- const { clientX: $, clientY: z } = qt(
2702
+ const { clientX: $, clientY: Y } = Gt(
2602
2703
  c.current.pointers,
2603
2704
  C
2604
2705
  );
2605
- M = ($ + x) / 2, A = (z + p) / 2, N = Gt(
2606
- [$, z],
2706
+ M = ($ + x) / 2, A = (Y + p) / 2, B = Jt(
2707
+ [$, Y],
2607
2708
  [x, p]
2608
2709
  );
2609
2710
  } else
2610
2711
  M = x, A = p;
2611
- let U = m || w || S || O || k !== 1;
2712
+ let U = m || _ || w || R || T !== 1;
2612
2713
  d !== "drag" && (U = !U);
2613
2714
  const J = !U, P = U;
2614
2715
  if (J) {
@@ -2622,53 +2723,53 @@ const se = new zn(), Fe = ({
2622
2723
  distanceX: 0,
2623
2724
  distanceY: 0,
2624
2725
  button: c.current.currentButton,
2625
- altKey: w,
2726
+ altKey: _,
2626
2727
  shiftKey: m,
2627
- ctrlKey: S,
2628
- metaKey: O,
2728
+ ctrlKey: w,
2729
+ metaKey: R,
2629
2730
  target: c.current.target,
2630
2731
  event: c.current.pointerDownEvent
2631
2732
  }));
2632
- const $ = M - c.current.prevX, z = A - c.current.prevY, V = M - c.current.startX, Y = A - c.current.startY;
2733
+ const $ = M - c.current.prevX, Y = A - c.current.prevY, V = M - c.current.startX, L = A - c.current.startY;
2633
2734
  se.add(t, {
2634
2735
  deltaX: $,
2635
- deltaY: z,
2736
+ deltaY: Y,
2636
2737
  startX: c.current.startX,
2637
2738
  startY: c.current.startY,
2638
2739
  clientX: M,
2639
2740
  clientY: A,
2640
2741
  distanceX: V,
2641
- distanceY: Y,
2742
+ distanceY: L,
2642
2743
  button: c.current.currentButton,
2643
- altKey: w,
2744
+ altKey: _,
2644
2745
  shiftKey: m,
2645
- ctrlKey: S,
2646
- metaKey: O,
2746
+ ctrlKey: w,
2747
+ metaKey: R,
2647
2748
  target: c.current.target,
2648
2749
  event: y
2649
2750
  });
2650
2751
  }
2651
2752
  if (P) {
2652
2753
  c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout));
2653
- const $ = M - c.current.prevX, z = A - c.current.prevY, { target: V } = c.current;
2754
+ const $ = M - c.current.prevX, Y = A - c.current.prevY, { target: V } = c.current;
2654
2755
  if (se.add(o, {
2655
2756
  deltaX: $,
2656
- deltaY: z,
2757
+ deltaY: Y,
2657
2758
  button: c.current.currentButton,
2658
- altKey: w,
2759
+ altKey: _,
2659
2760
  shiftKey: m,
2660
- ctrlKey: S,
2661
- metaKey: O,
2761
+ ctrlKey: w,
2762
+ metaKey: R,
2662
2763
  target: V,
2663
2764
  event: y
2664
- }), N !== c.current.prevDistance && l) {
2665
- const Y = c.current.prevDistance - N;
2666
- Math.abs(Y) > 0 && (se.add(l, {
2667
- scale: Y * 3,
2765
+ }), B !== c.current.prevDistance && l) {
2766
+ const L = c.current.prevDistance - B;
2767
+ Math.abs(L) > 0 && (se.add(l, {
2768
+ scale: L * 3,
2668
2769
  clientX: M,
2669
2770
  clientY: A,
2670
2771
  event: y
2671
- }), c.current.prevDistance = N);
2772
+ }), c.current.prevDistance = B);
2672
2773
  }
2673
2774
  }
2674
2775
  c.current.prevX = M, c.current.prevY = A;
@@ -2678,14 +2779,14 @@ const se = new zn(), Fe = ({
2678
2779
  clientX: C,
2679
2780
  clientY: x,
2680
2781
  altKey: p,
2681
- shiftKey: w,
2782
+ shiftKey: _,
2682
2783
  ctrlKey: m,
2683
- metaKey: S,
2684
- target: O,
2685
- pointerId: k
2784
+ metaKey: w,
2785
+ target: R,
2786
+ pointerId: T
2686
2787
  } = y;
2687
- if (c.current.pointers[k]) {
2688
- if (delete c.current.pointers[k], c.current.mainPointer !== k) {
2788
+ if (c.current.pointers[T]) {
2789
+ if (delete c.current.pointers[T], c.current.mainPointer !== T) {
2689
2790
  const { clientX: j, clientY: M } = c.current.pointers[c.current.mainPointer];
2690
2791
  Object.assign(c.current, {
2691
2792
  prevX: j,
@@ -2725,9 +2826,9 @@ const se = new zn(), Fe = ({
2725
2826
  distanceY: x - c.current.startY,
2726
2827
  button: c.current.currentButton,
2727
2828
  altKey: p,
2728
- shiftKey: w,
2829
+ shiftKey: _,
2729
2830
  ctrlKey: m,
2730
- metaKey: S,
2831
+ metaKey: w,
2731
2832
  event: y
2732
2833
  }), f.current.style.cursor = "auto";
2733
2834
  else {
@@ -2736,35 +2837,35 @@ const se = new zn(), Fe = ({
2736
2837
  clientX: C,
2737
2838
  clientY: x,
2738
2839
  altKey: p,
2739
- shiftKey: w,
2840
+ shiftKey: _,
2740
2841
  ctrlKey: m,
2741
- metaKey: S,
2742
- target: O,
2842
+ metaKey: w,
2843
+ target: R,
2743
2844
  event: y
2744
2845
  });
2745
2846
  }
2746
2847
  }
2747
2848
  };
2748
- return /* @__PURE__ */ T(
2849
+ return /* @__PURE__ */ k(
2749
2850
  "div",
2750
2851
  {
2751
2852
  onWheel: h,
2752
- onPointerDown: _,
2853
+ onPointerDown: S,
2753
2854
  onPointerMove: v,
2754
2855
  onPointerUp: E,
2755
2856
  onPointerOut: E,
2756
2857
  onPointerLeave: E,
2757
2858
  onPointerCancel: E,
2758
2859
  onDoubleClick: (y) => {
2759
- const { clientX: C, clientY: x, altKey: p, shiftKey: w, ctrlKey: m, metaKey: S, target: O } = y;
2860
+ const { clientX: C, clientY: x, altKey: p, shiftKey: _, ctrlKey: m, metaKey: w, target: R } = y;
2760
2861
  se.add(u, {
2761
2862
  clientX: C,
2762
2863
  clientY: x,
2763
2864
  altKey: p,
2764
- shiftKey: w,
2865
+ shiftKey: _,
2765
2866
  ctrlKey: m,
2766
- metaKey: S,
2767
- target: O,
2867
+ metaKey: w,
2868
+ target: R,
2768
2869
  event: y
2769
2870
  });
2770
2871
  },
@@ -2774,104 +2875,16 @@ const se = new zn(), Fe = ({
2774
2875
  }
2775
2876
  );
2776
2877
  }, ot = ({ onResize: e, ...t }) => {
2777
- const [r] = Q((o) => [o.getBoardState]);
2778
- return /* @__PURE__ */ T(Fe, { onDrag: ({ deltaX: o, deltaY: s, event: a }) => {
2878
+ const [r] = Z((o) => [o.getBoardState]);
2879
+ return /* @__PURE__ */ k(Fe, { onDrag: ({ deltaX: o, deltaY: s, event: a }) => {
2779
2880
  a.stopPropagation();
2780
2881
  const { scale: u } = r();
2781
2882
  e({
2782
2883
  width: o / u,
2783
2884
  height: s / u
2784
2885
  });
2785
- }, children: /* @__PURE__ */ T("div", { ...t }) });
2786
- };
2787
- let Yn = { data: "" }, Bn = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || Yn, Nn = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, Xn = /\/\*[^]*?\*\/| +/g, Jt = /\n+/g, fe = (e, t) => {
2788
- let r = "", n = "", o = "";
2789
- for (let s in e) {
2790
- let a = e[s];
2791
- s[0] == "@" ? s[1] == "i" ? r = s + " " + a + ";" : n += s[1] == "f" ? fe(a, s) : s + "{" + fe(a, s[1] == "k" ? "" : t) + "}" : typeof a == "object" ? n += fe(a, t ? t.replace(/([^,])+/g, (u) => s.replace(/(^:.*)|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, u) : u ? u + " " + l : l)) : s) : a != null && (s = /^--/.test(s) ? s : s.replace(/[A-Z]/g, "-$&").toLowerCase(), o += fe.p ? fe.p(s, a) : s + ":" + a + ";");
2792
- }
2793
- return r + (t && o ? t + "{" + o + "}" : o) + n;
2794
- }, ce = {}, pr = (e) => {
2795
- if (typeof e == "object") {
2796
- let t = "";
2797
- for (let r in e)
2798
- t += r + pr(e[r]);
2799
- return t;
2800
- }
2801
- return e;
2802
- }, Un = (e, t, r, n, o) => {
2803
- let s = pr(e), a = ce[s] || (ce[s] = ((l) => {
2804
- let d = 0, f = 11;
2805
- for (; d < l.length; )
2806
- f = 101 * f + l.charCodeAt(d++) >>> 0;
2807
- return "go" + f;
2808
- })(s));
2809
- if (!ce[a]) {
2810
- let l = s !== e ? e : ((d) => {
2811
- let f, c, h = [{}];
2812
- for (; f = Nn.exec(d.replace(Xn, "")); )
2813
- f[4] ? h.shift() : f[3] ? (c = f[3].replace(Jt, " ").trim(), h.unshift(h[0][c] = h[0][c] || {})) : h[0][f[1]] = f[2].replace(Jt, " ").trim();
2814
- return h[0];
2815
- })(e);
2816
- ce[a] = fe(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
2817
- }
2818
- let u = r && ce.g ? ce.g : null;
2819
- return r && (ce.g = ce[a]), ((l, d, f, c) => {
2820
- c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = f ? l + d.data : d.data + l);
2821
- })(ce[a], t, n, u), a;
2822
- }, Wn = (e, t, r) => e.reduce((n, o, s) => {
2823
- let a = t[s];
2824
- if (a && a.call) {
2825
- let u = a(r), l = u && u.props && u.props.className || /^go/.test(u) && u;
2826
- a = l ? "." + l : u && typeof u == "object" ? u.props ? "" : fe(u, "") : u === !1 ? "" : u;
2827
- }
2828
- return n + o + (a ?? "");
2829
- }, "");
2830
- function K(e) {
2831
- let t = this || {}, r = e.call ? e(t.p) : e;
2832
- return Un(r.unshift ? r.raw ? Wn(r, [].slice.call(arguments, 1), t.p) : r.reduce((n, o) => Object.assign(n, o && o.call ? o(t.p) : o), {}) : r, Bn(t.target), t.g, t.o, t.k);
2833
- }
2834
- K.bind({ g: 1 });
2835
- K.bind({ k: 1 });
2836
- function Vn(e, t, r, n) {
2837
- fe.p = t;
2838
- }
2839
- var Fn = function e(t, r) {
2840
- if (t === r)
2841
- return !0;
2842
- if (t && r && typeof t == "object" && typeof r == "object") {
2843
- if (t.constructor !== r.constructor)
2844
- return !1;
2845
- var n, o, s;
2846
- if (Array.isArray(t)) {
2847
- if (n = t.length, n != r.length)
2848
- return !1;
2849
- for (o = n; o-- !== 0; )
2850
- if (!e(t[o], r[o]))
2851
- return !1;
2852
- return !0;
2853
- }
2854
- if (t.constructor === RegExp)
2855
- return t.source === r.source && t.flags === r.flags;
2856
- if (t.valueOf !== Object.prototype.valueOf)
2857
- return t.valueOf() === r.valueOf();
2858
- if (t.toString !== Object.prototype.toString)
2859
- return t.toString() === r.toString();
2860
- if (s = Object.keys(t), n = s.length, n !== Object.keys(r).length)
2861
- return !1;
2862
- for (o = n; o-- !== 0; )
2863
- if (!Object.prototype.hasOwnProperty.call(r, s[o]))
2864
- return !1;
2865
- for (o = n; o-- !== 0; ) {
2866
- var a = s[o];
2867
- if (!e(t[a], r[a]))
2868
- return !1;
2869
- }
2870
- return !0;
2871
- }
2872
- return t !== t && r !== r;
2873
- };
2874
- const Kn = K`
2886
+ }, children: /* @__PURE__ */ k("div", { ...t }) });
2887
+ }, Kn = K`
2875
2888
  display: inline-block;
2876
2889
  transition: transform 150ms;
2877
2890
  user-select: none;
@@ -2933,7 +2946,7 @@ const Kn = K`
2933
2946
  })}`,
2934
2947
  children: [
2935
2948
  "Sorry, this item seems broken.",
2936
- /* @__PURE__ */ T("button", { onClick: e, children: "Reload it" })
2949
+ /* @__PURE__ */ k("button", { onClick: e, children: "Reload it" })
2937
2950
  ]
2938
2951
  }
2939
2952
  );
@@ -2956,7 +2969,7 @@ class oo extends g.Component {
2956
2969
  }
2957
2970
  render() {
2958
2971
  const { ErrorComponent: t } = this.props;
2959
- return this.state.hasError ? /* @__PURE__ */ T(t, { onReload: this.onReload }) : this.props.children;
2972
+ return this.state.hasError ? /* @__PURE__ */ k(t, { onReload: this.onReload }) : this.props.children;
2960
2973
  }
2961
2974
  }
2962
2975
  const so = (e) => {
@@ -2998,88 +3011,89 @@ const so = (e) => {
2998
3011
  itemMap: d,
2999
3012
  showResizeHandle: f = !0
3000
3013
  }) => {
3001
- var m;
3002
- const c = g.useRef(null), {
3003
- component: h = () => null,
3004
- resizeDirections: _ = ao,
3005
- resize: v = io
3006
- } = d[t], E = g.useCallback(
3007
- (S, O = !1) => e(n, S, O),
3014
+ var w;
3015
+ const c = g.useRef(null), [h] = Z((R) => [R.config.uid]), {
3016
+ component: S = () => null,
3017
+ resizeDirections: v = ao,
3018
+ resize: E = io
3019
+ } = d[t], O = g.useCallback(
3020
+ (R, T = !1) => e(n, R, T),
3008
3021
  [e, n]
3009
3022
  );
3010
3023
  g.useEffect(() => {
3011
3024
  c.current.className = u;
3012
3025
  }, [u]);
3013
- const I = ["item", n, Kn];
3014
- o && I.push("locked"), l && (I.push("selected"), I.push(Hn));
3015
- const y = I.join(" "), C = ({ width: S = 0, height: O = 0, keepRatio: k }) => {
3016
- E((j) => {
3017
- const { offsetWidth: M, offsetHeight: A } = c.current;
3018
- return v({
3019
- prevState: j,
3020
- width: S,
3021
- height: O,
3022
- actualHeight: A,
3023
- actualWidth: M,
3024
- keepRatio: k
3026
+ const y = ["item", n, Kn];
3027
+ o && y.push("locked"), l && (y.push("selected"), y.push(Hn));
3028
+ const C = y.join(" "), x = ({ width: R = 0, height: T = 0, keepRatio: j }) => {
3029
+ O((M) => {
3030
+ const { offsetWidth: A, offsetHeight: B } = c.current;
3031
+ return E({
3032
+ prevState: M,
3033
+ width: R,
3034
+ height: T,
3035
+ actualHeight: B,
3036
+ actualWidth: A,
3037
+ keepRatio: j
3025
3038
  });
3026
3039
  });
3027
- }, x = ({ width: S }) => {
3028
- C({ width: S });
3029
- }, p = ({ height: S }) => {
3030
- C({ height: S });
3031
- }, w = ({ width: S }) => {
3032
- C({ height: S, width: S, keepRatio: !0 });
3040
+ }, p = ({ width: R }) => {
3041
+ x({ width: R });
3042
+ }, _ = ({ height: R }) => {
3043
+ x({ height: R });
3044
+ }, m = ({ width: R }) => {
3045
+ x({ height: R, width: R, keepRatio: !0 });
3033
3046
  };
3034
- return /* @__PURE__ */ T(
3047
+ return /* @__PURE__ */ k(
3035
3048
  "div",
3036
3049
  {
3037
3050
  style: { transform: `rotate(${r}deg` },
3038
3051
  "data-id": n,
3039
- className: y,
3052
+ id: `${h}__${n}`,
3053
+ className: C,
3040
3054
  children: /* @__PURE__ */ le(
3041
3055
  "div",
3042
3056
  {
3043
3057
  style: { display: "flex" },
3044
3058
  ref: c,
3045
3059
  onAnimationEnd: so,
3046
- onKeyDown: (S) => S.stopPropagation(),
3047
- onKeyUp: (S) => S.stopPropagation(),
3060
+ onKeyDown: (R) => R.stopPropagation(),
3061
+ onKeyUp: (R) => R.stopPropagation(),
3048
3062
  children: [
3049
- /* @__PURE__ */ T(
3063
+ /* @__PURE__ */ k(
3050
3064
  oo,
3051
3065
  {
3052
3066
  itemId: n,
3053
3067
  state: a,
3054
- ErrorComponent: ((m = d == null ? void 0 : d.error) == null ? void 0 : m.component) || no,
3055
- children: /* @__PURE__ */ T(h, { ...a, id: n, setState: E })
3068
+ ErrorComponent: ((w = d == null ? void 0 : d.error) == null ? void 0 : w.component) || no,
3069
+ children: /* @__PURE__ */ k(S, { ...a, id: n, setState: O })
3056
3070
  }
3057
3071
  ),
3058
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${qn}` }),
3059
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${Gn}` }),
3060
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${Zn}` }),
3061
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${Jn}` }),
3062
- /* @__PURE__ */ T("div", { className: `center ${Ce} ${Qn}` }),
3072
+ /* @__PURE__ */ k("div", { className: `corner ${Ce} ${qn}` }),
3073
+ /* @__PURE__ */ k("div", { className: `corner ${Ce} ${Gn}` }),
3074
+ /* @__PURE__ */ k("div", { className: `corner ${Ce} ${Zn}` }),
3075
+ /* @__PURE__ */ k("div", { className: `corner ${Ce} ${Jn}` }),
3076
+ /* @__PURE__ */ k("div", { className: `center ${Ce} ${Qn}` }),
3063
3077
  f && /* @__PURE__ */ le(Wr, { children: [
3064
- _.b && /* @__PURE__ */ T(
3078
+ v.b && /* @__PURE__ */ k(
3065
3079
  ot,
3066
3080
  {
3067
3081
  className: `${st} ${ro}`,
3068
- onResize: w
3082
+ onResize: m
3069
3083
  }
3070
3084
  ),
3071
- _.h && /* @__PURE__ */ T(
3085
+ v.h && /* @__PURE__ */ k(
3072
3086
  ot,
3073
3087
  {
3074
3088
  className: `${st} ${to}`,
3075
- onResize: p
3089
+ onResize: _
3076
3090
  }
3077
3091
  ),
3078
- _.w && /* @__PURE__ */ T(
3092
+ v.w && /* @__PURE__ */ k(
3079
3093
  ot,
3080
3094
  {
3081
3095
  className: `${st} ${eo}`,
3082
- onResize: x
3096
+ onResize: p
3083
3097
  }
3084
3098
  )
3085
3099
  ] })
@@ -3100,7 +3114,7 @@ const so = (e) => {
3100
3114
  setState: s,
3101
3115
  isSelected: a,
3102
3116
  showResizeHandle: u
3103
- }) => r === a && n === u && t === s && Fn(e, o)
3117
+ }) => r === a && n === u && t === s && Bn(e, o)
3104
3118
  ), lo = (e) => e, fo = ({ state: e = {}, getCurrentUser: t, className: r, ...n }) => {
3105
3119
  if (!n.itemMap[e.type])
3106
3120
  return null;
@@ -3111,7 +3125,7 @@ const so = (e) => {
3111
3125
  moving: l,
3112
3126
  ...d
3113
3127
  } = o(e, { getCurrentUser: t }), f = (u + 4) * 10 + 100 + (l ? 5 : 0);
3114
- return /* @__PURE__ */ T(
3128
+ return /* @__PURE__ */ k(
3115
3129
  "div",
3116
3130
  {
3117
3131
  className: r,
@@ -3119,7 +3133,7 @@ const so = (e) => {
3119
3133
  transform: `translate(${s}px, ${a}px)`,
3120
3134
  zIndex: f
3121
3135
  },
3122
- children: /* @__PURE__ */ T(
3136
+ children: /* @__PURE__ */ k(
3123
3137
  uo,
3124
3138
  {
3125
3139
  ...n,
@@ -3133,7 +3147,7 @@ const so = (e) => {
3133
3147
  const { updateItem: e } = gt(), [t, r] = oe((d) => [
3134
3148
  d.itemIds,
3135
3149
  d.items
3136
- ]), [n, o, s, a] = Q(
3150
+ ]), [n, o, s, a] = Z(
3137
3151
  (d) => [
3138
3152
  d.config.boardSize,
3139
3153
  d.config.showResizeHandle,
@@ -3147,7 +3161,7 @@ const so = (e) => {
3147
3161
  display: "inline-block",
3148
3162
  lineHeight: 0
3149
3163
  });
3150
- return t.map((d) => /* @__PURE__ */ T(
3164
+ return t.map((d) => /* @__PURE__ */ k(
3151
3165
  po,
3152
3166
  {
3153
3167
  state: r[d],
@@ -3219,7 +3233,7 @@ const So = K({
3219
3233
  s,
3220
3234
  a,
3221
3235
  u
3222
- ] = Q((m) => [
3236
+ ] = Z((m) => [
3223
3237
  m.getSelection,
3224
3238
  m.clear,
3225
3239
  m.setSelection,
@@ -3227,7 +3241,7 @@ const So = K({
3227
3241
  m.getConfiguration,
3228
3242
  m.getBoardState,
3229
3243
  m.updateBoardState
3230
- ]), { findElementUnderPointer: l } = gt(), [d] = oe((m) => [m.getItems]), [f, c] = g.useState({}), [, h] = g.useTransition(), [_, v] = g.useState(!1), E = g.useRef(null), I = g.useRef({
3244
+ ]), { findElementUnderPointer: l } = gt(), [d] = oe((m) => [m.getItems]), [f, c] = g.useState({}), [, h] = g.useTransition(), [S, v] = g.useState(!1), E = g.useRef(null), O = g.useRef({
3231
3245
  moving: !1
3232
3246
  });
3233
3247
  return ue(document, "keydown", (m) => {
@@ -3237,34 +3251,34 @@ const So = K({
3237
3251
  }), g.useEffect(() => (n(), () => {
3238
3252
  n();
3239
3253
  }), [n]), g.useEffect(() => {
3240
- if (I.current.moving) {
3241
- const m = d(), { boardWrapper: S } = a(), O = _o(m, S, _);
3254
+ if (O.current.moving) {
3255
+ const m = d(), { boardWrapper: w } = a(), R = _o(m, w, S);
3242
3256
  h(() => {
3243
- o(O);
3257
+ o(R);
3244
3258
  });
3245
3259
  }
3246
- }, [a, d, f, o, _]), /* @__PURE__ */ T(
3260
+ }, [a, d, f, o, S]), /* @__PURE__ */ k(
3247
3261
  Fe,
3248
3262
  {
3249
3263
  onDragStart: async (m) => {
3250
- await l(m) || (I.current.moving = !0, h(() => {
3264
+ await l(m) || (O.current.moving = !0, h(() => {
3251
3265
  u({ selecting: !0 });
3252
3266
  }), E.current.style.cursor = "crosshair");
3253
3267
  },
3254
- onDrag: ({ distanceY: m, distanceX: S, startX: O, startY: k }) => {
3255
- if (I.current.moving) {
3256
- const { top: j, left: M } = E.current.getBoundingClientRect(), A = O - M, N = k - j;
3257
- S > 0 ? (I.current.left = A, I.current.width = S) : (I.current.left = A + S, I.current.width = -S), m > 0 ? (I.current.top = N, I.current.height = m) : (I.current.top = N + m, I.current.height = -m), c({ ...I.current, moving: !0 });
3268
+ onDrag: ({ distanceY: m, distanceX: w, startX: R, startY: T }) => {
3269
+ if (O.current.moving) {
3270
+ const { top: j, left: M } = E.current.getBoundingClientRect(), A = R - M, B = T - j;
3271
+ w > 0 ? (O.current.left = A, O.current.width = w) : (O.current.left = A + w, O.current.width = -w), m > 0 ? (O.current.top = B, O.current.height = m) : (O.current.top = B + m, O.current.height = -m), c({ ...O.current, moving: !0 });
3258
3272
  }
3259
3273
  },
3260
3274
  onDragEnd: () => {
3261
- I.current.moving && (h(() => {
3275
+ O.current.moving && (h(() => {
3262
3276
  u({ selecting: !1 });
3263
- }), I.current.moving = !1, c({ moving: !1 }), E.current.style.cursor = "auto");
3277
+ }), O.current.moving = !1, c({ moving: !1 }), E.current.style.cursor = "auto");
3264
3278
  },
3265
3279
  onTap: (m) => {
3266
- const { target: S, ctrlKey: O, metaKey: k } = m, j = l(m);
3267
- if (!j && Oe(S, "board"))
3280
+ const { target: w, ctrlKey: R, metaKey: T } = m, j = l(m);
3281
+ if (!j && Oe(w, "board"))
3268
3282
  n();
3269
3283
  else {
3270
3284
  const M = Te(j);
@@ -3273,19 +3287,19 @@ const So = K({
3273
3287
  return;
3274
3288
  }
3275
3289
  const A = r();
3276
- j && !A.includes(M) && (O || k ? s([M]) : o([M]));
3290
+ j && !A.includes(M) && (R || T ? s([M]) : o([M]));
3277
3291
  }
3278
3292
  },
3279
3293
  onLongTap: ({ target: m }) => {
3280
- const S = Oe(m, "item");
3281
- if (S) {
3282
- const O = Te(S);
3283
- o([O]);
3294
+ const w = Oe(m, "item");
3295
+ if (w) {
3296
+ const R = Te(w);
3297
+ o([R]);
3284
3298
  }
3285
3299
  },
3286
3300
  mainAction: t ? "pan" : "drag",
3287
3301
  children: /* @__PURE__ */ le("div", { ref: E, children: [
3288
- f.moving && /* @__PURE__ */ T(
3302
+ f.moving && /* @__PURE__ */ k(
3289
3303
  "div",
3290
3304
  {
3291
3305
  style: {
@@ -3301,7 +3315,7 @@ const So = K({
3301
3315
  }
3302
3316
  );
3303
3317
  }, Eo = ({ children: e }) => {
3304
- const { moveItems: t, placeItems: r, findElementUnderPointer: n } = gt(), { vectorFromWrapperToBoard: o } = Me(), [s, a, u, l, d] = Q((y) => [
3318
+ const { moveItems: t, placeItems: r, findElementUnderPointer: n } = gt(), { vectorFromWrapperToBoard: o } = Me(), [s, a, u, l, d] = Z((y) => [
3305
3319
  y.select,
3306
3320
  y.setSelection,
3307
3321
  y.getSelection,
@@ -3309,25 +3323,25 @@ const So = K({
3309
3323
  y.updateBoardState
3310
3324
  ]), [f] = oe((y) => [y.getBoardConfig]), c = g.useRef({}), h = g.useRef({
3311
3325
  items: []
3312
- }), _ = (y) => {
3313
- const { ctrlKey: C, metaKey: x, event: p } = y, w = n(y);
3314
- if (w) {
3326
+ }), S = (y) => {
3327
+ const { ctrlKey: C, metaKey: x, event: p } = y, _ = n(y);
3328
+ if (_) {
3315
3329
  p.stopPropagation();
3316
3330
  const m = u();
3317
3331
  h.current.items = m;
3318
- const S = Te(w);
3319
- m.includes(S) || (C || x ? (h.current.items = [...m, S], s([S])) : (h.current.items = [S], a([S]))), Object.assign(c.current, {
3332
+ const w = Te(_);
3333
+ m.includes(w) || (C || x ? (h.current.items = [...m, w], s([w])) : (h.current.items = [w], a([w]))), Object.assign(c.current, {
3320
3334
  moving: !0
3321
3335
  });
3322
3336
  }
3323
3337
  }, v = ({ deltaX: y, deltaY: C, event: x }) => {
3324
3338
  if (c.current.moving) {
3325
3339
  x.stopPropagation();
3326
- const { movingItems: p } = l(), [w, m] = o(y, C);
3340
+ const { movingItems: p } = l(), [_, m] = o(y, C);
3327
3341
  t(
3328
3342
  h.current.items,
3329
3343
  {
3330
- x: w,
3344
+ x: _,
3331
3345
  y: m
3332
3346
  },
3333
3347
  !0
@@ -3348,7 +3362,7 @@ const So = K({
3348
3362
  const C = u();
3349
3363
  if (C.length) {
3350
3364
  const { gridSize: x = 1 } = f();
3351
- let p = 0, w = 0;
3365
+ let p = 0, _ = 0;
3352
3366
  switch (y.key) {
3353
3367
  case "ArrowLeft":
3354
3368
  p = -10;
@@ -3357,20 +3371,20 @@ const So = K({
3357
3371
  p = 10;
3358
3372
  break;
3359
3373
  case "ArrowUp":
3360
- w = -10;
3374
+ _ = -10;
3361
3375
  break;
3362
3376
  case "ArrowDown":
3363
- w = 10;
3377
+ _ = 10;
3364
3378
  break;
3365
3379
  }
3366
- if (p || w) {
3367
- y.shiftKey && (p *= 5, w *= 5), (y.ctrlKey || y.altKey || y.metaKey) && (p /= 10, w /= 10);
3368
- const [m, S] = o(p, w);
3380
+ if (p || _) {
3381
+ y.shiftKey && (p *= 5, _ *= 5), (y.ctrlKey || y.altKey || y.metaKey) && (p /= 10, _ /= 10);
3382
+ const [m, w] = o(p, _);
3369
3383
  t(
3370
3384
  C,
3371
3385
  {
3372
3386
  x: m,
3373
- y: S
3387
+ y: w
3374
3388
  },
3375
3389
  !0
3376
3390
  ), r(C, {
@@ -3379,7 +3393,7 @@ const So = K({
3379
3393
  }), y.preventDefault();
3380
3394
  }
3381
3395
  }
3382
- }), /* @__PURE__ */ T(Fe, { onDragStart: _, onDrag: v, onDragEnd: E, children: e });
3396
+ }), /* @__PURE__ */ k(Fe, { onDragStart: S, onDrag: v, onDragEnd: E, children: e });
3383
3397
  }, wo = (e) => {
3384
3398
  const t = g.useRef({ hover: !1, x: 0, y: 0 });
3385
3399
  return ue(e.current, "mousemove", (n) => {
@@ -3391,7 +3405,7 @@ const So = K({
3391
3405
  t.current.hover = !1;
3392
3406
  }), g.useCallback(() => t.current, []);
3393
3407
  }, Co = [...Array(5).keys()].map((e) => `Digit${e + 1}`), xo = () => {
3394
- const [e, t] = g.useState({}), [r, n] = Q((o) => [
3408
+ const [e, t] = g.useState({}), [r, n] = Z((o) => [
3395
3409
  o.getBoardState,
3396
3410
  o.updateBoardState
3397
3411
  ]);
@@ -3411,7 +3425,7 @@ const So = K({
3411
3425
  s,
3412
3426
  a,
3413
3427
  u
3414
- ] = Q((p) => [
3428
+ ] = Z((p) => [
3415
3429
  {
3416
3430
  translateX: p.boardState.translateX,
3417
3431
  translateY: p.boardState.translateY,
@@ -3422,7 +3436,7 @@ const So = K({
3422
3436
  p.getConfiguration,
3423
3437
  p.updateBoardState,
3424
3438
  p.getSelection
3425
- ]), { zoomToCenter: l, zoomToExtent: d, moveBoard: f } = Me(), [c, h] = g.useState(!1), _ = g.useRef({}), v = wo(r);
3439
+ ]), { zoomToCenter: l, zoomToExtent: d, moveBoard: f } = Me(), [c, h] = g.useState(!1), S = g.useRef({}), v = wo(r);
3426
3440
  xo();
3427
3441
  const E = g.useCallback(() => {
3428
3442
  const { itemExtent: p } = s();
@@ -3431,27 +3445,27 @@ const So = K({
3431
3445
  g.useEffect(() => {
3432
3446
  !c && o.radius && (E(), h(!0));
3433
3447
  }, [E, c, o]);
3434
- const I = ({ clientX: p, clientY: w, scale: m }) => {
3435
- l({ to: { x: p, y: w }, factor: 1 - m / 500 }), clearTimeout(_.current.zoom), _.current.zoom = setTimeout(() => {
3448
+ const O = ({ clientX: p, clientY: _, scale: m }) => {
3449
+ l({ to: { x: p, y: _ }, factor: 1 - m / 500 }), clearTimeout(S.current.zoom), S.current.zoom = setTimeout(() => {
3436
3450
  a({ zooming: !1 });
3437
3451
  }, 200), a({ zooming: !0 });
3438
- }, y = ({ deltaX: p, deltaY: w }) => {
3439
- f(({ translateX: m, translateY: S }) => ({
3452
+ }, y = ({ deltaX: p, deltaY: _ }) => {
3453
+ f(({ translateX: m, translateY: w }) => ({
3440
3454
  translateX: m + p,
3441
- translateY: S + w
3442
- })), clearTimeout(_.current.pan), _.current.pan = setTimeout(() => {
3455
+ translateY: w + _
3456
+ })), clearTimeout(S.current.pan), S.current.pan = setTimeout(() => {
3443
3457
  a({ panning: !1 });
3444
3458
  }, 200), a({ panning: !0 });
3445
3459
  }, C = (p) => {
3446
3460
  if (["INPUT", "TEXTAREA"].includes(p.target.tagName))
3447
3461
  return;
3448
- let w = 0, m = 0, S = 1;
3462
+ let _ = 0, m = 0, w = 1;
3449
3463
  switch (p.key) {
3450
3464
  case "ArrowLeft":
3451
- w = -10;
3465
+ _ = -10;
3452
3466
  break;
3453
3467
  case "ArrowRight":
3454
- w = 10;
3468
+ _ = 10;
3455
3469
  break;
3456
3470
  case "ArrowUp":
3457
3471
  m = -10;
@@ -3460,32 +3474,32 @@ const So = K({
3460
3474
  m = 10;
3461
3475
  break;
3462
3476
  case "PageUp":
3463
- S = 1.2;
3477
+ w = 1.2;
3464
3478
  break;
3465
3479
  case "PageDown":
3466
- S = 0.8;
3480
+ w = 0.8;
3467
3481
  break;
3468
3482
  }
3469
- if (w || m || S !== 1) {
3470
- const O = u();
3471
- if (S === 1 && O.length)
3483
+ if (_ || m || w !== 1) {
3484
+ const R = u();
3485
+ if (w === 1 && R.length)
3472
3486
  return;
3473
- p.shiftKey && (w *= 5, m *= 5), (p.ctrlKey || p.altKey || p.metaKey) && (w /= 5, m /= 5), f(({ translateX: k, translateY: j }) => ({
3474
- translateX: k + w,
3487
+ p.shiftKey && (_ *= 5, m *= 5), (p.ctrlKey || p.altKey || p.metaKey) && (_ /= 5, m /= 5), f(({ translateX: T, translateY: j }) => ({
3488
+ translateX: T + _,
3475
3489
  translateY: j + m
3476
- })), l({ factor: S }), p.preventDefault();
3490
+ })), l({ factor: w }), p.preventDefault();
3477
3491
  }
3478
3492
  p.key === " " && !p.repeat && v().hover && l({ factor: 3, to: v() });
3479
3493
  }, x = (p) => {
3480
3494
  ["INPUT", "TEXTAREA"].includes(p.target.tagName) || p.key === " " && v().hover && l({ factor: 1 / 3, to: v() });
3481
3495
  };
3482
- return ue(document, "keydown", C), ue(document, "keyup", x), /* @__PURE__ */ T(
3496
+ return ue(document, "keydown", C), ue(document, "keyup", x), /* @__PURE__ */ k(
3483
3497
  Fe,
3484
3498
  {
3485
3499
  onPan: y,
3486
- onZoom: I,
3500
+ onZoom: O,
3487
3501
  mainAction: t ? "pan" : "drag",
3488
- children: /* @__PURE__ */ T(
3502
+ children: /* @__PURE__ */ k(
3489
3503
  "div",
3490
3504
  {
3491
3505
  style: {
@@ -3516,7 +3530,7 @@ const So = K({
3516
3530
  n,
3517
3531
  o,
3518
3532
  { translateX: s, translateY: a, scale: u }
3519
- ] = Q((c) => [
3533
+ ] = Z((c) => [
3520
3534
  c.selection,
3521
3535
  c.getSelection,
3522
3536
  c.selectionBox,
@@ -3528,19 +3542,19 @@ const So = K({
3528
3542
  scale: c.boardState.scale
3529
3543
  }
3530
3544
  ]), [l] = oe((c) => [c.items]), d = g.useCallback(() => {
3531
- const c = t(), { boardWrapperRect: h, boardWrapper: _ } = o();
3545
+ const c = t(), { boardWrapperRect: h, uid: S } = o();
3532
3546
  if (c.length === 0) {
3533
3547
  n(null);
3534
3548
  return;
3535
3549
  }
3536
- const v = sn(c, _);
3550
+ const v = sn(c, S);
3537
3551
  if (!v) {
3538
3552
  n(null);
3539
3553
  return;
3540
3554
  }
3541
- const { left: E, top: I, width: y, height: C } = v, x = {
3555
+ const { left: E, top: O, width: y, height: C } = v, x = {
3542
3556
  left: E - h.left,
3543
- top: I - h.top,
3557
+ top: O - h.top,
3544
3558
  height: C,
3545
3559
  width: y
3546
3560
  };
@@ -3556,7 +3570,7 @@ const So = K({
3556
3570
  u,
3557
3571
  d,
3558
3572
  f
3559
- ]), !r || e.length < 2 ? null : /* @__PURE__ */ T(
3573
+ ]), !r || e.length < 2 ? null : /* @__PURE__ */ k(
3560
3574
  "div",
3561
3575
  {
3562
3576
  style: {
@@ -3568,8 +3582,8 @@ const So = K({
3568
3582
  }
3569
3583
  );
3570
3584
  }, To = () => {
3571
- const [e] = Q((t) => [t.boardState.movingItems]);
3572
- return e ? null : /* @__PURE__ */ T(Oo, {});
3585
+ const [e] = Z((t) => [t.boardState.movingItems]);
3586
+ return e ? null : /* @__PURE__ */ k(Oo, {});
3573
3587
  }, ko = typeof window < "u" && typeof navigator < "u" && typeof document < "u";
3574
3588
  let Le;
3575
3589
  function Po() {
@@ -3625,7 +3639,7 @@ function Do(e) {
3625
3639
  if (e.trim().toLowerCase() === "transparent")
3626
3640
  return [0, 0, 0, 0];
3627
3641
  let t = e.trim();
3628
- t = Xo.test(e) ? Lo(e) : e;
3642
+ t = No.test(e) ? Lo(e) : e;
3629
3643
  const r = zo.exec(t);
3630
3644
  if (r) {
3631
3645
  const a = Array.from(r).slice(1);
@@ -3641,7 +3655,7 @@ function Do(e) {
3641
3655
  const a = Array.from(o).slice(1);
3642
3656
  return [...a.slice(0, 3).map((u) => parseInt(u, 10)), parseFloat(a[3] || "1")];
3643
3657
  }
3644
- const s = No.exec(t);
3658
+ const s = Xo.exec(t);
3645
3659
  if (s) {
3646
3660
  const [a, u, l, d] = Array.from(s).slice(1).map(parseFloat);
3647
3661
  if (Zt(0, 100, u) !== u)
@@ -3671,15 +3685,15 @@ function Lo(e) {
3671
3685
  throw new xe(e);
3672
3686
  return `#${r}`;
3673
3687
  }
3674
- const ke = (e, t) => Array.from(Array(t)).map(() => e).join(""), zo = new RegExp(`^#${ke("([a-f0-9])", 3)}([a-f0-9])?$`, "i"), Yo = new RegExp(`^#${ke("([a-f0-9]{2})", 3)}([a-f0-9]{2})?$`, "i"), Bo = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${ke(",\\s*(\\d+)\\s*", 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, "i"), No = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i, Xo = /^[a-z]+$/i, er = (e) => Math.round(e * 255), Uo = (e, t, r) => {
3688
+ const ke = (e, t) => Array.from(Array(t)).map(() => e).join(""), zo = new RegExp(`^#${ke("([a-f0-9])", 3)}([a-f0-9])?$`, "i"), Yo = new RegExp(`^#${ke("([a-f0-9]{2})", 3)}([a-f0-9]{2})?$`, "i"), Bo = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${ke(",\\s*(\\d+)\\s*", 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, "i"), Xo = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i, No = /^[a-z]+$/i, er = (e) => Math.round(e * 255), Uo = (e, t, r) => {
3675
3689
  let n = r / 100;
3676
3690
  if (t === 0)
3677
3691
  return [n, n, n].map(er);
3678
3692
  const o = (e % 360 + 360) % 360 / 60, s = (1 - Math.abs(2 * n - 1)) * (t / 100), a = s * (1 - Math.abs(o % 2 - 1));
3679
3693
  let u = 0, l = 0, d = 0;
3680
3694
  o >= 0 && o < 1 ? (u = s, l = a) : o >= 1 && o < 2 ? (u = a, l = s) : o >= 2 && o < 3 ? (l = s, d = a) : o >= 3 && o < 4 ? (l = a, d = s) : o >= 4 && o < 5 ? (u = a, d = s) : o >= 5 && o < 6 && (u = s, d = a);
3681
- const f = n - s / 2, c = u + f, h = l + f, _ = d + f;
3682
- return [c, h, _].map(er);
3695
+ const f = n - s / 2, c = u + f, h = l + f, S = d + f;
3696
+ return [c, h, S].map(er);
3683
3697
  };
3684
3698
  function Wo(e) {
3685
3699
  if (e === "transparent")
@@ -3723,7 +3737,7 @@ const Fo = K({
3723
3737
  width: t,
3724
3738
  height: t,
3725
3739
  children: [
3726
- /* @__PURE__ */ T(
3740
+ /* @__PURE__ */ k(
3727
3741
  "path",
3728
3742
  {
3729
3743
  d: "m 1197.1015,869.718 -62.2719,-154.49286 133.3276,-9.05842 -257.6915,-253.12748 1.2392,356.98609 88.2465,-79.47087 61.702,152.78366 z",
@@ -3732,7 +3746,7 @@ const Fo = K({
3732
3746
  }
3733
3747
  }
3734
3748
  ),
3735
- /* @__PURE__ */ T(
3749
+ /* @__PURE__ */ k(
3736
3750
  "path",
3737
3751
  {
3738
3752
  d: "m 1193.0939,861.12419 -62.2719,-154.49286 133.3276,-9.05842 -257.6915,-253.12748 1.2392,356.98609 88.2465,-79.47087 61.702,152.78366 z",
@@ -3746,7 +3760,7 @@ const Fo = K({
3746
3760
  ]
3747
3761
  }
3748
3762
  ),
3749
- /* @__PURE__ */ T(
3763
+ /* @__PURE__ */ k(
3750
3764
  "div",
3751
3765
  {
3752
3766
  style: {
@@ -3764,17 +3778,17 @@ const Fo = K({
3764
3778
  zIndex: 210,
3765
3779
  position: "fixed",
3766
3780
  pointerEvents: "none"
3767
- }), Jo = ({ pos: e, ...t }) => /* @__PURE__ */ T(
3781
+ }), Jo = ({ pos: e, ...t }) => /* @__PURE__ */ k(
3768
3782
  "div",
3769
3783
  {
3770
3784
  className: Go,
3771
3785
  style: {
3772
3786
  transform: `translate(${e.x - 6}px, ${e.y - 15}px)`
3773
3787
  },
3774
- children: /* @__PURE__ */ T(qo, { ...t })
3788
+ children: /* @__PURE__ */ k(qo, { ...t })
3775
3789
  }
3776
3790
  ), Zo = ({ children: e }) => {
3777
- const [t] = Q((v) => [
3791
+ const [t] = Z((v) => [
3778
3792
  v.getConfiguration,
3779
3793
  v.boardState.scale
3780
3794
  // We want to update this component when the scale changes
@@ -3789,22 +3803,22 @@ const Fo = K({
3789
3803
  v.moveCursor,
3790
3804
  v.removeCursor
3791
3805
  ]), { boardWrapperRect: f } = t(), c = ({ clientX: v, clientY: E }) => {
3792
- const [I, y] = r(
3806
+ const [O, y] = r(
3793
3807
  v - f.left,
3794
3808
  E - f.top
3795
3809
  );
3796
- l(o.id, { x: I, y });
3810
+ l(o.id, { x: O, y });
3797
3811
  }, h = () => {
3798
3812
  d(o.id);
3799
- }, _ = s.reduce((v, E) => (E.id !== o.id && a[E.id] && (v[E.id] = a[E.id]), v), {});
3813
+ }, S = s.reduce((v, E) => (E.id !== o.id && a[E.id] && (v[E.id] = a[E.id]), v), {});
3800
3814
  return /* @__PURE__ */ le("div", { onPointerMove: c, onPointerLeave: h, children: [
3801
3815
  e,
3802
- Object.entries(_).map(([v, E]) => {
3803
- const [I, y] = n(E.x, E.y), C = {
3804
- x: I + f.left,
3816
+ Object.entries(S).map(([v, E]) => {
3817
+ const [O, y] = n(E.x, E.y), C = {
3818
+ x: O + f.left,
3805
3819
  y: y + f.top
3806
3820
  };
3807
- return ft(C, f) ? /* @__PURE__ */ T(
3821
+ return ft(C, f) ? /* @__PURE__ */ k(
3808
3822
  Jo,
3809
3823
  {
3810
3824
  pos: C,
@@ -3819,7 +3833,7 @@ const Fo = K({
3819
3833
  overflow: "hidden",
3820
3834
  position: "absolute",
3821
3835
  inset: 0
3822
- }, gs = ({
3836
+ }, hs = ({
3823
3837
  moveFirst: e = !0,
3824
3838
  style: t,
3825
3839
  wrapperStyle: r,
@@ -3829,7 +3843,7 @@ const Fo = K({
3829
3843
  showResizeHandle: a = !1,
3830
3844
  Wrapper: u = Qo
3831
3845
  }) => {
3832
- const l = g.useRef(null), [d, f] = Q((v) => [
3846
+ const l = g.useRef(null), [d, f] = Z((v) => [
3833
3847
  v.config.uid,
3834
3848
  v.updateConfiguration
3835
3849
  ]), { updateItemExtent: c } = Me(), h = {
@@ -3869,15 +3883,15 @@ const Fo = K({
3869
3883
  boardWrapperRect: l.current.getBoundingClientRect()
3870
3884
  });
3871
3885
  });
3872
- const _ = K({ ...es, ...r });
3886
+ const S = K({ ...es, ...r });
3873
3887
  return /* @__PURE__ */ le(
3874
3888
  "div",
3875
3889
  {
3876
3890
  ref: l,
3877
3891
  id: d,
3878
- className: `sync-board ${_}`,
3892
+ className: `sync-board ${S}`,
3879
3893
  children: [
3880
- /* @__PURE__ */ T(Zo, { children: /* @__PURE__ */ T(bo, { moveFirst: e, children: /* @__PURE__ */ T(Ro, { moveFirst: e, children: /* @__PURE__ */ T(Eo, { moveFirst: e, children: /* @__PURE__ */ T(u, { children: /* @__PURE__ */ le(
3894
+ /* @__PURE__ */ k(Zo, { children: /* @__PURE__ */ k(bo, { moveFirst: e, children: /* @__PURE__ */ k(Ro, { moveFirst: e, children: /* @__PURE__ */ k(Eo, { moveFirst: e, children: /* @__PURE__ */ k(u, { children: /* @__PURE__ */ le(
3881
3895
  "div",
3882
3896
  {
3883
3897
  onContextMenu: (v) => {
@@ -3886,34 +3900,35 @@ const Fo = K({
3886
3900
  style: h,
3887
3901
  className: "board",
3888
3902
  children: [
3889
- /* @__PURE__ */ T(mo, {}),
3903
+ /* @__PURE__ */ k(mo, {}),
3890
3904
  s
3891
3905
  ]
3892
3906
  }
3893
3907
  ) }) }) }) }) }),
3894
- /* @__PURE__ */ T(To, {})
3908
+ /* @__PURE__ */ k(To, {})
3895
3909
  ]
3896
3910
  }
3897
3911
  );
3898
3912
  };
3899
- Vn(g.createElement);
3913
+ Yn(g.createElement);
3900
3914
  export {
3901
- gs as Board,
3902
- ps as BoardWrapper,
3903
- ms as RoomWrapper,
3904
- is as useAvailableActions,
3905
- us as useBoardConfig,
3915
+ hs as Board,
3916
+ ms as BoardWrapper,
3917
+ gs as RoomWrapper,
3918
+ as as useAvailableActions,
3919
+ ls as useBoardConfig,
3906
3920
  Me as useBoardPosition,
3907
- ls as useBoardState,
3921
+ fs as useBoardState,
3908
3922
  os as useDebouncedItems,
3923
+ is as useGetSelectedItems,
3909
3924
  gt as useItemActions,
3910
3925
  Vt as useItemInteraction,
3911
3926
  ns as useItems,
3912
- ds as useMessage,
3927
+ ps as useMessage,
3913
3928
  ss as useSelectedItems,
3914
- as as useSelectionBox,
3915
- fs as useSessionInfo,
3916
- cs as useUsers,
3917
- Xe as useWire
3929
+ cs as useSelectionBox,
3930
+ ds as useSessionInfo,
3931
+ us as useUsers,
3932
+ Ne as useWire
3918
3933
  };
3919
3934
  //# sourceMappingURL=react-sync-board.js.map