@roudanio/maze 0.0.1 → 0.0.3

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