speakid-build-a-sentence 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,283 +1,6 @@
1
- import on, { useState as g, useCallback as Ee, useRef as je, useEffect as ue, Component as sn } from "react";
2
- var ve = { exports: {} }, pe = {};
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.js
6
- *
7
- * Copyright (c) Meta Platforms, Inc. and affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var Pe;
13
- function an() {
14
- if (Pe) return pe;
15
- Pe = 1;
16
- var p = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
17
- function S(j, W, w) {
18
- var P = null;
19
- if (w !== void 0 && (P = "" + w), W.key !== void 0 && (P = "" + W.key), "key" in W) {
20
- w = {};
21
- for (var R in W)
22
- R !== "key" && (w[R] = W[R]);
23
- } else w = W;
24
- return W = w.ref, {
25
- $$typeof: p,
26
- type: j,
27
- key: P,
28
- ref: W !== void 0 ? W : null,
29
- props: w
30
- };
31
- }
32
- return pe.Fragment = d, pe.jsx = S, pe.jsxs = S, pe;
33
- }
34
- var fe = {};
35
- /**
36
- * @license React
37
- * react-jsx-runtime.development.js
38
- *
39
- * Copyright (c) Meta Platforms, Inc. and affiliates.
40
- *
41
- * This source code is licensed under the MIT license found in the
42
- * LICENSE file in the root directory of this source tree.
43
- */
44
- var He;
45
- function ln() {
46
- return He || (He = 1, process.env.NODE_ENV !== "production" && (function() {
47
- function p(e) {
48
- if (e == null) return null;
49
- if (typeof e == "function")
50
- return e.$$typeof === V ? null : e.displayName || e.name || null;
51
- if (typeof e == "string") return e;
52
- switch (e) {
53
- case E:
54
- return "Fragment";
55
- case _:
56
- return "Profiler";
57
- case U:
58
- return "StrictMode";
59
- case I:
60
- return "Suspense";
61
- case ae:
62
- return "SuspenseList";
63
- case $:
64
- return "Activity";
65
- }
66
- if (typeof e == "object")
67
- switch (typeof e.tag == "number" && console.error(
68
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
- ), e.$$typeof) {
70
- case ge:
71
- return "Portal";
72
- case se:
73
- return e.displayName || "Context";
74
- case he:
75
- return (e._context.displayName || "Context") + ".Consumer";
76
- case me:
77
- var a = e.render;
78
- return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case z:
80
- return a = e.displayName || null, a !== null ? a : p(e.type) || "Memo";
81
- case J:
82
- a = e._payload, e = e._init;
83
- try {
84
- return p(e(a));
85
- } catch {
86
- }
87
- }
88
- return null;
89
- }
90
- function d(e) {
91
- return "" + e;
92
- }
93
- function S(e) {
94
- try {
95
- d(e);
96
- var a = !1;
97
- } catch {
98
- a = !0;
99
- }
100
- if (a) {
101
- a = console;
102
- var r = a.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
- return r.call(
104
- a,
105
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- b
107
- ), d(e);
108
- }
109
- }
110
- function j(e) {
111
- if (e === E) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === J)
113
- return "<...>";
114
- try {
115
- var a = p(e);
116
- return a ? "<" + a + ">" : "<...>";
117
- } catch {
118
- return "<...>";
119
- }
120
- }
121
- function W() {
122
- var e = we.A;
123
- return e === null ? null : e.getOwner();
124
- }
125
- function w() {
126
- return Error("react-stack-top-frame");
127
- }
128
- function P(e) {
129
- if (le.call(e, "key")) {
130
- var a = Object.getOwnPropertyDescriptor(e, "key").get;
131
- if (a && a.isReactWarning) return !1;
132
- }
133
- return e.key !== void 0;
134
- }
135
- function R(e, a) {
136
- function r() {
137
- c || (c = !0, console.error(
138
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- a
140
- ));
141
- }
142
- r.isReactWarning = !0, Object.defineProperty(e, "key", {
143
- get: r,
144
- configurable: !0
145
- });
146
- }
147
- function f() {
148
- var e = p(this.type);
149
- return F[e] || (F[e] = !0, console.error(
150
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
- )), e = this.props.ref, e !== void 0 ? e : null;
152
- }
153
- function D(e, a, r, b, de, G) {
154
- var x = r.ref;
155
- return e = {
156
- $$typeof: oe,
157
- type: e,
158
- key: a,
159
- props: r,
160
- _owner: b
161
- }, (x !== void 0 ? x : null) !== null ? Object.defineProperty(e, "ref", {
162
- enumerable: !1,
163
- get: f
164
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
165
- configurable: !1,
166
- enumerable: !1,
167
- writable: !0,
168
- value: 0
169
- }), Object.defineProperty(e, "_debugInfo", {
170
- configurable: !1,
171
- enumerable: !1,
172
- writable: !0,
173
- value: null
174
- }), Object.defineProperty(e, "_debugStack", {
175
- configurable: !1,
176
- enumerable: !1,
177
- writable: !0,
178
- value: de
179
- }), Object.defineProperty(e, "_debugTask", {
180
- configurable: !1,
181
- enumerable: !1,
182
- writable: !0,
183
- value: G
184
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
- }
186
- function y(e, a, r, b, de, G) {
187
- var x = a.children;
188
- if (x !== void 0)
189
- if (b)
190
- if (M(x)) {
191
- for (b = 0; b < x.length; b++)
192
- T(x[b]);
193
- Object.freeze && Object.freeze(x);
194
- } else
195
- console.error(
196
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
- );
198
- else T(x);
199
- if (le.call(a, "key")) {
200
- x = p(e);
201
- var O = Object.keys(a).filter(function(Se) {
202
- return Se !== "key";
203
- });
204
- b = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", L[x + b] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
205
- `A props object containing a "key" prop is being spread into JSX:
206
- let props = %s;
207
- <%s {...props} />
208
- React keys must be passed directly to JSX without using spread:
209
- let props = %s;
210
- <%s key={someKey} {...props} />`,
211
- b,
212
- x,
213
- O,
214
- x
215
- ), L[x + b] = !0);
216
- }
217
- if (x = null, r !== void 0 && (S(r), x = "" + r), P(a) && (S(a.key), x = "" + a.key), "key" in a) {
218
- r = {};
219
- for (var ce in a)
220
- ce !== "key" && (r[ce] = a[ce]);
221
- } else r = a;
222
- return x && R(
223
- r,
224
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
- ), D(
226
- e,
227
- x,
228
- r,
229
- W(),
230
- de,
231
- G
232
- );
233
- }
234
- function T(e) {
235
- H(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === J && (e._payload.status === "fulfilled" ? H(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
236
- }
237
- function H(e) {
238
- return typeof e == "object" && e !== null && e.$$typeof === oe;
239
- }
240
- var B = on, oe = Symbol.for("react.transitional.element"), ge = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), he = Symbol.for("react.consumer"), se = Symbol.for("react.context"), me = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), ae = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), we = B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, le = Object.prototype.hasOwnProperty, M = Array.isArray, A = console.createTask ? console.createTask : function() {
241
- return null;
242
- };
243
- B = {
244
- react_stack_bottom_frame: function(e) {
245
- return e();
246
- }
247
- };
248
- var c, F = {}, X = B.react_stack_bottom_frame.bind(
249
- B,
250
- w
251
- )(), xe = A(j(w)), L = {};
252
- fe.Fragment = E, fe.jsx = function(e, a, r) {
253
- var b = 1e4 > we.recentlyCreatedOwnerStacks++;
254
- return y(
255
- e,
256
- a,
257
- r,
258
- !1,
259
- b ? Error("react-stack-top-frame") : X,
260
- b ? A(j(e)) : xe
261
- );
262
- }, fe.jsxs = function(e, a, r) {
263
- var b = 1e4 > we.recentlyCreatedOwnerStacks++;
264
- return y(
265
- e,
266
- a,
267
- r,
268
- !0,
269
- b ? Error("react-stack-top-frame") : X,
270
- b ? A(j(e)) : xe
271
- );
272
- };
273
- })()), fe;
274
- }
275
- var Ce;
276
- function dn() {
277
- return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? ve.exports = an() : ve.exports = ln()), ve.exports;
278
- }
279
- var s = dn();
280
- const cn = `
1
+ import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
+ import { useState as p, useCallback as pe, useRef as We, useEffect as V, Component as Ye } from "react";
3
+ const Ke = `
281
4
  @keyframes magic-sentence-spin {
282
5
  from { transform: rotate(0deg); }
283
6
  to { transform: rotate(360deg); }
@@ -312,10 +35,10 @@ const cn = `
312
35
  }
313
36
  `;
314
37
  if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes")) {
315
- const p = document.createElement("style");
316
- p.id = "magic-sentence-keyframes", p.innerHTML = cn, document.head.appendChild(p);
38
+ const h = document.createElement("style");
39
+ h.id = "magic-sentence-keyframes", h.innerHTML = Ke, document.head.appendChild(h);
317
40
  }
318
- const Ae = {
41
+ const Se = {
319
42
  spin: {
320
43
  animation: "magic-sentence-spin 1.4s linear infinite"
321
44
  },
@@ -334,7 +57,7 @@ const Ae = {
334
57
  glow: {
335
58
  animation: "magic-sentence-glow 1s ease-in-out infinite"
336
59
  }
337
- }, h = {
60
+ }, g = {
338
61
  gmCenterScreen: {
339
62
  position: "relative",
340
63
  zIndex: 1,
@@ -448,62 +171,64 @@ const Ae = {
448
171
  },
449
172
  gmHourglass: {
450
173
  fontSize: "42px",
451
- ...Ae.spin
174
+ ...Se.spin
452
175
  },
453
176
  // ===== Анимационные стили =====
454
- ...Ae
455
- }, un = () => {
456
- const [p, d] = g([]), S = Ee((w, P, R) => {
457
- const f = [];
458
- w.trim() || f.push({
177
+ ...Se
178
+ }, _e = () => {
179
+ const [h, r] = p([]), y = pe((S, M, C) => {
180
+ const c = [];
181
+ S.trim() || c.push({
459
182
  type: "empty",
460
183
  message: "Sentence cannot be empty"
461
- }), w.length > 41 && f.push({
184
+ }), S.length > 41 && c.push({
462
185
  type: "length",
463
- message: `Sentence is too long (${w.length}/41 characters)`
464
- }), w && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(w) && f.push({
186
+ message: `Sentence is too long (${S.length}/41 characters)`
187
+ }), S && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(S) && c.push({
465
188
  type: "characters",
466
189
  message: "Only Latin characters, numbers, spaces and punctuation are allowed"
467
190
  });
468
- const y = R.findIndex((T, H) => H !== P && T.toLowerCase().trim() === w.toLowerCase().trim());
469
- return y !== -1 && f.push({
191
+ const f = C.findIndex((k, I) => I !== M && k.toLowerCase().trim() === S.toLowerCase().trim());
192
+ return f !== -1 && c.push({
470
193
  type: "duplicate",
471
- message: `Duplicate sentence (same as sentence ${y + 1})`
472
- }), d(f), {
473
- isValid: f.length === 0,
474
- errors: f
194
+ message: `Duplicate sentence (same as sentence ${f + 1})`
195
+ }), r(c), {
196
+ isValid: c.length === 0,
197
+ errors: c
475
198
  };
476
- }, []), j = Ee((w) => {
477
- const P = [];
478
- return w.forEach((R, f) => {
479
- const D = S(R, f, w);
480
- P.push(...D.errors.map((y) => ({
481
- ...y,
482
- message: `Sentence ${f + 1}: ${y.message}`
199
+ }, []), B = pe((S) => {
200
+ const M = [];
201
+ return S.forEach((C, c) => {
202
+ const D = y(C, c, S);
203
+ M.push(...D.errors.map((f) => ({
204
+ ...f,
205
+ message: `Sentence ${c + 1}: ${f.message}`
483
206
  })));
484
207
  }), {
485
- isValid: P.length === 0,
486
- errors: P
208
+ isValid: M.length === 0,
209
+ errors: M
487
210
  };
488
- }, [S]), W = Ee(() => {
489
- d([]);
211
+ }, [y]), ne = pe(() => {
212
+ r([]);
490
213
  }, []);
491
214
  return {
492
- errors: p,
493
- validateSentence: S,
494
- validateAllSentences: j,
495
- clearErrors: W
215
+ errors: h,
216
+ validateSentence: y,
217
+ validateAllSentences: B,
218
+ clearErrors: ne
496
219
  };
497
- }, pn = (p, d, S) => d && S ? `${p} word "${d}" ${S}` : d ? `${p} word "${d}"` : p, fn = (p, d, S = ["Enter", " "]) => {
498
- S.includes(p.key) && (p.preventDefault(), d());
499
- }, Y = (p) => {
500
- const d = document.createElement("div");
501
- d.setAttribute("aria-live", "polite"), d.setAttribute("aria-atomic", "true"), d.style.position = "absolute", d.style.left = "-10000px", d.style.width = "1px", d.style.height = "1px", d.style.overflow = "hidden", document.body.appendChild(d), d.textContent = p, setTimeout(() => {
502
- document.body.removeChild(d);
220
+ }, en = (h, r, y) => r && y ? `${h} word "${r}" ${y}` : r ? `${h} word "${r}"` : h, nn = (h, r, y = ["Enter", " "]) => {
221
+ y.includes(h.key) && (h.preventDefault(), r());
222
+ }, E = (h) => {
223
+ const r = document.createElement("div");
224
+ r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.position = "absolute", r.style.left = "-10000px", r.style.width = "1px", r.style.height = "1px", r.style.overflow = "hidden", document.body.appendChild(r), r.textContent = h, setTimeout(() => {
225
+ document.body.removeChild(r);
503
226
  }, 1e3);
504
- }, gn = () => {
505
- const p = document.createElement("style");
506
- p.textContent = `
227
+ }, tn = () => {
228
+ const h = document.createElement("style");
229
+ h.id = "magic-sentence-reset";
230
+ const r = document.getElementById("magic-sentence-reset");
231
+ r && r.remove(), h.textContent = `
507
232
  #magic-sentence-root, #magic-sentence-root * {
508
233
  box-sizing: border-box;
509
234
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
@@ -529,17 +254,17 @@ const Ae = {
529
254
  height: 100% !important;
530
255
  overflow: hidden !important;
531
256
  }
532
- `, document.head.appendChild(p);
533
- }, hn = (p) => [...p].sort(() => Math.random() - 0.5);
534
- function wn(p = {}) {
535
- const { logoUrl: d, showLogo: S = !0, baseURL: j } = p, W = je(null), { validateAllSentences: w, errors: P } = un(), R = () => r || window.innerWidth < 768, f = () => r || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (n = "medium") => {
536
- if (!f())
257
+ `, document.head.appendChild(h);
258
+ }, on = (h) => [...h].sort(() => Math.random() - 0.5);
259
+ function ln(h = {}) {
260
+ const { logoUrl: r, showLogo: y = !0, baseURL: B } = h, ne = We(null), { validateAllSentences: S, errors: M } = _e(), C = () => d || window.innerWidth < 768, c = () => d || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (e = "medium") => {
261
+ if (!c())
537
262
  return {
538
263
  padding: "12px 24px",
539
264
  fontSize: "16px",
540
265
  minWidth: "auto"
541
266
  };
542
- switch (n) {
267
+ switch (e) {
543
268
  case "small":
544
269
  return {
545
270
  padding: "4px 6px",
@@ -560,201 +285,203 @@ function wn(p = {}) {
560
285
  };
561
286
  }
562
287
  };
563
- ue(() => (gn(), () => {
564
- document.body.style.overflow = "";
288
+ V(() => (tn(), () => {
289
+ document.documentElement.style.overflow = "", document.body.style.overflow = "";
290
+ const e = document.getElementById("magic-sentence-reset");
291
+ e && e.remove();
565
292
  }), []);
566
- const [y, T] = g("select"), [H, B] = g(null), [oe, ge] = g(null), [E, U] = g([]), [_, he] = g(0), [se, me] = g([]), [I, ae] = g([]), [z, J] = g(20), [$, V] = g(0), [we, le] = g(null), [M, A] = g(null), [c, F] = g(!1), [X, xe] = g(
293
+ const [f, k] = p("select"), [I, ge] = p(null), [he, we] = p(null), [H, q] = p([]), [T, ue] = p(0), [te, me] = p([]), [v, ie] = p([]), [L, fe] = p(20), [J, Y] = p(0), [rn, xe] = p(null), [A, z] = p(null), [l, K] = p(!1), [oe, ve] = p(
567
294
  Number(localStorage.getItem("magicSentenceBest")) || 0
568
- ), L = je(null), [e, a] = g({ list: null, index: null, side: null }), [r, b] = g(!1), [de, G] = g(1), [x, O] = g(null), [ce, Se] = g(!1), [q, De] = g(!1), [Z, _e] = g(!1), [Q, Oe] = g(!1), [K, ze] = g(!1), [ee, Me] = g(!1), [ne, Le] = g(!1), [te, Ne] = g(!1), [ie, Be] = g(!1);
569
- ue(() => {
570
- const n = () => {
571
- const i = window.innerWidth, t = window.innerHeight, o = i < 768 || i === 926 && t === 428 || i === 932 && t === 430, l = t < 700, v = i === 768 && t === 1024, k = i === 1024 && t === 768, u = i === 820 && t === 1180, m = i === 1180 && t === 820, re = i === 540 && t === 720, C = i === 720 && t === 540, Re = i === 1024 && t === 1366, nn = i === 1366 && t === 1024, tn = i >= 1200 && t >= 600 && !o;
572
- if (Se(tn), De(v), _e(k), Oe(u), ze(m), Me(re), Le(C), Ne(Re), Be(nn), b(o), o)
573
- O(null), G(1);
574
- else if (l)
575
- O(null), G(1);
295
+ ), U = We(null), [b, P] = p({ list: null, index: null, side: null }), [d, ke] = p(!1), [sn, re] = p(1), [ye, se] = p(null), [He, Ie] = p(!1), [$, Ce] = p(!1), [G, De] = p(!1), [N, Te] = p(!1), [j, Pe] = p(!1), [O, Re] = p(!1), [F, ze] = p(!1), [Z, Ee] = p(!1), [Q, Be] = p(!1);
296
+ V(() => {
297
+ const e = () => {
298
+ const t = window.innerWidth, n = window.innerHeight, i = t < 768 || t === 926 && n === 428 || t === 932 && n === 430, o = n < 700, u = t === 768 && n === 1024, x = t === 1024 && n === 768, s = t === 820 && n === 1180, w = t === 1180 && n === 820, X = t === 540 && n === 720, W = t === 720 && n === 540, ce = t === 1024 && n === 1366, Ue = t === 1366 && n === 1024, Ve = t >= 1200 && n >= 600 && !i;
299
+ if (Ie(Ve), Ce(u), De(x), Te(s), Pe(w), Re(X), ze(W), Ee(ce), Be(Ue), ke(i), i)
300
+ se(null), re(1);
301
+ else if (o)
302
+ se(null), re(1);
576
303
  else {
577
- const rn = Math.min(1e3, Math.min(i, t) * 0.9);
578
- O(rn), G(1);
304
+ const qe = Math.min(1e3, Math.min(t, n) * 0.9);
305
+ se(qe), re(1);
579
306
  }
580
307
  };
581
- return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
308
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
582
309
  }, []);
583
- const ye = (n, i, t, o) => {
584
- if (c) return;
585
- let l = [...se], v = [...I];
586
- const k = n === "bank" ? l : v, u = i === "bank" ? l : v, m = k.findIndex((Re) => Re.id === t);
587
- if (m === -1) return;
588
- const [re] = k.splice(m, 1);
589
- let C = o;
590
- n === i && C !== null && C !== void 0 && C > m && (C = C - 1), C == null || C < 0 || C > u.length ? u.push(re) : u.splice(C, 0, re), n === "bank" ? l = k : v = k, i === "bank" ? l = u : v = u, me(l), ae(v);
591
- }, be = (n, i, t) => {
592
- if (n.preventDefault(), c) {
593
- a({ list: null, index: null, side: null });
310
+ const _ = (e, t, n, i) => {
311
+ if (l) return;
312
+ let o = [...te], u = [...v];
313
+ const x = e === "bank" ? o : u, s = t === "bank" ? o : u, w = x.findIndex((ce) => ce.id === n);
314
+ if (w === -1) return;
315
+ const [X] = x.splice(w, 1);
316
+ let W = i;
317
+ e === t && W !== null && W !== void 0 && W > w && (W = W - 1), W == null || W < 0 || W > s.length ? s.push(X) : s.splice(W, 0, X), e === "bank" ? o = x : u = x, t === "bank" ? o = s : u = s, me(o), ie(u);
318
+ }, ee = (e, t, n) => {
319
+ if (e.preventDefault(), l) {
320
+ P({ list: null, index: null, side: null });
594
321
  return;
595
322
  }
596
- const o = n.dataTransfer.getData("application/x-token") || (() => {
597
- const l = n.dataTransfer.getData("text/plain");
598
- if (!l) return "";
599
- const v = se.some((m) => m.id === l), k = I.some((m) => m.id === l), u = v ? "bank" : k ? "selected" : null;
600
- return u ? JSON.stringify({ from: u, id: l }) : "";
323
+ const i = e.dataTransfer.getData("application/x-token") || (() => {
324
+ const o = e.dataTransfer.getData("text/plain");
325
+ if (!o) return "";
326
+ const u = te.some((w) => w.id === o), x = v.some((w) => w.id === o), s = u ? "bank" : x ? "selected" : null;
327
+ return s ? JSON.stringify({ from: s, id: o }) : "";
601
328
  })();
602
- if (o) {
329
+ if (i) {
603
330
  try {
604
- const l = JSON.parse(o);
605
- if (!l || !l.id || !l.from) return;
606
- ye(l.from, i, l.id, t);
331
+ const o = JSON.parse(i);
332
+ if (!o || !o.id || !o.from) return;
333
+ _(o.from, t, o.id, n);
607
334
  } catch {
608
335
  }
609
- a({ list: null, index: null, side: null });
336
+ P({ list: null, index: null, side: null });
610
337
  }
611
- }, $e = (n) => {
612
- B(n), U(Array(n).fill("")), T("time");
613
- }, Fe = (n) => {
614
- ge(n), T("type");
615
- }, Ge = (n, i) => {
616
- if (i.length > 41 || i && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(i))
338
+ }, Me = (e) => {
339
+ ge(e), q(Array(e).fill("")), k("time");
340
+ }, Le = (e) => {
341
+ we(e), k("type");
342
+ }, Ae = (e, t) => {
343
+ if (t.length > 41 || t && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(t))
617
344
  return;
618
- const o = [...E];
619
- o[n] = i, U(o);
620
- const l = w(o);
621
- l.isValid || console.warn("Validation errors:", l.errors);
622
- }, Ye = (n) => n.trim().replace(/\s+/g, " "), Te = (n) => n <= 3 ? 20 : n <= 5 ? 18 : n <= 7 ? 16 : n <= 9 ? 14 : 12, Ue = () => {
623
- E.some((i) => i.trim().length === 0) || (U((i) => i.map((t) => Ye(t))), V(0), he(0), le(null), T("getready"));
345
+ const i = [...H];
346
+ i[e] = t, q(i);
347
+ const o = S(i);
348
+ o.isValid || console.warn("Validation errors:", o.errors);
349
+ }, $e = (e) => e.trim().replace(/\s+/g, " "), be = (e) => e <= 3 ? 20 : e <= 5 ? 18 : e <= 7 ? 16 : e <= 9 ? 14 : 12, Ge = () => {
350
+ H.some((t) => t.trim().length === 0) || (q((t) => t.map((n) => $e(n))), Y(0), ue(0), xe(null), k("getready"));
624
351
  };
625
- ue(() => {
626
- if (y === "getready") {
627
- const n = setTimeout(() => ke(0), 3e3);
628
- return () => clearTimeout(n);
352
+ V(() => {
353
+ if (f === "getready") {
354
+ const e = setTimeout(() => ae(0), 3e3);
355
+ return () => clearTimeout(e);
629
356
  }
630
- }, [y]);
631
- const ke = (n) => {
632
- const i = E[n];
633
- if (!i) return;
634
- const o = hn(
635
- i.trim().split(/\s+/).filter(Boolean)
636
- ).map((l, v) => ({
637
- id: `${Date.now()}-${n}-${v}-${Math.random().toString(36).slice(2)}`,
638
- text: l
357
+ }, [f]);
358
+ const ae = (e) => {
359
+ const t = H[e];
360
+ if (!t) return;
361
+ const i = on(
362
+ t.trim().split(/\s+/).filter(Boolean)
363
+ ).map((o, u) => ({
364
+ id: `${Date.now()}-${e}-${u}-${Math.random().toString(36).slice(2)}`,
365
+ text: o
639
366
  }));
640
- me(o), ae([]), he(n), J(oe || 20), A(null), F(!1), T("play");
367
+ me(i), ie([]), ue(e), fe(he || 20), z(null), K(!1), k("play");
641
368
  };
642
- ue(() => {
643
- if (y === "play" && !c)
644
- if (L.current !== null && window.clearTimeout(L.current), z > 0)
645
- L.current = window.setTimeout(() => J((n) => n - 1), 1e3);
369
+ V(() => {
370
+ if (f === "play" && !l)
371
+ if (U.current !== null && window.clearTimeout(U.current), L > 0)
372
+ U.current = window.setTimeout(() => fe((e) => e - 1), 1e3);
646
373
  else {
647
- F(!0);
648
- const i = E[_].trim().split(/\s+/), t = I.map((u) => u.text), o = i.filter((u) => !t.includes(u)).length, l = t.filter((u) => !i.includes(u)).length, v = i.filter((u, m) => u !== t[m]).length, k = o + l + v;
649
- k === 0 ? (A("correct"), N("correct"), Y("Correct! Well done!")) : k === 1 ? (A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!"));
374
+ K(!0);
375
+ const t = H[T].trim().split(/\s+/), n = v.map((s) => s.text), i = t.filter((s) => !n.includes(s)).length, o = n.filter((s) => !t.includes(s)).length, u = t.filter((s, w) => s !== n[w]).length, x = i + o + u;
376
+ x === 0 ? (z("correct"), R("correct"), E("Correct! Well done!")) : x === 1 ? (z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!"));
650
377
  }
651
378
  return () => {
652
- L.current !== null && window.clearTimeout(L.current);
379
+ U.current !== null && window.clearTimeout(U.current);
653
380
  };
654
- }, [y, z, c, E, _, I]);
655
- const Je = (n = !0) => {
656
- if (c && n) {
657
- _ + 1 < (H || 0) ? ke(_ + 1) : (T("results"), setTimeout(() => We(), 600));
381
+ }, [f, L, l, H, T, v]);
382
+ const Ne = (e = !0) => {
383
+ if (l && e) {
384
+ T + 1 < (I || 0) ? ae(T + 1) : (k("results"), setTimeout(() => de(), 600));
658
385
  return;
659
386
  }
660
- if (n && !c) {
661
- const t = E[_].trim().split(/\s+/), o = I.map((m) => m.text), l = t.filter((m) => !o.includes(m)).length, v = o.filter((m) => !t.includes(m)).length, k = t.filter((m, re) => m !== o[re]).length, u = l + v + k;
662
- u === 0 && z > 0 ? (V((m) => m + 1), A("correct"), N("correct"), Y("Correct! Well done!")) : u === 1 ? (V((m) => m + 0.5), A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!")), _ + 1 < (H || 0) ? setTimeout(() => ke(_ + 1), 800) : (T("results"), setTimeout(() => We(), 600));
387
+ if (e && !l) {
388
+ const n = H[T].trim().split(/\s+/), i = v.map((w) => w.text), o = n.filter((w) => !i.includes(w)).length, u = i.filter((w) => !n.includes(w)).length, x = n.filter((w, X) => w !== i[X]).length, s = o + u + x;
389
+ s === 0 && L > 0 ? (Y((w) => w + 1), z("correct"), R("correct"), E("Correct! Well done!")) : s === 1 ? (Y((w) => w + 0.5), z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!")), T + 1 < (I || 0) ? setTimeout(() => ae(T + 1), 800) : (k("results"), setTimeout(() => de(), 600));
663
390
  }
664
391
  };
665
- ue(() => {
666
- y === "results" && $ > X && (xe($), localStorage.setItem("magicSentenceBest", String($)));
667
- }, [y, $, X]);
668
- const N = (n) => {
669
- const i = new (window.AudioContext || window.webkitAudioContext)(), t = i.createOscillator(), o = i.createGain();
670
- switch (t.connect(o), o.connect(i.destination), n) {
392
+ V(() => {
393
+ f === "results" && J > oe && (ve(J), localStorage.setItem("magicSentenceBest", String(J)));
394
+ }, [f, J, oe]);
395
+ const R = (e) => {
396
+ const t = new (window.AudioContext || window.webkitAudioContext)(), n = t.createOscillator(), i = t.createGain();
397
+ switch (n.connect(i), i.connect(t.destination), e) {
671
398
  case "start":
672
- t.frequency.value = 500;
399
+ n.frequency.value = 500;
673
400
  break;
674
401
  case "click":
675
- t.frequency.value = 800;
402
+ n.frequency.value = 800;
676
403
  break;
677
404
  case "correct":
678
- t.frequency.value = 1e3;
405
+ n.frequency.value = 1e3;
679
406
  break;
680
407
  case "half":
681
- t.frequency.value = 700;
408
+ n.frequency.value = 700;
682
409
  break;
683
410
  case "wrong":
684
- t.frequency.value = 200;
411
+ n.frequency.value = 200;
685
412
  break;
686
413
  }
687
- o.gain.setValueAtTime(0.1, i.currentTime), t.start(), t.stop(i.currentTime + 0.2);
688
- }, We = () => {
689
- const i = Date.now() + 2500, t = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], o = document.createElement("canvas"), l = o.getContext("2d");
690
- o.width = window.innerWidth, o.height = window.innerHeight, o.style.position = "fixed", o.style.top = "0", o.style.left = "0", o.style.pointerEvents = "none", document.body.appendChild(o);
691
- const v = Array.from({ length: 100 }).map(() => ({
692
- x: Math.random() * o.width,
693
- y: Math.random() * o.height - o.height,
414
+ i.gain.setValueAtTime(0.1, t.currentTime), n.start(), n.stop(t.currentTime + 0.2);
415
+ }, de = () => {
416
+ const t = Date.now() + 2500, n = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], i = document.createElement("canvas"), o = i.getContext("2d");
417
+ i.width = window.innerWidth, i.height = window.innerHeight, i.style.position = "fixed", i.style.top = "0", i.style.left = "0", i.style.pointerEvents = "none", document.body.appendChild(i);
418
+ const u = Array.from({ length: 100 }).map(() => ({
419
+ x: Math.random() * i.width,
420
+ y: Math.random() * i.height - i.height,
694
421
  size: 6 + Math.random() * 6,
695
- color: t[Math.floor(Math.random() * t.length)],
422
+ color: n[Math.floor(Math.random() * n.length)],
696
423
  speed: 2 + Math.random() * 4,
697
424
  tilt: Math.random() * 2 * Math.PI
698
- })), k = () => {
699
- l.clearRect(0, 0, o.width, o.height), v.forEach((u) => {
700
- l.fillStyle = u.color, l.beginPath(), l.ellipse(u.x, u.y, u.size, u.size / 2, u.tilt, 0, 2 * Math.PI), l.fill(), u.y += u.speed, u.x += Math.sin(u.tilt);
701
- }), Date.now() < i ? requestAnimationFrame(k) : document.body.removeChild(o);
425
+ })), x = () => {
426
+ o.clearRect(0, 0, i.width, i.height), u.forEach((s) => {
427
+ o.fillStyle = s.color, o.beginPath(), o.ellipse(s.x, s.y, s.size, s.size / 2, s.tilt, 0, 2 * Math.PI), o.fill(), s.y += s.speed, s.x += Math.sin(s.tilt);
428
+ }), Date.now() < t ? requestAnimationFrame(x) : document.body.removeChild(i);
702
429
  };
703
- k();
704
- }, Ve = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
705
- /* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
706
- /* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select number of rounds" }),
707
- /* @__PURE__ */ s.jsx("div", { style: {
430
+ x();
431
+ }, je = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
432
+ /* @__PURE__ */ a("h1", { style: g.gmHeadline1, children: "MAGIC SENTENCE" }),
433
+ /* @__PURE__ */ a("p", { style: g.gmBodyM, children: "Select number of rounds" }),
434
+ /* @__PURE__ */ a("div", { style: {
708
435
  display: "flex",
709
- gap: f() ? "8px" : "16px",
436
+ gap: c() ? "8px" : "16px",
710
437
  justifyContent: "center"
711
- }, children: [3, 4, 5].map((n) => /* @__PURE__ */ s.jsxs(
438
+ }, children: [3, 4, 5].map((e) => /* @__PURE__ */ m(
712
439
  "button",
713
440
  {
714
- onClick: () => $e(n),
441
+ onClick: () => Me(e),
715
442
  style: {
716
- ...h.gmButton,
443
+ ...g.gmButton,
717
444
  ...D("medium")
718
445
  },
719
446
  children: [
720
- n,
447
+ e,
721
448
  " ROUNDS"
722
449
  ]
723
450
  },
724
- n
451
+ e
725
452
  )) })
726
- ] }), Xe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
727
- /* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
728
- /* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select time per round" }),
729
- /* @__PURE__ */ s.jsx("div", { style: {
453
+ ] }), Oe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
454
+ /* @__PURE__ */ a("h1", { style: g.gmHeadline1, children: "MAGIC SENTENCE" }),
455
+ /* @__PURE__ */ a("p", { style: g.gmBodyM, children: "Select time per round" }),
456
+ /* @__PURE__ */ a("div", { style: {
730
457
  display: "flex",
731
- gap: f() ? "8px" : "16px",
458
+ gap: c() ? "8px" : "16px",
732
459
  justifyContent: "center"
733
- }, children: [15, 20, 30].map((n) => /* @__PURE__ */ s.jsxs(
460
+ }, children: [15, 20, 30].map((e) => /* @__PURE__ */ m(
734
461
  "button",
735
462
  {
736
- onClick: () => Fe(n),
463
+ onClick: () => Le(e),
737
464
  style: {
738
- ...h.gmButton,
465
+ ...g.gmButton,
739
466
  ...D("medium")
740
467
  },
741
468
  children: [
742
- n,
469
+ e,
743
470
  "s"
744
471
  ]
745
472
  },
746
- n
473
+ e
747
474
  )) })
748
- ] }), qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
749
- /* @__PURE__ */ s.jsxs("h2", { style: { ...h.gmBodyM, marginBottom: "0px" }, children: [
475
+ ] }), Fe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
476
+ /* @__PURE__ */ m("h2", { style: { ...g.gmBodyM, marginBottom: "0px" }, children: [
750
477
  "Type down ",
751
- H,
478
+ I,
752
479
  " sentence",
753
- H && H > 1 ? "s" : "",
480
+ I && I > 1 ? "s" : "",
754
481
  " for your student"
755
482
  ] }),
756
- /* @__PURE__ */ s.jsx("p", { style: { ...h.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
757
- /* @__PURE__ */ s.jsx("div", { style: {
483
+ /* @__PURE__ */ a("p", { style: { ...g.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
484
+ /* @__PURE__ */ a("div", { style: {
758
485
  display: "flex",
759
486
  flexDirection: "column",
760
487
  gap: 12,
@@ -764,317 +491,314 @@ function wn(p = {}) {
764
491
  // Минимальная ширина по содержимому
765
492
  maxWidth: "600px"
766
493
  // Ограничиваем максимальную ширину
767
- }, children: E.map((n, i) => /* @__PURE__ */ s.jsx(
494
+ }, children: H.map((e, t) => /* @__PURE__ */ a(
768
495
  "input",
769
496
  {
770
- value: n,
771
- placeholder: `Sentence ${i + 1}`,
772
- onChange: (t) => Ge(i, t.target.value),
497
+ value: e,
498
+ placeholder: `Sentence ${t + 1}`,
499
+ onChange: (n) => Ae(t, n.target.value),
773
500
  style: {
774
- ...h.gmInput,
775
- padding: f() ? "8px 12px" : "12px 16px",
776
- fontSize: f() ? "14px" : "16px",
501
+ ...g.gmInput,
502
+ padding: c() ? "8px 12px" : "12px 16px",
503
+ fontSize: c() ? "14px" : "16px",
777
504
  width: "100%",
778
505
  // Поля теперь будут шире благодаря увеличенной ширине контейнера
779
506
  textAlign: "center"
780
507
  // Центрируем placeholder текст
781
508
  }
782
509
  },
783
- i
510
+ t
784
511
  )) }),
785
- /* @__PURE__ */ s.jsx(
512
+ /* @__PURE__ */ a(
786
513
  "button",
787
514
  {
788
- onClick: Ue,
789
- disabled: E.some((n) => n.trim().length === 0),
515
+ onClick: Ge,
516
+ disabled: H.some((e) => e.trim().length === 0),
790
517
  style: {
791
- ...h.gmButton,
518
+ ...g.gmButton,
792
519
  marginTop: 30,
793
- background: E.some((n) => n.trim().length === 0) ? "#ccc" : "#ec4c44",
794
- cursor: E.some((n) => n.trim().length === 0) ? "not-allowed" : "pointer",
520
+ background: H.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
521
+ cursor: H.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
795
522
  ...D("large")
796
523
  },
797
524
  children: "PLAY"
798
525
  }
799
526
  )
800
- ] }), Ze = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmReadyWrapper, children: [
801
- /* @__PURE__ */ s.jsx("h1", { style: {
802
- ...h.gmHeadline1,
803
- fontSize: f() ? "36px" : "72px",
804
- color: "#ec4c44",
805
- marginBottom: "20px",
806
- animation: "pulse 1s ease-in-out infinite"
527
+ ] }), Ze = () => /* @__PURE__ */ m("div", { style: g.gmReadyWrapper, children: [
528
+ /* @__PURE__ */ a("h1", { style: {
529
+ ...g.gmHeadline1,
530
+ color: "#ec4c44"
807
531
  }, children: "GET READY" }),
808
- /* @__PURE__ */ s.jsx("div", { style: h.gmHourglass, children: "⏳" })
809
- ] }), Qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmGameLayout, children: [
810
- /* @__PURE__ */ s.jsxs("h2", { style: {
811
- marginBottom: f() ? "5px" : "10px",
812
- fontSize: f() ? "16px" : "20px"
532
+ /* @__PURE__ */ a("div", { style: g.gmHourglass, children: "⏳" })
533
+ ] }), Qe = () => /* @__PURE__ */ m("div", { style: g.gmGameLayout, children: [
534
+ /* @__PURE__ */ m("h2", { style: {
535
+ marginBottom: c() ? "5px" : "10px",
536
+ fontSize: c() ? "16px" : "20px"
813
537
  }, children: [
814
538
  "Round ",
815
- _ + 1,
539
+ T + 1,
816
540
  "/",
817
- H,
541
+ I,
818
542
  " — ",
819
- c ? "TIME'S UP!" : `Time: ${z}s`
543
+ l ? "TIME'S UP!" : `Time: ${L}s`
820
544
  ] }),
821
- /* @__PURE__ */ s.jsx(
545
+ /* @__PURE__ */ a(
822
546
  "div",
823
547
  {
824
548
  style: {
825
549
  width: "60%",
826
- height: f() ? "8px" : "14px",
550
+ height: c() ? "8px" : "14px",
827
551
  borderRadius: 8,
828
552
  background: "#eee",
829
553
  overflow: "hidden",
830
- marginBottom: f() ? "10px" : "20px"
554
+ marginBottom: c() ? "10px" : "20px"
831
555
  },
832
- children: /* @__PURE__ */ s.jsx(
556
+ children: /* @__PURE__ */ a(
833
557
  "div",
834
558
  {
835
559
  style: {
836
560
  height: "100%",
837
- width: `${z / (oe || 20) * 100}%`,
838
- background: z <= 5 ? "#ec4c44" : "#4caf50",
561
+ width: `${L / (he || 20) * 100}%`,
562
+ background: L <= 5 ? "#ec4c44" : "#4caf50",
839
563
  transition: "width 1s linear"
840
564
  }
841
565
  }
842
566
  )
843
567
  }
844
568
  ),
845
- /* @__PURE__ */ s.jsx(
569
+ /* @__PURE__ */ a(
846
570
  "div",
847
571
  {
848
- onDragOver: (n) => n.preventDefault(),
849
- onDrop: (n) => be(n, "bank", null),
572
+ onDragOver: (e) => e.preventDefault(),
573
+ onDrop: (e) => ee(e, "bank", null),
850
574
  style: {
851
575
  display: "flex",
852
- flexWrap: R() ? "wrap" : "nowrap",
853
- gap: r || window.innerWidth < 768 ? "6px" : "10px",
576
+ flexWrap: C() ? "wrap" : "nowrap",
577
+ gap: d || window.innerWidth < 768 ? "6px" : "10px",
854
578
  justifyContent: "center",
855
- marginBottom: r || window.innerWidth < 768 ? "15px" : "30px",
856
- padding: r || window.innerWidth < 768 ? "5px" : "10px",
579
+ marginBottom: d || window.innerWidth < 768 ? "15px" : "30px",
580
+ padding: d || window.innerWidth < 768 ? "5px" : "10px",
857
581
  width: "100%",
858
582
  boxSizing: "border-box"
859
583
  },
860
- children: se.map((n, i) => /* @__PURE__ */ s.jsx(
584
+ children: te.map((e, t) => /* @__PURE__ */ a(
861
585
  "div",
862
586
  {
863
- draggable: !c,
587
+ draggable: !l,
864
588
  role: "button",
865
- tabIndex: c ? -1 : 0,
866
- "aria-label": c ? `Word: ${n.text} (time expired)` : pn("Drag word", n.text, "to build sentence"),
867
- onDragStart: (t) => {
868
- if (c) {
869
- t.preventDefault();
589
+ tabIndex: l ? -1 : 0,
590
+ "aria-label": l ? `Word: ${e.text} (time expired)` : en("Drag word", e.text, "to build sentence"),
591
+ onDragStart: (n) => {
592
+ if (l) {
593
+ n.preventDefault();
870
594
  return;
871
595
  }
872
- t.dataTransfer.setData(
596
+ n.dataTransfer.setData(
873
597
  "application/x-token",
874
- JSON.stringify({ from: "bank", id: n.id })
875
- ), t.dataTransfer.setData("text/plain", n.id), Y(`Dragging word: ${n.text}`);
598
+ JSON.stringify({ from: "bank", id: e.id })
599
+ ), n.dataTransfer.setData("text/plain", e.id), E(`Dragging word: ${e.text}`);
876
600
  },
877
- onKeyDown: (t) => {
878
- c || fn(t, () => ye("bank", "selected", n.id, null));
601
+ onKeyDown: (n) => {
602
+ l || nn(n, () => _("bank", "selected", e.id, null));
879
603
  },
880
- onDragOver: (t) => t.preventDefault(),
881
- onDrop: (t) => {
882
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2, v = t.clientX > l ? i + 1 : i;
883
- a({ list: null, index: null, side: null }), t.stopPropagation(), be(t, "bank", v);
604
+ onDragOver: (n) => n.preventDefault(),
605
+ onDrop: (n) => {
606
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, u = n.clientX > o ? t + 1 : t;
607
+ P({ list: null, index: null, side: null }), n.stopPropagation(), ee(n, "bank", u);
884
608
  },
885
- onDragEnter: (t) => {
886
- if (c) return;
887
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2;
888
- a({ list: "bank", index: i, side: t.clientX > l ? "right" : "left" });
609
+ onDragEnter: (n) => {
610
+ if (l) return;
611
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
612
+ P({ list: "bank", index: t, side: n.clientX > o ? "right" : "left" });
889
613
  },
890
- onDragLeave: () => a({ list: null, index: null, side: null }),
614
+ onDragLeave: () => P({ list: null, index: null, side: null }),
891
615
  onClick: () => {
892
- c || ye("bank", "selected", n.id, null);
616
+ l || _("bank", "selected", e.id, null);
893
617
  },
894
618
  style: {
895
- padding: r || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
896
- borderRadius: r || window.innerWidth < 768 ? "6px" : "10px",
619
+ padding: d || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
620
+ borderRadius: d || window.innerWidth < 768 ? "6px" : "10px",
897
621
  border: "1px solid #ccc",
898
- background: c ? "#f0f0f0" : "#f9f9f9",
899
- cursor: c ? "not-allowed" : "pointer",
900
- fontSize: r || window.innerWidth < 768 ? "12px" : "18px",
901
- borderLeft: e.list === "bank" && e.index === i && e.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
902
- borderRight: e.list === "bank" && e.index === i && e.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
622
+ background: l ? "#f0f0f0" : "#f9f9f9",
623
+ cursor: l ? "not-allowed" : "pointer",
624
+ fontSize: d || window.innerWidth < 768 ? "12px" : "18px",
625
+ borderLeft: b.list === "bank" && b.index === t && b.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
626
+ borderRight: b.list === "bank" && b.index === t && b.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
903
627
  flexShrink: 0,
904
628
  flexBasis: "auto",
905
- opacity: c ? 0.6 : 1,
629
+ opacity: l ? 0.6 : 1,
906
630
  transition: "opacity 0.3s ease"
907
631
  },
908
- children: n.text
632
+ children: e.text
909
633
  },
910
- n.id
634
+ e.id
911
635
  ))
912
636
  }
913
637
  ),
914
- /* @__PURE__ */ s.jsx(
638
+ /* @__PURE__ */ a(
915
639
  "div",
916
640
  {
917
- onDragOver: (n) => n.preventDefault(),
918
- onDrop: (n) => be(n, "selected", null),
641
+ onDragOver: (e) => e.preventDefault(),
642
+ onDrop: (e) => ee(e, "selected", null),
919
643
  style: {
920
- minHeight: r || window.innerWidth < 768 ? "50px" : "70px",
644
+ minHeight: d || window.innerWidth < 768 ? "50px" : "70px",
921
645
  width: "auto",
922
646
  // Автоматическая ширина в зависимости от содержимого
923
647
  maxWidth: "none",
924
648
  // Убираем ограничение максимальной ширины
925
649
  minWidth: "245px",
926
650
  // Минимальная ширина для растягивания
927
- border: M === "correct" ? "2px dashed #4caf50" : M === "almost" ? "2px dashed #ff9800" : M === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
928
- borderRadius: r || window.innerWidth < 768 ? "8px" : "12px",
929
- padding: r || window.innerWidth < 768 ? "8px" : "12px",
651
+ border: A === "correct" ? "2px dashed #4caf50" : A === "almost" ? "2px dashed #ff9800" : A === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
652
+ borderRadius: d || window.innerWidth < 768 ? "8px" : "12px",
653
+ padding: d || window.innerWidth < 768 ? "8px" : "12px",
930
654
  display: "flex",
931
- flexWrap: R() ? "wrap" : "nowrap",
655
+ flexWrap: C() ? "wrap" : "nowrap",
932
656
  alignItems: "center",
933
657
  justifyContent: "center",
934
- fontSize: `${Te(I.length)}px`,
935
- background: M === "correct" ? "#e8f5e8" : M === "almost" ? "#fff3e0" : M === "wrong" ? "#ffebee" : "#fafafa",
936
- overflowX: R() ? "hidden" : "auto",
937
- whiteSpace: R() ? "normal" : "nowrap"
658
+ fontSize: `${be(v.length)}px`,
659
+ background: A === "correct" ? "#e8f5e8" : A === "almost" ? "#fff3e0" : A === "wrong" ? "#ffebee" : "#fafafa",
660
+ overflowX: C() ? "hidden" : "auto",
661
+ whiteSpace: C() ? "normal" : "nowrap"
938
662
  },
939
- children: I.map((n, i) => /* @__PURE__ */ s.jsx(
663
+ children: v.map((e, t) => /* @__PURE__ */ a(
940
664
  "span",
941
665
  {
942
- draggable: !c,
943
- onDragStart: (t) => {
944
- if (c) {
945
- t.preventDefault();
666
+ draggable: !l,
667
+ onDragStart: (n) => {
668
+ if (l) {
669
+ n.preventDefault();
946
670
  return;
947
671
  }
948
- t.dataTransfer.setData(
672
+ n.dataTransfer.setData(
949
673
  "application/x-token",
950
- JSON.stringify({ from: "selected", id: n.id })
951
- ), t.dataTransfer.setData("text/plain", n.id);
674
+ JSON.stringify({ from: "selected", id: e.id })
675
+ ), n.dataTransfer.setData("text/plain", e.id);
952
676
  },
953
- onDragOver: (t) => t.preventDefault(),
954
- onDrop: (t) => {
955
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2, v = t.clientX > l ? i + 1 : i;
956
- a({ list: null, index: null, side: null }), t.stopPropagation(), be(t, "selected", v);
677
+ onDragOver: (n) => n.preventDefault(),
678
+ onDrop: (n) => {
679
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, u = n.clientX > o ? t + 1 : t;
680
+ P({ list: null, index: null, side: null }), n.stopPropagation(), ee(n, "selected", u);
957
681
  },
958
- onDragEnter: (t) => {
959
- if (c) return;
960
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2;
961
- a({ list: "selected", index: i, side: t.clientX > l ? "right" : "left" });
682
+ onDragEnter: (n) => {
683
+ if (l) return;
684
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
685
+ P({ list: "selected", index: t, side: n.clientX > o ? "right" : "left" });
962
686
  },
963
- onDragLeave: () => a({ list: null, index: null, side: null }),
687
+ onDragLeave: () => P({ list: null, index: null, side: null }),
964
688
  onClick: () => {
965
- c || ye("selected", "bank", n.id, null);
689
+ l || _("selected", "bank", e.id, null);
966
690
  },
967
- title: c ? "Time expired" : "Click to remove back to bank",
691
+ title: l ? "Time expired" : "Click to remove back to bank",
968
692
  style: {
969
- padding: f() ? "4px 6px" : "6px 10px",
970
- margin: f() ? "2px" : "4px",
971
- borderRadius: f() ? "4px" : "8px",
972
- background: c ? "#f0f0f0" : "#ffe9e7",
973
- border: c ? "1px solid #ccc" : "1px solid #ec4c44",
974
- borderLeft: e.list === "selected" && e.index === i && e.side === "left" ? "3px solid #3b82f6" : void 0,
975
- borderRight: e.list === "selected" && e.index === i && e.side === "right" ? "3px solid #3b82f6" : void 0,
976
- cursor: c ? "not-allowed" : "pointer",
693
+ padding: c() ? "4px 6px" : "6px 10px",
694
+ margin: c() ? "2px" : "4px",
695
+ borderRadius: c() ? "4px" : "8px",
696
+ background: l ? "#f0f0f0" : "#ffe9e7",
697
+ border: l ? "1px solid #ccc" : "1px solid #ec4c44",
698
+ borderLeft: b.list === "selected" && b.index === t && b.side === "left" ? "3px solid #3b82f6" : void 0,
699
+ borderRight: b.list === "selected" && b.index === t && b.side === "right" ? "3px solid #3b82f6" : void 0,
700
+ cursor: l ? "not-allowed" : "pointer",
977
701
  userSelect: "none",
978
- fontSize: `${Te(I.length)}px`,
702
+ fontSize: `${be(v.length)}px`,
979
703
  // Адаптивный размер шрифта для слов
980
704
  fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
981
705
  // Более плотный шрифт
982
706
  whiteSpace: "nowrap",
983
707
  // Запрещаем перенос слов
984
- opacity: c ? 0.6 : 1,
708
+ opacity: l ? 0.6 : 1,
985
709
  transition: "opacity 0.3s ease"
986
710
  },
987
- children: n.text
711
+ children: e.text
988
712
  },
989
- n.id
713
+ e.id
990
714
  ))
991
715
  }
992
716
  ),
993
- /* @__PURE__ */ s.jsx(
717
+ /* @__PURE__ */ a(
994
718
  "button",
995
719
  {
996
- onClick: () => Je(!0),
997
- disabled: !c && I.length === 0,
720
+ onClick: () => Ne(!0),
721
+ disabled: !l && v.length === 0,
998
722
  style: {
999
- marginTop: f() ? "15px" : "30px",
1000
- fontSize: f() ? "14px" : "20px",
1001
- padding: f() ? "6px 12px" : "10px 24px",
1002
- borderRadius: f() ? "8px" : "12px",
1003
- background: c || I.length > 0 ? "#ec4c44" : "#ccc",
723
+ marginTop: c() ? "15px" : "30px",
724
+ fontSize: c() ? "14px" : "20px",
725
+ padding: c() ? "6px 12px" : "10px 24px",
726
+ borderRadius: c() ? "8px" : "12px",
727
+ background: l || v.length > 0 ? "#ec4c44" : "#ccc",
1004
728
  color: "white",
1005
729
  border: "none",
1006
- cursor: c || I.length > 0 ? "pointer" : "not-allowed"
730
+ cursor: l || v.length > 0 ? "pointer" : "not-allowed"
1007
731
  },
1008
732
  children: "NEXT"
1009
733
  }
1010
734
  )
1011
- ] }), Ke = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
1012
- /* @__PURE__ */ s.jsx("h1", { style: {
1013
- ...h.gmHeadline1,
1014
- marginTop: (r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie, "0px"),
1015
- marginBottom: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "10px",
1016
- fontSize: r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "32px" : "clamp(28px, 4vw, 40px)"
735
+ ] }), Xe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
736
+ /* @__PURE__ */ a("h1", { style: {
737
+ ...g.gmHeadline1,
738
+ marginTop: (d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q, "0px"),
739
+ marginBottom: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "10px",
740
+ fontSize: d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "32px" : "clamp(28px, 4vw, 40px)"
1017
741
  }, children: "Game Over 🎯" }),
1018
- /* @__PURE__ */ s.jsxs("h2", { style: {
1019
- ...h.gmHeadline2,
1020
- marginTop: (r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie, "0px"),
1021
- marginBottom: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "16px",
1022
- fontSize: r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "18px" : "24px"
742
+ /* @__PURE__ */ m("h2", { style: {
743
+ ...g.gmHeadline2,
744
+ marginTop: (d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q, "0px"),
745
+ marginBottom: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "16px",
746
+ fontSize: d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "18px" : "24px"
1023
747
  }, children: [
1024
748
  "Your score: ",
1025
- $,
749
+ J,
1026
750
  " out of ",
1027
- H
751
+ I
1028
752
  ] }),
1029
- /* @__PURE__ */ s.jsxs("p", { style: {
1030
- ...h.gmBodyM,
753
+ /* @__PURE__ */ m("p", { style: {
754
+ ...g.gmBodyM,
1031
755
  color: "#10b981",
1032
- marginTop: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "0px" : "12px",
1033
- marginBottom: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "16px",
1034
- fontSize: r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px"
756
+ marginTop: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "0px" : "12px",
757
+ marginBottom: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "16px",
758
+ fontSize: d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px"
1035
759
  }, children: [
1036
760
  "Best score: ",
1037
- X
761
+ oe
1038
762
  ] }),
1039
- /* @__PURE__ */ s.jsxs("div", { style: {
763
+ /* @__PURE__ */ m("div", { style: {
1040
764
  display: "flex",
1041
- gap: r && window.innerWidth > window.innerHeight || r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
1042
- marginTop: r && window.innerWidth > window.innerHeight || r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "2px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || ce ? "12px" : "24px"
765
+ gap: d && window.innerWidth > window.innerHeight || d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
766
+ marginTop: d && window.innerWidth > window.innerHeight || d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "2px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || He ? "12px" : "24px"
1043
767
  }, children: [
1044
- /* @__PURE__ */ s.jsx(
768
+ /* @__PURE__ */ a(
1045
769
  "button",
1046
770
  {
1047
771
  onClick: () => {
1048
- We(), N("start"), setTimeout(() => {
1049
- T("getready"), le(null), F(!1);
772
+ de(), R("start"), setTimeout(() => {
773
+ k("getready"), xe(null), K(!1);
1050
774
  }, 800);
1051
775
  },
1052
776
  style: {
1053
- ...h.gmButton,
777
+ ...g.gmButton,
1054
778
  ...D("medium")
1055
779
  },
1056
780
  children: "🔁 Play again"
1057
781
  }
1058
782
  ),
1059
- /* @__PURE__ */ s.jsx(
783
+ /* @__PURE__ */ a(
1060
784
  "button",
1061
785
  {
1062
786
  onClick: () => {
1063
- N("click"), T("select"), B(null), ge(null), U([]), V(0), ae([]), F(!1);
787
+ R("click"), k("select"), ge(null), we(null), q([]), Y(0), ie([]), K(!1);
1064
788
  },
1065
789
  style: {
1066
- ...h.gmButton,
790
+ ...g.gmButton,
1067
791
  ...D("medium")
1068
792
  },
1069
793
  children: "⬅️ Exit"
1070
794
  }
1071
795
  )
1072
796
  ] })
1073
- ] }), Ie = d || (j ? `${j.endsWith("/") ? j.slice(0, -1) : j}/logo.svg` : typeof window < "u" && window.origin ? `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg` : null), en = !r && S && !(window.innerWidth > window.innerHeight) && window.innerHeight >= 700;
1074
- return /* @__PURE__ */ s.jsx(
797
+ ] }), le = r || (B ? `${B.endsWith("/") ? B.slice(0, -1) : B}/logo.svg` : typeof window < "u" && window.origin ? `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg` : null), Je = !d && y && !(window.innerWidth > window.innerHeight) && window.innerHeight >= 700;
798
+ return /* @__PURE__ */ a(
1075
799
  "div",
1076
800
  {
1077
- ref: W,
801
+ ref: ne,
1078
802
  style: {
1079
803
  width: "100%",
1080
804
  height: "100%",
@@ -1090,81 +814,90 @@ function wn(p = {}) {
1090
814
  right: 0,
1091
815
  bottom: 0
1092
816
  },
1093
- children: /* @__PURE__ */ s.jsx(
817
+ children: /* @__PURE__ */ m(
1094
818
  "div",
1095
819
  {
1096
820
  style: {
1097
- width: r ? "100%" : x || 1e3,
1098
- height: r ? "100%" : x || 1e3,
821
+ width: d ? "100%" : ye || 1e3,
822
+ height: d ? "100%" : ye || 1e3,
1099
823
  display: "flex",
1100
824
  justifyContent: "center",
1101
825
  alignItems: "center",
1102
826
  overflow: "hidden",
1103
- borderRadius: r ? 0 : "20px",
827
+ borderRadius: d ? 0 : "20px",
1104
828
  background: "linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",
1105
- boxShadow: r ? "none" : "0 0 40px rgba(0,0,0,0.1)",
1106
- margin: r ? "0 auto" : "unset",
829
+ boxShadow: d ? "none" : "0 0 40px rgba(0,0,0,0.1)",
830
+ margin: d ? "0 auto" : "unset",
1107
831
  position: "relative"
832
+ // needed so absolute logo is inside the square
1108
833
  },
1109
- children: /* @__PURE__ */ s.jsx(
1110
- "div",
1111
- {
1112
- style: {
1113
- transform: "none",
1114
- width: "100%",
1115
- height: "100%",
1116
- display: "flex",
1117
- justifyContent: "center",
1118
- alignItems: "center"
1119
- },
1120
- children: /* @__PURE__ */ s.jsxs("div", { id: "magic-sentence-root", children: [
1121
- en ? /* @__PURE__ */ s.jsx("div", { style: {
1122
- ...h.gmLogoFixed,
1123
- display: "block"
1124
- }, children: Ie ? /* @__PURE__ */ s.jsx(
1125
- "img",
1126
- {
1127
- src: Ie,
1128
- alt: "SPEAKID Logo",
1129
- style: h.gmLogoImg,
1130
- loading: "lazy"
1131
- }
1132
- ) : /* @__PURE__ */ s.jsx("div", { style: h.gmLogoImg, children: "SPEAKID" }) }) : null,
1133
- y === "select" ? Ve() : null,
1134
- y === "time" ? Xe() : null,
1135
- y === "type" ? qe() : null,
1136
- y === "getready" ? Ze() : null,
1137
- y === "play" ? Qe() : null,
1138
- y === "results" ? Ke() : null
1139
- ] })
1140
- }
1141
- )
834
+ children: [
835
+ !d && Je && /* @__PURE__ */ a("div", { style: { ...g.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: le ? /* @__PURE__ */ m("picture", { children: [
836
+ /* @__PURE__ */ a(
837
+ "source",
838
+ {
839
+ srcSet: le,
840
+ type: "image/svg+xml"
841
+ }
842
+ ),
843
+ /* @__PURE__ */ a(
844
+ "img",
845
+ {
846
+ src: le.replace(".svg", ".png"),
847
+ alt: "SPEAKID Logo",
848
+ style: g.gmLogoImg,
849
+ loading: "lazy"
850
+ }
851
+ )
852
+ ] }) : /* @__PURE__ */ a("div", { style: g.gmLogoImg, children: "SPEAKID" }) }),
853
+ /* @__PURE__ */ a(
854
+ "div",
855
+ {
856
+ style: {
857
+ transform: "none",
858
+ width: "100%",
859
+ height: "100%",
860
+ display: "flex",
861
+ justifyContent: "center",
862
+ alignItems: "center"
863
+ },
864
+ children: /* @__PURE__ */ m("div", { id: "magic-sentence-root", children: [
865
+ f === "select" ? je() : null,
866
+ f === "time" ? Oe() : null,
867
+ f === "type" ? Fe() : null,
868
+ f === "getready" ? Ze() : null,
869
+ f === "play" ? Qe() : null,
870
+ f === "results" ? Xe() : null
871
+ ] })
872
+ }
873
+ )
874
+ ]
1142
875
  }
1143
876
  )
1144
877
  }
1145
878
  );
1146
879
  }
1147
- class xn extends sn {
1148
- constructor(d) {
1149
- super(d), this.state = { hasError: !1 };
880
+ class cn extends Ye {
881
+ constructor(r) {
882
+ super(r), this.state = { hasError: !1 };
1150
883
  }
1151
- static getDerivedStateFromError(d) {
884
+ static getDerivedStateFromError(r) {
1152
885
  return {
1153
886
  hasError: !0,
1154
- error: d
887
+ error: r
1155
888
  };
1156
889
  }
1157
- componentDidCatch(d, S) {
1158
- console.error("Game Error:", d, S), this.setState({
1159
- error: d,
1160
- errorInfo: S
890
+ componentDidCatch(r, y) {
891
+ console.error("Game Error:", r, y), this.setState({
892
+ error: r,
893
+ errorInfo: y
1161
894
  });
1162
895
  }
1163
896
  handleReset = () => {
1164
897
  this.setState({ hasError: !1, error: void 0, errorInfo: void 0 });
1165
898
  };
1166
899
  render() {
1167
- return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ s.jsxs("div", { style: {
900
+ return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ m("div", { style: {
1168
901
  display: "flex",
1169
902
  flexDirection: "column",
1170
903
  alignItems: "center",
@@ -1176,9 +909,9 @@ class xn extends sn {
1176
909
  color: "#dc2626",
1177
910
  fontFamily: "system-ui, sans-serif"
1178
911
  }, children: [
1179
- /* @__PURE__ */ s.jsx("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
1180
- /* @__PURE__ */ s.jsx("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
1181
- /* @__PURE__ */ s.jsx(
912
+ /* @__PURE__ */ a("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
913
+ /* @__PURE__ */ a("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
914
+ /* @__PURE__ */ a(
1182
915
  "button",
1183
916
  {
1184
917
  onClick: this.handleReset,
@@ -1192,14 +925,14 @@ class xn extends sn {
1192
925
  cursor: "pointer",
1193
926
  transition: "background-color 0.2s"
1194
927
  },
1195
- onMouseOver: (d) => d.currentTarget.style.backgroundColor = "#b91c1c",
1196
- onMouseOut: (d) => d.currentTarget.style.backgroundColor = "#dc2626",
928
+ onMouseOver: (r) => r.currentTarget.style.backgroundColor = "#b91c1c",
929
+ onMouseOut: (r) => r.currentTarget.style.backgroundColor = "#dc2626",
1197
930
  children: "🔄 Restart Game"
1198
931
  }
1199
932
  ),
1200
- typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ s.jsxs("details", { style: { marginTop: "20px", textAlign: "left", maxWidth: "600px" }, children: [
1201
- /* @__PURE__ */ s.jsx("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
1202
- /* @__PURE__ */ s.jsxs("pre", { style: {
933
+ typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ m("details", { style: { marginTop: "20px", textAlign: "left", maxWidth: "600px" }, children: [
934
+ /* @__PURE__ */ a("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
935
+ /* @__PURE__ */ m("pre", { style: {
1203
936
  backgroundColor: "#f3f4f6",
1204
937
  padding: "12px",
1205
938
  borderRadius: "4px",
@@ -1215,12 +948,12 @@ class xn extends sn {
1215
948
  }
1216
949
  }
1217
950
  export {
1218
- xn as ErrorBoundary,
1219
- wn as Game,
1220
- Y as announceToScreenReader,
1221
- pn as createAriaLabel,
1222
- wn as default,
1223
- fn as handleKeyDown,
1224
- un as useValidation
951
+ cn as ErrorBoundary,
952
+ ln as Game,
953
+ E as announceToScreenReader,
954
+ en as createAriaLabel,
955
+ ln as default,
956
+ nn as handleKeyDown,
957
+ _e as useValidation
1225
958
  };
1226
959
  //# sourceMappingURL=speakid-build-a-sentence.es.js.map