@doodle-engine/react 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Engine as ie } from "@doodle-engine/core";
2
2
  import { VERSION as De } from "@doodle-engine/core";
3
- import ue, { createContext as de, useState as C, useCallback as N, useContext as me, useRef as q, useEffect as D } from "react";
3
+ import ue, { createContext as de, useState as C, useEffect as L, useCallback as N, useContext as me, useRef as q } from "react";
4
4
  var Z = { exports: {} }, z = {};
5
5
  /**
6
6
  * @license React
@@ -11,11 +11,11 @@ var Z = { exports: {} }, z = {};
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
- var ne;
14
+ var te;
15
15
  function he() {
16
- if (ne) return z;
17
- ne = 1;
18
- var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
16
+ if (te) return z;
17
+ te = 1;
18
+ var n = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
19
19
  function r(a, l, o) {
20
20
  var m = null;
21
21
  if (o !== void 0 && (m = "" + o), l.key !== void 0 && (m = "" + l.key), "key" in l) {
@@ -24,7 +24,7 @@ function he() {
24
24
  h !== "key" && (o[h] = l[h]);
25
25
  } else o = l;
26
26
  return l = o.ref, {
27
- $$typeof: t,
27
+ $$typeof: n,
28
28
  type: a,
29
29
  key: m,
30
30
  ref: l !== void 0 ? l : null,
@@ -43,15 +43,15 @@ var B = {};
43
43
  * This source code is licensed under the MIT license found in the
44
44
  * LICENSE file in the root directory of this source tree.
45
45
  */
46
- var te;
46
+ var ne;
47
47
  function ve() {
48
- return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
49
- function t(n) {
50
- if (n == null) return null;
51
- if (typeof n == "function")
52
- return n.$$typeof === y ? null : n.displayName || n.name || null;
53
- if (typeof n == "string") return n;
54
- switch (n) {
48
+ return ne || (ne = 1, process.env.NODE_ENV !== "production" && (function() {
49
+ function n(t) {
50
+ if (t == null) return null;
51
+ if (typeof t == "function")
52
+ return t.$$typeof === y ? null : t.displayName || t.name || null;
53
+ if (typeof t == "string") return t;
54
+ switch (t) {
55
55
  case u:
56
56
  return "Fragment";
57
57
  case G:
@@ -65,127 +65,127 @@ function ve() {
65
65
  case v:
66
66
  return "Activity";
67
67
  }
68
- if (typeof n == "object")
69
- switch (typeof n.tag == "number" && console.error(
68
+ if (typeof t == "object")
69
+ switch (typeof t.tag == "number" && console.error(
70
70
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
71
- ), n.$$typeof) {
71
+ ), t.$$typeof) {
72
72
  case i:
73
73
  return "Portal";
74
74
  case W:
75
- return n.displayName || "Context";
76
- case L:
77
- return (n._context.displayName || "Context") + ".Consumer";
75
+ return t.displayName || "Context";
76
+ case D:
77
+ return (t._context.displayName || "Context") + ".Consumer";
78
78
  case J:
79
- var c = n.render;
80
- return n = n.displayName, n || (n = c.displayName || c.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
79
+ var c = t.render;
80
+ return t = t.displayName, t || (t = c.displayName || c.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
81
81
  case p:
82
- return c = n.displayName || null, c !== null ? c : t(n.type) || "Memo";
82
+ return c = t.displayName || null, c !== null ? c : n(t.type) || "Memo";
83
83
  case d:
84
- c = n._payload, n = n._init;
84
+ c = t._payload, t = t._init;
85
85
  try {
86
- return t(n(c));
86
+ return n(t(c));
87
87
  } catch {
88
88
  }
89
89
  }
90
90
  return null;
91
91
  }
92
- function s(n) {
93
- return "" + n;
92
+ function s(t) {
93
+ return "" + t;
94
94
  }
95
- function r(n) {
95
+ function r(t) {
96
96
  try {
97
- s(n);
97
+ s(t);
98
98
  var c = !1;
99
99
  } catch {
100
100
  c = !0;
101
101
  }
102
102
  if (c) {
103
103
  c = console;
104
- var j = c.error, S = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
104
+ var j = c.error, S = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
105
105
  return j.call(
106
106
  c,
107
107
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
108
108
  S
109
- ), s(n);
109
+ ), s(t);
110
110
  }
111
111
  }
112
- function a(n) {
113
- if (n === u) return "<>";
114
- if (typeof n == "object" && n !== null && n.$$typeof === d)
112
+ function a(t) {
113
+ if (t === u) return "<>";
114
+ if (typeof t == "object" && t !== null && t.$$typeof === d)
115
115
  return "<...>";
116
116
  try {
117
- var c = t(n);
117
+ var c = n(t);
118
118
  return c ? "<" + c + ">" : "<...>";
119
119
  } catch {
120
120
  return "<...>";
121
121
  }
122
122
  }
123
123
  function l() {
124
- var n = O.A;
125
- return n === null ? null : n.getOwner();
124
+ var t = O.A;
125
+ return t === null ? null : t.getOwner();
126
126
  }
127
127
  function o() {
128
128
  return Error("react-stack-top-frame");
129
129
  }
130
- function m(n) {
131
- if (M.call(n, "key")) {
132
- var c = Object.getOwnPropertyDescriptor(n, "key").get;
130
+ function m(t) {
131
+ if (M.call(t, "key")) {
132
+ var c = Object.getOwnPropertyDescriptor(t, "key").get;
133
133
  if (c && c.isReactWarning) return !1;
134
134
  }
135
- return n.key !== void 0;
135
+ return t.key !== void 0;
136
136
  }
137
- function h(n, c) {
137
+ function h(t, c) {
138
138
  function j() {
139
139
  P || (P = !0, console.error(
140
140
  "%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)",
141
141
  c
142
142
  ));
143
143
  }
144
- j.isReactWarning = !0, Object.defineProperty(n, "key", {
144
+ j.isReactWarning = !0, Object.defineProperty(t, "key", {
145
145
  get: j,
146
146
  configurable: !0
147
147
  });
148
148
  }
149
149
  function f() {
150
- var n = t(this.type);
151
- return I[n] || (I[n] = !0, console.error(
150
+ var t = n(this.type);
151
+ return I[t] || (I[t] = !0, console.error(
152
152
  "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."
153
- )), n = this.props.ref, n !== void 0 ? n : null;
153
+ )), t = this.props.ref, t !== void 0 ? t : null;
154
154
  }
155
- function b(n, c, j, S, H, K) {
155
+ function g(t, c, j, S, H, K) {
156
156
  var k = j.ref;
157
- return n = {
157
+ return t = {
158
158
  $$typeof: w,
159
- type: n,
159
+ type: t,
160
160
  key: c,
161
161
  props: j,
162
162
  _owner: S
163
- }, (k !== void 0 ? k : null) !== null ? Object.defineProperty(n, "ref", {
163
+ }, (k !== void 0 ? k : null) !== null ? Object.defineProperty(t, "ref", {
164
164
  enumerable: !1,
165
165
  get: f
166
- }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
166
+ }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
169
169
  writable: !0,
170
170
  value: 0
171
- }), Object.defineProperty(n, "_debugInfo", {
171
+ }), Object.defineProperty(t, "_debugInfo", {
172
172
  configurable: !1,
173
173
  enumerable: !1,
174
174
  writable: !0,
175
175
  value: null
176
- }), Object.defineProperty(n, "_debugStack", {
176
+ }), Object.defineProperty(t, "_debugStack", {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
180
  value: H
181
- }), Object.defineProperty(n, "_debugTask", {
181
+ }), Object.defineProperty(t, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
184
184
  writable: !0,
185
185
  value: K
186
- }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
186
+ }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
187
187
  }
188
- function x(n, c, j, S, H, K) {
188
+ function x(t, c, j, S, H, K) {
189
189
  var k = c.children;
190
190
  if (k !== void 0)
191
191
  if (S)
@@ -199,7 +199,7 @@ function ve() {
199
199
  );
200
200
  else R(k);
201
201
  if (M.call(c, "key")) {
202
- k = t(n);
202
+ k = n(t);
203
203
  var U = Object.keys(c).filter(function(ce) {
204
204
  return ce !== "key";
205
205
  });
@@ -223,9 +223,9 @@ React keys must be passed directly to JSX without using spread:
223
223
  } else j = c;
224
224
  return k && h(
225
225
  j,
226
- typeof n == "function" ? n.displayName || n.name || "Unknown" : n
227
- ), b(
228
- n,
226
+ typeof t == "function" ? t.displayName || t.name || "Unknown" : t
227
+ ), g(
228
+ t,
229
229
  k,
230
230
  j,
231
231
  l(),
@@ -233,43 +233,43 @@ React keys must be passed directly to JSX without using spread:
233
233
  K
234
234
  );
235
235
  }
236
- function R(n) {
237
- T(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === d && (n._payload.status === "fulfilled" ? T(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
236
+ function R(t) {
237
+ T(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === d && (t._payload.status === "fulfilled" ? T(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
238
238
  }
239
- function T(n) {
240
- return typeof n == "object" && n !== null && n.$$typeof === w;
239
+ function T(t) {
240
+ return typeof t == "object" && t !== null && t.$$typeof === w;
241
241
  }
242
- var E = ue, w = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), L = Symbol.for("react.consumer"), W = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), v = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), O = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, Y = Array.isArray, $ = console.createTask ? console.createTask : function() {
242
+ var E = ue, w = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), W = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), v = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), O = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, Y = Array.isArray, $ = console.createTask ? console.createTask : function() {
243
243
  return null;
244
244
  };
245
245
  E = {
246
- react_stack_bottom_frame: function(n) {
247
- return n();
246
+ react_stack_bottom_frame: function(t) {
247
+ return t();
248
248
  }
249
249
  };
250
250
  var P, I = {}, X = E.react_stack_bottom_frame.bind(
251
251
  E,
252
252
  o
253
- )(), g = $(a(o)), V = {};
254
- B.Fragment = u, B.jsx = function(n, c, j) {
253
+ )(), b = $(a(o)), V = {};
254
+ B.Fragment = u, B.jsx = function(t, c, j) {
255
255
  var S = 1e4 > O.recentlyCreatedOwnerStacks++;
256
256
  return x(
257
- n,
257
+ t,
258
258
  c,
259
259
  j,
260
260
  !1,
261
261
  S ? Error("react-stack-top-frame") : X,
262
- S ? $(a(n)) : g
262
+ S ? $(a(t)) : b
263
263
  );
264
- }, B.jsxs = function(n, c, j) {
264
+ }, B.jsxs = function(t, c, j) {
265
265
  var S = 1e4 > O.recentlyCreatedOwnerStacks++;
266
266
  return x(
267
- n,
267
+ t,
268
268
  c,
269
269
  j,
270
270
  !0,
271
271
  S ? Error("react-stack-top-frame") : X,
272
- S ? $(a(n)) : g
272
+ S ? $(a(t)) : b
273
273
  );
274
274
  };
275
275
  })()), B;
@@ -280,55 +280,58 @@ function pe() {
280
280
  }
281
281
  var e = pe();
282
282
  const ae = de(null);
283
- function fe({ engine: t, initialSnapshot: s, children: r }) {
284
- const [a, l] = C(s), o = N(
283
+ function fe({ engine: n, initialSnapshot: s, children: r }) {
284
+ const [a, l] = C(s);
285
+ L(() => {
286
+ }, [n]);
287
+ const o = N(
285
288
  (i) => {
286
- const u = t.selectChoice(i);
289
+ const u = n.selectChoice(i);
287
290
  l(u);
288
291
  },
289
- [t]
292
+ [n]
290
293
  ), m = N(
291
294
  (i) => {
292
- const u = t.talkTo(i);
295
+ const u = n.talkTo(i);
293
296
  l(u);
294
297
  },
295
- [t]
298
+ [n]
296
299
  ), h = N(
297
300
  (i) => {
298
- const u = t.takeItem(i);
301
+ const u = n.takeItem(i);
299
302
  l(u);
300
303
  },
301
- [t]
304
+ [n]
302
305
  ), f = N(
303
306
  (i) => {
304
- const u = t.travelTo(i);
307
+ const u = n.travelTo(i);
305
308
  l(u);
306
309
  },
307
- [t]
308
- ), b = N(
310
+ [n]
311
+ ), g = N(
309
312
  (i, u) => {
310
- const _ = t.writeNote(i, u);
313
+ const _ = n.writeNote(i, u);
311
314
  l(_);
312
315
  },
313
- [t]
316
+ [n]
314
317
  ), x = N(
315
318
  (i) => {
316
- const u = t.deleteNote(i);
319
+ const u = n.deleteNote(i);
317
320
  l(u);
318
321
  },
319
- [t]
322
+ [n]
320
323
  ), R = N(
321
324
  (i) => {
322
- const u = t.setLocale(i);
325
+ const u = n.setLocale(i);
323
326
  l(u);
324
327
  },
325
- [t]
326
- ), T = N(() => t.saveGame(), [t]), E = N(
328
+ [n]
329
+ ), T = N(() => n.saveGame(), [n]), E = N(
327
330
  (i) => {
328
- const u = t.loadGame(i);
331
+ const u = n.loadGame(i);
329
332
  l(u);
330
333
  },
331
- [t]
334
+ [n]
332
335
  ), w = {
333
336
  snapshot: a,
334
337
  actions: {
@@ -336,7 +339,7 @@ function fe({ engine: t, initialSnapshot: s, children: r }) {
336
339
  talkTo: m,
337
340
  takeItem: h,
338
341
  travelTo: f,
339
- writeNote: b,
342
+ writeNote: g,
340
343
  deleteNote: x,
341
344
  setLocale: R,
342
345
  saveGame: T,
@@ -346,12 +349,12 @@ function fe({ engine: t, initialSnapshot: s, children: r }) {
346
349
  return /* @__PURE__ */ e.jsx(ae.Provider, { value: w, children: r });
347
350
  }
348
351
  function re() {
349
- const t = me(ae);
350
- if (!t)
352
+ const n = me(ae);
353
+ if (!n)
351
354
  throw new Error("useGame must be used within a GameProvider");
352
- return t;
355
+ return n;
353
356
  }
354
- function le(t, s = {}) {
357
+ function le(n, s = {}) {
355
358
  var p;
356
359
  const {
357
360
  audioBasePath: r = "/audio",
@@ -360,18 +363,18 @@ function le(t, s = {}) {
360
363
  soundVolume: o = 0.8,
361
364
  voiceVolume: m = 1,
362
365
  crossfadeDuration: h = 1e3
363
- } = s, [f, b] = C(a), [x, R] = C(l), [T, E] = C(o), [w, i] = C(m), u = q(null), _ = q(null), G = q(null), L = q(null);
364
- D(() => {
366
+ } = s, [f, g] = C(a), [x, R] = C(l), [T, E] = C(o), [w, i] = C(m), u = q(null), _ = q(null), G = q(null), D = q(null);
367
+ L(() => {
365
368
  const d = new Audio();
366
369
  d.loop = !0, u.current = d;
367
370
  const v = new Audio();
368
371
  return _.current = v, () => {
369
- L.current && clearInterval(L.current), d.pause(), v.pause(), d.src = "", v.src = "";
372
+ D.current && clearInterval(D.current), d.pause(), v.pause(), d.src = "", v.src = "";
370
373
  };
371
- }, []), D(() => {
374
+ }, []), L(() => {
372
375
  const d = u.current;
373
376
  if (!d) return;
374
- const v = t.music;
377
+ const v = n.music;
375
378
  if (v !== G.current)
376
379
  if (G.current = v, !v)
377
380
  J(d, h);
@@ -380,22 +383,22 @@ function le(t, s = {}) {
380
383
  W(d, y, h);
381
384
  }
382
385
  d.volume = f * x;
383
- }, [t.music, f, x, r, h]), D(() => {
386
+ }, [n.music, f, x, r, h]), L(() => {
384
387
  var y;
385
388
  const d = _.current;
386
389
  if (!d) return;
387
- const v = (y = t.dialogue) == null ? void 0 : y.voice;
390
+ const v = (y = n.dialogue) == null ? void 0 : y.voice;
388
391
  v && (d.pause(), d.currentTime = 0, d.src = `${r}/voice/${v}`, d.volume = f * w, d.play().catch((O) => {
389
392
  console.warn("Voice playback failed:", O);
390
393
  }));
391
- }, [(p = t.dialogue) == null ? void 0 : p.voice, f, w, r]), D(() => {
392
- t.pendingSounds.length !== 0 && t.pendingSounds.forEach((d) => {
394
+ }, [(p = n.dialogue) == null ? void 0 : p.voice, f, w, r]), L(() => {
395
+ n.pendingSounds.length !== 0 && n.pendingSounds.forEach((d) => {
393
396
  const v = new Audio(`${r}/sfx/${d}`);
394
397
  v.volume = f * T, v.play().catch((y) => {
395
398
  console.warn("Sound playback failed:", y);
396
399
  });
397
400
  });
398
- }, [t.pendingSounds, f, T, r]);
401
+ }, [n.pendingSounds, f, T, r]);
399
402
  const W = (d, v, y) => {
400
403
  J(d, y / 2).then(() => {
401
404
  d.src = v, d.load(), d.volume = 0, d.play().then(() => {
@@ -410,17 +413,17 @@ function le(t, s = {}) {
410
413
  const I = setInterval(() => {
411
414
  P++, d.volume = Math.max(0, O - $ * P), P >= M && (clearInterval(I), d.pause(), d.currentTime = 0, y());
412
415
  }, Y);
413
- L.current = I;
416
+ D.current = I;
414
417
  }), A = (d, v, y) => {
415
418
  const M = v / 20, Y = y / 20;
416
419
  let $ = 0;
417
420
  const P = setInterval(() => {
418
421
  $++, d.volume = Math.min(y, Y * $), $ >= 20 && clearInterval(P);
419
422
  }, M);
420
- L.current = P;
423
+ D.current = P;
421
424
  };
422
425
  return {
423
- setMasterVolume: b,
426
+ setMasterVolume: g,
424
427
  setMusicVolume: R,
425
428
  setSoundVolume: E,
426
429
  setVoiceVolume: i,
@@ -434,13 +437,13 @@ const xe = {
434
437
  menuOpen: "menu_open.ogg",
435
438
  menuClose: "menu_close.ogg"
436
439
  };
437
- function je(t = {}) {
440
+ function je(n = {}) {
438
441
  const {
439
442
  enabled: s = !0,
440
443
  basePath: r = "/audio/ui",
441
444
  volume: a = 0.5,
442
445
  sounds: l = {}
443
- } = t, [o, m] = C(s), [h, f] = C(a), b = q({ ...xe, ...l }), x = N(
446
+ } = n, [o, m] = C(s), [h, f] = C(a), g = q({ ...xe, ...l }), x = N(
444
447
  (i) => {
445
448
  if (!o || !i) return;
446
449
  const u = new Audio(`${r}/${i}`);
@@ -450,11 +453,11 @@ function je(t = {}) {
450
453
  [o, h, r]
451
454
  ), R = N(
452
455
  (i) => {
453
- const u = b.current[i];
456
+ const u = g.current[i];
454
457
  u && x(u);
455
458
  },
456
459
  [x]
457
- ), T = N(() => x(b.current.click), [x]), E = N(() => x(b.current.menuOpen), [x]), w = N(() => x(b.current.menuClose), [x]);
460
+ ), T = N(() => x(g.current.click), [x]), E = N(() => x(g.current.menuOpen), [x]), w = N(() => x(g.current.menuClose), [x]);
458
461
  return {
459
462
  playClick: T,
460
463
  playMenuOpen: E,
@@ -466,17 +469,17 @@ function je(t = {}) {
466
469
  volume: h
467
470
  };
468
471
  }
469
- function Ne({ dialogue: t, className: s = "" }) {
472
+ function Ne({ dialogue: n, className: s = "" }) {
470
473
  return /* @__PURE__ */ e.jsxs("div", { className: `dialogue-box ${s}`, children: [
471
- t.portrait && /* @__PURE__ */ e.jsx("div", { className: "dialogue-portrait", children: /* @__PURE__ */ e.jsx("img", { src: t.portrait, alt: t.speakerName }) }),
474
+ n.portrait && /* @__PURE__ */ e.jsx("div", { className: "dialogue-portrait", children: /* @__PURE__ */ e.jsx("img", { src: n.portrait, alt: n.speakerName }) }),
472
475
  /* @__PURE__ */ e.jsxs("div", { className: "dialogue-content", children: [
473
- /* @__PURE__ */ e.jsx("div", { className: "dialogue-speaker", children: t.speakerName }),
474
- /* @__PURE__ */ e.jsx("div", { className: "dialogue-text", children: t.text })
476
+ /* @__PURE__ */ e.jsx("div", { className: "dialogue-speaker", children: n.speakerName }),
477
+ /* @__PURE__ */ e.jsx("div", { className: "dialogue-text", children: n.text })
475
478
  ] })
476
479
  ] });
477
480
  }
478
- function ge({ choices: t, onSelectChoice: s, className: r = "" }) {
479
- return t.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `choice-list ${r}`, children: t.map((a) => /* @__PURE__ */ e.jsx(
481
+ function be({ choices: n, onSelectChoice: s, className: r = "" }) {
482
+ return n.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `choice-list ${r}`, children: n.map((a) => /* @__PURE__ */ e.jsx(
480
483
  "button",
481
484
  {
482
485
  className: "choice-button",
@@ -486,23 +489,23 @@ function ge({ choices: t, onSelectChoice: s, className: r = "" }) {
486
489
  a.id
487
490
  )) });
488
491
  }
489
- function be({ location: t, className: s = "" }) {
492
+ function ge({ location: n, className: s = "" }) {
490
493
  return /* @__PURE__ */ e.jsxs("div", { className: `location-view ${s}`, children: [
491
- t.banner && /* @__PURE__ */ e.jsx("div", { className: "location-banner", children: /* @__PURE__ */ e.jsx("img", { src: t.banner, alt: t.name }) }),
494
+ n.banner && /* @__PURE__ */ e.jsx("div", { className: "location-banner", children: /* @__PURE__ */ e.jsx("img", { src: n.banner, alt: n.name }) }),
492
495
  /* @__PURE__ */ e.jsxs("div", { className: "location-content", children: [
493
- /* @__PURE__ */ e.jsx("h1", { className: "location-name", children: t.name }),
494
- /* @__PURE__ */ e.jsx("p", { className: "location-description", children: t.description })
496
+ /* @__PURE__ */ e.jsx("h1", { className: "location-name", children: n.name }),
497
+ /* @__PURE__ */ e.jsx("p", { className: "location-description", children: n.description })
495
498
  ] })
496
499
  ] });
497
500
  }
498
501
  function Se({
499
- characters: t,
502
+ characters: n,
500
503
  onTalkTo: s,
501
504
  className: r = ""
502
505
  }) {
503
- return t.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: `character-list ${r}`, children: [
506
+ return n.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: `character-list ${r}`, children: [
504
507
  /* @__PURE__ */ e.jsx("h2", { children: "Characters" }),
505
- /* @__PURE__ */ e.jsx("div", { className: "character-grid", children: t.map((a) => /* @__PURE__ */ e.jsxs(
508
+ /* @__PURE__ */ e.jsx("div", { className: "character-grid", children: n.map((a) => /* @__PURE__ */ e.jsxs(
506
509
  "button",
507
510
  {
508
511
  className: "character-card",
@@ -523,11 +526,11 @@ function Se({
523
526
  )) })
524
527
  ] });
525
528
  }
526
- function ke({ items: t, className: s = "" }) {
529
+ function ke({ items: n, className: s = "" }) {
527
530
  const [r, a] = C(null);
528
531
  return /* @__PURE__ */ e.jsxs("div", { className: `inventory ${s}`, children: [
529
532
  /* @__PURE__ */ e.jsx("h2", { children: "Inventory" }),
530
- t.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "inventory-empty", children: "No items" }) : /* @__PURE__ */ e.jsx("div", { className: "inventory-grid", children: t.map((l) => /* @__PURE__ */ e.jsxs(
533
+ n.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "inventory-empty", children: "No items" }) : /* @__PURE__ */ e.jsx("div", { className: "inventory-grid", children: n.map((l) => /* @__PURE__ */ e.jsxs(
531
534
  "div",
532
535
  {
533
536
  className: "inventory-item",
@@ -547,12 +550,12 @@ function ke({ items: t, className: s = "" }) {
547
550
  ] }) })
548
551
  ] });
549
552
  }
550
- function ye({ quests: t, entries: s, className: r = "" }) {
553
+ function ye({ quests: n, entries: s, className: r = "" }) {
551
554
  return /* @__PURE__ */ e.jsxs("div", { className: `journal ${r}`, children: [
552
555
  /* @__PURE__ */ e.jsx("h2", { children: "Journal" }),
553
- t.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "journal-quests", children: [
556
+ n.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "journal-quests", children: [
554
557
  /* @__PURE__ */ e.jsx("h3", { children: "Active Quests" }),
555
- t.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "quest-entry", children: [
558
+ n.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "quest-entry", children: [
556
559
  /* @__PURE__ */ e.jsx("div", { className: "quest-name", children: a.name }),
557
560
  /* @__PURE__ */ e.jsx("div", { className: "quest-description", children: a.description }),
558
561
  /* @__PURE__ */ e.jsx("div", { className: "quest-stage", children: a.currentStageDescription })
@@ -565,15 +568,15 @@ function ye({ quests: t, entries: s, className: r = "" }) {
565
568
  /* @__PURE__ */ e.jsx("div", { className: "entry-text", children: a.text })
566
569
  ] }, a.id))
567
570
  ] }),
568
- t.length === 0 && s.length === 0 && /* @__PURE__ */ e.jsx("p", { className: "journal-empty", children: "No entries yet" })
571
+ n.length === 0 && s.length === 0 && /* @__PURE__ */ e.jsx("p", { className: "journal-empty", children: "No entries yet" })
569
572
  ] });
570
573
  }
571
- function Ee({ map: t, onTravelTo: s, className: r = "" }) {
572
- return t ? /* @__PURE__ */ e.jsxs("div", { className: `map-view ${r}`, children: [
573
- /* @__PURE__ */ e.jsx("h2", { children: t.name }),
574
+ function Ee({ map: n, onTravelTo: s, className: r = "" }) {
575
+ return n ? /* @__PURE__ */ e.jsxs("div", { className: `map-view ${r}`, children: [
576
+ /* @__PURE__ */ e.jsx("h2", { children: n.name }),
574
577
  /* @__PURE__ */ e.jsxs("div", { className: "map-container", style: { position: "relative" }, children: [
575
- t.image && /* @__PURE__ */ e.jsx("img", { src: t.image, alt: t.name, className: "map-image" }),
576
- t.locations.map((a) => /* @__PURE__ */ e.jsx(
578
+ n.image && /* @__PURE__ */ e.jsx("img", { src: n.image, alt: n.name, className: "map-image" }),
579
+ n.locations.map((a) => /* @__PURE__ */ e.jsx(
577
580
  "button",
578
581
  {
579
582
  className: `map-marker ${a.isCurrent ? "current" : ""}`,
@@ -593,27 +596,27 @@ function Ee({ map: t, onTravelTo: s, className: r = "" }) {
593
596
  ] }) : null;
594
597
  }
595
598
  function Te({
596
- notifications: t,
599
+ notifications: n,
597
600
  className: s = ""
598
601
  }) {
599
- return t.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `notification-area ${s}`, children: t.map((r, a) => /* @__PURE__ */ e.jsx("div", { className: "notification", children: r }, a)) });
602
+ return n.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `notification-area ${s}`, children: n.map((r, a) => /* @__PURE__ */ e.jsx("div", { className: "notification", children: r }, a)) });
600
603
  }
601
604
  function we({
602
- onSave: t,
605
+ onSave: n,
603
606
  onLoad: s,
604
607
  storageKey: r = "doodle-engine-save",
605
608
  className: a = ""
606
609
  }) {
607
610
  const [l, o] = C(""), m = () => {
608
- const b = t();
609
- localStorage.setItem(r, JSON.stringify(b)), o("Saved!"), setTimeout(() => o(""), 2e3);
611
+ const g = n();
612
+ localStorage.setItem(r, JSON.stringify(g)), o("Saved!"), setTimeout(() => o(""), 2e3);
610
613
  }, h = () => {
611
- const b = localStorage.getItem(r);
612
- if (!b) {
614
+ const g = localStorage.getItem(r);
615
+ if (!g) {
613
616
  o("No save found"), setTimeout(() => o(""), 2e3);
614
617
  return;
615
618
  }
616
- const x = JSON.parse(b);
619
+ const x = JSON.parse(g);
617
620
  s(x), o("Loaded!"), setTimeout(() => o(""), 2e3);
618
621
  }, f = localStorage.getItem(r) !== null;
619
622
  return /* @__PURE__ */ e.jsxs("div", { className: `save-load-panel ${a}`, children: [
@@ -622,17 +625,17 @@ function we({
622
625
  l && /* @__PURE__ */ e.jsx("span", { className: "save-load-message", children: l })
623
626
  ] });
624
627
  }
625
- function _e({ className: t = "" }) {
628
+ function _e({ className: n = "" }) {
626
629
  const { snapshot: s, actions: r } = re();
627
630
  le(s);
628
631
  const a = Object.entries(s.variables).filter(([l]) => !l.startsWith("_"));
629
- return /* @__PURE__ */ e.jsxs("div", { className: `game-renderer ${t}`, children: [
632
+ return /* @__PURE__ */ e.jsxs("div", { className: `game-renderer ${n}`, children: [
630
633
  /* @__PURE__ */ e.jsx(Te, { notifications: s.notifications }),
631
634
  /* @__PURE__ */ e.jsxs("div", { className: "game-main", children: [
632
- /* @__PURE__ */ e.jsx(be, { location: s.location }),
635
+ /* @__PURE__ */ e.jsx(ge, { location: s.location }),
633
636
  s.dialogue && /* @__PURE__ */ e.jsxs("div", { className: "dialogue-container", children: [
634
637
  /* @__PURE__ */ e.jsx(Ne, { dialogue: s.dialogue }),
635
- /* @__PURE__ */ e.jsx(ge, { choices: s.choices, onSelectChoice: r.selectChoice })
638
+ /* @__PURE__ */ e.jsx(be, { choices: s.choices, onSelectChoice: r.selectChoice })
636
639
  ] }),
637
640
  !s.dialogue && /* @__PURE__ */ e.jsx(
638
641
  Se,
@@ -662,23 +665,23 @@ function _e({ className: t = "" }) {
662
665
  ] });
663
666
  }
664
667
  function Ce({
665
- logoSrc: t,
668
+ logoSrc: n,
666
669
  title: s,
667
670
  onComplete: r,
668
671
  duration: a = 2e3,
669
672
  className: l = ""
670
673
  }) {
671
- return D(() => {
674
+ return L(() => {
672
675
  const o = setTimeout(r, a);
673
676
  return () => clearTimeout(o);
674
677
  }, [r, a]), /* @__PURE__ */ e.jsxs("div", { className: `splash-screen ${l}`, onClick: r, children: [
675
- t && /* @__PURE__ */ e.jsx("img", { src: t, alt: s || "", className: "splash-logo" }),
678
+ n && /* @__PURE__ */ e.jsx("img", { src: n, alt: s || "", className: "splash-logo" }),
676
679
  s && /* @__PURE__ */ e.jsx("h1", { className: "splash-title", children: s }),
677
680
  /* @__PURE__ */ e.jsx("div", { className: "splash-loading", children: "Loading..." })
678
681
  ] });
679
682
  }
680
683
  function Re({
681
- title: t = "Doodle Engine",
684
+ title: n = "Doodle Engine",
682
685
  subtitle: s,
683
686
  logoSrc: r,
684
687
  hasSaveData: a,
@@ -688,8 +691,8 @@ function Re({
688
691
  className: h = ""
689
692
  }) {
690
693
  return /* @__PURE__ */ e.jsxs("div", { className: `title-screen ${h}`, children: [
691
- r && /* @__PURE__ */ e.jsx("img", { src: r, alt: t, className: "title-logo" }),
692
- /* @__PURE__ */ e.jsx("h1", { className: "title-heading", children: t }),
694
+ r && /* @__PURE__ */ e.jsx("img", { src: r, alt: n, className: "title-logo" }),
695
+ /* @__PURE__ */ e.jsx("h1", { className: "title-heading", children: n }),
693
696
  s && /* @__PURE__ */ e.jsx("p", { className: "title-subtitle", children: s }),
694
697
  /* @__PURE__ */ e.jsxs("div", { className: "title-menu", children: [
695
698
  /* @__PURE__ */ e.jsx("button", { className: "title-button", onClick: l, children: "New Game" }),
@@ -699,7 +702,7 @@ function Re({
699
702
  ] });
700
703
  }
701
704
  function Ae({
702
- onResume: t,
705
+ onResume: n,
703
706
  onSave: s,
704
707
  onLoad: r,
705
708
  onSettings: a,
@@ -709,7 +712,7 @@ function Ae({
709
712
  return /* @__PURE__ */ e.jsx("div", { className: `pause-menu-overlay ${o}`, children: /* @__PURE__ */ e.jsxs("div", { className: "pause-menu", children: [
710
713
  /* @__PURE__ */ e.jsx("h2", { className: "pause-title", children: "Paused" }),
711
714
  /* @__PURE__ */ e.jsxs("div", { className: "pause-buttons", children: [
712
- /* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: t, children: "Resume" }),
715
+ /* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: n, children: "Resume" }),
713
716
  /* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: s, children: "Save" }),
714
717
  /* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: r, children: "Load" }),
715
718
  /* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: a, children: "Settings" }),
@@ -718,7 +721,7 @@ function Ae({
718
721
  ] }) });
719
722
  }
720
723
  function oe({
721
- audioControls: t,
724
+ audioControls: n,
722
725
  uiSoundControls: s,
723
726
  availableLocales: r,
724
727
  currentLocale: a,
@@ -735,7 +738,7 @@ function oe({
735
738
  {
736
739
  label: "Master",
737
740
  value: 1,
738
- onChange: t.setMasterVolume
741
+ onChange: n.setMasterVolume
739
742
  }
740
743
  ),
741
744
  /* @__PURE__ */ e.jsx(
@@ -743,7 +746,7 @@ function oe({
743
746
  {
744
747
  label: "Music",
745
748
  value: 0.7,
746
- onChange: t.setMusicVolume
749
+ onChange: n.setMusicVolume
747
750
  }
748
751
  ),
749
752
  /* @__PURE__ */ e.jsx(
@@ -751,7 +754,7 @@ function oe({
751
754
  {
752
755
  label: "Sound Effects",
753
756
  value: 0.8,
754
- onChange: t.setSoundVolume
757
+ onChange: n.setSoundVolume
755
758
  }
756
759
  ),
757
760
  /* @__PURE__ */ e.jsx(
@@ -759,7 +762,7 @@ function oe({
759
762
  {
760
763
  label: "Voice",
761
764
  value: 1,
762
- onChange: t.setVoiceVolume
765
+ onChange: n.setVoiceVolume
763
766
  }
764
767
  ),
765
768
  s && /* @__PURE__ */ e.jsx(
@@ -787,12 +790,12 @@ function oe({
787
790
  ] });
788
791
  }
789
792
  function Q({
790
- label: t,
793
+ label: n,
791
794
  value: s,
792
795
  onChange: r
793
796
  }) {
794
797
  return /* @__PURE__ */ e.jsxs("div", { className: "volume-slider", children: [
795
- /* @__PURE__ */ e.jsx("label", { className: "volume-label", children: t }),
798
+ /* @__PURE__ */ e.jsx("label", { className: "volume-label", children: n }),
796
799
  /* @__PURE__ */ e.jsx(
797
800
  "input",
798
801
  {
@@ -808,13 +811,13 @@ function Q({
808
811
  ] });
809
812
  }
810
813
  function Oe({
811
- src: t,
814
+ src: n,
812
815
  basePath: s = "/video",
813
816
  onComplete: r,
814
817
  className: a = ""
815
818
  }) {
816
819
  const l = q(null);
817
- return D(() => {
820
+ return L(() => {
818
821
  const o = (m) => {
819
822
  (m.key === "Escape" || m.key === " " || m.key === "Enter") && (m.preventDefault(), r());
820
823
  };
@@ -824,7 +827,7 @@ function Oe({
824
827
  "video",
825
828
  {
826
829
  ref: l,
827
- src: `${s}/${t}`,
830
+ src: `${s}/${n}`,
828
831
  autoPlay: !0,
829
832
  onEnded: r,
830
833
  className: "video-player-video"
@@ -841,7 +844,7 @@ function Oe({
841
844
  ] });
842
845
  }
843
846
  function Me({
844
- registry: t,
847
+ registry: n,
845
848
  config: s,
846
849
  title: r = "Doodle Engine",
847
850
  subtitle: a,
@@ -850,14 +853,14 @@ function Me({
850
853
  uiSounds: m,
851
854
  audioOptions: h,
852
855
  storageKey: f = "doodle-engine-save",
853
- availableLocales: b,
856
+ availableLocales: g,
854
857
  videoBasePath: x = "/video",
855
858
  className: R = ""
856
859
  }) {
857
- const [T, E] = C(o > 0 ? "splash" : "title"), [w, i] = C(!1), [u, _] = C(!1), [G, L] = C("title"), [W, J] = C(null), [A, F] = C(null), p = je(
860
+ const [T, E] = C(o > 0 ? "splash" : "title"), [w, i] = C(!1), [u, _] = C(!1), [G, D] = C("title"), [W, J] = C(null), [A, F] = C(null), p = je(
858
861
  m === !1 ? { enabled: !1 } : m
859
862
  ), d = localStorage.getItem(f) !== null, v = N(() => {
860
- const g = {
863
+ const b = {
861
864
  currentLocation: s.startLocation,
862
865
  currentTime: { ...s.startTime },
863
866
  flags: { ...s.startFlags },
@@ -875,41 +878,41 @@ function Me({
875
878
  pendingVideo: null,
876
879
  currentLocale: "en"
877
880
  };
878
- return new ie(t, g);
879
- }, [t, s]), y = N(() => {
881
+ return new ie(n, b);
882
+ }, [n, s]), y = N(() => {
880
883
  p.playClick();
881
- const g = v(), V = g.newGame(s);
882
- F({ engine: g, snapshot: V }), E("playing");
884
+ const b = v(), V = b.newGame(s);
885
+ F({ engine: b, snapshot: V }), E("playing");
883
886
  }, [v, s, p]), O = N(() => {
884
887
  p.playClick();
885
- const g = localStorage.getItem(f);
886
- if (!g) return;
887
- const V = JSON.parse(g), n = v(), c = n.loadGame(V);
888
- F({ engine: n, snapshot: c }), E("playing");
888
+ const b = localStorage.getItem(f);
889
+ if (!b) return;
890
+ const V = JSON.parse(b), t = v(), c = t.loadGame(V);
891
+ F({ engine: t, snapshot: c }), E("playing");
889
892
  }, [v, f, p]), M = N(() => {
890
893
  if (!A) return;
891
894
  p.playClick();
892
- const g = A.engine.saveGame();
893
- localStorage.setItem(f, JSON.stringify(g)), i(!1);
895
+ const b = A.engine.saveGame();
896
+ localStorage.setItem(f, JSON.stringify(b)), i(!1);
894
897
  }, [A, f, p]), Y = N(() => {
895
- const g = localStorage.getItem(f);
896
- if (!g || !A) return;
898
+ const b = localStorage.getItem(f);
899
+ if (!b || !A) return;
897
900
  p.playClick();
898
- const V = JSON.parse(g), n = A.engine.loadGame(V);
899
- F({ engine: A.engine, snapshot: n }), i(!1);
901
+ const V = JSON.parse(b), t = A.engine.loadGame(V);
902
+ F({ engine: A.engine, snapshot: t }), i(!1);
900
903
  }, [A, f, p]), $ = N(() => {
901
904
  p.playClick(), i(!1), _(!1), F(null), E("title");
902
- }, [p]), P = N((g) => {
903
- p.playMenuOpen(), L(g), _(!0), g === "pause" && i(!1);
905
+ }, [p]), P = N((b) => {
906
+ p.playMenuOpen(), D(b), _(!0), b === "pause" && i(!1);
904
907
  }, [p]), I = N(() => {
905
908
  p.playMenuClose(), _(!1), G === "pause" && i(!0);
906
909
  }, [G, p]);
907
- D(() => {
910
+ L(() => {
908
911
  if (T !== "playing") return;
909
- const g = (V) => {
910
- V.key === "Escape" && (V.preventDefault(), u ? I() : (w ? p.playMenuClose() : p.playMenuOpen(), i((n) => !n)));
912
+ const b = (V) => {
913
+ V.key === "Escape" && (V.preventDefault(), u ? I() : (w ? p.playMenuClose() : p.playMenuOpen(), i((t) => !t)));
911
914
  };
912
- return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
915
+ return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
913
916
  }, [T, w, u, I, p]);
914
917
  const X = {
915
918
  setMasterVolume: () => {
@@ -936,7 +939,7 @@ function Me({
936
939
  {
937
940
  audioControls: X,
938
941
  uiSoundControls: m !== !1 ? p : void 0,
939
- availableLocales: b,
942
+ availableLocales: g,
940
943
  onBack: I
941
944
  }
942
945
  ) : /* @__PURE__ */ e.jsx(
@@ -957,7 +960,7 @@ function Me({
957
960
  uiSoundControls: m !== !1 ? p : void 0,
958
961
  showPauseMenu: w,
959
962
  showSettings: u,
960
- availableLocales: b,
963
+ availableLocales: g,
961
964
  videoBasePath: x,
962
965
  pendingVideo: W,
963
966
  setPendingVideo: J,
@@ -976,7 +979,7 @@ function Me({
976
979
  ) }) }) : null;
977
980
  }
978
981
  function Pe({
979
- audioOptions: t,
982
+ audioOptions: n,
980
983
  uiSoundControls: s,
981
984
  showPauseMenu: r,
982
985
  showSettings: a,
@@ -985,15 +988,15 @@ function Pe({
985
988
  pendingVideo: m,
986
989
  setPendingVideo: h,
987
990
  onPause: f,
988
- onResume: b,
991
+ onResume: g,
989
992
  onSave: x,
990
993
  onLoad: R,
991
994
  onSettings: T,
992
995
  onQuitToTitle: E,
993
996
  onCloseSettings: w
994
997
  }) {
995
- const { snapshot: i, actions: u } = re(), _ = le(i, t);
996
- return D(() => {
998
+ const { snapshot: i, actions: u } = re(), _ = le(i, n);
999
+ return L(() => {
997
1000
  i.pendingVideo && h(i.pendingVideo);
998
1001
  }, [i.pendingVideo, h]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
999
1002
  m && /* @__PURE__ */ e.jsx(
@@ -1017,7 +1020,7 @@ function Pe({
1017
1020
  r && /* @__PURE__ */ e.jsx(
1018
1021
  Ae,
1019
1022
  {
1020
- onResume: b,
1023
+ onResume: g,
1021
1024
  onSave: x,
1022
1025
  onLoad: R,
1023
1026
  onSettings: T,
@@ -1039,7 +1042,7 @@ function Pe({
1039
1042
  }
1040
1043
  export {
1041
1044
  Se as CharacterList,
1042
- ge as ChoiceList,
1045
+ be as ChoiceList,
1043
1046
  Ne as DialogueBox,
1044
1047
  ae as GameContext,
1045
1048
  fe as GameProvider,
@@ -1047,7 +1050,7 @@ export {
1047
1050
  Me as GameShell,
1048
1051
  ke as Inventory,
1049
1052
  ye as Journal,
1050
- be as LocationView,
1053
+ ge as LocationView,
1051
1054
  Ee as MapView,
1052
1055
  Te as NotificationArea,
1053
1056
  Ae as PauseMenu,