@makefully/fancifully 0.5.0 → 0.5.1

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.
@@ -199,13 +199,13 @@ function Or(s, e) {
199
199
  s.removeEventListener("pointerdown", n), s.removeEventListener("pointerup", a), s.removeEventListener("pointercancel", o);
200
200
  };
201
201
  }
202
- function Vr(s) {
202
+ function Br(s) {
203
203
  var t;
204
204
  const e = ((t = s.split(".").pop()) == null ? void 0 : t.toLowerCase()) ?? "";
205
205
  return /^[a-z0-9]{1,8}$/.test(e) ? e : "";
206
206
  }
207
207
  function rr(s) {
208
- const e = Vr(s.name), t = (s.type || "").toLowerCase();
208
+ const e = Br(s.name), t = (s.type || "").toLowerCase();
209
209
  return e === "fanci" || t === "application/x-fanci" || t === "application/fanci";
210
210
  }
211
211
  function Sa(s) {
@@ -440,9 +440,9 @@ const Jt = (s, e) => {
440
440
  }
441
441
  return { message: t };
442
442
  };
443
- let Br = Jt;
443
+ let Vr = Jt;
444
444
  function Fr() {
445
- return Br;
445
+ return Vr;
446
446
  }
447
447
  const zr = (s) => {
448
448
  const { data: e, path: t, errorMaps: r, issueData: i } = s, n = [...t, ...i.path || []], a = {
@@ -526,7 +526,7 @@ class ee {
526
526
  }
527
527
  const T = Object.freeze({
528
528
  status: "aborted"
529
- }), Xe = (s) => ({ status: "dirty", value: s }), oe = (s) => ({ status: "valid", value: s }), As = (s) => s.status === "aborted", Ts = (s) => s.status === "dirty", je = (s) => s.status === "valid", xt = (s) => typeof Promise < "u" && s instanceof Promise;
529
+ }), Xe = (s) => ({ status: "dirty", value: s }), le = (s) => ({ status: "valid", value: s }), As = (s) => s.status === "aborted", Ts = (s) => s.status === "dirty", je = (s) => s.status === "valid", xt = (s) => typeof Promise < "u" && s instanceof Promise;
530
530
  var _;
531
531
  (function(s) {
532
532
  s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
@@ -1522,7 +1522,7 @@ class Xt extends I {
1522
1522
  received: r.parsedType
1523
1523
  }), T;
1524
1524
  }
1525
- return oe(e.data);
1525
+ return le(e.data);
1526
1526
  }
1527
1527
  }
1528
1528
  Xt.create = (s) => new Xt({
@@ -1618,7 +1618,7 @@ class Es extends I {
1618
1618
  received: r.parsedType
1619
1619
  }), T;
1620
1620
  }
1621
- return oe(e.data);
1621
+ return le(e.data);
1622
1622
  }
1623
1623
  }
1624
1624
  Es.create = (s) => new Es({
@@ -1635,7 +1635,7 @@ class Kt extends I {
1635
1635
  received: r.parsedType
1636
1636
  }), T;
1637
1637
  }
1638
- return oe(e.data);
1638
+ return le(e.data);
1639
1639
  }
1640
1640
  }
1641
1641
  Kt.create = (s) => new Kt({
@@ -1652,7 +1652,7 @@ class Qt extends I {
1652
1652
  received: r.parsedType
1653
1653
  }), T;
1654
1654
  }
1655
- return oe(e.data);
1655
+ return le(e.data);
1656
1656
  }
1657
1657
  }
1658
1658
  Qt.create = (s) => new Qt({
@@ -1664,7 +1664,7 @@ class Ms extends I {
1664
1664
  super(...arguments), this._any = !0;
1665
1665
  }
1666
1666
  _parse(e) {
1667
- return oe(e.data);
1667
+ return le(e.data);
1668
1668
  }
1669
1669
  }
1670
1670
  Ms.create = (s) => new Ms({
@@ -1676,7 +1676,7 @@ class es extends I {
1676
1676
  super(...arguments), this._unknown = !0;
1677
1677
  }
1678
1678
  _parse(e) {
1679
- return oe(e.data);
1679
+ return le(e.data);
1680
1680
  }
1681
1681
  }
1682
1682
  es.create = (s) => new es({
@@ -1707,7 +1707,7 @@ class Ps extends I {
1707
1707
  received: r.parsedType
1708
1708
  }), T;
1709
1709
  }
1710
- return oe(e.data);
1710
+ return le(e.data);
1711
1711
  }
1712
1712
  }
1713
1713
  Ps.create = (s) => new Ps({
@@ -1787,12 +1787,12 @@ ge.create = (s, e) => new ge({
1787
1787
  typeName: L.ZodArray,
1788
1788
  ...M(e)
1789
1789
  });
1790
- function Ve(s) {
1790
+ function Be(s) {
1791
1791
  if (s instanceof G) {
1792
1792
  const e = {};
1793
1793
  for (const t in s.shape) {
1794
1794
  const r = s.shape[t];
1795
- e[t] = Se.create(Ve(r));
1795
+ e[t] = Se.create(Be(r));
1796
1796
  }
1797
1797
  return new G({
1798
1798
  ...s._def,
@@ -1800,8 +1800,8 @@ function Ve(s) {
1800
1800
  });
1801
1801
  } else return s instanceof ge ? new ge({
1802
1802
  ...s._def,
1803
- type: Ve(s.element)
1804
- }) : s instanceof Se ? Se.create(Ve(s.unwrap())) : s instanceof Ie ? Ie.create(Ve(s.unwrap())) : s instanceof Me ? Me.create(s.items.map((e) => Ve(e))) : s;
1803
+ type: Be(s.element)
1804
+ }) : s instanceof Se ? Se.create(Be(s.unwrap())) : s instanceof Ie ? Ie.create(Be(s.unwrap())) : s instanceof Me ? Me.create(s.items.map((e) => Be(e))) : s;
1805
1805
  }
1806
1806
  class G extends I {
1807
1807
  constructor() {
@@ -2037,7 +2037,7 @@ class G extends I {
2037
2037
  * @deprecated
2038
2038
  */
2039
2039
  deepPartial() {
2040
- return Ve(this);
2040
+ return Be(this);
2041
2041
  }
2042
2042
  partial(e) {
2043
2043
  const t = {};
@@ -2554,7 +2554,7 @@ class Pe extends I {
2554
2554
  options: r
2555
2555
  }), T;
2556
2556
  }
2557
- return oe(e.data);
2557
+ return le(e.data);
2558
2558
  }
2559
2559
  get options() {
2560
2560
  return this._def.values;
@@ -2610,7 +2610,7 @@ class rs extends I {
2610
2610
  options: i
2611
2611
  }), T;
2612
2612
  }
2613
- return oe(e.data);
2613
+ return le(e.data);
2614
2614
  }
2615
2615
  get enum() {
2616
2616
  return this._def.values;
@@ -2634,7 +2634,7 @@ class Lt extends I {
2634
2634
  received: t.parsedType
2635
2635
  }), T;
2636
2636
  const r = t.parsedType === S.promise ? t.data : Promise.resolve(t.data);
2637
- return oe(r.then((i) => this._def.type.parseAsync(i, {
2637
+ return le(r.then((i) => this._def.type.parseAsync(i, {
2638
2638
  path: t.path,
2639
2639
  errorMap: t.common.contextualErrorMap
2640
2640
  })));
@@ -2739,7 +2739,7 @@ Ne.createWithPreprocess = (s, e, t) => new Ne({
2739
2739
  });
2740
2740
  class Se extends I {
2741
2741
  _parse(e) {
2742
- return this._getType(e) === S.undefined ? oe(void 0) : this._def.innerType._parse(e);
2742
+ return this._getType(e) === S.undefined ? le(void 0) : this._def.innerType._parse(e);
2743
2743
  }
2744
2744
  unwrap() {
2745
2745
  return this._def.innerType;
@@ -2752,7 +2752,7 @@ Se.create = (s, e) => new Se({
2752
2752
  });
2753
2753
  class Ie extends I {
2754
2754
  _parse(e) {
2755
- return this._getType(e) === S.null ? oe(null) : this._def.innerType._parse(e);
2755
+ return this._getType(e) === S.null ? le(null) : this._def.innerType._parse(e);
2756
2756
  }
2757
2757
  unwrap() {
2758
2758
  return this._def.innerType;
@@ -2916,14 +2916,14 @@ var L;
2916
2916
  })(L || (L = {}));
2917
2917
  const N = we.create, Q = Ze.create, wt = Xt.create, ci = es.create;
2918
2918
  Le.create;
2919
- const Ue = ge.create, B = G.create, lt = _t.create, lr = gs.create;
2919
+ const Ue = ge.create, V = G.create, lt = _t.create, lr = gs.create;
2920
2920
  Ct.create;
2921
2921
  Me.create;
2922
2922
  const cr = At.create, Te = Tt.create, et = Pe.create;
2923
2923
  Lt.create;
2924
2924
  Se.create;
2925
2925
  Ie.create;
2926
- const ft = lt([Q(), N()]), It = B({
2926
+ const ft = lt([Q(), N()]), It = V({
2927
2927
  x: ft.optional().default(0),
2928
2928
  y: ft.optional().default(0),
2929
2929
  width: ft.optional(),
@@ -2931,46 +2931,46 @@ const ft = lt([Q(), N()]), It = B({
2931
2931
  fit: et(["contain", "cover", "fill", "none"]).optional(),
2932
2932
  horizontalAlign: et(["left", "center", "right"]).optional(),
2933
2933
  verticalAlign: et(["top", "center", "bottom"]).optional()
2934
- }), di = B({
2934
+ }), di = V({
2935
2935
  id: N(),
2936
2936
  start: Q(),
2937
2937
  end: Q(),
2938
2938
  text: N().optional()
2939
2939
  }), hi = lr("type", [
2940
- B({
2940
+ V({
2941
2941
  type: Te("image"),
2942
2942
  src: N()
2943
2943
  }),
2944
- B({
2944
+ V({
2945
2945
  type: Te("audio"),
2946
2946
  src: N(),
2947
2947
  channel: et(["vo", "sfx", "music"]).optional().default("vo")
2948
2948
  }),
2949
- B({
2949
+ V({
2950
2950
  type: Te("vtt"),
2951
2951
  src: N()
2952
2952
  }),
2953
- B({
2953
+ V({
2954
2954
  type: Te("html"),
2955
2955
  src: N()
2956
2956
  })
2957
- ]), pt = B({
2957
+ ]), pt = V({
2958
2958
  target: N(),
2959
2959
  className: N()
2960
2960
  }), $s = lt([
2961
- B({ play: N() }),
2962
- B({ toggleClass: pt }),
2963
- B({ addClass: pt }),
2964
- B({ removeClass: pt }),
2961
+ V({ play: N() }),
2962
+ V({ toggleClass: pt }),
2963
+ V({ addClass: pt }),
2964
+ V({ removeClass: pt }),
2965
2965
  /** Remove then re-add on the next frame so CSS bursts can fire every tap. */
2966
- B({ replayClass: pt })
2967
- ]), ui = B({
2966
+ V({ replayClass: pt })
2967
+ ]), ui = V({
2968
2968
  id: N(),
2969
2969
  type: Te("text"),
2970
2970
  layout: It.optional().default({}),
2971
2971
  html: N().optional(),
2972
2972
  htmlSrc: N().optional(),
2973
- style: B({
2973
+ style: V({
2974
2974
  fontFamily: N().optional(),
2975
2975
  fontSize: N().optional(),
2976
2976
  color: N().optional(),
@@ -2981,13 +2981,13 @@ const ft = lt([Q(), N()]), It = B({
2981
2981
  /** Set only when a real italic face of this family is embedded. */
2982
2982
  fontStyle: N().optional()
2983
2983
  }).optional()
2984
- }), fi = B({
2984
+ }), fi = V({
2985
2985
  id: N(),
2986
2986
  type: Te("image"),
2987
2987
  asset: N(),
2988
2988
  layout: It.optional().default({}),
2989
2989
  className: N().optional()
2990
- }), pi = B({
2990
+ }), pi = V({
2991
2991
  id: N(),
2992
2992
  type: Te("hotspot"),
2993
2993
  layout: It.optional().default({}),
@@ -2999,7 +2999,7 @@ const ft = lt([Q(), N()]), It = B({
2999
2999
  requiredTaps: Q().int().positive().optional(),
3000
3000
  onComplete: Ue($s).optional().default([]),
3001
3001
  ariaLabel: N().optional()
3002
- }), gi = B({
3002
+ }), gi = V({
3003
3003
  id: N(),
3004
3004
  type: Te("area"),
3005
3005
  layout: It.optional().default({}),
@@ -3014,9 +3014,9 @@ const ft = lt([Q(), N()]), It = B({
3014
3014
  fi,
3015
3015
  pi,
3016
3016
  gi
3017
- ]), yi = B({
3017
+ ]), yi = V({
3018
3018
  id: N(),
3019
- background: B({
3019
+ background: V({
3020
3020
  asset: N().optional(),
3021
3021
  color: N().optional(),
3022
3022
  /**
@@ -3025,15 +3025,15 @@ const ft = lt([Q(), N()]), It = B({
3025
3025
  */
3026
3026
  innerColor: N().optional()
3027
3027
  }).optional(),
3028
- readAloud: B({
3028
+ readAloud: V({
3029
3029
  audio: N(),
3030
3030
  cues: lt([N(), Ue(di)]).optional()
3031
3031
  }).optional(),
3032
3032
  blocks: Ue(mi).optional().default([])
3033
- }), vi = B({
3033
+ }), vi = V({
3034
3034
  id: N(),
3035
3035
  title: N().optional(),
3036
- pageSize: B({
3036
+ pageSize: V({
3037
3037
  width: Q().positive(),
3038
3038
  height: Q().positive()
3039
3039
  }),
@@ -3057,7 +3057,7 @@ const ft = lt([Q(), N()]), It = B({
3057
3057
  * Closed cover board size. When hardback is on, the rim is
3058
3058
  * `(coverSize - pageSize) / 2` on each edge. Omitted boards use the default overhang.
3059
3059
  */
3060
- coverSize: B({
3060
+ coverSize: V({
3061
3061
  width: Q().positive(),
3062
3062
  height: Q().positive()
3063
3063
  }).optional(),
@@ -3065,7 +3065,7 @@ const ft = lt([Q(), N()]), It = B({
3065
3065
  * Editor alignment rails (margins / gutter). The player ignores these.
3066
3066
  * Show/snap toggles are editor prefs, not story fields.
3067
3067
  */
3068
- guides: B({
3068
+ guides: V({
3069
3069
  marginTop: Q().nonnegative().default(48),
3070
3070
  marginRight: Q().nonnegative().default(48),
3071
3071
  marginBottom: Q().nonnegative().default(48),
@@ -3074,7 +3074,7 @@ const ft = lt([Q(), N()]), It = B({
3074
3074
  gutterBand: Q().nonnegative().default(8)
3075
3075
  }).optional(),
3076
3076
  fonts: Ue(
3077
- B({
3077
+ V({
3078
3078
  family: N(),
3079
3079
  src: N(),
3080
3080
  weight: lt([N(), Q()]).optional(),
@@ -3236,7 +3236,7 @@ var W = Uint8Array, re = Uint16Array, ys = Int32Array, $t = new W([
3236
3236
  return { b: t, r: i };
3237
3237
  }, hr = dr($t, 2), ur = hr.b, as = hr.r;
3238
3238
  ur[28] = 258, as[258] = 28;
3239
- var fr = dr(Rt, 0), ki = fr.b, Vs = fr.r, os = new re(32768);
3239
+ var fr = dr(Rt, 0), ki = fr.b, Bs = fr.r, os = new re(32768);
3240
3240
  for (var F = 0; F < 32768; ++F) {
3241
3241
  var Ce = (F & 43690) >> 1 | (F & 21845) << 1;
3242
3242
  Ce = (Ce & 52428) >> 2 | (Ce & 13107) << 2, Ce = (Ce & 61680) >> 4 | (Ce & 3855) << 4, os[F] = ((Ce & 65280) >> 8 | (Ce & 255) << 8) >> 1;
@@ -3275,7 +3275,7 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3275
3275
  for (var e = s[0], t = 1; t < s.length; ++t)
3276
3276
  s[t] > e && (e = s[t]);
3277
3277
  return e;
3278
- }, le = function(s, e, t) {
3278
+ }, ce = function(s, e, t) {
3279
3279
  var r = e / 8 | 0;
3280
3280
  return (s[r] | s[r + 1] << 8) >> (e & 7) & t;
3281
3281
  }, Ut = function(s, e) {
@@ -3322,26 +3322,26 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3322
3322
  }, h = e.f || 0, c = e.p || 0, u = e.b || 0, v = e.l, k = e.d, b = e.m, f = e.n, m = i * 8;
3323
3323
  do {
3324
3324
  if (!v) {
3325
- h = le(s, c, 1);
3326
- var C = le(s, c + 1, 3);
3325
+ h = ce(s, c, 1);
3326
+ var C = ce(s, c + 1, 3);
3327
3327
  if (c += 3, C)
3328
3328
  if (C == 1)
3329
3329
  v = xi, k = _i, b = 9, f = 5;
3330
3330
  else if (C == 2) {
3331
- var O = le(s, c, 31) + 257, A = le(s, c + 10, 15) + 4, P = O + le(s, c + 5, 31) + 1;
3331
+ var O = ce(s, c, 31) + 257, A = ce(s, c + 10, 15) + 4, P = O + ce(s, c + 5, 31) + 1;
3332
3332
  c += 14;
3333
3333
  for (var E = new W(P), H = new W(19), Z = 0; Z < A; ++Z)
3334
- H[ns[Z]] = le(s, c + Z * 3, 7);
3334
+ H[ns[Z]] = ce(s, c + Z * 3, 7);
3335
3335
  c += A * 3;
3336
- for (var q = Zt(H), ie = (1 << q) - 1, V = me(H, q, 1), Z = 0; Z < P; ) {
3337
- var j = V[le(s, c, ie)];
3336
+ for (var q = Zt(H), ie = (1 << q) - 1, B = me(H, q, 1), Z = 0; Z < P; ) {
3337
+ var j = B[ce(s, c, ie)];
3338
3338
  c += j & 15;
3339
3339
  var p = j >> 4;
3340
3340
  if (p < 16)
3341
3341
  E[Z++] = p;
3342
3342
  else {
3343
3343
  var D = 0, z = 0;
3344
- for (p == 16 ? (z = 3 + le(s, c, 3), c += 2, D = E[Z - 1]) : p == 17 ? (z = 3 + le(s, c, 7), c += 3) : p == 18 && (z = 11 + le(s, c, 127), c += 7); z--; )
3344
+ for (p == 16 ? (z = 3 + ce(s, c, 3), c += 2, D = E[Z - 1]) : p == 17 ? (z = 3 + ce(s, c, 7), c += 3) : p == 18 && (z = 11 + ce(s, c, 127), c += 7); z--; )
3345
3345
  E[Z++] = D;
3346
3346
  }
3347
3347
  }
@@ -3379,7 +3379,7 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3379
3379
  var se = te - 254;
3380
3380
  if (te > 264) {
3381
3381
  var Z = te - 257, U = $t[Z];
3382
- se = le(s, c, (1 << U) - 1) + ur[Z], c += U;
3382
+ se = ce(s, c, (1 << U) - 1) + ur[Z], c += U;
3383
3383
  }
3384
3384
  var de = k[Ut(s, c) & ne], $e = de >> 4;
3385
3385
  de || K(3), c += de & 15;
@@ -3457,7 +3457,7 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3457
3457
  return { t: new W(v), l: k };
3458
3458
  }, ls = function(s, e, t) {
3459
3459
  return s.s == -1 ? Math.max(ls(s.l, e, t + 1), ls(s.r, e, t + 1)) : e[s.s] = t;
3460
- }, Bs = function(s) {
3460
+ }, Vs = function(s) {
3461
3461
  for (var e = s.length; e && !s[--e]; )
3462
3462
  ;
3463
3463
  for (var t = new re(++e), r = 0, i = s[0], n = 1, a = function(l) {
@@ -3492,17 +3492,17 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3492
3492
  return (i + 4 + r) * 8;
3493
3493
  }, Fs = function(s, e, t, r, i, n, a, o, l, d, h) {
3494
3494
  be(e, h++, t), ++i[256];
3495
- for (var c = Ht(i, 15), u = c.t, v = c.l, k = Ht(n, 15), b = k.t, f = k.l, m = Bs(u), C = m.c, p = m.n, x = Bs(b), R = x.c, O = x.n, A = new re(19), P = 0; P < C.length; ++P)
3495
+ for (var c = Ht(i, 15), u = c.t, v = c.l, k = Ht(n, 15), b = k.t, f = k.l, m = Vs(u), C = m.c, p = m.n, x = Vs(b), R = x.c, O = x.n, A = new re(19), P = 0; P < C.length; ++P)
3496
3496
  ++A[C[P] & 31];
3497
3497
  for (var P = 0; P < R.length; ++P)
3498
3498
  ++A[R[P] & 31];
3499
3499
  for (var E = Ht(A, 7), H = E.t, Z = E.l, q = 19; q > 4 && !H[ns[q - 1]]; --q)
3500
3500
  ;
3501
- var ie = d + 5 << 3, V = Ge(i, Ee) + Ge(n, nt) + a, j = Ge(i, u) + Ge(n, b) + a + 14 + 3 * q + Ge(A, H) + 2 * A[16] + 3 * A[17] + 7 * A[18];
3502
- if (l >= 0 && ie <= V && ie <= j)
3501
+ var ie = d + 5 << 3, B = Ge(i, Ee) + Ge(n, nt) + a, j = Ge(i, u) + Ge(n, b) + a + 14 + 3 * q + Ge(A, H) + 2 * A[16] + 3 * A[17] + 7 * A[18];
3502
+ if (l >= 0 && ie <= B && ie <= j)
3503
3503
  return pr(e, h, s.subarray(l, l + d));
3504
3504
  var D, z, Y, J;
3505
- if (be(e, h, 1 + (j < V)), h += 2, j < V) {
3505
+ if (be(e, h, 1 + (j < B)), h += 2, j < B) {
3506
3506
  D = me(u, v, 0), z = u, Y = me(b, f, 0), J = b;
3507
3507
  var He = me(H, Z, 0);
3508
3508
  be(e, h, p - 257), be(e, h + 5, O - 1), be(e, h + 10, q - 4), h += 14;
@@ -3534,8 +3534,8 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3534
3534
  for (var c = Ti[e - 1], u = c >> 13, v = c & 8191, k = (1 << t) - 1, b = n.p || new re(32768), f = n.h || new re(k + 1), m = Math.ceil(t / 3), C = 2 * m, p = function(Ft) {
3535
3535
  return (s[Ft] ^ s[Ft + 1] << m ^ s[Ft + 2] << C) & k;
3536
3536
  }, x = new ys(25e3), R = new re(288), O = new re(32), A = 0, P = 0, E = n.i || 0, H = 0, Z = n.w || 0, q = 0; E + 2 < a; ++E) {
3537
- var ie = p(E), V = E & 32767, j = f[ie];
3538
- if (b[V] = j, f[ie] = V, Z <= E) {
3537
+ var ie = p(E), B = E & 32767, j = f[ie];
3538
+ if (b[B] = j, f[ie] = B, Z <= E) {
3539
3539
  var D = a - E;
3540
3540
  if ((A > 7e3 || H > 24576) && (D > 423 || !d)) {
3541
3541
  h = Fs(s, l, 0, x, R, O, P, H, q, E - q, h), H = A = P = 0, q = E;
@@ -3544,9 +3544,9 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3544
3544
  for (var z = 0; z < 30; ++z)
3545
3545
  O[z] = 0;
3546
3546
  }
3547
- var Y = 2, J = 0, He = v, ne = V - j & 32767;
3547
+ var Y = 2, J = 0, He = v, ne = B - j & 32767;
3548
3548
  if (D > 2 && ie == p(E - ne))
3549
- for (var ve = Math.min(u, D) - 1, te = Math.min(32767, E), se = Math.min(258, D); ne <= te && --He && V != j; ) {
3549
+ for (var ve = Math.min(u, D) - 1, te = Math.min(32767, E), se = Math.min(258, D); ne <= te && --He && B != j; ) {
3550
3550
  if (s[E + Y] == s[E + Y - ne]) {
3551
3551
  for (var U = 0; U < se && s[E + U] == s[E + U - ne]; ++U)
3552
3552
  ;
@@ -3559,11 +3559,11 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3559
3559
  }
3560
3560
  }
3561
3561
  }
3562
- V = j, j = b[V], ne += V - j & 32767;
3562
+ B = j, j = b[B], ne += B - j & 32767;
3563
3563
  }
3564
3564
  if (J) {
3565
- x[H++] = 268435456 | as[Y] << 18 | Vs[J];
3566
- var De = as[Y] & 31, We = Vs[J] & 31;
3565
+ x[H++] = 268435456 | as[Y] << 18 | Bs[J];
3566
+ var De = as[Y] & 31, We = Bs[J] & 31;
3567
3567
  P += $t[De] + Rt[We], ++R[257 + De], ++O[We], Z = E + Y, ++A;
3568
3568
  } else
3569
3569
  x[H++] = s[E], ++R[s[E]];
@@ -3614,10 +3614,10 @@ var wi = /* @__PURE__ */ me(Ee, 9, 0), xi = /* @__PURE__ */ me(Ee, 9, 1), Si = /
3614
3614
  return t;
3615
3615
  }, ue = function(s, e) {
3616
3616
  return s[e] | s[e + 1] << 8;
3617
- }, ae = function(s, e) {
3617
+ }, oe = function(s, e) {
3618
3618
  return (s[e] | s[e + 1] << 8 | s[e + 2] << 16 | s[e + 3] << 24) >>> 0;
3619
3619
  }, Dt = function(s, e) {
3620
- return ae(s, e) + ae(s, e + 4) * 4294967296;
3620
+ return oe(s, e) + oe(s, e + 4) * 4294967296;
3621
3621
  }, X = function(s, e, t) {
3622
3622
  for (; t; ++e)
3623
3623
  s[e] = t, t >>>= 8;
@@ -3676,10 +3676,10 @@ function vr(s, e) {
3676
3676
  }
3677
3677
  var Oi = function(s, e) {
3678
3678
  return e + 30 + ue(s, e + 26) + ue(s, e + 28);
3679
- }, Vi = function(s, e, t) {
3680
- var r = ue(s, e + 28), i = ue(s, e + 30), n = vr(s.subarray(e + 46, e + 46 + r), !(ue(s, e + 8) & 2048)), a = e + 46 + r, o = Bi(s, a, i, t, ae(s, e + 20), ae(s, e + 24), ae(s, e + 42)), l = o[0], d = o[1], h = o[2];
3679
+ }, Bi = function(s, e, t) {
3680
+ var r = ue(s, e + 28), i = ue(s, e + 30), n = vr(s.subarray(e + 46, e + 46 + r), !(ue(s, e + 8) & 2048)), a = e + 46 + r, o = Vi(s, a, i, t, oe(s, e + 20), oe(s, e + 24), oe(s, e + 42)), l = o[0], d = o[1], h = o[2];
3681
3681
  return [ue(s, e + 10), l, d, n, a + i + ue(s, e + 32), h];
3682
- }, Bi = function(s, e, t, r, i, n, a) {
3682
+ }, Vi = function(s, e, t, r, i, n, a) {
3683
3683
  var o = i == 4294967295, l = n == 4294967295, d = a == 4294967295, h = e + t, c = o + l + d;
3684
3684
  if (r && c) {
3685
3685
  for (; e + 4 < h; e += 4 + ue(s, e + 2))
@@ -3743,18 +3743,18 @@ function zi(s, e) {
3743
3743
  return Fi(x, i, r.length, O, R), x;
3744
3744
  }
3745
3745
  function ji(s, e) {
3746
- for (var t = {}, r = s.length - 22; ae(s, r) != 101010256; --r)
3746
+ for (var t = {}, r = s.length - 22; oe(s, r) != 101010256; --r)
3747
3747
  (!r || s.length - r > 65558) && K(13);
3748
3748
  var i = ue(s, r + 8);
3749
3749
  if (!i)
3750
3750
  return {};
3751
- var n = ae(s, r + 16), a = ae(s, r - 20) == 117853008;
3751
+ var n = oe(s, r + 16), a = oe(s, r - 20) == 117853008;
3752
3752
  if (a) {
3753
- var o = ae(s, r - 12);
3754
- a = ae(s, o) == 101075792, a && (i = ae(s, o + 32), n = ae(s, o + 48));
3753
+ var o = oe(s, r - 12);
3754
+ a = oe(s, o) == 101075792, a && (i = oe(s, o + 32), n = oe(s, o + 48));
3755
3755
  }
3756
3756
  for (var l = 0; l < i; ++l) {
3757
- var d = Vi(s, n, a), h = d[0], c = d[1], u = d[2], v = d[3], k = d[4], b = d[5], f = Oi(s, b);
3757
+ var d = Bi(s, n, a), h = d[0], c = d[1], u = d[2], v = d[3], k = d[4], b = d[5], f = Oi(s, b);
3758
3758
  n = k, h ? h == 8 ? t[v] = Ii(s.subarray(f, f + c), { out: new W(u) }) : K(14, "unknown compression type " + h) : t[v] = dt(s, f, f + c);
3759
3759
  }
3760
3760
  return t;
@@ -3868,12 +3868,12 @@ function kr(s) {
3868
3868
  if (d.forEach((f, m) => {
3869
3869
  const C = l.get(f);
3870
3870
  if (!C || !/html|xml/i.test(C.mediaType) && !C.href.match(/\.x?html?$/i)) return;
3871
- const p = C.href, x = Ke(s, p), R = p.includes("/") ? p.replace(/\/[^/]+$/, "/") : "", O = `page-${m + 1}`, A = Ji(x), { html: P, imageHrefs: E } = Xi(A, R, (V) => {
3872
- const j = pe(V.includes(":") ? V : `${R}${V}`);
3871
+ const p = C.href, x = Ke(s, p), R = p.includes("/") ? p.replace(/\/[^/]+$/, "/") : "", O = `page-${m + 1}`, A = Ji(x), { html: P, imageHrefs: E } = Xi(A, R, (B) => {
3872
+ const j = pe(B.includes(":") ? B : `${R}${B}`);
3873
3873
  try {
3874
3874
  return u(j);
3875
3875
  } catch {
3876
- return V;
3876
+ return B;
3877
3877
  }
3878
3878
  }), H = [
3879
3879
  {
@@ -3885,18 +3885,18 @@ function kr(s) {
3885
3885
  ], Z = E[0];
3886
3886
  let q;
3887
3887
  if (Z) {
3888
- const V = `img-${m}-0`;
3889
- v[V] = { type: "image", src: u(Z) }, q = { asset: V, color: "#ffffff" };
3888
+ const B = `img-${m}-0`;
3889
+ v[B] = { type: "image", src: u(Z) }, q = { asset: B, color: "#ffffff" };
3890
3890
  } else
3891
3891
  q = { color: "#ffffff" };
3892
3892
  let ie;
3893
3893
  if (C.mediaOverlay) {
3894
- const V = l.get(C.mediaOverlay);
3895
- if (V) {
3896
- const j = Yi(Ke(s, V.href), V.href);
3894
+ const B = l.get(C.mediaOverlay);
3895
+ if (B) {
3896
+ const j = Yi(Ke(s, B.href), B.href);
3897
3897
  if (j.audioHref) {
3898
3898
  const D = `vo-${m}`, z = pe(
3899
- j.audioHref.includes("/") || j.audioHref.startsWith(".") ? wr(V.href, j.audioHref) : `${i}${j.audioHref}`
3899
+ j.audioHref.includes("/") || j.audioHref.startsWith(".") ? wr(B.href, j.audioHref) : `${i}${j.audioHref}`
3900
3900
  );
3901
3901
  v[D] = { type: "audio", src: u(z), channel: "vo" };
3902
3902
  const Y = j.cues;
@@ -4224,7 +4224,7 @@ function Ws(s) {
4224
4224
  s.blobUrls.length = 0;
4225
4225
  }
4226
4226
  const ln = "auto", cn = 900;
4227
- function ce(s) {
4227
+ function ae(s) {
4228
4228
  return s === "single" || s === "single-right" || s === "single-left";
4229
4229
  }
4230
4230
  function _r(s) {
@@ -4391,7 +4391,7 @@ class yn {
4391
4391
  const a = this.currentPageIds[0] ?? mn(this.spreads[this.spreadIndex]) ?? ((l = this.story.pages[0]) == null ? void 0 : l.id) ?? null;
4392
4392
  this.resolvedMode = i, this.hasResolvedLayout = !0, this.rebuildCoverSpreads(), this.spreads = Wt(this.story.pages, i, this.covers);
4393
4393
  const o = this.covers.frontCover && a === ((d = this.story.pages[0]) == null ? void 0 : d.id) || this.covers.backCover && a === ((h = this.story.pages[this.story.pages.length - 1]) == null ? void 0 : h.id);
4394
- ce(i) ? (this.bookState = "open", this.spreadIndex = a ? Ye(this.spreads, a) : 0) : this.covers.frontCover && (this.bookState === "closed-front" || o && a === ((c = this.story.pages[0]) == null ? void 0 : c.id)) ? (this.bookState = "closed-front", this.spreadIndex = 0) : this.covers.backCover && (this.bookState === "closed-back" || o && a === ((u = this.story.pages[this.story.pages.length - 1]) == null ? void 0 : u.id)) ? (this.bookState = "closed-back", this.spreadIndex = Math.max(0, this.spreads.length - 1)) : (this.bookState = "open", this.spreadIndex = a ? Ye(this.spreads, a) : 0), this.spreadIndex >= this.spreads.length && (this.spreadIndex = Math.max(0, this.spreads.length - 1)), this.busy = !1, this.spreadView.setLayoutMode(i), this.spreadView.setBookState(this.bookState), this.spreadView.showSpread(this.currentSpread, "none"), r && (this.emit("layoutchange", { layoutMode: i }), this.emitPageChange());
4394
+ ae(i) ? (this.bookState = "open", this.spreadIndex = a ? Ye(this.spreads, a) : 0) : this.covers.frontCover && (this.bookState === "closed-front" || o && a === ((c = this.story.pages[0]) == null ? void 0 : c.id)) ? (this.bookState = "closed-front", this.spreadIndex = 0) : this.covers.backCover && (this.bookState === "closed-back" || o && a === ((u = this.story.pages[this.story.pages.length - 1]) == null ? void 0 : u.id)) ? (this.bookState = "closed-back", this.spreadIndex = Math.max(0, this.spreads.length - 1)) : (this.bookState = "open", this.spreadIndex = a ? Ye(this.spreads, a) : 0), this.spreadIndex >= this.spreads.length && (this.spreadIndex = Math.max(0, this.spreads.length - 1)), this.busy = !1, this.spreadView.setLayoutMode(i), this.spreadView.setBookState(this.bookState), this.spreadView.showSpread(this.currentSpread, "none"), r && (this.emit("layoutchange", { layoutMode: i }), this.emitPageChange());
4395
4395
  }
4396
4396
  async showInitial() {
4397
4397
  this.covers.frontCover && this.resolvedMode === "two-page" ? (this.bookState = "closed-front", this.spreadIndex = 0) : this.bookState = "open", await this.spreadView.showSpread(this.currentSpread, "none"), this.spreadView.setBookState(this.bookState), this.emitPageChange();
@@ -4437,7 +4437,7 @@ class yn {
4437
4437
  backCover: !!this.story.backCover
4438
4438
  }, this.rebuildCoverSpreads(), this.spreads = Wt(this.story.pages, this.resolvedMode, this.covers);
4439
4439
  const t = e ?? this.currentPageIds[0] ?? ((r = this.story.pages[0]) == null ? void 0 : r.id) ?? null;
4440
- ce(this.resolvedMode) ? (this.bookState = "open", this.spreadIndex = t ? Ye(this.spreads, t) : 0) : this.covers.frontCover && t === ((i = this.story.pages[0]) == null ? void 0 : i.id) && this.bookState === "closed-front" ? (this.bookState = "closed-front", this.spreadIndex = 0) : this.covers.backCover && t === ((n = this.story.pages[this.story.pages.length - 1]) == null ? void 0 : n.id) && this.bookState === "closed-back" ? (this.bookState = "closed-back", this.spreadIndex = Math.max(0, this.spreads.length - 1)) : (this.bookState = "open", this.spreadIndex = t ? Ye(this.spreads, t) : 0, this.spreadIndex < 0 && (this.spreadIndex = 0)), this.spreads.length === 0 ? (this.spreadIndex = 0, this.covers.frontCover ? this.bookState = "closed-front" : this.covers.backCover && (this.bookState = "closed-back")) : this.spreadIndex >= this.spreads.length && (this.spreadIndex = Math.max(0, this.spreads.length - 1)), this.busy = !1, this.spreadView.setLayoutMode(this.resolvedMode), this.spreadView.setBookState(this.bookState), this.spreadView.showSpread(this.currentSpread, "none"), this.emitPageChange();
4440
+ ae(this.resolvedMode) ? (this.bookState = "open", this.spreadIndex = t ? Ye(this.spreads, t) : 0) : this.covers.frontCover && t === ((i = this.story.pages[0]) == null ? void 0 : i.id) && this.bookState === "closed-front" ? (this.bookState = "closed-front", this.spreadIndex = 0) : this.covers.backCover && t === ((n = this.story.pages[this.story.pages.length - 1]) == null ? void 0 : n.id) && this.bookState === "closed-back" ? (this.bookState = "closed-back", this.spreadIndex = Math.max(0, this.spreads.length - 1)) : (this.bookState = "open", this.spreadIndex = t ? Ye(this.spreads, t) : 0, this.spreadIndex < 0 && (this.spreadIndex = 0)), this.spreads.length === 0 ? (this.spreadIndex = 0, this.covers.frontCover ? this.bookState = "closed-front" : this.covers.backCover && (this.bookState = "closed-back")) : this.spreadIndex >= this.spreads.length && (this.spreadIndex = Math.max(0, this.spreads.length - 1)), this.busy = !1, this.spreadView.setLayoutMode(this.resolvedMode), this.spreadView.setBookState(this.bookState), this.spreadView.showSpread(this.currentSpread, "none"), this.emitPageChange();
4441
4441
  }
4442
4442
  async goTo(e) {
4443
4443
  var a, o;
@@ -4528,13 +4528,13 @@ function bn(s, e) {
4528
4528
  const t = URL.createObjectURL(s), r = document.createElement("a");
4529
4529
  r.href = t, r.download = e, r.rel = "noopener", document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(t);
4530
4530
  }
4531
- class Vt {
4531
+ class Bt {
4532
4532
  /** Clear classes/styles if a flip is interrupted. */
4533
4533
  cancel(e) {
4534
4534
  }
4535
4535
  }
4536
4536
  /** Registry id when registered via {@link registerFlipStyle}. */
4537
- y(Vt, "id", "base");
4537
+ y(Bt, "id", "base");
4538
4538
  const at = /* @__PURE__ */ new Map();
4539
4539
  function kn(s, e) {
4540
4540
  at.set(s, e);
@@ -4546,7 +4546,7 @@ function wn() {
4546
4546
  return [...at.keys()];
4547
4547
  }
4548
4548
  function xn(s) {
4549
- return typeof s == "function" && s.prototype instanceof Vt;
4549
+ return typeof s == "function" && s.prototype instanceof Bt;
4550
4550
  }
4551
4551
  function qs(s) {
4552
4552
  if (s == null || s === "") {
@@ -4563,7 +4563,7 @@ function qs(s) {
4563
4563
  }
4564
4564
  return new e();
4565
4565
  }
4566
- if (s instanceof Vt)
4566
+ if (s instanceof Bt)
4567
4567
  return s;
4568
4568
  if (xn(s))
4569
4569
  return new s();
@@ -4591,7 +4591,7 @@ function An(s) {
4591
4591
  function qt(s) {
4592
4592
  s.classList.remove(..._n);
4593
4593
  }
4594
- class ps extends Vt {
4594
+ class ps extends Bt {
4595
4595
  play(e) {
4596
4596
  const { bookEl: t, durationMs: r } = e, i = An(e);
4597
4597
  return t.style.setProperty("--fc-flip-duration", `${r}ms`), qt(t), t.offsetWidth, t.classList.add(i), new Promise((n) => {
@@ -4624,21 +4624,21 @@ function Js(s) {
4624
4624
  }
4625
4625
  function Ln(s) {
4626
4626
  const e = s ?? {}, t = {
4627
- left: Be(e.x ?? 0),
4628
- top: Be(e.y ?? 0)
4627
+ left: Ve(e.x ?? 0),
4628
+ top: Ve(e.y ?? 0)
4629
4629
  };
4630
- return e.width != null && (t.width = Be(e.width)), e.height != null && (t.height = Be(e.height)), t;
4630
+ return e.width != null && (t.width = Ve(e.width)), e.height != null && (t.height = Ve(e.height)), t;
4631
4631
  }
4632
- function Bt(s, e) {
4632
+ function Vt(s, e) {
4633
4633
  const t = Ln(e);
4634
- s.style.left = t.left, s.style.top = t.top, t.width && (s.style.width = t.width), t.height && (s.style.height = t.height), (e == null ? void 0 : e.horizontalAlign) === "right" ? (s.style.left = "auto", s.style.right = Be(e.x ?? 0)) : (e == null ? void 0 : e.horizontalAlign) === "center" && (s.style.left = "50%", s.style.transform = `${s.style.transform || ""} translateX(-50%)`.trim()), (e == null ? void 0 : e.verticalAlign) === "bottom" ? (s.style.top = "auto", s.style.bottom = Be(e.y ?? 0)) : (e == null ? void 0 : e.verticalAlign) === "center" && (s.style.top = "50%", s.style.transform = `${s.style.transform || ""} translateY(-50%)`.trim());
4634
+ s.style.left = t.left, s.style.top = t.top, t.width && (s.style.width = t.width), t.height && (s.style.height = t.height), (e == null ? void 0 : e.horizontalAlign) === "right" ? (s.style.left = "auto", s.style.right = Ve(e.x ?? 0)) : (e == null ? void 0 : e.horizontalAlign) === "center" && (s.style.left = "50%", s.style.transform = `${s.style.transform || ""} translateX(-50%)`.trim()), (e == null ? void 0 : e.verticalAlign) === "bottom" ? (s.style.top = "auto", s.style.bottom = Ve(e.y ?? 0)) : (e == null ? void 0 : e.verticalAlign) === "center" && (s.style.top = "50%", s.style.transform = `${s.style.transform || ""} translateY(-50%)`.trim());
4635
4635
  }
4636
- function Be(s) {
4636
+ function Ve(s) {
4637
4637
  return typeof s == "number" ? `${s}px` : /^-?\d+(\.\d+)?$/.test(s) ? `${s}px` : s;
4638
4638
  }
4639
4639
  function En(s) {
4640
4640
  const e = document.createElement("div");
4641
- return e.className = "fc-block fc-block-area", e.dataset.blockId = s.id, e.dataset.game = s.game, s.requireComplete && (e.dataset.requireComplete = "true"), e.setAttribute("role", "group"), e.setAttribute("aria-label", s.ariaLabel ?? s.game), Bt(e, s.layout), e;
4641
+ return e.className = "fc-block fc-block-area", e.dataset.blockId = s.id, e.dataset.game = s.game, s.requireComplete && (e.dataset.requireComplete = "true"), e.setAttribute("role", "group"), e.setAttribute("aria-label", s.ariaLabel ?? s.game), Vt(e, s.layout), e;
4642
4642
  }
4643
4643
  function Mn(s, e, t) {
4644
4644
  const r = s + 1;
@@ -4646,7 +4646,7 @@ function Mn(s, e, t) {
4646
4646
  }
4647
4647
  function Pn(s, e) {
4648
4648
  const t = document.createElement("button");
4649
- t.type = "button", t.className = "fc-block fc-block-hotspot", t.dataset.blockId = s.id, t.setAttribute("aria-label", s.ariaLabel ?? s.id), Bt(t, s.layout);
4649
+ t.type = "button", t.className = "fc-block fc-block-hotspot", t.dataset.blockId = s.id, t.setAttribute("aria-label", s.ariaLabel ?? s.id), Vt(t, s.layout);
4650
4650
  let r = 0, i = !1;
4651
4651
  return t.addEventListener("click", (n) => {
4652
4652
  n.stopPropagation(), e(s.onTap ?? []);
@@ -4657,7 +4657,7 @@ function Pn(s, e) {
4657
4657
  function Nn(s, e) {
4658
4658
  var n;
4659
4659
  const t = document.createElement("div");
4660
- t.className = `fc-block fc-block-image${s.className ? ` ${s.className}` : ""}`, t.dataset.blockId = s.id, Bt(t, s.layout);
4660
+ t.className = `fc-block fc-block-image${s.className ? ` ${s.className}` : ""}`, t.dataset.blockId = s.id, Vt(t, s.layout);
4661
4661
  const r = document.createElement("img");
4662
4662
  r.alt = "", r.draggable = !1, e && (r.src = e.src);
4663
4663
  const i = ((n = s.layout) == null ? void 0 : n.fit) ?? "contain";
@@ -4665,7 +4665,7 @@ function Nn(s, e) {
4665
4665
  }
4666
4666
  function In(s, e) {
4667
4667
  const t = document.createElement("div");
4668
- return t.className = "fc-block fc-block-text", t.dataset.blockId = s.id, Bt(t, s.layout), t.innerHTML = e, t.querySelectorAll("[id]").forEach((r) => {
4668
+ return t.className = "fc-block fc-block-text", t.dataset.blockId = s.id, Vt(t, s.layout), t.innerHTML = e, t.querySelectorAll("[id]").forEach((r) => {
4669
4669
  r.classList.add("fc-cue");
4670
4670
  }), s.style && (s.style.fontFamily && (t.style.fontFamily = s.style.fontFamily), s.style.fontSize && (t.style.fontSize = s.style.fontSize), s.style.color && (t.style.color = s.style.color), s.style.textAlign && (t.style.textAlign = s.style.textAlign), s.style.lineHeight != null && (t.style.lineHeight = String(s.style.lineHeight)), s.style.fontWeight && (t.style.fontWeight = s.style.fontWeight), s.style.fontStyle && (t.style.fontStyle = s.style.fontStyle)), t;
4671
4671
  }
@@ -4738,7 +4738,7 @@ class $n {
4738
4738
  );
4739
4739
  }
4740
4740
  setLayoutMode(e) {
4741
- this.layoutMode = e, this.element.dataset.layoutMode = e, this.element.classList.toggle("fc-spread-viewport-single", ce(e)), this.element.classList.toggle("fc-spread-viewport-two", e === "two-page");
4741
+ this.layoutMode = e, this.element.dataset.layoutMode = e, this.element.classList.toggle("fc-spread-viewport-single", ae(e)), this.element.classList.toggle("fc-spread-viewport-two", e === "two-page");
4742
4742
  }
4743
4743
  /** Update closed/open presentation geometry (use page flips to change content). */
4744
4744
  setBookState(e) {
@@ -4852,17 +4852,17 @@ class $n {
4852
4852
  t
4853
4853
  ), this.bookEl.style.setProperty("--fc-page-width", `${k}px`), this.bookEl.style.setProperty("--fc-page-height", `${b}px`), this.bookEl.style.width = `${u ? k : k * 2}px`, this.bookEl.style.height = `${b}px`, f = u ? 0 : -k * v, m = 0, C = 0, this.hardbackEl.hidden = !0;
4854
4854
  else if (c) {
4855
- k = (ce(a) ? i : i * 2) + 2 * d.x, b = n + 2 * d.y, v = this.sizedScale(
4855
+ k = (ae(a) ? i : i * 2) + 2 * d.x, b = n + 2 * d.y, v = this.sizedScale(
4856
4856
  Math.min(e / k, t / b),
4857
4857
  i,
4858
4858
  n,
4859
4859
  e,
4860
4860
  t
4861
4861
  ), this.bookEl.style.setProperty("--fc-page-width", `${i}px`), this.bookEl.style.setProperty("--fc-page-height", `${n}px`), this.bookEl.style.width = `${i * 2}px`, this.bookEl.style.height = `${n}px`, this.hardbackEl.hidden = !1, this.hardbackEl.style.width = `${k}px`, this.hardbackEl.style.height = `${b}px`;
4862
- const H = ce(a) ? (r == null ? void 0 : r.left.kind) === "blank" ? "right" : "left" : "both";
4863
- this.sizeHardbackBoards(H, i, n, d.x, d.y), m = d.x, C = d.y, ce(a) && (r == null ? void 0 : r.left.kind) === "blank" ? f = -i * v : f = 0;
4862
+ const H = ae(a) ? (r == null ? void 0 : r.left.kind) === "blank" ? "right" : "left" : "both";
4863
+ this.sizeHardbackBoards(H, i, n, d.x, d.y), m = d.x, C = d.y, ae(a) && (r == null ? void 0 : r.left.kind) === "blank" ? f = -i * v : f = 0;
4864
4864
  } else
4865
- k = i * 2, b = n, ce(a) || h ? v = this.sizedScale(
4865
+ k = i * 2, b = n, ae(a) || h ? v = this.sizedScale(
4866
4866
  Math.min(e / i, t / n),
4867
4867
  i,
4868
4868
  n,
@@ -4874,10 +4874,10 @@ class $n {
4874
4874
  n,
4875
4875
  e,
4876
4876
  t
4877
- ), this.bookEl.style.setProperty("--fc-page-width", `${i}px`), this.bookEl.style.setProperty("--fc-page-height", `${n}px`), this.bookEl.style.width = `${u ? i : k}px`, this.bookEl.style.height = `${b}px`, this.hardbackEl.hidden = !0, u ? f = 0 : (h || ce(a) && r && r.left.kind === "blank") && (f = -i * v);
4877
+ ), this.bookEl.style.setProperty("--fc-page-width", `${i}px`), this.bookEl.style.setProperty("--fc-page-height", `${n}px`), this.bookEl.style.width = `${u ? i : k}px`, this.bookEl.style.height = `${b}px`, this.hardbackEl.hidden = !0, u ? f = 0 : (h || ae(a) && r && r.left.kind === "blank") && (f = -i * v);
4878
4878
  this.element.style.setProperty("--fc-hardback-overhang-x", `${d.x}px`), this.element.style.setProperty("--fc-hardback-overhang-y", `${d.y}px`), this.hardbackEl.style.transform = `scale(${v})`, this.hardbackEl.style.transformOrigin = "left top", this.bookEl.style.transform = `translateX(${f}px) scale(${v})`, this.bookEl.style.transformOrigin = "left top";
4879
- let p = l && h ? (i + 2 * d.x) * v : c ? (ce(a) ? i + 2 * d.x : i * 2 + 2 * d.x) * v : ce(a) || h ? i * v : i * 2 * v, x = l && (h || c) ? (n + 2 * d.y) * v : n * v, R = 0, O = 0;
4880
- this.stageZoom.mode === "fit-page" && (x > t && (O = (x - t) / 2, x = t), (ce(a) || h || u ? i : i * 2) * v <= e && p > e && (R = (p - e) / 2, p = e));
4879
+ let p = l && h ? (i + 2 * d.x) * v : c ? (ae(a) ? i + 2 * d.x : i * 2 + 2 * d.x) * v : ae(a) || h ? i * v : i * 2 * v, x = l && (h || c) ? (n + 2 * d.y) * v : n * v, R = 0, O = 0;
4880
+ this.stageZoom.mode === "fit-page" && (x > t && (O = (x - t) / 2, x = t), (ae(a) || h || u ? i : i * 2) * v <= e && p > e && (R = (p - e) / 2, p = e));
4881
4881
  const A = (c ? m * v : 0) - R, P = (c ? C * v : 0) - O;
4882
4882
  this.hardbackEl.style.left = `${-R}px`, this.hardbackEl.style.top = `${-O}px`, this.bookEl.style.left = `${A}px`, this.bookEl.style.top = `${P}px`, this.element.style.width = `${p}px`, this.element.style.height = `${x}px`, this.leftSlot.classList.toggle("fc-leaf-dimmed", h && !u), this.rightSlot.classList.remove("fc-leaf-dimmed"), this.applySoloCover(u);
4883
4883
  }
@@ -4923,24 +4923,32 @@ class $n {
4923
4923
  return;
4924
4924
  }
4925
4925
  const e = this.story.pages, t = this.story.frontCover ? e[0] : null, r = this.story.backCover ? e[e.length - 1] : null, i = t ?? r, n = r ?? t;
4926
+ if (ae(this.layoutMode)) {
4927
+ this.mountHardbackBoard("left", i, { solidOnly: !0 }), this.mountHardbackBoard("right", n, { solidOnly: !0 });
4928
+ return;
4929
+ }
4926
4930
  this.mountHardbackBoard("left", i), this.mountHardbackBoard("right", n);
4927
4931
  }
4928
- mountHardbackBoard(e, t) {
4929
- var o;
4930
- const r = e === "left" ? this.hardbackLeft : this.hardbackRight, i = e === "left" ? this.hardbackLeftPage : this.hardbackRightPage;
4931
- if (i == null || i.destroy(), !t) {
4932
- r.replaceChildren(), r.style.background = "", e === "left" ? this.hardbackLeftPage = null : this.hardbackRightPage = null;
4932
+ mountHardbackBoard(e, t, r = {}) {
4933
+ var l, d;
4934
+ const i = e === "left" ? this.hardbackLeft : this.hardbackRight, n = e === "left" ? this.hardbackLeftPage : this.hardbackRightPage;
4935
+ if (n == null || n.destroy(), !t) {
4936
+ i.replaceChildren(), i.style.background = "", e === "left" ? this.hardbackLeftPage = null : this.hardbackRightPage = null;
4937
+ return;
4938
+ }
4939
+ const a = ((l = t.background) == null ? void 0 : l.innerColor) ?? (r.solidOnly ? (d = t.background) == null ? void 0 : d.color : void 0);
4940
+ if (a) {
4941
+ i.style.background = a, i.replaceChildren(), e === "left" ? this.hardbackLeftPage = null : this.hardbackRightPage = null;
4933
4942
  return;
4934
4943
  }
4935
- const n = (o = t.background) == null ? void 0 : o.innerColor;
4936
- if (n) {
4937
- r.style.background = n, r.replaceChildren(), e === "left" ? this.hardbackLeftPage = null : this.hardbackRightPage = null;
4944
+ if (r.solidOnly) {
4945
+ i.style.background = "", i.replaceChildren(), e === "left" ? this.hardbackLeftPage = null : this.hardbackRightPage = null;
4938
4946
  return;
4939
4947
  }
4940
- r.style.background = "";
4941
- const a = new Gt(t, this.assets, { onTapActions: () => {
4948
+ i.style.background = "";
4949
+ const o = new Gt(t, this.assets, { onTapActions: () => {
4942
4950
  } });
4943
- a.element.classList.add("fc-hardback-page"), r.replaceChildren(a.element), e === "left" ? this.hardbackLeftPage = a : this.hardbackRightPage = a;
4951
+ o.element.classList.add("fc-hardback-page"), i.replaceChildren(o.element), e === "left" ? this.hardbackLeftPage = o : this.hardbackRightPage = o;
4944
4952
  }
4945
4953
  clearHardbackBoards() {
4946
4954
  var e, t;
@@ -4964,7 +4972,7 @@ class $n {
4964
4972
  function Rn(s, e) {
4965
4973
  const t = s == null ? void 0 : s.container;
4966
4974
  if (!(t != null && t.send)) return;
4967
- const r = Vn(e.progress);
4975
+ const r = Bn(e.progress);
4968
4976
  t.send("progress", r), t.send("loading", {
4969
4977
  stage: e.stage,
4970
4978
  progress: r,
@@ -4983,10 +4991,10 @@ function On() {
4983
4991
  s = t;
4984
4992
  }), resolve: s };
4985
4993
  }
4986
- function Vn(s) {
4994
+ function Bn(s) {
4987
4995
  return Number.isNaN(s) ? 0 : Math.min(1, Math.max(0, s));
4988
4996
  }
4989
- function Bn(s, e, t = {}) {
4997
+ function Vn(s, e, t = {}) {
4990
4998
  const r = [];
4991
4999
  let i = !1;
4992
5000
  const n = (a, o) => {
@@ -5568,7 +5576,7 @@ class Ar {
5568
5576
  });
5569
5577
  }
5570
5578
  wireSpringroll() {
5571
- this.bindings = Bn(this.springroll, this.bus, {
5579
+ this.bindings = Vn(this.springroll, this.bus, {
5572
5580
  onCaptionsMuted: (e) => this.readAloud.setCaptionsMuted(e),
5573
5581
  onPause: (e) => {
5574
5582
  e ? this.readAloud.pause() : this.readAloud.resume();
@@ -6076,10 +6084,10 @@ export {
6076
6084
  ps as DefaultFlipStyle,
6077
6085
  La as FABRIC_CSS_FONT_SIZE_MULT,
6078
6086
  ws as FANCI_EXTENSION,
6079
- Vt as FlipStyle,
6087
+ Bt as FlipStyle,
6080
6088
  Ys as HARDBACK_EDGE_RATIO,
6081
6089
  Ar as Storybook,
6082
- Bn as bindApplication,
6090
+ Vn as bindApplication,
6083
6091
  Fe as boxToPixels,
6084
6092
  un as buildBackCoverSpread,
6085
6093
  hn as buildFrontCoverSpread,
@@ -6091,7 +6099,7 @@ export {
6091
6099
  qs as createFlipStyle,
6092
6100
  Fn as createSpringrollApplication,
6093
6101
  bn as downloadBlob,
6094
- Vr as extensionOf,
6102
+ Br as extensionOf,
6095
6103
  er as fabricLikeToPage,
6096
6104
  Sa as findFanciFile,
6097
6105
  Ye as findSpreadIndexForPage,
@@ -6104,7 +6112,7 @@ export {
6104
6112
  Tr as htmlToPlainText,
6105
6113
  Rr as isAreaNavGated,
6106
6114
  rr as isFanciFile,
6107
- ce as isSingleLayout,
6115
+ ae as isSingleLayout,
6108
6116
  wn as listRegisteredFlipStyles,
6109
6117
  ka as listRegisteredPageGames,
6110
6118
  _a as loadEpubFromBytes,