@roudanio/maze 0.0.4 → 0.0.6

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,4 +1,4 @@
1
- var ne, C, qe, O, we, Xe, Ye, Je, de, le, ce, Ke, B = {}, Ze = [], Nt = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, X = Array.isArray;
1
+ var ne, y, qe, O, we, Xe, Ye, Je, de, ae, ce, Ke, B = {}, Ze = [], St = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, X = Array.isArray;
2
2
  function I(e, t) {
3
3
  for (var o in t) e[o] = t[o];
4
4
  return e;
@@ -6,7 +6,7 @@ function I(e, t) {
6
6
  function he(e) {
7
7
  e && e.parentNode && e.parentNode.removeChild(e);
8
8
  }
9
- function D(e, t, o) {
9
+ function W(e, t, o) {
10
10
  var n, i, r, s = {};
11
11
  for (r in t) r == "key" ? n = t[r] : r == "ref" ? i = t[r] : s[r] = t[r];
12
12
  if (arguments.length > 2 && (s.children = arguments.length > 3 ? ne.call(arguments, 2) : o), typeof e == "function" && e.defaultProps != null) for (r in e.defaultProps) s[r] == null && (s[r] = e.defaultProps[r]);
@@ -14,12 +14,12 @@ function D(e, t, o) {
14
14
  }
15
15
  function Z(e, t, o, n, i) {
16
16
  var r = { type: e, props: t, key: o, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++qe, __i: -1, __u: 0 };
17
- return i == null && C.vnode != null && C.vnode(r), r;
17
+ return i == null && y.vnode != null && y.vnode(r), r;
18
18
  }
19
19
  function j(e) {
20
20
  return e.children;
21
21
  }
22
- function R(e, t) {
22
+ function $(e, t) {
23
23
  this.props = e, this.context = t;
24
24
  }
25
25
  function H(e, t) {
@@ -38,21 +38,21 @@ function Qe(e) {
38
38
  }
39
39
  }
40
40
  function ue(e) {
41
- (!e.__d && (e.__d = !0) && O.push(e) && !te.__r++ || we != C.debounceRendering) && ((we = C.debounceRendering) || Xe)(te);
41
+ (!e.__d && (e.__d = !0) && O.push(e) && !te.__r++ || we != y.debounceRendering) && ((we = y.debounceRendering) || Xe)(te);
42
42
  }
43
43
  function te() {
44
- for (var e, t, o, n, i, r, s, a = 1; O.length; ) O.length > a && O.sort(Ye), e = O.shift(), a = O.length, e.__d && (o = void 0, i = (n = (t = e).__v).__e, r = [], s = [], t.__P && ((o = I({}, n)).__v = n.__v + 1, C.vnode && C.vnode(o), fe(t.__P, o, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [i] : null, r, i ?? H(n), !!(32 & n.__u), s), o.__v = n.__v, o.__.__k[o.__i] = o, ot(r, o, s), o.__e != i && Qe(o)));
44
+ for (var e, t, o, n, i, r, s, l = 1; O.length; ) O.length > l && O.sort(Ye), e = O.shift(), l = O.length, e.__d && (o = void 0, i = (n = (t = e).__v).__e, r = [], s = [], t.__P && ((o = I({}, n)).__v = n.__v + 1, y.vnode && y.vnode(o), fe(t.__P, o, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [i] : null, r, i ?? H(n), !!(32 & n.__u), s), o.__v = n.__v, o.__.__k[o.__i] = o, ot(r, o, s), o.__e != i && Qe(o)));
45
45
  te.__r = 0;
46
46
  }
47
- function et(e, t, o, n, i, r, s, a, l, c, _) {
48
- var u, h, d, m, v, y, g = n && n.__k || Ze, p = t.length;
49
- for (l = Lt(o, t, g, l, p), u = 0; u < p; u++) (d = o.__k[u]) != null && (h = d.__i == -1 ? B : g[d.__i] || B, d.__i = u, y = fe(e, d, h, i, r, s, a, l, c, _), m = d.__e, d.ref && h.ref != d.ref && (h.ref && me(h.ref, null, d), _.push(d.ref, d.__c || m, d)), v == null && m != null && (v = m), 4 & d.__u || h.__k === d.__k ? l = tt(d, l, e) : typeof d.type == "function" && y !== void 0 ? l = y : m && (l = m.nextSibling), d.__u &= -7);
50
- return o.__e = v, l;
47
+ function et(e, t, o, n, i, r, s, l, a, c, _) {
48
+ var u, h, d, f, g, v, C = n && n.__k || Ze, p = t.length;
49
+ for (a = Lt(o, t, C, a, p), u = 0; u < p; u++) (d = o.__k[u]) != null && (h = d.__i == -1 ? B : C[d.__i] || B, d.__i = u, v = fe(e, d, h, i, r, s, l, a, c, _), f = d.__e, d.ref && h.ref != d.ref && (h.ref && me(h.ref, null, d), _.push(d.ref, d.__c || f, d)), g == null && f != null && (g = f), 4 & d.__u || h.__k === d.__k ? a = tt(d, a, e) : typeof d.type == "function" && v !== void 0 ? a = v : f && (a = f.nextSibling), d.__u &= -7);
50
+ return o.__e = g, a;
51
51
  }
52
52
  function Lt(e, t, o, n, i) {
53
- var r, s, a, l, c, _ = o.length, u = _, h = 0;
54
- for (e.__k = new Array(i), r = 0; r < i; r++) (s = t[r]) != null && typeof s != "boolean" && typeof s != "function" ? (l = r + h, (s = e.__k[r] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? Z(null, s, null, null, null) : X(s) ? Z(j, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? Z(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = e, s.__b = e.__b + 1, a = null, (c = s.__i = xt(s, o, l, u)) != -1 && (u--, (a = o[c]) && (a.__u |= 2)), a == null || a.__v == null ? (c == -1 && (i > _ ? h-- : i < _ && h++), typeof s.type != "function" && (s.__u |= 4)) : c != l && (c == l - 1 ? h-- : c == l + 1 ? h++ : (c > l ? h-- : h++, s.__u |= 4))) : e.__k[r] = null;
55
- if (u) for (r = 0; r < _; r++) (a = o[r]) != null && (2 & a.__u) == 0 && (a.__e == n && (n = H(a)), it(a, a));
53
+ var r, s, l, a, c, _ = o.length, u = _, h = 0;
54
+ for (e.__k = new Array(i), r = 0; r < i; r++) (s = t[r]) != null && typeof s != "boolean" && typeof s != "function" ? (a = r + h, (s = e.__k[r] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? Z(null, s, null, null, null) : X(s) ? Z(j, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? Z(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = e, s.__b = e.__b + 1, l = null, (c = s.__i = xt(s, o, a, u)) != -1 && (u--, (l = o[c]) && (l.__u |= 2)), l == null || l.__v == null ? (c == -1 && (i > _ ? h-- : i < _ && h++), typeof s.type != "function" && (s.__u |= 4)) : c != a && (c == a - 1 ? h-- : c == a + 1 ? h++ : (c > a ? h-- : h++, s.__u |= 4))) : e.__k[r] = null;
55
+ if (u) for (r = 0; r < _; r++) (l = o[r]) != null && (2 & l.__u) == 0 && (l.__e == n && (n = H(l)), it(l, l));
56
56
  return n;
57
57
  }
58
58
  function tt(e, t, o) {
@@ -73,22 +73,22 @@ function oe(e, t) {
73
73
  }) : t.push(e)), t;
74
74
  }
75
75
  function xt(e, t, o, n) {
76
- var i, r, s = e.key, a = e.type, l = t[o];
77
- if (l === null && e.key == null || l && s == l.key && a == l.type && (2 & l.__u) == 0) return o;
78
- if (n > (l != null && (2 & l.__u) == 0 ? 1 : 0)) for (i = o - 1, r = o + 1; i >= 0 || r < t.length; ) {
76
+ var i, r, s = e.key, l = e.type, a = t[o];
77
+ if (a === null && e.key == null || a && s == a.key && l == a.type && (2 & a.__u) == 0) return o;
78
+ if (n > (a != null && (2 & a.__u) == 0 ? 1 : 0)) for (i = o - 1, r = o + 1; i >= 0 || r < t.length; ) {
79
79
  if (i >= 0) {
80
- if ((l = t[i]) && (2 & l.__u) == 0 && s == l.key && a == l.type) return i;
80
+ if ((a = t[i]) && (2 & a.__u) == 0 && s == a.key && l == a.type) return i;
81
81
  i--;
82
82
  }
83
83
  if (r < t.length) {
84
- if ((l = t[r]) && (2 & l.__u) == 0 && s == l.key && a == l.type) return r;
84
+ if ((a = t[r]) && (2 & a.__u) == 0 && s == a.key && l == a.type) return r;
85
85
  r++;
86
86
  }
87
87
  }
88
88
  return -1;
89
89
  }
90
90
  function be(e, t, o) {
91
- t[0] == "-" ? e.setProperty(t, o ?? "") : e[t] = o == null ? "" : typeof o != "number" || Nt.test(t) ? o : o + "px";
91
+ t[0] == "-" ? e.setProperty(t, o ?? "") : e[t] = o == null ? "" : typeof o != "number" || St.test(t) ? o : o + "px";
92
92
  }
93
93
  function J(e, t, o, n, i) {
94
94
  var r;
@@ -97,7 +97,7 @@ function J(e, t, o, n, i) {
97
97
  if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) o && t in o || be(e.style, t, "");
98
98
  if (o) for (t in o) n && o[t] == n[t] || be(e.style, t, o[t]);
99
99
  }
100
- else if (t[0] == "o" && t[1] == "n") r = t != (t = t.replace(Je, "$1")), t = t.toLowerCase() in e || t == "onFocusOut" || t == "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + r] = o, o ? n ? o.u = n.u : (o.u = de, e.addEventListener(t, r ? ce : le, r)) : e.removeEventListener(t, r ? ce : le, r);
100
+ else if (t[0] == "o" && t[1] == "n") r = t != (t = t.replace(Je, "$1")), t = t.toLowerCase() in e || t == "onFocusOut" || t == "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + r] = o, o ? n ? o.u = n.u : (o.u = de, e.addEventListener(t, r ? ce : ae, r)) : e.removeEventListener(t, r ? ce : ae, r);
101
101
  else {
102
102
  if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
103
103
  else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
@@ -114,63 +114,63 @@ function ke(e) {
114
114
  var o = this.l[t.type + e];
115
115
  if (t.t == null) t.t = de++;
116
116
  else if (t.t < o.u) return;
117
- return o(C.event ? C.event(t) : t);
117
+ return o(y.event ? y.event(t) : t);
118
118
  }
119
119
  };
120
120
  }
121
- function fe(e, t, o, n, i, r, s, a, l, c) {
122
- var _, u, h, d, m, v, y, g, p, T, k, E, P, F, M, S, N, z = t.type;
121
+ function fe(e, t, o, n, i, r, s, l, a, c) {
122
+ var _, u, h, d, f, g, v, C, p, T, k, E, P, F, M, N, S, z = t.type;
123
123
  if (t.constructor != null) return null;
124
- 128 & o.__u && (l = !!(32 & o.__u), r = [a = t.__e = o.__e]), (_ = C.__b) && _(t);
124
+ 128 & o.__u && (a = !!(32 & o.__u), r = [l = t.__e = o.__e]), (_ = y.__b) && _(t);
125
125
  e: if (typeof z == "function") try {
126
- if (g = t.props, p = "prototype" in z && z.prototype.render, T = (_ = z.contextType) && n[_.__c], k = _ ? T ? T.props.value : _.__ : n, o.__c ? y = (u = t.__c = o.__c).__ = u.__E : (p ? t.__c = u = new z(g, k) : (t.__c = u = new R(g, k), u.constructor = z, u.render = Et), T && T.sub(u), u.props = g, u.state || (u.state = {}), u.context = k, u.__n = n, h = u.__d = !0, u.__h = [], u._sb = []), p && u.__s == null && (u.__s = u.state), p && z.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = I({}, u.__s)), I(u.__s, z.getDerivedStateFromProps(g, u.__s))), d = u.props, m = u.state, u.__v = t, h) p && z.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), p && u.componentDidMount != null && u.__h.push(u.componentDidMount);
126
+ if (C = t.props, p = "prototype" in z && z.prototype.render, T = (_ = z.contextType) && n[_.__c], k = _ ? T ? T.props.value : _.__ : n, o.__c ? v = (u = t.__c = o.__c).__ = u.__E : (p ? t.__c = u = new z(C, k) : (t.__c = u = new $(C, k), u.constructor = z, u.render = Et), T && T.sub(u), u.props = C, u.state || (u.state = {}), u.context = k, u.__n = n, h = u.__d = !0, u.__h = [], u._sb = []), p && u.__s == null && (u.__s = u.state), p && z.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = I({}, u.__s)), I(u.__s, z.getDerivedStateFromProps(C, u.__s))), d = u.props, f = u.state, u.__v = t, h) p && z.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), p && u.componentDidMount != null && u.__h.push(u.componentDidMount);
127
127
  else {
128
- if (p && z.getDerivedStateFromProps == null && g !== d && u.componentWillReceiveProps != null && u.componentWillReceiveProps(g, k), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(g, u.__s, k) === !1 || t.__v == o.__v) {
129
- for (t.__v != o.__v && (u.props = g, u.state = u.__s, u.__d = !1), t.__e = o.__e, t.__k = o.__k, t.__k.some(function(U) {
128
+ if (p && z.getDerivedStateFromProps == null && C !== d && u.componentWillReceiveProps != null && u.componentWillReceiveProps(C, k), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(C, u.__s, k) === !1 || t.__v == o.__v) {
129
+ for (t.__v != o.__v && (u.props = C, u.state = u.__s, u.__d = !1), t.__e = o.__e, t.__k = o.__k, t.__k.some(function(U) {
130
130
  U && (U.__ = t);
131
131
  }), E = 0; E < u._sb.length; E++) u.__h.push(u._sb[E]);
132
132
  u._sb = [], u.__h.length && s.push(u);
133
133
  break e;
134
134
  }
135
- u.componentWillUpdate != null && u.componentWillUpdate(g, u.__s, k), p && u.componentDidUpdate != null && u.__h.push(function() {
136
- u.componentDidUpdate(d, m, v);
135
+ u.componentWillUpdate != null && u.componentWillUpdate(C, u.__s, k), p && u.componentDidUpdate != null && u.__h.push(function() {
136
+ u.componentDidUpdate(d, f, g);
137
137
  });
138
138
  }
139
- if (u.context = k, u.props = g, u.__P = e, u.__e = !1, P = C.__r, F = 0, p) {
139
+ if (u.context = k, u.props = C, u.__P = e, u.__e = !1, P = y.__r, F = 0, p) {
140
140
  for (u.state = u.__s, u.__d = !1, P && P(t), _ = u.render(u.props, u.state, u.context), M = 0; M < u._sb.length; M++) u.__h.push(u._sb[M]);
141
141
  u._sb = [];
142
142
  } else do
143
143
  u.__d = !1, P && P(t), _ = u.render(u.props, u.state, u.context), u.state = u.__s;
144
144
  while (u.__d && ++F < 25);
145
- u.state = u.__s, u.getChildContext != null && (n = I(I({}, n), u.getChildContext())), p && !h && u.getSnapshotBeforeUpdate != null && (v = u.getSnapshotBeforeUpdate(d, m)), S = _, _ != null && _.type === j && _.key == null && (S = nt(_.props.children)), a = et(e, X(S) ? S : [S], t, o, n, i, r, s, a, l, c), u.base = t.__e, t.__u &= -161, u.__h.length && s.push(u), y && (u.__E = u.__ = null);
145
+ u.state = u.__s, u.getChildContext != null && (n = I(I({}, n), u.getChildContext())), p && !h && u.getSnapshotBeforeUpdate != null && (g = u.getSnapshotBeforeUpdate(d, f)), N = _, _ != null && _.type === j && _.key == null && (N = nt(_.props.children)), l = et(e, X(N) ? N : [N], t, o, n, i, r, s, l, a, c), u.base = t.__e, t.__u &= -161, u.__h.length && s.push(u), v && (u.__E = u.__ = null);
146
146
  } catch (U) {
147
- if (t.__v = null, l || r != null) if (U.then) {
148
- for (t.__u |= l ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
149
- r[r.indexOf(a)] = null, t.__e = a;
150
- } else for (N = r.length; N--; ) he(r[N]);
147
+ if (t.__v = null, a || r != null) if (U.then) {
148
+ for (t.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
149
+ r[r.indexOf(l)] = null, t.__e = l;
150
+ } else for (S = r.length; S--; ) he(r[S]);
151
151
  else t.__e = o.__e, t.__k = o.__k;
152
- C.__e(U, t, o);
152
+ y.__e(U, t, o);
153
153
  }
154
- else r == null && t.__v == o.__v ? (t.__k = o.__k, t.__e = o.__e) : a = t.__e = At(o.__e, t, o, n, i, r, s, l, c);
155
- return (_ = C.diffed) && _(t), 128 & t.__u ? void 0 : a;
154
+ else r == null && t.__v == o.__v ? (t.__k = o.__k, t.__e = o.__e) : l = t.__e = At(o.__e, t, o, n, i, r, s, a, c);
155
+ return (_ = y.diffed) && _(t), 128 & t.__u ? void 0 : l;
156
156
  }
157
157
  function ot(e, t, o) {
158
158
  for (var n = 0; n < o.length; n++) me(o[n], o[++n], o[++n]);
159
- C.__c && C.__c(t, e), e.some(function(i) {
159
+ y.__c && y.__c(t, e), e.some(function(i) {
160
160
  try {
161
161
  e = i.__h, i.__h = [], e.some(function(r) {
162
162
  r.call(i);
163
163
  });
164
164
  } catch (r) {
165
- C.__e(r, i.__v);
165
+ y.__e(r, i.__v);
166
166
  }
167
167
  });
168
168
  }
169
169
  function nt(e) {
170
170
  return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : X(e) ? e.map(nt) : I({}, e);
171
171
  }
172
- function At(e, t, o, n, i, r, s, a, l) {
173
- var c, _, u, h, d, m, v, y = o.props, g = t.props, p = t.type;
172
+ function At(e, t, o, n, i, r, s, l, a) {
173
+ var c, _, u, h, d, f, g, v = o.props, C = t.props, p = t.type;
174
174
  if (p == "svg" ? i = "http://www.w3.org/2000/svg" : p == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), r != null) {
175
175
  for (c = 0; c < r.length; c++) if ((d = r[c]) && "setAttribute" in d == !!p && (p ? d.localName == p : d.nodeType == 3)) {
176
176
  e = d, r[c] = null;
@@ -178,23 +178,23 @@ function At(e, t, o, n, i, r, s, a, l) {
178
178
  }
179
179
  }
180
180
  if (e == null) {
181
- if (p == null) return document.createTextNode(g);
182
- e = document.createElementNS(i, p, g.is && g), a && (C.__m && C.__m(t, r), a = !1), r = null;
181
+ if (p == null) return document.createTextNode(C);
182
+ e = document.createElementNS(i, p, C.is && C), l && (y.__m && y.__m(t, r), l = !1), r = null;
183
183
  }
184
- if (p == null) y === g || a && e.data == g || (e.data = g);
184
+ if (p == null) v === C || l && e.data == C || (e.data = C);
185
185
  else {
186
- if (r = r && ne.call(e.childNodes), y = o.props || B, !a && r != null) for (y = {}, c = 0; c < e.attributes.length; c++) y[(d = e.attributes[c]).name] = d.value;
187
- for (c in y) if (d = y[c], c != "children") {
186
+ if (r = r && ne.call(e.childNodes), v = o.props || B, !l && r != null) for (v = {}, c = 0; c < e.attributes.length; c++) v[(d = e.attributes[c]).name] = d.value;
187
+ for (c in v) if (d = v[c], c != "children") {
188
188
  if (c == "dangerouslySetInnerHTML") u = d;
189
- else if (!(c in g)) {
190
- if (c == "value" && "defaultValue" in g || c == "checked" && "defaultChecked" in g) continue;
189
+ else if (!(c in C)) {
190
+ if (c == "value" && "defaultValue" in C || c == "checked" && "defaultChecked" in C) continue;
191
191
  J(e, c, null, d, i);
192
192
  }
193
193
  }
194
- for (c in g) d = g[c], c == "children" ? h = d : c == "dangerouslySetInnerHTML" ? _ = d : c == "value" ? m = d : c == "checked" ? v = d : a && typeof d != "function" || y[c] === d || J(e, c, d, y[c], i);
195
- if (_) a || u && (_.__html == u.__html || _.__html == e.innerHTML) || (e.innerHTML = _.__html), t.__k = [];
196
- else if (u && (e.innerHTML = ""), et(t.type == "template" ? e.content : e, X(h) ? h : [h], t, o, n, p == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, r, s, r ? r[0] : o.__k && H(o, 0), a, l), r != null) for (c = r.length; c--; ) he(r[c]);
197
- a || (c = "value", p == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[c] || p == "progress" && !m || p == "option" && m != y[c]) && J(e, c, m, y[c], i), c = "checked", v != null && v != e[c] && J(e, c, v, y[c], i));
194
+ for (c in C) d = C[c], c == "children" ? h = d : c == "dangerouslySetInnerHTML" ? _ = d : c == "value" ? f = d : c == "checked" ? g = d : l && typeof d != "function" || v[c] === d || J(e, c, d, v[c], i);
195
+ if (_) l || u && (_.__html == u.__html || _.__html == e.innerHTML) || (e.innerHTML = _.__html), t.__k = [];
196
+ else if (u && (e.innerHTML = ""), et(t.type == "template" ? e.content : e, X(h) ? h : [h], t, o, n, p == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, r, s, r ? r[0] : o.__k && H(o, 0), l, a), r != null) for (c = r.length; c--; ) he(r[c]);
197
+ l || (c = "value", p == "progress" && f == null ? e.removeAttribute("value") : f != null && (f !== e[c] || p == "progress" && !f || p == "option" && f != v[c]) && J(e, c, f, v[c], i), c = "checked", g != null && g != e[c] && J(e, c, g, v[c], i));
198
198
  }
199
199
  return e;
200
200
  }
@@ -205,16 +205,16 @@ function me(e, t, o) {
205
205
  n && e.__u(), n && t == null || (e.__u = e(t));
206
206
  } else e.current = t;
207
207
  } catch (i) {
208
- C.__e(i, o);
208
+ y.__e(i, o);
209
209
  }
210
210
  }
211
211
  function it(e, t, o) {
212
212
  var n, i;
213
- if (C.unmount && C.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || me(n, null, t)), (n = e.__c) != null) {
213
+ if (y.unmount && y.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || me(n, null, t)), (n = e.__c) != null) {
214
214
  if (n.componentWillUnmount) try {
215
215
  n.componentWillUnmount();
216
216
  } catch (r) {
217
- C.__e(r, t);
217
+ y.__e(r, t);
218
218
  }
219
219
  n.base = n.__P = null;
220
220
  }
@@ -226,7 +226,7 @@ function Et(e, t, o) {
226
226
  }
227
227
  function Mt(e, t, o) {
228
228
  var n, i, r, s;
229
- t == document && (t = document.documentElement), C.__ && C.__(e, t), i = (n = !1) ? null : t.__k, r = [], s = [], fe(t, e = t.__k = D(j, null, [e]), i || B, B, t.namespaceURI, i ? null : t.firstChild ? ne.call(t.childNodes) : null, r, i ? i.__e : t.firstChild, n, s), ot(r, e, s);
229
+ t == document && (t = document.documentElement), y.__ && y.__(e, t), i = (n = !1) ? null : t.__k, r = [], s = [], fe(t, e = t.__k = W(j, null, [e]), i || B, B, t.namespaceURI, i ? null : t.firstChild ? ne.call(t.childNodes) : null, r, i ? i.__e : t.firstChild, n, s), ot(r, e, s);
230
230
  }
231
231
  function rt(e) {
232
232
  function t(o) {
@@ -251,96 +251,96 @@ function rt(e) {
251
251
  return o.children(n);
252
252
  }).contextType = t, t;
253
253
  }
254
- ne = Ze.slice, C = { __e: function(e, t, o, n) {
254
+ ne = Ze.slice, y = { __e: function(e, t, o, n) {
255
255
  for (var i, r, s; t = t.__; ) if ((i = t.__c) && !i.__) try {
256
256
  if ((r = i.constructor) && r.getDerivedStateFromError != null && (i.setState(r.getDerivedStateFromError(e)), s = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, n || {}), s = i.__d), s) return i.__E = i;
257
- } catch (a) {
258
- e = a;
257
+ } catch (l) {
258
+ e = l;
259
259
  }
260
260
  throw e;
261
- } }, qe = 0, R.prototype.setState = function(e, t) {
261
+ } }, qe = 0, $.prototype.setState = function(e, t) {
262
262
  var o;
263
263
  o = this.__s != null && this.__s != this.state ? this.__s : this.__s = I({}, this.state), typeof e == "function" && (e = e(I({}, o), this.props)), e && I(o, e), e != null && this.__v && (t && this._sb.push(t), ue(this));
264
- }, R.prototype.forceUpdate = function(e) {
264
+ }, $.prototype.forceUpdate = function(e) {
265
265
  this.__v && (this.__e = !0, e && this.__h.push(e), ue(this));
266
- }, R.prototype.render = j, O = [], Xe = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ye = function(e, t) {
266
+ }, $.prototype.render = j, O = [], Xe = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ye = function(e, t) {
267
267
  return e.__v.__b - t.__v.__b;
268
- }, te.__r = 0, Je = /(PointerCapture)$|Capture$/i, de = 0, le = ke(!1), ce = ke(!0), Ke = 0;
268
+ }, te.__r = 0, Je = /(PointerCapture)$|Capture$/i, de = 0, ae = ke(!1), ce = ke(!0), Ke = 0;
269
269
  var It = 0;
270
- function f(e, t, o, n, i, r) {
270
+ function m(e, t, o, n, i, r) {
271
271
  t || (t = {});
272
- var s, a, l = t;
273
- if ("ref" in l) for (a in l = {}, t) a == "ref" ? s = t[a] : l[a] = t[a];
274
- var c = { type: e, props: l, key: o, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --It, __i: -1, __u: 0, __source: i, __self: r };
275
- if (typeof e == "function" && (s = e.defaultProps)) for (a in s) l[a] === void 0 && (l[a] = s[a]);
276
- return C.vnode && C.vnode(c), c;
272
+ var s, l, a = t;
273
+ if ("ref" in a) for (l in a = {}, t) l == "ref" ? s = t[l] : a[l] = t[l];
274
+ var c = { type: e, props: a, key: o, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --It, __i: -1, __u: 0, __source: i, __self: r };
275
+ if (typeof e == "function" && (s = e.defaultProps)) for (l in s) a[l] === void 0 && (a[l] = s[l]);
276
+ return y.vnode && y.vnode(c), c;
277
277
  }
278
- var G, w, re, Te, V = 0, st = [], b = C, ze = b.__b, Pe = b.__r, Se = b.diffed, Ne = b.__c, Le = b.unmount, xe = b.__;
278
+ var G, w, re, Te, V = 0, st = [], b = y, ze = b.__b, Pe = b.__r, Ne = b.diffed, Se = b.__c, Le = b.unmount, xe = b.__;
279
279
  function ie(e, t) {
280
280
  b.__h && b.__h(w, e, V || t), V = 0;
281
281
  var o = w.__H || (w.__H = { __: [], __h: [] });
282
282
  return e >= o.__.length && o.__.push({}), o.__[e];
283
283
  }
284
- function $(e) {
285
- return V = 1, $t(ct, e);
284
+ function R(e) {
285
+ return V = 1, Rt(ct, e);
286
286
  }
287
- function $t(e, t, o) {
287
+ function Rt(e, t, o) {
288
288
  var n = ie(G++, 2);
289
- if (n.t = e, !n.__c && (n.__ = [o ? o(t) : ct(void 0, t), function(a) {
290
- var l = n.__N ? n.__N[0] : n.__[0], c = n.t(l, a);
291
- l !== c && (n.__N = [c, n.__[1]], n.__c.setState({}));
289
+ if (n.t = e, !n.__c && (n.__ = [o ? o(t) : ct(void 0, t), function(l) {
290
+ var a = n.__N ? n.__N[0] : n.__[0], c = n.t(a, l);
291
+ a !== c && (n.__N = [c, n.__[1]], n.__c.setState({}));
292
292
  }], n.__c = w, !w.__f)) {
293
- var i = function(a, l, c) {
293
+ var i = function(l, a, c) {
294
294
  if (!n.__c.__H) return !0;
295
295
  var _ = n.__c.__H.__.filter(function(h) {
296
296
  return !!h.__c;
297
297
  });
298
298
  if (_.every(function(h) {
299
299
  return !h.__N;
300
- })) return !r || r.call(this, a, l, c);
301
- var u = n.__c.props !== a;
300
+ })) return !r || r.call(this, l, a, c);
301
+ var u = n.__c.props !== l;
302
302
  return _.forEach(function(h) {
303
303
  if (h.__N) {
304
304
  var d = h.__[0];
305
305
  h.__ = h.__N, h.__N = void 0, d !== h.__[0] && (u = !0);
306
306
  }
307
- }), r && r.call(this, a, l, c) || u;
307
+ }), r && r.call(this, l, a, c) || u;
308
308
  };
309
309
  w.__f = !0;
310
310
  var r = w.shouldComponentUpdate, s = w.componentWillUpdate;
311
- w.componentWillUpdate = function(a, l, c) {
311
+ w.componentWillUpdate = function(l, a, c) {
312
312
  if (this.__e) {
313
313
  var _ = r;
314
- r = void 0, i(a, l, c), r = _;
314
+ r = void 0, i(l, a, c), r = _;
315
315
  }
316
- s && s.call(this, a, l, c);
316
+ s && s.call(this, l, a, c);
317
317
  }, w.shouldComponentUpdate = i;
318
318
  }
319
319
  return n.__N || n.__;
320
320
  }
321
321
  function A(e, t) {
322
322
  var o = ie(G++, 3);
323
- !b.__s && lt(o.__H, t) && (o.__ = e, o.u = t, w.__H.__h.push(o));
323
+ !b.__s && at(o.__H, t) && (o.__ = e, o.u = t, w.__H.__h.push(o));
324
324
  }
325
- function W(e) {
325
+ function D(e) {
326
326
  return V = 5, pe(function() {
327
327
  return { current: e };
328
328
  }, []);
329
329
  }
330
330
  function pe(e, t) {
331
331
  var o = ie(G++, 7);
332
- return lt(o.__H, t) && (o.__ = e(), o.__H = t, o.__h = e), o.__;
332
+ return at(o.__H, t) && (o.__ = e(), o.__H = t, o.__h = e), o.__;
333
333
  }
334
334
  function Ae(e, t) {
335
335
  return V = 8, pe(function() {
336
336
  return e;
337
337
  }, t);
338
338
  }
339
- function at(e) {
339
+ function lt(e) {
340
340
  var t = w.context[e.__c], o = ie(G++, 9);
341
341
  return o.c = e, t ? (o.__ == null && (o.__ = !0, t.sub(w)), t.props.value) : e.__;
342
342
  }
343
- function Rt() {
343
+ function $t() {
344
344
  for (var e; e = st.shift(); ) if (e.__P && e.__H) try {
345
345
  e.__H.__h.forEach(Q), e.__H.__h.forEach(_e), e.__H.__h = [];
346
346
  } catch (t) {
@@ -358,9 +358,9 @@ b.__b = function(e) {
358
358
  o.__N && (o.__ = o.__N), o.u = o.__N = void 0;
359
359
  })) : (t.__h.forEach(Q), t.__h.forEach(_e), t.__h = [], G = 0)), re = w;
360
360
  }, b.diffed = function(e) {
361
- Se && Se(e);
361
+ Ne && Ne(e);
362
362
  var t = e.__c;
363
- t && t.__H && (t.__H.__h.length && (st.push(t) !== 1 && Te === b.requestAnimationFrame || ((Te = b.requestAnimationFrame) || Ft)(Rt)), t.__H.__.forEach(function(o) {
363
+ t && t.__H && (t.__H.__h.length && (st.push(t) !== 1 && Te === b.requestAnimationFrame || ((Te = b.requestAnimationFrame) || Ft)($t)), t.__H.__.forEach(function(o) {
364
364
  o.u && (o.__H = o.u), o.u = void 0;
365
365
  })), re = w = null;
366
366
  }, b.__c = function(e, t) {
@@ -374,7 +374,7 @@ b.__b = function(e) {
374
374
  i.__h && (i.__h = []);
375
375
  }), t = [], b.__e(n, o.__v);
376
376
  }
377
- }), Ne && Ne(e, t);
377
+ }), Se && Se(e, t);
378
378
  }, b.unmount = function(e) {
379
379
  Le && Le(e);
380
380
  var t, o = e.__c;
@@ -401,7 +401,7 @@ function _e(e) {
401
401
  var t = w;
402
402
  e.__c = e.__(), w = t;
403
403
  }
404
- function lt(e, t) {
404
+ function at(e, t) {
405
405
  return !e || e.length !== t.length || t.some(function(o, n) {
406
406
  return o !== e[n];
407
407
  });
@@ -448,7 +448,7 @@ const Ut = (e) => ({
448
448
  }
449
449
  }
450
450
  }), ut = rt(void 0), Ot = ({ children: e, config: t }) => {
451
- const o = W(t), n = Ut(t.lcPrefix + "score"), i = n.loadGameData(), [r, s] = $({
451
+ const o = D(t), n = Ut(t.lcPrefix + "score"), i = n.loadGameData(), [r, s] = R({
452
452
  currentLevel: 1,
453
453
  highestUnlockedLevel: 1,
454
454
  currentTier: 1,
@@ -479,9 +479,9 @@ const Ut = (e) => ({
479
479
  r.totalScore,
480
480
  r.currentLevel
481
481
  ]);
482
- const a = () => {
483
- n.resetGameData(), s((l) => ({
484
- ...l,
482
+ const l = () => {
483
+ n.resetGameData(), s((a) => ({
484
+ ...a,
485
485
  currentLevel: 1,
486
486
  highestUnlockedLevel: 1,
487
487
  currentTier: 1,
@@ -498,20 +498,20 @@ const Ut = (e) => ({
498
498
  showClue: !1
499
499
  }));
500
500
  };
501
- return /* @__PURE__ */ f(
501
+ return /* @__PURE__ */ m(
502
502
  ut.Provider,
503
503
  {
504
504
  value: {
505
505
  gameState: r,
506
506
  setGameState: s,
507
507
  config: o,
508
- resetGame: a
508
+ resetGame: l
509
509
  },
510
510
  children: e
511
511
  }
512
512
  );
513
513
  }, _t = () => {
514
- const e = at(ut);
514
+ const e = lt(ut);
515
515
  if (!e)
516
516
  throw new Error("useGameContext must be used within a GameProvider");
517
517
  return e;
@@ -532,7 +532,7 @@ function ge(e, t, o) {
532
532
  function Me(e) {
533
533
  return +e.replace(/px/, "");
534
534
  }
535
- function jt(e) {
535
+ function Wt(e) {
536
536
  var t = window.devicePixelRatio, o = getComputedStyle(e), n = Me(o.getPropertyValue("width")), i = Me(o.getPropertyValue("height"));
537
537
  e.setAttribute("width", (n * t).toString()), e.setAttribute("height", (i * t).toString());
538
538
  }
@@ -543,22 +543,22 @@ function x(e, t) {
543
543
  function Ie(e) {
544
544
  return e[x(0, e.length)];
545
545
  }
546
- var Ht = 125e-5, Gt = 5e-4, Wt = 9e-4, Bt = 1e-5, Vt = 6, qt = 80, Xt = 0.9, Yt = 1.7, Jt = 0.2, Kt = 0.6, Zt = 0.03, Qt = 0.07, eo = 15, to = 82, oo = 100, no = 250, io = 40, ro = ["#fcf403", "#62fc03", "#f4fc03", "#03e7fc", "#03fca5", "#a503fc", "#fc03ad", "#fc03c2"];
547
- function $e(e) {
546
+ var jt = 125e-5, Ht = 5e-4, Gt = 9e-4, Bt = 1e-5, Vt = 6, qt = 80, Xt = 0.9, Yt = 1.7, Jt = 0.2, Kt = 0.6, Zt = 0.03, Qt = 0.07, eo = 15, to = 82, oo = 100, no = 250, io = 40, ro = ["#fcf403", "#62fc03", "#f4fc03", "#03e7fc", "#03fca5", "#a503fc", "#fc03ad", "#fc03c2"];
547
+ function Re(e) {
548
548
  var t = 1920;
549
549
  return Math.log(e) / Math.log(t);
550
550
  }
551
- var Re = /* @__PURE__ */ function() {
551
+ var $e = /* @__PURE__ */ function() {
552
552
  function e(t) {
553
553
  ve(this, e);
554
- var o = t.initialPosition, n = t.direction, i = t.confettiRadius, r = t.confettiColors, s = t.emojis, a = t.emojiSize, l = t.canvasWidth, c = x(Xt, Yt, 3), _ = c * $e(l);
554
+ var o = t.initialPosition, n = t.direction, i = t.confettiRadius, r = t.confettiColors, s = t.emojis, l = t.emojiSize, a = t.canvasWidth, c = x(Xt, Yt, 3), _ = c * Re(a);
555
555
  this.confettiSpeed = {
556
556
  x: _,
557
557
  y: _
558
- }, this.finalConfettiSpeedX = x(Jt, Kt, 3), this.rotationSpeed = s.length ? 0.01 : x(Zt, Qt, 3) * $e(l), this.dragForceCoefficient = x(Gt, Wt, 6), this.radius = {
558
+ }, this.finalConfettiSpeedX = x(Jt, Kt, 3), this.rotationSpeed = s.length ? 0.01 : x(Zt, Qt, 3) * Re(a), this.dragForceCoefficient = x(Ht, Gt, 6), this.radius = {
559
559
  x: i,
560
560
  y: i
561
- }, this.initialRadius = i, this.rotationAngle = n === "left" ? x(0, 0.2, 3) : x(-0.2, 0, 3), this.emojiSize = a, this.emojiRotationAngle = x(0, 2 * Math.PI), this.radiusYUpdateDirection = "down";
561
+ }, this.initialRadius = i, this.rotationAngle = n === "left" ? x(0, 0.2, 3) : x(-0.2, 0, 3), this.emojiSize = l, this.emojiRotationAngle = x(0, 2 * Math.PI), this.radiusYUpdateDirection = "down";
562
562
  var u = n === "left" ? x(to, eo) * Math.PI / 180 : x(-15, -82) * Math.PI / 180;
563
563
  this.absCos = Math.abs(Math.cos(u)), this.absSin = Math.abs(Math.sin(u));
564
564
  var h = x(-150, 0), d = {
@@ -570,18 +570,18 @@ var Re = /* @__PURE__ */ function() {
570
570
  return ge(e, [{
571
571
  key: "draw",
572
572
  value: function(o) {
573
- var n = this.currentPosition, i = this.radius, r = this.color, s = this.emoji, a = this.rotationAngle, l = this.emojiRotationAngle, c = this.emojiSize, _ = window.devicePixelRatio;
574
- r ? (o.fillStyle = r, o.beginPath(), o.ellipse(n.x * _, n.y * _, i.x * _, i.y * _, a, 0, 2 * Math.PI), o.fill()) : s && (o.font = "".concat(c, "px serif"), o.save(), o.translate(_ * n.x, _ * n.y), o.rotate(l), o.textAlign = "center", o.fillText(s, 0, 0), o.restore());
573
+ var n = this.currentPosition, i = this.radius, r = this.color, s = this.emoji, l = this.rotationAngle, a = this.emojiRotationAngle, c = this.emojiSize, _ = window.devicePixelRatio;
574
+ r ? (o.fillStyle = r, o.beginPath(), o.ellipse(n.x * _, n.y * _, i.x * _, i.y * _, l, 0, 2 * Math.PI), o.fill()) : s && (o.font = "".concat(c, "px serif"), o.save(), o.translate(_ * n.x, _ * n.y), o.rotate(a), o.textAlign = "center", o.fillText(s, 0, 0), o.restore());
575
575
  }
576
576
  }, {
577
577
  key: "updatePosition",
578
578
  value: function(o, n) {
579
- var i = this.confettiSpeed, r = this.dragForceCoefficient, s = this.finalConfettiSpeedX, a = this.radiusYUpdateDirection, l = this.rotationSpeed, c = this.createdAt, _ = this.direction, u = n - c;
580
- if (i.x > s && (this.confettiSpeed.x -= r * o), this.currentPosition.x += i.x * (_ === "left" ? -this.absCos : this.absCos) * o, this.currentPosition.y = this.initialPosition.y - i.y * this.absSin * u + Ht * Math.pow(u, 2) / 2, this.rotationSpeed -= this.emoji ? 1e-4 : Bt * o, this.rotationSpeed < 0 && (this.rotationSpeed = 0), this.emoji) {
579
+ var i = this.confettiSpeed, r = this.dragForceCoefficient, s = this.finalConfettiSpeedX, l = this.radiusYUpdateDirection, a = this.rotationSpeed, c = this.createdAt, _ = this.direction, u = n - c;
580
+ if (i.x > s && (this.confettiSpeed.x -= r * o), this.currentPosition.x += i.x * (_ === "left" ? -this.absCos : this.absCos) * o, this.currentPosition.y = this.initialPosition.y - i.y * this.absSin * u + jt * Math.pow(u, 2) / 2, this.rotationSpeed -= this.emoji ? 1e-4 : Bt * o, this.rotationSpeed < 0 && (this.rotationSpeed = 0), this.emoji) {
581
581
  this.emojiRotationAngle += this.rotationSpeed * o % (2 * Math.PI);
582
582
  return;
583
583
  }
584
- a === "down" ? (this.radius.y -= o * l, this.radius.y <= 0 && (this.radius.y = 0, this.radiusYUpdateDirection = "up")) : (this.radius.y += o * l, this.radius.y >= this.initialRadius && (this.radius.y = this.initialRadius, this.radiusYUpdateDirection = "down"));
584
+ l === "down" ? (this.radius.y -= o * a, this.radius.y <= 0 && (this.radius.y = 0, this.radiusYUpdateDirection = "up")) : (this.radius.y += o * a, this.radius.y >= this.initialRadius && (this.radius.y = this.initialRadius, this.radiusYUpdateDirection = "down"));
585
585
  }
586
586
  }, {
587
587
  key: "getIsVisibleOnCanvas",
@@ -594,17 +594,17 @@ function so() {
594
594
  var e = document.createElement("canvas");
595
595
  return e.style.position = "fixed", e.style.width = "100%", e.style.height = "100%", e.style.top = "0", e.style.left = "0", e.style.zIndex = "1000", e.style.pointerEvents = "none", document.body.appendChild(e), e;
596
596
  }
597
- function ao(e) {
598
- var t = e.confettiRadius, o = t === void 0 ? Vt : t, n = e.confettiNumber, i = n === void 0 ? e.confettiesNumber || (e.emojis ? io : no) : n, r = e.confettiColors, s = r === void 0 ? ro : r, a = e.emojis, l = a === void 0 ? e.emojies || [] : a, c = e.emojiSize, _ = c === void 0 ? qt : c;
597
+ function lo(e) {
598
+ var t = e.confettiRadius, o = t === void 0 ? Vt : t, n = e.confettiNumber, i = n === void 0 ? e.confettiesNumber || (e.emojis ? io : no) : n, r = e.confettiColors, s = r === void 0 ? ro : r, l = e.emojis, a = l === void 0 ? e.emojies || [] : l, c = e.emojiSize, _ = c === void 0 ? qt : c;
599
599
  return e.emojies && console.error("emojies argument is deprecated, please use emojis instead"), e.confettiesNumber && console.error("confettiesNumber argument is deprecated, please use confettiNumber instead"), {
600
600
  confettiRadius: o,
601
601
  confettiNumber: i,
602
602
  confettiColors: s,
603
- emojis: l,
603
+ emojis: a,
604
604
  emojiSize: _
605
605
  };
606
606
  }
607
- var lo = /* @__PURE__ */ function() {
607
+ var ao = /* @__PURE__ */ function() {
608
608
  function e(t) {
609
609
  var o = this;
610
610
  ve(this, e), this.canvasContext = t, this.shapes = [], this.promise = new Promise(function(n) {
@@ -631,9 +631,9 @@ var lo = /* @__PURE__ */ function() {
631
631
  }, {
632
632
  key: "processShapes",
633
633
  value: function(o, n, i) {
634
- var r = this, s = o.timeDelta, a = o.currentTime;
635
- this.shapes = this.shapes.filter(function(l) {
636
- return l.updatePosition(s, a), l.draw(r.canvasContext), i ? l.getIsVisibleOnCanvas(n) : !0;
634
+ var r = this, s = o.timeDelta, l = o.currentTime;
635
+ this.shapes = this.shapes.filter(function(a) {
636
+ return a.updatePosition(s, l), a.draw(r.canvasContext), i ? a.getIsVisibleOnCanvas(n) : !0;
637
637
  });
638
638
  }
639
639
  }]), e;
@@ -645,7 +645,7 @@ var lo = /* @__PURE__ */ function() {
645
645
  return ge(e, [{
646
646
  key: "loop",
647
647
  value: function() {
648
- this.requestAnimationFrameRequested = !1, jt(this.canvas);
648
+ this.requestAnimationFrameRequested = !1, Wt(this.canvas);
649
649
  var o = (/* @__PURE__ */ new Date()).getTime(), n = o - this.lastUpdated, i = this.canvas.offsetHeight, r = this.iterationIndex % 10 === 0;
650
650
  this.activeConfettiBatches = this.activeConfettiBatches.filter(function(s) {
651
651
  return s.processShapes({
@@ -662,35 +662,35 @@ var lo = /* @__PURE__ */ function() {
662
662
  }, {
663
663
  key: "addConfetti",
664
664
  value: function() {
665
- for (var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = ao(o), i = n.confettiRadius, r = n.confettiNumber, s = n.confettiColors, a = n.emojis, l = n.emojiSize, c = this.canvas.getBoundingClientRect(), _ = c.width, u = c.height, h = u * 5 / 7, d = {
665
+ for (var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = lo(o), i = n.confettiRadius, r = n.confettiNumber, s = n.confettiColors, l = n.emojis, a = n.emojiSize, c = this.canvas.getBoundingClientRect(), _ = c.width, u = c.height, h = u * 5 / 7, d = {
666
666
  x: 0,
667
667
  y: h
668
- }, m = {
668
+ }, f = {
669
669
  x: _,
670
670
  y: h
671
- }, v = new lo(this.canvasContext), y = 0; y < r / 2; y++) {
672
- var g = new Re({
671
+ }, g = new ao(this.canvasContext), v = 0; v < r / 2; v++) {
672
+ var C = new $e({
673
673
  initialPosition: d,
674
674
  direction: "right",
675
675
  confettiRadius: i,
676
676
  confettiColors: s,
677
677
  confettiNumber: r,
678
- emojis: a,
679
- emojiSize: l,
678
+ emojis: l,
679
+ emojiSize: a,
680
680
  canvasWidth: _
681
- }), p = new Re({
682
- initialPosition: m,
681
+ }), p = new $e({
682
+ initialPosition: f,
683
683
  direction: "left",
684
684
  confettiRadius: i,
685
685
  confettiColors: s,
686
686
  confettiNumber: r,
687
- emojis: a,
688
- emojiSize: l,
687
+ emojis: l,
688
+ emojiSize: a,
689
689
  canvasWidth: _
690
690
  });
691
- v.addShapes(g, p);
691
+ g.addShapes(C, p);
692
692
  }
693
- return this.activeConfettiBatches.push(v), this.queueAnimationFrameIfNeeded(), v.getBatchCompletePromise();
693
+ return this.activeConfettiBatches.push(g), this.queueAnimationFrameIfNeeded(), g.getBatchCompletePromise();
694
694
  }
695
695
  }, {
696
696
  key: "clearCanvas",
@@ -716,11 +716,11 @@ function Fe(e, t) {
716
716
  function Ue(e, t) {
717
717
  this.props = e, this.context = t;
718
718
  }
719
- (Ue.prototype = new R()).isPureReactComponent = !0, Ue.prototype.shouldComponentUpdate = function(e, t) {
719
+ (Ue.prototype = new $()).isPureReactComponent = !0, Ue.prototype.shouldComponentUpdate = function(e, t) {
720
720
  return Fe(this.props, e) || Fe(this.state, t);
721
721
  };
722
- var Oe = C.__b;
723
- C.__b = function(e) {
722
+ var Oe = y.__b;
723
+ y.__b = function(e) {
724
724
  e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Oe && Oe(e);
725
725
  };
726
726
  var uo = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
@@ -731,14 +731,14 @@ function ht(e) {
731
731
  }
732
732
  return t.$$typeof = uo, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
733
733
  }
734
- var _o = C.__e;
735
- C.__e = function(e, t, o, n) {
734
+ var _o = y.__e;
735
+ y.__e = function(e, t, o, n) {
736
736
  if (e.then) {
737
737
  for (var i, r = t; r = r.__; ) if ((i = r.__c) && i.__c) return t.__e == null && (t.__e = o.__e, t.__k = o.__k), i.__c(e, t);
738
738
  }
739
739
  _o(e, t, o, n);
740
740
  };
741
- var De = C.unmount;
741
+ var De = y.unmount;
742
742
  function ft(e, t, o) {
743
743
  return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(n) {
744
744
  typeof n.__c == "function" && n.__c();
@@ -761,21 +761,21 @@ function pt(e) {
761
761
  function K() {
762
762
  this.i = null, this.l = null;
763
763
  }
764
- C.unmount = function(e) {
764
+ y.unmount = function(e) {
765
765
  var t = e.__c;
766
766
  t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), De && De(e);
767
- }, (se.prototype = new R()).__c = function(e, t) {
767
+ }, (se.prototype = new $()).__c = function(e, t) {
768
768
  var o = t.__c, n = this;
769
769
  n.o == null && (n.o = []), n.o.push(o);
770
770
  var i = pt(n.__v), r = !1, s = function() {
771
- r || (r = !0, o.__R = null, i ? i(a) : a());
771
+ r || (r = !0, o.__R = null, i ? i(l) : l());
772
772
  };
773
773
  o.__R = s;
774
- var a = function() {
774
+ var l = function() {
775
775
  if (!--n.__u) {
776
776
  if (n.state.__a) {
777
- var l = n.state.__a;
778
- n.__v.__k[0] = mt(l, l.__c.__P, l.__c.__O);
777
+ var a = n.state.__a;
778
+ n.__v.__k[0] = mt(a, a.__c.__P, a.__c.__O);
779
779
  }
780
780
  var c;
781
781
  for (n.setState({ __a: n.__b = null }); c = n.o.pop(); ) c.forceUpdate();
@@ -792,21 +792,21 @@ C.unmount = function(e) {
792
792
  }
793
793
  this.__b = null;
794
794
  }
795
- var i = t.__a && D(j, null, e.fallback);
796
- return i && (i.__u &= -33), [D(j, null, t.__a ? null : e.children), i];
795
+ var i = t.__a && W(j, null, e.fallback);
796
+ return i && (i.__u &= -33), [W(j, null, t.__a ? null : e.children), i];
797
797
  };
798
- var je = function(e, t, o) {
798
+ var We = function(e, t, o) {
799
799
  if (++o[1] === o[0] && e.l.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.l.size)) for (o = e.i; o; ) {
800
800
  for (; o.length > 3; ) o.pop()();
801
801
  if (o[1] < o[0]) break;
802
802
  e.i = o = o[2];
803
803
  }
804
804
  };
805
- (K.prototype = new R()).__a = function(e) {
805
+ (K.prototype = new $()).__a = function(e) {
806
806
  var t = this, o = pt(t.__v), n = t.l.get(e);
807
807
  return n[0]++, function(i) {
808
808
  var r = function() {
809
- t.props.revealOrder ? (n.push(i), je(t, e, n)) : i();
809
+ t.props.revealOrder ? (n.push(i), We(t, e, n)) : i();
810
810
  };
811
811
  o ? o(r) : r();
812
812
  };
@@ -819,20 +819,20 @@ var je = function(e, t, o) {
819
819
  }, K.prototype.componentDidUpdate = K.prototype.componentDidMount = function() {
820
820
  var e = this;
821
821
  this.l.forEach(function(t, o) {
822
- je(e, o, t);
822
+ We(e, o, t);
823
823
  });
824
824
  };
825
825
  var ho = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, fo = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, mo = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, po = /[A-Z0-9]/g, vo = typeof document < "u", go = function(e) {
826
826
  return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
827
827
  };
828
- R.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
829
- Object.defineProperty(R.prototype, e, { configurable: !0, get: function() {
828
+ $.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
829
+ Object.defineProperty($.prototype, e, { configurable: !0, get: function() {
830
830
  return this["UNSAFE_" + e];
831
831
  }, set: function(t) {
832
832
  Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
833
833
  } });
834
834
  });
835
- var He = C.event;
835
+ var je = y.event;
836
836
  function Co() {
837
837
  }
838
838
  function yo() {
@@ -841,20 +841,20 @@ function yo() {
841
841
  function wo() {
842
842
  return this.defaultPrevented;
843
843
  }
844
- C.event = function(e) {
845
- return He && (e = He(e)), e.persist = Co, e.isPropagationStopped = yo, e.isDefaultPrevented = wo, e.nativeEvent = e;
844
+ y.event = function(e) {
845
+ return je && (e = je(e)), e.persist = Co, e.isPropagationStopped = yo, e.isDefaultPrevented = wo, e.nativeEvent = e;
846
846
  };
847
847
  var bo = { enumerable: !1, configurable: !0, get: function() {
848
848
  return this.class;
849
- } }, Ge = C.vnode;
850
- C.vnode = function(e) {
849
+ } }, He = y.vnode;
850
+ y.vnode = function(e) {
851
851
  typeof e.type == "string" && function(t) {
852
852
  var o = t.props, n = t.type, i = {}, r = n.indexOf("-") === -1;
853
853
  for (var s in o) {
854
- var a = o[s];
855
- if (!(s === "value" && "defaultValue" in o && a == null || vo && s === "children" && n === "noscript" || s === "class" || s === "className")) {
856
- var l = s.toLowerCase();
857
- s === "defaultValue" && "value" in o && o.value == null ? s = "value" : s === "download" && a === !0 ? a = "" : l === "translate" && a === "no" ? a = !1 : l[0] === "o" && l[1] === "n" ? l === "ondoubleclick" ? s = "ondblclick" : l !== "onchange" || n !== "input" && n !== "textarea" || go(o.type) ? l === "onfocus" ? s = "onfocusin" : l === "onblur" ? s = "onfocusout" : mo.test(s) && (s = l) : l = s = "oninput" : r && fo.test(s) ? s = s.replace(po, "-$&").toLowerCase() : a === null && (a = void 0), l === "oninput" && i[s = l] && (s = "oninputCapture"), i[s] = a;
854
+ var l = o[s];
855
+ if (!(s === "value" && "defaultValue" in o && l == null || vo && s === "children" && n === "noscript" || s === "class" || s === "className")) {
856
+ var a = s.toLowerCase();
857
+ s === "defaultValue" && "value" in o && o.value == null ? s = "value" : s === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? s = "ondblclick" : a !== "onchange" || n !== "input" && n !== "textarea" || go(o.type) ? a === "onfocus" ? s = "onfocusin" : a === "onblur" ? s = "onfocusout" : mo.test(s) && (s = a) : a = s = "oninput" : r && fo.test(s) ? s = s.replace(po, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[s = a] && (s = "oninputCapture"), i[s] = l;
858
858
  }
859
859
  }
860
860
  n == "select" && i.multiple && Array.isArray(i.value) && (i.value = oe(o.children).forEach(function(c) {
@@ -862,14 +862,14 @@ C.vnode = function(e) {
862
862
  })), n == "select" && i.defaultValue != null && (i.value = oe(o.children).forEach(function(c) {
863
863
  c.props.selected = i.multiple ? i.defaultValue.indexOf(c.props.value) != -1 : i.defaultValue == c.props.value;
864
864
  })), o.class && !o.className ? (i.class = o.class, Object.defineProperty(i, "className", bo)) : (o.className && !o.class || o.class && o.className) && (i.class = i.className = o.className), t.props = i;
865
- }(e), e.$$typeof = ho, Ge && Ge(e);
865
+ }(e), e.$$typeof = ho, He && He(e);
866
866
  };
867
- var We = C.__r;
868
- C.__r = function(e) {
869
- We && We(e), e.__c;
867
+ var Ge = y.__r;
868
+ y.__r = function(e) {
869
+ Ge && Ge(e), e.__c;
870
870
  };
871
- var Be = C.diffed;
872
- C.diffed = function(e) {
871
+ var Be = y.diffed;
872
+ y.diffed = function(e) {
873
873
  Be && Be(e);
874
874
  var t = e.props, o = e.__e;
875
875
  o != null && e.type === "textarea" && "value" in t && t.value !== o.value && (o.value = t.value == null ? "" : t.value);
@@ -913,21 +913,21 @@ const zo = ht(
913
913
  className: i = "",
914
914
  children: r,
915
915
  iconNode: s,
916
- ...a
917
- }, l) => D(
916
+ ...l
917
+ }, a) => W(
918
918
  "svg",
919
919
  {
920
- ref: l,
920
+ ref: a,
921
921
  ...To,
922
922
  width: t,
923
923
  height: t,
924
924
  stroke: e,
925
925
  strokeWidth: n ? Number(o) * 24 / Number(t) : o,
926
926
  className: vt("lucide", i),
927
- ...a
927
+ ...l
928
928
  },
929
929
  [
930
- ...s.map(([c, _]) => D(c, _)),
930
+ ...s.map(([c, _]) => W(c, _)),
931
931
  ...Array.isArray(r) ? r : [r]
932
932
  ]
933
933
  )
@@ -940,7 +940,7 @@ const zo = ht(
940
940
  */
941
941
  const Po = (e, t) => {
942
942
  const o = ht(
943
- ({ className: n, ...i }, r) => D(zo, {
943
+ ({ className: n, ...i }, r) => W(zo, {
944
944
  ref: r,
945
945
  iconNode: t,
946
946
  className: vt(`lucide-${ko(e)}`, n),
@@ -955,7 +955,7 @@ const Po = (e, t) => {
955
955
  * This source code is licensed under the ISC license.
956
956
  * See the LICENSE file in the root directory of this source tree.
957
957
  */
958
- const So = [
958
+ const No = [
959
959
  [
960
960
  "path",
961
961
  {
@@ -964,23 +964,23 @@ const So = [
964
964
  }
965
965
  ],
966
966
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
967
- ], No = Po("Settings", So), gt = rt(void 0), Lo = ({ children: e }) => {
968
- const [t, o] = $(null), [n, i] = $(!1), [r, s] = $(
967
+ ], So = Po("Settings", No), gt = rt(void 0), Lo = ({ children: e }) => {
968
+ const [t, o] = R(null), [n, i] = R(!1), [r, s] = R(
969
969
  "info"
970
- ), [a, l] = $(null), c = Ae(() => {
971
- i(!1), a && (clearTimeout(a), l(null));
972
- }, [a]), _ = Ae(
970
+ ), [l, a] = R(null), c = Ae(() => {
971
+ i(!1), l && (clearTimeout(l), a(null));
972
+ }, [l]), _ = Ae(
973
973
  (u, h = "info", d = 3e3) => {
974
974
  if (n && c(), o(u), s(h), i(!0), d > 0) {
975
- const m = setTimeout(() => {
975
+ const f = setTimeout(() => {
976
976
  i(!1);
977
977
  }, d);
978
- l(m);
978
+ a(f);
979
979
  }
980
980
  },
981
981
  [n, c]
982
982
  );
983
- return /* @__PURE__ */ f(
983
+ return /* @__PURE__ */ m(
984
984
  gt.Provider,
985
985
  {
986
986
  value: { message: t, visible: n, type: r, showToast: _, hideToast: c },
@@ -988,7 +988,7 @@ const So = [
988
988
  }
989
989
  );
990
990
  }, Ce = () => {
991
- const e = at(gt);
991
+ const e = lt(gt);
992
992
  if (!e)
993
993
  throw new Error("useToast must be used within a ToastProvider");
994
994
  return e;
@@ -999,7 +999,7 @@ const So = [
999
999
  highestUnlockedTier: n,
1000
1000
  onTierChange: i,
1001
1001
  disabled: r
1002
- }) => /* @__PURE__ */ f("div", { className: "tier-selector", children: /* @__PURE__ */ f(
1002
+ }) => /* @__PURE__ */ m("div", { className: "tier-selector", children: /* @__PURE__ */ m(
1003
1003
  "select",
1004
1004
  {
1005
1005
  value: o,
@@ -1008,7 +1008,7 @@ const So = [
1008
1008
  },
1009
1009
  disabled: r,
1010
1010
  className: "tier-dropdown",
1011
- children: Array.from({ length: t }, (s, a) => a + 1).map((s) => /* @__PURE__ */ f(
1011
+ children: Array.from({ length: t }, (s, l) => l + 1).map((s) => /* @__PURE__ */ m(
1012
1012
  "option",
1013
1013
  {
1014
1014
  value: s,
@@ -1031,31 +1031,31 @@ const So = [
1031
1031
  disabled: r
1032
1032
  }) => {
1033
1033
  const s = Ao(t);
1034
- return /* @__PURE__ */ f("div", { className: "level-selector", children: /* @__PURE__ */ f(
1034
+ return /* @__PURE__ */ m("div", { className: "level-selector", children: /* @__PURE__ */ m(
1035
1035
  "select",
1036
1036
  {
1037
1037
  value: o,
1038
- onChange: (a) => {
1039
- a.target && a.target.value && i(Number(a.target.value));
1038
+ onChange: (l) => {
1039
+ l.target && l.target.value && i(Number(l.target.value));
1040
1040
  },
1041
1041
  disabled: r,
1042
1042
  className: "level-dropdown",
1043
- children: s.map((a) => /* @__PURE__ */ f(
1043
+ children: s.map((l) => /* @__PURE__ */ m(
1044
1044
  "option",
1045
1045
  {
1046
- value: a,
1047
- disabled: a > n,
1046
+ value: l,
1047
+ disabled: l > n,
1048
1048
  children: [
1049
1049
  e.level,
1050
1050
  " ",
1051
- a
1051
+ l
1052
1052
  ]
1053
1053
  },
1054
- `level-${a}`
1054
+ `level-${l}`
1055
1055
  ))
1056
1056
  }
1057
1057
  ) });
1058
- }, ae = ({
1058
+ }, le = ({
1059
1059
  isOpen: e,
1060
1060
  title: t,
1061
1061
  message: o,
@@ -1063,11 +1063,11 @@ const So = [
1063
1063
  noConfirm: i = !1,
1064
1064
  noCancel: r = !1,
1065
1065
  confirmText: s = "OK",
1066
- cancelText: a = "Cancel",
1067
- onConfirm: l,
1066
+ cancelText: l = "Cancel",
1067
+ onConfirm: a,
1068
1068
  onCancel: c
1069
1069
  }) => {
1070
- const _ = W(null);
1070
+ const _ = D(null);
1071
1071
  return A(() => {
1072
1072
  const u = (h) => {
1073
1073
  h.key === "Escape" && c?.();
@@ -1075,16 +1075,16 @@ const So = [
1075
1075
  return e && document.addEventListener("keydown", u), () => {
1076
1076
  document.removeEventListener("keydown", u);
1077
1077
  };
1078
- }, [e, c]), /* @__PURE__ */ f(
1078
+ }, [e, c]), /* @__PURE__ */ m(
1079
1079
  "div",
1080
1080
  {
1081
1081
  className: `maze-dialog-overlay ${e ? "maze-dialog-visible" : ""}`,
1082
- children: /* @__PURE__ */ f("div", { className: "maze-dialog", ref: _, children: [
1083
- /* @__PURE__ */ f("div", { className: "maze-dialog-title", children: t }),
1084
- /* @__PURE__ */ f("div", { className: "maze-dialog-content", children: n || /* @__PURE__ */ f("div", { className: "maze-dialog-message", children: o }) }),
1085
- /* @__PURE__ */ f("div", { className: "maze-dialog-buttons", children: [
1086
- !r && /* @__PURE__ */ f("button", { className: "maze-dialog-cancel", onClick: c, children: a }),
1087
- !i && /* @__PURE__ */ f("button", { className: "maze-dialog-confirm", onClick: l, children: s })
1082
+ children: /* @__PURE__ */ m("div", { className: "maze-dialog", ref: _, children: [
1083
+ /* @__PURE__ */ m("div", { className: "maze-dialog-title", children: t }),
1084
+ /* @__PURE__ */ m("div", { className: "maze-dialog-content", children: n || /* @__PURE__ */ m("div", { className: "maze-dialog-message", children: o }) }),
1085
+ /* @__PURE__ */ m("div", { className: "maze-dialog-buttons", children: [
1086
+ !r && /* @__PURE__ */ m("button", { className: "maze-dialog-cancel", onClick: c, children: l }),
1087
+ !i && /* @__PURE__ */ m("button", { className: "maze-dialog-confirm", onClick: a, children: s })
1088
1088
  ] })
1089
1089
  ] })
1090
1090
  }
@@ -1268,6 +1268,7 @@ const ye = [
1268
1268
  renderConfig: {
1269
1269
  padding: 10,
1270
1270
  wallWidth: 4,
1271
+ minWallWidth: 1,
1271
1272
  wallColor: "#000000",
1272
1273
  exitColor: "#F44336",
1273
1274
  foodColor: "#4CAF50",
@@ -1279,7 +1280,7 @@ const ye = [
1279
1280
  levelConfig: ye
1280
1281
  // levelsPerTier: 12,
1281
1282
  }, Io = (e) => e === 1 ? 2 : e >= 2 && e <= 5 ? 3 : e >= 6 && e <= 11 ? 4 : e >= 12 && e <= 15 ? 5 : 6;
1282
- class $o {
1283
+ class Ro {
1283
1284
  // initially all walls exit
1284
1285
  constructor(t, o) {
1285
1286
  this.row = t, this.col = o;
@@ -1287,7 +1288,7 @@ class $o {
1287
1288
  visited = !1;
1288
1289
  walls = { top: !0, right: !0, bottom: !0, left: !0 };
1289
1290
  }
1290
- class Ro {
1291
+ class $o {
1291
1292
  rows;
1292
1293
  cols;
1293
1294
  grid;
@@ -1302,7 +1303,7 @@ class Ro {
1302
1303
  for (let o = 0; o < this.rows; o++) {
1303
1304
  t[o] = [];
1304
1305
  for (let n = 0; n < this.cols; n++)
1305
- t[o][n] = new $o(o, n);
1306
+ t[o][n] = new Ro(o, n);
1306
1307
  }
1307
1308
  return t;
1308
1309
  }
@@ -1323,8 +1324,8 @@ class Ro {
1323
1324
  // Left
1324
1325
  ];
1325
1326
  for (const r of i) {
1326
- const s = t + r.r, a = o + r.c;
1327
- this.isValid(s, a) && n.push({ row: s, col: a });
1327
+ const s = t + r.r, l = o + r.c;
1328
+ this.isValid(s, l) && n.push({ row: s, col: l });
1328
1329
  }
1329
1330
  return n;
1330
1331
  }
@@ -1351,7 +1352,7 @@ class Ro {
1351
1352
  class Fo {
1352
1353
  maze;
1353
1354
  constructor(t, o, n, i, r = { row: 0, col: 0 }, s = { row: t - 1, col: o - 1 }) {
1354
- switch (this.maze = new Ro(t, o, i), n) {
1355
+ switch (this.maze = new $o(t, o, i), n) {
1355
1356
  case "backtracking":
1356
1357
  this.runBacktracking();
1357
1358
  break;
@@ -1375,10 +1376,10 @@ class Fo {
1375
1376
  let i = { row: o, col: n };
1376
1377
  for (this.maze.grid[o][n].visited = !0, t.push(i); t.length > 0; ) {
1377
1378
  i = t[t.length - 1];
1378
- const { row: r, col: s } = i, a = this.maze.getUnvisitedNeighbors(r, s);
1379
- if (a.length > 0) {
1380
- const l = this.randomPick(a), { row: c, col: _ } = l;
1381
- this.maze.removeWall(r, s, c, _), this.maze.grid[c][_].visited = !0, t.push(l);
1379
+ const { row: r, col: s } = i, l = this.maze.getUnvisitedNeighbors(r, s);
1380
+ if (l.length > 0) {
1381
+ const a = this.randomPick(l), { row: c, col: _ } = a;
1382
+ this.maze.removeWall(r, s, c, _), this.maze.grid[c][_].visited = !0, t.push(a);
1382
1383
  } else
1383
1384
  t.pop();
1384
1385
  }
@@ -1386,17 +1387,17 @@ class Fo {
1386
1387
  // --- Prim's Algorithm Implementation ---
1387
1388
  runPrims() {
1388
1389
  const t = [], o = (r, s) => {
1389
- const a = this.maze.getNeighbors(r, s);
1390
- for (const l of a)
1391
- !this.maze.grid[l.row][l.col].visited && !t.some(
1392
- (c) => c.row === l.row && c.col === l.col
1393
- ) && t.push(l);
1390
+ const l = this.maze.getNeighbors(r, s);
1391
+ for (const a of l)
1392
+ !this.maze.grid[a.row][a.col].visited && !t.some(
1393
+ (c) => c.row === a.row && c.col === a.col
1394
+ ) && t.push(a);
1394
1395
  }, n = this.randomNumber(this.maze.rows), i = this.randomNumber(this.maze.cols);
1395
1396
  for (this.maze.grid[n][i].visited = !0, o(n, i); t.length > 0; ) {
1396
- const r = this.randomNumber(t.length), s = t[r], { row: a, col: l } = s, c = this.maze.getVisitedNeighbors(a, l);
1397
+ const r = this.randomNumber(t.length), s = t[r], { row: l, col: a } = s, c = this.maze.getVisitedNeighbors(l, a);
1397
1398
  if (c.length > 0) {
1398
1399
  const _ = this.randomPick(c);
1399
- this.maze.removeWall(a, l, _.row, _.col), this.maze.grid[a][l].visited = !0, o(a, l);
1400
+ this.maze.removeWall(l, a, _.row, _.col), this.maze.grid[l][a].visited = !0, o(l, a);
1400
1401
  }
1401
1402
  t.splice(r, 1);
1402
1403
  }
@@ -1425,21 +1426,21 @@ const Oo = (e, t, o) => {
1425
1426
  const o = e - 1, n = t[o];
1426
1427
  if (!n)
1427
1428
  return console.error(`Cannot find Level ${e}'s config.`), null;
1428
- const i = n.size, r = i, s = i, a = n.seed, l = n.method, c = n.entry || { row: 0, col: 0 }, _ = n.exit || {
1429
+ const i = n.size, r = i, s = i, l = n.seed, a = n.method, c = n.entry || { row: 0, col: 0 }, _ = n.exit || {
1429
1430
  row: r - 1,
1430
1431
  col: s - 1
1431
- }, u = Uo(r, s, l, a, c, _), h = Io(e), d = [];
1432
- for (let m = 0; m < h; m++) {
1433
- let v;
1432
+ }, u = Uo(r, s, a, l, c, _), h = Io(e), d = [];
1433
+ for (let f = 0; f < h; f++) {
1434
+ let g;
1434
1435
  do
1435
- v = {
1436
+ g = {
1436
1437
  row: Math.floor(u.random() * r),
1437
1438
  col: Math.floor(u.random() * s)
1438
1439
  };
1439
- while (v.row === c.row && v.col === c.col || v.row === _.row && v.col === _.col || !Oo(u, v.row, v.col) || d.some(
1440
- (y) => y.row === v.row && y.col === v.col
1440
+ while (g.row === c.row && g.col === c.col || g.row === _.row && g.col === _.col || !Oo(u, g.row, g.col) || d.some(
1441
+ (v) => v.row === g.row && v.col === g.col
1441
1442
  ));
1442
- d.push(v);
1443
+ d.push(g);
1443
1444
  }
1444
1445
  return {
1445
1446
  maze: u,
@@ -1469,52 +1470,52 @@ const Oo = (e, t, o) => {
1469
1470
  }));
1470
1471
  }
1471
1472
  }), wt = (e) => pe(() => {
1472
- const t = e.map((a) => a.length), o = t.reduce((a, l) => a + l, 0), n = e.length, i = (a) => {
1473
- if (a < 1 || a > o) return 0;
1474
- let l = 0;
1473
+ const t = e.map((l) => l.length), o = t.reduce((l, a) => l + a, 0), n = e.length, i = (l) => {
1474
+ if (l < 1 || l > o) return 0;
1475
+ let a = 0;
1475
1476
  for (let c = 0; c < t.length; c++)
1476
- if (l += t[c], a <= l) return c + 1;
1477
+ if (a += t[c], l <= a) return c + 1;
1477
1478
  return 0;
1478
- }, r = (a) => a < 1 || a > n ? 0 : t.slice(0, a - 1).reduce((l, c) => l + c, 0) + 1, s = {
1479
+ }, r = (l) => l < 1 || l > n ? 0 : t.slice(0, l - 1).reduce((a, c) => a + c, 0) + 1, s = {
1479
1480
  getTotalLevels: () => o,
1480
1481
  getTotalTiers: () => n,
1481
- getTierLevelsRange: (a) => {
1482
- if (a < 1 || a > n) return [0, 0];
1483
- const l = r(a), c = l + t[a - 1] - 1;
1484
- return [l, c];
1482
+ getTierLevelsRange: (l) => {
1483
+ if (l < 1 || l > n) return [0, 0];
1484
+ const a = r(l), c = a + t[l - 1] - 1;
1485
+ return [a, c];
1485
1486
  },
1486
1487
  getTierByLevel: i,
1487
1488
  getFirstLevelOfTier: r,
1488
- getLevelConfig: (a) => {
1489
- if (a < 1 || a > o) return null;
1490
- const l = i(a), c = r(l), _ = a - c;
1491
- return e[l - 1][_];
1489
+ getLevelConfig: (l) => {
1490
+ if (l < 1 || l > o) return null;
1491
+ const a = i(l), c = r(a), _ = l - c;
1492
+ return e[a - 1][_];
1492
1493
  },
1493
- getTierConfig: (a) => a < 1 || a > n ? null : e[a - 1],
1494
- isLevelUnlocked: (a, l) => a <= l,
1495
- isTierUnlocked: (a, l) => a <= l,
1496
- getNextLevelInfo: (a) => {
1497
- if (a >= o) return null;
1498
- const l = a + 1, c = i(a), _ = i(l);
1494
+ getTierConfig: (l) => l < 1 || l > n ? null : e[l - 1],
1495
+ isLevelUnlocked: (l, a) => l <= a,
1496
+ isTierUnlocked: (l, a) => l <= a,
1497
+ getNextLevelInfo: (l) => {
1498
+ if (l >= o) return null;
1499
+ const a = l + 1, c = i(l), _ = i(a);
1499
1500
  return {
1500
- nextLevel: l,
1501
+ nextLevel: a,
1501
1502
  nextTier: _,
1502
1503
  isTierChange: _ > c
1503
1504
  };
1504
1505
  },
1505
- getCurrentTierProgress: (a, l) => {
1506
- const [c, _] = s.getTierLevelsRange(l), u = a - c + 1, h = _ - c + 1;
1506
+ getCurrentTierProgress: (l, a) => {
1507
+ const [c, _] = s.getTierLevelsRange(a), u = l - c + 1, h = _ - c + 1;
1507
1508
  return { current: u, total: h };
1508
1509
  },
1509
- isLastLevelInTier: (a) => {
1510
- const l = i(a), [, c] = s.getTierLevelsRange(l);
1511
- return a === c;
1510
+ isLastLevelInTier: (l) => {
1511
+ const a = i(l), [, c] = s.getTierLevelsRange(a);
1512
+ return l === c;
1512
1513
  },
1513
- getPreviousLevelInfo: (a) => {
1514
- if (a <= 1) return null;
1515
- const l = a - 1, c = i(a), _ = i(l);
1514
+ getPreviousLevelInfo: (l) => {
1515
+ if (l <= 1) return null;
1516
+ const a = l - 1, c = i(l), _ = i(a);
1516
1517
  return {
1517
- prevLevel: l,
1518
+ prevLevel: a,
1518
1519
  prevTier: _,
1519
1520
  isTierChange: _ < c
1520
1521
  };
@@ -1522,7 +1523,7 @@ const Oo = (e, t, o) => {
1522
1523
  };
1523
1524
  return s;
1524
1525
  }, [e]), Do = () => {
1525
- const { gameState: e, setGameState: t, resetGame: o, config: n } = _t(), i = n.current.i18n, r = n.current.levelConfig, s = wt(r), { showToast: a } = Ce(), { currentLevel: l, totalScore: c, levelScores: _, currentScore: u, showClue: h } = e, d = _[l] || 0, m = s.getTotalTiers(), [v, y] = $(!1), [g, p] = $(!1), [T, k] = $(!1), [E, P] = $(s.getTierLevelsRange(1)), { generateCurrentLevelMaze: F } = yt({
1526
+ const { gameState: e, setGameState: t, resetGame: o, config: n } = _t(), i = n.current.i18n, r = n.current.levelConfig, s = wt(r), { showToast: l } = Ce(), { currentLevel: a, totalScore: c, levelScores: _, currentScore: u, showClue: h } = e, d = _[a] || 0, f = s.getTotalTiers(), [g, v] = R(!1), [C, p] = R(!1), [T, k] = R(!1), [E, P] = R(s.getTierLevelsRange(1)), { generateCurrentLevelMaze: F } = yt({
1526
1527
  gameState: e,
1527
1528
  setGameState: t,
1528
1529
  config: n
@@ -1537,25 +1538,25 @@ const Oo = (e, t, o) => {
1537
1538
  s.isLevelUnlocked(
1538
1539
  Y,
1539
1540
  e.highestUnlockedLevel
1540
- ) && (t((St) => ({ ...St, currentTier: L })), S(Y));
1541
- }, S = (L) => {
1541
+ ) && (t((Nt) => ({ ...Nt, currentTier: L })), N(Y));
1542
+ }, N = (L) => {
1542
1543
  s.isLevelUnlocked(L, e.highestUnlockedLevel) && (t((Y) => ({
1543
1544
  ...Y,
1544
1545
  currentLevel: L
1545
- })), F(), a(
1546
+ })), F(), l(
1546
1547
  i.levelGoToast.replace("%LEVEL%", L.toString()),
1547
1548
  "success"
1548
1549
  ));
1549
- }, N = () => {
1550
- y(!0);
1550
+ }, S = () => {
1551
+ v(!0);
1551
1552
  }, z = () => {
1552
- y(!1);
1553
+ v(!1);
1553
1554
  }, U = () => {
1554
1555
  k(!0);
1555
1556
  }, bt = () => {
1556
1557
  k(!1);
1557
1558
  }, kt = () => {
1558
- t((L) => (a(L.showClue ? i.cluePathDisabled : i.cluePathEnabled), {
1559
+ t((L) => (l(L.showClue ? i.cluePathDisabled : i.cluePathEnabled), {
1559
1560
  ...L,
1560
1561
  showClue: !L.showClue,
1561
1562
  currentScore: Math.floor(L.currentScore / 2)
@@ -1564,79 +1565,79 @@ const Oo = (e, t, o) => {
1564
1565
  }, Tt = () => {
1565
1566
  p(!0);
1566
1567
  }, zt = () => {
1567
- o(), p(!1), a(i.resetDoneToast);
1568
+ o(), p(!1), l(i.resetDoneToast);
1568
1569
  }, Pt = () => {
1569
1570
  p(!1);
1570
1571
  };
1571
- return /* @__PURE__ */ f("div", { class: "game-panel-container", children: [
1572
- /* @__PURE__ */ f("div", { className: "game-controls", children: [
1573
- /* @__PURE__ */ f("div", { className: "selectors-container", children: [
1574
- /* @__PURE__ */ f(
1572
+ return /* @__PURE__ */ m("div", { class: "game-panel-container", children: [
1573
+ /* @__PURE__ */ m("div", { className: "game-controls", children: [
1574
+ /* @__PURE__ */ m("div", { className: "selectors-container", children: [
1575
+ /* @__PURE__ */ m(
1575
1576
  xo,
1576
1577
  {
1577
1578
  i18n: i,
1578
- totalTiers: m,
1579
+ totalTiers: f,
1579
1580
  currentTier: e.currentTier,
1580
1581
  highestUnlockedTier: e.highestUnlockedTier,
1581
1582
  onTierChange: M,
1582
1583
  disabled: e.levelTransitioning
1583
1584
  }
1584
1585
  ),
1585
- /* @__PURE__ */ f(
1586
+ /* @__PURE__ */ m(
1586
1587
  Eo,
1587
1588
  {
1588
1589
  i18n: i,
1589
1590
  levelsRange: E,
1590
1591
  currentLevel: e.currentLevel,
1591
1592
  highestUnlockedLevel: e.highestUnlockedLevel,
1592
- onLevelChange: S,
1593
+ onLevelChange: N,
1593
1594
  disabled: e.levelTransitioning
1594
1595
  }
1595
1596
  )
1596
1597
  ] }),
1597
- /* @__PURE__ */ f("div", { className: "score-container", children: [
1598
- /* @__PURE__ */ f("div", { className: "score-box currentscore", children: [
1599
- /* @__PURE__ */ f("span", { className: "score-label", children: [
1598
+ /* @__PURE__ */ m("div", { className: "score-container", children: [
1599
+ /* @__PURE__ */ m("div", { className: "score-box currentscore", children: [
1600
+ /* @__PURE__ */ m("span", { className: "score-label", children: [
1600
1601
  i.levelScore,
1601
1602
  ":"
1602
1603
  ] }),
1603
- /* @__PURE__ */ f("span", { className: "score-data", children: u })
1604
+ /* @__PURE__ */ m("span", { className: "score-data", children: u })
1604
1605
  ] }),
1605
- /* @__PURE__ */ f("div", { className: "score-box bestscore", children: [
1606
- /* @__PURE__ */ f("span", { className: "score-label", children: [
1606
+ /* @__PURE__ */ m("div", { className: "score-box bestscore", children: [
1607
+ /* @__PURE__ */ m("span", { className: "score-label", children: [
1607
1608
  i.bestScore,
1608
1609
  ":"
1609
1610
  ] }),
1610
- /* @__PURE__ */ f("span", { className: "score-data", children: d })
1611
+ /* @__PURE__ */ m("span", { className: "score-data", children: d })
1611
1612
  ] }),
1612
- /* @__PURE__ */ f("div", { className: "score-box totalscore", children: [
1613
- /* @__PURE__ */ f("span", { className: "score-label", children: [
1613
+ /* @__PURE__ */ m("div", { className: "score-box totalscore", children: [
1614
+ /* @__PURE__ */ m("span", { className: "score-label", children: [
1614
1615
  i.total,
1615
1616
  ":"
1616
1617
  ] }),
1617
- /* @__PURE__ */ f("span", { className: "score-data", children: c })
1618
+ /* @__PURE__ */ m("span", { className: "score-data", children: c })
1618
1619
  ] })
1619
1620
  ] })
1620
1621
  ] }),
1621
- /* @__PURE__ */ f("div", { className: "game-settings", children: /* @__PURE__ */ f(
1622
- No,
1622
+ /* @__PURE__ */ m("div", { className: "game-settings", children: /* @__PURE__ */ m(
1623
+ So,
1623
1624
  {
1624
- onClick: N,
1625
+ onClick: S,
1625
1626
  className: "game-settings-icon"
1626
1627
  }
1627
1628
  ) }),
1628
- /* @__PURE__ */ f(
1629
- ae,
1629
+ /* @__PURE__ */ m(
1630
+ le,
1630
1631
  {
1631
- isOpen: v,
1632
+ isOpen: g,
1632
1633
  title: i.settings,
1633
1634
  noConfirm: !0,
1634
1635
  cancelText: i.close,
1635
1636
  onCancel: z,
1636
1637
  children: [
1637
- /* @__PURE__ */ f("div", { className: "settings-item-box", children: [
1638
- /* @__PURE__ */ f("div", {}),
1639
- /* @__PURE__ */ f(
1638
+ /* @__PURE__ */ m("div", { className: "settings-item-box", children: [
1639
+ /* @__PURE__ */ m("div", {}),
1640
+ /* @__PURE__ */ m(
1640
1641
  "button",
1641
1642
  {
1642
1643
  className: `settings-clue-button ${h ? "clue-on" : "clue-off"}`,
@@ -1646,10 +1647,10 @@ const Oo = (e, t, o) => {
1646
1647
  children: h ? i.clueOn : i.clueOff
1647
1648
  }
1648
1649
  ),
1649
- /* @__PURE__ */ f("div", { className: "settings-item-tip", children: i.clueTip })
1650
+ /* @__PURE__ */ m("div", { className: "settings-item-tip", children: i.clueTip })
1650
1651
  ] }),
1651
- /* @__PURE__ */ f("div", { className: "settings-item-box", children: [
1652
- /* @__PURE__ */ f(
1652
+ /* @__PURE__ */ m("div", { className: "settings-item-box", children: [
1653
+ /* @__PURE__ */ m(
1653
1654
  "button",
1654
1655
  {
1655
1656
  className: "settings-reset-button",
@@ -1658,15 +1659,15 @@ const Oo = (e, t, o) => {
1658
1659
  children: i.reset
1659
1660
  }
1660
1661
  ),
1661
- /* @__PURE__ */ f("div", { className: "settings-item-tip", children: i.resetTip })
1662
+ /* @__PURE__ */ m("div", { className: "settings-item-tip", children: i.resetTip })
1662
1663
  ] })
1663
1664
  ]
1664
1665
  }
1665
1666
  ),
1666
- /* @__PURE__ */ f(
1667
- ae,
1667
+ /* @__PURE__ */ m(
1668
+ le,
1668
1669
  {
1669
- isOpen: g,
1670
+ isOpen: C,
1670
1671
  title: i.confirmReset,
1671
1672
  message: i.confirmResetMessage,
1672
1673
  confirmText: i.reset,
@@ -1675,8 +1676,8 @@ const Oo = (e, t, o) => {
1675
1676
  onCancel: Pt
1676
1677
  }
1677
1678
  ),
1678
- /* @__PURE__ */ f(
1679
- ae,
1679
+ /* @__PURE__ */ m(
1680
+ le,
1680
1681
  {
1681
1682
  isOpen: T,
1682
1683
  title: i.confirmClue,
@@ -1688,7 +1689,7 @@ const Oo = (e, t, o) => {
1688
1689
  }
1689
1690
  )
1690
1691
  ] });
1691
- }, jo = ({
1692
+ }, Wo = ({
1692
1693
  message: e,
1693
1694
  visible: t,
1694
1695
  duration: o = 2e3,
@@ -1702,15 +1703,15 @@ const Oo = (e, t, o) => {
1702
1703
  }, o)), () => {
1703
1704
  s && clearTimeout(s);
1704
1705
  };
1705
- }, [t, o, n]), /* @__PURE__ */ f("div", { className: `toast-container position-${i}`, children: /* @__PURE__ */ f("div", { className: `toast-message type-${r} ${t ? "toast-visible" : ""}`, children: e }) })) : null, Ho = (e, t, o) => {
1706
+ }, [t, o, n]), /* @__PURE__ */ m("div", { className: `toast-container position-${i}`, children: /* @__PURE__ */ m("div", { className: `toast-message type-${r} ${t ? "toast-visible" : ""}`, children: e }) })) : null, jo = (e, t, o) => {
1706
1707
  A(() => {
1707
1708
  const n = () => {
1708
1709
  const i = e.current;
1709
1710
  if (!i) return;
1710
1711
  const r = i.parentElement;
1711
1712
  if (!r) return;
1712
- const s = r.clientWidth, a = window.devicePixelRatio || 1;
1713
- i.style.width = `${s}px`, i.style.height = `${s}px`, i.width = s * a, i.height = s * a, t(e, o.current);
1713
+ const s = r.clientWidth, l = window.devicePixelRatio || 1;
1714
+ i.style.width = `${s}px`, i.style.height = `${s}px`, i.width = s * l, i.height = s * l, t(e, o.current);
1714
1715
  };
1715
1716
  return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
1716
1717
  }, [e]);
@@ -1719,7 +1720,7 @@ const Oo = (e, t, o) => {
1719
1720
  ArrowDown: [1, 0],
1720
1721
  ArrowLeft: [0, -1],
1721
1722
  ArrowRight: [0, 1]
1722
- }, Go = ({
1723
+ }, Ho = ({
1723
1724
  containerRef: e,
1724
1725
  gameState: t,
1725
1726
  setGameState: o,
@@ -1727,56 +1728,56 @@ const Oo = (e, t, o) => {
1727
1728
  onFoodNotAllCollected: i
1728
1729
  }) => {
1729
1730
  A(() => {
1730
- const r = (l) => {
1731
+ const r = (a) => {
1731
1732
  if (!t.isGameActive || !t.maze) return;
1732
- const [c, _] = Ve[l], { row: u, col: h } = t.playerPosition, d = u + c, m = h + _;
1733
- if (!t.maze.isValid(d, m)) return;
1734
- const v = t.maze.grid[u][h];
1735
- if (c === -1 && v.walls.top || c === 1 && v.walls.bottom || _ === -1 && v.walls.left || _ === 1 && v.walls.right)
1733
+ const [c, _] = Ve[a], { row: u, col: h } = t.playerPosition, d = u + c, f = h + _;
1734
+ if (!t.maze.isValid(d, f)) return;
1735
+ const g = t.maze.grid[u][h];
1736
+ if (c === -1 && g.walls.top || c === 1 && g.walls.bottom || _ === -1 && g.walls.left || _ === 1 && g.walls.right)
1736
1737
  return;
1737
- const y = { row: d, col: m }, g = `${d},${m}`;
1738
+ const v = { row: d, col: f }, C = `${d},${f}`;
1738
1739
  o((p) => {
1739
1740
  const T = p.foodPositions.some(
1740
- (N) => N.row === d && N.col === m
1741
+ (S) => S.row === d && S.col === f
1741
1742
  );
1742
1743
  T && n();
1743
1744
  const k = Math.max(
1744
1745
  0,
1745
1746
  p.currentScore - 1
1746
- ), E = `${u},${h}-${d},${m}`, P = d === p.exitPosition.row && m === p.exitPosition.col, F = T ? p.foodCollected + 1 : p.foodCollected, M = F === p.totalFoodCount, S = P && M;
1747
+ ), E = `${u},${h}-${d},${f}`, P = d === p.exitPosition.row && f === p.exitPosition.col, F = T ? p.foodCollected + 1 : p.foodCollected, M = F === p.totalFoodCount, N = P && M;
1747
1748
  return P && !M && i(), {
1748
1749
  ...p,
1749
- playerPosition: y,
1750
- playerPath: [...p.playerPath, y],
1750
+ playerPosition: v,
1751
+ playerPath: [...p.playerPath, v],
1751
1752
  foodPositions: p.foodPositions.filter(
1752
- (N) => !(N.row === d && N.col === m)
1753
+ (S) => !(S.row === d && S.col === f)
1753
1754
  ),
1754
1755
  foodCollected: F,
1755
1756
  currentScore: k,
1756
1757
  visitCounts: {
1757
1758
  ...p.visitCounts,
1758
1759
  [E]: (p.visitCounts[E] || 0) + 1,
1759
- [g]: (p.visitCounts[g] || 0) + 1
1760
+ [C]: (p.visitCounts[C] || 0) + 1
1760
1761
  },
1761
1762
  moveCount: p.moveCount + 1,
1762
1763
  playerAtExit: P,
1763
- isGameActive: !S,
1764
- levelTransitioning: S
1764
+ isGameActive: !N,
1765
+ levelTransitioning: N
1765
1766
  };
1766
1767
  });
1767
- }, s = (l) => {
1768
+ }, s = (a) => {
1768
1769
  if (!t.isGameActive || !t.maze) return;
1769
- const c = l.key;
1770
- c in Ve && (l.preventDefault(), r(c));
1771
- }, a = (l) => {
1772
- if (l.preventDefault(), !t.isGameActive || !t.maze) return;
1773
- const c = l.touches[0], _ = document.elementFromPoint(c.clientX, c.clientY);
1770
+ const c = a.key;
1771
+ c in Ve && (a.preventDefault(), r(c));
1772
+ }, l = (a) => {
1773
+ if (a.preventDefault(), !t.isGameActive || !t.maze) return;
1774
+ const c = a.touches[0], _ = document.elementFromPoint(c.clientX, c.clientY);
1774
1775
  _ && (_.classList.contains("maze-up") ? r("ArrowUp") : _.classList.contains("maze-down") ? r("ArrowDown") : _.classList.contains("maze-left") ? r("ArrowLeft") : _.classList.contains("maze-right") && r("ArrowRight"));
1775
1776
  };
1776
- return window.addEventListener("keydown", s), e.current?.addEventListener("touchstart", a, {
1777
+ return window.addEventListener("keydown", s), e.current?.addEventListener("touchstart", l, {
1777
1778
  passive: !1
1778
1779
  }), () => {
1779
- window.removeEventListener("keydown", s), e.current?.removeEventListener("touchstart", a);
1780
+ window.removeEventListener("keydown", s), e.current?.removeEventListener("touchstart", l);
1780
1781
  };
1781
1782
  }, [
1782
1783
  t.isGameActive,
@@ -1784,7 +1785,7 @@ const Oo = (e, t, o) => {
1784
1785
  t.playerPosition,
1785
1786
  t.exitPosition
1786
1787
  ]);
1787
- }, Wo = ({
1788
+ }, Go = ({
1788
1789
  gameState: e,
1789
1790
  setGameState: t,
1790
1791
  config: o,
@@ -1794,36 +1795,36 @@ const Oo = (e, t, o) => {
1794
1795
  A(() => {
1795
1796
  if (e.levelTransitioning) {
1796
1797
  n();
1797
- const a = setTimeout(() => {
1798
+ const l = setTimeout(() => {
1798
1799
  s(
1799
1800
  e.currentScore,
1800
1801
  o.current.levelConfig
1801
1802
  );
1802
1803
  }, 1e3);
1803
- return () => clearTimeout(a);
1804
+ return () => clearTimeout(l);
1804
1805
  }
1805
1806
  }, [e.levelTransitioning]);
1806
- const r = wt(o.current.levelConfig), s = (a, l) => {
1807
+ const r = wt(o.current.levelConfig), s = (l, a) => {
1807
1808
  const c = r.getNextLevelInfo(
1808
1809
  e.currentLevel
1809
1810
  );
1810
1811
  if (!c) return;
1811
- const { nextLevel: _, nextTier: u, isTierChange: h } = c, d = Ct(_, l.flat());
1812
- d && t((m) => {
1812
+ const { nextLevel: _, nextTier: u, isTierChange: h } = c, d = Ct(_, a.flat());
1813
+ d && t((f) => {
1813
1814
  h && i(u);
1814
- const v = { ...m.levelScores };
1815
- return v[m.currentLevel] = Math.max(
1816
- a,
1817
- v[m.currentLevel] || 0
1815
+ const g = { ...f.levelScores };
1816
+ return g[f.currentLevel] = Math.max(
1817
+ l,
1818
+ g[f.currentLevel] || 0
1818
1819
  ), {
1819
- ...m,
1820
+ ...f,
1820
1821
  ...d,
1821
1822
  currentLevel: _,
1822
1823
  currentTier: u,
1823
- highestUnlockedLevel: Math.max(m.highestUnlockedLevel, _),
1824
- highestUnlockedTier: Math.max(m.highestUnlockedTier, u),
1825
- levelScores: v,
1826
- totalScore: Object.values(v).reduce((y, g) => y + g, 0),
1824
+ highestUnlockedLevel: Math.max(f.highestUnlockedLevel, _),
1825
+ highestUnlockedTier: Math.max(f.highestUnlockedTier, u),
1826
+ levelScores: g,
1827
+ totalScore: Object.values(g).reduce((v, C) => v + C, 0),
1827
1828
  showClue: !1,
1828
1829
  // reset to false on new level
1829
1830
  isGameActive: !0,
@@ -1840,45 +1841,45 @@ function Bo(e, t) {
1840
1841
  t.playerColor = e.playerAtExit ? t.playerAtExitColor : t.playerColor;
1841
1842
  const {
1842
1843
  padding: s,
1843
- wallWidth: a,
1844
- wallColor: l,
1844
+ wallWidth: l,
1845
+ wallColor: a,
1845
1846
  playerColor: c,
1846
1847
  exitColor: _,
1847
1848
  foodColor: u,
1848
1849
  clueColor: h,
1849
1850
  backgroundColor: d
1850
- } = t, m = r.cols, v = r.rows, y = (n - s * 2) / m, g = (i - s * 2) / v;
1851
+ } = t, f = r.cols, g = r.rows, v = (n - s * 2) / f, C = (i - s * 2) / g;
1851
1852
  o.clearRect(0, 0, n, i), o.save(), o.fillStyle = d, o.fillRect(0, 0, n, i), o.restore(), e.showClue && e.playerPath && e.playerPath.length > 0 && Ko(e, {
1852
- cellWidth: y,
1853
- cellHeight: g,
1853
+ cellWidth: v,
1854
+ cellHeight: C,
1854
1855
  padding: s,
1855
1856
  clueColor: h
1856
1857
  }), Vo(e, {
1857
- cellWidth: y,
1858
- cellHeight: g,
1858
+ cellWidth: v,
1859
+ cellHeight: C,
1859
1860
  padding: s,
1860
- wallColor: l,
1861
- wallWidth: a
1861
+ wallColor: a,
1862
+ wallWidth: l
1862
1863
  }), Yo(e, {
1863
- cellWidth: y,
1864
- cellHeight: g,
1864
+ cellWidth: v,
1865
+ cellHeight: C,
1865
1866
  padding: s,
1866
1867
  foodColor: u
1867
1868
  }), e.playerAtExit || Xo(e, {
1868
- cellWidth: y,
1869
- cellHeight: g,
1869
+ cellWidth: v,
1870
+ cellHeight: C,
1870
1871
  padding: s,
1871
1872
  exitColor: _
1872
1873
  }), qo(e, {
1873
- cellWidth: y,
1874
- cellHeight: g,
1874
+ cellWidth: v,
1875
+ cellHeight: C,
1875
1876
  padding: s,
1876
1877
  playerColor: c
1877
1878
  });
1878
1879
  }
1879
1880
  function Vo(e, t) {
1880
- const { ctx: o, maze: n } = e, { cellWidth: i, cellHeight: r, padding: s, wallColor: a, wallWidth: l } = t;
1881
- o.save(), o.strokeStyle = a, o.lineWidth = l, o.lineCap = "round", o.beginPath();
1881
+ const { ctx: o, maze: n } = e, { cellWidth: i, cellHeight: r, padding: s, wallColor: l, wallWidth: a } = t;
1882
+ o.save(), o.strokeStyle = l, o.lineWidth = a, o.lineCap = "round", o.beginPath();
1882
1883
  for (let c = 0; c < n.rows; c++)
1883
1884
  for (let _ = 0; _ < n.cols; _++) {
1884
1885
  const u = n.grid[c][_], h = s + _ * i, d = s + c * r;
@@ -1887,29 +1888,29 @@ function Vo(e, t) {
1887
1888
  o.stroke(), o.restore();
1888
1889
  }
1889
1890
  function qo(e, t) {
1890
- const { ctx: o, playerPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, playerColor: a } = t, { x: l, y: c } = q(
1891
+ const { ctx: o, playerPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, playerColor: l } = t, { x: a, y: c } = q(
1891
1892
  n.row,
1892
1893
  n.col,
1893
1894
  i,
1894
1895
  r,
1895
1896
  s
1896
1897
  ), _ = Math.min(i, r) * 0.35;
1897
- o.save(), o.fillStyle = a, o.beginPath(), o.arc(l, c, _, 0, Math.PI * 2), o.fill(), o.restore();
1898
+ o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, _, 0, Math.PI * 2), o.fill(), o.restore();
1898
1899
  }
1899
1900
  function Xo(e, t) {
1900
- const { ctx: o, exitPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, exitColor: a } = t, { x: l, y: c } = q(
1901
+ const { ctx: o, exitPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, exitColor: l } = t, { x: a, y: c } = q(
1901
1902
  n.row,
1902
1903
  n.col,
1903
1904
  i,
1904
1905
  r,
1905
1906
  s
1906
1907
  ), _ = Math.min(i, r) * 0.35;
1907
- o.save(), o.fillStyle = a, o.beginPath(), o.arc(l, c, _, 0, Math.PI * 2), o.fill(), o.restore();
1908
+ o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, _, 0, Math.PI * 2), o.fill(), o.restore();
1908
1909
  }
1909
1910
  function Yo(e, t) {
1910
- const { ctx: o, foodPositions: n } = e, { cellWidth: i, cellHeight: r, padding: s, foodColor: a } = t;
1911
- o.fillStyle = a;
1912
- const l = Math.min(i, r) * 0.25;
1911
+ const { ctx: o, foodPositions: n } = e, { cellWidth: i, cellHeight: r, padding: s, foodColor: l } = t;
1912
+ o.fillStyle = l;
1913
+ const a = Math.min(i, r) * 0.25;
1913
1914
  n.forEach((c) => {
1914
1915
  const { x: _, y: u } = q(
1915
1916
  c.row,
@@ -1918,31 +1919,43 @@ function Yo(e, t) {
1918
1919
  r,
1919
1920
  s
1920
1921
  );
1921
- Jo(o, _, u, l * 1.2, 5, l * 0.6);
1922
+ Jo(o, _, u, a * 1.2, 5, a * 0.6);
1922
1923
  });
1923
1924
  }
1924
1925
  function Jo(e, t, o, n, i, r) {
1925
1926
  e.save(), e.beginPath();
1926
1927
  for (let s = 0; s < i * 2; s++) {
1927
- const a = s % 2 === 0 ? n : r, l = Math.PI * s / i;
1928
- e.lineTo(t + a * Math.sin(l), o + a * Math.cos(l));
1928
+ const l = s % 2 === 0 ? n : r, a = Math.PI * s / i;
1929
+ e.lineTo(t + l * Math.sin(a), o + l * Math.cos(a));
1929
1930
  }
1930
1931
  e.closePath(), e.fill(), e.restore();
1931
1932
  }
1932
1933
  function Ko(e, t) {
1933
- const { ctx: o, playerPath: n, visitCounts: i } = e, { cellWidth: r, cellHeight: s, padding: a, clueColor: l } = t;
1934
+ const { ctx: o, playerPath: n, visitCounts: i } = e, { cellWidth: r, cellHeight: s, padding: l, clueColor: a } = t;
1934
1935
  if (!(!n || n.length < 2 || !i)) {
1935
1936
  o.save();
1936
1937
  for (let c = 1; c < n.length; c++) {
1937
- const _ = n[c - 1], u = n[c], h = `${_.row},${_.col}-${u.row},${u.col}`, d = `${u.row},${u.col}-${_.row},${_.col}`, m = (i[h] || 0) + (i[d] || 0), v = Math.min(0.2 + m * 0.1, 0.9), y = Math.max(3, r * 0.1) + m * 0.5;
1938
+ const _ = n[c - 1], u = n[c], h = `${_.row},${_.col}-${u.row},${u.col}`, d = `${u.row},${u.col}-${_.row},${_.col}`, f = (i[h] || 0) + (i[d] || 0), g = Math.min(0.2 + f * 0.1, 0.9), v = Math.max(3, r * 0.1) + f * 0.5;
1938
1939
  try {
1939
- o.strokeStyle = l.replace(")", `, ${v})`).replace("rgb(", "rgba(");
1940
+ o.strokeStyle = a.replace(")", `, ${g})`).replace("rgb(", "rgba(");
1940
1941
  } catch {
1941
- o.strokeStyle = `rgba(255, 0, 0, ${v})`;
1942
+ o.strokeStyle = `rgba(255, 0, 0, ${g})`;
1942
1943
  }
1943
- o.lineWidth = y, o.lineCap = "round", o.lineJoin = "round";
1944
- const { x: g, y: p } = q(_.row, _.col, r, s, a), { x: T, y: k } = q(u.row, u.col, r, s, a);
1945
- o.beginPath(), o.moveTo(g, p), o.lineTo(T, k), o.stroke();
1944
+ o.lineWidth = v, o.lineCap = "round", o.lineJoin = "round";
1945
+ const { x: C, y: p } = q(
1946
+ _.row,
1947
+ _.col,
1948
+ r,
1949
+ s,
1950
+ l
1951
+ ), { x: T, y: k } = q(
1952
+ u.row,
1953
+ u.col,
1954
+ r,
1955
+ s,
1956
+ l
1957
+ );
1958
+ o.beginPath(), o.moveTo(C, p), o.lineTo(T, k), o.stroke();
1946
1959
  }
1947
1960
  o.restore();
1948
1961
  }
@@ -1955,8 +1968,8 @@ function q(e, t, o, n, i) {
1955
1968
  }
1956
1969
  const Zo = new co(), Qo = () => {
1957
1970
  const { message: e, visible: t, type: o, hideToast: n } = Ce();
1958
- return /* @__PURE__ */ f(
1959
- jo,
1971
+ return /* @__PURE__ */ m(
1972
+ Wo,
1960
1973
  {
1961
1974
  message: e,
1962
1975
  visible: t,
@@ -1966,94 +1979,111 @@ const Zo = new co(), Qo = () => {
1966
1979
  }
1967
1980
  );
1968
1981
  }, en = () => {
1969
- const { gameState: e, setGameState: t, config: o } = _t(), n = W(null), i = W(null), r = W(e), s = o.current.i18n, { showToast: a } = Ce();
1982
+ const { gameState: e, setGameState: t, config: o } = _t(), n = D(null), i = D(null), r = D(e), s = o.current.i18n, { showToast: l } = Ce(), a = D(!1);
1970
1983
  A(() => {
1971
1984
  r.current = e;
1972
1985
  }, [e]);
1973
- const l = () => {
1974
- const h = e.totalFoodCount - e.foodCollected - 1;
1975
- if (h > 0) {
1976
- a(
1977
- s.foodCollectedToast.replace("%NUM%", h.toString()),
1986
+ const c = () => {
1987
+ const d = e.totalFoodCount - e.foodCollected - 1;
1988
+ if (d > 0) {
1989
+ l(
1990
+ s.foodCollectedToast.replace("%NUM%", d.toString()),
1978
1991
  "success"
1979
1992
  );
1980
1993
  return;
1981
1994
  }
1982
- a(s.allFoodCollectedToast, "success");
1983
- }, c = () => {
1984
- const h = e.totalFoodCount - e.foodCollected - 1;
1985
- a(
1986
- s.warnNotAllFoodCollectedToast.replace("%NUM%", h.toString()),
1995
+ l(s.allFoodCollectedToast, "success");
1996
+ }, _ = () => {
1997
+ const d = e.totalFoodCount - e.foodCollected - 1;
1998
+ l(
1999
+ s.warnNotAllFoodCollectedToast.replace("%NUM%", d.toString()),
1987
2000
  "warning"
1988
2001
  );
1989
- }, _ = (h, d) => {
1990
- const m = h.current?.getContext("2d");
1991
- m && d.maze && Bo(
2002
+ }, u = (d, f) => {
2003
+ const g = d.current?.getContext("2d");
2004
+ if (!g || !f.maze || a.current) return;
2005
+ a.current = !0;
2006
+ const v = { ...o.current.renderConfig || {} }, p = o.current.levelConfig.flat()[f.currentLevel - 1];
2007
+ p.wallWidth ? v.wallWidth = p.wallWidth : f.maze.cols > 40 && (v.wallWidth -= v.wallWidth * 0.05 * (f.maze.cols - 40), v.wallWidth = Math.max(
2008
+ v.wallWidth,
2009
+ v.minWallWidth
2010
+ )), Bo(
1992
2011
  {
1993
- ctx: m,
1994
- width: h.current.width,
1995
- height: h.current.height,
1996
- maze: d.maze,
1997
- playerPosition: d.playerPosition,
1998
- exitPosition: d.exitPosition,
1999
- foodPositions: d.foodPositions,
2000
- showClue: d.showClue,
2001
- playerPath: d.playerPath,
2002
- visitCounts: d.visitCounts,
2003
- playerAtExit: d.playerAtExit
2012
+ ctx: g,
2013
+ width: d.current.width,
2014
+ height: d.current.height,
2015
+ maze: f.maze,
2016
+ playerPosition: f.playerPosition,
2017
+ exitPosition: f.exitPosition,
2018
+ foodPositions: f.foodPositions,
2019
+ showClue: f.showClue,
2020
+ playerPath: f.playerPath,
2021
+ visitCounts: f.visitCounts,
2022
+ playerAtExit: f.playerAtExit
2004
2023
  },
2005
- o.current.renderConfig || {}
2006
- );
2024
+ v
2025
+ ), requestAnimationFrame(() => {
2026
+ a.current = !1;
2027
+ });
2007
2028
  };
2008
2029
  A(() => {
2009
- a(s.useArrowKeyTips, "info", 3e3);
2010
- }, []), Ho(i, _, r);
2011
- const { generateCurrentLevelMaze: u } = yt({
2030
+ l(s.useArrowKeyTips, "info", 3e3);
2031
+ }, []), jo(i, u, r);
2032
+ const { generateCurrentLevelMaze: h } = yt({
2012
2033
  gameState: e,
2013
2034
  setGameState: t,
2014
2035
  config: o
2015
2036
  });
2016
- return Go({
2037
+ return Ho({
2017
2038
  containerRef: n,
2018
2039
  gameState: e,
2019
2040
  setGameState: t,
2020
- onFoodCollected: l,
2021
- onFoodNotAllCollected: c
2022
- }), Wo({
2041
+ onFoodCollected: c,
2042
+ onFoodNotAllCollected: _
2043
+ }), Go({
2023
2044
  gameState: e,
2024
2045
  setGameState: t,
2025
2046
  config: o,
2026
2047
  onLevelComplete: () => {
2027
- Zo.addConfetti(), a(s.levelCompleteToast, "success");
2048
+ Zo.addConfetti(), l(s.levelCompleteToast, "success");
2028
2049
  },
2029
- onTierUnlocked: (h) => {
2030
- a(
2031
- s.tierUnlockedToast.replace("%TIER%", h.toString()),
2050
+ onTierUnlocked: (d) => {
2051
+ l(
2052
+ s.tierUnlockedToast.replace("%TIER%", d.toString()),
2032
2053
  "success"
2033
2054
  );
2034
2055
  }
2035
2056
  }), A(() => {
2036
- e.isGameActive && !e.levelTransitioning && u();
2057
+ e.isGameActive && !e.levelTransitioning && h();
2037
2058
  }, [
2038
2059
  e.currentLevel,
2039
2060
  e.isGameActive,
2040
2061
  e.levelTransitioning
2041
2062
  ]), A(() => {
2042
- i.current && e.maze && _(i, e);
2043
- }, [e]), /* @__PURE__ */ f("div", { className: "maze-game-container", children: [
2044
- /* @__PURE__ */ f(Qo, {}),
2045
- /* @__PURE__ */ f(Do, {}),
2046
- /* @__PURE__ */ f("div", { className: "maze-canvas-container", ref: n, children: [
2047
- /* @__PURE__ */ f("canvas", { ref: i, className: "maze-game-canvas" }),
2048
- /* @__PURE__ */ f("div", { className: "maze-touch-area maze-up" }),
2049
- /* @__PURE__ */ f("div", { className: "maze-touch-area maze-down" }),
2050
- /* @__PURE__ */ f("div", { className: "maze-touch-area maze-left" }),
2051
- /* @__PURE__ */ f("div", { className: "maze-touch-area maze-right" })
2063
+ i.current && e.maze && u(i, e);
2064
+ }, [
2065
+ e.maze,
2066
+ e.playerPosition,
2067
+ e.exitPosition,
2068
+ e.foodPositions,
2069
+ e.showClue,
2070
+ e.playerPath,
2071
+ e.visitCounts,
2072
+ e.playerAtExit
2073
+ ]), /* @__PURE__ */ m("div", { className: "maze-game-container", children: [
2074
+ /* @__PURE__ */ m(Qo, {}),
2075
+ /* @__PURE__ */ m(Do, {}),
2076
+ /* @__PURE__ */ m("div", { className: "maze-canvas-container", ref: n, children: [
2077
+ /* @__PURE__ */ m("canvas", { ref: i, className: "maze-game-canvas" }),
2078
+ /* @__PURE__ */ m("div", { className: "maze-touch-area maze-up" }),
2079
+ /* @__PURE__ */ m("div", { className: "maze-touch-area maze-down" }),
2080
+ /* @__PURE__ */ m("div", { className: "maze-touch-area maze-left" }),
2081
+ /* @__PURE__ */ m("div", { className: "maze-touch-area maze-right" })
2052
2082
  ] })
2053
2083
  ] });
2054
2084
  };
2055
2085
  function tn() {
2056
- return /* @__PURE__ */ f(Lo, { children: /* @__PURE__ */ f(en, {}) });
2086
+ return /* @__PURE__ */ m(Lo, { children: /* @__PURE__ */ m(en, {}) });
2057
2087
  }
2058
2088
  function on({ config: e = {} }) {
2059
2089
  const t = { ...ee.i18n, ...e.i18n || {} }, o = { ...ee.renderConfig, ...e.renderConfig || {} }, n = e.levelConfig || ye;
@@ -2063,10 +2093,10 @@ function on({ config: e = {} }) {
2063
2093
  i18n: t,
2064
2094
  levelConfig: n,
2065
2095
  renderConfig: o
2066
- }, /* @__PURE__ */ f(Ot, { config: e, children: /* @__PURE__ */ f(tn, {}) });
2096
+ }, /* @__PURE__ */ m(Ot, { config: e, children: /* @__PURE__ */ m(tn, {}) });
2067
2097
  }
2068
2098
  const nn = {
2069
- root: "https://unpkg.com/@roudanio/maze@0.0.4/dist/",
2099
+ root: "https://unpkg.com/@roudanio/maze@0.0.6/dist/",
2070
2100
  ...ee
2071
2101
  };
2072
2102
  `${JSON.stringify(nn, null, 2)}`;
@@ -2075,8 +2105,8 @@ const rn = {
2075
2105
  const o = typeof e == "string" ? document.querySelector(e) : e;
2076
2106
  if (!o) {
2077
2107
  console.warn("Cannot find the root element");
2078
- const l = document.createElement("div");
2079
- l.style.textAlign = "center", l.style.padding = "20px", l.innerHTML = "Cannot find the root element", document.body.append(l);
2108
+ const a = document.createElement("div");
2109
+ a.style.textAlign = "center", a.style.padding = "20px", a.innerHTML = "Cannot find the root element", document.body.append(a);
2080
2110
  return;
2081
2111
  }
2082
2112
  let { root: n = location.origin } = t;
@@ -2100,10 +2130,10 @@ const rn = {
2100
2130
  @keyframes loading {
2101
2131
  0% { width: 0%; }
2102
2132
  100% { width: 99%; }
2103
- }`, document.head.appendChild(s), await (async (l) => new Promise((c, _) => {
2133
+ }`, document.head.appendChild(s), await (async (a) => new Promise((c, _) => {
2104
2134
  const u = document.createElement("link");
2105
- u.rel = "stylesheet", u.type = "text/css", u.href = l, u.onload = c, u.onerror = _, document.head.appendChild(u);
2106
- }))(n + "maze.css"), Mt(/* @__PURE__ */ f(on, { config: t }), o);
2135
+ u.rel = "stylesheet", u.type = "text/css", u.href = a, u.onload = c, u.onerror = _, document.head.appendChild(u);
2136
+ }))(n + "maze.css"), Mt(/* @__PURE__ */ m(on, { config: t }), o);
2107
2137
  }
2108
2138
  };
2109
2139
  export {