@famibee/skynovel 2.0.2 → 2.0.3

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.
Files changed (121) hide show
  1. package/dist/Button.js +36 -34
  2. package/dist/Button.js.map +1 -1
  3. package/dist/CallStack.js +11 -6
  4. package/dist/CallStack.js.map +1 -1
  5. package/dist/CmnInterface.js +13 -11
  6. package/dist/CmnInterface.js.map +1 -1
  7. package/dist/CmnLib.js +58 -56
  8. package/dist/CmnLib.js.map +1 -1
  9. package/dist/Config.js +9 -7
  10. package/dist/Config.js.map +1 -1
  11. package/dist/ConfigBase.js +52 -49
  12. package/dist/ConfigBase.js.map +1 -1
  13. package/dist/DebugMng.js +9 -6
  14. package/dist/DebugMng.js.map +1 -1
  15. package/dist/EventListenerCtn.js +6 -4
  16. package/dist/EventListenerCtn.js.map +1 -1
  17. package/dist/EventMng.js +522 -417
  18. package/dist/EventMng.js.map +1 -1
  19. package/dist/Grammar.js +22 -20
  20. package/dist/Grammar.js.map +1 -1
  21. package/dist/GrpLayer.js +58 -57
  22. package/dist/GrpLayer.js.map +1 -1
  23. package/dist/Layer.js +66 -64
  24. package/dist/Layer.js.map +1 -1
  25. package/dist/LayerMng.js +461 -441
  26. package/dist/LayerMng.js.map +1 -1
  27. package/dist/Main.js +69 -67
  28. package/dist/Main.js.map +1 -1
  29. package/dist/PropParser.js +23 -19
  30. package/dist/PropParser.js.map +1 -1
  31. package/dist/Reading.js +422 -418
  32. package/dist/Reading.js.map +1 -1
  33. package/dist/RubySpliter.js +4 -2
  34. package/dist/RubySpliter.js.map +1 -1
  35. package/dist/ScriptIterator.js +374 -370
  36. package/dist/ScriptIterator.js.map +1 -1
  37. package/dist/SndBuf.js +643 -622
  38. package/dist/SndBuf.js.map +1 -1
  39. package/dist/SoundMng.js +59 -60
  40. package/dist/SoundMng.js.map +1 -1
  41. package/dist/SpritesMng.js +135 -129
  42. package/dist/SpritesMng.js.map +1 -1
  43. package/dist/SysBase.js +985 -950
  44. package/dist/SysBase.js.map +1 -1
  45. package/dist/TxtLayer.js +558 -551
  46. package/dist/TxtLayer.js.map +1 -1
  47. package/dist/Variable.js +47 -45
  48. package/dist/Variable.js.map +1 -1
  49. package/dist/chunk.js +11 -9
  50. package/dist/gamepad.js +396 -660
  51. package/dist/gamepad.js.map +1 -1
  52. package/dist/pixi.js +2631 -2593
  53. package/dist/pixi.js.map +1 -1
  54. package/dist/platform.js +6 -4
  55. package/dist/platform.js.map +1 -1
  56. package/dist/rolldown-runtime.js +20 -0
  57. package/dist/web.js +418 -418
  58. package/dist/web.js.map +1 -1
  59. package/dist_app/Button.js +36 -34
  60. package/dist_app/Button.js.map +1 -1
  61. package/dist_app/CallStack.js +11 -6
  62. package/dist_app/CallStack.js.map +1 -1
  63. package/dist_app/CmnInterface.js +13 -11
  64. package/dist_app/CmnInterface.js.map +1 -1
  65. package/dist_app/CmnLib.js +58 -56
  66. package/dist_app/CmnLib.js.map +1 -1
  67. package/dist_app/Config.js +9 -7
  68. package/dist_app/Config.js.map +1 -1
  69. package/dist_app/ConfigBase.js +52 -49
  70. package/dist_app/ConfigBase.js.map +1 -1
  71. package/dist_app/DebugMng.js +9 -6
  72. package/dist_app/DebugMng.js.map +1 -1
  73. package/dist_app/EventListenerCtn.js +6 -4
  74. package/dist_app/EventListenerCtn.js.map +1 -1
  75. package/dist_app/EventMng.js +522 -417
  76. package/dist_app/EventMng.js.map +1 -1
  77. package/dist_app/Grammar.js +22 -20
  78. package/dist_app/Grammar.js.map +1 -1
  79. package/dist_app/GrpLayer.js +58 -57
  80. package/dist_app/GrpLayer.js.map +1 -1
  81. package/dist_app/Layer.js +66 -64
  82. package/dist_app/Layer.js.map +1 -1
  83. package/dist_app/LayerMng.js +461 -441
  84. package/dist_app/LayerMng.js.map +1 -1
  85. package/dist_app/Main.js +69 -67
  86. package/dist_app/Main.js.map +1 -1
  87. package/dist_app/PropParser.js +23 -19
  88. package/dist_app/PropParser.js.map +1 -1
  89. package/dist_app/Reading.js +422 -418
  90. package/dist_app/Reading.js.map +1 -1
  91. package/dist_app/RubySpliter.js +4 -2
  92. package/dist_app/RubySpliter.js.map +1 -1
  93. package/dist_app/ScriptIterator.js +374 -370
  94. package/dist_app/ScriptIterator.js.map +1 -1
  95. package/dist_app/SndBuf.js +643 -622
  96. package/dist_app/SndBuf.js.map +1 -1
  97. package/dist_app/SoundMng.js +59 -60
  98. package/dist_app/SoundMng.js.map +1 -1
  99. package/dist_app/SpritesMng.js +135 -129
  100. package/dist_app/SpritesMng.js.map +1 -1
  101. package/dist_app/SysBase.js +985 -950
  102. package/dist_app/SysBase.js.map +1 -1
  103. package/dist_app/TxtLayer.js +558 -551
  104. package/dist_app/TxtLayer.js.map +1 -1
  105. package/dist_app/Variable.js +47 -45
  106. package/dist_app/Variable.js.map +1 -1
  107. package/dist_app/app.js +62 -63
  108. package/dist_app/app.js.map +1 -1
  109. package/dist_app/appMain.js +11 -11
  110. package/dist_app/appMain.js.map +1 -1
  111. package/dist_app/chunk.js +11 -9
  112. package/dist_app/gamepad.js +396 -660
  113. package/dist_app/gamepad.js.map +1 -1
  114. package/dist_app/pixi.js +2028 -1990
  115. package/dist_app/pixi.js.map +1 -1
  116. package/dist_app/platform.js +6 -4
  117. package/dist_app/platform.js.map +1 -1
  118. package/dist_app/preload.js +1 -1
  119. package/dist_app/preload.js.map +1 -1
  120. package/dist_app/rolldown-runtime.js +20 -0
  121. package/package.json +20 -21
@@ -1,18 +1,18 @@
1
- import { a as RPN_COMP_CHIN, c as argChk_Color, f as initStyle, g as uint, l as argChk_Num, o as addStyle, s as argChk_Boolean, t as CmnLib } from "./CmnLib.js";
2
- import { f as Texture, h as Rectangle, m as Container, o as Sprite, s as Graphics } from "./pixi.js";
3
- import "./EventListenerCtn.js";
4
- import { n as SEARCH_PATH_ARG_EXT } from "./ConfigBase.js";
5
- import { t as DebugMng } from "./DebugMng.js";
6
- import { t as Layer } from "./Layer.js";
7
- import { a as Group, o as Tween, r as CmnTween, t as Reading } from "./Reading.js";
8
- import { t as SpritesMng } from "./SpritesMng.js";
9
- import { Button } from "./Button.js";
10
- import { t as RubySpliter } from "./RubySpliter.js";
11
- var def行頭禁則 = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", def行末禁則 = "[({〈「『【〔“〝", def分割禁止 = "─‥…", defぶら下げ = def行頭禁則, defReg行頭禁則 = /* @__PURE__ */ RegExp(`[${def行頭禁則}]`), defReg行末禁則 = /* @__PURE__ */ RegExp(`[${def行末禁則}]`), defReg分割禁止 = /* @__PURE__ */ RegExp(`[${def分割禁止}]`), defRegぶら下げ = defReg行頭禁則, Hyphenation = class {
12
- #e = def行頭禁則;
13
- #t = def行末禁則;
14
- #n = def分割禁止;
15
- #r = defぶら下げ;
1
+ import { a as e, c as t, f as n, g as r, l as i, o as a, s as o, t as s } from "./CmnLib.js";
2
+ import { f as c, h as l, m as u, o as d, s as f } from "./pixi.js";
3
+ import { n as p } from "./ConfigBase.js";
4
+ import { t as m } from "./DebugMng.js";
5
+ import { t as h } from "./Layer.js";
6
+ import { a as g, o as _, r as v, t as y } from "./Reading.js";
7
+ import { t as b } from "./SpritesMng.js";
8
+ import { Button as x } from "./Button.js";
9
+ import { t as S } from "./RubySpliter.js";
10
+ //#region src/sn/Hyphenation.ts
11
+ var C = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", w = "[({〈「『【〔“〝", T = "─‥…", E = C, D = RegExp(`[${C}]`), O = RegExp(`[${w}]`), k = RegExp(`[${T}]`), A = D, j = class {
12
+ #e = C;
13
+ #t = w;
14
+ #n = T;
15
+ #r = E;
16
16
  get 行頭禁則() {
17
17
  return this.#e;
18
18
  }
@@ -25,44 +25,44 @@ var def行頭禁則 = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉ
25
25
  get ぶら下げ() {
26
26
  return this.#r;
27
27
  }
28
- #i = defReg行頭禁則;
29
- #a = defReg行末禁則;
30
- #o = defReg分割禁止;
31
- #s = defRegぶら下げ;
28
+ #i = D;
29
+ #a = O;
30
+ #o = k;
31
+ #s = A;
32
32
  break_fixed = !1;
33
33
  break_fixed_left = 0;
34
34
  break_fixed_top = 0;
35
35
  bura = !1;
36
36
  lay(e) {
37
- e.kinsoku_sol && (this.#e = e.kinsoku_sol, this.#i = /* @__PURE__ */ RegExp(`[${this.#e}]`)), e.kinsoku_eol && (this.#t = e.kinsoku_eol, this.#c(), this.#a = /* @__PURE__ */ RegExp(`[${this.#t}]`)), e.kinsoku_dns && (this.#n = e.kinsoku_dns, this.#l(), this.#o = /* @__PURE__ */ RegExp(`[${this.#n}]`)), e.kinsoku_bura && (this.#r = e.kinsoku_bura, this.#c(), this.#l(), this.#s = /* @__PURE__ */ RegExp(`[${this.#r}]`)), "bura" in e && (this.bura = argChk_Boolean(e, "bura", !1)), this.break_fixed = argChk_Boolean(e, "break_fixed", this.break_fixed), this.break_fixed_left = argChk_Num(e, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = argChk_Num(e, "break_fixed_top", this.break_fixed_top);
37
+ e.kinsoku_sol && (this.#e = e.kinsoku_sol, this.#i = RegExp(`[${this.#e}]`)), e.kinsoku_eol && (this.#t = e.kinsoku_eol, this.#c(), this.#a = RegExp(`[${this.#t}]`)), e.kinsoku_dns && (this.#n = e.kinsoku_dns, this.#l(), this.#o = RegExp(`[${this.#n}]`)), e.kinsoku_bura && (this.#r = e.kinsoku_bura, this.#c(), this.#l(), this.#s = RegExp(`[${this.#r}]`)), "bura" in e && (this.bura = o(e, "bura", !1)), this.break_fixed = o(e, "break_fixed", this.break_fixed), this.break_fixed_left = i(e, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = i(e, "break_fixed_top", this.break_fixed_top);
38
38
  }
39
39
  #c() {
40
- let e = this.#t.length, p = this.#r.length;
41
- if (e < p) for (let p = 0; p < e; ++p) {
42
- let e = this.#t[p];
40
+ let e = this.#t.length, t = this.#r.length;
41
+ if (e < t) for (let t = 0; t < e; ++t) {
42
+ let e = this.#t[t];
43
43
  if (this.#r.includes(e)) throw `禁則の競合があります。文字 ${String(e)} がぶら下げ と 行末禁則 の両方に含まれます`;
44
44
  }
45
- else for (let e = 0; e < p; ++e) {
46
- let p = this.#r[e];
47
- if (this.#t.includes(p)) throw `禁則の競合があります。文字 ${String(p)} がぶら下げ と 行末禁則 の両方に含まれます`;
45
+ else for (let e = 0; e < t; ++e) {
46
+ let t = this.#r[e];
47
+ if (this.#t.includes(t)) throw `禁則の競合があります。文字 ${String(t)} がぶら下げ と 行末禁則 の両方に含まれます`;
48
48
  }
49
49
  }
50
50
  #l() {
51
- let e = this.#n.length, p = this.#r.length;
52
- if (e < p) for (let p = 0; p < e; ++p) {
53
- let e = this.#n[p];
51
+ let e = this.#n.length, t = this.#r.length;
52
+ if (e < t) for (let t = 0; t < e; ++t) {
53
+ let e = this.#n[t];
54
54
  if (this.#r.includes(e)) throw `禁則の競合があります。文字 ${String(e)} がぶら下げ と 分割禁止 の両方に含まれます`;
55
55
  }
56
- else for (let e = 0; e < p; ++e) {
57
- let p = this.#r[e];
58
- if (this.#n.includes(p)) throw `禁則の競合があります。文字 ${String(p)} がぶら下げ と 分割禁止 の両方に含まれます`;
56
+ else for (let e = 0; e < t; ++e) {
57
+ let t = this.#r[e];
58
+ if (this.#n.includes(t)) throw `禁則の競合があります。文字 ${String(t)} がぶら下げ と 分割禁止 の両方に含まれます`;
59
59
  }
60
60
  }
61
61
  reNew(e) {
62
62
  e.#u(this.#e, this.#t, this.#n, this.#r), e.break_fixed = this.break_fixed, e.break_fixed_left = this.break_fixed_left, e.break_fixed_top = this.break_fixed_top, e.bura = this.bura;
63
63
  }
64
- #u(e, p, m, h) {
65
- this.#e !== e && (this.#e = e, this.#i = /* @__PURE__ */ RegExp(`[${e}]`)), this.#t !== p && (this.#t = p, this.#a = /* @__PURE__ */ RegExp(`[${p}]`)), this.#n !== m && (this.#n = m, this.#o = /* @__PURE__ */ RegExp(`[${m}]`)), this.#r !== h && (this.#r = h, this.#s = /* @__PURE__ */ RegExp(`[${h}]`));
64
+ #u(e, t, n, r) {
65
+ this.#e !== e && (this.#e = e, this.#i = RegExp(`[${e}]`)), this.#t !== t && (this.#t = t, this.#a = RegExp(`[${t}]`)), this.#n !== n && (this.#n = n, this.#o = RegExp(`[${n}]`)), this.#r !== r && (this.#r = r, this.#s = RegExp(`[${r}]`));
66
66
  }
67
67
  record() {
68
68
  let e = {
@@ -71,267 +71,268 @@ var def行頭禁則 = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉ
71
71
  break_fixed_top: this.break_fixed_top,
72
72
  bura: this.bura
73
73
  };
74
- return this.#e === def行頭禁則 && (e.行頭禁則 = this.#e), this.#t === def行末禁則 && (e.行末禁則 = this.#t), this.#n === def分割禁止 && (e.分割禁止 = this.#n), this.#r === defぶら下げ && (e.ぶら下げ = this.#r), e;
74
+ return this.#e === C && (e.行頭禁則 = this.#e), this.#t === w && (e.行末禁則 = this.#t), this.#n === T && (e.分割禁止 = this.#n), this.#r === E && (e.ぶら下げ = this.#r), e;
75
75
  }
76
76
  playback(e) {
77
- e && (this.#u(e.行頭禁則 ?? def行頭禁則, e.行末禁則 ?? def行末禁則, e.分割禁止 ?? def分割禁止, e.ぶら下げ ?? defぶら下げ), this.break_fixed = e.break_fixed, this.break_fixed_left = e.break_fixed_left, this.break_fixed_top = e.break_fixed_top, this.bura = e.bura);
77
+ e && (this.#u(e.行頭禁則 ?? C, e.行末禁則 ?? w, e.分割禁止 ?? T, e.ぶら下げ ?? E), this.break_fixed = e.break_fixed, this.break_fixed_left = e.break_fixed_left, this.break_fixed_top = e.break_fixed_top, this.bura = e.bura);
78
78
  }
79
- hyph(e, p, m, h, g) {
80
- let _, v = 0, y = 2, b = (p) => (b = () => !1, h === p ? (h > 0 && (e.innerHTML = g.replaceAll("class=\"sn_ch\"", "class=\"sn_ch sn_ch_in_default\"")), !0) : p < 2);
79
+ hyph(e, t, n, r, i) {
80
+ let a, o = 0, s = 2, c = (t) => (c = () => !1, r === t ? (r > 0 && (e.innerHTML = i.replaceAll("class=\"sn_ch\"", "class=\"sn_ch sn_ch_in_default\"")), !0) : t < 2);
81
81
  do {
82
- if (_ = this.#f(e, p), v = _.length, b(v)) break;
83
- let h = -Infinity;
84
- for (; y < v; ++y) {
85
- let { elm: e, rect: p, ch: g } = _[y];
82
+ if (a = this.#f(e, t), o = a.length, c(o)) break;
83
+ let r = -Infinity;
84
+ for (; s < o; ++s) {
85
+ let { elm: e, rect: t, ch: i } = a[s];
86
86
  if (e.tagName === "RT") continue;
87
- let b = m ? p.y : p.x;
88
- if (h <= b || e.previousElementSibling?.tagName === "SPAN" && e.previousElementSibling?.innerHTML.includes("<br>") || e.parentElement?.previousElementSibling?.tagName === "SPAN" && e.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
89
- h = b, this.break_fixed || (this.break_fixed_left = p.x, this.break_fixed_top = p.y);
87
+ let c = n ? t.y : t.x;
88
+ if (r <= c || e.previousElementSibling?.tagName === "SPAN" && e.previousElementSibling?.innerHTML.includes("<br>") || e.parentElement?.previousElementSibling?.tagName === "SPAN" && e.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
89
+ r = c, this.break_fixed || (this.break_fixed_left = t.x, this.break_fixed_top = t.y);
90
90
  continue;
91
91
  }
92
- let x = this.#d(_, y), { elm: S, rect: C, ch: w } = _[x];
92
+ let l = this.#d(a, s), { elm: u, rect: d, ch: f } = a[l];
93
93
  if (!this.break_fixed) {
94
- this.break_fixed_left = C.x, this.break_fixed_top = C.y;
95
- let e = globalThis.getComputedStyle(S), p = parseFloat(e.fontSize);
96
- m ? this.break_fixed_top += p : this.break_fixed_left += p;
94
+ this.break_fixed_left = d.x, this.break_fixed_top = d.y;
95
+ let e = globalThis.getComputedStyle(u), t = parseFloat(e.fontSize);
96
+ n ? this.break_fixed_top += t : this.break_fixed_left += t;
97
97
  }
98
- h = -Infinity;
99
- let T = y, { cont: E, ins: D } = this.bura ? this.hyph_alg_bura(_, x, w, y) : this.hyph_alg(_, x, w, y, g);
100
- if (y = D, E) continue;
101
- let O = _[y].elm, k = O.parentElement, A = document.createElement("br");
102
- if (k.classList.contains("sn_tx")) k.insertBefore(A, O);
98
+ r = -Infinity;
99
+ let p = s, { cont: m, ins: h } = this.bura ? this.hyph_alg_bura(a, l, f, s) : this.hyph_alg(a, l, f, s, i);
100
+ if (s = h, m) continue;
101
+ let g = a[s].elm, _ = g.parentElement, v = document.createElement("br");
102
+ if (_.classList.contains("sn_tx")) _.insertBefore(v, g);
103
103
  else {
104
- let e = k.parentElement;
105
- e.classList.contains("sn_ch") ? e.parentElement.insertBefore(A, e) : e.insertBefore(A, k);
104
+ let e = _.parentElement;
105
+ e.classList.contains("sn_ch") ? e.parentElement.insertBefore(v, e) : e.insertBefore(v, _);
106
106
  }
107
- y += 2, y < T && (y = T), v = -1;
107
+ s += 2, s < p && (s = p), o = -1;
108
108
  break;
109
109
  }
110
- } while (v < 0);
111
- return [_, v];
112
- }
113
- #d(e, p) {
114
- let m = p - 1, { elm: h } = e[m];
115
- return h.tagName === "RT" ? m - Array.from(h.textContent).length : m - (h.style.textCombineUpright === "all" ? Array.from(h.textContent).length - 1 : 0);
116
- }
117
- #f(e, p) {
118
- let m = [];
119
- if (e.nodeType !== e.TEXT_NODE) return Array.from(e.childNodes).map((e) => this.#f(e, p)).flat();
120
- let h = e.ownerDocument.createRange();
121
- h.selectNodeContents(e);
122
- let g = 0, _ = h.endOffset;
123
- for (; g < _;) {
124
- h.setStart(e, g), h.setEnd(e, ++g);
125
- let _ = h.toString();
126
- m.push({
127
- ch: _,
128
- rect: p(h, _),
129
- elm: h.startContainer.parentElement
110
+ } while (o < 0);
111
+ return [a, o];
112
+ }
113
+ #d(e, t) {
114
+ let n = t - 1, { elm: r } = e[n];
115
+ return r.tagName === "RT" ? n - Array.from(r.textContent).length : n - (r.style.textCombineUpright === "all" ? Array.from(r.textContent).length - 1 : 0);
116
+ }
117
+ #f(e, t) {
118
+ let n = [];
119
+ if (e.nodeType !== e.TEXT_NODE) return Array.from(e.childNodes).map((e) => this.#f(e, t)).flat();
120
+ let r = e.ownerDocument.createRange();
121
+ r.selectNodeContents(e);
122
+ let i = 0, a = r.endOffset;
123
+ for (; i < a;) {
124
+ r.setStart(e, i), r.setEnd(e, ++i);
125
+ let a = r.toString();
126
+ n.push({
127
+ ch: a,
128
+ rect: t(r, a),
129
+ elm: r.startContainer.parentElement
130
130
  });
131
131
  }
132
- return h.detach(), m;
132
+ return r.detach(), n;
133
133
  }
134
- hyph_alg(e, p, m, h, g) {
135
- let _ = h;
136
- if (!this.#a.test(m)) {
137
- if (this.#i.test(g)) for (; (_ = this.#d(e, _)) >= 0 && this.#i.test(e[_].ch););
138
- else if (!(m === g && this.#o.test(m))) return {
134
+ hyph_alg(e, t, n, r, i) {
135
+ let a = r;
136
+ if (!this.#a.test(n)) {
137
+ if (this.#i.test(i)) for (; (a = this.#d(e, a)) >= 0 && this.#i.test(e[a].ch););
138
+ else if (!(n === i && this.#o.test(n))) return {
139
139
  cont: !0,
140
- ins: _ + 1
140
+ ins: a + 1
141
141
  };
142
142
  }
143
- for (_ = p; (_ = this.#d(e, _)) >= 0 && this.#a.test(e[_].ch););
143
+ for (a = t; (a = this.#d(e, a)) >= 0 && this.#a.test(e[a].ch););
144
144
  return {
145
145
  cont: !1,
146
- ins: _ + 1
146
+ ins: a + 1
147
147
  };
148
148
  }
149
- hyph_alg_bura(e, p, m, h) {
150
- let g = this.#d(e, p), { ch: _ } = e[g];
151
- if (this.#s.test(_) || this.#i.test(_)) {
152
- let h = p;
153
- (this.#s.test(m) || this.#i.test(m)) && ++h;
154
- let g = this.#d(e, h), { ch: _ } = e[g], { ch: v } = e[h];
155
- if (_ === v && this.#o.test(v)) return {
149
+ hyph_alg_bura(e, t, n, r) {
150
+ let i = this.#d(e, t), { ch: a } = e[i];
151
+ if (this.#s.test(a) || this.#i.test(a)) {
152
+ let r = t;
153
+ (this.#s.test(n) || this.#i.test(n)) && ++r;
154
+ let i = this.#d(e, r), { ch: a } = e[i], { ch: o } = e[r];
155
+ if (a === o && this.#o.test(o)) return {
156
156
  cont: !1,
157
- ins: g
157
+ ins: i
158
158
  };
159
- if (!this.#a.test(_)) return {
159
+ if (!this.#a.test(a)) return {
160
160
  cont: !1,
161
- ins: h
161
+ ins: r
162
162
  };
163
- h = g;
163
+ r = i;
164
164
  do
165
- if (!this.#a.test(e[h].ch)) break;
166
- while ((h = this.#d(e, h)) >= 0);
165
+ if (!this.#a.test(e[r].ch)) break;
166
+ while ((r = this.#d(e, r)) >= 0);
167
167
  return {
168
168
  cont: !1,
169
- ins: h + 1
169
+ ins: r + 1
170
170
  };
171
171
  }
172
- let v = this.#d(e, g);
173
- if (h >= 3) {
174
- let { ch: p } = e[v];
175
- if (this.#o.test(_) && p === _) return {
172
+ let o = this.#d(e, i);
173
+ if (r >= 3) {
174
+ let { ch: t } = e[o];
175
+ if (this.#o.test(a) && t === a) return {
176
176
  cont: !1,
177
- ins: v
177
+ ins: o
178
178
  };
179
- if (this.#a.test(p)) {
180
- let p = v;
181
- for (; (p = this.#d(e, p)) >= 0 && this.#a.test(e[p].ch););
179
+ if (this.#a.test(t)) {
180
+ let t = o;
181
+ for (; (t = this.#d(e, t)) >= 0 && this.#a.test(e[t].ch););
182
182
  return {
183
183
  cont: !1,
184
- ins: p + 1
184
+ ins: t + 1
185
185
  };
186
186
  }
187
187
  }
188
188
  return {
189
189
  cont: !1,
190
- ins: g
190
+ ins: i
191
191
  };
192
192
  }
193
193
  };
194
- function htm2tx(e, p, m, h, g, _ = !0) {
195
- let v = {
194
+ //#endregion
195
+ //#region src/sn/htm2tx.ts
196
+ function M(e, t, n, r, i, a = !0) {
197
+ let o = {
196
198
  escape: (e) => e.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
197
199
  mimeType: (e) => {
198
- let p = w(e).toLowerCase();
199
- return y()[p] || "";
200
+ let t = f(e).toLowerCase();
201
+ return s()[t] || "";
200
202
  },
201
- dataAsUrl: k,
202
- isDataUrl: T,
203
- resolveUrl: D,
204
- getAndEncode: O,
203
+ dataAsUrl: _,
204
+ isDataUrl: p,
205
+ resolveUrl: h,
206
+ getAndEncode: g,
205
207
  asArray: (e) => {
206
- let p = [], m = e.length;
207
- for (let h = 0; h < m; ++h) p.push(e[h]);
208
- return p;
208
+ let t = [], n = e.length;
209
+ for (let r = 0; r < n; ++r) t.push(e[r]);
210
+ return t;
209
211
  }
210
212
  };
211
- function y() {
212
- let e = "application/font-woff", p = "image/jpeg";
213
+ function s() {
214
+ let e = "application/font-woff", t = "image/jpeg";
213
215
  return {
214
216
  woff: e,
215
217
  woff2: e,
216
218
  ttf: "application/font-truetype",
217
219
  eot: "application/vnd.ms-fontobject",
218
220
  png: "image/png",
219
- jpg: p,
220
- jpeg: p,
221
+ jpg: t,
222
+ jpeg: t,
221
223
  gif: "image/gif",
222
224
  tiff: "image/tiff",
223
225
  svg: "image/svg+xml"
224
226
  };
225
227
  }
226
- let x = A(), S = j();
227
- function C(e) {
228
- return S.resolveAll().then((p) => {
229
- let m = document.createElement("style");
230
- return e.appendChild(m), m.appendChild(document.createTextNode(p)), e;
228
+ let l = v(), u = y();
229
+ function d(e) {
230
+ return u.resolveAll().then((t) => {
231
+ let n = document.createElement("style");
232
+ return e.appendChild(n), n.appendChild(document.createTextNode(t)), e;
231
233
  });
232
234
  }
233
- function w(e) {
235
+ function f(e) {
234
236
  return /\.([^./]*?)$/g.exec(e)?.[1] ?? "";
235
237
  }
236
- function T(e) {
238
+ function p(e) {
237
239
  return e.search(/^(data:)/) !== -1;
238
240
  }
239
- function D(e, p) {
240
- let m = document.implementation.createHTMLDocument(), h = m.createElement("base");
241
- m.head.appendChild(h);
242
- let g = m.createElement("a");
243
- return m.body.appendChild(g), h.href = p, g.href = e, g.href;
244
- }
245
- function O(e) {
246
- let p = 3e4;
247
- return new Promise(function(m) {
248
- let h = new XMLHttpRequest();
249
- h.onreadystatechange = g, h.ontimeout = _, h.responseType = "blob", h.timeout = p, h.open("GET", e, !0), h.send();
250
- function g() {
251
- if (h.readyState !== 4) return;
252
- if (h.status !== 200) {
253
- v("cannot fetch resource: " + e + ", status: " + h.status);
241
+ function h(e, t) {
242
+ let n = document.implementation.createHTMLDocument(), r = n.createElement("base");
243
+ n.head.appendChild(r);
244
+ let i = n.createElement("a");
245
+ return n.body.appendChild(i), r.href = t, i.href = e, i.href;
246
+ }
247
+ function g(e) {
248
+ return new Promise(function(t) {
249
+ let n = new XMLHttpRequest();
250
+ n.onreadystatechange = r, n.ontimeout = i, n.responseType = "blob", n.timeout = 3e4, n.open("GET", e, !0), n.send();
251
+ function r() {
252
+ if (n.readyState !== 4) return;
253
+ if (n.status !== 200) {
254
+ a("cannot fetch resource: " + e + ", status: " + n.status);
254
255
  return;
255
256
  }
256
- let p = new FileReader();
257
- p.onloadend = function() {
258
- let e = p.result.toString().split(/,/)[1];
259
- m(e);
260
- }, p.readAsDataURL(h.response);
257
+ let r = new FileReader();
258
+ r.onloadend = function() {
259
+ let e = r.result.toString().split(/,/)[1];
260
+ t(e);
261
+ }, r.readAsDataURL(n.response);
261
262
  }
262
- function _() {
263
- v("timeout of " + p + "ms occured while fetching resource: " + e);
263
+ function i() {
264
+ a("timeout of 30000ms occured while fetching resource: " + e);
264
265
  }
265
- function v(e) {
266
- console.error(e), m("");
266
+ function a(e) {
267
+ console.error(e), t("");
267
268
  }
268
269
  });
269
270
  }
270
- function k(e, p) {
271
- return "data:" + p + ";base64," + e;
271
+ function _(e, t) {
272
+ return "data:" + t + ";base64," + e;
272
273
  }
273
- function A() {
274
+ function v() {
274
275
  let e = /url\(['"]?([^'"]+?)['"]?\)/g;
275
276
  return {
276
- inlineAll: g,
277
- shouldProcess: p
277
+ inlineAll: i,
278
+ shouldProcess: t
278
279
  };
279
- function p(p) {
280
- return p.search(e) !== -1;
280
+ function t(t) {
281
+ return t.search(e) !== -1;
281
282
  }
282
- function m(p) {
283
- let m = [], h;
284
- for (; h = e.exec(p);) m.push(h[1]);
285
- return m.filter(function(e) {
286
- return !v.isDataUrl(e);
283
+ function n(t) {
284
+ let n = [], r;
285
+ for (; r = e.exec(t);) n.push(r[1]);
286
+ return n.filter(function(e) {
287
+ return !o.isDataUrl(e);
287
288
  });
288
289
  }
289
- function h(e, p, m, h) {
290
- return Promise.resolve(p).then((e) => m ? v.resolveUrl(e, m) : e).then(h || v.getAndEncode).then((e) => v.dataAsUrl(e, v.mimeType(p))).then((m) => e.replace(g(p), "$1" + m + "$3"));
291
- function g(e) {
292
- return RegExp("(url\\(['\"]?)(" + v.escape(e) + ")(['\"]?\\))", "g");
290
+ function r(e, t, n, r) {
291
+ return Promise.resolve(t).then((e) => n ? o.resolveUrl(e, n) : e).then(r || o.getAndEncode).then((e) => o.dataAsUrl(e, o.mimeType(t))).then((n) => e.replace(i(t), "$1" + n + "$3"));
292
+ function i(e) {
293
+ return RegExp("(url\\(['\"]?)(" + o.escape(e) + ")(['\"]?\\))", "g");
293
294
  }
294
295
  }
295
- function g(e, g, _) {
296
- if (v()) return Promise.resolve(e);
297
- return Promise.resolve(e).then(m).then((p) => {
298
- let m = Promise.resolve(e);
299
- for (let e of p) m = m.then((p) => h(p, e, g, _));
300
- return m;
296
+ function i(e, i, a) {
297
+ if (o()) return Promise.resolve(e);
298
+ return Promise.resolve(e).then(n).then((t) => {
299
+ let n = Promise.resolve(e);
300
+ for (let e of t) n = n.then((t) => r(t, e, i, a));
301
+ return n;
301
302
  });
302
- function v() {
303
- return !p(e);
303
+ function o() {
304
+ return !t(e);
304
305
  }
305
306
  }
306
307
  }
307
- function j() {
308
+ function y() {
308
309
  return {
309
310
  resolveAll: e,
310
- impl: { readAll: p }
311
+ impl: { readAll: t }
311
312
  };
312
313
  function e() {
313
- return p().then((e) => Promise.allSettled(e.map((e) => e.resolve()))).then((e) => e.join("\n"));
314
+ return t().then((e) => Promise.allSettled(e.map((e) => e.resolve()))).then((e) => e.join("\n"));
314
315
  }
315
- function p() {
316
- return Promise.resolve(v.asArray(document.styleSheets)).then(p).then(e).then((e) => e.map(m));
316
+ function t() {
317
+ return Promise.resolve(o.asArray(document.styleSheets)).then(t).then(e).then((e) => e.map(n));
317
318
  function e(e) {
318
- return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => x.shouldProcess(e.style.getPropertyValue("src")));
319
+ return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => l.shouldProcess(e.style.getPropertyValue("src")));
319
320
  }
320
- function p(e) {
321
- let p = [];
322
- for (let m of e) try {
323
- if (m.href) continue;
324
- v.asArray(m.cssRules || []).forEach(p.push.bind(p));
321
+ function t(e) {
322
+ let t = [];
323
+ for (let n of e) try {
324
+ if (n.href) continue;
325
+ o.asArray(n.cssRules || []).forEach(t.push.bind(t));
325
326
  } catch (e) {
326
- console.error("Error while reading CSS rules from " + m.href, String(e));
327
+ console.error("Error while reading CSS rules from " + n.href, String(e));
327
328
  }
328
- return p;
329
+ return t;
329
330
  }
330
- function m(e) {
331
+ function n(e) {
331
332
  return {
332
333
  resolve: function() {
333
- let p = (e.parentStyleSheet || {}).href;
334
- return x.inlineAll(e.cssText, p);
334
+ let t = (e.parentStyleSheet || {}).href;
335
+ return l.inlineAll(e.cssText, t);
335
336
  },
336
337
  src() {
337
338
  return e.style.getPropertyValue("src");
@@ -340,38 +341,43 @@ function htm2tx(e, p, m, h, g, _ = !0) {
340
341
  }
341
342
  }
342
343
  }
343
- Promise.resolve(p).then((e) => {
344
- let v = e.cloneNode(!0);
345
- return v.style.padding = "0px", v.style.paddingRight = h + "px", v.style.paddingTop = g + "px", v.style.left = "0px", v.style.top = "0px", v.style.width = m.$width - m.pad_left - m.pad_right + "px", v.style.height = m.$height - m.pad_top - m.pad_bottom + "px", p.hidden = _, v;
346
- }).then(C).then((e) => {
344
+ Promise.resolve(t).then((e) => {
345
+ let o = e.cloneNode(!0);
346
+ return o.style.padding = "0px", o.style.paddingRight = r + "px", o.style.paddingTop = i + "px", o.style.left = "0px", o.style.top = "0px", o.style.width = n.$width - n.pad_left - n.pad_right + "px", o.style.height = n.$height - n.pad_top - n.pad_bottom + "px", t.hidden = a, o;
347
+ }).then(d).then((e) => {
347
348
  e.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
348
- let p = new Image();
349
- return p.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${String(m.$width)}px" height="${String(m.$height)}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(e).replaceAll("#", "%23").replaceAll("\n", "%0A")}</foreignObject></svg>`, new Promise((e) => {
350
- p.onload = () => e(p);
349
+ let t = new Image();
350
+ return t.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${String(n.$width)}px" height="${String(n.$height)}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(e).replaceAll("#", "%23").replaceAll("\n", "%0A")}</foreignObject></svg>`, new Promise((e) => {
351
+ t.onload = () => e(t);
351
352
  });
352
- }).then((e) => new Promise((p) => setTimeout(() => p(e), 100))).then((p) => {
353
- let h = document.createElement("canvas");
354
- h.width = m.$width, h.height = m.$height, h.getContext("2d").drawImage(p, 0, 0), e(Texture.from(h));
355
- }).catch((e) => DebugMng.myTrace(`goTxt() = ${String(e)}`));
353
+ }).then((e) => new Promise((t) => setTimeout(() => t(e), 100))).then((t) => {
354
+ let r = document.createElement("canvas");
355
+ r.width = n.$width, r.height = n.$height, r.getContext("2d").drawImage(t, 0, 0), e(c.from(r));
356
+ }).catch((e) => m.myTrace(`goTxt() = ${String(e)}`));
356
357
  }
357
- var TxtStage = class p extends Container {
358
+ //#endregion
359
+ //#region src/sn/TxtStage.ts
360
+ var N = class t extends u {
361
+ ctn;
362
+ canFocus;
363
+ sys;
358
364
  static #e;
359
365
  static #t;
360
- static init(e, m) {
361
- p.#e = e, p.#t = m, CmnTween.addGrp(p.grp);
366
+ static init(e, n) {
367
+ t.#e = e, t.#t = n, v.addGrp(t.grp);
362
368
  }
363
- static grp = new Group();
369
+ static grp = new g();
364
370
  static #n;
365
371
  static #r;
366
- static setEvtMng(e, m) {
367
- p.#n = e, p.#r = m;
372
+ static setEvtMng(e, n) {
373
+ t.#n = e, t.#r = n;
368
374
  }
369
375
  static destroy() {
370
- p.grp.removeAll(), p.#T = Object.create(null), p.#D = Object.create(null), p.delBreak();
376
+ t.grp.removeAll(), t.#T = Object.create(null), t.#D = Object.create(null), t.delBreak();
371
377
  }
372
378
  #i = document.createElement("span");
373
- #a = new Container();
374
- #o = new Graphics();
379
+ #a = new u();
380
+ #o = new f();
375
381
  static #s = {
376
382
  "background-color": 0,
377
383
  "border-bottom-width": 0,
@@ -383,24 +389,24 @@ var TxtStage = class p extends Container {
383
389
  "margin-right": 0,
384
390
  "margin-top": 0
385
391
  };
386
- #c = new Hyphenation();
392
+ #c = new j();
387
393
  noticeCompTxt = () => {};
388
394
  #l;
389
- constructor(m, h, g) {
390
- super(), this.ctn = m, this.canFocus = h, this.sys = g, this.#i.classList.add("sn_tx"), this.#i.style.position = "absolute", p.#t.view.parentElement.appendChild(this.#i), this.addChild(this.#a), this.addChild(this.#o), this.#o.name = "grpDbgMasume";
391
- let _ = CmnLib.debugLog ? ({ ch: e, rect: { x: p, y: m, width: h, height: g } }) => console.log(`🍌 masume ch:${e} x:${String(p)} y:${String(m)} w:${String(h)} h:${String(g)}`) : () => {};
392
- this.#l = p.#e.oCfg.debug.masume ? (e) => {
393
- _(e);
394
- let { x: p, y: m, width: h, height: g } = e.rect;
395
- this.#o.beginFill(6737151, .5).lineStyle(2, 16724736, 1).drawRect(p, m, h, g).endFill();
396
- } : () => {}, this.noticeCompTxt = g.isApp && p.#e.oCfg.debug.dumpHtm ? () => {
397
- Reading.notifyEndProc(RPN_COMP_CHIN);
398
- let h = this.#i.innerHTML;
399
- if (h === "") return;
400
- let { fn: _, ln: v } = p.#r.nowScrFnLn(), y = `dumpHtm ${m.name.slice(0, -7).replaceAll(":", "=")}(fn=${_} line=${String(v)})`;
401
- g.outputFile(g.path_downloads + y + ".htm", `<!doctype html><html><head><meta charset=utf-8><title>${y}</title>
402
- <h1>${y}</h1>${h.replaceAll(/ class="sn_ch"|animation-delay: \d+ms; ?| data-add="{&quot;ch_in_style&quot;:&quot;default&quot;, &quot;ch_out_style&quot;:&quot;default&quot;}"/g, "").replaceAll(" style=\"\"", "").replaceAll(/(<\/?ruby>)/g, "\n$1\n").replaceAll(/<(br|\/span)>/g, "<$1>\n")}`);
403
- } : () => Reading.notifyEndProc(RPN_COMP_CHIN);
395
+ constructor(n, r, i) {
396
+ super(), this.ctn = n, this.canFocus = r, this.sys = i, this.#i.classList.add("sn_tx"), this.#i.style.position = "absolute", t.#t.view.parentElement.appendChild(this.#i), this.addChild(this.#a), this.addChild(this.#o), this.#o.name = "grpDbgMasume";
397
+ let a = s.debugLog ? ({ ch: e, rect: { x: t, y: n, width: r, height: i } }) => console.log(`🍌 masume ch:${e} x:${String(t)} y:${String(n)} w:${String(r)} h:${String(i)}`) : () => {};
398
+ this.#l = t.#e.oCfg.debug.masume ? (e) => {
399
+ a(e);
400
+ let { x: t, y: n, width: r, height: i } = e.rect;
401
+ this.#o.beginFill(6737151, .5).lineStyle(2, 16724736, 1).drawRect(t, n, r, i).endFill();
402
+ } : () => {}, this.noticeCompTxt = i.isApp && t.#e.oCfg.debug.dumpHtm ? () => {
403
+ y.notifyEndProc(e);
404
+ let r = this.#i.innerHTML;
405
+ if (r === "") return;
406
+ let { fn: a, ln: o } = t.#r.nowScrFnLn(), s = `dumpHtm ${n.name.slice(0, -7).replaceAll(":", "=")}(fn=${a} line=${String(o)})`;
407
+ i.outputFile(i.path_downloads + s + ".htm", `<!doctype html><html><head><meta charset=utf-8><title>${s}</title>
408
+ <h1>${s}</h1>${r.replaceAll(/ class="sn_ch"|animation-delay: \d+ms; ?| data-add="{&quot;ch_in_style&quot;:&quot;default&quot;, &quot;ch_out_style&quot;:&quot;default&quot;}"/g, "").replaceAll(" style=\"\"", "").replaceAll(/(<\/?ruby>)/g, "\n$1\n").replaceAll(/<(br|\/span)>/g, "<$1>\n")}`);
409
+ } : () => y.notifyEndProc(e);
404
410
  }
405
411
  #u = {
406
412
  fontsize: 24,
@@ -412,37 +418,37 @@ var TxtStage = class p extends Container {
412
418
  pad_bottom: 0
413
419
  };
414
420
  lay(e) {
415
- let m = this.#i.style;
421
+ let n = this.#i.style;
416
422
  if ("style" in e) if (e.style) {
417
- let h = document.createElement("span");
418
- h.style.cssText = e.style;
419
- let g = h.style.length;
420
- for (let e = 0; e < g; ++e) {
421
- let g = h.style[e];
422
- if (g in p.#s) {
423
- DebugMng.myTrace(`${String(g)}は指定できません`, "W");
423
+ let r = document.createElement("span");
424
+ r.style.cssText = e.style;
425
+ let i = r.style.length;
426
+ for (let e = 0; e < i; ++e) {
427
+ let i = r.style[e];
428
+ if (i in t.#s) {
429
+ m.myTrace(`${String(i)}は指定できません`, "W");
424
430
  continue;
425
431
  }
426
- m[g] = h.style[g];
432
+ n[i] = r.style[i];
427
433
  }
428
- !h.style.opacity && "alpha" in e && (m.opacity = String(this.ctn.alpha));
434
+ !r.style.opacity && "alpha" in e && (n.opacity = String(this.ctn.alpha));
429
435
  } else this.#i.style.cssText = "";
430
- else "alpha" in e && (m.opacity = String(this.ctn.alpha));
431
- if ("width" in e && (m.width = String(e.width ?? "0") + "px"), "height" in e && (m.height = String(e.height ?? "0") + "px"), "pl" in e && (m.paddingLeft = String(e.pl ?? "0") + "px"), "pr" in e && (m.paddingRight = String(e.pr ?? "0") + "px"), "pt" in e && (m.paddingTop = String(e.pt ?? "0") + "px"), "pb" in e && (m.paddingBottom = String(e.pb ?? "0") + "px"), this.#c.lay(e), this.#f(), this.#p = this.ctn.position.x, m.transformOrigin = `${String(this.ctn.pivot.x)}px ${String(this.ctn.pivot.y)}px`, this.cvsResize(), m.display = this.ctn.visible ? "inline" : "none", ":redraw" in e && this.#y > 0) {
436
+ else "alpha" in e && (n.opacity = String(this.ctn.alpha));
437
+ if ("width" in e && (n.width = String(e.width ?? "0") + "px"), "height" in e && (n.height = String(e.height ?? "0") + "px"), "pl" in e && (n.paddingLeft = String(e.pl ?? "0") + "px"), "pr" in e && (n.paddingRight = String(e.pr ?? "0") + "px"), "pt" in e && (n.paddingTop = String(e.pt ?? "0") + "px"), "pb" in e && (n.paddingBottom = String(e.pb ?? "0") + "px"), this.#c.lay(e), this.#f(), this.#p = this.ctn.position.x, n.transformOrigin = `${String(this.ctn.pivot.x)}px ${String(this.ctn.pivot.y)}px`, this.cvsResize(), n.display = this.ctn.visible ? "inline" : "none", ":redraw" in e && this.#y > 0) {
432
438
  let e = [this.#i.innerHTML.replaceAll(/(animation-delay: )\d+ms/g, "$10ms"), "<span class='sn_ch' data-add='{\"ch_in_style\":\"default\"}'>&emsp;</span>"];
433
439
  this.#N(), this.goTxt(e, !0);
434
440
  }
435
441
  }
436
442
  #d = 0;
437
443
  #f() {
438
- let e = this.#i.style, p = parseFloat(e.fontSize || "0");
439
- this.#u.fontsize = p, this.#u.pad_left = parseFloat(e.paddingLeft || "0"), this.#u.pad_right = parseFloat(e.paddingRight || "0"), this.#u.pad_top = parseFloat(e.paddingTop || "0"), this.#u.pad_bottom = parseFloat(e.paddingBottom || "0"), this.#u.$width = parseFloat(e.width || "0"), this.#u.$height = parseFloat(e.height || "0"), this.position.set(this.#u.pad_left, this.#u.pad_top), this.#m = e.writingMode === "vertical-rl", this.#h = 0, this.#g = 0;
440
- let m = e.lineHeight ?? "0";
441
- this.#d = this.#m ? 0 : (m.endsWith("px") ? parseFloat(m) : p * parseFloat(m) - p) / 2;
444
+ let e = this.#i.style, t = parseFloat(e.fontSize || "0");
445
+ this.#u.fontsize = t, this.#u.pad_left = parseFloat(e.paddingLeft || "0"), this.#u.pad_right = parseFloat(e.paddingRight || "0"), this.#u.pad_top = parseFloat(e.paddingTop || "0"), this.#u.pad_bottom = parseFloat(e.paddingBottom || "0"), this.#u.$width = parseFloat(e.width || "0"), this.#u.$height = parseFloat(e.height || "0"), this.position.set(this.#u.pad_left, this.#u.pad_top), this.#m = e.writingMode === "vertical-rl", this.#h = 0, this.#g = 0;
446
+ let n = e.lineHeight ?? "0";
447
+ this.#d = this.#m ? 0 : (n.endsWith("px") ? parseFloat(n) : t * parseFloat(n) - t) / 2;
442
448
  }
443
449
  cvsResize() {
444
- let e = this.#i.style, p = this.sys.cvsScale;
445
- e.left = `${String(this.sys.ofsLeft4elm + this.#p * p)}px`, e.top = `${String(this.sys.ofsTop4elm + this.ctn.position.y * p)}px`, e.transform = `rotate(${String(this.ctn.angle)}deg) scale(${String(this.ctn.scale.x * p)}, ${String(this.ctn.scale.y * p)})`;
450
+ let e = this.#i.style, t = this.sys.cvsScale;
451
+ e.left = `${String(this.sys.ofsLeft4elm + this.#p * t)}px`, e.top = `${String(this.sys.ofsTop4elm + this.ctn.position.y * t)}px`, e.transform = `rotate(${String(this.ctn.angle)}deg) scale(${String(this.ctn.scale.x * t)}, ${String(this.ctn.scale.y * t)})`;
446
452
  }
447
453
  #p = 0;
448
454
  #m = !1;
@@ -460,186 +466,186 @@ var TxtStage = class p extends Container {
460
466
  get getHeight() {
461
467
  return this.#u.$height;
462
468
  }
463
- setMySize(e, p) {
464
- this.#u.$width = e, this.#u.$height = p, this.#i.style.width = String(this.#u.$width) + "px", this.#i.style.height = String(this.#u.$height) + "px";
469
+ setMySize(e, t) {
470
+ this.#u.$width = e, this.#u.$height = t, this.#i.style.width = String(this.#u.$width) + "px", this.#i.style.height = String(this.#u.$height) + "px";
465
471
  }
466
472
  #_ = [];
467
- goTxt(e, p) {
468
- let m = () => this.#x(e, p);
469
- this.#_.push(m) === 1 && m();
473
+ goTxt(e, t) {
474
+ let n = () => this.#x(e, t);
475
+ this.#_.push(n) === 1 && n();
470
476
  }
471
477
  #v = [];
472
478
  #y = 0;
473
479
  static #b = "<span class='sn_ch sn_ch_last'>&emsp;</span>";
474
- #x(e, m) {
475
- p.#O.visible = !1;
476
- let h = this.#v.length, g = "";
477
- if (h === 0) {
478
- if (p.#e.oCfg.debug.masume && (CmnLib.debugLog && console.log(`🍌 masume ${this.name} v:${String(this.visible)} l:${String(this.x)} t:${String(this.y)} a:${String(this.alpha)} pl:${String(this.#u.pad_left)} pr:${String(this.#u.pad_right)} pt:${String(this.#u.pad_top)} pb:${String(this.#u.pad_bottom)} w:${String(this.#u.$width)} h:${String(this.#u.$height)}`), this.#o.clear().beginFill(3407616, .2).lineStyle(1, 3407616, 1).drawRect(-this.#u.pad_left, -this.#u.pad_top, this.#u.$width, this.#u.$height).endFill().beginFill(13311, .2).lineStyle(2, 13311, 1).drawRect(0, 0, this.#u.$width - this.#u.pad_left - this.#u.pad_right, this.#u.$height - this.#u.pad_top - this.#u.pad_bottom).endFill()), this.#i.innerHTML = [...e].join("").replaceAll(/[\n\t]/g, "") + p.#b, !this.#c.break_fixed) {
479
- let e = globalThis.getComputedStyle(this.#i), p = parseFloat(e.fontSize);
480
- this.#m ? (this.#c.break_fixed_left = (this.#u.$width - this.#u.pad_left - this.#u.pad_right - p * 1.5) * this.sys.cvsScale, this.#c.break_fixed_top = 0) : (this.#c.break_fixed_left = 0, this.#c.break_fixed_top = p / 2 * this.sys.cvsScale);
480
+ #x(e, n) {
481
+ t.#O.visible = !1;
482
+ let r = this.#v.length, i = "";
483
+ if (r === 0) {
484
+ if (t.#e.oCfg.debug.masume && (s.debugLog && console.log(`🍌 masume ${this.name} v:${String(this.visible)} l:${String(this.x)} t:${String(this.y)} a:${String(this.alpha)} pl:${String(this.#u.pad_left)} pr:${String(this.#u.pad_right)} pt:${String(this.#u.pad_top)} pb:${String(this.#u.pad_bottom)} w:${String(this.#u.$width)} h:${String(this.#u.$height)}`), this.#o.clear().beginFill(3407616, .2).lineStyle(1, 3407616, 1).drawRect(-this.#u.pad_left, -this.#u.pad_top, this.#u.$width, this.#u.$height).endFill().beginFill(13311, .2).lineStyle(2, 13311, 1).drawRect(0, 0, this.#u.$width - this.#u.pad_left - this.#u.pad_right, this.#u.$height - this.#u.pad_top - this.#u.pad_bottom).endFill()), this.#i.innerHTML = [...e].join("").replaceAll(/[\n\t]/g, "") + t.#b, !this.#c.break_fixed) {
485
+ let e = globalThis.getComputedStyle(this.#i), t = parseFloat(e.fontSize);
486
+ this.#m ? (this.#c.break_fixed_left = (this.#u.$width - this.#u.pad_left - this.#u.pad_right - t * 1.5) * this.sys.cvsScale, this.#c.break_fixed_top = 0) : (this.#c.break_fixed_left = 0, this.#c.break_fixed_top = t / 2 * this.sys.cvsScale);
481
487
  }
482
- } else g = this.#i.innerHTML, --h, this.#i.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#i.querySelectorAll(":scope > br").forEach((e) => e.remove()), this.#i.insertAdjacentHTML("beforeend", e.slice(this.#y).join("").replaceAll(/[\n\t]/g, "") + p.#b);
488
+ } else i = this.#i.innerHTML, --r, this.#i.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#i.querySelectorAll(":scope > br").forEach((e) => e.remove()), this.#i.insertAdjacentHTML("beforeend", e.slice(this.#y).join("").replaceAll(/[\n\t]/g, "") + t.#b);
483
489
  this.#i.querySelectorAll(".sn_ch:has(> ruby)").forEach((e) => {
484
490
  e.style.background = "";
485
491
  }), this.#y = e.length;
486
- let _ = this.sys.cvsScale, b = this.#i.getBoundingClientRect(), w = b.left + this.#u.pad_left, T = b.top + this.#u.pad_top, E;
487
- if (_ === 1) E = (e, p) => {
488
- let m = e.getBoundingClientRect();
489
- return new Rectangle(m.left - w, m.top - T, m.width, m.height + ("gjqy".includes(p) ? this.#d : 0));
492
+ let a = this.sys.cvsScale, c = this.#i.getBoundingClientRect(), f = c.left + this.#u.pad_left, p = c.top + this.#u.pad_top, m;
493
+ if (a === 1) m = (e, t) => {
494
+ let n = e.getBoundingClientRect();
495
+ return new l(n.left - f, n.top - p, n.width, n.height + ("gjqy".includes(t) ? this.#d : 0));
490
496
  };
491
497
  else {
492
- let e = this.sys.ofsPadLeft_Dom2PIXI + b.left * (1 - _), p = this.sys.ofsPadTop_Dom2PIXI + b.top * (1 - _);
493
- E = (m, h) => {
494
- let g = m.getBoundingClientRect();
495
- return new Rectangle((g.left - e) / _ - w, (g.top - p) / _ - T, g.width / _, (g.height + ("gjqy".includes(h) ? this.#d : 0)) / _);
498
+ let e = this.sys.ofsPadLeft_Dom2PIXI + c.left * (1 - a), t = this.sys.ofsPadTop_Dom2PIXI + c.top * (1 - a);
499
+ m = (n, r) => {
500
+ let i = n.getBoundingClientRect();
501
+ return new l((i.left - e) / a - f, (i.top - t) / a - p, i.width / a, (i.height + ("gjqy".includes(r) ? this.#d : 0)) / a);
496
502
  };
497
503
  }
498
- let [D, O] = this.#c.hyph(this.#i, E, this.#m, h, g);
499
- this.#v = D;
500
- let k = CmnTween.ease(this.#A);
501
- for (let e = h; e < O; ++e) {
502
- let m = this.#v[e], { elm: { dataset: h, parentElement: g }, rect: _ } = m, y = JSON.parse(h.arg ?? "{\"delay\": 0}"), b = JSON.parse(h.add ?? "{}"), x = p.#T[b.ch_in_style];
503
- if (this.#l(m), h.cmd === "grp") {
504
- let e = new Container();
505
- this.#a.addChild(e), new SpritesMng(y.pic, e, (p) => {
506
- this.#C(e, y, b, _, k, x ?? {}), e.parent || e.removeChild(p);
504
+ let [h, g] = this.#c.hyph(this.#i, m, this.#m, r, i);
505
+ this.#v = h;
506
+ let _ = v.ease(this.#A);
507
+ for (let e = r; e < g; ++e) {
508
+ let n = this.#v[e], { elm: { dataset: r, parentElement: i }, rect: a } = n, s = JSON.parse(r.arg ?? "{\"delay\": 0}"), c = JSON.parse(r.add ?? "{}"), l = t.#T[c.ch_in_style];
509
+ if (this.#l(n), r.cmd === "grp") {
510
+ let e = new u();
511
+ this.#a.addChild(e), new b(s.pic, e, (t) => {
512
+ this.#C(e, s, c, a, _, l ?? {}), e.parent || e.removeChild(t);
507
513
  });
508
514
  }
509
- if (h.lnk) {
510
- let m = g.closest("[data-arg]"), h = JSON.parse(m.dataset.arg ?? "{}");
511
- h.key = `lnk=[${String(e)}] ` + this.name;
512
- let y = new Sprite();
513
- this.#C(y, h, b, _, k, x ?? {});
514
- let S = h.style ?? "", w = S + (h.style_hover ?? ""), T = S + (h.style_clicked ?? ""), E = h.r_style ?? "", D = E + (h.r_style_hover ?? ""), O = E + (h.r_style_clicked ?? ""), A = Array.from(m.getElementsByTagName("rt"));
515
- for (let e of A) e.dataset.st_r_bk = e.style.cssText;
516
- let j = m.style.cssText, M = (e, p) => {
517
- m.style.cssText = j + e;
518
- for (let e of A) e.style.cssText = e.dataset.st_r_bk + p;
515
+ if (r.lnk) {
516
+ let n = i.closest("[data-arg]"), r = JSON.parse(n.dataset.arg ?? "{}");
517
+ r.key = `lnk=[${String(e)}] ` + this.name;
518
+ let s = new d();
519
+ this.#C(s, r, c, a, _, l ?? {});
520
+ let u = r.style ?? "", f = u + (r.style_hover ?? ""), p = u + (r.style_clicked ?? ""), m = r.r_style ?? "", h = m + (r.r_style_hover ?? ""), g = m + (r.r_style_clicked ?? ""), v = Array.from(n.getElementsByTagName("rt"));
521
+ for (let e of v) e.dataset.st_r_bk = e.style.cssText;
522
+ let y = n.style.cssText, b = (e, t) => {
523
+ n.style.cssText = y + e;
524
+ for (let e of v) e.style.cssText = e.dataset.st_r_bk + t;
519
525
  };
520
- argChk_Boolean(h, "enabled", !0) ? p.#n.button(h, y, () => M(S, E), () => this.canFocus() ? (M(w, D), !0) : !1, () => M(T, O)) : M(S + (h.style_disable ?? "color: gray;"), E + (h.r_style_disable ?? "color: gray;")), this.#a.addChild(y);
526
+ o(r, "enabled", !0) ? t.#n.button(r, s, () => b(u, m), () => this.canFocus() ? (b(f, h), !0) : !1, () => b(p, g)) : b(u + (r.style_disable ?? "color: gray;"), m + (r.r_style_disable ?? "color: gray;")), this.#a.addChild(s);
521
527
  }
522
528
  }
523
- let j = Array.from(this.#i.getElementsByClassName("sn_ch_yet"));
529
+ let y = Array.from(this.#i.getElementsByClassName("sn_ch_yet"));
524
530
  this.#S = () => {
525
531
  this.#S = () => !1;
526
- for (let e of j) e.className = "sn_ch";
527
- p.#O.position.set(this.#c.break_fixed_left, this.#c.break_fixed_top), p.#O.visible = !0, this.noticeCompTxt();
532
+ for (let e of y) e.className = "sn_ch";
533
+ t.#O.position.set(this.#c.break_fixed_left, this.#c.break_fixed_top), t.#O.visible = !0, this.noticeCompTxt();
528
534
  let e = this.#_.shift();
529
535
  return this.#_.length > 0 && e(), !0;
530
536
  };
531
- for (let e of j) e.className = e.className.replace("sn_ch_yet sn", "go");
532
- h > 0 && ++h;
533
- let N;
534
- for (let e = O - 2; e >= 0; --e) {
535
- let { elm: p } = this.#v[e];
536
- if (p.tagName === "SPAN") {
537
- N = p.parentElement?.tagName === "RUBY" ? p.parentElement.parentElement ?? p : p;
537
+ for (let e of y) e.className = e.className.replace("sn_ch_yet sn", "go");
538
+ r > 0 && ++r;
539
+ let x;
540
+ for (let e = g - 2; e >= 0; --e) {
541
+ let { elm: t } = this.#v[e];
542
+ if (t.tagName === "SPAN") {
543
+ x = t.parentElement?.tagName === "RUBY" ? t.parentElement.parentElement ?? t : t;
538
544
  break;
539
545
  }
540
546
  }
541
- if (!N || m || h === O) {
547
+ if (!x || n || r === g) {
542
548
  this.#S();
543
549
  return;
544
550
  }
545
- let P = () => {
546
- N.removeEventListener("animationend", P), this.#S();
551
+ let S = () => {
552
+ x.removeEventListener("animationend", S), this.#S();
547
553
  };
548
- N.addEventListener("animationend", P, {
554
+ x.addEventListener("animationend", S, {
549
555
  once: !0,
550
556
  signal: this.#M.signal
551
557
  });
552
558
  }
553
559
  #S = () => !1;
554
- #C(e, m, h, g, _, v) {
555
- e.alpha = 0, m.x && (g.x = m.x.startsWith("=") ? g.x + parseInt(m.x.slice(1)) : parseInt(m.x)), m.y && (g.y = m.y.startsWith("=") ? g.y + parseInt(m.y.slice(1)) : parseInt(m.y)), m.width && (g.width = parseInt(m.width)), m.height && (g.height = parseInt(m.height)), m.wait && (v.wait = m.wait), e.width = g.width, e.height = g.height, v.x ? e.position.set(v.x.startsWith("=") ? g.x + e.width * v.nx : v.nx, v.y.startsWith("=") ? g.y + e.height * v.ny : v.ny) : e.position.set(g.x, g.y);
556
- let y = new Tween(e).to({
560
+ #C(e, n, r, i, a, o) {
561
+ e.alpha = 0, n.x && (i.x = n.x.startsWith("=") ? i.x + parseInt(n.x.slice(1)) : parseInt(n.x)), n.y && (i.y = n.y.startsWith("=") ? i.y + parseInt(n.y.slice(1)) : parseInt(n.y)), n.width && (i.width = parseInt(n.width)), n.height && (i.height = parseInt(n.height)), n.wait && (o.wait = n.wait), e.width = i.width, e.height = i.height, o.x ? e.position.set(o.x.startsWith("=") ? i.x + e.width * o.nx : o.nx, o.y.startsWith("=") ? i.y + e.height * o.ny : o.ny) : e.position.set(i.x, i.y);
562
+ let s = new _(e).to({
557
563
  alpha: 1,
558
- x: g.x,
559
- y: g.y,
560
- width: g.width,
561
- height: g.height,
564
+ x: i.x,
565
+ y: i.y,
566
+ width: i.width,
567
+ height: i.height,
562
568
  angle: 0
563
- }, v.wait ?? 0).easing(_).delay((h.wait ?? 0) + (m.delay ?? 0)).onComplete(() => {
564
- b.tw = void 0;
569
+ }, o.wait ?? 0).easing(a).delay((r.wait ?? 0) + (n.delay ?? 0)).onComplete(() => {
570
+ c.tw = void 0;
565
571
  }).start();
566
- p.grp.add(y);
567
- let b = {
572
+ t.grp.add(s);
573
+ let c = {
568
574
  sp: e,
569
- tw: y
575
+ tw: s
570
576
  };
571
- this.#w.push(b);
577
+ this.#w.push(c);
572
578
  }
573
579
  #w = [];
574
580
  skipChIn() {
575
581
  let e = this.#S();
576
- for (let p of this.#w) p.tw && (p.tw.stop().end(), e = !0);
582
+ for (let t of this.#w) t.tw && (t.tw.stop().end(), e = !0);
577
583
  return this.#w = [], e;
578
584
  }
579
585
  static #T = Object.create(null);
580
586
  static #E = /[{\s.,*{]/;
581
587
  static initChStyle() {
582
- p.#T = Object.create(null), p.#D = Object.create(null);
588
+ t.#T = Object.create(null), t.#D = Object.create(null);
583
589
  }
584
590
  static getChInStyle(e) {
585
- return p.#T[e];
591
+ return t.#T[e];
586
592
  }
587
593
  static ch_in_style(e) {
588
- let { name: m } = e;
589
- if (!m) throw "nameは必須です";
590
- if (p.#E.test(m)) throw `name【${m}】に使えない文字が含まれます`;
591
- if (m in p.#T) throw `name【${m}】はすでにあります`;
592
- let h = String(e.x ?? "=0"), _ = String(e.y ?? "=0");
593
- return p.#T[m] = {
594
- wait: argChk_Num(e, "wait", 500),
595
- alpha: argChk_Num(e, "alpha", 0),
596
- x: h,
597
- y: _,
598
- nx: parseFloat(h.at(0) === "=" ? h.slice(1) : h),
599
- ny: parseFloat(_.at(0) === "=" ? _.slice(1) : _),
600
- scale_x: argChk_Num(e, "scale_x", 1),
601
- scale_y: argChk_Num(e, "scale_y", 1),
602
- rotate: argChk_Num(e, "rotate", 0),
603
- join: argChk_Boolean(e, "join", !0),
594
+ let { name: n } = e;
595
+ if (!n) throw "nameは必須です";
596
+ if (t.#E.test(n)) throw `name【${n}】に使えない文字が含まれます`;
597
+ if (n in t.#T) throw `name【${n}】はすでにあります`;
598
+ let r = String(e.x ?? "=0"), a = String(e.y ?? "=0");
599
+ return t.#T[n] = {
600
+ wait: i(e, "wait", 500),
601
+ alpha: i(e, "alpha", 0),
602
+ x: r,
603
+ y: a,
604
+ nx: parseFloat(r.at(0) === "=" ? r.slice(1) : r),
605
+ ny: parseFloat(a.at(0) === "=" ? a.slice(1) : a),
606
+ scale_x: i(e, "scale_x", 1),
607
+ scale_y: i(e, "scale_y", 1),
608
+ rotate: i(e, "rotate", 0),
609
+ join: o(e, "join", !0),
604
610
  ease: e.ease ?? "ease-out"
605
611
  };
606
612
  }
607
613
  static #D = Object.create(null);
608
614
  static getChOutStyle(e) {
609
- return p.#D[e];
615
+ return t.#D[e];
610
616
  }
611
617
  static ch_out_style(e) {
612
- let { name: m } = e;
613
- if (!m) throw "nameは必須です";
614
- if (p.#E.test(m)) throw `name【${m}】に使えない文字が含まれます`;
615
- if (m in p.#D) throw `name【${m}】はすでにあります`;
616
- let h = String(e.x ?? "=0"), _ = String(e.y ?? "=0");
617
- return p.#D[m] = {
618
- wait: argChk_Num(e, "wait", 500),
619
- alpha: argChk_Num(e, "alpha", 0),
620
- x: h,
621
- y: _,
622
- nx: parseFloat(h.at(0) === "=" ? h.slice(1) : h),
623
- ny: parseFloat(_.at(0) === "=" ? _.slice(1) : _),
624
- scale_x: argChk_Num(e, "scale_x", 1),
625
- scale_y: argChk_Num(e, "scale_y", 1),
626
- rotate: argChk_Num(e, "rotate", 0),
627
- join: argChk_Boolean(e, "join", !1),
618
+ let { name: n } = e;
619
+ if (!n) throw "nameは必須です";
620
+ if (t.#E.test(n)) throw `name【${n}】に使えない文字が含まれます`;
621
+ if (n in t.#D) throw `name【${n}】はすでにあります`;
622
+ let r = String(e.x ?? "=0"), a = String(e.y ?? "=0");
623
+ return t.#D[n] = {
624
+ wait: i(e, "wait", 500),
625
+ alpha: i(e, "alpha", 0),
626
+ x: r,
627
+ y: a,
628
+ nx: parseFloat(r.at(0) === "=" ? r.slice(1) : r),
629
+ ny: parseFloat(a.at(0) === "=" ? a.slice(1) : a),
630
+ scale_x: i(e, "scale_x", 1),
631
+ scale_y: i(e, "scale_y", 1),
632
+ rotate: i(e, "rotate", 0),
633
+ join: o(e, "join", !1),
628
634
  ease: e.ease ?? "ease-out"
629
635
  };
630
636
  }
631
- static #O = new Container();
632
- static #k = new SpritesMng();
637
+ static #O = new u();
638
+ static #k = new b();
633
639
  dispBreak(e) {
634
- p.delBreak();
635
- let m = p.#O;
636
- m.visible = !1, this.addChild(m), p.#k.destroy(), p.#k = new SpritesMng(e.pic, m, (p) => {
637
- m.parent ? (p.x = argChk_Num(e, "x", 0), p.y = argChk_Num(e, "y", 0), p.width = argChk_Num(e, "width", this.#u.fontsize), p.height = argChk_Num(e, "height", this.#u.fontsize)) : m.removeChild(p);
640
+ t.delBreak();
641
+ let n = t.#O;
642
+ n.visible = !1, this.addChild(n), t.#k.destroy(), t.#k = new b(e.pic, n, (t) => {
643
+ n.parent ? (t.x = i(e, "x", 0), t.y = i(e, "y", 0), t.width = i(e, "width", this.#u.fontsize), t.height = i(e, "height", this.#u.fontsize)) : n.removeChild(t);
638
644
  });
639
645
  }
640
646
  static delBreak() {
641
- let e = p.#O;
642
- e.parent?.removeChild(e), p.#k.destroy();
647
+ let e = t.#O;
648
+ e.parent?.removeChild(e), t.#k.destroy();
643
649
  }
644
650
  #A = "Quadratic.Out";
645
651
  #j = "Quadratic.Out";
@@ -648,43 +654,43 @@ var TxtStage = class p extends Container {
648
654
  this.#o.clear(), this.#v = [], this.#y = 0, this.#_ = [], this.#M.abort(), this.#M = new AbortController(), this.skipChIn();
649
655
  let e = document.createElement("span");
650
656
  e.style.cssText = this.#i.style.cssText, e.classList.value = this.#i.classList.value;
651
- let m = this.#i, h = Array.from(m.getElementsByClassName("sn_ch"));
652
- m.parentElement.insertBefore(e, m);
653
- let g = 0;
654
- h.forEach((e) => {
655
- let m = JSON.parse(e.dataset.add ?? e.children[0]?.getAttribute("data-add") ?? e.children[0]?.children[0]?.getAttribute("data-add") ?? "{}");
656
- if (!m.ch_out_style) return;
657
- let h = p.#D[m.ch_out_style];
658
- if (h) {
659
- if (h.wait === 0) {
657
+ let n = this.#i, r = Array.from(n.getElementsByClassName("sn_ch"));
658
+ n.parentElement.insertBefore(e, n);
659
+ let i = 0;
660
+ r.forEach((e) => {
661
+ let n = JSON.parse(e.dataset.add ?? e.children[0]?.getAttribute("data-add") ?? e.children[0]?.children[0]?.getAttribute("data-add") ?? "{}");
662
+ if (!n.ch_out_style) return;
663
+ let r = t.#D[n.ch_out_style];
664
+ if (r) {
665
+ if (r.wait === 0) {
660
666
  e.style.display = "none";
661
667
  return;
662
668
  }
663
- g += h.wait, h.join || (e.style.animationDelay = "0ms"), e.classList.add(`go_ch_out_${String(m.ch_out_style)}`);
669
+ i += r.wait, r.join || (e.style.animationDelay = "0ms"), e.classList.add(`go_ch_out_${String(n.ch_out_style)}`);
664
670
  }
665
671
  });
666
- let _ = () => {
667
- m.parentElement.removeChild(m);
668
- for (let e of this.#a.removeChildren()) e instanceof Container && p.#n.unButton(e), e.destroy();
672
+ let a = () => {
673
+ n.parentElement.removeChild(n);
674
+ for (let e of this.#a.removeChildren()) e instanceof u && t.#n.unButton(e), e.destroy();
669
675
  };
670
- if (g === 0) this.#i.textContent = "", this.#i = document.createElement("span"), _();
676
+ if (i === 0) this.#i.textContent = "", this.#i = document.createElement("span"), a();
671
677
  else {
672
- let e = m.lastElementChild;
678
+ let e = n.lastElementChild;
673
679
  if (e) {
674
- let p = () => {
675
- e.removeEventListener("animationend", p), _();
680
+ let t = () => {
681
+ e.removeEventListener("animationend", t), a();
676
682
  };
677
- e.addEventListener("animationend", p, {
683
+ e.addEventListener("animationend", t, {
678
684
  once: !0,
679
685
  signal: this.#M.signal
680
686
  });
681
- } else _();
687
+ } else a();
682
688
  }
683
689
  this.#i = e;
684
690
  }
685
691
  reNew() {
686
692
  this.#N();
687
- let e = new p(this.ctn, this.canFocus, this.sys);
693
+ let e = new t(this.ctn, this.canFocus, this.sys);
688
694
  return e.#u = this.#u, e.#i.style.cssText = this.#i.style.cssText, e.#p = this.#p, e.name = this.name, e.#f(), e.#P = this.#P, e.#A = this.#A, e.#j = this.#j, this.#c.reNew(e.#c), this.destroy(), e;
689
695
  }
690
696
  #P = void 0;
@@ -709,9 +715,9 @@ var TxtStage = class p extends Container {
709
715
  this.#i.style.cssText = e;
710
716
  }
711
717
  #F = void 0;
712
- snapshot(e, p) {
713
- htm2tx((m) => {
714
- this.#F = Sprite.from(m), this.#m && (this.#F.x += CmnLib.stageW - (this.#p + this.#u.$width)), this.#F.y -= this.#g, this.#F.texture.frame = new Rectangle(0, 0, Math.min(this.#F.width, this.#u.$width - this.#p), Math.min(this.#F.height, this.#u.$height)), this.#a.addChild(this.#F), e.render(this.#F, { clear: !1 }), p();
718
+ snapshot(e, t) {
719
+ M((n) => {
720
+ this.#F = d.from(n), this.#m && (this.#F.x += s.stageW - (this.#p + this.#u.$width)), this.#F.y -= this.#g, this.#F.texture.frame = new l(0, 0, Math.min(this.#F.width, this.#u.$width - this.#p), Math.min(this.#F.height, this.#u.$height)), this.#a.addChild(this.#F), e.render(this.#F, { clear: !1 }), t();
715
721
  }, this.#i, this.#u, this.#h, this.#g, !1);
716
722
  }
717
723
  snapshot_end() {
@@ -720,30 +726,30 @@ var TxtStage = class p extends Container {
720
726
  makeDesignCast(e) {}
721
727
  showDesignCast() {}
722
728
  dump() {
723
- let e = [], p = this.#i.style, m = p.length;
724
- for (let h = 0; h < m; ++h) {
725
- let m = p[h];
726
- e.push(`"${String(m)}":"${p[m].replaceAll(/(["\\])/g, "\\$1")}"`);
729
+ let e = [], t = this.#i.style, n = t.length;
730
+ for (let r = 0; r < n; ++r) {
731
+ let n = t[r];
732
+ e.push(`"${String(n)}":"${t[n].replaceAll(/(["\\])/g, "\\$1")}"`);
727
733
  }
728
734
  return `"txt":"${this.#i.textContent.replaceAll(/(["\\])/g, "\\$1")}", "style":{${e.join(",")}}`;
729
735
  }
730
736
  destroy() {
731
- p.delBreak(), this.#i.parentElement.removeChild(this.#i), this.#i = document.createElement("span"), this.removeChild(this.#a), this.removeChild(this.#o), this.#o.clear(), this.#l = () => {}, this.#_ = [], this.#v = [], this.#y = 0, this.#w = [], this.#M.abort(), this.#P = void 0, super.destroy();
737
+ t.delBreak(), this.#i.parentElement.removeChild(this.#i), this.#i = document.createElement("span"), this.removeChild(this.#a), this.removeChild(this.#o), this.#o.clear(), this.#l = () => {}, this.#_ = [], this.#v = [], this.#y = 0, this.#w = [], this.#M.abort(), this.#P = void 0, super.destroy();
732
738
  }
733
- }, TxtLayer = class e extends Layer {
739
+ }, P = class e extends h {
734
740
  static #e;
735
741
  static #t;
736
742
  static #n;
737
743
  static #r;
738
- static init(e, p, h, g, v, y) {
739
- this.#e = e, TxtStage.init(e, y), this.#t = h, this.#r = g, this.#n = v, h.setDoRecProc((e) => this.chgDoRec(e)), p.autowc = (e) => this.#d(e), p.autowc({
744
+ static init(e, t, r, i, o, s) {
745
+ this.#e = e, N.init(e, s), this.#t = r, this.#r = i, this.#n = o, r.setDoRecProc((e) => this.chgDoRec(e)), t.autowc = (e) => this.#d(e), t.autowc({
740
746
  enabled: !1,
741
747
  text: "",
742
748
  time: 0
743
- }), p.ch_in_style = (e) => this.#i(e), p.ch_out_style = (e) => this.#a(e), TxtStage.initChStyle(), initStyle(), addStyle(e.matchPath(".+", SEARCH_PATH_ARG_EXT.FONT).flatMap((e) => Object.values(e).map((e) => `
749
+ }), t.ch_in_style = (e) => this.#i(e), t.ch_out_style = (e) => this.#a(e), N.initChStyle(), n(), a(e.matchPath(".+", p.FONT).flatMap((e) => Object.values(e).map((e) => `
744
750
  @font-face {
745
751
  font-family: '${String(e)}';
746
- src: url('${this.#e.searchPath(String(e), SEARCH_PATH_ARG_EXT.FONT)}');
752
+ src: url('${this.#e.searchPath(String(e), p.FONT)}');
747
753
  }
748
754
  `)).join("") + "\n.sn_tx {\n pointer-events: none;\n user-select: none;\n -webkit-touch-callout: none;\n box-sizing: border-box;\n}\n.sn_ch {\n position: relative;\n display: inline-block;\n}\n"), this.#i({
749
755
  name: "default",
@@ -770,64 +776,64 @@ var TxtStage = class p extends Container {
770
776
  });
771
777
  }
772
778
  static #i(e) {
773
- let { x: p, y: m, nx: h, ny: g, alpha: v, wait: y, ease: b, rotate: x, scale_x: S, scale_y: C } = TxtStage.ch_in_style(e), w = p.startsWith("=") ? `${String(h * 100)}%` : `${String(h)}px`, T = m.startsWith("=") ? `${String(g * 100)}%` : `${String(g)}px`, { name: E = "" } = e;
774
- return addStyle(`
775
- .sn_ch_in_${E} {
779
+ let { x: t, y: n, nx: r, ny: i, alpha: o, wait: s, ease: c, rotate: l, scale_x: u, scale_y: d } = N.ch_in_style(e), f = t.startsWith("=") ? `${String(r * 100)}%` : `${String(r)}px`, p = n.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, { name: m = "" } = e;
780
+ return a(`
781
+ .sn_ch_in_${m} {
776
782
  position: relative;
777
783
  display: inline-block;
778
784
  }
779
- .go_ch_in_${E} {
780
- opacity: ${String(v)};
785
+ .go_ch_in_${m} {
786
+ opacity: ${String(o)};
781
787
  position: relative;
782
788
  display: inline-block;
783
- animation: sn_ch_in_${E} ${String(y)}ms ${b} 0s both;
789
+ animation: sn_ch_in_${m} ${String(s)}ms ${c} 0s both;
784
790
  }
785
- @keyframes sn_ch_in_${E} {
786
- from {transform: rotate(${String(x)}deg) scale(${String(S)}, ${String(C)}) translate(${w}, ${T})}
791
+ @keyframes sn_ch_in_${m} {
792
+ from {transform: rotate(${String(l)}deg) scale(${String(u)}, ${String(d)}) translate(${f}, ${p})}
787
793
  to {opacity: 1; transform: none;}
788
794
  }
789
795
  `), !1;
790
796
  }
791
797
  static #a(e) {
792
- let { x: p, y: m, nx: h, ny: g, alpha: v, wait: y, ease: b, rotate: x, scale_x: S, scale_y: C } = TxtStage.ch_out_style(e), w = p.startsWith("=") ? `${String(h * 100)}%` : `${String(h)}px`, T = m.startsWith("=") ? `${String(g * 100)}%` : `${String(g)}px`, { name: E = "" } = e;
793
- return addStyle(`
794
- .go_ch_out_${E} {
798
+ let { x: t, y: n, nx: r, ny: i, alpha: o, wait: s, ease: c, rotate: l, scale_x: u, scale_y: d } = N.ch_out_style(e), f = t.startsWith("=") ? `${String(r * 100)}%` : `${String(r)}px`, p = n.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, { name: m = "" } = e;
799
+ return a(`
800
+ .go_ch_out_${m} {
795
801
  position: relative;
796
802
  display: inline-block;
797
- animation: go_ch_out_${E} ${String(y)}ms ${b} 0s both;
803
+ animation: go_ch_out_${m} ${String(s)}ms ${c} 0s both;
798
804
  }
799
- @keyframes go_ch_out_${E} {
805
+ @keyframes go_ch_out_${m} {
800
806
  to {
801
- opacity: ${String(v)};
802
- transform: rotate(${String(x)}deg) scale(${String(S)}, ${String(C)}) translate(${w}, ${T});
807
+ opacity: ${String(o)};
808
+ transform: rotate(${String(l)}deg) scale(${String(u)}, ${String(d)}) translate(${f}, ${p});
803
809
  }
804
810
  `), !1;
805
811
  }
806
812
  static #o = 10;
807
- static set msecChWait(p) {
808
- e.#o = p;
813
+ static set msecChWait(t) {
814
+ e.#o = t;
809
815
  }
810
816
  static get msecChWait() {
811
817
  return e.#o;
812
818
  }
813
819
  static #s;
814
820
  static #c;
815
- static setEvtMng(e, p, m) {
816
- this.#s = e, this.#c = p, TxtStage.setEvtMng(e, m);
821
+ static setEvtMng(e, t, n) {
822
+ this.#s = e, this.#c = t, N.setEvtMng(e, n);
817
823
  }
818
824
  static #l = !1;
819
825
  static #u = {};
820
826
  static #d(e) {
821
- this.#l = argChk_Boolean(e, "enabled", this.#l), this.#t.setVal_Nochk("save", "const.sn.autowc.enabled", this.#l);
822
- let { text: p } = e;
827
+ this.#l = o(e, "enabled", this.#l), this.#t.setVal_Nochk("save", "const.sn.autowc.enabled", this.#l);
828
+ let { text: t } = e;
823
829
  if ("text" in e != "time" in e) throw "[autowc] textとtimeは同時指定必須です";
824
- if (this.#t.setVal_Nochk("save", "const.sn.autowc.text", p), !p) return this.#t.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
825
- let m = p.length;
826
- if (this.#l && m === 0) throw "[autowc] enabled === false かつ text === \"\" は許されません";
827
- let g = String(e.time).split(",");
828
- if (g.length !== m) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
830
+ if (this.#t.setVal_Nochk("save", "const.sn.autowc.text", t), !t) return this.#t.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
831
+ let n = t.length;
832
+ if (this.#l && n === 0) throw "[autowc] enabled === false かつ text === \"\" は許されません";
833
+ let i = String(e.time).split(",");
834
+ if (i.length !== n) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
829
835
  this.#u = {};
830
- for (let e = 0; e < m; ++e) this.#u[p[e]] = uint(g[e]);
836
+ for (let e = 0; e < n; ++e) this.#u[t[e]] = r(i[e]);
831
837
  return this.#t.setVal_Nochk("save", "const.sn.autowc.time", e.time), !1;
832
838
  }
833
839
  #f = 0;
@@ -835,8 +841,8 @@ var TxtStage = class p extends Container {
835
841
  #m = !1;
836
842
  #h = void 0;
837
843
  #g = "";
838
- #_ = new TxtStage(this.ctn, () => this.canFocus(), e.#c);
839
- #v = new RubySpliter();
844
+ #_ = new N(this.ctn, () => this.canFocus(), e.#c);
845
+ #v = new S();
840
846
  #y = document.createElement("span");
841
847
  static #b = {
842
848
  "text-align": 0,
@@ -848,10 +854,10 @@ var TxtStage = class p extends Container {
848
854
  "padding-top": 0,
849
855
  "padding-bottom": 0
850
856
  };
851
- #x = new Container();
857
+ #x = new u();
852
858
  constructor() {
853
859
  super(), this.ctn.addChild(this.#_), this.#v.init(this.#B), this.ctn.addChild(this.#x), this.#x.name = "cntBtn", this.lay({
854
- style: `width: ${String(CmnLib.stageW)}px; height: ${String(CmnLib.stageH)}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: 16px;`,
860
+ style: `width: ${String(s.stageW)}px; height: ${String(s.stageH)}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: 16px;`,
855
861
  in_style: "default",
856
862
  out_style: "default",
857
863
  back_clear: "true"
@@ -881,34 +887,34 @@ var TxtStage = class p extends Container {
881
887
  procSetY(e) {
882
888
  this.#_.lay({ y: e });
883
889
  }
884
- lay(p) {
885
- if (super.lay(p), Layer.setXY(this.ctn, p, this.ctn), p[":id_tag"] = this.name_.slice(0, -7), RubySpliter.setting(p), this.#k(p), this.#_.lay(p), "r_align" in p && (this.#L = p.r_align ?? ""), this.#F = CmnLib.isSafari ? this.#_.tategaki ? (e, p) => `text-align: start; height: ${String(p)}em; padding-top: ${e}; padding-bottom: ${e};` : (e, p) => `text-align: start; width: ${String(p)}em; padding-left: ${e}; padding-right: ${e};` : this.#_.tategaki ? (e) => `text-align: justify; text-align-last: justify; padding-top: ${e}; padding-bottom: ${e};` : (e) => `text-align: justify; text-align-last: justify; padding-left: ${e}; padding-right: ${e};`, CmnLib.isFirefox && (this.#I = this.#R), "r_style" in p) if (p.r_style) {
886
- let m = document.createElement("span");
887
- m.style.cssText = p.r_style;
888
- let h = m.style.length, g = this.#y.style;
889
- for (let p = 0; p < h; ++p) {
890
- let h = m.style[p];
891
- if (h in e.#b) {
892
- DebugMng.myTrace(`${String(h)}は指定できません`, "W");
890
+ lay(t) {
891
+ if (super.lay(t), h.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), S.setting(t), this.#k(t), this.#_.lay(t), "r_align" in t && (this.#L = t.r_align ?? ""), this.#F = s.isSafari ? this.#_.tategaki ? (e, t) => `text-align: start; height: ${String(t)}em; padding-top: ${e}; padding-bottom: ${e};` : (e, t) => `text-align: start; width: ${String(t)}em; padding-left: ${e}; padding-right: ${e};` : this.#_.tategaki ? (e) => `text-align: justify; text-align-last: justify; padding-top: ${e}; padding-bottom: ${e};` : (e) => `text-align: justify; text-align-last: justify; padding-left: ${e}; padding-right: ${e};`, s.isFirefox && (this.#I = this.#R), "r_style" in t) if (t.r_style) {
892
+ let n = document.createElement("span");
893
+ n.style.cssText = t.r_style;
894
+ let r = n.style.length, i = this.#y.style;
895
+ for (let t = 0; t < r; ++t) {
896
+ let r = n.style[t];
897
+ if (r in e.#b) {
898
+ m.myTrace(`${String(r)}は指定できません`, "W");
893
899
  continue;
894
900
  }
895
- let _ = m.style[h];
896
- _ && (g[h] = _);
901
+ let a = n.style[r];
902
+ a && (i[r] = a);
897
903
  }
898
904
  } else this.#y.style.cssText = "";
899
- if ("alpha" in p) for (let e of this.#x.children) e.alpha = this.ctn.alpha;
900
- this.#S(p), this.#T(p);
901
- let m = Reading.procID + `TxtLayer lay name:${this.name_}`, h = this.#O(p, (e) => {
902
- e && Reading.endProc(m);
905
+ if ("alpha" in t) for (let e of this.#x.children) e.alpha = this.ctn.alpha;
906
+ this.#S(t), this.#T(t);
907
+ let n = y.procID + `TxtLayer lay name:${this.name_}`, r = this.#O(t, (e) => {
908
+ e && y.endProc(n);
903
909
  });
904
- return h && Reading.beginProc(m), h;
910
+ return r && y.beginProc(n), r;
905
911
  }
906
912
  #S(e) {
907
- let { in_style: p } = e;
908
- if (!p) return;
909
- let m = TxtStage.getChInStyle(p);
910
- if (!m) throw `存在しないin_style【${p}】です`;
911
- this.#C = p, this.#w = m.join;
913
+ let { in_style: t } = e;
914
+ if (!t) return;
915
+ let n = N.getChInStyle(t);
916
+ if (!n) throw `存在しないin_style【${t}】です`;
917
+ this.#C = t, this.#w = n.join;
912
918
  }
913
919
  #C = "";
914
920
  #w = !0;
@@ -919,31 +925,31 @@ var TxtStage = class p extends Container {
919
925
  return this.#_.getHeight;
920
926
  }
921
927
  #T(e) {
922
- let { out_style: p } = e;
923
- if (p) {
924
- if (!TxtStage.getChOutStyle(p)) throw `存在しないout_style【${p}】です`;
925
- this.#E = p;
928
+ let { out_style: t } = e;
929
+ if (t) {
930
+ if (!N.getChOutStyle(t)) throw `存在しないout_style【${t}】です`;
931
+ this.#E = t;
926
932
  }
927
933
  }
928
934
  #E = "";
929
- #D = new SpritesMng();
930
- #O(m, h) {
931
- if ("back_clear" in m) return argChk_Boolean(m, "back_clear", !1) && (this.#f = 0, this.#p = 0, this.#m = !1, this.#g = ""), h(!1), !1;
932
- this.#p = argChk_Num(m, "b_alpha", this.#p), this.#m = argChk_Boolean(m, "b_alpha_isfixed", this.#m);
933
- let _ = (this.#m ? 1 : Number(e.#t.getVal("sys:TextLayer.Back.Alpha"))) * this.#p;
934
- if (m.b_pic) {
935
- if (this.#g !== m.b_pic) return this.#g = m.b_pic, this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#D = new SpritesMng(this.#g, this.ctn, (e) => {
936
- this.#h = e, e.name = "back(pic)", e.visible = _ > 0, e.alpha = _, this.#_.setMySize(e.width, e.height), this.ctn.setChildIndex(e, 0), h(!0);
935
+ #D = new b();
936
+ #O(n, r) {
937
+ if ("back_clear" in n) return o(n, "back_clear", !1) && (this.#f = 0, this.#p = 0, this.#m = !1, this.#g = ""), r(!1), !1;
938
+ this.#p = i(n, "b_alpha", this.#p), this.#m = o(n, "b_alpha_isfixed", this.#m);
939
+ let a = (this.#m ? 1 : Number(e.#t.getVal("sys:TextLayer.Back.Alpha"))) * this.#p;
940
+ if (n.b_pic) {
941
+ if (this.#g !== n.b_pic) return this.#g = n.b_pic, this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#D = new b(this.#g, this.ctn, (e) => {
942
+ this.#h = e, e.name = "back(pic)", e.visible = a > 0, e.alpha = a, this.#_.setMySize(e.width, e.height), this.ctn.setChildIndex(e, 0), r(!0);
937
943
  }), this.#D.ret;
938
- } else "b_color" in m && (this.#f = argChk_Color(m, "b_color", 0), this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#g = "", this.ctn.addChildAt((this.#h = new Graphics()).beginFill(this.#f, _).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)");
939
- return this.#h && (this.#h.visible = _ > 0, this.#h.alpha = _), h(!1), !1;
944
+ } else "b_color" in n && (this.#f = t(n, "b_color", 0), this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#g = "", this.ctn.addChildAt((this.#h = new f()).beginFill(this.#f, a).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)");
945
+ return this.#h && (this.#h.visible = a > 0, this.#h.alpha = a), r(!1), !1;
940
946
  }
941
947
  chgBackAlpha(e) {
942
- let p = this.#m ? this.#p : e * this.#p;
943
- this.#h instanceof Graphics && (this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.ctn.addChildAt((this.#h = new Graphics()).beginFill(this.#f, p).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)"), this.#h && (this.#h.visible = p > 0, this.#h.alpha = p);
948
+ let t = this.#m ? this.#p : e * this.#p;
949
+ this.#h instanceof f && (this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.ctn.addChildAt((this.#h = new f()).beginFill(this.#f, t).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)"), this.#h && (this.#h.visible = t > 0, this.#h.alpha = t);
944
950
  }
945
951
  #k(e) {
946
- "noffs" in e && (this.#M = e.noffs ?? "", this.#N = /* @__PURE__ */ RegExp(`[ ${this.#M}]`)), "ffs" in e && (this.#A ??= "", this.#j = this.#A === "" ? () => "" : (e) => this.#N.test(e) ? "" : ` font-feature-settings: ${this.#A};`);
952
+ "noffs" in e && (this.#M = e.noffs ?? "", this.#N = RegExp(`[ ${this.#M}]`)), "ffs" in e && (this.#A ??= "", this.#j = this.#A === "" ? () => "" : (e) => this.#N.test(e) ? "" : ` font-feature-settings: ${this.#A};`);
947
953
  }
948
954
  #A = "";
949
955
  #j = (e) => "";
@@ -955,62 +961,62 @@ var TxtStage = class p extends Container {
955
961
  static #P = (e) => e;
956
962
  isCur = !1;
957
963
  #F = () => "";
958
- #I = (e, p, m, h = "") => {
959
- if (!m) return ` style='${h}'`;
960
- let g = e.length * 2;
961
- if (g - p.length < 0) return ` style='text-align: ${m}; ${h}'`;
962
- let _ = "";
963
- switch (m) {
964
+ #I = (e, t, n, r = "") => {
965
+ if (!n) return ` style='${r}'`;
966
+ let i = e.length * 2;
967
+ if (i - t.length < 0) return ` style='text-align: ${n}; ${r}'`;
968
+ let a = "";
969
+ switch (n) {
964
970
  case "justify":
965
- _ = this.#F("0", g);
971
+ a = this.#F("0", i);
966
972
  break;
967
973
  case "121":
968
- _ = this.#F(`calc(${String((g - p.length) / (p.length * 2))}em)`, g);
974
+ a = this.#F(`calc(${String((i - t.length) / (t.length * 2))}em)`, i);
969
975
  break;
970
976
  case "even":
971
- _ = this.#F(`calc(${String((g - p.length) / (p.length + 1))}em)`, g);
977
+ a = this.#F(`calc(${String((i - t.length) / (t.length + 1))}em)`, i);
972
978
  break;
973
979
  case "1ruby":
974
- _ = this.#F("1em", g);
980
+ a = this.#F("1em", i);
975
981
  break;
976
- default: _ = `text-align: ${m};`;
982
+ default: a = `text-align: ${n};`;
977
983
  }
978
- return ` style='${_} ${h}'`;
984
+ return ` style='${a} ${r}'`;
979
985
  };
980
986
  #L = "";
981
- #R(e, p, m, h = "") {
982
- if (!m) return ` style='${h}'`;
983
- let g = e.length * 2;
984
- if (g - p.length < 0) return ` style='text-align: ${m}; ${h}'`;
985
- let _ = "";
986
- switch (m) {
987
+ #R(e, t, n, r = "") {
988
+ if (!n) return ` style='${r}'`;
989
+ let i = e.length * 2;
990
+ if (i - t.length < 0) return ` style='text-align: ${n}; ${r}'`;
991
+ let a = "";
992
+ switch (n) {
987
993
  case "left":
988
- _ = "ruby-align: start;";
994
+ a = "ruby-align: start;";
989
995
  break;
990
996
  case "center":
991
- _ = "ruby-align: center;";
997
+ a = "ruby-align: center;";
992
998
  break;
993
999
  case "right":
994
- _ = "ruby-align: start;";
1000
+ a = "ruby-align: start;";
995
1001
  break;
996
1002
  case "justify":
997
- _ = "ruby-align: space-between;";
1003
+ a = "ruby-align: space-between;";
998
1004
  break;
999
1005
  case "121":
1000
- _ = "ruby-align: space-around;";
1006
+ a = "ruby-align: space-around;";
1001
1007
  break;
1002
1008
  case "even":
1003
1009
  {
1004
- let e = ` ${String((g - p.length) / (p.length + 1))}em;`;
1005
- _ = "ruby-align: space-between; " + (this.#_.tategaki ? `padding-top:${e} padding-bottom:${e}` : `padding-left:${e} padding-right:${e}`);
1010
+ let e = ` ${String((i - t.length) / (t.length + 1))}em;`;
1011
+ a = "ruby-align: space-between; " + (this.#_.tategaki ? `padding-top:${e} padding-bottom:${e}` : `padding-left:${e} padding-right:${e}`);
1006
1012
  }
1007
1013
  break;
1008
1014
  case "1ruby":
1009
- _ = "ruby-align: space-between; " + (this.#_.tategaki ? "padding-top: 1em; padding-bottom: 1em;" : "padding-left: 1em; padding-right: 1em;");
1015
+ a = "ruby-align: space-between; " + (this.#_.tategaki ? "padding-top: 1em; padding-bottom: 1em;" : "padding-left: 1em; padding-right: 1em;");
1010
1016
  break;
1011
- default: _ = `text-align: ${m};`;
1017
+ default: a = `text-align: ${n};`;
1012
1018
  }
1013
- return ` style='${_} ${h}'`;
1019
+ return ` style='${a} ${r}'`;
1014
1020
  }
1015
1021
  tagCh(e) {
1016
1022
  this.#v.putTxt(e);
@@ -1019,20 +1025,20 @@ var TxtStage = class p extends Container {
1019
1025
  get needGoTxt() {
1020
1026
  return this.#z;
1021
1027
  }
1022
- #B = (p, m) => {
1023
- let g = m;
1024
- e.#e.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${p}\`(${p.charCodeAt(0).toString(16)}) ruby:\`${g}\` name:\`${this.name_}\``);
1025
- let _ = g.split("|"), v = "", [b, ...x] = _, S = x.join("|");
1026
- switch (_.length) {
1028
+ #B = (t, n) => {
1029
+ let i = n;
1030
+ e.#e.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${t}\`(${t.charCodeAt(0).toString(16)}) ruby:\`${i}\` name:\`${this.name_}\``);
1031
+ let a = i.split("|"), o = "", [c, ...l] = a, u = l.join("|");
1032
+ switch (a.length) {
1027
1033
  case 1:
1028
- if (this.#z = !0, p === "\n") {
1029
- this.#W ? (this.#W = !1, v = "<ruby>&emsp;<rt>&emsp;</rt></ruby><br/>") : v = "<br/>";
1034
+ if (this.#z = !0, t === "\n") {
1035
+ this.#W ? (this.#W = !1, o = "<ruby>&emsp;<rt>&emsp;</rt></ruby><br/>") : o = "<br/>";
1030
1036
  break;
1031
1037
  }
1032
- this.#W && (this.#W = !1, g === "" && (g = "&emsp;")), v = this.#V(p, g, this.#L);
1038
+ this.#W && (this.#W = !1, i === "" && (i = "&emsp;")), o = this.#V(t, i, this.#L);
1033
1039
  break;
1034
1040
  default:
1035
- switch (b) {
1041
+ switch (c) {
1036
1042
  case "start":
1037
1043
  case "left":
1038
1044
  case "center":
@@ -1041,15 +1047,15 @@ var TxtStage = class p extends Container {
1041
1047
  case "121":
1042
1048
  case "even":
1043
1049
  case "1ruby":
1044
- this.#W = !1, this.#z = !0, v = this.#V(p, S, b);
1050
+ this.#W = !1, this.#z = !0, o = this.#V(t, u, c);
1045
1051
  break;
1046
1052
  case "gotxt":
1047
1053
  this.#J(), this.#z ? (this.isCur && e.#r.recText(this.#G.join("").replace(/^<ruby>&emsp;<rt>&emsp;<\/rt><\/ruby>(<br\/>)+/, "").replaceAll(/style='(anim\S+ [^;]+;\s*)+/g, "style='").replaceAll(/( style=''| data-(add|arg|cmd)='[^']+'|\n+|\t+)/g, "").replaceAll(/class='sn_ch[^']+/g, "class='sn_ch").replaceAll("display: none;", "").replaceAll("class='offrec'", "style='display: none;'")), this.#_.goTxt(this.#G, this.#U === 0), this.#z = !1, this.#U = 0) : this.isCur && this.#_.noticeCompTxt();
1048
1054
  return;
1049
1055
  case "add":
1050
1056
  {
1051
- let e = JSON.parse(S), { style: p = "", wait: m = null } = e, { cl: g, sty: _ } = this.#H(!0, m ? uint(m) : null);
1052
- this.#G.push(`<span${g} style='${_} display: inline; ${p}'>`), delete e.style, this.#q(e);
1057
+ let e = JSON.parse(u), { style: t = "", wait: n = null } = e, { cl: i, sty: a } = this.#H(!0, n ? r(n) : null);
1058
+ this.#G.push(`<span${i} style='${a} display: inline; ${t}'>`), delete e.style, this.#q(e);
1053
1059
  }
1054
1060
  return;
1055
1061
  case "add_close":
@@ -1058,64 +1064,64 @@ var TxtStage = class p extends Container {
1058
1064
  case "grp":
1059
1065
  this.#z = !0;
1060
1066
  {
1061
- let e = JSON.parse(S);
1067
+ let e = JSON.parse(u);
1062
1068
  if (e.id ??= String(this.#G.length), e.id === "break") {
1063
1069
  this.#_.dispBreak(e);
1064
1070
  return;
1065
1071
  }
1066
1072
  this.#W = !1, e.delay = this.#U, e.r ??= "", e.style ??= "", e.r_style ??= "";
1067
- let { r: p, wait: m = null, r_style: g } = e, { cl: _, sty: y, lnk: b } = this.#H(!0, m ? uint(m) : null);
1068
- v = `<span${_} style='${y} ${e.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(e)}'${b} style='${y} display: inline;'>&emsp;</span><rt${b}${this.#I(" ", p, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + g)}>${e.r}</rt></ruby></span>`;
1073
+ let { r: t, wait: n = null, r_style: i } = e, { cl: a, sty: s, lnk: c } = this.#H(!0, n ? r(n) : null);
1074
+ o = `<span${a} style='${s} ${e.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(e)}'${c} style='${s} display: inline;'>&emsp;</span><rt${c}${this.#I(" ", t, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + i)}>${e.r}</rt></ruby></span>`;
1069
1075
  }
1070
1076
  break;
1071
1077
  case "tcy":
1072
1078
  this.#W = !1, this.#z = !0;
1073
1079
  {
1074
- let { t: m = "", r: _ = "", wait: b = null, style: x = "", r_style: C = "" } = JSON.parse(S);
1075
- e.#t.doRecLog() && (this.#X += p + (g ? `《${g}》` : ""), this.#Z += m);
1076
- let w = CmnLib.isSafari ? _.replaceAll(/[A-Za-z0-9]/g, (e) => String.fromCharCode(e.charCodeAt(0) + 65248)) : _, { cl: T, sty: E, lnk: D } = this.#H(!0, b ? uint(b) : null);
1077
- v = `<span${T} style='${E}${this.#j(m)} ${x}'><ruby><span${D} style='${E} display: inline; text-combine-upright: all;'>${m}</span><rt${D}${this.#I(m, w, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + C)}>${w}</rt></ruby></span>`;
1080
+ let { t: n = "", r: a = "", wait: c = null, style: l = "", r_style: d = "" } = JSON.parse(u);
1081
+ e.#t.doRecLog() && (this.#X += t + (i ? `《${i}》` : ""), this.#Z += n);
1082
+ let f = s.isSafari ? a.replaceAll(/[A-Za-z0-9]/g, (e) => String.fromCharCode(e.charCodeAt(0) + 65248)) : a, { cl: p, sty: m, lnk: h } = this.#H(!0, c ? r(c) : null);
1083
+ o = `<span${p} style='${m}${this.#j(n)} ${l}'><ruby><span${h} style='${m} display: inline; text-combine-upright: all;'>${n}</span><rt${h}${this.#I(n, f, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + d)}>${f}</rt></ruby></span>`;
1078
1084
  }
1079
1085
  break;
1080
1086
  case "del":
1081
- TxtStage.delBreak();
1087
+ N.delBreak();
1082
1088
  return;
1083
1089
  case "span":
1084
- this.#z = !0, this.#Y(JSON.parse(S));
1090
+ this.#z = !0, this.#Y(JSON.parse(u));
1085
1091
  return;
1086
1092
  case "link":
1087
1093
  this.#z = !0;
1088
1094
  {
1089
- let e = JSON.parse(S);
1095
+ let e = JSON.parse(u);
1090
1096
  e[":link"] = " data-lnk='@'";
1091
- let { cl: p, sty: m, curpos: g } = this.#H(!1, e.wait ? uint(e.wait) : null);
1092
- this.#G.push(`<span${p} style='${m} display: inline; ${e.style ?? ""}' ${g} data-arg='${S}'>`), delete e.style, this.#Y(e);
1097
+ let { cl: t, sty: n, curpos: i } = this.#H(!1, e.wait ? r(e.wait) : null);
1098
+ this.#G.push(`<span${t} style='${n} display: inline; ${e.style ?? ""}' ${i} data-arg='${u}'>`), delete e.style, this.#Y(e);
1093
1099
  }
1094
1100
  return;
1095
1101
  case "endlink":
1096
1102
  this.#z = !0, this.#G.push("</span>"), this.#J();
1097
1103
  return;
1098
- default: this.#z = !0, v = this.#V(p, g, this.#L);
1104
+ default: this.#z = !0, o = this.#V(t, i, this.#L);
1099
1105
  }
1100
1106
  break;
1101
1107
  }
1102
- this.#G.push(e.#P(v));
1108
+ this.#G.push(e.#P(o));
1103
1109
  };
1104
- #V(p, m, h) {
1105
- let g = p === " " ? "&nbsp;" : p === " " ? "&emsp;" : p;
1106
- e.#t.doRecLog() && (this.#X += g + (m ? `《${m}》` : ""), p !== " " && (this.#Z += p));
1107
- let { cl: _, sty: v, lnk: y } = this.#H(!0, null, p);
1108
- return m ? `<span${_} style='${v} ${this.#j(p)}'><ruby>${Array.from(p).map((e, m) => `<span${_}${y} style='${m > 0 ? this.#H(!0, null, p).sty : v} display: inline;'>${e === " " ? "&nbsp;" : e === " " ? "&emsp;" : e}</span>`).join("")}<rt${y}${this.#I(p, m, h, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? ""))}>${m}</rt></ruby></span>` : `<span${_} style='${v} ${this.#j(p)}'${y}>${g}</span>`;
1109
- }
1110
- #H(p, m, g = "\n") {
1111
- let _ = this.#w ? m ?? this.#K.at(0)?.o.wait ?? (e.#l ? e.#u[g.at(0) ?? ""] ?? 0 : e.msecChWait) : 0;
1112
- e.#s.isSkipping ? this.#U = 0 : p && this.#w && (this.#U += uint(_));
1113
- let v = `data-add='{"ch_in_style":"${this.#C}", "ch_out_style":"${this.#E}"}'`;
1110
+ #V(t, n, r) {
1111
+ let i = t === " " ? "&nbsp;" : t === " " ? "&emsp;" : t;
1112
+ e.#t.doRecLog() && (this.#X += i + (n ? `《${n}》` : ""), t !== " " && (this.#Z += t));
1113
+ let { cl: a, sty: o, lnk: s } = this.#H(!0, null, t);
1114
+ return n ? `<span${a} style='${o} ${this.#j(t)}'><ruby>${Array.from(t).map((e, n) => `<span${a}${s} style='${n > 0 ? this.#H(!0, null, t).sty : o} display: inline;'>${e === " " ? "&nbsp;" : e === " " ? "&emsp;" : e}</span>`).join("")}<rt${s}${this.#I(t, n, r, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? ""))}>${n}</rt></ruby></span>` : `<span${a} style='${o} ${this.#j(t)}'${s}>${i}</span>`;
1115
+ }
1116
+ #H(t, n, i = "\n") {
1117
+ let a = this.#w ? n ?? this.#K.at(0)?.o.wait ?? (e.#l ? e.#u[i.at(0) ?? ""] ?? 0 : e.msecChWait) : 0;
1118
+ e.#s.isSkipping ? this.#U = 0 : t && this.#w && (this.#U += r(a));
1119
+ let o = `data-add='{"ch_in_style":"${this.#C}", "ch_out_style":"${this.#E}"}'`;
1114
1120
  return {
1115
1121
  cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#C}'`,
1116
1122
  sty: `animation-delay: ${String(this.#U)}ms;${this.#K.at(-1)?.o.style ?? ""}`,
1117
- lnk: (this.#K.at(0)?.o[":link"] ?? "") + " " + v,
1118
- curpos: v
1123
+ lnk: (this.#K.at(0)?.o[":link"] ?? "") + " " + o,
1124
+ curpos: o
1119
1125
  };
1120
1126
  }
1121
1127
  #U = 0;
@@ -1135,15 +1141,15 @@ var TxtStage = class p extends Container {
1135
1141
  e && (this.#L = e.r_align, this.#S({ in_style: e.ch_in_style }), this.#T({ out_style: e.ch_out_style }));
1136
1142
  }
1137
1143
  #Y(e) {
1138
- let p = this.#K.at(-1);
1139
- if (!p) {
1144
+ let t = this.#K.at(-1);
1145
+ if (!t) {
1140
1146
  this.#q(e);
1141
1147
  return;
1142
1148
  }
1143
- p.o = {
1144
- ...p.o,
1149
+ t.o = {
1150
+ ...t.o,
1145
1151
  ...e
1146
- }, !e.style && !e.r_style && (p.o.style = "", p.o.r_style = ""), e.r_align && (this.#L = e.r_align), this.#S(e), this.#T(e);
1152
+ }, !e.style && !e.r_style && (t.o.style = "", t.o.r_style = ""), e.r_align && (this.#L = e.r_align), this.#S(e), this.#T(e);
1147
1153
  }
1148
1154
  click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#_.skipChIn();
1149
1155
  clearText() {
@@ -1163,10 +1169,10 @@ var TxtStage = class p extends Container {
1163
1169
  set enabled(e) {
1164
1170
  this.ctn.interactiveChildren = e;
1165
1171
  }
1166
- addButton = (p) => new Promise((m) => {
1167
- p.key = `btn=[${String(this.#x.children.length)}] ` + this.name_, p[":id_tag"] = p.key.slice(0, -7), argChk_Boolean(p, "hint_tate", this.#_.tategaki);
1168
- let h = new Button(p, e.#s, () => m(), () => this.canFocus());
1169
- h.name = JSON.stringify(p).replaceAll("\"", "'"), this.#x.addChild(h);
1172
+ addButton = (t) => new Promise((n) => {
1173
+ t.key = `btn=[${String(this.#x.children.length)}] ` + this.name_, t[":id_tag"] = t.key.slice(0, -7), o(t, "hint_tate", this.#_.tategaki);
1174
+ let r = new x(t, e.#s, () => n(), () => this.canFocus());
1175
+ r.name = JSON.stringify(t).replaceAll("\"", "'"), this.#x.addChild(r);
1170
1176
  });
1171
1177
  canFocus() {
1172
1178
  return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && e.#n(this);
@@ -1180,7 +1186,7 @@ var TxtStage = class p extends Container {
1180
1186
  enabled: this.enabled,
1181
1187
  r_cssText: this.#y.style.cssText,
1182
1188
  r_align: this.#L,
1183
- b_do: this.#h === void 0 ? void 0 : this.#h instanceof Sprite ? "Sprite" : "Graphics",
1189
+ b_do: this.#h === void 0 ? void 0 : this.#h instanceof d ? "Sprite" : "Graphics",
1184
1190
  b_pic: this.#g,
1185
1191
  b_color: this.#f,
1186
1192
  b_alpha: this.#p,
@@ -1190,12 +1196,12 @@ var TxtStage = class p extends Container {
1190
1196
  strNoFFS: this.#M,
1191
1197
  btns: this.#x.children.map((e) => e.name)
1192
1198
  });
1193
- playback(e, p) {
1194
- super.playback(e, p), this.enabled = e.enabled, this.#y.style.cssText = e.r_cssText, this.#L = e.r_align, this.cvsResize(), this.#k(e), this.#_.playback(e.txs), this.#p = e.b_alpha, this.#m = e.b_alpha_isfixed, p.push(new Promise((p) => {
1195
- let m = e.b_do ? e.b_do === "Sprite" ? { b_pic: e.b_pic } : { b_color: e.b_color } : { b_pic: "" };
1196
- m.b_alpha = e.b_alpha, m.b_alpha_isfixed = e.b_alpha_isfixed, this.#O(m, (e) => {
1197
- e && p();
1198
- }) || p();
1199
+ playback(e, t) {
1200
+ super.playback(e, t), this.enabled = e.enabled, this.#y.style.cssText = e.r_cssText, this.#L = e.r_align, this.cvsResize(), this.#k(e), this.#_.playback(e.txs), this.#p = e.b_alpha, this.#m = e.b_alpha_isfixed, t.push(new Promise((t) => {
1201
+ let n = e.b_do ? e.b_do === "Sprite" ? { b_pic: e.b_pic } : { b_color: e.b_color } : { b_pic: "" };
1202
+ n.b_alpha = e.b_alpha, n.b_alpha_isfixed = e.b_alpha_isfixed, this.#O(n, (e) => {
1203
+ e && t();
1204
+ }) || t();
1199
1205
  }), ...e.btns.map((e) => this.addButton(JSON.parse(e.replaceAll("'", "\"")))).flat());
1200
1206
  }
1201
1207
  get cssText() {
@@ -1204,8 +1210,8 @@ var TxtStage = class p extends Container {
1204
1210
  set cssText(e) {
1205
1211
  this.#_.cssText = e;
1206
1212
  }
1207
- snapshot(e, p) {
1208
- e.render(this.ctn, { clear: !1 }), this.#_.snapshot(e, p);
1213
+ snapshot(e, t) {
1214
+ e.render(this.ctn, { clear: !1 }), this.#_.snapshot(e, t);
1209
1215
  }
1210
1216
  snapshot_end() {
1211
1217
  this.#_.snapshot_end();
@@ -1214,7 +1220,7 @@ var TxtStage = class p extends Container {
1214
1220
  this.ctn.visible && this.#_.makeDesignCast(e);
1215
1221
  }
1216
1222
  makeDesignCastChildren(e) {
1217
- if (this.ctn.visible) for (let p of this.#x.children) p.makeDesignCast(e);
1223
+ if (this.ctn.visible) for (let t of this.#x.children) t.makeDesignCast(e);
1218
1224
  }
1219
1225
  showDesignCast() {
1220
1226
  this.#_.showDesignCast();
@@ -1223,9 +1229,10 @@ var TxtStage = class p extends Container {
1223
1229
  for (let e of this.#x.children) e.showDesignCast();
1224
1230
  }
1225
1231
  dump() {
1226
- return this.#B("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#_.dump()}, "b_pic":"${this.#g}", "b_color":"${String(this.#f)}", "b_alpha":${String(this.#p)}, "b_alpha_isfixed":"${String(this.#m)}", "width":${String(this.#_.getWidth)}, "height":${String(this.#_.getHeight)}, "pixi_obj":[${this.ctn.children.map((e) => `{"class":"${e instanceof Sprite ? "Sprite" : e instanceof Graphics ? "Graphics" : e instanceof Container ? "Container" : "?"}", "name":"${e.name}", "alpha":${String(e.alpha)}, "x":${String(e.x)}, "y":${String(e.y)}, "visible":"${String(e.visible)}"}`).join(",")}], "button":[${this.#x.children.map((e) => e.children[0]?.name ?? "{}").join(",")}]`;
1232
+ return this.#B("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#_.dump()}, "b_pic":"${this.#g}", "b_color":"${String(this.#f)}", "b_alpha":${String(this.#p)}, "b_alpha_isfixed":"${String(this.#m)}", "width":${String(this.#_.getWidth)}, "height":${String(this.#_.getHeight)}, "pixi_obj":[${this.ctn.children.map((e) => `{"class":"${e instanceof d ? "Sprite" : e instanceof f ? "Graphics" : e instanceof u ? "Container" : "?"}", "name":"${e.name}", "alpha":${String(e.alpha)}, "x":${String(e.x)}, "y":${String(e.y)}, "visible":"${String(e.visible)}"}`).join(",")}], "button":[${this.#x.children.map((e) => e.children[0]?.name ?? "{}").join(",")}]`;
1227
1233
  }
1228
1234
  };
1229
- export { TxtLayer, TxtStage as t };
1235
+ //#endregion
1236
+ export { P as TxtLayer, N as t };
1230
1237
 
1231
1238
  //# sourceMappingURL=TxtLayer.js.map