@roudanio/maze 0.0.3 → 0.0.5

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,5 +1,5 @@
1
- var ee, g, Oe, H, ye, Ie, le, We, de, ae, ce, Ve, V = {}, Be = [], wt = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, te = Array.isArray;
2
- function U(e, t) {
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
+ function I(e, t) {
3
3
  for (var o in t) e[o] = t[o];
4
4
  return e;
5
5
  }
@@ -7,100 +7,99 @@ function he(e) {
7
7
  e && e.parentNode && e.parentNode.removeChild(e);
8
8
  }
9
9
  function D(e, t, o) {
10
- var n, r, i, s = {};
11
- for (i in t) i == "key" ? n = t[i] : i == "ref" ? r = t[i] : s[i] = t[i];
12
- if (arguments.length > 2 && (s.children = arguments.length > 3 ? ee.call(arguments, 2) : o), typeof e == "function" && e.defaultProps != null) for (i in e.defaultProps) s[i] === void 0 && (s[i] = e.defaultProps[i]);
13
- return Y(e, s, n, r, null);
10
+ var n, i, r, s = {};
11
+ for (r in t) r == "key" ? n = t[r] : r == "ref" ? i = t[r] : s[r] = t[r];
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]);
13
+ return Z(e, s, n, i, null);
14
14
  }
15
- function Y(e, t, o, n, r) {
16
- var i = { type: e, props: t, key: o, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++Oe, __i: -1, __u: 0 };
17
- return r == null && g.vnode != null && g.vnode(i), i;
15
+ function Z(e, t, o, n, i) {
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 && y.vnode != null && y.vnode(r), r;
18
18
  }
19
- function G(e) {
19
+ function W(e) {
20
20
  return e.children;
21
21
  }
22
- function E(e, t) {
22
+ function R(e, t) {
23
23
  this.props = e, this.context = t;
24
24
  }
25
- function O(e, t) {
26
- if (t == null) return e.__ ? O(e.__, e.__i + 1) : null;
25
+ function j(e, t) {
26
+ if (t == null) return e.__ ? j(e.__, e.__i + 1) : null;
27
27
  for (var o; t < e.__k.length; t++) if ((o = e.__k[t]) != null && o.__e != null) return o.__e;
28
- return typeof e.type == "function" ? O(e) : null;
28
+ return typeof e.type == "function" ? j(e) : null;
29
29
  }
30
- function je(e) {
30
+ function Qe(e) {
31
31
  var t, o;
32
32
  if ((e = e.__) != null && e.__c != null) {
33
33
  for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((o = e.__k[t]) != null && o.__e != null) {
34
34
  e.__e = e.__c.base = o.__e;
35
35
  break;
36
36
  }
37
- return je(e);
37
+ return Qe(e);
38
38
  }
39
39
  }
40
- function _e(e) {
41
- (!e.__d && (e.__d = !0) && H.push(e) && !Z.__r++ || ye !== g.debounceRendering) && ((ye = g.debounceRendering) || Ie)(Z);
42
- }
43
- function Z() {
44
- var e, t, o, n, r, i, s, l;
45
- for (H.sort(le); e = H.shift(); ) e.__d && (t = H.length, n = void 0, i = (r = (o = e).__v).__e, s = [], l = [], o.__P && ((n = U({}, r)).__v = r.__v + 1, g.vnode && g.vnode(n), fe(o.__P, n, r, o.__n, o.__P.namespaceURI, 32 & r.__u ? [i] : null, s, i ?? O(r), !!(32 & r.__u), l), n.__v = r.__v, n.__.__k[n.__i] = n, Xe(s, n, l), n.__e != i && je(n)), H.length > t && H.sort(le));
46
- Z.__r = 0;
47
- }
48
- function qe(e, t, o, n, r, i, s, l, a, c, u) {
49
- var _, h, d, m, y, w, v = n && n.__k || Be, p = t.length;
50
- for (a = Ct(o, t, v, a, p), _ = 0; _ < p; _++) (d = o.__k[_]) != null && (h = d.__i === -1 ? V : v[d.__i] || V, d.__i = _, w = fe(e, d, h, r, i, s, l, a, c, u), m = d.__e, d.ref && h.ref != d.ref && (h.ref && me(h.ref, null, d), u.push(d.ref, d.__c || m, d)), y == null && m != null && (y = m), 4 & d.__u || h.__k === d.__k ? a = Ke(d, a, e) : typeof d.type == "function" && w !== void 0 ? a = w : m && (a = m.nextSibling), d.__u &= -7);
51
- return o.__e = y, a;
52
- }
53
- function Ct(e, t, o, n, r) {
54
- var i, s, l, a, c, u = o.length, _ = u, h = 0;
55
- for (e.__k = new Array(r), i = 0; i < r; i++) (s = t[i]) != null && typeof s != "boolean" && typeof s != "function" ? (a = i + h, (s = e.__k[i] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? Y(null, s, null, null, null) : te(s) ? Y(G, { children: s }, null, null, null) : s.constructor === void 0 && s.__b > 0 ? Y(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 = kt(s, o, a, _)) !== -1 && (_--, (l = o[c]) && (l.__u |= 2)), l == null || l.__v === null ? (c == -1 && 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[i] = null;
56
- if (_) for (i = 0; i < u; i++) (l = o[i]) != null && !(2 & l.__u) && (l.__e == n && (n = O(l)), Ye(l, l));
40
+ function ue(e) {
41
+ (!e.__d && (e.__d = !0) && O.push(e) && !te.__r++ || we != y.debounceRendering) && ((we = y.debounceRendering) || Xe)(te);
42
+ }
43
+ function te() {
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 ?? j(n), !!(32 & n.__u), s), o.__v = n.__v, o.__.__k[o.__i] = o, ot(r, o, s), o.__e != i && Qe(o)));
45
+ te.__r = 0;
46
+ }
47
+ function et(e, t, o, n, i, r, s, l, a, c, _) {
48
+ var u, h, d, v, m, C, g = n && n.__k || Ze, p = t.length;
49
+ for (a = Lt(o, t, g, a, p), u = 0; u < p; u++) (d = o.__k[u]) != null && (h = d.__i == -1 ? B : g[d.__i] || B, d.__i = u, C = fe(e, d, h, i, r, s, l, a, c, _), v = d.__e, d.ref && h.ref != d.ref && (h.ref && me(h.ref, null, d), _.push(d.ref, d.__c || v, d)), m == null && v != null && (m = v), 4 & d.__u || h.__k === d.__k ? a = tt(d, a, e) : typeof d.type == "function" && C !== void 0 ? a = C : v && (a = v.nextSibling), d.__u &= -7);
50
+ return o.__e = m, a;
51
+ }
52
+ function Lt(e, t, o, n, i) {
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(W, { 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 = j(l)), it(l, l));
57
56
  return n;
58
57
  }
59
- function Ke(e, t, o) {
60
- var n, r;
58
+ function tt(e, t, o) {
59
+ var n, i;
61
60
  if (typeof e.type == "function") {
62
- for (n = e.__k, r = 0; n && r < n.length; r++) n[r] && (n[r].__ = e, t = Ke(n[r], t, o));
61
+ for (n = e.__k, i = 0; n && i < n.length; i++) n[i] && (n[i].__ = e, t = tt(n[i], t, o));
63
62
  return t;
64
63
  }
65
- e.__e != t && (t && e.type && !o.contains(t) && (t = O(e)), o.insertBefore(e.__e, t || null), t = e.__e);
64
+ e.__e != t && (t && e.type && !o.contains(t) && (t = j(e)), o.insertBefore(e.__e, t || null), t = e.__e);
66
65
  do
67
66
  t = t && t.nextSibling;
68
67
  while (t != null && t.nodeType == 8);
69
68
  return t;
70
69
  }
71
- function Q(e, t) {
72
- return t = t || [], e == null || typeof e == "boolean" || (te(e) ? e.some(function(o) {
73
- Q(o, t);
70
+ function oe(e, t) {
71
+ return t = t || [], e == null || typeof e == "boolean" || (X(e) ? e.some(function(o) {
72
+ oe(o, t);
74
73
  }) : t.push(e)), t;
75
74
  }
76
- function kt(e, t, o, n) {
77
- var r, i, s = e.key, l = e.type, a = t[o];
78
- if (a === null || a && s == a.key && l === a.type && !(2 & a.__u)) return o;
79
- if (n > (a != null && !(2 & a.__u) ? 1 : 0)) for (r = o - 1, i = o + 1; r >= 0 || i < t.length; ) {
80
- if (r >= 0) {
81
- if ((a = t[r]) && !(2 & a.__u) && s == a.key && l === a.type) return r;
82
- r--;
75
+ function xt(e, t, o, n) {
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
+ if (i >= 0) {
80
+ if ((a = t[i]) && (2 & a.__u) == 0 && s == a.key && l == a.type) return i;
81
+ i--;
83
82
  }
84
- if (i < t.length) {
85
- if ((a = t[i]) && !(2 & a.__u) && s == a.key && l === a.type) return i;
86
- i++;
83
+ if (r < t.length) {
84
+ if ((a = t[r]) && (2 & a.__u) == 0 && s == a.key && l == a.type) return r;
85
+ r++;
87
86
  }
88
87
  }
89
88
  return -1;
90
89
  }
91
- function we(e, t, o) {
92
- t[0] == "-" ? e.setProperty(t, o ?? "") : e[t] = o == null ? "" : typeof o != "number" || wt.test(t) ? o : o + "px";
90
+ function be(e, t, o) {
91
+ t[0] == "-" ? e.setProperty(t, o ?? "") : e[t] = o == null ? "" : typeof o != "number" || St.test(t) ? o : o + "px";
93
92
  }
94
- function K(e, t, o, n, r) {
95
- var i;
93
+ function J(e, t, o, n, i) {
94
+ var r;
96
95
  e: if (t == "style") if (typeof o == "string") e.style.cssText = o;
97
96
  else {
98
- if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) o && t in o || we(e.style, t, "");
99
- if (o) for (t in o) n && o[t] === n[t] || we(e.style, t, o[t]);
97
+ if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) o && t in o || be(e.style, t, "");
98
+ if (o) for (t in o) n && o[t] == n[t] || be(e.style, t, o[t]);
100
99
  }
101
- else if (t[0] == "o" && t[1] == "n") i = t != (t = t.replace(We, "$1")), t = t.toLowerCase() in e || t == "onFocusOut" || t == "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + i] = o, o ? n ? o.u = n.u : (o.u = de, e.addEventListener(t, i ? ce : ae, i)) : e.removeEventListener(t, i ? ce : ae, i);
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);
102
101
  else {
103
- if (r == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
102
+ if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
104
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 {
105
104
  e[t] = o ?? "";
106
105
  break e;
@@ -109,90 +108,93 @@ function K(e, t, o, n, r) {
109
108
  typeof o == "function" || (o == null || o === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && o == 1 ? "" : o));
110
109
  }
111
110
  }
112
- function Ce(e) {
111
+ function ke(e) {
113
112
  return function(t) {
114
113
  if (this.l) {
115
114
  var o = this.l[t.type + e];
116
115
  if (t.t == null) t.t = de++;
117
116
  else if (t.t < o.u) return;
118
- return o(g.event ? g.event(t) : t);
117
+ return o(y.event ? y.event(t) : t);
119
118
  }
120
119
  };
121
120
  }
122
- function fe(e, t, o, n, r, i, s, l, a, c) {
123
- var u, _, h, d, m, y, w, v, p, z, b, S, L, F, $, M, P, T = t.type;
124
- if (t.constructor !== void 0) return null;
125
- 128 & o.__u && (a = !!(32 & o.__u), i = [l = t.__e = o.__e]), (u = g.__b) && u(t);
126
- e: if (typeof T == "function") try {
127
- if (v = t.props, p = "prototype" in T && T.prototype.render, z = (u = T.contextType) && n[u.__c], b = u ? z ? z.props.value : u.__ : n, o.__c ? w = (_ = t.__c = o.__c).__ = _.__E : (p ? t.__c = _ = new T(v, b) : (t.__c = _ = new E(v, b), _.constructor = T, _.render = zt), z && z.sub(_), _.props = v, _.state || (_.state = {}), _.context = b, _.__n = n, h = _.__d = !0, _.__h = [], _._sb = []), p && _.__s == null && (_.__s = _.state), p && T.getDerivedStateFromProps != null && (_.__s == _.state && (_.__s = U({}, _.__s)), U(_.__s, T.getDerivedStateFromProps(v, _.__s))), d = _.props, m = _.state, _.__v = t, h) p && T.getDerivedStateFromProps == null && _.componentWillMount != null && _.componentWillMount(), p && _.componentDidMount != null && _.__h.push(_.componentDidMount);
121
+ function fe(e, t, o, n, i, r, s, l, a, c) {
122
+ var _, u, h, d, v, m, C, g, p, T, k, E, P, F, M, N, S, z = t.type;
123
+ if (t.constructor != null) return null;
124
+ 128 & o.__u && (a = !!(32 & o.__u), r = [l = t.__e = o.__e]), (_ = y.__b) && _(t);
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 ? C = (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, v = u.state, u.__v = t, h) p && z.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), p && u.componentDidMount != null && u.__h.push(u.componentDidMount);
128
127
  else {
129
- if (p && T.getDerivedStateFromProps == null && v !== d && _.componentWillReceiveProps != null && _.componentWillReceiveProps(v, b), !_.__e && (_.shouldComponentUpdate != null && _.shouldComponentUpdate(v, _.__s, b) === !1 || t.__v == o.__v)) {
130
- for (t.__v != o.__v && (_.props = v, _.state = _.__s, _.__d = !1), t.__e = o.__e, t.__k = o.__k, t.__k.some(function(R) {
131
- R && (R.__ = t);
132
- }), S = 0; S < _._sb.length; S++) _.__h.push(_._sb[S]);
133
- _._sb = [], _.__h.length && s.push(_);
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) {
130
+ U && (U.__ = t);
131
+ }), E = 0; E < u._sb.length; E++) u.__h.push(u._sb[E]);
132
+ u._sb = [], u.__h.length && s.push(u);
134
133
  break e;
135
134
  }
136
- _.componentWillUpdate != null && _.componentWillUpdate(v, _.__s, b), p && _.componentDidUpdate != null && _.__h.push(function() {
137
- _.componentDidUpdate(d, m, y);
135
+ u.componentWillUpdate != null && u.componentWillUpdate(g, u.__s, k), p && u.componentDidUpdate != null && u.__h.push(function() {
136
+ u.componentDidUpdate(d, v, m);
138
137
  });
139
138
  }
140
- if (_.context = b, _.props = v, _.__P = e, _.__e = !1, L = g.__r, F = 0, p) {
141
- for (_.state = _.__s, _.__d = !1, L && L(t), u = _.render(_.props, _.state, _.context), $ = 0; $ < _._sb.length; $++) _.__h.push(_._sb[$]);
142
- _._sb = [];
139
+ if (u.context = k, u.props = g, u.__P = e, u.__e = !1, P = y.__r, F = 0, p) {
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
+ u._sb = [];
143
142
  } else do
144
- _.__d = !1, L && L(t), u = _.render(_.props, _.state, _.context), _.state = _.__s;
145
- while (_.__d && ++F < 25);
146
- _.state = _.__s, _.getChildContext != null && (n = U(U({}, n), _.getChildContext())), p && !h && _.getSnapshotBeforeUpdate != null && (y = _.getSnapshotBeforeUpdate(d, m)), l = qe(e, te(M = u != null && u.type === G && u.key == null ? u.props.children : u) ? M : [M], t, o, n, r, i, s, l, a, c), _.base = t.__e, t.__u &= -161, _.__h.length && s.push(_), w && (_.__E = _.__ = null);
147
- } catch (R) {
148
- if (t.__v = null, a || i != null) if (R.then) {
143
+ u.__d = !1, P && P(t), _ = u.render(u.props, u.state, u.context), u.state = u.__s;
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 && (m = u.getSnapshotBeforeUpdate(d, v)), N = _, _ != null && _.type === W && _.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), C && (u.__E = u.__ = null);
146
+ } catch (U) {
147
+ if (t.__v = null, a || r != null) if (U.then) {
149
148
  for (t.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
150
- i[i.indexOf(l)] = null, t.__e = l;
151
- } else for (P = i.length; P--; ) he(i[P]);
149
+ r[r.indexOf(l)] = null, t.__e = l;
150
+ } else for (S = r.length; S--; ) he(r[S]);
152
151
  else t.__e = o.__e, t.__k = o.__k;
153
- g.__e(R, t, o);
152
+ y.__e(U, t, o);
154
153
  }
155
- else i == null && t.__v == o.__v ? (t.__k = o.__k, t.__e = o.__e) : l = t.__e = bt(o.__e, t, o, n, r, i, s, a, c);
156
- return (u = g.diffed) && u(t), 128 & t.__u ? void 0 : l;
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;
157
156
  }
158
- function Xe(e, t, o) {
157
+ function ot(e, t, o) {
159
158
  for (var n = 0; n < o.length; n++) me(o[n], o[++n], o[++n]);
160
- g.__c && g.__c(t, e), e.some(function(r) {
159
+ y.__c && y.__c(t, e), e.some(function(i) {
161
160
  try {
162
- e = r.__h, r.__h = [], e.some(function(i) {
163
- i.call(r);
161
+ e = i.__h, i.__h = [], e.some(function(r) {
162
+ r.call(i);
164
163
  });
165
- } catch (i) {
166
- g.__e(i, r.__v);
164
+ } catch (r) {
165
+ y.__e(r, i.__v);
167
166
  }
168
167
  });
169
168
  }
170
- function bt(e, t, o, n, r, i, s, l, a) {
171
- var c, u, _, h, d, m, y, w = o.props, v = t.props, p = t.type;
172
- if (p == "svg" ? r = "http://www.w3.org/2000/svg" : p == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), i != null) {
173
- for (c = 0; c < i.length; c++) if ((d = i[c]) && "setAttribute" in d == !!p && (p ? d.localName == p : d.nodeType == 3)) {
174
- e = d, i[c] = null;
169
+ function nt(e) {
170
+ return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : X(e) ? e.map(nt) : I({}, e);
171
+ }
172
+ function At(e, t, o, n, i, r, s, l, a) {
173
+ var c, _, u, h, d, v, m, C = o.props, g = t.props, p = t.type;
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
+ for (c = 0; c < r.length; c++) if ((d = r[c]) && "setAttribute" in d == !!p && (p ? d.localName == p : d.nodeType == 3)) {
176
+ e = d, r[c] = null;
175
177
  break;
176
178
  }
177
179
  }
178
180
  if (e == null) {
179
- if (p == null) return document.createTextNode(v);
180
- e = document.createElementNS(r, p, v.is && v), l && (g.__m && g.__m(t, i), l = !1), i = null;
181
+ if (p == null) return document.createTextNode(g);
182
+ e = document.createElementNS(i, p, g.is && g), l && (y.__m && y.__m(t, r), l = !1), r = null;
181
183
  }
182
- if (p === null) w === v || l && e.data === v || (e.data = v);
184
+ if (p == null) C === g || l && e.data == g || (e.data = g);
183
185
  else {
184
- if (i = i && ee.call(e.childNodes), w = o.props || V, !l && i != null) for (w = {}, c = 0; c < e.attributes.length; c++) w[(d = e.attributes[c]).name] = d.value;
185
- for (c in w) if (d = w[c], c != "children") {
186
- if (c == "dangerouslySetInnerHTML") _ = d;
187
- else if (!(c in v)) {
188
- if (c == "value" && "defaultValue" in v || c == "checked" && "defaultChecked" in v) continue;
189
- K(e, c, null, d, r);
186
+ if (r = r && ne.call(e.childNodes), C = o.props || B, !l && r != null) for (C = {}, c = 0; c < e.attributes.length; c++) C[(d = e.attributes[c]).name] = d.value;
187
+ for (c in C) if (d = C[c], c != "children") {
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;
191
+ J(e, c, null, d, i);
190
192
  }
191
193
  }
192
- for (c in v) d = v[c], c == "children" ? h = d : c == "dangerouslySetInnerHTML" ? u = d : c == "value" ? m = d : c == "checked" ? y = d : l && typeof d != "function" || w[c] === d || K(e, c, d, w[c], r);
193
- if (u) l || _ && (u.__html === _.__html || u.__html === e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];
194
- else if (_ && (e.innerHTML = ""), qe(e, te(h) ? h : [h], t, o, n, p == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, i, s, i ? i[0] : o.__k && O(o, 0), l, a), i != null) for (c = i.length; c--; ) he(i[c]);
195
- l || (c = "value", p == "progress" && m == null ? e.removeAttribute("value") : m !== void 0 && (m !== e[c] || p == "progress" && !m || p == "option" && m !== w[c]) && K(e, c, m, w[c], r), c = "checked", y !== void 0 && y !== e[c] && K(e, c, y, w[c], r));
194
+ for (c in g) d = g[c], c == "children" ? h = d : c == "dangerouslySetInnerHTML" ? _ = d : c == "value" ? v = d : c == "checked" ? m = d : l && typeof d != "function" || C[c] === d || J(e, c, d, C[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 && j(o, 0), l, a), r != null) for (c = r.length; c--; ) he(r[c]);
197
+ l || (c = "value", p == "progress" && v == null ? e.removeAttribute("value") : v != null && (v !== e[c] || p == "progress" && !v || p == "option" && v != C[c]) && J(e, c, v, C[c], i), c = "checked", m != null && m != e[c] && J(e, c, m, C[c], i));
196
198
  }
197
199
  return e;
198
200
  }
@@ -202,212 +204,212 @@ function me(e, t, o) {
202
204
  var n = typeof e.__u == "function";
203
205
  n && e.__u(), n && t == null || (e.__u = e(t));
204
206
  } else e.current = t;
205
- } catch (r) {
206
- g.__e(r, o);
207
+ } catch (i) {
208
+ y.__e(i, o);
207
209
  }
208
210
  }
209
- function Ye(e, t, o) {
210
- var n, r;
211
- if (g.unmount && g.unmount(e), (n = e.ref) && (n.current && n.current !== e.__e || me(n, null, t)), (n = e.__c) != null) {
211
+ function it(e, t, o) {
212
+ var n, i;
213
+ if (y.unmount && y.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || me(n, null, t)), (n = e.__c) != null) {
212
214
  if (n.componentWillUnmount) try {
213
215
  n.componentWillUnmount();
214
- } catch (i) {
215
- g.__e(i, t);
216
+ } catch (r) {
217
+ y.__e(r, t);
216
218
  }
217
219
  n.base = n.__P = null;
218
220
  }
219
- if (n = e.__k) for (r = 0; r < n.length; r++) n[r] && Ye(n[r], t, o || typeof e.type != "function");
221
+ if (n = e.__k) for (i = 0; i < n.length; i++) n[i] && it(n[i], t, o || typeof e.type != "function");
220
222
  o || he(e.__e), e.__c = e.__ = e.__e = void 0;
221
223
  }
222
- function zt(e, t, o) {
224
+ function Et(e, t, o) {
223
225
  return this.constructor(e, o);
224
226
  }
225
- function Tt(e, t, o) {
226
- var n, r, i, s;
227
- t == document && (t = document.documentElement), g.__ && g.__(e, t), r = (n = !1) ? null : t.__k, i = [], s = [], fe(t, e = t.__k = D(G, null, [e]), r || V, V, t.namespaceURI, r ? null : t.firstChild ? ee.call(t.childNodes) : null, i, r ? r.__e : t.firstChild, n, s), Xe(i, e, s);
227
+ function Mt(e, t, o) {
228
+ var n, i, r, s;
229
+ t == document && (t = document.documentElement), y.__ && y.__(e, t), i = (n = !1) ? null : t.__k, r = [], s = [], fe(t, e = t.__k = D(W, 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);
228
230
  }
229
- function Je(e, t) {
230
- var o = { __c: t = "__cC" + Ve++, __: e, Consumer: function(n, r) {
231
- return n.children(r);
232
- }, Provider: function(n) {
233
- var r, i;
234
- return this.getChildContext || (r = /* @__PURE__ */ new Set(), (i = {})[t] = this, this.getChildContext = function() {
231
+ function rt(e) {
232
+ function t(o) {
233
+ var n, i;
234
+ return this.getChildContext || (n = /* @__PURE__ */ new Set(), (i = {})[t.__c] = this, this.getChildContext = function() {
235
235
  return i;
236
236
  }, this.componentWillUnmount = function() {
237
- r = null;
238
- }, this.shouldComponentUpdate = function(s) {
239
- this.props.value !== s.value && r.forEach(function(l) {
240
- l.__e = !0, _e(l);
237
+ n = null;
238
+ }, this.shouldComponentUpdate = function(r) {
239
+ this.props.value != r.value && n.forEach(function(s) {
240
+ s.__e = !0, ue(s);
241
241
  });
242
- }, this.sub = function(s) {
243
- r.add(s);
244
- var l = s.componentWillUnmount;
245
- s.componentWillUnmount = function() {
246
- r && r.delete(s), l && l.call(s);
242
+ }, this.sub = function(r) {
243
+ n.add(r);
244
+ var s = r.componentWillUnmount;
245
+ r.componentWillUnmount = function() {
246
+ n && n.delete(r), s && s.call(r);
247
247
  };
248
- }), n.children;
249
- } };
250
- return o.Provider.__ = o.Consumer.contextType = o;
248
+ }), o.children;
249
+ }
250
+ return t.__c = "__cC" + Ke++, t.__ = e, t.Provider = t.__l = (t.Consumer = function(o, n) {
251
+ return o.children(n);
252
+ }).contextType = t, t;
251
253
  }
252
- ee = Be.slice, g = { __e: function(e, t, o, n) {
253
- for (var r, i, s; t = t.__; ) if ((r = t.__c) && !r.__) try {
254
- if ((i = r.constructor) && i.getDerivedStateFromError != null && (r.setState(i.getDerivedStateFromError(e)), s = r.__d), r.componentDidCatch != null && (r.componentDidCatch(e, n || {}), s = r.__d), s) return r.__E = r;
254
+ ne = Ze.slice, y = { __e: function(e, t, o, n) {
255
+ for (var i, r, s; t = t.__; ) if ((i = t.__c) && !i.__) try {
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;
255
257
  } catch (l) {
256
258
  e = l;
257
259
  }
258
260
  throw e;
259
- } }, Oe = 0, E.prototype.setState = function(e, t) {
261
+ } }, qe = 0, R.prototype.setState = function(e, t) {
260
262
  var o;
261
- o = this.__s != null && this.__s !== this.state ? this.__s : this.__s = U({}, this.state), typeof e == "function" && (e = e(U({}, o), this.props)), e && U(o, e), e != null && this.__v && (t && this._sb.push(t), _e(this));
262
- }, E.prototype.forceUpdate = function(e) {
263
- this.__v && (this.__e = !0, e && this.__h.push(e), _e(this));
264
- }, E.prototype.render = G, H = [], Ie = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, le = function(e, t) {
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) {
265
+ this.__v && (this.__e = !0, e && this.__h.push(e), ue(this));
266
+ }, R.prototype.render = W, O = [], Xe = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ye = function(e, t) {
265
267
  return e.__v.__b - t.__v.__b;
266
- }, Z.__r = 0, We = /(PointerCapture)$|Capture$/i, de = 0, ae = Ce(!1), ce = Ce(!0), Ve = 0;
267
- var Lt = 0;
268
- function f(e, t, o, n, r, i) {
268
+ }, te.__r = 0, Je = /(PointerCapture)$|Capture$/i, de = 0, ae = ke(!1), ce = ke(!0), Ke = 0;
269
+ var It = 0;
270
+ function f(e, t, o, n, i, r) {
269
271
  t || (t = {});
270
272
  var s, l, a = t;
271
273
  if ("ref" in a) for (l in a = {}, t) l == "ref" ? s = t[l] : a[l] = t[l];
272
- var c = { type: e, props: a, key: o, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Lt, __i: -1, __u: 0, __source: r, __self: i };
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 };
273
275
  if (typeof e == "function" && (s = e.defaultProps)) for (l in s) a[l] === void 0 && (a[l] = s[l]);
274
- return g.vnode && g.vnode(c), c;
276
+ return y.vnode && y.vnode(c), c;
275
277
  }
276
- var I, C, ne, ke, B = 0, Ze = [], k = g, be = k.__b, ze = k.__r, Te = k.diffed, Le = k.__c, Pe = k.unmount, xe = k.__;
277
- function oe(e, t) {
278
- k.__h && k.__h(C, e, B || t), B = 0;
279
- var o = C.__H || (C.__H = { __: [], __h: [] });
278
+ var H, 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
+ function ie(e, t) {
280
+ b.__h && b.__h(w, e, V || t), V = 0;
281
+ var o = w.__H || (w.__H = { __: [], __h: [] });
280
282
  return e >= o.__.length && o.__.push({}), o.__[e];
281
283
  }
282
- function A(e) {
283
- return B = 1, Pt(tt, e);
284
+ function $(e) {
285
+ return V = 1, $t(ct, e);
284
286
  }
285
- function Pt(e, t, o) {
286
- var n = oe(I++, 2);
287
- if (n.t = e, !n.__c && (n.__ = [o ? o(t) : tt(void 0, t), function(l) {
287
+ function $t(e, t, o) {
288
+ var n = ie(H++, 2);
289
+ if (n.t = e, !n.__c && (n.__ = [o ? o(t) : ct(void 0, t), function(l) {
288
290
  var a = n.__N ? n.__N[0] : n.__[0], c = n.t(a, l);
289
291
  a !== c && (n.__N = [c, n.__[1]], n.__c.setState({}));
290
- }], n.__c = C, !C.u)) {
291
- var r = function(l, a, c) {
292
+ }], n.__c = w, !w.__f)) {
293
+ var i = function(l, a, c) {
292
294
  if (!n.__c.__H) return !0;
293
- var u = n.__c.__H.__.filter(function(h) {
295
+ var _ = n.__c.__H.__.filter(function(h) {
294
296
  return !!h.__c;
295
297
  });
296
- if (u.every(function(h) {
298
+ if (_.every(function(h) {
297
299
  return !h.__N;
298
- })) return !i || i.call(this, l, a, c);
299
- var _ = n.__c.props !== l;
300
- return u.forEach(function(h) {
300
+ })) return !r || r.call(this, l, a, c);
301
+ var u = n.__c.props !== l;
302
+ return _.forEach(function(h) {
301
303
  if (h.__N) {
302
304
  var d = h.__[0];
303
- h.__ = h.__N, h.__N = void 0, d !== h.__[0] && (_ = !0);
305
+ h.__ = h.__N, h.__N = void 0, d !== h.__[0] && (u = !0);
304
306
  }
305
- }), i && i.call(this, l, a, c) || _;
307
+ }), r && r.call(this, l, a, c) || u;
306
308
  };
307
- C.u = !0;
308
- var i = C.shouldComponentUpdate, s = C.componentWillUpdate;
309
- C.componentWillUpdate = function(l, a, c) {
309
+ w.__f = !0;
310
+ var r = w.shouldComponentUpdate, s = w.componentWillUpdate;
311
+ w.componentWillUpdate = function(l, a, c) {
310
312
  if (this.__e) {
311
- var u = i;
312
- i = void 0, r(l, a, c), i = u;
313
+ var _ = r;
314
+ r = void 0, i(l, a, c), r = _;
313
315
  }
314
316
  s && s.call(this, l, a, c);
315
- }, C.shouldComponentUpdate = r;
317
+ }, w.shouldComponentUpdate = i;
316
318
  }
317
319
  return n.__N || n.__;
318
320
  }
319
- function N(e, t) {
320
- var o = oe(I++, 3);
321
- !k.__s && et(o.__H, t) && (o.__ = e, o.i = t, C.__H.__h.push(o));
321
+ function A(e, t) {
322
+ var o = ie(H++, 3);
323
+ !b.__s && at(o.__H, t) && (o.__ = e, o.u = t, w.__H.__h.push(o));
322
324
  }
323
- function W(e) {
324
- return B = 5, pe(function() {
325
+ function G(e) {
326
+ return V = 5, ve(function() {
325
327
  return { current: e };
326
328
  }, []);
327
329
  }
328
- function pe(e, t) {
329
- var o = oe(I++, 7);
330
- return et(o.__H, t) && (o.__ = e(), o.__H = t, o.__h = e), o.__;
330
+ function ve(e, t) {
331
+ var o = ie(H++, 7);
332
+ return at(o.__H, t) && (o.__ = e(), o.__H = t, o.__h = e), o.__;
331
333
  }
332
- function Ne(e, t) {
333
- return B = 8, pe(function() {
334
+ function Ae(e, t) {
335
+ return V = 8, ve(function() {
334
336
  return e;
335
337
  }, t);
336
338
  }
337
- function Qe(e) {
338
- var t = C.context[e.__c], o = oe(I++, 9);
339
- return o.c = e, t ? (o.__ == null && (o.__ = !0, t.sub(C)), t.props.value) : e.__;
339
+ function lt(e) {
340
+ var t = w.context[e.__c], o = ie(H++, 9);
341
+ return o.c = e, t ? (o.__ == null && (o.__ = !0, t.sub(w)), t.props.value) : e.__;
340
342
  }
341
- function xt() {
342
- for (var e; e = Ze.shift(); ) if (e.__P && e.__H) try {
343
- e.__H.__h.forEach(J), e.__H.__h.forEach(ue), e.__H.__h = [];
343
+ function Rt() {
344
+ for (var e; e = st.shift(); ) if (e.__P && e.__H) try {
345
+ e.__H.__h.forEach(Q), e.__H.__h.forEach(_e), e.__H.__h = [];
344
346
  } catch (t) {
345
- e.__H.__h = [], k.__e(t, e.__v);
347
+ e.__H.__h = [], b.__e(t, e.__v);
346
348
  }
347
349
  }
348
- k.__b = function(e) {
349
- C = null, be && be(e);
350
- }, k.__ = function(e, t) {
350
+ b.__b = function(e) {
351
+ w = null, ze && ze(e);
352
+ }, b.__ = function(e, t) {
351
353
  e && t.__k && t.__k.__m && (e.__m = t.__k.__m), xe && xe(e, t);
352
- }, k.__r = function(e) {
353
- ze && ze(e), I = 0;
354
- var t = (C = e.__c).__H;
355
- t && (ne === C ? (t.__h = [], C.__h = [], t.__.forEach(function(o) {
356
- o.__N && (o.__ = o.__N), o.i = o.__N = void 0;
357
- })) : (t.__h.forEach(J), t.__h.forEach(ue), t.__h = [], I = 0)), ne = C;
358
- }, k.diffed = function(e) {
359
- Te && Te(e);
354
+ }, b.__r = function(e) {
355
+ Pe && Pe(e), H = 0;
356
+ var t = (w = e.__c).__H;
357
+ t && (re === w ? (t.__h = [], w.__h = [], t.__.forEach(function(o) {
358
+ o.__N && (o.__ = o.__N), o.u = o.__N = void 0;
359
+ })) : (t.__h.forEach(Q), t.__h.forEach(_e), t.__h = [], H = 0)), re = w;
360
+ }, b.diffed = function(e) {
361
+ Ne && Ne(e);
360
362
  var t = e.__c;
361
- t && t.__H && (t.__H.__h.length && (Ze.push(t) !== 1 && ke === k.requestAnimationFrame || ((ke = k.requestAnimationFrame) || Nt)(xt)), t.__H.__.forEach(function(o) {
362
- o.i && (o.__H = o.i), o.i = void 0;
363
- })), ne = C = null;
364
- }, k.__c = function(e, t) {
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) {
364
+ o.u && (o.__H = o.u), o.u = void 0;
365
+ })), re = w = null;
366
+ }, b.__c = function(e, t) {
365
367
  t.some(function(o) {
366
368
  try {
367
- o.__h.forEach(J), o.__h = o.__h.filter(function(n) {
368
- return !n.__ || ue(n);
369
+ o.__h.forEach(Q), o.__h = o.__h.filter(function(n) {
370
+ return !n.__ || _e(n);
369
371
  });
370
372
  } catch (n) {
371
- t.some(function(r) {
372
- r.__h && (r.__h = []);
373
- }), t = [], k.__e(n, o.__v);
373
+ t.some(function(i) {
374
+ i.__h && (i.__h = []);
375
+ }), t = [], b.__e(n, o.__v);
374
376
  }
375
- }), Le && Le(e, t);
376
- }, k.unmount = function(e) {
377
- Pe && Pe(e);
377
+ }), Se && Se(e, t);
378
+ }, b.unmount = function(e) {
379
+ Le && Le(e);
378
380
  var t, o = e.__c;
379
381
  o && o.__H && (o.__H.__.forEach(function(n) {
380
382
  try {
381
- J(n);
382
- } catch (r) {
383
- t = r;
383
+ Q(n);
384
+ } catch (i) {
385
+ t = i;
384
386
  }
385
- }), o.__H = void 0, t && k.__e(t, o.__v));
387
+ }), o.__H = void 0, t && b.__e(t, o.__v));
386
388
  };
387
- var Se = typeof requestAnimationFrame == "function";
388
- function Nt(e) {
389
+ var Ee = typeof requestAnimationFrame == "function";
390
+ function Ft(e) {
389
391
  var t, o = function() {
390
- clearTimeout(n), Se && cancelAnimationFrame(t), setTimeout(e);
392
+ clearTimeout(n), Ee && cancelAnimationFrame(t), setTimeout(e);
391
393
  }, n = setTimeout(o, 100);
392
- Se && (t = requestAnimationFrame(o));
394
+ Ee && (t = requestAnimationFrame(o));
393
395
  }
394
- function J(e) {
395
- var t = C, o = e.__c;
396
- typeof o == "function" && (e.__c = void 0, o()), C = t;
396
+ function Q(e) {
397
+ var t = w, o = e.__c;
398
+ typeof o == "function" && (e.__c = void 0, o()), w = t;
397
399
  }
398
- function ue(e) {
399
- var t = C;
400
- e.__c = e.__(), C = t;
400
+ function _e(e) {
401
+ var t = w;
402
+ e.__c = e.__(), w = t;
401
403
  }
402
- function et(e, t) {
404
+ function at(e, t) {
403
405
  return !e || e.length !== t.length || t.some(function(o, n) {
404
406
  return o !== e[n];
405
407
  });
406
408
  }
407
- function tt(e, t) {
409
+ function ct(e, t) {
408
410
  return typeof t == "function" ? t(e) : t;
409
411
  }
410
- const St = (e) => ({
412
+ const Ut = (e) => ({
411
413
  saveGameData(t) {
412
414
  try {
413
415
  const o = {
@@ -445,8 +447,8 @@ const St = (e) => ({
445
447
  console.error("Failed to reset game state:", t);
446
448
  }
447
449
  }
448
- }), ot = Je(void 0), $t = ({ children: e, config: t }) => {
449
- const o = W(t), n = St(t.lcPrefix + "score"), r = n.loadGameData(), [i, s] = A({
450
+ }), ut = rt(void 0), Ot = ({ children: e, config: t }) => {
451
+ const o = G(t), n = Ut(t.lcPrefix + "score"), i = n.loadGameData(), [r, s] = $({
450
452
  currentLevel: 1,
451
453
  highestUnlockedLevel: 1,
452
454
  currentTier: 1,
@@ -467,15 +469,15 @@ const St = (e) => ({
467
469
  foodCollected: 0,
468
470
  totalFoodCount: 0,
469
471
  showClue: !1,
470
- ...r || {}
472
+ ...i || {}
471
473
  });
472
- N(() => {
473
- n.saveGameData(i);
474
+ A(() => {
475
+ n.saveGameData(r);
474
476
  }, [
475
- i.highestUnlockedLevel,
476
- i.levelScores,
477
- i.totalScore,
478
- i.currentLevel
477
+ r.highestUnlockedLevel,
478
+ r.levelScores,
479
+ r.totalScore,
480
+ r.currentLevel
479
481
  ]);
480
482
  const l = () => {
481
483
  n.resetGameData(), s((a) => ({
@@ -497,10 +499,10 @@ const St = (e) => ({
497
499
  }));
498
500
  };
499
501
  return /* @__PURE__ */ f(
500
- ot.Provider,
502
+ ut.Provider,
501
503
  {
502
504
  value: {
503
- gameState: i,
505
+ gameState: r,
504
506
  setGameState: s,
505
507
  config: o,
506
508
  resetGame: l
@@ -508,179 +510,367 @@ const St = (e) => ({
508
510
  children: e
509
511
  }
510
512
  );
511
- }, nt = () => {
512
- const e = Qe(ot);
513
+ }, _t = () => {
514
+ const e = lt(ut);
513
515
  if (!e)
514
516
  throw new Error("useGameContext must be used within a GameProvider");
515
517
  return e;
516
518
  };
517
- function rt(e, t) {
519
+ function pe(e, t) {
520
+ if (!(e instanceof t))
521
+ throw new TypeError("Cannot call a class as a function");
522
+ }
523
+ function Dt(e, t) {
524
+ for (var o = 0; o < t.length; o++) {
525
+ var n = t[o];
526
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
527
+ }
528
+ }
529
+ function ge(e, t, o) {
530
+ return t && Dt(e.prototype, t), e;
531
+ }
532
+ function Me(e) {
533
+ return +e.replace(/px/, "");
534
+ }
535
+ function Wt(e) {
536
+ var t = window.devicePixelRatio, o = getComputedStyle(e), n = Me(o.getPropertyValue("width")), i = Me(o.getPropertyValue("height"));
537
+ e.setAttribute("width", (n * t).toString()), e.setAttribute("height", (i * t).toString());
538
+ }
539
+ function x(e, t) {
540
+ var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, n = Math.random() * (t - e) + e;
541
+ return Math.floor(n * Math.pow(10, o)) / Math.pow(10, o);
542
+ }
543
+ function Ie(e) {
544
+ return e[x(0, e.length)];
545
+ }
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 $e(e) {
548
+ var t = 1920;
549
+ return Math.log(e) / Math.log(t);
550
+ }
551
+ var Re = /* @__PURE__ */ function() {
552
+ function e(t) {
553
+ pe(this, e);
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 * $e(a);
555
+ this.confettiSpeed = {
556
+ x: _,
557
+ y: _
558
+ }, this.finalConfettiSpeedX = x(Jt, Kt, 3), this.rotationSpeed = s.length ? 0.01 : x(Zt, Qt, 3) * $e(a), this.dragForceCoefficient = x(Ht, Gt, 6), this.radius = {
559
+ x: i,
560
+ y: i
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
+ var u = n === "left" ? x(to, eo) * Math.PI / 180 : x(-15, -82) * Math.PI / 180;
563
+ this.absCos = Math.abs(Math.cos(u)), this.absSin = Math.abs(Math.sin(u));
564
+ var h = x(-150, 0), d = {
565
+ x: o.x + (n === "left" ? -h : h) * this.absCos,
566
+ y: o.y - h * this.absSin
567
+ };
568
+ this.currentPosition = Object.assign({}, d), this.initialPosition = Object.assign({}, d), this.color = s.length ? null : Ie(r), this.emoji = s.length ? Ie(s) : null, this.createdAt = (/* @__PURE__ */ new Date()).getTime(), this.direction = n;
569
+ }
570
+ return ge(e, [{
571
+ key: "draw",
572
+ value: function(o) {
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
+ }
576
+ }, {
577
+ key: "updatePosition",
578
+ value: function(o, n) {
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
+ this.emojiRotationAngle += this.rotationSpeed * o % (2 * Math.PI);
582
+ return;
583
+ }
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
+ }
586
+ }, {
587
+ key: "getIsVisibleOnCanvas",
588
+ value: function(o) {
589
+ return this.currentPosition.y < o + oo;
590
+ }
591
+ }]), e;
592
+ }();
593
+ function so() {
594
+ var e = document.createElement("canvas");
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
+ }
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
+ 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
+ confettiRadius: o,
601
+ confettiNumber: i,
602
+ confettiColors: s,
603
+ emojis: a,
604
+ emojiSize: _
605
+ };
606
+ }
607
+ var ao = /* @__PURE__ */ function() {
608
+ function e(t) {
609
+ var o = this;
610
+ pe(this, e), this.canvasContext = t, this.shapes = [], this.promise = new Promise(function(n) {
611
+ return o.resolvePromise = n;
612
+ });
613
+ }
614
+ return ge(e, [{
615
+ key: "getBatchCompletePromise",
616
+ value: function() {
617
+ return this.promise;
618
+ }
619
+ }, {
620
+ key: "addShapes",
621
+ value: function() {
622
+ var o;
623
+ (o = this.shapes).push.apply(o, arguments);
624
+ }
625
+ }, {
626
+ key: "complete",
627
+ value: function() {
628
+ var o;
629
+ return this.shapes.length ? !1 : ((o = this.resolvePromise) === null || o === void 0 || o.call(this), !0);
630
+ }
631
+ }, {
632
+ key: "processShapes",
633
+ value: function(o, n, i) {
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
+ });
638
+ }
639
+ }]), e;
640
+ }(), co = /* @__PURE__ */ function() {
641
+ function e() {
642
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
643
+ pe(this, e), this.activeConfettiBatches = [], this.canvas = t.canvas || so(), this.canvasContext = this.canvas.getContext("2d"), this.requestAnimationFrameRequested = !1, this.lastUpdated = (/* @__PURE__ */ new Date()).getTime(), this.iterationIndex = 0, this.loop = this.loop.bind(this), requestAnimationFrame(this.loop);
644
+ }
645
+ return ge(e, [{
646
+ key: "loop",
647
+ value: function() {
648
+ this.requestAnimationFrameRequested = !1, Wt(this.canvas);
649
+ var o = (/* @__PURE__ */ new Date()).getTime(), n = o - this.lastUpdated, i = this.canvas.offsetHeight, r = this.iterationIndex % 10 === 0;
650
+ this.activeConfettiBatches = this.activeConfettiBatches.filter(function(s) {
651
+ return s.processShapes({
652
+ timeDelta: n,
653
+ currentTime: o
654
+ }, i, r), r ? !s.complete() : !0;
655
+ }), this.iterationIndex++, this.queueAnimationFrameIfNeeded(o);
656
+ }
657
+ }, {
658
+ key: "queueAnimationFrameIfNeeded",
659
+ value: function(o) {
660
+ this.requestAnimationFrameRequested || this.activeConfettiBatches.length < 1 || (this.requestAnimationFrameRequested = !0, this.lastUpdated = o || (/* @__PURE__ */ new Date()).getTime(), requestAnimationFrame(this.loop));
661
+ }
662
+ }, {
663
+ key: "addConfetti",
664
+ value: function() {
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
+ x: 0,
667
+ y: h
668
+ }, v = {
669
+ x: _,
670
+ y: h
671
+ }, m = new ao(this.canvasContext), C = 0; C < r / 2; C++) {
672
+ var g = new Re({
673
+ initialPosition: d,
674
+ direction: "right",
675
+ confettiRadius: i,
676
+ confettiColors: s,
677
+ confettiNumber: r,
678
+ emojis: l,
679
+ emojiSize: a,
680
+ canvasWidth: _
681
+ }), p = new Re({
682
+ initialPosition: v,
683
+ direction: "left",
684
+ confettiRadius: i,
685
+ confettiColors: s,
686
+ confettiNumber: r,
687
+ emojis: l,
688
+ emojiSize: a,
689
+ canvasWidth: _
690
+ });
691
+ m.addShapes(g, p);
692
+ }
693
+ return this.activeConfettiBatches.push(m), this.queueAnimationFrameIfNeeded(), m.getBatchCompletePromise();
694
+ }
695
+ }, {
696
+ key: "clearCanvas",
697
+ value: function() {
698
+ this.activeConfettiBatches = [];
699
+ }
700
+ }, {
701
+ key: "destroyCanvas",
702
+ value: function() {
703
+ this.canvas.remove();
704
+ }
705
+ }]), e;
706
+ }();
707
+ function dt(e, t) {
518
708
  for (var o in t) e[o] = t[o];
519
709
  return e;
520
710
  }
521
- function $e(e, t) {
711
+ function Fe(e, t) {
522
712
  for (var o in e) if (o !== "__source" && !(o in t)) return !0;
523
713
  for (var n in t) if (n !== "__source" && e[n] !== t[n]) return !0;
524
714
  return !1;
525
715
  }
526
- function Me(e, t) {
716
+ function Ue(e, t) {
527
717
  this.props = e, this.context = t;
528
718
  }
529
- (Me.prototype = new E()).isPureReactComponent = !0, Me.prototype.shouldComponentUpdate = function(e, t) {
530
- return $e(this.props, e) || $e(this.state, t);
719
+ (Ue.prototype = new R()).isPureReactComponent = !0, Ue.prototype.shouldComponentUpdate = function(e, t) {
720
+ return Fe(this.props, e) || Fe(this.state, t);
531
721
  };
532
- var Ae = g.__b;
533
- g.__b = function(e) {
534
- e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Ae && Ae(e);
722
+ var Oe = y.__b;
723
+ y.__b = function(e) {
724
+ e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Oe && Oe(e);
535
725
  };
536
- var Mt = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
537
- function it(e) {
726
+ var uo = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
727
+ function ht(e) {
538
728
  function t(o) {
539
- var n = rt({}, o);
729
+ var n = dt({}, o);
540
730
  return delete n.ref, e(n, o.ref || null);
541
731
  }
542
- return t.$$typeof = Mt, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
732
+ return t.$$typeof = uo, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
543
733
  }
544
- var At = g.__e;
545
- g.__e = function(e, t, o, n) {
734
+ var _o = y.__e;
735
+ y.__e = function(e, t, o, n) {
546
736
  if (e.then) {
547
- for (var r, i = t; i = i.__; ) if ((r = i.__c) && r.__c) return t.__e == null && (t.__e = o.__e, t.__k = o.__k), r.__c(e, t);
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);
548
738
  }
549
- At(e, t, o, n);
739
+ _o(e, t, o, n);
550
740
  };
551
- var Ee = g.unmount;
552
- function st(e, t, o) {
741
+ var De = y.unmount;
742
+ function ft(e, t, o) {
553
743
  return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(n) {
554
744
  typeof n.__c == "function" && n.__c();
555
- }), e.__c.__H = null), (e = rt({}, e)).__c != null && (e.__c.__P === o && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
556
- return st(n, t, o);
745
+ }), e.__c.__H = null), (e = dt({}, e)).__c != null && (e.__c.__P === o && (e.__c.__P = t), e.__c.__e = !0, e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
746
+ return ft(n, t, o);
557
747
  })), e;
558
748
  }
559
- function lt(e, t, o) {
749
+ function mt(e, t, o) {
560
750
  return e && o && (e.__v = null, e.__k = e.__k && e.__k.map(function(n) {
561
- return lt(n, t, o);
751
+ return mt(n, t, o);
562
752
  }), e.__c && e.__c.__P === t && (e.__e && o.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = o)), e;
563
753
  }
564
- function re() {
754
+ function se() {
565
755
  this.__u = 0, this.o = null, this.__b = null;
566
756
  }
567
- function at(e) {
757
+ function vt(e) {
568
758
  var t = e.__.__c;
569
759
  return t && t.__a && t.__a(e);
570
760
  }
571
- function X() {
761
+ function K() {
572
762
  this.i = null, this.l = null;
573
763
  }
574
- g.unmount = function(e) {
764
+ y.unmount = function(e) {
575
765
  var t = e.__c;
576
- t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), Ee && Ee(e);
577
- }, (re.prototype = new E()).__c = function(e, t) {
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) {
578
768
  var o = t.__c, n = this;
579
769
  n.o == null && (n.o = []), n.o.push(o);
580
- var r = at(n.__v), i = !1, s = function() {
581
- i || (i = !0, o.__R = null, r ? r(l) : l());
770
+ var i = vt(n.__v), r = !1, s = function() {
771
+ r || (r = !0, o.__R = null, i ? i(l) : l());
582
772
  };
583
773
  o.__R = s;
584
774
  var l = function() {
585
775
  if (!--n.__u) {
586
776
  if (n.state.__a) {
587
777
  var a = n.state.__a;
588
- n.__v.__k[0] = lt(a, a.__c.__P, a.__c.__O);
778
+ n.__v.__k[0] = mt(a, a.__c.__P, a.__c.__O);
589
779
  }
590
780
  var c;
591
781
  for (n.setState({ __a: n.__b = null }); c = n.o.pop(); ) c.forceUpdate();
592
782
  }
593
783
  };
594
784
  n.__u++ || 32 & t.__u || n.setState({ __a: n.__b = n.__v.__k[0] }), e.then(s, s);
595
- }, re.prototype.componentWillUnmount = function() {
785
+ }, se.prototype.componentWillUnmount = function() {
596
786
  this.o = [];
597
- }, re.prototype.render = function(e, t) {
787
+ }, se.prototype.render = function(e, t) {
598
788
  if (this.__b) {
599
789
  if (this.__v.__k) {
600
790
  var o = document.createElement("div"), n = this.__v.__k[0].__c;
601
- this.__v.__k[0] = st(this.__b, o, n.__O = n.__P);
791
+ this.__v.__k[0] = ft(this.__b, o, n.__O = n.__P);
602
792
  }
603
793
  this.__b = null;
604
794
  }
605
- var r = t.__a && D(G, null, e.fallback);
606
- return r && (r.__u &= -33), [D(G, null, t.__a ? null : e.children), r];
795
+ var i = t.__a && D(W, null, e.fallback);
796
+ return i && (i.__u &= -33), [D(W, null, t.__a ? null : e.children), i];
607
797
  };
608
- var Ue = function(e, t, o) {
798
+ var We = function(e, t, o) {
609
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; ) {
610
800
  for (; o.length > 3; ) o.pop()();
611
801
  if (o[1] < o[0]) break;
612
802
  e.i = o = o[2];
613
803
  }
614
804
  };
615
- (X.prototype = new E()).__a = function(e) {
616
- var t = this, o = at(t.__v), n = t.l.get(e);
617
- return n[0]++, function(r) {
618
- var i = function() {
619
- t.props.revealOrder ? (n.push(r), Ue(t, e, n)) : r();
805
+ (K.prototype = new R()).__a = function(e) {
806
+ var t = this, o = vt(t.__v), n = t.l.get(e);
807
+ return n[0]++, function(i) {
808
+ var r = function() {
809
+ t.props.revealOrder ? (n.push(i), We(t, e, n)) : i();
620
810
  };
621
- o ? o(i) : i();
811
+ o ? o(r) : r();
622
812
  };
623
- }, X.prototype.render = function(e) {
813
+ }, K.prototype.render = function(e) {
624
814
  this.i = null, this.l = /* @__PURE__ */ new Map();
625
- var t = Q(e.children);
815
+ var t = oe(e.children);
626
816
  e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
627
817
  for (var o = t.length; o--; ) this.l.set(t[o], this.i = [1, 0, this.i]);
628
818
  return e.children;
629
- }, X.prototype.componentDidUpdate = X.prototype.componentDidMount = function() {
819
+ }, K.prototype.componentDidUpdate = K.prototype.componentDidMount = function() {
630
820
  var e = this;
631
821
  this.l.forEach(function(t, o) {
632
- Ue(e, o, t);
822
+ We(e, o, t);
633
823
  });
634
824
  };
635
- var Et = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Ut = /^(?: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]/, Ft = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Rt = /[A-Z0-9]/g, Ht = typeof document < "u", Dt = function(e) {
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)/, vo = /[A-Z0-9]/g, po = typeof document < "u", go = function(e) {
636
826
  return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
637
827
  };
638
- E.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
639
- Object.defineProperty(E.prototype, e, { configurable: !0, get: function() {
828
+ R.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
829
+ Object.defineProperty(R.prototype, e, { configurable: !0, get: function() {
640
830
  return this["UNSAFE_" + e];
641
831
  }, set: function(t) {
642
832
  Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
643
833
  } });
644
834
  });
645
- var Fe = g.event;
646
- function Gt() {
835
+ var je = y.event;
836
+ function Co() {
647
837
  }
648
- function Ot() {
838
+ function yo() {
649
839
  return this.cancelBubble;
650
840
  }
651
- function It() {
841
+ function wo() {
652
842
  return this.defaultPrevented;
653
843
  }
654
- g.event = function(e) {
655
- return Fe && (e = Fe(e)), e.persist = Gt, e.isPropagationStopped = Ot, e.isDefaultPrevented = It, 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;
656
846
  };
657
- var Wt = { enumerable: !1, configurable: !0, get: function() {
847
+ var bo = { enumerable: !1, configurable: !0, get: function() {
658
848
  return this.class;
659
- } }, Re = g.vnode;
660
- g.vnode = function(e) {
849
+ } }, He = y.vnode;
850
+ y.vnode = function(e) {
661
851
  typeof e.type == "string" && function(t) {
662
- var o = t.props, n = t.type, r = {}, i = n.indexOf("-") === -1;
852
+ var o = t.props, n = t.type, i = {}, r = n.indexOf("-") === -1;
663
853
  for (var s in o) {
664
854
  var l = o[s];
665
- if (!(s === "value" && "defaultValue" in o && l == null || Ht && s === "children" && n === "noscript" || s === "class" || s === "className")) {
855
+ if (!(s === "value" && "defaultValue" in o && l == null || po && s === "children" && n === "noscript" || s === "class" || s === "className")) {
666
856
  var a = s.toLowerCase();
667
- 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" || Dt(o.type) ? a === "onfocus" ? s = "onfocusin" : a === "onblur" ? s = "onfocusout" : Ft.test(s) && (s = a) : a = s = "oninput" : i && Ut.test(s) ? s = s.replace(Rt, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && r[s = a] && (s = "oninputCapture"), r[s] = l;
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(vo, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[s = a] && (s = "oninputCapture"), i[s] = l;
668
858
  }
669
859
  }
670
- n == "select" && r.multiple && Array.isArray(r.value) && (r.value = Q(o.children).forEach(function(c) {
671
- c.props.selected = r.value.indexOf(c.props.value) != -1;
672
- })), n == "select" && r.defaultValue != null && (r.value = Q(o.children).forEach(function(c) {
673
- c.props.selected = r.multiple ? r.defaultValue.indexOf(c.props.value) != -1 : r.defaultValue == c.props.value;
674
- })), o.class && !o.className ? (r.class = o.class, Object.defineProperty(r, "className", Wt)) : (o.className && !o.class || o.class && o.className) && (r.class = r.className = o.className), t.props = r;
675
- }(e), e.$$typeof = Et, Re && Re(e);
860
+ n == "select" && i.multiple && Array.isArray(i.value) && (i.value = oe(o.children).forEach(function(c) {
861
+ c.props.selected = i.value.indexOf(c.props.value) != -1;
862
+ })), n == "select" && i.defaultValue != null && (i.value = oe(o.children).forEach(function(c) {
863
+ c.props.selected = i.multiple ? i.defaultValue.indexOf(c.props.value) != -1 : i.defaultValue == c.props.value;
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, He && He(e);
676
866
  };
677
- var He = g.__r;
678
- g.__r = function(e) {
679
- He && He(e), e.__c;
867
+ var Ge = y.__r;
868
+ y.__r = function(e) {
869
+ Ge && Ge(e), e.__c;
680
870
  };
681
- var De = g.diffed;
682
- g.diffed = function(e) {
683
- De && De(e);
871
+ var Be = y.diffed;
872
+ y.diffed = function(e) {
873
+ Be && Be(e);
684
874
  var t = e.props, o = e.__e;
685
875
  o != null && e.type === "textarea" && "value" in t && t.value !== o.value && (o.value = t.value == null ? "" : t.value);
686
876
  };
@@ -690,14 +880,14 @@ g.diffed = function(e) {
690
880
  * This source code is licensed under the ISC license.
691
881
  * See the LICENSE file in the root directory of this source tree.
692
882
  */
693
- const Vt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ct = (...e) => e.filter((t, o, n) => !!t && t.trim() !== "" && n.indexOf(t) === o).join(" ").trim();
883
+ const ko = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), pt = (...e) => e.filter((t, o, n) => !!t && t.trim() !== "" && n.indexOf(t) === o).join(" ").trim();
694
884
  /**
695
885
  * @license lucide-react v0.473.0 - ISC
696
886
  *
697
887
  * This source code is licensed under the ISC license.
698
888
  * See the LICENSE file in the root directory of this source tree.
699
889
  */
700
- var Bt = {
890
+ var To = {
701
891
  xmlns: "http://www.w3.org/2000/svg",
702
892
  width: 24,
703
893
  height: 24,
@@ -714,31 +904,31 @@ var Bt = {
714
904
  * This source code is licensed under the ISC license.
715
905
  * See the LICENSE file in the root directory of this source tree.
716
906
  */
717
- const jt = it(
907
+ const zo = ht(
718
908
  ({
719
909
  color: e = "currentColor",
720
910
  size: t = 24,
721
911
  strokeWidth: o = 2,
722
912
  absoluteStrokeWidth: n,
723
- className: r = "",
724
- children: i,
913
+ className: i = "",
914
+ children: r,
725
915
  iconNode: s,
726
916
  ...l
727
917
  }, a) => D(
728
918
  "svg",
729
919
  {
730
920
  ref: a,
731
- ...Bt,
921
+ ...To,
732
922
  width: t,
733
923
  height: t,
734
924
  stroke: e,
735
925
  strokeWidth: n ? Number(o) * 24 / Number(t) : o,
736
- className: ct("lucide", r),
926
+ className: pt("lucide", i),
737
927
  ...l
738
928
  },
739
929
  [
740
- ...s.map(([c, u]) => D(c, u)),
741
- ...Array.isArray(i) ? i : [i]
930
+ ...s.map(([c, _]) => D(c, _)),
931
+ ...Array.isArray(r) ? r : [r]
742
932
  ]
743
933
  )
744
934
  );
@@ -748,13 +938,13 @@ const jt = it(
748
938
  * This source code is licensed under the ISC license.
749
939
  * See the LICENSE file in the root directory of this source tree.
750
940
  */
751
- const qt = (e, t) => {
752
- const o = it(
753
- ({ className: n, ...r }, i) => D(jt, {
754
- ref: i,
941
+ const Po = (e, t) => {
942
+ const o = ht(
943
+ ({ className: n, ...i }, r) => D(zo, {
944
+ ref: r,
755
945
  iconNode: t,
756
- className: ct(`lucide-${Vt(e)}`, n),
757
- ...r
946
+ className: pt(`lucide-${ko(e)}`, n),
947
+ ...i
758
948
  })
759
949
  );
760
950
  return o.displayName = `${e}`, o;
@@ -765,7 +955,7 @@ const qt = (e, t) => {
765
955
  * This source code is licensed under the ISC license.
766
956
  * See the LICENSE file in the root directory of this source tree.
767
957
  */
768
- const Kt = [
958
+ const No = [
769
959
  [
770
960
  "path",
771
961
  {
@@ -774,49 +964,49 @@ const Kt = [
774
964
  }
775
965
  ],
776
966
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
777
- ], Xt = qt("Settings", Kt), _t = Je(void 0), Yt = ({ children: e }) => {
778
- const [t, o] = A(null), [n, r] = A(!1), [i, s] = A(
967
+ ], So = Po("Settings", No), gt = rt(void 0), Lo = ({ children: e }) => {
968
+ const [t, o] = $(null), [n, i] = $(!1), [r, s] = $(
779
969
  "info"
780
- ), [l, a] = A(null), c = Ne(() => {
781
- r(!1), l && (clearTimeout(l), a(null));
782
- }, [l]), u = Ne(
783
- (_, h = "info", d = 3e3) => {
784
- if (n && c(), o(_), s(h), r(!0), d > 0) {
785
- const m = setTimeout(() => {
786
- r(!1);
970
+ ), [l, a] = $(null), c = Ae(() => {
971
+ i(!1), l && (clearTimeout(l), a(null));
972
+ }, [l]), _ = Ae(
973
+ (u, h = "info", d = 3e3) => {
974
+ if (n && c(), o(u), s(h), i(!0), d > 0) {
975
+ const v = setTimeout(() => {
976
+ i(!1);
787
977
  }, d);
788
- a(m);
978
+ a(v);
789
979
  }
790
980
  },
791
981
  [n, c]
792
982
  );
793
983
  return /* @__PURE__ */ f(
794
- _t.Provider,
984
+ gt.Provider,
795
985
  {
796
- value: { message: t, visible: n, type: i, showToast: u, hideToast: c },
986
+ value: { message: t, visible: n, type: r, showToast: _, hideToast: c },
797
987
  children: e
798
988
  }
799
989
  );
800
- }, ve = () => {
801
- const e = Qe(_t);
990
+ }, Ce = () => {
991
+ const e = lt(gt);
802
992
  if (!e)
803
993
  throw new Error("useToast must be used within a ToastProvider");
804
994
  return e;
805
- }, Jt = ({
995
+ }, xo = ({
806
996
  i18n: e,
807
997
  totalTiers: t,
808
998
  currentTier: o,
809
999
  highestUnlockedTier: n,
810
- onTierChange: r,
811
- disabled: i
1000
+ onTierChange: i,
1001
+ disabled: r
812
1002
  }) => /* @__PURE__ */ f("div", { className: "tier-selector", children: /* @__PURE__ */ f(
813
1003
  "select",
814
1004
  {
815
1005
  value: o,
816
1006
  onChange: (s) => {
817
- s.target && s.target.value && r(Number(s.target.value));
1007
+ s.target && s.target.value && i(Number(s.target.value));
818
1008
  },
819
- disabled: i,
1009
+ disabled: r,
820
1010
  className: "tier-dropdown",
821
1011
  children: Array.from({ length: t }, (s, l) => l + 1).map((s) => /* @__PURE__ */ f(
822
1012
  "option",
@@ -832,23 +1022,23 @@ const Kt = [
832
1022
  `tier-${s}`
833
1023
  ))
834
1024
  }
835
- ) }), Zt = ([e, t]) => Array.from({ length: t - e + 1 }, (o, n) => e + n), Qt = ({
1025
+ ) }), Ao = ([e, t]) => Array.from({ length: t - e + 1 }, (o, n) => e + n), Eo = ({
836
1026
  i18n: e,
837
1027
  levelsRange: t,
838
1028
  currentLevel: o,
839
1029
  highestUnlockedLevel: n,
840
- onLevelChange: r,
841
- disabled: i
1030
+ onLevelChange: i,
1031
+ disabled: r
842
1032
  }) => {
843
- const s = Zt(t);
1033
+ const s = Ao(t);
844
1034
  return /* @__PURE__ */ f("div", { className: "level-selector", children: /* @__PURE__ */ f(
845
1035
  "select",
846
1036
  {
847
1037
  value: o,
848
1038
  onChange: (l) => {
849
- l.target && l.target.value && r(Number(l.target.value));
1039
+ l.target && l.target.value && i(Number(l.target.value));
850
1040
  },
851
- disabled: i,
1041
+ disabled: r,
852
1042
  className: "level-dropdown",
853
1043
  children: s.map((l) => /* @__PURE__ */ f(
854
1044
  "option",
@@ -865,48 +1055,48 @@ const Kt = [
865
1055
  ))
866
1056
  }
867
1057
  ) });
868
- }, ie = ({
1058
+ }, le = ({
869
1059
  isOpen: e,
870
1060
  title: t,
871
1061
  message: o,
872
1062
  children: n,
873
- noConfirm: r = !1,
874
- noCancel: i = !1,
1063
+ noConfirm: i = !1,
1064
+ noCancel: r = !1,
875
1065
  confirmText: s = "OK",
876
1066
  cancelText: l = "Cancel",
877
1067
  onConfirm: a,
878
1068
  onCancel: c
879
1069
  }) => {
880
- const u = W(null);
881
- return N(() => {
882
- const _ = (h) => {
1070
+ const _ = G(null);
1071
+ return A(() => {
1072
+ const u = (h) => {
883
1073
  h.key === "Escape" && c?.();
884
1074
  };
885
- return e && document.addEventListener("keydown", _), () => {
886
- document.removeEventListener("keydown", _);
1075
+ return e && document.addEventListener("keydown", u), () => {
1076
+ document.removeEventListener("keydown", u);
887
1077
  };
888
1078
  }, [e, c]), /* @__PURE__ */ f(
889
1079
  "div",
890
1080
  {
891
1081
  className: `maze-dialog-overlay ${e ? "maze-dialog-visible" : ""}`,
892
- children: /* @__PURE__ */ f("div", { className: "maze-dialog", ref: u, children: [
1082
+ children: /* @__PURE__ */ f("div", { className: "maze-dialog", ref: _, children: [
893
1083
  /* @__PURE__ */ f("div", { className: "maze-dialog-title", children: t }),
894
1084
  /* @__PURE__ */ f("div", { className: "maze-dialog-content", children: n || /* @__PURE__ */ f("div", { className: "maze-dialog-message", children: o }) }),
895
1085
  /* @__PURE__ */ f("div", { className: "maze-dialog-buttons", children: [
896
- !i && /* @__PURE__ */ f("button", { className: "maze-dialog-cancel", onClick: c, children: l }),
897
- !r && /* @__PURE__ */ f("button", { className: "maze-dialog-confirm", onClick: a, children: s })
1086
+ !r && /* @__PURE__ */ f("button", { className: "maze-dialog-cancel", onClick: c, children: l }),
1087
+ !i && /* @__PURE__ */ f("button", { className: "maze-dialog-confirm", onClick: a, children: s })
898
1088
  ] })
899
1089
  ] })
900
1090
  }
901
1091
  );
902
1092
  };
903
- function eo(e) {
1093
+ function Mo(e) {
904
1094
  return function() {
905
1095
  let t = e += 1831565813;
906
1096
  return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
907
1097
  };
908
1098
  }
909
- const ge = [
1099
+ const ye = [
910
1100
  // Tier 1 (Levels 1-12) - Beginner
911
1101
  [
912
1102
  { size: 8, seed: 12345, method: "backtracking" },
@@ -1042,7 +1232,7 @@ const ge = [
1042
1232
  { size: 68, seed: 33341, method: "backtracking" }
1043
1233
  // Level 60 - Master
1044
1234
  ]
1045
- ], se = {
1235
+ ], ee = {
1046
1236
  lcPrefix: "maze-",
1047
1237
  i18n: {
1048
1238
  reset: "Reset",
@@ -1078,6 +1268,7 @@ const ge = [
1078
1268
  renderConfig: {
1079
1269
  padding: 10,
1080
1270
  wallWidth: 4,
1271
+ minWallWidth: 1,
1081
1272
  wallColor: "#000000",
1082
1273
  exitColor: "#F44336",
1083
1274
  foodColor: "#4CAF50",
@@ -1086,10 +1277,10 @@ const ge = [
1086
1277
  playerColor: "#4CAF50",
1087
1278
  playerAtExitColor: "#FFD700"
1088
1279
  },
1089
- levelConfig: ge
1280
+ levelConfig: ye
1090
1281
  // levelsPerTier: 12,
1091
- }, to = (e) => e === 1 ? 2 : e >= 2 && e <= 5 ? 3 : e >= 6 && e <= 11 ? 4 : e >= 12 && e <= 15 ? 5 : 6;
1092
- class oo {
1282
+ }, Io = (e) => e === 1 ? 2 : e >= 2 && e <= 5 ? 3 : e >= 6 && e <= 11 ? 4 : e >= 12 && e <= 15 ? 5 : 6;
1283
+ class $o {
1093
1284
  // initially all walls exit
1094
1285
  constructor(t, o) {
1095
1286
  this.row = t, this.col = o;
@@ -1097,14 +1288,14 @@ class oo {
1097
1288
  visited = !1;
1098
1289
  walls = { top: !0, right: !0, bottom: !0, left: !0 };
1099
1290
  }
1100
- class no {
1291
+ class Ro {
1101
1292
  rows;
1102
1293
  cols;
1103
1294
  grid;
1104
1295
  seed;
1105
1296
  random;
1106
1297
  constructor(t, o, n) {
1107
- this.rows = t, this.cols = o, this.seed = n ?? Math.floor(Math.random() * 1e6), this.random = eo(this.seed), this.grid = this.initializeGrid();
1298
+ this.rows = t, this.cols = o, this.seed = n ?? Math.floor(Math.random() * 1e6), this.random = Mo(this.seed), this.grid = this.initializeGrid();
1108
1299
  }
1109
1300
  // Initialize the grid with new MazeCell objects
1110
1301
  initializeGrid() {
@@ -1112,7 +1303,7 @@ class no {
1112
1303
  for (let o = 0; o < this.rows; o++) {
1113
1304
  t[o] = [];
1114
1305
  for (let n = 0; n < this.cols; n++)
1115
- t[o][n] = new oo(o, n);
1306
+ t[o][n] = new $o(o, n);
1116
1307
  }
1117
1308
  return t;
1118
1309
  }
@@ -1122,7 +1313,7 @@ class no {
1122
1313
  }
1123
1314
  // Get all valid neighbors (top, right, bottom, left)
1124
1315
  getNeighbors(t, o) {
1125
- const n = [], r = [
1316
+ const n = [], i = [
1126
1317
  { r: -1, c: 0 },
1127
1318
  // Top
1128
1319
  { r: 0, c: 1 },
@@ -1132,8 +1323,8 @@ class no {
1132
1323
  { r: 0, c: -1 }
1133
1324
  // Left
1134
1325
  ];
1135
- for (const i of r) {
1136
- const s = t + i.r, l = o + i.c;
1326
+ for (const r of i) {
1327
+ const s = t + r.r, l = o + r.c;
1137
1328
  this.isValid(s, l) && n.push({ row: s, col: l });
1138
1329
  }
1139
1330
  return n;
@@ -1153,15 +1344,15 @@ class no {
1153
1344
  );
1154
1345
  }
1155
1346
  // Remove the wall between two adjacent cells
1156
- removeWall(t, o, n, r) {
1157
- const i = this.grid[t][o], s = this.grid[n][r];
1158
- t === n + 1 ? (i.walls.top = !1, s.walls.bottom = !1) : t === n - 1 ? (i.walls.bottom = !1, s.walls.top = !1) : o === r + 1 ? (i.walls.left = !1, s.walls.right = !1) : o === r - 1 && (i.walls.right = !1, s.walls.left = !1);
1347
+ removeWall(t, o, n, i) {
1348
+ const r = this.grid[t][o], s = this.grid[n][i];
1349
+ t === n + 1 ? (r.walls.top = !1, s.walls.bottom = !1) : t === n - 1 ? (r.walls.bottom = !1, s.walls.top = !1) : o === i + 1 ? (r.walls.left = !1, s.walls.right = !1) : o === i - 1 && (r.walls.right = !1, s.walls.left = !1);
1159
1350
  }
1160
1351
  }
1161
- class ro {
1352
+ class Fo {
1162
1353
  maze;
1163
- constructor(t, o, n, r, i = { row: 0, col: 0 }, s = { row: t - 1, col: o - 1 }) {
1164
- switch (this.maze = new no(t, o, r), n) {
1354
+ constructor(t, o, n, i, r = { row: 0, col: 0 }, s = { row: t - 1, col: o - 1 }) {
1355
+ switch (this.maze = new Ro(t, o, i), n) {
1165
1356
  case "backtracking":
1166
1357
  this.runBacktracking();
1167
1358
  break;
@@ -1171,7 +1362,7 @@ class ro {
1171
1362
  default:
1172
1363
  throw new Error(`Unknown maze generation method: ${n}`);
1173
1364
  }
1174
- this.addOpenings(i, s);
1365
+ this.addOpenings(r, s);
1175
1366
  }
1176
1367
  /**
1177
1368
  * Returns the generated Maze instance.
@@ -1182,33 +1373,33 @@ class ro {
1182
1373
  // --- Backtracking Algorithm Implementation ---
1183
1374
  runBacktracking() {
1184
1375
  const t = [], o = this.randomNumber(this.maze.rows), n = this.randomNumber(this.maze.cols);
1185
- let r = { row: o, col: n };
1186
- for (this.maze.grid[o][n].visited = !0, t.push(r); t.length > 0; ) {
1187
- r = t[t.length - 1];
1188
- const { row: i, col: s } = r, l = this.maze.getUnvisitedNeighbors(i, s);
1376
+ let i = { row: o, col: n };
1377
+ for (this.maze.grid[o][n].visited = !0, t.push(i); t.length > 0; ) {
1378
+ i = t[t.length - 1];
1379
+ const { row: r, col: s } = i, l = this.maze.getUnvisitedNeighbors(r, s);
1189
1380
  if (l.length > 0) {
1190
- const a = this.randomPick(l), { row: c, col: u } = a;
1191
- this.maze.removeWall(i, s, c, u), this.maze.grid[c][u].visited = !0, t.push(a);
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);
1192
1383
  } else
1193
1384
  t.pop();
1194
1385
  }
1195
1386
  }
1196
1387
  // --- Prim's Algorithm Implementation ---
1197
1388
  runPrims() {
1198
- const t = [], o = (i, s) => {
1199
- const l = this.maze.getNeighbors(i, s);
1389
+ const t = [], o = (r, s) => {
1390
+ const l = this.maze.getNeighbors(r, s);
1200
1391
  for (const a of l)
1201
1392
  !this.maze.grid[a.row][a.col].visited && !t.some(
1202
1393
  (c) => c.row === a.row && c.col === a.col
1203
1394
  ) && t.push(a);
1204
- }, n = this.randomNumber(this.maze.rows), r = this.randomNumber(this.maze.cols);
1205
- for (this.maze.grid[n][r].visited = !0, o(n, r); t.length > 0; ) {
1206
- const i = this.randomNumber(t.length), s = t[i], { row: l, col: a } = s, c = this.maze.getVisitedNeighbors(l, a);
1395
+ }, n = this.randomNumber(this.maze.rows), i = this.randomNumber(this.maze.cols);
1396
+ for (this.maze.grid[n][i].visited = !0, o(n, i); t.length > 0; ) {
1397
+ const r = this.randomNumber(t.length), s = t[r], { row: l, col: a } = s, c = this.maze.getVisitedNeighbors(l, a);
1207
1398
  if (c.length > 0) {
1208
- const u = this.randomPick(c);
1209
- this.maze.removeWall(l, a, u.row, u.col), this.maze.grid[l][a].visited = !0, o(l, a);
1399
+ const _ = this.randomPick(c);
1400
+ this.maze.removeWall(l, a, _.row, _.col), this.maze.grid[l][a].visited = !0, o(l, a);
1210
1401
  }
1211
- t.splice(i, 1);
1402
+ t.splice(r, 1);
1212
1403
  }
1213
1404
  }
1214
1405
  // --- Helper ---
@@ -1224,181 +1415,182 @@ class ro {
1224
1415
  return t[Math.floor(this.maze.random() * t.length)];
1225
1416
  }
1226
1417
  }
1227
- function io(e, t, o, n, r, i) {
1228
- return new ro(e, t, o, n, r, i).getMaze();
1418
+ function Uo(e, t, o, n, i, r) {
1419
+ return new Fo(e, t, o, n, i, r).getMaze();
1229
1420
  }
1230
- const so = (e, t, o) => {
1421
+ const Oo = (e, t, o) => {
1231
1422
  if (!e.isValid(t, o)) return !1;
1232
1423
  const n = e.grid[t][o];
1233
1424
  return !n.walls.top || !n.walls.right || !n.walls.bottom || !n.walls.left;
1234
- }, ut = (e, t = ge.flat()) => {
1425
+ }, Ct = (e, t = ye.flat()) => {
1235
1426
  const o = e - 1, n = t[o];
1236
1427
  if (!n)
1237
1428
  return console.error(`Cannot find Level ${e}'s config.`), null;
1238
- const r = n.size, i = r, s = r, l = n.seed, a = n.method, c = n.entry || { row: 0, col: 0 }, u = n.exit || {
1239
- row: i - 1,
1429
+ const i = n.size, r = i, s = i, l = n.seed, a = n.method, c = n.entry || { row: 0, col: 0 }, _ = n.exit || {
1430
+ row: r - 1,
1240
1431
  col: s - 1
1241
- }, _ = io(i, s, a, l, c, u), h = to(e), d = [];
1242
- for (let m = 0; m < h; m++) {
1243
- let y;
1432
+ }, u = Uo(r, s, a, l, c, _), h = Io(e), d = [];
1433
+ for (let v = 0; v < h; v++) {
1434
+ let m;
1244
1435
  do
1245
- y = {
1246
- row: Math.floor(_.random() * i),
1247
- col: Math.floor(_.random() * s)
1436
+ m = {
1437
+ row: Math.floor(u.random() * r),
1438
+ col: Math.floor(u.random() * s)
1248
1439
  };
1249
- while (y.row === c.row && y.col === c.col || y.row === u.row && y.col === u.col || !so(_, y.row, y.col) || d.some(
1250
- (w) => w.row === y.row && w.col === y.col
1440
+ while (m.row === c.row && m.col === c.col || m.row === _.row && m.col === _.col || !Oo(u, m.row, m.col) || d.some(
1441
+ (C) => C.row === m.row && C.col === m.col
1251
1442
  ));
1252
- d.push(y);
1443
+ d.push(m);
1253
1444
  }
1254
1445
  return {
1255
- maze: _,
1446
+ maze: u,
1256
1447
  playerPosition: c,
1257
- exitPosition: u,
1448
+ exitPosition: _,
1258
1449
  foodPositions: d,
1259
1450
  totalFoodCount: h,
1260
1451
  foodCollected: 0,
1261
1452
  playerPath: [c],
1262
1453
  visitCounts: { [`${c.row},${c.col}`]: 1 },
1263
1454
  moveCount: 0,
1264
- currentScore: _.rows * _.cols,
1455
+ currentScore: u.rows * u.cols * 5,
1265
1456
  playerAtExit: !1,
1266
1457
  isGameActive: !0,
1267
1458
  levelTransitioning: !1
1268
1459
  };
1269
- }, dt = ({
1460
+ }, yt = ({
1270
1461
  gameState: e,
1271
1462
  setGameState: t,
1272
1463
  config: o
1273
1464
  }) => ({
1274
1465
  generateCurrentLevelMaze: () => {
1275
- const r = ut(e.currentLevel, o.current.levelConfig.flat());
1276
- r && t((i) => ({
1277
- ...i,
1278
- ...r
1466
+ const i = Ct(e.currentLevel, o.current.levelConfig.flat());
1467
+ i && t((r) => ({
1468
+ ...r,
1469
+ ...i
1279
1470
  }));
1280
1471
  }
1281
- }), ht = (e) => pe(() => {
1282
- const t = e.map((l) => l.length), o = t.reduce((l, a) => l + a, 0), n = e.length, r = (l) => {
1472
+ }), wt = (e) => ve(() => {
1473
+ const t = e.map((l) => l.length), o = t.reduce((l, a) => l + a, 0), n = e.length, i = (l) => {
1283
1474
  if (l < 1 || l > o) return 0;
1284
1475
  let a = 0;
1285
1476
  for (let c = 0; c < t.length; c++)
1286
1477
  if (a += t[c], l <= a) return c + 1;
1287
1478
  return 0;
1288
- }, i = (l) => l < 1 || l > n ? 0 : t.slice(0, l - 1).reduce((a, c) => a + 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 = {
1289
1480
  getTotalLevels: () => o,
1290
1481
  getTotalTiers: () => n,
1291
1482
  getTierLevelsRange: (l) => {
1292
1483
  if (l < 1 || l > n) return [0, 0];
1293
- const a = i(l), c = a + t[l - 1] - 1;
1484
+ const a = r(l), c = a + t[l - 1] - 1;
1294
1485
  return [a, c];
1295
1486
  },
1296
- getTierByLevel: r,
1297
- getFirstLevelOfTier: i,
1487
+ getTierByLevel: i,
1488
+ getFirstLevelOfTier: r,
1298
1489
  getLevelConfig: (l) => {
1299
1490
  if (l < 1 || l > o) return null;
1300
- const a = r(l), c = i(a), u = l - c;
1301
- return e[a - 1][u];
1491
+ const a = i(l), c = r(a), _ = l - c;
1492
+ return e[a - 1][_];
1302
1493
  },
1303
1494
  getTierConfig: (l) => l < 1 || l > n ? null : e[l - 1],
1304
1495
  isLevelUnlocked: (l, a) => l <= a,
1305
1496
  isTierUnlocked: (l, a) => l <= a,
1306
1497
  getNextLevelInfo: (l) => {
1307
1498
  if (l >= o) return null;
1308
- const a = l + 1, c = r(l), u = r(a);
1499
+ const a = l + 1, c = i(l), _ = i(a);
1309
1500
  return {
1310
1501
  nextLevel: a,
1311
- nextTier: u,
1312
- isTierChange: u > c
1502
+ nextTier: _,
1503
+ isTierChange: _ > c
1313
1504
  };
1314
1505
  },
1315
1506
  getCurrentTierProgress: (l, a) => {
1316
- const [c, u] = s.getTierLevelsRange(a), _ = l - c + 1, h = u - c + 1;
1317
- return { current: _, total: h };
1507
+ const [c, _] = s.getTierLevelsRange(a), u = l - c + 1, h = _ - c + 1;
1508
+ return { current: u, total: h };
1318
1509
  },
1319
1510
  isLastLevelInTier: (l) => {
1320
- const a = r(l), [, c] = s.getTierLevelsRange(a);
1511
+ const a = i(l), [, c] = s.getTierLevelsRange(a);
1321
1512
  return l === c;
1322
1513
  },
1323
1514
  getPreviousLevelInfo: (l) => {
1324
1515
  if (l <= 1) return null;
1325
- const a = l - 1, c = r(l), u = r(a);
1516
+ const a = l - 1, c = i(l), _ = i(a);
1326
1517
  return {
1327
1518
  prevLevel: a,
1328
- prevTier: u,
1329
- isTierChange: u < c
1519
+ prevTier: _,
1520
+ isTierChange: _ < c
1330
1521
  };
1331
1522
  }
1332
1523
  };
1333
1524
  return s;
1334
- }, [e]), lo = () => {
1335
- const { gameState: e, setGameState: t, resetGame: o, config: n } = nt(), r = n.current.i18n, i = n.current.levelConfig, s = ht(i), { showToast: l } = ve(), { currentLevel: a, totalScore: c, levelScores: u, currentScore: _, showClue: h } = e, d = u[a] || 0, m = s.getTotalTiers(), [y, w] = A(!1), [v, p] = A(!1), [z, b] = A(!1), [S, L] = A(
1336
- s.getTierLevelsRange(1)
1337
- ), { generateCurrentLevelMaze: F } = dt({
1525
+ }, [e]), Do = () => {
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, v = s.getTotalTiers(), [m, C] = $(!1), [g, p] = $(!1), [T, k] = $(!1), [E, P] = $(s.getTierLevelsRange(1)), { generateCurrentLevelMaze: F } = yt({
1338
1527
  gameState: e,
1339
1528
  setGameState: t,
1340
1529
  config: n
1341
1530
  });
1342
- N(() => {
1343
- L(
1531
+ A(() => {
1532
+ P(
1344
1533
  s.getTierLevelsRange(e.currentTier)
1345
1534
  );
1346
1535
  }, [e.currentTier]);
1347
- const $ = (x) => {
1348
- const q = s.getFirstLevelOfTier(x);
1349
- s.isLevelUnlocked(q, e.highestUnlockedLevel) && (t((yt) => ({ ...yt, currentTier: x })), M(q));
1350
- }, M = (x) => {
1351
- s.isLevelUnlocked(x, e.highestUnlockedLevel) && (t((q) => ({
1352
- ...q,
1353
- currentLevel: x
1536
+ const M = (L) => {
1537
+ const Y = s.getFirstLevelOfTier(L);
1538
+ s.isLevelUnlocked(
1539
+ Y,
1540
+ e.highestUnlockedLevel
1541
+ ) && (t((Nt) => ({ ...Nt, currentTier: L })), N(Y));
1542
+ }, N = (L) => {
1543
+ s.isLevelUnlocked(L, e.highestUnlockedLevel) && (t((Y) => ({
1544
+ ...Y,
1545
+ currentLevel: L
1354
1546
  })), F(), l(
1355
- r.levelGoToast.replace("%LEVEL%", x.toString()),
1547
+ i.levelGoToast.replace("%LEVEL%", L.toString()),
1356
1548
  "success"
1357
1549
  ));
1358
- }, P = () => {
1359
- w(!0);
1360
- }, T = () => {
1361
- w(!1);
1362
- }, R = () => {
1363
- b(!0);
1364
- }, ft = () => {
1365
- b(!1);
1366
- }, mt = () => {
1367
- t((x) => (l(x.showClue ? r.cluePathDisabled : r.cluePathEnabled), {
1368
- ...x,
1369
- showClue: !x.showClue,
1370
- currentScore: Math.floor(x.currentScore / 2)
1550
+ }, S = () => {
1551
+ C(!0);
1552
+ }, z = () => {
1553
+ C(!1);
1554
+ }, U = () => {
1555
+ k(!0);
1556
+ }, bt = () => {
1557
+ k(!1);
1558
+ }, kt = () => {
1559
+ t((L) => (l(L.showClue ? i.cluePathDisabled : i.cluePathEnabled), {
1560
+ ...L,
1561
+ showClue: !L.showClue,
1562
+ currentScore: Math.floor(L.currentScore / 2)
1371
1563
  // half the current score
1372
- })), b(!1);
1373
- }, pt = () => {
1564
+ })), k(!1);
1565
+ }, Tt = () => {
1374
1566
  p(!0);
1375
- }, vt = () => {
1376
- o(), p(!1), l(r.resetDoneToast);
1377
- }, gt = () => {
1567
+ }, zt = () => {
1568
+ o(), p(!1), l(i.resetDoneToast);
1569
+ }, Pt = () => {
1378
1570
  p(!1);
1379
1571
  };
1380
1572
  return /* @__PURE__ */ f("div", { class: "game-panel-container", children: [
1381
1573
  /* @__PURE__ */ f("div", { className: "game-controls", children: [
1382
1574
  /* @__PURE__ */ f("div", { className: "selectors-container", children: [
1383
1575
  /* @__PURE__ */ f(
1384
- Jt,
1576
+ xo,
1385
1577
  {
1386
- i18n: r,
1387
- totalTiers: m,
1578
+ i18n: i,
1579
+ totalTiers: v,
1388
1580
  currentTier: e.currentTier,
1389
1581
  highestUnlockedTier: e.highestUnlockedTier,
1390
- onTierChange: $,
1582
+ onTierChange: M,
1391
1583
  disabled: e.levelTransitioning
1392
1584
  }
1393
1585
  ),
1394
1586
  /* @__PURE__ */ f(
1395
- Qt,
1587
+ Eo,
1396
1588
  {
1397
- i18n: r,
1398
- levelsRange: S,
1589
+ i18n: i,
1590
+ levelsRange: E,
1399
1591
  currentLevel: e.currentLevel,
1400
1592
  highestUnlockedLevel: e.highestUnlockedLevel,
1401
- onLevelChange: M,
1593
+ onLevelChange: N,
1402
1594
  disabled: e.levelTransitioning
1403
1595
  }
1404
1596
  )
@@ -1406,21 +1598,21 @@ const so = (e, t, o) => {
1406
1598
  /* @__PURE__ */ f("div", { className: "score-container", children: [
1407
1599
  /* @__PURE__ */ f("div", { className: "score-box currentscore", children: [
1408
1600
  /* @__PURE__ */ f("span", { className: "score-label", children: [
1409
- r.levelScore,
1601
+ i.levelScore,
1410
1602
  ":"
1411
1603
  ] }),
1412
- /* @__PURE__ */ f("span", { className: "score-data", children: _ })
1604
+ /* @__PURE__ */ f("span", { className: "score-data", children: u })
1413
1605
  ] }),
1414
1606
  /* @__PURE__ */ f("div", { className: "score-box bestscore", children: [
1415
1607
  /* @__PURE__ */ f("span", { className: "score-label", children: [
1416
- r.bestScore,
1608
+ i.bestScore,
1417
1609
  ":"
1418
1610
  ] }),
1419
1611
  /* @__PURE__ */ f("span", { className: "score-data", children: d })
1420
1612
  ] }),
1421
1613
  /* @__PURE__ */ f("div", { className: "score-box totalscore", children: [
1422
1614
  /* @__PURE__ */ f("span", { className: "score-label", children: [
1423
- r.total,
1615
+ i.total,
1424
1616
  ":"
1425
1617
  ] }),
1426
1618
  /* @__PURE__ */ f("span", { className: "score-data", children: c })
@@ -1428,20 +1620,20 @@ const so = (e, t, o) => {
1428
1620
  ] })
1429
1621
  ] }),
1430
1622
  /* @__PURE__ */ f("div", { className: "game-settings", children: /* @__PURE__ */ f(
1431
- Xt,
1623
+ So,
1432
1624
  {
1433
- onClick: P,
1625
+ onClick: S,
1434
1626
  className: "game-settings-icon"
1435
1627
  }
1436
1628
  ) }),
1437
1629
  /* @__PURE__ */ f(
1438
- ie,
1630
+ le,
1439
1631
  {
1440
- isOpen: y,
1441
- title: r.settings,
1632
+ isOpen: m,
1633
+ title: i.settings,
1442
1634
  noConfirm: !0,
1443
- cancelText: r.close,
1444
- onCancel: T,
1635
+ cancelText: i.close,
1636
+ onCancel: z,
1445
1637
  children: [
1446
1638
  /* @__PURE__ */ f("div", { className: "settings-item-box", children: [
1447
1639
  /* @__PURE__ */ f("div", {}),
@@ -1449,12 +1641,13 @@ const so = (e, t, o) => {
1449
1641
  "button",
1450
1642
  {
1451
1643
  className: `settings-clue-button ${h ? "clue-on" : "clue-off"}`,
1644
+ disabled: h,
1452
1645
  title: "Toggle Clue",
1453
- onClick: R,
1454
- children: h ? r.clueOn : r.clueOff
1646
+ onClick: U,
1647
+ children: h ? i.clueOn : i.clueOff
1455
1648
  }
1456
1649
  ),
1457
- /* @__PURE__ */ f("div", { className: "settings-item-tip", children: r.clueTip })
1650
+ /* @__PURE__ */ f("div", { className: "settings-item-tip", children: i.clueTip })
1458
1651
  ] }),
1459
1652
  /* @__PURE__ */ f("div", { className: "settings-item-box", children: [
1460
1653
  /* @__PURE__ */ f(
@@ -1462,124 +1655,124 @@ const so = (e, t, o) => {
1462
1655
  {
1463
1656
  className: "settings-reset-button",
1464
1657
  title: "Reset Game",
1465
- onClick: pt,
1466
- children: r.reset
1658
+ onClick: Tt,
1659
+ children: i.reset
1467
1660
  }
1468
1661
  ),
1469
- /* @__PURE__ */ f("div", { className: "settings-item-tip", children: r.resetTip })
1662
+ /* @__PURE__ */ f("div", { className: "settings-item-tip", children: i.resetTip })
1470
1663
  ] })
1471
1664
  ]
1472
1665
  }
1473
1666
  ),
1474
1667
  /* @__PURE__ */ f(
1475
- ie,
1668
+ le,
1476
1669
  {
1477
- isOpen: v,
1478
- title: r.confirmReset,
1479
- message: r.confirmResetMessage,
1480
- confirmText: r.reset,
1481
- cancelText: r.cancel,
1482
- onConfirm: vt,
1483
- onCancel: gt
1670
+ isOpen: g,
1671
+ title: i.confirmReset,
1672
+ message: i.confirmResetMessage,
1673
+ confirmText: i.reset,
1674
+ cancelText: i.cancel,
1675
+ onConfirm: zt,
1676
+ onCancel: Pt
1484
1677
  }
1485
1678
  ),
1486
1679
  /* @__PURE__ */ f(
1487
- ie,
1680
+ le,
1488
1681
  {
1489
- isOpen: z,
1490
- title: r.confirmClue,
1491
- message: r.confirmClueMessage,
1492
- confirmText: r.confirm,
1493
- cancelText: r.cancel,
1494
- onConfirm: mt,
1495
- onCancel: ft
1682
+ isOpen: T,
1683
+ title: i.confirmClue,
1684
+ message: i.confirmClueMessage,
1685
+ confirmText: i.confirm,
1686
+ cancelText: i.cancel,
1687
+ onConfirm: kt,
1688
+ onCancel: bt
1496
1689
  }
1497
1690
  )
1498
1691
  ] });
1499
- }, ao = ({
1692
+ }, Wo = ({
1500
1693
  message: e,
1501
1694
  visible: t,
1502
1695
  duration: o = 2e3,
1503
1696
  onClose: n,
1504
- position: r = "center",
1505
- type: i = "info"
1506
- }) => e ? (N(() => {
1697
+ position: i = "center",
1698
+ type: r = "info"
1699
+ }) => e ? (A(() => {
1507
1700
  let s;
1508
1701
  return t && o > 0 && n && (s = setTimeout(() => {
1509
1702
  n();
1510
1703
  }, o)), () => {
1511
1704
  s && clearTimeout(s);
1512
1705
  };
1513
- }, [t, o, n]), /* @__PURE__ */ f("div", { className: `toast-container position-${r}`, children: /* @__PURE__ */ f("div", { className: `toast-message type-${i} ${t ? "toast-visible" : ""}`, children: e }) })) : null, co = (e, t, o) => {
1514
- N(() => {
1706
+ }, [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, jo = (e, t, o) => {
1707
+ A(() => {
1515
1708
  const n = () => {
1516
- const r = e.current;
1517
- if (!r) return;
1518
- const i = r.parentElement;
1709
+ const i = e.current;
1519
1710
  if (!i) return;
1520
- const s = i.clientWidth, l = i.clientHeight, a = Math.min(s, l), c = window.devicePixelRatio || 1;
1521
- r.style.width = `${a}px`, r.style.height = `${a}px`, r.width = a * c, r.height = a * c, t(e, o.current);
1711
+ const r = i.parentElement;
1712
+ if (!r) return;
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);
1522
1715
  };
1523
1716
  return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
1524
1717
  }, [e]);
1525
- }, Ge = {
1718
+ }, Ve = {
1526
1719
  ArrowUp: [-1, 0],
1527
1720
  ArrowDown: [1, 0],
1528
1721
  ArrowLeft: [0, -1],
1529
1722
  ArrowRight: [0, 1]
1530
- }, _o = ({
1723
+ }, Ho = ({
1531
1724
  containerRef: e,
1532
1725
  gameState: t,
1533
1726
  setGameState: o,
1534
1727
  onFoodCollected: n,
1535
- onFoodNotAllCollected: r
1728
+ onFoodNotAllCollected: i
1536
1729
  }) => {
1537
- N(() => {
1538
- const i = (a) => {
1730
+ A(() => {
1731
+ const r = (a) => {
1539
1732
  if (!t.isGameActive || !t.maze) return;
1540
- const [c, u] = Ge[a], { row: _, col: h } = t.playerPosition, d = _ + c, m = h + u;
1541
- if (!t.maze.isValid(d, m)) return;
1542
- const y = t.maze.grid[_][h];
1543
- if (c === -1 && y.walls.top || c === 1 && y.walls.bottom || u === -1 && y.walls.left || u === 1 && y.walls.right)
1733
+ const [c, _] = Ve[a], { row: u, col: h } = t.playerPosition, d = u + c, v = h + _;
1734
+ if (!t.maze.isValid(d, v)) return;
1735
+ const m = t.maze.grid[u][h];
1736
+ if (c === -1 && m.walls.top || c === 1 && m.walls.bottom || _ === -1 && m.walls.left || _ === 1 && m.walls.right)
1544
1737
  return;
1545
- const w = { row: d, col: m }, v = `${d},${m}`;
1738
+ const C = { row: d, col: v }, g = `${d},${v}`;
1546
1739
  o((p) => {
1547
- const z = p.foodPositions.some(
1548
- (P) => P.row === d && P.col === m
1740
+ const T = p.foodPositions.some(
1741
+ (S) => S.row === d && S.col === v
1549
1742
  );
1550
- z && n();
1551
- const b = Math.max(
1743
+ T && n();
1744
+ const k = Math.max(
1552
1745
  0,
1553
1746
  p.currentScore - 1
1554
- ), S = `${_},${h}-${d},${m}`, L = d === p.exitPosition.row && m === p.exitPosition.col, F = z ? p.foodCollected + 1 : p.foodCollected, $ = F === p.totalFoodCount, M = L && $;
1555
- return L && !$ && r(), {
1747
+ ), E = `${u},${h}-${d},${v}`, P = d === p.exitPosition.row && v === p.exitPosition.col, F = T ? p.foodCollected + 1 : p.foodCollected, M = F === p.totalFoodCount, N = P && M;
1748
+ return P && !M && i(), {
1556
1749
  ...p,
1557
- playerPosition: w,
1558
- playerPath: [...p.playerPath, w],
1750
+ playerPosition: C,
1751
+ playerPath: [...p.playerPath, C],
1559
1752
  foodPositions: p.foodPositions.filter(
1560
- (P) => !(P.row === d && P.col === m)
1753
+ (S) => !(S.row === d && S.col === v)
1561
1754
  ),
1562
1755
  foodCollected: F,
1563
- currentScore: b,
1756
+ currentScore: k,
1564
1757
  visitCounts: {
1565
1758
  ...p.visitCounts,
1566
- [S]: (p.visitCounts[S] || 0) + 1,
1567
- [v]: (p.visitCounts[v] || 0) + 1
1759
+ [E]: (p.visitCounts[E] || 0) + 1,
1760
+ [g]: (p.visitCounts[g] || 0) + 1
1568
1761
  },
1569
1762
  moveCount: p.moveCount + 1,
1570
- playerAtExit: L,
1571
- isGameActive: !M,
1572
- levelTransitioning: M
1763
+ playerAtExit: P,
1764
+ isGameActive: !N,
1765
+ levelTransitioning: N
1573
1766
  };
1574
1767
  });
1575
1768
  }, s = (a) => {
1576
1769
  if (!t.isGameActive || !t.maze) return;
1577
1770
  const c = a.key;
1578
- c in Ge && (a.preventDefault(), i(c));
1771
+ c in Ve && (a.preventDefault(), r(c));
1579
1772
  }, l = (a) => {
1580
1773
  if (a.preventDefault(), !t.isGameActive || !t.maze) return;
1581
- const c = a.touches[0], u = document.elementFromPoint(c.clientX, c.clientY);
1582
- u && (u.classList.contains("maze-up") ? i("ArrowUp") : u.classList.contains("maze-down") ? i("ArrowDown") : u.classList.contains("maze-left") ? i("ArrowLeft") : u.classList.contains("maze-right") && i("ArrowRight"));
1774
+ const c = a.touches[0], _ = document.elementFromPoint(c.clientX, c.clientY);
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"));
1583
1776
  };
1584
1777
  return window.addEventListener("keydown", s), e.current?.addEventListener("touchstart", l, {
1585
1778
  passive: !1
@@ -1592,14 +1785,14 @@ const so = (e, t, o) => {
1592
1785
  t.playerPosition,
1593
1786
  t.exitPosition
1594
1787
  ]);
1595
- }, uo = ({
1788
+ }, Go = ({
1596
1789
  gameState: e,
1597
1790
  setGameState: t,
1598
1791
  config: o,
1599
1792
  onLevelComplete: n,
1600
- onTierUnlocked: r
1793
+ onTierUnlocked: i
1601
1794
  }) => {
1602
- N(() => {
1795
+ A(() => {
1603
1796
  if (e.levelTransitioning) {
1604
1797
  n();
1605
1798
  const l = setTimeout(() => {
@@ -1611,27 +1804,27 @@ const so = (e, t, o) => {
1611
1804
  return () => clearTimeout(l);
1612
1805
  }
1613
1806
  }, [e.levelTransitioning]);
1614
- const i = ht(o.current.levelConfig), s = (l, a) => {
1615
- const c = i.getNextLevelInfo(
1807
+ const r = wt(o.current.levelConfig), s = (l, a) => {
1808
+ const c = r.getNextLevelInfo(
1616
1809
  e.currentLevel
1617
1810
  );
1618
1811
  if (!c) return;
1619
- const { nextLevel: u, nextTier: _, isTierChange: h } = c, d = ut(u, a.flat());
1620
- d && t((m) => {
1621
- h && r(_);
1622
- const y = { ...m.levelScores };
1623
- return y[m.currentLevel] = Math.max(
1812
+ const { nextLevel: _, nextTier: u, isTierChange: h } = c, d = Ct(_, a.flat());
1813
+ d && t((v) => {
1814
+ h && i(u);
1815
+ const m = { ...v.levelScores };
1816
+ return m[v.currentLevel] = Math.max(
1624
1817
  l,
1625
- y[m.currentLevel] || 0
1818
+ m[v.currentLevel] || 0
1626
1819
  ), {
1627
- ...m,
1820
+ ...v,
1628
1821
  ...d,
1629
- currentLevel: u,
1630
- currentTier: _,
1631
- highestUnlockedLevel: Math.max(m.highestUnlockedLevel, u),
1632
- highestUnlockedTier: Math.max(m.highestUnlockedTier, _),
1633
- levelScores: y,
1634
- totalScore: Object.values(y).reduce((w, v) => w + v, 0),
1822
+ currentLevel: _,
1823
+ currentTier: u,
1824
+ highestUnlockedLevel: Math.max(v.highestUnlockedLevel, _),
1825
+ highestUnlockedTier: Math.max(v.highestUnlockedTier, u),
1826
+ levelScores: m,
1827
+ totalScore: Object.values(m).reduce((C, g) => C + g, 0),
1635
1828
  showClue: !1,
1636
1829
  // reset to false on new level
1637
1830
  isGameActive: !0,
@@ -1643,128 +1836,140 @@ const so = (e, t, o) => {
1643
1836
  handleLevelComplete: s
1644
1837
  };
1645
1838
  };
1646
- function ho(e, t) {
1647
- const { ctx: o, width: n, height: r, maze: i } = e;
1839
+ function Bo(e, t) {
1840
+ const { ctx: o, width: n, height: i, maze: r } = e;
1648
1841
  t.playerColor = e.playerAtExit ? t.playerAtExitColor : t.playerColor;
1649
1842
  const {
1650
1843
  padding: s,
1651
1844
  wallWidth: l,
1652
1845
  wallColor: a,
1653
1846
  playerColor: c,
1654
- exitColor: u,
1655
- foodColor: _,
1847
+ exitColor: _,
1848
+ foodColor: u,
1656
1849
  clueColor: h,
1657
1850
  backgroundColor: d
1658
- } = t, m = i.cols, y = i.rows, w = (n - s * 2) / m, v = (r - s * 2) / y;
1659
- o.clearRect(0, 0, n, r), o.save(), o.fillStyle = d, o.fillRect(0, 0, n, r), o.restore(), e.showClue && e.playerPath && e.playerPath.length > 0 && yo(e, {
1660
- cellWidth: w,
1661
- cellHeight: v,
1851
+ } = t, v = r.cols, m = r.rows, C = (n - s * 2) / v, g = (i - s * 2) / m;
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, {
1853
+ cellWidth: C,
1854
+ cellHeight: g,
1662
1855
  padding: s,
1663
1856
  clueColor: h
1664
- }), fo(e, {
1665
- cellWidth: w,
1666
- cellHeight: v,
1857
+ }), Vo(e, {
1858
+ cellWidth: C,
1859
+ cellHeight: g,
1667
1860
  padding: s,
1668
1861
  wallColor: a,
1669
1862
  wallWidth: l
1670
- }), vo(e, {
1671
- cellWidth: w,
1672
- cellHeight: v,
1863
+ }), Yo(e, {
1864
+ cellWidth: C,
1865
+ cellHeight: g,
1673
1866
  padding: s,
1674
- foodColor: _
1675
- }), e.playerAtExit || po(e, {
1676
- cellWidth: w,
1677
- cellHeight: v,
1867
+ foodColor: u
1868
+ }), e.playerAtExit || Xo(e, {
1869
+ cellWidth: C,
1870
+ cellHeight: g,
1678
1871
  padding: s,
1679
- exitColor: u
1680
- }), mo(e, {
1681
- cellWidth: w,
1682
- cellHeight: v,
1872
+ exitColor: _
1873
+ }), qo(e, {
1874
+ cellWidth: C,
1875
+ cellHeight: g,
1683
1876
  padding: s,
1684
1877
  playerColor: c
1685
1878
  });
1686
1879
  }
1687
- function fo(e, t) {
1688
- const { ctx: o, maze: n } = e, { cellWidth: r, cellHeight: i, padding: s, wallColor: l, wallWidth: a } = t;
1880
+ function Vo(e, t) {
1881
+ const { ctx: o, maze: n } = e, { cellWidth: i, cellHeight: r, padding: s, wallColor: l, wallWidth: a } = t;
1689
1882
  o.save(), o.strokeStyle = l, o.lineWidth = a, o.lineCap = "round", o.beginPath();
1690
1883
  for (let c = 0; c < n.rows; c++)
1691
- for (let u = 0; u < n.cols; u++) {
1692
- const _ = n.grid[c][u], h = s + u * r, d = s + c * i;
1693
- _.walls.top && (o.moveTo(h, d), o.lineTo(h + r, d)), _.walls.right && (o.moveTo(h + r, d), o.lineTo(h + r, d + i)), _.walls.bottom && (o.moveTo(h + r, d + i), o.lineTo(h, d + i)), _.walls.left && (o.moveTo(h, d + i), o.lineTo(h, d));
1884
+ for (let _ = 0; _ < n.cols; _++) {
1885
+ const u = n.grid[c][_], h = s + _ * i, d = s + c * r;
1886
+ u.walls.top && (o.moveTo(h, d), o.lineTo(h + i, d)), u.walls.right && (o.moveTo(h + i, d), o.lineTo(h + i, d + r)), u.walls.bottom && (o.moveTo(h + i, d + r), o.lineTo(h, d + r)), u.walls.left && (o.moveTo(h, d + r), o.lineTo(h, d));
1694
1887
  }
1695
1888
  o.stroke(), o.restore();
1696
1889
  }
1697
- function mo(e, t) {
1698
- const { ctx: o, playerPosition: n } = e, { cellWidth: r, cellHeight: i, padding: s, playerColor: l } = t, { x: a, y: c } = j(
1890
+ function qo(e, t) {
1891
+ const { ctx: o, playerPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, playerColor: l } = t, { x: a, y: c } = q(
1699
1892
  n.row,
1700
1893
  n.col,
1701
- r,
1702
1894
  i,
1895
+ r,
1703
1896
  s
1704
- ), u = Math.min(r, i) * 0.35;
1705
- o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, u, 0, Math.PI * 2), o.fill(), o.restore();
1897
+ ), _ = Math.min(i, r) * 0.35;
1898
+ o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, _, 0, Math.PI * 2), o.fill(), o.restore();
1706
1899
  }
1707
- function po(e, t) {
1708
- const { ctx: o, exitPosition: n } = e, { cellWidth: r, cellHeight: i, padding: s, exitColor: l } = t, { x: a, y: c } = j(
1900
+ function Xo(e, t) {
1901
+ const { ctx: o, exitPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, exitColor: l } = t, { x: a, y: c } = q(
1709
1902
  n.row,
1710
1903
  n.col,
1711
- r,
1712
1904
  i,
1905
+ r,
1713
1906
  s
1714
- ), u = Math.min(r, i) * 0.35;
1715
- o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, u, 0, Math.PI * 2), o.fill(), o.restore();
1907
+ ), _ = Math.min(i, r) * 0.35;
1908
+ o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, _, 0, Math.PI * 2), o.fill(), o.restore();
1716
1909
  }
1717
- function vo(e, t) {
1718
- const { ctx: o, foodPositions: n } = e, { cellWidth: r, cellHeight: i, padding: s, foodColor: l } = t;
1910
+ function Yo(e, t) {
1911
+ const { ctx: o, foodPositions: n } = e, { cellWidth: i, cellHeight: r, padding: s, foodColor: l } = t;
1719
1912
  o.fillStyle = l;
1720
- const a = Math.min(r, i) * 0.25;
1913
+ const a = Math.min(i, r) * 0.25;
1721
1914
  n.forEach((c) => {
1722
- const { x: u, y: _ } = j(
1915
+ const { x: _, y: u } = q(
1723
1916
  c.row,
1724
1917
  c.col,
1725
- r,
1726
1918
  i,
1919
+ r,
1727
1920
  s
1728
1921
  );
1729
- go(o, u, _, a * 1.2, 5, a * 0.6);
1922
+ Jo(o, _, u, a * 1.2, 5, a * 0.6);
1730
1923
  });
1731
1924
  }
1732
- function go(e, t, o, n, r, i) {
1925
+ function Jo(e, t, o, n, i, r) {
1733
1926
  e.save(), e.beginPath();
1734
- for (let s = 0; s < r * 2; s++) {
1735
- const l = s % 2 === 0 ? n : i, a = Math.PI * s / r;
1927
+ for (let s = 0; s < i * 2; s++) {
1928
+ const l = s % 2 === 0 ? n : r, a = Math.PI * s / i;
1736
1929
  e.lineTo(t + l * Math.sin(a), o + l * Math.cos(a));
1737
1930
  }
1738
1931
  e.closePath(), e.fill(), e.restore();
1739
1932
  }
1740
- function yo(e, t) {
1741
- const { ctx: o, playerPath: n, visitCounts: r } = e, { cellWidth: i, cellHeight: s, padding: l, clueColor: a } = t;
1742
- if (!(!n || n.length < 2 || !r)) {
1933
+ function Ko(e, t) {
1934
+ const { ctx: o, playerPath: n, visitCounts: i } = e, { cellWidth: r, cellHeight: s, padding: l, clueColor: a } = t;
1935
+ if (!(!n || n.length < 2 || !i)) {
1743
1936
  o.save();
1744
1937
  for (let c = 1; c < n.length; c++) {
1745
- const u = n[c - 1], _ = n[c], h = `${u.row},${u.col}-${_.row},${_.col}`, d = `${_.row},${_.col}-${u.row},${u.col}`, m = (r[h] || 0) + (r[d] || 0), y = Math.min(0.2 + m * 0.1, 0.9), w = Math.max(3, i * 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}`, v = (i[h] || 0) + (i[d] || 0), m = Math.min(0.2 + v * 0.1, 0.9), C = Math.max(3, r * 0.1) + v * 0.5;
1746
1939
  try {
1747
- o.strokeStyle = a.replace(")", `, ${y})`).replace("rgb(", "rgba(");
1940
+ o.strokeStyle = a.replace(")", `, ${m})`).replace("rgb(", "rgba(");
1748
1941
  } catch {
1749
- o.strokeStyle = `rgba(255, 0, 0, ${y})`;
1942
+ o.strokeStyle = `rgba(255, 0, 0, ${m})`;
1750
1943
  }
1751
- o.lineWidth = w, o.lineCap = "round", o.lineJoin = "round";
1752
- const { x: v, y: p } = j(u.row, u.col, i, s, l), { x: z, y: b } = j(_.row, _.col, i, s, l);
1753
- o.beginPath(), o.moveTo(v, p), o.lineTo(z, b), o.stroke();
1944
+ o.lineWidth = C, o.lineCap = "round", o.lineJoin = "round";
1945
+ const { x: g, 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(g, p), o.lineTo(T, k), o.stroke();
1754
1959
  }
1755
1960
  o.restore();
1756
1961
  }
1757
1962
  }
1758
- function j(e, t, o, n, r) {
1963
+ function q(e, t, o, n, i) {
1759
1964
  return {
1760
- x: r + t * o + o / 2,
1761
- y: r + e * n + n / 2
1965
+ x: i + t * o + o / 2,
1966
+ y: i + e * n + n / 2
1762
1967
  };
1763
1968
  }
1764
- const wo = () => {
1765
- const { message: e, visible: t, type: o, hideToast: n } = ve();
1969
+ const Zo = new co(), Qo = () => {
1970
+ const { message: e, visible: t, type: o, hideToast: n } = Ce();
1766
1971
  return /* @__PURE__ */ f(
1767
- ao,
1972
+ Wo,
1768
1973
  {
1769
1974
  message: e,
1770
1975
  visible: t,
@@ -1773,10 +1978,10 @@ const wo = () => {
1773
1978
  position: "top"
1774
1979
  }
1775
1980
  );
1776
- }, Co = () => {
1777
- const { gameState: e, setGameState: t, config: o } = nt(), n = W(null), r = W(null), i = W(e), s = o.current.i18n, { showToast: l } = ve();
1778
- N(() => {
1779
- i.current = e;
1981
+ }, en = () => {
1982
+ const { gameState: e, setGameState: t, config: o } = _t(), n = G(null), i = G(null), r = G(e), s = o.current.i18n, { showToast: l } = Ce();
1983
+ A(() => {
1984
+ r.current = e;
1780
1985
  }, [e]);
1781
1986
  const a = () => {
1782
1987
  const h = e.totalFoodCount - e.foodCollected - 1;
@@ -1794,45 +1999,51 @@ const wo = () => {
1794
1999
  s.warnNotAllFoodCollectedToast.replace("%NUM%", h.toString()),
1795
2000
  "warning"
1796
2001
  );
1797
- }, u = (h, d) => {
1798
- const m = h.current?.getContext("2d");
1799
- m && d.maze && ho(
1800
- {
1801
- ctx: m,
1802
- width: h.current.width,
1803
- height: h.current.height,
1804
- maze: d.maze,
1805
- playerPosition: d.playerPosition,
1806
- exitPosition: d.exitPosition,
1807
- foodPositions: d.foodPositions,
1808
- showClue: d.showClue,
1809
- playerPath: d.playerPath,
1810
- visitCounts: d.visitCounts,
1811
- playerAtExit: d.playerAtExit
1812
- },
1813
- o.current.renderConfig || {}
1814
- );
2002
+ }, _ = (h, d) => {
2003
+ const v = h.current?.getContext("2d");
2004
+ if (v && d.maze) {
2005
+ const m = o.current.renderConfig || {}, g = o.current.levelConfig.flat()[d.currentLevel - 1];
2006
+ g.wallWidth ? m.wallWidth = g.wallWidth : d.currentLevel > 40 && (m.wallWidth -= m.wallWidth * 0.05 * (d.currentLevel - 40), m.wallWidth = Math.max(
2007
+ m.wallWidth,
2008
+ m.minWallWidth
2009
+ )), Bo(
2010
+ {
2011
+ ctx: v,
2012
+ width: h.current.width,
2013
+ height: h.current.height,
2014
+ maze: d.maze,
2015
+ playerPosition: d.playerPosition,
2016
+ exitPosition: d.exitPosition,
2017
+ foodPositions: d.foodPositions,
2018
+ showClue: d.showClue,
2019
+ playerPath: d.playerPath,
2020
+ visitCounts: d.visitCounts,
2021
+ playerAtExit: d.playerAtExit
2022
+ },
2023
+ m
2024
+ );
2025
+ }
1815
2026
  };
1816
- N(() => {
2027
+ A(() => {
1817
2028
  l(s.useArrowKeyTips, "info", 3e3);
1818
- }, []), co(r, u, i);
1819
- const { generateCurrentLevelMaze: _ } = dt({
2029
+ }, []), jo(i, _, r);
2030
+ const { generateCurrentLevelMaze: u } = yt({
1820
2031
  gameState: e,
1821
2032
  setGameState: t,
1822
2033
  config: o
1823
2034
  });
1824
- return _o({
2035
+ return Ho({
1825
2036
  containerRef: n,
1826
2037
  gameState: e,
1827
2038
  setGameState: t,
1828
2039
  onFoodCollected: a,
1829
2040
  onFoodNotAllCollected: c
1830
- }), uo({
2041
+ }), Go({
1831
2042
  gameState: e,
1832
2043
  setGameState: t,
1833
2044
  config: o,
1834
2045
  onLevelComplete: () => {
1835
- l(s.levelCompleteToast, "success");
2046
+ Zo.addConfetti(), l(s.levelCompleteToast, "success");
1836
2047
  },
1837
2048
  onTierUnlocked: (h) => {
1838
2049
  l(
@@ -1840,19 +2051,19 @@ const wo = () => {
1840
2051
  "success"
1841
2052
  );
1842
2053
  }
1843
- }), N(() => {
1844
- e.isGameActive && !e.levelTransitioning && _();
2054
+ }), A(() => {
2055
+ e.isGameActive && !e.levelTransitioning && u();
1845
2056
  }, [
1846
2057
  e.currentLevel,
1847
2058
  e.isGameActive,
1848
2059
  e.levelTransitioning
1849
- ]), N(() => {
1850
- r.current && e.maze && u(r, e);
2060
+ ]), A(() => {
2061
+ i.current && e.maze && _(i, e);
1851
2062
  }, [e]), /* @__PURE__ */ f("div", { className: "maze-game-container", children: [
1852
- /* @__PURE__ */ f(wo, {}),
1853
- /* @__PURE__ */ f(lo, {}),
2063
+ /* @__PURE__ */ f(Qo, {}),
2064
+ /* @__PURE__ */ f(Do, {}),
1854
2065
  /* @__PURE__ */ f("div", { className: "maze-canvas-container", ref: n, children: [
1855
- /* @__PURE__ */ f("canvas", { ref: r, className: "maze-game-canvas" }),
2066
+ /* @__PURE__ */ f("canvas", { ref: i, className: "maze-game-canvas" }),
1856
2067
  /* @__PURE__ */ f("div", { className: "maze-touch-area maze-up" }),
1857
2068
  /* @__PURE__ */ f("div", { className: "maze-touch-area maze-down" }),
1858
2069
  /* @__PURE__ */ f("div", { className: "maze-touch-area maze-left" }),
@@ -1860,20 +2071,25 @@ const wo = () => {
1860
2071
  ] })
1861
2072
  ] });
1862
2073
  };
1863
- function ko() {
1864
- return /* @__PURE__ */ f(Yt, { children: /* @__PURE__ */ f(Co, {}) });
2074
+ function tn() {
2075
+ return /* @__PURE__ */ f(Lo, { children: /* @__PURE__ */ f(en, {}) });
1865
2076
  }
1866
- function bo({ config: e = {} }) {
1867
- const t = { ...se.i18n, ...e.i18n || {} }, o = { ...se.renderConfig, ...e.renderConfig || {} }, n = e.levelConfig || ge;
2077
+ function on({ config: e = {} }) {
2078
+ const t = { ...ee.i18n, ...e.i18n || {} }, o = { ...ee.renderConfig, ...e.renderConfig || {} }, n = e.levelConfig || ye;
1868
2079
  return e = {
1869
- ...se,
2080
+ ...ee,
1870
2081
  ...e,
1871
2082
  i18n: t,
1872
2083
  levelConfig: n,
1873
2084
  renderConfig: o
1874
- }, /* @__PURE__ */ f($t, { config: e, children: /* @__PURE__ */ f(ko, {}) });
2085
+ }, /* @__PURE__ */ f(Ot, { config: e, children: /* @__PURE__ */ f(tn, {}) });
1875
2086
  }
1876
- const zo = {
2087
+ const nn = {
2088
+ root: "https://unpkg.com/@roudanio/maze@0.0.5/dist/",
2089
+ ...ee
2090
+ };
2091
+ `${JSON.stringify(nn, null, 2)}`;
2092
+ const rn = {
1877
2093
  async init(e, t) {
1878
2094
  const o = typeof e == "string" ? document.querySelector(e) : e;
1879
2095
  if (!o) {
@@ -1884,31 +2100,31 @@ const zo = {
1884
2100
  }
1885
2101
  let { root: n = location.origin } = t;
1886
2102
  n.at(-1) !== "/" && (n += "/");
1887
- const r = document.createElement("div"), i = document.createElement("div");
1888
- r.style.cssText = `
2103
+ const i = document.createElement("div"), r = document.createElement("div");
2104
+ i.style.cssText = `
1889
2105
  height: 30px;
1890
2106
  width: 100%;
1891
2107
  border: solid 2px #999;
1892
2108
  margin: 20% auto;
1893
- `, i.style.cssText = `
2109
+ `, r.style.cssText = `
1894
2110
  width: 99%;
1895
2111
  height: 100%;
1896
2112
  background: #999;
1897
2113
  animation: loading 1.5s ease-in-out;
1898
2114
  transition: width 1.5s ease-in-out;
1899
2115
  transition: width 1.5s ease-in-out;
1900
- `, r.append(i), o.append(r);
2116
+ `, i.append(r), o.append(i);
1901
2117
  const s = document.createElement("style");
1902
2118
  s.innerHTML = `
1903
2119
  @keyframes loading {
1904
2120
  0% { width: 0%; }
1905
2121
  100% { width: 99%; }
1906
- }`, document.head.appendChild(s), await (async (a) => new Promise((c, u) => {
1907
- const _ = document.createElement("link");
1908
- _.rel = "stylesheet", _.type = "text/css", _.href = a, _.onload = c, _.onerror = u, document.head.appendChild(_);
1909
- }))(n + "maze.css"), Tt(/* @__PURE__ */ f(bo, { config: t }), o);
2122
+ }`, document.head.appendChild(s), await (async (a) => new Promise((c, _) => {
2123
+ const u = document.createElement("link");
2124
+ u.rel = "stylesheet", u.type = "text/css", u.href = a, u.onload = c, u.onerror = _, document.head.appendChild(u);
2125
+ }))(n + "maze.css"), Mt(/* @__PURE__ */ f(on, { config: t }), o);
1910
2126
  }
1911
2127
  };
1912
2128
  export {
1913
- zo as default
2129
+ rn as default
1914
2130
  };