react-sync-board 1.2.6 → 1.2.8

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.
@@ -1,11 +1,11 @@
1
- var Lr = Object.defineProperty;
2
- var zr = (e, t, r) => t in e ? Lr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var kt = (e, t, r) => (zr(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import g, { useContext as _e, useDebugValue as Yr, useRef as Re, useMemo as lt, useEffect as Pe, useCallback as tr, memo as rr } from "react";
5
- function Br(e) {
1
+ var zr = Object.defineProperty;
2
+ var Yr = (e, t, r) => t in e ? zr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var Pt = (e, t, r) => (Yr(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import g, { useContext as _e, useDebugValue as Br, useRef as Re, useMemo as ft, useEffect as Pe, useCallback as rr, memo as nr } from "react";
5
+ function Nr(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
  },
@@ -22,21 +22,21 @@ var Ie = {}, Nr = {
22
22
  * This source code is licensed under the MIT license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  */
25
- var Pt;
26
- function Xr() {
27
- if (Pt)
25
+ var Mt;
26
+ function Ur() {
27
+ if (Mt)
28
28
  return Ee;
29
- Pt = 1;
29
+ Mt = 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
  }
@@ -50,57 +50,57 @@ var we = {};
50
50
  * This source code is licensed under the MIT license found in the
51
51
  * LICENSE file in the root directory of this source tree.
52
52
  */
53
- var Mt;
54
- function Ur() {
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) {
53
+ var Dt;
54
+ function Wr() {
55
+ return Dt || (Dt = 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"), 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];
61
61
  return typeof b == "function" ? b : null;
62
62
  }
63
63
  var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
64
- function C(i) {
64
+ function x(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), j = 1; j < b; j++)
67
+ I[j - 1] = arguments[j];
68
+ C("error", i, I);
69
69
  }
70
70
  }
71
- function x(i, b, R) {
71
+ function C(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 j = y.ReactDebugCurrentFrame, X = j.getStackAddendum();
74
+ X !== "" && (b += "%s", I = I.concat([X]));
75
+ var W = I.map(function(N) {
76
+ return String(N);
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");
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
81
+ var p = !1, _ = !1, m = !1, w = !1, R = !1, T;
82
+ T = Symbol.for("react.module.reference");
83
+ function D(i) {
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) {
91
- var D = i.displayName;
92
- if (D)
93
- return D;
90
+ function M(i, b, I) {
91
+ var j = i.displayName;
92
+ if (j)
93
+ return j;
94
94
  var X = b.displayName || b.name || "";
95
- return X !== "" ? R + "(" + X + ")" : R;
95
+ return X !== "" ? I + "(" + X + ")" : I;
96
96
  }
97
97
  function A(i) {
98
98
  return i.displayName || "Context";
99
99
  }
100
- function N(i) {
100
+ function Y(i) {
101
101
  if (i == null)
102
102
  return null;
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")
103
+ if (typeof i.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
104
104
  return i.displayName || i.name || null;
105
105
  if (typeof i == "string")
106
106
  return i;
@@ -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
- var D = i.displayName || null;
133
- return D !== null ? D : N(i.type) || "Memo";
132
+ var j = i.displayName || null;
133
+ return j !== null ? j : Y(i.type) || "Memo";
134
134
  case h: {
135
- var X = i, W = X._payload, B = X._init;
135
+ var X = i, W = X._payload, N = X._init;
136
136
  try {
137
- return N(B(W));
137
+ return Y(N(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, G = 0, P, $, B, V, L, F, H;
146
146
  function te() {
147
147
  }
148
148
  te.__reactDisabledLog = !0;
149
- function Z() {
149
+ function Q() {
150
150
  {
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;
151
+ if (G === 0) {
152
+ P = console.log, $ = console.info, B = 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,
@@ -166,12 +166,12 @@ function Ur() {
166
166
  groupEnd: i
167
167
  });
168
168
  }
169
- J++;
169
+ G++;
170
170
  }
171
171
  }
172
172
  function ne() {
173
173
  {
174
- if (J--, J === 0) {
174
+ if (G--, G === 0) {
175
175
  var i = {
176
176
  configurable: !0,
177
177
  enumerable: !0,
@@ -185,13 +185,13 @@ function Ur() {
185
185
  value: $
186
186
  }),
187
187
  warn: U({}, i, {
188
- value: z
188
+ value: B
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
@@ -201,111 +201,111 @@ function Ur() {
201
201
  })
202
202
  });
203
203
  }
204
- J < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
204
+ G < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
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
213
  } catch (X) {
214
- var D = X.stack.trim().match(/\n( *(at )?)/);
215
- me = D && D[1] || "";
214
+ var j = X.stack.trim().match(/\n( *(at )?)/);
215
+ me = j && j[1] || "";
216
216
  }
217
217
  return `
218
218
  ` + me + i;
219
219
  }
220
220
  }
221
- var Ke = !1, je;
221
+ var Ke = !1, De;
222
222
  {
223
- var mr = typeof WeakMap == "function" ? WeakMap : Map;
224
- je = new mr();
223
+ var gr = typeof WeakMap == "function" ? WeakMap : Map;
224
+ De = new gr();
225
225
  }
226
- function ht(i, b) {
226
+ function vt(i, b) {
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 = De.get(i);
231
+ if (I !== void 0)
232
+ return I;
233
233
  }
234
- var D;
234
+ var j;
235
235
  Ke = !0;
236
236
  var X = 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 N = function() {
243
243
  throw Error();
244
244
  };
245
- if (Object.defineProperty(B.prototype, "props", {
245
+ if (Object.defineProperty(N.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(N, []);
252
252
  } catch (ae) {
253
- D = ae;
253
+ j = ae;
254
254
  }
255
- Reflect.construct(i, [], B);
255
+ Reflect.construct(i, [], N);
256
256
  } else {
257
257
  try {
258
- B.call();
258
+ N.call();
259
259
  } catch (ae) {
260
- D = ae;
260
+ j = ae;
261
261
  }
262
- i.call(B.prototype);
262
+ i.call(N.prototype);
263
263
  }
264
264
  } else {
265
265
  try {
266
266
  throw Error();
267
267
  } catch (ae) {
268
- D = ae;
268
+ j = ae;
269
269
  }
270
270
  i();
271
271
  }
272
272
  } catch (ae) {
273
- if (ae && D && typeof ae.stack == "string") {
274
- for (var L = ae.stack.split(`
275
- `), ee = D.stack.split(`
276
- `), q = L.length - 1, G = ee.length - 1; q >= 1 && G >= 0 && L[q] !== ee[G]; )
277
- G--;
278
- for (; q >= 1 && G >= 0; q--, G--)
279
- if (L[q] !== ee[G]) {
280
- if (q !== 1 || G !== 1)
273
+ if (ae && j && typeof ae.stack == "string") {
274
+ for (var z = ae.stack.split(`
275
+ `), ee = j.stack.split(`
276
+ `), q = z.length - 1, J = ee.length - 1; q >= 1 && J >= 0 && z[q] !== ee[J]; )
277
+ J--;
278
+ for (; q >= 1 && J >= 0; q--, J--)
279
+ if (z[q] !== ee[J]) {
280
+ if (q !== 1 || J !== 1)
281
281
  do
282
- if (q--, G--, G < 0 || L[q] !== ee[G]) {
282
+ if (q--, J--, J < 0 || z[q] !== ee[J]) {
283
283
  var re = `
284
- ` + L[q].replace(" at new ", " at ");
285
- return i.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", i.displayName)), typeof i == "function" && je.set(i, re), re;
284
+ ` + z[q].replace(" at new ", " at ");
285
+ return i.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", i.displayName)), typeof i == "function" && De.set(i, re), re;
286
286
  }
287
- while (q >= 1 && G >= 0);
287
+ while (q >= 1 && J >= 0);
288
288
  break;
289
289
  }
290
290
  }
291
291
  } finally {
292
292
  Ke = !1, ie.current = W, ne(), Error.prepareStackTrace = X;
293
293
  }
294
- var ve = i ? i.displayName || i.name : "", Tt = ve ? ge(ve) : "";
295
- return typeof i == "function" && je.set(i, Tt), Tt;
294
+ var ve = i ? i.displayName || i.name : "", kt = ve ? ge(ve) : "";
295
+ return typeof i == "function" && De.set(i, kt), kt;
296
296
  }
297
- function gr(i, b, R) {
298
- return ht(i, !1);
297
+ function hr(i, b, I) {
298
+ return vt(i, !1);
299
299
  }
300
- function hr(i) {
300
+ function vr(i) {
301
301
  var b = i.prototype;
302
302
  return !!(b && b.isReactComponent);
303
303
  }
304
- function De(i, b, R) {
304
+ function je(i, b, I) {
305
305
  if (i == null)
306
306
  return "";
307
307
  if (typeof i == "function")
308
- return ht(i, hr(i));
308
+ return vt(i, vr(i));
309
309
  if (typeof i == "string")
310
310
  return ge(i);
311
311
  switch (i) {
@@ -317,78 +317,78 @@ function Ur() {
317
317
  if (typeof i == "object")
318
318
  switch (i.$$typeof) {
319
319
  case l:
320
- return gr(i.render);
320
+ return hr(i.render);
321
321
  case c:
322
- return De(i.type, b, R);
322
+ return je(i.type, b, I);
323
323
  case h: {
324
- var D = i, X = D._payload, W = D._init;
324
+ var j = i, X = j._payload, W = j._init;
325
325
  try {
326
- return De(W(X), b, R);
326
+ return je(W(X), b, I);
327
327
  } catch {
328
328
  }
329
329
  }
330
330
  }
331
331
  return "";
332
332
  }
333
- var $e = Object.prototype.hasOwnProperty, vt = {}, yt = y.ReactDebugCurrentFrame;
333
+ var $e = Object.prototype.hasOwnProperty, yt = {}, St = 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 = je(i.type, i._source, b ? b.type : null);
337
+ St.setExtraStackFrame(I);
338
338
  } else
339
- yt.setExtraStackFrame(null);
339
+ St.setExtraStackFrame(null);
340
340
  }
341
- function vr(i, b, R, D, X) {
341
+ function yr(i, b, I, j, X) {
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 N in i)
345
+ if (W(i, N)) {
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[N] != "function") {
349
+ var ee = Error((j || "React class") + ": " + I + " type `" + N + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[N] + "`.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[N](b, N, j, 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(X), x("%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).", j || "React class", I, N, typeof z), Ae(null)), z instanceof Error && !(z.message in yt) && (yt[z.message] = !0, Ae(X), x("Failed %s type: %s", I, z.message), Ae(null));
357
357
  }
358
358
  }
359
359
  }
360
- var yr = Array.isArray;
360
+ var Sr = Array.isArray;
361
361
  function He(i) {
362
- return yr(i);
362
+ return Sr(i);
363
363
  }
364
- function Sr(i) {
364
+ function _r(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
- function _r(i) {
370
+ function br(i) {
371
371
  try {
372
- return St(i), !1;
372
+ return _t(i), !1;
373
373
  } catch {
374
374
  return !0;
375
375
  }
376
376
  }
377
- function St(i) {
377
+ function _t(i) {
378
378
  return "" + i;
379
379
  }
380
- function _t(i) {
381
- if (_r(i))
382
- return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Sr(i)), St(i);
380
+ function bt(i) {
381
+ if (br(i))
382
+ return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", _r(i)), _t(i);
383
383
  }
384
- var be = y.ReactCurrentOwner, br = {
384
+ var be = y.ReactCurrentOwner, Er = {
385
385
  key: !0,
386
386
  ref: !0,
387
387
  __self: !0,
388
388
  __source: !0
389
- }, bt, Et, qe;
389
+ }, Et, wt, qe;
390
390
  qe = {};
391
- function Er(i) {
391
+ function wr(i) {
392
392
  if ($e.call(i, "ref")) {
393
393
  var b = Object.getOwnPropertyDescriptor(i, "ref").get;
394
394
  if (b && b.isReactWarning)
@@ -396,7 +396,7 @@ function Ur() {
396
396
  }
397
397
  return i.ref !== void 0;
398
398
  }
399
- function wr(i) {
399
+ function xr(i) {
400
400
  if ($e.call(i, "key")) {
401
401
  var b = Object.getOwnPropertyDescriptor(i, "key").get;
402
402
  if (b && b.isReactWarning)
@@ -406,86 +406,86 @@ 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 = Y(be.current.type);
410
+ qe[I] || (x('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', Y(be.current.type), i.ref), qe[I] = !0);
411
411
  }
412
412
  }
413
- function xr(i, b) {
413
+ function Rr(i, b) {
414
414
  {
415
- var R = function() {
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));
415
+ var I = function() {
416
+ Et || (Et = !0, x("%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
- function Rr(i, b) {
424
+ function Ir(i, b) {
425
425
  {
426
- var R = function() {
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));
426
+ var I = function() {
427
+ wt || (wt = !0, x("%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 Or = function(i, b, I, j, X, W, N) {
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: N,
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
- value: D
457
- }), Object.defineProperty(L, "_source", {
456
+ value: j
457
+ }), Object.defineProperty(z, "_source", {
458
458
  configurable: !1,
459
459
  enumerable: !1,
460
460
  writable: !1,
461
461
  value: X
462
- }), Object.freeze && (Object.freeze(L.props), Object.freeze(L)), L;
462
+ }), Object.freeze && (Object.freeze(z.props), Object.freeze(z)), z;
463
463
  };
464
- function Or(i, b, R, D, X) {
464
+ function Tr(i, b, I, j, X) {
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, N = {}, z = null, ee = null;
467
+ I !== void 0 && (bt(I), z = "" + I), xr(b) && (bt(b.key), z = "" + b.key), wr(b) && (ee = b.ref, Cr(b, X));
468
468
  for (W in b)
469
- $e.call(b, W) && !br.hasOwnProperty(W) && (B[W] = b[W]);
469
+ $e.call(b, W) && !Er.hasOwnProperty(W) && (N[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
+ N[W] === void 0 && (N[W] = q[W]);
474
474
  }
475
- if (L || ee) {
476
- var G = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
477
- L && xr(B, G), ee && Rr(B, G);
475
+ if (z || ee) {
476
+ var J = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
477
+ z && Rr(N, J), ee && Ir(N, J);
478
478
  }
479
- return Ir(i, L, ee, X, D, be.current, B);
479
+ return Or(i, z, ee, X, j, be.current, N);
480
480
  }
481
481
  }
482
- var Ge = y.ReactCurrentOwner, wt = y.ReactDebugCurrentFrame;
482
+ var Ge = y.ReactCurrentOwner, xt = 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 = je(i.type, i._source, b ? b.type : null);
486
+ xt.setExtraStackFrame(I);
487
487
  } else
488
- wt.setExtraStackFrame(null);
488
+ xt.setExtraStackFrame(null);
489
489
  }
490
490
  var Je;
491
491
  Je = !1;
@@ -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 = Y(Ge.current.type);
499
499
  if (i)
500
500
  return `
501
501
 
@@ -504,145 +504,145 @@ Check the render method of \`` + i + "`.";
504
504
  return "";
505
505
  }
506
506
  }
507
- function Tr(i) {
507
+ function kr(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
  }
517
517
  }
518
- var xt = {};
519
- function kr(i) {
518
+ var Rt = {};
519
+ function Pr(i) {
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
  }
530
530
  }
531
- function Rt(i, b) {
531
+ function It(i, b) {
532
532
  {
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 = Pr(b);
537
+ if (Rt[I])
538
538
  return;
539
- xt[R] = !0;
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);
539
+ Rt[I] = !0;
540
+ var j = "";
541
+ i && i._owner && i._owner !== Ge.current && (j = " It was passed a child from " + Y(i._owner.type) + "."), he(i), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', I, j), he(null);
542
542
  }
543
543
  }
544
- function It(i, b) {
544
+ function Ot(i, b) {
545
545
  {
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];
551
- Ze(D) && Rt(D, b);
549
+ for (var I = 0; I < i.length; I++) {
550
+ var j = i[I];
551
+ Ze(j) && It(j, 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);
556
+ var X = O(i);
557
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);
558
+ for (var W = X.call(i), N; !(N = W.next()).done; )
559
+ Ze(N.value) && It(N.value, b);
560
560
  }
561
561
  }
562
562
  }
563
- function Pr(i) {
563
+ function Mr(i) {
564
564
  {
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 j = Y(b);
579
+ yr(I, i.props, "prop", j, 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 X = Y(b);
583
+ x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", X || "Unknown");
584
584
  }
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.");
585
+ typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
586
586
  }
587
587
  }
588
- function Mr(i) {
588
+ function Dr(i) {
589
589
  {
590
- for (var b = Object.keys(i.props), R = 0; R < b.length; R++) {
591
- var D = b[R];
592
- if (D !== "children" && D !== "key") {
593
- he(i), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", D), he(null);
590
+ for (var b = Object.keys(i.props), I = 0; I < b.length; I++) {
591
+ var j = b[I];
592
+ if (j !== "children" && j !== "key") {
593
+ he(i), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", j), he(null);
594
594
  break;
595
595
  }
596
596
  }
597
- i.ref !== null && (he(i), C("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
597
+ i.ref !== null && (he(i), x("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
598
598
  }
599
599
  }
600
- function Ot(i, b, R, D, X, W) {
600
+ function Tt(i, b, I, j, X, 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 N = D(i);
603
+ if (!N) {
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 = kr(X);
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 = "<" + (Y(i.type) || "Unknown") + " />", z = " Did you accidentally export a JSX literal instead of a component?") : q = typeof i, x("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);
612
- if (G == null)
613
- return G;
614
- if (B) {
611
+ var J = Tr(i, b, I, X, W);
612
+ if (J == null)
613
+ return J;
614
+ if (N) {
615
615
  var re = b.children;
616
616
  if (re !== void 0)
617
- if (D)
617
+ if (j)
618
618
  if (He(re)) {
619
619
  for (var ve = 0; ve < re.length; ve++)
620
- It(re[ve], i);
620
+ Ot(re[ve], i);
621
621
  Object.freeze && Object.freeze(re);
622
622
  } else
623
- C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
623
+ x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
624
624
  else
625
- It(re, i);
625
+ Ot(re, i);
626
626
  }
627
- return i === n ? Mr(G) : Pr(G), G;
627
+ return i === n ? Dr(J) : Mr(J), J;
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 Tt(i, b, I, !0);
632
632
  }
633
- function Dr(i, b, R) {
634
- return Ot(i, b, R, !1);
633
+ function $r(i, b, I) {
634
+ return Tt(i, b, I, !1);
635
635
  }
636
- var $r = Dr, Ar = jr;
637
- we.Fragment = n, we.jsx = $r, we.jsxs = Ar;
636
+ var Ar = $r, Lr = jr;
637
+ we.Fragment = n, we.jsx = Ar, we.jsxs = Lr;
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;
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
- class Fr {
641
+ process.env.NODE_ENV === "production" ? e.exports = Ur() : e.exports = Wr();
642
+ })(Xr);
643
+ const Vr = Ie.Fragment, k = Ie.jsx, le = Ie.jsxs;
644
+ let Fr = (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
+ class Kr {
646
646
  constructor(t, r, n = null) {
647
647
  this._socket = t, this.userId = n, this.room = r, this.toUnregister = [
648
648
  () => {
@@ -669,7 +669,7 @@ class Fr {
669
669
  * @returns the result of the call.
670
670
  */
671
671
  async _callServerRPC(t, r) {
672
- const n = Vr();
672
+ const n = Fr();
673
673
  return new Promise((o, s) => {
674
674
  this._socket.once(`${this.room}._result.${n}`, (a) => {
675
675
  a.hasOwnProperty("ok") ? o(a.ok) : s(a.err);
@@ -738,7 +738,7 @@ class Fr {
738
738
  return await this._callServerRPC("call", { name: t, params: r });
739
739
  }
740
740
  }
741
- const Kr = ({
741
+ const Hr = ({
742
742
  socket: e,
743
743
  room: t,
744
744
  onJoined: r = () => {
@@ -747,7 +747,7 @@ const Kr = ({
747
747
  },
748
748
  userId: o = null
749
749
  }) => {
750
- const s = new Fr(e, t, o);
750
+ const s = new Kr(e, t, o);
751
751
  return new Promise((a) => {
752
752
  let u = !0;
753
753
  e.on(`${t}.isMaster`, () => {
@@ -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
+ }, at = g.createContext(), qr = () => /* @__PURE__ */ k(
765
765
  "div",
766
766
  {
767
767
  style: {
@@ -773,16 +773,16 @@ 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
- ), nr = ({
778
+ ), or = ({
779
779
  socket: e,
780
780
  room: t,
781
781
  channel: r = "default",
782
- LoadingComponent: n = Hr,
782
+ LoadingComponent: n = qr,
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(at), v = g.useRef(!1);
786
786
  return g.useEffect(() => (h.current = !0, () => {
787
787
  h.current = !1;
788
788
  }), []), g.useEffect(() => {
@@ -794,7 +794,7 @@ const Kr = ({
794
794
  return e.on("disconnect", E), () => {
795
795
  e.off("disconnect", E);
796
796
  };
797
- }, [r, e]), g.useEffect(() => e ? (e.connected || e.connect(), console.log(`Try to connect to wire ${t} on channel ${r}`), v.current || (v.current = !0, Kr({
797
+ }, [r, e]), g.useEffect(() => e ? (e.connected || e.connect(), console.log(`Try to connect to wire ${t} on channel ${r}`), v.current || (v.current = !0, Hr({
798
798
  socket: e,
799
799
  room: t,
800
800
  onMaster: () => {
@@ -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(
810
- it.Provider,
809
+ }) : null, [r, t, e]), !s || !d ? /* @__PURE__ */ k(n, {}) : /* @__PURE__ */ k(
810
+ at.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
+ }, Xe = (e = "default") => (_e(at) || {})[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;
@@ -828,14 +828,14 @@ const Kr = ({
828
828
  } };
829
829
  return t = e(n, o, u), u;
830
830
  }, Ue = (e) => e ? jt(e) : jt;
831
- var at = {}, qr = {
831
+ var ct = {}, Gr = {
832
832
  get exports() {
833
- return at;
833
+ return ct;
834
834
  },
835
835
  set exports(e) {
836
- at = e;
836
+ ct = e;
837
837
  }
838
- }, Qe = {}, Ye = {}, Gr = {
838
+ }, Qe = {}, Ye = {}, Jr = {
839
839
  get exports() {
840
840
  return Ye;
841
841
  },
@@ -852,32 +852,32 @@ var at = {}, qr = {
852
852
  * This source code is licensed under the MIT license found in the
853
853
  * LICENSE file in the root directory of this source tree.
854
854
  */
855
- var Dt;
856
- function Jr() {
857
- if (Dt)
855
+ var $t;
856
+ function Zr() {
857
+ if ($t)
858
858
  return et;
859
- Dt = 1;
859
+ $t = 1;
860
860
  var e = g;
861
861
  function t(c, h) {
862
862
  return c === h && (c !== 0 || 1 / c === 1 / h) || c !== c && h !== h;
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
  }
@@ -898,82 +898,82 @@ var tt = {};
898
898
  * This source code is licensed under the MIT license found in the
899
899
  * LICENSE file in the root directory of this source tree.
900
900
  */
901
- var $t;
902
- function Zr() {
903
- return $t || ($t = 1, process.env.NODE_ENV !== "production" && function() {
901
+ var At;
902
+ function Qr() {
903
+ return At || (At = 1, process.env.NODE_ENV !== "production" && function() {
904
904
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
905
905
  var e = g, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
906
- function r(x) {
906
+ function r(C) {
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", C, _);
911
911
  }
912
912
  }
913
- function n(x, p, w) {
913
+ function n(C, 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[C], console, R);
921
921
  }
922
922
  }
923
- function o(x, p) {
924
- return x === p && (x !== 0 || 1 / x === 1 / p) || x !== x && p !== p;
923
+ function o(C, p) {
924
+ return C === p && (C !== 0 || 1 / C === 1 / p) || C !== C && 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(C, 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, D = 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) && D({
942
+ inst: T
943
943
  });
944
- }, [x, m, p]), u(function() {
945
- _(k) && j({
946
- inst: k
944
+ }, [C, m, p]), u(function() {
945
+ S(T) && D({
946
+ inst: T
947
947
  });
948
948
  var M = function() {
949
- _(k) && j({
950
- inst: k
949
+ S(T) && D({
950
+ inst: T
951
951
  });
952
952
  };
953
- return x(M);
954
- }, [x]), d(m), m;
953
+ return C(M);
954
+ }, [C]), d(m), m;
955
955
  }
956
- function _(x) {
957
- var p = x.getSnapshot, w = x.value;
956
+ function S(C) {
957
+ var p = C.getSnapshot, _ = C.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(C, 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;
969
- tt.useSyncExternalStore = C, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
968
+ var E = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", O = !E, y = O ? v : h, x = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : y;
969
+ tt.useSyncExternalStore = x, 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
  }
972
- var At;
973
- function or() {
974
- return At || (At = 1, function(e) {
975
- process.env.NODE_ENV === "production" ? e.exports = Jr() : e.exports = Zr();
976
- }(Gr)), Ye;
972
+ var Lt;
973
+ function sr() {
974
+ return Lt || (Lt = 1, function(e) {
975
+ process.env.NODE_ENV === "production" ? e.exports = Zr() : e.exports = Qr();
976
+ }(Jr)), Ye;
977
977
  }
978
978
  /**
979
979
  * @license React
@@ -984,17 +984,17 @@ function or() {
984
984
  * This source code is licensed under the MIT license found in the
985
985
  * LICENSE file in the root directory of this source tree.
986
986
  */
987
- var Lt;
988
- function Qr() {
989
- if (Lt)
987
+ var zt;
988
+ function en() {
989
+ if (zt)
990
990
  return Qe;
991
- Lt = 1;
992
- var e = g, t = or();
991
+ zt = 1;
992
+ var e = g, t = sr();
993
993
  function r(d, f) {
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 };
@@ -1003,30 +1003,30 @@ function Qr() {
1003
1003
  E = v.current;
1004
1004
  v = u(function() {
1005
1005
  function y(m) {
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;
1006
+ if (!x) {
1007
+ if (x = !0, C = 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(C, m))
1015
+ return w;
1016
+ var R = h(m);
1017
+ return S !== void 0 && S(w, R) ? w : (C = m, p = R);
1018
1018
  }
1019
- var C = !1, x, p, w = c === void 0 ? null : c;
1019
+ var x = !1, C, 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 = {};
@@ -1039,97 +1039,97 @@ var rt = {};
1039
1039
  * This source code is licensed under the MIT license found in the
1040
1040
  * LICENSE file in the root directory of this source tree.
1041
1041
  */
1042
- var zt;
1043
- function en() {
1044
- return zt || (zt = 1, process.env.NODE_ENV !== "production" && function() {
1042
+ var Yt;
1043
+ function tn() {
1044
+ return Yt || (Yt = 1, process.env.NODE_ENV !== "production" && function() {
1045
1045
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
1046
- var e = g, t = or();
1046
+ var e = g, t = sr();
1047
1047
  function r(f, c) {
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 Y = S(A);
1062
+ if (v !== void 0 && O.hasValue) {
1063
+ var U = O.value;
1064
+ if (v(U, Y))
1065
+ return w = U, U;
1066
1066
  }
1067
- return S = N, N;
1067
+ return w = Y, Y;
1068
1068
  }
1069
- var J = m, P = S;
1070
- if (n(J, A))
1069
+ var G = m, P = w;
1070
+ if (n(G, 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, D = function() {
1075
+ return R(c());
1076
+ }, M = T === null ? void 0 : function() {
1077
+ return R(T());
1078
1078
  };
1079
- return [j, M];
1080
- }, [c, h, _, v]), C = y[0], x = y[1], p = o(f, C, x);
1079
+ return [D, M];
1080
+ }, [c, h, S, v]), x = y[0], C = y[1], p = o(f, x, C);
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());
1086
1086
  }()), rt;
1087
1087
  }
1088
1088
  (function(e) {
1089
- process.env.NODE_ENV === "production" ? e.exports = Qr() : e.exports = en();
1090
- })(qr);
1091
- const tn = /* @__PURE__ */ Br(at), { useSyncExternalStoreWithSelector: rn } = tn;
1089
+ process.env.NODE_ENV === "production" ? e.exports = en() : e.exports = tn();
1090
+ })(Gr);
1091
+ const rn = /* @__PURE__ */ Nr(ct), { useSyncExternalStoreWithSelector: nn } = rn;
1092
1092
  function We(e, t = e.getState, r) {
1093
- const n = rn(
1093
+ const n = nn(
1094
1094
  e.subscribe,
1095
1095
  e.getState,
1096
1096
  e.getServerState || e.getState,
1097
1097
  t,
1098
1098
  r
1099
1099
  );
1100
- return Yr(n), n;
1100
+ return Br(n), n;
1101
1101
  }
1102
1102
  const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e, t) ? e : e.parentNode ? Oe(e.parentNode, t) : !1, ze = ([e, t], [r, n]) => {
1103
1103
  const o = Math.abs(e - r), s = Math.abs(t - n);
1104
1104
  return Math.hypot(o, s);
1105
- }, sr = (e, t, r) => {
1105
+ }, ir = (e, t, r) => {
1106
1106
  const n = r * Math.PI / 180, o = e * Math.cos(n) - t * Math.sin(n), s = e * Math.sin(n) + t * Math.cos(n);
1107
1107
  return [o, s];
1108
- }, ct = ([e, t], { scale: r, rotate: n, translateX: o, translateY: s }) => {
1108
+ }, ut = ([e, t], { scale: r, rotate: n, translateX: o, translateY: s }) => {
1109
1109
  const a = (e - o) / r, u = (t - s) / r;
1110
- return sr(a, u, -n);
1110
+ return ir(a, u, -n);
1111
1111
  }, Be = ([e, t], { scale: r, rotate: n, translateX: o, translateY: s }) => {
1112
- const [a, u] = sr(e, t, n);
1112
+ const [a, u] = ir(e, t, n);
1113
1113
  return [a * r + o, u * r + s];
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;
1114
+ }, Bt = (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 = 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
- const C = (-E + Math.sqrt(y)) / (2 * v), x = (-E - Math.sqrt(y)) / (2 * v), p = [];
1119
- return C >= 0 && C <= 1 && p.push({ x: o + C * f, y: s + C * c }), x >= 0 && x <= 1 && p.push({ x: o + x * f, y: s + x * c }), p;
1120
- }, ft = (e, t) => e.x > t.left && e.x < t.left + t.width && e.y > t.top && e.y < t.top + t.height, nn = (e, t) => Array.from(e.querySelectorAll(".corner")).every((n) => {
1118
+ const x = (-E + Math.sqrt(y)) / (2 * v), C = (-E - Math.sqrt(y)) / (2 * v), p = [];
1119
+ return x >= 0 && x <= 1 && p.push({ x: o + x * f, y: s + x * c }), C >= 0 && C <= 1 && p.push({ x: o + C * f, y: s + C * c }), p;
1120
+ }, dt = (e, t) => e.x > t.left && e.x < t.left + t.width && e.y > t.top && e.y < t.top + t.height, on = (e, t) => Array.from(e.querySelectorAll(".corner")).every((n) => {
1121
1121
  const { top: o, left: s } = n.getBoundingClientRect();
1122
- return ft({ x: s, y: o }, t);
1123
- }), on = (e, t) => {
1122
+ return dt({ x: s, y: o }, t);
1123
+ }), sn = (e, t) => {
1124
1124
  const r = t.getBoundingClientRect();
1125
- return nn(e, r);
1125
+ return on(e, r);
1126
1126
  }, Ne = (e, t) => {
1127
1127
  try {
1128
- const n = e.getElementsByClassName(`item ${t}`)[0];
1129
- return n || console.error(`Missing item ${t}`), n;
1128
+ const r = document.getElementById(`${e}__${t}`);
1129
+ return r || console.error(`Missing item ${t}`), r;
1130
1130
  } catch {
1131
1131
  console.error(
1132
- `Error while getting item with id ${t} with wrapper`,
1132
+ `Error while getting item with id ${t} inside wrapper`,
1133
1133
  e
1134
1134
  );
1135
1135
  return;
@@ -1143,7 +1143,7 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1143
1143
  JSON.stringify(e == null ? void 0 : e.dataset),
1144
1144
  (n = e == null ? void 0 : e.dataset) == null ? void 0 : n.id
1145
1145
  ), t;
1146
- }, sn = (e, t = document) => {
1146
+ }, an = (e, t) => {
1147
1147
  const r = e.reduce((n, o) => {
1148
1148
  const s = Ne(t, o);
1149
1149
  if (!s)
@@ -1158,32 +1158,32 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1158
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;
1159
1159
  }, null);
1160
1160
  return r && (r.width = r.right - r.left, r.height = r.bottom - r.top, r);
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), [
1161
+ }, ar = (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] ? [
1162
1162
  n,
1163
- ...ir(
1163
+ ...ar(
1164
1164
  e,
1165
1165
  e[n].linkedItems,
1166
1166
  r
1167
1167
  )
1168
- ])).flat()), Bt = (e, t, r) => {
1169
- const n = new Set(ir(e, r));
1168
+ ] : [])).flat()), Nt = (e, t, r) => {
1169
+ const n = new Set(ar(e, r));
1170
1170
  return t.filter((o) => n.has(o));
1171
- }, an = ({ x: e, y: t, width: r, height: n }, { type: o = "grid", size: s = 1, offset: a = { x: 0, y: 0 } }) => {
1171
+ }, cn = ({ x: e, y: t, width: r, height: n }, { type: o = "grid", size: s = 1, offset: a = { x: 0, y: 0 } }) => {
1172
1172
  const [u, l] = [
1173
1173
  e + r / 2 - a.x,
1174
1174
  t + n / 2 - a.y
1175
1175
  ];
1176
- let d, f, c, h, _, v, E, I, y, C;
1177
- const x = s / 1.1547;
1176
+ let d, f, c, h, S, v, E, O, y, x;
1177
+ const C = s / 1.1547;
1178
1178
  switch (o) {
1179
1179
  case "grid":
1180
1180
  d = Math.round(u / s) * s, f = Math.round(l / s) * s;
1181
1181
  break;
1182
1182
  case "hexH":
1183
- 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 * C, h = 3 * s, S = Math.round(u / c) * c, E = Math.round(l / h) * h, v = S > u ? S - C : S + C, O = E > l ? E - 1.5 * s : E + 1.5 * s, y = Math.hypot(S - u, E - l), x = Math.hypot(v - u, O - l), y < x ? (d = S, f = E) : (d = v, f = O);
1184
1184
  break;
1185
1185
  case "hexV":
1186
- 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 * C, 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 - C : E + C, y = Math.hypot(S - u, E - l), x = Math.hypot(v - u, O - l), y < x ? (d = S, f = E) : (d = v, f = O);
1187
1187
  break;
1188
1188
  default:
1189
1189
  d = e + r / 2, f = t + n / 2;
@@ -1192,7 +1192,7 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1192
1192
  x: d + a.x - r / 2,
1193
1193
  y: f + a.y - n / 2
1194
1194
  };
1195
- }, Nt = [
1195
+ }, Xt = [
1196
1196
  "#037758",
1197
1197
  "#99092a",
1198
1198
  "#067070",
@@ -1223,13 +1223,13 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1223
1223
  "#007a4b",
1224
1224
  "#bf0daa",
1225
1225
  "#af0ad8"
1226
- ], Xt = () => Nt[Math.floor(Math.random() * Nt.length)], cn = !1, dt = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s, a, u) => {
1226
+ ], Ut = () => Xt[Math.floor(Math.random() * Xt.length)], un = !1, pt = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s, a, u) => {
1227
1227
  s({ ready: !1 });
1228
1228
  const l = [];
1229
1229
  (async () => {
1230
1230
  try {
1231
- const _ = await e.call(`${t}_getValue`);
1232
- cn && console.log("init from peer with value", _), s((v) => ({ ...v, ..._ }));
1231
+ const S = await e.call(`${t}_getValue`);
1232
+ un && console.log("init from peer with value", S), s((v) => ({ ...v, ...S }));
1233
1233
  } catch {
1234
1234
  n !== void 0 && s(n);
1235
1235
  }
@@ -1238,26 +1238,26 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
1238
1238
  `${t}_getValue`,
1239
1239
  () => Object.fromEntries(
1240
1240
  Object.entries(a()).filter(
1241
- ([_, v]) => typeof v != "function" && !r.includes(_)
1241
+ ([S, v]) => typeof v != "function" && !r.includes(S)
1242
1242
  )
1243
1243
  ),
1244
1244
  { invoke: "first" }
1245
1245
  )
1246
1246
  ), l.push(
1247
- e.subscribe(`${t}_call`, ([_, v]) => {
1248
- c[_](...v);
1247
+ e.subscribe(`${t}_call`, ([S, v]) => {
1248
+ c[S](...v);
1249
1249
  })
1250
1250
  ), s({ ready: !0 });
1251
1251
  })();
1252
1252
  const f = o(s, a, u), c = { ...f }, h = Object.fromEntries(
1253
1253
  // Send the update message on all method calls
1254
- Object.entries(f).map(([_, v]) => typeof v == "function" && !_.startsWith("get") && !r.includes(_) ? [_, (...I) => {
1255
- const y = v(...I);
1256
- return e.publish(`${t}_call`, [_, I]), y;
1257
- }] : [_, 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])
1258
1258
  );
1259
1259
  return h.unsub = () => {
1260
- l.forEach((_) => _());
1260
+ l.forEach((S) => S());
1261
1261
  }, h;
1262
1262
  };
1263
1263
  function Ve(e, t) {
@@ -1289,7 +1289,7 @@ function Ve(e, t) {
1289
1289
  return !1;
1290
1290
  return !0;
1291
1291
  }
1292
- const ar = g.createContext(), un = (e, t) => ({
1292
+ const cr = g.createContext(), ln = (e, t) => ({
1293
1293
  items: {},
1294
1294
  getItems: () => t().items,
1295
1295
  setItems: (r) => e({ items: r }),
@@ -1308,7 +1308,7 @@ const ar = g.createContext(), un = (e, t) => ({
1308
1308
  });
1309
1309
  }), { items: s };
1310
1310
  })
1311
- }), ln = (e, t) => ({
1311
+ }), fn = (e, t) => ({
1312
1312
  itemIds: [],
1313
1313
  setItemIds: (r) => e({ itemIds: r }),
1314
1314
  getItemIds: () => t().itemIds,
@@ -1327,7 +1327,7 @@ const ar = g.createContext(), un = (e, t) => ({
1327
1327
  updateManyItemIds: (r) => e((n) => ({
1328
1328
  items: n.itemIds.map((o, s) => r[s] !== void 0 ? r[s] : o)
1329
1329
  }))
1330
- }), fn = (e, t) => ({
1330
+ }), dn = (e, t) => ({
1331
1331
  removeItemsById: (r) => e((n) => ({
1332
1332
  itemIds: n.itemIds.filter((o) => !r.includes(o)),
1333
1333
  items: Object.fromEntries(
@@ -1360,25 +1360,25 @@ const ar = g.createContext(), un = (e, t) => ({
1360
1360
  itemIds: s
1361
1361
  };
1362
1362
  })
1363
- }), dn = (e, t) => ({
1363
+ }), pn = (e, t) => ({
1364
1364
  boardConfig: {},
1365
1365
  getBoardConfig: () => t().boardConfig,
1366
1366
  setBoardConfig: (r) => e({ boardConfig: r }),
1367
1367
  updateBoardConfig: (r) => e((n) => ({ boardConfig: { ...n.boardConfig, ...r } }))
1368
- }), pn = (e, t) => ({
1368
+ }), mn = (e, t) => ({
1369
1369
  session: {},
1370
1370
  getSessionInfo: () => t().session,
1371
1371
  setSessionInfo: (r) => e({ session: r }),
1372
1372
  updateSessionInfo: (r) => e((n) => ({ session: { ...n.session, ...r } }))
1373
- }), Ut = ({ storeName: e, children: t, defaultValue: r }) => {
1373
+ }), Wt = ({ storeName: e, children: t, defaultValue: r }) => {
1374
1374
  const { wire: n } = Xe("room"), [o, s] = g.useState(!1), [a] = g.useState(
1375
1375
  () => Ue(
1376
- dt({ wire: n, storeName: e, defaultValue: r }, (...u) => ({
1377
- ...un(...u),
1376
+ pt({ wire: n, storeName: e, defaultValue: r }, (...u) => ({
1378
1377
  ...ln(...u),
1379
1378
  ...fn(...u),
1380
1379
  ...dn(...u),
1381
- ...pn(...u)
1380
+ ...pn(...u),
1381
+ ...mn(...u)
1382
1382
  }))
1383
1383
  )
1384
1384
  );
@@ -1386,11 +1386,11 @@ const ar = g.createContext(), un = (e, t) => ({
1386
1386
  const u = a.subscribe((l) => {
1387
1387
  l.ready && (u(), s(!0));
1388
1388
  });
1389
- }, [a]), o ? /* @__PURE__ */ T(ar.Provider, { value: a, children: t }) : null;
1389
+ }, [a]), o ? /* @__PURE__ */ k(cr.Provider, { value: a, children: t }) : null;
1390
1390
  }, oe = (e, t) => {
1391
- const r = _e(ar);
1391
+ const r = _e(cr);
1392
1392
  return We(r, e, t || Ve);
1393
- }, ns = () => {
1393
+ }, os = () => {
1394
1394
  const [e, t] = oe((n) => [
1395
1395
  n.itemIds,
1396
1396
  n.items
@@ -1399,7 +1399,7 @@ const ar = g.createContext(), un = (e, t) => ({
1399
1399
  () => e.map((n) => t[n]),
1400
1400
  [e, t]
1401
1401
  );
1402
- }, os = () => {
1402
+ }, ss = () => {
1403
1403
  const [e, t, r] = oe((a) => [
1404
1404
  a.items,
1405
1405
  a.itemIds,
@@ -1411,19 +1411,19 @@ const ar = g.createContext(), un = (e, t) => ({
1411
1411
  o(a);
1412
1412
  });
1413
1413
  }, [e, t, r]), n;
1414
- }, cr = 5e4, ur = g.createContext(), mn = (e, t) => ({
1414
+ }, ur = 5e4, lr = g.createContext(), gn = (e, t) => ({
1415
1415
  config: {
1416
1416
  itemTemplates: {},
1417
1417
  actions: {},
1418
1418
  uid: null,
1419
1419
  itemExtent: { x: 0, y: 0, radius: 0 },
1420
1420
  boardWrapperRect: {},
1421
- boardSize: cr
1421
+ boardSize: ur
1422
1422
  },
1423
1423
  // TODO optimize when same values as before
1424
1424
  updateConfiguration: (r) => e((n) => ({ config: { ...n.config, ...r } })),
1425
1425
  getConfiguration: () => t().config
1426
- }), gn = (e, t) => ({
1426
+ }), hn = (e, t) => ({
1427
1427
  boardState: {
1428
1428
  movingItems: !1,
1429
1429
  selecting: !1,
@@ -1437,7 +1437,7 @@ const ar = g.createContext(), un = (e, t) => ({
1437
1437
  // TODO optimize when same values as before
1438
1438
  updateBoardState: (r) => e((n) => ({ boardState: { ...n.boardState, ...r } })),
1439
1439
  getBoardState: () => t().boardState
1440
- }), hn = (e, t) => ({
1440
+ }), vn = (e, t) => ({
1441
1441
  interactions: {},
1442
1442
  getInteractions: () => t().interactions,
1443
1443
  register: (r, n) => e((o) => {
@@ -1459,7 +1459,7 @@ const ar = g.createContext(), un = (e, t) => ({
1459
1459
  setTimeout(() => o(n), 0);
1460
1460
  });
1461
1461
  }
1462
- }), vn = (e, t) => ({
1462
+ }), yn = (e, t) => ({
1463
1463
  selection: [],
1464
1464
  setSelection: (r) => e((n) => JSON.stringify(n.selection) !== JSON.stringify(r) ? { selection: r } : {}),
1465
1465
  getSelection: () => t().selection,
@@ -1479,33 +1479,36 @@ const ar = g.createContext(), un = (e, t) => ({
1479
1479
  const o = n.selectionBox;
1480
1480
  return !o || !r || o.top !== r.top || o.left !== r.left || o.width !== r.width || o.height !== r.height ? { selectionBox: r } : {};
1481
1481
  })
1482
- }), Wt = ({ children: e }) => {
1482
+ }), Vt = ({ children: e }) => {
1483
1483
  const [t] = g.useState(
1484
1484
  () => Ue((...r) => ({
1485
- ...mn(...r),
1486
1485
  ...gn(...r),
1487
1486
  ...hn(...r),
1488
- ...vn(...r)
1487
+ ...vn(...r),
1488
+ ...yn(...r)
1489
1489
  }))
1490
1490
  );
1491
- return /* @__PURE__ */ T(ur.Provider, { value: t, children: e });
1492
- }, Q = (e, t) => {
1493
- const r = _e(ur);
1491
+ return /* @__PURE__ */ k(lr.Provider, { value: t, children: e });
1492
+ }, Z = (e, t) => {
1493
+ const r = _e(lr);
1494
1494
  return We(r, e, t || Ve);
1495
- }, ss = () => {
1496
- const [e] = Q((t) => [t.selection]);
1495
+ }, is = () => {
1496
+ const [e] = Z((t) => [t.selection]);
1497
+ return e;
1498
+ }, as = () => {
1499
+ const [e] = Z((t) => [t.getSelection]);
1497
1500
  return e;
1498
1501
  };
1499
- function pt(e) {
1502
+ function mt(e) {
1500
1503
  const t = Re(e);
1501
- return t.current = e, lt(() => Object.freeze({
1504
+ return t.current = e, ft(() => Object.freeze({
1502
1505
  get current() {
1503
1506
  return t.current;
1504
1507
  }
1505
1508
  }), []);
1506
1509
  }
1507
- function yn(e) {
1508
- const t = pt(e);
1510
+ function Sn(e) {
1511
+ const t = mt(e);
1509
1512
  Pe(
1510
1513
  () => () => {
1511
1514
  t.current();
@@ -1514,11 +1517,11 @@ function yn(e) {
1514
1517
  []
1515
1518
  );
1516
1519
  }
1517
- function mt(e, t, r, n = 0) {
1520
+ function gt(e, t, r, n = 0) {
1518
1521
  const o = Re(), s = Re(), a = Re(), u = () => {
1519
1522
  o.current && (clearTimeout(o.current), o.current = void 0), s.current && (clearTimeout(s.current), s.current = void 0);
1520
1523
  };
1521
- return yn(u), lt(
1524
+ return Sn(u), ft(
1522
1525
  () => {
1523
1526
  const l = () => {
1524
1527
  if (!a.current)
@@ -1537,7 +1540,9 @@ function mt(e, t, r, n = 0) {
1537
1540
  [r, n, ...t]
1538
1541
  );
1539
1542
  }
1540
- const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1543
+ const _n = 100, bn = 1e3, En = 0.8;
1544
+ let nt = !1;
1545
+ const wn = ({
1541
1546
  x: e,
1542
1547
  y: t,
1543
1548
  scale: r,
@@ -1547,7 +1552,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1547
1552
  boardSize: a
1548
1553
  }) => {
1549
1554
  let [u, l] = [e, t];
1550
- const d = ct(
1555
+ const d = ut(
1551
1556
  [s.width / 2, s.height / 2],
1552
1557
  { translateX: u, translateY: l, scale: r, rotate: n }
1553
1558
  ), f = {
@@ -1556,37 +1561,37 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1556
1561
  }, c = {
1557
1562
  x: a / 2,
1558
1563
  y: a / 2
1559
- }, h = ze(d, [f.x, f.y]), _ = Math.min(s.width, s.height), v = o.radius + _ / 2 / r - Sn / r;
1564
+ }, h = ze(d, [f.x, f.y]), S = Math.min(s.width, s.height), v = o.radius + S / 2 / r - _n / r;
1560
1565
  if (h > v) {
1561
- const y = Yt(
1566
+ const y = Bt(
1562
1567
  { x: d[0], y: d[1] },
1563
1568
  f,
1564
1569
  f,
1565
1570
  v - 1 / r
1566
- )[0], [C, x] = Be([-y.x, -y.y], {
1571
+ )[0], [x, C] = Be([-y.x, -y.y], {
1567
1572
  translateX: s.width / 2,
1568
1573
  translateY: s.height / 2,
1569
1574
  scale: r,
1570
1575
  rotate: n
1571
1576
  });
1572
- u = C, l = x;
1577
+ u = x, l = C;
1573
1578
  }
1574
- const E = ze(d, [c.x, c.y]), I = a / 2 - ze([0, 0], [s.width, s.height]) / r;
1575
- if (E > I) {
1576
- const y = Yt(
1579
+ const E = ze(d, [c.x, c.y]), O = a / 2 - ze([0, 0], [s.width, s.height]) / r;
1580
+ if (E > O) {
1581
+ const y = Bt(
1577
1582
  { x: d[0], y: d[1] },
1578
1583
  c,
1579
1584
  c,
1580
- I - 1 / r
1585
+ O - 1 / r
1581
1586
  )[0];
1582
1587
  if (y) {
1583
- const [C, x] = Be([-y.x, -y.y], {
1588
+ const [x, C] = Be([-y.x, -y.y], {
1584
1589
  translateX: s.width / 2,
1585
1590
  translateY: s.height / 2,
1586
1591
  scale: r,
1587
1592
  rotate: n
1588
1593
  });
1589
- u = C, l = x;
1594
+ u = x, l = C;
1590
1595
  }
1591
1596
  }
1592
1597
  return [u, l];
@@ -1597,66 +1602,68 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1597
1602
  r,
1598
1603
  n,
1599
1604
  o
1600
- ] = Q((p) => [
1605
+ ] = Z((p) => [
1601
1606
  p.getBoardState,
1602
1607
  p.updateBoardState,
1603
1608
  p.config.itemExtent,
1604
1609
  p.getConfiguration,
1605
1610
  p.updateConfiguration
1606
1611
  ]), s = g.useRef([0.15, 5]), [a] = oe((p) => [p.getItemList]), u = g.useCallback(() => {
1607
- const { translateX: p, translateY: w, scale: m, rotate: S } = e();
1608
- return { translateX: p, translateY: w, scale: m, rotate: S };
1612
+ const { translateX: p, translateY: _, scale: m, rotate: w } = e();
1613
+ return { translateX: p, translateY: _, scale: m, rotate: w };
1609
1614
  }, [e]), l = g.useCallback(
1610
- (p, w) => ct([p, w], e()),
1615
+ (p, _) => ut([p, _], e()),
1611
1616
  [e]
1612
1617
  ), d = g.useCallback(
1613
- (p, w) => Be([p, w], e()),
1618
+ (p, _) => Be([p, _], e()),
1614
1619
  [e]
1615
1620
  ), f = g.useCallback(
1616
- (p, w) => {
1617
- const { scale: m, rotate: S } = e();
1618
- return ct([p, w], {
1621
+ (p, _) => {
1622
+ const { scale: m, rotate: w } = e();
1623
+ return ut([p, _], {
1619
1624
  translateX: 0,
1620
1625
  translateY: 0,
1621
- rotate: S,
1626
+ rotate: w,
1622
1627
  scale: m
1623
1628
  });
1624
1629
  },
1625
1630
  [e]
1626
1631
  ), c = g.useCallback((p) => p > s.current[1] ? s.current[1] : p < s.current[0] ? s.current[0] : p, []), h = g.useCallback(
1627
1632
  (p) => {
1628
- const { itemExtent: w, boardWrapperRect: m, boardSize: S } = n(), O = e(), {
1629
- translateX: k,
1630
- translateY: j,
1633
+ const { itemExtent: _, boardWrapperRect: m, boardSize: w } = n(), R = e(), {
1634
+ translateX: T,
1635
+ translateY: D,
1631
1636
  scale: M,
1632
1637
  rotate: A
1633
1638
  } = {
1634
- ...O,
1635
- ...p(O)
1636
- }, N = c(M);
1637
- let [U, J] = [k, j];
1638
- (k !== O.translateX || j !== O.translateY) && ([U, J] = En({
1639
- x: k,
1640
- y: j,
1641
- scale: N,
1639
+ ...R,
1640
+ ...p(R)
1641
+ };
1642
+ nt && console.log("New expected values: ", T, D, M, A);
1643
+ const Y = c(M);
1644
+ let [U, G] = [T, D];
1645
+ (T !== R.translateX || D !== R.translateY) && ([U, G] = wn({
1646
+ x: T,
1647
+ y: D,
1648
+ scale: Y,
1642
1649
  rotate: A,
1643
- itemExtent: w,
1650
+ itemExtent: _,
1644
1651
  boardWrapperRect: m,
1645
- boardSize: S
1646
- })), t({
1652
+ boardSize: w
1653
+ })), nt && console.log("New fixed values: ", U, G, Y, A), t({
1647
1654
  translateX: U,
1648
- translateY: J,
1649
- scale: N,
1655
+ translateY: G,
1656
+ scale: Y,
1650
1657
  rotate: A
1651
1658
  });
1652
1659
  },
1653
1660
  [c, e, n, t]
1654
- ), _ = g.useCallback(
1661
+ ), S = g.useCallback(
1655
1662
  (p) => {
1656
- let w = (m) => ({ ...m, ...p });
1657
- typeof p == "function" && (w = p), h((m) => ({
1663
+ let _ = (m) => ({ ...m, ...p });
1664
+ typeof p == "function" && (_ = p), h((m) => ({
1658
1665
  ...m,
1659
- ...w({
1666
+ ..._({
1660
1667
  translateX: m.translateX,
1661
1668
  translateY: m.translateY
1662
1669
  })
@@ -1664,98 +1671,102 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1664
1671
  },
1665
1672
  [h]
1666
1673
  ), v = g.useCallback(
1667
- ({ to: p, factor: w }) => {
1674
+ ({ to: p, factor: _ }) => {
1668
1675
  const { boardWrapperRect: m } = n();
1669
- let S = p;
1670
- S || (S = {
1676
+ let w = p;
1677
+ w || (w = {
1671
1678
  x: m.left + m.width / 2,
1672
1679
  y: m.top + m.height / 2
1673
1680
  });
1674
- 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;
1681
+ const R = e(), T = c(R.scale * _), D = w.x - m.left, M = w.y - m.top, A = D - (D - R.translateX) * T / R.scale, Y = M - (M - R.translateY) * T / R.scale;
1675
1682
  h((U) => ({
1676
1683
  ...U,
1677
1684
  translateX: A,
1678
- translateY: N,
1679
- scale: k
1685
+ translateY: Y,
1686
+ scale: T
1680
1687
  }));
1681
1688
  },
1682
1689
  [c, e, n, h]
1683
1690
  ), E = g.useCallback(
1684
- ({ x: p, y: w, radius: m }) => {
1685
- 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(
1686
- [-k / 2 - p, -k / 2 - w],
1691
+ ({ x: p, y: _, radius: m }) => {
1692
+ const { rotate: w } = e(), { boardWrapperRect: R, boardSize: T } = n(), D = R.width / (m * 2), M = R.height / (m * 2), A = c(Math.min(D, M) * En), [Y, U] = Be(
1693
+ [-T / 2 - p, -T / 2 - _],
1687
1694
  {
1688
- translateX: O.width / 2,
1689
- translateY: O.height / 2,
1695
+ translateX: R.width / 2,
1696
+ translateY: R.height / 2,
1690
1697
  scale: A,
1691
- rotate: S
1698
+ rotate: w
1692
1699
  }
1693
1700
  );
1694
- h((J) => ({ ...J, translateX: N, translateY: U, scale: A }));
1701
+ h((G) => ({ ...G, translateX: Y, translateY: U, scale: A }));
1695
1702
  },
1696
1703
  [c, e, n, h]
1697
- ), I = g.useCallback(() => {
1698
- const { boardWrapperRect: p, boardSize: w } = n(), [m, S] = l(
1704
+ ), O = g.useCallback(() => {
1705
+ const { boardWrapperRect: p, boardSize: _ } = n(), [m, w] = l(
1699
1706
  p.width / 2,
1700
1707
  p.height / 2
1701
1708
  );
1702
1709
  return {
1703
- x: m - w / 2,
1704
- y: S - w / 2
1710
+ x: m - _ / 2,
1711
+ y: w - _ / 2
1705
1712
  };
1706
1713
  }, [l, n]), y = g.useCallback(() => {
1707
- const p = a(), { boardWrapper: w, boardSize: m } = n(), S = p.reduce(
1708
- (k, j) => {
1709
- const M = Ne(w, j.id);
1710
- return M && (k.left = Math.min(j.x, k.left), k.top = Math.min(j.y, k.top), k.right = Math.max(
1711
- j.x + M.offsetWidth,
1712
- k.right
1713
- ), k.bottom = Math.max(
1714
- j.y + M.offsetHeight,
1715
- k.bottom
1716
- )), k;
1714
+ const p = a(), { boardSize: _, uid: m } = n(), w = p.reduce(
1715
+ (T, D) => {
1716
+ const M = Ne(m, D.id);
1717
+ return M && (T.left = Math.min(D.x, T.left), T.top = Math.min(D.y, T.top), T.right = Math.max(
1718
+ D.x + M.offsetWidth,
1719
+ T.right
1720
+ ), T.bottom = Math.max(
1721
+ D.y + M.offsetHeight,
1722
+ T.bottom
1723
+ )), T;
1717
1724
  },
1718
1725
  {
1719
- left: m / 2,
1720
- top: m / 2,
1721
- right: -m / 2,
1722
- bottom: -m / 2
1726
+ left: _ / 2,
1727
+ top: _ / 2,
1728
+ right: -_ / 2,
1729
+ bottom: -_ / 2
1723
1730
  }
1724
- ), O = {
1725
- x: (S.right + S.left) / 2,
1726
- y: (S.bottom + S.top) / 2
1731
+ ), R = {
1732
+ x: (w.right + w.left) / 2,
1733
+ y: (w.bottom + w.top) / 2
1727
1734
  };
1728
- O.radius = Math.max(
1729
- ze([O.x, O.y], [S.left, S.top]),
1730
- _n
1731
- ), o({ itemExtent: O });
1732
- }, [n, a, o]), C = g.useCallback(
1735
+ R.radius = Math.max(
1736
+ ze([R.x, R.y], [w.left, w.top]),
1737
+ bn
1738
+ ), o({ itemExtent: R });
1739
+ }, [n, a, o]), x = g.useCallback(
1733
1740
  (p) => {
1734
- let w = () => p;
1735
- typeof p == "function" && (w = p), h((m) => ({ ...m, rotate: w(m.rotate) })), y(), E(r);
1741
+ let _ = () => p;
1742
+ typeof p == "function" && (_ = p), h((m) => ({ ...m, rotate: _(m.rotate) })), y(), E(r);
1736
1743
  },
1737
1744
  [r, h, y, E]
1738
- ), x = mt(
1745
+ ), C = gt(
1739
1746
  () => y(),
1740
1747
  [y],
1741
1748
  200
1742
1749
  );
1743
- return {
1750
+ return g.useEffect(() => {
1751
+ window.debugUpdateExtent = () => y(), window.debugDisplayExtent = () => console.log(n().itemExtent), window.debugSetDebug = () => {
1752
+ nt = !0;
1753
+ };
1754
+ }, [n, y]), {
1744
1755
  setDim: h,
1745
- rotateBoard: C,
1746
- moveBoard: _,
1756
+ rotateBoard: x,
1757
+ moveBoard: S,
1747
1758
  getDim: u,
1748
1759
  zoomTo: v,
1749
1760
  zoomToCenter: v,
1750
1761
  zoomToExtent: E,
1751
- getCenter: I,
1752
- updateItemExtent: x,
1762
+ getCenter: O,
1763
+ updateItemExtent: C,
1753
1764
  vectorFromWrapperToBoard: f,
1754
1765
  fromWrapperToBoard: l,
1755
1766
  fromBoardToWrapper: d
1756
1767
  };
1757
- }, Vt = (e) => {
1758
- const [t, r, n] = Q(
1768
+ }, Ft = (e) => {
1769
+ const [t, r, n] = Z(
1759
1770
  ({ register: a, unregister: u, callInteractions: l }) => [
1760
1771
  a,
1761
1772
  u,
@@ -1773,8 +1784,8 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1773
1784
  [n, e]
1774
1785
  );
1775
1786
  return { register: o, call: s };
1776
- }, gt = () => {
1777
- const { call: e } = Vt("place"), { call: t } = Vt("delete"), { getCenter: r, updateItemExtent: n } = Me(), [o, s, a, u] = Q((P) => [
1787
+ }, ht = () => {
1788
+ const { call: e } = Ft("place"), { call: t } = Ft("delete"), { getCenter: r, updateItemExtent: n } = Me(), [o, s, a, u] = Z((P) => [
1778
1789
  P.clear,
1779
1790
  P.reverse,
1780
1791
  P.unselect,
@@ -1785,91 +1796,91 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1785
1796
  setItemIds: f,
1786
1797
  updateItems: c,
1787
1798
  moveItems: h,
1788
- removeItemsById: _,
1799
+ removeItemsById: S,
1789
1800
  getItemList: v,
1790
1801
  insertItems: E,
1791
- setItemList: I
1802
+ setItemList: O
1792
1803
  } = oe(
1793
1804
  ({
1794
1805
  getItems: P,
1795
1806
  getItemIds: $,
1796
- setItemIds: z,
1807
+ setItemIds: B,
1797
1808
  updateItems: V,
1798
- moveItems: Y,
1809
+ moveItems: L,
1799
1810
  removeItemsById: F,
1800
1811
  getItemList: H,
1801
1812
  insertItems: te,
1802
- setItemList: Z
1813
+ setItemList: Q
1803
1814
  }) => ({
1804
1815
  getItems: P,
1805
1816
  getItemIds: $,
1806
- setItemIds: z,
1817
+ setItemIds: B,
1807
1818
  updateItems: V,
1808
- moveItems: Y,
1819
+ moveItems: L,
1809
1820
  removeItemsById: F,
1810
1821
  getItemList: H,
1811
1822
  insertItems: te,
1812
- setItemList: Z
1823
+ setItemList: Q
1813
1824
  })
1814
1825
  ), y = g.useCallback(
1815
- (P, $, z = !1) => {
1826
+ (P, $, B = !1) => {
1816
1827
  let V = $;
1817
1828
  typeof $ == "object" && (V = () => $);
1818
- const Y = d().filter((Z) => P.includes(Z)), F = l(), H = Y.map((Z) => {
1819
- const ne = F[Z];
1820
- return z ? [Z, V(ne)] : [Z, V({ ...ne })];
1821
- }).filter(([, Z]) => Z);
1829
+ const L = d().filter((Q) => P.includes(Q)), F = l(), H = L.map((Q) => {
1830
+ const ne = F[Q];
1831
+ return B ? [Q, V(ne)] : [Q, V({ ...ne })];
1832
+ }).filter(([, Q]) => Q);
1822
1833
  if (H.length === 0)
1823
1834
  return;
1824
1835
  const te = Object.fromEntries(H);
1825
- c(te, z), n();
1836
+ c(te, B), n();
1826
1837
  },
1827
1838
  [d, l, n, c]
1828
- ), C = g.useCallback(
1839
+ ), x = g.useCallback(
1829
1840
  (P) => {
1830
- I(P), o(), n();
1841
+ O(P), o(), n();
1831
1842
  },
1832
- [o, I, n]
1833
- ), x = g.useCallback(
1834
- (P, $, z = !1) => {
1835
- y([P], $, z);
1843
+ [o, O, n]
1844
+ ), C = g.useCallback(
1845
+ (P, $, B = !1) => {
1846
+ y([P], $, B);
1836
1847
  },
1837
1848
  [y]
1838
1849
  ), p = g.useCallback(
1839
1850
  (P, $) => {
1840
1851
  h(
1841
- Bt(l(), d(), P),
1852
+ Nt(l(), d(), P),
1842
1853
  $
1843
- ), n();
1854
+ );
1844
1855
  },
1845
- [d, l, h, n]
1846
- ), w = g.useCallback(
1856
+ [d, l, h]
1857
+ ), _ = g.useCallback(
1847
1858
  (P) => {
1848
- const $ = d(), z = $.filter((Y) => !P.includes(Y)), V = $.filter(
1849
- (Y) => P.includes(Y)
1859
+ const $ = d(), B = $.filter((L) => !P.includes(L)), V = $.filter(
1860
+ (L) => P.includes(L)
1850
1861
  );
1851
- f([...z, ...V]);
1862
+ f([...B, ...V]);
1852
1863
  },
1853
1864
  [d, f]
1854
1865
  ), m = g.useCallback(
1855
- (P, { type: $, size: z } = {}) => {
1856
- const { boardWrapper: V } = u();
1866
+ (P, { type: $, size: B } = {}) => {
1867
+ const { uid: V } = u();
1857
1868
  y(
1858
1869
  P,
1859
- (Y) => {
1860
- const F = Ne(V, Y.id);
1870
+ (L) => {
1871
+ const F = Ne(V, L.id);
1861
1872
  if (!F)
1862
1873
  return;
1863
1874
  const H = {
1864
1875
  type: $ || "grid",
1865
- size: z || 1,
1876
+ size: B || 1,
1866
1877
  offset: { x: 0, y: 0 },
1867
- ...Y.grid
1878
+ ...L.grid
1868
1879
  };
1869
- return an(
1880
+ return cn(
1870
1881
  {
1871
- x: Y.x,
1872
- y: Y.y,
1882
+ x: L.x,
1883
+ y: L.y,
1873
1884
  width: F.clientWidth,
1874
1885
  height: F.clientHeight
1875
1886
  },
@@ -1880,47 +1891,47 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1880
1891
  );
1881
1892
  },
1882
1893
  [u, y]
1883
- ), S = g.useCallback(
1894
+ ), w = g.useCallback(
1884
1895
  (P, $) => {
1885
- const z = Bt(
1896
+ const B = Nt(
1886
1897
  l(),
1887
1898
  d(),
1888
1899
  P
1889
1900
  );
1890
- w(z), y(z, { moving: !1 }, !0), m(z, $), e(P), n();
1901
+ _(B), y(B, { moving: !1 }, !0), m(B, $), e(P), n();
1891
1902
  },
1892
1903
  [
1893
1904
  y,
1894
1905
  e,
1895
1906
  d,
1896
1907
  l,
1897
- w,
1908
+ _,
1898
1909
  m,
1899
1910
  n
1900
1911
  ]
1901
- ), O = g.useCallback(
1912
+ ), R = g.useCallback(
1902
1913
  (P) => {
1903
1914
  f(P);
1904
1915
  },
1905
1916
  [f]
1906
- ), k = g.useCallback(
1917
+ ), T = g.useCallback(
1907
1918
  (P) => {
1908
- const $ = d(), z = $.filter(
1909
- (Y) => P.includes(Y)
1910
- ), V = $.map((Y) => P.includes(Y) ? z.pop() : Y);
1919
+ const $ = d(), B = $.filter(
1920
+ (L) => P.includes(L)
1921
+ ), V = $.map((L) => P.includes(L) ? B.pop() : L);
1911
1922
  f(V), s();
1912
1923
  },
1913
1924
  [d, s, f]
1914
- ), j = g.useCallback(
1925
+ ), D = g.useCallback(
1915
1926
  (P, $) => {
1916
- const z = l(), V = Object.fromEntries(
1927
+ const B = l(), V = Object.fromEntries(
1917
1928
  $.map((H, te) => {
1918
- const Z = z[P[te]];
1929
+ const Q = B[P[te]];
1919
1930
  return [
1920
1931
  H,
1921
1932
  {
1922
- x: Z.x,
1923
- y: Z.y
1933
+ x: Q.x,
1934
+ y: Q.y
1924
1935
  }
1925
1936
  ];
1926
1937
  })
@@ -1930,52 +1941,52 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1930
1941
  (H) => V[H.id],
1931
1942
  !0
1932
1943
  );
1933
- const Y = Object.fromEntries(
1944
+ const L = Object.fromEntries(
1934
1945
  P.map((H, te) => [H, $[te]])
1935
- ), F = d().map((H) => P.includes(H) ? Y[H] : H);
1946
+ ), F = d().map((H) => P.includes(H) ? L[H] : H);
1936
1947
  f(F);
1937
1948
  },
1938
1949
  [l, y, d, f]
1939
1950
  ), M = g.useCallback(
1940
1951
  (P, $) => {
1941
- const z = r(), V = P.map((Y, F) => !Y.x || !Y.y ? { ...Y, x: z.x + 2 * F, y: z.y + 2 * F } : Y);
1942
- E(V, $), n();
1952
+ const B = r(), V = P.map((L, F) => !L.x || !L.y ? { ...L, x: B.x + 2 * F, y: B.y + 2 * F } : L);
1953
+ E(V, $), w(P.map(({ id: L }) => L));
1943
1954
  },
1944
- [r, E, n]
1955
+ [r, E, w]
1945
1956
  ), A = g.useCallback(
1946
1957
  (P, $) => {
1947
1958
  M([P], $);
1948
1959
  },
1949
1960
  [M]
1950
- ), N = g.useCallback(
1961
+ ), Y = g.useCallback(
1951
1962
  (P) => {
1952
- a(P), _(P), t(P);
1963
+ a(P), S(P), t(P);
1953
1964
  },
1954
- [a, _, t]
1965
+ [a, S, t]
1955
1966
  ), U = g.useCallback(
1956
1967
  (P) => {
1957
1968
  const $ = l();
1958
- return P.map((z) => $[z]);
1969
+ return P.map((B) => $[B]);
1959
1970
  },
1960
1971
  [l]
1961
- ), J = g.useCallback(
1962
- ({ target: P, clientX: $, clientY: z }, { returnLocked: V = !1, passLocked: Y = !1 } = {}) => {
1972
+ ), G = g.useCallback(
1973
+ ({ target: P, clientX: $, clientY: B }, { returnLocked: V = !1, passLocked: L = !1 } = {}) => {
1963
1974
  if (["INPUT", "TEXTAREA"].includes(P.tagName))
1964
1975
  return null;
1965
1976
  const F = Oe(P, "item");
1966
1977
  if (F) {
1967
1978
  if (ye(F, "selected"))
1968
1979
  return F;
1969
- if (!Y && ye(F, "locked") && !ye(P, "passthrough"))
1980
+ if (!L && ye(F, "locked") && !ye(P, "passthrough"))
1970
1981
  return V ? F : null;
1971
1982
  if (ye(P, "passthrough")) {
1972
- const H = d(), { boardWrapper: te } = u(), Z = H.reduce((ne, ie) => {
1983
+ const H = d(), { uid: te } = u(), Q = H.reduce((ne, ie) => {
1973
1984
  const me = Ne(te, ie), ge = me.getBoundingClientRect();
1974
- return ft({ x: $, y: z }, ge) && ne.unshift(me), ne;
1985
+ return dt({ x: $, y: B }, ge) && ne.unshift(me), ne;
1975
1986
  }, []);
1976
- for (let ne = 0; ne < Z.length; ne += 1) {
1977
- const ie = Z[ne];
1978
- if (ie !== F && (Y || !ye(ie, "locked")))
1987
+ for (let ne = 0; ne < Q.length; ne += 1) {
1988
+ const ie = Q[ne];
1989
+ if (ie !== F && (L || !ye(ie, "locked")))
1979
1990
  return ie;
1980
1991
  }
1981
1992
  return null;
@@ -1986,24 +1997,24 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
1986
1997
  [u, d]
1987
1998
  );
1988
1999
  return {
1989
- putItemsOnTop: w,
2000
+ putItemsOnTop: _,
1990
2001
  batchUpdateItems: y,
1991
- updateItemOrder: O,
2002
+ updateItemOrder: R,
1992
2003
  moveItems: p,
1993
- placeItems: S,
1994
- updateItem: x,
1995
- swapItems: j,
1996
- reverseItemsOrder: k,
1997
- setItemList: C,
2004
+ placeItems: w,
2005
+ updateItem: C,
2006
+ swapItems: D,
2007
+ reverseItemsOrder: T,
2008
+ setItemList: x,
1998
2009
  pushItem: A,
1999
2010
  pushItems: M,
2000
- removeItems: N,
2011
+ removeItems: Y,
2001
2012
  getItemList: v,
2002
- findElementUnderPointer: J,
2013
+ findElementUnderPointer: G,
2003
2014
  getItems: U
2004
2015
  };
2005
2016
  };
2006
- var wn = function e(t, r) {
2017
+ var xn = function e(t, r) {
2007
2018
  if (t === r)
2008
2019
  return !0;
2009
2020
  if (t && r && typeof t == "object" && typeof r == "object") {
@@ -2066,22 +2077,22 @@ var wn = function e(t, r) {
2066
2077
  return t !== t && r !== r;
2067
2078
  };
2068
2079
  function Cn(e, t, r, n = 0) {
2069
- Pe(mt(e, t, r, n), t);
2080
+ Pe(gt(e, t, r, n), t);
2070
2081
  }
2071
- const xn = (e, t) => {
2082
+ const Rn = (e, t) => {
2072
2083
  if (e.type in t) {
2073
2084
  const r = t[e.type].defaultActions;
2074
2085
  return typeof r == "function" ? r(e) : r;
2075
2086
  }
2076
2087
  return [];
2077
- }, Ft = (e, t) => {
2078
- const { actions: r = xn(e, t) } = e;
2088
+ }, Kt = (e, t) => {
2089
+ const { actions: r = Rn(e, t) } = e;
2079
2090
  return r.map((n) => typeof n == "string" ? { name: n } : n);
2080
- }, is = () => {
2091
+ }, cs = () => {
2081
2092
  const [e, t] = oe((c) => [
2082
2093
  c.items,
2083
2094
  c.getItems
2084
- ]), [r, n, o] = Q((c) => [
2095
+ ]), [r, n, o] = Z((c) => [
2085
2096
  c.config.itemTemplates,
2086
2097
  c.selection,
2087
2098
  c.getSelection
@@ -2094,23 +2105,23 @@ const xn = (e, t) => {
2094
2105
  const h = t();
2095
2106
  if (c)
2096
2107
  return [c, c.map((v) => h[v])];
2097
- const _ = o();
2098
- return [_, _.map((v) => h[v])];
2108
+ const S = o();
2109
+ return [S, S.map((v) => h[v])];
2099
2110
  },
2100
2111
  [t, o]
2101
- ), f = tr(() => {
2112
+ ), f = rr(() => {
2102
2113
  const [c, h] = d();
2103
2114
  if (c.length > 0) {
2104
2115
  if (!u.current)
2105
2116
  return;
2106
- const _ = h.reduce((v, E) => {
2107
- const I = Ft(E, r);
2117
+ const S = h.reduce((v, E) => {
2118
+ const O = Kt(E, r);
2108
2119
  return v.filter(
2109
- (y) => I.some((C) => wn(y, C))
2120
+ (y) => O.some((x) => xn(y, x))
2110
2121
  );
2111
- }, Ft(h[0], r));
2122
+ }, Kt(h[0], r));
2112
2123
  l(() => {
2113
- a(_);
2124
+ a(S);
2114
2125
  });
2115
2126
  } else
2116
2127
  l(() => {
@@ -2124,30 +2135,30 @@ const xn = (e, t) => {
2124
2135
  ), {
2125
2136
  availableActions: s
2126
2137
  };
2127
- }, as = () => {
2128
- const [e] = Q((t) => [t.selectionBox]);
2138
+ }, us = () => {
2139
+ const [e] = Z((t) => [t.selectionBox]);
2129
2140
  return e;
2130
2141
  };
2131
2142
  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), "");
2132
- const lr = g.createContext(), ut = (e) => {
2143
+ const fr = g.createContext(), lt = (e) => {
2133
2144
  localStorage.setItem("user", JSON.stringify(e));
2134
- }, Rn = () => {
2145
+ }, In = () => {
2135
2146
  if (localStorage.user) {
2136
2147
  const t = {
2137
2148
  name: "Player",
2138
- color: Xt(),
2149
+ color: Ut(),
2139
2150
  uid: pe(),
2140
2151
  ...JSON.parse(localStorage.user)
2141
2152
  };
2142
- return ut(t), t;
2153
+ return lt(t), t;
2143
2154
  }
2144
2155
  const e = {
2145
2156
  name: "Player",
2146
- color: Xt(),
2157
+ color: Ut(),
2147
2158
  uid: pe()
2148
2159
  };
2149
- return ut(e), e;
2150
- }, In = (e) => (t, r) => ({
2160
+ return lt(e), e;
2161
+ }, On = (e) => (t, r) => ({
2151
2162
  isSpaceMaster: !1,
2152
2163
  users: {},
2153
2164
  getUser: () => r().users[e],
@@ -2169,7 +2180,7 @@ const lr = g.createContext(), ut = (e) => {
2169
2180
  id: n,
2170
2181
  uid: s.users[n].uid
2171
2182
  };
2172
- return a.id === e && ut(a), setTimeout(() => r().electSpaceMaster(), 100), {
2183
+ return a.id === e && lt(a), setTimeout(() => r().electSpaceMaster(), 100), {
2173
2184
  users: {
2174
2185
  ...s.users,
2175
2186
  [n]: a
@@ -2192,14 +2203,14 @@ const lr = g.createContext(), ut = (e) => {
2192
2203
  s < o.timestamp && (o.id = a, o.timestamp = s);
2193
2204
  }), t({ isSpaceMaster: o.id === e });
2194
2205
  }
2195
- }), On = (e) => ({
2206
+ }), Tn = (e) => ({
2196
2207
  cursors: {},
2197
2208
  moveCursor: (t, r) => e((n) => ({ cursors: { ...n.cursors, [t]: r } })),
2198
2209
  removeCursor: (t) => e((r) => {
2199
2210
  const n = { ...r.cursors };
2200
2211
  return delete n[t], { cursors: n };
2201
2212
  })
2202
- }), fr = ({ storeName: e, children: t }) => {
2213
+ }), dr = ({ storeName: e, children: t }) => {
2203
2214
  const { wire: r, isMaster: n } = Xe("room"), [o, s] = g.useState(null), [a, u] = g.useState(!1), l = g.useRef(!1);
2204
2215
  return g.useEffect(() => {
2205
2216
  let d = !0;
@@ -2207,7 +2218,7 @@ const lr = g.createContext(), ut = (e) => {
2207
2218
  if (!o && !l.current)
2208
2219
  return l.current = !0, (() => {
2209
2220
  const h = Ue(
2210
- dt(
2221
+ pt(
2211
2222
  {
2212
2223
  wire: r,
2213
2224
  storeName: e,
@@ -2219,12 +2230,12 @@ const lr = g.createContext(), ut = (e) => {
2219
2230
  ]
2220
2231
  },
2221
2232
  (...v) => ({
2222
- ...In(r.userId)(...v),
2223
- ...On(...v)
2233
+ ...On(r.userId)(...v),
2234
+ ...Tn(...v)
2224
2235
  })
2225
2236
  )
2226
- ), _ = h.subscribe((v) => {
2227
- v.ready && (_(), d && s(h));
2237
+ ), S = h.subscribe((v) => {
2238
+ v.ready && (S(), d && s(h));
2228
2239
  });
2229
2240
  })(), () => {
2230
2241
  d = !1, l.current = !1, f.forEach((h) => h());
@@ -2232,7 +2243,7 @@ const lr = g.createContext(), ut = (e) => {
2232
2243
  }, [o, e, r, r.userId]), g.useEffect(() => {
2233
2244
  if (o)
2234
2245
  return o.getState().addUser({
2235
- ...Rn(),
2246
+ ...In(),
2236
2247
  id: r.userId
2237
2248
  }), u(!0), () => {
2238
2249
  o.getState().removeUser(r.userId);
@@ -2248,11 +2259,11 @@ const lr = g.createContext(), ut = (e) => {
2248
2259
  }
2249
2260
  }, [n, o, r]), g.useEffect(() => {
2250
2261
  n && o && o.getState().updateCurrentUser({ isMaster: n });
2251
- }, [n, o, r]), a ? /* @__PURE__ */ T(lr.Provider, { value: o, children: t }) : null;
2262
+ }, [n, o, r]), a ? /* @__PURE__ */ k(fr.Provider, { value: o, children: t }) : null;
2252
2263
  }, Se = (e, t) => {
2253
- const r = _e(lr);
2264
+ const r = _e(fr);
2254
2265
  return We(r, e, t || Ve);
2255
- }, cs = () => {
2266
+ }, ls = () => {
2256
2267
  const [e, t, r, n, o] = Se((u) => [
2257
2268
  u.isSpaceMaster,
2258
2269
  u.getUser(),
@@ -2271,7 +2282,7 @@ const lr = g.createContext(), ut = (e) => {
2271
2282
  localUsers: a,
2272
2283
  joinSpace: o
2273
2284
  };
2274
- }, us = () => {
2285
+ }, fs = () => {
2275
2286
  const [e, t, r] = oe(
2276
2287
  (o) => [o.boardConfig, o.getBoardConfig, o.setBoardConfig]
2277
2288
  ), n = g.useCallback(
@@ -2284,10 +2295,10 @@ const lr = g.createContext(), ut = (e) => {
2284
2295
  [t, r]
2285
2296
  );
2286
2297
  return [e, n];
2287
- }, ls = () => {
2288
- const [e] = Q((t) => [t.boardState]);
2298
+ }, ds = () => {
2299
+ const [e] = Z((t) => [t.boardState]);
2289
2300
  return e;
2290
- }, fs = () => {
2301
+ }, ps = () => {
2291
2302
  const [e, t, r, n] = oe((o) => [
2292
2303
  o.getSessionInfo,
2293
2304
  o.setSessionInfo,
@@ -2295,13 +2306,13 @@ const lr = g.createContext(), ut = (e) => {
2295
2306
  o.session
2296
2307
  ]);
2297
2308
  return { getSessionInfo: e, setSessionInfo: t, sessionInfo: n, updateSessionInfo: r };
2298
- }, dr = g.createContext(), Tn = ({ user: { name: e, uid: t, color: r }, content: n }) => ({
2309
+ }, pr = g.createContext(), kn = ({ user: { name: e, uid: t, color: r }, content: n }) => ({
2299
2310
  type: "message",
2300
2311
  user: { name: e, uid: t, color: r },
2301
2312
  content: n,
2302
2313
  uid: pe(),
2303
2314
  timestamp: new Date().toISOString()
2304
- }), kn = (e, t) => ({
2315
+ }), Pn = (e, t) => ({
2305
2316
  messages: [],
2306
2317
  setMessages: (r) => e({
2307
2318
  messages: r.map((n) => ({
@@ -2316,34 +2327,34 @@ const lr = g.createContext(), ut = (e) => {
2316
2327
  ]
2317
2328
  })),
2318
2329
  sendMessage: (r, n) => {
2319
- const o = Tn({
2330
+ const o = kn({
2320
2331
  user: r,
2321
2332
  content: n
2322
2333
  });
2323
2334
  o && t().addMessage(o);
2324
2335
  }
2325
- }), Kt = ({
2336
+ }), Ht = ({
2326
2337
  storeName: e,
2327
2338
  children: t,
2328
2339
  defaultValue: r = []
2329
2340
  }) => {
2330
2341
  const { wire: n } = Xe("room"), [o] = g.useState(
2331
2342
  () => Ue(
2332
- dt(
2343
+ pt(
2333
2344
  { wire: n, storeName: e, defaultValue: r, noSync: ["sendMessage"] },
2334
2345
  (...s) => ({
2335
- ...kn(...s)
2346
+ ...Pn(...s)
2336
2347
  })
2337
2348
  )
2338
2349
  )
2339
2350
  );
2340
- return /* @__PURE__ */ T(dr.Provider, { value: o, children: t });
2341
- }, Pn = (e, t) => {
2342
- const r = _e(dr);
2351
+ return /* @__PURE__ */ k(pr.Provider, { value: o, children: t });
2352
+ }, Mn = (e, t) => {
2353
+ const r = _e(pr);
2343
2354
  return We(r, e, t || Ve);
2344
- }, Mn = () => {
2345
- }, ds = (e = Mn) => {
2346
- const t = Se((a) => a.getUser()), [r, n, o] = Pn((a) => [
2355
+ }, Dn = () => {
2356
+ }, ms = (e = Dn) => {
2357
+ const t = Se((a) => a.getUser()), [r, n, o] = Mn((a) => [
2347
2358
  a.messages,
2348
2359
  a.setMessages,
2349
2360
  a.sendMessage
@@ -2358,12 +2369,12 @@ const lr = g.createContext(), ut = (e) => {
2358
2369
  [t, o]
2359
2370
  );
2360
2371
  return { messages: r, setMessages: n, sendMessage: s };
2361
- }, Ht = ({ children: e, session: t }) => {
2372
+ }, qt = ({ children: e, session: t }) => {
2362
2373
  const r = Se((n) => n.joinSpace);
2363
2374
  return g.useEffect(() => (r(t), () => {
2364
2375
  r(null);
2365
2376
  }), [r, t]), e;
2366
- }, ps = ({
2377
+ }, gs = ({
2367
2378
  socket: e,
2368
2379
  room: t,
2369
2380
  session: r,
@@ -2376,60 +2387,148 @@ const lr = g.createContext(), ut = (e) => {
2376
2387
  itemIds: n.map(({ id: c }) => c),
2377
2388
  items: Object.fromEntries(n.map((c) => [c.id, c]))
2378
2389
  }));
2379
- return Xe("room") ? /* @__PURE__ */ T(
2380
- Kt,
2390
+ return Xe("room") ? /* @__PURE__ */ k(
2391
+ Ht,
2381
2392
  {
2382
2393
  storeName: `${l}_messages`,
2383
2394
  defaultValue: o,
2384
- children: /* @__PURE__ */ T(Wt, { children: /* @__PURE__ */ T(
2385
- Ut,
2395
+ children: /* @__PURE__ */ k(Vt, { children: /* @__PURE__ */ k(
2396
+ Wt,
2386
2397
  {
2387
2398
  storeName: `${l}_item`,
2388
2399
  defaultValue: d,
2389
- children: /* @__PURE__ */ T(Ht, { ...a, session: l })
2400
+ children: /* @__PURE__ */ k(qt, { ...a, session: l })
2390
2401
  }
2391
2402
  ) })
2392
2403
  }
2393
- ) : /* @__PURE__ */ T(
2394
- nr,
2404
+ ) : /* @__PURE__ */ k(
2405
+ or,
2395
2406
  {
2396
2407
  room: u,
2397
2408
  channel: "room",
2398
2409
  socket: e,
2399
2410
  LoadingComponent: s,
2400
- children: /* @__PURE__ */ T(fr, { storeName: `${u}_users`, children: /* @__PURE__ */ T(
2401
- Kt,
2411
+ children: /* @__PURE__ */ k(dr, { storeName: `${u}_users`, children: /* @__PURE__ */ k(
2412
+ Ht,
2402
2413
  {
2403
2414
  storeName: `${l}_messages`,
2404
2415
  defaultValue: o,
2405
- children: /* @__PURE__ */ T(Wt, { children: /* @__PURE__ */ T(
2406
- Ut,
2416
+ children: /* @__PURE__ */ k(Vt, { children: /* @__PURE__ */ k(
2417
+ Wt,
2407
2418
  {
2408
2419
  storeName: `${l}_item`,
2409
2420
  defaultValue: d,
2410
- children: /* @__PURE__ */ T(Ht, { ...a, session: l })
2421
+ children: /* @__PURE__ */ k(qt, { ...a, session: l })
2411
2422
  }
2412
2423
  ) })
2413
2424
  }
2414
2425
  ) })
2415
2426
  }
2416
2427
  );
2417
- }, ms = ({ socket: e, room: t, children: r, LoadingComponent: n }) => {
2428
+ }, hs = ({ socket: e, room: t, children: r, LoadingComponent: n }) => {
2418
2429
  const [o] = g.useState(t || pe());
2419
- return /* @__PURE__ */ T(
2420
- nr,
2430
+ return /* @__PURE__ */ k(
2431
+ or,
2421
2432
  {
2422
2433
  room: o,
2423
2434
  channel: "room",
2424
2435
  socket: e,
2425
2436
  LoadingComponent: n,
2426
- children: /* @__PURE__ */ T(fr, { storeName: `${o}_users`, children: r })
2437
+ children: /* @__PURE__ */ k(dr, { storeName: `${o}_users`, children: r })
2427
2438
  }
2428
2439
  );
2429
- }, nt = () => {
2440
+ };
2441
+ let jn = { data: "" }, $n = (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, An = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, Ln = /\/\*[^]*?\*\/| +/g, Gt = /\n+/g, fe = (e, t) => {
2442
+ let r = "", n = "", o = "";
2443
+ for (let s in e) {
2444
+ let a = e[s];
2445
+ 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 + ";");
2446
+ }
2447
+ return r + (t && o ? t + "{" + o + "}" : o) + n;
2448
+ }, ce = {}, mr = (e) => {
2449
+ if (typeof e == "object") {
2450
+ let t = "";
2451
+ for (let r in e)
2452
+ t += r + mr(e[r]);
2453
+ return t;
2454
+ }
2455
+ return e;
2456
+ }, zn = (e, t, r, n, o) => {
2457
+ let s = mr(e), a = ce[s] || (ce[s] = ((l) => {
2458
+ let d = 0, f = 11;
2459
+ for (; d < l.length; )
2460
+ f = 101 * f + l.charCodeAt(d++) >>> 0;
2461
+ return "go" + f;
2462
+ })(s));
2463
+ if (!ce[a]) {
2464
+ let l = s !== e ? e : ((d) => {
2465
+ let f, c, h = [{}];
2466
+ for (; f = An.exec(d.replace(Ln, "")); )
2467
+ f[4] ? h.shift() : f[3] ? (c = f[3].replace(Gt, " ").trim(), h.unshift(h[0][c] = h[0][c] || {})) : h[0][f[1]] = f[2].replace(Gt, " ").trim();
2468
+ return h[0];
2469
+ })(e);
2470
+ ce[a] = fe(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
2471
+ }
2472
+ let u = r && ce.g ? ce.g : null;
2473
+ return r && (ce.g = ce[a]), ((l, d, f, c) => {
2474
+ c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = f ? l + d.data : d.data + l);
2475
+ })(ce[a], t, n, u), a;
2476
+ }, Yn = (e, t, r) => e.reduce((n, o, s) => {
2477
+ let a = t[s];
2478
+ if (a && a.call) {
2479
+ let u = a(r), l = u && u.props && u.props.className || /^go/.test(u) && u;
2480
+ a = l ? "." + l : u && typeof u == "object" ? u.props ? "" : fe(u, "") : u === !1 ? "" : u;
2481
+ }
2482
+ return n + o + (a ?? "");
2483
+ }, "");
2484
+ function K(e) {
2485
+ let t = this || {}, r = e.call ? e(t.p) : e;
2486
+ return zn(r.unshift ? r.raw ? Yn(r, [].slice.call(arguments, 1), t.p) : r.reduce((n, o) => Object.assign(n, o && o.call ? o(t.p) : o), {}) : r, $n(t.target), t.g, t.o, t.k);
2487
+ }
2488
+ K.bind({ g: 1 });
2489
+ K.bind({ k: 1 });
2490
+ function Bn(e, t, r, n) {
2491
+ fe.p = t;
2492
+ }
2493
+ var Nn = function e(t, r) {
2494
+ if (t === r)
2495
+ return !0;
2496
+ if (t && r && typeof t == "object" && typeof r == "object") {
2497
+ if (t.constructor !== r.constructor)
2498
+ return !1;
2499
+ var n, o, s;
2500
+ if (Array.isArray(t)) {
2501
+ if (n = t.length, n != r.length)
2502
+ return !1;
2503
+ for (o = n; o-- !== 0; )
2504
+ if (!e(t[o], r[o]))
2505
+ return !1;
2506
+ return !0;
2507
+ }
2508
+ if (t.constructor === RegExp)
2509
+ return t.source === r.source && t.flags === r.flags;
2510
+ if (t.valueOf !== Object.prototype.valueOf)
2511
+ return t.valueOf() === r.valueOf();
2512
+ if (t.toString !== Object.prototype.toString)
2513
+ return t.toString() === r.toString();
2514
+ if (s = Object.keys(t), n = s.length, n !== Object.keys(r).length)
2515
+ return !1;
2516
+ for (o = n; o-- !== 0; )
2517
+ if (!Object.prototype.hasOwnProperty.call(r, s[o]))
2518
+ return !1;
2519
+ for (o = n; o-- !== 0; ) {
2520
+ var a = s[o];
2521
+ if (!e(t[a], r[a]))
2522
+ return !1;
2523
+ }
2524
+ return !0;
2525
+ }
2526
+ return t !== t && r !== r;
2527
+ };
2528
+ const ot = () => {
2430
2529
  const e = navigator.userAgent.toLowerCase();
2431
2530
  return /mac os ?x 10/.test(e);
2432
- }, jn = () => {
2531
+ }, Xn = () => {
2433
2532
  const e = document.createElement("iframe");
2434
2533
  e.src = "#", document.body.appendChild(e);
2435
2534
  const t = e.contentWindow.document;
@@ -2438,34 +2537,34 @@ const lr = g.createContext(), ut = (e) => {
2438
2537
  ), t.close();
2439
2538
  const r = t.body.firstElementChild.offsetHeight;
2440
2539
  return document.body.removeChild(e), r;
2441
- }, Dn = jn(), $n = 800, qt = (e, t) => {
2540
+ }, Un = Xn(), Wn = 800, Jt = (e, t) => {
2442
2541
  const r = Object.keys(e).map((n) => Number(n)).find((n) => n !== t);
2443
2542
  return e[r];
2444
- }, Gt = ([e, t], [r, n]) => {
2543
+ }, Zt = ([e, t], [r, n]) => {
2445
2544
  const o = Math.abs(e - r), s = Math.abs(t - n);
2446
2545
  return Math.hypot(o, s);
2447
2546
  }, de = () => {
2448
- }, An = (e) => (t) => {
2547
+ }, Vn = (e) => (t) => {
2449
2548
  const { event: r } = t;
2450
2549
  return r.isPropagationStopped() ? null : e(t);
2451
- }, Ln = (e) => async (...t) => {
2550
+ }, Fn = (e) => async (...t) => {
2452
2551
  try {
2453
2552
  await e(...t);
2454
2553
  } catch (r) {
2455
2554
  console.error(r);
2456
2555
  }
2457
2556
  };
2458
- class zn {
2557
+ class Kn {
2459
2558
  constructor() {
2460
- kt(this, "lastPromise", Promise.resolve(!0));
2559
+ Pt(this, "lastPromise", Promise.resolve(!0));
2461
2560
  }
2462
2561
  add(t, ...r) {
2463
2562
  return new Promise((n, o) => {
2464
- this.lastPromise = this.lastPromise.then(() => An(Ln(t))(...r)).then(n).catch(o);
2563
+ this.lastPromise = this.lastPromise.then(() => Vn(Fn(t))(...r)).then(n).catch(o);
2465
2564
  });
2466
2565
  }
2467
2566
  }
2468
- const se = new zn(), Fe = ({
2567
+ const se = new Kn(), Fe = ({
2469
2568
  children: e,
2470
2569
  onDrag: t = de,
2471
2570
  onDragStart: r = de,
@@ -2483,73 +2582,73 @@ const se = new zn(), Fe = ({
2483
2582
  mainPointer: void 0
2484
2583
  }), h = (y) => {
2485
2584
  const {
2486
- deltaX: C,
2487
- deltaY: x,
2585
+ deltaX: x,
2586
+ deltaY: C,
2488
2587
  clientX: p,
2489
- clientY: w,
2588
+ clientY: _,
2490
2589
  deltaMode: m,
2491
- ctrlKey: S,
2492
- altKey: O,
2493
- metaKey: k,
2494
- target: j
2590
+ ctrlKey: w,
2591
+ altKey: R,
2592
+ metaKey: T,
2593
+ target: D
2495
2594
  } = y;
2496
- if (!(O || S && !nt()))
2497
- if (nt() && !S)
2595
+ if (!(R || w && !ot()))
2596
+ if (ot() && !w)
2498
2597
  se.add(o, {
2499
- deltaX: -2 * C,
2500
- deltaY: -2 * x,
2598
+ deltaX: -2 * x,
2599
+ deltaY: -2 * C,
2501
2600
  button: 1,
2502
- ctrlKey: S,
2503
- metaKey: k,
2504
- target: j,
2601
+ ctrlKey: w,
2602
+ metaKey: T,
2603
+ target: D,
2505
2604
  event: y
2506
2605
  });
2507
2606
  else {
2508
- if (l === void 0 || !x)
2607
+ if (l === void 0 || !C)
2509
2608
  return;
2510
- let M = x;
2609
+ let M = C;
2511
2610
  switch (m) {
2512
2611
  case 1:
2513
- M *= Dn;
2612
+ M *= Un;
2514
2613
  break;
2515
2614
  case 2:
2516
- M *= $n;
2615
+ M *= Wn;
2517
2616
  break;
2518
2617
  }
2519
- nt() && (M *= 2), se.add(l, { scale: M, clientX: p, clientY: w, event: y });
2618
+ ot() && (M *= 2), se.add(l, { scale: M, clientX: p, clientY: _, event: y });
2520
2619
  }
2521
- }, _ = (y) => {
2620
+ }, S = (y) => {
2522
2621
  const {
2523
- target: C,
2524
- button: x,
2622
+ target: x,
2623
+ button: C,
2525
2624
  clientX: p,
2526
- clientY: w,
2625
+ clientY: _,
2527
2626
  pointerId: m,
2528
- altKey: S,
2529
- ctrlKey: O,
2530
- metaKey: k,
2531
- isPrimary: j
2627
+ altKey: w,
2628
+ ctrlKey: R,
2629
+ metaKey: T,
2630
+ isPrimary: D
2532
2631
  } = y;
2533
- if (c.current.pointers[m] = { clientX: p, clientY: w }, j && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
2632
+ if (c.current.pointers[m] = { clientX: p, clientY: _ }, D && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
2534
2633
  if (c.current.mainPointer !== m)
2535
2634
  try {
2536
- const { clientX: M, clientY: A } = qt(
2635
+ const { clientX: M, clientY: A } = Jt(
2537
2636
  c.current.pointers,
2538
2637
  m
2539
- ), N = (M + p) / 2, U = (A + w) / 2, J = Gt(
2638
+ ), Y = (M + p) / 2, U = (A + _) / 2, G = Zt(
2540
2639
  [M, A],
2541
- [p, w]
2640
+ [p, _]
2542
2641
  );
2543
2642
  Object.assign(c.current, {
2544
2643
  pressed: !0,
2545
2644
  moving: !1,
2546
2645
  gestureStart: !1,
2547
2646
  startX: p,
2548
- startY: w,
2549
- prevX: N,
2647
+ startY: _,
2648
+ prevX: Y,
2550
2649
  prevY: U,
2551
- startDistance: J,
2552
- prevDistance: J
2650
+ startDistance: G,
2651
+ prevDistance: G
2553
2652
  });
2554
2653
  } catch (M) {
2555
2654
  console.log("Error while getting other pointer. Ignoring", M), c.current.mainPointer;
@@ -2561,65 +2660,65 @@ const se = new zn(), Fe = ({
2561
2660
  moving: !1,
2562
2661
  gestureStart: !1,
2563
2662
  startX: p,
2564
- startY: w,
2663
+ startY: _,
2565
2664
  prevX: p,
2566
- prevY: w,
2567
- currentButton: x,
2665
+ prevY: _,
2666
+ currentButton: C,
2568
2667
  pointerDownEvent: y,
2569
2668
  startDistance: 0,
2570
2669
  prevDistance: 0,
2571
- target: C,
2670
+ target: x,
2572
2671
  timeStart: Date.now(),
2573
2672
  longTapTimeout: setTimeout(async () => {
2574
2673
  c.current.noTap = !0, se.add(a, {
2575
2674
  clientX: p,
2576
- clientY: w,
2577
- altKey: S,
2578
- ctrlKey: O,
2579
- metaKey: k,
2580
- target: C,
2675
+ clientY: _,
2676
+ altKey: w,
2677
+ ctrlKey: R,
2678
+ metaKey: T,
2679
+ target: x,
2581
2680
  event: y
2582
2681
  });
2583
2682
  }, 750)
2584
2683
  });
2585
2684
  try {
2586
- C.setPointerCapture(m);
2685
+ x.setPointerCapture(m);
2587
2686
  } catch (M) {
2588
2687
  console.log("Fail to capture pointer", M);
2589
2688
  }
2590
2689
  }, v = (y) => {
2591
2690
  if (c.current.pressed) {
2592
2691
  const {
2593
- pointerId: C,
2594
- clientX: x,
2692
+ pointerId: x,
2693
+ clientX: C,
2595
2694
  clientY: p,
2596
- altKey: w,
2695
+ altKey: _,
2597
2696
  shiftKey: m,
2598
- ctrlKey: S,
2599
- metaKey: O,
2600
- buttons: k
2697
+ ctrlKey: w,
2698
+ metaKey: R,
2699
+ buttons: T
2601
2700
  } = y;
2602
- c.current.pointers[C] = {
2603
- clientX: x,
2701
+ c.current.pointers[x] = {
2702
+ clientX: C,
2604
2703
  clientY: p
2605
2704
  }, c.current.moving = !0;
2606
- const j = Object.keys(c.current.pointers).length === 2;
2607
- let M, A, N = 0;
2608
- if (j) {
2609
- const { clientX: $, clientY: z } = qt(
2705
+ const D = Object.keys(c.current.pointers).length === 2;
2706
+ let M, A, Y = 0;
2707
+ if (D) {
2708
+ const { clientX: $, clientY: B } = Jt(
2610
2709
  c.current.pointers,
2611
- C
2710
+ x
2612
2711
  );
2613
- M = ($ + x) / 2, A = (z + p) / 2, N = Gt(
2614
- [$, z],
2615
- [x, p]
2712
+ M = ($ + C) / 2, A = (B + p) / 2, Y = Zt(
2713
+ [$, B],
2714
+ [C, p]
2616
2715
  );
2617
2716
  } else
2618
- M = x, A = p;
2619
- let U = m || w || S || O || k !== 1;
2717
+ M = C, A = p;
2718
+ let U = m || _ || w || R || T !== 1;
2620
2719
  d !== "drag" && (U = !U);
2621
- const J = !U, P = U;
2622
- if (J) {
2720
+ const G = !U, P = U;
2721
+ if (G) {
2623
2722
  c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout), se.add(r, {
2624
2723
  deltaX: 0,
2625
2724
  deltaY: 0,
@@ -2630,73 +2729,73 @@ const se = new zn(), Fe = ({
2630
2729
  distanceX: 0,
2631
2730
  distanceY: 0,
2632
2731
  button: c.current.currentButton,
2633
- altKey: w,
2732
+ altKey: _,
2634
2733
  shiftKey: m,
2635
- ctrlKey: S,
2636
- metaKey: O,
2734
+ ctrlKey: w,
2735
+ metaKey: R,
2637
2736
  target: c.current.target,
2638
2737
  event: c.current.pointerDownEvent
2639
2738
  }));
2640
- const $ = M - c.current.prevX, z = A - c.current.prevY, V = M - c.current.startX, Y = A - c.current.startY;
2739
+ const $ = M - c.current.prevX, B = A - c.current.prevY, V = M - c.current.startX, L = A - c.current.startY;
2641
2740
  se.add(t, {
2642
2741
  deltaX: $,
2643
- deltaY: z,
2742
+ deltaY: B,
2644
2743
  startX: c.current.startX,
2645
2744
  startY: c.current.startY,
2646
2745
  clientX: M,
2647
2746
  clientY: A,
2648
2747
  distanceX: V,
2649
- distanceY: Y,
2748
+ distanceY: L,
2650
2749
  button: c.current.currentButton,
2651
- altKey: w,
2750
+ altKey: _,
2652
2751
  shiftKey: m,
2653
- ctrlKey: S,
2654
- metaKey: O,
2752
+ ctrlKey: w,
2753
+ metaKey: R,
2655
2754
  target: c.current.target,
2656
2755
  event: y
2657
2756
  });
2658
2757
  }
2659
2758
  if (P) {
2660
2759
  c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout));
2661
- const $ = M - c.current.prevX, z = A - c.current.prevY, { target: V } = c.current;
2760
+ const $ = M - c.current.prevX, B = A - c.current.prevY, { target: V } = c.current;
2662
2761
  if (se.add(o, {
2663
2762
  deltaX: $,
2664
- deltaY: z,
2763
+ deltaY: B,
2665
2764
  button: c.current.currentButton,
2666
- altKey: w,
2765
+ altKey: _,
2667
2766
  shiftKey: m,
2668
- ctrlKey: S,
2669
- metaKey: O,
2767
+ ctrlKey: w,
2768
+ metaKey: R,
2670
2769
  target: V,
2671
2770
  event: y
2672
- }), N !== c.current.prevDistance && l) {
2673
- const Y = c.current.prevDistance - N;
2674
- Math.abs(Y) > 0 && (se.add(l, {
2675
- scale: Y * 3,
2771
+ }), Y !== c.current.prevDistance && l) {
2772
+ const L = c.current.prevDistance - Y;
2773
+ Math.abs(L) > 0 && (se.add(l, {
2774
+ scale: L * 3,
2676
2775
  clientX: M,
2677
2776
  clientY: A,
2678
2777
  event: y
2679
- }), c.current.prevDistance = N);
2778
+ }), c.current.prevDistance = Y);
2680
2779
  }
2681
2780
  }
2682
2781
  c.current.prevX = M, c.current.prevY = A;
2683
2782
  }
2684
2783
  }, E = (y) => {
2685
2784
  const {
2686
- clientX: C,
2687
- clientY: x,
2785
+ clientX: x,
2786
+ clientY: C,
2688
2787
  altKey: p,
2689
- shiftKey: w,
2788
+ shiftKey: _,
2690
2789
  ctrlKey: m,
2691
- metaKey: S,
2692
- target: O,
2693
- pointerId: k
2790
+ metaKey: w,
2791
+ target: R,
2792
+ pointerId: T
2694
2793
  } = y;
2695
- if (c.current.pointers[k]) {
2696
- if (delete c.current.pointers[k], c.current.mainPointer !== k) {
2697
- const { clientX: j, clientY: M } = c.current.pointers[c.current.mainPointer];
2794
+ if (c.current.pointers[T]) {
2795
+ if (delete c.current.pointers[T], c.current.mainPointer !== T) {
2796
+ const { clientX: D, clientY: M } = c.current.pointers[c.current.mainPointer];
2698
2797
  Object.assign(c.current, {
2699
- prevX: j,
2798
+ prevX: D,
2700
2799
  prevY: M,
2701
2800
  prevDistance: 0,
2702
2801
  startDistance: 0
@@ -2709,70 +2808,70 @@ const se = new zn(), Fe = ({
2709
2808
  );
2710
2809
  try {
2711
2810
  c.current.target.setPointerCapture(c.current.mainPointer);
2712
- const { clientX: j, clientY: M } = c.current.pointers[c.current.mainPointer];
2811
+ const { clientX: D, clientY: M } = c.current.pointers[c.current.mainPointer];
2713
2812
  Object.assign(c.current, {
2714
- prevX: j,
2813
+ prevX: D,
2715
2814
  prevY: M,
2716
2815
  prevDistance: 0,
2717
2816
  startDistance: 0
2718
2817
  });
2719
2818
  return;
2720
- } catch (j) {
2721
- console.log("Fails to set pointer capture", j), c.current.mainPointer = void 0, delete c.current.pointers[Object.keys(c.current.pointers)[0]];
2819
+ } catch (D) {
2820
+ console.log("Fails to set pointer capture", D), c.current.mainPointer = void 0, delete c.current.pointers[Object.keys(c.current.pointers)[0]];
2722
2821
  }
2723
2822
  }
2724
2823
  if (c.current.mainPointer = void 0, c.current.pressed = !1, clearTimeout(c.current.longTapTimeout), c.current.moving)
2725
2824
  c.current.moving = !1, se.add(n, {
2726
- deltaX: C - c.current.prevX,
2727
- deltaY: x - c.current.prevY,
2825
+ deltaX: x - c.current.prevX,
2826
+ deltaY: C - c.current.prevY,
2728
2827
  startX: c.current.startX,
2729
2828
  startY: c.current.startY,
2730
- clientX: C,
2731
- clientY: x,
2732
- distanceX: C - c.current.startX,
2733
- distanceY: x - c.current.startY,
2829
+ clientX: x,
2830
+ clientY: C,
2831
+ distanceX: x - c.current.startX,
2832
+ distanceY: C - c.current.startY,
2734
2833
  button: c.current.currentButton,
2735
2834
  altKey: p,
2736
- shiftKey: w,
2835
+ shiftKey: _,
2737
2836
  ctrlKey: m,
2738
- metaKey: S,
2837
+ metaKey: w,
2739
2838
  event: y
2740
2839
  }), f.current.style.cursor = "auto";
2741
2840
  else {
2742
- const j = Date.now();
2743
- c.current.noTap ? c.current.noTap = !1 : c.current.timeStart - j < 300 && se.add(s, {
2744
- clientX: C,
2745
- clientY: x,
2841
+ const D = Date.now();
2842
+ c.current.noTap ? c.current.noTap = !1 : c.current.timeStart - D < 300 && se.add(s, {
2843
+ clientX: x,
2844
+ clientY: C,
2746
2845
  altKey: p,
2747
- shiftKey: w,
2846
+ shiftKey: _,
2748
2847
  ctrlKey: m,
2749
- metaKey: S,
2750
- target: O,
2848
+ metaKey: w,
2849
+ target: R,
2751
2850
  event: y
2752
2851
  });
2753
2852
  }
2754
2853
  }
2755
2854
  };
2756
- return /* @__PURE__ */ T(
2855
+ return /* @__PURE__ */ k(
2757
2856
  "div",
2758
2857
  {
2759
2858
  onWheel: h,
2760
- onPointerDown: _,
2859
+ onPointerDown: S,
2761
2860
  onPointerMove: v,
2762
2861
  onPointerUp: E,
2763
2862
  onPointerOut: E,
2764
2863
  onPointerLeave: E,
2765
2864
  onPointerCancel: E,
2766
2865
  onDoubleClick: (y) => {
2767
- const { clientX: C, clientY: x, altKey: p, shiftKey: w, ctrlKey: m, metaKey: S, target: O } = y;
2866
+ const { clientX: x, clientY: C, altKey: p, shiftKey: _, ctrlKey: m, metaKey: w, target: R } = y;
2768
2867
  se.add(u, {
2769
- clientX: C,
2770
- clientY: x,
2868
+ clientX: x,
2869
+ clientY: C,
2771
2870
  altKey: p,
2772
- shiftKey: w,
2871
+ shiftKey: _,
2773
2872
  ctrlKey: m,
2774
- metaKey: S,
2775
- target: O,
2873
+ metaKey: w,
2874
+ target: R,
2776
2875
  event: y
2777
2876
  });
2778
2877
  },
@@ -2781,134 +2880,46 @@ const se = new zn(), Fe = ({
2781
2880
  children: e
2782
2881
  }
2783
2882
  );
2784
- }, ot = ({ onResize: e, ...t }) => {
2785
- const [r] = Q((o) => [o.getBoardState]);
2786
- return /* @__PURE__ */ T(Fe, { onDrag: ({ deltaX: o, deltaY: s, event: a }) => {
2883
+ }, st = ({ onResize: e, ...t }) => {
2884
+ const [r] = Z((o) => [o.getBoardState]);
2885
+ return /* @__PURE__ */ k(Fe, { onDrag: ({ deltaX: o, deltaY: s, event: a }) => {
2787
2886
  a.stopPropagation();
2788
2887
  const { scale: u } = r();
2789
2888
  e({
2790
2889
  width: o / u,
2791
2890
  height: s / u
2792
2891
  });
2793
- }, children: /* @__PURE__ */ T("div", { ...t }) });
2794
- };
2795
- 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) => {
2796
- let r = "", n = "", o = "";
2797
- for (let s in e) {
2798
- let a = e[s];
2799
- 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 + ";");
2800
- }
2801
- return r + (t && o ? t + "{" + o + "}" : o) + n;
2802
- }, ce = {}, pr = (e) => {
2803
- if (typeof e == "object") {
2804
- let t = "";
2805
- for (let r in e)
2806
- t += r + pr(e[r]);
2807
- return t;
2808
- }
2809
- return e;
2810
- }, Un = (e, t, r, n, o) => {
2811
- let s = pr(e), a = ce[s] || (ce[s] = ((l) => {
2812
- let d = 0, f = 11;
2813
- for (; d < l.length; )
2814
- f = 101 * f + l.charCodeAt(d++) >>> 0;
2815
- return "go" + f;
2816
- })(s));
2817
- if (!ce[a]) {
2818
- let l = s !== e ? e : ((d) => {
2819
- let f, c, h = [{}];
2820
- for (; f = Nn.exec(d.replace(Xn, "")); )
2821
- 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();
2822
- return h[0];
2823
- })(e);
2824
- ce[a] = fe(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
2825
- }
2826
- let u = r && ce.g ? ce.g : null;
2827
- return r && (ce.g = ce[a]), ((l, d, f, c) => {
2828
- c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = f ? l + d.data : d.data + l);
2829
- })(ce[a], t, n, u), a;
2830
- }, Wn = (e, t, r) => e.reduce((n, o, s) => {
2831
- let a = t[s];
2832
- if (a && a.call) {
2833
- let u = a(r), l = u && u.props && u.props.className || /^go/.test(u) && u;
2834
- a = l ? "." + l : u && typeof u == "object" ? u.props ? "" : fe(u, "") : u === !1 ? "" : u;
2835
- }
2836
- return n + o + (a ?? "");
2837
- }, "");
2838
- function K(e) {
2839
- let t = this || {}, r = e.call ? e(t.p) : e;
2840
- 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);
2841
- }
2842
- K.bind({ g: 1 });
2843
- K.bind({ k: 1 });
2844
- function Vn(e, t, r, n) {
2845
- fe.p = t;
2846
- }
2847
- var Fn = function e(t, r) {
2848
- if (t === r)
2849
- return !0;
2850
- if (t && r && typeof t == "object" && typeof r == "object") {
2851
- if (t.constructor !== r.constructor)
2852
- return !1;
2853
- var n, o, s;
2854
- if (Array.isArray(t)) {
2855
- if (n = t.length, n != r.length)
2856
- return !1;
2857
- for (o = n; o-- !== 0; )
2858
- if (!e(t[o], r[o]))
2859
- return !1;
2860
- return !0;
2861
- }
2862
- if (t.constructor === RegExp)
2863
- return t.source === r.source && t.flags === r.flags;
2864
- if (t.valueOf !== Object.prototype.valueOf)
2865
- return t.valueOf() === r.valueOf();
2866
- if (t.toString !== Object.prototype.toString)
2867
- return t.toString() === r.toString();
2868
- if (s = Object.keys(t), n = s.length, n !== Object.keys(r).length)
2869
- return !1;
2870
- for (o = n; o-- !== 0; )
2871
- if (!Object.prototype.hasOwnProperty.call(r, s[o]))
2872
- return !1;
2873
- for (o = n; o-- !== 0; ) {
2874
- var a = s[o];
2875
- if (!e(t[a], r[a]))
2876
- return !1;
2877
- }
2878
- return !0;
2879
- }
2880
- return t !== t && r !== r;
2881
- };
2882
- const Kn = K`
2892
+ }, children: /* @__PURE__ */ k("div", { ...t }) });
2893
+ }, Hn = K`
2883
2894
  display: inline-block;
2884
2895
  transition: transform 150ms;
2885
2896
  user-select: none;
2886
2897
  padding: 2px;
2887
2898
  box-sizing: border-box;
2888
- `, Hn = K`
2899
+ `, qn = K`
2889
2900
  border: 2px dashed #db5034;
2890
2901
  padding: 0px;
2891
2902
  cursor: pointer;
2892
- `, Ce = K`
2903
+ `, xe = K`
2893
2904
  position: absolute;
2894
2905
  width: 0px;
2895
2906
  height: 0px;
2896
- `, qn = K`
2907
+ `, Gn = K`
2897
2908
  top: 0;
2898
2909
  left: 0;
2899
- `, Gn = K`
2910
+ `, Jn = K`
2900
2911
  top: 0;
2901
2912
  right: 0;
2902
- `, Jn = K`
2913
+ `, Zn = K`
2903
2914
  bottom: 0;
2904
2915
  left: 0;
2905
- `, Zn = K`
2916
+ `, Qn = K`
2906
2917
  bottom: 0;
2907
2918
  right: 0;
2908
- `, Qn = K`
2919
+ `, eo = K`
2909
2920
  top: 50%;
2910
2921
  left: 50%;
2911
- `, st = K`
2922
+ `, it = K`
2912
2923
  position: absolute;
2913
2924
 
2914
2925
  width: 10px;
@@ -2916,19 +2927,19 @@ const Kn = K`
2916
2927
  border: 2px solid #db5034;
2917
2928
  background-color: #db5034;
2918
2929
  cursor: move;
2919
- `, eo = K`
2930
+ `, to = K`
2920
2931
  cursor: ew-resize;
2921
2932
  right: -6px;
2922
2933
  top: calc(50% - 5px);
2923
- `, to = K`
2934
+ `, ro = K`
2924
2935
  cursor: ns-resize;
2925
2936
  bottom: -6px;
2926
2937
  left: calc(50% - 5px);
2927
- `, ro = K`
2938
+ `, no = K`
2928
2939
  cursor: nwse-resize;
2929
2940
  bottom: -6px;
2930
2941
  right: -6px;
2931
- `, no = ({ onReload: e }) => /* @__PURE__ */ le(
2942
+ `, oo = ({ onReload: e }) => /* @__PURE__ */ le(
2932
2943
  "div",
2933
2944
  {
2934
2945
  className: `syncboard-error-item ${K({
@@ -2941,11 +2952,11 @@ const Kn = K`
2941
2952
  })}`,
2942
2953
  children: [
2943
2954
  "Sorry, this item seems broken.",
2944
- /* @__PURE__ */ T("button", { onClick: e, children: "Reload it" })
2955
+ /* @__PURE__ */ k("button", { onClick: e, children: "Reload it" })
2945
2956
  ]
2946
2957
  }
2947
2958
  );
2948
- class oo extends g.Component {
2959
+ class so extends g.Component {
2949
2960
  constructor(t) {
2950
2961
  super(t), this.state = { hasError: !1, itemId: t.itemId }, this.onReload = this.onReload.bind(this);
2951
2962
  }
@@ -2964,12 +2975,12 @@ class oo extends g.Component {
2964
2975
  }
2965
2976
  render() {
2966
2977
  const { ErrorComponent: t } = this.props;
2967
- return this.state.hasError ? /* @__PURE__ */ T(t, { onReload: this.onReload }) : this.props.children;
2978
+ return this.state.hasError ? /* @__PURE__ */ k(t, { onReload: this.onReload }) : this.props.children;
2968
2979
  }
2969
2980
  }
2970
- const so = (e) => {
2981
+ const io = (e) => {
2971
2982
  e.target.className = "";
2972
- }, io = ({
2983
+ }, ao = ({
2973
2984
  width: e,
2974
2985
  height: t,
2975
2986
  actualWidth: r,
@@ -2994,11 +3005,11 @@ const so = (e) => {
2994
3005
  width: (a + e).toFixed(1),
2995
3006
  height: (u + t).toFixed(1)
2996
3007
  };
2997
- }, ao = {
3008
+ }, co = {
2998
3009
  w: !0,
2999
3010
  h: !0,
3000
3011
  b: !0
3001
- }, co = ({
3012
+ }, uo = ({
3002
3013
  setState: e,
3003
3014
  state: { type: t, rotation: r = 0, id: n, locked: o, extraClasses: s, ...a } = {},
3004
3015
  animate: u = "hvr-pop",
@@ -3006,88 +3017,89 @@ const so = (e) => {
3006
3017
  itemMap: d,
3007
3018
  showResizeHandle: f = !0
3008
3019
  }) => {
3009
- var m;
3010
- const c = g.useRef(null), {
3011
- component: h = () => null,
3012
- resizeDirections: _ = ao,
3013
- resize: v = io
3014
- } = d[t], E = g.useCallback(
3015
- (S, O = !1) => e(n, S, O),
3020
+ var w;
3021
+ const c = g.useRef(null), [h] = Z((R) => [R.config.uid]), {
3022
+ component: S = () => null,
3023
+ resizeDirections: v = co,
3024
+ resize: E = ao
3025
+ } = d[t], O = g.useCallback(
3026
+ (R, T = !1) => e(n, R, T),
3016
3027
  [e, n]
3017
3028
  );
3018
3029
  g.useEffect(() => {
3019
3030
  c.current.className = u;
3020
3031
  }, [u]);
3021
- const I = ["item", n, Kn];
3022
- o && I.push("locked"), l && (I.push("selected"), I.push(Hn));
3023
- const y = I.join(" "), C = ({ width: S = 0, height: O = 0, keepRatio: k }) => {
3024
- E((j) => {
3025
- const { offsetWidth: M, offsetHeight: A } = c.current;
3026
- return v({
3027
- prevState: j,
3028
- width: S,
3029
- height: O,
3030
- actualHeight: A,
3031
- actualWidth: M,
3032
- keepRatio: k
3032
+ const y = ["item", n, Hn];
3033
+ o && y.push("locked"), l && (y.push("selected"), y.push(qn));
3034
+ const x = y.join(" "), C = ({ width: R = 0, height: T = 0, keepRatio: D }) => {
3035
+ O((M) => {
3036
+ const { offsetWidth: A, offsetHeight: Y } = c.current;
3037
+ return E({
3038
+ prevState: M,
3039
+ width: R,
3040
+ height: T,
3041
+ actualHeight: Y,
3042
+ actualWidth: A,
3043
+ keepRatio: D
3033
3044
  });
3034
3045
  });
3035
- }, x = ({ width: S }) => {
3036
- C({ width: S });
3037
- }, p = ({ height: S }) => {
3038
- C({ height: S });
3039
- }, w = ({ width: S }) => {
3040
- C({ height: S, width: S, keepRatio: !0 });
3046
+ }, p = ({ width: R }) => {
3047
+ C({ width: R });
3048
+ }, _ = ({ height: R }) => {
3049
+ C({ height: R });
3050
+ }, m = ({ width: R }) => {
3051
+ C({ height: R, width: R, keepRatio: !0 });
3041
3052
  };
3042
- return /* @__PURE__ */ T(
3053
+ return /* @__PURE__ */ k(
3043
3054
  "div",
3044
3055
  {
3045
3056
  style: { transform: `rotate(${r}deg` },
3046
3057
  "data-id": n,
3047
- className: y,
3058
+ id: `${h}__${n}`,
3059
+ className: x,
3048
3060
  children: /* @__PURE__ */ le(
3049
3061
  "div",
3050
3062
  {
3051
3063
  style: { display: "flex" },
3052
3064
  ref: c,
3053
- onAnimationEnd: so,
3054
- onKeyDown: (S) => S.stopPropagation(),
3055
- onKeyUp: (S) => S.stopPropagation(),
3065
+ onAnimationEnd: io,
3066
+ onKeyDown: (R) => R.stopPropagation(),
3067
+ onKeyUp: (R) => R.stopPropagation(),
3056
3068
  children: [
3057
- /* @__PURE__ */ T(
3058
- oo,
3069
+ /* @__PURE__ */ k(
3070
+ so,
3059
3071
  {
3060
3072
  itemId: n,
3061
3073
  state: a,
3062
- ErrorComponent: ((m = d == null ? void 0 : d.error) == null ? void 0 : m.component) || no,
3063
- children: /* @__PURE__ */ T(h, { ...a, id: n, setState: E })
3074
+ ErrorComponent: ((w = d == null ? void 0 : d.error) == null ? void 0 : w.component) || oo,
3075
+ children: /* @__PURE__ */ k(S, { ...a, id: n, setState: O })
3064
3076
  }
3065
3077
  ),
3066
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${qn}` }),
3067
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${Gn}` }),
3068
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${Zn}` }),
3069
- /* @__PURE__ */ T("div", { className: `corner ${Ce} ${Jn}` }),
3070
- /* @__PURE__ */ T("div", { className: `center ${Ce} ${Qn}` }),
3071
- f && /* @__PURE__ */ le(Wr, { children: [
3072
- _.b && /* @__PURE__ */ T(
3073
- ot,
3078
+ /* @__PURE__ */ k("div", { className: `corner ${xe} ${Gn}` }),
3079
+ /* @__PURE__ */ k("div", { className: `corner ${xe} ${Jn}` }),
3080
+ /* @__PURE__ */ k("div", { className: `corner ${xe} ${Qn}` }),
3081
+ /* @__PURE__ */ k("div", { className: `corner ${xe} ${Zn}` }),
3082
+ /* @__PURE__ */ k("div", { className: `center ${xe} ${eo}` }),
3083
+ f && /* @__PURE__ */ le(Vr, { children: [
3084
+ v.b && /* @__PURE__ */ k(
3085
+ st,
3074
3086
  {
3075
- className: `${st} ${ro}`,
3076
- onResize: w
3087
+ className: `${it} ${no}`,
3088
+ onResize: m
3077
3089
  }
3078
3090
  ),
3079
- _.h && /* @__PURE__ */ T(
3080
- ot,
3091
+ v.h && /* @__PURE__ */ k(
3092
+ st,
3081
3093
  {
3082
- className: `${st} ${to}`,
3083
- onResize: p
3094
+ className: `${it} ${ro}`,
3095
+ onResize: _
3084
3096
  }
3085
3097
  ),
3086
- _.w && /* @__PURE__ */ T(
3087
- ot,
3098
+ v.w && /* @__PURE__ */ k(
3099
+ st,
3088
3100
  {
3089
- className: `${st} ${eo}`,
3090
- onResize: x
3101
+ className: `${it} ${to}`,
3102
+ onResize: p
3091
3103
  }
3092
3104
  )
3093
3105
  ] })
@@ -3096,8 +3108,8 @@ const so = (e) => {
3096
3108
  )
3097
3109
  }
3098
3110
  );
3099
- }, uo = rr(
3100
- co,
3111
+ }, lo = nr(
3112
+ uo,
3101
3113
  ({
3102
3114
  state: e,
3103
3115
  setState: t,
@@ -3108,18 +3120,18 @@ const so = (e) => {
3108
3120
  setState: s,
3109
3121
  isSelected: a,
3110
3122
  showResizeHandle: u
3111
- }) => r === a && n === u && t === s && Fn(e, o)
3112
- ), lo = (e) => e, fo = ({ state: e = {}, getCurrentUser: t, className: r, ...n }) => {
3123
+ }) => r === a && n === u && t === s && Nn(e, o)
3124
+ ), fo = (e) => e, po = ({ state: e = {}, getCurrentUser: t, className: r, ...n }) => {
3113
3125
  if (!n.itemMap[e.type])
3114
3126
  return null;
3115
- const { stateHook: o = lo } = n.itemMap[e.type], {
3127
+ const { stateHook: o = fo } = n.itemMap[e.type], {
3116
3128
  x: s = 0,
3117
3129
  y: a = 0,
3118
3130
  layer: u = 0,
3119
3131
  moving: l,
3120
3132
  ...d
3121
3133
  } = o(e, { getCurrentUser: t }), f = (u + 4) * 10 + 100 + (l ? 5 : 0);
3122
- return /* @__PURE__ */ T(
3134
+ return /* @__PURE__ */ k(
3123
3135
  "div",
3124
3136
  {
3125
3137
  className: r,
@@ -3127,8 +3139,8 @@ const so = (e) => {
3127
3139
  transform: `translate(${s}px, ${a}px)`,
3128
3140
  zIndex: f
3129
3141
  },
3130
- children: /* @__PURE__ */ T(
3131
- uo,
3142
+ children: /* @__PURE__ */ k(
3143
+ lo,
3132
3144
  {
3133
3145
  ...n,
3134
3146
  showResizeHandle: n.isSelected && n.showResizeHandle,
@@ -3137,11 +3149,11 @@ const so = (e) => {
3137
3149
  )
3138
3150
  }
3139
3151
  );
3140
- }, po = rr(fo), mo = () => {
3141
- const { updateItem: e } = gt(), [t, r] = oe((d) => [
3152
+ }, mo = nr(po), go = () => {
3153
+ const { updateItem: e } = ht(), [t, r] = oe((d) => [
3142
3154
  d.itemIds,
3143
3155
  d.items
3144
- ]), [n, o, s, a] = Q(
3156
+ ]), [n, o, s, a] = Z(
3145
3157
  (d) => [
3146
3158
  d.config.boardSize,
3147
3159
  d.config.showResizeHandle,
@@ -3155,8 +3167,8 @@ const so = (e) => {
3155
3167
  display: "inline-block",
3156
3168
  lineHeight: 0
3157
3169
  });
3158
- return t.map((d) => /* @__PURE__ */ T(
3159
- po,
3170
+ return t.map((d) => /* @__PURE__ */ k(
3171
+ mo,
3160
3172
  {
3161
3173
  state: r[d],
3162
3174
  setState: e,
@@ -3170,21 +3182,21 @@ const so = (e) => {
3170
3182
  d
3171
3183
  ));
3172
3184
  };
3173
- function go(e = !1) {
3174
- const t = Re(e), r = tr(() => t.current, []);
3185
+ function ho(e = !1) {
3186
+ const t = Re(e), r = rr(() => t.current, []);
3175
3187
  return Pe(() => (t.current = !0, () => {
3176
3188
  t.current = !1;
3177
3189
  }), []), r;
3178
3190
  }
3179
- function ho(e, ...t) {
3191
+ function vo(e, ...t) {
3180
3192
  e && e.addEventListener && e.addEventListener(...t);
3181
3193
  }
3182
- function vo(e, ...t) {
3194
+ function yo(e, ...t) {
3183
3195
  e && e.removeEventListener && e.removeEventListener(...t);
3184
3196
  }
3185
- const yo = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
3197
+ const So = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
3186
3198
  function ue(e, ...t) {
3187
- const r = go(), n = pt(t[1]), o = lt(
3199
+ const r = ho(), n = mt(t[1]), o = ft(
3188
3200
  () => (
3189
3201
  // as some event listeners designed to be used through `this`
3190
3202
  // it is better to make listener a conventional function as it
@@ -3198,28 +3210,28 @@ function ue(e, ...t) {
3198
3210
  []
3199
3211
  );
3200
3212
  Pe(() => {
3201
- const s = e && yo(e, "current") ? e.current : e;
3213
+ const s = e && So(e, "current") ? e.current : e;
3202
3214
  if (!s)
3203
3215
  return;
3204
3216
  const a = t.slice(2);
3205
- return ho(s, t[0], o, ...a), () => vo(s, t[0], o, ...a);
3217
+ return vo(s, t[0], o, ...a), () => yo(s, t[0], o, ...a);
3206
3218
  }, [e, t[0]]);
3207
3219
  }
3208
- const So = K({
3220
+ const _o = K({
3209
3221
  zIndex: 210,
3210
3222
  position: "absolute",
3211
3223
  backgroundColor: "hsla(0, 40%, 50%, 10%)",
3212
3224
  border: "2px solid hsl(0, 55%, 40%)"
3213
- }), _o = (e, t, r = !1) => {
3225
+ }), bo = (e, t, r = !1) => {
3214
3226
  const n = t.getElementsByClassName("selector");
3215
3227
  if (!n.length)
3216
3228
  return [];
3217
3229
  const o = n[0];
3218
3230
  return Array.from(t.getElementsByClassName("item")).filter((s) => {
3219
3231
  const a = Te(s), u = e[a];
3220
- return !u || !r && u.locked ? !1 : on(s, o);
3232
+ return !u || !r && u.locked ? !1 : sn(s, o);
3221
3233
  }).map((s) => Te(s));
3222
- }, bo = ({ children: e, moveFirst: t }) => {
3234
+ }, Eo = ({ children: e, moveFirst: t }) => {
3223
3235
  const [
3224
3236
  r,
3225
3237
  n,
@@ -3227,7 +3239,7 @@ const So = K({
3227
3239
  s,
3228
3240
  a,
3229
3241
  u
3230
- ] = Q((m) => [
3242
+ ] = Z((m) => [
3231
3243
  m.getSelection,
3232
3244
  m.clear,
3233
3245
  m.setSelection,
@@ -3235,7 +3247,7 @@ const So = K({
3235
3247
  m.getConfiguration,
3236
3248
  m.getBoardState,
3237
3249
  m.updateBoardState
3238
- ]), { 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({
3250
+ ]), { findElementUnderPointer: l } = ht(), [d] = oe((m) => [m.getItems]), [f, c] = g.useState({}), [, h] = g.useTransition(), [S, v] = g.useState(!1), E = g.useRef(null), O = g.useRef({
3239
3251
  moving: !1
3240
3252
  });
3241
3253
  return ue(document, "keydown", (m) => {
@@ -3245,55 +3257,55 @@ const So = K({
3245
3257
  }), g.useEffect(() => (n(), () => {
3246
3258
  n();
3247
3259
  }), [n]), g.useEffect(() => {
3248
- if (I.current.moving) {
3249
- const m = d(), { boardWrapper: S } = a(), O = _o(m, S, _);
3260
+ if (O.current.moving) {
3261
+ const m = d(), { boardWrapper: w } = a(), R = bo(m, w, S);
3250
3262
  h(() => {
3251
- o(O);
3263
+ o(R);
3252
3264
  });
3253
3265
  }
3254
- }, [a, d, f, o, _]), /* @__PURE__ */ T(
3266
+ }, [a, d, f, o, S]), /* @__PURE__ */ k(
3255
3267
  Fe,
3256
3268
  {
3257
3269
  onDragStart: async (m) => {
3258
- await l(m) || (I.current.moving = !0, h(() => {
3270
+ await l(m) || (O.current.moving = !0, h(() => {
3259
3271
  u({ selecting: !0 });
3260
3272
  }), E.current.style.cursor = "crosshair");
3261
3273
  },
3262
- onDrag: ({ distanceY: m, distanceX: S, startX: O, startY: k }) => {
3263
- if (I.current.moving) {
3264
- const { top: j, left: M } = E.current.getBoundingClientRect(), A = O - M, N = k - j;
3265
- 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 });
3274
+ onDrag: ({ distanceY: m, distanceX: w, startX: R, startY: T }) => {
3275
+ if (O.current.moving) {
3276
+ const { top: D, left: M } = E.current.getBoundingClientRect(), A = R - M, Y = T - D;
3277
+ w > 0 ? (O.current.left = A, O.current.width = w) : (O.current.left = A + w, O.current.width = -w), m > 0 ? (O.current.top = Y, O.current.height = m) : (O.current.top = Y + m, O.current.height = -m), c({ ...O.current, moving: !0 });
3266
3278
  }
3267
3279
  },
3268
3280
  onDragEnd: () => {
3269
- I.current.moving && (h(() => {
3281
+ O.current.moving && (h(() => {
3270
3282
  u({ selecting: !1 });
3271
- }), I.current.moving = !1, c({ moving: !1 }), E.current.style.cursor = "auto");
3283
+ }), O.current.moving = !1, c({ moving: !1 }), E.current.style.cursor = "auto");
3272
3284
  },
3273
3285
  onTap: (m) => {
3274
- const { target: S, ctrlKey: O, metaKey: k } = m, j = l(m);
3275
- if (!j && Oe(S, "board"))
3286
+ const { target: w, ctrlKey: R, metaKey: T } = m, D = l(m);
3287
+ if (!D && Oe(w, "board"))
3276
3288
  n();
3277
3289
  else {
3278
- const M = Te(j);
3290
+ const M = Te(D);
3279
3291
  if (!M) {
3280
3292
  n();
3281
3293
  return;
3282
3294
  }
3283
3295
  const A = r();
3284
- j && !A.includes(M) && (O || k ? s([M]) : o([M]));
3296
+ D && !A.includes(M) && (R || T ? s([M]) : o([M]));
3285
3297
  }
3286
3298
  },
3287
3299
  onLongTap: ({ target: m }) => {
3288
- const S = Oe(m, "item");
3289
- if (S) {
3290
- const O = Te(S);
3291
- o([O]);
3300
+ const w = Oe(m, "item");
3301
+ if (w) {
3302
+ const R = Te(w);
3303
+ o([R]);
3292
3304
  }
3293
3305
  },
3294
3306
  mainAction: t ? "pan" : "drag",
3295
3307
  children: /* @__PURE__ */ le("div", { ref: E, children: [
3296
- f.moving && /* @__PURE__ */ T(
3308
+ f.moving && /* @__PURE__ */ k(
3297
3309
  "div",
3298
3310
  {
3299
3311
  style: {
@@ -3301,15 +3313,15 @@ const So = K({
3301
3313
  height: `${f.height}px`,
3302
3314
  width: `${f.width}px`
3303
3315
  },
3304
- className: `selector ${So}`
3316
+ className: `selector ${_o}`
3305
3317
  }
3306
3318
  ),
3307
3319
  e
3308
3320
  ] })
3309
3321
  }
3310
3322
  );
3311
- }, Eo = ({ children: e }) => {
3312
- const { moveItems: t, placeItems: r, findElementUnderPointer: n } = gt(), { vectorFromWrapperToBoard: o } = Me(), [s, a, u, l, d] = Q((y) => [
3323
+ }, wo = ({ children: e }) => {
3324
+ const { moveItems: t, placeItems: r, findElementUnderPointer: n } = ht(), { vectorFromWrapperToBoard: o } = Me(), [s, a, u, l, d] = Z((y) => [
3313
3325
  y.select,
3314
3326
  y.setSelection,
3315
3327
  y.getSelection,
@@ -3317,25 +3329,25 @@ const So = K({
3317
3329
  y.updateBoardState
3318
3330
  ]), [f] = oe((y) => [y.getBoardConfig]), c = g.useRef({}), h = g.useRef({
3319
3331
  items: []
3320
- }), _ = (y) => {
3321
- const { ctrlKey: C, metaKey: x, event: p } = y, w = n(y);
3322
- if (w) {
3332
+ }), S = (y) => {
3333
+ const { ctrlKey: x, metaKey: C, event: p } = y, _ = n(y);
3334
+ if (_) {
3323
3335
  p.stopPropagation();
3324
3336
  const m = u();
3325
3337
  h.current.items = m;
3326
- const S = Te(w);
3327
- m.includes(S) || (C || x ? (h.current.items = [...m, S], s([S])) : (h.current.items = [S], a([S]))), Object.assign(c.current, {
3338
+ const w = Te(_);
3339
+ m.includes(w) || (x || C ? (h.current.items = [...m, w], s([w])) : (h.current.items = [w], a([w]))), Object.assign(c.current, {
3328
3340
  moving: !0
3329
3341
  });
3330
3342
  }
3331
- }, v = ({ deltaX: y, deltaY: C, event: x }) => {
3343
+ }, v = ({ deltaX: y, deltaY: x, event: C }) => {
3332
3344
  if (c.current.moving) {
3333
- x.stopPropagation();
3334
- const { movingItems: p } = l(), [w, m] = o(y, C);
3345
+ C.stopPropagation();
3346
+ const { movingItems: p } = l(), [_, m] = o(y, x);
3335
3347
  t(
3336
3348
  h.current.items,
3337
3349
  {
3338
- x: w,
3350
+ x: _,
3339
3351
  y: m
3340
3352
  },
3341
3353
  !0
@@ -3343,20 +3355,20 @@ const So = K({
3343
3355
  }
3344
3356
  }, E = () => {
3345
3357
  if (c.current.moving) {
3346
- const { gridSize: y = 1 } = f(), C = y || 1;
3358
+ const { gridSize: y = 1 } = f(), x = y || 1;
3347
3359
  c.current = { moving: !1 }, r(h.current.items, {
3348
3360
  type: "grid",
3349
- size: C
3361
+ size: x
3350
3362
  }), d({ movingItems: !1 });
3351
3363
  }
3352
3364
  };
3353
3365
  return ue(document, "keydown", (y) => {
3354
3366
  if (["INPUT", "TEXTAREA"].includes(y.target.tagName))
3355
3367
  return;
3356
- const C = u();
3357
- if (C.length) {
3358
- const { gridSize: x = 1 } = f();
3359
- let p = 0, w = 0;
3368
+ const x = u();
3369
+ if (x.length) {
3370
+ const { gridSize: C = 1 } = f();
3371
+ let p = 0, _ = 0;
3360
3372
  switch (y.key) {
3361
3373
  case "ArrowLeft":
3362
3374
  p = -10;
@@ -3365,30 +3377,30 @@ const So = K({
3365
3377
  p = 10;
3366
3378
  break;
3367
3379
  case "ArrowUp":
3368
- w = -10;
3380
+ _ = -10;
3369
3381
  break;
3370
3382
  case "ArrowDown":
3371
- w = 10;
3383
+ _ = 10;
3372
3384
  break;
3373
3385
  }
3374
- if (p || w) {
3375
- y.shiftKey && (p *= 5, w *= 5), (y.ctrlKey || y.altKey || y.metaKey) && (p /= 10, w /= 10);
3376
- const [m, S] = o(p, w);
3386
+ if (p || _) {
3387
+ y.shiftKey && (p *= 5, _ *= 5), (y.ctrlKey || y.altKey || y.metaKey) && (p /= 10, _ /= 10);
3388
+ const [m, w] = o(p, _);
3377
3389
  t(
3378
- C,
3390
+ x,
3379
3391
  {
3380
3392
  x: m,
3381
- y: S
3393
+ y: w
3382
3394
  },
3383
3395
  !0
3384
- ), r(C, {
3396
+ ), r(x, {
3385
3397
  type: "grid",
3386
- size: x || 1
3398
+ size: C || 1
3387
3399
  }), y.preventDefault();
3388
3400
  }
3389
3401
  }
3390
- }), /* @__PURE__ */ T(Fe, { onDragStart: _, onDrag: v, onDragEnd: E, children: e });
3391
- }, wo = (e) => {
3402
+ }), /* @__PURE__ */ k(Fe, { onDragStart: S, onDrag: v, onDragEnd: E, children: e });
3403
+ }, xo = (e) => {
3392
3404
  const t = g.useRef({ hover: !1, x: 0, y: 0 });
3393
3405
  return ue(e.current, "mousemove", (n) => {
3394
3406
  const { clientX: o, clientY: s } = n;
@@ -3398,8 +3410,8 @@ const So = K({
3398
3410
  }), ue(e.current, "mouseleave", () => {
3399
3411
  t.current.hover = !1;
3400
3412
  }), g.useCallback(() => t.current, []);
3401
- }, Co = [...Array(5).keys()].map((e) => `Digit${e + 1}`), xo = () => {
3402
- const [e, t] = g.useState({}), [r, n] = Q((o) => [
3413
+ }, Co = [...Array(5).keys()].map((e) => `Digit${e + 1}`), Ro = () => {
3414
+ const [e, t] = g.useState({}), [r, n] = Z((o) => [
3403
3415
  o.getBoardState,
3404
3416
  o.updateBoardState
3405
3417
  ]);
@@ -3412,14 +3424,14 @@ const So = K({
3412
3424
  })) : e[s] && n(e[s]), o.preventDefault();
3413
3425
  }
3414
3426
  }), null;
3415
- }, Ro = ({ children: e, moveFirst: t = !1 }) => {
3427
+ }, Io = ({ children: e, moveFirst: t = !1 }) => {
3416
3428
  const r = g.useRef(null), [
3417
3429
  n,
3418
3430
  o,
3419
3431
  s,
3420
3432
  a,
3421
3433
  u
3422
- ] = Q((p) => [
3434
+ ] = Z((p) => [
3423
3435
  {
3424
3436
  translateX: p.boardState.translateX,
3425
3437
  translateY: p.boardState.translateY,
@@ -3430,8 +3442,8 @@ const So = K({
3430
3442
  p.getConfiguration,
3431
3443
  p.updateBoardState,
3432
3444
  p.getSelection
3433
- ]), { zoomToCenter: l, zoomToExtent: d, moveBoard: f } = Me(), [c, h] = g.useState(!1), _ = g.useRef({}), v = wo(r);
3434
- xo();
3445
+ ]), { zoomToCenter: l, zoomToExtent: d, moveBoard: f } = Me(), [c, h] = g.useState(!1), S = g.useRef({}), v = xo(r);
3446
+ Ro();
3435
3447
  const E = g.useCallback(() => {
3436
3448
  const { itemExtent: p } = s();
3437
3449
  d(p);
@@ -3439,27 +3451,27 @@ const So = K({
3439
3451
  g.useEffect(() => {
3440
3452
  !c && o.radius && (E(), h(!0));
3441
3453
  }, [E, c, o]);
3442
- const I = ({ clientX: p, clientY: w, scale: m }) => {
3443
- l({ to: { x: p, y: w }, factor: 1 - m / 500 }), clearTimeout(_.current.zoom), _.current.zoom = setTimeout(() => {
3454
+ const O = ({ clientX: p, clientY: _, scale: m }) => {
3455
+ l({ to: { x: p, y: _ }, factor: 1 - m / 500 }), clearTimeout(S.current.zoom), S.current.zoom = setTimeout(() => {
3444
3456
  a({ zooming: !1 });
3445
3457
  }, 200), a({ zooming: !0 });
3446
- }, y = ({ deltaX: p, deltaY: w }) => {
3447
- f(({ translateX: m, translateY: S }) => ({
3458
+ }, y = ({ deltaX: p, deltaY: _ }) => {
3459
+ f(({ translateX: m, translateY: w }) => ({
3448
3460
  translateX: m + p,
3449
- translateY: S + w
3450
- })), clearTimeout(_.current.pan), _.current.pan = setTimeout(() => {
3461
+ translateY: w + _
3462
+ })), clearTimeout(S.current.pan), S.current.pan = setTimeout(() => {
3451
3463
  a({ panning: !1 });
3452
3464
  }, 200), a({ panning: !0 });
3453
- }, C = (p) => {
3465
+ }, x = (p) => {
3454
3466
  if (["INPUT", "TEXTAREA"].includes(p.target.tagName))
3455
3467
  return;
3456
- let w = 0, m = 0, S = 1;
3468
+ let _ = 0, m = 0, w = 1;
3457
3469
  switch (p.key) {
3458
3470
  case "ArrowLeft":
3459
- w = -10;
3471
+ _ = -10;
3460
3472
  break;
3461
3473
  case "ArrowRight":
3462
- w = 10;
3474
+ _ = 10;
3463
3475
  break;
3464
3476
  case "ArrowUp":
3465
3477
  m = -10;
@@ -3468,32 +3480,32 @@ const So = K({
3468
3480
  m = 10;
3469
3481
  break;
3470
3482
  case "PageUp":
3471
- S = 1.2;
3483
+ w = 1.2;
3472
3484
  break;
3473
3485
  case "PageDown":
3474
- S = 0.8;
3486
+ w = 0.8;
3475
3487
  break;
3476
3488
  }
3477
- if (w || m || S !== 1) {
3478
- const O = u();
3479
- if (S === 1 && O.length)
3489
+ if (_ || m || w !== 1) {
3490
+ const R = u();
3491
+ if (w === 1 && R.length)
3480
3492
  return;
3481
- p.shiftKey && (w *= 5, m *= 5), (p.ctrlKey || p.altKey || p.metaKey) && (w /= 5, m /= 5), f(({ translateX: k, translateY: j }) => ({
3482
- translateX: k + w,
3483
- translateY: j + m
3484
- })), l({ factor: S }), p.preventDefault();
3493
+ p.shiftKey && (_ *= 5, m *= 5), (p.ctrlKey || p.altKey || p.metaKey) && (_ /= 5, m /= 5), f(({ translateX: T, translateY: D }) => ({
3494
+ translateX: T + _,
3495
+ translateY: D + m
3496
+ })), l({ factor: w }), p.preventDefault();
3485
3497
  }
3486
3498
  p.key === " " && !p.repeat && v().hover && l({ factor: 3, to: v() });
3487
- }, x = (p) => {
3499
+ }, C = (p) => {
3488
3500
  ["INPUT", "TEXTAREA"].includes(p.target.tagName) || p.key === " " && v().hover && l({ factor: 1 / 3, to: v() });
3489
3501
  };
3490
- return ue(document, "keydown", C), ue(document, "keyup", x), /* @__PURE__ */ T(
3502
+ return ue(document, "keydown", x), ue(document, "keyup", C), /* @__PURE__ */ k(
3491
3503
  Fe,
3492
3504
  {
3493
3505
  onPan: y,
3494
- onZoom: I,
3506
+ onZoom: O,
3495
3507
  mainAction: t ? "pan" : "drag",
3496
- children: /* @__PURE__ */ T(
3508
+ children: /* @__PURE__ */ k(
3497
3509
  "div",
3498
3510
  {
3499
3511
  style: {
@@ -3508,7 +3520,7 @@ const So = K({
3508
3520
  )
3509
3521
  }
3510
3522
  );
3511
- }, Io = K({
3523
+ }, Oo = K({
3512
3524
  position: "absolute",
3513
3525
  top: 0,
3514
3526
  left: 0,
@@ -3516,7 +3528,7 @@ const So = K({
3516
3528
  backgroundColor: "hsla(0, 40%, 50%, 0%)",
3517
3529
  border: "2px dashed hsl(20, 55%, 40%)",
3518
3530
  pointerEvents: "none"
3519
- }), Oo = () => {
3531
+ }), To = () => {
3520
3532
  const [
3521
3533
  e,
3522
3534
  t,
@@ -3524,7 +3536,7 @@ const So = K({
3524
3536
  n,
3525
3537
  o,
3526
3538
  { translateX: s, translateY: a, scale: u }
3527
- ] = Q((c) => [
3539
+ ] = Z((c) => [
3528
3540
  c.selection,
3529
3541
  c.getSelection,
3530
3542
  c.selectionBox,
@@ -3536,24 +3548,24 @@ const So = K({
3536
3548
  scale: c.boardState.scale
3537
3549
  }
3538
3550
  ]), [l] = oe((c) => [c.items]), d = g.useCallback(() => {
3539
- const c = t(), { boardWrapperRect: h, boardWrapper: _ } = o();
3551
+ const c = t(), { boardWrapperRect: h, uid: S } = o();
3540
3552
  if (c.length === 0) {
3541
3553
  n(null);
3542
3554
  return;
3543
3555
  }
3544
- const v = sn(c, _);
3556
+ const v = an(c, S);
3545
3557
  if (!v) {
3546
3558
  n(null);
3547
3559
  return;
3548
3560
  }
3549
- const { left: E, top: I, width: y, height: C } = v, x = {
3561
+ const { left: E, top: O, width: y, height: x } = v, C = {
3550
3562
  left: E - h.left,
3551
- top: I - h.top,
3552
- height: C,
3563
+ top: O - h.top,
3564
+ height: x,
3553
3565
  width: y
3554
3566
  };
3555
- n(x);
3556
- }, [o, t, n]), f = mt(d, [d], 300);
3567
+ n(C);
3568
+ }, [o, t, n]), f = gt(d, [d], 300);
3557
3569
  return g.useEffect(() => {
3558
3570
  d(), f();
3559
3571
  }, [
@@ -3564,7 +3576,7 @@ const So = K({
3564
3576
  u,
3565
3577
  d,
3566
3578
  f
3567
- ]), !r || e.length < 2 ? null : /* @__PURE__ */ T(
3579
+ ]), !r || e.length < 2 ? null : /* @__PURE__ */ k(
3568
3580
  "div",
3569
3581
  {
3570
3582
  style: {
@@ -3572,16 +3584,16 @@ const So = K({
3572
3584
  height: `${r.height}px`,
3573
3585
  width: `${r.width}px`
3574
3586
  },
3575
- className: `selection ${Io}`
3587
+ className: `selection ${Oo}`
3576
3588
  }
3577
3589
  );
3578
- }, To = () => {
3579
- const [e] = Q((t) => [t.boardState.movingItems]);
3580
- return e ? null : /* @__PURE__ */ T(Oo, {});
3581
- }, ko = typeof window < "u" && typeof navigator < "u" && typeof document < "u";
3590
+ }, ko = () => {
3591
+ const [e] = Z((t) => [t.boardState.movingItems]);
3592
+ return e ? null : /* @__PURE__ */ k(To, {});
3593
+ }, Po = typeof window < "u" && typeof navigator < "u" && typeof document < "u";
3582
3594
  let Le;
3583
- function Po() {
3584
- if (!ko)
3595
+ function Mo() {
3596
+ if (!Po)
3585
3597
  return;
3586
3598
  if (Le)
3587
3599
  return Le;
@@ -3603,8 +3615,8 @@ function Po() {
3603
3615
  }
3604
3616
  }, Le;
3605
3617
  }
3606
- function Mo(e, t, r = !0) {
3607
- const n = r && Po(), o = pt(t), s = e && "current" in e ? e.current : e;
3618
+ function Do(e, t, r = !0) {
3619
+ const n = r && Mo(), o = mt(t), s = e && "current" in e ? e.current : e;
3608
3620
  Pe(() => {
3609
3621
  const a = e && "current" in e ? e.current : e;
3610
3622
  if (!n || !a)
@@ -3618,7 +3630,7 @@ function Mo(e, t, r = !0) {
3618
3630
  };
3619
3631
  }, [s, n]);
3620
3632
  }
3621
- function Zt(e, t, r) {
3633
+ function Qt(e, t, r) {
3622
3634
  return Math.min(Math.max(e, r), t);
3623
3635
  }
3624
3636
  class jo extends Error {
@@ -3626,89 +3638,89 @@ class jo extends Error {
3626
3638
  super(`Failed to parse color: "${t}"`);
3627
3639
  }
3628
3640
  }
3629
- var xe = jo;
3630
- function Do(e) {
3641
+ var Ce = jo;
3642
+ function $o(e) {
3631
3643
  if (typeof e != "string")
3632
- throw new xe(e);
3644
+ throw new Ce(e);
3633
3645
  if (e.trim().toLowerCase() === "transparent")
3634
3646
  return [0, 0, 0, 0];
3635
3647
  let t = e.trim();
3636
- t = Xo.test(e) ? Lo(e) : e;
3637
- const r = zo.exec(t);
3648
+ t = Uo.test(e) ? zo(e) : e;
3649
+ const r = Yo.exec(t);
3638
3650
  if (r) {
3639
3651
  const a = Array.from(r).slice(1);
3640
3652
  return [...a.slice(0, 3).map((u) => parseInt(ke(u, 2), 16)), parseInt(ke(a[3] || "f", 2), 16) / 255];
3641
3653
  }
3642
- const n = Yo.exec(t);
3654
+ const n = Bo.exec(t);
3643
3655
  if (n) {
3644
3656
  const a = Array.from(n).slice(1);
3645
3657
  return [...a.slice(0, 3).map((u) => parseInt(u, 16)), parseInt(a[3] || "ff", 16) / 255];
3646
3658
  }
3647
- const o = Bo.exec(t);
3659
+ const o = No.exec(t);
3648
3660
  if (o) {
3649
3661
  const a = Array.from(o).slice(1);
3650
3662
  return [...a.slice(0, 3).map((u) => parseInt(u, 10)), parseFloat(a[3] || "1")];
3651
3663
  }
3652
- const s = No.exec(t);
3664
+ const s = Xo.exec(t);
3653
3665
  if (s) {
3654
3666
  const [a, u, l, d] = Array.from(s).slice(1).map(parseFloat);
3655
- if (Zt(0, 100, u) !== u)
3656
- throw new xe(e);
3657
- if (Zt(0, 100, l) !== l)
3658
- throw new xe(e);
3659
- return [...Uo(a, u, l), Number.isNaN(d) ? 1 : d];
3667
+ if (Qt(0, 100, u) !== u)
3668
+ throw new Ce(e);
3669
+ if (Qt(0, 100, l) !== l)
3670
+ throw new Ce(e);
3671
+ return [...Wo(a, u, l), Number.isNaN(d) ? 1 : d];
3660
3672
  }
3661
- throw new xe(e);
3673
+ throw new Ce(e);
3662
3674
  }
3663
- function $o(e) {
3675
+ function Ao(e) {
3664
3676
  let t = 5381, r = e.length;
3665
3677
  for (; r; )
3666
3678
  t = t * 33 ^ e.charCodeAt(--r);
3667
3679
  return (t >>> 0) % 2341;
3668
3680
  }
3669
- const Qt = (e) => parseInt(e.replace(/_/g, ""), 36), Ao = "1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e, t) => {
3670
- const r = Qt(t.substring(0, 3)), n = Qt(t.substring(3)).toString(16);
3681
+ const er = (e) => parseInt(e.replace(/_/g, ""), 36), Lo = "1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e, t) => {
3682
+ const r = er(t.substring(0, 3)), n = er(t.substring(3)).toString(16);
3671
3683
  let o = "";
3672
3684
  for (let s = 0; s < 6 - n.length; s++)
3673
3685
  o += "0";
3674
3686
  return e[r] = `${o}${n}`, e;
3675
3687
  }, {});
3676
- function Lo(e) {
3677
- const t = e.toLowerCase().trim(), r = Ao[$o(t)];
3688
+ function zo(e) {
3689
+ const t = e.toLowerCase().trim(), r = Lo[Ao(t)];
3678
3690
  if (!r)
3679
- throw new xe(e);
3691
+ throw new Ce(e);
3680
3692
  return `#${r}`;
3681
3693
  }
3682
- 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) => {
3694
+ const ke = (e, t) => Array.from(Array(t)).map(() => e).join(""), Yo = new RegExp(`^#${ke("([a-f0-9])", 3)}([a-f0-9])?$`, "i"), Bo = new RegExp(`^#${ke("([a-f0-9]{2})", 3)}([a-f0-9]{2})?$`, "i"), No = 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, Uo = /^[a-z]+$/i, tr = (e) => Math.round(e * 255), Wo = (e, t, r) => {
3683
3695
  let n = r / 100;
3684
3696
  if (t === 0)
3685
- return [n, n, n].map(er);
3697
+ return [n, n, n].map(tr);
3686
3698
  const o = (e % 360 + 360) % 360 / 60, s = (1 - Math.abs(2 * n - 1)) * (t / 100), a = s * (1 - Math.abs(o % 2 - 1));
3687
3699
  let u = 0, l = 0, d = 0;
3688
3700
  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);
3689
- const f = n - s / 2, c = u + f, h = l + f, _ = d + f;
3690
- return [c, h, _].map(er);
3701
+ const f = n - s / 2, c = u + f, h = l + f, S = d + f;
3702
+ return [c, h, S].map(tr);
3691
3703
  };
3692
- function Wo(e) {
3704
+ function Vo(e) {
3693
3705
  if (e === "transparent")
3694
3706
  return 0;
3695
3707
  function t(s) {
3696
3708
  const a = s / 255;
3697
3709
  return a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4);
3698
3710
  }
3699
- const [r, n, o] = Do(e);
3711
+ const [r, n, o] = $o(e);
3700
3712
  return 0.2126 * t(r) + 0.7152 * t(n) + 0.0722 * t(o);
3701
3713
  }
3702
- function Vo(e) {
3703
- return Wo(e) > 0.179;
3714
+ function Fo(e) {
3715
+ return Vo(e) > 0.179;
3704
3716
  }
3705
- const Fo = K({
3717
+ const Ko = K({
3706
3718
  display: "flex",
3707
3719
  flexDirection: "row",
3708
3720
  alignItems: "center",
3709
3721
  zIndex: 210,
3710
3722
  pointerEvents: "none"
3711
- }), Ko = K({
3723
+ }), Ho = K({
3712
3724
  fontWeight: "bold",
3713
3725
  padding: "0 0.5em",
3714
3726
  borderRadius: "2px",
@@ -3719,9 +3731,9 @@ const Fo = K({
3719
3731
  marginTop: "1.7em",
3720
3732
  whitespace: "nowrap",
3721
3733
  pointerEvents: "none"
3722
- }), Ho = ({ color: e = "#666", size: t = 40, text: r }) => {
3723
- const n = Vo(e) ? "#222" : "#EEE";
3724
- return /* @__PURE__ */ le("div", { className: Fo, children: [
3734
+ }), qo = ({ color: e = "#666", size: t = 40, text: r }) => {
3735
+ const n = Fo(e) ? "#222" : "#EEE";
3736
+ return /* @__PURE__ */ le("div", { className: Ko, children: [
3725
3737
  /* @__PURE__ */ le(
3726
3738
  "svg",
3727
3739
  {
@@ -3731,7 +3743,7 @@ const Fo = K({
3731
3743
  width: t,
3732
3744
  height: t,
3733
3745
  children: [
3734
- /* @__PURE__ */ T(
3746
+ /* @__PURE__ */ k(
3735
3747
  "path",
3736
3748
  {
3737
3749
  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",
@@ -3740,7 +3752,7 @@ const Fo = K({
3740
3752
  }
3741
3753
  }
3742
3754
  ),
3743
- /* @__PURE__ */ T(
3755
+ /* @__PURE__ */ k(
3744
3756
  "path",
3745
3757
  {
3746
3758
  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",
@@ -3754,35 +3766,35 @@ const Fo = K({
3754
3766
  ]
3755
3767
  }
3756
3768
  ),
3757
- /* @__PURE__ */ T(
3769
+ /* @__PURE__ */ k(
3758
3770
  "div",
3759
3771
  {
3760
3772
  style: {
3761
3773
  color: n,
3762
3774
  backgroundColor: e
3763
3775
  },
3764
- className: Ko,
3776
+ className: Ho,
3765
3777
  children: r
3766
3778
  }
3767
3779
  )
3768
3780
  ] });
3769
- }, qo = g.memo(Ho), Go = K({
3781
+ }, Go = g.memo(qo), Jo = K({
3770
3782
  top: 0,
3771
3783
  left: 0,
3772
3784
  zIndex: 210,
3773
3785
  position: "fixed",
3774
3786
  pointerEvents: "none"
3775
- }), Jo = ({ pos: e, ...t }) => /* @__PURE__ */ T(
3787
+ }), Zo = ({ pos: e, ...t }) => /* @__PURE__ */ k(
3776
3788
  "div",
3777
3789
  {
3778
- className: Go,
3790
+ className: Jo,
3779
3791
  style: {
3780
3792
  transform: `translate(${e.x - 6}px, ${e.y - 15}px)`
3781
3793
  },
3782
- children: /* @__PURE__ */ T(qo, { ...t })
3794
+ children: /* @__PURE__ */ k(Go, { ...t })
3783
3795
  }
3784
- ), Zo = ({ children: e }) => {
3785
- const [t] = Q((v) => [
3796
+ ), Qo = ({ children: e }) => {
3797
+ const [t] = Z((v) => [
3786
3798
  v.getConfiguration,
3787
3799
  v.boardState.scale
3788
3800
  // We want to update this component when the scale changes
@@ -3797,25 +3809,25 @@ const Fo = K({
3797
3809
  v.moveCursor,
3798
3810
  v.removeCursor
3799
3811
  ]), { boardWrapperRect: f } = t(), c = ({ clientX: v, clientY: E }) => {
3800
- const [I, y] = r(
3812
+ const [O, y] = r(
3801
3813
  v - f.left,
3802
3814
  E - f.top
3803
3815
  );
3804
- l(o.id, { x: I, y });
3816
+ l(o.id, { x: O, y });
3805
3817
  }, h = () => {
3806
3818
  d(o.id);
3807
- }, _ = s.reduce((v, E) => (E.id !== o.id && a[E.id] && (v[E.id] = a[E.id]), v), {});
3819
+ }, S = s.reduce((v, E) => (E.id !== o.id && a[E.id] && (v[E.id] = a[E.id]), v), {});
3808
3820
  return /* @__PURE__ */ le("div", { onPointerMove: c, onPointerLeave: h, children: [
3809
3821
  e,
3810
- Object.entries(_).map(([v, E]) => {
3811
- const [I, y] = n(E.x, E.y), C = {
3812
- x: I + f.left,
3822
+ Object.entries(S).map(([v, E]) => {
3823
+ const [O, y] = n(E.x, E.y), x = {
3824
+ x: O + f.left,
3813
3825
  y: y + f.top
3814
3826
  };
3815
- return ft(C, f) ? /* @__PURE__ */ T(
3816
- Jo,
3827
+ return dt(x, f) ? /* @__PURE__ */ k(
3828
+ Zo,
3817
3829
  {
3818
- pos: C,
3830
+ pos: x,
3819
3831
  text: u[v].name,
3820
3832
  color: u[v].color
3821
3833
  },
@@ -3823,21 +3835,21 @@ const Fo = K({
3823
3835
  ) : null;
3824
3836
  })
3825
3837
  ] });
3826
- }, Qo = ({ children: e }) => e, es = {
3838
+ }, es = ({ children: e }) => e, ts = {
3827
3839
  overflow: "hidden",
3828
3840
  position: "absolute",
3829
3841
  inset: 0
3830
- }, gs = ({
3842
+ }, vs = ({
3831
3843
  moveFirst: e = !0,
3832
3844
  style: t,
3833
3845
  wrapperStyle: r,
3834
3846
  itemTemplates: n = {},
3835
- boardSize: o = cr,
3847
+ boardSize: o = ur,
3836
3848
  children: s,
3837
3849
  showResizeHandle: a = !1,
3838
- Wrapper: u = Qo
3850
+ Wrapper: u = es
3839
3851
  }) => {
3840
- const l = g.useRef(null), [d, f] = Q((v) => [
3852
+ const l = g.useRef(null), [d, f] = Z((v) => [
3841
3853
  v.config.uid,
3842
3854
  v.updateConfiguration
3843
3855
  ]), { updateItemExtent: c } = Me(), h = {
@@ -3872,20 +3884,20 @@ const Fo = K({
3872
3884
  f({
3873
3885
  boardWrapperRect: l.current.getBoundingClientRect()
3874
3886
  }), c(), setTimeout(c, 2e3);
3875
- }, [f, c]), Mo(l, () => {
3887
+ }, [f, c]), Do(l, () => {
3876
3888
  l.current && f({
3877
3889
  boardWrapperRect: l.current.getBoundingClientRect()
3878
3890
  });
3879
3891
  });
3880
- const _ = K({ ...es, ...r });
3892
+ const S = K({ ...ts, ...r });
3881
3893
  return /* @__PURE__ */ le(
3882
3894
  "div",
3883
3895
  {
3884
3896
  ref: l,
3885
3897
  id: d,
3886
- className: `sync-board ${_}`,
3898
+ className: `sync-board ${S}`,
3887
3899
  children: [
3888
- /* @__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(
3900
+ /* @__PURE__ */ k(Qo, { children: /* @__PURE__ */ k(Eo, { moveFirst: e, children: /* @__PURE__ */ k(Io, { moveFirst: e, children: /* @__PURE__ */ k(wo, { moveFirst: e, children: /* @__PURE__ */ k(u, { children: /* @__PURE__ */ le(
3889
3901
  "div",
3890
3902
  {
3891
3903
  onContextMenu: (v) => {
@@ -3894,34 +3906,35 @@ const Fo = K({
3894
3906
  style: h,
3895
3907
  className: "board",
3896
3908
  children: [
3897
- /* @__PURE__ */ T(mo, {}),
3909
+ /* @__PURE__ */ k(go, {}),
3898
3910
  s
3899
3911
  ]
3900
3912
  }
3901
3913
  ) }) }) }) }) }),
3902
- /* @__PURE__ */ T(To, {})
3914
+ /* @__PURE__ */ k(ko, {})
3903
3915
  ]
3904
3916
  }
3905
3917
  );
3906
3918
  };
3907
- Vn(g.createElement);
3919
+ Bn(g.createElement);
3908
3920
  export {
3909
- gs as Board,
3910
- ps as BoardWrapper,
3911
- ms as RoomWrapper,
3912
- is as useAvailableActions,
3913
- us as useBoardConfig,
3921
+ vs as Board,
3922
+ gs as BoardWrapper,
3923
+ hs as RoomWrapper,
3924
+ cs as useAvailableActions,
3925
+ fs as useBoardConfig,
3914
3926
  Me as useBoardPosition,
3915
- ls as useBoardState,
3916
- os as useDebouncedItems,
3917
- gt as useItemActions,
3918
- Vt as useItemInteraction,
3919
- ns as useItems,
3920
- ds as useMessage,
3921
- ss as useSelectedItems,
3922
- as as useSelectionBox,
3923
- fs as useSessionInfo,
3924
- cs as useUsers,
3927
+ ds as useBoardState,
3928
+ ss as useDebouncedItems,
3929
+ as as useGetSelectedItems,
3930
+ ht as useItemActions,
3931
+ Ft as useItemInteraction,
3932
+ os as useItems,
3933
+ ms as useMessage,
3934
+ is as useSelectedItems,
3935
+ us as useSelectionBox,
3936
+ ps as useSessionInfo,
3937
+ ls as useUsers,
3925
3938
  Xe as useWire
3926
3939
  };
3927
3940
  //# sourceMappingURL=react-sync-board.js.map