@clockworkdog/cogs-client 3.0.0-alpha.7 → 3.0.0-alpha.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.
@@ -17,7 +17,7 @@ var Oe = function(e, t) {
17
17
  return Oe = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, o) {
18
18
  n.__proto__ = o;
19
19
  } || function(n, o) {
20
- for (var i in o) o.hasOwnProperty(i) && (n[i] = o[i]);
20
+ for (var r in o) o.hasOwnProperty(r) && (n[r] = o[r]);
21
21
  }, Oe(e, t);
22
22
  };
23
23
  function Tt(e, t) {
@@ -38,14 +38,14 @@ function nn(e) {
38
38
  function on(e, t) {
39
39
  var n = typeof Symbol == "function" && e[Symbol.iterator];
40
40
  if (!n) return e;
41
- var o = n.call(e), i, a = [], c;
41
+ var o = n.call(e), r, a = [], c;
42
42
  try {
43
- for (; (t === void 0 || t-- > 0) && !(i = o.next()).done; ) a.push(i.value);
43
+ for (; (t === void 0 || t-- > 0) && !(r = o.next()).done; ) a.push(r.value);
44
44
  } catch (l) {
45
45
  c = { error: l };
46
46
  } finally {
47
47
  try {
48
- i && !i.done && (n = o.return) && n.call(o);
48
+ r && !r.done && (n = o.return) && n.call(o);
49
49
  } finally {
50
50
  if (c) throw c.error;
51
51
  }
@@ -70,8 +70,8 @@ var St = (
70
70
  function(e) {
71
71
  Tt(t, e);
72
72
  function t(n, o) {
73
- var i = e.call(this, "error", o) || this;
74
- return i.message = n.message, i.error = n, i;
73
+ var r = e.call(this, "error", o) || this;
74
+ return r.message = n.message, r.error = n, r;
75
75
  }
76
76
  return t;
77
77
  }(St)
@@ -79,9 +79,9 @@ var St = (
79
79
  /** @class */
80
80
  function(e) {
81
81
  Tt(t, e);
82
- function t(n, o, i) {
82
+ function t(n, o, r) {
83
83
  n === void 0 && (n = 1e3), o === void 0 && (o = "");
84
- var a = e.call(this, "close", i) || this;
84
+ var a = e.call(this, "close", r) || this;
85
85
  return a.wasClean = !0, a.code = n, a.reason = o, a;
86
86
  }
87
87
  return t;
@@ -110,33 +110,33 @@ var un = function() {
110
110
  /** @class */
111
111
  function() {
112
112
  function e(t, n, o) {
113
- var i = this;
113
+ var r = this;
114
114
  o === void 0 && (o = {}), this._listeners = {
115
115
  error: [],
116
116
  message: [],
117
117
  open: [],
118
118
  close: []
119
119
  }, this._retryCount = -1, this._shouldReconnect = !0, this._connectLock = !1, this._binaryType = "blob", this._closeCalled = !1, this._messageQueue = [], this.onclose = null, this.onerror = null, this.onmessage = null, this.onopen = null, this._handleOpen = function(a) {
120
- i._debug("open event");
121
- var c = i._options.minUptime, l = c === void 0 ? F.minUptime : c;
122
- clearTimeout(i._connectTimeout), i._uptimeTimeout = setTimeout(function() {
123
- return i._acceptOpen();
124
- }, l), i._ws.binaryType = i._binaryType, i._messageQueue.forEach(function(d) {
125
- return i._ws.send(d);
126
- }), i._messageQueue = [], i.onopen && i.onopen(a), i._listeners.open.forEach(function(d) {
127
- return i._callEventListener(a, d);
120
+ r._debug("open event");
121
+ var c = r._options.minUptime, l = c === void 0 ? F.minUptime : c;
122
+ clearTimeout(r._connectTimeout), r._uptimeTimeout = setTimeout(function() {
123
+ return r._acceptOpen();
124
+ }, l), r._ws.binaryType = r._binaryType, r._messageQueue.forEach(function(d) {
125
+ return r._ws.send(d);
126
+ }), r._messageQueue = [], r.onopen && r.onopen(a), r._listeners.open.forEach(function(d) {
127
+ return r._callEventListener(a, d);
128
128
  });
129
129
  }, this._handleMessage = function(a) {
130
- i._debug("message event"), i.onmessage && i.onmessage(a), i._listeners.message.forEach(function(c) {
131
- return i._callEventListener(a, c);
130
+ r._debug("message event"), r.onmessage && r.onmessage(a), r._listeners.message.forEach(function(c) {
131
+ return r._callEventListener(a, c);
132
132
  });
133
133
  }, this._handleError = function(a) {
134
- i._debug("error event", a.message), i._disconnect(void 0, a.message === "TIMEOUT" ? "timeout" : void 0), i.onerror && i.onerror(a), i._debug("exec error listeners"), i._listeners.error.forEach(function(c) {
135
- return i._callEventListener(a, c);
136
- }), i._connect();
134
+ r._debug("error event", a.message), r._disconnect(void 0, a.message === "TIMEOUT" ? "timeout" : void 0), r.onerror && r.onerror(a), r._debug("exec error listeners"), r._listeners.error.forEach(function(c) {
135
+ return r._callEventListener(a, c);
136
+ }), r._connect();
137
137
  }, this._handleClose = function(a) {
138
- i._debug("close event"), i._clearTimeouts(), i._shouldReconnect && i._connect(), i.onclose && i.onclose(a), i._listeners.close.forEach(function(c) {
139
- return i._callEventListener(a, c);
138
+ r._debug("close event"), r._clearTimeouts(), r._shouldReconnect && r._connect(), r.onclose && r.onclose(a), r._listeners.close.forEach(function(c) {
139
+ return r._callEventListener(a, c);
140
140
  });
141
141
  }, this._url = t, this._protocols = n, this._options = o, this._options.startClosed && (this._shouldReconnect = !1), this._connect();
142
142
  }
@@ -282,10 +282,10 @@ var un = function() {
282
282
  }, e.prototype.addEventListener = function(t, n) {
283
283
  this._listeners[t] && this._listeners[t].push(n);
284
284
  }, e.prototype.dispatchEvent = function(t) {
285
- var n, o, i = this._listeners[t.type];
286
- if (i)
285
+ var n, o, r = this._listeners[t.type];
286
+ if (r)
287
287
  try {
288
- for (var a = nn(i), c = a.next(); !c.done; c = a.next()) {
288
+ for (var a = nn(r), c = a.next(); !c.done; c = a.next()) {
289
289
  var l = c.value;
290
290
  this._callEventListener(t, l);
291
291
  }
@@ -308,7 +308,7 @@ var un = function() {
308
308
  t[n] = arguments[n];
309
309
  this._options.debug && console.log.apply(console, rn(["RWS>"], t));
310
310
  }, e.prototype._getNextDelay = function() {
311
- var t = this._options, n = t.reconnectionDelayGrowFactor, o = n === void 0 ? F.reconnectionDelayGrowFactor : n, i = t.minReconnectionDelay, a = i === void 0 ? F.minReconnectionDelay : i, c = t.maxReconnectionDelay, l = c === void 0 ? F.maxReconnectionDelay : c, d = 0;
311
+ var t = this._options, n = t.reconnectionDelayGrowFactor, o = n === void 0 ? F.reconnectionDelayGrowFactor : n, r = t.minReconnectionDelay, a = r === void 0 ? F.minReconnectionDelay : r, c = t.maxReconnectionDelay, l = c === void 0 ? F.maxReconnectionDelay : c, d = 0;
312
312
  return this._retryCount > 0 && (d = a * Math.pow(o, this._retryCount - 1), d > l && (d = l)), this._debug("next delay", d), d;
313
313
  }, e.prototype._wait = function() {
314
314
  var t = this;
@@ -330,9 +330,9 @@ var un = function() {
330
330
  var t = this;
331
331
  if (!(this._connectLock || !this._shouldReconnect)) {
332
332
  this._connectLock = !0;
333
- var n = this._options, o = n.maxRetries, i = o === void 0 ? F.maxRetries : o, a = n.connectionTimeout, c = a === void 0 ? F.connectionTimeout : a, l = n.WebSocket, d = l === void 0 ? un() : l;
334
- if (this._retryCount >= i) {
335
- this._debug("max retries reached", this._retryCount, ">=", i);
333
+ var n = this._options, o = n.maxRetries, r = o === void 0 ? F.maxRetries : o, a = n.connectionTimeout, c = a === void 0 ? F.connectionTimeout : a, l = n.WebSocket, d = l === void 0 ? un() : l;
334
+ if (this._retryCount >= r) {
335
+ this._debug("max retries reached", this._retryCount, ">=", r);
336
336
  return;
337
337
  }
338
338
  if (this._retryCount++, this._debug("connect", this._retryCount), this._removeListeners(), !cn(d))
@@ -373,7 +373,7 @@ function dn(e) {
373
373
  const t = typeof window < "u" ? window.location : void 0, n = `/assets/${encodeURIComponent(e)}`;
374
374
  return `${t?.protocol}//${t?.hostname}:${zt}${n}`;
375
375
  }
376
- async function Sa(e) {
376
+ async function za(e) {
377
377
  const t = await fetch(e);
378
378
  return URL.createObjectURL(new Blob([await t.arrayBuffer()]));
379
379
  }
@@ -425,8 +425,8 @@ class He extends Event {
425
425
  const te = globalThis.Date;
426
426
  function hn(e) {
427
427
  const t = e - te.now();
428
- function n(...i) {
429
- return i.length === 0 ? new te(n.now()) : new te(...i);
428
+ function n(...r) {
429
+ return r.length === 0 ? new te(n.now()) : new te(...r);
430
430
  }
431
431
  const o = Object.getOwnPropertyDescriptors(te);
432
432
  Object.defineProperties(n, o), n.now = function() {
@@ -438,7 +438,7 @@ function _n() {
438
438
  return ++fn;
439
439
  }
440
440
  const mn = 5, vn = 1e4;
441
- function gn({ interval: e, send: t, onChange: n = hn, syncSampleSize: o = mn, syncRequestTimeout: i = vn }) {
441
+ function gn({ interval: e, send: t, onChange: n = hn, syncSampleSize: o = mn, syncRequestTimeout: r = vn }) {
442
442
  const a = {};
443
443
  async function c() {
444
444
  const y = [];
@@ -447,16 +447,16 @@ function gn({ interval: e, send: t, onChange: n = hn, syncSampleSize: o = mn, sy
447
447
  const h = _n(), v = Date.now(), _ = performance.now();
448
448
  t({ timesync: { id: h } });
449
449
  const w = (E, k) => p({ sentAt: _, receivedAt: E, serverNow: k, clientNow: v });
450
- a[h] = { complete: w }, setTimeout(() => p(null), i);
450
+ a[h] = { complete: w }, setTimeout(() => p(null), r);
451
451
  });
452
452
  y.push(u), await u;
453
453
  }
454
- const g = (await Promise.all(y)).filter((s) => s !== null), r = yn(g);
455
- isNaN(r) || n(Date.now() + r);
454
+ const g = (await Promise.all(y)).filter((s) => s !== null), i = yn(g);
455
+ isNaN(i) || n(Date.now() + i);
456
456
  }
457
457
  const l = (y) => {
458
- const g = performance.now(), r = a[y.timesync.id];
459
- r && r.complete(g, y.timesync.now);
458
+ const g = performance.now(), i = a[y.timesync.id];
459
+ i && i.complete(g, y.timesync.now);
460
460
  };
461
461
  c();
462
462
  const d = setInterval(c, e);
@@ -468,14 +468,14 @@ function gn({ interval: e, send: t, onChange: n = hn, syncSampleSize: o = mn, sy
468
468
  };
469
469
  }
470
470
  function yn(e) {
471
- return e.map(({ sentAt: t, receivedAt: n, clientNow: o, serverNow: i }) => {
471
+ return e.map(({ sentAt: t, receivedAt: n, clientNow: o, serverNow: r }) => {
472
472
  const a = (n - t) / 2;
473
- return i - o - a;
473
+ return r - o - a;
474
474
  }).reduce((t, n) => t + n, 0) / e.length;
475
475
  }
476
- class za {
477
- constructor(t, { hostname: n = document.location.hostname, port: o = zt } = {}, i, a) {
478
- this.manifest = t, this.currentState = { ...i }, this.store = new pn(a ?? {});
476
+ class Ia {
477
+ constructor(t, { hostname: n = document.location.hostname, port: o = zt } = {}, r, a) {
478
+ this.manifest = t, this.currentState = { ...r }, this.store = new pn(a ?? {});
479
479
  const { useReconnectingWebsocket: c, path: l, pathParams: d } = bn(document.location.href);
480
480
  this.urlParams = new URLSearchParams(d), this.urlParams.set("screenWidth", window.screen.width.toString()), this.urlParams.set("screenHeight", window.screen.height.toString()), this.urlParams.set("screenPixelRatio", window.devicePixelRatio.toString());
481
481
  const f = `ws://${n}:${o}${l}?${this.urlParams}`;
@@ -490,30 +490,30 @@ class za {
490
490
  });
491
491
  }, this.websocket.addEventListener("message", ({ data: g }) => {
492
492
  try {
493
- const r = JSON.parse(g);
494
- if (typeof r == "object" && r !== null && "timesync" in r) {
495
- const s = r;
493
+ const i = JSON.parse(g);
494
+ if (typeof i == "object" && i !== null && "timesync" in i) {
495
+ const s = i;
496
496
  y?.receive(s);
497
497
  }
498
- } catch (r) {
499
- console.error(r);
498
+ } catch (i) {
499
+ console.error(i);
500
500
  }
501
501
  }), this.websocket.onclose = () => {
502
502
  y?.destroy(), this.dispatchEvent(new En());
503
503
  }, this.websocket.addEventListener("message", ({ data: g }) => {
504
504
  try {
505
- const r = JSON.parse(g);
505
+ const i = JSON.parse(g);
506
506
  try {
507
- if (r.config)
508
- this.currentConfig = r.config, this.dispatchEvent(new Cn(this.currentConfig));
509
- else if (r.updates)
510
- this.currentState = { ...this.currentState, ...r.updates }, this.dispatchEvent(new An(r.updates));
511
- else if (r.event && r.event.key)
507
+ if (i.config)
508
+ this.currentConfig = i.config, this.dispatchEvent(new Cn(this.currentConfig));
509
+ else if (i.updates)
510
+ this.currentState = { ...this.currentState, ...i.updates }, this.dispatchEvent(new An(i.updates));
511
+ else if (i.event && i.event.key)
512
512
  this.dispatchEvent(
513
- new Tn(r.event.key, r.event.value)
513
+ new Tn(i.event.key, i.event.value)
514
514
  );
515
- else if (typeof r.message == "object") {
516
- const s = r.message;
515
+ else if (typeof i.message == "object") {
516
+ const s = i.message;
517
517
  switch (s.type) {
518
518
  case "adjustable_timer_update":
519
519
  this._timerState = {
@@ -540,8 +540,8 @@ class za {
540
540
  } catch (s) {
541
541
  console.warn("Error handling data", g, s);
542
542
  }
543
- } catch (r) {
544
- console.error("Unable to parse incoming data from server", g, r);
543
+ } catch (i) {
544
+ console.error("Unable to parse incoming data from server", g, i);
545
545
  }
546
546
  }), this.store.addEventListener("items", (g) => {
547
547
  this.sendDataStoreItems(g.items);
@@ -549,8 +549,8 @@ class za {
549
549
  {
550
550
  const g = async () => {
551
551
  if (navigator.mediaDevices) {
552
- const r = (await navigator.mediaDevices.enumerateDevices()).filter(({ kind: s }) => s === "audiooutput");
553
- this.sendAudioOutputs(r), this.audioOutputs = r;
552
+ const i = (await navigator.mediaDevices.enumerateDevices()).filter(({ kind: s }) => s === "audiooutput");
553
+ this.sendAudioOutputs(i), this.audioOutputs = i;
554
554
  }
555
555
  };
556
556
  this.eventTarget.addEventListener("open", g), navigator.mediaDevices?.addEventListener("devicechange", g), g();
@@ -656,7 +656,7 @@ class za {
656
656
  }
657
657
  }
658
658
  function bn(e) {
659
- const t = new URL(e), n = new URLSearchParams(t.searchParams), o = n.get("local_id"), i = n.get("simulator") === "true", a = n.get("display") ?? "", c = t.pathname.startsWith("/plugin/") ? decodeURIComponent(t.pathname.split("/")[2]) : void 0;
659
+ const t = new URL(e), n = new URLSearchParams(t.searchParams), o = n.get("local_id"), r = n.get("simulator") === "true", a = n.get("display") ?? "", c = t.pathname.startsWith("/plugin/") ? decodeURIComponent(t.pathname.split("/")[2]) : void 0;
660
660
  if (o) {
661
661
  const l = n.get("t") ?? "";
662
662
  return n.delete("local_id"), {
@@ -664,7 +664,7 @@ function bn(e) {
664
664
  pathParams: new URLSearchParams({ t: l }),
665
665
  useReconnectingWebsocket: !0
666
666
  };
667
- } else if (i) {
667
+ } else if (r) {
668
668
  const l = n.get("name") ?? "";
669
669
  return n.delete("simulator"), n.delete("name"), {
670
670
  path: `/simulator/${encodeURIComponent(l)}`,
@@ -754,12 +754,12 @@ function m(e, t, n) {
754
754
  l._zod.traits.add(e), t(l, d);
755
755
  const f = c.prototype, y = Object.keys(f);
756
756
  for (let g = 0; g < y.length; g++) {
757
- const r = y[g];
758
- r in l || (l[r] = f[r].bind(l));
757
+ const i = y[g];
758
+ i in l || (l[i] = f[i].bind(l));
759
759
  }
760
760
  }
761
- const i = n?.Parent ?? Object;
762
- class a extends i {
761
+ const r = n?.Parent ?? Object;
762
+ class a extends r {
763
763
  }
764
764
  Object.defineProperty(a, "name", { value: e });
765
765
  function c(l) {
@@ -790,9 +790,9 @@ function j(e) {
790
790
  }
791
791
  function In(e) {
792
792
  const t = Object.values(e).filter((o) => typeof o == "number");
793
- return Object.entries(e).filter(([o, i]) => t.indexOf(+o) === -1).map(([o, i]) => i);
793
+ return Object.entries(e).filter(([o, r]) => t.indexOf(+o) === -1).map(([o, r]) => r);
794
794
  }
795
- function Ze(e, t) {
795
+ function Pe(e, t) {
796
796
  return typeof t == "bigint" ? t.toString() : t;
797
797
  }
798
798
  function Re(e) {
@@ -814,12 +814,12 @@ function Ne(e) {
814
814
  }
815
815
  function $n(e, t) {
816
816
  const n = (e.toString().split(".")[1] || "").length, o = t.toString();
817
- let i = (o.split(".")[1] || "").length;
818
- if (i === 0 && /\d?e-\d?/.test(o)) {
817
+ let r = (o.split(".")[1] || "").length;
818
+ if (r === 0 && /\d?e-\d?/.test(o)) {
819
819
  const d = o.match(/\d?e-(\d?)/);
820
- d?.[1] && (i = Number.parseInt(d[1]));
820
+ d?.[1] && (r = Number.parseInt(d[1]));
821
821
  }
822
- const a = n > i ? n : i, c = Number.parseInt(e.toFixed(a).replace(".", "")), l = Number.parseInt(t.toFixed(a).replace(".", ""));
822
+ const a = n > r ? n : r, c = Number.parseInt(e.toFixed(a).replace(".", "")), l = Number.parseInt(t.toFixed(a).replace(".", ""));
823
823
  return c % l / 10 ** a;
824
824
  }
825
825
  const Je = Symbol("evaluating");
@@ -830,9 +830,9 @@ function C(e, t, n) {
830
830
  if (o !== Je)
831
831
  return o === void 0 && (o = Je, o = n()), o;
832
832
  },
833
- set(i) {
833
+ set(r) {
834
834
  Object.defineProperty(e, t, {
835
- value: i
835
+ value: r
836
836
  // configurable: true,
837
837
  });
838
838
  },
@@ -866,7 +866,7 @@ const Ot = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
866
866
  function he(e) {
867
867
  return typeof e == "object" && e !== null && !Array.isArray(e);
868
868
  }
869
- const Zn = Re(() => {
869
+ const Pn = Re(() => {
870
870
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
871
871
  return !1;
872
872
  try {
@@ -885,10 +885,10 @@ function H(e) {
885
885
  const n = t.prototype;
886
886
  return !(he(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
887
887
  }
888
- function Zt(e) {
888
+ function Pt(e) {
889
889
  return H(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
890
890
  }
891
- const Pn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
891
+ const Zn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
892
892
  function J(e) {
893
893
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
894
894
  }
@@ -922,13 +922,13 @@ const Ln = {
922
922
  function Rn(e, t) {
923
923
  const n = e._zod.def, o = B(e._zod.def, {
924
924
  get shape() {
925
- const i = {};
925
+ const r = {};
926
926
  for (const a in t) {
927
927
  if (!(a in n.shape))
928
928
  throw new Error(`Unrecognized key: "${a}"`);
929
- t[a] && (i[a] = n.shape[a]);
929
+ t[a] && (r[a] = n.shape[a]);
930
930
  }
931
- return V(this, "shape", i), i;
931
+ return V(this, "shape", r), r;
932
932
  },
933
933
  checks: []
934
934
  });
@@ -937,13 +937,13 @@ function Rn(e, t) {
937
937
  function jn(e, t) {
938
938
  const n = e._zod.def, o = B(e._zod.def, {
939
939
  get shape() {
940
- const i = { ...e._zod.def.shape };
940
+ const r = { ...e._zod.def.shape };
941
941
  for (const a in t) {
942
942
  if (!(a in n.shape))
943
943
  throw new Error(`Unrecognized key: "${a}"`);
944
- t[a] && delete i[a];
944
+ t[a] && delete r[a];
945
945
  }
946
- return V(this, "shape", i), i;
946
+ return V(this, "shape", r), r;
947
947
  },
948
948
  checks: []
949
949
  });
@@ -955,14 +955,14 @@ function Nn(e, t) {
955
955
  const n = e._zod.def.checks;
956
956
  if (n && n.length > 0)
957
957
  throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
958
- const i = B(e._zod.def, {
958
+ const r = B(e._zod.def, {
959
959
  get shape() {
960
960
  const a = { ...e._zod.def.shape, ...t };
961
961
  return V(this, "shape", a), a;
962
962
  },
963
963
  checks: []
964
964
  });
965
- return D(e, i);
965
+ return D(e, r);
966
966
  }
967
967
  function Dn(e, t) {
968
968
  if (!H(t))
@@ -994,22 +994,22 @@ function Un(e, t) {
994
994
  function Fn(e, t, n) {
995
995
  const o = B(t._zod.def, {
996
996
  get shape() {
997
- const i = t._zod.def.shape, a = { ...i };
997
+ const r = t._zod.def.shape, a = { ...r };
998
998
  if (n)
999
999
  for (const c in n) {
1000
- if (!(c in i))
1000
+ if (!(c in r))
1001
1001
  throw new Error(`Unrecognized key: "${c}"`);
1002
1002
  n[c] && (a[c] = e ? new e({
1003
1003
  type: "optional",
1004
- innerType: i[c]
1005
- }) : i[c]);
1004
+ innerType: r[c]
1005
+ }) : r[c]);
1006
1006
  }
1007
1007
  else
1008
- for (const c in i)
1008
+ for (const c in r)
1009
1009
  a[c] = e ? new e({
1010
1010
  type: "optional",
1011
- innerType: i[c]
1012
- }) : i[c];
1011
+ innerType: r[c]
1012
+ }) : r[c];
1013
1013
  return V(this, "shape", a), a;
1014
1014
  },
1015
1015
  checks: []
@@ -1019,21 +1019,21 @@ function Fn(e, t, n) {
1019
1019
  function Mn(e, t, n) {
1020
1020
  const o = B(t._zod.def, {
1021
1021
  get shape() {
1022
- const i = t._zod.def.shape, a = { ...i };
1022
+ const r = t._zod.def.shape, a = { ...r };
1023
1023
  if (n)
1024
1024
  for (const c in n) {
1025
1025
  if (!(c in a))
1026
1026
  throw new Error(`Unrecognized key: "${c}"`);
1027
1027
  n[c] && (a[c] = new e({
1028
1028
  type: "nonoptional",
1029
- innerType: i[c]
1029
+ innerType: r[c]
1030
1030
  }));
1031
1031
  }
1032
1032
  else
1033
- for (const c in i)
1033
+ for (const c in r)
1034
1034
  a[c] = new e({
1035
1035
  type: "nonoptional",
1036
- innerType: i[c]
1036
+ innerType: r[c]
1037
1037
  });
1038
1038
  return V(this, "shape", a), a;
1039
1039
  },
@@ -1061,15 +1061,15 @@ function ae(e) {
1061
1061
  function N(e, t, n) {
1062
1062
  const o = { ...e, path: e.path ?? [] };
1063
1063
  if (!e.message) {
1064
- const i = ae(e.inst?._zod.def?.error?.(e)) ?? ae(t?.error?.(e)) ?? ae(n.customError?.(e)) ?? ae(n.localeError?.(e)) ?? "Invalid input";
1065
- o.message = i;
1064
+ const r = ae(e.inst?._zod.def?.error?.(e)) ?? ae(t?.error?.(e)) ?? ae(n.customError?.(e)) ?? ae(n.localeError?.(e)) ?? "Invalid input";
1065
+ o.message = r;
1066
1066
  }
1067
1067
  return delete o.inst, delete o.continue, t?.reportInput || delete o.input, o;
1068
1068
  }
1069
1069
  function De(e) {
1070
1070
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
1071
1071
  }
1072
- function ie(...e) {
1072
+ function re(...e) {
1073
1073
  const [t, n, o] = e;
1074
1074
  return typeof t == "string" ? {
1075
1075
  message: t,
@@ -1078,27 +1078,27 @@ function ie(...e) {
1078
1078
  inst: o
1079
1079
  } : { ...t };
1080
1080
  }
1081
- const Pt = (e, t) => {
1081
+ const Zt = (e, t) => {
1082
1082
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
1083
1083
  value: e._zod,
1084
1084
  enumerable: !1
1085
1085
  }), Object.defineProperty(e, "issues", {
1086
1086
  value: t,
1087
1087
  enumerable: !1
1088
- }), e.message = JSON.stringify(t, Ze, 2), Object.defineProperty(e, "toString", {
1088
+ }), e.message = JSON.stringify(t, Pe, 2), Object.defineProperty(e, "toString", {
1089
1089
  value: () => e.message,
1090
1090
  enumerable: !1
1091
1091
  });
1092
- }, xt = /* @__PURE__ */ m("$ZodError", Pt), Lt = /* @__PURE__ */ m("$ZodError", Pt, { Parent: Error });
1092
+ }, xt = /* @__PURE__ */ m("$ZodError", Zt), Lt = /* @__PURE__ */ m("$ZodError", Zt, { Parent: Error });
1093
1093
  function Vn(e, t = (n) => n.message) {
1094
1094
  const n = {}, o = [];
1095
- for (const i of e.issues)
1096
- i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : o.push(t(i));
1095
+ for (const r of e.issues)
1096
+ r.path.length > 0 ? (n[r.path[0]] = n[r.path[0]] || [], n[r.path[0]].push(t(r))) : o.push(t(r));
1097
1097
  return { formErrors: o, fieldErrors: n };
1098
1098
  }
1099
1099
  function Bn(e, t = (n) => n.message) {
1100
- const n = { _errors: [] }, o = (i) => {
1101
- for (const a of i.issues)
1100
+ const n = { _errors: [] }, o = (r) => {
1101
+ for (const a of r.issues)
1102
1102
  if (a.code === "invalid_union" && a.errors.length)
1103
1103
  a.errors.map((c) => o({ issues: c }));
1104
1104
  else if (a.code === "invalid_key")
@@ -1117,51 +1117,51 @@ function Bn(e, t = (n) => n.message) {
1117
1117
  };
1118
1118
  return o(e), n;
1119
1119
  }
1120
- const Ue = (e) => (t, n, o, i) => {
1120
+ const Ue = (e) => (t, n, o, r) => {
1121
1121
  const a = o ? Object.assign(o, { async: !1 }) : { async: !1 }, c = t._zod.run({ value: n, issues: [] }, a);
1122
1122
  if (c instanceof Promise)
1123
1123
  throw new K();
1124
1124
  if (c.issues.length) {
1125
- const l = new (i?.Err ?? e)(c.issues.map((d) => N(d, a, j())));
1126
- throw Ot(l, i?.callee), l;
1125
+ const l = new (r?.Err ?? e)(c.issues.map((d) => N(d, a, j())));
1126
+ throw Ot(l, r?.callee), l;
1127
1127
  }
1128
1128
  return c.value;
1129
- }, Fe = (e) => async (t, n, o, i) => {
1129
+ }, Fe = (e) => async (t, n, o, r) => {
1130
1130
  const a = o ? Object.assign(o, { async: !0 }) : { async: !0 };
1131
1131
  let c = t._zod.run({ value: n, issues: [] }, a);
1132
1132
  if (c instanceof Promise && (c = await c), c.issues.length) {
1133
- const l = new (i?.Err ?? e)(c.issues.map((d) => N(d, a, j())));
1134
- throw Ot(l, i?.callee), l;
1133
+ const l = new (r?.Err ?? e)(c.issues.map((d) => N(d, a, j())));
1134
+ throw Ot(l, r?.callee), l;
1135
1135
  }
1136
1136
  return c.value;
1137
1137
  }, ve = (e) => (t, n, o) => {
1138
- const i = o ? { ...o, async: !1 } : { async: !1 }, a = t._zod.run({ value: n, issues: [] }, i);
1138
+ const r = o ? { ...o, async: !1 } : { async: !1 }, a = t._zod.run({ value: n, issues: [] }, r);
1139
1139
  if (a instanceof Promise)
1140
1140
  throw new K();
1141
1141
  return a.issues.length ? {
1142
1142
  success: !1,
1143
- error: new (e ?? xt)(a.issues.map((c) => N(c, i, j())))
1143
+ error: new (e ?? xt)(a.issues.map((c) => N(c, r, j())))
1144
1144
  } : { success: !0, data: a.value };
1145
1145
  }, Gn = /* @__PURE__ */ ve(Lt), ge = (e) => async (t, n, o) => {
1146
- const i = o ? Object.assign(o, { async: !0 }) : { async: !0 };
1147
- let a = t._zod.run({ value: n, issues: [] }, i);
1146
+ const r = o ? Object.assign(o, { async: !0 }) : { async: !0 };
1147
+ let a = t._zod.run({ value: n, issues: [] }, r);
1148
1148
  return a instanceof Promise && (a = await a), a.issues.length ? {
1149
1149
  success: !1,
1150
- error: new e(a.issues.map((c) => N(c, i, j())))
1150
+ error: new e(a.issues.map((c) => N(c, r, j())))
1151
1151
  } : { success: !0, data: a.value };
1152
1152
  }, Wn = /* @__PURE__ */ ge(Lt), qn = (e) => (t, n, o) => {
1153
- const i = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1154
- return Ue(e)(t, n, i);
1153
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1154
+ return Ue(e)(t, n, r);
1155
1155
  }, Kn = (e) => (t, n, o) => Ue(e)(t, n, o), Hn = (e) => async (t, n, o) => {
1156
- const i = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1157
- return Fe(e)(t, n, i);
1156
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1157
+ return Fe(e)(t, n, r);
1158
1158
  }, Jn = (e) => async (t, n, o) => Fe(e)(t, n, o), Yn = (e) => (t, n, o) => {
1159
- const i = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1160
- return ve(e)(t, n, i);
1159
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1160
+ return ve(e)(t, n, r);
1161
1161
  }, Qn = (e) => (t, n, o) => ve(e)(t, n, o), Xn = (e) => async (t, n, o) => {
1162
- const i = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1163
- return ge(e)(t, n, i);
1164
- }, eo = (e) => async (t, n, o) => ge(e)(t, n, o), to = /^[cC][^\s-]{8,}$/, no = /^[0-9a-z]+$/, oo = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, ro = /^[0-9a-vA-V]{20}$/, io = /^[A-Za-z0-9]{27}$/, so = /^[a-zA-Z0-9_-]{21}$/, ao = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, uo = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Qe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, co = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, lo = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1162
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
1163
+ return ge(e)(t, n, r);
1164
+ }, eo = (e) => async (t, n, o) => ge(e)(t, n, o), to = /^[cC][^\s-]{8,}$/, no = /^[0-9a-z]+$/, oo = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, io = /^[0-9a-vA-V]{20}$/, ro = /^[A-Za-z0-9]{27}$/, so = /^[a-zA-Z0-9_-]{21}$/, ao = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, uo = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Qe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, co = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, lo = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1165
1165
  function po() {
1166
1166
  return new RegExp(lo, "u");
1167
1167
  }
@@ -1193,8 +1193,8 @@ const Eo = (e) => {
1193
1193
  O.init(e, t);
1194
1194
  const n = Dt[typeof t.value];
1195
1195
  e._zod.onattach.push((o) => {
1196
- const i = o._zod.bag, a = (t.inclusive ? i.maximum : i.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
1197
- t.value < a && (t.inclusive ? i.maximum = t.value : i.exclusiveMaximum = t.value);
1196
+ const r = o._zod.bag, a = (t.inclusive ? r.maximum : r.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
1197
+ t.value < a && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value);
1198
1198
  }), e._zod.check = (o) => {
1199
1199
  (t.inclusive ? o.value <= t.value : o.value < t.value) || o.issues.push({
1200
1200
  origin: n,
@@ -1210,8 +1210,8 @@ const Eo = (e) => {
1210
1210
  O.init(e, t);
1211
1211
  const n = Dt[typeof t.value];
1212
1212
  e._zod.onattach.push((o) => {
1213
- const i = o._zod.bag, a = (t.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
1214
- t.value > a && (t.inclusive ? i.minimum = t.value : i.exclusiveMinimum = t.value);
1213
+ const r = o._zod.bag, a = (t.inclusive ? r.minimum : r.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
1214
+ t.value > a && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value);
1215
1215
  }), e._zod.check = (o) => {
1216
1216
  (t.inclusive ? o.value >= t.value : o.value > t.value) || o.issues.push({
1217
1217
  origin: n,
@@ -1241,10 +1241,10 @@ const Eo = (e) => {
1241
1241
  };
1242
1242
  }), Io = /* @__PURE__ */ m("$ZodCheckNumberFormat", (e, t) => {
1243
1243
  O.init(e, t), t.format = t.format || "float64";
1244
- const n = t.format?.includes("int"), o = n ? "int" : "number", [i, a] = Ln[t.format];
1244
+ const n = t.format?.includes("int"), o = n ? "int" : "number", [r, a] = Ln[t.format];
1245
1245
  e._zod.onattach.push((c) => {
1246
1246
  const l = c._zod.bag;
1247
- l.format = t.format, l.minimum = i, l.maximum = a, n && (l.pattern = ko);
1247
+ l.format = t.format, l.minimum = r, l.maximum = a, n && (l.pattern = ko);
1248
1248
  }), e._zod.check = (c) => {
1249
1249
  const l = c.value;
1250
1250
  if (n) {
@@ -1280,11 +1280,11 @@ const Eo = (e) => {
1280
1280
  return;
1281
1281
  }
1282
1282
  }
1283
- l < i && c.issues.push({
1283
+ l < r && c.issues.push({
1284
1284
  origin: "number",
1285
1285
  input: l,
1286
1286
  code: "too_small",
1287
- minimum: i,
1287
+ minimum: r,
1288
1288
  inclusive: !0,
1289
1289
  inst: e,
1290
1290
  continue: !t.abort
@@ -1299,22 +1299,22 @@ const Eo = (e) => {
1299
1299
  }), $o = /* @__PURE__ */ m("$ZodCheckMaxLength", (e, t) => {
1300
1300
  var n;
1301
1301
  O.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
1302
- const i = o.value;
1303
- return !je(i) && i.length !== void 0;
1302
+ const r = o.value;
1303
+ return !je(r) && r.length !== void 0;
1304
1304
  }), e._zod.onattach.push((o) => {
1305
- const i = o._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1306
- t.maximum < i && (o._zod.bag.maximum = t.maximum);
1305
+ const r = o._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1306
+ t.maximum < r && (o._zod.bag.maximum = t.maximum);
1307
1307
  }), e._zod.check = (o) => {
1308
- const i = o.value;
1309
- if (i.length <= t.maximum)
1308
+ const r = o.value;
1309
+ if (r.length <= t.maximum)
1310
1310
  return;
1311
- const c = De(i);
1311
+ const c = De(r);
1312
1312
  o.issues.push({
1313
1313
  origin: c,
1314
1314
  code: "too_big",
1315
1315
  maximum: t.maximum,
1316
1316
  inclusive: !0,
1317
- input: i,
1317
+ input: r,
1318
1318
  inst: e,
1319
1319
  continue: !t.abort
1320
1320
  });
@@ -1322,39 +1322,39 @@ const Eo = (e) => {
1322
1322
  }), Oo = /* @__PURE__ */ m("$ZodCheckMinLength", (e, t) => {
1323
1323
  var n;
1324
1324
  O.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
1325
- const i = o.value;
1326
- return !je(i) && i.length !== void 0;
1325
+ const r = o.value;
1326
+ return !je(r) && r.length !== void 0;
1327
1327
  }), e._zod.onattach.push((o) => {
1328
- const i = o._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1329
- t.minimum > i && (o._zod.bag.minimum = t.minimum);
1328
+ const r = o._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1329
+ t.minimum > r && (o._zod.bag.minimum = t.minimum);
1330
1330
  }), e._zod.check = (o) => {
1331
- const i = o.value;
1332
- if (i.length >= t.minimum)
1331
+ const r = o.value;
1332
+ if (r.length >= t.minimum)
1333
1333
  return;
1334
- const c = De(i);
1334
+ const c = De(r);
1335
1335
  o.issues.push({
1336
1336
  origin: c,
1337
1337
  code: "too_small",
1338
1338
  minimum: t.minimum,
1339
1339
  inclusive: !0,
1340
- input: i,
1340
+ input: r,
1341
1341
  inst: e,
1342
1342
  continue: !t.abort
1343
1343
  });
1344
1344
  };
1345
- }), Zo = /* @__PURE__ */ m("$ZodCheckLengthEquals", (e, t) => {
1345
+ }), Po = /* @__PURE__ */ m("$ZodCheckLengthEquals", (e, t) => {
1346
1346
  var n;
1347
1347
  O.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
1348
- const i = o.value;
1349
- return !je(i) && i.length !== void 0;
1348
+ const r = o.value;
1349
+ return !je(r) && r.length !== void 0;
1350
1350
  }), e._zod.onattach.push((o) => {
1351
- const i = o._zod.bag;
1352
- i.minimum = t.length, i.maximum = t.length, i.length = t.length;
1351
+ const r = o._zod.bag;
1352
+ r.minimum = t.length, r.maximum = t.length, r.length = t.length;
1353
1353
  }), e._zod.check = (o) => {
1354
- const i = o.value, a = i.length;
1354
+ const r = o.value, a = r.length;
1355
1355
  if (a === t.length)
1356
1356
  return;
1357
- const c = De(i), l = a > t.length;
1357
+ const c = De(r), l = a > t.length;
1358
1358
  o.issues.push({
1359
1359
  origin: c,
1360
1360
  ...l ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
@@ -1367,22 +1367,22 @@ const Eo = (e) => {
1367
1367
  };
1368
1368
  }), ye = /* @__PURE__ */ m("$ZodCheckStringFormat", (e, t) => {
1369
1369
  var n, o;
1370
- O.init(e, t), e._zod.onattach.push((i) => {
1371
- const a = i._zod.bag;
1370
+ O.init(e, t), e._zod.onattach.push((r) => {
1371
+ const a = r._zod.bag;
1372
1372
  a.format = t.format, t.pattern && (a.patterns ?? (a.patterns = /* @__PURE__ */ new Set()), a.patterns.add(t.pattern));
1373
- }), t.pattern ? (n = e._zod).check ?? (n.check = (i) => {
1374
- t.pattern.lastIndex = 0, !t.pattern.test(i.value) && i.issues.push({
1373
+ }), t.pattern ? (n = e._zod).check ?? (n.check = (r) => {
1374
+ t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
1375
1375
  origin: "string",
1376
1376
  code: "invalid_format",
1377
1377
  format: t.format,
1378
- input: i.value,
1378
+ input: r.value,
1379
1379
  ...t.pattern ? { pattern: t.pattern.toString() } : {},
1380
1380
  inst: e,
1381
1381
  continue: !t.abort
1382
1382
  });
1383
1383
  }) : (o = e._zod).check ?? (o.check = () => {
1384
1384
  });
1385
- }), Po = /* @__PURE__ */ m("$ZodCheckRegex", (e, t) => {
1385
+ }), Zo = /* @__PURE__ */ m("$ZodCheckRegex", (e, t) => {
1386
1386
  ye.init(e, t), e._zod.check = (n) => {
1387
1387
  t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
1388
1388
  origin: "string",
@@ -1401,16 +1401,16 @@ const Eo = (e) => {
1401
1401
  }), Ro = /* @__PURE__ */ m("$ZodCheckIncludes", (e, t) => {
1402
1402
  O.init(e, t);
1403
1403
  const n = J(t.includes), o = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
1404
- t.pattern = o, e._zod.onattach.push((i) => {
1405
- const a = i._zod.bag;
1404
+ t.pattern = o, e._zod.onattach.push((r) => {
1405
+ const a = r._zod.bag;
1406
1406
  a.patterns ?? (a.patterns = /* @__PURE__ */ new Set()), a.patterns.add(o);
1407
- }), e._zod.check = (i) => {
1408
- i.value.includes(t.includes, t.position) || i.issues.push({
1407
+ }), e._zod.check = (r) => {
1408
+ r.value.includes(t.includes, t.position) || r.issues.push({
1409
1409
  origin: "string",
1410
1410
  code: "invalid_format",
1411
1411
  format: "includes",
1412
1412
  includes: t.includes,
1413
- input: i.value,
1413
+ input: r.value,
1414
1414
  inst: e,
1415
1415
  continue: !t.abort
1416
1416
  });
@@ -1419,8 +1419,8 @@ const Eo = (e) => {
1419
1419
  O.init(e, t);
1420
1420
  const n = new RegExp(`^${J(t.prefix)}.*`);
1421
1421
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
1422
- const i = o._zod.bag;
1423
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
1422
+ const r = o._zod.bag;
1423
+ r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
1424
1424
  }), e._zod.check = (o) => {
1425
1425
  o.value.startsWith(t.prefix) || o.issues.push({
1426
1426
  origin: "string",
@@ -1436,8 +1436,8 @@ const Eo = (e) => {
1436
1436
  O.init(e, t);
1437
1437
  const n = new RegExp(`.*${J(t.suffix)}$`);
1438
1438
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
1439
- const i = o._zod.bag;
1440
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
1439
+ const r = o._zod.bag;
1440
+ r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
1441
1441
  }), e._zod.check = (o) => {
1442
1442
  o.value.endsWith(t.suffix) || o.issues.push({
1443
1443
  origin: "string",
@@ -1467,13 +1467,13 @@ class Uo {
1467
1467
  return;
1468
1468
  }
1469
1469
  const o = t.split(`
1470
- `).filter((c) => c), i = Math.min(...o.map((c) => c.length - c.trimStart().length)), a = o.map((c) => c.slice(i)).map((c) => " ".repeat(this.indent * 2) + c);
1470
+ `).filter((c) => c), r = Math.min(...o.map((c) => c.length - c.trimStart().length)), a = o.map((c) => c.slice(r)).map((c) => " ".repeat(this.indent * 2) + c);
1471
1471
  for (const c of a)
1472
1472
  this.content.push(c);
1473
1473
  }
1474
1474
  compile() {
1475
- const t = Function, n = this?.args, i = [...(this?.content ?? [""]).map((a) => ` ${a}`)];
1476
- return new t(...n, i.join(`
1475
+ const t = Function, n = this?.args, r = [...(this?.content ?? [""]).map((a) => ` ${a}`)];
1476
+ return new t(...n, r.join(`
1477
1477
  `));
1478
1478
  }
1479
1479
  }
@@ -1486,15 +1486,15 @@ const Fo = {
1486
1486
  e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Fo;
1487
1487
  const o = [...e._zod.def.checks ?? []];
1488
1488
  e._zod.traits.has("$ZodCheck") && o.unshift(e);
1489
- for (const i of o)
1490
- for (const a of i._zod.onattach)
1489
+ for (const r of o)
1490
+ for (const a of r._zod.onattach)
1491
1491
  a(e);
1492
1492
  if (o.length === 0)
1493
1493
  (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
1494
1494
  e._zod.run = e._zod.parse;
1495
1495
  });
1496
1496
  else {
1497
- const i = (c, l, d) => {
1497
+ const r = (c, l, d) => {
1498
1498
  let f = q(c), y;
1499
1499
  for (const g of l) {
1500
1500
  if (g._zod.def.when) {
@@ -1502,24 +1502,24 @@ const Fo = {
1502
1502
  continue;
1503
1503
  } else if (f)
1504
1504
  continue;
1505
- const r = c.issues.length, s = g._zod.check(c);
1505
+ const i = c.issues.length, s = g._zod.check(c);
1506
1506
  if (s instanceof Promise && d?.async === !1)
1507
1507
  throw new K();
1508
1508
  if (y || s instanceof Promise)
1509
1509
  y = (y ?? Promise.resolve()).then(async () => {
1510
- await s, c.issues.length !== r && (f || (f = q(c, r)));
1510
+ await s, c.issues.length !== i && (f || (f = q(c, i)));
1511
1511
  });
1512
1512
  else {
1513
- if (c.issues.length === r)
1513
+ if (c.issues.length === i)
1514
1514
  continue;
1515
- f || (f = q(c, r));
1515
+ f || (f = q(c, i));
1516
1516
  }
1517
1517
  }
1518
1518
  return y ? y.then(() => c) : c;
1519
1519
  }, a = (c, l, d) => {
1520
1520
  if (q(c))
1521
1521
  return c.aborted = !0, c;
1522
- const f = i(l, o, d);
1522
+ const f = r(l, o, d);
1523
1523
  if (f instanceof Promise) {
1524
1524
  if (d.async === !1)
1525
1525
  throw new K();
@@ -1538,18 +1538,18 @@ const Fo = {
1538
1538
  if (d instanceof Promise) {
1539
1539
  if (l.async === !1)
1540
1540
  throw new K();
1541
- return d.then((f) => i(f, o, l));
1541
+ return d.then((f) => r(f, o, l));
1542
1542
  }
1543
- return i(d, o, l);
1543
+ return r(d, o, l);
1544
1544
  };
1545
1545
  }
1546
1546
  e["~standard"] = {
1547
- validate: (i) => {
1547
+ validate: (r) => {
1548
1548
  try {
1549
- const a = Gn(e, i);
1549
+ const a = Gn(e, r);
1550
1550
  return a.success ? { value: a.data } : { issues: a.error?.issues };
1551
1551
  } catch {
1552
- return Wn(e, i).then((c) => c.success ? { value: c.data } : { issues: c.error?.issues });
1552
+ return Wn(e, r).then((c) => c.success ? { value: c.data } : { issues: c.error?.issues });
1553
1553
  }
1554
1554
  },
1555
1555
  vendor: "zod",
@@ -1596,8 +1596,8 @@ const Fo = {
1596
1596
  }), Go = /* @__PURE__ */ m("$ZodURL", (e, t) => {
1597
1597
  z.init(e, t), e._zod.check = (n) => {
1598
1598
  try {
1599
- const o = n.value.trim(), i = new URL(o);
1600
- t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
1599
+ const o = n.value.trim(), r = new URL(o);
1600
+ t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(r.hostname) || n.issues.push({
1601
1601
  code: "invalid_format",
1602
1602
  format: "url",
1603
1603
  note: "Invalid hostname",
@@ -1605,7 +1605,7 @@ const Fo = {
1605
1605
  input: n.value,
1606
1606
  inst: e,
1607
1607
  continue: !t.abort
1608
- })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
1608
+ })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(r.protocol.endsWith(":") ? r.protocol.slice(0, -1) : r.protocol) || n.issues.push({
1609
1609
  code: "invalid_format",
1610
1610
  format: "url",
1611
1611
  note: "Invalid protocol",
@@ -1613,7 +1613,7 @@ const Fo = {
1613
1613
  input: n.value,
1614
1614
  inst: e,
1615
1615
  continue: !t.abort
1616
- })), t.normalize ? n.value = i.href : n.value = o;
1616
+ })), t.normalize ? n.value = r.href : n.value = o;
1617
1617
  return;
1618
1618
  } catch {
1619
1619
  n.issues.push({
@@ -1636,20 +1636,20 @@ const Fo = {
1636
1636
  }), Jo = /* @__PURE__ */ m("$ZodULID", (e, t) => {
1637
1637
  t.pattern ?? (t.pattern = oo), z.init(e, t);
1638
1638
  }), Yo = /* @__PURE__ */ m("$ZodXID", (e, t) => {
1639
- t.pattern ?? (t.pattern = ro), z.init(e, t);
1640
- }), Qo = /* @__PURE__ */ m("$ZodKSUID", (e, t) => {
1641
1639
  t.pattern ?? (t.pattern = io), z.init(e, t);
1640
+ }), Qo = /* @__PURE__ */ m("$ZodKSUID", (e, t) => {
1641
+ t.pattern ?? (t.pattern = ro), z.init(e, t);
1642
1642
  }), Xo = /* @__PURE__ */ m("$ZodISODateTime", (e, t) => {
1643
1643
  t.pattern ?? (t.pattern = wo(t)), z.init(e, t);
1644
- }), er = /* @__PURE__ */ m("$ZodISODate", (e, t) => {
1644
+ }), ei = /* @__PURE__ */ m("$ZodISODate", (e, t) => {
1645
1645
  t.pattern ?? (t.pattern = yo), z.init(e, t);
1646
- }), tr = /* @__PURE__ */ m("$ZodISOTime", (e, t) => {
1646
+ }), ti = /* @__PURE__ */ m("$ZodISOTime", (e, t) => {
1647
1647
  t.pattern ?? (t.pattern = bo(t)), z.init(e, t);
1648
- }), nr = /* @__PURE__ */ m("$ZodISODuration", (e, t) => {
1648
+ }), ni = /* @__PURE__ */ m("$ZodISODuration", (e, t) => {
1649
1649
  t.pattern ?? (t.pattern = ao), z.init(e, t);
1650
- }), or = /* @__PURE__ */ m("$ZodIPv4", (e, t) => {
1650
+ }), oi = /* @__PURE__ */ m("$ZodIPv4", (e, t) => {
1651
1651
  t.pattern ?? (t.pattern = ho), z.init(e, t), e._zod.bag.format = "ipv4";
1652
- }), rr = /* @__PURE__ */ m("$ZodIPv6", (e, t) => {
1652
+ }), ii = /* @__PURE__ */ m("$ZodIPv6", (e, t) => {
1653
1653
  t.pattern ?? (t.pattern = fo), z.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
1654
1654
  try {
1655
1655
  new URL(`http://[${n.value}]`);
@@ -1663,15 +1663,15 @@ const Fo = {
1663
1663
  });
1664
1664
  }
1665
1665
  };
1666
- }), ir = /* @__PURE__ */ m("$ZodCIDRv4", (e, t) => {
1666
+ }), ri = /* @__PURE__ */ m("$ZodCIDRv4", (e, t) => {
1667
1667
  t.pattern ?? (t.pattern = _o), z.init(e, t);
1668
- }), sr = /* @__PURE__ */ m("$ZodCIDRv6", (e, t) => {
1668
+ }), si = /* @__PURE__ */ m("$ZodCIDRv6", (e, t) => {
1669
1669
  t.pattern ?? (t.pattern = mo), z.init(e, t), e._zod.check = (n) => {
1670
1670
  const o = n.value.split("/");
1671
1671
  try {
1672
1672
  if (o.length !== 2)
1673
1673
  throw new Error();
1674
- const [i, a] = o;
1674
+ const [r, a] = o;
1675
1675
  if (!a)
1676
1676
  throw new Error();
1677
1677
  const c = Number(a);
@@ -1679,7 +1679,7 @@ const Fo = {
1679
1679
  throw new Error();
1680
1680
  if (c < 0 || c > 128)
1681
1681
  throw new Error();
1682
- new URL(`http://[${i}]`);
1682
+ new URL(`http://[${r}]`);
1683
1683
  } catch {
1684
1684
  n.issues.push({
1685
1685
  code: "invalid_format",
@@ -1702,7 +1702,7 @@ function Mt(e) {
1702
1702
  return !1;
1703
1703
  }
1704
1704
  }
1705
- const ar = /* @__PURE__ */ m("$ZodBase64", (e, t) => {
1705
+ const ai = /* @__PURE__ */ m("$ZodBase64", (e, t) => {
1706
1706
  t.pattern ?? (t.pattern = vo), z.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
1707
1707
  Mt(n.value) || n.issues.push({
1708
1708
  code: "invalid_format",
@@ -1713,15 +1713,15 @@ const ar = /* @__PURE__ */ m("$ZodBase64", (e, t) => {
1713
1713
  });
1714
1714
  };
1715
1715
  });
1716
- function ur(e) {
1716
+ function ui(e) {
1717
1717
  if (!Rt.test(e))
1718
1718
  return !1;
1719
1719
  const t = e.replace(/[-_]/g, (o) => o === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1720
1720
  return Mt(n);
1721
1721
  }
1722
- const cr = /* @__PURE__ */ m("$ZodBase64URL", (e, t) => {
1722
+ const ci = /* @__PURE__ */ m("$ZodBase64URL", (e, t) => {
1723
1723
  t.pattern ?? (t.pattern = Rt), z.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1724
- ur(n.value) || n.issues.push({
1724
+ ui(n.value) || n.issues.push({
1725
1725
  code: "invalid_format",
1726
1726
  format: "base64url",
1727
1727
  input: n.value,
@@ -1729,10 +1729,10 @@ const cr = /* @__PURE__ */ m("$ZodBase64URL", (e, t) => {
1729
1729
  continue: !t.abort
1730
1730
  });
1731
1731
  };
1732
- }), lr = /* @__PURE__ */ m("$ZodE164", (e, t) => {
1732
+ }), li = /* @__PURE__ */ m("$ZodE164", (e, t) => {
1733
1733
  t.pattern ?? (t.pattern = go), z.init(e, t);
1734
1734
  });
1735
- function dr(e, t = null) {
1735
+ function di(e, t = null) {
1736
1736
  try {
1737
1737
  const n = e.split(".");
1738
1738
  if (n.length !== 3)
@@ -1740,15 +1740,15 @@ function dr(e, t = null) {
1740
1740
  const [o] = n;
1741
1741
  if (!o)
1742
1742
  return !1;
1743
- const i = JSON.parse(atob(o));
1744
- return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
1743
+ const r = JSON.parse(atob(o));
1744
+ return !("typ" in r && r?.typ !== "JWT" || !r.alg || t && (!("alg" in r) || r.alg !== t));
1745
1745
  } catch {
1746
1746
  return !1;
1747
1747
  }
1748
1748
  }
1749
- const pr = /* @__PURE__ */ m("$ZodJWT", (e, t) => {
1749
+ const pi = /* @__PURE__ */ m("$ZodJWT", (e, t) => {
1750
1750
  z.init(e, t), e._zod.check = (n) => {
1751
- dr(n.value, t.alg) || n.issues.push({
1751
+ di(n.value, t.alg) || n.issues.push({
1752
1752
  code: "invalid_format",
1753
1753
  format: "jwt",
1754
1754
  input: n.value,
@@ -1763,33 +1763,33 @@ const pr = /* @__PURE__ */ m("$ZodJWT", (e, t) => {
1763
1763
  n.value = Number(n.value);
1764
1764
  } catch {
1765
1765
  }
1766
- const i = n.value;
1767
- if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i))
1766
+ const r = n.value;
1767
+ if (typeof r == "number" && !Number.isNaN(r) && Number.isFinite(r))
1768
1768
  return n;
1769
- const a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
1769
+ const a = typeof r == "number" ? Number.isNaN(r) ? "NaN" : Number.isFinite(r) ? void 0 : "Infinity" : void 0;
1770
1770
  return n.issues.push({
1771
1771
  expected: "number",
1772
1772
  code: "invalid_type",
1773
- input: i,
1773
+ input: r,
1774
1774
  inst: e,
1775
1775
  ...a ? { received: a } : {}
1776
1776
  }), n;
1777
1777
  };
1778
- }), hr = /* @__PURE__ */ m("$ZodNumberFormat", (e, t) => {
1778
+ }), hi = /* @__PURE__ */ m("$ZodNumberFormat", (e, t) => {
1779
1779
  Io.init(e, t), Vt.init(e, t);
1780
- }), fr = /* @__PURE__ */ m("$ZodNull", (e, t) => {
1780
+ }), fi = /* @__PURE__ */ m("$ZodNull", (e, t) => {
1781
1781
  A.init(e, t), e._zod.pattern = Ao, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (n, o) => {
1782
- const i = n.value;
1783
- return i === null || n.issues.push({
1782
+ const r = n.value;
1783
+ return r === null || n.issues.push({
1784
1784
  expected: "null",
1785
1785
  code: "invalid_type",
1786
- input: i,
1786
+ input: r,
1787
1787
  inst: e
1788
1788
  }), n;
1789
1789
  };
1790
- }), _r = /* @__PURE__ */ m("$ZodUnknown", (e, t) => {
1790
+ }), _i = /* @__PURE__ */ m("$ZodUnknown", (e, t) => {
1791
1791
  A.init(e, t), e._zod.parse = (n) => n;
1792
- }), mr = /* @__PURE__ */ m("$ZodNever", (e, t) => {
1792
+ }), mi = /* @__PURE__ */ m("$ZodNever", (e, t) => {
1793
1793
  A.init(e, t), e._zod.parse = (n, o) => (n.issues.push({
1794
1794
  expected: "never",
1795
1795
  code: "invalid_type",
@@ -1800,20 +1800,20 @@ const pr = /* @__PURE__ */ m("$ZodJWT", (e, t) => {
1800
1800
  function Xe(e, t, n) {
1801
1801
  e.issues.length && t.issues.push(...M(n, e.issues)), t.value[n] = e.value;
1802
1802
  }
1803
- const vr = /* @__PURE__ */ m("$ZodArray", (e, t) => {
1803
+ const vi = /* @__PURE__ */ m("$ZodArray", (e, t) => {
1804
1804
  A.init(e, t), e._zod.parse = (n, o) => {
1805
- const i = n.value;
1806
- if (!Array.isArray(i))
1805
+ const r = n.value;
1806
+ if (!Array.isArray(r))
1807
1807
  return n.issues.push({
1808
1808
  expected: "array",
1809
1809
  code: "invalid_type",
1810
- input: i,
1810
+ input: r,
1811
1811
  inst: e
1812
1812
  }), n;
1813
- n.value = Array(i.length);
1813
+ n.value = Array(r.length);
1814
1814
  const a = [];
1815
- for (let c = 0; c < i.length; c++) {
1816
- const l = i[c], d = t.element._zod.run({
1815
+ for (let c = 0; c < r.length; c++) {
1816
+ const l = r[c], d = t.element._zod.run({
1817
1817
  value: l,
1818
1818
  issues: []
1819
1819
  }, o);
@@ -1839,8 +1839,8 @@ function Bt(e) {
1839
1839
  optionalKeys: new Set(n)
1840
1840
  };
1841
1841
  }
1842
- function Gt(e, t, n, o, i, a) {
1843
- const c = [], l = i.keySet, d = i.catchall._zod, f = d.def.type;
1842
+ function Gt(e, t, n, o, r, a) {
1843
+ const c = [], l = r.keySet, d = r.catchall._zod, f = d.def.type;
1844
1844
  for (const y in t) {
1845
1845
  if (l.has(y))
1846
1846
  continue;
@@ -1849,7 +1849,7 @@ function Gt(e, t, n, o, i, a) {
1849
1849
  continue;
1850
1850
  }
1851
1851
  const g = d.run({ value: t[y], issues: [] }, o);
1852
- g instanceof Promise ? e.push(g.then((r) => fe(r, n, y, t))) : fe(g, n, y, t);
1852
+ g instanceof Promise ? e.push(g.then((i) => fe(i, n, y, t))) : fe(g, n, y, t);
1853
1853
  }
1854
1854
  return c.length && n.issues.push({
1855
1855
  code: "unrecognized_keys",
@@ -1858,7 +1858,7 @@ function Gt(e, t, n, o, i, a) {
1858
1858
  inst: a
1859
1859
  }), e.length ? Promise.all(e).then(() => n) : n;
1860
1860
  }
1861
- const gr = /* @__PURE__ */ m("$ZodObject", (e, t) => {
1861
+ const gi = /* @__PURE__ */ m("$ZodObject", (e, t) => {
1862
1862
  if (A.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1863
1863
  const l = t.shape;
1864
1864
  Object.defineProperty(t, "shape", {
@@ -1883,12 +1883,12 @@ const gr = /* @__PURE__ */ m("$ZodObject", (e, t) => {
1883
1883
  }
1884
1884
  return d;
1885
1885
  });
1886
- const i = he, a = t.catchall;
1886
+ const r = he, a = t.catchall;
1887
1887
  let c;
1888
1888
  e._zod.parse = (l, d) => {
1889
1889
  c ?? (c = o.value);
1890
1890
  const f = l.value;
1891
- if (!i(f))
1891
+ if (!r(f))
1892
1892
  return l.issues.push({
1893
1893
  expected: "object",
1894
1894
  code: "invalid_type",
@@ -1897,15 +1897,15 @@ const gr = /* @__PURE__ */ m("$ZodObject", (e, t) => {
1897
1897
  }), l;
1898
1898
  l.value = {};
1899
1899
  const y = [], g = c.shape;
1900
- for (const r of c.keys) {
1901
- const u = g[r]._zod.run({ value: f[r], issues: [] }, d);
1902
- u instanceof Promise ? y.push(u.then((p) => fe(p, l, r, f))) : fe(u, l, r, f);
1900
+ for (const i of c.keys) {
1901
+ const u = g[i]._zod.run({ value: f[i], issues: [] }, d);
1902
+ u instanceof Promise ? y.push(u.then((p) => fe(p, l, i, f))) : fe(u, l, i, f);
1903
1903
  }
1904
1904
  return a ? Gt(y, f, l, d, o.value, e) : y.length ? Promise.all(y).then(() => l) : l;
1905
1905
  };
1906
- }), yr = /* @__PURE__ */ m("$ZodObjectJIT", (e, t) => {
1907
- gr.init(e, t);
1908
- const n = e._zod.parse, o = Re(() => Bt(t)), i = (r) => {
1906
+ }), yi = /* @__PURE__ */ m("$ZodObjectJIT", (e, t) => {
1907
+ gi.init(e, t);
1908
+ const n = e._zod.parse, o = Re(() => Bt(t)), r = (i) => {
1909
1909
  const s = new Uo(["shape", "payload", "ctx"]), u = o.value, p = (w) => {
1910
1910
  const E = Ye(w);
1911
1911
  return `shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`;
@@ -1939,53 +1939,53 @@ const gr = /* @__PURE__ */ m("$ZodObject", (e, t) => {
1939
1939
  }
1940
1940
  s.write("payload.value = newResult;"), s.write("return payload;");
1941
1941
  const _ = s.compile();
1942
- return (w, E) => _(r, w, E);
1942
+ return (w, E) => _(i, w, E);
1943
1943
  };
1944
1944
  let a;
1945
- const c = he, l = !$t.jitless, f = l && Zn.value, y = t.catchall;
1945
+ const c = he, l = !$t.jitless, f = l && Pn.value, y = t.catchall;
1946
1946
  let g;
1947
- e._zod.parse = (r, s) => {
1947
+ e._zod.parse = (i, s) => {
1948
1948
  g ?? (g = o.value);
1949
- const u = r.value;
1950
- return c(u) ? l && f && s?.async === !1 && s.jitless !== !0 ? (a || (a = i(t.shape)), r = a(r, s), y ? Gt([], u, r, s, g, e) : r) : n(r, s) : (r.issues.push({
1949
+ const u = i.value;
1950
+ return c(u) ? l && f && s?.async === !1 && s.jitless !== !0 ? (a || (a = r(t.shape)), i = a(i, s), y ? Gt([], u, i, s, g, e) : i) : n(i, s) : (i.issues.push({
1951
1951
  expected: "object",
1952
1952
  code: "invalid_type",
1953
1953
  input: u,
1954
1954
  inst: e
1955
- }), r);
1955
+ }), i);
1956
1956
  };
1957
1957
  });
1958
1958
  function et(e, t, n, o) {
1959
1959
  for (const a of e)
1960
1960
  if (a.issues.length === 0)
1961
1961
  return t.value = a.value, t;
1962
- const i = e.filter((a) => !q(a));
1963
- return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1962
+ const r = e.filter((a) => !q(a));
1963
+ return r.length === 1 ? (t.value = r[0].value, r[0]) : (t.issues.push({
1964
1964
  code: "invalid_union",
1965
1965
  input: t.value,
1966
1966
  inst: n,
1967
1967
  errors: e.map((a) => a.issues.map((c) => N(c, o, j())))
1968
1968
  }), t);
1969
1969
  }
1970
- const br = /* @__PURE__ */ m("$ZodUnion", (e, t) => {
1971
- A.init(e, t), C(e._zod, "optin", () => t.options.some((i) => i._zod.optin === "optional") ? "optional" : void 0), C(e._zod, "optout", () => t.options.some((i) => i._zod.optout === "optional") ? "optional" : void 0), C(e._zod, "values", () => {
1972
- if (t.options.every((i) => i._zod.values))
1973
- return new Set(t.options.flatMap((i) => Array.from(i._zod.values)));
1970
+ const bi = /* @__PURE__ */ m("$ZodUnion", (e, t) => {
1971
+ A.init(e, t), C(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), C(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), C(e._zod, "values", () => {
1972
+ if (t.options.every((r) => r._zod.values))
1973
+ return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
1974
1974
  }), C(e._zod, "pattern", () => {
1975
- if (t.options.every((i) => i._zod.pattern)) {
1976
- const i = t.options.map((a) => a._zod.pattern);
1977
- return new RegExp(`^(${i.map((a) => Ne(a.source)).join("|")})$`);
1975
+ if (t.options.every((r) => r._zod.pattern)) {
1976
+ const r = t.options.map((a) => a._zod.pattern);
1977
+ return new RegExp(`^(${r.map((a) => Ne(a.source)).join("|")})$`);
1978
1978
  }
1979
1979
  });
1980
1980
  const n = t.options.length === 1, o = t.options[0]._zod.run;
1981
- e._zod.parse = (i, a) => {
1981
+ e._zod.parse = (r, a) => {
1982
1982
  if (n)
1983
- return o(i, a);
1983
+ return o(r, a);
1984
1984
  let c = !1;
1985
1985
  const l = [];
1986
1986
  for (const d of t.options) {
1987
1987
  const f = d._zod.run({
1988
- value: i.value,
1988
+ value: r.value,
1989
1989
  issues: []
1990
1990
  }, a);
1991
1991
  if (f instanceof Promise)
@@ -1996,38 +1996,38 @@ const br = /* @__PURE__ */ m("$ZodUnion", (e, t) => {
1996
1996
  l.push(f);
1997
1997
  }
1998
1998
  }
1999
- return c ? Promise.all(l).then((d) => et(d, i, e, a)) : et(l, i, e, a);
1999
+ return c ? Promise.all(l).then((d) => et(d, r, e, a)) : et(l, r, e, a);
2000
2000
  };
2001
- }), wr = /* @__PURE__ */ m("$ZodIntersection", (e, t) => {
2001
+ }), wi = /* @__PURE__ */ m("$ZodIntersection", (e, t) => {
2002
2002
  A.init(e, t), e._zod.parse = (n, o) => {
2003
- const i = n.value, a = t.left._zod.run({ value: i, issues: [] }, o), c = t.right._zod.run({ value: i, issues: [] }, o);
2003
+ const r = n.value, a = t.left._zod.run({ value: r, issues: [] }, o), c = t.right._zod.run({ value: r, issues: [] }, o);
2004
2004
  return a instanceof Promise || c instanceof Promise ? Promise.all([a, c]).then(([d, f]) => tt(n, d, f)) : tt(n, a, c);
2005
2005
  };
2006
2006
  });
2007
- function Pe(e, t) {
2007
+ function Ze(e, t) {
2008
2008
  if (e === t)
2009
2009
  return { valid: !0, data: e };
2010
2010
  if (e instanceof Date && t instanceof Date && +e == +t)
2011
2011
  return { valid: !0, data: e };
2012
2012
  if (H(e) && H(t)) {
2013
- const n = Object.keys(t), o = Object.keys(e).filter((a) => n.indexOf(a) !== -1), i = { ...e, ...t };
2013
+ const n = Object.keys(t), o = Object.keys(e).filter((a) => n.indexOf(a) !== -1), r = { ...e, ...t };
2014
2014
  for (const a of o) {
2015
- const c = Pe(e[a], t[a]);
2015
+ const c = Ze(e[a], t[a]);
2016
2016
  if (!c.valid)
2017
2017
  return {
2018
2018
  valid: !1,
2019
2019
  mergeErrorPath: [a, ...c.mergeErrorPath]
2020
2020
  };
2021
- i[a] = c.data;
2021
+ r[a] = c.data;
2022
2022
  }
2023
- return { valid: !0, data: i };
2023
+ return { valid: !0, data: r };
2024
2024
  }
2025
2025
  if (Array.isArray(e) && Array.isArray(t)) {
2026
2026
  if (e.length !== t.length)
2027
2027
  return { valid: !1, mergeErrorPath: [] };
2028
2028
  const n = [];
2029
2029
  for (let o = 0; o < e.length; o++) {
2030
- const i = e[o], a = t[o], c = Pe(i, a);
2030
+ const r = e[o], a = t[o], c = Ze(r, a);
2031
2031
  if (!c.valid)
2032
2032
  return {
2033
2033
  valid: !1,
@@ -2042,15 +2042,15 @@ function Pe(e, t) {
2042
2042
  function tt(e, t, n) {
2043
2043
  if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), q(e))
2044
2044
  return e;
2045
- const o = Pe(t.value, n.value);
2045
+ const o = Ze(t.value, n.value);
2046
2046
  if (!o.valid)
2047
2047
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
2048
2048
  return e.value = o.data, e;
2049
2049
  }
2050
- const Er = /* @__PURE__ */ m("$ZodTuple", (e, t) => {
2050
+ const Ei = /* @__PURE__ */ m("$ZodTuple", (e, t) => {
2051
2051
  A.init(e, t);
2052
2052
  const n = t.items;
2053
- e._zod.parse = (o, i) => {
2053
+ e._zod.parse = (o, r) => {
2054
2054
  const a = o.value;
2055
2055
  if (!Array.isArray(a))
2056
2056
  return o.issues.push({
@@ -2078,18 +2078,18 @@ const Er = /* @__PURE__ */ m("$ZodTuple", (e, t) => {
2078
2078
  const g = y._zod.run({
2079
2079
  value: a[f],
2080
2080
  issues: []
2081
- }, i);
2082
- g instanceof Promise ? c.push(g.then((r) => ue(r, o, f))) : ue(g, o, f);
2081
+ }, r);
2082
+ g instanceof Promise ? c.push(g.then((i) => ue(i, o, f))) : ue(g, o, f);
2083
2083
  }
2084
2084
  if (t.rest) {
2085
2085
  const y = a.slice(n.length);
2086
2086
  for (const g of y) {
2087
2087
  f++;
2088
- const r = t.rest._zod.run({
2088
+ const i = t.rest._zod.run({
2089
2089
  value: g,
2090
2090
  issues: []
2091
- }, i);
2092
- r instanceof Promise ? c.push(r.then((s) => ue(s, o, f))) : ue(r, o, f);
2091
+ }, r);
2092
+ i instanceof Promise ? c.push(i.then((s) => ue(s, o, f))) : ue(i, o, f);
2093
2093
  }
2094
2094
  }
2095
2095
  return c.length ? Promise.all(c).then(() => o) : o;
@@ -2098,14 +2098,14 @@ const Er = /* @__PURE__ */ m("$ZodTuple", (e, t) => {
2098
2098
  function ue(e, t, n) {
2099
2099
  e.issues.length && t.issues.push(...M(n, e.issues)), t.value[n] = e.value;
2100
2100
  }
2101
- const kr = /* @__PURE__ */ m("$ZodRecord", (e, t) => {
2101
+ const ki = /* @__PURE__ */ m("$ZodRecord", (e, t) => {
2102
2102
  A.init(e, t), e._zod.parse = (n, o) => {
2103
- const i = n.value;
2104
- if (!H(i))
2103
+ const r = n.value;
2104
+ if (!H(r))
2105
2105
  return n.issues.push({
2106
2106
  expected: "record",
2107
2107
  code: "invalid_type",
2108
- input: i,
2108
+ input: r,
2109
2109
  inst: e
2110
2110
  }), n;
2111
2111
  const a = [], c = t.keyType._zod.values;
@@ -2115,23 +2115,23 @@ const kr = /* @__PURE__ */ m("$ZodRecord", (e, t) => {
2115
2115
  for (const f of c)
2116
2116
  if (typeof f == "string" || typeof f == "number" || typeof f == "symbol") {
2117
2117
  l.add(typeof f == "number" ? f.toString() : f);
2118
- const y = t.valueType._zod.run({ value: i[f], issues: [] }, o);
2118
+ const y = t.valueType._zod.run({ value: r[f], issues: [] }, o);
2119
2119
  y instanceof Promise ? a.push(y.then((g) => {
2120
2120
  g.issues.length && n.issues.push(...M(f, g.issues)), n.value[f] = g.value;
2121
2121
  })) : (y.issues.length && n.issues.push(...M(f, y.issues)), n.value[f] = y.value);
2122
2122
  }
2123
2123
  let d;
2124
- for (const f in i)
2124
+ for (const f in r)
2125
2125
  l.has(f) || (d = d ?? [], d.push(f));
2126
2126
  d && d.length > 0 && n.issues.push({
2127
2127
  code: "unrecognized_keys",
2128
- input: i,
2128
+ input: r,
2129
2129
  inst: e,
2130
2130
  keys: d
2131
2131
  });
2132
2132
  } else {
2133
2133
  n.value = {};
2134
- for (const l of Reflect.ownKeys(i)) {
2134
+ for (const l of Reflect.ownKeys(r)) {
2135
2135
  if (l === "__proto__")
2136
2136
  continue;
2137
2137
  const d = t.keyType._zod.run({ value: l, issues: [] }, o);
@@ -2148,7 +2148,7 @@ const kr = /* @__PURE__ */ m("$ZodRecord", (e, t) => {
2148
2148
  }), n.value[d.value] = d.value;
2149
2149
  continue;
2150
2150
  }
2151
- const f = t.valueType._zod.run({ value: i[l], issues: [] }, o);
2151
+ const f = t.valueType._zod.run({ value: r[l], issues: [] }, o);
2152
2152
  f instanceof Promise ? a.push(f.then((y) => {
2153
2153
  y.issues.length && n.issues.push(...M(l, y.issues)), n.value[d.value] = y.value;
2154
2154
  })) : (f.issues.length && n.issues.push(...M(l, f.issues)), n.value[d.value] = f.value);
@@ -2156,23 +2156,23 @@ const kr = /* @__PURE__ */ m("$ZodRecord", (e, t) => {
2156
2156
  }
2157
2157
  return a.length ? Promise.all(a).then(() => n) : n;
2158
2158
  };
2159
- }), Cr = /* @__PURE__ */ m("$ZodEnum", (e, t) => {
2159
+ }), Ci = /* @__PURE__ */ m("$ZodEnum", (e, t) => {
2160
2160
  A.init(e, t);
2161
2161
  const n = In(t.entries), o = new Set(n);
2162
- e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((i) => Pn.has(typeof i)).map((i) => typeof i == "string" ? J(i) : i.toString()).join("|")})$`), e._zod.parse = (i, a) => {
2163
- const c = i.value;
2164
- return o.has(c) || i.issues.push({
2162
+ e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) => Zn.has(typeof r)).map((r) => typeof r == "string" ? J(r) : r.toString()).join("|")})$`), e._zod.parse = (r, a) => {
2163
+ const c = r.value;
2164
+ return o.has(c) || r.issues.push({
2165
2165
  code: "invalid_value",
2166
2166
  values: n,
2167
2167
  input: c,
2168
2168
  inst: e
2169
- }), i;
2169
+ }), r;
2170
2170
  };
2171
- }), Ar = /* @__PURE__ */ m("$ZodLiteral", (e, t) => {
2171
+ }), Ai = /* @__PURE__ */ m("$ZodLiteral", (e, t) => {
2172
2172
  if (A.init(e, t), t.values.length === 0)
2173
2173
  throw new Error("Cannot create literal schema with no valid values");
2174
2174
  const n = new Set(t.values);
2175
- e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((o) => typeof o == "string" ? J(o) : o ? J(o.toString()) : String(o)).join("|")})$`), e._zod.parse = (o, i) => {
2175
+ e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((o) => typeof o == "string" ? J(o) : o ? J(o.toString()) : String(o)).join("|")})$`), e._zod.parse = (o, r) => {
2176
2176
  const a = o.value;
2177
2177
  return n.has(a) || o.issues.push({
2178
2178
  code: "invalid_value",
@@ -2181,62 +2181,62 @@ const kr = /* @__PURE__ */ m("$ZodRecord", (e, t) => {
2181
2181
  inst: e
2182
2182
  }), o;
2183
2183
  };
2184
- }), Tr = /* @__PURE__ */ m("$ZodTransform", (e, t) => {
2184
+ }), Ti = /* @__PURE__ */ m("$ZodTransform", (e, t) => {
2185
2185
  A.init(e, t), e._zod.parse = (n, o) => {
2186
2186
  if (o.direction === "backward")
2187
2187
  throw new It(e.constructor.name);
2188
- const i = t.transform(n.value, n);
2188
+ const r = t.transform(n.value, n);
2189
2189
  if (o.async)
2190
- return (i instanceof Promise ? i : Promise.resolve(i)).then((c) => (n.value = c, n));
2191
- if (i instanceof Promise)
2190
+ return (r instanceof Promise ? r : Promise.resolve(r)).then((c) => (n.value = c, n));
2191
+ if (r instanceof Promise)
2192
2192
  throw new K();
2193
- return n.value = i, n;
2193
+ return n.value = r, n;
2194
2194
  };
2195
2195
  });
2196
2196
  function nt(e, t) {
2197
2197
  return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
2198
2198
  }
2199
- const Sr = /* @__PURE__ */ m("$ZodOptional", (e, t) => {
2199
+ const Si = /* @__PURE__ */ m("$ZodOptional", (e, t) => {
2200
2200
  A.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", C(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), C(e._zod, "pattern", () => {
2201
2201
  const n = t.innerType._zod.pattern;
2202
2202
  return n ? new RegExp(`^(${Ne(n.source)})?$`) : void 0;
2203
2203
  }), e._zod.parse = (n, o) => {
2204
2204
  if (t.innerType._zod.optin === "optional") {
2205
- const i = t.innerType._zod.run(n, o);
2206
- return i instanceof Promise ? i.then((a) => nt(a, n.value)) : nt(i, n.value);
2205
+ const r = t.innerType._zod.run(n, o);
2206
+ return r instanceof Promise ? r.then((a) => nt(a, n.value)) : nt(r, n.value);
2207
2207
  }
2208
2208
  return n.value === void 0 ? n : t.innerType._zod.run(n, o);
2209
2209
  };
2210
- }), zr = /* @__PURE__ */ m("$ZodNullable", (e, t) => {
2210
+ }), zi = /* @__PURE__ */ m("$ZodNullable", (e, t) => {
2211
2211
  A.init(e, t), C(e._zod, "optin", () => t.innerType._zod.optin), C(e._zod, "optout", () => t.innerType._zod.optout), C(e._zod, "pattern", () => {
2212
2212
  const n = t.innerType._zod.pattern;
2213
2213
  return n ? new RegExp(`^(${Ne(n.source)}|null)$`) : void 0;
2214
2214
  }), C(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, o) => n.value === null ? n : t.innerType._zod.run(n, o);
2215
- }), Ir = /* @__PURE__ */ m("$ZodDefault", (e, t) => {
2215
+ }), Ii = /* @__PURE__ */ m("$ZodDefault", (e, t) => {
2216
2216
  A.init(e, t), e._zod.optin = "optional", C(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
2217
2217
  if (o.direction === "backward")
2218
2218
  return t.innerType._zod.run(n, o);
2219
2219
  if (n.value === void 0)
2220
2220
  return n.value = t.defaultValue, n;
2221
- const i = t.innerType._zod.run(n, o);
2222
- return i instanceof Promise ? i.then((a) => ot(a, t)) : ot(i, t);
2221
+ const r = t.innerType._zod.run(n, o);
2222
+ return r instanceof Promise ? r.then((a) => ot(a, t)) : ot(r, t);
2223
2223
  };
2224
2224
  });
2225
2225
  function ot(e, t) {
2226
2226
  return e.value === void 0 && (e.value = t.defaultValue), e;
2227
2227
  }
2228
- const $r = /* @__PURE__ */ m("$ZodPrefault", (e, t) => {
2228
+ const $i = /* @__PURE__ */ m("$ZodPrefault", (e, t) => {
2229
2229
  A.init(e, t), e._zod.optin = "optional", C(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => (o.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, o));
2230
- }), Or = /* @__PURE__ */ m("$ZodNonOptional", (e, t) => {
2230
+ }), Oi = /* @__PURE__ */ m("$ZodNonOptional", (e, t) => {
2231
2231
  A.init(e, t), C(e._zod, "values", () => {
2232
2232
  const n = t.innerType._zod.values;
2233
2233
  return n ? new Set([...n].filter((o) => o !== void 0)) : void 0;
2234
2234
  }), e._zod.parse = (n, o) => {
2235
- const i = t.innerType._zod.run(n, o);
2236
- return i instanceof Promise ? i.then((a) => rt(a, e)) : rt(i, e);
2235
+ const r = t.innerType._zod.run(n, o);
2236
+ return r instanceof Promise ? r.then((a) => it(a, e)) : it(r, e);
2237
2237
  };
2238
2238
  });
2239
- function rt(e, t) {
2239
+ function it(e, t) {
2240
2240
  return !e.issues.length && e.value === void 0 && e.issues.push({
2241
2241
  code: "invalid_type",
2242
2242
  expected: "nonoptional",
@@ -2244,60 +2244,60 @@ function rt(e, t) {
2244
2244
  inst: t
2245
2245
  }), e;
2246
2246
  }
2247
- const Zr = /* @__PURE__ */ m("$ZodCatch", (e, t) => {
2247
+ const Pi = /* @__PURE__ */ m("$ZodCatch", (e, t) => {
2248
2248
  A.init(e, t), C(e._zod, "optin", () => t.innerType._zod.optin), C(e._zod, "optout", () => t.innerType._zod.optout), C(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
2249
2249
  if (o.direction === "backward")
2250
2250
  return t.innerType._zod.run(n, o);
2251
- const i = t.innerType._zod.run(n, o);
2252
- return i instanceof Promise ? i.then((a) => (n.value = a.value, a.issues.length && (n.value = t.catchValue({
2251
+ const r = t.innerType._zod.run(n, o);
2252
+ return r instanceof Promise ? r.then((a) => (n.value = a.value, a.issues.length && (n.value = t.catchValue({
2253
2253
  ...n,
2254
2254
  error: {
2255
2255
  issues: a.issues.map((c) => N(c, o, j()))
2256
2256
  },
2257
2257
  input: n.value
2258
- }), n.issues = []), n)) : (n.value = i.value, i.issues.length && (n.value = t.catchValue({
2258
+ }), n.issues = []), n)) : (n.value = r.value, r.issues.length && (n.value = t.catchValue({
2259
2259
  ...n,
2260
2260
  error: {
2261
- issues: i.issues.map((a) => N(a, o, j()))
2261
+ issues: r.issues.map((a) => N(a, o, j()))
2262
2262
  },
2263
2263
  input: n.value
2264
2264
  }), n.issues = []), n);
2265
2265
  };
2266
- }), Pr = /* @__PURE__ */ m("$ZodPipe", (e, t) => {
2266
+ }), Zi = /* @__PURE__ */ m("$ZodPipe", (e, t) => {
2267
2267
  A.init(e, t), C(e._zod, "values", () => t.in._zod.values), C(e._zod, "optin", () => t.in._zod.optin), C(e._zod, "optout", () => t.out._zod.optout), C(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, o) => {
2268
2268
  if (o.direction === "backward") {
2269
2269
  const a = t.out._zod.run(n, o);
2270
2270
  return a instanceof Promise ? a.then((c) => ce(c, t.in, o)) : ce(a, t.in, o);
2271
2271
  }
2272
- const i = t.in._zod.run(n, o);
2273
- return i instanceof Promise ? i.then((a) => ce(a, t.out, o)) : ce(i, t.out, o);
2272
+ const r = t.in._zod.run(n, o);
2273
+ return r instanceof Promise ? r.then((a) => ce(a, t.out, o)) : ce(r, t.out, o);
2274
2274
  };
2275
2275
  });
2276
2276
  function ce(e, t, n) {
2277
2277
  return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
2278
2278
  }
2279
- const xr = /* @__PURE__ */ m("$ZodReadonly", (e, t) => {
2279
+ const xi = /* @__PURE__ */ m("$ZodReadonly", (e, t) => {
2280
2280
  A.init(e, t), C(e._zod, "propValues", () => t.innerType._zod.propValues), C(e._zod, "values", () => t.innerType._zod.values), C(e._zod, "optin", () => t.innerType?._zod?.optin), C(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, o) => {
2281
2281
  if (o.direction === "backward")
2282
2282
  return t.innerType._zod.run(n, o);
2283
- const i = t.innerType._zod.run(n, o);
2284
- return i instanceof Promise ? i.then(it) : it(i);
2283
+ const r = t.innerType._zod.run(n, o);
2284
+ return r instanceof Promise ? r.then(rt) : rt(r);
2285
2285
  };
2286
2286
  });
2287
- function it(e) {
2287
+ function rt(e) {
2288
2288
  return e.value = Object.freeze(e.value), e;
2289
2289
  }
2290
- const Lr = /* @__PURE__ */ m("$ZodCustom", (e, t) => {
2290
+ const Li = /* @__PURE__ */ m("$ZodCustom", (e, t) => {
2291
2291
  O.init(e, t), A.init(e, t), e._zod.parse = (n, o) => n, e._zod.check = (n) => {
2292
- const o = n.value, i = t.fn(o);
2293
- if (i instanceof Promise)
2294
- return i.then((a) => st(a, n, o, e));
2295
- st(i, n, o, e);
2292
+ const o = n.value, r = t.fn(o);
2293
+ if (r instanceof Promise)
2294
+ return r.then((a) => st(a, n, o, e));
2295
+ st(r, n, o, e);
2296
2296
  };
2297
2297
  });
2298
2298
  function st(e, t, n, o) {
2299
2299
  if (!e) {
2300
- const i = {
2300
+ const r = {
2301
2301
  code: "custom",
2302
2302
  input: n,
2303
2303
  inst: o,
@@ -2307,11 +2307,11 @@ function st(e, t, n, o) {
2307
2307
  continue: !o._zod.def.abort
2308
2308
  // params: inst._zod.def.params,
2309
2309
  };
2310
- o._zod.def.params && (i.params = o._zod.def.params), t.issues.push(ie(i));
2310
+ o._zod.def.params && (r.params = o._zod.def.params), t.issues.push(re(r));
2311
2311
  }
2312
2312
  }
2313
2313
  var at;
2314
- class Rr {
2314
+ class Ri {
2315
2315
  constructor() {
2316
2316
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
2317
2317
  }
@@ -2336,8 +2336,8 @@ class Rr {
2336
2336
  if (n) {
2337
2337
  const o = { ...this.get(n) ?? {} };
2338
2338
  delete o.id;
2339
- const i = { ...o, ...this._map.get(t) };
2340
- return Object.keys(i).length ? i : void 0;
2339
+ const r = { ...o, ...this._map.get(t) };
2340
+ return Object.keys(r).length ? r : void 0;
2341
2341
  }
2342
2342
  return this._map.get(t);
2343
2343
  }
@@ -2345,18 +2345,18 @@ class Rr {
2345
2345
  return this._map.has(t);
2346
2346
  }
2347
2347
  }
2348
- function jr() {
2349
- return new Rr();
2348
+ function ji() {
2349
+ return new Ri();
2350
2350
  }
2351
- (at = globalThis).__zod_globalRegistry ?? (at.__zod_globalRegistry = jr());
2351
+ (at = globalThis).__zod_globalRegistry ?? (at.__zod_globalRegistry = ji());
2352
2352
  const le = globalThis.__zod_globalRegistry;
2353
- function Nr(e, t) {
2353
+ function Ni(e, t) {
2354
2354
  return new e({
2355
2355
  type: "string",
2356
2356
  ...b(t)
2357
2357
  });
2358
2358
  }
2359
- function Dr(e, t) {
2359
+ function Di(e, t) {
2360
2360
  return new e({
2361
2361
  type: "string",
2362
2362
  format: "email",
@@ -2374,7 +2374,7 @@ function ut(e, t) {
2374
2374
  ...b(t)
2375
2375
  });
2376
2376
  }
2377
- function Ur(e, t) {
2377
+ function Ui(e, t) {
2378
2378
  return new e({
2379
2379
  type: "string",
2380
2380
  format: "uuid",
@@ -2383,7 +2383,7 @@ function Ur(e, t) {
2383
2383
  ...b(t)
2384
2384
  });
2385
2385
  }
2386
- function Fr(e, t) {
2386
+ function Fi(e, t) {
2387
2387
  return new e({
2388
2388
  type: "string",
2389
2389
  format: "uuid",
@@ -2393,7 +2393,7 @@ function Fr(e, t) {
2393
2393
  ...b(t)
2394
2394
  });
2395
2395
  }
2396
- function Mr(e, t) {
2396
+ function Mi(e, t) {
2397
2397
  return new e({
2398
2398
  type: "string",
2399
2399
  format: "uuid",
@@ -2403,7 +2403,7 @@ function Mr(e, t) {
2403
2403
  ...b(t)
2404
2404
  });
2405
2405
  }
2406
- function Vr(e, t) {
2406
+ function Vi(e, t) {
2407
2407
  return new e({
2408
2408
  type: "string",
2409
2409
  format: "uuid",
@@ -2413,7 +2413,7 @@ function Vr(e, t) {
2413
2413
  ...b(t)
2414
2414
  });
2415
2415
  }
2416
- function Br(e, t) {
2416
+ function Bi(e, t) {
2417
2417
  return new e({
2418
2418
  type: "string",
2419
2419
  format: "url",
@@ -2422,7 +2422,7 @@ function Br(e, t) {
2422
2422
  ...b(t)
2423
2423
  });
2424
2424
  }
2425
- function Gr(e, t) {
2425
+ function Gi(e, t) {
2426
2426
  return new e({
2427
2427
  type: "string",
2428
2428
  format: "emoji",
@@ -2431,7 +2431,7 @@ function Gr(e, t) {
2431
2431
  ...b(t)
2432
2432
  });
2433
2433
  }
2434
- function Wr(e, t) {
2434
+ function Wi(e, t) {
2435
2435
  return new e({
2436
2436
  type: "string",
2437
2437
  format: "nanoid",
@@ -2440,7 +2440,7 @@ function Wr(e, t) {
2440
2440
  ...b(t)
2441
2441
  });
2442
2442
  }
2443
- function qr(e, t) {
2443
+ function qi(e, t) {
2444
2444
  return new e({
2445
2445
  type: "string",
2446
2446
  format: "cuid",
@@ -2449,7 +2449,7 @@ function qr(e, t) {
2449
2449
  ...b(t)
2450
2450
  });
2451
2451
  }
2452
- function Kr(e, t) {
2452
+ function Ki(e, t) {
2453
2453
  return new e({
2454
2454
  type: "string",
2455
2455
  format: "cuid2",
@@ -2458,7 +2458,7 @@ function Kr(e, t) {
2458
2458
  ...b(t)
2459
2459
  });
2460
2460
  }
2461
- function Hr(e, t) {
2461
+ function Hi(e, t) {
2462
2462
  return new e({
2463
2463
  type: "string",
2464
2464
  format: "ulid",
@@ -2467,7 +2467,7 @@ function Hr(e, t) {
2467
2467
  ...b(t)
2468
2468
  });
2469
2469
  }
2470
- function Jr(e, t) {
2470
+ function Ji(e, t) {
2471
2471
  return new e({
2472
2472
  type: "string",
2473
2473
  format: "xid",
@@ -2476,7 +2476,7 @@ function Jr(e, t) {
2476
2476
  ...b(t)
2477
2477
  });
2478
2478
  }
2479
- function Yr(e, t) {
2479
+ function Yi(e, t) {
2480
2480
  return new e({
2481
2481
  type: "string",
2482
2482
  format: "ksuid",
@@ -2485,7 +2485,7 @@ function Yr(e, t) {
2485
2485
  ...b(t)
2486
2486
  });
2487
2487
  }
2488
- function Qr(e, t) {
2488
+ function Qi(e, t) {
2489
2489
  return new e({
2490
2490
  type: "string",
2491
2491
  format: "ipv4",
@@ -2494,7 +2494,7 @@ function Qr(e, t) {
2494
2494
  ...b(t)
2495
2495
  });
2496
2496
  }
2497
- function Xr(e, t) {
2497
+ function Xi(e, t) {
2498
2498
  return new e({
2499
2499
  type: "string",
2500
2500
  format: "ipv6",
@@ -2503,7 +2503,7 @@ function Xr(e, t) {
2503
2503
  ...b(t)
2504
2504
  });
2505
2505
  }
2506
- function ei(e, t) {
2506
+ function er(e, t) {
2507
2507
  return new e({
2508
2508
  type: "string",
2509
2509
  format: "cidrv4",
@@ -2512,7 +2512,7 @@ function ei(e, t) {
2512
2512
  ...b(t)
2513
2513
  });
2514
2514
  }
2515
- function ti(e, t) {
2515
+ function tr(e, t) {
2516
2516
  return new e({
2517
2517
  type: "string",
2518
2518
  format: "cidrv6",
@@ -2521,7 +2521,7 @@ function ti(e, t) {
2521
2521
  ...b(t)
2522
2522
  });
2523
2523
  }
2524
- function ni(e, t) {
2524
+ function nr(e, t) {
2525
2525
  return new e({
2526
2526
  type: "string",
2527
2527
  format: "base64",
@@ -2530,7 +2530,7 @@ function ni(e, t) {
2530
2530
  ...b(t)
2531
2531
  });
2532
2532
  }
2533
- function oi(e, t) {
2533
+ function or(e, t) {
2534
2534
  return new e({
2535
2535
  type: "string",
2536
2536
  format: "base64url",
@@ -2539,7 +2539,7 @@ function oi(e, t) {
2539
2539
  ...b(t)
2540
2540
  });
2541
2541
  }
2542
- function ri(e, t) {
2542
+ function ir(e, t) {
2543
2543
  return new e({
2544
2544
  type: "string",
2545
2545
  format: "e164",
@@ -2548,7 +2548,7 @@ function ri(e, t) {
2548
2548
  ...b(t)
2549
2549
  });
2550
2550
  }
2551
- function ii(e, t) {
2551
+ function rr(e, t) {
2552
2552
  return new e({
2553
2553
  type: "string",
2554
2554
  format: "jwt",
@@ -2557,7 +2557,7 @@ function ii(e, t) {
2557
2557
  ...b(t)
2558
2558
  });
2559
2559
  }
2560
- function si(e, t) {
2560
+ function sr(e, t) {
2561
2561
  return new e({
2562
2562
  type: "string",
2563
2563
  format: "datetime",
@@ -2568,7 +2568,7 @@ function si(e, t) {
2568
2568
  ...b(t)
2569
2569
  });
2570
2570
  }
2571
- function ai(e, t) {
2571
+ function ar(e, t) {
2572
2572
  return new e({
2573
2573
  type: "string",
2574
2574
  format: "date",
@@ -2576,7 +2576,7 @@ function ai(e, t) {
2576
2576
  ...b(t)
2577
2577
  });
2578
2578
  }
2579
- function ui(e, t) {
2579
+ function ur(e, t) {
2580
2580
  return new e({
2581
2581
  type: "string",
2582
2582
  format: "time",
@@ -2585,7 +2585,7 @@ function ui(e, t) {
2585
2585
  ...b(t)
2586
2586
  });
2587
2587
  }
2588
- function ci(e, t) {
2588
+ function cr(e, t) {
2589
2589
  return new e({
2590
2590
  type: "string",
2591
2591
  format: "duration",
@@ -2593,14 +2593,14 @@ function ci(e, t) {
2593
2593
  ...b(t)
2594
2594
  });
2595
2595
  }
2596
- function li(e, t) {
2596
+ function lr(e, t) {
2597
2597
  return new e({
2598
2598
  type: "number",
2599
2599
  checks: [],
2600
2600
  ...b(t)
2601
2601
  });
2602
2602
  }
2603
- function di(e, t) {
2603
+ function dr(e, t) {
2604
2604
  return new e({
2605
2605
  type: "number",
2606
2606
  check: "number_format",
@@ -2609,18 +2609,18 @@ function di(e, t) {
2609
2609
  ...b(t)
2610
2610
  });
2611
2611
  }
2612
- function pi(e, t) {
2612
+ function pr(e, t) {
2613
2613
  return new e({
2614
2614
  type: "null",
2615
2615
  ...b(t)
2616
2616
  });
2617
2617
  }
2618
- function hi(e) {
2618
+ function hr(e) {
2619
2619
  return new e({
2620
2620
  type: "unknown"
2621
2621
  });
2622
2622
  }
2623
- function fi(e, t) {
2623
+ function fr(e, t) {
2624
2624
  return new e({
2625
2625
  type: "never",
2626
2626
  ...b(t)
@@ -2680,35 +2680,35 @@ function _e(e, t) {
2680
2680
  });
2681
2681
  }
2682
2682
  function qt(e, t) {
2683
- return new Zo({
2683
+ return new Po({
2684
2684
  check: "length_equals",
2685
2685
  ...b(t),
2686
2686
  length: e
2687
2687
  });
2688
2688
  }
2689
- function _i(e, t) {
2690
- return new Po({
2689
+ function _r(e, t) {
2690
+ return new Zo({
2691
2691
  check: "string_format",
2692
2692
  format: "regex",
2693
2693
  ...b(t),
2694
2694
  pattern: e
2695
2695
  });
2696
2696
  }
2697
- function mi(e) {
2697
+ function mr(e) {
2698
2698
  return new xo({
2699
2699
  check: "string_format",
2700
2700
  format: "lowercase",
2701
2701
  ...b(e)
2702
2702
  });
2703
2703
  }
2704
- function vi(e) {
2704
+ function vr(e) {
2705
2705
  return new Lo({
2706
2706
  check: "string_format",
2707
2707
  format: "uppercase",
2708
2708
  ...b(e)
2709
2709
  });
2710
2710
  }
2711
- function gi(e, t) {
2711
+ function gr(e, t) {
2712
2712
  return new Ro({
2713
2713
  check: "string_format",
2714
2714
  format: "includes",
@@ -2716,7 +2716,7 @@ function gi(e, t) {
2716
2716
  includes: e
2717
2717
  });
2718
2718
  }
2719
- function yi(e, t) {
2719
+ function yr(e, t) {
2720
2720
  return new jo({
2721
2721
  check: "string_format",
2722
2722
  format: "starts_with",
@@ -2724,7 +2724,7 @@ function yi(e, t) {
2724
2724
  prefix: e
2725
2725
  });
2726
2726
  }
2727
- function bi(e, t) {
2727
+ function br(e, t) {
2728
2728
  return new No({
2729
2729
  check: "string_format",
2730
2730
  format: "ends_with",
@@ -2738,22 +2738,22 @@ function ee(e) {
2738
2738
  tx: e
2739
2739
  });
2740
2740
  }
2741
- function wi(e) {
2741
+ function wr(e) {
2742
2742
  return ee((t) => t.normalize(e));
2743
2743
  }
2744
- function Ei() {
2744
+ function Er() {
2745
2745
  return ee((e) => e.trim());
2746
2746
  }
2747
- function ki() {
2747
+ function kr() {
2748
2748
  return ee((e) => e.toLowerCase());
2749
2749
  }
2750
- function Ci() {
2750
+ function Cr() {
2751
2751
  return ee((e) => e.toUpperCase());
2752
2752
  }
2753
- function Ai() {
2753
+ function Ar() {
2754
2754
  return ee((e) => On(e));
2755
2755
  }
2756
- function Ti(e, t, n) {
2756
+ function Tr(e, t, n) {
2757
2757
  return new e({
2758
2758
  type: "array",
2759
2759
  element: t,
@@ -2763,7 +2763,7 @@ function Ti(e, t, n) {
2763
2763
  ...b(n)
2764
2764
  });
2765
2765
  }
2766
- function Si(e, t, n) {
2766
+ function Sr(e, t, n) {
2767
2767
  return new e({
2768
2768
  type: "custom",
2769
2769
  check: "custom",
@@ -2771,49 +2771,49 @@ function Si(e, t, n) {
2771
2771
  ...b(n)
2772
2772
  });
2773
2773
  }
2774
- function zi(e) {
2775
- const t = Ii((n) => (n.addIssue = (o) => {
2774
+ function zr(e) {
2775
+ const t = Ir((n) => (n.addIssue = (o) => {
2776
2776
  if (typeof o == "string")
2777
- n.issues.push(ie(o, n.value, t._zod.def));
2777
+ n.issues.push(re(o, n.value, t._zod.def));
2778
2778
  else {
2779
- const i = o;
2780
- i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = t), i.continue ?? (i.continue = !t._zod.def.abort), n.issues.push(ie(i));
2779
+ const r = o;
2780
+ r.fatal && (r.continue = !1), r.code ?? (r.code = "custom"), r.input ?? (r.input = n.value), r.inst ?? (r.inst = t), r.continue ?? (r.continue = !t._zod.def.abort), n.issues.push(re(r));
2781
2781
  }
2782
2782
  }, e(n.value, n)));
2783
2783
  return t;
2784
2784
  }
2785
- function Ii(e, t) {
2785
+ function Ir(e, t) {
2786
2786
  const n = new O({
2787
2787
  check: "custom",
2788
2788
  ...b(t)
2789
2789
  });
2790
2790
  return n._zod.check = e, n;
2791
2791
  }
2792
- const $i = /* @__PURE__ */ m("ZodISODateTime", (e, t) => {
2792
+ const $r = /* @__PURE__ */ m("ZodISODateTime", (e, t) => {
2793
2793
  Xo.init(e, t), $.init(e, t);
2794
2794
  });
2795
- function Oi(e) {
2796
- return si($i, e);
2795
+ function Or(e) {
2796
+ return sr($r, e);
2797
2797
  }
2798
- const Zi = /* @__PURE__ */ m("ZodISODate", (e, t) => {
2799
- er.init(e, t), $.init(e, t);
2798
+ const Pr = /* @__PURE__ */ m("ZodISODate", (e, t) => {
2799
+ ei.init(e, t), $.init(e, t);
2800
2800
  });
2801
- function Pi(e) {
2802
- return ai(Zi, e);
2801
+ function Zr(e) {
2802
+ return ar(Pr, e);
2803
2803
  }
2804
- const xi = /* @__PURE__ */ m("ZodISOTime", (e, t) => {
2805
- tr.init(e, t), $.init(e, t);
2804
+ const xr = /* @__PURE__ */ m("ZodISOTime", (e, t) => {
2805
+ ti.init(e, t), $.init(e, t);
2806
2806
  });
2807
- function Li(e) {
2808
- return ui(xi, e);
2807
+ function Lr(e) {
2808
+ return ur(xr, e);
2809
2809
  }
2810
- const Ri = /* @__PURE__ */ m("ZodISODuration", (e, t) => {
2811
- nr.init(e, t), $.init(e, t);
2810
+ const Rr = /* @__PURE__ */ m("ZodISODuration", (e, t) => {
2811
+ ni.init(e, t), $.init(e, t);
2812
2812
  });
2813
- function ji(e) {
2814
- return ci(Ri, e);
2813
+ function jr(e) {
2814
+ return cr(Rr, e);
2815
2815
  }
2816
- const Ni = (e, t) => {
2816
+ const Nr = (e, t) => {
2817
2817
  xt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2818
2818
  format: {
2819
2819
  value: (n) => Bn(e, n)
@@ -2825,13 +2825,13 @@ const Ni = (e, t) => {
2825
2825
  },
2826
2826
  addIssue: {
2827
2827
  value: (n) => {
2828
- e.issues.push(n), e.message = JSON.stringify(e.issues, Ze, 2);
2828
+ e.issues.push(n), e.message = JSON.stringify(e.issues, Pe, 2);
2829
2829
  }
2830
2830
  // enumerable: false,
2831
2831
  },
2832
2832
  addIssues: {
2833
2833
  value: (n) => {
2834
- e.issues.push(...n), e.message = JSON.stringify(e.issues, Ze, 2);
2834
+ e.issues.push(...n), e.message = JSON.stringify(e.issues, Pe, 2);
2835
2835
  }
2836
2836
  // enumerable: false,
2837
2837
  },
@@ -2842,14 +2842,14 @@ const Ni = (e, t) => {
2842
2842
  // enumerable: false,
2843
2843
  }
2844
2844
  });
2845
- }, P = /* @__PURE__ */ m("ZodError", Ni, {
2845
+ }, Z = /* @__PURE__ */ m("ZodError", Nr, {
2846
2846
  Parent: Error
2847
- }), Di = /* @__PURE__ */ Ue(P), Ui = /* @__PURE__ */ Fe(P), Fi = /* @__PURE__ */ ve(P), Mi = /* @__PURE__ */ ge(P), Vi = /* @__PURE__ */ qn(P), Bi = /* @__PURE__ */ Kn(P), Gi = /* @__PURE__ */ Hn(P), Wi = /* @__PURE__ */ Jn(P), qi = /* @__PURE__ */ Yn(P), Ki = /* @__PURE__ */ Qn(P), Hi = /* @__PURE__ */ Xn(P), Ji = /* @__PURE__ */ eo(P), I = /* @__PURE__ */ m("ZodType", (e, t) => (A.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(B(t, {
2847
+ }), Dr = /* @__PURE__ */ Ue(Z), Ur = /* @__PURE__ */ Fe(Z), Fr = /* @__PURE__ */ ve(Z), Mr = /* @__PURE__ */ ge(Z), Vr = /* @__PURE__ */ qn(Z), Br = /* @__PURE__ */ Kn(Z), Gr = /* @__PURE__ */ Hn(Z), Wr = /* @__PURE__ */ Jn(Z), qr = /* @__PURE__ */ Yn(Z), Kr = /* @__PURE__ */ Qn(Z), Hr = /* @__PURE__ */ Xn(Z), Jr = /* @__PURE__ */ eo(Z), I = /* @__PURE__ */ m("ZodType", (e, t) => (A.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(B(t, {
2848
2848
  checks: [
2849
2849
  ...t.checks ?? [],
2850
2850
  ...n.map((o) => typeof o == "function" ? { _zod: { check: o, def: { check: "custom" }, onattach: [] } } : o)
2851
2851
  ]
2852
- })), e.clone = (n, o) => D(e, n, o), e.brand = () => e, e.register = (n, o) => (n.add(e, o), e), e.parse = (n, o) => Di(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => Fi(e, n, o), e.parseAsync = async (n, o) => Ui(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => Mi(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => Vi(e, n, o), e.decode = (n, o) => Bi(e, n, o), e.encodeAsync = async (n, o) => Gi(e, n, o), e.decodeAsync = async (n, o) => Wi(e, n, o), e.safeEncode = (n, o) => qi(e, n, o), e.safeDecode = (n, o) => Ki(e, n, o), e.safeEncodeAsync = async (n, o) => Hi(e, n, o), e.safeDecodeAsync = async (n, o) => Ji(e, n, o), e.refine = (n, o) => e.check(Ws(n, o)), e.superRefine = (n) => e.check(qs(n)), e.overwrite = (n) => e.check(ee(n)), e.optional = () => _t(e), e.nullable = () => mt(e), e.nullish = () => _t(mt(e)), e.nonoptional = (n) => Ds(e, n), e.array = () => Es(e), e.or = (n) => G([e, n]), e.and = (n) => Ts(e, n), e.transform = (n) => vt(e, Ps(n)), e.default = (n) => Rs(e, n), e.prefault = (n) => Ns(e, n), e.catch = (n) => Fs(e, n), e.pipe = (n) => vt(e, n), e.readonly = () => Bs(e), e.describe = (n) => {
2852
+ })), e.clone = (n, o) => D(e, n, o), e.brand = () => e, e.register = (n, o) => (n.add(e, o), e), e.parse = (n, o) => Dr(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => Fr(e, n, o), e.parseAsync = async (n, o) => Ur(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => Mr(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => Vr(e, n, o), e.decode = (n, o) => Br(e, n, o), e.encodeAsync = async (n, o) => Gr(e, n, o), e.decodeAsync = async (n, o) => Wr(e, n, o), e.safeEncode = (n, o) => qr(e, n, o), e.safeDecode = (n, o) => Kr(e, n, o), e.safeEncodeAsync = async (n, o) => Hr(e, n, o), e.safeDecodeAsync = async (n, o) => Jr(e, n, o), e.refine = (n, o) => e.check(Ws(n, o)), e.superRefine = (n) => e.check(qs(n)), e.overwrite = (n) => e.check(ee(n)), e.optional = () => _t(e), e.nullable = () => mt(e), e.nullish = () => _t(mt(e)), e.nonoptional = (n) => Ds(e, n), e.array = () => Es(e), e.or = (n) => G([e, n]), e.and = (n) => Ts(e, n), e.transform = (n) => vt(e, Zs(n)), e.default = (n) => Rs(e, n), e.prefault = (n) => Ns(e, n), e.catch = (n) => Fs(e, n), e.pipe = (n) => vt(e, n), e.readonly = () => Bs(e), e.describe = (n) => {
2853
2853
  const o = e.clone();
2854
2854
  return le.add(o, { description: n }), o;
2855
2855
  }, Object.defineProperty(e, "description", {
@@ -2865,22 +2865,22 @@ const Ni = (e, t) => {
2865
2865
  }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Kt = /* @__PURE__ */ m("_ZodString", (e, t) => {
2866
2866
  Me.init(e, t), I.init(e, t);
2867
2867
  const n = e._zod.bag;
2868
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...o) => e.check(_i(...o)), e.includes = (...o) => e.check(gi(...o)), e.startsWith = (...o) => e.check(yi(...o)), e.endsWith = (...o) => e.check(bi(...o)), e.min = (...o) => e.check(_e(...o)), e.max = (...o) => e.check(Wt(...o)), e.length = (...o) => e.check(qt(...o)), e.nonempty = (...o) => e.check(_e(1, ...o)), e.lowercase = (o) => e.check(mi(o)), e.uppercase = (o) => e.check(vi(o)), e.trim = () => e.check(Ei()), e.normalize = (...o) => e.check(wi(...o)), e.toLowerCase = () => e.check(ki()), e.toUpperCase = () => e.check(Ci()), e.slugify = () => e.check(Ai());
2869
- }), Yi = /* @__PURE__ */ m("ZodString", (e, t) => {
2870
- Me.init(e, t), Kt.init(e, t), e.email = (n) => e.check(Dr(Qi, n)), e.url = (n) => e.check(Br(Xi, n)), e.jwt = (n) => e.check(ii(fs, n)), e.emoji = (n) => e.check(Gr(es, n)), e.guid = (n) => e.check(ut(pt, n)), e.uuid = (n) => e.check(Ur(de, n)), e.uuidv4 = (n) => e.check(Fr(de, n)), e.uuidv6 = (n) => e.check(Mr(de, n)), e.uuidv7 = (n) => e.check(Vr(de, n)), e.nanoid = (n) => e.check(Wr(ts, n)), e.guid = (n) => e.check(ut(pt, n)), e.cuid = (n) => e.check(qr(ns, n)), e.cuid2 = (n) => e.check(Kr(os, n)), e.ulid = (n) => e.check(Hr(rs, n)), e.base64 = (n) => e.check(ni(ds, n)), e.base64url = (n) => e.check(oi(ps, n)), e.xid = (n) => e.check(Jr(is, n)), e.ksuid = (n) => e.check(Yr(ss, n)), e.ipv4 = (n) => e.check(Qr(as, n)), e.ipv6 = (n) => e.check(Xr(us, n)), e.cidrv4 = (n) => e.check(ei(cs, n)), e.cidrv6 = (n) => e.check(ti(ls, n)), e.e164 = (n) => e.check(ri(hs, n)), e.datetime = (n) => e.check(Oi(n)), e.date = (n) => e.check(Pi(n)), e.time = (n) => e.check(Li(n)), e.duration = (n) => e.check(ji(n));
2868
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...o) => e.check(_r(...o)), e.includes = (...o) => e.check(gr(...o)), e.startsWith = (...o) => e.check(yr(...o)), e.endsWith = (...o) => e.check(br(...o)), e.min = (...o) => e.check(_e(...o)), e.max = (...o) => e.check(Wt(...o)), e.length = (...o) => e.check(qt(...o)), e.nonempty = (...o) => e.check(_e(1, ...o)), e.lowercase = (o) => e.check(mr(o)), e.uppercase = (o) => e.check(vr(o)), e.trim = () => e.check(Er()), e.normalize = (...o) => e.check(wr(...o)), e.toLowerCase = () => e.check(kr()), e.toUpperCase = () => e.check(Cr()), e.slugify = () => e.check(Ar());
2869
+ }), Yr = /* @__PURE__ */ m("ZodString", (e, t) => {
2870
+ Me.init(e, t), Kt.init(e, t), e.email = (n) => e.check(Di(Qr, n)), e.url = (n) => e.check(Bi(Xr, n)), e.jwt = (n) => e.check(rr(fs, n)), e.emoji = (n) => e.check(Gi(es, n)), e.guid = (n) => e.check(ut(pt, n)), e.uuid = (n) => e.check(Ui(de, n)), e.uuidv4 = (n) => e.check(Fi(de, n)), e.uuidv6 = (n) => e.check(Mi(de, n)), e.uuidv7 = (n) => e.check(Vi(de, n)), e.nanoid = (n) => e.check(Wi(ts, n)), e.guid = (n) => e.check(ut(pt, n)), e.cuid = (n) => e.check(qi(ns, n)), e.cuid2 = (n) => e.check(Ki(os, n)), e.ulid = (n) => e.check(Hi(is, n)), e.base64 = (n) => e.check(nr(ds, n)), e.base64url = (n) => e.check(or(ps, n)), e.xid = (n) => e.check(Ji(rs, n)), e.ksuid = (n) => e.check(Yi(ss, n)), e.ipv4 = (n) => e.check(Qi(as, n)), e.ipv6 = (n) => e.check(Xi(us, n)), e.cidrv4 = (n) => e.check(er(cs, n)), e.cidrv6 = (n) => e.check(tr(ls, n)), e.e164 = (n) => e.check(ir(hs, n)), e.datetime = (n) => e.check(Or(n)), e.date = (n) => e.check(Zr(n)), e.time = (n) => e.check(Lr(n)), e.duration = (n) => e.check(jr(n));
2871
2871
  });
2872
2872
  function Y(e) {
2873
- return Nr(Yi, e);
2873
+ return Ni(Yr, e);
2874
2874
  }
2875
2875
  const $ = /* @__PURE__ */ m("ZodStringFormat", (e, t) => {
2876
2876
  z.init(e, t), Kt.init(e, t);
2877
- }), Qi = /* @__PURE__ */ m("ZodEmail", (e, t) => {
2877
+ }), Qr = /* @__PURE__ */ m("ZodEmail", (e, t) => {
2878
2878
  Bo.init(e, t), $.init(e, t);
2879
2879
  }), pt = /* @__PURE__ */ m("ZodGUID", (e, t) => {
2880
2880
  Mo.init(e, t), $.init(e, t);
2881
2881
  }), de = /* @__PURE__ */ m("ZodUUID", (e, t) => {
2882
2882
  Vo.init(e, t), $.init(e, t);
2883
- }), Xi = /* @__PURE__ */ m("ZodURL", (e, t) => {
2883
+ }), Xr = /* @__PURE__ */ m("ZodURL", (e, t) => {
2884
2884
  Go.init(e, t), $.init(e, t);
2885
2885
  }), es = /* @__PURE__ */ m("ZodEmoji", (e, t) => {
2886
2886
  Wo.init(e, t), $.init(e, t);
@@ -2890,68 +2890,68 @@ const $ = /* @__PURE__ */ m("ZodStringFormat", (e, t) => {
2890
2890
  Ko.init(e, t), $.init(e, t);
2891
2891
  }), os = /* @__PURE__ */ m("ZodCUID2", (e, t) => {
2892
2892
  Ho.init(e, t), $.init(e, t);
2893
- }), rs = /* @__PURE__ */ m("ZodULID", (e, t) => {
2893
+ }), is = /* @__PURE__ */ m("ZodULID", (e, t) => {
2894
2894
  Jo.init(e, t), $.init(e, t);
2895
- }), is = /* @__PURE__ */ m("ZodXID", (e, t) => {
2895
+ }), rs = /* @__PURE__ */ m("ZodXID", (e, t) => {
2896
2896
  Yo.init(e, t), $.init(e, t);
2897
2897
  }), ss = /* @__PURE__ */ m("ZodKSUID", (e, t) => {
2898
2898
  Qo.init(e, t), $.init(e, t);
2899
2899
  }), as = /* @__PURE__ */ m("ZodIPv4", (e, t) => {
2900
- or.init(e, t), $.init(e, t);
2900
+ oi.init(e, t), $.init(e, t);
2901
2901
  }), us = /* @__PURE__ */ m("ZodIPv6", (e, t) => {
2902
- rr.init(e, t), $.init(e, t);
2902
+ ii.init(e, t), $.init(e, t);
2903
2903
  }), cs = /* @__PURE__ */ m("ZodCIDRv4", (e, t) => {
2904
- ir.init(e, t), $.init(e, t);
2904
+ ri.init(e, t), $.init(e, t);
2905
2905
  }), ls = /* @__PURE__ */ m("ZodCIDRv6", (e, t) => {
2906
- sr.init(e, t), $.init(e, t);
2906
+ si.init(e, t), $.init(e, t);
2907
2907
  }), ds = /* @__PURE__ */ m("ZodBase64", (e, t) => {
2908
- ar.init(e, t), $.init(e, t);
2908
+ ai.init(e, t), $.init(e, t);
2909
2909
  }), ps = /* @__PURE__ */ m("ZodBase64URL", (e, t) => {
2910
- cr.init(e, t), $.init(e, t);
2910
+ ci.init(e, t), $.init(e, t);
2911
2911
  }), hs = /* @__PURE__ */ m("ZodE164", (e, t) => {
2912
- lr.init(e, t), $.init(e, t);
2912
+ li.init(e, t), $.init(e, t);
2913
2913
  }), fs = /* @__PURE__ */ m("ZodJWT", (e, t) => {
2914
- pr.init(e, t), $.init(e, t);
2914
+ pi.init(e, t), $.init(e, t);
2915
2915
  }), Ht = /* @__PURE__ */ m("ZodNumber", (e, t) => {
2916
- Vt.init(e, t), I.init(e, t), e.gt = (o, i) => e.check(lt(o, i)), e.gte = (o, i) => e.check(Ae(o, i)), e.min = (o, i) => e.check(Ae(o, i)), e.lt = (o, i) => e.check(ct(o, i)), e.lte = (o, i) => e.check(Ce(o, i)), e.max = (o, i) => e.check(Ce(o, i)), e.int = (o) => e.check(ht(o)), e.safe = (o) => e.check(ht(o)), e.positive = (o) => e.check(lt(0, o)), e.nonnegative = (o) => e.check(Ae(0, o)), e.negative = (o) => e.check(ct(0, o)), e.nonpositive = (o) => e.check(Ce(0, o)), e.multipleOf = (o, i) => e.check(dt(o, i)), e.step = (o, i) => e.check(dt(o, i)), e.finite = () => e;
2916
+ Vt.init(e, t), I.init(e, t), e.gt = (o, r) => e.check(lt(o, r)), e.gte = (o, r) => e.check(Ae(o, r)), e.min = (o, r) => e.check(Ae(o, r)), e.lt = (o, r) => e.check(ct(o, r)), e.lte = (o, r) => e.check(Ce(o, r)), e.max = (o, r) => e.check(Ce(o, r)), e.int = (o) => e.check(ht(o)), e.safe = (o) => e.check(ht(o)), e.positive = (o) => e.check(lt(0, o)), e.nonnegative = (o) => e.check(Ae(0, o)), e.negative = (o) => e.check(ct(0, o)), e.nonpositive = (o) => e.check(Ce(0, o)), e.multipleOf = (o, r) => e.check(dt(o, r)), e.step = (o, r) => e.check(dt(o, r)), e.finite = () => e;
2917
2917
  const n = e._zod.bag;
2918
2918
  e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
2919
2919
  });
2920
- function Z(e) {
2921
- return li(Ht, e);
2920
+ function P(e) {
2921
+ return lr(Ht, e);
2922
2922
  }
2923
2923
  const _s = /* @__PURE__ */ m("ZodNumberFormat", (e, t) => {
2924
- hr.init(e, t), Ht.init(e, t);
2924
+ hi.init(e, t), Ht.init(e, t);
2925
2925
  });
2926
2926
  function ht(e) {
2927
- return di(_s, e);
2927
+ return dr(_s, e);
2928
2928
  }
2929
2929
  const ms = /* @__PURE__ */ m("ZodNull", (e, t) => {
2930
- fr.init(e, t), I.init(e, t);
2930
+ fi.init(e, t), I.init(e, t);
2931
2931
  });
2932
2932
  function vs(e) {
2933
- return pi(ms, e);
2933
+ return pr(ms, e);
2934
2934
  }
2935
2935
  const gs = /* @__PURE__ */ m("ZodUnknown", (e, t) => {
2936
- _r.init(e, t), I.init(e, t);
2936
+ _i.init(e, t), I.init(e, t);
2937
2937
  });
2938
2938
  function ft() {
2939
- return hi(gs);
2939
+ return hr(gs);
2940
2940
  }
2941
2941
  const ys = /* @__PURE__ */ m("ZodNever", (e, t) => {
2942
- mr.init(e, t), I.init(e, t);
2942
+ mi.init(e, t), I.init(e, t);
2943
2943
  });
2944
2944
  function bs(e) {
2945
- return fi(ys, e);
2945
+ return fr(ys, e);
2946
2946
  }
2947
2947
  const ws = /* @__PURE__ */ m("ZodArray", (e, t) => {
2948
- vr.init(e, t), I.init(e, t), e.element = t.element, e.min = (n, o) => e.check(_e(n, o)), e.nonempty = (n) => e.check(_e(1, n)), e.max = (n, o) => e.check(Wt(n, o)), e.length = (n, o) => e.check(qt(n, o)), e.unwrap = () => e.element;
2948
+ vi.init(e, t), I.init(e, t), e.element = t.element, e.min = (n, o) => e.check(_e(n, o)), e.nonempty = (n) => e.check(_e(1, n)), e.max = (n, o) => e.check(Wt(n, o)), e.length = (n, o) => e.check(qt(n, o)), e.unwrap = () => e.element;
2949
2949
  });
2950
2950
  function Es(e, t) {
2951
- return Ti(ws, e, t);
2951
+ return Tr(ws, e, t);
2952
2952
  }
2953
2953
  const ks = /* @__PURE__ */ m("ZodObject", (e, t) => {
2954
- yr.init(e, t), I.init(e, t), C(e, "shape", () => t.shape), e.keyof = () => $s(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ft() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ft() }), e.strict = () => e.clone({ ...e._zod.def, catchall: bs() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Nn(e, n), e.safeExtend = (n) => Dn(e, n), e.merge = (n) => Un(e, n), e.pick = (n) => Rn(e, n), e.omit = (n) => jn(e, n), e.partial = (...n) => Fn(Jt, e, n[0]), e.required = (...n) => Mn(Yt, e, n[0]);
2954
+ yi.init(e, t), I.init(e, t), C(e, "shape", () => t.shape), e.keyof = () => $s(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ft() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ft() }), e.strict = () => e.clone({ ...e._zod.def, catchall: bs() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Nn(e, n), e.safeExtend = (n) => Dn(e, n), e.merge = (n) => Un(e, n), e.pick = (n) => Rn(e, n), e.omit = (n) => jn(e, n), e.partial = (...n) => Fn(Jt, e, n[0]), e.required = (...n) => Mn(Yt, e, n[0]);
2955
2955
  });
2956
2956
  function S(e, t) {
2957
2957
  const n = {
@@ -2962,7 +2962,7 @@ function S(e, t) {
2962
2962
  return new ks(n);
2963
2963
  }
2964
2964
  const Cs = /* @__PURE__ */ m("ZodUnion", (e, t) => {
2965
- br.init(e, t), I.init(e, t), e.options = t.options;
2965
+ bi.init(e, t), I.init(e, t), e.options = t.options;
2966
2966
  });
2967
2967
  function G(e, t) {
2968
2968
  return new Cs({
@@ -2972,7 +2972,7 @@ function G(e, t) {
2972
2972
  });
2973
2973
  }
2974
2974
  const As = /* @__PURE__ */ m("ZodIntersection", (e, t) => {
2975
- wr.init(e, t), I.init(e, t);
2975
+ wi.init(e, t), I.init(e, t);
2976
2976
  });
2977
2977
  function Ts(e, t) {
2978
2978
  return new As({
@@ -2982,22 +2982,22 @@ function Ts(e, t) {
2982
2982
  });
2983
2983
  }
2984
2984
  const Ss = /* @__PURE__ */ m("ZodTuple", (e, t) => {
2985
- Er.init(e, t), I.init(e, t), e.rest = (n) => e.clone({
2985
+ Ei.init(e, t), I.init(e, t), e.rest = (n) => e.clone({
2986
2986
  ...e._zod.def,
2987
2987
  rest: n
2988
2988
  });
2989
2989
  });
2990
2990
  function L(e, t, n) {
2991
- const o = t instanceof A, i = o ? n : t, a = o ? t : null;
2991
+ const o = t instanceof A, r = o ? n : t, a = o ? t : null;
2992
2992
  return new Ss({
2993
2993
  type: "tuple",
2994
2994
  items: e,
2995
2995
  rest: a,
2996
- ...b(i)
2996
+ ...b(r)
2997
2997
  });
2998
2998
  }
2999
2999
  const zs = /* @__PURE__ */ m("ZodRecord", (e, t) => {
3000
- kr.init(e, t), I.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType;
3000
+ ki.init(e, t), I.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType;
3001
3001
  });
3002
3002
  function Is(e, t, n) {
3003
3003
  return new zs({
@@ -3008,9 +3008,9 @@ function Is(e, t, n) {
3008
3008
  });
3009
3009
  }
3010
3010
  const xe = /* @__PURE__ */ m("ZodEnum", (e, t) => {
3011
- Cr.init(e, t), I.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
3011
+ Ci.init(e, t), I.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
3012
3012
  const n = new Set(Object.keys(t.entries));
3013
- e.extract = (o, i) => {
3013
+ e.extract = (o, r) => {
3014
3014
  const a = {};
3015
3015
  for (const c of o)
3016
3016
  if (n.has(c))
@@ -3020,10 +3020,10 @@ const xe = /* @__PURE__ */ m("ZodEnum", (e, t) => {
3020
3020
  return new xe({
3021
3021
  ...t,
3022
3022
  checks: [],
3023
- ...b(i),
3023
+ ...b(r),
3024
3024
  entries: a
3025
3025
  });
3026
- }, e.exclude = (o, i) => {
3026
+ }, e.exclude = (o, r) => {
3027
3027
  const a = { ...t.entries };
3028
3028
  for (const c of o)
3029
3029
  if (n.has(c))
@@ -3033,7 +3033,7 @@ const xe = /* @__PURE__ */ m("ZodEnum", (e, t) => {
3033
3033
  return new xe({
3034
3034
  ...t,
3035
3035
  checks: [],
3036
- ...b(i),
3036
+ ...b(r),
3037
3037
  entries: a
3038
3038
  });
3039
3039
  };
@@ -3047,7 +3047,7 @@ function $s(e, t) {
3047
3047
  });
3048
3048
  }
3049
3049
  const Os = /* @__PURE__ */ m("ZodLiteral", (e, t) => {
3050
- Ar.init(e, t), I.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
3050
+ Ai.init(e, t), I.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
3051
3051
  get() {
3052
3052
  if (t.values.length > 1)
3053
3053
  throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
@@ -3062,30 +3062,30 @@ function R(e, t) {
3062
3062
  ...b(t)
3063
3063
  });
3064
3064
  }
3065
- const Zs = /* @__PURE__ */ m("ZodTransform", (e, t) => {
3066
- Tr.init(e, t), I.init(e, t), e._zod.parse = (n, o) => {
3065
+ const Ps = /* @__PURE__ */ m("ZodTransform", (e, t) => {
3066
+ Ti.init(e, t), I.init(e, t), e._zod.parse = (n, o) => {
3067
3067
  if (o.direction === "backward")
3068
3068
  throw new It(e.constructor.name);
3069
3069
  n.addIssue = (a) => {
3070
3070
  if (typeof a == "string")
3071
- n.issues.push(ie(a, n.value, t));
3071
+ n.issues.push(re(a, n.value, t));
3072
3072
  else {
3073
3073
  const c = a;
3074
- c.fatal && (c.continue = !1), c.code ?? (c.code = "custom"), c.input ?? (c.input = n.value), c.inst ?? (c.inst = e), n.issues.push(ie(c));
3074
+ c.fatal && (c.continue = !1), c.code ?? (c.code = "custom"), c.input ?? (c.input = n.value), c.inst ?? (c.inst = e), n.issues.push(re(c));
3075
3075
  }
3076
3076
  };
3077
- const i = t.transform(n.value, n);
3078
- return i instanceof Promise ? i.then((a) => (n.value = a, n)) : (n.value = i, n);
3077
+ const r = t.transform(n.value, n);
3078
+ return r instanceof Promise ? r.then((a) => (n.value = a, n)) : (n.value = r, n);
3079
3079
  };
3080
3080
  });
3081
- function Ps(e) {
3082
- return new Zs({
3081
+ function Zs(e) {
3082
+ return new Ps({
3083
3083
  type: "transform",
3084
3084
  transform: e
3085
3085
  });
3086
3086
  }
3087
3087
  const Jt = /* @__PURE__ */ m("ZodOptional", (e, t) => {
3088
- Sr.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3088
+ Si.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3089
3089
  });
3090
3090
  function _t(e) {
3091
3091
  return new Jt({
@@ -3094,7 +3094,7 @@ function _t(e) {
3094
3094
  });
3095
3095
  }
3096
3096
  const xs = /* @__PURE__ */ m("ZodNullable", (e, t) => {
3097
- zr.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3097
+ zi.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3098
3098
  });
3099
3099
  function mt(e) {
3100
3100
  return new xs({
@@ -3103,31 +3103,31 @@ function mt(e) {
3103
3103
  });
3104
3104
  }
3105
3105
  const Ls = /* @__PURE__ */ m("ZodDefault", (e, t) => {
3106
- Ir.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3106
+ Ii.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3107
3107
  });
3108
3108
  function Rs(e, t) {
3109
3109
  return new Ls({
3110
3110
  type: "default",
3111
3111
  innerType: e,
3112
3112
  get defaultValue() {
3113
- return typeof t == "function" ? t() : Zt(t);
3113
+ return typeof t == "function" ? t() : Pt(t);
3114
3114
  }
3115
3115
  });
3116
3116
  }
3117
3117
  const js = /* @__PURE__ */ m("ZodPrefault", (e, t) => {
3118
- $r.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3118
+ $i.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3119
3119
  });
3120
3120
  function Ns(e, t) {
3121
3121
  return new js({
3122
3122
  type: "prefault",
3123
3123
  innerType: e,
3124
3124
  get defaultValue() {
3125
- return typeof t == "function" ? t() : Zt(t);
3125
+ return typeof t == "function" ? t() : Pt(t);
3126
3126
  }
3127
3127
  });
3128
3128
  }
3129
3129
  const Yt = /* @__PURE__ */ m("ZodNonOptional", (e, t) => {
3130
- Or.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3130
+ Oi.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3131
3131
  });
3132
3132
  function Ds(e, t) {
3133
3133
  return new Yt({
@@ -3137,7 +3137,7 @@ function Ds(e, t) {
3137
3137
  });
3138
3138
  }
3139
3139
  const Us = /* @__PURE__ */ m("ZodCatch", (e, t) => {
3140
- Zr.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3140
+ Pi.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3141
3141
  });
3142
3142
  function Fs(e, t) {
3143
3143
  return new Us({
@@ -3147,7 +3147,7 @@ function Fs(e, t) {
3147
3147
  });
3148
3148
  }
3149
3149
  const Ms = /* @__PURE__ */ m("ZodPipe", (e, t) => {
3150
- Pr.init(e, t), I.init(e, t), e.in = t.in, e.out = t.out;
3150
+ Zi.init(e, t), I.init(e, t), e.in = t.in, e.out = t.out;
3151
3151
  });
3152
3152
  function vt(e, t) {
3153
3153
  return new Ms({
@@ -3158,7 +3158,7 @@ function vt(e, t) {
3158
3158
  });
3159
3159
  }
3160
3160
  const Vs = /* @__PURE__ */ m("ZodReadonly", (e, t) => {
3161
- xr.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3161
+ xi.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
3162
3162
  });
3163
3163
  function Bs(e) {
3164
3164
  return new Vs({
@@ -3167,22 +3167,22 @@ function Bs(e) {
3167
3167
  });
3168
3168
  }
3169
3169
  const Gs = /* @__PURE__ */ m("ZodCustom", (e, t) => {
3170
- Lr.init(e, t), I.init(e, t);
3170
+ Li.init(e, t), I.init(e, t);
3171
3171
  });
3172
3172
  function Ws(e, t = {}) {
3173
- return Si(Gs, e, t);
3173
+ return Sr(Gs, e, t);
3174
3174
  }
3175
3175
  function qs(e) {
3176
- return zi(e);
3176
+ return zr(e);
3177
3177
  }
3178
3178
  const be = S({
3179
- t: Z().gte(0),
3180
- rate: Z().gte(0)
3179
+ t: P().gte(0),
3180
+ rate: P().gte(0)
3181
3181
  }), Q = S({
3182
- opacity: Z().gte(0).lte(1),
3183
- zIndex: Z()
3182
+ opacity: P().gte(0).lte(1),
3183
+ zIndex: P()
3184
3184
  }), X = S({
3185
- volume: Z().gte(0).lte(1)
3185
+ volume: P().gte(0).lte(1)
3186
3186
  }), Ks = S({
3187
3187
  type: R("image"),
3188
3188
  file: Y(),
@@ -3196,15 +3196,15 @@ const be = S({
3196
3196
  file: Y(),
3197
3197
  audioOutput: Y(),
3198
3198
  fit: G([R("contain"), R("cover"), R("none")])
3199
- }), Ve = L([Z(), vs()]), Ys = L([
3200
- Z(),
3199
+ }), Ve = L([P(), vs()]), Ys = L([
3200
+ P(),
3201
3201
  S({
3202
3202
  set: S({
3203
3203
  ...Q.shape
3204
3204
  }).partial()
3205
3205
  }).partial()
3206
3206
  ]), Qs = L([
3207
- Z(),
3207
+ P(),
3208
3208
  S({
3209
3209
  set: S({
3210
3210
  ...Q.shape
@@ -3214,7 +3214,7 @@ const be = S({
3214
3214
  }).partial()
3215
3215
  }).partial()
3216
3216
  ]), Xs = L([
3217
- Z(),
3217
+ P(),
3218
3218
  S({
3219
3219
  set: S({
3220
3220
  ...be.shape,
@@ -3222,7 +3222,7 @@ const be = S({
3222
3222
  }).partial()
3223
3223
  }).partial()
3224
3224
  ]), ea = L([
3225
- Z(),
3225
+ P(),
3226
3226
  S({
3227
3227
  set: S({
3228
3228
  ...be.shape,
@@ -3233,7 +3233,7 @@ const be = S({
3233
3233
  }).partial()
3234
3234
  }).partial()
3235
3235
  ]), ta = L([
3236
- Z(),
3236
+ P(),
3237
3237
  S({
3238
3238
  set: S({
3239
3239
  ...be.shape,
@@ -3242,7 +3242,7 @@ const be = S({
3242
3242
  }).partial()
3243
3243
  }).partial()
3244
3244
  ]), na = L([
3245
- Z(),
3245
+ P(),
3246
3246
  S({
3247
3247
  set: S({
3248
3248
  ...be.shape,
@@ -3257,79 +3257,79 @@ const be = S({
3257
3257
  ]), oa = S({
3258
3258
  ...Ks.shape,
3259
3259
  keyframes: L([Qs], G([Ys, Ve]))
3260
- }), ra = S({
3260
+ }), ia = S({
3261
3261
  ...Hs.shape,
3262
3262
  keyframes: L([ea], G([Xs, Ve]))
3263
- }), ia = S({
3263
+ }), ra = S({
3264
3264
  ...Js.shape,
3265
3265
  keyframes: L([na], G([ta, Ve]))
3266
- }), sa = Is(Y(), G([oa, ra, ia])), me = {
3266
+ }), sa = Is(Y(), G([oa, ia, ra])), me = {
3267
3267
  opacity: 1,
3268
3268
  zIndex: 0
3269
3269
  }, we = {
3270
3270
  t: 0,
3271
3271
  rate: 1,
3272
3272
  volume: 1
3273
- }, re = {
3273
+ }, ie = {
3274
3274
  t: 0,
3275
3275
  rate: 1,
3276
3276
  volume: 1,
3277
3277
  opacity: 1,
3278
3278
  zIndex: 0
3279
- }, Ia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3279
+ }, $a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3280
3280
  __proto__: null,
3281
3281
  MediaSurfaceStateSchema: sa,
3282
3282
  defaultAudioOptions: we,
3283
3283
  defaultImageOptions: me,
3284
- defaultVideoOptions: re
3284
+ defaultVideoOptions: ie
3285
3285
  }, Symbol.toStringTag, { value: "Module" }));
3286
3286
  function Ee(e, t) {
3287
3287
  switch (e.type) {
3288
3288
  case "image": {
3289
3289
  if (e.keyframes[0][0] > t)
3290
3290
  return;
3291
- const o = e.keyframes.filter((a) => a[1] !== null), i = Te(o, t);
3292
- return { ...me, ...i };
3291
+ const o = e.keyframes.filter((a) => a[1] !== null), r = Te(o, t);
3292
+ return { ...me, ...r };
3293
3293
  }
3294
3294
  case "audio": {
3295
3295
  const n = e.keyframes.filter((a) => a[1] !== null), o = gt(n, t);
3296
3296
  if (!o)
3297
3297
  return;
3298
- const i = Te(n, t);
3299
- return { ...we, ...i, ...o };
3298
+ const r = Te(n, t);
3299
+ return { ...we, ...r, ...o };
3300
3300
  }
3301
3301
  case "video": {
3302
3302
  const n = e.keyframes.filter((a) => a[1] !== null), o = gt(n, t);
3303
3303
  if (!o)
3304
3304
  return;
3305
- const i = Te(n, t);
3306
- return { ...re, ...i, ...o };
3305
+ const r = Te(n, t);
3306
+ return { ...ie, ...r, ...o };
3307
3307
  }
3308
3308
  }
3309
3309
  }
3310
3310
  function Te(e, t) {
3311
3311
  const n = {};
3312
- for (const [i, a] of e)
3313
- i <= t ? (Object.entries(a.lerp ?? {}).forEach(([c, l]) => {
3314
- n[c] ??= {}, n[c].before = [i, l];
3312
+ for (const [r, a] of e)
3313
+ r <= t ? (Object.entries(a.lerp ?? {}).forEach(([c, l]) => {
3314
+ n[c] ??= {}, n[c].before = [r, l];
3315
3315
  }), Object.entries(a.set ?? {}).forEach(([c, l]) => {
3316
- n[c] ??= {}, n[c].before = [i, l];
3316
+ n[c] ??= {}, n[c].before = [r, l];
3317
3317
  })) : Object.entries(a.lerp ?? {}).forEach(([c, l]) => {
3318
- n[c] ??= {}, n[c].after === void 0 && (n[c].after = [i, l]);
3318
+ n[c] ??= {}, n[c].after === void 0 && (n[c].after = [r, l]);
3319
3319
  });
3320
3320
  const o = {};
3321
3321
  return Object.entries(n).forEach(
3322
- ([i, { before: a, after: c }]) => {
3322
+ ([r, { before: a, after: c }]) => {
3323
3323
  if (c === void 0 && a) {
3324
- o[i] = a[1];
3324
+ o[r] = a[1];
3325
3325
  return;
3326
3326
  }
3327
3327
  if (a && c && a[0] === c[0]) {
3328
- o[i] = c[1];
3328
+ o[r] = c[1];
3329
3329
  return;
3330
3330
  }
3331
3331
  if (a && typeof a[1] == "number" && c && typeof c[1] == "number") {
3332
- o[i] = a[1] + (t - a[0]) * (c[1] - a[1]) / (c[0] - a[0]);
3332
+ o[r] = a[1] + (t - a[0]) * (c[1] - a[1]) / (c[0] - a[0]);
3333
3333
  return;
3334
3334
  }
3335
3335
  }
@@ -3339,22 +3339,22 @@ function gt(e, t) {
3339
3339
  const n = e[0];
3340
3340
  if (!n || n[0] > t)
3341
3341
  return;
3342
- let o = 0, { t: i, rate: a } = we;
3342
+ let o = 0, { t: r, rate: a } = we;
3343
3343
  for (const [f, y] of e) {
3344
3344
  if (f > t) break;
3345
3345
  const { set: g } = y;
3346
3346
  if (!g) continue;
3347
- const { t: r, rate: s } = g;
3348
- if (r !== void 0) {
3349
- o = f, i = r, s !== void 0 && (a = s);
3347
+ const { t: i, rate: s } = g;
3348
+ if (i !== void 0) {
3349
+ o = f, r = i, s !== void 0 && (a = s);
3350
3350
  continue;
3351
3351
  }
3352
3352
  if (s !== void 0) {
3353
3353
  const p = (f - o) * a;
3354
- o = f, i += p, a = s;
3354
+ o = f, r += p, a = s;
3355
3355
  }
3356
3356
  }
3357
- const l = (t - o) * a, d = i + l;
3357
+ const l = (t - o) * a, d = r + l;
3358
3358
  return {
3359
3359
  rate: a,
3360
3360
  t: d
@@ -3362,8 +3362,8 @@ function gt(e, t) {
3362
3362
  }
3363
3363
  const aa = 1e3;
3364
3364
  class Be {
3365
- constructor(t, n, o, i) {
3366
- this.surfaceElement = t, this.clipElement = n, this.constructAssetURL = i, this._state = o, setTimeout(this.loop);
3365
+ constructor(t, n, o, r) {
3366
+ this.surfaceElement = t, this.clipElement = n, this.constructAssetURL = r, this._state = o, setTimeout(this.loop);
3367
3367
  }
3368
3368
  /**
3369
3369
  * This is the delay to be used in the update loop.
@@ -3375,6 +3375,8 @@ class Be {
3375
3375
  }
3376
3376
  _state;
3377
3377
  setState(t) {
3378
+ if (this._state.file !== t.file)
3379
+ throw new Error(`Cannot change from ${this._state.file} to ${t.file}. Create a new clip instead.`);
3378
3380
  this._state = t, clearTimeout(this.timeout), this.loop();
3379
3381
  }
3380
3382
  timeout;
@@ -3384,8 +3386,8 @@ class Be {
3384
3386
  }
3385
3387
  class ua extends Be {
3386
3388
  imageElement;
3387
- constructor(t, n, o, i) {
3388
- super(t, n, o, i), this.clipElement = n;
3389
+ constructor(t, n, o, r) {
3390
+ super(t, n, o, r), this.clipElement = n;
3389
3391
  }
3390
3392
  updateImageElement() {
3391
3393
  this.imageElement = document.createElement("img"), this.clipElement.replaceChildren(this.imageElement), this.imageElement.style.position = "absolute", this.imageElement.style.height = "100%", this.imageElement.style.widows = "100%";
@@ -3397,8 +3399,8 @@ class ua extends Be {
3397
3399
  this.imageElement.src.includes(n) || (this.imageElement.src = n), this.imageElement.style.objectFit !== this._state.fit && (this.imageElement.style.objectFit = this._state.fit), parseFloat(this.imageElement.style.opacity) !== t.opacity && (this.imageElement.style.opacity = String(t.opacity ?? me.opacity));
3398
3400
  const o = Math.round(t.zIndex ?? me.zIndex);
3399
3401
  parseInt(this.imageElement.style.zIndex) !== o && (this.imageElement.style.zIndex = String(o));
3400
- const { opacity: i } = t;
3401
- typeof i == "string" && i !== this.imageElement.style.opacity && (this.imageElement.style.opacity = i);
3402
+ const { opacity: r } = t;
3403
+ typeof r == "string" && r !== this.imageElement.style.opacity && (this.imageElement.style.opacity = r);
3402
3404
  }
3403
3405
  destroy() {
3404
3406
  this.imageElement?.remove();
@@ -3412,24 +3414,25 @@ const fa = 5;
3412
3414
  function _a(e, t, n) {
3413
3415
  const o = Ee(e, t);
3414
3416
  if (!o) return !1;
3415
- const { t: i, rate: a } = o;
3416
- if (i === void 0 || a === void 0) return !1;
3417
+ const { t: r, rate: a } = o;
3418
+ if (r === void 0 || a === void 0) return !1;
3417
3419
  const c = e.keyframes.filter(([f, y]) => f > t && (y?.set?.t !== void 0 || y?.set?.rate !== void 0))[0];
3418
3420
  if (c?.[1]?.set?.t !== 0) return !1;
3419
- const l = (n - i) / a, d = c[0] - t;
3421
+ const l = (n - r) / a, d = c[0] - t;
3420
3422
  return Math.abs(l - d) <= fa;
3421
3423
  }
3422
3424
  class ma extends Be {
3425
+ constructor(t, n, o, r, a) {
3426
+ super(t, n, o, r), this.mediaPreloader = a, this.clipElement = n;
3427
+ }
3423
3428
  videoElement;
3424
3429
  // We seek to another part of the video and do nothing until we get there
3425
3430
  isSeeking = !1;
3426
3431
  // We change playbackRate to intercept the server time of the video and don't change course until we intercept
3427
3432
  timeToIntercept = void 0;
3428
- constructor(t, n, o, i) {
3429
- super(t, n, o, i), this.clipElement = n;
3430
- }
3431
3433
  updateVideoElement() {
3432
- this.destroy(), this.videoElement = document.createElement("video"), this.clipElement.replaceChildren(this.videoElement), this.videoElement.style.position = "absolute", this.videoElement.style.width = "100%", this.videoElement.style.height = "100%";
3434
+ const t = this.mediaPreloader.getElement(this._state.file, "video");
3435
+ this.videoElement = t, this.clipElement.replaceChildren(this.videoElement), this.videoElement.style.position = "absolute", this.videoElement.style.width = "100%", this.videoElement.style.height = "100%";
3433
3436
  }
3434
3437
  get videoDuration() {
3435
3438
  if (this.videoElement && !(this.videoElement.readyState < HTMLMediaElement.HAVE_METADATA))
@@ -3452,9 +3455,9 @@ class ma extends Be {
3452
3455
  if (this.isSeeking) return;
3453
3456
  const t = Date.now(), n = Ee(this._state, t);
3454
3457
  if (n ? (!this.videoElement || !this.isConnected(this.videoElement)) && this.updateVideoElement() : (this.videoElement?.remove(), this.videoElement = void 0), !n || !this.videoElement) return;
3455
- const { t: o, rate: i, volume: a } = { ...re, ...n }, c = this.constructAssetURL(this._state.file);
3456
- this.videoElement.src.includes(c) || (this.videoElement.src = c), this.videoElement.style.objectFit !== this._state.fit && (this.videoElement.style.objectFit = this._state.fit), parseFloat(this.videoElement.style.opacity) !== n.opacity && (this.videoElement.style.opacity = String(n.opacity ?? re.opacity));
3457
- const l = Math.round(n.zIndex ?? re.zIndex);
3458
+ const { t: o, rate: r, volume: a } = { ...ie, ...n }, c = this.constructAssetURL(this._state.file);
3459
+ this.videoElement.src.includes(c) || this.updateVideoElement(), this.videoElement.style.objectFit !== this._state.fit && (this.videoElement.style.objectFit = this._state.fit), parseFloat(this.videoElement.style.opacity) !== n.opacity && (this.videoElement.style.opacity = String(n.opacity ?? ie.opacity));
3460
+ const l = Math.round(n.zIndex ?? ie.zIndex);
3458
3461
  parseInt(this.videoElement.style.zIndex) !== l && (this.videoElement.style.zIndex = String(l)), this.videoElement.volume !== a && (this.videoElement.volume = a);
3459
3462
  const d = this.videoDuration;
3460
3463
  if (d !== void 0) {
@@ -3465,37 +3468,37 @@ class ma extends Be {
3465
3468
  return;
3466
3469
  }
3467
3470
  }
3468
- this.videoElement.paused && i > 0 && (d === void 0 || d > o) && this.videoElement.play().catch(() => {
3471
+ this.videoElement.paused && r > 0 && (d === void 0 || d > o) && this.videoElement.play().catch(() => {
3469
3472
  });
3470
3473
  const y = this.videoElement.currentTime * 1e3 - o, g = Math.abs(y);
3471
3474
  if (this.timeToIntercept !== void 0)
3472
3475
  if (g <= Se)
3473
3476
  console.log("intercepted", `${y.toFixed(0)}ms`), this.timeToIntercept = void 0;
3474
3477
  else {
3475
- const r = y / (i - this.videoElement.playbackRate);
3476
- r < this.timeToIntercept && r > 0 ? (console.debug(`intercepting ${r.toFixed(0)}ms`, `${y.toFixed(0)}ms`), this.timeToIntercept = r) : (console.debug("missed intercept", y, this.timeToIntercept, r), this.timeToIntercept = void 0);
3478
+ const i = y / (r - this.videoElement.playbackRate);
3479
+ i < this.timeToIntercept && i > 0 ? (console.debug(`intercepting ${i.toFixed(0)}ms`, `${y.toFixed(0)}ms`), this.timeToIntercept = i) : (console.debug("missed intercept", y, this.timeToIntercept, i), this.timeToIntercept = void 0);
3477
3480
  }
3478
3481
  switch (!0) {
3479
3482
  case g <= Se: {
3480
- console.debug(`${i}x`, y.toFixed(0)), this.timeToIntercept = void 0, this.videoElement.playbackRate !== i && (this.videoElement.playbackRate = i), this.delay = ca;
3483
+ console.debug(`${r}x`, y.toFixed(0)), this.timeToIntercept = void 0, this.videoElement.playbackRate !== r && (this.videoElement.playbackRate = r), this.delay = ca;
3481
3484
  break;
3482
3485
  }
3483
3486
  case this.timeToIntercept !== void 0:
3484
3487
  this.delay = this.timeToIntercept * yt;
3485
3488
  break;
3486
- case (i > 0 && g > Se && g <= Qt && this.timeToIntercept === void 0): {
3487
- const r = ha(y), s = Math.max(0, i + r);
3488
- this.timeToIntercept = y / (i - s), console.debug(`${s.toFixed(2)}x`, `${y.toFixed(0)}ms`), this.videoElement.playbackRate !== s && (this.videoElement.playbackRate = s), this.delay = this.timeToIntercept * yt;
3489
+ case (r > 0 && g > Se && g <= Qt && this.timeToIntercept === void 0): {
3490
+ const i = ha(y), s = Math.max(0, r + i);
3491
+ this.timeToIntercept = y / (r - s), console.debug(`${s.toFixed(2)}x`, `${y.toFixed(0)}ms`), this.videoElement.playbackRate !== s && (this.videoElement.playbackRate = s), this.delay = this.timeToIntercept * yt;
3489
3492
  break;
3490
3493
  }
3491
3494
  default: {
3492
- this.videoElement.playbackRate !== i && (this.videoElement.playbackRate = i), console.debug("seeking"), this.delay = 10, this.seekTo(o + i * la);
3495
+ this.videoElement.playbackRate !== r && (this.videoElement.playbackRate = r), console.debug("seeking"), this.delay = 10, this.seekTo(o + r * la);
3493
3496
  break;
3494
3497
  }
3495
3498
  }
3496
3499
  }
3497
3500
  destroy() {
3498
- this.videoElement && (this.videoElement.src = "", this.videoElement.remove());
3501
+ this.videoElement && (this.mediaPreloader.releaseElement(this.videoElement), this.videoElement.remove());
3499
3502
  }
3500
3503
  }
3501
3504
  const va = 1e3, bt = 10, Xt = 1e3, ga = 200, ya = 0.2, ba = 0.5;
@@ -3503,13 +3506,14 @@ function wa(e) {
3503
3506
  return Math.sign(e) * Math.pow(Math.abs(e) / Xt, ba) * ya;
3504
3507
  }
3505
3508
  class Ea extends Be {
3509
+ constructor(t, n, o, r, a) {
3510
+ super(t, n, o, r), this.mediaPreloader = a, this.clipElement = n;
3511
+ }
3506
3512
  audioElement;
3507
3513
  isSeeking = !1;
3508
- constructor(t, n, o, i) {
3509
- super(t, n, o, i), this.clipElement = n;
3510
- }
3511
3514
  updateAudioElement() {
3512
- this.destroy(), this.audioElement = document.createElement("audio"), this.clipElement.replaceChildren(this.audioElement);
3515
+ const t = this.mediaPreloader.getElement(this._state.file, "audio");
3516
+ this.audioElement = t, this.clipElement.replaceChildren(this.audioElement);
3513
3517
  }
3514
3518
  /**
3515
3519
  * Helper function to seek to a specified time.
@@ -3529,8 +3533,8 @@ class Ea extends Be {
3529
3533
  this.delay = va;
3530
3534
  const t = Ee(this._state, Date.now());
3531
3535
  if (t ? (!this.audioElement || !this.isConnected(this.audioElement)) && this.updateAudioElement() : this.destroy(), !t || !this.audioElement) return;
3532
- const { t: n, rate: o, volume: i } = { ...we, ...t }, a = this.constructAssetURL(this._state.file);
3533
- this.audioElement.src.includes(a) || (this.audioElement.src = a), this.audioElement.volume !== i && (this.audioElement.volume = i), this.audioElement.paused && o > 0 && this.audioElement.play().catch(() => {
3536
+ const { t: n, rate: o, volume: r } = { ...we, ...t }, a = this.constructAssetURL(this._state.file);
3537
+ this.audioElement.src.includes(a) || this.updateAudioElement(), this.audioElement.volume !== r && (this.audioElement.volume = r), this.audioElement.paused && o > 0 && this.audioElement.play().catch(() => {
3534
3538
  });
3535
3539
  const l = this.audioElement.currentTime * 1e3 - n, d = Math.abs(l);
3536
3540
  switch (this.delay = 100, !0) {
@@ -3549,13 +3553,66 @@ class Ea extends Be {
3549
3553
  }
3550
3554
  }
3551
3555
  destroy() {
3552
- this.audioElement && (this.audioElement.src = "", this.audioElement.remove());
3556
+ this.audioElement && this.audioElement.remove();
3553
3557
  }
3554
3558
  }
3555
- const ka = "data-clip-id";
3556
- class $a {
3557
- constructor(t, n) {
3558
- this.constructAssetUrl = t, this._element = document.createElement("div"), this._element.className = "surface-manager", this._element.style.width = "100%", this._element.style.height = "100%", this._state = n || {}, this.update();
3559
+ class ka {
3560
+ _state;
3561
+ _elements = {};
3562
+ _constructAssetURL;
3563
+ constructor(t, n = {}) {
3564
+ this._constructAssetURL = t, this._state = n;
3565
+ }
3566
+ get state() {
3567
+ return { ...this._state };
3568
+ }
3569
+ setState(t) {
3570
+ this._state = t, this.update();
3571
+ }
3572
+ update() {
3573
+ for (const [t, n] of Object.entries(this._elements))
3574
+ t in this._state || (n.element.src = "", delete this._elements[t]), n.inUse = n.element.isConnected;
3575
+ for (const [t, n] of Object.entries(this._state)) {
3576
+ if (t in this._elements)
3577
+ continue;
3578
+ let o;
3579
+ switch (n.preload === !0 ? o = "auto" : n.preload === !1 ? o = "none" : o = n.preload, n.type) {
3580
+ case "audio": {
3581
+ const r = document.createElement("audio");
3582
+ r.src = this._constructAssetURL(t), r.preload = o, this._elements[t] = { element: r, inUse: !1, type: "audio" };
3583
+ break;
3584
+ }
3585
+ case "video": {
3586
+ const r = document.createElement("video");
3587
+ r.src = this._constructAssetURL(t), r.preload = o, this._elements[t] = { element: r, inUse: !1, type: "video" };
3588
+ break;
3589
+ }
3590
+ }
3591
+ }
3592
+ }
3593
+ getElement(t, n) {
3594
+ const o = this._elements[t];
3595
+ if (o && o.inUse === !1)
3596
+ return o.inUse = !0, o.element;
3597
+ {
3598
+ const r = document.createElement(n);
3599
+ return r.src = this._constructAssetURL(t), this._elements[t] = { element: r, type: n, inUse: !0 }, r;
3600
+ }
3601
+ }
3602
+ releaseElement(t) {
3603
+ if (typeof t == "string") {
3604
+ const n = this._elements[t];
3605
+ n && (n.inUse = !1);
3606
+ } else
3607
+ Object.entries(this._elements).forEach(([n, o]) => {
3608
+ o.element === t && delete this._elements[n];
3609
+ });
3610
+ }
3611
+ }
3612
+ const Ca = "data-clip-id";
3613
+ class Oa {
3614
+ constructor(t, n = {}, o = new ka(t)) {
3615
+ this.constructAssetUrl = t, this.mediaPreloader = o, this._element = document.createElement("div"), this._element.className = "surface-manager", this._element.style.width = "100%", this._element.style.height = "100%", this._state = n || {}, this.update();
3559
3616
  }
3560
3617
  _state = {};
3561
3618
  setState(t) {
@@ -3567,41 +3624,41 @@ class $a {
3567
3624
  }
3568
3625
  resources = {};
3569
3626
  update() {
3570
- Object.entries(this.resources).forEach(([n, { element: o, manager: i }]) => {
3571
- n in this._state || (delete this.resources[n], o.remove(), i?.destroy());
3627
+ Object.entries(this.resources).forEach(([n, { element: o, manager: r }]) => {
3628
+ n in this._state || (delete this.resources[n], o.remove(), r?.destroy());
3572
3629
  });
3573
3630
  const t = Object.keys(this._state).toSorted().map((n) => {
3574
3631
  const o = this.resources[n];
3575
3632
  if (o)
3576
3633
  return o.element;
3577
3634
  {
3578
- const i = document.createElement("div");
3579
- return i.setAttribute(ka, n), this.resources[n] = { element: i }, i;
3635
+ const r = document.createElement("div");
3636
+ return r.setAttribute(Ca, n), this.resources[n] = { element: r }, r;
3580
3637
  }
3581
3638
  });
3582
3639
  this._element.replaceChildren(...t), Object.keys(this._state).toSorted().forEach((n) => {
3583
- const o = this._state[n], i = this.resources[n];
3584
- if (!i)
3640
+ const o = this._state[n], r = this.resources[n];
3641
+ if (!r)
3585
3642
  throw new Error("Failed to create resource");
3586
- if (i.manager)
3587
- i.manager.setState(o);
3643
+ if (r.manager)
3644
+ r.manager.setState(o);
3588
3645
  else
3589
3646
  switch (o.type) {
3590
3647
  case "image":
3591
- i.manager = new ua(this._element, i.element, o, this.constructAssetUrl);
3648
+ r.manager = new ua(this._element, r.element, o, this.constructAssetUrl);
3592
3649
  break;
3593
3650
  case "audio":
3594
- i.manager = new Ea(this._element, i.element, o, this.constructAssetUrl);
3651
+ r.manager = new Ea(this._element, r.element, o, this.constructAssetUrl, this.mediaPreloader);
3595
3652
  break;
3596
3653
  case "video":
3597
- i.manager = new ma(this._element, i.element, o, this.constructAssetUrl);
3654
+ r.manager = new ma(this._element, r.element, o, this.constructAssetUrl, this.mediaPreloader);
3598
3655
  break;
3599
3656
  }
3600
3657
  });
3601
3658
  }
3602
3659
  }
3603
3660
  var ze = {}, wt;
3604
- function Ca() {
3661
+ function Aa() {
3605
3662
  return wt || (wt = 1, function(e) {
3606
3663
  var t = {};
3607
3664
  /*! howler.js v2.2.1 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */
@@ -3610,163 +3667,163 @@ function Ca() {
3610
3667
  this.init();
3611
3668
  };
3612
3669
  n.prototype = { init: function() {
3613
- var r = this || o;
3614
- return r._counter = 1e3, r._html5AudioPool = [], r.html5PoolSize = 10, r._codecs = {}, r._howls = [], r._muted = !1, r._volume = 1, r._canPlayEvent = "canplaythrough", r._navigator = typeof window < "u" && window.navigator ? window.navigator : null, r.masterGain = null, r.noAudio = !1, r.usingWebAudio = !0, r.autoSuspend = !0, r.ctx = null, r.autoUnlock = !0, r._setup(), r;
3615
- }, volume: function(r) {
3670
+ var i = this || o;
3671
+ return i._counter = 1e3, i._html5AudioPool = [], i.html5PoolSize = 10, i._codecs = {}, i._howls = [], i._muted = !1, i._volume = 1, i._canPlayEvent = "canplaythrough", i._navigator = typeof window < "u" && window.navigator ? window.navigator : null, i.masterGain = null, i.noAudio = !1, i.usingWebAudio = !0, i.autoSuspend = !0, i.ctx = null, i.autoUnlock = !0, i._setup(), i;
3672
+ }, volume: function(i) {
3616
3673
  var s = this || o;
3617
- if (r = parseFloat(r), s.ctx || g(), r !== void 0 && r >= 0 && r <= 1) {
3618
- if (s._volume = r, s._muted) return s;
3619
- s.usingWebAudio && s.masterGain.gain.setValueAtTime(r, o.ctx.currentTime);
3674
+ if (i = parseFloat(i), s.ctx || g(), i !== void 0 && i >= 0 && i <= 1) {
3675
+ if (s._volume = i, s._muted) return s;
3676
+ s.usingWebAudio && s.masterGain.gain.setValueAtTime(i, o.ctx.currentTime);
3620
3677
  for (var u = 0; u < s._howls.length; u++) if (!s._howls[u]._webAudio) for (var p = s._howls[u]._getSoundIds(), h = 0; h < p.length; h++) {
3621
3678
  var v = s._howls[u]._soundById(p[h]);
3622
- v && v._node && (v._node.volume = v._volume * r);
3679
+ v && v._node && (v._node.volume = v._volume * i);
3623
3680
  }
3624
3681
  return s;
3625
3682
  }
3626
3683
  return s._volume;
3627
- }, mute: function(r) {
3684
+ }, mute: function(i) {
3628
3685
  var s = this || o;
3629
- s.ctx || g(), s._muted = r, s.usingWebAudio && s.masterGain.gain.setValueAtTime(r ? 0 : s._volume, o.ctx.currentTime);
3686
+ s.ctx || g(), s._muted = i, s.usingWebAudio && s.masterGain.gain.setValueAtTime(i ? 0 : s._volume, o.ctx.currentTime);
3630
3687
  for (var u = 0; u < s._howls.length; u++) if (!s._howls[u]._webAudio) for (var p = s._howls[u]._getSoundIds(), h = 0; h < p.length; h++) {
3631
3688
  var v = s._howls[u]._soundById(p[h]);
3632
- v && v._node && (v._node.muted = !!r || v._muted);
3689
+ v && v._node && (v._node.muted = !!i || v._muted);
3633
3690
  }
3634
3691
  return s;
3635
3692
  }, stop: function() {
3636
- for (var r = this || o, s = 0; s < r._howls.length; s++) r._howls[s].stop();
3637
- return r;
3693
+ for (var i = this || o, s = 0; s < i._howls.length; s++) i._howls[s].stop();
3694
+ return i;
3638
3695
  }, unload: function() {
3639
- for (var r = this || o, s = r._howls.length - 1; s >= 0; s--) r._howls[s].unload();
3640
- return r.usingWebAudio && r.ctx && r.ctx.close !== void 0 && (r.ctx.close(), r.ctx = null, g()), r;
3641
- }, codecs: function(r) {
3642
- return (this || o)._codecs[r.replace(/^x-/, "")];
3696
+ for (var i = this || o, s = i._howls.length - 1; s >= 0; s--) i._howls[s].unload();
3697
+ return i.usingWebAudio && i.ctx && i.ctx.close !== void 0 && (i.ctx.close(), i.ctx = null, g()), i;
3698
+ }, codecs: function(i) {
3699
+ return (this || o)._codecs[i.replace(/^x-/, "")];
3643
3700
  }, _setup: function() {
3644
- var r = this || o;
3645
- if (r.state = r.ctx && r.ctx.state || "suspended", r._autoSuspend(), !r.usingWebAudio) if (typeof Audio < "u") try {
3701
+ var i = this || o;
3702
+ if (i.state = i.ctx && i.ctx.state || "suspended", i._autoSuspend(), !i.usingWebAudio) if (typeof Audio < "u") try {
3646
3703
  var s = new Audio();
3647
- s.oncanplaythrough === void 0 && (r._canPlayEvent = "canplay");
3704
+ s.oncanplaythrough === void 0 && (i._canPlayEvent = "canplay");
3648
3705
  } catch {
3649
- r.noAudio = !0;
3706
+ i.noAudio = !0;
3650
3707
  }
3651
- else r.noAudio = !0;
3708
+ else i.noAudio = !0;
3652
3709
  try {
3653
3710
  var s = new Audio();
3654
- s.muted && (r.noAudio = !0);
3711
+ s.muted && (i.noAudio = !0);
3655
3712
  } catch {
3656
3713
  }
3657
- return r.noAudio || r._setupCodecs(), r;
3714
+ return i.noAudio || i._setupCodecs(), i;
3658
3715
  }, _setupCodecs: function() {
3659
- var r = this || o, s = null;
3716
+ var i = this || o, s = null;
3660
3717
  try {
3661
3718
  s = typeof Audio < "u" ? new Audio() : null;
3662
3719
  } catch {
3663
- return r;
3720
+ return i;
3664
3721
  }
3665
- if (!s || typeof s.canPlayType != "function") return r;
3666
- var u = s.canPlayType("audio/mpeg;").replace(/^no$/, ""), p = r._navigator && r._navigator.userAgent.match(/OPR\/([0-6].)/g), h = p && parseInt(p[0].split("/")[1], 10) < 33;
3667
- return r._codecs = { mp3: !(h || !u && !s.canPlayType("audio/mp3;").replace(/^no$/, "")), mpeg: !!u, opus: !!s.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""), ogg: !!s.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), oga: !!s.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), wav: !!(s.canPlayType('audio/wav; codecs="1"') || s.canPlayType("audio/wav")).replace(/^no$/, ""), aac: !!s.canPlayType("audio/aac;").replace(/^no$/, ""), caf: !!s.canPlayType("audio/x-caf;").replace(/^no$/, ""), m4a: !!(s.canPlayType("audio/x-m4a;") || s.canPlayType("audio/m4a;") || s.canPlayType("audio/aac;")).replace(/^no$/, ""), m4b: !!(s.canPlayType("audio/x-m4b;") || s.canPlayType("audio/m4b;") || s.canPlayType("audio/aac;")).replace(/^no$/, ""), mp4: !!(s.canPlayType("audio/x-mp4;") || s.canPlayType("audio/mp4;") || s.canPlayType("audio/aac;")).replace(/^no$/, ""), weba: !!s.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""), webm: !!s.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""), dolby: !!s.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/, ""), flac: !!(s.canPlayType("audio/x-flac;") || s.canPlayType("audio/flac;")).replace(/^no$/, "") }, r;
3722
+ if (!s || typeof s.canPlayType != "function") return i;
3723
+ var u = s.canPlayType("audio/mpeg;").replace(/^no$/, ""), p = i._navigator && i._navigator.userAgent.match(/OPR\/([0-6].)/g), h = p && parseInt(p[0].split("/")[1], 10) < 33;
3724
+ return i._codecs = { mp3: !(h || !u && !s.canPlayType("audio/mp3;").replace(/^no$/, "")), mpeg: !!u, opus: !!s.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""), ogg: !!s.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), oga: !!s.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), wav: !!(s.canPlayType('audio/wav; codecs="1"') || s.canPlayType("audio/wav")).replace(/^no$/, ""), aac: !!s.canPlayType("audio/aac;").replace(/^no$/, ""), caf: !!s.canPlayType("audio/x-caf;").replace(/^no$/, ""), m4a: !!(s.canPlayType("audio/x-m4a;") || s.canPlayType("audio/m4a;") || s.canPlayType("audio/aac;")).replace(/^no$/, ""), m4b: !!(s.canPlayType("audio/x-m4b;") || s.canPlayType("audio/m4b;") || s.canPlayType("audio/aac;")).replace(/^no$/, ""), mp4: !!(s.canPlayType("audio/x-mp4;") || s.canPlayType("audio/mp4;") || s.canPlayType("audio/aac;")).replace(/^no$/, ""), weba: !!s.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""), webm: !!s.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""), dolby: !!s.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/, ""), flac: !!(s.canPlayType("audio/x-flac;") || s.canPlayType("audio/flac;")).replace(/^no$/, "") }, i;
3668
3725
  }, _unlockAudio: function() {
3669
- var r = this || o;
3670
- if (!r._audioUnlocked && r.ctx) {
3671
- r._audioUnlocked = !1, r.autoUnlock = !1, r._mobileUnloaded || r.ctx.sampleRate === 44100 || (r._mobileUnloaded = !0, r.unload()), r._scratchBuffer = r.ctx.createBuffer(1, 1, 22050);
3726
+ var i = this || o;
3727
+ if (!i._audioUnlocked && i.ctx) {
3728
+ i._audioUnlocked = !1, i.autoUnlock = !1, i._mobileUnloaded || i.ctx.sampleRate === 44100 || (i._mobileUnloaded = !0, i.unload()), i._scratchBuffer = i.ctx.createBuffer(1, 1, 22050);
3672
3729
  var s = function(u) {
3673
- for (; r._html5AudioPool.length < r.html5PoolSize; ) try {
3730
+ for (; i._html5AudioPool.length < i.html5PoolSize; ) try {
3674
3731
  var p = new Audio();
3675
- p._unlocked = !0, r._releaseHtml5Audio(p);
3732
+ p._unlocked = !0, i._releaseHtml5Audio(p);
3676
3733
  } catch {
3677
- r.noAudio = !0;
3734
+ i.noAudio = !0;
3678
3735
  break;
3679
3736
  }
3680
- for (var h = 0; h < r._howls.length; h++) if (!r._howls[h]._webAudio) for (var v = r._howls[h]._getSoundIds(), _ = 0; _ < v.length; _++) {
3681
- var w = r._howls[h]._soundById(v[_]);
3737
+ for (var h = 0; h < i._howls.length; h++) if (!i._howls[h]._webAudio) for (var v = i._howls[h]._getSoundIds(), _ = 0; _ < v.length; _++) {
3738
+ var w = i._howls[h]._soundById(v[_]);
3682
3739
  w && w._node && !w._node._unlocked && (w._node._unlocked = !0, w._node.load());
3683
3740
  }
3684
- r._autoResume();
3685
- var E = r.ctx.createBufferSource();
3686
- E.buffer = r._scratchBuffer, E.connect(r.ctx.destination), E.start === void 0 ? E.noteOn(0) : E.start(0), typeof r.ctx.resume == "function" && r.ctx.resume(), E.onended = function() {
3687
- E.disconnect(0), r._audioUnlocked = !0, document.removeEventListener("touchstart", s, !0), document.removeEventListener("touchend", s, !0), document.removeEventListener("click", s, !0);
3688
- for (var k = 0; k < r._howls.length; k++) r._howls[k]._emit("unlock");
3741
+ i._autoResume();
3742
+ var E = i.ctx.createBufferSource();
3743
+ E.buffer = i._scratchBuffer, E.connect(i.ctx.destination), E.start === void 0 ? E.noteOn(0) : E.start(0), typeof i.ctx.resume == "function" && i.ctx.resume(), E.onended = function() {
3744
+ E.disconnect(0), i._audioUnlocked = !0, document.removeEventListener("touchstart", s, !0), document.removeEventListener("touchend", s, !0), document.removeEventListener("click", s, !0);
3745
+ for (var k = 0; k < i._howls.length; k++) i._howls[k]._emit("unlock");
3689
3746
  };
3690
3747
  };
3691
- return document.addEventListener("touchstart", s, !0), document.addEventListener("touchend", s, !0), document.addEventListener("click", s, !0), r;
3748
+ return document.addEventListener("touchstart", s, !0), document.addEventListener("touchend", s, !0), document.addEventListener("click", s, !0), i;
3692
3749
  }
3693
3750
  }, _obtainHtml5Audio: function() {
3694
- var r = this || o;
3695
- if (r._html5AudioPool.length) return r._html5AudioPool.pop();
3751
+ var i = this || o;
3752
+ if (i._html5AudioPool.length) return i._html5AudioPool.pop();
3696
3753
  var s = new Audio().play();
3697
3754
  return s && typeof Promise < "u" && (s instanceof Promise || typeof s.then == "function") && s.catch(function() {
3698
3755
  console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.");
3699
3756
  }), new Audio();
3700
- }, _releaseHtml5Audio: function(r) {
3757
+ }, _releaseHtml5Audio: function(i) {
3701
3758
  var s = this || o;
3702
- return r._unlocked && s._html5AudioPool.push(r), s;
3759
+ return i._unlocked && s._html5AudioPool.push(i), s;
3703
3760
  }, _autoSuspend: function() {
3704
- var r = this;
3705
- if (r.autoSuspend && r.ctx && r.ctx.suspend !== void 0 && o.usingWebAudio) {
3706
- for (var s = 0; s < r._howls.length; s++) if (r._howls[s]._webAudio) {
3707
- for (var u = 0; u < r._howls[s]._sounds.length; u++) if (!r._howls[s]._sounds[u]._paused) return r;
3761
+ var i = this;
3762
+ if (i.autoSuspend && i.ctx && i.ctx.suspend !== void 0 && o.usingWebAudio) {
3763
+ for (var s = 0; s < i._howls.length; s++) if (i._howls[s]._webAudio) {
3764
+ for (var u = 0; u < i._howls[s]._sounds.length; u++) if (!i._howls[s]._sounds[u]._paused) return i;
3708
3765
  }
3709
- return r._suspendTimer && clearTimeout(r._suspendTimer), r._suspendTimer = setTimeout(function() {
3710
- if (r.autoSuspend) {
3711
- r._suspendTimer = null, r.state = "suspending";
3766
+ return i._suspendTimer && clearTimeout(i._suspendTimer), i._suspendTimer = setTimeout(function() {
3767
+ if (i.autoSuspend) {
3768
+ i._suspendTimer = null, i.state = "suspending";
3712
3769
  var p = function() {
3713
- r.state = "suspended", r._resumeAfterSuspend && (delete r._resumeAfterSuspend, r._autoResume());
3770
+ i.state = "suspended", i._resumeAfterSuspend && (delete i._resumeAfterSuspend, i._autoResume());
3714
3771
  };
3715
- r.ctx.suspend().then(p, p);
3772
+ i.ctx.suspend().then(p, p);
3716
3773
  }
3717
- }, 3e4), r;
3774
+ }, 3e4), i;
3718
3775
  }
3719
3776
  }, _autoResume: function() {
3720
- var r = this;
3721
- if (r.ctx && r.ctx.resume !== void 0 && o.usingWebAudio) return r.state === "running" && r.ctx.state !== "interrupted" && r._suspendTimer ? (clearTimeout(r._suspendTimer), r._suspendTimer = null) : r.state === "suspended" || r.state === "running" && r.ctx.state === "interrupted" ? (r.ctx.resume().then(function() {
3722
- r.state = "running";
3723
- for (var s = 0; s < r._howls.length; s++) r._howls[s]._emit("resume");
3724
- }), r._suspendTimer && (clearTimeout(r._suspendTimer), r._suspendTimer = null)) : r.state === "suspending" && (r._resumeAfterSuspend = !0), r;
3777
+ var i = this;
3778
+ if (i.ctx && i.ctx.resume !== void 0 && o.usingWebAudio) return i.state === "running" && i.ctx.state !== "interrupted" && i._suspendTimer ? (clearTimeout(i._suspendTimer), i._suspendTimer = null) : i.state === "suspended" || i.state === "running" && i.ctx.state === "interrupted" ? (i.ctx.resume().then(function() {
3779
+ i.state = "running";
3780
+ for (var s = 0; s < i._howls.length; s++) i._howls[s]._emit("resume");
3781
+ }), i._suspendTimer && (clearTimeout(i._suspendTimer), i._suspendTimer = null)) : i.state === "suspending" && (i._resumeAfterSuspend = !0), i;
3725
3782
  } };
3726
- var o = new n(), i = function(r) {
3783
+ var o = new n(), r = function(i) {
3727
3784
  var s = this;
3728
- if (!r.src || r.src.length === 0) return void console.error("An array of source files must be passed with any new Howl.");
3729
- s.init(r);
3785
+ if (!i.src || i.src.length === 0) return void console.error("An array of source files must be passed with any new Howl.");
3786
+ s.init(i);
3730
3787
  };
3731
- i.prototype = { init: function(r) {
3788
+ r.prototype = { init: function(i) {
3732
3789
  var s = this;
3733
- return o.ctx || g(), s._autoplay = r.autoplay || !1, s._format = typeof r.format != "string" ? r.format : [r.format], s._html5 = r.html5 || !1, s._muted = r.mute || !1, s._loop = r.loop || !1, s._pool = r.pool || 5, s._preload = typeof r.preload != "boolean" && r.preload !== "metadata" || r.preload, s._rate = r.rate || 1, s._sprite = r.sprite || {}, s._src = typeof r.src != "string" ? r.src : [r.src], s._volume = r.volume !== void 0 ? r.volume : 1, s._xhr = { method: r.xhr && r.xhr.method ? r.xhr.method : "GET", headers: r.xhr && r.xhr.headers ? r.xhr.headers : null, withCredentials: !(!r.xhr || !r.xhr.withCredentials) && r.xhr.withCredentials }, s._duration = 0, s._state = "unloaded", s._sounds = [], s._endTimers = {}, s._queue = [], s._playLock = !1, s._onend = r.onend ? [{ fn: r.onend }] : [], s._onfade = r.onfade ? [{ fn: r.onfade }] : [], s._onload = r.onload ? [{ fn: r.onload }] : [], s._onloaderror = r.onloaderror ? [{ fn: r.onloaderror }] : [], s._onplayerror = r.onplayerror ? [{ fn: r.onplayerror }] : [], s._onpause = r.onpause ? [{ fn: r.onpause }] : [], s._onplay = r.onplay ? [{ fn: r.onplay }] : [], s._onstop = r.onstop ? [{ fn: r.onstop }] : [], s._onmute = r.onmute ? [{ fn: r.onmute }] : [], s._onvolume = r.onvolume ? [{ fn: r.onvolume }] : [], s._onrate = r.onrate ? [{ fn: r.onrate }] : [], s._onseek = r.onseek ? [{ fn: r.onseek }] : [], s._onunlock = r.onunlock ? [{ fn: r.onunlock }] : [], s._onresume = [], s._webAudio = o.usingWebAudio && !s._html5, o.ctx !== void 0 && o.ctx && o.autoUnlock && o._unlockAudio(), o._howls.push(s), s._autoplay && s._queue.push({ event: "play", action: function() {
3790
+ return o.ctx || g(), s._autoplay = i.autoplay || !1, s._format = typeof i.format != "string" ? i.format : [i.format], s._html5 = i.html5 || !1, s._muted = i.mute || !1, s._loop = i.loop || !1, s._pool = i.pool || 5, s._preload = typeof i.preload != "boolean" && i.preload !== "metadata" || i.preload, s._rate = i.rate || 1, s._sprite = i.sprite || {}, s._src = typeof i.src != "string" ? i.src : [i.src], s._volume = i.volume !== void 0 ? i.volume : 1, s._xhr = { method: i.xhr && i.xhr.method ? i.xhr.method : "GET", headers: i.xhr && i.xhr.headers ? i.xhr.headers : null, withCredentials: !(!i.xhr || !i.xhr.withCredentials) && i.xhr.withCredentials }, s._duration = 0, s._state = "unloaded", s._sounds = [], s._endTimers = {}, s._queue = [], s._playLock = !1, s._onend = i.onend ? [{ fn: i.onend }] : [], s._onfade = i.onfade ? [{ fn: i.onfade }] : [], s._onload = i.onload ? [{ fn: i.onload }] : [], s._onloaderror = i.onloaderror ? [{ fn: i.onloaderror }] : [], s._onplayerror = i.onplayerror ? [{ fn: i.onplayerror }] : [], s._onpause = i.onpause ? [{ fn: i.onpause }] : [], s._onplay = i.onplay ? [{ fn: i.onplay }] : [], s._onstop = i.onstop ? [{ fn: i.onstop }] : [], s._onmute = i.onmute ? [{ fn: i.onmute }] : [], s._onvolume = i.onvolume ? [{ fn: i.onvolume }] : [], s._onrate = i.onrate ? [{ fn: i.onrate }] : [], s._onseek = i.onseek ? [{ fn: i.onseek }] : [], s._onunlock = i.onunlock ? [{ fn: i.onunlock }] : [], s._onresume = [], s._webAudio = o.usingWebAudio && !s._html5, o.ctx !== void 0 && o.ctx && o.autoUnlock && o._unlockAudio(), o._howls.push(s), s._autoplay && s._queue.push({ event: "play", action: function() {
3734
3791
  s.play();
3735
3792
  } }), s._preload && s._preload !== "none" && s.load(), s;
3736
3793
  }, load: function() {
3737
- var r = this, s = null;
3738
- if (o.noAudio) return void r._emit("loaderror", null, "No audio support.");
3739
- typeof r._src == "string" && (r._src = [r._src]);
3740
- for (var u = 0; u < r._src.length; u++) {
3794
+ var i = this, s = null;
3795
+ if (o.noAudio) return void i._emit("loaderror", null, "No audio support.");
3796
+ typeof i._src == "string" && (i._src = [i._src]);
3797
+ for (var u = 0; u < i._src.length; u++) {
3741
3798
  var p, h;
3742
- if (r._format && r._format[u]) p = r._format[u];
3799
+ if (i._format && i._format[u]) p = i._format[u];
3743
3800
  else {
3744
- if (typeof (h = r._src[u]) != "string") {
3745
- r._emit("loaderror", null, "Non-string found in selected audio sources - ignoring.");
3801
+ if (typeof (h = i._src[u]) != "string") {
3802
+ i._emit("loaderror", null, "Non-string found in selected audio sources - ignoring.");
3746
3803
  continue;
3747
3804
  }
3748
3805
  p = /^data:audio\/([^;,]+);/i.exec(h), p || (p = /\.([^.]+)$/.exec(h.split("?", 1)[0])), p && (p = p[1].toLowerCase());
3749
3806
  }
3750
3807
  if (p || console.warn('No file extension was found. Consider using the "format" property or specify an extension.'), p && o.codecs(p)) {
3751
- s = r._src[u];
3808
+ s = i._src[u];
3752
3809
  break;
3753
3810
  }
3754
3811
  }
3755
- return s ? (r._src = s, r._state = "loading", window.location.protocol === "https:" && s.slice(0, 5) === "http:" && (r._html5 = !0, r._webAudio = !1), new a(r), r._webAudio && l(r), r) : void r._emit("loaderror", null, "No codec support for selected audio sources.");
3756
- }, play: function(r, s) {
3812
+ return s ? (i._src = s, i._state = "loading", window.location.protocol === "https:" && s.slice(0, 5) === "http:" && (i._html5 = !0, i._webAudio = !1), new a(i), i._webAudio && l(i), i) : void i._emit("loaderror", null, "No codec support for selected audio sources.");
3813
+ }, play: function(i, s) {
3757
3814
  var u = this, p = null;
3758
- if (typeof r == "number") p = r, r = null;
3815
+ if (typeof i == "number") p = i, i = null;
3759
3816
  else {
3760
- if (typeof r == "string" && u._state === "loaded" && !u._sprite[r]) return null;
3761
- if (r === void 0 && (r = "__default", !u._playLock)) {
3817
+ if (typeof i == "string" && u._state === "loaded" && !u._sprite[i]) return null;
3818
+ if (i === void 0 && (i = "__default", !u._playLock)) {
3762
3819
  for (var h = 0, v = 0; v < u._sounds.length; v++) u._sounds[v]._paused && !u._sounds[v]._ended && (h++, p = u._sounds[v]._id);
3763
- h === 1 ? r = null : p = null;
3820
+ h === 1 ? i = null : p = null;
3764
3821
  }
3765
3822
  }
3766
3823
  var _ = p ? u._soundById(p) : u._inactiveSound();
3767
3824
  if (!_) return null;
3768
- if (p && !r && (r = _._sprite || "__default"), u._state !== "loaded") {
3769
- _._sprite = r, _._ended = !1;
3825
+ if (p && !i && (i = _._sprite || "__default"), u._state !== "loaded") {
3826
+ _._sprite = i, _._ended = !1;
3770
3827
  var w = _._id;
3771
3828
  return u._queue.push({ event: "play", action: function() {
3772
3829
  u.play(w);
@@ -3774,10 +3831,10 @@ function Ca() {
3774
3831
  }
3775
3832
  if (p && !_._paused) return s || u._loadQueue("play"), _._id;
3776
3833
  u._webAudio && o._autoResume();
3777
- var E = Math.max(0, _._seek > 0 ? _._seek : u._sprite[r][0] / 1e3), k = Math.max(0, (u._sprite[r][0] + u._sprite[r][1]) / 1e3 - E), x = 1e3 * k / Math.abs(_._rate), U = u._sprite[r][0] / 1e3, se = (u._sprite[r][0] + u._sprite[r][1]) / 1e3;
3778
- _._sprite = r, _._ended = !1;
3834
+ var E = Math.max(0, _._seek > 0 ? _._seek : u._sprite[i][0] / 1e3), k = Math.max(0, (u._sprite[i][0] + u._sprite[i][1]) / 1e3 - E), x = 1e3 * k / Math.abs(_._rate), U = u._sprite[i][0] / 1e3, se = (u._sprite[i][0] + u._sprite[i][1]) / 1e3;
3835
+ _._sprite = i, _._ended = !1;
3779
3836
  var ke = function() {
3780
- _._paused = !1, _._seek = E, _._start = U, _._stop = se, _._loop = !(!_._loop && !u._sprite[r][2]);
3837
+ _._paused = !1, _._seek = E, _._start = U, _._stop = se, _._loop = !(!_._loop && !u._sprite[i][2]);
3781
3838
  };
3782
3839
  if (E >= se) return void u._ended(_);
3783
3840
  var T = _._node;
@@ -3800,7 +3857,7 @@ function Ca() {
3800
3857
  }).catch(function() {
3801
3858
  u._playLock = !1, u._emit("playerror", _._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."), _._ended = !0, _._paused = !0;
3802
3859
  })) : s || (u._playLock = !1, ke(), u._emit("play", _._id), u._loadQueue()), T.playbackRate = _._rate, T.paused) return void u._emit("playerror", _._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");
3803
- r !== "__default" || _._loop ? u._endTimers[_._id] = setTimeout(u._ended.bind(u, _), x) : (u._endTimers[_._id] = function() {
3860
+ i !== "__default" || _._loop ? u._endTimers[_._id] = setTimeout(u._ended.bind(u, _), x) : (u._endTimers[_._id] = function() {
3804
3861
  u._ended(_), T.removeEventListener("ended", u._endTimers[_._id], !1);
3805
3862
  }, T.addEventListener("ended", u._endTimers[_._id], !1));
3806
3863
  } catch (tn) {
@@ -3819,12 +3876,12 @@ function Ca() {
3819
3876
  }
3820
3877
  }
3821
3878
  return _._id;
3822
- }, pause: function(r) {
3879
+ }, pause: function(i) {
3823
3880
  var s = this;
3824
3881
  if (s._state !== "loaded" || s._playLock) return s._queue.push({ event: "pause", action: function() {
3825
- s.pause(r);
3882
+ s.pause(i);
3826
3883
  } }), s;
3827
- for (var u = s._getSoundIds(r), p = 0; p < u.length; p++) {
3884
+ for (var u = s._getSoundIds(i), p = 0; p < u.length; p++) {
3828
3885
  s._clearTimer(u[p]);
3829
3886
  var h = s._soundById(u[p]);
3830
3887
  if (h && !h._paused && (h._seek = s.seek(u[p]), h._rateSeek = 0, h._paused = !0, s._stopFade(u[p]), h._node)) if (s._webAudio) {
@@ -3834,111 +3891,111 @@ function Ca() {
3834
3891
  arguments[1] || s._emit("pause", h ? h._id : null);
3835
3892
  }
3836
3893
  return s;
3837
- }, stop: function(r, s) {
3894
+ }, stop: function(i, s) {
3838
3895
  var u = this;
3839
3896
  if (u._state !== "loaded" || u._playLock) return u._queue.push({ event: "stop", action: function() {
3840
- u.stop(r, s);
3897
+ u.stop(i, s);
3841
3898
  } }), u;
3842
- for (var p = u._getSoundIds(r), h = 0; h < p.length; h++) {
3899
+ for (var p = u._getSoundIds(i), h = 0; h < p.length; h++) {
3843
3900
  u._clearTimer(p[h]);
3844
3901
  var v = u._soundById(p[h]);
3845
3902
  v && (v._seek = v._start || 0, v._rateSeek = 0, v._paused = !0, v._ended = !0, u._stopFade(p[h]), v._node && (u._webAudio ? v._node.bufferSource && (v._node.bufferSource.stop === void 0 ? v._node.bufferSource.noteOff(0) : v._node.bufferSource.stop(0), u._cleanBuffer(v._node)) : isNaN(v._node.duration) && v._node.duration !== 1 / 0 || (v._node.currentTime = v._start || 0, v._node.pause(), v._node.duration === 1 / 0 && u._clearSound(v._node))), s || u._emit("stop", v._id));
3846
3903
  }
3847
3904
  return u;
3848
- }, mute: function(r, s) {
3905
+ }, mute: function(i, s) {
3849
3906
  var u = this;
3850
3907
  if (u._state !== "loaded" || u._playLock) return u._queue.push({ event: "mute", action: function() {
3851
- u.mute(r, s);
3908
+ u.mute(i, s);
3852
3909
  } }), u;
3853
3910
  if (s === void 0) {
3854
- if (typeof r != "boolean") return u._muted;
3855
- u._muted = r;
3911
+ if (typeof i != "boolean") return u._muted;
3912
+ u._muted = i;
3856
3913
  }
3857
3914
  for (var p = u._getSoundIds(s), h = 0; h < p.length; h++) {
3858
3915
  var v = u._soundById(p[h]);
3859
- v && (v._muted = r, v._interval && u._stopFade(v._id), u._webAudio && v._node ? v._node.gain.setValueAtTime(r ? 0 : v._volume, o.ctx.currentTime) : v._node && (v._node.muted = !!o._muted || r), u._emit("mute", v._id));
3916
+ v && (v._muted = i, v._interval && u._stopFade(v._id), u._webAudio && v._node ? v._node.gain.setValueAtTime(i ? 0 : v._volume, o.ctx.currentTime) : v._node && (v._node.muted = !!o._muted || i), u._emit("mute", v._id));
3860
3917
  }
3861
3918
  return u;
3862
3919
  }, volume: function() {
3863
- var r, s, u = this, p = arguments;
3920
+ var i, s, u = this, p = arguments;
3864
3921
  if (p.length === 0) return u._volume;
3865
- p.length === 1 || p.length === 2 && p[1] === void 0 ? u._getSoundIds().indexOf(p[0]) >= 0 ? s = parseInt(p[0], 10) : r = parseFloat(p[0]) : p.length >= 2 && (r = parseFloat(p[0]), s = parseInt(p[1], 10));
3922
+ p.length === 1 || p.length === 2 && p[1] === void 0 ? u._getSoundIds().indexOf(p[0]) >= 0 ? s = parseInt(p[0], 10) : i = parseFloat(p[0]) : p.length >= 2 && (i = parseFloat(p[0]), s = parseInt(p[1], 10));
3866
3923
  var h;
3867
- if (!(r !== void 0 && r >= 0 && r <= 1)) return h = s ? u._soundById(s) : u._sounds[0], h ? h._volume : 0;
3924
+ if (!(i !== void 0 && i >= 0 && i <= 1)) return h = s ? u._soundById(s) : u._sounds[0], h ? h._volume : 0;
3868
3925
  if (u._state !== "loaded" || u._playLock) return u._queue.push({ event: "volume", action: function() {
3869
3926
  u.volume.apply(u, p);
3870
3927
  } }), u;
3871
- s === void 0 && (u._volume = r), s = u._getSoundIds(s);
3872
- for (var v = 0; v < s.length; v++) (h = u._soundById(s[v])) && (h._volume = r, p[2] || u._stopFade(s[v]), u._webAudio && h._node && !h._muted ? h._node.gain.setValueAtTime(r, o.ctx.currentTime) : h._node && !h._muted && (h._node.volume = r * o.volume()), u._emit("volume", h._id));
3928
+ s === void 0 && (u._volume = i), s = u._getSoundIds(s);
3929
+ for (var v = 0; v < s.length; v++) (h = u._soundById(s[v])) && (h._volume = i, p[2] || u._stopFade(s[v]), u._webAudio && h._node && !h._muted ? h._node.gain.setValueAtTime(i, o.ctx.currentTime) : h._node && !h._muted && (h._node.volume = i * o.volume()), u._emit("volume", h._id));
3873
3930
  return u;
3874
- }, fade: function(r, s, u, p) {
3931
+ }, fade: function(i, s, u, p) {
3875
3932
  var h = this;
3876
3933
  if (h._state !== "loaded" || h._playLock) return h._queue.push({ event: "fade", action: function() {
3877
- h.fade(r, s, u, p);
3934
+ h.fade(i, s, u, p);
3878
3935
  } }), h;
3879
- r = Math.min(Math.max(0, parseFloat(r)), 1), s = Math.min(Math.max(0, parseFloat(s)), 1), u = parseFloat(u), h.volume(r, p);
3936
+ i = Math.min(Math.max(0, parseFloat(i)), 1), s = Math.min(Math.max(0, parseFloat(s)), 1), u = parseFloat(u), h.volume(i, p);
3880
3937
  for (var v = h._getSoundIds(p), _ = 0; _ < v.length; _++) {
3881
3938
  var w = h._soundById(v[_]);
3882
3939
  if (w) {
3883
3940
  if (p || h._stopFade(v[_]), h._webAudio && !w._muted) {
3884
3941
  var E = o.ctx.currentTime, k = E + u / 1e3;
3885
- w._volume = r, w._node.gain.setValueAtTime(r, E), w._node.gain.linearRampToValueAtTime(s, k);
3942
+ w._volume = i, w._node.gain.setValueAtTime(i, E), w._node.gain.linearRampToValueAtTime(s, k);
3886
3943
  }
3887
- h._startFadeInterval(w, r, s, u, v[_], p === void 0);
3944
+ h._startFadeInterval(w, i, s, u, v[_], p === void 0);
3888
3945
  }
3889
3946
  }
3890
3947
  return h;
3891
- }, _startFadeInterval: function(r, s, u, p, h, v) {
3948
+ }, _startFadeInterval: function(i, s, u, p, h, v) {
3892
3949
  var _ = this, w = s, E = u - s, k = Math.abs(E / 0.01), x = Math.max(4, k > 0 ? p / k : p), U = Date.now();
3893
- r._fadeTo = u, r._interval = setInterval(function() {
3950
+ i._fadeTo = u, i._interval = setInterval(function() {
3894
3951
  var se = (Date.now() - U) / p;
3895
- U = Date.now(), w += E * se, w = Math.round(100 * w) / 100, w = E < 0 ? Math.max(u, w) : Math.min(u, w), _._webAudio ? r._volume = w : _.volume(w, r._id, !0), v && (_._volume = w), (u < s && w <= u || u > s && w >= u) && (clearInterval(r._interval), r._interval = null, r._fadeTo = null, _.volume(u, r._id), _._emit("fade", r._id));
3952
+ U = Date.now(), w += E * se, w = Math.round(100 * w) / 100, w = E < 0 ? Math.max(u, w) : Math.min(u, w), _._webAudio ? i._volume = w : _.volume(w, i._id, !0), v && (_._volume = w), (u < s && w <= u || u > s && w >= u) && (clearInterval(i._interval), i._interval = null, i._fadeTo = null, _.volume(u, i._id), _._emit("fade", i._id));
3896
3953
  }, x);
3897
- }, _stopFade: function(r) {
3898
- var s = this, u = s._soundById(r);
3899
- return u && u._interval && (s._webAudio && u._node.gain.cancelScheduledValues(o.ctx.currentTime), clearInterval(u._interval), u._interval = null, s.volume(u._fadeTo, r), u._fadeTo = null, s._emit("fade", r)), s;
3954
+ }, _stopFade: function(i) {
3955
+ var s = this, u = s._soundById(i);
3956
+ return u && u._interval && (s._webAudio && u._node.gain.cancelScheduledValues(o.ctx.currentTime), clearInterval(u._interval), u._interval = null, s.volume(u._fadeTo, i), u._fadeTo = null, s._emit("fade", i)), s;
3900
3957
  }, loop: function() {
3901
- var r, s, u, p = this, h = arguments;
3958
+ var i, s, u, p = this, h = arguments;
3902
3959
  if (h.length === 0) return p._loop;
3903
3960
  if (h.length === 1) {
3904
3961
  if (typeof h[0] != "boolean") return !!(u = p._soundById(parseInt(h[0], 10))) && u._loop;
3905
- r = h[0], p._loop = r;
3906
- } else h.length === 2 && (r = h[0], s = parseInt(h[1], 10));
3907
- for (var v = p._getSoundIds(s), _ = 0; _ < v.length; _++) (u = p._soundById(v[_])) && (u._loop = r, p._webAudio && u._node && u._node.bufferSource && (u._node.bufferSource.loop = r, r && (u._node.bufferSource.loopStart = u._start || 0, u._node.bufferSource.loopEnd = u._stop)));
3962
+ i = h[0], p._loop = i;
3963
+ } else h.length === 2 && (i = h[0], s = parseInt(h[1], 10));
3964
+ for (var v = p._getSoundIds(s), _ = 0; _ < v.length; _++) (u = p._soundById(v[_])) && (u._loop = i, p._webAudio && u._node && u._node.bufferSource && (u._node.bufferSource.loop = i, i && (u._node.bufferSource.loopStart = u._start || 0, u._node.bufferSource.loopEnd = u._stop)));
3908
3965
  return p;
3909
3966
  }, rate: function() {
3910
- var r, s, u = this, p = arguments;
3967
+ var i, s, u = this, p = arguments;
3911
3968
  if (p.length === 0) s = u._sounds[0]._id;
3912
3969
  else if (p.length === 1) {
3913
3970
  var h = u._getSoundIds(), v = h.indexOf(p[0]);
3914
- v >= 0 ? s = parseInt(p[0], 10) : r = parseFloat(p[0]);
3915
- } else p.length === 2 && (r = parseFloat(p[0]), s = parseInt(p[1], 10));
3971
+ v >= 0 ? s = parseInt(p[0], 10) : i = parseFloat(p[0]);
3972
+ } else p.length === 2 && (i = parseFloat(p[0]), s = parseInt(p[1], 10));
3916
3973
  var _;
3917
- if (typeof r != "number") return _ = u._soundById(s), _ ? _._rate : u._rate;
3974
+ if (typeof i != "number") return _ = u._soundById(s), _ ? _._rate : u._rate;
3918
3975
  if (u._state !== "loaded" || u._playLock) return u._queue.push({ event: "rate", action: function() {
3919
3976
  u.rate.apply(u, p);
3920
3977
  } }), u;
3921
- s === void 0 && (u._rate = r), s = u._getSoundIds(s);
3978
+ s === void 0 && (u._rate = i), s = u._getSoundIds(s);
3922
3979
  for (var w = 0; w < s.length; w++) if (_ = u._soundById(s[w])) {
3923
- u.playing(s[w]) && (_._rateSeek = u.seek(s[w]), _._playStart = u._webAudio ? o.ctx.currentTime : _._playStart), _._rate = r, u._webAudio && _._node && _._node.bufferSource ? _._node.bufferSource.playbackRate.setValueAtTime(r, o.ctx.currentTime) : _._node && (_._node.playbackRate = r);
3980
+ u.playing(s[w]) && (_._rateSeek = u.seek(s[w]), _._playStart = u._webAudio ? o.ctx.currentTime : _._playStart), _._rate = i, u._webAudio && _._node && _._node.bufferSource ? _._node.bufferSource.playbackRate.setValueAtTime(i, o.ctx.currentTime) : _._node && (_._node.playbackRate = i);
3924
3981
  var E = u.seek(s[w]), k = (u._sprite[_._sprite][0] + u._sprite[_._sprite][1]) / 1e3 - E, x = 1e3 * k / Math.abs(_._rate);
3925
3982
  !u._endTimers[s[w]] && _._paused || (u._clearTimer(s[w]), u._endTimers[s[w]] = setTimeout(u._ended.bind(u, _), x)), u._emit("rate", _._id);
3926
3983
  }
3927
3984
  return u;
3928
3985
  }, seek: function() {
3929
- var r, s, u = this, p = arguments;
3986
+ var i, s, u = this, p = arguments;
3930
3987
  if (p.length === 0) s = u._sounds[0]._id;
3931
3988
  else if (p.length === 1) {
3932
3989
  var h = u._getSoundIds(), v = h.indexOf(p[0]);
3933
- v >= 0 ? s = parseInt(p[0], 10) : u._sounds.length && (s = u._sounds[0]._id, r = parseFloat(p[0]));
3934
- } else p.length === 2 && (r = parseFloat(p[0]), s = parseInt(p[1], 10));
3990
+ v >= 0 ? s = parseInt(p[0], 10) : u._sounds.length && (s = u._sounds[0]._id, i = parseFloat(p[0]));
3991
+ } else p.length === 2 && (i = parseFloat(p[0]), s = parseInt(p[1], 10));
3935
3992
  if (s === void 0) return u;
3936
- if (typeof r == "number" && (u._state !== "loaded" || u._playLock)) return u._queue.push({ event: "seek", action: function() {
3993
+ if (typeof i == "number" && (u._state !== "loaded" || u._playLock)) return u._queue.push({ event: "seek", action: function() {
3937
3994
  u.seek.apply(u, p);
3938
3995
  } }), u;
3939
3996
  var _ = u._soundById(s);
3940
3997
  if (_) {
3941
- if (!(typeof r == "number" && r >= 0)) {
3998
+ if (!(typeof i == "number" && i >= 0)) {
3942
3999
  if (u._webAudio) {
3943
4000
  var w = u.playing(s) ? o.ctx.currentTime - _._playStart : 0, E = _._rateSeek ? _._rateSeek - _._seek : 0;
3944
4001
  return _._seek + (E + w * Math.abs(_._rate));
@@ -3946,7 +4003,7 @@ function Ca() {
3946
4003
  return _._node.currentTime;
3947
4004
  }
3948
4005
  var k = u.playing(s);
3949
- k && u.pause(s, !0), _._seek = r, _._ended = !1, u._clearTimer(s), u._webAudio || !_._node || isNaN(_._node.duration) || (_._node.currentTime = r);
4006
+ k && u.pause(s, !0), _._seek = i, _._ended = !1, u._clearTimer(s), u._webAudio || !_._node || isNaN(_._node.duration) || (_._node.currentTime = i);
3950
4007
  var x = function() {
3951
4008
  u._emit("seek", s), k && u.play(s, !0);
3952
4009
  };
@@ -3958,34 +4015,34 @@ function Ca() {
3958
4015
  } else x();
3959
4016
  }
3960
4017
  return u;
3961
- }, playing: function(r) {
4018
+ }, playing: function(i) {
3962
4019
  var s = this;
3963
- if (typeof r == "number") {
3964
- var u = s._soundById(r);
4020
+ if (typeof i == "number") {
4021
+ var u = s._soundById(i);
3965
4022
  return !!u && !u._paused;
3966
4023
  }
3967
4024
  for (var p = 0; p < s._sounds.length; p++) if (!s._sounds[p]._paused) return !0;
3968
4025
  return !1;
3969
- }, duration: function(r) {
3970
- var s = this, u = s._duration, p = s._soundById(r);
4026
+ }, duration: function(i) {
4027
+ var s = this, u = s._duration, p = s._soundById(i);
3971
4028
  return p && (u = s._sprite[p._sprite][1] / 1e3), u;
3972
4029
  }, state: function() {
3973
4030
  return this._state;
3974
4031
  }, unload: function() {
3975
- for (var r = this, s = r._sounds, u = 0; u < s.length; u++) s[u]._paused || r.stop(s[u]._id), r._webAudio || (r._clearSound(s[u]._node), s[u]._node.removeEventListener("error", s[u]._errorFn, !1), s[u]._node.removeEventListener(o._canPlayEvent, s[u]._loadFn, !1), s[u]._node.removeEventListener("ended", s[u]._endFn, !1), o._releaseHtml5Audio(s[u]._node)), delete s[u]._node, r._clearTimer(s[u]._id);
3976
- var p = o._howls.indexOf(r);
4032
+ for (var i = this, s = i._sounds, u = 0; u < s.length; u++) s[u]._paused || i.stop(s[u]._id), i._webAudio || (i._clearSound(s[u]._node), s[u]._node.removeEventListener("error", s[u]._errorFn, !1), s[u]._node.removeEventListener(o._canPlayEvent, s[u]._loadFn, !1), s[u]._node.removeEventListener("ended", s[u]._endFn, !1), o._releaseHtml5Audio(s[u]._node)), delete s[u]._node, i._clearTimer(s[u]._id);
4033
+ var p = o._howls.indexOf(i);
3977
4034
  p >= 0 && o._howls.splice(p, 1);
3978
4035
  var h = !0;
3979
- for (u = 0; u < o._howls.length; u++) if (o._howls[u]._src === r._src || r._src.indexOf(o._howls[u]._src) >= 0) {
4036
+ for (u = 0; u < o._howls.length; u++) if (o._howls[u]._src === i._src || i._src.indexOf(o._howls[u]._src) >= 0) {
3980
4037
  h = !1;
3981
4038
  break;
3982
4039
  }
3983
- return c && h && delete c[r._src], o.noAudio = !1, r._state = "unloaded", r._sounds = [], r = null, null;
3984
- }, on: function(r, s, u, p) {
3985
- var h = this, v = h["_on" + r];
4040
+ return c && h && delete c[i._src], o.noAudio = !1, i._state = "unloaded", i._sounds = [], i = null, null;
4041
+ }, on: function(i, s, u, p) {
4042
+ var h = this, v = h["_on" + i];
3986
4043
  return typeof s == "function" && v.push(p ? { id: u, fn: s, once: p } : { id: u, fn: s }), h;
3987
- }, off: function(r, s, u) {
3988
- var p = this, h = p["_on" + r], v = 0;
4044
+ }, off: function(i, s, u) {
4045
+ var p = this, h = p["_on" + i], v = 0;
3989
4046
  if (typeof s == "number" && (u = s, s = null), s || u) for (v = 0; v < h.length; v++) {
3990
4047
  var _ = u === h[v].id;
3991
4048
  if (s === h[v].fn && _ || !s && _) {
@@ -3993,140 +4050,140 @@ function Ca() {
3993
4050
  break;
3994
4051
  }
3995
4052
  }
3996
- else if (r) p["_on" + r] = [];
4053
+ else if (i) p["_on" + i] = [];
3997
4054
  else {
3998
4055
  var w = Object.keys(p);
3999
4056
  for (v = 0; v < w.length; v++) w[v].indexOf("_on") === 0 && Array.isArray(p[w[v]]) && (p[w[v]] = []);
4000
4057
  }
4001
4058
  return p;
4002
- }, once: function(r, s, u) {
4059
+ }, once: function(i, s, u) {
4003
4060
  var p = this;
4004
- return p.on(r, s, u, 1), p;
4005
- }, _emit: function(r, s, u) {
4006
- for (var p = this, h = p["_on" + r], v = h.length - 1; v >= 0; v--) h[v].id && h[v].id !== s && r !== "load" || (setTimeout((function(_) {
4061
+ return p.on(i, s, u, 1), p;
4062
+ }, _emit: function(i, s, u) {
4063
+ for (var p = this, h = p["_on" + i], v = h.length - 1; v >= 0; v--) h[v].id && h[v].id !== s && i !== "load" || (setTimeout((function(_) {
4007
4064
  _.call(this, s, u);
4008
- }).bind(p, h[v].fn), 0), h[v].once && p.off(r, h[v].fn, h[v].id));
4009
- return p._loadQueue(r), p;
4010
- }, _loadQueue: function(r) {
4065
+ }).bind(p, h[v].fn), 0), h[v].once && p.off(i, h[v].fn, h[v].id));
4066
+ return p._loadQueue(i), p;
4067
+ }, _loadQueue: function(i) {
4011
4068
  var s = this;
4012
4069
  if (s._queue.length > 0) {
4013
4070
  var u = s._queue[0];
4014
- u.event === r && (s._queue.shift(), s._loadQueue()), r || u.action();
4071
+ u.event === i && (s._queue.shift(), s._loadQueue()), i || u.action();
4015
4072
  }
4016
4073
  return s;
4017
- }, _ended: function(r) {
4018
- var s = this, u = r._sprite;
4019
- if (!s._webAudio && r._node && !r._node.paused && !r._node.ended && r._node.currentTime < r._stop) return setTimeout(s._ended.bind(s, r), 100), s;
4020
- var p = !(!r._loop && !s._sprite[u][2]);
4021
- if (s._emit("end", r._id), !s._webAudio && p && s.stop(r._id, !0).play(r._id), s._webAudio && p) {
4022
- s._emit("play", r._id), r._seek = r._start || 0, r._rateSeek = 0, r._playStart = o.ctx.currentTime;
4023
- var h = 1e3 * (r._stop - r._start) / Math.abs(r._rate);
4024
- s._endTimers[r._id] = setTimeout(s._ended.bind(s, r), h);
4074
+ }, _ended: function(i) {
4075
+ var s = this, u = i._sprite;
4076
+ if (!s._webAudio && i._node && !i._node.paused && !i._node.ended && i._node.currentTime < i._stop) return setTimeout(s._ended.bind(s, i), 100), s;
4077
+ var p = !(!i._loop && !s._sprite[u][2]);
4078
+ if (s._emit("end", i._id), !s._webAudio && p && s.stop(i._id, !0).play(i._id), s._webAudio && p) {
4079
+ s._emit("play", i._id), i._seek = i._start || 0, i._rateSeek = 0, i._playStart = o.ctx.currentTime;
4080
+ var h = 1e3 * (i._stop - i._start) / Math.abs(i._rate);
4081
+ s._endTimers[i._id] = setTimeout(s._ended.bind(s, i), h);
4025
4082
  }
4026
- return s._webAudio && !p && (r._paused = !0, r._ended = !0, r._seek = r._start || 0, r._rateSeek = 0, s._clearTimer(r._id), s._cleanBuffer(r._node), o._autoSuspend()), s._webAudio || p || s.stop(r._id, !0), s;
4027
- }, _clearTimer: function(r) {
4083
+ return s._webAudio && !p && (i._paused = !0, i._ended = !0, i._seek = i._start || 0, i._rateSeek = 0, s._clearTimer(i._id), s._cleanBuffer(i._node), o._autoSuspend()), s._webAudio || p || s.stop(i._id, !0), s;
4084
+ }, _clearTimer: function(i) {
4028
4085
  var s = this;
4029
- if (s._endTimers[r]) {
4030
- if (typeof s._endTimers[r] != "function") clearTimeout(s._endTimers[r]);
4086
+ if (s._endTimers[i]) {
4087
+ if (typeof s._endTimers[i] != "function") clearTimeout(s._endTimers[i]);
4031
4088
  else {
4032
- var u = s._soundById(r);
4033
- u && u._node && u._node.removeEventListener("ended", s._endTimers[r], !1);
4089
+ var u = s._soundById(i);
4090
+ u && u._node && u._node.removeEventListener("ended", s._endTimers[i], !1);
4034
4091
  }
4035
- delete s._endTimers[r];
4092
+ delete s._endTimers[i];
4036
4093
  }
4037
4094
  return s;
4038
- }, _soundById: function(r) {
4039
- for (var s = this, u = 0; u < s._sounds.length; u++) if (r === s._sounds[u]._id) return s._sounds[u];
4095
+ }, _soundById: function(i) {
4096
+ for (var s = this, u = 0; u < s._sounds.length; u++) if (i === s._sounds[u]._id) return s._sounds[u];
4040
4097
  return null;
4041
4098
  }, _inactiveSound: function() {
4042
- var r = this;
4043
- r._drain();
4044
- for (var s = 0; s < r._sounds.length; s++) if (r._sounds[s]._ended) return r._sounds[s].reset();
4045
- return new a(r);
4099
+ var i = this;
4100
+ i._drain();
4101
+ for (var s = 0; s < i._sounds.length; s++) if (i._sounds[s]._ended) return i._sounds[s].reset();
4102
+ return new a(i);
4046
4103
  }, _drain: function() {
4047
- var r = this, s = r._pool, u = 0, p = 0;
4048
- if (!(r._sounds.length < s)) {
4049
- for (p = 0; p < r._sounds.length; p++) r._sounds[p]._ended && u++;
4050
- for (p = r._sounds.length - 1; p >= 0; p--) {
4104
+ var i = this, s = i._pool, u = 0, p = 0;
4105
+ if (!(i._sounds.length < s)) {
4106
+ for (p = 0; p < i._sounds.length; p++) i._sounds[p]._ended && u++;
4107
+ for (p = i._sounds.length - 1; p >= 0; p--) {
4051
4108
  if (u <= s) return;
4052
- r._sounds[p]._ended && (r._webAudio && r._sounds[p]._node && r._sounds[p]._node.disconnect(0), r._sounds.splice(p, 1), u--);
4109
+ i._sounds[p]._ended && (i._webAudio && i._sounds[p]._node && i._sounds[p]._node.disconnect(0), i._sounds.splice(p, 1), u--);
4053
4110
  }
4054
4111
  }
4055
- }, _getSoundIds: function(r) {
4112
+ }, _getSoundIds: function(i) {
4056
4113
  var s = this;
4057
- if (r === void 0) {
4114
+ if (i === void 0) {
4058
4115
  for (var u = [], p = 0; p < s._sounds.length; p++) u.push(s._sounds[p]._id);
4059
4116
  return u;
4060
4117
  }
4061
- return [r];
4062
- }, _refreshBuffer: function(r) {
4118
+ return [i];
4119
+ }, _refreshBuffer: function(i) {
4063
4120
  var s = this;
4064
- return r._node.bufferSource = o.ctx.createBufferSource(), r._node.bufferSource.buffer = c[s._src], r._panner ? r._node.bufferSource.connect(r._panner) : r._node.bufferSource.connect(r._node), r._node.bufferSource.loop = r._loop, r._loop && (r._node.bufferSource.loopStart = r._start || 0, r._node.bufferSource.loopEnd = r._stop || 0), r._node.bufferSource.playbackRate.setValueAtTime(r._rate, o.ctx.currentTime), s;
4065
- }, _cleanBuffer: function(r) {
4121
+ return i._node.bufferSource = o.ctx.createBufferSource(), i._node.bufferSource.buffer = c[s._src], i._panner ? i._node.bufferSource.connect(i._panner) : i._node.bufferSource.connect(i._node), i._node.bufferSource.loop = i._loop, i._loop && (i._node.bufferSource.loopStart = i._start || 0, i._node.bufferSource.loopEnd = i._stop || 0), i._node.bufferSource.playbackRate.setValueAtTime(i._rate, o.ctx.currentTime), s;
4122
+ }, _cleanBuffer: function(i) {
4066
4123
  var s = this, u = o._navigator && o._navigator.vendor.indexOf("Apple") >= 0;
4067
- if (o._scratchBuffer && r.bufferSource && (r.bufferSource.onended = null, r.bufferSource.disconnect(0), u)) try {
4068
- r.bufferSource.buffer = o._scratchBuffer;
4124
+ if (o._scratchBuffer && i.bufferSource && (i.bufferSource.onended = null, i.bufferSource.disconnect(0), u)) try {
4125
+ i.bufferSource.buffer = o._scratchBuffer;
4069
4126
  } catch {
4070
4127
  }
4071
- return r.bufferSource = null, s;
4072
- }, _clearSound: function(r) {
4073
- /MSIE |Trident\//.test(o._navigator && o._navigator.userAgent) || (r.src = "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA");
4128
+ return i.bufferSource = null, s;
4129
+ }, _clearSound: function(i) {
4130
+ /MSIE |Trident\//.test(o._navigator && o._navigator.userAgent) || (i.src = "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA");
4074
4131
  } };
4075
- var a = function(r) {
4076
- this._parent = r, this.init();
4132
+ var a = function(i) {
4133
+ this._parent = i, this.init();
4077
4134
  };
4078
4135
  a.prototype = { init: function() {
4079
- var r = this, s = r._parent;
4080
- return r._muted = s._muted, r._loop = s._loop, r._volume = s._volume, r._rate = s._rate, r._seek = 0, r._paused = !0, r._ended = !0, r._sprite = "__default", r._id = ++o._counter, s._sounds.push(r), r.create(), r;
4136
+ var i = this, s = i._parent;
4137
+ return i._muted = s._muted, i._loop = s._loop, i._volume = s._volume, i._rate = s._rate, i._seek = 0, i._paused = !0, i._ended = !0, i._sprite = "__default", i._id = ++o._counter, s._sounds.push(i), i.create(), i;
4081
4138
  }, create: function() {
4082
- var r = this, s = r._parent, u = o._muted || r._muted || r._parent._muted ? 0 : r._volume;
4083
- return s._webAudio ? (r._node = o.ctx.createGain === void 0 ? o.ctx.createGainNode() : o.ctx.createGain(), r._node.gain.setValueAtTime(u, o.ctx.currentTime), r._node.paused = !0, r._node.connect(o.masterGain)) : o.noAudio || (r._node = o._obtainHtml5Audio(), r._errorFn = r._errorListener.bind(r), r._node.addEventListener("error", r._errorFn, !1), r._loadFn = r._loadListener.bind(r), r._node.addEventListener(o._canPlayEvent, r._loadFn, !1), r._endFn = r._endListener.bind(r), r._node.addEventListener("ended", r._endFn, !1), r._node.src = s._src, r._node.preload = s._preload === !0 ? "auto" : s._preload, r._node.volume = u * o.volume(), r._node.load()), r;
4139
+ var i = this, s = i._parent, u = o._muted || i._muted || i._parent._muted ? 0 : i._volume;
4140
+ return s._webAudio ? (i._node = o.ctx.createGain === void 0 ? o.ctx.createGainNode() : o.ctx.createGain(), i._node.gain.setValueAtTime(u, o.ctx.currentTime), i._node.paused = !0, i._node.connect(o.masterGain)) : o.noAudio || (i._node = o._obtainHtml5Audio(), i._errorFn = i._errorListener.bind(i), i._node.addEventListener("error", i._errorFn, !1), i._loadFn = i._loadListener.bind(i), i._node.addEventListener(o._canPlayEvent, i._loadFn, !1), i._endFn = i._endListener.bind(i), i._node.addEventListener("ended", i._endFn, !1), i._node.src = s._src, i._node.preload = s._preload === !0 ? "auto" : s._preload, i._node.volume = u * o.volume(), i._node.load()), i;
4084
4141
  }, reset: function() {
4085
- var r = this, s = r._parent;
4086
- return r._muted = s._muted, r._loop = s._loop, r._volume = s._volume, r._rate = s._rate, r._seek = 0, r._rateSeek = 0, r._paused = !0, r._ended = !0, r._sprite = "__default", r._id = ++o._counter, r;
4142
+ var i = this, s = i._parent;
4143
+ return i._muted = s._muted, i._loop = s._loop, i._volume = s._volume, i._rate = s._rate, i._seek = 0, i._rateSeek = 0, i._paused = !0, i._ended = !0, i._sprite = "__default", i._id = ++o._counter, i;
4087
4144
  }, _errorListener: function() {
4088
- var r = this;
4089
- r._parent._emit("loaderror", r._id, r._node.error ? r._node.error.code : 0), r._node.removeEventListener("error", r._errorFn, !1);
4145
+ var i = this;
4146
+ i._parent._emit("loaderror", i._id, i._node.error ? i._node.error.code : 0), i._node.removeEventListener("error", i._errorFn, !1);
4090
4147
  }, _loadListener: function() {
4091
- var r = this, s = r._parent;
4092
- s._duration = Math.ceil(10 * r._node.duration) / 10, Object.keys(s._sprite).length === 0 && (s._sprite = { __default: [0, 1e3 * s._duration] }), s._state !== "loaded" && (s._state = "loaded", s._emit("load"), s._loadQueue()), r._node.removeEventListener(o._canPlayEvent, r._loadFn, !1);
4148
+ var i = this, s = i._parent;
4149
+ s._duration = Math.ceil(10 * i._node.duration) / 10, Object.keys(s._sprite).length === 0 && (s._sprite = { __default: [0, 1e3 * s._duration] }), s._state !== "loaded" && (s._state = "loaded", s._emit("load"), s._loadQueue()), i._node.removeEventListener(o._canPlayEvent, i._loadFn, !1);
4093
4150
  }, _endListener: function() {
4094
- var r = this, s = r._parent;
4095
- s._duration === 1 / 0 && (s._duration = Math.ceil(10 * r._node.duration) / 10, s._sprite.__default[1] === 1 / 0 && (s._sprite.__default[1] = 1e3 * s._duration), s._ended(r)), r._node.removeEventListener("ended", r._endFn, !1);
4151
+ var i = this, s = i._parent;
4152
+ s._duration === 1 / 0 && (s._duration = Math.ceil(10 * i._node.duration) / 10, s._sprite.__default[1] === 1 / 0 && (s._sprite.__default[1] = 1e3 * s._duration), s._ended(i)), i._node.removeEventListener("ended", i._endFn, !1);
4096
4153
  } };
4097
- var c = {}, l = function(r) {
4098
- var s = r._src;
4099
- if (c[s]) return r._duration = c[s].duration, void y(r);
4154
+ var c = {}, l = function(i) {
4155
+ var s = i._src;
4156
+ if (c[s]) return i._duration = c[s].duration, void y(i);
4100
4157
  if (/^data:[^;]+;base64,/.test(s)) {
4101
4158
  for (var u = atob(s.split(",")[1]), p = new Uint8Array(u.length), h = 0; h < u.length; ++h) p[h] = u.charCodeAt(h);
4102
- f(p.buffer, r);
4159
+ f(p.buffer, i);
4103
4160
  } else {
4104
4161
  var v = new XMLHttpRequest();
4105
- v.open(r._xhr.method, s, !0), v.withCredentials = r._xhr.withCredentials, v.responseType = "arraybuffer", r._xhr.headers && Object.keys(r._xhr.headers).forEach(function(_) {
4106
- v.setRequestHeader(_, r._xhr.headers[_]);
4162
+ v.open(i._xhr.method, s, !0), v.withCredentials = i._xhr.withCredentials, v.responseType = "arraybuffer", i._xhr.headers && Object.keys(i._xhr.headers).forEach(function(_) {
4163
+ v.setRequestHeader(_, i._xhr.headers[_]);
4107
4164
  }), v.onload = function() {
4108
4165
  var _ = (v.status + "")[0];
4109
- if (_ !== "0" && _ !== "2" && _ !== "3") return void r._emit("loaderror", null, "Failed loading audio file with status: " + v.status + ".");
4110
- f(v.response, r);
4166
+ if (_ !== "0" && _ !== "2" && _ !== "3") return void i._emit("loaderror", null, "Failed loading audio file with status: " + v.status + ".");
4167
+ f(v.response, i);
4111
4168
  }, v.onerror = function() {
4112
- r._webAudio && (r._html5 = !0, r._webAudio = !1, r._sounds = [], delete c[s], r.load());
4169
+ i._webAudio && (i._html5 = !0, i._webAudio = !1, i._sounds = [], delete c[s], i.load());
4113
4170
  }, d(v);
4114
4171
  }
4115
- }, d = function(r) {
4172
+ }, d = function(i) {
4116
4173
  try {
4117
- r.send();
4174
+ i.send();
4118
4175
  } catch {
4119
- r.onerror();
4176
+ i.onerror();
4120
4177
  }
4121
- }, f = function(r, s) {
4178
+ }, f = function(i, s) {
4122
4179
  var u = function() {
4123
4180
  s._emit("loaderror", null, "Decoding audio data failed.");
4124
4181
  }, p = function(h) {
4125
4182
  h && s._sounds.length > 0 ? (c[s._src] = h, y(s, h)) : u();
4126
4183
  };
4127
- typeof Promise < "u" && o.ctx.decodeAudioData.length === 1 ? o.ctx.decodeAudioData(r).then(p).catch(u) : o.ctx.decodeAudioData(r, p, u);
4128
- }, y = function(r, s) {
4129
- s && !r._duration && (r._duration = s.duration), Object.keys(r._sprite).length === 0 && (r._sprite = { __default: [0, 1e3 * r._duration] }), r._state !== "loaded" && (r._state = "loaded", r._emit("load"), r._loadQueue());
4184
+ typeof Promise < "u" && o.ctx.decodeAudioData.length === 1 ? o.ctx.decodeAudioData(i).then(p).catch(u) : o.ctx.decodeAudioData(i, p, u);
4185
+ }, y = function(i, s) {
4186
+ s && !i._duration && (i._duration = s.duration), Object.keys(i._sprite).length === 0 && (i._sprite = { __default: [0, 1e3 * i._duration] }), i._state !== "loaded" && (i._state = "loaded", i._emit("load"), i._loadQueue());
4130
4187
  }, g = function() {
4131
4188
  if (o.usingWebAudio) {
4132
4189
  try {
@@ -4135,21 +4192,21 @@ function Ca() {
4135
4192
  o.usingWebAudio = !1;
4136
4193
  }
4137
4194
  o.ctx || (o.usingWebAudio = !1);
4138
- var r = /iP(hone|od|ad)/.test(o._navigator && o._navigator.platform), s = o._navigator && o._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/), u = s ? parseInt(s[1], 10) : null;
4139
- if (r && u && u < 9) {
4195
+ var i = /iP(hone|od|ad)/.test(o._navigator && o._navigator.platform), s = o._navigator && o._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/), u = s ? parseInt(s[1], 10) : null;
4196
+ if (i && u && u < 9) {
4140
4197
  var p = /safari/.test(o._navigator && o._navigator.userAgent.toLowerCase());
4141
4198
  o._navigator && !p && (o.usingWebAudio = !1);
4142
4199
  }
4143
4200
  o.usingWebAudio && (o.masterGain = o.ctx.createGain === void 0 ? o.ctx.createGainNode() : o.ctx.createGain(), o.masterGain.gain.setValueAtTime(o._muted ? 0 : o._volume, o.ctx.currentTime), o.masterGain.connect(o.ctx.destination)), o._setup();
4144
4201
  }
4145
4202
  };
4146
- e.Howler = o, e.Howl = i, typeof t < "u" ? (t.HowlerGlobal = n, t.Howler = o, t.Howl = i, t.Sound = a) : typeof window < "u" && (window.HowlerGlobal = n, window.Howler = o, window.Howl = i, window.Sound = a);
4203
+ e.Howler = o, e.Howl = r, typeof t < "u" ? (t.HowlerGlobal = n, t.Howler = o, t.Howl = r, t.Sound = a) : typeof window < "u" && (window.HowlerGlobal = n, window.Howler = o, window.Howl = r, window.Sound = a);
4147
4204
  })();
4148
4205
  }(ze)), ze;
4149
4206
  }
4150
- var Et = Ca();
4151
- const Aa = typeof navigator < "u" && typeof navigator.standalone < "u";
4152
- class Oa {
4207
+ var Et = Aa();
4208
+ const Ta = typeof navigator < "u" && typeof navigator.standalone < "u";
4209
+ class Pa {
4153
4210
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4154
4211
  constructor(t) {
4155
4212
  this.cogsConnection = t, this.addEventListener("audioClipState", ({ detail: o }) => {
@@ -4158,8 +4215,8 @@ class Oa {
4158
4215
  switch (o.type) {
4159
4216
  case "media_config_update":
4160
4217
  if (this.globalVolume !== o.globalVolume && this.setGlobalVolume(o.globalVolume), o.audioOutput !== void 0) {
4161
- const i = t.getAudioSinkId(o.audioOutput);
4162
- this.setAudioSink(i ?? "");
4218
+ const r = t.getAudioSinkId(o.audioOutput);
4219
+ this.setAudioSink(r ?? "");
4163
4220
  }
4164
4221
  this.updateConfig(o.files);
4165
4222
  break;
@@ -4183,11 +4240,11 @@ class Oa {
4183
4240
  }
4184
4241
  });
4185
4242
  const n = () => {
4186
- const o = Object.entries(this.audioClipPlayers).map(([i, a]) => {
4243
+ const o = Object.entries(this.audioClipPlayers).map(([r, a]) => {
4187
4244
  const c = Object.values(a.activeClips), l = c.some(
4188
4245
  ({ state: d }) => d.type === "playing" || d.type === "pausing" || d.type === "stopping" || d.type === "play_requested" || d.type === "pause_requested" || d.type === "stop_requested"
4189
4246
  ) ? "playing" : c.some(({ state: d }) => d.type === "paused") ? "paused" : "stopped";
4190
- return [i, l];
4247
+ return [r, l];
4191
4248
  });
4192
4249
  t.sendInitialMediaClipStates({ mediaType: "audio", files: o });
4193
4250
  };
@@ -4200,7 +4257,7 @@ class Oa {
4200
4257
  setGlobalVolume(t) {
4201
4258
  this.globalVolume = t, Et.Howler.volume(t), this.notifyStateListeners();
4202
4259
  }
4203
- playAudioClip(t, { playId: n, volume: o, fade: i, loop: a }) {
4260
+ playAudioClip(t, { playId: n, volume: o, fade: r, loop: a }) {
4204
4261
  t in this.audioClipPlayers || (this.audioClipPlayers[t] = this.createClip(t, { preload: !1, ephemeral: !0 })), this.updateAudioClipPlayer(t, (c) => {
4205
4262
  const l = Object.entries(c.activeClips).filter(([, { state: g }]) => g.type === "paused").map(([g]) => parseInt(g)), d = Object.entries(c.activeClips).filter(([, { state: g }]) => g.type === "pausing").map(([g]) => parseInt(g));
4206
4263
  l.forEach((g) => {
@@ -4208,7 +4265,7 @@ class Oa {
4208
4265
  });
4209
4266
  const f = Object.entries(c.activeClips).filter(([, { state: g }]) => g.type === "pause_requested").map(([g]) => parseInt(g)), y = l.length > 0 || d.length > 0 || f.length > 0 ? [] : [c.player.play()];
4210
4267
  return d.forEach((g) => {
4211
- c.player.off("fade", void 0, g), c.player.loop(a, g), this.updateActiveAudioClip(t, g, (r) => ({ ...r, state: { type: "playing" } })), ne(i) ? oe(c.player, o, i * 1e3, g) : $e(c.player, o, g);
4268
+ c.player.off("fade", void 0, g), c.player.loop(a, g), this.updateActiveAudioClip(t, g, (i) => ({ ...i, state: { type: "playing" } })), ne(r) ? oe(c.player, o, r * 1e3, g) : $e(c.player, o, g);
4212
4269
  }), [...l, ...f, ...y].forEach((g) => {
4213
4270
  c.player.loop(a, g), c.player.off("play", void 0, g), c.player.off("pause", void 0, g), c.player.off("fade", void 0, g), c.player.off("end", void 0, g), c.player.off("stop", void 0, g), c.player.once("play", () => {
4214
4271
  Ie(c.player, this.sinkId);
@@ -4219,7 +4276,7 @@ class Oa {
4219
4276
  },
4220
4277
  g
4221
4278
  );
4222
- const r = {
4279
+ const i = {
4223
4280
  playId: n,
4224
4281
  state: { type: "play_requested" },
4225
4282
  loop: a,
@@ -4232,21 +4289,21 @@ class Oa {
4232
4289
  s?.type === "pause_requested" ? this.pauseAudioClip(t, { fade: s.fade }, g, !0) : s?.type === "stop_requested" ? this.stopAudioClip(t, { fade: s.fade }, g, !0) : this.updateActiveAudioClip(t, g, (u) => ({ ...u, state: { type: "playing" } }));
4233
4290
  },
4234
4291
  g
4235
- ), ne(i) ? (c.player.volume(0, g), c.player.mute(!1, g), c.player.once(
4292
+ ), ne(r) ? (c.player.volume(0, g), c.player.mute(!1, g), c.player.once(
4236
4293
  "play",
4237
4294
  () => {
4238
- oe(c.player, o, i * 1e3, g);
4295
+ oe(c.player, o, r * 1e3, g);
4239
4296
  },
4240
4297
  g
4241
- )) : $e(c.player, o, g), c.activeClips = { ...c.activeClips, [g]: r };
4298
+ )) : $e(c.player, o, g), c.activeClips = { ...c.activeClips, [g]: i };
4242
4299
  }), c;
4243
4300
  }), this.notifyClipStateListeners(n, t, "playing");
4244
4301
  }
4245
- pauseAudioClip(t, { fade: n }, o, i) {
4302
+ pauseAudioClip(t, { fade: n }, o, r) {
4246
4303
  Object.keys(this.audioClipPlayers[t]?.activeClips ?? {}).length !== 0 && this.updateAudioClipPlayer(t, (a) => (a.activeClips = Object.fromEntries(
4247
4304
  Object.entries(a.activeClips).map(([c, l]) => {
4248
4305
  const d = parseInt(c);
4249
- return (o === void 0 || o === d) && (i && l.state.type === "pause_requested" || l.state.type === "playing" || l.state.type === "pausing" ? ne(n) ? (a.player.once(
4306
+ return (o === void 0 || o === d) && (r && l.state.type === "pause_requested" || l.state.type === "playing" || l.state.type === "pausing" ? ne(n) ? (a.player.once(
4250
4307
  "fade",
4251
4308
  (f) => {
4252
4309
  a.player.pause(f), this.updateActiveAudioClip(t, f, (y) => ({ ...y, state: { type: "paused" } })), this.notifyClipStateListeners(l.playId, t, "paused");
@@ -4256,11 +4313,11 @@ class Oa {
4256
4313
  })
4257
4314
  ), a));
4258
4315
  }
4259
- stopAudioClip(t, { fade: n }, o, i) {
4260
- Ta("Stop audio clip", { activeClips: this.audioClipPlayers[t]?.activeClips }), Object.keys(this.audioClipPlayers[t]?.activeClips ?? {}).length !== 0 && this.updateAudioClipPlayer(t, (a) => (a.activeClips = Object.fromEntries(
4316
+ stopAudioClip(t, { fade: n }, o, r) {
4317
+ Sa("Stop audio clip", { activeClips: this.audioClipPlayers[t]?.activeClips }), Object.keys(this.audioClipPlayers[t]?.activeClips ?? {}).length !== 0 && this.updateAudioClipPlayer(t, (a) => (a.activeClips = Object.fromEntries(
4261
4318
  Object.entries(a.activeClips).map(([c, l]) => {
4262
4319
  const d = parseInt(c);
4263
- return (o === void 0 || o === d) && (i && l.state.type === "stop_requested" || l.state.type === "playing" || l.state.type === "pausing" || l.state.type === "paused" || l.state.type === "stopping" ? ne(n) && l.state.type !== "paused" ? (a.player.off("fade", d), oe(a.player, 0, n * 1e3, d), a.player.once(
4320
+ return (o === void 0 || o === d) && (r && l.state.type === "stop_requested" || l.state.type === "playing" || l.state.type === "pausing" || l.state.type === "paused" || l.state.type === "stopping" ? ne(n) && l.state.type !== "paused" ? (a.player.off("fade", d), oe(a.player, 0, n * 1e3, d), a.player.once(
4264
4321
  "fade",
4265
4322
  (f) => {
4266
4323
  a.player.loop(!1, f), a.player.stop(f);
@@ -4280,23 +4337,23 @@ class Oa {
4280
4337
  console.warn("Invalid volume", n);
4281
4338
  return;
4282
4339
  }
4283
- Object.keys(this.audioClipPlayers[t]?.activeClips ?? {}).length !== 0 && this.updateAudioClipPlayer(t, (i) => (i.activeClips = Object.fromEntries(
4284
- Object.entries(i.activeClips).map(([a, c]) => {
4340
+ Object.keys(this.audioClipPlayers[t]?.activeClips ?? {}).length !== 0 && this.updateAudioClipPlayer(t, (r) => (r.activeClips = Object.fromEntries(
4341
+ Object.entries(r.activeClips).map(([a, c]) => {
4285
4342
  if (c.state.type !== "pausing" && c.state.type !== "stopping") {
4286
4343
  const l = parseInt(a);
4287
- return ne(o) ? oe(i.player, n, o * 1e3, l) : $e(i.player, n, l), [a, { ...c, volume: n }];
4344
+ return ne(o) ? oe(r.player, n, o * 1e3, l) : $e(r.player, n, l), [a, { ...c, volume: n }];
4288
4345
  } else
4289
4346
  return [a, c];
4290
4347
  })
4291
- ), i));
4348
+ ), r));
4292
4349
  }
4293
4350
  handleStoppedClip(t, n, o) {
4294
- this.updateAudioClipPlayer(t, (i) => (delete i.activeClips[o], i)), this.notifyClipStateListeners(n, t, "stopped");
4351
+ this.updateAudioClipPlayer(t, (r) => (delete r.activeClips[o], r)), this.notifyClipStateListeners(n, t, "stopped");
4295
4352
  }
4296
4353
  updateActiveAudioClip(t, n, o) {
4297
4354
  this.updateAudioClipPlayer(
4298
4355
  t,
4299
- (i) => n in i.activeClips ? { ...i, activeClips: { ...i.activeClips, [n]: o(i.activeClips[n]) } } : i
4356
+ (r) => n in r.activeClips ? { ...r, activeClips: { ...r.activeClips, [n]: o(r.activeClips[n]) } } : r
4300
4357
  );
4301
4358
  }
4302
4359
  updateAudioClipPlayer(t, n) {
@@ -4311,33 +4368,33 @@ class Oa {
4311
4368
  }
4312
4369
  updateConfig(t) {
4313
4370
  const n = Object.fromEntries(
4314
- Object.entries(t).filter((i) => {
4315
- const a = i[1].type;
4371
+ Object.entries(t).filter((r) => {
4372
+ const a = r[1].type;
4316
4373
  return a === "audio" || !a;
4317
4374
  })
4318
4375
  ), o = this.audioClipPlayers;
4319
4376
  this.audioClipPlayers = (() => {
4320
- const i = { ...o };
4377
+ const r = { ...o };
4321
4378
  return Object.keys(o).filter(
4322
4379
  (d) => !(d in n) && !o[d].config.ephemeral
4323
4380
  ).forEach((d) => {
4324
- o[d].player.unload(), delete i[d];
4381
+ o[d].player.unload(), delete r[d];
4325
4382
  }), Object.entries(n).filter(([d]) => !o[d]).forEach(([d, f]) => {
4326
- i[d] = this.createClip(d, { ...f, ephemeral: !1 });
4383
+ r[d] = this.createClip(d, { ...f, ephemeral: !1 });
4327
4384
  }), Object.keys(o).filter((d) => d in n).forEach((d) => {
4328
- i[d] = this.updatedClip(d, i[d], { ...n[d], ephemeral: !1 });
4329
- }), i;
4385
+ r[d] = this.updatedClip(d, r[d], { ...n[d], ephemeral: !1 });
4386
+ }), r;
4330
4387
  })(), this.notifyStateListeners();
4331
4388
  }
4332
4389
  notifyStateListeners() {
4333
4390
  const t = Object.entries(this.audioClipPlayers).reduce(
4334
- (i, [a, c]) => (i[a] = {
4391
+ (r, [a, c]) => (r[a] = {
4335
4392
  config: { preload: c.config.preload, ephemeral: c.config.ephemeral },
4336
4393
  activeClips: c.activeClips
4337
- }, i),
4394
+ }, r),
4338
4395
  {}
4339
4396
  ), n = Object.values(this.audioClipPlayers).some(
4340
- ({ activeClips: i }) => Object.values(i).some((a) => a.state.type === "playing" || a.state.type === "pausing" || a.state.type === "stopping")
4397
+ ({ activeClips: r }) => Object.values(r).some((a) => a.state.type === "playing" || a.state.type === "pausing" || a.state.type === "stopping")
4341
4398
  ), o = {
4342
4399
  globalVolume: this.globalVolume,
4343
4400
  isPlaying: n,
@@ -4377,14 +4434,14 @@ class Oa {
4377
4434
  };
4378
4435
  }
4379
4436
  updatedClip(t, n, o) {
4380
- const i = { ...n, config: o };
4381
- return n.config.preload !== o.preload && (i.player.unload(), i.player = this.createPlayer(t, o)), i;
4437
+ const r = { ...n, config: o };
4438
+ return n.config.preload !== o.preload && (r.player.unload(), r.player = this.createPlayer(t, o)), r;
4382
4439
  }
4383
4440
  }
4384
- function Ta(...e) {
4441
+ function Sa(...e) {
4385
4442
  }
4386
4443
  function ne(e) {
4387
- return !Aa && typeof e == "number" && !isNaN(e) && e > 0;
4444
+ return !Ta && typeof e == "number" && !isNaN(e) && e > 0;
4388
4445
  }
4389
4446
  function Ie(e, t) {
4390
4447
  t !== void 0 && (e._html5 ? e._sounds?.forEach((n) => {
@@ -4400,23 +4457,23 @@ function oe(e, t, n, o) {
4400
4457
  var Le = /* @__PURE__ */ ((e) => (e.Paused = "paused", e.Playing = "playing", e))(Le || {});
4401
4458
  class Za {
4402
4459
  constructor(t, n = document.body) {
4403
- this.cogsConnection = t, this.parentElement = n, this.addEventListener("videoClipState", ({ detail: i }) => {
4404
- t.sendMediaClipState(i);
4405
- }), t.addEventListener("message", ({ message: i }) => {
4406
- switch (i.type) {
4460
+ this.cogsConnection = t, this.parentElement = n, this.addEventListener("videoClipState", ({ detail: r }) => {
4461
+ t.sendMediaClipState(r);
4462
+ }), t.addEventListener("message", ({ message: r }) => {
4463
+ switch (r.type) {
4407
4464
  case "media_config_update":
4408
- if (this.setGlobalVolume(i.globalVolume), i.audioOutput !== void 0) {
4409
- const a = t.getAudioSinkId(i.audioOutput);
4465
+ if (this.setGlobalVolume(r.globalVolume), r.audioOutput !== void 0) {
4466
+ const a = t.getAudioSinkId(r.audioOutput);
4410
4467
  this.setAudioSink(a ?? "");
4411
4468
  }
4412
- this.updateConfig(i.files);
4469
+ this.updateConfig(r.files);
4413
4470
  break;
4414
4471
  case "video_play":
4415
- this.playVideoClip(i.file, {
4416
- playId: i.playId,
4417
- volume: i.volume,
4418
- loop: !!i.loop,
4419
- fit: i.fit
4472
+ this.playVideoClip(r.file, {
4473
+ playId: r.playId,
4474
+ volume: r.volume,
4475
+ loop: !!r.loop,
4476
+ fit: r.fit
4420
4477
  });
4421
4478
  break;
4422
4479
  case "video_pause":
@@ -4426,19 +4483,19 @@ class Za {
4426
4483
  this.stopVideoClip();
4427
4484
  break;
4428
4485
  case "video_set_volume":
4429
- this.setVideoClipVolume({ volume: i.volume });
4486
+ this.setVideoClipVolume({ volume: r.volume });
4430
4487
  break;
4431
4488
  case "video_set_fit":
4432
- this.setVideoClipFit({ fit: i.fit });
4489
+ this.setVideoClipFit({ fit: r.fit });
4433
4490
  break;
4434
4491
  }
4435
4492
  });
4436
4493
  const o = () => {
4437
- const i = Object.entries(this.videoClipPlayers).map(([a, c]) => {
4494
+ const r = Object.entries(this.videoClipPlayers).map(([a, c]) => {
4438
4495
  const l = c.videoElement.paused ? c.videoElement.currentTime === 0 || c.videoElement.currentTime === c.videoElement.duration ? "paused" : "stopped" : "playing";
4439
4496
  return [a, l];
4440
4497
  });
4441
- t.sendInitialMediaClipStates({ mediaType: "video", files: i });
4498
+ t.sendInitialMediaClipStates({ mediaType: "video", files: r });
4442
4499
  };
4443
4500
  t.addEventListener("open", o), o();
4444
4501
  }
@@ -4462,8 +4519,8 @@ class Za {
4462
4519
  pe(n.videoElement, n.volume * t);
4463
4520
  }), this.globalVolume = t, this.notifyStateListeners();
4464
4521
  }
4465
- playVideoClip(t, { playId: n, volume: o, loop: i, fit: a }) {
4466
- this.videoClipPlayers[t] || (this.videoClipPlayers[t] = this.createClipPlayer(t, { preload: "none", ephemeral: !0, fit: a })), this.pendingClip && this.updateVideoClipPlayer(this.pendingClip.path, (c) => (c.videoElement.load(), c)), this.activeClip?.path !== t && (this.pendingClip = { path: t, playId: n, actionOncePlaying: "play" }), this.updateVideoClipPlayer(t, (c) => (c.volume = o, pe(c.videoElement, o * this.globalVolume), c.videoElement.loop = i, c.videoElement.style.objectFit = a, c.videoElement.currentTime === c.videoElement.duration && (c.videoElement.currentTime = 0), c.videoElement.play(), this.activeClip || (c.videoElement.style.display = "block"), c));
4522
+ playVideoClip(t, { playId: n, volume: o, loop: r, fit: a }) {
4523
+ this.videoClipPlayers[t] || (this.videoClipPlayers[t] = this.createClipPlayer(t, { preload: "none", ephemeral: !0, fit: a })), this.pendingClip && this.updateVideoClipPlayer(this.pendingClip.path, (c) => (c.videoElement.load(), c)), this.activeClip?.path !== t && (this.pendingClip = { path: t, playId: n, actionOncePlaying: "play" }), this.updateVideoClipPlayer(t, (c) => (c.volume = o, pe(c.videoElement, o * this.globalVolume), c.videoElement.loop = r, c.videoElement.style.objectFit = a, c.videoElement.currentTime === c.videoElement.duration && (c.videoElement.currentTime = 0), c.videoElement.play(), this.activeClip || (c.videoElement.style.display = "block"), c));
4467
4524
  }
4468
4525
  pauseVideoClip() {
4469
4526
  if (this.pendingClip && (this.pendingClip.actionOncePlaying = "pause"), this.activeClip) {
@@ -4506,20 +4563,20 @@ class Za {
4506
4563
  this.sinkId = t;
4507
4564
  }
4508
4565
  updateConfig(t) {
4509
- const n = Object.fromEntries(Object.entries(t).filter(([, { type: i }]) => i === "video" || !i)), o = this.videoClipPlayers;
4566
+ const n = Object.fromEntries(Object.entries(t).filter(([, { type: r }]) => r === "video" || !r)), o = this.videoClipPlayers;
4510
4567
  this.videoClipPlayers = (() => {
4511
- const i = { ...o };
4568
+ const r = { ...o };
4512
4569
  return Object.keys(o).filter((d) => !(d in n)).forEach((d) => {
4513
- this.activeClip?.path === d && o[d]?.config.ephemeral === !1 ? this.updateVideoClipPlayer(d, (f) => (f.config = { ...f.config, ephemeral: !0 }, f)) : (this.unloadClip(d), delete i[d]);
4570
+ this.activeClip?.path === d && o[d]?.config.ephemeral === !1 ? this.updateVideoClipPlayer(d, (f) => (f.config = { ...f.config, ephemeral: !0 }, f)) : (this.unloadClip(d), delete r[d]);
4514
4571
  }), Object.entries(n).filter(([d]) => !o[d]).forEach(([d, f]) => {
4515
- i[d] = this.createClipPlayer(d, { ...f, preload: kt(f.preload), ephemeral: !1, fit: "contain" });
4572
+ r[d] = this.createClipPlayer(d, { ...f, preload: kt(f.preload), ephemeral: !1, fit: "contain" });
4516
4573
  }), Object.entries(o).filter(([d]) => d in n).forEach(([d, f]) => {
4517
4574
  f.config.preload !== n[d].preload && this.updateVideoClipPlayer(d, (y) => (y.config = {
4518
4575
  ...y.config,
4519
4576
  preload: kt(n[d].preload),
4520
4577
  ephemeral: !1
4521
4578
  }, y.videoElement.preload = y.config.preload, y));
4522
- }), i;
4579
+ }), r;
4523
4580
  })(), this.notifyStateListeners();
4524
4581
  }
4525
4582
  notifyStateListeners() {
@@ -4550,36 +4607,36 @@ class Za {
4550
4607
  this.eventTarget.dispatchEvent(new CustomEvent(t, { detail: n }));
4551
4608
  }
4552
4609
  createVideoElement(t, n, { volume: o }) {
4553
- const i = document.createElement("video");
4554
- return i.playsInline = !0, i.src = this.cogsConnection.getAssetUrl(t), i.autoplay = !1, i.loop = !1, pe(i, o * this.globalVolume), i.preload = n.preload, i.addEventListener("playing", () => {
4610
+ const r = document.createElement("video");
4611
+ return r.playsInline = !0, r.src = this.cogsConnection.getAssetUrl(t), r.autoplay = !1, r.loop = !1, pe(r, o * this.globalVolume), r.preload = n.preload, r.addEventListener("playing", () => {
4555
4612
  if (this.pendingClip?.path === t) {
4556
4613
  switch (this.pendingClip.actionOncePlaying) {
4557
4614
  case "play": {
4558
- i.style.display = "block", this.notifyClipStateListeners(this.pendingClip.playId, t, "playing");
4615
+ r.style.display = "block", this.notifyClipStateListeners(this.pendingClip.playId, t, "playing");
4559
4616
  break;
4560
4617
  }
4561
4618
  case "pause": {
4562
- i.style.display = "block", i.pause(), this.notifyClipStateListeners(this.pendingClip.playId, t, "paused");
4619
+ r.style.display = "block", r.pause(), this.notifyClipStateListeners(this.pendingClip.playId, t, "paused");
4563
4620
  break;
4564
4621
  }
4565
4622
  case "stop": {
4566
- i.pause(), this.notifyClipStateListeners(this.pendingClip.playId, t, "stopped");
4623
+ r.pause(), this.notifyClipStateListeners(this.pendingClip.playId, t, "stopped");
4567
4624
  break;
4568
4625
  }
4569
4626
  }
4570
4627
  this.activeClip && this.handleStoppedClip(this.activeClip.path), this.activeClip = this.pendingClip, this.pendingClip = void 0;
4571
- } else this.activeClip?.path === t ? this.notifyClipStateListeners(this.activeClip.playId, t, "playing") : i.pause();
4572
- }), i.addEventListener("ended", () => {
4573
- !this.pendingClip && !i.loop && this.handleStoppedClip(t);
4574
- }), i.style.position = "absolute", i.style.top = "0", i.style.left = "0", i.style.width = "100%", i.style.height = "100%", i.style.objectFit = n.fit, i.style.display = "none", this.parentElement.appendChild(i), i;
4628
+ } else this.activeClip?.path === t ? this.notifyClipStateListeners(this.activeClip.playId, t, "playing") : r.pause();
4629
+ }), r.addEventListener("ended", () => {
4630
+ !this.pendingClip && !r.loop && this.handleStoppedClip(t);
4631
+ }), r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.width = "100%", r.style.height = "100%", r.style.objectFit = n.fit, r.style.display = "none", this.parentElement.appendChild(r), r;
4575
4632
  }
4576
4633
  createClipPlayer(t, n) {
4577
- const i = {
4634
+ const r = {
4578
4635
  config: n,
4579
4636
  videoElement: this.createVideoElement(t, n, { volume: 1 }),
4580
4637
  volume: 1
4581
4638
  };
4582
- return Ct(i, this.sinkId), i;
4639
+ return Ct(r, this.sinkId), r;
4583
4640
  }
4584
4641
  unloadClip(t) {
4585
4642
  if (this.activeClip?.path === t) {
@@ -4598,13 +4655,13 @@ function Ct(e, t) {
4598
4655
  function pe(e, t) {
4599
4656
  e.volume = t, e.muted = t === 0;
4600
4657
  }
4601
- const Pa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4658
+ const xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4602
4659
  __proto__: null
4603
4660
  }, Symbol.toStringTag, { value: "Module" }));
4604
4661
  export {
4605
- Oa as CogsAudioPlayer,
4662
+ Pa as CogsAudioPlayer,
4606
4663
  Cn as CogsConfigChangedEvent,
4607
- za as CogsConnection,
4664
+ Ia as CogsConnection,
4608
4665
  En as CogsConnectionCloseEvent,
4609
4666
  wn as CogsConnectionOpenEvent,
4610
4667
  Tn as CogsIncomingEvent,
@@ -4613,13 +4670,14 @@ export {
4613
4670
  zn as CogsShowPhaseChangedEvent,
4614
4671
  An as CogsStateChangedEvent,
4615
4672
  Za as CogsVideoPlayer,
4616
- ka as DATA_CLIP_ID,
4673
+ Ca as DATA_CLIP_ID,
4617
4674
  Ke as DataStoreItemEvent,
4618
4675
  He as DataStoreItemsEvent,
4619
- Pa as ManifestTypes,
4620
- Ia as MediaSchema,
4621
- $a as SurfaceManager,
4676
+ xa as ManifestTypes,
4677
+ ka as MediaPreloader,
4678
+ $a as MediaSchema,
4679
+ Oa as SurfaceManager,
4622
4680
  dn as assetUrl,
4623
4681
  Ee as getStateAtTime,
4624
- Sa as preloadUrl
4682
+ za as preloadUrl
4625
4683
  };