speakid-build-a-sentence 1.0.17 → 1.0.19

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,6 +1,6 @@
1
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 = `
2
+ import { useState as c, useCallback as pe, useRef as be, useEffect as J, Component as Ue } from "react";
3
+ const qe = `
4
4
  @keyframes magic-sentence-spin {
5
5
  from { transform: rotate(0deg); }
6
6
  to { transform: rotate(360deg); }
@@ -35,8 +35,8 @@ const Ke = `
35
35
  }
36
36
  `;
37
37
  if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes")) {
38
- const h = document.createElement("style");
39
- h.id = "magic-sentence-keyframes", h.innerHTML = Ke, document.head.appendChild(h);
38
+ const g = document.createElement("style");
39
+ g.id = "magic-sentence-keyframes", g.innerHTML = qe, document.head.appendChild(g);
40
40
  }
41
41
  const Se = {
42
42
  spin: {
@@ -57,7 +57,7 @@ const Se = {
57
57
  glow: {
58
58
  animation: "magic-sentence-glow 1s ease-in-out infinite"
59
59
  }
60
- }, g = {
60
+ }, p = {
61
61
  gmCenterScreen: {
62
62
  position: "relative",
63
63
  zIndex: 1,
@@ -147,6 +147,17 @@ const Se = {
147
147
  willChange: "auto"
148
148
  },
149
149
  gmLogoImg: {
150
+ height: "clamp(28px, 5vw, 40px)",
151
+ width: "auto",
152
+ background: "transparent",
153
+ objectFit: "contain",
154
+ imageRendering: "auto",
155
+ transform: "translateZ(0)",
156
+ backfaceVisibility: "hidden",
157
+ WebkitFontSmoothing: "antialiased",
158
+ display: "block"
159
+ },
160
+ gmLogoFallback: {
150
161
  height: "clamp(28px, 5vw, 40px)",
151
162
  width: "auto",
152
163
  background: "transparent",
@@ -157,8 +168,7 @@ const Se = {
157
168
  transform: "translateZ(0)",
158
169
  backfaceVisibility: "hidden",
159
170
  WebkitFontSmoothing: "antialiased",
160
- objectFit: "contain",
161
- imageRendering: "auto"
171
+ display: "block"
162
172
  },
163
173
  gmReadyWrapper: {
164
174
  display: "flex",
@@ -175,60 +185,60 @@ const Se = {
175
185
  },
176
186
  // ===== Анимационные стили =====
177
187
  ...Se
178
- }, _e = () => {
179
- const [h, r] = p([]), y = pe((S, M, C) => {
180
- const c = [];
181
- S.trim() || c.push({
188
+ }, Ye = () => {
189
+ const [g, r] = c([]), S = pe((H, I, u) => {
190
+ const f = [];
191
+ H.trim() || f.push({
182
192
  type: "empty",
183
193
  message: "Sentence cannot be empty"
184
- }), S.length > 41 && c.push({
194
+ }), H.length > 41 && f.push({
185
195
  type: "length",
186
- message: `Sentence is too long (${S.length}/41 characters)`
187
- }), S && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(S) && c.push({
196
+ message: `Sentence is too long (${H.length}/41 characters)`
197
+ }), H && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(H) && f.push({
188
198
  type: "characters",
189
199
  message: "Only Latin characters, numbers, spaces and punctuation are allowed"
190
200
  });
191
- const f = C.findIndex((k, I) => I !== M && k.toLowerCase().trim() === S.toLowerCase().trim());
192
- return f !== -1 && c.push({
201
+ const b = u.findIndex((D, V) => V !== I && D.toLowerCase().trim() === H.toLowerCase().trim());
202
+ return b !== -1 && f.push({
193
203
  type: "duplicate",
194
- message: `Duplicate sentence (same as sentence ${f + 1})`
195
- }), r(c), {
196
- isValid: c.length === 0,
197
- errors: c
204
+ message: `Duplicate sentence (same as sentence ${b + 1})`
205
+ }), r(f), {
206
+ isValid: f.length === 0,
207
+ errors: f
198
208
  };
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}`
209
+ }, []), ee = pe((H) => {
210
+ const I = [];
211
+ return H.forEach((u, f) => {
212
+ const y = S(u, f, H);
213
+ I.push(...y.errors.map((b) => ({
214
+ ...b,
215
+ message: `Sentence ${f + 1}: ${b.message}`
206
216
  })));
207
217
  }), {
208
- isValid: M.length === 0,
209
- errors: M
218
+ isValid: I.length === 0,
219
+ errors: I
210
220
  };
211
- }, [y]), ne = pe(() => {
221
+ }, [S]), ne = pe(() => {
212
222
  r([]);
213
223
  }, []);
214
224
  return {
215
- errors: h,
216
- validateSentence: y,
217
- validateAllSentences: B,
225
+ errors: g,
226
+ validateSentence: S,
227
+ validateAllSentences: ee,
218
228
  clearErrors: ne
219
229
  };
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) => {
230
+ }, Ke = (g, r, S) => r && S ? `${g} word "${r}" ${S}` : r ? `${g} word "${r}"` : g, _e = (g, r, S = ["Enter", " "]) => {
231
+ S.includes(g.key) && (g.preventDefault(), r());
232
+ }, E = (g) => {
223
233
  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(() => {
234
+ 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 = g, setTimeout(() => {
225
235
  document.body.removeChild(r);
226
236
  }, 1e3);
227
- }, tn = () => {
228
- const h = document.createElement("style");
229
- h.id = "magic-sentence-reset";
237
+ }, en = () => {
238
+ const g = document.createElement("style");
239
+ g.id = "magic-sentence-reset";
230
240
  const r = document.getElementById("magic-sentence-reset");
231
- r && r.remove(), h.textContent = `
241
+ r && r.remove(), g.textContent = `
232
242
  #magic-sentence-root, #magic-sentence-root * {
233
243
  box-sizing: border-box;
234
244
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
@@ -254,11 +264,11 @@ const Se = {
254
264
  height: 100% !important;
255
265
  overflow: hidden !important;
256
266
  }
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())
267
+ `, document.head.appendChild(g);
268
+ }, nn = (g) => [...g].sort(() => Math.random() - 0.5);
269
+ function dn(g = {}) {
270
+ const { logoUrl: r, showLogo: S = !0 } = g, ee = be(null), { validateAllSentences: ne, errors: H } = Ye(), I = () => l || window.innerWidth < 768, u = () => l || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, f = (e = "medium") => {
271
+ if (!u())
262
272
  return {
263
273
  padding: "12px 24px",
264
274
  fontSize: "16px",
@@ -285,113 +295,113 @@ function ln(h = {}) {
285
295
  };
286
296
  }
287
297
  };
288
- V(() => (tn(), () => {
298
+ J(() => (en(), () => {
289
299
  document.documentElement.style.overflow = "", document.body.style.overflow = "";
290
300
  const e = document.getElementById("magic-sentence-reset");
291
301
  e && e.remove();
292
302
  }), []);
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(
303
+ const [y, b] = c("select"), [D, V] = c(null), [ge, he] = c(null), [C, U] = c([]), [T, we] = c(0), [te, ue] = c([]), [k, ie] = c([]), [B, me] = c(20), [Q, q] = c(0), [tn, fe] = c(null), [L, z] = c(null), [d, Y] = c(!1), [oe, We] = c(
294
304
  Number(localStorage.getItem("magicSentenceBest")) || 0
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(() => {
305
+ ), X = be(null), [W, P] = c({ list: null, index: null, side: null }), [l, ve] = c(!1), [on, re] = c(1), [xe, se] = c(null), [ke, He] = c(!1), [M, Ie] = c(!1), [A, Ce] = c(!1), [G, De] = c(!1), [$, Te] = c(!1), [N, Pe] = c(!1), [j, Re] = c(!1), [O, ze] = c(!1), [F, Ee] = c(!1);
306
+ J(() => {
297
307
  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)
308
+ const t = window.innerWidth, n = window.innerHeight, i = t < 768 || t === 926 && n === 428 || t === 932 && n === 430, o = n < 700, w = t === 768 && n === 1024, x = t === 1024 && n === 768, s = t === 820 && n === 1180, h = t === 1180 && n === 820, Z = t === 540 && n === 720, v = t === 720 && n === 540, ce = t === 1024 && n === 1366, Xe = t === 1366 && n === 1024, Je = t >= 1200 && n >= 600 && !i;
309
+ if (He(Je), Ie(w), Ce(x), De(s), Te(h), Pe(Z), Re(v), ze(ce), Ee(Xe), ve(i), i)
300
310
  se(null), re(1);
301
311
  else if (o)
302
312
  se(null), re(1);
303
313
  else {
304
- const qe = Math.min(1e3, Math.min(t, n) * 0.9);
305
- se(qe), re(1);
314
+ const Ve = Math.min(1e3, Math.min(t, n) * 0.9);
315
+ se(Ve), re(1);
306
316
  }
307
317
  };
308
318
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
309
319
  }, []);
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
+ const K = (e, t, n, i) => {
321
+ if (d) return;
322
+ let o = [...te], w = [...k];
323
+ const x = e === "bank" ? o : w, s = t === "bank" ? o : w, h = x.findIndex((ce) => ce.id === n);
324
+ if (h === -1) return;
325
+ const [Z] = x.splice(h, 1);
326
+ let v = i;
327
+ e === t && v !== null && v !== void 0 && v > h && (v = v - 1), v == null || v < 0 || v > s.length ? s.push(Z) : s.splice(v, 0, Z), e === "bank" ? o = x : w = x, t === "bank" ? o = s : w = s, ue(o), ie(w);
328
+ }, _ = (e, t, n) => {
329
+ if (e.preventDefault(), d) {
320
330
  P({ list: null, index: null, side: null });
321
331
  return;
322
332
  }
323
333
  const i = e.dataTransfer.getData("application/x-token") || (() => {
324
334
  const o = e.dataTransfer.getData("text/plain");
325
335
  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;
336
+ const w = te.some((h) => h.id === o), x = k.some((h) => h.id === o), s = w ? "bank" : x ? "selected" : null;
327
337
  return s ? JSON.stringify({ from: s, id: o }) : "";
328
338
  })();
329
339
  if (i) {
330
340
  try {
331
341
  const o = JSON.parse(i);
332
342
  if (!o || !o.id || !o.from) return;
333
- _(o.from, t, o.id, n);
343
+ K(o.from, t, o.id, n);
334
344
  } catch {
335
345
  }
336
346
  P({ list: null, index: null, side: null });
337
347
  }
338
- }, Me = (e) => {
339
- ge(e), q(Array(e).fill("")), k("time");
348
+ }, Be = (e) => {
349
+ V(e), U(Array(e).fill("")), b("time");
340
350
  }, Le = (e) => {
341
- we(e), k("type");
342
- }, Ae = (e, t) => {
351
+ he(e), b("type");
352
+ }, Me = (e, t) => {
343
353
  if (t.length > 41 || t && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(t))
344
354
  return;
345
- const i = [...H];
346
- i[e] = t, q(i);
347
- const o = S(i);
355
+ const i = [...C];
356
+ i[e] = t, U(i);
357
+ const o = ne(i);
348
358
  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"));
359
+ }, Ae = (e) => e.trim().replace(/\s+/g, " "), ye = (e) => e <= 3 ? 20 : e <= 5 ? 18 : e <= 7 ? 16 : e <= 9 ? 14 : 12, Ge = () => {
360
+ C.some((t) => t.trim().length === 0) || (U((t) => t.map((n) => Ae(n))), q(0), we(0), fe(null), b("getready"));
351
361
  };
352
- V(() => {
353
- if (f === "getready") {
362
+ J(() => {
363
+ if (y === "getready") {
354
364
  const e = setTimeout(() => ae(0), 3e3);
355
365
  return () => clearTimeout(e);
356
366
  }
357
- }, [f]);
367
+ }, [y]);
358
368
  const ae = (e) => {
359
- const t = H[e];
369
+ const t = C[e];
360
370
  if (!t) return;
361
- const i = on(
371
+ const i = nn(
362
372
  t.trim().split(/\s+/).filter(Boolean)
363
- ).map((o, u) => ({
364
- id: `${Date.now()}-${e}-${u}-${Math.random().toString(36).slice(2)}`,
373
+ ).map((o, w) => ({
374
+ id: `${Date.now()}-${e}-${w}-${Math.random().toString(36).slice(2)}`,
365
375
  text: o
366
376
  }));
367
- me(i), ie([]), ue(e), fe(he || 20), z(null), K(!1), k("play");
377
+ ue(i), ie([]), we(e), me(ge || 20), z(null), Y(!1), b("play");
368
378
  };
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);
379
+ J(() => {
380
+ if (y === "play" && !d)
381
+ if (X.current !== null && window.clearTimeout(X.current), B > 0)
382
+ X.current = window.setTimeout(() => me((e) => e - 1), 1e3);
373
383
  else {
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;
384
+ Y(!0);
385
+ const t = C[T].trim().split(/\s+/), n = k.map((s) => s.text), i = t.filter((s) => !n.includes(s)).length, o = n.filter((s) => !t.includes(s)).length, w = t.filter((s, h) => s !== n[h]).length, x = i + o + w;
376
386
  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!"));
377
387
  }
378
388
  return () => {
379
- U.current !== null && window.clearTimeout(U.current);
389
+ X.current !== null && window.clearTimeout(X.current);
380
390
  };
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));
391
+ }, [y, B, d, C, T, k]);
392
+ const $e = (e = !0) => {
393
+ if (d && e) {
394
+ T + 1 < (D || 0) ? ae(T + 1) : (b("results"), setTimeout(() => de(), 600));
385
395
  return;
386
396
  }
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));
397
+ if (e && !d) {
398
+ const n = C[T].trim().split(/\s+/), i = k.map((h) => h.text), o = n.filter((h) => !i.includes(h)).length, w = i.filter((h) => !n.includes(h)).length, x = n.filter((h, Z) => h !== i[Z]).length, s = o + w + x;
399
+ s === 0 && B > 0 ? (q((h) => h + 1), z("correct"), R("correct"), E("Correct! Well done!")) : s === 1 ? (q((h) => h + 0.5), z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!")), T + 1 < (D || 0) ? setTimeout(() => ae(T + 1), 800) : (b("results"), setTimeout(() => de(), 600));
390
400
  }
391
401
  };
392
- V(() => {
393
- f === "results" && J > oe && (ve(J), localStorage.setItem("magicSentenceBest", String(J)));
394
- }, [f, J, oe]);
402
+ J(() => {
403
+ y === "results" && Q > oe && (We(Q), localStorage.setItem("magicSentenceBest", String(Q)));
404
+ }, [y, Q, oe]);
395
405
  const R = (e) => {
396
406
  const t = new (window.AudioContext || window.webkitAudioContext)(), n = t.createOscillator(), i = t.createGain();
397
407
  switch (n.connect(i), i.connect(t.destination), e) {
@@ -415,7 +425,7 @@ function ln(h = {}) {
415
425
  }, de = () => {
416
426
  const t = Date.now() + 2500, n = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], i = document.createElement("canvas"), o = i.getContext("2d");
417
427
  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(() => ({
428
+ const w = Array.from({ length: 100 }).map(() => ({
419
429
  x: Math.random() * i.width,
420
430
  y: Math.random() * i.height - i.height,
421
431
  size: 6 + Math.random() * 6,
@@ -423,25 +433,25 @@ function ln(h = {}) {
423
433
  speed: 2 + Math.random() * 4,
424
434
  tilt: Math.random() * 2 * Math.PI
425
435
  })), x = () => {
426
- o.clearRect(0, 0, i.width, i.height), u.forEach((s) => {
436
+ o.clearRect(0, 0, i.width, i.height), w.forEach((s) => {
427
437
  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
438
  }), Date.now() < t ? requestAnimationFrame(x) : document.body.removeChild(i);
429
439
  };
430
440
  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" }),
441
+ }, Ne = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
442
+ /* @__PURE__ */ a("h1", { style: p.gmHeadline1, children: "MAGIC SENTENCE" }),
443
+ /* @__PURE__ */ a("p", { style: p.gmBodyM, children: "Select number of rounds" }),
434
444
  /* @__PURE__ */ a("div", { style: {
435
445
  display: "flex",
436
- gap: c() ? "8px" : "16px",
446
+ gap: u() ? "8px" : "16px",
437
447
  justifyContent: "center"
438
448
  }, children: [3, 4, 5].map((e) => /* @__PURE__ */ m(
439
449
  "button",
440
450
  {
441
- onClick: () => Me(e),
451
+ onClick: () => Be(e),
442
452
  style: {
443
- ...g.gmButton,
444
- ...D("medium")
453
+ ...p.gmButton,
454
+ ...f("medium")
445
455
  },
446
456
  children: [
447
457
  e,
@@ -450,20 +460,20 @@ function ln(h = {}) {
450
460
  },
451
461
  e
452
462
  )) })
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" }),
463
+ ] }), je = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
464
+ /* @__PURE__ */ a("h1", { style: p.gmHeadline1, children: "MAGIC SENTENCE" }),
465
+ /* @__PURE__ */ a("p", { style: p.gmBodyM, children: "Select time per round" }),
456
466
  /* @__PURE__ */ a("div", { style: {
457
467
  display: "flex",
458
- gap: c() ? "8px" : "16px",
468
+ gap: u() ? "8px" : "16px",
459
469
  justifyContent: "center"
460
470
  }, children: [15, 20, 30].map((e) => /* @__PURE__ */ m(
461
471
  "button",
462
472
  {
463
473
  onClick: () => Le(e),
464
474
  style: {
465
- ...g.gmButton,
466
- ...D("medium")
475
+ ...p.gmButton,
476
+ ...f("medium")
467
477
  },
468
478
  children: [
469
479
  e,
@@ -472,15 +482,15 @@ function ln(h = {}) {
472
482
  },
473
483
  e
474
484
  )) })
475
- ] }), Fe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
476
- /* @__PURE__ */ m("h2", { style: { ...g.gmBodyM, marginBottom: "0px" }, children: [
485
+ ] }), Oe = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
486
+ /* @__PURE__ */ m("h2", { style: { ...p.gmBodyM, marginBottom: "0px" }, children: [
477
487
  "Type down ",
478
- I,
488
+ D,
479
489
  " sentence",
480
- I && I > 1 ? "s" : "",
490
+ D && D > 1 ? "s" : "",
481
491
  " for your student"
482
492
  ] }),
483
- /* @__PURE__ */ a("p", { style: { ...g.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
493
+ /* @__PURE__ */ a("p", { style: { ...p.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
484
494
  /* @__PURE__ */ a("div", { style: {
485
495
  display: "flex",
486
496
  flexDirection: "column",
@@ -491,16 +501,16 @@ function ln(h = {}) {
491
501
  // Минимальная ширина по содержимому
492
502
  maxWidth: "600px"
493
503
  // Ограничиваем максимальную ширину
494
- }, children: H.map((e, t) => /* @__PURE__ */ a(
504
+ }, children: C.map((e, t) => /* @__PURE__ */ a(
495
505
  "input",
496
506
  {
497
507
  value: e,
498
508
  placeholder: `Sentence ${t + 1}`,
499
- onChange: (n) => Ae(t, n.target.value),
509
+ onChange: (n) => Me(t, n.target.value),
500
510
  style: {
501
- ...g.gmInput,
502
- padding: c() ? "8px 12px" : "12px 16px",
503
- fontSize: c() ? "14px" : "16px",
511
+ ...p.gmInput,
512
+ padding: u() ? "8px 12px" : "12px 16px",
513
+ fontSize: u() ? "14px" : "16px",
504
514
  width: "100%",
505
515
  // Поля теперь будут шире благодаря увеличенной ширине контейнера
506
516
  textAlign: "center"
@@ -513,53 +523,53 @@ function ln(h = {}) {
513
523
  "button",
514
524
  {
515
525
  onClick: Ge,
516
- disabled: H.some((e) => e.trim().length === 0),
526
+ disabled: C.some((e) => e.trim().length === 0),
517
527
  style: {
518
- ...g.gmButton,
528
+ ...p.gmButton,
519
529
  marginTop: 30,
520
- background: H.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
521
- cursor: H.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
522
- ...D("large")
530
+ background: C.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
531
+ cursor: C.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
532
+ ...f("large")
523
533
  },
524
534
  children: "PLAY"
525
535
  }
526
536
  )
527
- ] }), Ze = () => /* @__PURE__ */ m("div", { style: g.gmReadyWrapper, children: [
537
+ ] }), Fe = () => /* @__PURE__ */ m("div", { style: p.gmReadyWrapper, children: [
528
538
  /* @__PURE__ */ a("h1", { style: {
529
- ...g.gmHeadline1,
539
+ ...p.gmHeadline1,
530
540
  color: "#ec4c44"
531
541
  }, children: "GET READY" }),
532
- /* @__PURE__ */ a("div", { style: g.gmHourglass, children: "⏳" })
533
- ] }), Qe = () => /* @__PURE__ */ m("div", { style: g.gmGameLayout, children: [
542
+ /* @__PURE__ */ a("div", { style: p.gmHourglass, children: "⏳" })
543
+ ] }), Ze = () => /* @__PURE__ */ m("div", { style: p.gmGameLayout, children: [
534
544
  /* @__PURE__ */ m("h2", { style: {
535
- marginBottom: c() ? "5px" : "10px",
536
- fontSize: c() ? "16px" : "20px"
545
+ marginBottom: u() ? "5px" : "10px",
546
+ fontSize: u() ? "16px" : "20px"
537
547
  }, children: [
538
548
  "Round ",
539
549
  T + 1,
540
550
  "/",
541
- I,
551
+ D,
542
552
  " — ",
543
- l ? "TIME'S UP!" : `Time: ${L}s`
553
+ d ? "TIME'S UP!" : `Time: ${B}s`
544
554
  ] }),
545
555
  /* @__PURE__ */ a(
546
556
  "div",
547
557
  {
548
558
  style: {
549
559
  width: "60%",
550
- height: c() ? "8px" : "14px",
560
+ height: u() ? "8px" : "14px",
551
561
  borderRadius: 8,
552
562
  background: "#eee",
553
563
  overflow: "hidden",
554
- marginBottom: c() ? "10px" : "20px"
564
+ marginBottom: u() ? "10px" : "20px"
555
565
  },
556
566
  children: /* @__PURE__ */ a(
557
567
  "div",
558
568
  {
559
569
  style: {
560
570
  height: "100%",
561
- width: `${L / (he || 20) * 100}%`,
562
- background: L <= 5 ? "#ec4c44" : "#4caf50",
571
+ width: `${B / (ge || 20) * 100}%`,
572
+ background: B <= 5 ? "#ec4c44" : "#4caf50",
563
573
  transition: "width 1s linear"
564
574
  }
565
575
  }
@@ -570,26 +580,26 @@ function ln(h = {}) {
570
580
  "div",
571
581
  {
572
582
  onDragOver: (e) => e.preventDefault(),
573
- onDrop: (e) => ee(e, "bank", null),
583
+ onDrop: (e) => _(e, "bank", null),
574
584
  style: {
575
585
  display: "flex",
576
- flexWrap: C() ? "wrap" : "nowrap",
577
- gap: d || window.innerWidth < 768 ? "6px" : "10px",
586
+ flexWrap: I() ? "wrap" : "nowrap",
587
+ gap: l || window.innerWidth < 768 ? "6px" : "10px",
578
588
  justifyContent: "center",
579
- marginBottom: d || window.innerWidth < 768 ? "15px" : "30px",
580
- padding: d || window.innerWidth < 768 ? "5px" : "10px",
589
+ marginBottom: l || window.innerWidth < 768 ? "15px" : "30px",
590
+ padding: l || window.innerWidth < 768 ? "5px" : "10px",
581
591
  width: "100%",
582
592
  boxSizing: "border-box"
583
593
  },
584
594
  children: te.map((e, t) => /* @__PURE__ */ a(
585
595
  "div",
586
596
  {
587
- draggable: !l,
597
+ draggable: !d,
588
598
  role: "button",
589
- tabIndex: l ? -1 : 0,
590
- "aria-label": l ? `Word: ${e.text} (time expired)` : en("Drag word", e.text, "to build sentence"),
599
+ tabIndex: d ? -1 : 0,
600
+ "aria-label": d ? `Word: ${e.text} (time expired)` : Ke("Drag word", e.text, "to build sentence"),
591
601
  onDragStart: (n) => {
592
- if (l) {
602
+ if (d) {
593
603
  n.preventDefault();
594
604
  return;
595
605
  }
@@ -599,34 +609,34 @@ function ln(h = {}) {
599
609
  ), n.dataTransfer.setData("text/plain", e.id), E(`Dragging word: ${e.text}`);
600
610
  },
601
611
  onKeyDown: (n) => {
602
- l || nn(n, () => _("bank", "selected", e.id, null));
612
+ d || _e(n, () => K("bank", "selected", e.id, null));
603
613
  },
604
614
  onDragOver: (n) => n.preventDefault(),
605
615
  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);
616
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, w = n.clientX > o ? t + 1 : t;
617
+ P({ list: null, index: null, side: null }), n.stopPropagation(), _(n, "bank", w);
608
618
  },
609
619
  onDragEnter: (n) => {
610
- if (l) return;
620
+ if (d) return;
611
621
  const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
612
622
  P({ list: "bank", index: t, side: n.clientX > o ? "right" : "left" });
613
623
  },
614
624
  onDragLeave: () => P({ list: null, index: null, side: null }),
615
625
  onClick: () => {
616
- l || _("bank", "selected", e.id, null);
626
+ d || K("bank", "selected", e.id, null);
617
627
  },
618
628
  style: {
619
- padding: d || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
620
- borderRadius: d || window.innerWidth < 768 ? "6px" : "10px",
629
+ padding: l || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
630
+ borderRadius: l || window.innerWidth < 768 ? "6px" : "10px",
621
631
  border: "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",
632
+ background: d ? "#f0f0f0" : "#f9f9f9",
633
+ cursor: d ? "not-allowed" : "pointer",
634
+ fontSize: l || window.innerWidth < 768 ? "12px" : "18px",
635
+ borderLeft: W.list === "bank" && W.index === t && W.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
636
+ borderRight: W.list === "bank" && W.index === t && W.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
627
637
  flexShrink: 0,
628
638
  flexBasis: "auto",
629
- opacity: l ? 0.6 : 1,
639
+ opacity: d ? 0.6 : 1,
630
640
  transition: "opacity 0.3s ease"
631
641
  },
632
642
  children: e.text
@@ -639,33 +649,33 @@ function ln(h = {}) {
639
649
  "div",
640
650
  {
641
651
  onDragOver: (e) => e.preventDefault(),
642
- onDrop: (e) => ee(e, "selected", null),
652
+ onDrop: (e) => _(e, "selected", null),
643
653
  style: {
644
- minHeight: d || window.innerWidth < 768 ? "50px" : "70px",
654
+ minHeight: l || window.innerWidth < 768 ? "50px" : "70px",
645
655
  width: "auto",
646
656
  // Автоматическая ширина в зависимости от содержимого
647
657
  maxWidth: "none",
648
658
  // Убираем ограничение максимальной ширины
649
659
  minWidth: "245px",
650
660
  // Минимальная ширина для растягивания
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",
661
+ border: L === "correct" ? "2px dashed #4caf50" : L === "almost" ? "2px dashed #ff9800" : L === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
662
+ borderRadius: l || window.innerWidth < 768 ? "8px" : "12px",
663
+ padding: l || window.innerWidth < 768 ? "8px" : "12px",
654
664
  display: "flex",
655
- flexWrap: C() ? "wrap" : "nowrap",
665
+ flexWrap: I() ? "wrap" : "nowrap",
656
666
  alignItems: "center",
657
667
  justifyContent: "center",
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"
668
+ fontSize: `${ye(k.length)}px`,
669
+ background: L === "correct" ? "#e8f5e8" : L === "almost" ? "#fff3e0" : L === "wrong" ? "#ffebee" : "#fafafa",
670
+ overflowX: I() ? "hidden" : "auto",
671
+ whiteSpace: I() ? "normal" : "nowrap"
662
672
  },
663
- children: v.map((e, t) => /* @__PURE__ */ a(
673
+ children: k.map((e, t) => /* @__PURE__ */ a(
664
674
  "span",
665
675
  {
666
- draggable: !l,
676
+ draggable: !d,
667
677
  onDragStart: (n) => {
668
- if (l) {
678
+ if (d) {
669
679
  n.preventDefault();
670
680
  return;
671
681
  }
@@ -676,36 +686,36 @@ function ln(h = {}) {
676
686
  },
677
687
  onDragOver: (n) => n.preventDefault(),
678
688
  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);
689
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, w = n.clientX > o ? t + 1 : t;
690
+ P({ list: null, index: null, side: null }), n.stopPropagation(), _(n, "selected", w);
681
691
  },
682
692
  onDragEnter: (n) => {
683
- if (l) return;
693
+ if (d) return;
684
694
  const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
685
695
  P({ list: "selected", index: t, side: n.clientX > o ? "right" : "left" });
686
696
  },
687
697
  onDragLeave: () => P({ list: null, index: null, side: null }),
688
698
  onClick: () => {
689
- l || _("selected", "bank", e.id, null);
699
+ d || K("selected", "bank", e.id, null);
690
700
  },
691
- title: l ? "Time expired" : "Click to remove back to bank",
701
+ title: d ? "Time expired" : "Click to remove back to bank",
692
702
  style: {
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",
703
+ padding: u() ? "4px 6px" : "6px 10px",
704
+ margin: u() ? "2px" : "4px",
705
+ borderRadius: u() ? "4px" : "8px",
706
+ background: d ? "#f0f0f0" : "#ffe9e7",
707
+ border: d ? "1px solid #ccc" : "1px solid #ec4c44",
708
+ borderLeft: W.list === "selected" && W.index === t && W.side === "left" ? "3px solid #3b82f6" : void 0,
709
+ borderRight: W.list === "selected" && W.index === t && W.side === "right" ? "3px solid #3b82f6" : void 0,
710
+ cursor: d ? "not-allowed" : "pointer",
701
711
  userSelect: "none",
702
- fontSize: `${be(v.length)}px`,
712
+ fontSize: `${ye(k.length)}px`,
703
713
  // Адаптивный размер шрифта для слов
704
714
  fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
705
715
  // Более плотный шрифт
706
716
  whiteSpace: "nowrap",
707
717
  // Запрещаем перенос слов
708
- opacity: l ? 0.6 : 1,
718
+ opacity: d ? 0.6 : 1,
709
719
  transition: "opacity 0.3s ease"
710
720
  },
711
721
  children: e.text
@@ -717,65 +727,65 @@ function ln(h = {}) {
717
727
  /* @__PURE__ */ a(
718
728
  "button",
719
729
  {
720
- onClick: () => Ne(!0),
721
- disabled: !l && v.length === 0,
730
+ onClick: () => $e(!0),
731
+ disabled: !d && k.length === 0,
722
732
  style: {
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",
733
+ marginTop: u() ? "15px" : "30px",
734
+ fontSize: u() ? "14px" : "20px",
735
+ padding: u() ? "6px 12px" : "10px 24px",
736
+ borderRadius: u() ? "8px" : "12px",
737
+ background: d || k.length > 0 ? "#ec4c44" : "#ccc",
728
738
  color: "white",
729
739
  border: "none",
730
- cursor: l || v.length > 0 ? "pointer" : "not-allowed"
740
+ cursor: d || k.length > 0 ? "pointer" : "not-allowed"
731
741
  },
732
742
  children: "NEXT"
733
743
  }
734
744
  )
735
- ] }), Xe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
745
+ ] }), Qe = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
736
746
  /* @__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)"
747
+ ...p.gmHeadline1,
748
+ marginTop: (l && 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 || M || A || G || $ || N || j || O || F, "0px"),
749
+ marginBottom: l && 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 || M || A || G || $ || N || j || O || F ? "2px" : "10px",
750
+ fontSize: l && 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)"
741
751
  }, children: "Game Over 🎯" }),
742
752
  /* @__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"
753
+ ...p.gmHeadline2,
754
+ marginTop: (l && 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 || M || A || G || $ || N || j || O || F, "0px"),
755
+ marginBottom: l && 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 || M || A || G || $ || N || j || O || F ? "2px" : "16px",
756
+ fontSize: l && 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"
747
757
  }, children: [
748
758
  "Your score: ",
749
- J,
759
+ Q,
750
760
  " out of ",
751
- I
761
+ D
752
762
  ] }),
753
763
  /* @__PURE__ */ m("p", { style: {
754
- ...g.gmBodyM,
764
+ ...p.gmBodyM,
755
765
  color: "#10b981",
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"
766
+ marginTop: l && 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 || M || A || G || $ || N || j || O || F ? "0px" : "12px",
767
+ marginBottom: l && 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 || M || A || G || $ || N || j || O || F ? "2px" : "16px",
768
+ fontSize: l && 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"
759
769
  }, children: [
760
770
  "Best score: ",
761
771
  oe
762
772
  ] }),
763
773
  /* @__PURE__ */ m("div", { style: {
764
774
  display: "flex",
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"
775
+ gap: l && window.innerWidth > window.innerHeight || l && 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",
776
+ marginTop: l && window.innerWidth > window.innerHeight || l && 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 || ke ? "12px" : "24px"
767
777
  }, children: [
768
778
  /* @__PURE__ */ a(
769
779
  "button",
770
780
  {
771
781
  onClick: () => {
772
782
  de(), R("start"), setTimeout(() => {
773
- k("getready"), xe(null), K(!1);
783
+ b("getready"), fe(null), Y(!1);
774
784
  }, 800);
775
785
  },
776
786
  style: {
777
- ...g.gmButton,
778
- ...D("medium")
787
+ ...p.gmButton,
788
+ ...f("medium")
779
789
  },
780
790
  children: "🔁 Play again"
781
791
  }
@@ -784,21 +794,21 @@ function ln(h = {}) {
784
794
  "button",
785
795
  {
786
796
  onClick: () => {
787
- R("click"), k("select"), ge(null), we(null), q([]), Y(0), ie([]), K(!1);
797
+ R("click"), b("select"), V(null), he(null), U([]), q(0), ie([]), Y(!1);
788
798
  },
789
799
  style: {
790
- ...g.gmButton,
791
- ...D("medium")
800
+ ...p.gmButton,
801
+ ...f("medium")
792
802
  },
793
803
  children: "⬅️ Exit"
794
804
  }
795
805
  )
796
806
  ] })
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;
807
+ ] }), le = r || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/magic%20sentence/logo.svg` : null);
798
808
  return /* @__PURE__ */ a(
799
809
  "div",
800
810
  {
801
- ref: ne,
811
+ ref: ee,
802
812
  style: {
803
813
  width: "100%",
804
814
  height: "100%",
@@ -818,21 +828,21 @@ function ln(h = {}) {
818
828
  "div",
819
829
  {
820
830
  style: {
821
- width: d ? "100%" : ye || 1e3,
822
- height: d ? "100%" : ye || 1e3,
831
+ width: l ? "100%" : xe || 1e3,
832
+ height: l ? "100%" : xe || 1e3,
823
833
  display: "flex",
824
834
  justifyContent: "center",
825
835
  alignItems: "center",
826
836
  overflow: "hidden",
827
- borderRadius: d ? 0 : "20px",
837
+ borderRadius: l ? 0 : "20px",
828
838
  background: "linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",
829
- boxShadow: d ? "none" : "0 0 40px rgba(0,0,0,0.1)",
830
- margin: d ? "0 auto" : "unset",
839
+ boxShadow: l ? "none" : "0 0 40px rgba(0,0,0,0.1)",
840
+ margin: l ? "0 auto" : "unset",
831
841
  position: "relative"
832
842
  // needed so absolute logo is inside the square
833
843
  },
834
844
  children: [
835
- !d && Je && /* @__PURE__ */ a("div", { style: { ...g.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: le ? /* @__PURE__ */ m("picture", { children: [
845
+ !l && S ? /* @__PURE__ */ a("div", { style: { ...p.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: le ? /* @__PURE__ */ m("picture", { children: [
836
846
  /* @__PURE__ */ a(
837
847
  "source",
838
848
  {
@@ -845,11 +855,11 @@ function ln(h = {}) {
845
855
  {
846
856
  src: le.replace(".svg", ".png"),
847
857
  alt: "SPEAKID Logo",
848
- style: g.gmLogoImg,
858
+ style: p.gmLogoImg,
849
859
  loading: "lazy"
850
860
  }
851
861
  )
852
- ] }) : /* @__PURE__ */ a("div", { style: g.gmLogoImg, children: "SPEAKID" }) }),
862
+ ] }) : /* @__PURE__ */ a("div", { style: p.gmLogoFallback, children: "SPEAKID" }) }) : null,
853
863
  /* @__PURE__ */ a(
854
864
  "div",
855
865
  {
@@ -862,12 +872,12 @@ function ln(h = {}) {
862
872
  alignItems: "center"
863
873
  },
864
874
  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
875
+ y === "select" ? Ne() : null,
876
+ y === "time" ? je() : null,
877
+ y === "type" ? Oe() : null,
878
+ y === "getready" ? Fe() : null,
879
+ y === "play" ? Ze() : null,
880
+ y === "results" ? Qe() : null
871
881
  ] })
872
882
  }
873
883
  )
@@ -877,7 +887,7 @@ function ln(h = {}) {
877
887
  }
878
888
  );
879
889
  }
880
- class cn extends Ye {
890
+ class ln extends Ue {
881
891
  constructor(r) {
882
892
  super(r), this.state = { hasError: !1 };
883
893
  }
@@ -887,10 +897,10 @@ class cn extends Ye {
887
897
  error: r
888
898
  };
889
899
  }
890
- componentDidCatch(r, y) {
891
- console.error("Game Error:", r, y), this.setState({
900
+ componentDidCatch(r, S) {
901
+ console.error("Game Error:", r, S), this.setState({
892
902
  error: r,
893
- errorInfo: y
903
+ errorInfo: S
894
904
  });
895
905
  }
896
906
  handleReset = () => {
@@ -948,12 +958,12 @@ class cn extends Ye {
948
958
  }
949
959
  }
950
960
  export {
951
- cn as ErrorBoundary,
952
- ln as Game,
961
+ ln as ErrorBoundary,
962
+ dn as Game,
953
963
  E as announceToScreenReader,
954
- en as createAriaLabel,
955
- ln as default,
956
- nn as handleKeyDown,
957
- _e as useValidation
964
+ Ke as createAriaLabel,
965
+ dn as default,
966
+ _e as handleKeyDown,
967
+ Ye as useValidation
958
968
  };
959
969
  //# sourceMappingURL=speakid-build-a-sentence.es.js.map