@roudanio/maze 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maze.js CHANGED
@@ -1,25 +1,25 @@
1
- var se, S, Ue, W, be, We, je, Ge, me, de, he, He, B = {}, qe = [], it = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, le = Array.isArray;
1
+ var le, L, je, U, Te, Ge, He, qe, pe, fe, _e, Be, X = {}, Ve = [], lt = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ae = Array.isArray;
2
2
  function $(t, e) {
3
3
  for (var n in e) t[n] = e[n];
4
4
  return t;
5
5
  }
6
- function ve(t) {
6
+ function ge(t) {
7
7
  t && t.parentNode && t.parentNode.removeChild(t);
8
8
  }
9
- function st(t, e, n) {
10
- var o, i, s, l = {};
11
- for (s in e) s == "key" ? o = e[s] : s == "ref" ? i = e[s] : l[s] = e[s];
12
- if (arguments.length > 2 && (l.children = arguments.length > 3 ? se.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) l[s] == null && (l[s] = t.defaultProps[s]);
13
- return Q(t, l, o, i, null);
9
+ function at(t, e, n) {
10
+ var o, i, s, c = {};
11
+ for (s in e) s == "key" ? o = e[s] : s == "ref" ? i = e[s] : c[s] = e[s];
12
+ if (arguments.length > 2 && (c.children = arguments.length > 3 ? le.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) c[s] == null && (c[s] = t.defaultProps[s]);
13
+ return ee(t, c, o, i, null);
14
14
  }
15
- function Q(t, e, n, o, i) {
16
- var s = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++Ue, __i: -1, __u: 0 };
17
- return i == null && S.vnode != null && S.vnode(s), s;
15
+ function ee(t, e, n, o, i) {
16
+ var s = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++je, __i: -1, __u: 0 };
17
+ return i == null && L.vnode != null && L.vnode(s), s;
18
18
  }
19
- function ae(t) {
19
+ function ce(t) {
20
20
  return t.children;
21
21
  }
22
- function ee(t, e) {
22
+ function te(t, e) {
23
23
  this.props = t, this.context = e;
24
24
  }
25
25
  function G(t, e) {
@@ -27,38 +27,38 @@ function G(t, e) {
27
27
  for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
28
28
  return typeof t.type == "function" ? G(t) : null;
29
29
  }
30
- function Ve(t) {
30
+ function Ye(t) {
31
31
  var e, n;
32
32
  if ((t = t.__) != null && t.__c != null) {
33
33
  for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
34
34
  t.__e = t.__c.base = n.__e;
35
35
  break;
36
36
  }
37
- return Ve(t);
37
+ return Ye(t);
38
38
  }
39
39
  }
40
- function _e(t) {
41
- (!t.__d && (t.__d = !0) && W.push(t) && !re.__r++ || be != S.debounceRendering) && ((be = S.debounceRendering) || We)(re);
40
+ function me(t) {
41
+ (!t.__d && (t.__d = !0) && U.push(t) && !ie.__r++ || Te != L.debounceRendering) && ((Te = L.debounceRendering) || Ge)(ie);
42
42
  }
43
- function re() {
44
- for (var t, e, n, o, i, s, l, r = 1; W.length; ) W.length > r && W.sort(je), t = W.shift(), r = W.length, t.__d && (n = void 0, i = (o = (e = t).__v).__e, s = [], l = [], e.__P && ((n = $({}, o)).__v = o.__v + 1, S.vnode && S.vnode(n), ge(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [i] : null, s, i ?? G(o), !!(32 & o.__u), l), n.__v = o.__v, n.__.__k[n.__i] = n, Xe(s, n, l), n.__e != i && Ve(n)));
45
- re.__r = 0;
43
+ function ie() {
44
+ for (var t, e, n, o, i, s, c, r = 1; U.length; ) U.length > r && U.sort(He), t = U.shift(), r = U.length, t.__d && (n = void 0, i = (o = (e = t).__v).__e, s = [], c = [], e.__P && ((n = $({}, o)).__v = o.__v + 1, L.vnode && L.vnode(n), Ce(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [i] : null, s, i ?? G(o), !!(32 & o.__u), c), n.__v = o.__v, n.__.__k[n.__i] = n, Je(s, n, c), n.__e != i && Ye(n)));
45
+ ie.__r = 0;
46
46
  }
47
- function Be(t, e, n, o, i, s, l, r, a, c, d) {
48
- var u, h, _, m, g, f, p = o && o.__k || qe, v = e.length;
49
- for (a = lt(n, e, p, a, v), u = 0; u < v; u++) (_ = n.__k[u]) != null && (h = _.__i == -1 ? B : p[_.__i] || B, _.__i = u, f = ge(t, _, h, i, s, l, r, a, c, d), m = _.__e, _.ref && h.ref != _.ref && (h.ref && pe(h.ref, null, _), d.push(_.ref, _.__c || m, _)), g == null && m != null && (g = m), 4 & _.__u || h.__k === _.__k ? a = Ye(_, a, t) : typeof _.type == "function" && f !== void 0 ? a = f : m && (a = m.nextSibling), _.__u &= -7);
50
- return n.__e = g, a;
47
+ function Xe(t, e, n, o, i, s, c, r, l, a, d) {
48
+ var u, h, f, w, g, _, v = o && o.__k || Ve, m = e.length;
49
+ for (l = ct(n, e, v, l, m), u = 0; u < m; u++) (f = n.__k[u]) != null && (h = f.__i == -1 ? X : v[f.__i] || X, f.__i = u, _ = Ce(t, f, h, i, s, c, r, l, a, d), w = f.__e, f.ref && h.ref != f.ref && (h.ref && we(h.ref, null, f), d.push(f.ref, f.__c || w, f)), g == null && w != null && (g = w), 4 & f.__u || h.__k === f.__k ? l = Ke(f, l, t) : typeof f.type == "function" && _ !== void 0 ? l = _ : w && (l = w.nextSibling), f.__u &= -7);
50
+ return n.__e = g, l;
51
51
  }
52
- function lt(t, e, n, o, i) {
53
- var s, l, r, a, c, d = n.length, u = d, h = 0;
54
- for (t.__k = new Array(i), s = 0; s < i; s++) (l = e[s]) != null && typeof l != "boolean" && typeof l != "function" ? (a = s + h, (l = t.__k[s] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? Q(null, l, null, null, null) : le(l) ? Q(ae, { children: l }, null, null, null) : l.constructor == null && l.__b > 0 ? Q(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = t, l.__b = t.__b + 1, r = null, (c = l.__i = at(l, n, a, u)) != -1 && (u--, (r = n[c]) && (r.__u |= 2)), r == null || r.__v == null ? (c == -1 && (i > d ? h-- : i < d && h++), typeof l.type != "function" && (l.__u |= 4)) : c != a && (c == a - 1 ? h-- : c == a + 1 ? h++ : (c > a ? h-- : h++, l.__u |= 4))) : t.__k[s] = null;
55
- if (u) for (s = 0; s < d; s++) (r = n[s]) != null && (2 & r.__u) == 0 && (r.__e == o && (o = G(r)), Je(r, r));
52
+ function ct(t, e, n, o, i) {
53
+ var s, c, r, l, a, d = n.length, u = d, h = 0;
54
+ for (t.__k = new Array(i), s = 0; s < i; s++) (c = e[s]) != null && typeof c != "boolean" && typeof c != "function" ? (l = s + h, (c = t.__k[s] = typeof c == "string" || typeof c == "number" || typeof c == "bigint" || c.constructor == String ? ee(null, c, null, null, null) : ae(c) ? ee(ce, { children: c }, null, null, null) : c.constructor == null && c.__b > 0 ? ee(c.type, c.props, c.key, c.ref ? c.ref : null, c.__v) : c).__ = t, c.__b = t.__b + 1, r = null, (a = c.__i = ut(c, n, l, u)) != -1 && (u--, (r = n[a]) && (r.__u |= 2)), r == null || r.__v == null ? (a == -1 && (i > d ? h-- : i < d && h++), typeof c.type != "function" && (c.__u |= 4)) : a != l && (a == l - 1 ? h-- : a == l + 1 ? h++ : (a > l ? h-- : h++, c.__u |= 4))) : t.__k[s] = null;
55
+ if (u) for (s = 0; s < d; s++) (r = n[s]) != null && (2 & r.__u) == 0 && (r.__e == o && (o = G(r)), Qe(r, r));
56
56
  return o;
57
57
  }
58
- function Ye(t, e, n) {
58
+ function Ke(t, e, n) {
59
59
  var o, i;
60
60
  if (typeof t.type == "function") {
61
- for (o = t.__k, i = 0; o && i < o.length; i++) o[i] && (o[i].__ = t, e = Ye(o[i], e, n));
61
+ for (o = t.__k, i = 0; o && i < o.length; i++) o[i] && (o[i].__ = t, e = Ke(o[i], e, n));
62
62
  return e;
63
63
  }
64
64
  t.__e != e && (e && t.type && !n.contains(e) && (e = G(t)), n.insertBefore(t.__e, e || null), e = t.__e);
@@ -67,32 +67,32 @@ function Ye(t, e, n) {
67
67
  while (e != null && e.nodeType == 8);
68
68
  return e;
69
69
  }
70
- function at(t, e, n, o) {
71
- var i, s, l = t.key, r = t.type, a = e[n];
72
- if (a === null && t.key == null || a && l == a.key && r == a.type && (2 & a.__u) == 0) return n;
73
- if (o > (a != null && (2 & a.__u) == 0 ? 1 : 0)) for (i = n - 1, s = n + 1; i >= 0 || s < e.length; ) {
70
+ function ut(t, e, n, o) {
71
+ var i, s, c = t.key, r = t.type, l = e[n];
72
+ if (l === null && t.key == null || l && c == l.key && r == l.type && (2 & l.__u) == 0) return n;
73
+ if (o > (l != null && (2 & l.__u) == 0 ? 1 : 0)) for (i = n - 1, s = n + 1; i >= 0 || s < e.length; ) {
74
74
  if (i >= 0) {
75
- if ((a = e[i]) && (2 & a.__u) == 0 && l == a.key && r == a.type) return i;
75
+ if ((l = e[i]) && (2 & l.__u) == 0 && c == l.key && r == l.type) return i;
76
76
  i--;
77
77
  }
78
78
  if (s < e.length) {
79
- if ((a = e[s]) && (2 & a.__u) == 0 && l == a.key && r == a.type) return s;
79
+ if ((l = e[s]) && (2 & l.__u) == 0 && c == l.key && r == l.type) return s;
80
80
  s++;
81
81
  }
82
82
  }
83
83
  return -1;
84
84
  }
85
- function ke(t, e, n) {
86
- e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || it.test(e) ? n : n + "px";
85
+ function Se(t, e, n) {
86
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || lt.test(e) ? n : n + "px";
87
87
  }
88
- function J(t, e, n, o, i) {
88
+ function Z(t, e, n, o, i) {
89
89
  var s;
90
90
  e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
91
91
  else {
92
- if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || ke(t.style, e, "");
93
- if (n) for (e in n) o && n[e] == o[e] || ke(t.style, e, n[e]);
92
+ if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || Se(t.style, e, "");
93
+ if (n) for (e in n) o && n[e] == o[e] || Se(t.style, e, n[e]);
94
94
  }
95
- else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(Ge, "$1")), e = e.toLowerCase() in t || e == "onFocusOut" || e == "onFocusIn" ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? o ? n.u = o.u : (n.u = me, t.addEventListener(e, s ? he : de, s)) : t.removeEventListener(e, s ? he : de, s);
95
+ else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(qe, "$1")), e = e.toLowerCase() in t || e == "onFocusOut" || e == "onFocusIn" ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? o ? n.u = o.u : (n.u = pe, t.addEventListener(e, s ? _e : fe, s)) : t.removeEventListener(e, s ? _e : fe, s);
96
96
  else {
97
97
  if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
98
98
  else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
@@ -103,127 +103,127 @@ function J(t, e, n, o, i) {
103
103
  typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
104
104
  }
105
105
  }
106
- function Te(t) {
106
+ function ze(t) {
107
107
  return function(e) {
108
108
  if (this.l) {
109
109
  var n = this.l[e.type + t];
110
- if (e.t == null) e.t = me++;
110
+ if (e.t == null) e.t = pe++;
111
111
  else if (e.t < n.u) return;
112
- return n(S.event ? S.event(e) : e);
112
+ return n(L.event ? L.event(e) : e);
113
113
  }
114
114
  };
115
115
  }
116
- function ge(t, e, n, o, i, s, l, r, a, c) {
117
- var d, u, h, _, m, g, f, p, v, y, w, b, k, T, N, L, A, z = e.type;
116
+ function Ce(t, e, n, o, i, s, c, r, l, a) {
117
+ var d, u, h, f, w, g, _, v, m, y, C, k, T, z, S, b, E, N = e.type;
118
118
  if (e.constructor != null) return null;
119
- 128 & n.__u && (a = !!(32 & n.__u), s = [r = e.__e = n.__e]), (d = S.__b) && d(e);
120
- e: if (typeof z == "function") try {
121
- if (p = e.props, v = "prototype" in z && z.prototype.render, y = (d = z.contextType) && o[d.__c], w = d ? y ? y.props.value : d.__ : o, n.__c ? f = (u = e.__c = n.__c).__ = u.__E : (v ? e.__c = u = new z(p, w) : (e.__c = u = new ee(p, w), u.constructor = z, u.render = ut), y && y.sub(u), u.props = p, u.state || (u.state = {}), u.context = w, u.__n = o, h = u.__d = !0, u.__h = [], u._sb = []), v && u.__s == null && (u.__s = u.state), v && z.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = $({}, u.__s)), $(u.__s, z.getDerivedStateFromProps(p, u.__s))), _ = u.props, m = u.state, u.__v = e, h) v && z.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), v && u.componentDidMount != null && u.__h.push(u.componentDidMount);
119
+ 128 & n.__u && (l = !!(32 & n.__u), s = [r = e.__e = n.__e]), (d = L.__b) && d(e);
120
+ e: if (typeof N == "function") try {
121
+ if (v = e.props, m = "prototype" in N && N.prototype.render, y = (d = N.contextType) && o[d.__c], C = d ? y ? y.props.value : d.__ : o, n.__c ? _ = (u = e.__c = n.__c).__ = u.__E : (m ? e.__c = u = new N(v, C) : (e.__c = u = new te(v, C), u.constructor = N, u.render = ht), y && y.sub(u), u.props = v, u.state || (u.state = {}), u.context = C, u.__n = o, h = u.__d = !0, u.__h = [], u._sb = []), m && u.__s == null && (u.__s = u.state), m && N.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = $({}, u.__s)), $(u.__s, N.getDerivedStateFromProps(v, u.__s))), f = u.props, w = u.state, u.__v = e, h) m && N.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), m && u.componentDidMount != null && u.__h.push(u.componentDidMount);
122
122
  else {
123
- if (v && z.getDerivedStateFromProps == null && p !== _ && u.componentWillReceiveProps != null && u.componentWillReceiveProps(p, w), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(p, u.__s, w) === !1 || e.__v == n.__v) {
124
- for (e.__v != n.__v && (u.props = p, u.state = u.__s, u.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(P) {
123
+ if (m && N.getDerivedStateFromProps == null && v !== f && u.componentWillReceiveProps != null && u.componentWillReceiveProps(v, C), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(v, u.__s, C) === !1 || e.__v == n.__v) {
124
+ for (e.__v != n.__v && (u.props = v, u.state = u.__s, u.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(P) {
125
125
  P && (P.__ = e);
126
- }), b = 0; b < u._sb.length; b++) u.__h.push(u._sb[b]);
127
- u._sb = [], u.__h.length && l.push(u);
126
+ }), k = 0; k < u._sb.length; k++) u.__h.push(u._sb[k]);
127
+ u._sb = [], u.__h.length && c.push(u);
128
128
  break e;
129
129
  }
130
- u.componentWillUpdate != null && u.componentWillUpdate(p, u.__s, w), v && u.componentDidUpdate != null && u.__h.push(function() {
131
- u.componentDidUpdate(_, m, g);
130
+ u.componentWillUpdate != null && u.componentWillUpdate(v, u.__s, C), m && u.componentDidUpdate != null && u.__h.push(function() {
131
+ u.componentDidUpdate(f, w, g);
132
132
  });
133
133
  }
134
- if (u.context = w, u.props = p, u.__P = t, u.__e = !1, k = S.__r, T = 0, v) {
135
- for (u.state = u.__s, u.__d = !1, k && k(e), d = u.render(u.props, u.state, u.context), N = 0; N < u._sb.length; N++) u.__h.push(u._sb[N]);
134
+ if (u.context = C, u.props = v, u.__P = t, u.__e = !1, T = L.__r, z = 0, m) {
135
+ for (u.state = u.__s, u.__d = !1, T && T(e), d = u.render(u.props, u.state, u.context), S = 0; S < u._sb.length; S++) u.__h.push(u._sb[S]);
136
136
  u._sb = [];
137
137
  } else do
138
- u.__d = !1, k && k(e), d = u.render(u.props, u.state, u.context), u.state = u.__s;
139
- while (u.__d && ++T < 25);
140
- u.state = u.__s, u.getChildContext != null && (o = $($({}, o), u.getChildContext())), v && !h && u.getSnapshotBeforeUpdate != null && (g = u.getSnapshotBeforeUpdate(_, m)), L = d, d != null && d.type === ae && d.key == null && (L = Ke(d.props.children)), r = Be(t, le(L) ? L : [L], e, n, o, i, s, l, r, a, c), u.base = e.__e, e.__u &= -161, u.__h.length && l.push(u), f && (u.__E = u.__ = null);
138
+ u.__d = !1, T && T(e), d = u.render(u.props, u.state, u.context), u.state = u.__s;
139
+ while (u.__d && ++z < 25);
140
+ u.state = u.__s, u.getChildContext != null && (o = $($({}, o), u.getChildContext())), m && !h && u.getSnapshotBeforeUpdate != null && (g = u.getSnapshotBeforeUpdate(f, w)), b = d, d != null && d.type === ce && d.key == null && (b = Ze(d.props.children)), r = Xe(t, ae(b) ? b : [b], e, n, o, i, s, c, r, l, a), u.base = e.__e, e.__u &= -161, u.__h.length && c.push(u), _ && (u.__E = u.__ = null);
141
141
  } catch (P) {
142
- if (e.__v = null, a || s != null) if (P.then) {
143
- for (e.__u |= a ? 160 : 128; r && r.nodeType == 8 && r.nextSibling; ) r = r.nextSibling;
142
+ if (e.__v = null, l || s != null) if (P.then) {
143
+ for (e.__u |= l ? 160 : 128; r && r.nodeType == 8 && r.nextSibling; ) r = r.nextSibling;
144
144
  s[s.indexOf(r)] = null, e.__e = r;
145
- } else for (A = s.length; A--; ) ve(s[A]);
145
+ } else for (E = s.length; E--; ) ge(s[E]);
146
146
  else e.__e = n.__e, e.__k = n.__k;
147
- S.__e(P, e, n);
147
+ L.__e(P, e, n);
148
148
  }
149
- else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : r = e.__e = ct(n.__e, e, n, o, i, s, l, a, c);
150
- return (d = S.diffed) && d(e), 128 & e.__u ? void 0 : r;
149
+ else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : r = e.__e = dt(n.__e, e, n, o, i, s, c, l, a);
150
+ return (d = L.diffed) && d(e), 128 & e.__u ? void 0 : r;
151
151
  }
152
- function Xe(t, e, n) {
153
- for (var o = 0; o < n.length; o++) pe(n[o], n[++o], n[++o]);
154
- S.__c && S.__c(e, t), t.some(function(i) {
152
+ function Je(t, e, n) {
153
+ for (var o = 0; o < n.length; o++) we(n[o], n[++o], n[++o]);
154
+ L.__c && L.__c(e, t), t.some(function(i) {
155
155
  try {
156
156
  t = i.__h, i.__h = [], t.some(function(s) {
157
157
  s.call(i);
158
158
  });
159
159
  } catch (s) {
160
- S.__e(s, i.__v);
160
+ L.__e(s, i.__v);
161
161
  }
162
162
  });
163
163
  }
164
- function Ke(t) {
165
- return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : le(t) ? t.map(Ke) : $({}, t);
164
+ function Ze(t) {
165
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : ae(t) ? t.map(Ze) : $({}, t);
166
166
  }
167
- function ct(t, e, n, o, i, s, l, r, a) {
168
- var c, d, u, h, _, m, g, f = n.props, p = e.props, v = e.type;
169
- if (v == "svg" ? i = "http://www.w3.org/2000/svg" : v == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), s != null) {
170
- for (c = 0; c < s.length; c++) if ((_ = s[c]) && "setAttribute" in _ == !!v && (v ? _.localName == v : _.nodeType == 3)) {
171
- t = _, s[c] = null;
167
+ function dt(t, e, n, o, i, s, c, r, l) {
168
+ var a, d, u, h, f, w, g, _ = n.props, v = e.props, m = e.type;
169
+ if (m == "svg" ? i = "http://www.w3.org/2000/svg" : m == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), s != null) {
170
+ for (a = 0; a < s.length; a++) if ((f = s[a]) && "setAttribute" in f == !!m && (m ? f.localName == m : f.nodeType == 3)) {
171
+ t = f, s[a] = null;
172
172
  break;
173
173
  }
174
174
  }
175
175
  if (t == null) {
176
- if (v == null) return document.createTextNode(p);
177
- t = document.createElementNS(i, v, p.is && p), r && (S.__m && S.__m(e, s), r = !1), s = null;
176
+ if (m == null) return document.createTextNode(v);
177
+ t = document.createElementNS(i, m, v.is && v), r && (L.__m && L.__m(e, s), r = !1), s = null;
178
178
  }
179
- if (v == null) f === p || r && t.data == p || (t.data = p);
179
+ if (m == null) _ === v || r && t.data == v || (t.data = v);
180
180
  else {
181
- if (s = s && se.call(t.childNodes), f = n.props || B, !r && s != null) for (f = {}, c = 0; c < t.attributes.length; c++) f[(_ = t.attributes[c]).name] = _.value;
182
- for (c in f) if (_ = f[c], c != "children") {
183
- if (c == "dangerouslySetInnerHTML") u = _;
184
- else if (!(c in p)) {
185
- if (c == "value" && "defaultValue" in p || c == "checked" && "defaultChecked" in p) continue;
186
- J(t, c, null, _, i);
181
+ if (s = s && le.call(t.childNodes), _ = n.props || X, !r && s != null) for (_ = {}, a = 0; a < t.attributes.length; a++) _[(f = t.attributes[a]).name] = f.value;
182
+ for (a in _) if (f = _[a], a != "children") {
183
+ if (a == "dangerouslySetInnerHTML") u = f;
184
+ else if (!(a in v)) {
185
+ if (a == "value" && "defaultValue" in v || a == "checked" && "defaultChecked" in v) continue;
186
+ Z(t, a, null, f, i);
187
187
  }
188
188
  }
189
- for (c in p) _ = p[c], c == "children" ? h = _ : c == "dangerouslySetInnerHTML" ? d = _ : c == "value" ? m = _ : c == "checked" ? g = _ : r && typeof _ != "function" || f[c] === _ || J(t, c, _, f[c], i);
189
+ for (a in v) f = v[a], a == "children" ? h = f : a == "dangerouslySetInnerHTML" ? d = f : a == "value" ? w = f : a == "checked" ? g = f : r && typeof f != "function" || _[a] === f || Z(t, a, f, _[a], i);
190
190
  if (d) r || u && (d.__html == u.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
191
- else if (u && (t.innerHTML = ""), Be(e.type == "template" ? t.content : t, le(h) ? h : [h], e, n, o, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, s, l, s ? s[0] : n.__k && G(n, 0), r, a), s != null) for (c = s.length; c--; ) ve(s[c]);
192
- r || (c = "value", v == "progress" && m == null ? t.removeAttribute("value") : m != null && (m !== t[c] || v == "progress" && !m || v == "option" && m != f[c]) && J(t, c, m, f[c], i), c = "checked", g != null && g != t[c] && J(t, c, g, f[c], i));
191
+ else if (u && (t.innerHTML = ""), Xe(e.type == "template" ? t.content : t, ae(h) ? h : [h], e, n, o, m == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, s, c, s ? s[0] : n.__k && G(n, 0), r, l), s != null) for (a = s.length; a--; ) ge(s[a]);
192
+ r || (a = "value", m == "progress" && w == null ? t.removeAttribute("value") : w != null && (w !== t[a] || m == "progress" && !w || m == "option" && w != _[a]) && Z(t, a, w, _[a], i), a = "checked", g != null && g != t[a] && Z(t, a, g, _[a], i));
193
193
  }
194
194
  return t;
195
195
  }
196
- function pe(t, e, n) {
196
+ function we(t, e, n) {
197
197
  try {
198
198
  if (typeof t == "function") {
199
199
  var o = typeof t.__u == "function";
200
200
  o && t.__u(), o && e == null || (t.__u = t(e));
201
201
  } else t.current = e;
202
202
  } catch (i) {
203
- S.__e(i, n);
203
+ L.__e(i, n);
204
204
  }
205
205
  }
206
- function Je(t, e, n) {
206
+ function Qe(t, e, n) {
207
207
  var o, i;
208
- if (S.unmount && S.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || pe(o, null, e)), (o = t.__c) != null) {
208
+ if (L.unmount && L.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || we(o, null, e)), (o = t.__c) != null) {
209
209
  if (o.componentWillUnmount) try {
210
210
  o.componentWillUnmount();
211
211
  } catch (s) {
212
- S.__e(s, e);
212
+ L.__e(s, e);
213
213
  }
214
214
  o.base = o.__P = null;
215
215
  }
216
- if (o = t.__k) for (i = 0; i < o.length; i++) o[i] && Je(o[i], e, n || typeof t.type != "function");
217
- n || ve(t.__e), t.__c = t.__ = t.__e = void 0;
216
+ if (o = t.__k) for (i = 0; i < o.length; i++) o[i] && Qe(o[i], e, n || typeof t.type != "function");
217
+ n || ge(t.__e), t.__c = t.__ = t.__e = void 0;
218
218
  }
219
- function ut(t, e, n) {
219
+ function ht(t, e, n) {
220
220
  return this.constructor(t, n);
221
221
  }
222
- function dt(t, e, n) {
223
- var o, i, s, l;
224
- e == document && (e = document.documentElement), S.__ && S.__(t, e), i = (o = !1) ? null : e.__k, s = [], l = [], ge(e, t = e.__k = st(ae, null, [t]), i || B, B, e.namespaceURI, i ? null : e.firstChild ? se.call(e.childNodes) : null, s, i ? i.__e : e.firstChild, o, l), Xe(s, t, l);
222
+ function ft(t, e, n) {
223
+ var o, i, s, c;
224
+ e == document && (e = document.documentElement), L.__ && L.__(t, e), i = (o = !1) ? null : e.__k, s = [], c = [], Ce(e, t = e.__k = at(ce, null, [t]), i || X, X, e.namespaceURI, i ? null : e.firstChild ? le.call(e.childNodes) : null, s, i ? i.__e : e.firstChild, o, c), Je(s, t, c);
225
225
  }
226
- function ht(t) {
226
+ function _t(t) {
227
227
  function e(n) {
228
228
  var o, i;
229
229
  return this.getChildContext || (o = /* @__PURE__ */ new Set(), (i = {})[e.__c] = this, this.getChildContext = function() {
@@ -231,180 +231,180 @@ function ht(t) {
231
231
  }, this.componentWillUnmount = function() {
232
232
  o = null;
233
233
  }, this.shouldComponentUpdate = function(s) {
234
- this.props.value != s.value && o.forEach(function(l) {
235
- l.__e = !0, _e(l);
234
+ this.props.value != s.value && o.forEach(function(c) {
235
+ c.__e = !0, me(c);
236
236
  });
237
237
  }, this.sub = function(s) {
238
238
  o.add(s);
239
- var l = s.componentWillUnmount;
239
+ var c = s.componentWillUnmount;
240
240
  s.componentWillUnmount = function() {
241
- o && o.delete(s), l && l.call(s);
241
+ o && o.delete(s), c && c.call(s);
242
242
  };
243
243
  }), n.children;
244
244
  }
245
- return e.__c = "__cC" + He++, e.__ = t, e.Provider = e.__l = (e.Consumer = function(n, o) {
245
+ return e.__c = "__cC" + Be++, e.__ = t, e.Provider = e.__l = (e.Consumer = function(n, o) {
246
246
  return n.children(o);
247
247
  }).contextType = e, e;
248
248
  }
249
- se = qe.slice, S = { __e: function(t, e, n, o) {
250
- for (var i, s, l; e = e.__; ) if ((i = e.__c) && !i.__) try {
251
- if ((s = i.constructor) && s.getDerivedStateFromError != null && (i.setState(s.getDerivedStateFromError(t)), l = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, o || {}), l = i.__d), l) return i.__E = i;
249
+ le = Ve.slice, L = { __e: function(t, e, n, o) {
250
+ for (var i, s, c; e = e.__; ) if ((i = e.__c) && !i.__) try {
251
+ if ((s = i.constructor) && s.getDerivedStateFromError != null && (i.setState(s.getDerivedStateFromError(t)), c = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, o || {}), c = i.__d), c) return i.__E = i;
252
252
  } catch (r) {
253
253
  t = r;
254
254
  }
255
255
  throw t;
256
- } }, Ue = 0, ee.prototype.setState = function(t, e) {
256
+ } }, je = 0, te.prototype.setState = function(t, e) {
257
257
  var n;
258
- n = this.__s != null && this.__s != this.state ? this.__s : this.__s = $({}, this.state), typeof t == "function" && (t = t($({}, n), this.props)), t && $(n, t), t != null && this.__v && (e && this._sb.push(e), _e(this));
259
- }, ee.prototype.forceUpdate = function(t) {
260
- this.__v && (this.__e = !0, t && this.__h.push(t), _e(this));
261
- }, ee.prototype.render = ae, W = [], We = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, je = function(t, e) {
258
+ n = this.__s != null && this.__s != this.state ? this.__s : this.__s = $({}, this.state), typeof t == "function" && (t = t($({}, n), this.props)), t && $(n, t), t != null && this.__v && (e && this._sb.push(e), me(this));
259
+ }, te.prototype.forceUpdate = function(t) {
260
+ this.__v && (this.__e = !0, t && this.__h.push(t), me(this));
261
+ }, te.prototype.render = ce, U = [], Ge = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, He = function(t, e) {
262
262
  return t.__v.__b - e.__v.__b;
263
- }, re.__r = 0, Ge = /(PointerCapture)$|Capture$/i, me = 0, de = Te(!1), he = Te(!0), He = 0;
264
- var _t = 0;
265
- function C(t, e, n, o, i, s) {
263
+ }, ie.__r = 0, qe = /(PointerCapture)$|Capture$/i, pe = 0, fe = ze(!1), _e = ze(!0), Be = 0;
264
+ var mt = 0;
265
+ function p(t, e, n, o, i, s) {
266
266
  e || (e = {});
267
- var l, r, a = e;
268
- if ("ref" in a) for (r in a = {}, e) r == "ref" ? l = e[r] : a[r] = e[r];
269
- var c = { type: t, props: a, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --_t, __i: -1, __u: 0, __source: i, __self: s };
270
- if (typeof t == "function" && (l = t.defaultProps)) for (r in l) a[r] === void 0 && (a[r] = l[r]);
271
- return S.vnode && S.vnode(c), c;
272
- }
273
- var H, E, ue, Le, Y = 0, Ze = [], M = S, Se = M.__b, Ne = M.__r, ze = M.diffed, Ee = M.__c, Ae = M.unmount, Me = M.__;
274
- function ce(t, e) {
275
- M.__h && M.__h(E, t, Y || e), Y = 0;
276
- var n = E.__H || (E.__H = { __: [], __h: [] });
267
+ var c, r, l = e;
268
+ if ("ref" in l) for (r in l = {}, e) r == "ref" ? c = e[r] : l[r] = e[r];
269
+ var a = { type: t, props: l, key: n, ref: c, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --mt, __i: -1, __u: 0, __source: i, __self: s };
270
+ if (typeof t == "function" && (c = t.defaultProps)) for (r in c) l[r] === void 0 && (l[r] = c[r]);
271
+ return L.vnode && L.vnode(a), a;
272
+ }
273
+ var H, A, he, Le, K = 0, et = [], M = L, Ne = M.__b, Ae = M.__r, Ee = M.diffed, Me = M.__c, Pe = M.unmount, Ie = M.__;
274
+ function ue(t, e) {
275
+ M.__h && M.__h(A, t, K || e), K = 0;
276
+ var n = A.__H || (A.__H = { __: [], __h: [] });
277
277
  return t >= n.__.length && n.__.push({}), n.__[t];
278
278
  }
279
279
  function j(t) {
280
- return Y = 1, ft(et, t);
281
- }
282
- function ft(t, e, n) {
283
- var o = ce(H++, 2);
284
- if (o.t = t, !o.__c && (o.__ = [et(void 0, e), function(r) {
285
- var a = o.__N ? o.__N[0] : o.__[0], c = o.t(a, r);
286
- a !== c && (o.__N = [c, o.__[1]], o.__c.setState({}));
287
- }], o.__c = E, !E.__f)) {
288
- var i = function(r, a, c) {
280
+ return K = 1, vt(nt, t);
281
+ }
282
+ function vt(t, e, n) {
283
+ var o = ue(H++, 2);
284
+ if (o.t = t, !o.__c && (o.__ = [nt(void 0, e), function(r) {
285
+ var l = o.__N ? o.__N[0] : o.__[0], a = o.t(l, r);
286
+ l !== a && (o.__N = [a, o.__[1]], o.__c.setState({}));
287
+ }], o.__c = A, !A.__f)) {
288
+ var i = function(r, l, a) {
289
289
  if (!o.__c.__H) return !0;
290
290
  var d = o.__c.__H.__.filter(function(h) {
291
291
  return !!h.__c;
292
292
  });
293
293
  if (d.every(function(h) {
294
294
  return !h.__N;
295
- })) return !s || s.call(this, r, a, c);
295
+ })) return !s || s.call(this, r, l, a);
296
296
  var u = o.__c.props !== r;
297
297
  return d.forEach(function(h) {
298
298
  if (h.__N) {
299
- var _ = h.__[0];
300
- h.__ = h.__N, h.__N = void 0, _ !== h.__[0] && (u = !0);
299
+ var f = h.__[0];
300
+ h.__ = h.__N, h.__N = void 0, f !== h.__[0] && (u = !0);
301
301
  }
302
- }), s && s.call(this, r, a, c) || u;
302
+ }), s && s.call(this, r, l, a) || u;
303
303
  };
304
- E.__f = !0;
305
- var s = E.shouldComponentUpdate, l = E.componentWillUpdate;
306
- E.componentWillUpdate = function(r, a, c) {
304
+ A.__f = !0;
305
+ var s = A.shouldComponentUpdate, c = A.componentWillUpdate;
306
+ A.componentWillUpdate = function(r, l, a) {
307
307
  if (this.__e) {
308
308
  var d = s;
309
- s = void 0, i(r, a, c), s = d;
309
+ s = void 0, i(r, l, a), s = d;
310
310
  }
311
- l && l.call(this, r, a, c);
312
- }, E.shouldComponentUpdate = i;
311
+ c && c.call(this, r, l, a);
312
+ }, A.shouldComponentUpdate = i;
313
313
  }
314
314
  return o.__N || o.__;
315
315
  }
316
316
  function x(t, e) {
317
- var n = ce(H++, 3);
318
- !M.__s && Qe(n.__H, e) && (n.__ = t, n.u = e, E.__H.__h.push(n));
317
+ var n = ue(H++, 3);
318
+ !M.__s && tt(n.__H, e) && (n.__ = t, n.u = e, A.__H.__h.push(n));
319
319
  }
320
- function R(t) {
321
- return Y = 5, q(function() {
320
+ function F(t) {
321
+ return K = 5, q(function() {
322
322
  return { current: t };
323
323
  }, []);
324
324
  }
325
325
  function q(t, e) {
326
- var n = ce(H++, 7);
327
- return Qe(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
326
+ var n = ue(H++, 7);
327
+ return tt(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
328
328
  }
329
- function mt(t, e) {
330
- return Y = 8, q(function() {
329
+ function pt(t, e) {
330
+ return K = 8, q(function() {
331
331
  return t;
332
332
  }, e);
333
333
  }
334
- function vt(t) {
335
- var e = E.context[t.__c], n = ce(H++, 9);
336
- return n.c = t, e ? (n.__ == null && (n.__ = !0, e.sub(E)), e.props.value) : t.__;
334
+ function gt(t) {
335
+ var e = A.context[t.__c], n = ue(H++, 9);
336
+ return n.c = t, e ? (n.__ == null && (n.__ = !0, e.sub(A)), e.props.value) : t.__;
337
337
  }
338
- function gt() {
339
- for (var t; t = Ze.shift(); ) if (t.__P && t.__H) try {
340
- t.__H.__h.forEach(te), t.__H.__h.forEach(fe), t.__H.__h = [];
338
+ function Ct() {
339
+ for (var t; t = et.shift(); ) if (t.__P && t.__H) try {
340
+ t.__H.__h.forEach(ne), t.__H.__h.forEach(ve), t.__H.__h = [];
341
341
  } catch (e) {
342
342
  t.__H.__h = [], M.__e(e, t.__v);
343
343
  }
344
344
  }
345
345
  M.__b = function(t) {
346
- E = null, Se && Se(t);
346
+ A = null, Ne && Ne(t);
347
347
  }, M.__ = function(t, e) {
348
- t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Me && Me(t, e);
348
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Ie && Ie(t, e);
349
349
  }, M.__r = function(t) {
350
- Ne && Ne(t), H = 0;
351
- var e = (E = t.__c).__H;
352
- e && (ue === E ? (e.__h = [], E.__h = [], e.__.forEach(function(n) {
350
+ Ae && Ae(t), H = 0;
351
+ var e = (A = t.__c).__H;
352
+ e && (he === A ? (e.__h = [], A.__h = [], e.__.forEach(function(n) {
353
353
  n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
354
- })) : (e.__h.forEach(te), e.__h.forEach(fe), e.__h = [], H = 0)), ue = E;
354
+ })) : (e.__h.forEach(ne), e.__h.forEach(ve), e.__h = [], H = 0)), he = A;
355
355
  }, M.diffed = function(t) {
356
- ze && ze(t);
356
+ Ee && Ee(t);
357
357
  var e = t.__c;
358
- e && e.__H && (e.__H.__h.length && (Ze.push(e) !== 1 && Le === M.requestAnimationFrame || ((Le = M.requestAnimationFrame) || pt)(gt)), e.__H.__.forEach(function(n) {
358
+ e && e.__H && (e.__H.__h.length && (et.push(e) !== 1 && Le === M.requestAnimationFrame || ((Le = M.requestAnimationFrame) || wt)(Ct)), e.__H.__.forEach(function(n) {
359
359
  n.u && (n.__H = n.u), n.u = void 0;
360
- })), ue = E = null;
360
+ })), he = A = null;
361
361
  }, M.__c = function(t, e) {
362
362
  e.some(function(n) {
363
363
  try {
364
- n.__h.forEach(te), n.__h = n.__h.filter(function(o) {
365
- return !o.__ || fe(o);
364
+ n.__h.forEach(ne), n.__h = n.__h.filter(function(o) {
365
+ return !o.__ || ve(o);
366
366
  });
367
367
  } catch (o) {
368
368
  e.some(function(i) {
369
369
  i.__h && (i.__h = []);
370
370
  }), e = [], M.__e(o, n.__v);
371
371
  }
372
- }), Ee && Ee(t, e);
372
+ }), Me && Me(t, e);
373
373
  }, M.unmount = function(t) {
374
- Ae && Ae(t);
374
+ Pe && Pe(t);
375
375
  var e, n = t.__c;
376
376
  n && n.__H && (n.__H.__.forEach(function(o) {
377
377
  try {
378
- te(o);
378
+ ne(o);
379
379
  } catch (i) {
380
380
  e = i;
381
381
  }
382
382
  }), n.__H = void 0, e && M.__e(e, n.__v));
383
383
  };
384
- var Pe = typeof requestAnimationFrame == "function";
385
- function pt(t) {
384
+ var xe = typeof requestAnimationFrame == "function";
385
+ function wt(t) {
386
386
  var e, n = function() {
387
- clearTimeout(o), Pe && cancelAnimationFrame(e), setTimeout(t);
387
+ clearTimeout(o), xe && cancelAnimationFrame(e), setTimeout(t);
388
388
  }, o = setTimeout(n, 100);
389
- Pe && (e = requestAnimationFrame(n));
389
+ xe && (e = requestAnimationFrame(n));
390
390
  }
391
- function te(t) {
392
- var e = E, n = t.__c;
393
- typeof n == "function" && (t.__c = void 0, n()), E = e;
391
+ function ne(t) {
392
+ var e = A, n = t.__c;
393
+ typeof n == "function" && (t.__c = void 0, n()), A = e;
394
394
  }
395
- function fe(t) {
396
- var e = E;
397
- t.__c = t.__(), E = e;
395
+ function ve(t) {
396
+ var e = A;
397
+ t.__c = t.__(), A = e;
398
398
  }
399
- function Qe(t, e) {
399
+ function tt(t, e) {
400
400
  return !t || t.length !== e.length || e.some(function(n, o) {
401
401
  return n !== t[o];
402
402
  });
403
403
  }
404
- function et(t, e) {
404
+ function nt(t, e) {
405
405
  return typeof e == "function" ? e(t) : e;
406
406
  }
407
- const Ct = (t) => ({
407
+ const yt = (t) => ({
408
408
  saveGameData(e) {
409
409
  try {
410
410
  localStorage.setItem(t, JSON.stringify(e));
@@ -427,14 +427,14 @@ const Ct = (t) => ({
427
427
  console.error("Failed to reset maze game data:", e);
428
428
  }
429
429
  }
430
- }), tt = ht(void 0), Ie = {
430
+ }), ot = _t(void 0), De = {
431
431
  currentLevel: 1,
432
432
  highestUnlockedLevel: 1,
433
433
  currentTier: 1,
434
434
  highestUnlockedTier: 1,
435
435
  levelScores: {},
436
436
  totalScore: 0
437
- }, xe = {
437
+ }, Fe = {
438
438
  isGameActive: !0,
439
439
  levelTransitioning: !1,
440
440
  maze: null,
@@ -447,11 +447,11 @@ const Ct = (t) => ({
447
447
  showClue: !1,
448
448
  playerPath: [],
449
449
  visitCounts: {}
450
- }, wt = ({ children: t, config: e }) => {
451
- const n = Ct(e.lcPrefix + "progress"), o = n.loadGameData(), [i, s] = j(() => o || { ...Ie });
450
+ }, bt = ({ children: t, config: e }) => {
451
+ const n = yt(e.lcPrefix + "progress"), o = n.loadGameData(), [i, s] = j(() => o || { ...De });
452
452
  x(() => {
453
453
  const u = Object.values(i.levelScores).reduce(
454
- (h, _) => h + _,
454
+ (h, f) => h + f,
455
455
  0
456
456
  );
457
457
  s((h) => ({
@@ -468,114 +468,114 @@ const Ct = (t) => ({
468
468
  i.levelScores,
469
469
  i.totalScore
470
470
  ]);
471
- const [l, r] = j({
472
- ...xe
473
- }), a = R(l);
471
+ const [c, r] = j({
472
+ ...Fe
473
+ }), l = F(c);
474
474
  x(() => {
475
- a.current = l;
476
- }, [l]);
477
- const c = q(() => [
478
- l.playerAtExit ? 1 : 0,
479
- l.foodCollected === l.totalFoodCount ? 1 : 0,
480
- l.showClue ? 0 : 1
475
+ l.current = c;
476
+ }, [c]);
477
+ const a = q(() => [
478
+ c.playerAtExit ? 1 : 0,
479
+ c.foodCollected === c.totalFoodCount ? 1 : 0,
480
+ c.showClue ? 0 : 1
481
481
  ], [
482
- l.playerAtExit,
483
- l.foodCollected,
484
- l.totalFoodCount,
485
- l.showClue
482
+ c.playerAtExit,
483
+ c.foodCollected,
484
+ c.totalFoodCount,
485
+ c.showClue
486
486
  ]), d = () => {
487
487
  n.resetGameData(), s({
488
- ...Ie
488
+ ...De
489
489
  }), r({
490
- ...xe
490
+ ...Fe
491
491
  });
492
492
  };
493
- return /* @__PURE__ */ C(
494
- tt.Provider,
493
+ return /* @__PURE__ */ p(
494
+ ot.Provider,
495
495
  {
496
496
  value: {
497
497
  gameProgress: i,
498
498
  setGameProgress: s,
499
- gamePlayState: l,
499
+ gamePlayState: c,
500
500
  setGamePlayState: r,
501
- gamePlayStateRef: a,
502
- currentScore: c,
501
+ gamePlayStateRef: l,
502
+ currentScore: a,
503
503
  config: e,
504
504
  resetGame: d
505
505
  },
506
506
  children: t
507
507
  }
508
508
  );
509
- }, V = () => {
510
- const t = vt(tt);
509
+ }, B = () => {
510
+ const t = gt(ot);
511
511
  if (!t)
512
512
  throw new Error("useGameContext must be used within a GameProvider");
513
513
  return t;
514
- }, X = (t) => q(() => {
515
- const e = t.map((r) => r.length), n = e.reduce((r, a) => r + a, 0), o = t.length, i = (r) => {
514
+ }, J = (t) => q(() => {
515
+ const e = t.map((r) => r.length), n = e.reduce((r, l) => r + l, 0), o = t.length, i = (r) => {
516
516
  if (r < 1 || r > n) return 0;
517
- let a = 0;
518
- for (let c = 0; c < e.length; c++)
519
- if (a += e[c], r <= a) return c + 1;
517
+ let l = 0;
518
+ for (let a = 0; a < e.length; a++)
519
+ if (l += e[a], r <= l) return a + 1;
520
520
  return 0;
521
- }, s = (r) => r < 1 || r > o ? 0 : e.slice(0, r - 1).reduce((a, c) => a + c, 0) + 1, l = {
521
+ }, s = (r) => r < 1 || r > o ? 0 : e.slice(0, r - 1).reduce((l, a) => l + a, 0) + 1, c = {
522
522
  getTotalLevels: () => n,
523
523
  getTotalTiers: () => o,
524
524
  getTierLevelsRange: (r) => {
525
525
  if (r < 1 || r > o) return [0, 0];
526
- const a = s(r), c = a + e[r - 1] - 1;
527
- return [a, c];
526
+ const l = s(r), a = l + e[r - 1] - 1;
527
+ return [l, a];
528
528
  },
529
529
  getTierByLevel: i,
530
530
  getFirstLevelOfTier: s,
531
531
  getLevelConfig: (r) => {
532
532
  if (r < 1 || r > n) return null;
533
- const a = i(r), c = s(a), d = r - c;
534
- return t[a - 1][d];
533
+ const l = i(r), a = s(l), d = r - a;
534
+ return t[l - 1][d];
535
535
  },
536
536
  getTierConfig: (r) => r < 1 || r > o ? null : t[r - 1],
537
- isLevelUnlocked: (r, a) => r <= a,
538
- isTierUnlocked: (r, a) => r <= a,
537
+ isLevelUnlocked: (r, l) => r <= l,
538
+ isTierUnlocked: (r, l) => r <= l,
539
539
  getNextLevelInfo: (r) => {
540
540
  if (r >= n) return null;
541
- const a = r + 1, c = i(r), d = i(a);
541
+ const l = r + 1, a = i(r), d = i(l);
542
542
  return {
543
- nextLevel: a,
543
+ nextLevel: l,
544
544
  nextTier: d,
545
- isTierChange: d > c
545
+ isTierChange: d > a
546
546
  };
547
547
  },
548
- getCurrentTierProgress: (r, a) => {
549
- const [c, d] = l.getTierLevelsRange(a), u = r - c + 1, h = d - c + 1;
548
+ getCurrentTierProgress: (r, l) => {
549
+ const [a, d] = c.getTierLevelsRange(l), u = r - a + 1, h = d - a + 1;
550
550
  return { current: u, total: h };
551
551
  },
552
552
  isLastLevelInTier: (r) => {
553
- const a = i(r), [, c] = l.getTierLevelsRange(a);
554
- return r === c;
553
+ const l = i(r), [, a] = c.getTierLevelsRange(l);
554
+ return r === a;
555
555
  },
556
556
  getPreviousLevelInfo: (r) => {
557
557
  if (r <= 1) return null;
558
- const a = r - 1, c = i(r), d = i(a);
558
+ const l = r - 1, a = i(r), d = i(l);
559
559
  return {
560
- prevLevel: a,
560
+ prevLevel: l,
561
561
  prevTier: d,
562
- isTierChange: d < c
562
+ isTierChange: d < a
563
563
  };
564
564
  }
565
565
  };
566
- return l;
567
- }, [t]), yt = ({ onTierChange: t, disabled: e }) => {
568
- const { gameProgress: n, config: o } = V(), { i18n: i, levelConfig: s } = o, { currentTier: l, highestUnlockedTier: r } = n, c = X(s).getTotalTiers();
569
- return /* @__PURE__ */ C("div", { className: "tier-selector", children: /* @__PURE__ */ C(
566
+ return c;
567
+ }, [t]), kt = ({ onTierChange: t, disabled: e }) => {
568
+ const { gameProgress: n, config: o } = B(), { i18n: i, levelConfig: s } = o, { currentTier: c, highestUnlockedTier: r } = n, a = J(s).getTotalTiers();
569
+ return /* @__PURE__ */ p("div", { className: "tier-selector", children: /* @__PURE__ */ p(
570
570
  "select",
571
571
  {
572
- value: l,
572
+ value: c,
573
573
  onChange: (d) => {
574
574
  d.target && d.target.value && t(Number(d.target.value));
575
575
  },
576
576
  disabled: e,
577
577
  className: "tier-dropdown",
578
- children: Array.from({ length: c }, (d, u) => u + 1).map((d) => /* @__PURE__ */ C(
578
+ children: Array.from({ length: a }, (d, u) => u + 1).map((d) => /* @__PURE__ */ p(
579
579
  "option",
580
580
  {
581
581
  value: d,
@@ -586,81 +586,81 @@ const Ct = (t) => ({
586
586
  ))
587
587
  }
588
588
  ) });
589
- }, bt = ({ onLevelChange: t, disabled: e }) => {
590
- const { gameProgress: n, config: o } = V(), { i18n: i, levelConfig: s } = o, { currentTier: l, levelScores: r, currentLevel: a, highestUnlockedLevel: c } = n, d = X(s), u = q(() => {
591
- const [h, _] = d.getTierLevelsRange(l);
592
- return Array.from({ length: _ - h + 1 }, (m, g) => {
593
- const f = h + g, p = r[f] || 0;
589
+ }, Tt = ({ onLevelChange: t, disabled: e }) => {
590
+ const { gameProgress: n, config: o } = B(), { i18n: i, levelConfig: s } = o, { currentTier: c, levelScores: r, currentLevel: l, highestUnlockedLevel: a } = n, d = J(s), u = q(() => {
591
+ const [h, f] = d.getTierLevelsRange(c);
592
+ return Array.from({ length: f - h + 1 }, (w, g) => {
593
+ const _ = h + g, v = r[_] || 0;
594
594
  return {
595
- level: f,
596
- score: p
595
+ level: _,
596
+ score: v
597
597
  };
598
598
  });
599
- }, [l, r]);
600
- return /* @__PURE__ */ C("div", { className: "level-selector", children: /* @__PURE__ */ C(
599
+ }, [c, r]);
600
+ return /* @__PURE__ */ p("div", { className: "level-selector", children: /* @__PURE__ */ p(
601
601
  "select",
602
602
  {
603
- value: a,
603
+ value: l,
604
604
  onChange: (h) => {
605
605
  h.target && h.target.value && t(Number(h.target.value));
606
606
  },
607
607
  disabled: e,
608
608
  className: "level-dropdown",
609
- children: u.map(({ level: h, score: _ }) => /* @__PURE__ */ C(
609
+ children: u.map(({ level: h, score: f }) => /* @__PURE__ */ p(
610
610
  "option",
611
611
  {
612
612
  value: h,
613
- disabled: h > c,
614
- children: `${i.level} ${h} ${"★".repeat(_)}`
613
+ disabled: h > a,
614
+ children: `${i.level} ${h} ${"★".repeat(f)}`
615
615
  },
616
616
  `level-${h}`
617
617
  ))
618
618
  }
619
619
  ) });
620
- }, ne = ({
620
+ }, oe = ({
621
621
  isOpen: t,
622
622
  title: e,
623
623
  className: n = "",
624
624
  message: o,
625
625
  children: i,
626
626
  noConfirm: s = !1,
627
- noCancel: l = !1,
627
+ noCancel: c = !1,
628
628
  confirmText: r = "OK",
629
- cancelText: a = "Cancel",
630
- onConfirm: c,
629
+ cancelText: l = "Cancel",
630
+ onConfirm: a,
631
631
  onCancel: d
632
632
  }) => {
633
- const u = R(null);
633
+ const u = F(null);
634
634
  return x(() => {
635
- const h = (_) => {
636
- _.key === "Escape" && d?.();
635
+ const h = (f) => {
636
+ f.key === "Escape" && d?.();
637
637
  };
638
638
  return t && document.addEventListener("keydown", h), () => {
639
639
  document.removeEventListener("keydown", h);
640
640
  };
641
- }, [t, d]), /* @__PURE__ */ C(
641
+ }, [t, d]), /* @__PURE__ */ p(
642
642
  "div",
643
643
  {
644
644
  className: `maze-dialog-overlay ${t ? "maze-dialog-visible" : ""}`,
645
- children: /* @__PURE__ */ C("div", { className: "maze-dialog " + n, ref: u, children: [
646
- /* @__PURE__ */ C("div", { className: "maze-dialog-title", children: e }),
647
- /* @__PURE__ */ C("div", { className: "maze-dialog-content", children: i || /* @__PURE__ */ C("div", { className: "maze-dialog-message", children: o }) }),
648
- (!l || !s) && /* @__PURE__ */ C("div", { className: "maze-dialog-buttons", children: [
649
- !l && /* @__PURE__ */ C(
645
+ children: /* @__PURE__ */ p("div", { className: "maze-dialog " + n, ref: u, children: [
646
+ /* @__PURE__ */ p("div", { className: "maze-dialog-title", children: e }),
647
+ /* @__PURE__ */ p("div", { className: "maze-dialog-content", children: i || /* @__PURE__ */ p("div", { className: "maze-dialog-message", children: o }) }),
648
+ (!c || !s) && /* @__PURE__ */ p("div", { className: "maze-dialog-buttons", children: [
649
+ !c && /* @__PURE__ */ p(
650
650
  "button",
651
651
  {
652
652
  type: "button",
653
653
  className: "maze-dialog-cancel",
654
654
  onClick: d,
655
- children: a
655
+ children: l
656
656
  }
657
657
  ),
658
- !s && /* @__PURE__ */ C(
658
+ !s && /* @__PURE__ */ p(
659
659
  "button",
660
660
  {
661
661
  type: "button",
662
662
  className: "maze-dialog-confirm",
663
- onClick: c,
663
+ onClick: a,
664
664
  children: r
665
665
  }
666
666
  )
@@ -668,7 +668,7 @@ const Ct = (t) => ({
668
668
  ] })
669
669
  }
670
670
  );
671
- }, O = {
671
+ }, R = {
672
672
  container: null,
673
673
  // attach Toast container to element, only need to execute once
674
674
  attachTo(t) {
@@ -698,7 +698,7 @@ const Ct = (t) => ({
698
698
  for (; this.container.firstChild; )
699
699
  this.container.removeChild(this.container.firstChild);
700
700
  }
701
- }, kt = () => {
701
+ }, St = () => {
702
702
  const {
703
703
  gameProgress: t,
704
704
  setGameProgress: e,
@@ -706,82 +706,82 @@ const Ct = (t) => ({
706
706
  setGamePlayState: o,
707
707
  gamePlayStateRef: i,
708
708
  resetGame: s,
709
- config: l
710
- } = V(), { i18n: r, levelConfig: a } = l, c = X(a), { levelTransitioning: d, showClue: u } = n, { highestUnlockedLevel: h, totalScore: _ } = t, m = c.getTotalLevels(), [g, f] = j(!1), [p, v] = j(!1), [y, w] = j(!1), b = (D) => {
711
- const U = c.getFirstLevelOfTier(D);
712
- c.isLevelUnlocked(U, h) && (e((K) => ({ ...K, currentTier: D })), k(U));
713
- }, k = (D) => {
714
- c.isLevelUnlocked(D, h) && (e((U) => ({ ...U, currentLevel: D })), O.show(
715
- r.levelGoToast.replace("%LEVEL%", D.toString()),
709
+ config: c
710
+ } = B(), { i18n: r, levelConfig: l } = c, a = J(l), { levelTransitioning: d, showClue: u } = n, { highestUnlockedLevel: h, totalScore: f } = t, w = a.getTotalLevels(), [g, _] = j(!1), [v, m] = j(!1), [y, C] = j(!1), k = (O) => {
711
+ const Y = a.getFirstLevelOfTier(O);
712
+ a.isLevelUnlocked(Y, h) && (e((W) => ({ ...W, currentTier: O })), T(Y));
713
+ }, T = (O) => {
714
+ a.isLevelUnlocked(O, h) && (e((Y) => ({ ...Y, currentLevel: O })), R.show(
715
+ r.levelGoToast.replace("%LEVEL%", O.toString()),
716
716
  "success"
717
717
  ));
718
- }, T = () => {
719
- f(!0);
720
- }, N = () => {
721
- f(!1);
722
- }, L = () => {
723
- w(!0);
724
- }, A = () => {
725
- w(!1);
726
718
  }, z = () => {
727
- O.show(u ? r.cluePathDisabled : r.cluePathEnabled), o(() => ({
719
+ _(!0);
720
+ }, S = () => {
721
+ _(!1);
722
+ }, b = () => {
723
+ C(!0);
724
+ }, E = () => {
725
+ C(!1);
726
+ }, N = () => {
727
+ R.show(u ? r.cluePathDisabled : r.cluePathEnabled), o(() => ({
728
728
  ...i.current,
729
729
  // need to sync with ref
730
730
  showClue: !i.current.showClue
731
- })), w(!1);
731
+ })), C(!1);
732
732
  }, P = () => {
733
- v(!0);
733
+ m(!0);
734
734
  }, I = () => {
735
- s(), v(!1), O.show(r.resetDoneToast);
736
- }, ye = () => {
737
- v(!1);
735
+ s(), m(!1), R.show(r.resetDoneToast);
736
+ }, V = () => {
737
+ m(!1);
738
738
  };
739
- return /* @__PURE__ */ C("div", { class: "game-panel-container", children: [
740
- /* @__PURE__ */ C("div", { className: "game-controls", children: [
741
- /* @__PURE__ */ C("div", { className: "selectors-container", children: [
742
- /* @__PURE__ */ C(
743
- yt,
739
+ return /* @__PURE__ */ p("div", { class: "game-panel-container", children: [
740
+ /* @__PURE__ */ p("div", { className: "game-controls", children: [
741
+ /* @__PURE__ */ p("div", { className: "selectors-container", children: [
742
+ /* @__PURE__ */ p(
743
+ kt,
744
744
  {
745
- onTierChange: b,
745
+ onTierChange: k,
746
746
  disabled: d
747
747
  }
748
748
  ),
749
- /* @__PURE__ */ C(
750
- bt,
749
+ /* @__PURE__ */ p(
750
+ Tt,
751
751
  {
752
- onLevelChange: k,
752
+ onLevelChange: T,
753
753
  disabled: d
754
754
  }
755
755
  )
756
756
  ] }),
757
- /* @__PURE__ */ C(
757
+ /* @__PURE__ */ p(
758
758
  "button",
759
759
  {
760
760
  className: `settings-clue-button ${u ? "clue-on" : "clue-off"}`,
761
761
  disabled: u,
762
762
  title: "Toggle Clue",
763
- onClick: L,
763
+ onClick: b,
764
764
  children: u ? r.clueOn : r.clueOff
765
765
  }
766
766
  )
767
767
  ] }),
768
- /* @__PURE__ */ C("div", { className: "game-settings", children: /* @__PURE__ */ C("span", { className: "game-settings-icon", onClick: T, children: "★ " + _ }) }),
769
- /* @__PURE__ */ C(
770
- ne,
768
+ /* @__PURE__ */ p("div", { className: "game-settings", children: /* @__PURE__ */ p("span", { className: "game-settings-icon", onClick: z, children: "★ " + f }) }),
769
+ /* @__PURE__ */ p(
770
+ oe,
771
771
  {
772
772
  isOpen: g,
773
773
  title: r.settings,
774
774
  noConfirm: !0,
775
775
  cancelText: r.close,
776
- onCancel: N,
776
+ onCancel: S,
777
777
  children: [
778
- /* @__PURE__ */ C("div", { className: "settings-stats", children: [
779
- /* @__PURE__ */ C("div", { children: r.levelComplete + `: ${h}/${m}` }),
780
- /* @__PURE__ */ C("div", { children: r.starsCollected + ": " + _ }),
781
- /* @__PURE__ */ C("div", { children: r.avgStarPerLevel + ": " + (_ / h).toFixed(2) })
778
+ /* @__PURE__ */ p("div", { className: "settings-stats", children: [
779
+ /* @__PURE__ */ p("div", { children: r.levelComplete + `: ${h}/${w}` }),
780
+ /* @__PURE__ */ p("div", { children: r.starsCollected + ": " + f }),
781
+ /* @__PURE__ */ p("div", { children: r.avgStarPerLevel + ": " + (f / h).toFixed(2) })
782
782
  ] }),
783
- /* @__PURE__ */ C("div", { className: "settings-item-box", children: [
784
- /* @__PURE__ */ C(
783
+ /* @__PURE__ */ p("div", { className: "settings-item-box", children: [
784
+ /* @__PURE__ */ p(
785
785
  "button",
786
786
  {
787
787
  className: "settings-reset-button",
@@ -790,133 +790,133 @@ const Ct = (t) => ({
790
790
  children: r.reset
791
791
  }
792
792
  ),
793
- /* @__PURE__ */ C("div", { className: "settings-item-tip", children: r.resetTip })
793
+ /* @__PURE__ */ p("div", { className: "settings-item-tip", children: r.resetTip })
794
794
  ] })
795
795
  ]
796
796
  }
797
797
  ),
798
- /* @__PURE__ */ C(
799
- ne,
798
+ /* @__PURE__ */ p(
799
+ oe,
800
800
  {
801
- isOpen: p,
801
+ isOpen: v,
802
802
  title: r.confirmReset,
803
803
  message: r.confirmResetMessage,
804
804
  confirmText: r.reset,
805
805
  cancelText: r.cancel,
806
806
  onConfirm: I,
807
- onCancel: ye
807
+ onCancel: V
808
808
  }
809
809
  ),
810
- /* @__PURE__ */ C(
811
- ne,
810
+ /* @__PURE__ */ p(
811
+ oe,
812
812
  {
813
813
  isOpen: y,
814
814
  title: r.confirmClue,
815
815
  message: r.confirmClueMessage,
816
816
  confirmText: r.confirm,
817
817
  cancelText: r.cancel,
818
- onConfirm: z,
819
- onCancel: A
818
+ onConfirm: N,
819
+ onCancel: E
820
820
  }
821
821
  )
822
822
  ] });
823
823
  };
824
- function Ce(t, e) {
824
+ function ye(t, e) {
825
825
  if (!(t instanceof e))
826
826
  throw new TypeError("Cannot call a class as a function");
827
827
  }
828
- function Tt(t, e) {
828
+ function zt(t, e) {
829
829
  for (var n = 0; n < e.length; n++) {
830
830
  var o = e[n];
831
831
  o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
832
832
  }
833
833
  }
834
- function we(t, e, n) {
835
- return e && Tt(t.prototype, e), t;
834
+ function be(t, e, n) {
835
+ return e && zt(t.prototype, e), t;
836
836
  }
837
- function De(t) {
837
+ function Re(t) {
838
838
  return +t.replace(/px/, "");
839
839
  }
840
840
  function Lt(t) {
841
- var e = window.devicePixelRatio, n = getComputedStyle(t), o = De(n.getPropertyValue("width")), i = De(n.getPropertyValue("height"));
841
+ var e = window.devicePixelRatio, n = getComputedStyle(t), o = Re(n.getPropertyValue("width")), i = Re(n.getPropertyValue("height"));
842
842
  t.setAttribute("width", (o * e).toString()), t.setAttribute("height", (i * e).toString());
843
843
  }
844
- function F(t, e) {
844
+ function D(t, e) {
845
845
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, o = Math.random() * (e - t) + t;
846
846
  return Math.floor(o * Math.pow(10, n)) / Math.pow(10, n);
847
847
  }
848
- function Fe(t) {
849
- return t[F(0, t.length)];
848
+ function Oe(t) {
849
+ return t[D(0, t.length)];
850
850
  }
851
- var St = 125e-5, Nt = 5e-4, zt = 9e-4, Et = 1e-5, At = 6, Mt = 80, Pt = 0.9, It = 1.7, xt = 0.2, Dt = 0.6, Ft = 0.03, Rt = 0.07, Ot = 15, $t = 82, Ut = 100, Wt = 250, jt = 40, Gt = ["#fcf403", "#62fc03", "#f4fc03", "#03e7fc", "#03fca5", "#a503fc", "#fc03ad", "#fc03c2"];
852
- function Re(t) {
851
+ var Nt = 125e-5, At = 5e-4, Et = 9e-4, Mt = 1e-5, Pt = 6, It = 80, xt = 0.9, Dt = 1.7, Ft = 0.2, Rt = 0.6, Ot = 0.03, $t = 0.07, Ut = 15, Wt = 82, jt = 100, Gt = 250, Ht = 40, qt = ["#fcf403", "#62fc03", "#f4fc03", "#03e7fc", "#03fca5", "#a503fc", "#fc03ad", "#fc03c2"];
852
+ function $e(t) {
853
853
  var e = 1920;
854
854
  return Math.log(t) / Math.log(e);
855
855
  }
856
- var Oe = /* @__PURE__ */ function() {
856
+ var Ue = /* @__PURE__ */ function() {
857
857
  function t(e) {
858
- Ce(this, t);
859
- var n = e.initialPosition, o = e.direction, i = e.confettiRadius, s = e.confettiColors, l = e.emojis, r = e.emojiSize, a = e.canvasWidth, c = F(Pt, It, 3), d = c * Re(a);
858
+ ye(this, t);
859
+ var n = e.initialPosition, o = e.direction, i = e.confettiRadius, s = e.confettiColors, c = e.emojis, r = e.emojiSize, l = e.canvasWidth, a = D(xt, Dt, 3), d = a * $e(l);
860
860
  this.confettiSpeed = {
861
861
  x: d,
862
862
  y: d
863
- }, this.finalConfettiSpeedX = F(xt, Dt, 3), this.rotationSpeed = l.length ? 0.01 : F(Ft, Rt, 3) * Re(a), this.dragForceCoefficient = F(Nt, zt, 6), this.radius = {
863
+ }, this.finalConfettiSpeedX = D(Ft, Rt, 3), this.rotationSpeed = c.length ? 0.01 : D(Ot, $t, 3) * $e(l), this.dragForceCoefficient = D(At, Et, 6), this.radius = {
864
864
  x: i,
865
865
  y: i
866
- }, this.initialRadius = i, this.rotationAngle = o === "left" ? F(0, 0.2, 3) : F(-0.2, 0, 3), this.emojiSize = r, this.emojiRotationAngle = F(0, 2 * Math.PI), this.radiusYUpdateDirection = "down";
867
- var u = o === "left" ? F($t, Ot) * Math.PI / 180 : F(-15, -82) * Math.PI / 180;
866
+ }, this.initialRadius = i, this.rotationAngle = o === "left" ? D(0, 0.2, 3) : D(-0.2, 0, 3), this.emojiSize = r, this.emojiRotationAngle = D(0, 2 * Math.PI), this.radiusYUpdateDirection = "down";
867
+ var u = o === "left" ? D(Wt, Ut) * Math.PI / 180 : D(-15, -82) * Math.PI / 180;
868
868
  this.absCos = Math.abs(Math.cos(u)), this.absSin = Math.abs(Math.sin(u));
869
- var h = F(-150, 0), _ = {
869
+ var h = D(-150, 0), f = {
870
870
  x: n.x + (o === "left" ? -h : h) * this.absCos,
871
871
  y: n.y - h * this.absSin
872
872
  };
873
- this.currentPosition = Object.assign({}, _), this.initialPosition = Object.assign({}, _), this.color = l.length ? null : Fe(s), this.emoji = l.length ? Fe(l) : null, this.createdAt = (/* @__PURE__ */ new Date()).getTime(), this.direction = o;
873
+ this.currentPosition = Object.assign({}, f), this.initialPosition = Object.assign({}, f), this.color = c.length ? null : Oe(s), this.emoji = c.length ? Oe(c) : null, this.createdAt = (/* @__PURE__ */ new Date()).getTime(), this.direction = o;
874
874
  }
875
- return we(t, [{
875
+ return be(t, [{
876
876
  key: "draw",
877
877
  value: function(n) {
878
- var o = this.currentPosition, i = this.radius, s = this.color, l = this.emoji, r = this.rotationAngle, a = this.emojiRotationAngle, c = this.emojiSize, d = window.devicePixelRatio;
879
- s ? (n.fillStyle = s, n.beginPath(), n.ellipse(o.x * d, o.y * d, i.x * d, i.y * d, r, 0, 2 * Math.PI), n.fill()) : l && (n.font = "".concat(c, "px serif"), n.save(), n.translate(d * o.x, d * o.y), n.rotate(a), n.textAlign = "center", n.fillText(l, 0, 0), n.restore());
878
+ var o = this.currentPosition, i = this.radius, s = this.color, c = this.emoji, r = this.rotationAngle, l = this.emojiRotationAngle, a = this.emojiSize, d = window.devicePixelRatio;
879
+ s ? (n.fillStyle = s, n.beginPath(), n.ellipse(o.x * d, o.y * d, i.x * d, i.y * d, r, 0, 2 * Math.PI), n.fill()) : c && (n.font = "".concat(a, "px serif"), n.save(), n.translate(d * o.x, d * o.y), n.rotate(l), n.textAlign = "center", n.fillText(c, 0, 0), n.restore());
880
880
  }
881
881
  }, {
882
882
  key: "updatePosition",
883
883
  value: function(n, o) {
884
- var i = this.confettiSpeed, s = this.dragForceCoefficient, l = this.finalConfettiSpeedX, r = this.radiusYUpdateDirection, a = this.rotationSpeed, c = this.createdAt, d = this.direction, u = o - c;
885
- if (i.x > l && (this.confettiSpeed.x -= s * n), this.currentPosition.x += i.x * (d === "left" ? -this.absCos : this.absCos) * n, this.currentPosition.y = this.initialPosition.y - i.y * this.absSin * u + St * Math.pow(u, 2) / 2, this.rotationSpeed -= this.emoji ? 1e-4 : Et * n, this.rotationSpeed < 0 && (this.rotationSpeed = 0), this.emoji) {
884
+ var i = this.confettiSpeed, s = this.dragForceCoefficient, c = this.finalConfettiSpeedX, r = this.radiusYUpdateDirection, l = this.rotationSpeed, a = this.createdAt, d = this.direction, u = o - a;
885
+ if (i.x > c && (this.confettiSpeed.x -= s * n), this.currentPosition.x += i.x * (d === "left" ? -this.absCos : this.absCos) * n, this.currentPosition.y = this.initialPosition.y - i.y * this.absSin * u + Nt * Math.pow(u, 2) / 2, this.rotationSpeed -= this.emoji ? 1e-4 : Mt * n, this.rotationSpeed < 0 && (this.rotationSpeed = 0), this.emoji) {
886
886
  this.emojiRotationAngle += this.rotationSpeed * n % (2 * Math.PI);
887
887
  return;
888
888
  }
889
- r === "down" ? (this.radius.y -= n * a, this.radius.y <= 0 && (this.radius.y = 0, this.radiusYUpdateDirection = "up")) : (this.radius.y += n * a, this.radius.y >= this.initialRadius && (this.radius.y = this.initialRadius, this.radiusYUpdateDirection = "down"));
889
+ r === "down" ? (this.radius.y -= n * l, this.radius.y <= 0 && (this.radius.y = 0, this.radiusYUpdateDirection = "up")) : (this.radius.y += n * l, this.radius.y >= this.initialRadius && (this.radius.y = this.initialRadius, this.radiusYUpdateDirection = "down"));
890
890
  }
891
891
  }, {
892
892
  key: "getIsVisibleOnCanvas",
893
893
  value: function(n) {
894
- return this.currentPosition.y < n + Ut;
894
+ return this.currentPosition.y < n + jt;
895
895
  }
896
896
  }]), t;
897
897
  }();
898
- function Ht() {
898
+ function Bt() {
899
899
  var t = document.createElement("canvas");
900
900
  return t.style.position = "fixed", t.style.width = "100%", t.style.height = "100%", t.style.top = "0", t.style.left = "0", t.style.zIndex = "1000", t.style.pointerEvents = "none", document.body.appendChild(t), t;
901
901
  }
902
- function qt(t) {
903
- var e = t.confettiRadius, n = e === void 0 ? At : e, o = t.confettiNumber, i = o === void 0 ? t.confettiesNumber || (t.emojis ? jt : Wt) : o, s = t.confettiColors, l = s === void 0 ? Gt : s, r = t.emojis, a = r === void 0 ? t.emojies || [] : r, c = t.emojiSize, d = c === void 0 ? Mt : c;
902
+ function Vt(t) {
903
+ var e = t.confettiRadius, n = e === void 0 ? Pt : e, o = t.confettiNumber, i = o === void 0 ? t.confettiesNumber || (t.emojis ? Ht : Gt) : o, s = t.confettiColors, c = s === void 0 ? qt : s, r = t.emojis, l = r === void 0 ? t.emojies || [] : r, a = t.emojiSize, d = a === void 0 ? It : a;
904
904
  return t.emojies && console.error("emojies argument is deprecated, please use emojis instead"), t.confettiesNumber && console.error("confettiesNumber argument is deprecated, please use confettiNumber instead"), {
905
905
  confettiRadius: n,
906
906
  confettiNumber: i,
907
- confettiColors: l,
908
- emojis: a,
907
+ confettiColors: c,
908
+ emojis: l,
909
909
  emojiSize: d
910
910
  };
911
911
  }
912
- var Vt = /* @__PURE__ */ function() {
912
+ var Yt = /* @__PURE__ */ function() {
913
913
  function t(e) {
914
914
  var n = this;
915
- Ce(this, t), this.canvasContext = e, this.shapes = [], this.promise = new Promise(function(o) {
915
+ ye(this, t), this.canvasContext = e, this.shapes = [], this.promise = new Promise(function(o) {
916
916
  return n.resolvePromise = o;
917
917
  });
918
918
  }
919
- return we(t, [{
919
+ return be(t, [{
920
920
  key: "getBatchCompletePromise",
921
921
  value: function() {
922
922
  return this.promise;
@@ -936,27 +936,27 @@ var Vt = /* @__PURE__ */ function() {
936
936
  }, {
937
937
  key: "processShapes",
938
938
  value: function(n, o, i) {
939
- var s = this, l = n.timeDelta, r = n.currentTime;
940
- this.shapes = this.shapes.filter(function(a) {
941
- return a.updatePosition(l, r), a.draw(s.canvasContext), i ? a.getIsVisibleOnCanvas(o) : !0;
939
+ var s = this, c = n.timeDelta, r = n.currentTime;
940
+ this.shapes = this.shapes.filter(function(l) {
941
+ return l.updatePosition(c, r), l.draw(s.canvasContext), i ? l.getIsVisibleOnCanvas(o) : !0;
942
942
  });
943
943
  }
944
944
  }]), t;
945
- }(), Bt = /* @__PURE__ */ function() {
945
+ }(), Xt = /* @__PURE__ */ function() {
946
946
  function t() {
947
947
  var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
948
- Ce(this, t), this.activeConfettiBatches = [], this.canvas = e.canvas || Ht(), this.canvasContext = this.canvas.getContext("2d"), this.requestAnimationFrameRequested = !1, this.lastUpdated = (/* @__PURE__ */ new Date()).getTime(), this.iterationIndex = 0, this.loop = this.loop.bind(this), requestAnimationFrame(this.loop);
948
+ ye(this, t), this.activeConfettiBatches = [], this.canvas = e.canvas || Bt(), this.canvasContext = this.canvas.getContext("2d"), this.requestAnimationFrameRequested = !1, this.lastUpdated = (/* @__PURE__ */ new Date()).getTime(), this.iterationIndex = 0, this.loop = this.loop.bind(this), requestAnimationFrame(this.loop);
949
949
  }
950
- return we(t, [{
950
+ return be(t, [{
951
951
  key: "loop",
952
952
  value: function() {
953
953
  this.requestAnimationFrameRequested = !1, Lt(this.canvas);
954
954
  var n = (/* @__PURE__ */ new Date()).getTime(), o = n - this.lastUpdated, i = this.canvas.offsetHeight, s = this.iterationIndex % 10 === 0;
955
- this.activeConfettiBatches = this.activeConfettiBatches.filter(function(l) {
956
- return l.processShapes({
955
+ this.activeConfettiBatches = this.activeConfettiBatches.filter(function(c) {
956
+ return c.processShapes({
957
957
  timeDelta: o,
958
958
  currentTime: n
959
- }, i, s), s ? !l.complete() : !0;
959
+ }, i, s), s ? !c.complete() : !0;
960
960
  }), this.iterationIndex++, this.queueAnimationFrameIfNeeded(n);
961
961
  }
962
962
  }, {
@@ -967,33 +967,33 @@ var Vt = /* @__PURE__ */ function() {
967
967
  }, {
968
968
  key: "addConfetti",
969
969
  value: function() {
970
- for (var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = qt(n), i = o.confettiRadius, s = o.confettiNumber, l = o.confettiColors, r = o.emojis, a = o.emojiSize, c = this.canvas.getBoundingClientRect(), d = c.width, u = c.height, h = u * 5 / 7, _ = {
970
+ for (var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = Vt(n), i = o.confettiRadius, s = o.confettiNumber, c = o.confettiColors, r = o.emojis, l = o.emojiSize, a = this.canvas.getBoundingClientRect(), d = a.width, u = a.height, h = u * 5 / 7, f = {
971
971
  x: 0,
972
972
  y: h
973
- }, m = {
973
+ }, w = {
974
974
  x: d,
975
975
  y: h
976
- }, g = new Vt(this.canvasContext), f = 0; f < s / 2; f++) {
977
- var p = new Oe({
978
- initialPosition: _,
976
+ }, g = new Yt(this.canvasContext), _ = 0; _ < s / 2; _++) {
977
+ var v = new Ue({
978
+ initialPosition: f,
979
979
  direction: "right",
980
980
  confettiRadius: i,
981
- confettiColors: l,
981
+ confettiColors: c,
982
982
  confettiNumber: s,
983
983
  emojis: r,
984
- emojiSize: a,
984
+ emojiSize: l,
985
985
  canvasWidth: d
986
- }), v = new Oe({
987
- initialPosition: m,
986
+ }), m = new Ue({
987
+ initialPosition: w,
988
988
  direction: "left",
989
989
  confettiRadius: i,
990
- confettiColors: l,
990
+ confettiColors: c,
991
991
  confettiNumber: s,
992
992
  emojis: r,
993
- emojiSize: a,
993
+ emojiSize: l,
994
994
  canvasWidth: d
995
995
  });
996
- g.addShapes(p, v);
996
+ g.addShapes(v, m);
997
997
  }
998
998
  return this.activeConfettiBatches.push(g), this.queueAnimationFrameIfNeeded(), g.getBatchCompletePromise();
999
999
  }
@@ -1009,40 +1009,40 @@ var Vt = /* @__PURE__ */ function() {
1009
1009
  }
1010
1010
  }]), t;
1011
1011
  }();
1012
- const Yt = new Bt(), Xt = ({ onRetry: t }) => {
1012
+ const Kt = new Xt(), Jt = ({ onRetry: t }) => {
1013
1013
  const {
1014
1014
  config: e,
1015
1015
  currentScore: n,
1016
1016
  gamePlayState: o,
1017
1017
  setGamePlayState: i,
1018
1018
  gameProgress: s,
1019
- setGameProgress: l
1020
- } = V(), { i18n: r, levelConfig: a } = e, [c, d, u] = n, { foodCollected: h, totalFoodCount: _, playerAtExit: m, levelTransitioning: g } = o, { currentLevel: f } = s, [p, v] = j(!1);
1019
+ setGameProgress: c
1020
+ } = B(), { i18n: r, levelConfig: l } = e, [a, d, u] = n, { foodCollected: h, totalFoodCount: f, playerAtExit: w, levelTransitioning: g } = o, { currentLevel: _ } = s, [v, m] = j(!1);
1021
1021
  x(() => {
1022
- m && g && (Yt.addConfetti(), O.show(r.levelCompleteToast, "success"), v(!0));
1023
- }, [m, g]);
1024
- const y = X(a), w = y.getTotalLevels(), b = q(() => f >= w, [f, w]), k = () => {
1025
- v(!1), O.show(r.levelRestartToast, "info"), t?.();
1026
- }, T = () => {
1027
- v(!1), i((L) => ({
1028
- ...L,
1022
+ w && g && (Kt.addConfetti(), R.show(r.levelCompleteToast, "success"), m(!0));
1023
+ }, [w, g]);
1024
+ const y = J(l), C = y.getTotalLevels(), k = q(() => _ >= C, [_, C]), T = () => {
1025
+ m(!1), R.show(r.levelRestartToast, "info"), t?.();
1026
+ }, z = () => {
1027
+ m(!1), i((b) => ({
1028
+ ...b,
1029
1029
  isGameActive: !0,
1030
1030
  levelTransitioning: !1
1031
1031
  }));
1032
- }, N = () => {
1033
- v(!1);
1034
- const L = y.getNextLevelInfo(f);
1035
- if (!L) return;
1036
- const { nextLevel: A, nextTier: z, isTierChange: P } = L;
1037
- P && O.show(
1038
- r.tierUnlockedToast.replace("%TIER%", z.toString()),
1032
+ }, S = () => {
1033
+ m(!1);
1034
+ const b = y.getNextLevelInfo(_);
1035
+ if (!b) return;
1036
+ const { nextLevel: E, nextTier: N, isTierChange: P } = b;
1037
+ P && R.show(
1038
+ r.tierUnlockedToast.replace("%TIER%", N.toString()),
1039
1039
  "success"
1040
- ), l((I) => ({
1040
+ ), c((I) => ({
1041
1041
  ...I,
1042
- currentLevel: A,
1043
- currentTier: z,
1044
- highestUnlockedLevel: Math.max(I.highestUnlockedLevel, A),
1045
- highestUnlockedTier: Math.max(I.highestUnlockedTier, z),
1042
+ currentLevel: E,
1043
+ currentTier: N,
1044
+ highestUnlockedLevel: Math.max(I.highestUnlockedLevel, E),
1045
+ highestUnlockedTier: Math.max(I.highestUnlockedTier, N),
1046
1046
  levelScores: {
1047
1047
  ...I.levelScores,
1048
1048
  [I.currentLevel]: Math.max(
@@ -1052,31 +1052,31 @@ const Yt = new Bt(), Xt = ({ onRetry: t }) => {
1052
1052
  }
1053
1053
  }));
1054
1054
  };
1055
- return /* @__PURE__ */ C(
1056
- ne,
1055
+ return /* @__PURE__ */ p(
1056
+ oe,
1057
1057
  {
1058
1058
  className: "level-complete-dialog",
1059
- isOpen: p,
1059
+ isOpen: v,
1060
1060
  title: r.congratulations,
1061
1061
  cancelText: r.retry,
1062
- onCancel: k,
1062
+ onCancel: T,
1063
1063
  noConfirm: !!d,
1064
1064
  confirmText: r.continue,
1065
- onConfirm: T,
1065
+ onConfirm: z,
1066
1066
  children: [
1067
- /* @__PURE__ */ C("div", { className: "maze-summary-message", children: [
1068
- !!c && /* @__PURE__ */ C("div", { children: "★ - " + r.findYourExit }),
1069
- /* @__PURE__ */ C("div", { children: u ? "★ - " + r.withoutClue : "☆ - " + r.withClue }),
1070
- /* @__PURE__ */ C("div", { children: (d ? "★ - " + r.collectAllStars : "☆ - " + r.notCollectAllStars) + ` (${h}/${_})` })
1067
+ /* @__PURE__ */ p("div", { className: "maze-summary-message", children: [
1068
+ !!a && /* @__PURE__ */ p("div", { children: "★ - " + r.findYourExit }),
1069
+ /* @__PURE__ */ p("div", { children: u ? "★ - " + r.withoutClue : "☆ - " + r.withClue }),
1070
+ /* @__PURE__ */ p("div", { children: (d ? "★ - " + r.collectAllStars : "☆ - " + r.notCollectAllStars) + ` (${h}/${f})` })
1071
1071
  ] }),
1072
- b && /* @__PURE__ */ C("div", { className: "all-levels-completed", children: r.allLevelsCompleted }),
1073
- /* @__PURE__ */ C("div", { className: "go-next-level", children: b ? "OK" : /* @__PURE__ */ C("button", { type: "button", onClick: N, children: r.nextLevel }) }),
1074
- !d && /* @__PURE__ */ C("div", { className: "not-all-stars-collected", children: r.continueMessage })
1072
+ k && /* @__PURE__ */ p("div", { className: "all-levels-completed", children: r.allLevelsCompleted }),
1073
+ /* @__PURE__ */ p("div", { className: "go-next-level", children: k ? "OK" : /* @__PURE__ */ p("button", { type: "button", onClick: S, children: r.nextLevel }) }),
1074
+ !d && /* @__PURE__ */ p("div", { className: "not-all-stars-collected", children: r.continueMessage })
1075
1075
  ]
1076
1076
  }
1077
1077
  );
1078
- }, Kt = (t, e) => {
1079
- const n = R({
1078
+ }, Zt = (t, e) => {
1079
+ const n = F({
1080
1080
  canvasWidth: 0,
1081
1081
  canvasHeight: 0
1082
1082
  });
@@ -1084,12 +1084,12 @@ const Yt = new Bt(), Xt = ({ onRetry: t }) => {
1084
1084
  const o = () => {
1085
1085
  const s = t.current;
1086
1086
  if (!s) return;
1087
- const l = s.parentElement;
1088
- if (!l) return;
1089
- const r = l.clientWidth, a = window.devicePixelRatio || 1;
1087
+ const c = s.parentElement;
1088
+ if (!c) return;
1089
+ const r = c.clientWidth, l = window.devicePixelRatio || 1;
1090
1090
  s.style.width = `${r}px`, s.style.height = `${r}px`;
1091
- const c = r * a, d = r * a;
1092
- s.width = c, s.height = d, n.current = { canvasWidth: c, canvasHeight: d }, e?.();
1091
+ const a = r * l, d = r * l;
1092
+ s.width = a, s.height = d, n.current = { canvasWidth: a, canvasHeight: d }, e?.();
1093
1093
  };
1094
1094
  o();
1095
1095
  let i = null;
@@ -1097,32 +1097,32 @@ const Yt = new Bt(), Xt = ({ onRetry: t }) => {
1097
1097
  window.removeEventListener("resize", o), i?.disconnect();
1098
1098
  };
1099
1099
  }, [t, e]), n;
1100
- }, Jt = (t) => {
1100
+ }, Qt = (t) => {
1101
1101
  const {
1102
1102
  config: e,
1103
1103
  gamePlayState: { maze: n }
1104
- } = V(), o = R({ cellWidth: 0, cellHeight: 0 });
1104
+ } = B(), o = F({ cellWidth: 0, cellHeight: 0 });
1105
1105
  return x(() => {
1106
1106
  const i = e.renderConfig.padding, s = () => {
1107
1107
  const r = t.current;
1108
1108
  if (!r || !n) return;
1109
- const { rows: a, cols: c } = n;
1110
- if (a <= 0 || c <= 0) return;
1111
- const d = (r.width - i * 2) / c, u = (r.height - i * 2) / a;
1109
+ const { rows: l, cols: a } = n;
1110
+ if (l <= 0 || a <= 0) return;
1111
+ const d = (r.width - i * 2) / a, u = (r.height - i * 2) / l;
1112
1112
  o.current = { cellWidth: d, cellHeight: u };
1113
1113
  };
1114
1114
  s();
1115
- let l = null;
1116
- return t.current && window.ResizeObserver && (l = new ResizeObserver(s), l.observe(t.current)), () => {
1117
- t.current && l?.disconnect();
1115
+ let c = null;
1116
+ return t.current && window.ResizeObserver && (c = new ResizeObserver(s), c.observe(t.current)), () => {
1117
+ t.current && c?.disconnect();
1118
1118
  };
1119
1119
  }, [t, n]), o;
1120
- }, Z = {
1120
+ }, Q = {
1121
1121
  ArrowUp: [-1, 0],
1122
1122
  ArrowDown: [1, 0],
1123
1123
  ArrowLeft: [0, -1],
1124
1124
  ArrowRight: [0, 1]
1125
- }, Zt = ({
1125
+ }, en = ({
1126
1126
  containerRef: t,
1127
1127
  gamePlayStateRef: e,
1128
1128
  setGamePlayState: n,
@@ -1130,45 +1130,49 @@ const Yt = new Bt(), Xt = ({ onRetry: t }) => {
1130
1130
  // move X grid units per frame, default 0.03
1131
1131
  playerRadius: i,
1132
1132
  // player radius in grid unit, default 0.2
1133
- onFoodCollected: s
1133
+ exitWallWidth: s,
1134
+ getCellSizeInPixels: c,
1135
+ onFoodCollected: r
1134
1136
  }) => {
1135
- const l = R(!1), r = R(/* @__PURE__ */ new Set()), a = (m, g) => {
1136
- const f = e.current;
1137
- if (!f.maze)
1137
+ const l = F(!1), a = F(/* @__PURE__ */ new Set()), d = (_, v) => {
1138
+ const m = e.current;
1139
+ if (!m.maze)
1138
1140
  return { canMove: !1, newCell: null };
1139
- const [p, v] = Z[m];
1140
- if ($e(
1141
- g,
1142
- p,
1141
+ const [y, C] = Q[_];
1142
+ if (We(
1143
1143
  v,
1144
+ y,
1145
+ C,
1144
1146
  i,
1145
1147
  o,
1146
- f.maze
1148
+ m.maze
1147
1149
  ))
1148
1150
  return { canMove: !1, newCell: null };
1149
- const { row: w, col: b } = g, k = w + p * o, T = b + v * o, N = Math.floor(w), L = Math.floor(b), A = Math.floor(k), z = Math.floor(T);
1150
- return A !== N || z !== L ? f.maze.isValid(A, z) ? {
1151
+ const { row: T, col: z } = v, S = T + y * o, b = z + C * o, E = Math.floor(T), N = Math.floor(z), P = Math.floor(S), I = Math.floor(b);
1152
+ return P !== E || I !== N ? m.maze.isValid(P, I) ? {
1151
1153
  canMove: !0,
1152
- newCell: { row: A, col: z }
1154
+ newCell: { row: P, col: I }
1153
1155
  } : { canMove: !1, newCell: null } : { canMove: !0, newCell: null };
1154
- }, c = () => {
1155
- const m = e.current, { row: g, col: f } = m.playerCell, p = i * 2, v = m.foodCells.findIndex((b) => Math.sqrt(
1156
- Math.pow(g - b.row, 2) + Math.pow(f - b.col, 2)
1157
- ) < p);
1158
- v !== -1 && s && (s(), e.current = {
1156
+ }, u = () => {
1157
+ const _ = e.current, { row: v, col: m } = _.playerCell, y = i * 2, C = _.foodCells.findIndex((z) => Math.sqrt(
1158
+ Math.pow(v - z.row, 2) + Math.pow(m - z.col, 2)
1159
+ ) < y);
1160
+ C !== -1 && r && (r(), e.current = {
1159
1161
  ...e.current,
1160
1162
  foodCollected: e.current.foodCollected + 1,
1161
1163
  foodCells: e.current.foodCells.filter(
1162
- (b, k) => k !== v
1164
+ (z, S) => S !== C
1163
1165
  )
1164
1166
  });
1165
- const w = en(
1166
- m.playerCell,
1167
- m.exitCell,
1168
- m.maze,
1169
- i
1167
+ const T = nn(
1168
+ _.playerCell,
1169
+ _.exitCell,
1170
+ _.maze,
1171
+ i,
1172
+ s,
1173
+ c
1170
1174
  );
1171
- w && !e.current.playerAtExit ? (e.current = {
1175
+ T && !e.current.playerAtExit ? (e.current = {
1172
1176
  ...e.current,
1173
1177
  playerAtExit: !0,
1174
1178
  isGameActive: !1,
@@ -1179,119 +1183,119 @@ const Yt = new Bt(), Xt = ({ onRetry: t }) => {
1179
1183
  n(() => ({ ...e.current }));
1180
1184
  },
1181
1185
  { timeout: 10 }
1182
- )) : !w && e.current.playerAtExit && (e.current = {
1186
+ )) : !T && e.current.playerAtExit && (e.current = {
1183
1187
  ...e.current,
1184
1188
  playerAtExit: !1,
1185
1189
  isGameActive: !0,
1186
1190
  levelTransitioning: !1
1187
1191
  });
1188
- }, d = (m) => {
1189
- const g = e.current, f = Math.round(m.row), p = Math.round(m.col), v = g.playerPath[g.playerPath.length - 1], y = v.row === f && v.col === p, w = Math.abs(v.row - f), b = Math.abs(v.col - p);
1190
- if ((w === 1 && b === 0 || w === 0 && b === 1) && !y) {
1191
- const T = `${v.row},${v.col}-${f},${p}`;
1192
+ }, h = (_) => {
1193
+ const v = e.current, m = Math.round(_.row), y = Math.round(_.col), C = v.playerPath[v.playerPath.length - 1], k = C.row === m && C.col === y, T = Math.abs(C.row - m), z = Math.abs(C.col - y);
1194
+ if ((T === 1 && z === 0 || T === 0 && z === 1) && !k) {
1195
+ const b = `${C.row},${C.col}-${m},${y}`;
1192
1196
  e.current = {
1193
1197
  ...e.current,
1194
1198
  playerPath: [
1195
1199
  ...e.current.playerPath,
1196
- { row: f, col: p }
1200
+ { row: m, col: y }
1197
1201
  ],
1198
1202
  visitCounts: {
1199
1203
  ...e.current.visitCounts,
1200
- [T]: (e.current.visitCounts[T] || 0) + 1
1204
+ [b]: (e.current.visitCounts[b] || 0) + 1
1201
1205
  }
1202
1206
  };
1203
1207
  }
1204
- }, u = () => {
1205
- if (l.current || r.current.size === 0) return;
1206
- const m = e.current;
1207
- !m.playerCell || !Array.from(r.current).some(
1208
- (f) => {
1209
- const { canMove: p } = a(
1210
- f,
1211
- m.playerCell
1208
+ }, f = () => {
1209
+ if (l.current || a.current.size === 0) return;
1210
+ const _ = e.current;
1211
+ !_.playerCell || !Array.from(a.current).some(
1212
+ (m) => {
1213
+ const { canMove: y } = d(
1214
+ m,
1215
+ _.playerCell
1212
1216
  );
1213
- return p;
1217
+ return y;
1214
1218
  }
1215
1219
  ) || (l.current = !0);
1216
1220
  };
1217
1221
  x(() => {
1218
- const m = (y) => {
1219
- (y.key === "ArrowUp" || y.key === "ArrowDown" || y.key === "ArrowLeft" || y.key === "ArrowRight" || y.key === " ") && y.preventDefault();
1220
- }, g = (y) => {
1221
- const w = y.key;
1222
- w in Z && (y.preventDefault(), e.current.isGameActive && (r.current.has(w) || (r.current.add(w), l.current || u())));
1223
- }, f = (y) => {
1224
- const w = y.key;
1225
- w in Z && (y.preventDefault(), r.current.delete(w), r.current.size === 0 && _());
1226
- }, p = (y) => {
1227
- y.preventDefault();
1228
- const w = e.current;
1229
- if (!w.isGameActive || !w.maze || l.current)
1222
+ const _ = (k) => {
1223
+ (k.key === "ArrowUp" || k.key === "ArrowDown" || k.key === "ArrowLeft" || k.key === "ArrowRight" || k.key === " ") && k.preventDefault();
1224
+ }, v = (k) => {
1225
+ const T = k.key;
1226
+ T in Q && (k.preventDefault(), e.current.isGameActive && (a.current.has(T) || (a.current.add(T), l.current || f())));
1227
+ }, m = (k) => {
1228
+ const T = k.key;
1229
+ T in Q && (k.preventDefault(), a.current.delete(T), a.current.size === 0 && g());
1230
+ }, y = (k) => {
1231
+ k.preventDefault();
1232
+ const T = e.current;
1233
+ if (!T.isGameActive || !T.maze || l.current)
1230
1234
  return;
1231
- const b = y.touches[0], k = document.elementFromPoint(b.clientX, b.clientY);
1232
- let T = null;
1233
- k && (k.classList.contains("maze-up") ? T = "ArrowUp" : k.classList.contains("maze-down") ? T = "ArrowDown" : k.classList.contains("maze-left") ? T = "ArrowLeft" : k.classList.contains("maze-right") && (T = "ArrowRight")), T && (r.current.clear(), r.current.add(T), u());
1234
- }, v = () => {
1235
- _();
1235
+ const z = k.touches[0], S = document.elementFromPoint(z.clientX, z.clientY);
1236
+ let b = null;
1237
+ S && (S.classList.contains("maze-up") ? b = "ArrowUp" : S.classList.contains("maze-down") ? b = "ArrowDown" : S.classList.contains("maze-left") ? b = "ArrowLeft" : S.classList.contains("maze-right") && (b = "ArrowRight")), b && (a.current.clear(), a.current.add(b), f());
1238
+ }, C = () => {
1239
+ g();
1236
1240
  };
1237
- return window.addEventListener("keydown", m, {
1241
+ return window.addEventListener("keydown", _, {
1238
1242
  capture: !0
1239
- }), window.addEventListener("keydown", g), window.addEventListener("keyup", f), t.current?.addEventListener("touchstart", p, {
1243
+ }), window.addEventListener("keydown", v), window.addEventListener("keyup", m), t.current?.addEventListener("touchstart", y, {
1240
1244
  passive: !1
1241
- }), t.current?.addEventListener("touchend", v), () => {
1242
- window.removeEventListener("keydown", m, {
1245
+ }), t.current?.addEventListener("touchend", C), () => {
1246
+ window.removeEventListener("keydown", _, {
1243
1247
  capture: !0
1244
- }), window.removeEventListener("keydown", g), window.removeEventListener("keyup", f), t.current?.removeEventListener("touchstart", p), t.current?.removeEventListener("touchend", v);
1248
+ }), window.removeEventListener("keydown", v), window.removeEventListener("keyup", m), t.current?.removeEventListener("touchstart", y), t.current?.removeEventListener("touchend", C);
1245
1249
  };
1246
1250
  }, []);
1247
- const h = mt(() => {
1248
- if (!l.current || r.current.size === 0)
1251
+ const w = pt(() => {
1252
+ if (!l.current || a.current.size === 0)
1249
1253
  return e.current.playerCell;
1250
- const m = e.current.playerCell;
1251
- let g = 0, f = 0, p = 0;
1252
- for (const D of r.current) {
1253
- const { canMove: U } = a(D, m);
1254
- if (U) {
1255
- const [K, rt] = Z[D];
1256
- g += K, f += rt, p++;
1254
+ const _ = e.current.playerCell;
1255
+ let v = 0, m = 0, y = 0;
1256
+ for (const W of a.current) {
1257
+ const { canMove: de } = d(W, _);
1258
+ if (de) {
1259
+ const [ke, st] = Q[W];
1260
+ v += ke, m += st, y++;
1257
1261
  }
1258
1262
  }
1259
- if (p === 0)
1263
+ if (y === 0)
1260
1264
  return e.current.playerCell;
1261
- const v = Math.sqrt(g * g + f * f), y = v > 0 ? g / v : 0, w = v > 0 ? f / v : 0, b = Number(
1262
- (m.row + y * o).toFixed(2)
1263
- ), k = Number(
1264
- (m.col + w * o).toFixed(2)
1265
- ), T = b - m.row, N = k - m.col, L = Math.sqrt(T * T + N * N);
1266
- if (L > 0) {
1267
- const D = T / L, U = N / L;
1268
- if ($e(
1269
- m,
1270
- D,
1271
- U,
1265
+ const C = Math.sqrt(v * v + m * m), k = C > 0 ? v / C : 0, T = C > 0 ? m / C : 0, z = Number(
1266
+ (_.row + k * o).toFixed(2)
1267
+ ), S = Number(
1268
+ (_.col + T * o).toFixed(2)
1269
+ ), b = z - _.row, E = S - _.col, N = Math.sqrt(b * b + E * E);
1270
+ if (N > 0) {
1271
+ const W = b / N, de = E / N;
1272
+ if (We(
1273
+ _,
1274
+ W,
1275
+ de,
1272
1276
  i,
1273
- L,
1277
+ N,
1274
1278
  e.current.maze
1275
1279
  ))
1276
1280
  return e.current.playerCell;
1277
1281
  }
1278
1282
  e.current.playerCell = {
1279
- row: b,
1280
- col: k
1281
- }, c();
1282
- const A = Math.round(m.row), z = Math.round(m.col), P = Math.round(b), I = Math.round(k);
1283
- return (P !== A || I !== z) && d({ row: P, col: I }), e.current.playerCell;
1284
- }, [o]), _ = () => {
1285
- l.current = !1, r.current.clear();
1283
+ row: z,
1284
+ col: S
1285
+ }, u();
1286
+ const P = Math.round(_.row), I = Math.round(_.col), V = Math.round(z), O = Math.round(S);
1287
+ return (V !== P || O !== I) && h({ row: V, col: O }), e.current.playerCell;
1288
+ }, [o]), g = () => {
1289
+ l.current = !1, a.current.clear();
1286
1290
  };
1287
1291
  return {
1288
- updatePlayerPos: h,
1289
- resetMovingState: _
1292
+ updatePlayerPos: w,
1293
+ resetMovingState: g
1290
1294
  };
1291
1295
  };
1292
- function $e(t, e, n, o, i, s) {
1293
- const l = t.row + e * i, r = t.col + n * i, a = { row: l, col: r }, c = [], d = Math.floor(t.row), u = Math.floor(t.col);
1294
- c.push({ row: d, col: u });
1296
+ function We(t, e, n, o, i, s) {
1297
+ const c = t.row + e * i, r = t.col + n * i, l = { row: c, col: r }, a = [], d = Math.floor(t.row), u = Math.floor(t.col);
1298
+ a.push({ row: d, col: u });
1295
1299
  const h = [
1296
1300
  [-1, 0],
1297
1301
  // up
@@ -1310,19 +1314,19 @@ function $e(t, e, n, o, i, s) {
1310
1314
  [1, 1]
1311
1315
  // lower right, diagonal
1312
1316
  ];
1313
- for (const [_, m] of h) {
1314
- const g = d + _, f = u + m;
1315
- s.isValid(g, f) && c.push({ row: g, col: f });
1317
+ for (const [f, w] of h) {
1318
+ const g = d + f, _ = u + w;
1319
+ s.isValid(g, _) && a.push({ row: g, col: _ });
1316
1320
  }
1317
- for (const _ of c) {
1318
- const m = Qt(_.row, _.col, s);
1319
- for (const g of m)
1320
- if (nt(a, g) < o)
1321
+ for (const f of a) {
1322
+ const w = tn(f.row, f.col, s);
1323
+ for (const g of w)
1324
+ if (rt(l, g) < o)
1321
1325
  return !0;
1322
1326
  }
1323
1327
  return !1;
1324
1328
  }
1325
- function Qt(t, e, n) {
1329
+ function tn(t, e, n) {
1326
1330
  const o = [], i = n.grid[t][e];
1327
1331
  return i.walls.top && o.push({
1328
1332
  start: { row: t - 0.5, col: e - 0.5 },
@@ -1338,158 +1342,158 @@ function Qt(t, e, n) {
1338
1342
  end: { row: t + 0.5, col: e - 0.5 }
1339
1343
  }), o;
1340
1344
  }
1341
- function nt(t, e) {
1342
- const { start: n, end: o } = e, i = o.col - n.col, s = o.row - n.row, l = t.col - n.col, r = t.row - n.row, a = i * i + s * s;
1343
- if (a === 0)
1344
- return Math.sqrt(l * l + r * r);
1345
- const c = Math.max(
1345
+ function rt(t, e) {
1346
+ const { start: n, end: o } = e, i = o.col - n.col, s = o.row - n.row, c = t.col - n.col, r = t.row - n.row, l = i * i + s * s;
1347
+ if (l === 0)
1348
+ return Math.sqrt(c * c + r * r);
1349
+ const a = Math.max(
1346
1350
  0,
1347
1351
  Math.min(
1348
1352
  1,
1349
- (l * i + r * s) / a
1353
+ (c * i + r * s) / l
1350
1354
  )
1351
- ), d = n.col + c * i, u = n.row + c * s, h = t.col - d, _ = t.row - u;
1352
- return Math.sqrt(h * h + _ * _);
1355
+ ), d = n.col + a * i, u = n.row + a * s, h = t.col - d, f = t.row - u;
1356
+ return Math.sqrt(h * h + f * f);
1353
1357
  }
1354
- function en(t, e, n, o) {
1358
+ function nn(t, e, n, o, i, s) {
1355
1359
  if (Math.sqrt(
1356
1360
  Math.pow(t.row - e.row, 2) + Math.pow(t.col - e.col, 2)
1357
1361
  ) > 1.5 || !n.isValid(e.row, e.col)) return !1;
1358
1362
  if (n.grid[e.row][e.col].walls.bottom) {
1359
- const l = {
1360
- start: { row: e.row + 0.5, col: e.col - 0.5 },
1361
- end: { row: e.row + 0.5, col: e.col + 0.5 }
1362
- }, r = nt(
1363
+ let l = 0;
1364
+ if (s && i) {
1365
+ const h = s();
1366
+ l = i / h;
1367
+ } else
1368
+ l = (i || 3) / 100;
1369
+ const a = l * 0.5, d = {
1370
+ start: { row: e.row + 0.5 - a, col: e.col - 0.5 },
1371
+ end: { row: e.row + 0.5 - a, col: e.col + 0.5 }
1372
+ };
1373
+ if (rt(
1363
1374
  t,
1364
- l
1365
- ), u = Math.max(
1366
- 0.02,
1367
- Math.min(0.1, o * 0.15)
1368
- );
1369
- if (console.log("Distance between player point to exit wall: ", r), console.log("Player radius: ", o), console.log("Relative tolerance: ", u), console.log(
1370
- "Collision condition: playerRadius + tolerance: ",
1371
- o + u
1372
- ), r <= o + u)
1373
- return console.log("-> collision true"), !0;
1375
+ d
1376
+ ) <= o * 1.5)
1377
+ return !0;
1374
1378
  }
1375
1379
  return !1;
1376
1380
  }
1377
- function tn(t, e, n, o, i) {
1381
+ function on(t, e, n, o, i) {
1378
1382
  if (!t || !e.maze) return;
1379
- const { canvasWidth: s, canvasHeight: l } = n, { cellWidth: r, cellHeight: a } = o, {
1380
- maze: c,
1383
+ const { canvasWidth: s, canvasHeight: c } = n, { cellWidth: r, cellHeight: l } = o, {
1384
+ maze: a,
1381
1385
  playerCell: d,
1382
1386
  // row, col, but floating allowed
1383
1387
  exitCell: u,
1384
1388
  foodCells: h,
1385
- showClue: _,
1386
- playerPath: m,
1389
+ showClue: f,
1390
+ playerPath: w,
1387
1391
  visitCounts: g
1388
1392
  } = e, {
1389
- padding: f,
1390
- wallWidth: p,
1393
+ padding: _,
1394
+ wallWidth: v,
1391
1395
  // need merge with level config when passed here
1392
- wallColor: v,
1396
+ wallColor: m,
1393
1397
  playerColor: y,
1394
- playerRadius: w,
1395
- foodColor: b,
1396
- backgroundColor: k,
1397
- clueColor: T,
1398
- exitColor: N,
1399
- exitWallWidth: L,
1400
- exitDashArray: A
1398
+ playerRadius: C,
1399
+ foodColor: k,
1400
+ backgroundColor: T,
1401
+ clueColor: z,
1402
+ exitColor: S,
1403
+ exitWallWidth: b,
1404
+ exitDashArray: E
1401
1405
  } = i;
1402
- t.clearRect(0, 0, s, l), t.save(), t.fillStyle = k, t.fillRect(0, 0, s, l), t.restore(), _ && an({
1406
+ t.clearRect(0, 0, s, c), t.save(), t.fillStyle = T, t.fillRect(0, 0, s, c), t.restore(), f && un({
1403
1407
  ctx: t,
1404
- playerPath: m,
1408
+ playerPath: w,
1405
1409
  visitCounts: g,
1406
1410
  cellWidth: r,
1407
- cellHeight: a,
1408
- padding: f,
1409
- clueColor: T
1410
- }), nn({
1411
+ cellHeight: l,
1412
+ padding: _,
1413
+ clueColor: z
1414
+ }), rn({
1411
1415
  ctx: t,
1412
- maze: c,
1416
+ maze: a,
1413
1417
  cellWidth: r,
1414
- cellHeight: a,
1415
- padding: f,
1416
- wallColor: v,
1417
- wallWidth: p
1418
- }), rn({
1418
+ cellHeight: l,
1419
+ padding: _,
1420
+ wallColor: m,
1421
+ wallWidth: v
1422
+ }), ln({
1419
1423
  ctx: t,
1420
- maze: c,
1424
+ maze: a,
1421
1425
  exitCell: u,
1422
1426
  cellWidth: r,
1423
- cellHeight: a,
1424
- padding: f,
1425
- exitColor: N,
1426
- exitWallWidth: L,
1427
- exitDashArray: A
1428
- }), sn({
1427
+ cellHeight: l,
1428
+ padding: _,
1429
+ exitColor: S,
1430
+ exitWallWidth: b,
1431
+ exitDashArray: E
1432
+ }), an({
1429
1433
  ctx: t,
1430
1434
  foodCells: h,
1431
1435
  cellWidth: r,
1432
- cellHeight: a,
1433
- padding: f,
1434
- foodColor: b
1435
- }), on({
1436
+ cellHeight: l,
1437
+ padding: _,
1438
+ foodColor: k
1439
+ }), sn({
1436
1440
  ctx: t,
1437
1441
  playerCell: d,
1438
- playerRadius: w,
1442
+ playerRadius: C,
1439
1443
  cellWidth: r,
1440
- cellHeight: a,
1441
- padding: f,
1444
+ cellHeight: l,
1445
+ padding: _,
1442
1446
  playerColor: y
1443
1447
  });
1444
1448
  }
1445
- function nn({
1449
+ function rn({
1446
1450
  ctx: t,
1447
1451
  maze: e,
1448
1452
  cellWidth: n,
1449
1453
  cellHeight: o,
1450
1454
  padding: i,
1451
1455
  wallColor: s,
1452
- wallWidth: l
1456
+ wallWidth: c
1453
1457
  }) {
1454
- t.save(), t.strokeStyle = s, t.lineWidth = l, t.lineCap = "round", t.beginPath(), cn(e, n, o, i).forEach((a) => {
1455
- t.moveTo(a.x1, a.y1), t.lineTo(a.x2, a.y2);
1458
+ t.save(), t.strokeStyle = s, t.lineWidth = c, t.lineCap = "round", t.beginPath(), dn(e, n, o, i).forEach((l) => {
1459
+ t.moveTo(l.x1, l.y1), t.lineTo(l.x2, l.y2);
1456
1460
  }), t.stroke(), t.restore();
1457
1461
  }
1458
- function on({
1462
+ function sn({
1459
1463
  ctx: t,
1460
1464
  playerCell: e,
1461
1465
  playerRadius: n,
1462
1466
  cellWidth: o,
1463
1467
  cellHeight: i,
1464
1468
  padding: s,
1465
- playerColor: l
1469
+ playerColor: c
1466
1470
  }) {
1467
- const { x: r, y: a } = ie(
1471
+ const { x: r, y: l } = se(
1468
1472
  e.row,
1469
1473
  e.col,
1470
1474
  o,
1471
1475
  i,
1472
1476
  s
1473
- ), c = Math.min(o, i) * Math.min(n, 0.5);
1474
- t.save(), t.fillStyle = l, t.beginPath(), t.arc(r, a, c, 0, Math.PI * 2), t.fill(), t.restore();
1477
+ ), a = Math.min(o, i) * Math.min(n, 0.5);
1478
+ t.save(), t.fillStyle = c, t.beginPath(), t.arc(r, l, a, 0, Math.PI * 2), t.fill(), t.restore();
1475
1479
  }
1476
- function rn({
1480
+ function ln({
1477
1481
  ctx: t,
1478
1482
  maze: e,
1479
1483
  exitCell: n,
1480
1484
  cellWidth: o,
1481
1485
  cellHeight: i,
1482
1486
  padding: s,
1483
- exitColor: l,
1487
+ exitColor: c,
1484
1488
  exitWallWidth: r,
1485
- exitDashArray: a = [8, 12]
1489
+ exitDashArray: l = [8, 12]
1486
1490
  }) {
1487
- const { row: c, col: d } = n;
1488
- if (!e.isValid(c, d)) return;
1489
- const u = e.grid[c][d], h = s + d * o, _ = s + c * i;
1490
- t.save(), t.globalCompositeOperation = "destination-out", t.lineWidth = r, t.lineCap = "round", t.beginPath(), u.walls.bottom && (t.moveTo(h, _ + i), t.lineTo(h + o, _ + i)), t.stroke(), t.globalCompositeOperation = "source-over", t.strokeStyle = l, t.lineWidth = r, t.setLineDash(a), t.beginPath(), u.walls.bottom && (t.moveTo(h, _ + i), t.lineTo(h + o, _ + i)), t.stroke(), t.restore();
1491
+ const { row: a, col: d } = n;
1492
+ if (!e.isValid(a, d)) return;
1493
+ const u = e.grid[a][d], h = s + d * o, f = s + a * i;
1494
+ t.save(), t.globalCompositeOperation = "destination-out", t.lineWidth = r, t.lineCap = "round", t.beginPath(), u.walls.bottom && (t.moveTo(h, f + i), t.lineTo(h + o, f + i)), t.stroke(), t.globalCompositeOperation = "source-over", t.strokeStyle = c, t.lineWidth = r, t.setLineDash(l), t.beginPath(), u.walls.bottom && (t.moveTo(h, f + i), t.lineTo(h + o, f + i)), t.stroke(), t.restore();
1491
1495
  }
1492
- function sn({
1496
+ function an({
1493
1497
  ctx: t,
1494
1498
  foodCells: e,
1495
1499
  cellWidth: n,
@@ -1498,105 +1502,105 @@ function sn({
1498
1502
  foodColor: s
1499
1503
  }) {
1500
1504
  t.fillStyle = s;
1501
- const l = Math.min(n, o) * 0.25;
1505
+ const c = Math.min(n, o) * 0.25;
1502
1506
  e.forEach((r) => {
1503
- const { x: a, y: c } = ie(
1507
+ const { x: l, y: a } = se(
1504
1508
  r.row,
1505
1509
  r.col,
1506
1510
  n,
1507
1511
  o,
1508
1512
  i
1509
1513
  );
1510
- ln(t, a, c, l * 1.2, 5, l * 0.6);
1514
+ cn(t, l, a, c * 1.2, 5, c * 0.6);
1511
1515
  });
1512
1516
  }
1513
- function ln(t, e, n, o, i, s) {
1517
+ function cn(t, e, n, o, i, s) {
1514
1518
  t.save(), t.beginPath();
1515
- for (let l = 0; l < i * 2; l++) {
1516
- const r = l % 2 === 0 ? o : s, a = Math.PI * l / i;
1517
- t.lineTo(e + r * Math.sin(a), n + r * Math.cos(a));
1519
+ for (let c = 0; c < i * 2; c++) {
1520
+ const r = c % 2 === 0 ? o : s, l = Math.PI * c / i;
1521
+ t.lineTo(e + r * Math.sin(l), n + r * Math.cos(l));
1518
1522
  }
1519
1523
  t.closePath(), t.fill(), t.restore();
1520
1524
  }
1521
- function an({
1525
+ function un({
1522
1526
  ctx: t,
1523
1527
  playerPath: e,
1524
1528
  visitCounts: n,
1525
1529
  cellWidth: o,
1526
1530
  cellHeight: i,
1527
1531
  padding: s,
1528
- clueColor: l
1532
+ clueColor: c
1529
1533
  }) {
1530
1534
  if (!(!e || e.length < 2 || !n)) {
1531
1535
  t.save();
1532
1536
  for (let r = 1; r < e.length; r++) {
1533
- const a = e[r - 1], c = e[r], d = `${a.row},${a.col}-${c.row},${c.col}`, u = `${c.row},${c.col}-${a.row},${a.col}`, h = (n[d] || 0) + (n[u] || 0), _ = Math.min(0.2 + h * 0.1, 0.9), m = Math.max(3, o * 0.1) + h * 0.5;
1537
+ const l = e[r - 1], a = e[r], d = `${l.row},${l.col}-${a.row},${a.col}`, u = `${a.row},${a.col}-${l.row},${l.col}`, h = (n[d] || 0) + (n[u] || 0), f = Math.min(0.2 + h * 0.1, 0.9), w = Math.max(3, o * 0.1) + h * 0.5;
1534
1538
  try {
1535
- t.strokeStyle = l.replace(")", `, ${_})`).replace("rgb(", "rgba(");
1539
+ t.strokeStyle = c.replace(")", `, ${f})`).replace("rgb(", "rgba(");
1536
1540
  } catch {
1537
- t.strokeStyle = `rgba(255, 0, 0, ${_})`;
1541
+ t.strokeStyle = `rgba(255, 0, 0, ${f})`;
1538
1542
  }
1539
- t.lineWidth = m, t.lineCap = "round", t.lineJoin = "round";
1540
- const { x: g, y: f } = ie(
1541
- a.row,
1542
- a.col,
1543
+ t.lineWidth = w, t.lineCap = "round", t.lineJoin = "round";
1544
+ const { x: g, y: _ } = se(
1545
+ l.row,
1546
+ l.col,
1543
1547
  o,
1544
1548
  i,
1545
1549
  s
1546
- ), { x: p, y: v } = ie(
1547
- c.row,
1548
- c.col,
1550
+ ), { x: v, y: m } = se(
1551
+ a.row,
1552
+ a.col,
1549
1553
  o,
1550
1554
  i,
1551
1555
  s
1552
1556
  );
1553
- t.beginPath(), t.moveTo(g, f), t.lineTo(p, v), t.stroke();
1557
+ t.beginPath(), t.moveTo(g, _), t.lineTo(v, m), t.stroke();
1554
1558
  }
1555
1559
  t.restore();
1556
1560
  }
1557
1561
  }
1558
- function cn(t, e, n, o) {
1562
+ function dn(t, e, n, o) {
1559
1563
  const i = [];
1560
1564
  for (let s = 0; s < t.rows; s++)
1561
- for (let l = 0; l < t.cols; l++) {
1562
- const r = t.grid[s][l], a = o + l * e, c = o + s * n;
1565
+ for (let c = 0; c < t.cols; c++) {
1566
+ const r = t.grid[s][c], l = o + c * e, a = o + s * n;
1563
1567
  r.walls.top && i.push({
1564
- x1: a,
1565
- y1: c,
1566
- x2: a + e,
1567
- y2: c
1568
+ x1: l,
1569
+ y1: a,
1570
+ x2: l + e,
1571
+ y2: a
1568
1572
  }), r.walls.right && i.push({
1569
- x1: a + e,
1570
- y1: c,
1571
- x2: a + e,
1572
- y2: c + n
1573
+ x1: l + e,
1574
+ y1: a,
1575
+ x2: l + e,
1576
+ y2: a + n
1573
1577
  }), r.walls.bottom && i.push({
1574
- x1: a,
1575
- y1: c + n,
1576
- x2: a + e,
1577
- y2: c + n
1578
+ x1: l,
1579
+ y1: a + n,
1580
+ x2: l + e,
1581
+ y2: a + n
1578
1582
  }), r.walls.left && i.push({
1579
- x1: a,
1580
- y1: c,
1581
- x2: a,
1582
- y2: c + n
1583
+ x1: l,
1584
+ y1: a,
1585
+ x2: l,
1586
+ y2: a + n
1583
1587
  });
1584
1588
  }
1585
1589
  return i;
1586
1590
  }
1587
- function ie(t, e, n, o, i) {
1591
+ function se(t, e, n, o, i) {
1588
1592
  return {
1589
1593
  x: i + e * n + n / 2,
1590
1594
  y: i + t * o + o / 2
1591
1595
  };
1592
1596
  }
1593
- function un(t) {
1597
+ function hn(t) {
1594
1598
  return function() {
1595
1599
  let e = t += 1831565813;
1596
1600
  return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
1597
1601
  };
1598
1602
  }
1599
- class dn {
1603
+ class fn {
1600
1604
  // initially all walls exit
1601
1605
  constructor(e, n) {
1602
1606
  this.row = e, this.col = n;
@@ -1604,7 +1608,7 @@ class dn {
1604
1608
  visited = !1;
1605
1609
  walls = { top: !0, right: !0, bottom: !0, left: !0 };
1606
1610
  }
1607
- class hn {
1611
+ class _n {
1608
1612
  rows;
1609
1613
  cols;
1610
1614
  grid;
@@ -1621,7 +1625,7 @@ class hn {
1621
1625
  * @param exit Optional exit cell position
1622
1626
  */
1623
1627
  constructor(e, n, o, i, s = { row: 0, col: 0 }) {
1624
- this.rows = e, this.cols = n, this.seed = i ?? Math.floor(Math.random() * 1e6), this.random = un(this.seed), this.grid = this.initializeGrid(), this.generate(o, s);
1628
+ this.rows = e, this.cols = n, this.seed = i ?? Math.floor(Math.random() * 1e6), this.random = hn(this.seed), this.grid = this.initializeGrid(), this.generate(o, s);
1625
1629
  }
1626
1630
  // Initialize the grid with new MazeCell objects
1627
1631
  initializeGrid() {
@@ -1629,7 +1633,7 @@ class hn {
1629
1633
  for (let n = 0; n < this.rows; n++) {
1630
1634
  e[n] = [];
1631
1635
  for (let o = 0; o < this.cols; o++)
1632
- e[n][o] = new dn(n, o);
1636
+ e[n][o] = new fn(n, o);
1633
1637
  }
1634
1638
  return e;
1635
1639
  }
@@ -1650,8 +1654,8 @@ class hn {
1650
1654
  // Left
1651
1655
  ];
1652
1656
  for (const s of i) {
1653
- const l = e + s.r, r = n + s.c;
1654
- this.isValid(l, r) && o.push({ row: l, col: r });
1657
+ const c = e + s.r, r = n + s.c;
1658
+ this.isValid(c, r) && o.push({ row: c, col: r });
1655
1659
  }
1656
1660
  return o;
1657
1661
  }
@@ -1671,8 +1675,8 @@ class hn {
1671
1675
  }
1672
1676
  // Remove the wall between two adjacent cells
1673
1677
  removeWall(e, n, o, i) {
1674
- const s = this.grid[e][n], l = this.grid[o][i];
1675
- e === o + 1 ? (s.walls.top = !1, l.walls.bottom = !1) : e === o - 1 ? (s.walls.bottom = !1, l.walls.top = !1) : n === i + 1 ? (s.walls.left = !1, l.walls.right = !1) : n === i - 1 && (s.walls.right = !1, l.walls.left = !1);
1678
+ const s = this.grid[e][n], c = this.grid[o][i];
1679
+ e === o + 1 ? (s.walls.top = !1, c.walls.bottom = !1) : e === o - 1 ? (s.walls.bottom = !1, c.walls.top = !1) : n === i + 1 ? (s.walls.left = !1, c.walls.right = !1) : n === i - 1 && (s.walls.right = !1, c.walls.left = !1);
1676
1680
  }
1677
1681
  // --- Generation Methods ---
1678
1682
  /**
@@ -1701,28 +1705,28 @@ class hn {
1701
1705
  let i = { row: n, col: o };
1702
1706
  for (this.grid[n][o].visited = !0, e.push(i); e.length > 0; ) {
1703
1707
  i = e[e.length - 1];
1704
- const { row: s, col: l } = i, r = this.getUnvisitedNeighbors(s, l);
1708
+ const { row: s, col: c } = i, r = this.getUnvisitedNeighbors(s, c);
1705
1709
  if (r.length > 0) {
1706
- const a = this.randomPick(r), { row: c, col: d } = a;
1707
- this.removeWall(s, l, c, d), this.grid[c][d].visited = !0, e.push(a);
1710
+ const l = this.randomPick(r), { row: a, col: d } = l;
1711
+ this.removeWall(s, c, a, d), this.grid[a][d].visited = !0, e.push(l);
1708
1712
  } else
1709
1713
  e.pop();
1710
1714
  }
1711
1715
  }
1712
1716
  // --- Prim's Algorithm Implementation ---
1713
1717
  generateWithPrims() {
1714
- const e = [], n = (s, l) => {
1715
- const r = this.getNeighbors(s, l);
1716
- for (const a of r)
1717
- !this.grid[a.row][a.col].visited && !e.some(
1718
- (c) => c.row === a.row && c.col === a.col
1719
- ) && e.push(a);
1718
+ const e = [], n = (s, c) => {
1719
+ const r = this.getNeighbors(s, c);
1720
+ for (const l of r)
1721
+ !this.grid[l.row][l.col].visited && !e.some(
1722
+ (a) => a.row === l.row && a.col === l.col
1723
+ ) && e.push(l);
1720
1724
  }, o = this.randomNumber(this.rows), i = this.randomNumber(this.cols);
1721
1725
  for (this.grid[o][i].visited = !0, n(o, i); e.length > 0; ) {
1722
- const s = this.randomNumber(e.length), l = e[s], { row: r, col: a } = l, c = this.getVisitedNeighbors(r, a);
1723
- if (c.length > 0) {
1724
- const d = this.randomPick(c);
1725
- this.removeWall(r, a, d.row, d.col), this.grid[r][a].visited = !0, n(r, a);
1726
+ const s = this.randomNumber(e.length), c = e[s], { row: r, col: l } = c, a = this.getVisitedNeighbors(r, l);
1727
+ if (a.length > 0) {
1728
+ const d = this.randomPick(a);
1729
+ this.removeWall(r, l, d.row, d.col), this.grid[r][l].visited = !0, n(r, l);
1726
1730
  }
1727
1731
  e.splice(s, 1);
1728
1732
  }
@@ -1747,140 +1751,142 @@ class hn {
1747
1751
  return e[Math.floor(this.random() * e.length)];
1748
1752
  }
1749
1753
  }
1750
- const _n = (t, e, n) => {
1754
+ const mn = (t, e, n) => {
1751
1755
  if (!t.isValid(e, n)) return !1;
1752
1756
  const o = t.grid[e][n];
1753
1757
  return !o.walls.top || !o.walls.right || !o.walls.bottom || !o.walls.left;
1754
- }, fn = (t) => t === 1 ? 2 : t >= 2 && t <= 5 ? 3 : t >= 6 && t <= 11 ? 4 : t >= 12 && t <= 15 ? 5 : 6, mn = (t, e) => {
1758
+ }, vn = (t) => t === 1 ? 2 : t >= 2 && t <= 5 ? 3 : t >= 6 && t <= 11 ? 4 : t >= 12 && t <= 15 ? 5 : 6, pn = (t, e) => {
1755
1759
  if (!e)
1756
1760
  return console.error(`Cannot find Level ${t}'s config.`), null;
1757
- const { size: n, seed: o, method: i, entry: s, exit: l } = e, r = n, a = n, c = s || { row: 0, col: 0 }, d = l || {
1761
+ const { size: n, seed: o, method: i, entry: s, exit: c } = e, r = n, l = n, a = s || { row: 0, col: 0 }, d = c || {
1758
1762
  row: r - 1,
1759
- col: a - 1
1760
- }, u = new hn(r, a, i, o, s), h = fn(t), _ = [];
1761
- for (let m = 0; m < h; m++) {
1763
+ col: l - 1
1764
+ }, u = new _n(r, l, i, o, s), h = vn(t), f = [];
1765
+ for (let w = 0; w < h; w++) {
1762
1766
  let g;
1763
1767
  do
1764
1768
  g = {
1765
1769
  row: Math.floor(u.random() * r),
1766
- col: Math.floor(u.random() * a)
1770
+ col: Math.floor(u.random() * l)
1767
1771
  };
1768
- while (g.row === c.row && g.col === c.col || g.row === d.row && g.col === d.col || !_n(u, g.row, g.col) || _.some((f) => f.row === g.row && f.col === g.col));
1769
- _.push(g);
1772
+ while (g.row === a.row && g.col === a.col || g.row === d.row && g.col === d.col || !mn(u, g.row, g.col) || f.some((_) => _.row === g.row && _.col === g.col));
1773
+ f.push(g);
1770
1774
  }
1771
1775
  return {
1772
1776
  isGameActive: !0,
1773
1777
  levelTransitioning: !1,
1774
1778
  maze: u,
1775
- playerCell: c,
1779
+ playerCell: a,
1776
1780
  exitCell: d,
1777
- foodCells: _,
1781
+ foodCells: f,
1778
1782
  playerAtExit: !1,
1779
1783
  foodCollected: 0,
1780
1784
  totalFoodCount: h,
1781
1785
  showClue: !1,
1782
- playerPath: [c],
1783
- visitCounts: { [`${c.row},${c.col}`]: 1 }
1786
+ playerPath: [a],
1787
+ visitCounts: { [`${a.row},${a.col}`]: 1 }
1784
1788
  };
1785
1789
  };
1786
- function vn() {
1787
- const { setGamePlayState: t, gamePlayStateRef: e, gameProgress: n, config: o } = V(), i = R(null), s = R(null), l = R(null), { i18n: r, levelConfig: a, renderConfig: c } = o, d = X(a), u = R(
1790
+ function gn() {
1791
+ const { setGamePlayState: t, gamePlayStateRef: e, gameProgress: n, config: o } = B(), i = F(null), s = F(null), c = F(null), { i18n: r, levelConfig: l, renderConfig: a } = o, d = J(l), u = F(
1788
1792
  d.getLevelConfig(n.currentLevel)
1789
1793
  );
1790
1794
  x(() => {
1791
- i.current && O.attachTo(i.current);
1795
+ i.current && R.attachTo(i.current);
1792
1796
  }, []);
1793
- const h = R(), _ = Kt(l, () => {
1797
+ const h = F(), f = Zt(c, () => {
1794
1798
  h.current?.();
1795
- }), m = Jt(l);
1799
+ }), w = Qt(c);
1796
1800
  x(() => {
1797
1801
  u.current = d.getLevelConfig(
1798
1802
  n.currentLevel
1799
1803
  );
1800
1804
  }, [n.currentLevel]);
1801
1805
  const g = () => {
1802
- const y = mn(
1806
+ const y = pn(
1803
1807
  n.currentLevel,
1804
1808
  u.current
1805
1809
  );
1806
- y && t((w) => ({
1807
- ...w,
1810
+ y && t((C) => ({
1811
+ ...C,
1808
1812
  ...y
1809
1813
  }));
1810
1814
  };
1811
1815
  x(() => {
1812
1816
  g();
1813
1817
  }, [n.currentLevel]);
1814
- const f = () => {
1818
+ const _ = () => {
1815
1819
  g();
1816
- }, { updatePlayerPos: p, resetMovingState: v } = Zt({
1820
+ }, { updatePlayerPos: v, resetMovingState: m } = en({
1817
1821
  containerRef: s,
1818
1822
  gamePlayStateRef: e,
1819
1823
  setGamePlayState: t,
1820
- playerRadius: c.playerRadius,
1821
- moveSpeed: c.gridMoveSpeed,
1824
+ playerRadius: a.playerRadius,
1825
+ moveSpeed: a.gridMoveSpeed,
1826
+ exitWallWidth: u.current?.exitWallWidth || a?.exitWallWidth,
1827
+ getCellSizeInPixels: () => w.current.cellWidth,
1822
1828
  onFoodCollected: () => {
1823
1829
  const y = e.current.totalFoodCount - e.current.foodCollected - 1;
1824
- y > 0 ? O.show(
1830
+ y > 0 ? R.show(
1825
1831
  r.foodCollectedToast.replace("%NUM%", y.toString()),
1826
1832
  "success",
1827
1833
  3e3
1828
- ) : O.show(r.allFoodCollectedToast, "success");
1834
+ ) : R.show(r.allFoodCollectedToast, "success");
1829
1835
  }
1830
1836
  });
1831
1837
  return x(() => {
1832
- v();
1833
- }, [n.currentLevel, v]), x(() => {
1834
- let y, w = !document.hidden;
1835
- const b = () => {
1836
- const N = l.current?.getContext("2d"), L = e.current;
1837
- if (!(w && L?.isGameActive && N && L?.maze)) {
1838
- y = requestAnimationFrame(b);
1838
+ m();
1839
+ }, [n.currentLevel, m]), x(() => {
1840
+ let y, C = !document.hidden;
1841
+ const k = () => {
1842
+ const S = c.current?.getContext("2d"), b = e.current;
1843
+ if (!(C && b?.isGameActive && S && b?.maze)) {
1844
+ y = requestAnimationFrame(k);
1839
1845
  return;
1840
1846
  }
1841
- p(), k(), y = requestAnimationFrame(b);
1842
- }, k = () => {
1843
- const N = l.current?.getContext("2d"), L = e.current;
1844
- if (N && L?.maze) {
1845
- const A = u.current?.wallWidth || c?.wallWidth, z = u.current?.exitColor || c?.exitColor, P = u.current?.exitWallWidth || c?.exitWallWidth, I = u.current?.exitDashArray || c?.exitDashArray;
1846
- tn(N, L, _.current, m.current, {
1847
- ...c,
1848
- wallWidth: A,
1849
- exitColor: z,
1847
+ v(), T(), y = requestAnimationFrame(k);
1848
+ }, T = () => {
1849
+ const S = c.current?.getContext("2d"), b = e.current;
1850
+ if (S && b?.maze) {
1851
+ const E = u.current?.wallWidth || a?.wallWidth, N = u.current?.exitColor || a?.exitColor, P = u.current?.exitWallWidth || a?.exitWallWidth, I = u.current?.exitDashArray || a?.exitDashArray;
1852
+ on(S, b, f.current, w.current, {
1853
+ ...a,
1854
+ wallWidth: E,
1855
+ exitColor: N,
1850
1856
  exitWallWidth: P,
1851
1857
  exitDashArray: I
1852
1858
  });
1853
1859
  }
1854
1860
  };
1855
- h.current = k;
1856
- const T = (N) => {
1857
- const L = w;
1858
- w = !document.hidden && document.visibilityState === "visible" && (!N || N.type !== "blur"), !L && w ? e.current?.levelTransitioning === !1 && t({
1861
+ h.current = T;
1862
+ const z = (S) => {
1863
+ const b = C;
1864
+ C = !document.hidden && document.visibilityState === "visible" && (!S || S.type !== "blur"), !b && C ? e.current?.levelTransitioning === !1 && t({
1859
1865
  ...e.current,
1860
1866
  isGameActive: !0
1861
- }) : L && !w && t({
1867
+ }) : b && !C && t({
1862
1868
  ...e.current,
1863
1869
  isGameActive: !1
1864
1870
  });
1865
1871
  };
1866
- return document.addEventListener("visibilitychange", T), window.addEventListener("blur", T), window.addEventListener("focus", T), y = requestAnimationFrame(b), () => {
1867
- cancelAnimationFrame(y), document.removeEventListener("visibilitychange", T), window.removeEventListener("blur", T), window.removeEventListener("focus", T);
1872
+ return document.addEventListener("visibilitychange", z), window.addEventListener("blur", z), window.addEventListener("focus", z), y = requestAnimationFrame(k), () => {
1873
+ cancelAnimationFrame(y), document.removeEventListener("visibilitychange", z), window.removeEventListener("blur", z), window.removeEventListener("focus", z);
1868
1874
  };
1869
1875
  }, []), x(() => {
1870
- O.show(r.useArrowKeyTips, "info", 3e3);
1871
- }, []), /* @__PURE__ */ C("div", { className: "maze-game-container", ref: i, children: [
1872
- /* @__PURE__ */ C(kt, {}),
1873
- /* @__PURE__ */ C(Xt, { onRetry: f }),
1874
- /* @__PURE__ */ C("div", { className: "maze-canvas-container", ref: s, children: [
1875
- /* @__PURE__ */ C("canvas", { ref: l, className: "maze-game-canvas" }),
1876
- /* @__PURE__ */ C("div", { className: "maze-touch-area maze-up" }),
1877
- /* @__PURE__ */ C("div", { className: "maze-touch-area maze-down" }),
1878
- /* @__PURE__ */ C("div", { className: "maze-touch-area maze-left" }),
1879
- /* @__PURE__ */ C("div", { className: "maze-touch-area maze-right" })
1876
+ R.show(r.useArrowKeyTips, "info", 3e3);
1877
+ }, []), /* @__PURE__ */ p("div", { className: "maze-game-container", ref: i, children: [
1878
+ /* @__PURE__ */ p(St, {}),
1879
+ /* @__PURE__ */ p(Jt, { onRetry: _ }),
1880
+ /* @__PURE__ */ p("div", { className: "maze-canvas-container", ref: s, children: [
1881
+ /* @__PURE__ */ p("canvas", { ref: c, className: "maze-game-canvas" }),
1882
+ /* @__PURE__ */ p("div", { className: "maze-touch-area maze-up" }),
1883
+ /* @__PURE__ */ p("div", { className: "maze-touch-area maze-down" }),
1884
+ /* @__PURE__ */ p("div", { className: "maze-touch-area maze-left" }),
1885
+ /* @__PURE__ */ p("div", { className: "maze-touch-area maze-right" })
1880
1886
  ] })
1881
1887
  ] });
1882
1888
  }
1883
- const ot = [
1889
+ const it = [
1884
1890
  // Tier 1 (Levels 1-12) - Beginner
1885
1891
  [
1886
1892
  // debug
@@ -2038,7 +2044,7 @@ const ot = [
2038
2044
  { size: 68, seed: 33341, method: "backtracking" }
2039
2045
  // Level 60 - Master
2040
2046
  ]
2041
- ], oe = {
2047
+ ], re = {
2042
2048
  lcPrefix: "maze-",
2043
2049
  i18n: {
2044
2050
  reset: "Reset",
@@ -2097,33 +2103,33 @@ const ot = [
2097
2103
  exitDashArray: [8, 12]
2098
2104
  // default dash: 8px dash, 12px gap
2099
2105
  },
2100
- levelConfig: ot
2106
+ levelConfig: it
2101
2107
  };
2102
- function gn({ config: t = {} }) {
2103
- const e = { ...oe.i18n, ...t.i18n || {} }, n = {
2104
- ...oe.renderConfig,
2108
+ function Cn({ config: t = {} }) {
2109
+ const e = { ...re.i18n, ...t.i18n || {} }, n = {
2110
+ ...re.renderConfig,
2105
2111
  ...t.renderConfig || {}
2106
- }, o = t.levelConfig || ot, i = {
2107
- ...oe,
2112
+ }, o = t.levelConfig || it, i = {
2113
+ ...re,
2108
2114
  ...t,
2109
2115
  i18n: e,
2110
2116
  levelConfig: o,
2111
2117
  renderConfig: n
2112
2118
  };
2113
- return /* @__PURE__ */ C(wt, { config: i, children: /* @__PURE__ */ C(vn, {}) });
2119
+ return /* @__PURE__ */ p(bt, { config: i, children: /* @__PURE__ */ p(gn, {}) });
2114
2120
  }
2115
- const pn = {
2116
- root: "https://unpkg.com/@roudanio/maze@0.1.1/dist/",
2117
- ...oe
2121
+ const wn = {
2122
+ root: "https://unpkg.com/@roudanio/maze@0.1.2/dist/",
2123
+ ...re
2118
2124
  };
2119
- `${JSON.stringify(pn, null, 2)}`;
2120
- const Cn = {
2125
+ `${JSON.stringify(wn, null, 2)}`;
2126
+ const yn = {
2121
2127
  async init(t, e) {
2122
2128
  const n = typeof t == "string" ? document.querySelector(t) : t;
2123
2129
  if (!n) {
2124
2130
  console.warn("Cannot find the root element");
2125
- const a = document.createElement("div");
2126
- a.style.textAlign = "center", a.style.padding = "20px", a.innerHTML = "Cannot find the root element", document.body.append(a);
2131
+ const l = document.createElement("div");
2132
+ l.style.textAlign = "center", l.style.padding = "20px", l.innerHTML = "Cannot find the root element", document.body.append(l);
2127
2133
  return;
2128
2134
  }
2129
2135
  let { root: o = location.origin } = e;
@@ -2142,17 +2148,17 @@ const Cn = {
2142
2148
  transition: width 1.5s ease-in-out;
2143
2149
  transition: width 1.5s ease-in-out;
2144
2150
  `, i.append(s), n.append(i);
2145
- const l = document.createElement("style");
2146
- l.innerHTML = `
2151
+ const c = document.createElement("style");
2152
+ c.innerHTML = `
2147
2153
  @keyframes loading {
2148
2154
  0% { width: 0%; }
2149
2155
  100% { width: 99%; }
2150
- }`, document.head.appendChild(l), await (async (a) => new Promise((c, d) => {
2156
+ }`, document.head.appendChild(c), await (async (l) => new Promise((a, d) => {
2151
2157
  const u = document.createElement("link");
2152
- u.rel = "stylesheet", u.type = "text/css", u.href = a, u.onload = c, u.onerror = d, document.head.appendChild(u);
2153
- }))(o + "maze.css"), dt(/* @__PURE__ */ C(gn, { config: e }), n);
2158
+ u.rel = "stylesheet", u.type = "text/css", u.href = l, u.onload = a, u.onerror = d, document.head.appendChild(u);
2159
+ }))(o + "maze.css"), ft(/* @__PURE__ */ p(Cn, { config: e }), n);
2154
2160
  }
2155
2161
  };
2156
2162
  export {
2157
- Cn as default
2163
+ yn as default
2158
2164
  };