playlist-data-engine 1.5.5 → 1.5.6

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.
@@ -116,17 +116,17 @@ const yl = {
116
116
  smooth: 40
117
117
  // Cleaner peaks, less noise
118
118
  };
119
- function Ar(s = { mode: "standard" }) {
119
+ function kr(s = { mode: "standard" }) {
120
120
  if (s.mode === "custom") {
121
121
  const e = s.customValue ?? Ga.standard;
122
122
  return Math.max(1, Math.min(50, e));
123
123
  }
124
124
  return Ga[s.mode];
125
125
  }
126
- function Mr(s = { mode: "standard" }) {
126
+ function Ar(s = { mode: "standard" }) {
127
127
  return bl[s.mode];
128
128
  }
129
- function kr(s = { mode: "standard" }) {
129
+ function Mr(s = { mode: "standard" }) {
130
130
  return wl[s.mode];
131
131
  }
132
132
  const ii = {
@@ -164,7 +164,7 @@ const ii = {
164
164
  useInterpolatedBeats: !1,
165
165
  ignoreKeyRequirements: !1
166
166
  }, qv = Cr;
167
- function An(s) {
167
+ function kn(s) {
168
168
  switch (s) {
169
169
  case "easy":
170
170
  return yl;
@@ -212,7 +212,7 @@ function Gv(s) {
212
212
  const Ir = {
213
213
  beatSubdivisions: /* @__PURE__ */ new Map(),
214
214
  defaultSubdivision: "quarter"
215
- }, Ua = 4, Mn = [
215
+ }, Ua = 4, An = [
216
216
  "quarter",
217
217
  "half",
218
218
  "eighth",
@@ -225,8 +225,8 @@ const Ir = {
225
225
  "offbeat8",
226
226
  "rest"
227
227
  ];
228
- function kn(s) {
229
- return typeof s == "string" && Mn.includes(s);
228
+ function Mn(s) {
229
+ return typeof s == "string" && An.includes(s);
230
230
  }
231
231
  function Dr(s) {
232
232
  switch (s) {
@@ -264,14 +264,14 @@ function Er(s) {
264
264
  throw new Error(
265
265
  `Beat index must be non-negative, got ${e}`
266
266
  );
267
- if (!kn(t))
267
+ if (!Mn(t))
268
268
  throw new Error(
269
- `Beat ${e}: Invalid subdivision type "${t}". Valid types: ${Mn.join(", ")}`
269
+ `Beat ${e}: Invalid subdivision type "${t}". Valid types: ${An.join(", ")}`
270
270
  );
271
271
  }
272
- if (!kn(s.defaultSubdivision))
272
+ if (!Mn(s.defaultSubdivision))
273
273
  throw new Error(
274
- `Invalid defaultSubdivision "${s.defaultSubdivision}". Valid types: ${Mn.join(", ")}`
274
+ `Invalid defaultSubdivision "${s.defaultSubdivision}". Valid types: ${An.join(", ")}`
275
275
  );
276
276
  }
277
277
  function Tl(s, e) {
@@ -298,7 +298,7 @@ const Cl = {
298
298
  timingTolerance: 0.01,
299
299
  userOffsetMs: 0,
300
300
  compensateOutputLatency: !0
301
- }, Al = "1.0.0", Ml = "ellis-dp-v1", _t = [
301
+ }, kl = "1.0.0", Al = "ellis-dp-v1", _t = [
302
302
  { tier: "D", minHotness: 0, maxHotness: 33, windowMs: 31 },
303
303
  { tier: "C", minHotness: 33, maxHotness: 66, windowMs: 25 },
304
304
  { tier: "B", minHotness: 66, maxHotness: 100, windowMs: 20 },
@@ -313,7 +313,7 @@ function en(s) {
313
313
  return e.tier;
314
314
  return "Platinum";
315
315
  }
316
- function kl(s) {
316
+ function Ml(s) {
317
317
  const e = _t.findIndex(
318
318
  (c) => s >= c.minHotness && s < c.maxHotness
319
319
  );
@@ -1816,7 +1816,7 @@ class ye {
1816
1816
  else if (u) {
1817
1817
  o = this.calculateSaveDC(e, u);
1818
1818
  for (const g of i) {
1819
- const y = u.toLowerCase() === "dexterity" && g.statusEffects.some((S) => S.mechanicalEffects?.disadvantageOnDexSaves);
1819
+ const y = u.toLowerCase() === "dexterity" && g.statusEffects.some((_) => _.mechanicalEffects?.disadvantageOnDexSaves);
1820
1820
  this.makeSavingThrow(g, u, o, y) || (r = this.diceRoller ? this.diceRoller.calculateDamage(c, 0, !1) : ue.calculateDamage(c, 0, !1), g.currentHP -= r.total, g.currentHP < 0 && (g.currentHP = 0, g.isDefeated = !0));
1821
1821
  }
1822
1822
  }
@@ -2067,16 +2067,16 @@ class Gl {
2067
2067
  assessThreat(e, t) {
2068
2068
  const i = e.character.hp.max, n = i > 0 ? e.currentHP / i : 0, a = this.getAllies(e, t), r = this.getEnemies(e, t), o = a.reduce((y, v) => {
2069
2069
  if (v.id === e.id) return y;
2070
- const S = v.character.hp.max, T = S > 0 ? v.currentHP / S : 0;
2070
+ const _ = v.character.hp.max, T = _ > 0 ? v.currentHP / _ : 0;
2071
2071
  return Math.min(y, T);
2072
2072
  }, 1), c = r.reduce(
2073
2073
  (y, v) => Math.min(y, v.currentHP),
2074
2074
  r.length > 0 ? 1 / 0 : 0
2075
2075
  ), l = r.reduce((y, v) => {
2076
- const S = v.character.equipment?.weapons.filter((_) => _.equipped) || [];
2076
+ const _ = v.character.equipment?.weapons.filter((S) => S.equipped) || [];
2077
2077
  let T = 5;
2078
- for (const _ of S) {
2079
- const I = Vt[_.name], D = _.damage_dice || (typeof _.damage != "string" ? _.damage?.dice : void 0) || I?.damage?.dice || "1d6", R = this.averageDamageFromFormula(D);
2078
+ for (const S of _) {
2079
+ const I = Vt[S.name], D = S.damage_dice || (typeof S.damage != "string" ? S.damage?.dice : void 0) || I?.damage?.dice || "1d6", R = this.averageDamageFromFormula(D);
2080
2080
  R > T && (T = R);
2081
2081
  }
2082
2082
  return Math.max(y, T);
@@ -3257,11 +3257,11 @@ function Br(s) {
3257
3257
  function eb(s, e = 1) {
3258
3258
  return Math.round(s * e);
3259
3259
  }
3260
- function ki(s) {
3260
+ function Mi(s) {
3261
3261
  return s <= 0 ? 1 : s >= 15 ? Za[15] : Za[s] || 1;
3262
3262
  }
3263
3263
  function tb(s, e) {
3264
- const t = s.reduce((n, a) => n + Pr(a), 0), i = e !== void 0 ? e : ki(s.length);
3264
+ const t = s.reduce((n, a) => n + Pr(a), 0), i = e !== void 0 ? e : Mi(s.length);
3265
3265
  return Math.round(t * i);
3266
3266
  }
3267
3267
  function Xl(s) {
@@ -7300,7 +7300,7 @@ class xn {
7300
7300
  static validateFeatureReference(e, t) {
7301
7301
  const i = [];
7302
7302
  if (typeof e == "string") {
7303
- const n = ke.getInstance(), a = n.getClassFeatureById(e), r = a ? void 0 : n.getRacialTraitById(e);
7303
+ const n = Me.getInstance(), a = n.getClassFeatureById(e), r = a ? void 0 : n.getRacialTraitById(e);
7304
7304
  !a && !r && i.push(
7305
7305
  `grantsFeatures[${t}]: Feature "${e}" not found in FeatureQuery`
7306
7306
  );
@@ -7333,7 +7333,7 @@ class xn {
7333
7333
  * @returns True if feature exists in registry
7334
7334
  */
7335
7335
  static validateEquipmentFeatureReference(e) {
7336
- const t = ke.getInstance(), i = t.getClassFeatureById(e), n = i ? void 0 : t.getRacialTraitById(e);
7336
+ const t = Me.getInstance(), i = t.getClassFeatureById(e), n = i ? void 0 : t.getRacialTraitById(e);
7337
7337
  return !!(i || n);
7338
7338
  }
7339
7339
  /**
@@ -8602,7 +8602,7 @@ class it {
8602
8602
  };
8603
8603
  }
8604
8604
  }
8605
- function Ab() {
8605
+ function kb() {
8606
8606
  return it.getInstance();
8607
8607
  }
8608
8608
  class Y {
@@ -8952,7 +8952,7 @@ ${d.errors?.join(`
8952
8952
  * Reset all categories to defaults
8953
8953
  */
8954
8954
  resetAll() {
8955
- this.extensions.clear(), this.customWeights.clear(), it.getInstance().invalidateCache(), Ne.getInstance().invalidateCache(), ke.getInstance().invalidateCache();
8955
+ this.extensions.clear(), this.customWeights.clear(), it.getInstance().invalidateCache(), Ne.getInstance().invalidateCache(), Me.getInstance().invalidateCache();
8956
8956
  }
8957
8957
  /**
8958
8958
  * Get the registry type for a given category
@@ -8977,7 +8977,7 @@ ${d.errors?.join(`
8977
8977
  */
8978
8978
  invalidateRegistryCache(e) {
8979
8979
  const t = this.getRegistryForCategory(e);
8980
- t === "spell" ? it.getInstance().invalidateCache() : t === "skill" ? Ne.getInstance().invalidateCache() : t === "feature" && ke.getInstance().invalidateCache();
8980
+ t === "spell" ? it.getInstance().invalidateCache() : t === "skill" ? Ne.getInstance().invalidateCache() : t === "feature" && Me.getInstance().invalidateCache();
8981
8981
  }
8982
8982
  /**
8983
8983
  * Get information about registered extensions
@@ -9465,12 +9465,12 @@ const _u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9465
9465
  traits: ["Darkvision", "Hellish Resistance", "Infernal Legacy"],
9466
9466
  description: "Tieflings are humanoids with infernal blood, often bearing horns, tails, and other fiendish features. Their ancestry grants them resistance to fire and innate magical abilities. Though often feared and distrusted due to their appearance, tieflings are as varied in morality and ambition as any other race, with many becoming powerful warlocks, sorcerers, or charismatic leaders."
9467
9467
  }
9468
- }, Mb = qr, Tu = Object.entries(qr).map(([s, e]) => ({
9468
+ }, Ab = qr, Tu = Object.entries(qr).map(([s, e]) => ({
9469
9469
  race: s,
9470
9470
  ...e
9471
9471
  }));
9472
9472
  let rn = null, on = null;
9473
- async function kb(s) {
9473
+ async function Mb(s) {
9474
9474
  try {
9475
9475
  rn || (on || (on = Promise.resolve().then(() => _u)), rn = (await on).ExtensionManager);
9476
9476
  const t = rn.getInstance().get("races.data");
@@ -9493,7 +9493,7 @@ function Xn(s) {
9493
9493
  } catch {
9494
9494
  }
9495
9495
  }
9496
- class ke {
9496
+ class Me {
9497
9497
  constructor() {
9498
9498
  this.allClassFeaturesCache = null, this.classFeaturesIndex = null, this.allRacialTraitsCache = null, this.racialTraitsIndex = null, this.manager = Y.getInstance();
9499
9499
  }
@@ -9501,7 +9501,7 @@ class ke {
9501
9501
  * Get the singleton instance
9502
9502
  */
9503
9503
  static getInstance() {
9504
- return ke.instance || (ke.instance = new ke()), ke.instance;
9504
+ return Me.instance || (Me.instance = new Me()), Me.instance;
9505
9505
  }
9506
9506
  /**
9507
9507
  * Invalidate all caches
@@ -9920,7 +9920,7 @@ class ke {
9920
9920
  */
9921
9921
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9922
9922
  static getEquipmentFeatures(e) {
9923
- const t = ke.getInstance(), i = [], n = t.getAllClassFeaturesArray();
9923
+ const t = Me.getInstance(), i = [], n = t.getAllClassFeaturesArray();
9924
9924
  for (const a of n)
9925
9925
  (a.tags?.includes("equipment") || a.tags?.includes("item") || a.source === "custom") && i.push(a);
9926
9926
  return i;
@@ -9936,7 +9936,7 @@ class ke {
9936
9936
  * @returns True if the feature exists and can be granted by equipment
9937
9937
  */
9938
9938
  static isValidEquipmentFeature(e) {
9939
- return !!ke.getInstance().getClassFeatureById(e);
9939
+ return !!Me.getInstance().getClassFeatureById(e);
9940
9940
  }
9941
9941
  /**
9942
9942
  * Get all racial traits as a plain object (for debugging/serialization)
@@ -9956,7 +9956,7 @@ class ke {
9956
9956
  }
9957
9957
  }
9958
9958
  function Ib() {
9959
- return ke.getInstance();
9959
+ return Me.getInstance();
9960
9960
  }
9961
9961
  const Cu = {
9962
9962
  // === WEAPONS ===
@@ -10139,12 +10139,12 @@ function Jn(s, e) {
10139
10139
  (t) => t.archetypes.includes(s) && t.rarities.includes(e)
10140
10140
  );
10141
10141
  }
10142
- function Au(s, e) {
10142
+ function ku(s, e) {
10143
10143
  return Jn(s, e).filter(
10144
10144
  (t) => t.type === "weapon"
10145
10145
  );
10146
10146
  }
10147
- function Mu(s, e) {
10147
+ function Au(s, e) {
10148
10148
  return Jn(s, e).filter(
10149
10149
  (t) => t.type === "armor"
10150
10150
  );
@@ -10193,7 +10193,7 @@ const $e = class $e {
10193
10193
  * @returns Selected weapon template
10194
10194
  */
10195
10195
  static selectWeapon(e, t, i) {
10196
- const n = Au(e, t);
10196
+ const n = ku(e, t);
10197
10197
  if (n.length === 0)
10198
10198
  return St.find((o) => o.id === "dagger");
10199
10199
  const a = $e.WEAPON_PRIORITY[e][t], r = n.filter((o) => a.includes(o.id));
@@ -10210,7 +10210,7 @@ const $e = class $e {
10210
10210
  * @returns Selected armor template
10211
10211
  */
10212
10212
  static selectArmor(e, t, i) {
10213
- const n = Mu(e, t);
10213
+ const n = Au(e, t);
10214
10214
  if (n.length === 0)
10215
10215
  return St.find((o) => o.id === "leather-armor");
10216
10216
  const a = $e.ARMOR_PRIORITY[e][t], r = n.filter((o) => a.includes(o.id));
@@ -10876,10 +10876,10 @@ class Ze {
10876
10876
  const v = li[n]?.[p];
10877
10877
  if (!v || v === 0)
10878
10878
  continue;
10879
- const S = [...y];
10880
- for (let T = 0; T < v && S.length > 0; T++) {
10881
- const _ = r.randomInt(0, S.length), I = S[_];
10882
- h.push(I), S.splice(_, 1);
10879
+ const _ = [...y];
10880
+ for (let T = 0; T < v && _.length > 0; T++) {
10881
+ const S = r.randomInt(0, _.length), I = _[S];
10882
+ h.push(I), _.splice(S, 1);
10883
10883
  }
10884
10884
  }
10885
10885
  const f = c.spells - h.length;
@@ -10887,13 +10887,13 @@ class Ze {
10887
10887
  const p = [];
10888
10888
  for (const v of m) {
10889
10889
  if (v > l) break;
10890
- const S = o[`level${v}`];
10891
- S && p.push(...S);
10890
+ const _ = o[`level${v}`];
10891
+ _ && p.push(..._);
10892
10892
  }
10893
10893
  const y = [...p];
10894
10894
  for (let v = 0; v < f && y.length > 0; v++) {
10895
- const S = r.randomInt(0, y.length), T = y[S];
10896
- h.some((_) => _.id === T.id) || h.push(T), y.splice(S, 1);
10895
+ const _ = r.randomInt(0, y.length), T = y[_];
10896
+ h.some((S) => S.id === T.id) || h.push(T), y.splice(_, 1);
10897
10897
  }
10898
10898
  }
10899
10899
  const g = Ze.getSpellSlotsForCR(n);
@@ -10940,9 +10940,9 @@ class Ze {
10940
10940
  if (!y || y === 0)
10941
10941
  continue;
10942
10942
  const v = [...p];
10943
- for (let S = 0; S < y && v.length > 0; S++) {
10944
- const T = a.randomInt(0, v.length), _ = v[T];
10945
- d.push(_), v.splice(T, 1);
10943
+ for (let _ = 0; _ < y && v.length > 0; _++) {
10944
+ const T = a.randomInt(0, v.length), S = v[T];
10945
+ d.push(S), v.splice(T, 1);
10946
10946
  }
10947
10947
  }
10948
10948
  const m = o.spells - d.length;
@@ -10955,8 +10955,8 @@ class Ze {
10955
10955
  }
10956
10956
  const p = [...g];
10957
10957
  for (let y = 0; y < m && p.length > 0; y++) {
10958
- const v = a.randomInt(0, p.length), S = p[v];
10959
- d.some((T) => T.id === S.id) || d.push(S), p.splice(v, 1);
10958
+ const v = a.randomInt(0, p.length), _ = p[v];
10959
+ d.some((T) => T.id === _.id) || d.push(_), p.splice(v, 1);
10960
10960
  }
10961
10961
  }
10962
10962
  const f = Ze.getSpellSlotsForCR(n);
@@ -11338,7 +11338,7 @@ const di = {
11338
11338
  20: 5,
11339
11339
  // CR 21+: 6 per day (ancient dragons, demon lords, etc.)
11340
11340
  21: 6
11341
- }, ku = 3;
11341
+ }, Mu = 3;
11342
11342
  class Ke {
11343
11343
  /**
11344
11344
  * Generate legendary configuration for a boss enemy
@@ -11417,7 +11417,7 @@ class Ke {
11417
11417
  n.push(u), a.add(u.id);
11418
11418
  }
11419
11419
  }
11420
- const r = ku - n.length, o = e.filter((l) => !a.has(l.id)), c = t.shuffle(o);
11420
+ const r = Mu - n.length, o = e.filter((l) => !a.has(l.id)), c = t.shuffle(o);
11421
11421
  for (let l = 0; l < r && l < c.length; l++)
11422
11422
  n.push(c[l]);
11423
11423
  return n;
@@ -12068,7 +12068,7 @@ const U = class U {
12068
12068
  * @returns Array of selected feature objects
12069
12069
  */
12070
12070
  static selectExtraAbilities(e, t, i) {
12071
- const n = U.ARCHETYPE_TAGS[e], r = ke.getInstance().getAllClassFeatures(), o = [];
12071
+ const n = U.ARCHETYPE_TAGS[e], r = Me.getInstance().getAllClassFeatures(), o = [];
12072
12072
  for (const d of r.values())
12073
12073
  o.push(...d);
12074
12074
  const c = o.filter((d) => !d.tags || d.tags.length === 0 ? !1 : d.tags.some(
@@ -12179,11 +12179,11 @@ const U = class U {
12179
12179
  u?.hpLevel !== void 0 ? y = bs(h.baseHP, u.hpLevel, r) : y = bs(h.baseHP, f, r), o !== 1 && (y = Math.round(y * o));
12180
12180
  const v = Math.ceil(1 + (f - 1) / 4);
12181
12181
  Ze.shouldHaveSpellcasting(h.archetype, r);
12182
- const { abilities: S, spellConfig: T } = U.generateAbilities(h, r, d, m, g, f, u);
12183
- let _ = S;
12182
+ const { abilities: _, spellConfig: T } = U.generateAbilities(h, r, d, m, g, f, u);
12183
+ let S = _;
12184
12184
  if (r === "boss") {
12185
- const j = _[0];
12186
- _ = U.generateBossFeatures(
12185
+ const j = S[0];
12186
+ S = U.generateBossFeatures(
12187
12187
  h,
12188
12188
  j,
12189
12189
  d
@@ -12211,7 +12211,7 @@ const U = class U {
12211
12211
  legendary_effect: X.effect,
12212
12212
  legendary_damage: X.damage,
12213
12213
  legendary_damage_type: X.damageType
12214
- })), _.push(...I);
12214
+ })), S.push(...I);
12215
12215
  }
12216
12216
  const R = Ct.generate({
12217
12217
  archetype: h.archetype,
@@ -12308,7 +12308,7 @@ const U = class U {
12308
12308
  racial_traits: [],
12309
12309
  // Enemies don't have racial traits
12310
12310
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12311
- class_features: _.map((j) => j.id || j.name || `${j}`),
12311
+ class_features: S.map((j) => j.id || j.name || `${j}`),
12312
12312
  // Equipment - enemies now use generated equipment
12313
12313
  equipment: {
12314
12314
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -12534,8 +12534,8 @@ const U = class U {
12534
12534
  throw new Error(
12535
12535
  `Boss encounters must have count=1. Requested count=${n} with baseRarity='boss'. Boss enemies are designed for solo encounters against a party. Use a lower rarity (common/uncommon/elite) for multi-enemy encounters, or set count=1 for a boss encounter.`
12536
12536
  );
12537
- const y = e.map((Z) => Z.level), v = Zn(y, a), S = Math.round(v * c), T = ki(n), _ = Math.round(S / T / n);
12538
- let I = Br(_);
12537
+ const y = e.map((Z) => Z.level), v = Zn(y, a), _ = Math.round(v * c), T = Mi(n), S = Math.round(_ / T / n);
12538
+ let I = Br(S);
12539
12539
  const D = U.getSeededRNG(i), R = D.random();
12540
12540
  R < 0.25 ? I = Math.min(I * 1.5, 30) : R > 0.75 && (I = Math.max(I * 0.67, 0.125));
12541
12541
  const q = o ? U.getRarityDistribution(n, I) : Array(n).fill(r), O = U.selectTemplatesForMix(
@@ -12627,10 +12627,10 @@ const U = class U {
12627
12627
  throw new Error(
12628
12628
  `Boss encounters must have count=1. Requested count=${i} with baseRarity='boss'. Boss enemies are designed for solo encounters against a party. Use a lower rarity (common/uncommon/elite) for multi-enemy encounters, or set count=1 for a boss encounter.`
12629
12629
  );
12630
- const y = ki(i);
12630
+ const y = Mi(i);
12631
12631
  let v = n;
12632
12632
  y > 1 && i > 1 && (v = Math.max(n / Math.sqrt(y), 0.125));
12633
- const S = r ? U.getRarityDistribution(i, n) : Array(i).fill(a), T = U.getSeededRNG(t), _ = U.selectTemplatesForMix(
12633
+ const _ = r ? U.getRarityDistribution(i, n) : Array(i).fill(a), T = U.getSeededRNG(t), S = U.selectTemplatesForMix(
12634
12634
  i,
12635
12635
  T,
12636
12636
  d,
@@ -12640,7 +12640,7 @@ const U = class U {
12640
12640
  m
12641
12641
  ), I = [];
12642
12642
  for (let D = 0; D < i; D++) {
12643
- const R = _[D];
12643
+ const R = S[D];
12644
12644
  if (!R)
12645
12645
  throw new Error(`No template available for enemy at index ${D}`);
12646
12646
  const q = U.generate({
@@ -12648,7 +12648,7 @@ const U = class U {
12648
12648
  templateId: R.id,
12649
12649
  cr: v,
12650
12650
  // Pass CR for proper level scaling (Task 1.4)
12651
- rarity: S[D],
12651
+ rarity: _[D],
12652
12652
  // Use distributed rarity (Task 2.3)
12653
12653
  difficultyMultiplier: o,
12654
12654
  audioProfile: m,
@@ -13790,7 +13790,7 @@ class xb {
13790
13790
  return Math.round(e * 1e4) / 1e4;
13791
13791
  }
13792
13792
  }
13793
- const Ae = class Ae {
13793
+ const ke = class ke {
13794
13794
  /**
13795
13795
  * Suggest an enemy CR for the given party and target difficulty.
13796
13796
  *
@@ -13805,15 +13805,15 @@ const Ae = class Ae {
13805
13805
  aiConfig: a,
13806
13806
  combatConfig: r,
13807
13807
  baseSeed: o = "difficulty-calc",
13808
- simulationsPerProbe: c = Ae.DEFAULT_SIMULATIONS_PER_PROBE,
13809
- maxIterations: l = Ae.DEFAULT_MAX_ITERATIONS,
13808
+ simulationsPerProbe: c = ke.DEFAULT_SIMULATIONS_PER_PROBE,
13809
+ maxIterations: l = ke.DEFAULT_MAX_ITERATIONS,
13810
13810
  enemyCount: u = 1,
13811
13811
  abortSignal: d,
13812
13812
  onProgress: h
13813
13813
  } = n, m = [];
13814
13814
  let f = 0;
13815
- const g = e.map((oe) => oe.level), p = Zn(g, i), y = ki(u), v = p / y, S = Br(v);
13816
- let T = Ae.CR_FLOOR, _ = Ae.CR_CEILING, I = Math.max(T, Math.min(_, S));
13815
+ const g = e.map((oe) => oe.level), p = Zn(g, i), y = Mi(u), v = p / y, _ = Br(v);
13816
+ let T = ke.CR_FLOOR, S = ke.CR_CEILING, I = Math.max(T, Math.min(S, _));
13817
13817
  const D = jr[i];
13818
13818
  let R = !1, q = null, O = !1;
13819
13819
  for (let oe = 0; oe < l; oe++) {
@@ -13847,10 +13847,10 @@ const Ae = class Ae {
13847
13847
  R = !0;
13848
13848
  break;
13849
13849
  }
13850
- X.winRate > D.max ? T = I : _ = I;
13851
- const ge = (T + _) / 2;
13852
- if (Math.abs(ge - I) < Ae.CR_STEP_MIN) {
13853
- if (X.winRate > D.max ? I = Math.min(Ae.CR_CEILING, I + Ae.CR_STEP_MIN) : I = Math.max(Ae.CR_FLOOR, I - Ae.CR_STEP_MIN), I === m[m.length - 1].cr)
13850
+ X.winRate > D.max ? T = I : S = I;
13851
+ const ge = (T + S) / 2;
13852
+ if (Math.abs(ge - I) < ke.CR_STEP_MIN) {
13853
+ if (X.winRate > D.max ? I = Math.min(ke.CR_CEILING, I + ke.CR_STEP_MIN) : I = Math.max(ke.CR_FLOOR, I - ke.CR_STEP_MIN), I === m[m.length - 1].cr)
13854
13854
  break;
13855
13855
  } else
13856
13856
  I = ge;
@@ -13870,7 +13870,7 @@ const Ae = class Ae {
13870
13870
  totalSimulationsRun: f,
13871
13871
  iterationsUsed: m.length,
13872
13872
  probes: m,
13873
- initialCREstimate: this.roundCR(S),
13873
+ initialCREstimate: this.roundCR(_),
13874
13874
  suggestedEnemy: Z,
13875
13875
  wasCancelled: O
13876
13876
  };
@@ -13960,8 +13960,8 @@ const Ae = class Ae {
13960
13960
  return e <= 0 ? 0 : e < 0.25 ? 0.125 : e < 0.375 ? 0.25 : e < 0.75 ? 0.5 : Math.round(e);
13961
13961
  }
13962
13962
  };
13963
- Ae.DEFAULT_SIMULATIONS_PER_PROBE = 200, Ae.DEFAULT_MAX_ITERATIONS = 10, Ae.CR_STEP_MIN = 0.25, Ae.CR_FLOOR = 0.125, Ae.CR_CEILING = 30;
13964
- let _s = Ae;
13963
+ ke.DEFAULT_SIMULATIONS_PER_PROBE = 200, ke.DEFAULT_MAX_ITERATIONS = 10, ke.CR_STEP_MIN = 0.25, ke.CR_FLOOR = 0.125, ke.CR_CEILING = 30;
13964
+ let _s = ke;
13965
13965
  const Ou = (s) => s * 5, nt = {
13966
13966
  baseXP: {
13967
13967
  perfect: 10,
@@ -14068,7 +14068,7 @@ function E(s, e, t) {
14068
14068
  value: (o) => t?.Parent && o instanceof t.Parent ? !0 : o?._zod?.traits?.has(s)
14069
14069
  }), Object.defineProperty(r, "name", { value: s }), r;
14070
14070
  }
14071
- class kt extends Error {
14071
+ class Mt extends Error {
14072
14072
  constructor() {
14073
14073
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
14074
14074
  }
@@ -14344,7 +14344,7 @@ function Qu(s, e, t) {
14344
14344
  });
14345
14345
  return ut(e, i);
14346
14346
  }
14347
- function At(s, e = 0) {
14347
+ function kt(s, e = 0) {
14348
14348
  if (s.aborted === !0)
14349
14349
  return !0;
14350
14350
  for (let t = e; t < s.issues.length; t++)
@@ -14352,7 +14352,7 @@ function At(s, e = 0) {
14352
14352
  return !0;
14353
14353
  return !1;
14354
14354
  }
14355
- function Mt(s, e) {
14355
+ function At(s, e) {
14356
14356
  return e.map((t) => {
14357
14357
  var i;
14358
14358
  return (i = t).path ?? (i.path = []), t.path.unshift(s), t;
@@ -14423,7 +14423,7 @@ function td(s, e = (t) => t.message) {
14423
14423
  const na = (s) => (e, t, i, n) => {
14424
14424
  const a = i ? Object.assign(i, { async: !1 }) : { async: !1 }, r = e._zod.run({ value: t, issues: [] }, a);
14425
14425
  if (r instanceof Promise)
14426
- throw new kt();
14426
+ throw new Mt();
14427
14427
  if (r.issues.length) {
14428
14428
  const o = new (n?.Err ?? s)(r.issues.map((c) => ct(c, a, ot())));
14429
14429
  throw Xr(o, n?.callee), o;
@@ -14440,7 +14440,7 @@ const na = (s) => (e, t, i, n) => {
14440
14440
  }, Li = (s) => (e, t, i) => {
14441
14441
  const n = i ? { ...i, async: !1 } : { async: !1 }, a = e._zod.run({ value: t, issues: [] }, n);
14442
14442
  if (a instanceof Promise)
14443
- throw new kt();
14443
+ throw new Mt();
14444
14444
  return a.issues.length ? {
14445
14445
  success: !1,
14446
14446
  error: new (s ?? eo)(a.issues.map((r) => ct(r, n, ot())))
@@ -14464,11 +14464,11 @@ const na = (s) => (e, t, i, n) => {
14464
14464
  }, ld = (s) => (e, t, i) => Li(s)(e, t, i), ud = (s) => async (e, t, i) => {
14465
14465
  const n = i ? Object.assign(i, { direction: "backward" }) : { direction: "backward" };
14466
14466
  return zi(s)(e, t, n);
14467
- }, dd = (s) => async (e, t, i) => zi(s)(e, t, i), hd = /^[cC][^\s-]{8,}$/, md = /^[0-9a-z]+$/, fd = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, gd = /^[0-9a-vA-V]{20}$/, pd = /^[A-Za-z0-9]{27}$/, yd = /^[a-zA-Z0-9_-]{21}$/, vd = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, bd = /^([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})$/, As = (s) => s ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${s}[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)$/, wd = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Sd = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
14467
+ }, dd = (s) => async (e, t, i) => zi(s)(e, t, i), hd = /^[cC][^\s-]{8,}$/, md = /^[0-9a-z]+$/, fd = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, gd = /^[0-9a-vA-V]{20}$/, pd = /^[A-Za-z0-9]{27}$/, yd = /^[a-zA-Z0-9_-]{21}$/, vd = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, bd = /^([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})$/, ks = (s) => s ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${s}[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)$/, wd = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Sd = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
14468
14468
  function _d() {
14469
14469
  return new RegExp(Sd, "u");
14470
14470
  }
14471
- const Td = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Cd = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Ad = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Md = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, kd = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, io = /^[A-Za-z0-9_-]*$/, Id = /^\+[1-9]\d{6,14}$/, no = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Dd = /* @__PURE__ */ new RegExp(`^${no}$`);
14471
+ const Td = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Cd = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, kd = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Ad = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Md = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, io = /^[A-Za-z0-9_-]*$/, Id = /^\+[1-9]\d{6,14}$/, no = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Dd = /* @__PURE__ */ new RegExp(`^${no}$`);
14472
14472
  function ao(s) {
14473
14473
  const e = "(?:[01]\\d|2[0-3]):[0-5]\\d";
14474
14474
  return typeof s.precision == "number" ? s.precision === -1 ? `${e}` : s.precision === 0 ? `${e}:[0-5]\\d` : `${e}:[0-5]\\d\\.\\d{${s.precision}}` : `${e}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -14802,7 +14802,7 @@ const Zd = {
14802
14802
  });
14803
14803
  else {
14804
14804
  const n = (r, o, c) => {
14805
- let l = At(r), u;
14805
+ let l = kt(r), u;
14806
14806
  for (const d of o) {
14807
14807
  if (d._zod.def.when) {
14808
14808
  if (!d._zod.def.when(r))
@@ -14811,25 +14811,25 @@ const Zd = {
14811
14811
  continue;
14812
14812
  const h = r.issues.length, m = d._zod.check(r);
14813
14813
  if (m instanceof Promise && c?.async === !1)
14814
- throw new kt();
14814
+ throw new Mt();
14815
14815
  if (u || m instanceof Promise)
14816
14816
  u = (u ?? Promise.resolve()).then(async () => {
14817
- await m, r.issues.length !== h && (l || (l = At(r, h)));
14817
+ await m, r.issues.length !== h && (l || (l = kt(r, h)));
14818
14818
  });
14819
14819
  else {
14820
14820
  if (r.issues.length === h)
14821
14821
  continue;
14822
- l || (l = At(r, h));
14822
+ l || (l = kt(r, h));
14823
14823
  }
14824
14824
  }
14825
14825
  return u ? u.then(() => r) : r;
14826
14826
  }, a = (r, o, c) => {
14827
- if (At(r))
14827
+ if (kt(r))
14828
14828
  return r.aborted = !0, r;
14829
14829
  const l = n(o, i, c);
14830
14830
  if (l instanceof Promise) {
14831
14831
  if (c.async === !1)
14832
- throw new kt();
14832
+ throw new Mt();
14833
14833
  return l.then((u) => s._zod.parse(u, c));
14834
14834
  }
14835
14835
  return s._zod.parse(l, c);
@@ -14844,7 +14844,7 @@ const Zd = {
14844
14844
  const c = s._zod.parse(r, o);
14845
14845
  if (c instanceof Promise) {
14846
14846
  if (o.async === !1)
14847
- throw new kt();
14847
+ throw new Mt();
14848
14848
  return c.then((l) => n(l, i, o));
14849
14849
  }
14850
14850
  return n(c, i, o);
@@ -14894,9 +14894,9 @@ const Zd = {
14894
14894
  }[e.version];
14895
14895
  if (i === void 0)
14896
14896
  throw new Error(`Invalid UUID version: "${e.version}"`);
14897
- e.pattern ?? (e.pattern = As(i));
14897
+ e.pattern ?? (e.pattern = ks(i));
14898
14898
  } else
14899
- e.pattern ?? (e.pattern = As());
14899
+ e.pattern ?? (e.pattern = ks());
14900
14900
  ce.init(s, e);
14901
14901
  }), Qd = /* @__PURE__ */ E("$ZodEmail", (s, e) => {
14902
14902
  e.pattern ?? (e.pattern = wd), ce.init(s, e);
@@ -14971,9 +14971,9 @@ const Zd = {
14971
14971
  }
14972
14972
  };
14973
14973
  }), fh = /* @__PURE__ */ E("$ZodCIDRv4", (s, e) => {
14974
- e.pattern ?? (e.pattern = Ad), ce.init(s, e);
14974
+ e.pattern ?? (e.pattern = kd), ce.init(s, e);
14975
14975
  }), gh = /* @__PURE__ */ E("$ZodCIDRv6", (s, e) => {
14976
- e.pattern ?? (e.pattern = Md), ce.init(s, e), s._zod.check = (t) => {
14976
+ e.pattern ?? (e.pattern = Ad), ce.init(s, e), s._zod.check = (t) => {
14977
14977
  const i = t.value.split("/");
14978
14978
  try {
14979
14979
  if (i.length !== 2)
@@ -15010,7 +15010,7 @@ function lo(s) {
15010
15010
  }
15011
15011
  }
15012
15012
  const ph = /* @__PURE__ */ E("$ZodBase64", (s, e) => {
15013
- e.pattern ?? (e.pattern = kd), ce.init(s, e), s._zod.bag.contentEncoding = "base64", s._zod.check = (t) => {
15013
+ e.pattern ?? (e.pattern = Md), ce.init(s, e), s._zod.bag.contentEncoding = "base64", s._zod.check = (t) => {
15014
15014
  lo(t.value) || t.issues.push({
15015
15015
  code: "invalid_format",
15016
15016
  format: "base64",
@@ -15101,7 +15101,7 @@ const Sh = /* @__PURE__ */ E("$ZodJWT", (s, e) => {
15101
15101
  };
15102
15102
  }), Ch = /* @__PURE__ */ E("$ZodUnknown", (s, e) => {
15103
15103
  he.init(s, e), s._zod.parse = (t) => t;
15104
- }), Ah = /* @__PURE__ */ E("$ZodNever", (s, e) => {
15104
+ }), kh = /* @__PURE__ */ E("$ZodNever", (s, e) => {
15105
15105
  he.init(s, e), s._zod.parse = (t, i) => (t.issues.push({
15106
15106
  expected: "never",
15107
15107
  code: "invalid_type",
@@ -15109,10 +15109,10 @@ const Sh = /* @__PURE__ */ E("$ZodJWT", (s, e) => {
15109
15109
  inst: s
15110
15110
  }), t);
15111
15111
  });
15112
- function Ms(s, e, t) {
15113
- s.issues.length && e.issues.push(...Mt(t, s.issues)), e.value[t] = s.value;
15112
+ function As(s, e, t) {
15113
+ s.issues.length && e.issues.push(...At(t, s.issues)), e.value[t] = s.value;
15114
15114
  }
15115
- const Mh = /* @__PURE__ */ E("$ZodArray", (s, e) => {
15115
+ const Ah = /* @__PURE__ */ E("$ZodArray", (s, e) => {
15116
15116
  he.init(s, e), s._zod.parse = (t, i) => {
15117
15117
  const n = t.value;
15118
15118
  if (!Array.isArray(n))
@@ -15129,7 +15129,7 @@ const Mh = /* @__PURE__ */ E("$ZodArray", (s, e) => {
15129
15129
  value: o,
15130
15130
  issues: []
15131
15131
  }, i);
15132
- c instanceof Promise ? a.push(c.then((l) => Ms(l, t, r))) : Ms(c, t, r);
15132
+ c instanceof Promise ? a.push(c.then((l) => As(l, t, r))) : As(c, t, r);
15133
15133
  }
15134
15134
  return a.length ? Promise.all(a).then(() => t) : t;
15135
15135
  };
@@ -15138,7 +15138,7 @@ function Ei(s, e, t, i, n) {
15138
15138
  if (s.issues.length) {
15139
15139
  if (n && !(t in i))
15140
15140
  return;
15141
- e.issues.push(...Mt(t, s.issues));
15141
+ e.issues.push(...At(t, s.issues));
15142
15142
  }
15143
15143
  s.value === void 0 ? t in i && (e.value[t] = void 0) : e.value[t] = s.value;
15144
15144
  }
@@ -15175,7 +15175,7 @@ function mo(s, e, t, i, n, a) {
15175
15175
  inst: a
15176
15176
  }), s.length ? Promise.all(s).then(() => t) : t;
15177
15177
  }
15178
- const kh = /* @__PURE__ */ E("$ZodObject", (s, e) => {
15178
+ const Mh = /* @__PURE__ */ E("$ZodObject", (s, e) => {
15179
15179
  if (he.init(s, e), !Object.getOwnPropertyDescriptor(e, "shape")?.get) {
15180
15180
  const o = e.shape;
15181
15181
  Object.defineProperty(e, "shape", {
@@ -15221,59 +15221,59 @@ const kh = /* @__PURE__ */ E("$ZodObject", (s, e) => {
15221
15221
  return a ? mo(u, l, o, c, i.value, s) : u.length ? Promise.all(u).then(() => o) : o;
15222
15222
  };
15223
15223
  }), Ih = /* @__PURE__ */ E("$ZodObjectJIT", (s, e) => {
15224
- kh.init(s, e);
15224
+ Mh.init(s, e);
15225
15225
  const t = s._zod.parse, i = Qn(() => ho(e)), n = (h) => {
15226
- const m = new Yd(["shape", "payload", "ctx"]), f = i.value, g = (S) => {
15227
- const T = Cs(S);
15226
+ const m = new Yd(["shape", "payload", "ctx"]), f = i.value, g = (_) => {
15227
+ const T = Cs(_);
15228
15228
  return `shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`;
15229
15229
  };
15230
15230
  m.write("const input = payload.value;");
15231
15231
  const p = /* @__PURE__ */ Object.create(null);
15232
15232
  let y = 0;
15233
- for (const S of f.keys)
15234
- p[S] = `key_${y++}`;
15233
+ for (const _ of f.keys)
15234
+ p[_] = `key_${y++}`;
15235
15235
  m.write("const newResult = {};");
15236
- for (const S of f.keys) {
15237
- const T = p[S], _ = Cs(S), D = h[S]?._zod?.optout === "optional";
15238
- m.write(`const ${T} = ${g(S)};`), D ? m.write(`
15236
+ for (const _ of f.keys) {
15237
+ const T = p[_], S = Cs(_), D = h[_]?._zod?.optout === "optional";
15238
+ m.write(`const ${T} = ${g(_)};`), D ? m.write(`
15239
15239
  if (${T}.issues.length) {
15240
- if (${_} in input) {
15240
+ if (${S} in input) {
15241
15241
  payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
15242
15242
  ...iss,
15243
- path: iss.path ? [${_}, ...iss.path] : [${_}]
15243
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
15244
15244
  })));
15245
15245
  }
15246
15246
  }
15247
15247
 
15248
15248
  if (${T}.value === undefined) {
15249
- if (${_} in input) {
15250
- newResult[${_}] = undefined;
15249
+ if (${S} in input) {
15250
+ newResult[${S}] = undefined;
15251
15251
  }
15252
15252
  } else {
15253
- newResult[${_}] = ${T}.value;
15253
+ newResult[${S}] = ${T}.value;
15254
15254
  }
15255
15255
 
15256
15256
  `) : m.write(`
15257
15257
  if (${T}.issues.length) {
15258
15258
  payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
15259
15259
  ...iss,
15260
- path: iss.path ? [${_}, ...iss.path] : [${_}]
15260
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
15261
15261
  })));
15262
15262
  }
15263
15263
 
15264
15264
  if (${T}.value === undefined) {
15265
- if (${_} in input) {
15266
- newResult[${_}] = undefined;
15265
+ if (${S} in input) {
15266
+ newResult[${S}] = undefined;
15267
15267
  }
15268
15268
  } else {
15269
- newResult[${_}] = ${T}.value;
15269
+ newResult[${S}] = ${T}.value;
15270
15270
  }
15271
15271
 
15272
15272
  `);
15273
15273
  }
15274
15274
  m.write("payload.value = newResult;"), m.write("return payload;");
15275
15275
  const v = m.compile();
15276
- return (S, T) => v(h, S, T);
15276
+ return (_, T) => v(h, _, T);
15277
15277
  };
15278
15278
  let a;
15279
15279
  const r = Di, o = !Yr.jitless, l = o && qu.value, u = e.catchall;
@@ -15289,11 +15289,11 @@ const kh = /* @__PURE__ */ E("$ZodObject", (s, e) => {
15289
15289
  }), h);
15290
15290
  };
15291
15291
  });
15292
- function ks(s, e, t, i) {
15292
+ function Ms(s, e, t, i) {
15293
15293
  for (const a of s)
15294
15294
  if (a.issues.length === 0)
15295
15295
  return e.value = a.value, e;
15296
- const n = s.filter((a) => !At(a));
15296
+ const n = s.filter((a) => !kt(a));
15297
15297
  return n.length === 1 ? (e.value = n[0].value, n[0]) : (e.issues.push({
15298
15298
  code: "invalid_union",
15299
15299
  input: e.value,
@@ -15330,7 +15330,7 @@ const Dh = /* @__PURE__ */ E("$ZodUnion", (s, e) => {
15330
15330
  o.push(l);
15331
15331
  }
15332
15332
  }
15333
- return r ? Promise.all(o).then((c) => ks(c, n, s, a)) : ks(o, n, s, a);
15333
+ return r ? Promise.all(o).then((c) => Ms(c, n, s, a)) : Ms(o, n, s, a);
15334
15334
  };
15335
15335
  }), Eh = /* @__PURE__ */ E("$ZodIntersection", (s, e) => {
15336
15336
  he.init(s, e), s._zod.parse = (t, i) => {
@@ -15390,7 +15390,7 @@ function Is(s, e, t) {
15390
15390
  else
15391
15391
  s.issues.push(o);
15392
15392
  const a = [...i].filter(([, o]) => o.l && o.r).map(([o]) => o);
15393
- if (a.length && n && s.issues.push({ ...n, keys: a }), At(s))
15393
+ if (a.length && n && s.issues.push({ ...n, keys: a }), kt(s))
15394
15394
  return s;
15395
15395
  const r = Nn(e.value, t.value);
15396
15396
  if (!r.valid)
@@ -15416,8 +15416,8 @@ const xh = /* @__PURE__ */ E("$ZodRecord", (s, e) => {
15416
15416
  o.add(typeof l == "number" ? l.toString() : l);
15417
15417
  const u = e.valueType._zod.run({ value: n[l], issues: [] }, i);
15418
15418
  u instanceof Promise ? a.push(u.then((d) => {
15419
- d.issues.length && t.issues.push(...Mt(l, d.issues)), t.value[l] = d.value;
15420
- })) : (u.issues.length && t.issues.push(...Mt(l, u.issues)), t.value[l] = u.value);
15419
+ d.issues.length && t.issues.push(...At(l, d.issues)), t.value[l] = d.value;
15420
+ })) : (u.issues.length && t.issues.push(...At(l, u.issues)), t.value[l] = u.value);
15421
15421
  }
15422
15422
  let c;
15423
15423
  for (const l in n)
@@ -15455,8 +15455,8 @@ const xh = /* @__PURE__ */ E("$ZodRecord", (s, e) => {
15455
15455
  }
15456
15456
  const u = e.valueType._zod.run({ value: n[o], issues: [] }, i);
15457
15457
  u instanceof Promise ? a.push(u.then((d) => {
15458
- d.issues.length && t.issues.push(...Mt(o, d.issues)), t.value[c.value] = d.value;
15459
- })) : (u.issues.length && t.issues.push(...Mt(o, u.issues)), t.value[c.value] = u.value);
15458
+ d.issues.length && t.issues.push(...At(o, d.issues)), t.value[c.value] = d.value;
15459
+ })) : (u.issues.length && t.issues.push(...At(o, u.issues)), t.value[c.value] = u.value);
15460
15460
  }
15461
15461
  }
15462
15462
  return a.length ? Promise.all(a).then(() => t) : t;
@@ -15481,7 +15481,7 @@ const xh = /* @__PURE__ */ E("$ZodRecord", (s, e) => {
15481
15481
  if (i.async)
15482
15482
  return (n instanceof Promise ? n : Promise.resolve(n)).then((r) => (t.value = r, t));
15483
15483
  if (n instanceof Promise)
15484
- throw new kt();
15484
+ throw new Mt();
15485
15485
  return t.value = n, t;
15486
15486
  };
15487
15487
  });
@@ -16041,7 +16041,7 @@ function Cm(s) {
16041
16041
  });
16042
16042
  }
16043
16043
  // @__NO_SIDE_EFFECTS__
16044
- function Am(s, e) {
16044
+ function km(s, e) {
16045
16045
  return new Ud({
16046
16046
  check: "string_format",
16047
16047
  format: "includes",
@@ -16050,7 +16050,7 @@ function Am(s, e) {
16050
16050
  });
16051
16051
  }
16052
16052
  // @__NO_SIDE_EFFECTS__
16053
- function Mm(s, e) {
16053
+ function Am(s, e) {
16054
16054
  return new Vd({
16055
16055
  check: "string_format",
16056
16056
  format: "starts_with",
@@ -16059,7 +16059,7 @@ function Mm(s, e) {
16059
16059
  });
16060
16060
  }
16061
16061
  // @__NO_SIDE_EFFECTS__
16062
- function km(s, e) {
16062
+ function Mm(s, e) {
16063
16063
  return new jd({
16064
16064
  check: "string_format",
16065
16065
  format: "ends_with",
@@ -16567,7 +16567,7 @@ const ff = (s, e) => {
16567
16567
  });
16568
16568
  }, Oe = E("ZodError", ff, {
16569
16569
  Parent: Error
16570
- }), gf = /* @__PURE__ */ na(Oe), pf = /* @__PURE__ */ aa(Oe), yf = /* @__PURE__ */ Li(Oe), vf = /* @__PURE__ */ zi(Oe), bf = /* @__PURE__ */ ad(Oe), wf = /* @__PURE__ */ sd(Oe), Sf = /* @__PURE__ */ rd(Oe), _f = /* @__PURE__ */ od(Oe), Tf = /* @__PURE__ */ cd(Oe), Cf = /* @__PURE__ */ ld(Oe), Af = /* @__PURE__ */ ud(Oe), Mf = /* @__PURE__ */ dd(Oe), me = /* @__PURE__ */ E("ZodType", (s, e) => (he.init(s, e), Object.assign(s["~standard"], {
16570
+ }), gf = /* @__PURE__ */ na(Oe), pf = /* @__PURE__ */ aa(Oe), yf = /* @__PURE__ */ Li(Oe), vf = /* @__PURE__ */ zi(Oe), bf = /* @__PURE__ */ ad(Oe), wf = /* @__PURE__ */ sd(Oe), Sf = /* @__PURE__ */ rd(Oe), _f = /* @__PURE__ */ od(Oe), Tf = /* @__PURE__ */ cd(Oe), Cf = /* @__PURE__ */ ld(Oe), kf = /* @__PURE__ */ ud(Oe), Af = /* @__PURE__ */ dd(Oe), me = /* @__PURE__ */ E("ZodType", (s, e) => (he.init(s, e), Object.assign(s["~standard"], {
16571
16571
  jsonSchema: {
16572
16572
  input: Ri(s, "input"),
16573
16573
  output: Ri(s, "output")
@@ -16579,7 +16579,7 @@ const ff = (s, e) => {
16579
16579
  ]
16580
16580
  }), {
16581
16581
  parent: !0
16582
- }), s.with = s.check, s.clone = (t, i) => ut(s, t, i), s.brand = () => s, s.register = ((t, i) => (t.add(s, i), s)), s.parse = (t, i) => gf(s, t, i, { callee: s.parse }), s.safeParse = (t, i) => yf(s, t, i), s.parseAsync = async (t, i) => pf(s, t, i, { callee: s.parseAsync }), s.safeParseAsync = async (t, i) => vf(s, t, i), s.spa = s.safeParseAsync, s.encode = (t, i) => bf(s, t, i), s.decode = (t, i) => wf(s, t, i), s.encodeAsync = async (t, i) => Sf(s, t, i), s.decodeAsync = async (t, i) => _f(s, t, i), s.safeEncode = (t, i) => Tf(s, t, i), s.safeDecode = (t, i) => Cf(s, t, i), s.safeEncodeAsync = async (t, i) => Af(s, t, i), s.safeDecodeAsync = async (t, i) => Mf(s, t, i), s.refine = (t, i) => s.check(vg(t, i)), s.superRefine = (t) => s.check(bg(t)), s.overwrite = (t) => s.check(/* @__PURE__ */ Et(t)), s.optional = () => Hs(s), s.exactOptional = () => sg(s), s.nullable = () => qs(s), s.nullish = () => Hs(qs(s)), s.nonoptional = (t) => dg(s, t), s.array = () => Te(s), s.or = (t) => ra([s, t]), s.and = (t) => eg(s, t), s.transform = (t) => Gs(s, ng(t)), s.default = (t) => cg(s, t), s.prefault = (t) => ug(s, t), s.catch = (t) => mg(s, t), s.pipe = (t) => Gs(s, t), s.readonly = () => pg(s), s.describe = (t) => {
16582
+ }), s.with = s.check, s.clone = (t, i) => ut(s, t, i), s.brand = () => s, s.register = ((t, i) => (t.add(s, i), s)), s.parse = (t, i) => gf(s, t, i, { callee: s.parse }), s.safeParse = (t, i) => yf(s, t, i), s.parseAsync = async (t, i) => pf(s, t, i, { callee: s.parseAsync }), s.safeParseAsync = async (t, i) => vf(s, t, i), s.spa = s.safeParseAsync, s.encode = (t, i) => bf(s, t, i), s.decode = (t, i) => wf(s, t, i), s.encodeAsync = async (t, i) => Sf(s, t, i), s.decodeAsync = async (t, i) => _f(s, t, i), s.safeEncode = (t, i) => Tf(s, t, i), s.safeDecode = (t, i) => Cf(s, t, i), s.safeEncodeAsync = async (t, i) => kf(s, t, i), s.safeDecodeAsync = async (t, i) => Af(s, t, i), s.refine = (t, i) => s.check(vg(t, i)), s.superRefine = (t) => s.check(bg(t)), s.overwrite = (t) => s.check(/* @__PURE__ */ Et(t)), s.optional = () => Hs(s), s.exactOptional = () => sg(s), s.nullable = () => qs(s), s.nullish = () => Hs(qs(s)), s.nonoptional = (t) => dg(s, t), s.array = () => Te(s), s.or = (t) => ra([s, t]), s.and = (t) => eg(s, t), s.transform = (t) => Gs(s, ng(t)), s.default = (t) => cg(s, t), s.prefault = (t) => ug(s, t), s.catch = (t) => mg(s, t), s.pipe = (t) => Gs(s, t), s.readonly = () => pg(s), s.describe = (t) => {
16583
16583
  const i = s.clone();
16584
16584
  return zt.add(i, { description: t }), i;
16585
16585
  }, Object.defineProperty(s, "description", {
@@ -16595,12 +16595,12 @@ const ff = (s, e) => {
16595
16595
  }, s.isOptional = () => s.safeParse(void 0).success, s.isNullable = () => s.safeParse(null).success, s.apply = (t) => t(s), s)), So = /* @__PURE__ */ E("_ZodString", (s, e) => {
16596
16596
  sa.init(s, e), me.init(s, e), s._zod.processJSONSchema = (i, n, a) => Lm(s, i, n);
16597
16597
  const t = s._zod.bag;
16598
- s.format = t.format ?? null, s.minLength = t.minimum ?? null, s.maxLength = t.maximum ?? null, s.regex = (...i) => s.check(/* @__PURE__ */ _m(...i)), s.includes = (...i) => s.check(/* @__PURE__ */ Am(...i)), s.startsWith = (...i) => s.check(/* @__PURE__ */ Mm(...i)), s.endsWith = (...i) => s.check(/* @__PURE__ */ km(...i)), s.min = (...i) => s.check(/* @__PURE__ */ xi(...i)), s.max = (...i) => s.check(/* @__PURE__ */ go(...i)), s.length = (...i) => s.check(/* @__PURE__ */ po(...i)), s.nonempty = (...i) => s.check(/* @__PURE__ */ xi(1, ...i)), s.lowercase = (i) => s.check(/* @__PURE__ */ Tm(i)), s.uppercase = (i) => s.check(/* @__PURE__ */ Cm(i)), s.trim = () => s.check(/* @__PURE__ */ Dm()), s.normalize = (...i) => s.check(/* @__PURE__ */ Im(...i)), s.toLowerCase = () => s.check(/* @__PURE__ */ Em()), s.toUpperCase = () => s.check(/* @__PURE__ */ xm()), s.slugify = () => s.check(/* @__PURE__ */ Rm());
16599
- }), kf = /* @__PURE__ */ E("ZodString", (s, e) => {
16598
+ s.format = t.format ?? null, s.minLength = t.minimum ?? null, s.maxLength = t.maximum ?? null, s.regex = (...i) => s.check(/* @__PURE__ */ _m(...i)), s.includes = (...i) => s.check(/* @__PURE__ */ km(...i)), s.startsWith = (...i) => s.check(/* @__PURE__ */ Am(...i)), s.endsWith = (...i) => s.check(/* @__PURE__ */ Mm(...i)), s.min = (...i) => s.check(/* @__PURE__ */ xi(...i)), s.max = (...i) => s.check(/* @__PURE__ */ go(...i)), s.length = (...i) => s.check(/* @__PURE__ */ po(...i)), s.nonempty = (...i) => s.check(/* @__PURE__ */ xi(1, ...i)), s.lowercase = (i) => s.check(/* @__PURE__ */ Tm(i)), s.uppercase = (i) => s.check(/* @__PURE__ */ Cm(i)), s.trim = () => s.check(/* @__PURE__ */ Dm()), s.normalize = (...i) => s.check(/* @__PURE__ */ Im(...i)), s.toLowerCase = () => s.check(/* @__PURE__ */ Em()), s.toUpperCase = () => s.check(/* @__PURE__ */ xm()), s.slugify = () => s.check(/* @__PURE__ */ Rm());
16599
+ }), Mf = /* @__PURE__ */ E("ZodString", (s, e) => {
16600
16600
  sa.init(s, e), So.init(s, e), s.email = (t) => s.check(/* @__PURE__ */ Vh(If, t)), s.url = (t) => s.check(/* @__PURE__ */ Xh(Df, t)), s.jwt = (t) => s.check(/* @__PURE__ */ hm(Gf, t)), s.emoji = (t) => s.check(/* @__PURE__ */ Jh(Ef, t)), s.guid = (t) => s.check(/* @__PURE__ */ Ns(Ls, t)), s.uuid = (t) => s.check(/* @__PURE__ */ jh(pi, t)), s.uuidv4 = (t) => s.check(/* @__PURE__ */ Kh(pi, t)), s.uuidv6 = (t) => s.check(/* @__PURE__ */ Yh(pi, t)), s.uuidv7 = (t) => s.check(/* @__PURE__ */ Zh(pi, t)), s.nanoid = (t) => s.check(/* @__PURE__ */ Qh(xf, t)), s.guid = (t) => s.check(/* @__PURE__ */ Ns(Ls, t)), s.cuid = (t) => s.check(/* @__PURE__ */ em(Rf, t)), s.cuid2 = (t) => s.check(/* @__PURE__ */ tm(Pf, t)), s.ulid = (t) => s.check(/* @__PURE__ */ im(Bf, t)), s.base64 = (t) => s.check(/* @__PURE__ */ lm(Wf, t)), s.base64url = (t) => s.check(/* @__PURE__ */ um(Hf, t)), s.xid = (t) => s.check(/* @__PURE__ */ nm(Nf, t)), s.ksuid = (t) => s.check(/* @__PURE__ */ am(Ff, t)), s.ipv4 = (t) => s.check(/* @__PURE__ */ sm($f, t)), s.ipv6 = (t) => s.check(/* @__PURE__ */ rm(Of, t)), s.cidrv4 = (t) => s.check(/* @__PURE__ */ om(Lf, t)), s.cidrv6 = (t) => s.check(/* @__PURE__ */ cm(zf, t)), s.e164 = (t) => s.check(/* @__PURE__ */ dm(qf, t)), s.datetime = (t) => s.check(of(t)), s.date = (t) => s.check(lf(t)), s.time = (t) => s.check(df(t)), s.duration = (t) => s.check(mf(t));
16601
16601
  });
16602
16602
  function G(s) {
16603
- return /* @__PURE__ */ Uh(kf, s);
16603
+ return /* @__PURE__ */ Uh(Mf, s);
16604
16604
  }
16605
16605
  const de = /* @__PURE__ */ E("ZodStringFormat", (s, e) => {
16606
16606
  ce.init(s, e), So.init(s, e);
@@ -16669,19 +16669,19 @@ function Ws() {
16669
16669
  return /* @__PURE__ */ wm(jf);
16670
16670
  }
16671
16671
  const Kf = /* @__PURE__ */ E("ZodNever", (s, e) => {
16672
- Ah.init(s, e), me.init(s, e), s._zod.processJSONSchema = (t, i, n) => Hm(s, t, i);
16672
+ kh.init(s, e), me.init(s, e), s._zod.processJSONSchema = (t, i, n) => Hm(s, t, i);
16673
16673
  });
16674
16674
  function Yf(s) {
16675
16675
  return /* @__PURE__ */ Sm(Kf, s);
16676
16676
  }
16677
16677
  const Zf = /* @__PURE__ */ E("ZodArray", (s, e) => {
16678
- Mh.init(s, e), me.init(s, e), s._zod.processJSONSchema = (t, i, n) => jm(s, t, i, n), s.element = e.element, s.min = (t, i) => s.check(/* @__PURE__ */ xi(t, i)), s.nonempty = (t) => s.check(/* @__PURE__ */ xi(1, t)), s.max = (t, i) => s.check(/* @__PURE__ */ go(t, i)), s.length = (t, i) => s.check(/* @__PURE__ */ po(t, i)), s.unwrap = () => s.element;
16678
+ Ah.init(s, e), me.init(s, e), s._zod.processJSONSchema = (t, i, n) => jm(s, t, i, n), s.element = e.element, s.min = (t, i) => s.check(/* @__PURE__ */ xi(t, i)), s.nonempty = (t) => s.check(/* @__PURE__ */ xi(1, t)), s.max = (t, i) => s.check(/* @__PURE__ */ go(t, i)), s.length = (t, i) => s.check(/* @__PURE__ */ po(t, i)), s.unwrap = () => s.element;
16679
16679
  });
16680
16680
  function Te(s, e) {
16681
16681
  return /* @__PURE__ */ Pm(Zf, s, e);
16682
16682
  }
16683
16683
  const Xf = /* @__PURE__ */ E("ZodObject", (s, e) => {
16684
- Ih.init(s, e), me.init(s, e), s._zod.processJSONSchema = (t, i, n) => Km(s, t, i, n), ae(s, "shape", () => e.shape), s.keyof = () => Ai(Object.keys(s._zod.def.shape)), s.catchall = (t) => s.clone({ ...s._zod.def, catchall: t }), s.passthrough = () => s.clone({ ...s._zod.def, catchall: Ws() }), s.loose = () => s.clone({ ...s._zod.def, catchall: Ws() }), s.strict = () => s.clone({ ...s._zod.def, catchall: Yf() }), s.strip = () => s.clone({ ...s._zod.def, catchall: void 0 }), s.extend = (t) => Yu(s, t), s.safeExtend = (t) => Zu(s, t), s.merge = (t) => Xu(s, t), s.pick = (t) => ju(s, t), s.omit = (t) => Ku(s, t), s.partial = (...t) => Ju(To, s, t[0]), s.required = (...t) => Qu(Co, s, t[0]);
16684
+ Ih.init(s, e), me.init(s, e), s._zod.processJSONSchema = (t, i, n) => Km(s, t, i, n), ae(s, "shape", () => e.shape), s.keyof = () => ki(Object.keys(s._zod.def.shape)), s.catchall = (t) => s.clone({ ...s._zod.def, catchall: t }), s.passthrough = () => s.clone({ ...s._zod.def, catchall: Ws() }), s.loose = () => s.clone({ ...s._zod.def, catchall: Ws() }), s.strict = () => s.clone({ ...s._zod.def, catchall: Yf() }), s.strip = () => s.clone({ ...s._zod.def, catchall: void 0 }), s.extend = (t) => Yu(s, t), s.safeExtend = (t) => Zu(s, t), s.merge = (t) => Xu(s, t), s.pick = (t) => ju(s, t), s.omit = (t) => Ku(s, t), s.partial = (...t) => Ju(To, s, t[0]), s.required = (...t) => Qu(Co, s, t[0]);
16685
16685
  });
16686
16686
  function re(s, e) {
16687
16687
  const t = {
@@ -16753,7 +16753,7 @@ const $n = /* @__PURE__ */ E("ZodEnum", (s, e) => {
16753
16753
  });
16754
16754
  };
16755
16755
  });
16756
- function Ai(s, e) {
16756
+ function ki(s, e) {
16757
16757
  const t = Array.isArray(s) ? Object.fromEntries(s.map((i) => [i, i])) : s;
16758
16758
  return new $n({
16759
16759
  type: "enum",
@@ -16952,8 +16952,8 @@ const wg = et.map((s) => s), Sg = re({
16952
16952
  CHA: z().min(1).max(20)
16953
16953
  }), Nb = re({
16954
16954
  name: G(),
16955
- race: Ai(["Human", "Elf", "Dwarf", "Halfling", "Dragonborn", "Gnome", "Half-Elf", "Half-Orc", "Tiefling"]),
16956
- class: Ai(wg),
16955
+ race: ki(["Human", "Elf", "Dwarf", "Halfling", "Dragonborn", "Gnome", "Half-Elf", "Half-Orc", "Tiefling"]),
16956
+ class: ki(wg),
16957
16957
  level: z().min(1).max(20),
16958
16958
  ability_scores: Us,
16959
16959
  ability_modifiers: Us,
@@ -16966,7 +16966,7 @@ const wg = et.map((s) => s), Sg = re({
16966
16966
  armor_class: z().positive(),
16967
16967
  initiative: z(),
16968
16968
  speed: z().positive(),
16969
- skills: Ci(G(), Ai(["none", "proficient", "expertise"])),
16969
+ skills: Ci(G(), ki(["none", "proficient", "expertise"])),
16970
16970
  saving_throws: Ci(G(), Fn()),
16971
16971
  racial_traits: Te(G()),
16972
16972
  class_features: Te(G()),
@@ -17398,7 +17398,7 @@ function ca(s) {
17398
17398
  }
17399
17399
  return null;
17400
17400
  }
17401
- function Ao(s) {
17401
+ function ko(s) {
17402
17402
  if ("image_thumb_url" in s && typeof s.image_thumb_url == "string")
17403
17403
  return s.image_thumb_url;
17404
17404
  if ("metadata" in s) {
@@ -17408,7 +17408,7 @@ function Ao(s) {
17408
17408
  }
17409
17409
  return null;
17410
17410
  }
17411
- function Mo(s) {
17411
+ function Ao(s) {
17412
17412
  if ("audio_url" in s)
17413
17413
  return null;
17414
17414
  if ("metadata" in s) {
@@ -17519,7 +17519,7 @@ function Gb(s) {
17519
17519
  function Ub(s) {
17520
17520
  const e = [];
17521
17521
  for (const t of s.tracks) {
17522
- const i = oa(t), n = ca(t), a = Ao(t);
17522
+ const i = oa(t), n = ca(t), a = ko(t);
17523
17523
  let r = "", o = "";
17524
17524
  if ("title" in t)
17525
17525
  r = t.title || "", o = t.artist || "";
@@ -17583,7 +17583,7 @@ function Vb(s) {
17583
17583
  function jb(s) {
17584
17584
  const e = [];
17585
17585
  for (const t of s.tracks) {
17586
- const i = Mo(t);
17586
+ const i = Ao(t);
17587
17587
  i && e.push(i);
17588
17588
  }
17589
17589
  return e;
@@ -17591,9 +17591,9 @@ function jb(s) {
17591
17591
  function Kb(s) {
17592
17592
  const e = [];
17593
17593
  for (const t of s.tracks) {
17594
- const i = Mo(t);
17594
+ const i = Ao(t);
17595
17595
  if (!i) continue;
17596
- const n = oa(t), a = ca(t), r = Ao(t);
17596
+ const n = oa(t), a = ca(t), r = ko(t);
17597
17597
  let o = "", c = "";
17598
17598
  if ("title" in t)
17599
17599
  o = t.title || "", c = t.artist || "";
@@ -17612,7 +17612,7 @@ function Kb(s) {
17612
17612
  }
17613
17613
  return e;
17614
17614
  }
17615
- const ko = [
17615
+ const Mo = [
17616
17616
  { host: "arweave.net", protocol: "https", priority: 3 },
17617
17617
  { host: "ardrive.net", protocol: "https", priority: 2 },
17618
17618
  { host: "turbo-gateway.com", protocol: "https", priority: 1 }
@@ -17675,31 +17675,31 @@ function Nt(s) {
17675
17675
  function qe(s, e, t = "") {
17676
17676
  return `${e.protocol || "https"}://${e.host}/${s}${t}`;
17677
17677
  }
17678
- function Yb(s, e = ko, t = "") {
17678
+ function Yb(s, e = Mo, t = "") {
17679
17679
  return e.sort((i, n) => i.priority - n.priority).map((i) => qe(s, i, t));
17680
17680
  }
17681
- async function Ag() {
17681
+ async function kg() {
17682
17682
  try {
17683
17683
  return await import("@ar.io/wayfinder-core");
17684
17684
  } catch {
17685
17685
  return null;
17686
17686
  }
17687
17687
  }
17688
- async function Mg() {
17688
+ async function Ag() {
17689
17689
  try {
17690
17690
  return await import("@ar.io/sdk");
17691
17691
  } catch {
17692
17692
  return null;
17693
17693
  }
17694
17694
  }
17695
- const kg = "https://solana-rpc.publicnode.com", Ig = 5e3, Dg = 864e5, hn = "arweave_active_gateway", mn = "arweave_ranked_gateways";
17695
+ const Mg = "https://solana-rpc.publicnode.com", Ig = 5e3, Dg = 864e5, hn = "arweave_active_gateway", mn = "arweave_ranked_gateways";
17696
17696
  class Eg {
17697
17697
  constructor(e) {
17698
- this.cache = /* @__PURE__ */ new Map(), this.logger = Se.for("ArweaveGateway"), this.hitCount = 0, this.missCount = 0, this.healthData = /* @__PURE__ */ new Map(), this.originalPriorities = /* @__PURE__ */ new Map(), this.MAX_HEALTH_RECORDS = 50, this.inflightResolves = /* @__PURE__ */ new Map(), this.inflightControllers = /* @__PURE__ */ new Map(), this.wayfinder = null, this.wayfinderGatewaysProvider = null, this.rankedGatewaysCache = null, this.rankedGatewaysCacheTimestamp = 0, this.RANKED_GATEWAYS_TTL_MS = 7200 * 1e3, this.activeGateway = null, this.lastFetchTiming = 0, this.consecutiveSlowResponses = 0, this.gateways = (e?.gateways ?? ko).map((i) => ({ ...i })), this.timeout = e?.timeout ?? Ig, this.cacheTTL = e?.cacheTTL ?? Dg, this.slowResponseThreshold = e?.slowResponseThreshold ?? 8e3, this.maxSlowResponses = e?.maxSlowResponses ?? 3, this.solanaRpcUrl = e?.solanaRpcUrl ?? kg, this.hasCustomSolanaRpc = typeof e?.solanaRpcUrl == "string" && e.solanaRpcUrl.length > 0, this.wayfinderSortBy = e?.wayfinderSortBy ?? "weights.compositeWeight", this.wayfinderPrimaryLimit = e?.wayfinderPrimaryLimit ?? 50, this.wayfinderFallbackLimit = e?.wayfinderFallbackLimit ?? 100, this.wayfinderStrategy = e?.wayfinderStrategy ?? "composite-ping-random", this.gateways.sort((i, n) => i.priority - n.priority), this.gateways.forEach((i) => {
17698
+ this.cache = /* @__PURE__ */ new Map(), this.logger = Se.for("ArweaveGateway"), this.hitCount = 0, this.missCount = 0, this.healthData = /* @__PURE__ */ new Map(), this.originalPriorities = /* @__PURE__ */ new Map(), this.MAX_HEALTH_RECORDS = 50, this.inflightResolves = /* @__PURE__ */ new Map(), this.inflightControllers = /* @__PURE__ */ new Map(), this.wayfinder = null, this.wayfinderGatewaysProvider = null, this.rankedGatewaysCache = null, this.rankedGatewaysCacheTimestamp = 0, this.RANKED_GATEWAYS_TTL_MS = 7200 * 1e3, this.activeGateway = null, this.lastFetchTiming = 0, this.consecutiveSlowResponses = 0, this.gateways = (e?.gateways ?? Mo).map((i) => ({ ...i })), this.timeout = e?.timeout ?? Ig, this.cacheTTL = e?.cacheTTL ?? Dg, this.slowResponseThreshold = e?.slowResponseThreshold ?? 8e3, this.maxSlowResponses = e?.maxSlowResponses ?? 3, this.solanaRpcUrl = e?.solanaRpcUrl ?? Mg, this.hasCustomSolanaRpc = typeof e?.solanaRpcUrl == "string" && e.solanaRpcUrl.length > 0, this.wayfinderSortBy = e?.wayfinderSortBy ?? "weights.compositeWeight", this.wayfinderPrimaryLimit = e?.wayfinderPrimaryLimit ?? 50, this.wayfinderFallbackLimit = e?.wayfinderFallbackLimit ?? 100, this.wayfinderStrategy = e?.wayfinderStrategy ?? "composite-ping-random", this.gateways.sort((i, n) => i.priority - n.priority), this.gateways.forEach((i) => {
17699
17699
  this.originalPriorities.set(i.host, i.priority);
17700
17700
  }), this.activeGateway = this.loadPersistedGateway();
17701
17701
  const t = this.loadPersistedRankedGateways();
17702
- t && (this.rankedGatewaysCache = t), Promise.all([Ag(), Mg(), import("./index.browser-CVv08iVS.js")]).then(([i, n, a]) => {
17702
+ t && (this.rankedGatewaysCache = t), Promise.all([kg(), Ag(), import("./index.browser-CVv08iVS.js")]).then(([i, n, a]) => {
17703
17703
  if (i && n)
17704
17704
  try {
17705
17705
  const {
@@ -17887,49 +17887,60 @@ class Eg {
17887
17887
  */
17888
17888
  async resolveGatewayChain(e, t, i, n, a) {
17889
17889
  const r = Date.now(), o = a?.bypassArweaveNet ?? !1;
17890
- let c = null;
17890
+ let c = null, l = null;
17891
17891
  if (e.startsWith("https://") || e.startsWith("http://"))
17892
17892
  try {
17893
- const f = new URL(e), g = {
17894
- host: f.host,
17893
+ const g = new URL(e), p = {
17894
+ host: g.host,
17895
17895
  // includes port if present
17896
- protocol: f.protocol.replace(":", ""),
17896
+ protocol: g.protocol.replace(":", ""),
17897
17897
  priority: 0
17898
- }, p = Date.now(), y = await this.checkAndSetGateway(e, t, i, g, n), v = Date.now() - p;
17899
- if (y)
17900
- return this.logger.info("[gateway] Step 0 (original): success", { host: g.host, ms: v, totalMs: Date.now() - r }), y;
17901
- this.logger.info("[gateway] Step 0 (original): failed", { host: g.host, ms: v }), c = g.host;
17898
+ }, y = Date.now(), v = await this.checkAndSetGateway(e, t, i, p, n), _ = Date.now() - y;
17899
+ if (v) {
17900
+ if (this.logger.info(`[gateway] Step 0 (original): ${v.kind}`, { host: p.host, ms: _, totalMs: Date.now() - r }), v.kind === "verified") return v.url;
17901
+ l ??= v.url;
17902
+ } else
17903
+ this.logger.info("[gateway] Step 0 (original): failed", { host: p.host, ms: _ });
17904
+ c = p.host;
17902
17905
  } catch {
17903
17906
  }
17904
17907
  if (this.activeGateway && this.activeGateway.host !== c) {
17905
- const f = Date.now(), g = await this.checkAndSetGateway(e, t, i, this.activeGateway, n), p = Date.now() - f;
17906
- if (g)
17907
- return this.logger.info("[gateway] Step 1 (persisted): success", { host: this.activeGateway.host, ms: p, totalMs: Date.now() - r }), g;
17908
- this.logger.info("[gateway] Step 1 (persisted): failed, clearing", { ms: p }), this.activeGateway = null, this.clearPersistedGateway();
17908
+ const g = Date.now(), p = await this.checkAndSetGateway(e, t, i, this.activeGateway, n), y = Date.now() - g;
17909
+ if (p) {
17910
+ if (this.logger.info(`[gateway] Step 1 (persisted): ${p.kind}`, { host: this.activeGateway.host, ms: y, totalMs: Date.now() - r }), p.kind === "verified") return p.url;
17911
+ l ??= p.url;
17912
+ } else
17913
+ this.logger.info("[gateway] Step 1 (persisted): failed, clearing", { ms: y }), this.activeGateway = null, this.clearPersistedGateway();
17909
17914
  }
17910
17915
  if (!o && c !== "arweave.net") {
17911
- const f = this.gateways.find((g) => g.host === "arweave.net");
17912
- if (f) {
17913
- const g = Date.now(), p = await this.checkAndSetGateway(e, t, i, f, n), y = Date.now() - g;
17914
- if (p)
17915
- return this.logger.info("[gateway] Step 2 (arweave.net): success", { ms: y, totalMs: Date.now() - r }), p;
17916
- this.logger.info("[gateway] Step 2 (arweave.net): failed", { ms: y });
17917
- }
17918
- }
17919
- const l = Date.now(), u = await this.tryFallbackGateways(e, t, i, n, c), d = Date.now() - l;
17920
- if (u)
17921
- return this.logger.info("[gateway] Step 3 (fallbacks): success", { ms: d, totalMs: Date.now() - r }), u;
17922
- this.logger.info("[gateway] Step 3 (fallbacks): failed", { ms: d });
17923
- const h = !this.hasCustomSolanaRpc, m = a?.bypassWayfinder ?? h;
17924
- if (this.wayfinder && !m) {
17925
- const f = Date.now();
17916
+ const g = this.gateways.find((p) => p.host === "arweave.net");
17917
+ if (g) {
17918
+ const p = Date.now(), y = await this.checkAndSetGateway(e, t, i, g, n), v = Date.now() - p;
17919
+ if (y) {
17920
+ if (this.logger.info(`[gateway] Step 2 (arweave.net): ${y.kind}`, { ms: v, totalMs: Date.now() - r }), y.kind === "verified") return y.url;
17921
+ l ??= y.url;
17922
+ } else
17923
+ this.logger.info("[gateway] Step 2 (arweave.net): failed", { ms: v });
17924
+ }
17925
+ }
17926
+ const u = Date.now(), d = await this.tryFallbackGateways(e, t, i, n, c), h = Date.now() - u;
17927
+ if (d) {
17928
+ if (this.logger.info(`[gateway] Step 3 (fallbacks): ${d.kind}`, { ms: h, totalMs: Date.now() - r }), d.kind === "verified") return d.url;
17929
+ l ??= d.url;
17930
+ } else
17931
+ this.logger.info("[gateway] Step 3 (fallbacks): failed", { ms: h });
17932
+ const m = !this.hasCustomSolanaRpc, f = a?.bypassWayfinder ?? m;
17933
+ if (this.wayfinder && !f) {
17934
+ const g = Date.now();
17926
17935
  this.logger.info("[gateway] Step 4 (wayfinder): trying");
17927
- const g = await this.tryWayfinder(t, i, n, c), p = Date.now() - f;
17928
- if (g)
17929
- return this.logger.info("[gateway] Step 4 (wayfinder): success", { ms: p, totalMs: Date.now() - r }), g;
17930
- this.logger.info("[gateway] Step 4 (wayfinder): failed", { ms: p });
17936
+ const p = await this.tryWayfinder(t, i, n, c), y = Date.now() - g;
17937
+ if (p) {
17938
+ if (this.logger.info(`[gateway] Step 4 (wayfinder): ${p.kind}`, { ms: y, totalMs: Date.now() - r }), p.kind === "verified") return p.url;
17939
+ l ??= p.url;
17940
+ } else
17941
+ this.logger.info("[gateway] Step 4 (wayfinder): failed", { ms: y });
17931
17942
  }
17932
- return this.logger.warn("All gateways (arweave.net + Wayfinder + fallbacks) failed, returning original URL", { txId: t, pathSuffix: i, originalUrl: e }), e;
17943
+ return l ? (this.logger.warn("No gateway verified, returning best maybe-result", { txId: t, pathSuffix: i, maybeUrl: l }), l) : (this.logger.warn("All gateways (arweave.net + Wayfinder + fallbacks) failed, returning original URL", { txId: t, pathSuffix: i, originalUrl: e }), e);
17933
17944
  }
17934
17945
  /**
17935
17946
  * Report that the active gateway failed a real fetch.
@@ -17964,16 +17975,16 @@ class Eg {
17964
17975
  const u = this.gateways.find((m) => m.host === "arweave.net" && m.host !== l);
17965
17976
  if (u) {
17966
17977
  const m = await this.checkAndSetGateway(e, o, c, u, i);
17967
- if (m) return m;
17978
+ if (m) return m.url;
17968
17979
  }
17969
17980
  if (this.wayfinder) {
17970
17981
  const m = await this.tryWayfinder(o, c, i);
17971
- if (m) return m;
17982
+ if (m) return m.url;
17972
17983
  }
17973
17984
  const d = this.gateways;
17974
17985
  l && (this.gateways = this.gateways.filter((m) => m.host !== l));
17975
17986
  const h = await this.tryFallbackGateways(e, o, c, i);
17976
- return this.gateways = d, h || e;
17987
+ return this.gateways = d, h ? h.url : e;
17977
17988
  }
17978
17989
  /**
17979
17990
  * Report that a fetch succeeded with timing data.
@@ -17998,7 +18009,22 @@ class Eg {
17998
18009
  }
17999
18010
  /**
18000
18011
  * Check a single gateway and set it as active if it works.
18001
- * Returns the working URL, or null if the check failed.
18012
+ *
18013
+ * Returns one of:
18014
+ * - `{ kind: 'verified', url }` — HEAD returned 2xx/3xx, gateway is confirmed working
18015
+ * - `{ kind: 'maybe', url }` — HEAD failed (likely CORS), no-cors GET didn't throw.
18016
+ * Server responded but we can't verify status. Caller
18017
+ * should keep looking for a 'verified' result and use
18018
+ * 'maybe' only as a last resort.
18019
+ * - `null` — gateway definitively failed
18020
+ *
18021
+ * Previously this returned `string | null` for both 'verified' and 'maybe', which forced
18022
+ * `resolveGatewayChain` to bail on the first 'maybe' — even when other gateways might
18023
+ * have a verified 2xx response. For manifest-path Arweave URLs (where the txid root
18024
+ * serves a manifest and individual paths may 404), this meant the chain stopped at the
18025
+ * first gateway that responded at all (even with 404s hidden behind no-cors opacity)
18026
+ * and never tried alternates. Surfacing the distinction lets the chain prefer verified
18027
+ * results and use 'maybe' only as a fallback.
18002
18028
  */
18003
18029
  async checkAndSetGateway(e, t, i, n, a) {
18004
18030
  if (a?.aborted) return null;
@@ -18011,7 +18037,7 @@ class Eg {
18011
18037
  gateway: n.host,
18012
18038
  pathSuffix: i,
18013
18039
  workingUrl: o
18014
- }), o;
18040
+ }), { kind: "verified", url: o };
18015
18041
  }
18016
18042
  if (r === "maybe") {
18017
18043
  const o = qe(t, n, i);
@@ -18020,7 +18046,7 @@ class Eg {
18020
18046
  gateway: n.host,
18021
18047
  pathSuffix: i,
18022
18048
  workingUrl: o
18023
- }), o;
18049
+ }), { kind: "maybe", url: o };
18024
18050
  }
18025
18051
  return null;
18026
18052
  }
@@ -18030,51 +18056,55 @@ class Eg {
18030
18056
  */
18031
18057
  async tryFallbackGateways(e, t, i, n, a) {
18032
18058
  this.missCount++;
18033
- const r = 0.7, o = 3, c = this.gateways.filter((m) => m.host !== "arweave.net" && m.host !== a), l = c.filter((m) => {
18034
- const { rate: f, totalChecks: g } = this.getFailureRate(m.host);
18035
- return !(g >= o && f > r);
18059
+ const r = 0.7, o = 3, c = this.gateways.filter((f) => f.host !== "arweave.net" && f.host !== a), l = c.filter((f) => {
18060
+ const { rate: g, totalChecks: p } = this.getFailureRate(f.host);
18061
+ return !(p >= o && g > r);
18036
18062
  }), u = l.length > 0 ? l : c;
18037
18063
  if (n?.aborted || u.length === 0) return null;
18038
- const d = async (m) => {
18039
- if (n?.aborted || m.length === 0) return null;
18040
- const f = new AbortController(), g = () => f.abort();
18041
- n?.addEventListener("abort", g, { once: !0 });
18042
- let p = !1;
18064
+ const d = async (f) => {
18065
+ if (n?.aborted || f.length === 0) return null;
18066
+ const g = new AbortController(), p = () => g.abort();
18067
+ n?.addEventListener("abort", p, { once: !0 });
18068
+ let y = null, v = null, _ = !1;
18043
18069
  try {
18044
- return await Promise.any(
18045
- m.map(async (v) => {
18046
- const S = await this.checkGateway(t, v, i, f.signal);
18047
- if (S) {
18048
- const T = qe(t, v, i);
18049
- return p || (p = !0, S === !0 ? (this.setActiveGateway(v, t), this.logger.info("Gateway resolved via fallback", {
18050
- txId: t,
18051
- gateway: v.host,
18052
- pathSuffix: i,
18053
- workingUrl: T
18054
- })) : this.logger.info("Gateway maybe resolved via fallback (no-cors)", {
18055
- txId: t,
18056
- gateway: v.host,
18057
- pathSuffix: i,
18058
- workingUrl: T
18059
- })), T;
18060
- }
18061
- throw new Error(`Gateway ${v.host} failed check`);
18070
+ const T = await Promise.allSettled(
18071
+ f.map(async (S) => {
18072
+ const I = await this.checkGateway(t, S, i, g.signal);
18073
+ if (!I) throw new Error(`Gateway ${S.host} failed check`);
18074
+ const D = qe(t, S, i), R = I === !0 ? "verified" : "maybe";
18075
+ return _ || (_ = !0, R === "verified" ? (this.setActiveGateway(S, t), this.logger.info("Gateway resolved via fallback", {
18076
+ txId: t,
18077
+ gateway: S.host,
18078
+ pathSuffix: i,
18079
+ workingUrl: D
18080
+ })) : this.logger.info("Gateway maybe resolved via fallback (no-cors)", {
18081
+ txId: t,
18082
+ gateway: S.host,
18083
+ pathSuffix: i,
18084
+ workingUrl: D
18085
+ })), { kind: R, url: D };
18062
18086
  })
18063
18087
  );
18064
- } catch {
18065
- return null;
18088
+ for (const S of T) {
18089
+ if (S.status !== "fulfilled") continue;
18090
+ const I = S.value;
18091
+ if (I.kind === "verified" && !y ? y = { kind: "verified", url: I.url } : I.kind === "maybe" && !v && (v = { kind: "maybe", url: I.url }), y) break;
18092
+ }
18093
+ return y ?? v;
18066
18094
  } finally {
18067
- n?.removeEventListener("abort", g);
18095
+ n?.removeEventListener("abort", p);
18068
18096
  }
18069
18097
  }, h = await d(u);
18070
- if (h) return h;
18098
+ if (h && h.kind === "verified") return h;
18099
+ let m = h;
18071
18100
  if (l.length < c.length && !n?.aborted) {
18072
- const m = c.filter((g) => !l.some((p) => p.host === g.host)).map((g) => g.host);
18073
- this.logger.debug("Healthy gateways exhausted, retrying with previously unhealthy", { excludedHosts: m });
18074
- const f = await d(c);
18075
- if (f) return f;
18101
+ const f = c.filter((p) => !l.some((y) => y.host === p.host)).map((p) => p.host);
18102
+ this.logger.debug("Healthy gateways exhausted, retrying with previously unhealthy", { excludedHosts: f });
18103
+ const g = await d(c);
18104
+ if (g && (g.kind === "verified" || !m))
18105
+ return g;
18076
18106
  }
18077
- return null;
18107
+ return m;
18078
18108
  }
18079
18109
  /**
18080
18110
  * Try Wayfinder as a last resort when all static gateways fail.
@@ -18109,81 +18139,90 @@ class Eg {
18109
18139
  }
18110
18140
  async tryWayfinder(e, t, i, n) {
18111
18141
  if (!this.wayfinder) return null;
18112
- const a = 10, r = /* @__PURE__ */ new Set();
18113
- n && r.add(n);
18114
- const o = `https://arweave.net/${e}${t}`;
18142
+ let a = null;
18143
+ const r = 10, o = /* @__PURE__ */ new Set();
18144
+ n && o.add(n);
18145
+ const c = `https://arweave.net/${e}${t}`;
18115
18146
  try {
18116
- this.logger.debug("Resolving via Wayfinder (first pick)", { txId: e, normalizedUrl: o });
18117
- const u = await this.withTimeout(
18118
- this.wayfinder.resolveUrl({ originalUrl: o }),
18147
+ this.logger.debug("Resolving via Wayfinder (first pick)", { txId: e, normalizedUrl: c });
18148
+ const d = await this.withTimeout(
18149
+ this.wayfinder.resolveUrl({ originalUrl: c }),
18119
18150
  this.timeout + 2e3,
18120
18151
  "Wayfinder resolution timed out"
18121
18152
  );
18122
18153
  if (i?.aborted) return null;
18123
- const d = u.hostname;
18124
- if (r.has(d))
18125
- this.logger.debug("Wayfinder first pick was already excluded, skipping to walk", { host: d });
18154
+ const h = d.hostname;
18155
+ if (o.has(h))
18156
+ this.logger.debug("Wayfinder first pick was already excluded, skipping to walk", { host: h });
18126
18157
  else {
18127
- const h = u.protocol.replace(":", ""), m = {
18128
- host: d,
18129
- protocol: h,
18158
+ const m = d.protocol.replace(":", ""), f = {
18159
+ host: h,
18160
+ protocol: m,
18130
18161
  priority: 0
18131
- }, f = await this.checkGateway(e, m, t, i);
18132
- if (f) {
18133
- const g = qe(e, m, t);
18134
- return f === !0 ? (this.setActiveGateway(m, e), this.logger.info("Gateway resolved via Wayfinder (first pick)", {
18162
+ }, g = await this.checkGateway(e, f, t, i);
18163
+ if (g) {
18164
+ const p = qe(e, f, t), y = g === !0 ? "verified" : "maybe";
18165
+ if (y === "verified" ? (this.setActiveGateway(f, e), this.logger.info("Gateway resolved via Wayfinder (first pick)", {
18135
18166
  txId: e,
18136
- gateway: d,
18167
+ gateway: h,
18137
18168
  pathSuffix: t,
18138
- workingUrl: g
18169
+ workingUrl: p
18139
18170
  })) : this.logger.info("Gateway maybe resolved via Wayfinder (first pick, no-cors)", {
18140
18171
  txId: e,
18141
- gateway: d,
18172
+ gateway: h,
18142
18173
  pathSuffix: t,
18143
- workingUrl: g
18144
- }), g;
18145
- }
18146
- this.logger.debug("Wayfinder first pick failed verify, will walk ranked list", { host: d }), r.add(d);
18174
+ workingUrl: p
18175
+ }), y === "verified") return { kind: y, url: p };
18176
+ a ??= { kind: y, url: p };
18177
+ } else
18178
+ this.logger.debug("Wayfinder first pick failed verify, will walk ranked list", { host: h });
18179
+ o.add(h);
18147
18180
  }
18148
- } catch (u) {
18149
- this.logger.debug("Wayfinder first pick threw, will walk ranked list", { error: u });
18181
+ } catch (d) {
18182
+ this.logger.debug("Wayfinder first pick threw, will walk ranked list", { error: d });
18150
18183
  }
18151
- if (i?.aborted) return null;
18152
- const c = await this.getRankedGatewaysCached(i);
18153
- if (!c || c.length === 0 || i?.aborted) return null;
18154
- const l = c.filter((u) => !r.has(u.hostname)).slice(0, a);
18184
+ if (i?.aborted) return a;
18185
+ const l = await this.getRankedGatewaysCached(i);
18186
+ if (!l || l.length === 0 || i?.aborted) return a;
18187
+ const u = l.filter((d) => !o.has(d.hostname)).slice(0, r);
18155
18188
  this.logger.debug("Walking Wayfinder ranked list", {
18156
18189
  txId: e,
18157
- poolSize: c.length,
18158
- walkSize: l.length
18190
+ poolSize: l.length,
18191
+ walkSize: u.length
18159
18192
  });
18160
- for (const u of l) {
18161
- if (i?.aborted) return null;
18162
- const d = {
18163
- host: u.hostname,
18164
- protocol: u.protocol.replace(":", ""),
18193
+ for (const d of u) {
18194
+ if (i?.aborted) return a;
18195
+ const h = {
18196
+ host: d.hostname,
18197
+ protocol: d.protocol.replace(":", ""),
18165
18198
  priority: 0
18166
- }, h = await this.checkGateway(e, d, t, i);
18167
- if (h) {
18168
- const m = qe(e, d, t);
18169
- return h === !0 ? (this.setActiveGateway(d, e), this.logger.info("Gateway resolved via Wayfinder ranked walk", {
18170
- txId: e,
18171
- gateway: d.host,
18172
- pathSuffix: t,
18173
- workingUrl: m
18174
- })) : this.logger.info("Gateway maybe resolved via Wayfinder ranked walk (no-cors)", {
18199
+ }, m = await this.checkGateway(e, h, t, i);
18200
+ if (m) {
18201
+ const f = qe(e, h, t), g = m === !0 ? "verified" : "maybe";
18202
+ if (g === "verified")
18203
+ return this.setActiveGateway(h, e), this.logger.info("Gateway resolved via Wayfinder ranked walk", {
18204
+ txId: e,
18205
+ gateway: h.host,
18206
+ pathSuffix: t,
18207
+ workingUrl: f
18208
+ }), { kind: g, url: f };
18209
+ this.logger.info("Gateway maybe resolved via Wayfinder ranked walk (no-cors)", {
18175
18210
  txId: e,
18176
- gateway: d.host,
18211
+ gateway: h.host,
18177
18212
  pathSuffix: t,
18178
- workingUrl: m
18179
- }), m;
18213
+ workingUrl: f
18214
+ }), a ??= { kind: g, url: f };
18180
18215
  }
18181
- r.add(d.host);
18216
+ o.add(h.host);
18182
18217
  }
18183
- return this.logger.debug("Wayfinder ranked walk exhausted with no match", {
18218
+ return a ? this.logger.debug("Wayfinder returning best maybe-result (no verified match)", {
18184
18219
  txId: e,
18185
- checkedHosts: Array.from(r)
18186
- }), null;
18220
+ checkedHosts: Array.from(o),
18221
+ maybeUrl: a.url
18222
+ }) : this.logger.debug("Wayfinder ranked walk exhausted with no match", {
18223
+ txId: e,
18224
+ checkedHosts: Array.from(o)
18225
+ }), a;
18187
18226
  }
18188
18227
  /**
18189
18228
  * Set the active gateway, cache it for the txId, and persist to localStorage.
@@ -18692,12 +18731,12 @@ class Eg {
18692
18731
  const g = Date.now();
18693
18732
  let p = !1, y = this.timeout;
18694
18733
  try {
18695
- const v = qe(i, f), S = new AbortController(), T = setTimeout(() => S.abort(), this.timeout), _ = await fetch(v, {
18734
+ const v = qe(i, f), _ = new AbortController(), T = setTimeout(() => _.abort(), this.timeout), S = await fetch(v, {
18696
18735
  method: "HEAD",
18697
18736
  mode: "cors",
18698
- signal: S.signal
18737
+ signal: _.signal
18699
18738
  });
18700
- clearTimeout(T), y = Date.now() - g, p = _.ok || _.status >= 200 && _.status < 400;
18739
+ clearTimeout(T), y = Date.now() - g, p = S.ok || S.status >= 200 && S.status < 400;
18701
18740
  } catch {
18702
18741
  y = Date.now() - g, p = !1;
18703
18742
  }
@@ -18753,7 +18792,7 @@ class Eg {
18753
18792
  this.healthData.clear(), this.logger.info("Health data cleared");
18754
18793
  }
18755
18794
  }
18756
- const Me = new Eg(), la = [
18795
+ const Ae = new Eg(), la = [
18757
18796
  "ipfs.io",
18758
18797
  "cloudflare-ipfs.com",
18759
18798
  "dweb.link",
@@ -18896,80 +18935,80 @@ function Bg() {
18896
18935
  }
18897
18936
  var o = {}, c = ["REJECTED"], l = ["FULFILLED"], u = ["PENDING"];
18898
18937
  i.exports = d;
18899
- function d(_) {
18900
- if (typeof _ != "function")
18938
+ function d(S) {
18939
+ if (typeof S != "function")
18901
18940
  throw new TypeError("resolver must be a function");
18902
- this.state = u, this.queue = [], this.outcome = void 0, _ !== r && g(this, _);
18941
+ this.state = u, this.queue = [], this.outcome = void 0, S !== r && g(this, S);
18903
18942
  }
18904
- d.prototype.catch = function(_) {
18905
- return this.then(null, _);
18906
- }, d.prototype.then = function(_, I) {
18907
- if (typeof _ != "function" && this.state === l || typeof I != "function" && this.state === c)
18943
+ d.prototype.catch = function(S) {
18944
+ return this.then(null, S);
18945
+ }, d.prototype.then = function(S, I) {
18946
+ if (typeof S != "function" && this.state === l || typeof I != "function" && this.state === c)
18908
18947
  return this;
18909
18948
  var D = new this.constructor(r);
18910
18949
  if (this.state !== u) {
18911
- var R = this.state === l ? _ : I;
18950
+ var R = this.state === l ? S : I;
18912
18951
  m(D, R, this.outcome);
18913
18952
  } else
18914
- this.queue.push(new h(D, _, I));
18953
+ this.queue.push(new h(D, S, I));
18915
18954
  return D;
18916
18955
  };
18917
- function h(_, I, D) {
18918
- this.promise = _, typeof I == "function" && (this.onFulfilled = I, this.callFulfilled = this.otherCallFulfilled), typeof D == "function" && (this.onRejected = D, this.callRejected = this.otherCallRejected);
18956
+ function h(S, I, D) {
18957
+ this.promise = S, typeof I == "function" && (this.onFulfilled = I, this.callFulfilled = this.otherCallFulfilled), typeof D == "function" && (this.onRejected = D, this.callRejected = this.otherCallRejected);
18919
18958
  }
18920
- h.prototype.callFulfilled = function(_) {
18921
- o.resolve(this.promise, _);
18922
- }, h.prototype.otherCallFulfilled = function(_) {
18923
- m(this.promise, this.onFulfilled, _);
18924
- }, h.prototype.callRejected = function(_) {
18925
- o.reject(this.promise, _);
18926
- }, h.prototype.otherCallRejected = function(_) {
18927
- m(this.promise, this.onRejected, _);
18959
+ h.prototype.callFulfilled = function(S) {
18960
+ o.resolve(this.promise, S);
18961
+ }, h.prototype.otherCallFulfilled = function(S) {
18962
+ m(this.promise, this.onFulfilled, S);
18963
+ }, h.prototype.callRejected = function(S) {
18964
+ o.reject(this.promise, S);
18965
+ }, h.prototype.otherCallRejected = function(S) {
18966
+ m(this.promise, this.onRejected, S);
18928
18967
  };
18929
- function m(_, I, D) {
18968
+ function m(S, I, D) {
18930
18969
  a(function() {
18931
18970
  var R;
18932
18971
  try {
18933
18972
  R = I(D);
18934
18973
  } catch (q) {
18935
- return o.reject(_, q);
18974
+ return o.reject(S, q);
18936
18975
  }
18937
- R === _ ? o.reject(_, new TypeError("Cannot resolve promise with itself")) : o.resolve(_, R);
18976
+ R === S ? o.reject(S, new TypeError("Cannot resolve promise with itself")) : o.resolve(S, R);
18938
18977
  });
18939
18978
  }
18940
- o.resolve = function(_, I) {
18979
+ o.resolve = function(S, I) {
18941
18980
  var D = p(f, I);
18942
18981
  if (D.status === "error")
18943
- return o.reject(_, D.value);
18982
+ return o.reject(S, D.value);
18944
18983
  var R = D.value;
18945
18984
  if (R)
18946
- g(_, R);
18985
+ g(S, R);
18947
18986
  else {
18948
- _.state = l, _.outcome = I;
18949
- for (var q = -1, O = _.queue.length; ++q < O; )
18950
- _.queue[q].callFulfilled(I);
18987
+ S.state = l, S.outcome = I;
18988
+ for (var q = -1, O = S.queue.length; ++q < O; )
18989
+ S.queue[q].callFulfilled(I);
18951
18990
  }
18952
- return _;
18953
- }, o.reject = function(_, I) {
18954
- _.state = c, _.outcome = I;
18955
- for (var D = -1, R = _.queue.length; ++D < R; )
18956
- _.queue[D].callRejected(I);
18957
- return _;
18991
+ return S;
18992
+ }, o.reject = function(S, I) {
18993
+ S.state = c, S.outcome = I;
18994
+ for (var D = -1, R = S.queue.length; ++D < R; )
18995
+ S.queue[D].callRejected(I);
18996
+ return S;
18958
18997
  };
18959
- function f(_) {
18960
- var I = _ && _.then;
18961
- if (_ && (typeof _ == "object" || typeof _ == "function") && typeof I == "function")
18998
+ function f(S) {
18999
+ var I = S && S.then;
19000
+ if (S && (typeof S == "object" || typeof S == "function") && typeof I == "function")
18962
19001
  return function() {
18963
- I.apply(_, arguments);
19002
+ I.apply(S, arguments);
18964
19003
  };
18965
19004
  }
18966
- function g(_, I) {
19005
+ function g(S, I) {
18967
19006
  var D = !1;
18968
19007
  function R(Z) {
18969
- D || (D = !0, o.reject(_, Z));
19008
+ D || (D = !0, o.reject(S, Z));
18970
19009
  }
18971
19010
  function q(Z) {
18972
- D || (D = !0, o.resolve(_, Z));
19011
+ D || (D = !0, o.resolve(S, Z));
18973
19012
  }
18974
19013
  function O() {
18975
19014
  I(q, R);
@@ -18977,34 +19016,34 @@ function Bg() {
18977
19016
  var W = p(O);
18978
19017
  W.status === "error" && R(W.value);
18979
19018
  }
18980
- function p(_, I) {
19019
+ function p(S, I) {
18981
19020
  var D = {};
18982
19021
  try {
18983
- D.value = _(I), D.status = "success";
19022
+ D.value = S(I), D.status = "success";
18984
19023
  } catch (R) {
18985
19024
  D.status = "error", D.value = R;
18986
19025
  }
18987
19026
  return D;
18988
19027
  }
18989
19028
  d.resolve = y;
18990
- function y(_) {
18991
- return _ instanceof this ? _ : o.resolve(new this(r), _);
19029
+ function y(S) {
19030
+ return S instanceof this ? S : o.resolve(new this(r), S);
18992
19031
  }
18993
19032
  d.reject = v;
18994
- function v(_) {
19033
+ function v(S) {
18995
19034
  var I = new this(r);
18996
- return o.reject(I, _);
19035
+ return o.reject(I, S);
18997
19036
  }
18998
- d.all = S;
18999
- function S(_) {
19037
+ d.all = _;
19038
+ function _(S) {
19000
19039
  var I = this;
19001
- if (Object.prototype.toString.call(_) !== "[object Array]")
19040
+ if (Object.prototype.toString.call(S) !== "[object Array]")
19002
19041
  return this.reject(new TypeError("must be an array"));
19003
- var D = _.length, R = !1;
19042
+ var D = S.length, R = !1;
19004
19043
  if (!D)
19005
19044
  return this.resolve([]);
19006
19045
  for (var q = new Array(D), O = 0, W = -1, Z = new this(r); ++W < D; )
19007
- Q(_[W], W);
19046
+ Q(S[W], W);
19008
19047
  return Z;
19009
19048
  function Q(se, oe) {
19010
19049
  I.resolve(se).then(j, function(X) {
@@ -19016,15 +19055,15 @@ function Bg() {
19016
19055
  }
19017
19056
  }
19018
19057
  d.race = T;
19019
- function T(_) {
19058
+ function T(S) {
19020
19059
  var I = this;
19021
- if (Object.prototype.toString.call(_) !== "[object Array]")
19060
+ if (Object.prototype.toString.call(S) !== "[object Array]")
19022
19061
  return this.reject(new TypeError("must be an array"));
19023
- var D = _.length, R = !1;
19062
+ var D = S.length, R = !1;
19024
19063
  if (!D)
19025
19064
  return this.resolve([]);
19026
19065
  for (var q = -1, O = new this(r); ++q < D; )
19027
- W(_[q]);
19066
+ W(S[q]);
19028
19067
  return O;
19029
19068
  function W(Z) {
19030
19069
  I.resolve(Z).then(function(Q) {
@@ -19083,12 +19122,12 @@ function Bg() {
19083
19122
  b = b || [], C = C || {};
19084
19123
  try {
19085
19124
  return new Blob(b, C);
19086
- } catch (A) {
19087
- if (A.name !== "TypeError")
19088
- throw A;
19089
- for (var w = typeof BlobBuilder < "u" ? BlobBuilder : typeof MSBlobBuilder < "u" ? MSBlobBuilder : typeof MozBlobBuilder < "u" ? MozBlobBuilder : WebKitBlobBuilder, M = new w(), k = 0; k < b.length; k += 1)
19090
- M.append(b[k]);
19091
- return M.getBlob(C.type);
19125
+ } catch (k) {
19126
+ if (k.name !== "TypeError")
19127
+ throw k;
19128
+ for (var w = typeof BlobBuilder < "u" ? BlobBuilder : typeof MSBlobBuilder < "u" ? MSBlobBuilder : typeof MozBlobBuilder < "u" ? MozBlobBuilder : WebKitBlobBuilder, A = new w(), M = 0; M < b.length; M += 1)
19129
+ A.append(b[M]);
19130
+ return A.getBlob(C.type);
19092
19131
  }
19093
19132
  }
19094
19133
  typeof Promise > "u" && t(3);
@@ -19110,20 +19149,20 @@ function Bg() {
19110
19149
  if (arguments.length && typeof arguments[arguments.length - 1] == "function")
19111
19150
  return arguments[arguments.length - 1];
19112
19151
  }
19113
- var p = "local-forage-detect-blob-support", y = void 0, v = {}, S = Object.prototype.toString, T = "readonly", _ = "readwrite";
19152
+ var p = "local-forage-detect-blob-support", y = void 0, v = {}, _ = Object.prototype.toString, T = "readonly", S = "readwrite";
19114
19153
  function I(b) {
19115
- for (var C = b.length, w = new ArrayBuffer(C), M = new Uint8Array(w), k = 0; k < C; k++)
19116
- M[k] = b.charCodeAt(k);
19154
+ for (var C = b.length, w = new ArrayBuffer(C), A = new Uint8Array(w), M = 0; M < C; M++)
19155
+ A[M] = b.charCodeAt(M);
19117
19156
  return w;
19118
19157
  }
19119
19158
  function D(b) {
19120
19159
  return new d(function(C) {
19121
- var w = b.transaction(p, _), M = u([""]);
19122
- w.objectStore(p).put(M, "key"), w.onabort = function(k) {
19123
- k.preventDefault(), k.stopPropagation(), C(!1);
19160
+ var w = b.transaction(p, S), A = u([""]);
19161
+ w.objectStore(p).put(A, "key"), w.onabort = function(M) {
19162
+ M.preventDefault(), M.stopPropagation(), C(!1);
19124
19163
  }, w.oncomplete = function() {
19125
- var k = navigator.userAgent.match(/Chrome\/(\d+)/), A = navigator.userAgent.match(/Edge\//);
19126
- C(A || !k || parseInt(k[1], 10) >= 43);
19164
+ var M = navigator.userAgent.match(/Chrome\/(\d+)/), k = navigator.userAgent.match(/Edge\//);
19165
+ C(k || !M || parseInt(M[1], 10) >= 43);
19127
19166
  };
19128
19167
  }).catch(function() {
19129
19168
  return !1;
@@ -19136,8 +19175,8 @@ function Bg() {
19136
19175
  }
19137
19176
  function q(b) {
19138
19177
  var C = v[b.name], w = {};
19139
- w.promise = new d(function(M, k) {
19140
- w.resolve = M, w.reject = k;
19178
+ w.promise = new d(function(A, M) {
19179
+ w.resolve = A, w.reject = M;
19141
19180
  }), C.deferredOperations.push(w), C.dbReady ? C.dbReady = C.dbReady.then(function() {
19142
19181
  return w.promise;
19143
19182
  }) : C.dbReady = w.promise;
@@ -19148,22 +19187,22 @@ function Bg() {
19148
19187
  return w.resolve(), w.promise;
19149
19188
  }
19150
19189
  function W(b, C) {
19151
- var w = v[b.name], M = w.deferredOperations.pop();
19152
- if (M)
19153
- return M.reject(C), M.promise;
19190
+ var w = v[b.name], A = w.deferredOperations.pop();
19191
+ if (A)
19192
+ return A.reject(C), A.promise;
19154
19193
  }
19155
19194
  function Z(b, C) {
19156
- return new d(function(w, M) {
19195
+ return new d(function(w, A) {
19157
19196
  if (v[b.name] = v[b.name] || le(), b.db)
19158
19197
  if (C)
19159
19198
  q(b), b.db.close();
19160
19199
  else
19161
19200
  return w(b.db);
19162
- var k = [b.name];
19163
- C && k.push(b.version);
19164
- var A = c.open.apply(c, k);
19165
- C && (A.onupgradeneeded = function(x) {
19166
- var P = A.result;
19201
+ var M = [b.name];
19202
+ C && M.push(b.version);
19203
+ var k = c.open.apply(c, M);
19204
+ C && (k.onupgradeneeded = function(x) {
19205
+ var P = k.result;
19167
19206
  try {
19168
19207
  P.createObjectStore(b.storeName), x.oldVersion <= 1 && P.createObjectStore(p);
19169
19208
  } catch (B) {
@@ -19172,10 +19211,10 @@ function Bg() {
19172
19211
  else
19173
19212
  throw B;
19174
19213
  }
19175
- }), A.onerror = function(x) {
19176
- x.preventDefault(), M(A.error);
19177
- }, A.onsuccess = function() {
19178
- var x = A.result;
19214
+ }), k.onerror = function(x) {
19215
+ x.preventDefault(), A(k.error);
19216
+ }, k.onsuccess = function() {
19217
+ var x = k.result;
19179
19218
  x.onversionchange = function(P) {
19180
19219
  P.target.close();
19181
19220
  }, w(x), O(b);
@@ -19191,11 +19230,11 @@ function Bg() {
19191
19230
  function oe(b, C) {
19192
19231
  if (!b.db)
19193
19232
  return !0;
19194
- var w = !b.db.objectStoreNames.contains(b.storeName), M = b.version < b.db.version, k = b.version > b.db.version;
19195
- if (M && (b.version !== C && console.warn('The database "' + b.name + `" can't be downgraded from version ` + b.db.version + " to version " + b.version + "."), b.version = b.db.version), k || w) {
19233
+ var w = !b.db.objectStoreNames.contains(b.storeName), A = b.version < b.db.version, M = b.version > b.db.version;
19234
+ if (A && (b.version !== C && console.warn('The database "' + b.name + `" can't be downgraded from version ` + b.db.version + " to version " + b.version + "."), b.version = b.db.version), M || w) {
19196
19235
  if (w) {
19197
- var A = b.db.version + 1;
19198
- A > b.version && (b.version = A);
19236
+ var k = b.db.version + 1;
19237
+ k > b.version && (b.version = k);
19199
19238
  }
19200
19239
  return !0;
19201
19240
  }
@@ -19203,15 +19242,15 @@ function Bg() {
19203
19242
  }
19204
19243
  function j(b) {
19205
19244
  return new d(function(C, w) {
19206
- var M = new FileReader();
19207
- M.onerror = w, M.onloadend = function(k) {
19208
- var A = btoa(k.target.result || "");
19245
+ var A = new FileReader();
19246
+ A.onerror = w, A.onloadend = function(M) {
19247
+ var k = btoa(M.target.result || "");
19209
19248
  C({
19210
19249
  __local_forage_encoded_blob: !0,
19211
- data: A,
19250
+ data: k,
19212
19251
  type: b.type
19213
19252
  });
19214
- }, M.readAsBinaryString(b);
19253
+ }, A.readAsBinaryString(b);
19215
19254
  });
19216
19255
  }
19217
19256
  function X(b) {
@@ -19223,44 +19262,44 @@ function Bg() {
19223
19262
  }
19224
19263
  function ge(b) {
19225
19264
  var C = this, w = C._initReady().then(function() {
19226
- var M = v[C._dbInfo.name];
19227
- if (M && M.dbReady)
19228
- return M.dbReady;
19265
+ var A = v[C._dbInfo.name];
19266
+ if (A && A.dbReady)
19267
+ return A.dbReady;
19229
19268
  });
19230
19269
  return m(w, b, b), w;
19231
19270
  }
19232
19271
  function Qt(b) {
19233
19272
  q(b);
19234
- for (var C = v[b.name], w = C.forages, M = 0; M < w.length; M++) {
19235
- var k = w[M];
19236
- k._dbInfo.db && (k._dbInfo.db.close(), k._dbInfo.db = null);
19273
+ for (var C = v[b.name], w = C.forages, A = 0; A < w.length; A++) {
19274
+ var M = w[A];
19275
+ M._dbInfo.db && (M._dbInfo.db.close(), M._dbInfo.db = null);
19237
19276
  }
19238
- return b.db = null, Q(b).then(function(A) {
19239
- return b.db = A, oe(b) ? se(b) : A;
19240
- }).then(function(A) {
19241
- b.db = C.db = A;
19277
+ return b.db = null, Q(b).then(function(k) {
19278
+ return b.db = k, oe(b) ? se(b) : k;
19279
+ }).then(function(k) {
19280
+ b.db = C.db = k;
19242
19281
  for (var x = 0; x < w.length; x++)
19243
- w[x]._dbInfo.db = A;
19244
- }).catch(function(A) {
19245
- throw W(b, A), A;
19282
+ w[x]._dbInfo.db = k;
19283
+ }).catch(function(k) {
19284
+ throw W(b, k), k;
19246
19285
  });
19247
19286
  }
19248
- function J(b, C, w, M) {
19249
- M === void 0 && (M = 1);
19287
+ function J(b, C, w, A) {
19288
+ A === void 0 && (A = 1);
19250
19289
  try {
19251
- var k = b.db.transaction(b.storeName, C);
19252
- w(null, k);
19253
- } catch (A) {
19254
- if (M > 0 && (!b.db || A.name === "InvalidStateError" || A.name === "NotFoundError"))
19290
+ var M = b.db.transaction(b.storeName, C);
19291
+ w(null, M);
19292
+ } catch (k) {
19293
+ if (A > 0 && (!b.db || k.name === "InvalidStateError" || k.name === "NotFoundError"))
19255
19294
  return d.resolve().then(function() {
19256
- if (!b.db || A.name === "NotFoundError" && !b.db.objectStoreNames.contains(b.storeName) && b.version <= b.db.version)
19295
+ if (!b.db || k.name === "NotFoundError" && !b.db.objectStoreNames.contains(b.storeName) && b.version <= b.db.version)
19257
19296
  return b.db && (b.version = b.db.version + 1), se(b);
19258
19297
  }).then(function() {
19259
19298
  return Qt(b).then(function() {
19260
- J(b, C, w, M - 1);
19299
+ J(b, C, w, A - 1);
19261
19300
  });
19262
19301
  }).catch(w);
19263
- w(A);
19302
+ w(k);
19264
19303
  }
19265
19304
  }
19266
19305
  function le() {
@@ -19280,25 +19319,25 @@ function Bg() {
19280
19319
  db: null
19281
19320
  };
19282
19321
  if (b)
19283
- for (var M in b)
19284
- w[M] = b[M];
19285
- var k = v[w.name];
19286
- k || (k = le(), v[w.name] = k), k.forages.push(C), C._initReady || (C._initReady = C.ready, C.ready = ge);
19287
- var A = [];
19322
+ for (var A in b)
19323
+ w[A] = b[A];
19324
+ var M = v[w.name];
19325
+ M || (M = le(), v[w.name] = M), M.forages.push(C), C._initReady || (C._initReady = C.ready, C.ready = ge);
19326
+ var k = [];
19288
19327
  function x() {
19289
19328
  return d.resolve();
19290
19329
  }
19291
- for (var P = 0; P < k.forages.length; P++) {
19292
- var B = k.forages[P];
19293
- B !== C && A.push(B._initReady().catch(x));
19330
+ for (var P = 0; P < M.forages.length; P++) {
19331
+ var B = M.forages[P];
19332
+ B !== C && k.push(B._initReady().catch(x));
19294
19333
  }
19295
- var N = k.forages.slice(0);
19296
- return d.all(A).then(function() {
19297
- return w.db = k.db, Q(w);
19334
+ var N = M.forages.slice(0);
19335
+ return d.all(k).then(function() {
19336
+ return w.db = M.db, Q(w);
19298
19337
  }).then(function($) {
19299
19338
  return w.db = $, oe(w, C._defaultConfig.version) ? se(w) : $;
19300
19339
  }).then(function($) {
19301
- w.db = k.db = $, C._dbInfo = w;
19340
+ w.db = M.db = $, C._dbInfo = w;
19302
19341
  for (var V = 0; V < N.length; V++) {
19303
19342
  var te = N[V];
19304
19343
  te !== C && (te._dbInfo.db = w.db, te._dbInfo.version = w.version);
@@ -19308,33 +19347,33 @@ function Bg() {
19308
19347
  function Gi(b, C) {
19309
19348
  var w = this;
19310
19349
  b = f(b);
19311
- var M = new d(function(k, A) {
19350
+ var A = new d(function(M, k) {
19312
19351
  w.ready().then(function() {
19313
19352
  J(w._dbInfo, T, function(x, P) {
19314
19353
  if (x)
19315
- return A(x);
19354
+ return k(x);
19316
19355
  try {
19317
19356
  var B = P.objectStore(w._dbInfo.storeName), N = B.get(b);
19318
19357
  N.onsuccess = function() {
19319
19358
  var $ = N.result;
19320
- $ === void 0 && ($ = null), fe($) && ($ = X($)), k($);
19359
+ $ === void 0 && ($ = null), fe($) && ($ = X($)), M($);
19321
19360
  }, N.onerror = function() {
19322
- A(N.error);
19361
+ k(N.error);
19323
19362
  };
19324
19363
  } catch ($) {
19325
- A($);
19364
+ k($);
19326
19365
  }
19327
19366
  });
19328
- }).catch(A);
19367
+ }).catch(k);
19329
19368
  });
19330
- return h(M, C), M;
19369
+ return h(A, C), A;
19331
19370
  }
19332
19371
  function _a(b, C) {
19333
- var w = this, M = new d(function(k, A) {
19372
+ var w = this, A = new d(function(M, k) {
19334
19373
  w.ready().then(function() {
19335
19374
  J(w._dbInfo, T, function(x, P) {
19336
19375
  if (x)
19337
- return A(x);
19376
+ return k(x);
19338
19377
  try {
19339
19378
  var B = P.objectStore(w._dbInfo.storeName), N = B.openCursor(), $ = 1;
19340
19379
  N.onsuccess = function() {
@@ -19343,39 +19382,39 @@ function Bg() {
19343
19382
  var te = V.value;
19344
19383
  fe(te) && (te = X(te));
19345
19384
  var ie = b(te, V.key, $++);
19346
- ie !== void 0 ? k(ie) : V.continue();
19385
+ ie !== void 0 ? M(ie) : V.continue();
19347
19386
  } else
19348
- k();
19387
+ M();
19349
19388
  }, N.onerror = function() {
19350
- A(N.error);
19389
+ k(N.error);
19351
19390
  };
19352
19391
  } catch (V) {
19353
- A(V);
19392
+ k(V);
19354
19393
  }
19355
19394
  });
19356
- }).catch(A);
19395
+ }).catch(k);
19357
19396
  });
19358
- return h(M, C), M;
19397
+ return h(A, C), A;
19359
19398
  }
19360
19399
  function wc(b, C, w) {
19361
- var M = this;
19400
+ var A = this;
19362
19401
  b = f(b);
19363
- var k = new d(function(A, x) {
19402
+ var M = new d(function(k, x) {
19364
19403
  var P;
19365
- M.ready().then(function() {
19366
- return P = M._dbInfo, S.call(C) === "[object Blob]" ? R(P.db).then(function(B) {
19404
+ A.ready().then(function() {
19405
+ return P = A._dbInfo, _.call(C) === "[object Blob]" ? R(P.db).then(function(B) {
19367
19406
  return B ? C : j(C);
19368
19407
  }) : C;
19369
19408
  }).then(function(B) {
19370
- J(M._dbInfo, _, function(N, $) {
19409
+ J(A._dbInfo, S, function(N, $) {
19371
19410
  if (N)
19372
19411
  return x(N);
19373
19412
  try {
19374
- var V = $.objectStore(M._dbInfo.storeName);
19413
+ var V = $.objectStore(A._dbInfo.storeName);
19375
19414
  B === null && (B = void 0);
19376
19415
  var te = V.put(B, b);
19377
19416
  $.oncomplete = function() {
19378
- B === void 0 && (B = null), A(B);
19417
+ B === void 0 && (B = null), k(B);
19379
19418
  }, $.onabort = $.onerror = function() {
19380
19419
  var ie = te.error ? te.error : te.transaction.error;
19381
19420
  x(ie);
@@ -19386,149 +19425,149 @@ function Bg() {
19386
19425
  });
19387
19426
  }).catch(x);
19388
19427
  });
19389
- return h(k, w), k;
19428
+ return h(M, w), M;
19390
19429
  }
19391
19430
  function Sc(b, C) {
19392
19431
  var w = this;
19393
19432
  b = f(b);
19394
- var M = new d(function(k, A) {
19433
+ var A = new d(function(M, k) {
19395
19434
  w.ready().then(function() {
19396
- J(w._dbInfo, _, function(x, P) {
19435
+ J(w._dbInfo, S, function(x, P) {
19397
19436
  if (x)
19398
- return A(x);
19437
+ return k(x);
19399
19438
  try {
19400
19439
  var B = P.objectStore(w._dbInfo.storeName), N = B.delete(b);
19401
19440
  P.oncomplete = function() {
19402
- k();
19441
+ M();
19403
19442
  }, P.onerror = function() {
19404
- A(N.error);
19443
+ k(N.error);
19405
19444
  }, P.onabort = function() {
19406
19445
  var $ = N.error ? N.error : N.transaction.error;
19407
- A($);
19446
+ k($);
19408
19447
  };
19409
19448
  } catch ($) {
19410
- A($);
19449
+ k($);
19411
19450
  }
19412
19451
  });
19413
- }).catch(A);
19452
+ }).catch(k);
19414
19453
  });
19415
- return h(M, C), M;
19454
+ return h(A, C), A;
19416
19455
  }
19417
19456
  function _c(b) {
19418
- var C = this, w = new d(function(M, k) {
19457
+ var C = this, w = new d(function(A, M) {
19419
19458
  C.ready().then(function() {
19420
- J(C._dbInfo, _, function(A, x) {
19421
- if (A)
19422
- return k(A);
19459
+ J(C._dbInfo, S, function(k, x) {
19460
+ if (k)
19461
+ return M(k);
19423
19462
  try {
19424
19463
  var P = x.objectStore(C._dbInfo.storeName), B = P.clear();
19425
19464
  x.oncomplete = function() {
19426
- M();
19465
+ A();
19427
19466
  }, x.onabort = x.onerror = function() {
19428
19467
  var N = B.error ? B.error : B.transaction.error;
19429
- k(N);
19468
+ M(N);
19430
19469
  };
19431
19470
  } catch (N) {
19432
- k(N);
19471
+ M(N);
19433
19472
  }
19434
19473
  });
19435
- }).catch(k);
19474
+ }).catch(M);
19436
19475
  });
19437
19476
  return h(w, b), w;
19438
19477
  }
19439
19478
  function Tc(b) {
19440
- var C = this, w = new d(function(M, k) {
19479
+ var C = this, w = new d(function(A, M) {
19441
19480
  C.ready().then(function() {
19442
- J(C._dbInfo, T, function(A, x) {
19443
- if (A)
19444
- return k(A);
19481
+ J(C._dbInfo, T, function(k, x) {
19482
+ if (k)
19483
+ return M(k);
19445
19484
  try {
19446
19485
  var P = x.objectStore(C._dbInfo.storeName), B = P.count();
19447
19486
  B.onsuccess = function() {
19448
- M(B.result);
19487
+ A(B.result);
19449
19488
  }, B.onerror = function() {
19450
- k(B.error);
19489
+ M(B.error);
19451
19490
  };
19452
19491
  } catch (N) {
19453
- k(N);
19492
+ M(N);
19454
19493
  }
19455
19494
  });
19456
- }).catch(k);
19495
+ }).catch(M);
19457
19496
  });
19458
19497
  return h(w, b), w;
19459
19498
  }
19460
19499
  function Cc(b, C) {
19461
- var w = this, M = new d(function(k, A) {
19500
+ var w = this, A = new d(function(M, k) {
19462
19501
  if (b < 0) {
19463
- k(null);
19502
+ M(null);
19464
19503
  return;
19465
19504
  }
19466
19505
  w.ready().then(function() {
19467
19506
  J(w._dbInfo, T, function(x, P) {
19468
19507
  if (x)
19469
- return A(x);
19508
+ return k(x);
19470
19509
  try {
19471
19510
  var B = P.objectStore(w._dbInfo.storeName), N = !1, $ = B.openKeyCursor();
19472
19511
  $.onsuccess = function() {
19473
19512
  var V = $.result;
19474
19513
  if (!V) {
19475
- k(null);
19514
+ M(null);
19476
19515
  return;
19477
19516
  }
19478
- b === 0 || N ? k(V.key) : (N = !0, V.advance(b));
19517
+ b === 0 || N ? M(V.key) : (N = !0, V.advance(b));
19479
19518
  }, $.onerror = function() {
19480
- A($.error);
19519
+ k($.error);
19481
19520
  };
19482
19521
  } catch (V) {
19483
- A(V);
19522
+ k(V);
19484
19523
  }
19485
19524
  });
19486
- }).catch(A);
19525
+ }).catch(k);
19487
19526
  });
19488
- return h(M, C), M;
19527
+ return h(A, C), A;
19489
19528
  }
19490
- function Ac(b) {
19491
- var C = this, w = new d(function(M, k) {
19529
+ function kc(b) {
19530
+ var C = this, w = new d(function(A, M) {
19492
19531
  C.ready().then(function() {
19493
- J(C._dbInfo, T, function(A, x) {
19494
- if (A)
19495
- return k(A);
19532
+ J(C._dbInfo, T, function(k, x) {
19533
+ if (k)
19534
+ return M(k);
19496
19535
  try {
19497
19536
  var P = x.objectStore(C._dbInfo.storeName), B = P.openKeyCursor(), N = [];
19498
19537
  B.onsuccess = function() {
19499
19538
  var $ = B.result;
19500
19539
  if (!$) {
19501
- M(N);
19540
+ A(N);
19502
19541
  return;
19503
19542
  }
19504
19543
  N.push($.key), $.continue();
19505
19544
  }, B.onerror = function() {
19506
- k(B.error);
19545
+ M(B.error);
19507
19546
  };
19508
19547
  } catch ($) {
19509
- k($);
19548
+ M($);
19510
19549
  }
19511
19550
  });
19512
- }).catch(k);
19551
+ }).catch(M);
19513
19552
  });
19514
19553
  return h(w, b), w;
19515
19554
  }
19516
- function Mc(b, C) {
19555
+ function Ac(b, C) {
19517
19556
  C = g.apply(this, arguments);
19518
19557
  var w = this.config();
19519
19558
  b = typeof b != "function" && b || {}, b.name || (b.name = b.name || w.name, b.storeName = b.storeName || w.storeName);
19520
- var M = this, k;
19559
+ var A = this, M;
19521
19560
  if (!b.name)
19522
- k = d.reject("Invalid arguments");
19561
+ M = d.reject("Invalid arguments");
19523
19562
  else {
19524
- var A = b.name === w.name && M._dbInfo.db, x = A ? d.resolve(M._dbInfo.db) : Q(b).then(function(P) {
19563
+ var k = b.name === w.name && A._dbInfo.db, x = k ? d.resolve(A._dbInfo.db) : Q(b).then(function(P) {
19525
19564
  var B = v[b.name], N = B.forages;
19526
19565
  B.db = P;
19527
19566
  for (var $ = 0; $ < N.length; $++)
19528
19567
  N[$]._dbInfo.db = P;
19529
19568
  return P;
19530
19569
  });
19531
- b.storeName ? k = x.then(function(P) {
19570
+ b.storeName ? M = x.then(function(P) {
19532
19571
  if (P.objectStoreNames.contains(b.storeName)) {
19533
19572
  var B = P.version + 1;
19534
19573
  q(b);
@@ -19562,7 +19601,7 @@ function Bg() {
19562
19601
  }), ne;
19563
19602
  });
19564
19603
  }
19565
- }) : k = x.then(function(P) {
19604
+ }) : M = x.then(function(P) {
19566
19605
  q(b);
19567
19606
  var B = v[b.name], N = B.forages;
19568
19607
  P.close();
@@ -19594,9 +19633,9 @@ function Bg() {
19594
19633
  });
19595
19634
  });
19596
19635
  }
19597
- return h(k, C), k;
19636
+ return h(M, C), M;
19598
19637
  }
19599
- var kc = {
19638
+ var Mc = {
19600
19639
  _driver: "asyncStorage",
19601
19640
  _initStorage: dt,
19602
19641
  _support: l(),
@@ -19607,38 +19646,38 @@ function Bg() {
19607
19646
  clear: _c,
19608
19647
  length: Tc,
19609
19648
  key: Cc,
19610
- keys: Ac,
19611
- dropInstance: Mc
19649
+ keys: kc,
19650
+ dropInstance: Ac
19612
19651
  };
19613
19652
  function Ic() {
19614
19653
  return typeof openDatabase == "function";
19615
19654
  }
19616
- var Xe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Dc = "~~local_forage_type~", Ta = /^~~local_forage_type~([^~]+)~/, ei = "__lfsc__:", Ui = ei.length, Vi = "arbf", ji = "blob", Ca = "si08", Aa = "ui08", Ma = "uic8", ka = "si16", Ia = "si32", Da = "ur16", Ea = "ui32", xa = "fl32", Ra = "fl64", Pa = Ui + Vi.length, Ba = Object.prototype.toString;
19655
+ var Xe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Dc = "~~local_forage_type~", Ta = /^~~local_forage_type~([^~]+)~/, ei = "__lfsc__:", Ui = ei.length, Vi = "arbf", ji = "blob", Ca = "si08", ka = "ui08", Aa = "uic8", Ma = "si16", Ia = "si32", Da = "ur16", Ea = "ui32", xa = "fl32", Ra = "fl64", Pa = Ui + Vi.length, Ba = Object.prototype.toString;
19617
19656
  function Na(b) {
19618
- var C = b.length * 0.75, w = b.length, M, k = 0, A, x, P, B;
19657
+ var C = b.length * 0.75, w = b.length, A, M = 0, k, x, P, B;
19619
19658
  b[b.length - 1] === "=" && (C--, b[b.length - 2] === "=" && C--);
19620
19659
  var N = new ArrayBuffer(C), $ = new Uint8Array(N);
19621
- for (M = 0; M < w; M += 4)
19622
- A = Xe.indexOf(b[M]), x = Xe.indexOf(b[M + 1]), P = Xe.indexOf(b[M + 2]), B = Xe.indexOf(b[M + 3]), $[k++] = A << 2 | x >> 4, $[k++] = (x & 15) << 4 | P >> 2, $[k++] = (P & 3) << 6 | B & 63;
19660
+ for (A = 0; A < w; A += 4)
19661
+ k = Xe.indexOf(b[A]), x = Xe.indexOf(b[A + 1]), P = Xe.indexOf(b[A + 2]), B = Xe.indexOf(b[A + 3]), $[M++] = k << 2 | x >> 4, $[M++] = (x & 15) << 4 | P >> 2, $[M++] = (P & 3) << 6 | B & 63;
19623
19662
  return N;
19624
19663
  }
19625
19664
  function Ki(b) {
19626
- var C = new Uint8Array(b), w = "", M;
19627
- for (M = 0; M < C.length; M += 3)
19628
- w += Xe[C[M] >> 2], w += Xe[(C[M] & 3) << 4 | C[M + 1] >> 4], w += Xe[(C[M + 1] & 15) << 2 | C[M + 2] >> 6], w += Xe[C[M + 2] & 63];
19665
+ var C = new Uint8Array(b), w = "", A;
19666
+ for (A = 0; A < C.length; A += 3)
19667
+ w += Xe[C[A] >> 2], w += Xe[(C[A] & 3) << 4 | C[A + 1] >> 4], w += Xe[(C[A + 1] & 15) << 2 | C[A + 2] >> 6], w += Xe[C[A + 2] & 63];
19629
19668
  return C.length % 3 === 2 ? w = w.substring(0, w.length - 1) + "=" : C.length % 3 === 1 && (w = w.substring(0, w.length - 2) + "=="), w;
19630
19669
  }
19631
19670
  function Ec(b, C) {
19632
19671
  var w = "";
19633
19672
  if (b && (w = Ba.call(b)), b && (w === "[object ArrayBuffer]" || b.buffer && Ba.call(b.buffer) === "[object ArrayBuffer]")) {
19634
- var M, k = ei;
19635
- b instanceof ArrayBuffer ? (M = b, k += Vi) : (M = b.buffer, w === "[object Int8Array]" ? k += Ca : w === "[object Uint8Array]" ? k += Aa : w === "[object Uint8ClampedArray]" ? k += Ma : w === "[object Int16Array]" ? k += ka : w === "[object Uint16Array]" ? k += Da : w === "[object Int32Array]" ? k += Ia : w === "[object Uint32Array]" ? k += Ea : w === "[object Float32Array]" ? k += xa : w === "[object Float64Array]" ? k += Ra : C(new Error("Failed to get type for BinaryArray"))), C(k + Ki(M));
19673
+ var A, M = ei;
19674
+ b instanceof ArrayBuffer ? (A = b, M += Vi) : (A = b.buffer, w === "[object Int8Array]" ? M += Ca : w === "[object Uint8Array]" ? M += ka : w === "[object Uint8ClampedArray]" ? M += Aa : w === "[object Int16Array]" ? M += Ma : w === "[object Uint16Array]" ? M += Da : w === "[object Int32Array]" ? M += Ia : w === "[object Uint32Array]" ? M += Ea : w === "[object Float32Array]" ? M += xa : w === "[object Float64Array]" ? M += Ra : C(new Error("Failed to get type for BinaryArray"))), C(M + Ki(A));
19636
19675
  } else if (w === "[object Blob]") {
19637
- var A = new FileReader();
19638
- A.onload = function() {
19676
+ var k = new FileReader();
19677
+ k.onload = function() {
19639
19678
  var x = Dc + b.type + "~" + Ki(this.result);
19640
19679
  C(ei + ji + x);
19641
- }, A.readAsArrayBuffer(b);
19680
+ }, k.readAsArrayBuffer(b);
19642
19681
  } else
19643
19682
  try {
19644
19683
  C(JSON.stringify(b));
@@ -19649,35 +19688,35 @@ function Bg() {
19649
19688
  function xc(b) {
19650
19689
  if (b.substring(0, Ui) !== ei)
19651
19690
  return JSON.parse(b);
19652
- var C = b.substring(Pa), w = b.substring(Ui, Pa), M;
19691
+ var C = b.substring(Pa), w = b.substring(Ui, Pa), A;
19653
19692
  if (w === ji && Ta.test(C)) {
19654
- var k = C.match(Ta);
19655
- M = k[1], C = C.substring(k[0].length);
19693
+ var M = C.match(Ta);
19694
+ A = M[1], C = C.substring(M[0].length);
19656
19695
  }
19657
- var A = Na(C);
19696
+ var k = Na(C);
19658
19697
  switch (w) {
19659
19698
  case Vi:
19660
- return A;
19699
+ return k;
19661
19700
  case ji:
19662
- return u([A], { type: M });
19701
+ return u([k], { type: A });
19663
19702
  case Ca:
19664
- return new Int8Array(A);
19703
+ return new Int8Array(k);
19704
+ case ka:
19705
+ return new Uint8Array(k);
19665
19706
  case Aa:
19666
- return new Uint8Array(A);
19707
+ return new Uint8ClampedArray(k);
19667
19708
  case Ma:
19668
- return new Uint8ClampedArray(A);
19669
- case ka:
19670
- return new Int16Array(A);
19709
+ return new Int16Array(k);
19671
19710
  case Da:
19672
- return new Uint16Array(A);
19711
+ return new Uint16Array(k);
19673
19712
  case Ia:
19674
- return new Int32Array(A);
19713
+ return new Int32Array(k);
19675
19714
  case Ea:
19676
- return new Uint32Array(A);
19715
+ return new Uint32Array(k);
19677
19716
  case xa:
19678
- return new Float32Array(A);
19717
+ return new Float32Array(k);
19679
19718
  case Ra:
19680
- return new Float64Array(A);
19719
+ return new Float64Array(k);
19681
19720
  default:
19682
19721
  throw new Error("Unkown type: " + w);
19683
19722
  }
@@ -19688,17 +19727,17 @@ function Bg() {
19688
19727
  stringToBuffer: Na,
19689
19728
  bufferToString: Ki
19690
19729
  };
19691
- function Fa(b, C, w, M) {
19692
- b.executeSql("CREATE TABLE IF NOT EXISTS " + C.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], w, M);
19730
+ function Fa(b, C, w, A) {
19731
+ b.executeSql("CREATE TABLE IF NOT EXISTS " + C.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], w, A);
19693
19732
  }
19694
19733
  function Rc(b) {
19695
19734
  var C = this, w = {
19696
19735
  db: null
19697
19736
  };
19698
19737
  if (b)
19699
- for (var M in b)
19700
- w[M] = typeof b[M] != "string" ? b[M].toString() : b[M];
19701
- var k = new d(function(A, x) {
19738
+ for (var A in b)
19739
+ w[A] = typeof b[A] != "string" ? b[A].toString() : b[A];
19740
+ var M = new d(function(k, x) {
19702
19741
  try {
19703
19742
  w.db = openDatabase(w.name, String(w.version), w.description, w.size);
19704
19743
  } catch (P) {
@@ -19706,43 +19745,43 @@ function Bg() {
19706
19745
  }
19707
19746
  w.db.transaction(function(P) {
19708
19747
  Fa(P, w, function() {
19709
- C._dbInfo = w, A();
19748
+ C._dbInfo = w, k();
19710
19749
  }, function(B, N) {
19711
19750
  x(N);
19712
19751
  });
19713
19752
  }, x);
19714
19753
  });
19715
- return w.serializer = Yi, k;
19754
+ return w.serializer = Yi, M;
19716
19755
  }
19717
- function Je(b, C, w, M, k, A) {
19718
- b.executeSql(w, M, k, function(x, P) {
19756
+ function Je(b, C, w, A, M, k) {
19757
+ b.executeSql(w, A, M, function(x, P) {
19719
19758
  P.code === P.SYNTAX_ERR ? x.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [C.storeName], function(B, N) {
19720
- N.rows.length ? A(B, P) : Fa(B, C, function() {
19721
- B.executeSql(w, M, k, A);
19722
- }, A);
19723
- }, A) : A(x, P);
19724
- }, A);
19759
+ N.rows.length ? k(B, P) : Fa(B, C, function() {
19760
+ B.executeSql(w, A, M, k);
19761
+ }, k);
19762
+ }, k) : k(x, P);
19763
+ }, k);
19725
19764
  }
19726
19765
  function Pc(b, C) {
19727
19766
  var w = this;
19728
19767
  b = f(b);
19729
- var M = new d(function(k, A) {
19768
+ var A = new d(function(M, k) {
19730
19769
  w.ready().then(function() {
19731
19770
  var x = w._dbInfo;
19732
19771
  x.db.transaction(function(P) {
19733
19772
  Je(P, x, "SELECT * FROM " + x.storeName + " WHERE key = ? LIMIT 1", [b], function(B, N) {
19734
19773
  var $ = N.rows.length ? N.rows.item(0).value : null;
19735
- $ && ($ = x.serializer.deserialize($)), k($);
19774
+ $ && ($ = x.serializer.deserialize($)), M($);
19736
19775
  }, function(B, N) {
19737
- A(N);
19776
+ k(N);
19738
19777
  });
19739
19778
  });
19740
- }).catch(A);
19779
+ }).catch(k);
19741
19780
  });
19742
- return h(M, C), M;
19781
+ return h(A, C), A;
19743
19782
  }
19744
19783
  function Bc(b, C) {
19745
- var w = this, M = new d(function(k, A) {
19784
+ var w = this, A = new d(function(M, k) {
19746
19785
  w.ready().then(function() {
19747
19786
  var x = w._dbInfo;
19748
19787
  x.db.transaction(function(P) {
@@ -19750,26 +19789,26 @@ function Bg() {
19750
19789
  for (var $ = N.rows, V = $.length, te = 0; te < V; te++) {
19751
19790
  var ie = $.item(te), ne = ie.value;
19752
19791
  if (ne && (ne = x.serializer.deserialize(ne)), ne = b(ne, ie.key, te + 1), ne !== void 0) {
19753
- k(ne);
19792
+ M(ne);
19754
19793
  return;
19755
19794
  }
19756
19795
  }
19757
- k();
19796
+ M();
19758
19797
  }, function(B, N) {
19759
- A(N);
19798
+ k(N);
19760
19799
  });
19761
19800
  });
19762
- }).catch(A);
19801
+ }).catch(k);
19763
19802
  });
19764
- return h(M, C), M;
19803
+ return h(A, C), A;
19765
19804
  }
19766
- function $a(b, C, w, M) {
19767
- var k = this;
19805
+ function $a(b, C, w, A) {
19806
+ var M = this;
19768
19807
  b = f(b);
19769
- var A = new d(function(x, P) {
19770
- k.ready().then(function() {
19808
+ var k = new d(function(x, P) {
19809
+ M.ready().then(function() {
19771
19810
  C === void 0 && (C = null);
19772
- var B = C, N = k._dbInfo;
19811
+ var B = C, N = M._dbInfo;
19773
19812
  N.serializer.serialize(C, function($, V) {
19774
19813
  V ? P(V) : N.db.transaction(function(te) {
19775
19814
  Je(te, N, "INSERT OR REPLACE INTO " + N.storeName + " (key, value) VALUES (?, ?)", [b, $], function() {
@@ -19779,8 +19818,8 @@ function Bg() {
19779
19818
  });
19780
19819
  }, function(te) {
19781
19820
  if (te.code === te.QUOTA_ERR) {
19782
- if (M > 0) {
19783
- x($a.apply(k, [b, B, w, M - 1]));
19821
+ if (A > 0) {
19822
+ x($a.apply(M, [b, B, w, A - 1]));
19784
19823
  return;
19785
19824
  }
19786
19825
  P(te);
@@ -19789,7 +19828,7 @@ function Bg() {
19789
19828
  });
19790
19829
  }).catch(P);
19791
19830
  });
19792
- return h(A, w), A;
19831
+ return h(k, w), k;
19793
19832
  }
19794
19833
  function Nc(b, C, w) {
19795
19834
  return $a.apply(this, [b, C, w, 1]);
@@ -19797,99 +19836,99 @@ function Bg() {
19797
19836
  function Fc(b, C) {
19798
19837
  var w = this;
19799
19838
  b = f(b);
19800
- var M = new d(function(k, A) {
19839
+ var A = new d(function(M, k) {
19801
19840
  w.ready().then(function() {
19802
19841
  var x = w._dbInfo;
19803
19842
  x.db.transaction(function(P) {
19804
19843
  Je(P, x, "DELETE FROM " + x.storeName + " WHERE key = ?", [b], function() {
19805
- k();
19844
+ M();
19806
19845
  }, function(B, N) {
19807
- A(N);
19846
+ k(N);
19808
19847
  });
19809
19848
  });
19810
- }).catch(A);
19849
+ }).catch(k);
19811
19850
  });
19812
- return h(M, C), M;
19851
+ return h(A, C), A;
19813
19852
  }
19814
19853
  function $c(b) {
19815
- var C = this, w = new d(function(M, k) {
19854
+ var C = this, w = new d(function(A, M) {
19816
19855
  C.ready().then(function() {
19817
- var A = C._dbInfo;
19818
- A.db.transaction(function(x) {
19819
- Je(x, A, "DELETE FROM " + A.storeName, [], function() {
19820
- M();
19856
+ var k = C._dbInfo;
19857
+ k.db.transaction(function(x) {
19858
+ Je(x, k, "DELETE FROM " + k.storeName, [], function() {
19859
+ A();
19821
19860
  }, function(P, B) {
19822
- k(B);
19861
+ M(B);
19823
19862
  });
19824
19863
  });
19825
- }).catch(k);
19864
+ }).catch(M);
19826
19865
  });
19827
19866
  return h(w, b), w;
19828
19867
  }
19829
19868
  function Oc(b) {
19830
- var C = this, w = new d(function(M, k) {
19869
+ var C = this, w = new d(function(A, M) {
19831
19870
  C.ready().then(function() {
19832
- var A = C._dbInfo;
19833
- A.db.transaction(function(x) {
19834
- Je(x, A, "SELECT COUNT(key) as c FROM " + A.storeName, [], function(P, B) {
19871
+ var k = C._dbInfo;
19872
+ k.db.transaction(function(x) {
19873
+ Je(x, k, "SELECT COUNT(key) as c FROM " + k.storeName, [], function(P, B) {
19835
19874
  var N = B.rows.item(0).c;
19836
- M(N);
19875
+ A(N);
19837
19876
  }, function(P, B) {
19838
- k(B);
19877
+ M(B);
19839
19878
  });
19840
19879
  });
19841
- }).catch(k);
19880
+ }).catch(M);
19842
19881
  });
19843
19882
  return h(w, b), w;
19844
19883
  }
19845
19884
  function Lc(b, C) {
19846
- var w = this, M = new d(function(k, A) {
19885
+ var w = this, A = new d(function(M, k) {
19847
19886
  w.ready().then(function() {
19848
19887
  var x = w._dbInfo;
19849
19888
  x.db.transaction(function(P) {
19850
19889
  Je(P, x, "SELECT key FROM " + x.storeName + " WHERE id = ? LIMIT 1", [b + 1], function(B, N) {
19851
19890
  var $ = N.rows.length ? N.rows.item(0).key : null;
19852
- k($);
19891
+ M($);
19853
19892
  }, function(B, N) {
19854
- A(N);
19893
+ k(N);
19855
19894
  });
19856
19895
  });
19857
- }).catch(A);
19896
+ }).catch(k);
19858
19897
  });
19859
- return h(M, C), M;
19898
+ return h(A, C), A;
19860
19899
  }
19861
19900
  function zc(b) {
19862
- var C = this, w = new d(function(M, k) {
19901
+ var C = this, w = new d(function(A, M) {
19863
19902
  C.ready().then(function() {
19864
- var A = C._dbInfo;
19865
- A.db.transaction(function(x) {
19866
- Je(x, A, "SELECT key FROM " + A.storeName, [], function(P, B) {
19903
+ var k = C._dbInfo;
19904
+ k.db.transaction(function(x) {
19905
+ Je(x, k, "SELECT key FROM " + k.storeName, [], function(P, B) {
19867
19906
  for (var N = [], $ = 0; $ < B.rows.length; $++)
19868
19907
  N.push(B.rows.item($).key);
19869
- M(N);
19908
+ A(N);
19870
19909
  }, function(P, B) {
19871
- k(B);
19910
+ M(B);
19872
19911
  });
19873
19912
  });
19874
- }).catch(k);
19913
+ }).catch(M);
19875
19914
  });
19876
19915
  return h(w, b), w;
19877
19916
  }
19878
19917
  function Wc(b) {
19879
19918
  return new d(function(C, w) {
19880
- b.transaction(function(M) {
19881
- M.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(k, A) {
19882
- for (var x = [], P = 0; P < A.rows.length; P++)
19883
- x.push(A.rows.item(P).name);
19919
+ b.transaction(function(A) {
19920
+ A.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(M, k) {
19921
+ for (var x = [], P = 0; P < k.rows.length; P++)
19922
+ x.push(k.rows.item(P).name);
19884
19923
  C({
19885
19924
  db: b,
19886
19925
  storeNames: x
19887
19926
  });
19888
- }, function(k, A) {
19889
- w(A);
19927
+ }, function(M, k) {
19928
+ w(k);
19890
19929
  });
19891
- }, function(M) {
19892
- w(M);
19930
+ }, function(A) {
19931
+ w(A);
19893
19932
  });
19894
19933
  });
19895
19934
  }
@@ -19897,16 +19936,16 @@ function Bg() {
19897
19936
  C = g.apply(this, arguments);
19898
19937
  var w = this.config();
19899
19938
  b = typeof b != "function" && b || {}, b.name || (b.name = b.name || w.name, b.storeName = b.storeName || w.storeName);
19900
- var M = this, k;
19901
- return b.name ? k = new d(function(A) {
19939
+ var A = this, M;
19940
+ return b.name ? M = new d(function(k) {
19902
19941
  var x;
19903
- b.name === w.name ? x = M._dbInfo.db : x = openDatabase(b.name, "", "", 0), b.storeName ? A({
19942
+ b.name === w.name ? x = A._dbInfo.db : x = openDatabase(b.name, "", "", 0), b.storeName ? k({
19904
19943
  db: x,
19905
19944
  storeNames: [b.storeName]
19906
- }) : A(Wc(x));
19907
- }).then(function(A) {
19945
+ }) : k(Wc(x));
19946
+ }).then(function(k) {
19908
19947
  return new d(function(x, P) {
19909
- A.db.transaction(function(B) {
19948
+ k.db.transaction(function(B) {
19910
19949
  function N(ie) {
19911
19950
  return new d(function(ne, ve) {
19912
19951
  B.executeSql("DROP TABLE IF EXISTS " + ie, [], function() {
@@ -19916,8 +19955,8 @@ function Bg() {
19916
19955
  });
19917
19956
  });
19918
19957
  }
19919
- for (var $ = [], V = 0, te = A.storeNames.length; V < te; V++)
19920
- $.push(N(A.storeNames[V]));
19958
+ for (var $ = [], V = 0, te = k.storeNames.length; V < te; V++)
19959
+ $.push(N(k.storeNames[V]));
19921
19960
  d.all($).then(function() {
19922
19961
  x();
19923
19962
  }).catch(function(ie) {
@@ -19927,7 +19966,7 @@ function Bg() {
19927
19966
  P(B);
19928
19967
  });
19929
19968
  });
19930
- }) : k = d.reject("Invalid arguments"), h(k, C), k;
19969
+ }) : M = d.reject("Invalid arguments"), h(M, C), M;
19931
19970
  }
19932
19971
  var qc = {
19933
19972
  _driver: "webSQLStorage",
@@ -19969,15 +20008,15 @@ function Bg() {
19969
20008
  function jc(b) {
19970
20009
  var C = this, w = {};
19971
20010
  if (b)
19972
- for (var M in b)
19973
- w[M] = b[M];
20011
+ for (var A in b)
20012
+ w[A] = b[A];
19974
20013
  return w.keyPrefix = Oa(b, C._defaultConfig), Vc() ? (C._dbInfo = w, w.serializer = Yi, d.resolve()) : d.reject();
19975
20014
  }
19976
20015
  function Kc(b) {
19977
20016
  var C = this, w = C.ready().then(function() {
19978
- for (var M = C._dbInfo.keyPrefix, k = localStorage.length - 1; k >= 0; k--) {
19979
- var A = localStorage.key(k);
19980
- A.indexOf(M) === 0 && localStorage.removeItem(A);
20017
+ for (var A = C._dbInfo.keyPrefix, M = localStorage.length - 1; M >= 0; M--) {
20018
+ var k = localStorage.key(M);
20019
+ k.indexOf(A) === 0 && localStorage.removeItem(k);
19981
20020
  }
19982
20021
  });
19983
20022
  return h(w, b), w;
@@ -19985,98 +20024,98 @@ function Bg() {
19985
20024
  function Yc(b, C) {
19986
20025
  var w = this;
19987
20026
  b = f(b);
19988
- var M = w.ready().then(function() {
19989
- var k = w._dbInfo, A = localStorage.getItem(k.keyPrefix + b);
19990
- return A && (A = k.serializer.deserialize(A)), A;
20027
+ var A = w.ready().then(function() {
20028
+ var M = w._dbInfo, k = localStorage.getItem(M.keyPrefix + b);
20029
+ return k && (k = M.serializer.deserialize(k)), k;
19991
20030
  });
19992
- return h(M, C), M;
20031
+ return h(A, C), A;
19993
20032
  }
19994
20033
  function Zc(b, C) {
19995
- var w = this, M = w.ready().then(function() {
19996
- for (var k = w._dbInfo, A = k.keyPrefix, x = A.length, P = localStorage.length, B = 1, N = 0; N < P; N++) {
20034
+ var w = this, A = w.ready().then(function() {
20035
+ for (var M = w._dbInfo, k = M.keyPrefix, x = k.length, P = localStorage.length, B = 1, N = 0; N < P; N++) {
19997
20036
  var $ = localStorage.key(N);
19998
- if ($.indexOf(A) === 0) {
20037
+ if ($.indexOf(k) === 0) {
19999
20038
  var V = localStorage.getItem($);
20000
- if (V && (V = k.serializer.deserialize(V)), V = b(V, $.substring(x), B++), V !== void 0)
20039
+ if (V && (V = M.serializer.deserialize(V)), V = b(V, $.substring(x), B++), V !== void 0)
20001
20040
  return V;
20002
20041
  }
20003
20042
  }
20004
20043
  });
20005
- return h(M, C), M;
20044
+ return h(A, C), A;
20006
20045
  }
20007
20046
  function Xc(b, C) {
20008
- var w = this, M = w.ready().then(function() {
20009
- var k = w._dbInfo, A;
20047
+ var w = this, A = w.ready().then(function() {
20048
+ var M = w._dbInfo, k;
20010
20049
  try {
20011
- A = localStorage.key(b);
20050
+ k = localStorage.key(b);
20012
20051
  } catch {
20013
- A = null;
20052
+ k = null;
20014
20053
  }
20015
- return A && (A = A.substring(k.keyPrefix.length)), A;
20054
+ return k && (k = k.substring(M.keyPrefix.length)), k;
20016
20055
  });
20017
- return h(M, C), M;
20056
+ return h(A, C), A;
20018
20057
  }
20019
20058
  function Jc(b) {
20020
20059
  var C = this, w = C.ready().then(function() {
20021
- for (var M = C._dbInfo, k = localStorage.length, A = [], x = 0; x < k; x++) {
20060
+ for (var A = C._dbInfo, M = localStorage.length, k = [], x = 0; x < M; x++) {
20022
20061
  var P = localStorage.key(x);
20023
- P.indexOf(M.keyPrefix) === 0 && A.push(P.substring(M.keyPrefix.length));
20062
+ P.indexOf(A.keyPrefix) === 0 && k.push(P.substring(A.keyPrefix.length));
20024
20063
  }
20025
- return A;
20064
+ return k;
20026
20065
  });
20027
20066
  return h(w, b), w;
20028
20067
  }
20029
20068
  function Qc(b) {
20030
- var C = this, w = C.keys().then(function(M) {
20031
- return M.length;
20069
+ var C = this, w = C.keys().then(function(A) {
20070
+ return A.length;
20032
20071
  });
20033
20072
  return h(w, b), w;
20034
20073
  }
20035
20074
  function el(b, C) {
20036
20075
  var w = this;
20037
20076
  b = f(b);
20038
- var M = w.ready().then(function() {
20039
- var k = w._dbInfo;
20040
- localStorage.removeItem(k.keyPrefix + b);
20077
+ var A = w.ready().then(function() {
20078
+ var M = w._dbInfo;
20079
+ localStorage.removeItem(M.keyPrefix + b);
20041
20080
  });
20042
- return h(M, C), M;
20081
+ return h(A, C), A;
20043
20082
  }
20044
20083
  function tl(b, C, w) {
20045
- var M = this;
20084
+ var A = this;
20046
20085
  b = f(b);
20047
- var k = M.ready().then(function() {
20086
+ var M = A.ready().then(function() {
20048
20087
  C === void 0 && (C = null);
20049
- var A = C;
20088
+ var k = C;
20050
20089
  return new d(function(x, P) {
20051
- var B = M._dbInfo;
20090
+ var B = A._dbInfo;
20052
20091
  B.serializer.serialize(C, function(N, $) {
20053
20092
  if ($)
20054
20093
  P($);
20055
20094
  else
20056
20095
  try {
20057
- localStorage.setItem(B.keyPrefix + b, N), x(A);
20096
+ localStorage.setItem(B.keyPrefix + b, N), x(k);
20058
20097
  } catch (V) {
20059
20098
  (V.name === "QuotaExceededError" || V.name === "NS_ERROR_DOM_QUOTA_REACHED") && P(V), P(V);
20060
20099
  }
20061
20100
  });
20062
20101
  });
20063
20102
  });
20064
- return h(k, w), k;
20103
+ return h(M, w), M;
20065
20104
  }
20066
20105
  function il(b, C) {
20067
20106
  if (C = g.apply(this, arguments), b = typeof b != "function" && b || {}, !b.name) {
20068
20107
  var w = this.config();
20069
20108
  b.name = b.name || w.name, b.storeName = b.storeName || w.storeName;
20070
20109
  }
20071
- var M = this, k;
20072
- return b.name ? k = new d(function(A) {
20073
- b.storeName ? A(Oa(b, M._defaultConfig)) : A(b.name + "/");
20074
- }).then(function(A) {
20110
+ var A = this, M;
20111
+ return b.name ? M = new d(function(k) {
20112
+ b.storeName ? k(Oa(b, A._defaultConfig)) : k(b.name + "/");
20113
+ }).then(function(k) {
20075
20114
  for (var x = localStorage.length - 1; x >= 0; x--) {
20076
20115
  var P = localStorage.key(x);
20077
- P.indexOf(A) === 0 && localStorage.removeItem(P);
20116
+ P.indexOf(k) === 0 && localStorage.removeItem(P);
20078
20117
  }
20079
- }) : k = d.reject("Invalid arguments"), h(k, C), k;
20118
+ }) : M = d.reject("Invalid arguments"), h(M, C), M;
20080
20119
  }
20081
20120
  var nl = {
20082
20121
  _driver: "localStorageWrapper",
@@ -20094,16 +20133,16 @@ function Bg() {
20094
20133
  }, al = function(C, w) {
20095
20134
  return C === w || typeof C == "number" && typeof w == "number" && isNaN(C) && isNaN(w);
20096
20135
  }, sl = function(C, w) {
20097
- for (var M = C.length, k = 0; k < M; ) {
20098
- if (al(C[k], w))
20136
+ for (var A = C.length, M = 0; M < A; ) {
20137
+ if (al(C[M], w))
20099
20138
  return !0;
20100
- k++;
20139
+ M++;
20101
20140
  }
20102
20141
  return !1;
20103
20142
  }, La = Array.isArray || function(b) {
20104
20143
  return Object.prototype.toString.call(b) === "[object Array]";
20105
20144
  }, xt = {}, za = {}, yt = {
20106
- INDEXEDDB: kc,
20145
+ INDEXEDDB: Mc,
20107
20146
  WEBSQL: qc,
20108
20147
  LOCALSTORAGE: nl
20109
20148
  }, rl = [yt.INDEXEDDB._driver, yt.WEBSQL._driver, yt.LOCALSTORAGE._driver], ti = ["dropInstance"], Zi = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(ti), ol = {
@@ -20138,8 +20177,8 @@ function Bg() {
20138
20177
  r(this, b);
20139
20178
  for (var w in yt)
20140
20179
  if (yt.hasOwnProperty(w)) {
20141
- var M = yt[w], k = M._driver;
20142
- this[w] = k, xt[k] || this.defineDriver(M);
20180
+ var A = yt[w], M = A._driver;
20181
+ this[w] = M, xt[M] || this.defineDriver(A);
20143
20182
  }
20144
20183
  this._defaultConfig = Xi({}, ol), this._config = Xi({}, this._defaultConfig, C), this._driverSet = null, this._initDriver = null, this._ready = !1, this._dbInfo = null, this._wrapLibraryMethodsWithReady(), this.setDriver(this._config.driver).catch(function() {
20145
20184
  });
@@ -20148,15 +20187,15 @@ function Bg() {
20148
20187
  if ((typeof w > "u" ? "undefined" : a(w)) === "object") {
20149
20188
  if (this._ready)
20150
20189
  return new Error("Can't call config() after localforage has been used.");
20151
- for (var M in w) {
20152
- if (M === "storeName" && (w[M] = w[M].replace(/\W/g, "_")), M === "version" && typeof w[M] != "number")
20190
+ for (var A in w) {
20191
+ if (A === "storeName" && (w[A] = w[A].replace(/\W/g, "_")), A === "version" && typeof w[A] != "number")
20153
20192
  return new Error("Database version must be a number.");
20154
- this._config[M] = w[M];
20193
+ this._config[A] = w[A];
20155
20194
  }
20156
20195
  return "driver" in w && w.driver ? this.setDriver(this._config.driver) : !0;
20157
20196
  } else return typeof w == "string" ? this._config[w] : this._config;
20158
- }, b.prototype.defineDriver = function(w, M, k) {
20159
- var A = new d(function(x, P) {
20197
+ }, b.prototype.defineDriver = function(w, A, M) {
20198
+ var k = new d(function(x, P) {
20160
20199
  try {
20161
20200
  var B = w._driver, N = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
20162
20201
  if (!w._driver) {
@@ -20190,29 +20229,29 @@ function Bg() {
20190
20229
  P(Fe);
20191
20230
  }
20192
20231
  });
20193
- return m(A, M, k), A;
20232
+ return m(k, A, M), k;
20194
20233
  }, b.prototype.driver = function() {
20195
20234
  return this._driver || null;
20196
- }, b.prototype.getDriver = function(w, M, k) {
20197
- var A = xt[w] ? d.resolve(xt[w]) : d.reject(new Error("Driver not found."));
20198
- return m(A, M, k), A;
20235
+ }, b.prototype.getDriver = function(w, A, M) {
20236
+ var k = xt[w] ? d.resolve(xt[w]) : d.reject(new Error("Driver not found."));
20237
+ return m(k, A, M), k;
20199
20238
  }, b.prototype.getSerializer = function(w) {
20200
- var M = d.resolve(Yi);
20201
- return m(M, w), M;
20239
+ var A = d.resolve(Yi);
20240
+ return m(A, w), A;
20202
20241
  }, b.prototype.ready = function(w) {
20203
- var M = this, k = M._driverSet.then(function() {
20204
- return M._ready === null && (M._ready = M._initDriver()), M._ready;
20242
+ var A = this, M = A._driverSet.then(function() {
20243
+ return A._ready === null && (A._ready = A._initDriver()), A._ready;
20205
20244
  });
20206
- return m(k, w, w), k;
20207
- }, b.prototype.setDriver = function(w, M, k) {
20208
- var A = this;
20245
+ return m(M, w, w), M;
20246
+ }, b.prototype.setDriver = function(w, A, M) {
20247
+ var k = this;
20209
20248
  La(w) || (w = [w]);
20210
20249
  var x = this._getSupportedDrivers(w);
20211
20250
  function P() {
20212
- A._config.driver = A.driver();
20251
+ k._config.driver = k.driver();
20213
20252
  }
20214
20253
  function B(V) {
20215
- return A._extend(V), P(), A._ready = A._initStorage(A._config), A._ready;
20254
+ return k._extend(V), P(), k._ready = k._initStorage(k._config), k._ready;
20216
20255
  }
20217
20256
  function N(V) {
20218
20257
  return function() {
@@ -20220,11 +20259,11 @@ function Bg() {
20220
20259
  function ie() {
20221
20260
  for (; te < V.length; ) {
20222
20261
  var ne = V[te];
20223
- return te++, A._dbInfo = null, A._ready = null, A.getDriver(ne).then(B).catch(ie);
20262
+ return te++, k._dbInfo = null, k._ready = null, k.getDriver(ne).then(B).catch(ie);
20224
20263
  }
20225
20264
  P();
20226
20265
  var ve = new Error("No available storage method found.");
20227
- return A._driverSet = d.reject(ve), A._driverSet;
20266
+ return k._driverSet = d.reject(ve), k._driverSet;
20228
20267
  }
20229
20268
  return ie();
20230
20269
  };
@@ -20234,26 +20273,26 @@ function Bg() {
20234
20273
  }) : d.resolve();
20235
20274
  return this._driverSet = $.then(function() {
20236
20275
  var V = x[0];
20237
- return A._dbInfo = null, A._ready = null, A.getDriver(V).then(function(te) {
20238
- A._driver = te._driver, P(), A._wrapLibraryMethodsWithReady(), A._initDriver = N(x);
20276
+ return k._dbInfo = null, k._ready = null, k.getDriver(V).then(function(te) {
20277
+ k._driver = te._driver, P(), k._wrapLibraryMethodsWithReady(), k._initDriver = N(x);
20239
20278
  });
20240
20279
  }).catch(function() {
20241
20280
  P();
20242
20281
  var V = new Error("No available storage method found.");
20243
- return A._driverSet = d.reject(V), A._driverSet;
20244
- }), m(this._driverSet, M, k), this._driverSet;
20282
+ return k._driverSet = d.reject(V), k._driverSet;
20283
+ }), m(this._driverSet, A, M), this._driverSet;
20245
20284
  }, b.prototype.supports = function(w) {
20246
20285
  return !!za[w];
20247
20286
  }, b.prototype._extend = function(w) {
20248
20287
  Xi(this, w);
20249
20288
  }, b.prototype._getSupportedDrivers = function(w) {
20250
- for (var M = [], k = 0, A = w.length; k < A; k++) {
20251
- var x = w[k];
20252
- this.supports(x) && M.push(x);
20289
+ for (var A = [], M = 0, k = w.length; M < k; M++) {
20290
+ var x = w[M];
20291
+ this.supports(x) && A.push(x);
20253
20292
  }
20254
- return M;
20293
+ return A;
20255
20294
  }, b.prototype._wrapLibraryMethodsWithReady = function() {
20256
- for (var w = 0, M = Zi.length; w < M; w++)
20295
+ for (var w = 0, A = Zi.length; w < A; w++)
20257
20296
  cl(this, Zi[w]);
20258
20297
  }, b.prototype.createInstance = function(w) {
20259
20298
  return new b(w);
@@ -23319,8 +23358,8 @@ class pn {
23319
23358
  g = a;
23320
23359
  break;
23321
23360
  }
23322
- const p = f ? this.getSpicedValue(u, g, e) : g, y = f ? g : this.getSpicedValue(u, g, e), v = t.random(), S = t.random();
23323
- o[h] = Math.floor(8 + v * l + p * c), o[m] = Math.floor(8 + S * l + y * c);
23361
+ const p = f ? this.getSpicedValue(u, g, e) : g, y = f ? g : this.getSpicedValue(u, g, e), v = t.random(), _ = t.random();
23362
+ o[h] = Math.floor(8 + v * l + p * c), o[m] = Math.floor(8 + _ * l + y * c);
23324
23363
  }
23325
23364
  return o;
23326
23365
  }
@@ -23554,8 +23593,8 @@ class pp {
23554
23593
  */
23555
23594
  static generate(e, t, i) {
23556
23595
  xo();
23557
- const n = new Ve(e), a = Y.getInstance(), r = a.get("appearance.bodyTypes"), o = a.getWeights("appearance.bodyTypes"), c = a.getMode("appearance.bodyTypes") || "default", l = a.get("appearance.skinTones"), u = a.getWeights("appearance.skinTones"), d = a.getMode("appearance.skinTones") || "default", h = a.get("appearance.hairStyles"), m = a.getWeights("appearance.hairStyles"), f = a.getMode("appearance.hairStyles") || "default", g = a.get("appearance.hairColors"), p = a.getWeights("appearance.hairColors"), y = a.getMode("appearance.hairColors") || "default", v = a.get("appearance.eyeColors"), S = a.getWeights("appearance.eyeColors"), T = a.getMode("appearance.eyeColors") || "default", _ = a.get("appearance.facialFeatures"), I = a.getWeights("appearance.facialFeatures"), D = a.getMode("appearance.facialFeatures") || "default", R = Le.select(r, o, n, c), q = Le.select(l, u, n, d), O = Le.select(h, m, n, f), W = Le.select(g, p, n, y), Z = Le.select(v, S, n, T), Q = n.randomInt(1, 4), se = Le.selectMultiple(
23558
- _,
23596
+ const n = new Ve(e), a = Y.getInstance(), r = a.get("appearance.bodyTypes"), o = a.getWeights("appearance.bodyTypes"), c = a.getMode("appearance.bodyTypes") || "default", l = a.get("appearance.skinTones"), u = a.getWeights("appearance.skinTones"), d = a.getMode("appearance.skinTones") || "default", h = a.get("appearance.hairStyles"), m = a.getWeights("appearance.hairStyles"), f = a.getMode("appearance.hairStyles") || "default", g = a.get("appearance.hairColors"), p = a.getWeights("appearance.hairColors"), y = a.getMode("appearance.hairColors") || "default", v = a.get("appearance.eyeColors"), _ = a.getWeights("appearance.eyeColors"), T = a.getMode("appearance.eyeColors") || "default", S = a.get("appearance.facialFeatures"), I = a.getWeights("appearance.facialFeatures"), D = a.getMode("appearance.facialFeatures") || "default", R = Le.select(r, o, n, c), q = Le.select(l, u, n, d), O = Le.select(h, m, n, f), W = Le.select(g, p, n, y), Z = Le.select(v, _, n, T), Q = n.randomInt(1, 4), se = Le.selectMultiple(
23597
+ S,
23559
23598
  I,
23560
23599
  n,
23561
23600
  Q,
@@ -24211,7 +24250,7 @@ class xe {
24211
24250
  if (t.grantsFeatures)
24212
24251
  for (const a of t.grantsFeatures)
24213
24252
  if (typeof a == "string") {
24214
- const r = ke.getInstance(), o = r.getClassFeatureById(a), c = o ? void 0 : r.getRacialTraitById(a);
24253
+ const r = Me.getInstance(), o = r.getClassFeatureById(a), c = o ? void 0 : r.getRacialTraitById(a);
24215
24254
  if (o || c) {
24216
24255
  const u = {
24217
24256
  featureId: a,
@@ -25060,7 +25099,7 @@ class ua {
25060
25099
  static generate(e, t, i, n = {}) {
25061
25100
  const a = new Ve(e), r = n.level || 1, o = n.gameMode || "standard";
25062
25101
  Wo();
25063
- const c = ke.getInstance();
25102
+ const c = Me.getInstance();
25064
25103
  n.extensions && ua.registerExtensions(n.extensions);
25065
25104
  let l;
25066
25105
  const u = n.subrace;
@@ -25098,7 +25137,7 @@ class ua {
25098
25137
  ), g = pn.calculateBaseScores(t, a), p = pn.applyRacialBonuses(g, h), y = pn.calculateModifiers(p), v = zr(m);
25099
25138
  if (!v)
25100
25139
  throw new Error(`Unknown class: ${m}. Cannot generate character.`);
25101
- const T = Xn(h)?.speed ?? 30, _ = v.hit_die + y.CON, I = 10 + y.DEX, D = y.DEX, R = Wr[r], q = fp.assignSkills(m, a), O = {
25140
+ const T = Xn(h)?.speed ?? 30, S = v.hit_die + y.CON, I = 10 + y.DEX, D = y.DEX, R = Wr[r], q = fp.assignSkills(m, a), O = {
25102
25141
  STR: v.saving_throws.includes("STR"),
25103
25142
  DEX: v.saving_throws.includes("DEX"),
25104
25143
  CON: v.saving_throws.includes("CON"),
@@ -25115,7 +25154,7 @@ class ua {
25115
25154
  ability_scores: p,
25116
25155
  ability_modifiers: y,
25117
25156
  proficiency_bonus: R,
25118
- hp: { current: _, max: _, temp: 0 },
25157
+ hp: { current: S, max: S, temp: 0 },
25119
25158
  armor_class: I,
25120
25159
  initiative: D,
25121
25160
  speed: T,
@@ -25158,8 +25197,8 @@ class ua {
25158
25197
  ability_modifiers: y,
25159
25198
  proficiency_bonus: R,
25160
25199
  hp: {
25161
- current: _,
25162
- max: _,
25200
+ current: S,
25201
+ max: S,
25163
25202
  temp: 0
25164
25203
  },
25165
25204
  armor_class: I,
@@ -25310,8 +25349,8 @@ function _p(s) {
25310
25349
  for (let f = 0; f < r / 2; f++) {
25311
25350
  const g = d + f, p = d + f + r / 2, y = i[p] * h - n[p] * m, v = i[p] * m + n[p] * h;
25312
25351
  i[p] = i[g] - y, n[p] = n[g] - v, i[g] += y, n[g] += v;
25313
- const S = h * l - m * u;
25314
- m = h * u + m * l, h = S;
25352
+ const _ = h * l - m * u;
25353
+ m = h * u + m * l, h = _;
25315
25354
  }
25316
25355
  }
25317
25356
  r *= 2;
@@ -25362,7 +25401,7 @@ function ar(s, e) {
25362
25401
  o[c] = t * s[c] + i * s[c - 1] + n * s[c - 2] - a * o[c - 1] - r * o[c - 2];
25363
25402
  return o;
25364
25403
  }
25365
- function Ap(s, e, t, i, n) {
25404
+ function kp(s, e, t, i, n) {
25366
25405
  if (s.length === 0)
25367
25406
  return new Float32Array(0);
25368
25407
  const a = 8;
@@ -25382,13 +25421,13 @@ function Ap(s, e, t, i, n) {
25382
25421
  }
25383
25422
  return o;
25384
25423
  }
25385
- function Mp(s, e, t, i) {
25424
+ function Ap(s, e, t, i) {
25386
25425
  const n = Uo.find((a) => a.name === e);
25387
25426
  if (!n)
25388
25427
  throw new Error(`Unknown frequency band: ${e}. Valid bands are: low, mid, high`);
25389
- return Ap(s, n.lowHz, n.highHz, t);
25428
+ return kp(s, n.lowHz, n.highHz, t);
25390
25429
  }
25391
- const kp = {
25430
+ const Mp = {
25392
25431
  targetSampleRate: 44100,
25393
25432
  fftWindowSizeMs: 23,
25394
25433
  hopSizeMs: 10,
@@ -25404,7 +25443,7 @@ class Ip {
25404
25443
  */
25405
25444
  constructor(e = {}) {
25406
25445
  if (this.config = {
25407
- ...kp,
25446
+ ...Mp,
25408
25447
  ...e
25409
25448
  }, this.config.peakThreshold < 0 || this.config.peakThreshold > 1)
25410
25449
  throw new Error(`peakThreshold must be between 0 and 1, got: ${this.config.peakThreshold}`);
@@ -25459,13 +25498,13 @@ class Ip {
25459
25498
  * Analyze a single frequency band
25460
25499
  */
25461
25500
  analyzeBand(e, t, i, n, a, r, o) {
25462
- const c = Mp(e, t.name, i), l = Go(c, n, a, i), u = l.numFrames, d = new Float32Array(u);
25501
+ const c = Ap(e, t.name, i), l = Go(c, n, a, i), u = l.numFrames, d = new Float32Array(u);
25463
25502
  for (let T = 0; T < u; T++) {
25464
- const _ = l.frames[T];
25503
+ const S = l.frames[T];
25465
25504
  let I = 0;
25466
- for (let D = 0; D < _.length; D++)
25467
- I += _[D] * _[D];
25468
- d[T] = Math.sqrt(I / _.length);
25505
+ for (let D = 0; D < S.length; D++)
25506
+ I += S[D] * S[D];
25507
+ d[T] = Math.sqrt(I / S.length);
25469
25508
  }
25470
25509
  const h = Math.max(...d);
25471
25510
  if (h > 0)
@@ -25475,7 +25514,7 @@ class Ip {
25475
25514
  if (p > 0)
25476
25515
  for (let T = 0; T < g.length; T++)
25477
25516
  y[T] = g[T] / p;
25478
- const v = this.findPeaks(y, this.config.peakThreshold), S = v.map((T) => T * r);
25517
+ const v = this.findPeaks(y, this.config.peakThreshold), _ = v.map((T) => T * r);
25479
25518
  return {
25480
25519
  name: t.name,
25481
25520
  frequencyRange: {
@@ -25484,7 +25523,7 @@ class Ip {
25484
25523
  },
25485
25524
  envelope: y,
25486
25525
  peaks: v,
25487
- peakTimes: S,
25526
+ peakTimes: _,
25488
25527
  energy: m,
25489
25528
  energyOverTime: d
25490
25529
  };
@@ -26651,8 +26690,8 @@ class Fp {
26651
26690
  analyzeBand(e, t, i, n) {
26652
26691
  const a = e.beats, o = (a.length > 0 ? Math.max(...a.map((v) => v.beatIndex)) : 0) + 1, c = /* @__PURE__ */ new Map();
26653
26692
  for (const v of a) {
26654
- const S = c.get(v.beatIndex);
26655
- S ? (S.count++, S.intensities.push(v.intensity)) : c.set(v.beatIndex, {
26693
+ const _ = c.get(v.beatIndex);
26694
+ _ ? (_.count++, _.intensities.push(v.intensity)) : c.set(v.beatIndex, {
26656
26695
  count: 1,
26657
26696
  intensities: [v.intensity]
26658
26697
  });
@@ -26660,12 +26699,12 @@ class Fp {
26660
26699
  const l = [];
26661
26700
  let u = 0;
26662
26701
  for (let v = 0; v < o; v++) {
26663
- const S = c.get(v), T = S?.count ?? 0, _ = S ? S.intensities.reduce((I, D) => I + D, 0) / S.intensities.length : 0;
26702
+ const _ = c.get(v), T = _?.count ?? 0, S = _ ? _.intensities.reduce((I, D) => I + D, 0) / _.intensities.length : 0;
26664
26703
  l.push({
26665
26704
  beatIndex: v,
26666
26705
  transientCount: T,
26667
26706
  bands: T > 0 ? [t] : [],
26668
- averageIntensity: _
26707
+ averageIntensity: S
26669
26708
  }), u += T;
26670
26709
  }
26671
26710
  const d = l.map((v) => v.transientCount);
@@ -26759,7 +26798,7 @@ class Fp {
26759
26798
  calculateSectionMetrics(e, t, i) {
26760
26799
  const n = [], a = this.config.beatsPerSection, r = e.length;
26761
26800
  for (let o = 0; o < r; o += a) {
26762
- const c = Math.min(o + a - 1, r - 1), l = e.slice(o, c + 1), u = l.reduce((v, S) => v + S.transientCount, 0), d = l.length, h = d > 0 ? u / d * t : 0, m = l.map((v) => v.transientCount), f = m.length > 0 ? Math.min(...m) * t : 0, g = m.length > 0 ? Math.max(...m) * t : 0, p = this.categorizeDensity(h), y = this.determineNaturalDifficulty(p);
26801
+ const c = Math.min(o + a - 1, r - 1), l = e.slice(o, c + 1), u = l.reduce((v, _) => v + _.transientCount, 0), d = l.length, h = d > 0 ? u / d * t : 0, m = l.map((v) => v.transientCount), f = m.length > 0 ? Math.min(...m) * t : 0, g = m.length > 0 ? Math.max(...m) * t : 0, p = this.categorizeDensity(h), y = this.determineNaturalDifficulty(p);
26763
26802
  n.push({
26764
26803
  startBeat: o,
26765
26804
  endBeat: c,
@@ -27086,15 +27125,15 @@ class qp {
27086
27125
  generate(e, t, i, n) {
27087
27126
  const a = t.sectionWinners, r = { low: 0, mid: 0, high: 0 }, o = { low: 0, mid: 0, high: 0 }, l = a.filter((y) => {
27088
27127
  const v = ["low", "mid", "high"];
27089
- let S = !1;
27128
+ let _ = !1;
27090
27129
  for (const T of v)
27091
27130
  if (e.streams[T].beats.filter(
27092
27131
  (D) => D.beatIndex >= y.beatRange.start && D.beatIndex <= y.beatRange.end
27093
27132
  ).length > 0) {
27094
- S = !0;
27133
+ _ = !0;
27095
27134
  break;
27096
27135
  }
27097
- return S;
27136
+ return _;
27098
27137
  }).map((y) => ({
27099
27138
  beatRange: y.beatRange,
27100
27139
  sourceBand: y.winner,
@@ -27105,12 +27144,12 @@ class qp {
27105
27144
  o[y.sourceBand]++;
27106
27145
  const u = [];
27107
27146
  for (const y of l) {
27108
- const v = e.streams[y.sourceBand], S = this.extractSectionBeats(
27147
+ const v = e.streams[y.sourceBand], _ = this.extractSectionBeats(
27109
27148
  v,
27110
27149
  y.beatRange,
27111
27150
  y.sourceBand
27112
27151
  );
27113
- u.push(...S), r[y.sourceBand] += S.length;
27152
+ u.push(..._), r[y.sourceBand] += _.length;
27114
27153
  }
27115
27154
  u.sort((y, v) => y.timestamp - v.timestamp);
27116
27155
  const d = this.deduplicateBeats(u), h = e.streams.low.quarterNoteInterval, m = 60 / h, f = this.determineNaturalDifficulty(
@@ -27843,10 +27882,10 @@ class Un {
27843
27882
  m,
27844
27883
  c,
27845
27884
  u
27846
- ), S = this.enforceSingleGridPerBeat(v.beats), T = v.metadata.patternsInserted > 0 ? "pattern_inserted" : "interpolated";
27885
+ ), _ = this.enforceSingleGridPerBeat(v.beats), T = v.metadata.patternsInserted > 0 ? "pattern_inserted" : "interpolated";
27847
27886
  return {
27848
27887
  difficulty: "custom",
27849
- beats: S,
27888
+ beats: _,
27850
27889
  isUnedited: !1,
27851
27890
  editType: T,
27852
27891
  editAmount: v.metadata.totalBeatsBefore > 0 ? (v.metadata.totalBeatsAfter - v.metadata.totalBeatsBefore) / v.metadata.totalBeatsBefore : 0,
@@ -27858,7 +27897,7 @@ class Un {
27858
27897
  this.config.logConversions && console.log(
27859
27898
  `[DifficultyVariantGenerator] Density approximately equal (${f.toFixed(2)} ≈ ${u.toFixed(2)}), but grid restrictions needed`
27860
27899
  );
27861
- const S = this.simplifyBeats(
27900
+ const _ = this.simplifyBeats(
27862
27901
  h,
27863
27902
  "custom",
27864
27903
  e.quarterNoteInterval,
@@ -27872,11 +27911,11 @@ class Un {
27872
27911
  );
27873
27912
  return {
27874
27913
  difficulty: "custom",
27875
- beats: this.enforceSingleGridPerBeat(S.beats),
27876
- isUnedited: S.metadata.beatsRemoved === 0 && !d,
27877
- editType: S.metadata.beatsRemoved > 0 ? "simplified" : "none",
27878
- editAmount: S.metadata.totalBeatsBefore > 0 ? (S.metadata.totalBeatsBefore - S.metadata.totalBeatsAfter) / S.metadata.totalBeatsBefore : 0,
27879
- conversionMetadata: S.metadata,
27914
+ beats: this.enforceSingleGridPerBeat(_.beats),
27915
+ isUnedited: _.metadata.beatsRemoved === 0 && !d,
27916
+ editType: _.metadata.beatsRemoved > 0 ? "simplified" : "none",
27917
+ editAmount: _.metadata.totalBeatsBefore > 0 ? (_.metadata.totalBeatsBefore - _.metadata.totalBeatsAfter) / _.metadata.totalBeatsBefore : 0,
27918
+ conversionMetadata: _.metadata,
27880
27919
  densityClamped: d
27881
27920
  };
27882
27921
  }
@@ -28055,12 +28094,12 @@ class Un {
28055
28094
  r,
28056
28095
  e.quarterNoteInterval,
28057
28096
  h
28058
- ), S = v.metadata.patternsInserted > 0 ? "pattern_inserted" : "interpolated";
28097
+ ), _ = v.metadata.patternsInserted > 0 ? "pattern_inserted" : "interpolated";
28059
28098
  return {
28060
28099
  difficulty: t,
28061
28100
  beats: v.beats,
28062
28101
  isUnedited: !1,
28063
- editType: S,
28102
+ editType: _,
28064
28103
  editAmount: v.metadata.totalBeatsBefore > 0 ? (v.metadata.totalBeatsAfter - v.metadata.totalBeatsBefore) / v.metadata.totalBeatsBefore : 0,
28065
28104
  enhancementMetadata: v.metadata
28066
28105
  };
@@ -28118,12 +28157,12 @@ class Un {
28118
28157
  r,
28119
28158
  e.quarterNoteInterval,
28120
28159
  h
28121
- ), S = v.metadata.patternsInserted > 0 ? "pattern_inserted" : "interpolated";
28160
+ ), _ = v.metadata.patternsInserted > 0 ? "pattern_inserted" : "interpolated";
28122
28161
  return {
28123
28162
  difficulty: t,
28124
28163
  beats: v.beats,
28125
28164
  isUnedited: !1,
28126
- editType: S,
28165
+ editType: _,
28127
28166
  editAmount: 1,
28128
28167
  conversionMetadata: p.metadata,
28129
28168
  enhancementMetadata: v.metadata
@@ -28150,16 +28189,16 @@ class Un {
28150
28189
  h
28151
28190
  );
28152
28191
  let p = g.beats;
28153
- if (p.some((S) => !u.includes(S.gridType))) {
28154
- const S = [];
28192
+ if (p.some((_) => !u.includes(_.gridType))) {
28193
+ const _ = [];
28155
28194
  for (const T of p)
28156
28195
  if (u.includes(T.gridType))
28157
- S.push(T);
28196
+ _.push(T);
28158
28197
  else {
28159
- const _ = this.convertBeatGridType(T, t, e.quarterNoteInterval, c);
28160
- _ && S.push(_);
28198
+ const S = this.convertBeatGridType(T, t, e.quarterNoteInterval, c);
28199
+ S && _.push(S);
28161
28200
  }
28162
- p = this.deduplicateConvertedBeats(S);
28201
+ p = this.deduplicateConvertedBeats(_);
28163
28202
  }
28164
28203
  const v = g.metadata.patternsInserted > 0 ? "pattern_inserted" : "interpolated";
28165
28204
  return {
@@ -28254,10 +28293,10 @@ class Un {
28254
28293
  }
28255
28294
  const v = this.deduplicateConvertedBeats(y);
28256
28295
  d.beatsRemoved += y.length - v.length;
28257
- const S = y.length - v.length, T = this.calculateDensity(v, c), _ = u !== void 0 ? Math.round(u * c) : this.calculateBeatCountTarget(v.length, c, t).targetCount, I = u ?? this.calculateBeatCountTarget(v.length, c, t).targetDensity;
28258
- if (v.length <= _)
28296
+ const _ = y.length - v.length, T = this.calculateDensity(v, c), S = u !== void 0 ? Math.round(u * c) : this.calculateBeatCountTarget(v.length, c, t).targetCount, I = u ?? this.calculateBeatCountTarget(v.length, c, t).targetDensity;
28297
+ if (v.length <= S)
28259
28298
  return this.config.logConversions && console.log(
28260
- `[DifficultyVariantGenerator] Grid conversion achieved target density: ${T.toFixed(2)} notes/sec (target midpoint ${I.toFixed(2)} nps, ${_} beats) for ${t}` + (S > 0 ? ` (${S} beats collapsed)` : "")
28299
+ `[DifficultyVariantGenerator] Grid conversion achieved target density: ${T.toFixed(2)} notes/sec (target midpoint ${I.toFixed(2)} nps, ${S} beats) for ${t}` + (_ > 0 ? ` (${_} beats collapsed)` : "")
28261
28300
  ), d.totalBeatsAfter = v.length, { beats: v, metadata: d };
28262
28301
  const D = this.reduceDensityToTarget(
28263
28302
  v,
@@ -28265,7 +28304,7 @@ class Un {
28265
28304
  d,
28266
28305
  h,
28267
28306
  r,
28268
- _,
28307
+ S,
28269
28308
  c
28270
28309
  );
28271
28310
  return d.totalBeatsAfter = D.length, { beats: D, metadata: d };
@@ -28524,8 +28563,8 @@ class Un {
28524
28563
  }
28525
28564
  }
28526
28565
  d.sort((m, f) => {
28527
- const g = o.get(m) ?? 0, p = o.get(f) ?? 0, y = l(m), v = l(f), S = y - g, _ = v - p - S;
28528
- if (_ !== 0) return _;
28566
+ const g = o.get(m) ?? 0, p = o.get(f) ?? 0, y = l(m), v = l(f), _ = y - g, S = v - p - _;
28567
+ if (S !== 0) return S;
28529
28568
  const I = ht(Tt(a, `partial:${m}`)), D = ht(Tt(a, `partial:${f}`));
28530
28569
  return I - D;
28531
28570
  });
@@ -28606,14 +28645,14 @@ class Un {
28606
28645
  beat: T,
28607
28646
  priority: this.calculateRemovalPriority(T, n, u)
28608
28647
  }));
28609
- d.sort((T, _) => T.priority - _.priority);
28648
+ d.sort((T, S) => T.priority - S.priority);
28610
28649
  const h = /* @__PURE__ */ new Set();
28611
28650
  let m = e.length;
28612
28651
  const f = this.config.maxReductionPasses;
28613
28652
  let g = 0;
28614
28653
  for (let T = 1; T <= f; T++) {
28615
28654
  g = T;
28616
- let _ = 0;
28655
+ let S = 0;
28617
28656
  const I = T === f;
28618
28657
  let D, R, q = !1;
28619
28658
  T === 1 ? (D = 1 - this.config.densityReductionMinIntensity, R = this.config.moderateSimplificationIntensityThreshold) : T === 2 ? (D = 1 - this.config.densityReductionMinIntensity - 0.15, R = this.config.moderateSimplificationIntensityThreshold - 0.1) : (q = !0, D = 0, R = 0);
@@ -28629,12 +28668,12 @@ class Un {
28629
28668
  continue;
28630
28669
  } else if (W >= D || O.intensity >= R)
28631
28670
  continue;
28632
- h.add(O), m--, _++, this.config.logConversions && console.log(
28671
+ h.add(O), m--, S++, this.config.logConversions && console.log(
28633
28672
  `[DifficultyVariantGenerator] Pass ${T}: Removed beat at index ${O.beatIndex} position ${O.gridPosition} (priority: ${W.toFixed(2)}, intensity: ${O.intensity.toFixed(2)})`
28634
28673
  );
28635
28674
  }
28636
28675
  if (this.config.logConversions && console.log(
28637
- `[DifficultyVariantGenerator] Pass ${T}${I ? " (final)" : ""}: Removed ${_} beats, density now: ${(m / o).toFixed(2)} notes/sec`
28676
+ `[DifficultyVariantGenerator] Pass ${T}${I ? " (final)" : ""}: Removed ${S} beats, density now: ${(m / o).toFixed(2)} notes/sec`
28638
28677
  ), r !== void 0) {
28639
28678
  if (m <= r)
28640
28679
  break;
@@ -28650,12 +28689,12 @@ class Un {
28650
28689
  }
28651
28690
  const v = e.filter((T) => !h.has(T));
28652
28691
  i.reductionPasses = g, i.beatsRemoved += h.size;
28653
- const S = Math.ceil(c.min * o);
28654
- if (v.length < S && e.length > 0) {
28655
- const T = d.filter(({ beat: _ }) => h.has(_)).sort((_, I) => I.priority - _.priority);
28656
- for (const { beat: _ } of T) {
28657
- if (v.length >= S) break;
28658
- v.push(_), i.beatsRemoved--;
28692
+ const _ = Math.ceil(c.min * o);
28693
+ if (v.length < _ && e.length > 0) {
28694
+ const T = d.filter(({ beat: S }) => h.has(S)).sort((S, I) => I.priority - S.priority);
28695
+ for (const { beat: S } of T) {
28696
+ if (v.length >= _) break;
28697
+ v.push(S), i.beatsRemoved--;
28659
28698
  }
28660
28699
  }
28661
28700
  return v;
@@ -28909,7 +28948,7 @@ class Un {
28909
28948
  i,
28910
28949
  t
28911
28950
  ).beatsToAdd;
28912
- const v = this.config.seed ?? `enhance:${p}:${f.length}`, S = this.distributeBeatsAcrossIndices(
28951
+ const v = this.config.seed ?? `enhance:${p}:${f.length}`, _ = this.distributeBeatsAcrossIndices(
28913
28952
  y,
28914
28953
  g,
28915
28954
  c ?? /* @__PURE__ */ new Map(),
@@ -28917,13 +28956,13 @@ class Un {
28917
28956
  v,
28918
28957
  l
28919
28958
  // Pass through for max beats per index calculation
28920
- ), T = [], _ = /* @__PURE__ */ new Map(), I = (O, W) => `${O}:${W}`;
28959
+ ), T = [], S = /* @__PURE__ */ new Map(), I = (O, W) => `${O}:${W}`;
28921
28960
  for (const O of f) {
28922
28961
  const W = I(O.beatIndex, O.gridPosition);
28923
- _.has(W) || _.set(W, O.gridType);
28962
+ S.has(W) || S.set(W, O.gridType);
28924
28963
  }
28925
28964
  for (let O = 0; O <= p; O++) {
28926
- const W = g.get(O) ?? [], Z = S.get(O) ?? 0;
28965
+ const W = g.get(O) ?? [], Z = _.get(O) ?? 0;
28927
28966
  if (W.length >= Z) {
28928
28967
  T.push(...W);
28929
28968
  continue;
@@ -28937,12 +28976,12 @@ class Un {
28937
28976
  r,
28938
28977
  o,
28939
28978
  g,
28940
- _,
28979
+ S,
28941
28980
  fe
28942
28981
  ), Qt = fe ?? this.getGridForBeatIndex(O, ge, r);
28943
28982
  for (const J of ge) {
28944
28983
  const le = I(J.beatIndex, J.gridPosition);
28945
- !_.has(le) && J.gridType === Qt && (_.set(le, J.gridType), T.push(J), h.interpolatedBeats++);
28984
+ !S.has(le) && J.gridType === Qt && (S.set(le, J.gridType), T.push(J), h.interpolatedBeats++);
28946
28985
  }
28947
28986
  continue;
28948
28987
  }
@@ -28954,7 +28993,7 @@ class Un {
28954
28993
  O,
28955
28994
  Q,
28956
28995
  a,
28957
- _,
28996
+ S,
28958
28997
  oe
28959
28998
  );
28960
28999
  j = X.beatsAdded, X.patternId && (h.patternsInserted++, h.insertedPatternIds.push(X.patternId));
@@ -28965,13 +29004,13 @@ class Un {
28965
29004
  O,
28966
29005
  Q - j,
28967
29006
  o,
28968
- _,
29007
+ S,
28969
29008
  oe,
28970
29009
  n
28971
29010
  );
28972
29011
  for (const fe of X) {
28973
29012
  const ge = I(fe.beatIndex, fe.gridPosition);
28974
- _.has(ge) || (_.set(ge, fe.gridType), T.push(fe), h.interpolatedBeats++);
29013
+ S.has(ge) || (S.set(ge, fe.gridType), T.push(fe), h.interpolatedBeats++);
28975
29014
  }
28976
29015
  }
28977
29016
  T.push(...W);
@@ -29031,12 +29070,12 @@ class Un {
29031
29070
  if (c.length === 0)
29032
29071
  return { beatsAdded: 0 };
29033
29072
  const l = c.filter(
29034
- (v) => v.pattern.some((S) => S.gridType === r)
29073
+ (v) => v.pattern.some((_) => _.gridType === r)
29035
29074
  );
29036
29075
  if (l.length === 0)
29037
29076
  return { beatsAdded: 0 };
29038
- l.sort((v, S) => S.significance - v.significance);
29039
- const u = l[0], d = u.pattern.filter((v) => v.beatIndex === 0), h = new Set(e.map((v) => v.gridPosition)), m = (v, S) => `${v}:${S}`, f = d.filter((v) => !(v.gridType !== r || h.has(v.gridPosition) || a.has(m(t, v.gridPosition))));
29077
+ l.sort((v, _) => _.significance - v.significance);
29078
+ const u = l[0], d = u.pattern.filter((v) => v.beatIndex === 0), h = new Set(e.map((v) => v.gridPosition)), m = (v, _) => `${v}:${_}`, f = d.filter((v) => !(v.gridType !== r || h.has(v.gridPosition) || a.has(m(t, v.gridPosition))));
29040
29079
  if (f.length === 0)
29041
29080
  return { beatsAdded: 0 };
29042
29081
  const g = f.slice(0, i), p = u.sourceBand, y = g.map((v) => ({
@@ -29078,17 +29117,17 @@ class Un {
29078
29117
  }
29079
29118
  if (!c && !n?.has(e) && r)
29080
29119
  for (const T of [1, -1, 2, -2, 3, -3]) {
29081
- const _ = r.get(e + T);
29082
- if (_ && _.length > 0) {
29083
- l = _[0].gridType, u = _[0].band, d = _[0].sourceBand;
29120
+ const S = r.get(e + T);
29121
+ if (S && S.length > 0) {
29122
+ l = S[0].gridType, u = S[0].band, d = S[0].sourceBand;
29084
29123
  break;
29085
29124
  }
29086
29125
  }
29087
29126
  const h = /* @__PURE__ */ new Set();
29088
29127
  if (o) {
29089
- const T = (_, I) => `${_}:${I}`;
29090
- for (let _ = 0; _ < 4; _++)
29091
- o.has(T(e, _)) && h.add(_);
29128
+ const T = (S, I) => `${S}:${I}`;
29129
+ for (let S = 0; S < 4; S++)
29130
+ o.has(T(e, S)) && h.add(S);
29092
29131
  }
29093
29132
  const f = {
29094
29133
  straight_16th: 4,
@@ -29099,11 +29138,11 @@ class Un {
29099
29138
  }[l], g = [];
29100
29139
  for (let T = 0; T < f; T++)
29101
29140
  h.has(T) || g.push(T);
29102
- g.sort((T, _) => {
29141
+ g.sort((T, S) => {
29103
29142
  const I = (D) => D === 0 ? 0 : D === f - 1 ? 2 : 1;
29104
- return I(T) - I(_);
29143
+ return I(T) - I(S);
29105
29144
  });
29106
- const p = g.slice(0, t), y = i?.beats[e]?.timestamp ?? e * a, S = {
29145
+ const p = g.slice(0, t), y = i?.beats[e]?.timestamp ?? e * a, _ = {
29107
29146
  straight_16th: a / 4,
29108
29147
  straight_8th: a / 2,
29109
29148
  triplet_8th: a / 3,
@@ -29111,7 +29150,7 @@ class Un {
29111
29150
  quarter_triplet: a
29112
29151
  }[l];
29113
29152
  return p.map((T) => ({
29114
- timestamp: y + T * S,
29153
+ timestamp: y + T * _,
29115
29154
  beatIndex: e,
29116
29155
  gridPosition: T,
29117
29156
  gridType: l,
@@ -29140,14 +29179,14 @@ class Un {
29140
29179
  interpolateBeats(e, t, i, n = 0.5, a, r, o) {
29141
29180
  if (i <= 0 || e.length === 0)
29142
29181
  return [];
29143
- const c = r ?? e[0].gridType, u = ((T) => T === "straight_16th" ? 4 : T === "straight_8th" ? 2 : T === "straight_4th" || T === "quarter_triplet" ? 1 : 3)(c), d = (T, _) => `${T}:${_}`, h = new Set(e.map((T) => T.gridPosition));
29182
+ const c = r ?? e[0].gridType, u = ((T) => T === "straight_16th" ? 4 : T === "straight_8th" ? 2 : T === "straight_4th" || T === "quarter_triplet" ? 1 : 3)(c), d = (T, S) => `${T}:${S}`, h = new Set(e.map((T) => T.gridPosition));
29144
29183
  if (a)
29145
29184
  for (let T = 0; T < u; T++)
29146
29185
  a.has(d(t, T)) && h.add(T);
29147
29186
  const m = [];
29148
29187
  for (let T = 0; T < u; T++)
29149
29188
  h.has(T) || m.push(T);
29150
- m.sort((T, _) => (T === 0 || T === 3 ? 2 : 1) - (_ === 0 || _ === 3 ? 2 : 1));
29189
+ m.sort((T, S) => (T === 0 || T === 3 ? 2 : 1) - (S === 0 || S === 3 ? 2 : 1));
29151
29190
  const f = m.slice(0, i), g = e[0], p = o?.beats[t]?.timestamp ?? t * n, v = {
29152
29191
  straight_16th: n / 4,
29153
29192
  straight_8th: n / 2,
@@ -29527,8 +29566,8 @@ class mt {
29527
29566
  * @throws {DOMException} If the operation is cancelled via signal
29528
29567
  */
29529
29568
  async generate(e, t, i, n) {
29530
- const a = (_, I, D) => {
29531
- this.options.verbose && console.log(`[RhythmGenerator] [${_}] ${Math.round(I * 100)}%: ${D}`), n?.(_, I, D);
29569
+ const a = (S, I, D) => {
29570
+ this.options.verbose && console.log(`[RhythmGenerator] [${S}] ${Math.round(I * 100)}%: ${D}`), n?.(S, I, D);
29532
29571
  };
29533
29572
  i?.throwIfAborted();
29534
29573
  const r = this.generateCacheKey(
@@ -29558,7 +29597,7 @@ class mt {
29558
29597
  a("Phase 3", 0.6, `Balanced composite: ${p.beats.length} beats (${y.beatsAdded} added, ${y.beatsShifted} shifted for rhythmic structure)`);
29559
29598
  const v = this.options.skipDifficultyVariants ? null : this.generateDifficultyVariants(p, d, u, t);
29560
29599
  a("Phase 3", 0.8, this.options.skipDifficultyVariants ? "Skipped preset difficulty variants (density-based mode)" : "Generated easy/medium/hard difficulty variants"), a("Phase 3", 1, "Phase 3 complete"), i?.throwIfAborted();
29561
- const S = {
29600
+ const _ = {
29562
29601
  difficulty: this.options.difficulty,
29563
29602
  bandsAnalyzed: ["low", "mid", "high"],
29564
29603
  transientsDetected: l.metadata.totalTransients,
@@ -29582,7 +29621,7 @@ class mt {
29582
29621
  densityAnalysis: h,
29583
29622
  scoringResult: m
29584
29623
  },
29585
- metadata: S
29624
+ metadata: _
29586
29625
  };
29587
29626
  return this.setCache(r, T), T;
29588
29627
  }
@@ -30386,9 +30425,9 @@ class Xo {
30386
30425
  midiNote: g.frequency > 0 ? g.midiNote : null,
30387
30426
  noteName: g.frequency > 0 ? this.midiToNoteName(g.midiNote) : null
30388
30427
  };
30389
- y.length > 1 && (v.alternativeHypotheses = y.slice(0, 5).map((S) => ({
30390
- frequency: S.frequency,
30391
- probability: S.probability
30428
+ y.length > 1 && (v.alternativeHypotheses = y.slice(0, 5).map((_) => ({
30429
+ frequency: _.frequency,
30430
+ probability: _.probability
30392
30431
  }))), h.push(v);
30393
30432
  }
30394
30433
  return h;
@@ -30452,18 +30491,18 @@ class Xo {
30452
30491
  l++;
30453
30492
  const v = g[0].probability;
30454
30493
  if (v < 0.1 ? d.below01++ : v < 0.2 ? d.b01_02++ : v < 0.3 ? d.b02_03++ : v < 0.4 ? d.b03_04++ : v < 0.5 ? d.b04_05++ : d.above05++, v >= a) {
30455
- const S = g[0], T = Math.round(this.frequencyToMidi(S.frequency)), _ = {
30494
+ const _ = g[0], T = Math.round(this.frequencyToMidi(_.frequency)), S = {
30456
30495
  timestamp: y,
30457
- frequency: S.frequency,
30458
- probability: S.probability,
30496
+ frequency: _.frequency,
30497
+ probability: _.probability,
30459
30498
  isVoiced: !0,
30460
30499
  midiNote: T,
30461
30500
  noteName: this.midiToNoteName(T)
30462
30501
  };
30463
- p.length > 1 && (_.alternativeHypotheses = p.slice(0, 5).map((I) => ({
30502
+ p.length > 1 && (S.alternativeHypotheses = p.slice(0, 5).map((I) => ({
30464
30503
  frequency: I.frequency,
30465
30504
  probability: I.probability
30466
- }))), c.push(_);
30505
+ }))), c.push(S);
30467
30506
  } else
30468
30507
  c.push({
30469
30508
  timestamp: y,
@@ -30557,8 +30596,8 @@ class Xo {
30557
30596
  let g = !1;
30558
30597
  for (const p of d) {
30559
30598
  if (p.frequency <= f.frequency || p.probability < m * 0.9) continue;
30560
- const y = p.frequency / f.frequency, v = Math.round(y), S = Math.abs(y - v);
30561
- if (v >= 2 && v <= 5 && S < 0.1) {
30599
+ const y = p.frequency / f.frequency, v = Math.round(y), _ = Math.abs(y - v);
30600
+ if (v >= 2 && v <= 5 && _ < 0.1) {
30562
30601
  g = !0;
30563
30602
  break;
30564
30603
  }
@@ -30744,7 +30783,7 @@ class qi {
30744
30783
  */
30745
30784
  static async create(e = {}) {
30746
30785
  const t = { ...or, ...e };
30747
- t.resolveUrl || (t.resolveUrl = Me.resolveUrl.bind(Me));
30786
+ t.resolveUrl || (t.resolveUrl = Ae.resolveUrl.bind(Ae));
30748
30787
  const i = new qi(t);
30749
30788
  return await i.initializeEssentia(), t.algorithm === "pitch_crepe" && await i.loadCrepeModel(t.crepeModelUrl), i;
30750
30789
  }
@@ -30771,7 +30810,7 @@ class qi {
30771
30810
  if (this.config.enableModelCache !== !1)
30772
30811
  this.crepeModel = await Ht.getOrFetchGraphModel(Ee, e, {
30773
30812
  resolveUrl: this.config.resolveUrl,
30774
- invalidateUrlCache: (i) => Me.invalidateCacheForUrl(i),
30813
+ invalidateUrlCache: (i) => Ae.invalidateCacheForUrl(i),
30775
30814
  maxRetries: 3,
30776
30815
  baseDelayMs: 1e3
30777
30816
  });
@@ -31085,16 +31124,16 @@ class qi {
31085
31124
  let g;
31086
31125
  try {
31087
31126
  const y = Ee.tidy(() => {
31088
- const _ = Ee.tensor(m, [1, n]);
31089
- return this.crepeModel.execute(_).dataSync().slice();
31127
+ const S = Ee.tensor(m, [1, n]);
31128
+ return this.crepeModel.execute(S).dataSync().slice();
31090
31129
  });
31091
- let v = 0, S = 0, T = 0;
31092
- for (let _ = 0; _ < 360; _++) {
31093
- const I = y[_];
31094
- v += _ * 10 * I, S += I, I > T && (T = I);
31130
+ let v = 0, _ = 0, T = 0;
31131
+ for (let S = 0; S < 360; S++) {
31132
+ const I = y[S];
31133
+ v += S * 10 * I, _ += I, I > T && (T = I);
31095
31134
  }
31096
- if (S > 0 && T > 0.3) {
31097
- const _ = v / S, I = l * Math.pow(2, _ / 1200), D = Math.round(this.frequencyToMidi(I));
31135
+ if (_ > 0 && T > 0.3) {
31136
+ const S = v / _, I = l * Math.pow(2, S / 1200), D = Math.round(this.frequencyToMidi(I));
31098
31137
  g = {
31099
31138
  timestamp: f,
31100
31139
  frequency: I,
@@ -31656,7 +31695,7 @@ const yy = {
31656
31695
  sampleRate: 44100,
31657
31696
  hopSize: 1024,
31658
31697
  crepeModelUrl: ha,
31659
- resolveUrl: Me.resolveUrl.bind(Me),
31698
+ resolveUrl: Ae.resolveUrl.bind(Ae),
31660
31699
  includeContour: !0,
31661
31700
  onProgress: void 0
31662
31701
  }, vy = 69, by = 440, wy = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"];
@@ -31788,7 +31827,7 @@ class d0 {
31788
31827
  * Compute summary statistics from pitch results
31789
31828
  */
31790
31829
  computeSummary(e) {
31791
- const t = e.length, i = e.filter((S) => S.isVoiced && S.frequency > 0), n = i.length;
31830
+ const t = e.length, i = e.filter((_) => _.isVoiced && _.frequency > 0), n = i.length;
31792
31831
  if (n === 0)
31793
31832
  return {
31794
31833
  voicingRatio: 0,
@@ -31803,14 +31842,14 @@ class d0 {
31803
31842
  totalFrames: t,
31804
31843
  voicedFrames: 0
31805
31844
  };
31806
- const a = i.map((S) => S.frequency), r = [...a].sort((S, T) => S - T), o = a.reduce((S, T) => S + T, 0) / a.length, c = Math.floor(r.length / 2), l = r.length % 2 !== 0 ? r[c] : (r[c - 1] + r[c]) / 2, u = r[0], d = r[r.length - 1], h = this.frequencyToMidi(u), m = this.frequencyToMidi(d), f = Math.abs(m - h), g = this.midiToNoteName(Math.round(h)), p = this.midiToNoteName(Math.round(m)), y = /* @__PURE__ */ new Map();
31807
- for (const S of i)
31808
- S.noteName && y.set(S.noteName, (y.get(S.noteName) ?? 0) + 1);
31809
- const v = Array.from(y.entries()).map(([S, T]) => ({
31810
- note: S,
31845
+ const a = i.map((_) => _.frequency), r = [...a].sort((_, T) => _ - T), o = a.reduce((_, T) => _ + T, 0) / a.length, c = Math.floor(r.length / 2), l = r.length % 2 !== 0 ? r[c] : (r[c - 1] + r[c]) / 2, u = r[0], d = r[r.length - 1], h = this.frequencyToMidi(u), m = this.frequencyToMidi(d), f = Math.abs(m - h), g = this.midiToNoteName(Math.round(h)), p = this.midiToNoteName(Math.round(m)), y = /* @__PURE__ */ new Map();
31846
+ for (const _ of i)
31847
+ _.noteName && y.set(_.noteName, (y.get(_.noteName) ?? 0) + 1);
31848
+ const v = Array.from(y.entries()).map(([_, T]) => ({
31849
+ note: _,
31811
31850
  count: T,
31812
31851
  percentage: T / n * 100
31813
- })).sort((S, T) => T.count - S.count);
31852
+ })).sort((_, T) => T.count - _.count);
31814
31853
  return {
31815
31854
  voicingRatio: n / t,
31816
31855
  averageFrequency: o,
@@ -31855,11 +31894,11 @@ class d0 {
31855
31894
  h = v;
31856
31895
  continue;
31857
31896
  }
31858
- let S;
31897
+ let _;
31859
31898
  const T = Math.abs(v - h);
31860
- v > h ? (S = "up", c.up++) : v < h ? (S = "down", c.down++) : (S = "stable", c.stable++);
31861
- const _ = Jo(T);
31862
- l[_]++, !d || d.direction !== S ? (d && u.push({
31899
+ v > h ? (_ = "up", c.up++) : v < h ? (_ = "down", c.down++) : (_ = "stable", c.stable++);
31900
+ const S = Jo(T);
31901
+ l[S]++, !d || d.direction !== _ ? (d && u.push({
31863
31902
  startTime: d.startTime,
31864
31903
  endTime: d.endTime,
31865
31904
  startNote: d.startNote,
@@ -31871,7 +31910,7 @@ class d0 {
31871
31910
  endTime: y.timestamp,
31872
31911
  startNote: this.midiToNoteName(h),
31873
31912
  endNote: this.midiToNoteName(v),
31874
- direction: S,
31913
+ direction: _,
31875
31914
  startMidi: h,
31876
31915
  endMidi: v
31877
31916
  }) : (d.endTime = y.timestamp, d.endNote = this.midiToNoteName(v), d.endMidi = v), h = v;
@@ -32407,7 +32446,7 @@ const Sy = [
32407
32446
  category: "jump",
32408
32447
  difficulty: 6
32409
32448
  }
32410
- ], Ay = [
32449
+ ], ky = [
32411
32450
  // Build-up transitions
32412
32451
  {
32413
32452
  id: "ddr_transition_build_up",
@@ -32450,7 +32489,7 @@ const Sy = [
32450
32489
  category: "transition",
32451
32490
  difficulty: 4
32452
32491
  }
32453
- ], My = [
32492
+ ], Ay = [
32454
32493
  // Single fret patterns
32455
32494
  {
32456
32495
  id: "gh_basic_single_1",
@@ -32625,7 +32664,7 @@ const Sy = [
32625
32664
  category: "basic",
32626
32665
  difficulty: 2
32627
32666
  }
32628
- ], ky = [
32667
+ ], My = [
32629
32668
  // Two-fret alternations
32630
32669
  {
32631
32670
  id: "gh_alternating_1_3",
@@ -33007,10 +33046,10 @@ const Sy = [
33007
33046
  ..._y,
33008
33047
  ...Ty,
33009
33048
  ...Cy,
33010
- ...Ay
33049
+ ...ky
33011
33050
  ], Ry = [
33051
+ ...Ay,
33012
33052
  ...My,
33013
- ...ky,
33014
33053
  ...Iy,
33015
33054
  ...Dy,
33016
33055
  ...Ey
@@ -33503,8 +33542,8 @@ class bn {
33503
33542
  mapButtons(e, t, i) {
33504
33543
  const n = e.beats;
33505
33544
  if (this.config.controllerMode === "tap")
33506
- return n.map((v, S) => ({
33507
- beatIndex: S,
33545
+ return n.map((v, _) => ({
33546
+ beatIndex: _,
33508
33547
  timestamp: v.timestamp,
33509
33548
  key: "tap",
33510
33549
  source: "pattern",
@@ -33523,17 +33562,17 @@ class bn {
33523
33562
  l,
33524
33563
  this.config.pitchInfluenceWeight
33525
33564
  ), d = c.map(
33526
- (v, S) => v !== null && u[S] ? v : null
33527
- ), h = this.config.controllerMode === "ddr" ? ec.patterns : tc.patterns, m = Oy(d), f = /* @__PURE__ */ new Set(), g = m.map((v, S) => {
33565
+ (v, _) => v !== null && u[_] ? v : null
33566
+ ), h = this.config.controllerMode === "ddr" ? ec.patterns : tc.patterns, m = Oy(d), f = /* @__PURE__ */ new Set(), g = m.map((v, _) => {
33528
33567
  const T = Ly(
33529
33568
  v,
33530
33569
  h,
33531
33570
  r,
33532
33571
  f,
33533
- () => this.seededRandom(`run:${S}:pick:${o++}`)
33572
+ () => this.seededRandom(`run:${_}:pick:${o++}`)
33534
33573
  );
33535
- for (const _ of T)
33536
- _.pattern.id !== "__interpolated__" && f.add(_.pattern.id);
33574
+ for (const S of T)
33575
+ S.pattern.id !== "__interpolated__" && f.add(S.pattern.id);
33537
33576
  return T;
33538
33577
  }), { keys: p, patternIds: y } = zy(
33539
33578
  d,
@@ -33541,13 +33580,13 @@ class bn {
33541
33580
  g
33542
33581
  );
33543
33582
  for (let v = 0; v < n.length; v++) {
33544
- const S = d[v] !== null;
33583
+ const _ = d[v] !== null;
33545
33584
  a.push({
33546
33585
  beatIndex: v,
33547
33586
  timestamp: n[v].timestamp,
33548
33587
  key: p[v],
33549
- source: S ? "pitch" : "pattern",
33550
- patternId: S ? void 0 : y[v],
33588
+ source: _ ? "pitch" : "pattern",
33589
+ patternId: _ ? void 0 : y[v],
33551
33590
  probability: l[v]
33552
33591
  });
33553
33592
  }
@@ -34261,8 +34300,8 @@ class fa {
34261
34300
  * ```
34262
34301
  */
34263
34302
  async generateAtDensity(e, t, i, n, a) {
34264
- const r = (y, v, S) => {
34265
- n?.({ stage: y, progress: v, message: S });
34303
+ const r = (y, v, _) => {
34304
+ n?.({ stage: y, progress: v, message: _ });
34266
34305
  };
34267
34306
  a?.throwIfAborted();
34268
34307
  const o = t.audioId;
@@ -34279,8 +34318,8 @@ class fa {
34279
34318
  c = this.getFromCache(y), c ? r("rhythm", 1, "Rhythm loaded from cache") : (c = await this.generateRhythm(
34280
34319
  e,
34281
34320
  t,
34282
- (v, S, T) => {
34283
- r("rhythm", S, `[${v}] ${T}`);
34321
+ (v, _, T) => {
34322
+ r("rhythm", _, `[${v}] ${T}`);
34284
34323
  },
34285
34324
  a,
34286
34325
  !0
@@ -34305,8 +34344,8 @@ class fa {
34305
34344
  "pitch",
34306
34345
  this.createConfigFingerprint("pitch")
34307
34346
  );
34308
- h = this.getFromCache(y), h ? r("pitch", 0.5, "Pitch analysis loaded from cache") : (r("pitch", 0, "Starting pitch analysis..."), h = await this.analyzePitch(e, c, (v, S) => {
34309
- r("pitch", v, S);
34347
+ h = this.getFromCache(y), h ? r("pitch", 0.5, "Pitch analysis loaded from cache") : (r("pitch", 0, "Starting pitch analysis..."), h = await this.analyzePitch(e, c, (v, _) => {
34348
+ r("pitch", v, _);
34310
34349
  }), this.setCache(y, h), r("pitch", 1, "Pitch analysis complete"));
34311
34350
  } else
34312
34351
  r("pitch", 1, "Pitch analysis skipped");
@@ -34440,8 +34479,8 @@ class fa {
34440
34479
  g,
34441
34480
  c.metadata,
34442
34481
  l?.pitchByBeat
34443
- ), v = this.convertToChart(y, t), S = this.buildLevel(v, y, c, l, "custom");
34444
- r.set(m, S);
34482
+ ), v = this.convertToChart(y, t), _ = this.buildLevel(v, y, c, l, "custom");
34483
+ r.set(m, _);
34445
34484
  }
34446
34485
  return n?.({
34447
34486
  stage: "finalizing",
@@ -35524,7 +35563,7 @@ function T0(s) {
35524
35563
  function C0(s) {
35525
35564
  return typeof s == "string" && ["easy", "medium", "hard", "deadly"].includes(s);
35526
35565
  }
35527
- class A0 {
35566
+ class k0 {
35528
35567
  /**
35529
35568
  * Calculate average party level
35530
35569
  *
@@ -35772,7 +35811,7 @@ function jy(s, e, t) {
35772
35811
  function Ky(s, e, t) {
35773
35812
  return ur.randomUUID && !s ? ur.randomUUID() : jy(s);
35774
35813
  }
35775
- class M0 {
35814
+ class A0 {
35776
35815
  constructor(e = {}) {
35777
35816
  this.options = {
35778
35817
  validateAudioUrls: !1,
@@ -35789,7 +35828,7 @@ class M0 {
35789
35828
  async parse(e) {
35790
35829
  const t = e.name, i = e.image, n = e.creator, a = e.description, r = e.genre, o = e.tags;
35791
35830
  let c = i;
35792
- i && this.options.resolveImageUrls && (c = await Me.resolveUrl(i));
35831
+ i && this.options.resolveImageUrls && (c = await Ae.resolveUrl(i));
35793
35832
  const l = e.tracks || [], u = [];
35794
35833
  for (let d = 0; d < l.length; d++)
35795
35834
  try {
@@ -35826,7 +35865,7 @@ class M0 {
35826
35865
  if (!this.options.resolveImageUrls)
35827
35866
  return e;
35828
35867
  const t = { ...e };
35829
- return t.image_url && (t.image_url = await Me.resolveUrl(t.image_url)), t.image_thumb_url && (t.image_thumb_url = await Me.resolveUrl(t.image_thumb_url)), t;
35868
+ return t.image_url && (t.image_url = await Ae.resolveUrl(t.image_url)), t.image_thumb_url && (t.image_thumb_url = await Ae.resolveUrl(t.image_thumb_url)), t;
35830
35869
  }
35831
35870
  /**
35832
35871
  * Parse a single track following the flattening process
@@ -35852,7 +35891,7 @@ class M0 {
35852
35891
  throw new Error(`Missing required fields for track: ${JSON.stringify({ title: d, artist: h, imageUrl: f })}`);
35853
35892
  return null;
35854
35893
  }
35855
- const S = typeof i?.description == "string" ? i.description : void 0, T = typeof i?.album == "string" ? i.album : void 0, _ = i?.duration ? Number(i.duration) : 0, I = ee.extractGenre(i || {}), D = i?.tags || [], R = i?.bpm ? Number(i.bpm) : void 0, q = typeof i?.key == "string" ? i.key : void 0, O = ee.convertAttributes(i?.attributes), W = Wg(i || {}), Z = {
35894
+ const _ = typeof i?.description == "string" ? i.description : void 0, T = typeof i?.album == "string" ? i.album : void 0, S = i?.duration ? Number(i.duration) : 0, I = ee.extractGenre(i || {}), D = i?.tags || [], R = i?.bpm ? Number(i.bpm) : void 0, q = typeof i?.key == "string" ? i.key : void 0, O = ee.convertAttributes(i?.attributes), W = Wg(i || {}), Z = {
35856
35895
  id: l,
35857
35896
  uuid: u,
35858
35897
  playlist_index: t,
@@ -35860,12 +35899,12 @@ class M0 {
35860
35899
  platform: c,
35861
35900
  title: d,
35862
35901
  artist: h,
35863
- description: S,
35902
+ description: _,
35864
35903
  album: T,
35865
35904
  image_url: f,
35866
35905
  audio_url: y,
35867
35906
  audio_url_lossless: v && v !== y ? v : void 0,
35868
- duration: _,
35907
+ duration: S,
35869
35908
  genre: I,
35870
35909
  tags: Array.isArray(D) ? D.map((Q) => String(Q).toLowerCase()) : [],
35871
35910
  bpm: R,
@@ -35992,7 +36031,7 @@ class Yy {
35992
36031
  * ```
35993
36032
  */
35994
36033
  constructor(e = {}) {
35995
- const t = e.hopSizeMode ? Ar(e.hopSizeMode) : e.hopSizeMs ?? _i.hopSizeMs, i = e.melBandsMode ? Mr(e.melBandsMode) : e.melBands ?? _i.melBands, n = e.gaussianSmoothMode ? kr(e.gaussianSmoothMode) : e.gaussianSmoothMs ?? _i.gaussianSmoothMs;
36034
+ const t = e.hopSizeMode ? kr(e.hopSizeMode) : e.hopSizeMs ?? _i.hopSizeMs, i = e.melBandsMode ? Ar(e.melBandsMode) : e.melBands ?? _i.melBands, n = e.gaussianSmoothMode ? Mr(e.gaussianSmoothMode) : e.gaussianSmoothMs ?? _i.gaussianSmoothMs;
35996
36035
  this.config = {
35997
36036
  ..._i,
35998
36037
  ...e,
@@ -36022,26 +36061,26 @@ class Yy {
36022
36061
  r,
36023
36062
  i
36024
36063
  ), d = l.numFrames, h = [];
36025
- for (let S = 0; S < d; S++) {
36026
- const T = l.frames[S], _ = new Float32Array(this.config.melBands);
36064
+ for (let _ = 0; _ < d; _++) {
36065
+ const T = l.frames[_], S = new Float32Array(this.config.melBands);
36027
36066
  for (let I = 0; I < this.config.melBands; I++) {
36028
36067
  const D = u[I];
36029
36068
  let R = 0;
36030
36069
  for (let q = 0; q < D.length && q < T.length; q++)
36031
36070
  R += T[q] * D[q];
36032
- _[I] = 20 * Math.log10(R + 1e-10);
36071
+ S[I] = 20 * Math.log10(R + 1e-10);
36033
36072
  }
36034
- h.push(_);
36073
+ h.push(S);
36035
36074
  }
36036
36075
  const m = new Float32Array(d);
36037
36076
  m[0] = 0;
36038
- for (let S = 1; S < d; S++) {
36077
+ for (let _ = 1; _ < d; _++) {
36039
36078
  let T = 0;
36040
- for (let _ = 0; _ < this.config.melBands; _++) {
36041
- const I = h[S][_] - h[S - 1][_];
36079
+ for (let S = 0; S < this.config.melBands; S++) {
36080
+ const I = h[_][S] - h[_ - 1][S];
36042
36081
  I > 0 && (T += I);
36043
36082
  }
36044
- m[S] = T;
36083
+ m[_] = T;
36045
36084
  }
36046
36085
  const f = 1 / c, g = wp(
36047
36086
  m,
@@ -36053,11 +36092,11 @@ class Yy {
36053
36092
  f
36054
36093
  ), y = Sp(p), v = new Float32Array(p.length);
36055
36094
  if (y > 1e-10)
36056
- for (let S = 0; S < p.length; S++)
36057
- v[S] = p[S] / y;
36095
+ for (let _ = 0; _ < p.length; _++)
36096
+ v[_] = p[_] / y;
36058
36097
  else
36059
- for (let S = 0; S < p.length; S++)
36060
- v[S] = p[S];
36098
+ for (let _ = 0; _ < p.length; _++)
36099
+ v[_] = p[_];
36061
36100
  return {
36062
36101
  envelope: v,
36063
36102
  numFrames: d,
@@ -36189,23 +36228,23 @@ class Xy {
36189
36228
  );
36190
36229
  let l = this.findPeak(c, 0, c.length);
36191
36230
  if (this.config.useOctaveResolution) {
36192
- const T = this.calculateTPS2(o.values, l), _ = Math.floor(l / 2);
36193
- _ >= 1 && _ < c.length && this.calculateTPS2(o.values, _) > T && (l = _);
36231
+ const T = this.calculateTPS2(o.values, l), S = Math.floor(l / 2);
36232
+ S >= 1 && S < c.length && this.calculateTPS2(o.values, S) > T && (l = S);
36194
36233
  }
36195
36234
  if (this.config.useTripleMeter) {
36196
- const T = this.calculateTPS3(o.values, l), _ = Math.floor(l / 3);
36197
- _ >= 1 && _ < c.length && this.calculateTPS3(o.values, _) > T && (l = _);
36235
+ const T = this.calculateTPS3(o.values, l), S = Math.floor(l / 3);
36236
+ S >= 1 && S < c.length && this.calculateTPS3(o.values, S) > T && (l = S);
36198
36237
  }
36199
36238
  const u = this.lagToBpm(l + o.minLag, t), d = u / 2, h = c[l] || 0, m = Math.min(l * 2, c.length - 1), f = c[m] || 0, g = Math.max(Math.floor(l / 2), 0), p = c[g] || 0, y = 1, v = Math.min(Math.max(
36200
36239
  Math.max(f, p) / (h + 1e-3),
36201
36240
  0
36202
- ), 1), S = 60 / u;
36241
+ ), 1), _ = 60 / u;
36203
36242
  return {
36204
36243
  primaryBpm: u,
36205
36244
  secondaryBpm: d,
36206
36245
  primaryWeight: y,
36207
36246
  secondaryWeight: v,
36208
- targetIntervalSeconds: S
36247
+ targetIntervalSeconds: _
36209
36248
  };
36210
36249
  }
36211
36250
  /**
@@ -36441,31 +36480,31 @@ class Qy {
36441
36480
  effectiveDpAlpha: c
36442
36481
  });
36443
36482
  const l = Math.max(1, Math.round(a * this.config.minPredecessorRatio)), u = Math.round(a * this.config.maxPredecessorRatio), d = new Float32Array(u - l + 1);
36444
- for (let S = 0; S < d.length; S++) {
36445
- const T = l + S, _ = Math.log(T / a);
36446
- d[S] = -c * _ * _;
36483
+ for (let _ = 0; _ < d.length; _++) {
36484
+ const T = l + _, S = Math.log(T / a);
36485
+ d[_] = -c * S * S;
36447
36486
  }
36448
36487
  const h = new Int32Array(n);
36449
36488
  h.fill(-1);
36450
36489
  const m = new Float32Array(e);
36451
- for (let S = u + 1; S < n; S++) {
36452
- let T = -1 / 0, _ = -1;
36490
+ for (let _ = u + 1; _ < n; _++) {
36491
+ let T = -1 / 0, S = -1;
36453
36492
  for (let I = 0; I < d.length; I++) {
36454
- const D = S - (l + I);
36493
+ const D = _ - (l + I);
36455
36494
  if (D >= 0 && D < n) {
36456
36495
  const R = d[I] + m[D];
36457
- R > T && (T = R, _ = D);
36496
+ R > T && (T = R, S = D);
36458
36497
  }
36459
36498
  }
36460
- m[S] = T + e[S], h[S] = _;
36499
+ m[_] = T + e[_], h[_] = S;
36461
36500
  }
36462
36501
  Ti.debug("BeatTracker: Starting backward pass", {
36463
36502
  maxCumulativeScore: Math.max(...m),
36464
36503
  envelopeLength: n
36465
36504
  });
36466
36505
  let f = 0, g = m[0];
36467
- for (let S = 1; S < n; S++)
36468
- m[S] > g && (g = m[S], f = S);
36506
+ for (let _ = 1; _ < n; _++)
36507
+ m[_] > g && (g = m[_], f = _);
36469
36508
  const p = [];
36470
36509
  let y = f;
36471
36510
  for (; y >= 0 && h[y] >= 0; )
@@ -36632,7 +36671,7 @@ class Ye {
36632
36671
  */
36633
36672
  constructor(e = {}) {
36634
36673
  this.state = null;
36635
- const t = { ...ii, ...e }, i = e.hopSizeMode, n = e.melBandsMode, a = e.gaussianSmoothMode, r = i ? Ar(i) : e.hopSizeMs ?? ii.hopSizeMs, o = n ? Mr(n) : e.melBands ?? ii.melBands, c = a ? kr(a) : e.gaussianSmoothMs ?? ii.gaussianSmoothMs;
36674
+ const t = { ...ii, ...e }, i = e.hopSizeMode, n = e.melBandsMode, a = e.gaussianSmoothMode, r = i ? kr(i) : e.hopSizeMs ?? ii.hopSizeMs, o = n ? Ar(n) : e.melBands ?? ii.melBands, c = a ? Mr(a) : e.gaussianSmoothMs ?? ii.gaussianSmoothMs;
36636
36675
  this.options = {
36637
36676
  ...t,
36638
36677
  hopSizeMs: r,
@@ -36755,8 +36794,8 @@ class Ye {
36755
36794
  noiseFloorThreshold: this.options.noiseFloorThreshold
36756
36795
  });
36757
36796
  const y = {
36758
- version: Al,
36759
- algorithm: Ml,
36797
+ version: kl,
36798
+ algorithm: Al,
36760
36799
  minBpm: this.options.minBpm,
36761
36800
  maxBpm: this.options.maxBpm,
36762
36801
  sensitivity: this.options.sensitivity,
@@ -37380,9 +37419,9 @@ class iv {
37380
37419
  */
37381
37420
  resolveThresholds() {
37382
37421
  return this.options.customThresholds && Object.keys(this.options.customThresholds).length > 0 ? {
37383
- ...An(this.options.difficultyPreset || "medium"),
37422
+ ...kn(this.options.difficultyPreset || "medium"),
37384
37423
  ...this.options.customThresholds
37385
- } : An(this.options.difficultyPreset || "medium");
37424
+ } : kn(this.options.difficultyPreset || "medium");
37386
37425
  }
37387
37426
  /**
37388
37427
  * Check the accuracy of a button press
@@ -37559,24 +37598,24 @@ class Ni {
37559
37598
  const u = this.generateGrid(e, c, l);
37560
37599
  let d = this.mergeBeats(t, u, o);
37561
37600
  const h = d.filter((I) => I.source === "interpolated").length, m = h > 0 ? d.filter((I) => I.source === "interpolated").reduce((I, D) => I + D.confidence, 0) / h : 0, f = this.calculateTempoDriftRatio(d), g = this.identifyTempoClusters(t), p = g.map((I) => Math.round(I.bpm)), y = this.filterOctaveMultiples(p), v = y.length > 1;
37562
- let S, T;
37601
+ let _, T;
37563
37602
  if (this.options.enableMultiTempo && v) {
37564
37603
  const I = this.runMultiTempoAnalysis(
37565
37604
  t,
37566
37605
  g,
37567
37606
  n
37568
37607
  );
37569
- I && (S = I.tempoSections, T = !0, S.length > 1 && (d = this.reinterpolateBoundaryRegions(
37608
+ I && (_ = I.tempoSections, T = !0, _.length > 1 && (d = this.reinterpolateBoundaryRegions(
37570
37609
  d,
37571
- S,
37610
+ _,
37572
37611
  t,
37573
37612
  o
37574
37613
  )), Ie.debug("Multi-tempo analysis complete", {
37575
- sectionCount: S.length,
37576
- tempos: S.map((D) => D.bpm)
37614
+ sectionCount: _.length,
37615
+ tempos: _.map((D) => D.bpm)
37577
37616
  }));
37578
37617
  }
37579
- const _ = {
37618
+ const S = {
37580
37619
  quarterNoteDetection: c,
37581
37620
  gapAnalysis: l,
37582
37621
  detectedBeatCount: t.length,
@@ -37588,14 +37627,14 @@ class Ni {
37588
37627
  // Multi-tempo fields
37589
37628
  detectedClusterTempos: y.length > 0 ? y : void 0,
37590
37629
  hasMultipleTempos: v,
37591
- tempoSections: S,
37630
+ tempoSections: _,
37592
37631
  hasMultiTempoApplied: T
37593
37632
  };
37594
37633
  return Ie.debug("Interpolation complete", {
37595
37634
  detectedBeats: t.length,
37596
37635
  interpolatedBeats: h,
37597
37636
  totalBeats: d.length,
37598
- interpolationRatio: _.interpolationRatio.toFixed(2),
37637
+ interpolationRatio: S.interpolationRatio.toFixed(2),
37599
37638
  hasMultipleTempos: v,
37600
37639
  hasMultiTempoApplied: T
37601
37640
  }), {
@@ -37608,7 +37647,7 @@ class Ni {
37608
37647
  quarterNoteBpm: c.bpm,
37609
37648
  quarterNoteConfidence: c.confidence,
37610
37649
  originalMetadata: a,
37611
- interpolationMetadata: _,
37650
+ interpolationMetadata: S,
37612
37651
  downbeatConfig: o
37613
37652
  };
37614
37653
  }
@@ -38232,8 +38271,8 @@ class Ni {
38232
38271
  if (y > 0) {
38233
38272
  const v = c + y * o, T = (g.timestamp - v) / y * n;
38234
38273
  o = o + T;
38235
- for (let _ = 1; _ < y; _++) {
38236
- const I = u + _ * o;
38274
+ for (let S = 1; S < y; S++) {
38275
+ const I = u + S * o;
38237
38276
  if (a !== void 0 && I > a) break;
38238
38277
  r.push(I);
38239
38278
  }
@@ -38272,8 +38311,8 @@ class Ni {
38272
38311
  if (y > 0) {
38273
38312
  const v = c - y * o, T = (g.timestamp - v) / y * n;
38274
38313
  o = o + T;
38275
- for (let _ = 1; _ < y; _++) {
38276
- const I = u - _ * o;
38314
+ for (let S = 1; S < y; S++) {
38315
+ const I = u - S * o;
38277
38316
  if (a !== void 0 && I < a) break;
38278
38317
  r.unshift(I);
38279
38318
  }
@@ -38313,13 +38352,13 @@ class Ni {
38313
38352
  for (let f = 0; f < i.length; f++) {
38314
38353
  const g = i[f];
38315
38354
  if (c.push(this.createDetectedBeat(g)), f < i.length - 1) {
38316
- const p = i[f + 1], y = p.timestamp - g.timestamp, v = Math.round(y / m), S = h + v * m, T = p.timestamp - S;
38355
+ const p = i[f + 1], y = p.timestamp - g.timestamp, v = Math.round(y / m), _ = h + v * m, T = p.timestamp - _;
38317
38356
  if (v > 0) {
38318
- const _ = T / v * o;
38319
- m = m + _;
38357
+ const S = T / v * o;
38358
+ m = m + S;
38320
38359
  }
38321
- for (let _ = 1; _ < v; _++) {
38322
- const I = g.timestamp + _ * m;
38360
+ for (let S = 1; S < v; S++) {
38361
+ const I = g.timestamp + S * m;
38323
38362
  if (I >= p.timestamp - r) break;
38324
38363
  const D = this.calculateConfidence(
38325
38364
  l,
@@ -38928,7 +38967,7 @@ const Ut = class Ut {
38928
38967
  const d = Math.floor(c * a), h = Math.floor((c + u) * a), m = this.extractAudioSegment(i, d, h), f = this.performFFT(m, this.options.fftSize), g = new Uint8Array(f.length);
38929
38968
  for (let R = 0; R < f.length; R++)
38930
38969
  g[R] = Math.min(255, Math.round(f[R]));
38931
- const p = Qe.separateFrequencyBands(g, a), y = Qe.calculateDominance(p.bass) * this.options.bassBoost, v = Qe.calculateDominance(p.mid) * this.options.midBoost, S = Qe.calculateDominance(p.treble) * this.options.trebleBoost, T = y + v + S || 1, _ = this.calculateRMS(i, d, h), I = this.calculatePeak(i, d, h), D = [
38970
+ const p = Qe.separateFrequencyBands(g, a), y = Qe.calculateDominance(p.bass) * this.options.bassBoost, v = Qe.calculateDominance(p.mid) * this.options.midBoost, _ = Qe.calculateDominance(p.treble) * this.options.trebleBoost, T = y + v + _ || 1, S = this.calculateRMS(i, d, h), I = this.calculatePeak(i, d, h), D = [
38932
38971
  ...p.bass,
38933
38972
  ...p.mid,
38934
38973
  ...p.treble
@@ -38938,11 +38977,11 @@ const Ut = class Ut {
38938
38977
  duration: u,
38939
38978
  bass: y / T,
38940
38979
  mid: v / T,
38941
- treble: S / T,
38942
- amplitude: _,
38943
- rms_energy: _,
38980
+ treble: _ / T,
38981
+ amplitude: S,
38982
+ rms_energy: S,
38944
38983
  peak: I,
38945
- dynamic_range: I - _,
38984
+ dynamic_range: I - S,
38946
38985
  spectral_centroid: this.calculateSpectralCentroid(D),
38947
38986
  spectral_rolloff: this.calculateSpectralRolloff(D),
38948
38987
  zero_crossing_rate: this.calculateZeroCrossingRate(i, d, h)
@@ -40286,7 +40325,7 @@ const nv = [
40286
40325
  "video",
40287
40326
  "war"
40288
40327
  ], cv = ["danceable", "non-danceable"], lv = ["voice", "instrumental"], uv = ["acoustic", "electronic"];
40289
- function Mi(s) {
40328
+ function Ai(s) {
40290
40329
  return typeof s == "object" && s !== null && "embedding" in s && "classifier" in s;
40291
40330
  }
40292
40331
  function fr(s) {
@@ -40317,7 +40356,7 @@ function hv(s) {
40317
40356
  }
40318
40357
  }
40319
40358
  function Ot(s) {
40320
- return Mi(s) ? `${s.embedding} -> ${s.classifier}` : s.modelUrl;
40359
+ return Ai(s) ? `${s.embedding} -> ${s.classifier}` : s.modelUrl;
40321
40360
  }
40322
40361
  function mv(s) {
40323
40362
  if (!s || s.length === 0)
@@ -40387,7 +40426,7 @@ const _n = {
40387
40426
  modelUrl: "https://arweave.net/nX9KX1OVhEaT1dStNcsRiZKCQTWuHjAMl4MWprIFyZU/model.json",
40388
40427
  modelType: "musicnn"
40389
40428
  }
40390
- }, k0 = {
40429
+ }, M0 = {
40391
40430
  genre: Object.keys(rc),
40392
40431
  mood: Object.keys(oc),
40393
40432
  danceability: Object.keys(cc)
@@ -40414,7 +40453,7 @@ class I0 {
40414
40453
  cacheEmbeddings: !0,
40415
40454
  enableModelCache: !0,
40416
40455
  ...e
40417
- }, this.options.resolveUrl || (this.options.resolveUrl = Me.resolveUrl.bind(Me)), delete this.options.preset;
40456
+ }, this.options.resolveUrl || (this.options.resolveUrl = Ae.resolveUrl.bind(Ae)), delete this.options.preset;
40418
40457
  }
40419
40458
  /**
40420
40459
  * Initialize essentia.js modules for browser environment.
@@ -40483,7 +40522,7 @@ class I0 {
40483
40522
  if (this.options.enableModelCache)
40484
40523
  return Ht.getOrFetchGraphModel(Ee, e, {
40485
40524
  resolveUrl: this.options.resolveUrl,
40486
- invalidateUrlCache: (r) => Me.invalidateCacheForUrl(r),
40525
+ invalidateUrlCache: (r) => Ae.invalidateCacheForUrl(r),
40487
40526
  maxRetries: t,
40488
40527
  baseDelayMs: i
40489
40528
  });
@@ -40531,7 +40570,7 @@ class I0 {
40531
40570
  const u = String(l).toLowerCase();
40532
40571
  if (!(u.includes("fetch") || u.includes("network") || u.includes("timeout") || u.includes("failed to fetch") || u.includes("networkerror") || u.includes("404")) || a === i - 1)
40533
40572
  throw l;
40534
- Me.invalidateCacheForUrl(e);
40573
+ Ae.invalidateCacheForUrl(e);
40535
40574
  const h = n * Math.pow(2, a);
40536
40575
  console.warn(
40537
40576
  `[MusicClassifier] Essentia model init failed (attempt ${a + 1}/${i}), re-resolving and retrying in ${h}ms...`,
@@ -40565,7 +40604,7 @@ class I0 {
40565
40604
  if (this.options.enableModelCache) {
40566
40605
  const a = await Ht.getOrFetchEssentiaUrl(e, {
40567
40606
  resolveUrl: this.options.resolveUrl,
40568
- invalidateUrlCache: (r) => Me.invalidateCacheForUrl(r)
40607
+ invalidateUrlCache: (r) => Ae.invalidateCacheForUrl(r)
40569
40608
  });
40570
40609
  n = new this.essentiaModel.TensorflowVGGish(Ee, a), await n.initialize();
40571
40610
  } else
@@ -40576,7 +40615,7 @@ class I0 {
40576
40615
  if (this.options.enableModelCache) {
40577
40616
  const a = await Ht.getOrFetchEssentiaUrl(e, {
40578
40617
  resolveUrl: this.options.resolveUrl,
40579
- invalidateUrlCache: (r) => Me.invalidateCacheForUrl(r)
40618
+ invalidateUrlCache: (r) => Ae.invalidateCacheForUrl(r)
40580
40619
  });
40581
40620
  n = new this.essentiaModel.TensorflowMusiCNN(Ee, a), await n.initialize();
40582
40621
  } else
@@ -40747,9 +40786,9 @@ class I0 {
40747
40786
  vibe_metrics: {}
40748
40787
  };
40749
40788
  if (this.options.models?.genre) {
40750
- const d = this.options.models.genre, h = Mi(d) ? d.classifier : d.modelUrl;
40789
+ const d = this.options.models.genre, h = Ai(d) ? d.classifier : d.modelUrl;
40751
40790
  let m;
40752
- Mi(d) && d.classifierType ? m = d.classifierType : fr(d) && d.genreType ? m = d.genreType : m = dv(h);
40791
+ Ai(d) && d.classifierType ? m = d.classifierType : fr(d) && d.genreType ? m = d.genreType : m = dv(h);
40753
40792
  const f = hv(m);
40754
40793
  u.genres = await this.runModelPrediction(
40755
40794
  d,
@@ -40942,29 +40981,29 @@ class I0 {
40942
40981
  if (m.length === 0)
40943
40982
  throw new Error("Could not discover model input names");
40944
40983
  const f = {};
40945
- for (const S of m)
40946
- S.includes("melspectrogram") || S.includes("mel") || S.includes("spectrogram") ? f[S] = h : S.includes("saver") || S.includes("filename") ? f[S] = Ee.scalar("") : f[S] = h;
40984
+ for (const _ of m)
40985
+ _.includes("melspectrogram") || _.includes("mel") || _.includes("spectrogram") ? f[_] = h : _.includes("saver") || _.includes("filename") ? f[_] = Ee.scalar("") : f[_] = h;
40947
40986
  const g = e.execute(f);
40948
40987
  let p;
40949
40988
  if (Array.isArray(g) ? p = g[0] : g && typeof g == "object" && !("data" in g) ? p = Object.values(g)[0] : p = g, !p || typeof p.data != "function")
40950
40989
  throw new Error("Model execution did not return a valid tensor");
40951
40990
  const y = await p.data(), v = p.shape;
40952
40991
  if (v.length === 2) {
40953
- const S = v[1], T = [];
40954
- for (let D = 0; D < S; D++) {
40992
+ const _ = v[1], T = [];
40993
+ for (let D = 0; D < _; D++) {
40955
40994
  let R = 0;
40956
40995
  for (let q = 0; q < a; q++)
40957
- R += y[q * S + D];
40996
+ R += y[q * _ + D];
40958
40997
  T.push(R / a);
40959
40998
  }
40960
- const _ = Math.sqrt(T.reduce((D, R) => D + R * R, 0)), I = _ > 0 ? T.map((D) => D / _) : T;
40999
+ const S = Math.sqrt(T.reduce((D, R) => D + R * R, 0)), I = S > 0 ? T.map((D) => D / S) : T;
40961
41000
  c.push(I);
40962
41001
  } else {
40963
- const S = Array.from(y.slice(0, v[v.length - 1])), T = Math.sqrt(S.reduce((I, D) => I + D * D, 0)), _ = T > 0 ? S.map((I) => I / T) : S;
40964
- c.push(_);
41002
+ const _ = Array.from(y.slice(0, v[v.length - 1])), T = Math.sqrt(_.reduce((I, D) => I + D * D, 0)), S = T > 0 ? _.map((I) => I / T) : _;
41003
+ c.push(S);
40965
41004
  }
40966
41005
  p.dispose();
40967
- for (const [S, T] of Object.entries(f))
41006
+ for (const [_, T] of Object.entries(f))
40968
41007
  T !== h && T.dispose();
40969
41008
  } finally {
40970
41009
  h.dispose();
@@ -41016,7 +41055,7 @@ class I0 {
41016
41055
  */
41017
41056
  async runModelPrediction(e, t, i) {
41018
41057
  let n;
41019
- if (Mi(e))
41058
+ if (Ai(e))
41020
41059
  n = await this.predictWithTwoStepModel(e, t);
41021
41060
  else {
41022
41061
  const a = Sn(e.modelUrl, e.modelType), r = this.getFeaturesForArchitecture(t, a);
@@ -41034,7 +41073,7 @@ class I0 {
41034
41073
  if (this.options.enableModelCache) {
41035
41074
  const o = await Ht.getOrFetchEssentiaUrl(e, {
41036
41075
  resolveUrl: this.options.resolveUrl,
41037
- invalidateUrlCache: (c) => Me.invalidateCacheForUrl(c)
41076
+ invalidateUrlCache: (c) => Ae.invalidateCacheForUrl(c)
41038
41077
  });
41039
41078
  i = new this.essentiaModel.TensorflowMusiCNN(Ee, o), await i.initialize();
41040
41079
  } else
@@ -41089,7 +41128,7 @@ class D0 {
41089
41128
  try {
41090
41129
  if (!this.context || !this.canvas)
41091
41130
  throw new Error("Canvas not supported in this environment");
41092
- const t = await Me.resolveUrl(e), i = await this.loadImage(t);
41131
+ const t = await Ae.resolveUrl(e), i = await this.loadImage(t);
41093
41132
  this.context.drawImage(i, 0, 0, 100, 100);
41094
41133
  const n = this.context.getImageData(0, 0, 100, 100), a = this.getPixels(n);
41095
41134
  if (a.length === 0)
@@ -41319,19 +41358,19 @@ class Xt {
41319
41358
  t.beatSubdivisions.has(g) && r++, i.add(p);
41320
41359
  const y = Dr(p);
41321
41360
  n = Math.max(n, y);
41322
- const v = e.beats[g], S = g < e.beats.length - 1 ? e.beats[g + 1] : null, T = e.detectedBeatIndices.includes(g);
41361
+ const v = e.beats[g], _ = g < e.beats.length - 1 ? e.beats[g + 1] : null, T = e.detectedBeatIndices.includes(g);
41323
41362
  if (p === "rest" || p === "half" && v.beatInMeasure % 2 !== 0)
41324
41363
  continue;
41325
- const _ = p === "dotted4" && v.beatInMeasure % 2 !== 0;
41326
- if (p === "offbeat8" || p === "triplet4" && o(g) === 1 || _ || c.push({
41364
+ const S = p === "dotted4" && v.beatInMeasure % 2 !== 0;
41365
+ if (p === "offbeat8" || p === "triplet4" && o(g) === 1 || S || c.push({
41327
41366
  ...v,
41328
41367
  isDetected: T,
41329
41368
  originalBeatIndex: g,
41330
41369
  subdivisionType: p
41331
- }), S) {
41370
+ }), _) {
41332
41371
  const D = this.createInterpolatedBeatsForSubdivision(
41333
41372
  v,
41334
- S,
41373
+ _,
41335
41374
  g,
41336
41375
  p,
41337
41376
  e,
@@ -41982,7 +42021,7 @@ class E0 {
41982
42021
  * @returns Pocket window size in seconds
41983
42022
  */
41984
42023
  calculatePocketWindow(e) {
41985
- const i = kl(this.hotness) / 1e3, n = 120 / e;
42024
+ const i = Ml(this.hotness) / 1e3, n = 120 / e;
41986
42025
  return i * n;
41987
42026
  }
41988
42027
  /**
@@ -42158,7 +42197,7 @@ class L0 {
42158
42197
  pendingMeasureNumber: null,
42159
42198
  transitionTimestamp: null,
42160
42199
  scheduledBeats: /* @__PURE__ */ new Map(),
42161
- thresholds: An("medium")
42200
+ thresholds: kn("medium")
42162
42201
  }, this.subscribers = /* @__PURE__ */ new Set(), this.regenerateBeats(), we.debug("SubdivisionPlaybackController initialized", {
42163
42202
  audioId: e.audioId,
42164
42203
  duration: e.duration,
@@ -42231,7 +42270,7 @@ class L0 {
42231
42270
  * ```
42232
42271
  */
42233
42272
  setSubdivision(e) {
42234
- if (!kn(e))
42273
+ if (!Mn(e))
42235
42274
  throw new Error(`Invalid subdivision type: ${e}`);
42236
42275
  if (this.state.currentSubdivision === e)
42237
42276
  return;
@@ -43300,7 +43339,7 @@ class je {
43300
43339
  * @returns Array of ClassFeature objects gained at this level
43301
43340
  */
43302
43341
  static getClassFeaturesForLevel(e, t, i) {
43303
- const n = ke.getInstance(), a = n.getFeaturesForLevel(t, i), r = { ...e, level: i }, o = [];
43342
+ const n = Me.getInstance(), a = n.getFeaturesForLevel(t, i), r = { ...e, level: i }, o = [];
43304
43343
  for (const c of a) {
43305
43344
  const l = n.validatePrerequisites(c, r);
43306
43345
  l.valid ? o.push(c) : (console.warn(
@@ -43758,7 +43797,7 @@ const yr = [4, 8, 12, 16, 19], vr = {
43758
43797
  strategy: "dnD5e",
43759
43798
  autoApply: !0
43760
43799
  };
43761
- class Av {
43800
+ class kv {
43762
43801
  constructor(e) {
43763
43802
  this.config = this.mergeWithDefaults(e), this.strategy = pr(this.config.strategy);
43764
43803
  }
@@ -44304,7 +44343,7 @@ class W0 {
44304
44343
  };
44305
44344
  if (n.xp.current += t, !this.statManager) {
44306
44345
  const d = (n.gameMode || "standard") === "standard" ? "dnD5e" : "dnD5e_smart";
44307
- this.statManager = new Av({ strategy: d }), je.setStatManager(this.statManager);
44346
+ this.statManager = new kv({ strategy: d }), je.setStatManager(this.statManager);
44308
44347
  }
44309
44348
  let a = !1, r;
44310
44349
  const o = [], c = n.gameMode === "uncapped", l = je.calculateLevel(n.xp.current, c);
@@ -45523,7 +45562,7 @@ const jn = {
45523
45562
  tags: ["magic", "enhanced", "+2", "armor"]
45524
45563
  }
45525
45564
  };
45526
- class Mv {
45565
+ class Av {
45527
45566
  /**
45528
45567
  * Open a box and generate its contents
45529
45568
  *
@@ -46110,7 +46149,7 @@ class G0 {
46110
46149
  const o = Y.getInstance().get("equipment").find((d) => d.name === t);
46111
46150
  if (!o || o.type !== "box")
46112
46151
  return null;
46113
- const c = e.equipment.items, l = Mv.openBox(o, i, c);
46152
+ const c = e.equipment.items, l = Av.openBox(o, i, c);
46114
46153
  if (!l.success)
46115
46154
  return { character: e, result: l };
46116
46155
  if (l.consumedItems && l.consumedItems.length > 0)
@@ -46482,7 +46521,7 @@ class br {
46482
46521
  return e >= 7 && e <= 18 && t >= 275 && t <= 290 || e >= 33 && e <= 43 && t >= 124 && t <= 132 || e >= 36 && e <= 47 && t >= 8 && t <= 19 || e >= 36 && e <= 44 && t >= 358 && t <= 360 || e >= 36 && e <= 44 && t >= 0 && t <= 10 || e >= 55 && e <= 71 && t >= 4 && t <= 32 || e >= 24 && e <= 31 && t >= 268 && t <= 272 || e >= 55 && e <= 62 && t >= 210 && t <= 220 || e >= 50 && e <= 62 && t >= 156 && t <= 163;
46483
46522
  }
46484
46523
  }
46485
- class kv {
46524
+ class Mv {
46486
46525
  constructor() {
46487
46526
  this.logger = Se.for("MotionDetector"), this.isListening = !1, this.lastMotion = null, this.motionCallback = null, this.lastProcessedTime = 0, this.minSampleIntervalMs = 83, this.deltaBuffer = [], this.bufferSize = 24, this.confirmedActivity = "unknown", this.candidateActivity = null, this.candidateStartTime = 0, this.confirmationMs = 1500, this.handleMotion = (e) => {
46488
46527
  if (!this.isListening || !this.motionCallback) return;
@@ -47034,8 +47073,8 @@ class Rv {
47034
47073
  const l = this.calculateJulianDate(c), u = this.calculateJulianCentury(l), d = this.calculateSolarDeclination(u), h = this.calculateHourAngle(e, d, o);
47035
47074
  if (isNaN(h))
47036
47075
  return /* @__PURE__ */ new Date(NaN);
47037
- const m = this.calculateEquationOfTime(u), f = (a ? -h : h) / 15, p = 12 - t / 15 - m / 60 + f, y = Math.floor(p), v = Math.floor((p - y) * 60), S = Math.floor(((p - y) * 60 - v) * 60), T = new Date(i);
47038
- return T.setUTCHours(y, v, S, 0), T;
47076
+ const m = this.calculateEquationOfTime(u), f = (a ? -h : h) / 15, p = 12 - t / 15 - m / 60 + f, y = Math.floor(p), v = Math.floor((p - y) * 60), _ = Math.floor(((p - y) * 60 - v) * 60), T = new Date(i);
47077
+ return T.setUTCHours(y, v, _, 0), T;
47039
47078
  }
47040
47079
  /**
47041
47080
  * Calculate current sun position (altitude and azimuth)
@@ -47622,7 +47661,7 @@ class U0 {
47622
47661
  const a = e;
47623
47662
  i = a.weather?.apiKey ?? "", n = a.geolocation, a.retry && (this.retryConfig = { ...this.retryConfig, ...a.retry }), a.xpModifier && (this.xpConfig = { ...this.xpConfig, ...a.xpModifier });
47624
47663
  }
47625
- this.geolocation = n ? new br(n) : new br(), this.motion = new kv(), this.weather = new Rv(i), this.initializeSensorStatuses();
47664
+ this.geolocation = n ? new br(n) : new br(), this.motion = new Mv(), this.weather = new Rv(i), this.initializeSensorStatuses();
47626
47665
  }
47627
47666
  /**
47628
47667
  * Initialize sensor statuses to 'unknown' state
@@ -51297,7 +51336,7 @@ export {
51297
51336
  s0 as ALL_GRID_TYPES,
51298
51337
  wu as ALL_RACES,
51299
51338
  Z0 as ARMOR_ENCHANTMENTS,
51300
- k0 as AVAILABLE_PRESETS,
51339
+ M0 as AVAILABLE_PRESETS,
51301
51340
  pn as AbilityScoreCalculator,
51302
51341
  Us as AbilityScoresSchema,
51303
51342
  pp as AppearanceGenerator,
@@ -51308,8 +51347,8 @@ export {
51308
51347
  zl as BASE_PLAYS_THRESHOLD,
51309
51348
  Wl as BASE_XP_THRESHOLD,
51310
51349
  qv as BEAT_ACCURACY_THRESHOLDS,
51311
- Ml as BEAT_DETECTION_ALGORITHM,
51312
- Al as BEAT_DETECTION_VERSION,
51350
+ Al as BEAT_DETECTION_ALGORITHM,
51351
+ kl as BEAT_DETECTION_VERSION,
51313
51352
  Db as BalanceValidator,
51314
51353
  wv as BalancedStrategy,
51315
51354
  ma as BeatConverter,
@@ -51318,7 +51357,7 @@ export {
51318
51357
  iv as BeatStream,
51319
51358
  Xt as BeatSubdivider,
51320
51359
  Qy as BeatTracker,
51321
- Mv as BoxOpener,
51360
+ Av as BoxOpener,
51322
51361
  bn as ButtonMapper,
51323
51362
  bu as CLASS_AUDIO_PREFERENCES,
51324
51363
  tt as CLASS_DATA,
@@ -51351,7 +51390,7 @@ export {
51351
51390
  Yn as DEFAULT_DOWNBEAT_CONFIG,
51352
51391
  jt as DEFAULT_ENEMY_TEMPLATES,
51353
51392
  Vt as DEFAULT_EQUIPMENT,
51354
- ko as DEFAULT_GATEWAYS,
51393
+ Mo as DEFAULT_GATEWAYS,
51355
51394
  Il as DEFAULT_GROOVE_OPTIONS,
51356
51395
  xg as DEFAULT_IPFS_GATEWAY,
51357
51396
  Lt as DEFAULT_PROGRESSION_CONFIG,
@@ -51390,7 +51429,7 @@ export {
51390
51429
  qi as EssentiaPitchDetector,
51391
51430
  Y as ExtensionManager,
51392
51431
  Bi as FeatureEffectApplier,
51393
- ke as FeatureQuery,
51432
+ Me as FeatureQuery,
51394
51433
  It as FeatureValidator,
51395
51434
  wl as GAUSSIAN_SMOOTH_PRESETS,
51396
51435
  rc as GENRE_PRESETS,
@@ -51436,16 +51475,16 @@ export {
51436
51475
  ja as PRESTIGE_SCALING_FACTOR,
51437
51476
  Wr as PROFICIENCY_BONUS,
51438
51477
  Eb as ParameterSweep,
51439
- A0 as PartyAnalyzer,
51478
+ k0 as PartyAnalyzer,
51440
51479
  Bp as PhraseAnalyzer,
51441
51480
  d0 as PitchAnalyzer,
51442
51481
  dy as PitchBeatLinker,
51443
51482
  Xo as PitchDetector,
51444
- M0 as PlaylistParser,
51483
+ A0 as PlaylistParser,
51445
51484
  Sg as PlaylistTrackSchema,
51446
51485
  Ce as PrestigeSystem,
51447
51486
  Sv as PrimaryOnlyStrategy,
51448
- Mb as RACE_DATA,
51487
+ Ab as RACE_DATA,
51449
51488
  Nr as RARITY_CONFIGS,
51450
51489
  X0 as RESISTANCE_ENCHANTMENTS,
51451
51490
  Zo as RHYTHM_PRESETS,
@@ -51473,14 +51512,14 @@ export {
51473
51512
  tr as SpellManager,
51474
51513
  it as SpellQuery,
51475
51514
  rt as SpellValidator,
51476
- Av as StatManager,
51515
+ kv as StatManager,
51477
51516
  Lp as StreamScorer,
51478
51517
  L0 as SubdivisionPlaybackController,
51479
51518
  Qv as TUNING_FACTORS,
51480
51519
  Rp as TempoAwareQuantizer,
51481
51520
  Xy as TempoDetector,
51482
51521
  Ep as TransientDetector,
51483
- Mn as VALID_SUBDIVISION_TYPES,
51522
+ An as VALID_SUBDIVISION_TYPES,
51484
51523
  Y0 as WEAPON_ENCHANTMENTS,
51485
51524
  Le as WeightedSelector,
51486
51525
  lc as XPCalculator,
@@ -51496,7 +51535,7 @@ export {
51496
51535
  rp as areRaceDefaultsInitialized,
51497
51536
  dp as areSkillDefaultsInitialized,
51498
51537
  np as areSpellDefaultsInitialized,
51499
- Me as arweaveGatewayManager,
51538
+ Ae as arweaveGatewayManager,
51500
51539
  fu as asClass,
51501
51540
  R0 as assignKeyToBeat,
51502
51541
  P0 as assignKeysToBeats,
@@ -51542,7 +51581,7 @@ export {
51542
51581
  Ot as formatModelForMetadata,
51543
51582
  qo as gaussianSmooth,
51544
51583
  Xv as generateSeed,
51545
- An as getAccuracyThresholdsForPreset,
51584
+ kn as getAccuracyThresholdsForPreset,
51546
51585
  nw as getAllCurses,
51547
51586
  iw as getAllEnchantments,
51548
51587
  Yb as getAllGatewayUrls,
@@ -51562,24 +51601,24 @@ export {
51562
51601
  fw as getCursedItems,
51563
51602
  ew as getEnchantment,
51564
51603
  aw as getEnchantmentsByType,
51565
- ki as getEncounterMultiplier,
51604
+ Mi as getEncounterMultiplier,
51566
51605
  Ib as getFeatureQuery,
51567
51606
  Vb as getFullTracks,
51568
- kr as getGaussianSmoothMs,
51607
+ Mr as getGaussianSmoothMs,
51569
51608
  hv as getGenreLabels,
51570
51609
  Wb as getGenres,
51571
51610
  Rl as getGroovePenaltiesForPreset,
51572
51611
  en as getGrooveTier,
51573
- kl as getGrooveWindowMs,
51612
+ Ml as getGrooveWindowMs,
51574
51613
  ob as getHigherRarity,
51575
- Ar as getHopSizeMs,
51614
+ kr as getHopSizeMs,
51576
51615
  Ob as getImageUrls,
51577
51616
  gw as getItemsWithProperty,
51578
51617
  $0 as getKeyCount,
51579
51618
  dw as getMagicItem,
51580
51619
  mw as getMagicItemsByRarity,
51581
51620
  hw as getMagicItemsByType,
51582
- Mr as getMelBands,
51621
+ Ar as getMelBands,
51583
51622
  Up as getMetricGroupSize,
51584
51623
  Vv as getMinHotnessForTier,
51585
51624
  v0 as getPatternById,
@@ -51590,14 +51629,14 @@ export {
51590
51629
  p0 as getPatternsByKeyCount,
51591
51630
  g0 as getPatternsByTags,
51592
51631
  Xn as getRaceData,
51593
- kb as getRaceDataAsync,
51632
+ Mb as getRaceDataAsync,
51594
51633
  y0 as getRandomPattern,
51595
51634
  wt as getRarityConfig,
51596
51635
  l0 as getRhythmPreset,
51597
51636
  u0 as getRhythmPresetNames,
51598
51637
  rb as getSignatureDie,
51599
51638
  _b as getSkillQuery,
51600
- Ab as getSpellQuery,
51639
+ kb as getSpellQuery,
51601
51640
  Hr as getSpellSlotsForClass,
51602
51641
  Dr as getSubdivisionDensity,
51603
51642
  Hb as getTags,
@@ -51641,7 +51680,7 @@ export {
51641
51680
  Yv as isPrestigeLevel,
51642
51681
  fr as isSingleStepModel,
51643
51682
  Yp as isStrongBeatForEmphasis,
51644
- Mi as isTwoStepModel,
51683
+ Ai as isTwoStepModel,
51645
51684
  Zv as isValidAIPlayStyle,
51646
51685
  Xa as isValidClass,
51647
51686
  C0 as isValidEncounterDifficulty,
@@ -51649,7 +51688,7 @@ export {
51649
51688
  T0 as isValidEnemyArchetype,
51650
51689
  S0 as isValidEnemyCategory,
51651
51690
  _0 as isValidEnemyRarity,
51652
- kn as isValidSubdivisionType,
51691
+ Mn as isValidSubdivisionType,
51653
51692
  Lv as loadConfigFromEnv,
51654
51693
  Nl as mapGridToSubdivision,
51655
51694
  vp as melToHz,