haori 0.13.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/haori.es.js CHANGED
@@ -30,12 +30,12 @@ const K = class K {
30
30
  };
31
31
  K.devMode = !1;
32
32
  let B = K;
33
- const ne = "embedded";
34
- function de(E) {
35
- return E === "embedded" || E === "demo";
33
+ const oe = "embedded";
34
+ function pe(m) {
35
+ return m === "embedded" || m === "demo";
36
36
  }
37
- function ve(E) {
38
- return E === null ? null : de(E) ? E : ne;
37
+ function Te(m) {
38
+ return m === null ? null : pe(m) ? m : oe;
39
39
  }
40
40
  const H = class H {
41
41
  /**
@@ -53,7 +53,7 @@ const H = class H {
53
53
  * @return 戻り値はありません。
54
54
  */
55
55
  static setRuntime(e) {
56
- H._runtime = de(e) ? e : ne;
56
+ H._runtime = pe(e) ? e : oe;
57
57
  }
58
58
  /**
59
59
  * 実行環境からプレフィックスと開発モードかどうかを自動検出します。
@@ -67,7 +67,7 @@ const H = class H {
67
67
  if (e instanceof HTMLScriptElement) {
68
68
  const r = e.getAttribute("data-prefix") || H._prefix;
69
69
  H._prefix = r.endsWith("-") ? r : r + "-";
70
- const i = ve(
70
+ const i = Te(
71
71
  e.getAttribute("data-runtime")
72
72
  );
73
73
  i !== null && (H._runtime = i);
@@ -94,7 +94,7 @@ const H = class H {
94
94
  return H._prefix;
95
95
  }
96
96
  };
97
- H._prefix = "data-", H._runtime = ne;
97
+ H._prefix = "data-", H._runtime = oe;
98
98
  let l = H;
99
99
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", l.detect) : l.detect();
100
100
  class g {
@@ -126,41 +126,41 @@ class g {
126
126
  console.error(e, ...t);
127
127
  }
128
128
  }
129
- const ye = "yyyy/MM/dd HH:mm", Ee = "en-US", ce = 1e4;
130
- function W(E) {
131
- return String(E).padStart(2, "0");
129
+ const we = "yyyy/MM/dd HH:mm", De = "en-US", de = 1e4;
130
+ function V(m) {
131
+ return String(m).padStart(2, "0");
132
132
  }
133
- function fe(E, e = ye) {
134
- if (E == null || E === "")
133
+ function ge(m, e = we) {
134
+ if (m == null || m === "")
135
135
  return "";
136
- const t = E instanceof Date ? E : new Date(E);
136
+ const t = m instanceof Date ? m : new Date(m);
137
137
  if (Number.isNaN(t.getTime()))
138
138
  return "";
139
139
  const r = {
140
140
  yyyy: String(t.getFullYear()).padStart(4, "0"),
141
- yy: W(t.getFullYear() % 100),
142
- MM: W(t.getMonth() + 1),
141
+ yy: V(t.getFullYear() % 100),
142
+ MM: V(t.getMonth() + 1),
143
143
  M: String(t.getMonth() + 1),
144
- dd: W(t.getDate()),
144
+ dd: V(t.getDate()),
145
145
  d: String(t.getDate()),
146
- HH: W(t.getHours()),
146
+ HH: V(t.getHours()),
147
147
  H: String(t.getHours()),
148
- mm: W(t.getMinutes()),
149
- ss: W(t.getSeconds())
148
+ mm: V(t.getMinutes()),
149
+ ss: V(t.getSeconds())
150
150
  };
151
151
  return e.replace(
152
152
  /'([^']*)'|yyyy|yy|MM|dd|HH|mm|ss|M|d|H/g,
153
153
  (i, s) => s !== void 0 ? s === "" ? "'" : s : r[i]
154
154
  );
155
155
  }
156
- function pe(E, e) {
157
- if (E == null)
156
+ function me(m, e) {
157
+ if (m == null)
158
158
  return "";
159
159
  let t;
160
- if (typeof E == "number")
161
- t = E;
160
+ if (typeof m == "number")
161
+ t = m;
162
162
  else {
163
- const i = String(E).trim();
163
+ const i = String(m).trim();
164
164
  if (i === "")
165
165
  return "";
166
166
  t = Number(i);
@@ -172,24 +172,24 @@ function pe(E, e) {
172
172
  const i = Math.max(0, Math.trunc(e));
173
173
  r.minimumFractionDigits = i, r.maximumFractionDigits = i;
174
174
  }
175
- return new Intl.NumberFormat(Ee, r).format(t);
175
+ return new Intl.NumberFormat(De, r).format(t);
176
176
  }
177
- function ge(E, e, t) {
177
+ function be(m, e, t) {
178
178
  let r, i, s;
179
- if (e === void 0 ? (r = 0, i = E, s = 1) : (r = E, i = e, s = t === void 0 ? 1 : t), !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(s) || s === 0)
179
+ if (e === void 0 ? (r = 0, i = m, s = 1) : (r = m, i = e, s = t === void 0 ? 1 : t), !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(s) || s === 0)
180
180
  return [];
181
181
  r = Math.trunc(r), i = Math.trunc(i), s = Math.trunc(s);
182
182
  const n = [];
183
183
  if (s > 0)
184
- for (let a = r; a < i && n.length < ce; a += s)
184
+ for (let a = r; a < i && n.length < de; a += s)
185
185
  n.push(a);
186
186
  else
187
- for (let a = r; a > i && n.length < ce; a += s)
187
+ for (let a = r; a > i && n.length < de; a += s)
188
188
  n.push(a);
189
189
  return n;
190
190
  }
191
- function me(E, e, t = {}) {
192
- const r = Math.trunc(Number(E));
191
+ function ve(m, e, t = {}) {
192
+ const r = Math.trunc(Number(m));
193
193
  if (!Number.isFinite(r) || r <= 0)
194
194
  return [];
195
195
  const i = Math.min(
@@ -225,7 +225,82 @@ function me(E, e, t = {}) {
225
225
  }
226
226
  return c;
227
227
  }
228
- const Ae = Object.freeze({ date: fe, number: pe, pages: me, range: ge }), I = class I {
228
+ const Re = /^(\d{4})-(\d{1,2})$/, Fe = 1200;
229
+ function Q(m, e) {
230
+ const t = Number(m);
231
+ return Number.isFinite(t) ? Math.trunc(t) : e;
232
+ }
233
+ function se(m, e) {
234
+ if (typeof m != "string")
235
+ return "";
236
+ const t = Re.exec(m.trim());
237
+ if (!t)
238
+ return "";
239
+ const r = Number(t[1]), i = Number(t[2]);
240
+ if (i < 1 || i > 12)
241
+ return "";
242
+ const s = Number.isFinite(e) ? Math.trunc(e) : 0, n = r * 12 + (i - 1) + s, a = Math.floor(n / 12), o = n - a * 12 + 1;
243
+ return `${String(a).padStart(4, "0")}-${V(o)}`;
244
+ }
245
+ function Ne(m) {
246
+ if (typeof m == "string" && m.trim() !== "")
247
+ return se(m, 0);
248
+ const e = /* @__PURE__ */ new Date();
249
+ return `${String(e.getFullYear()).padStart(4, "0")}-${V(e.getMonth() + 1)}`;
250
+ }
251
+ function ye(m, e) {
252
+ const t = Math.trunc(Number(m));
253
+ if (!Number.isFinite(t) || t < 0)
254
+ return [];
255
+ const r = Ne(e);
256
+ if (r === "")
257
+ return [];
258
+ const i = Math.min(t, Fe), s = [];
259
+ for (let n = 0; n <= i; n += 1) {
260
+ const a = se(r, -n);
261
+ s.push({ targetMonth: a, label: a.replace(/-/g, "/") });
262
+ }
263
+ return s;
264
+ }
265
+ function Ee(m, e) {
266
+ const t = { start: 0, end: 0, total: 0, empty: !0 };
267
+ if (!m || typeof m != "object")
268
+ return t;
269
+ const r = m, i = Q(
270
+ r.totalElements ?? r.totalCount,
271
+ 0
272
+ );
273
+ if (i <= 0)
274
+ return t;
275
+ const s = Math.max(0, Q(r.number, 0)), n = Math.max(0, Q(r.size, 0)), a = s * n, o = Math.min(a + 1, i);
276
+ let c;
277
+ if (e !== void 0 && Number.isFinite(e))
278
+ c = Math.max(0, Math.trunc(e));
279
+ else {
280
+ const h = Q(r.numberOfElements, NaN);
281
+ c = Number.isFinite(h) ? h : Math.min(n, i - a);
282
+ }
283
+ const d = Math.min(a + c, i);
284
+ return { start: o, end: Math.max(d, o), total: i, empty: !1 };
285
+ }
286
+ function Ae(m, e, t) {
287
+ if (!Array.isArray(m) || m.length === 0)
288
+ return null;
289
+ const r = String(t), i = m.find(
290
+ (s) => s != null && String(s[e]) === r
291
+ );
292
+ return i === void 0 ? null : i;
293
+ }
294
+ const Me = Object.freeze({
295
+ date: ge,
296
+ number: me,
297
+ pages: ve,
298
+ range: be,
299
+ monthAdd: se,
300
+ monthRange: ye,
301
+ pageSummary: Ee,
302
+ findBy: Ae
303
+ }), C = class C {
229
304
  /**
230
305
  * 明示バインド内に持ち込まれてはならない危険値を返します。
231
306
  *
@@ -910,9 +985,9 @@ return (${e});`;
910
985
  return this.forbiddenBindingValueCache.set(e, !1), !1;
911
986
  }
912
987
  };
913
- I.MAX_IDENTIFIER_RECOVERY_COUNT = 8, I.BUILTIN_NAMESPACE = "haori", I.BUILTIN_HELPERS = {
914
- ...Ae
915
- }, I.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, I.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), I.forbiddenBindingValueCacheResetScheduled = !1, I.FORBIDDEN_NAMES = [
988
+ C.MAX_IDENTIFIER_RECOVERY_COUNT = 8, C.BUILTIN_NAMESPACE = "haori", C.BUILTIN_HELPERS = {
989
+ ...Me
990
+ }, C.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, C.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), C.forbiddenBindingValueCacheResetScheduled = !1, C.FORBIDDEN_NAMES = [
916
991
  // グローバルオブジェクト
917
992
  "window",
918
993
  "self",
@@ -944,23 +1019,23 @@ I.MAX_IDENTIFIER_RECOVERY_COUNT = 8, I.BUILTIN_NAMESPACE = "haori", I.BUILTIN_HE
944
1019
  "sessionStorage",
945
1020
  "IndexedDB",
946
1021
  "history"
947
- ], I.STRICT_FORBIDDEN_NAMES = ["eval", "arguments"], I.REBINDABLE_FORBIDDEN_NAMES = /* @__PURE__ */ new Set(["location"]), I.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
948
- ...I.FORBIDDEN_NAMES.filter(
949
- (e) => !I.REBINDABLE_FORBIDDEN_NAMES.has(e)
1022
+ ], C.STRICT_FORBIDDEN_NAMES = ["eval", "arguments"], C.REBINDABLE_FORBIDDEN_NAMES = /* @__PURE__ */ new Set(["location"]), C.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
1023
+ ...C.FORBIDDEN_NAMES.filter(
1024
+ (e) => !C.REBINDABLE_FORBIDDEN_NAMES.has(e)
950
1025
  ),
951
1026
  "constructor",
952
1027
  "__proto__",
953
1028
  "prototype",
954
- ...I.STRICT_FORBIDDEN_NAMES
955
- ]), I.FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
1029
+ ...C.STRICT_FORBIDDEN_NAMES
1030
+ ]), C.FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
956
1031
  "constructor",
957
1032
  "__proto__",
958
1033
  "prototype"
959
- ]), I.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
1034
+ ]), C.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
960
1035
  "get",
961
1036
  "set",
962
1037
  "async"
963
- ]), I.DISALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
1038
+ ]), C.DISALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
964
1039
  "await",
965
1040
  "break",
966
1041
  "case",
@@ -994,9 +1069,9 @@ I.MAX_IDENTIFIER_RECOVERY_COUNT = 8, I.BUILTIN_NAMESPACE = "haori", I.BUILTIN_HE
994
1069
  "while",
995
1070
  "with",
996
1071
  "yield"
997
- ]), I.EXPRESSION_CACHE = /* @__PURE__ */ new Map();
998
- let J = I;
999
- class oe {
1072
+ ]), C.EXPRESSION_CACHE = /* @__PURE__ */ new Map();
1073
+ let W = C;
1074
+ class ue {
1000
1075
  constructor() {
1001
1076
  this.MAX_BUDGET = 8, this.queue = [], this.processing = !1;
1002
1077
  }
@@ -1086,7 +1161,7 @@ class oe {
1086
1161
  async waitForIdle(e = 1e3) {
1087
1162
  let t = 0, r = 0;
1088
1163
  for (; t < 2 && r < e; )
1089
- this.processing || this.queue.length > 0 ? (await this.wait(), t = 0) : t += 1, await oe.nextTick(), r += 1;
1164
+ this.processing || this.queue.length > 0 ? (await this.wait(), t = 0) : t += 1, await ue.nextTick(), r += 1;
1090
1165
  }
1091
1166
  /**
1092
1167
  * 次のフレーム(または 1 マクロタスク)まで待機します。
@@ -1099,7 +1174,7 @@ class oe {
1099
1174
  });
1100
1175
  }
1101
1176
  }
1102
- const ue = class ue {
1177
+ const he = class he {
1103
1178
  /**
1104
1179
  * タスクをキューに追加します。
1105
1180
  *
@@ -1126,8 +1201,8 @@ const ue = class ue {
1126
1201
  return this.ASYNC_QUEUE.waitForIdle(e);
1127
1202
  }
1128
1203
  };
1129
- ue.ASYNC_QUEUE = new oe();
1130
- let x = ue;
1204
+ he.ASYNC_QUEUE = new ue();
1205
+ let M = he;
1131
1206
  class X {
1132
1207
  /**
1133
1208
  * 実行モードを取得します。
@@ -1158,7 +1233,7 @@ class X {
1158
1233
  * @return すべてのレンダリングが完了したら解決される Promise
1159
1234
  */
1160
1235
  static waitForRenders() {
1161
- return x.waitForIdle();
1236
+ return M.waitForIdle();
1162
1237
  }
1163
1238
  /**
1164
1239
  * 通知ダイアログを表示します。
@@ -1167,7 +1242,7 @@ class X {
1167
1242
  * @returns 通知が閉じられると解決されるPromise
1168
1243
  */
1169
1244
  static dialog(e) {
1170
- return x.enqueue(() => {
1245
+ return M.enqueue(() => {
1171
1246
  window.alert(e);
1172
1247
  }, !0);
1173
1248
  }
@@ -1195,7 +1270,7 @@ class X {
1195
1270
  * @returns ユーザーがOKをクリックした場合はtrue、キャンセルした場合はfalseが解決されるPromise
1196
1271
  */
1197
1272
  static confirm(e) {
1198
- return x.enqueue(() => window.confirm(e), !0);
1273
+ return M.enqueue(() => window.confirm(e), !0);
1199
1274
  }
1200
1275
  /**
1201
1276
  * ダイアログを開きます。
@@ -1203,7 +1278,7 @@ class X {
1203
1278
  * @param element 開くダイアログのHTML要素
1204
1279
  */
1205
1280
  static openDialog(e) {
1206
- return x.enqueue(() => {
1281
+ return M.enqueue(() => {
1207
1282
  e instanceof HTMLDialogElement ? e.showModal() : g.error("[Haori]", "Element is not a dialog: ", e);
1208
1283
  }, !0);
1209
1284
  }
@@ -1213,7 +1288,7 @@ class X {
1213
1288
  * @param element 閉じるダイアログのHTML要素
1214
1289
  */
1215
1290
  static closeDialog(e) {
1216
- return x.enqueue(() => {
1291
+ return M.enqueue(() => {
1217
1292
  e instanceof HTMLDialogElement ? e.close() : g.error("[Haori]", "Element is not a dialog: ", e);
1218
1293
  }, !0);
1219
1294
  }
@@ -1234,7 +1309,7 @@ class X {
1234
1309
  * @param level メッセージのレベル(省略可能)
1235
1310
  */
1236
1311
  static addMessage(e, t, r) {
1237
- return x.enqueue(() => {
1312
+ return M.enqueue(() => {
1238
1313
  const i = e instanceof HTMLFormElement ? e : e.parentElement ?? e;
1239
1314
  i.setAttribute("data-message", t), r !== void 0 ? i.setAttribute("data-message-level", r) : i.removeAttribute("data-message-level");
1240
1315
  }, !0);
@@ -1245,7 +1320,7 @@ class X {
1245
1320
  * @param parent メッセージをクリアする親要素
1246
1321
  */
1247
1322
  static clearMessages(e) {
1248
- return x.enqueue(() => {
1323
+ return M.enqueue(() => {
1249
1324
  e.removeAttribute("data-message"), e.removeAttribute("data-message-level"), e.querySelectorAll("[data-message]").forEach((t) => {
1250
1325
  t.removeAttribute("data-message"), t.removeAttribute("data-message-level");
1251
1326
  });
@@ -1261,7 +1336,7 @@ class X {
1261
1336
  * @returns 整形済み文字列。整形できない場合は空文字
1262
1337
  */
1263
1338
  static date(e, t) {
1264
- return fe(e, t);
1339
+ return ge(e, t);
1265
1340
  }
1266
1341
  /**
1267
1342
  * 数値を桁区切り・小数桁付きの文字列へ整形します。
@@ -1273,7 +1348,7 @@ class X {
1273
1348
  * @returns 整形済み文字列。整形できない場合は空文字
1274
1349
  */
1275
1350
  static number(e, t) {
1276
- return pe(e, t);
1351
+ return me(e, t);
1277
1352
  }
1278
1353
  /**
1279
1354
  * 整数の配列を生成します(終端は排他)。
@@ -1286,7 +1361,7 @@ class X {
1286
1361
  * @returns 整数配列
1287
1362
  */
1288
1363
  static range(e, t, r) {
1289
- return ge(e, t, r);
1364
+ return be(e, t, r);
1290
1365
  }
1291
1366
  /**
1292
1367
  * 番号ページネーション用の表示要素列を生成します。
@@ -1299,17 +1374,67 @@ class X {
1299
1374
  * @returns 表示要素の配列
1300
1375
  */
1301
1376
  static pages(e, t, r) {
1302
- return me(e, t, r);
1377
+ return ve(e, t, r);
1378
+ }
1379
+ /**
1380
+ * `YYYY-MM` 形式の年月文字列に月数を加算します。
1381
+ *
1382
+ * テンプレート式中の `haori.monthAdd(...)` と同じ実装です。
1383
+ *
1384
+ * @param value 基準となる年月(`YYYY-MM` 形式)
1385
+ * @param delta 加算する月数(負数で過去方向)
1386
+ * @returns 加算後の年月(`YYYY-MM` 形式)。不正な入力は空文字
1387
+ */
1388
+ static monthAdd(e, t) {
1389
+ return se(e, t);
1390
+ }
1391
+ /**
1392
+ * 基準月から過去方向へ `count + 1` 個の年月配列を降順で返します。
1393
+ *
1394
+ * テンプレート式中の `haori.monthRange(...)` と同じ実装です。
1395
+ *
1396
+ * @param count 基準月から遡る月数(戻り値の要素数は `count + 1`)
1397
+ * @param base 基準月(`YYYY-MM` 形式、省略時は現在月)
1398
+ * @returns 年月情報の降順配列。不正な入力は空配列
1399
+ */
1400
+ static monthRange(e, t) {
1401
+ return ye(e, t);
1402
+ }
1403
+ /**
1404
+ * ページレスポンスから表示用サマリーを作ります。
1405
+ *
1406
+ * テンプレート式中の `haori.pageSummary(...)` と同じ実装です。
1407
+ *
1408
+ * @param page ページ情報(`number`・`size`・`totalElements`/`totalCount` 等)
1409
+ * @param visibleCount 現在表示している件数(省略可)
1410
+ * @returns 表示サマリー
1411
+ */
1412
+ static pageSummary(e, t) {
1413
+ return Ee(e, t);
1414
+ }
1415
+ /**
1416
+ * 配列から `item[key]` が指定値に一致する最初の要素を返します。
1417
+ *
1418
+ * テンプレート式中の `haori.findBy(...)` と同じ実装です。比較は文字列化して
1419
+ * 行い、一致が無ければ null を返します。
1420
+ *
1421
+ * @param array 検索対象の配列
1422
+ * @param key 比較に使うプロパティ名
1423
+ * @param value 一致させたい値(文字列化して比較)
1424
+ * @returns 一致した最初の要素。無ければ null
1425
+ */
1426
+ static findBy(e, t, r) {
1427
+ return Ae(e, t, r);
1303
1428
  }
1304
1429
  }
1305
- const Se = ["addErrorMessage", "clearMessages"];
1306
- function he() {
1430
+ const xe = ["addErrorMessage", "clearMessages"];
1431
+ function fe() {
1307
1432
  const e = globalThis.window?.Haori;
1308
- return Se.every(
1433
+ return xe.every(
1309
1434
  (r) => typeof e?.[r] == "function"
1310
1435
  ) ? e : X;
1311
1436
  }
1312
- class S {
1437
+ class A {
1313
1438
  /**
1314
1439
  * フォーム内にある入力エレメントの値をオブジェクトとして取得します。
1315
1440
  * data-form-object属性があると、そのエレメント内の値はオブジェクトとして処理されます。
@@ -1320,7 +1445,7 @@ class S {
1320
1445
  */
1321
1446
  static getValues(e) {
1322
1447
  const t = {};
1323
- return S.getPartValues(e, t);
1448
+ return A.getPartValues(e, t);
1324
1449
  }
1325
1450
  /**
1326
1451
  * フォーム内の各入力エレメントから値を取得し、オブジェクトとして返します。
@@ -1338,11 +1463,11 @@ class S {
1338
1463
  `Element cannot have both ${l.prefix}form-object and name attributes.`
1339
1464
  );
1340
1465
  for (const n of e.getChildElementFragments())
1341
- S.getPartValues(n, t);
1466
+ A.getPartValues(n, t);
1342
1467
  } else if (i) {
1343
1468
  const n = {};
1344
1469
  for (const a of e.getChildElementFragments())
1345
- S.getPartValues(a, n);
1470
+ A.getPartValues(a, n);
1346
1471
  Object.keys(n).length > 0 && (t[String(i)] = n), s && g.warn(
1347
1472
  "Haori",
1348
1473
  `Element cannot have both ${l.prefix}form-list and ${l.prefix}form-object attributes.`
@@ -1351,12 +1476,12 @@ class S {
1351
1476
  const n = [];
1352
1477
  for (const a of e.getChildElementFragments()) {
1353
1478
  const o = {};
1354
- S.getPartValues(a, o), Object.keys(o).length > 0 && n.push(o);
1479
+ A.getPartValues(a, o), Object.keys(o).length > 0 && n.push(o);
1355
1480
  }
1356
1481
  n.length > 0 && (t[String(s)] = n);
1357
1482
  } else
1358
1483
  for (const n of e.getChildElementFragments())
1359
- S.getPartValues(n, t);
1484
+ A.getPartValues(n, t);
1360
1485
  return t;
1361
1486
  }
1362
1487
  /**
@@ -1369,7 +1494,7 @@ class S {
1369
1494
  * @returns Promise(DOMの更新が完了したら解決される)
1370
1495
  */
1371
1496
  static setValues(e, t, r = !1) {
1372
- return S.setPartValues(e, t, null, r, !0);
1497
+ return A.setPartValues(e, t, null, r, !0);
1373
1498
  }
1374
1499
  /**
1375
1500
  * フォーム内にある入力エレメントに値をイベントなしで設定します。
@@ -1381,7 +1506,7 @@ class S {
1381
1506
  * @returns Promise(DOMの更新が完了したら解決される)
1382
1507
  */
1383
1508
  static syncValues(e, t, r = !1) {
1384
- return S.setPartValues(e, t, null, r, !1);
1509
+ return A.setPartValues(e, t, null, r, !1);
1385
1510
  }
1386
1511
  /**
1387
1512
  * 単一フラグメントへ値を設定します。
@@ -1409,9 +1534,9 @@ class S {
1409
1534
  if (!d || i) {
1410
1535
  const h = t[String(a)];
1411
1536
  c && Array.isArray(h) && r !== null ? n.push(
1412
- S.applyFragmentValue(e, h[r] ?? null, s)
1413
- ) : typeof h > "u" || (typeof h == "string" || typeof h == "number" || typeof h == "boolean" || h === null ? n.push(S.applyFragmentValue(e, h, s)) : n.push(
1414
- S.applyFragmentValue(e, String(h), s)
1537
+ A.applyFragmentValue(e, h[r] ?? null, s)
1538
+ ) : typeof h > "u" || (typeof h == "string" || typeof h == "number" || typeof h == "boolean" || h === null ? n.push(A.applyFragmentValue(e, h, s)) : n.push(
1539
+ A.applyFragmentValue(e, String(h), s)
1415
1540
  ));
1416
1541
  }
1417
1542
  } else if (o) {
@@ -1419,7 +1544,7 @@ class S {
1419
1544
  if (h && typeof h == "object")
1420
1545
  for (const p of e.getChildElementFragments())
1421
1546
  n.push(
1422
- S.setPartValues(
1547
+ A.setPartValues(
1423
1548
  p,
1424
1549
  h,
1425
1550
  null,
@@ -1431,23 +1556,23 @@ class S {
1431
1556
  const h = t[String(c)];
1432
1557
  if (Array.isArray(h)) {
1433
1558
  const p = e.getChildElementFragments();
1434
- for (let v = 0; v < p.length; v++) {
1435
- const T = p[v];
1436
- h.length > v ? n.push(
1437
- S.setPartValues(
1559
+ for (let y = 0; y < p.length; y++) {
1560
+ const T = p[y];
1561
+ h.length > y ? n.push(
1562
+ A.setPartValues(
1438
1563
  T,
1439
- h[v],
1440
- v,
1564
+ h[y],
1565
+ y,
1441
1566
  i,
1442
1567
  s
1443
1568
  )
1444
- ) : n.push(S.setPartValues(T, {}, v, i, s));
1569
+ ) : n.push(A.setPartValues(T, {}, y, i, s));
1445
1570
  }
1446
1571
  }
1447
1572
  } else
1448
1573
  for (const h of e.getChildElementFragments())
1449
1574
  n.push(
1450
- S.setPartValues(h, t, null, i, s)
1575
+ A.setPartValues(h, t, null, i, s)
1451
1576
  );
1452
1577
  return Promise.all(n).then(() => {
1453
1578
  });
@@ -1460,10 +1585,10 @@ class S {
1460
1585
  * @returns すべての初期化処理が完了するPromise
1461
1586
  */
1462
1587
  static async reset(e) {
1463
- S.clearValues(e), await Promise.all([
1464
- S.clearMessages(e),
1465
- S.clearEachClones(e)
1466
- ]), await x.enqueue(() => {
1588
+ A.clearValues(e), await Promise.all([
1589
+ A.clearMessages(e),
1590
+ A.clearEachClones(e)
1591
+ ]), await M.enqueue(() => {
1467
1592
  const t = e.getTarget();
1468
1593
  if (t instanceof HTMLFormElement)
1469
1594
  t.reset();
@@ -1508,7 +1633,7 @@ class S {
1508
1633
  static clearValues(e) {
1509
1634
  e.clearValue();
1510
1635
  for (const t of e.getChildElementFragments())
1511
- S.clearValues(t);
1636
+ A.clearValues(t);
1512
1637
  }
1513
1638
  /**
1514
1639
  * フラグメントとその子要素のメッセージをクリアします。
@@ -1517,7 +1642,7 @@ class S {
1517
1642
  * @returns Promise(メッセージのクリアが完了したら解決される)
1518
1643
  */
1519
1644
  static clearMessages(e) {
1520
- return he().clearMessages(
1645
+ return fe().clearMessages(
1521
1646
  e.getTarget()
1522
1647
  );
1523
1648
  }
@@ -1531,7 +1656,7 @@ class S {
1531
1656
  * @return Promise(メッセージの追加が完了したら解決される)
1532
1657
  */
1533
1658
  static addErrorMessage(e, t, r) {
1534
- return S.addMessage(e, t, r, "error");
1659
+ return A.addMessage(e, t, r, "error");
1535
1660
  }
1536
1661
  /**
1537
1662
  * キーに一致するフラグメントにレベル付きメッセージを追加します。
@@ -1544,7 +1669,7 @@ class S {
1544
1669
  * @return Promise(メッセージの追加が完了したら解決される)
1545
1670
  */
1546
1671
  static addMessage(e, t, r, i) {
1547
- const s = [], n = he(), a = n.addMessage, o = (d) => typeof a == "function" ? a.call(n, d, r, i) : n.addErrorMessage(d, r), c = S.findFragmentsByKey(e, t);
1672
+ const s = [], n = fe(), a = n.addMessage, o = (d) => typeof a == "function" ? a.call(n, d, r, i) : n.addErrorMessage(d, r), c = A.findFragmentsByKey(e, t);
1548
1673
  return c.forEach((d) => {
1549
1674
  s.push(o(d.getTarget()));
1550
1675
  }), c.length === 0 && s.push(o(e.getTarget())), Promise.all(s).then(() => {
@@ -1558,7 +1683,7 @@ class S {
1558
1683
  * @returns 一致するフラグメントの配列
1559
1684
  */
1560
1685
  static findFragmentsByKey(e, t) {
1561
- return S.findFragmentByKeyParts(e, t.split("."));
1686
+ return A.findFragmentByKeyParts(e, t.split("."));
1562
1687
  }
1563
1688
  /**
1564
1689
  * 指定されたキーに一致するフラグメントを検索します。
@@ -1572,7 +1697,7 @@ class S {
1572
1697
  const r = [], i = t[0];
1573
1698
  if (t.length == 1 && e.getAttribute("name") === i && r.push(e), e.hasAttribute(`${l.prefix}form-object`))
1574
1699
  t.length > 1 && e.getAttribute(`${l.prefix}form-object`) === i && e.getChildElementFragments().forEach((n) => {
1575
- r.push(...S.findFragmentByKeyParts(n, t.slice(1)));
1700
+ r.push(...A.findFragmentByKeyParts(n, t.slice(1)));
1576
1701
  });
1577
1702
  else if (e.hasAttribute(`${l.prefix}form-list`)) {
1578
1703
  if (t.length > 1) {
@@ -1586,7 +1711,7 @@ class S {
1586
1711
  else {
1587
1712
  const h = e.getChildElementFragments().filter((p) => p.hasAttribute(`${l.prefix}row`));
1588
1713
  d < h.length && r.push(
1589
- ...S.findFragmentByKeyParts(h[d], t.slice(1))
1714
+ ...A.findFragmentByKeyParts(h[d], t.slice(1))
1590
1715
  );
1591
1716
  }
1592
1717
  }
@@ -1594,7 +1719,7 @@ class S {
1594
1719
  }
1595
1720
  } else
1596
1721
  e.getChildElementFragments().forEach((s) => {
1597
- r.push(...S.findFragmentByKeyParts(s, t));
1722
+ r.push(...A.findFragmentByKeyParts(s, t));
1598
1723
  });
1599
1724
  return r;
1600
1725
  }
@@ -1617,12 +1742,12 @@ class S {
1617
1742
  return r ? this.getFormFragment(r) : null;
1618
1743
  }
1619
1744
  }
1620
- const N = class N {
1745
+ const F = class F {
1621
1746
  /**
1622
1747
  * 集計状態を初期化します。
1623
1748
  */
1624
1749
  static reset() {
1625
- N.ELEMENT_STORES.clear(), N.ensureGlobalAccess();
1750
+ F.ELEMENT_STORES.clear(), F.ensureGlobalAccess();
1626
1751
  }
1627
1752
  /**
1628
1753
  * 現在の集計結果スナップショットを返します。
@@ -1630,7 +1755,7 @@ const N = class N {
1630
1755
  * @returns エレメントごとの集計結果
1631
1756
  */
1632
1757
  static snapshot() {
1633
- return N.ensureGlobalAccess(), [...N.ELEMENT_STORES.entries()].map(([e, t]) => ({
1758
+ return F.ensureGlobalAccess(), [...F.ELEMENT_STORES.entries()].map(([e, t]) => ({
1634
1759
  elementId: e,
1635
1760
  tagName: t.tagName,
1636
1761
  attributes: [...t.attributes.entries()].map(([r, i]) => ({
@@ -1639,7 +1764,7 @@ const N = class N {
1639
1764
  calls: i.calls,
1640
1765
  totalDurationMs: i.totalDurationMs,
1641
1766
  maxDurationMs: i.maxDurationMs,
1642
- placeholders: N.sortPlaceholders(
1767
+ placeholders: F.sortPlaceholders(
1643
1768
  i.placeholders
1644
1769
  )
1645
1770
  })).sort((r, i) => i.calls - r.calls),
@@ -1649,7 +1774,7 @@ const N = class N {
1649
1774
  calls: i.calls,
1650
1775
  totalDurationMs: i.totalDurationMs,
1651
1776
  maxDurationMs: i.maxDurationMs,
1652
- placeholders: N.sortPlaceholders(
1777
+ placeholders: F.sortPlaceholders(
1653
1778
  i.placeholders
1654
1779
  )
1655
1780
  })).sort((r, i) => i.calls - r.calls)
@@ -1667,29 +1792,29 @@ const N = class N {
1667
1792
  static record(e, t, r) {
1668
1793
  if (!B.isEnabled() || !e || t.length === 0)
1669
1794
  return;
1670
- N.ensureGlobalAccess();
1671
- const i = N.getOrCreateElementStore(
1795
+ F.ensureGlobalAccess();
1796
+ const i = F.getOrCreateElementStore(
1672
1797
  e.element
1673
1798
  );
1674
1799
  if (e.kind === "attribute") {
1675
- const n = N.getOrCreateCounter(
1800
+ const n = F.getOrCreateCounter(
1676
1801
  i.attributes,
1677
1802
  e.rawName,
1678
1803
  e.template
1679
1804
  );
1680
- N.updateCounter(
1805
+ F.updateCounter(
1681
1806
  n,
1682
1807
  t,
1683
1808
  r
1684
1809
  );
1685
1810
  return;
1686
1811
  }
1687
- const s = N.getOrCreateCounter(
1812
+ const s = F.getOrCreateCounter(
1688
1813
  i.texts,
1689
1814
  String(e.childIndex),
1690
1815
  e.template
1691
1816
  );
1692
- N.updateCounter(
1817
+ F.updateCounter(
1693
1818
  s,
1694
1819
  t,
1695
1820
  r
@@ -1702,9 +1827,9 @@ const N = class N {
1702
1827
  if (!B.isEnabled())
1703
1828
  return;
1704
1829
  const e = globalThis;
1705
- e[N.GLOBAL_KEY] === void 0 && (e[N.GLOBAL_KEY] = {
1706
- reset: () => N.reset(),
1707
- snapshot: () => N.snapshot()
1830
+ e[F.GLOBAL_KEY] === void 0 && (e[F.GLOBAL_KEY] = {
1831
+ reset: () => F.reset(),
1832
+ snapshot: () => F.snapshot()
1708
1833
  });
1709
1834
  }
1710
1835
  /**
@@ -1714,7 +1839,7 @@ const N = class N {
1714
1839
  * @returns 集計ストア
1715
1840
  */
1716
1841
  static getOrCreateElementStore(e) {
1717
- const t = N.createElementId(e), r = N.ELEMENT_STORES.get(t);
1842
+ const t = F.createElementId(e), r = F.ELEMENT_STORES.get(t);
1718
1843
  if (r)
1719
1844
  return r;
1720
1845
  const i = {
@@ -1722,7 +1847,7 @@ const N = class N {
1722
1847
  attributes: /* @__PURE__ */ new Map(),
1723
1848
  texts: /* @__PURE__ */ new Map()
1724
1849
  };
1725
- return N.ELEMENT_STORES.set(t, i), i;
1850
+ return F.ELEMENT_STORES.set(t, i), i;
1726
1851
  }
1727
1852
  /**
1728
1853
  * カウンタを取得または初期化します。
@@ -1772,7 +1897,7 @@ const N = class N {
1772
1897
  */
1773
1898
  static updateCounter(e, t, r) {
1774
1899
  e.calls += 1, e.totalDurationMs += r, e.maxDurationMs = Math.max(e.maxDurationMs, r), t.forEach((i) => {
1775
- const s = N.getOrCreatePlaceholder(
1900
+ const s = F.getOrCreatePlaceholder(
1776
1901
  e.placeholders,
1777
1902
  i.expression
1778
1903
  );
@@ -1811,10 +1936,10 @@ const N = class N {
1811
1936
  * @returns 結果と所要時間
1812
1937
  */
1813
1938
  static measure(e) {
1814
- const t = N.now();
1939
+ const t = F.now();
1815
1940
  return {
1816
1941
  value: e(),
1817
- durationMs: N.now() - t
1942
+ durationMs: F.now() - t
1818
1943
  };
1819
1944
  }
1820
1945
  /**
@@ -1841,8 +1966,8 @@ const N = class N {
1841
1966
  return t.join(" > ");
1842
1967
  }
1843
1968
  };
1844
- N.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", N.ELEMENT_STORES = /* @__PURE__ */ new Map();
1845
- let Q = N;
1969
+ F.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", F.ELEMENT_STORES = /* @__PURE__ */ new Map();
1970
+ let Z = F;
1846
1971
  const G = class G {
1847
1972
  /**
1848
1973
  * フラグメントのコンストラクタ。
@@ -1860,13 +1985,13 @@ const G = class G {
1860
1985
  let t;
1861
1986
  switch (e.nodeType) {
1862
1987
  case Node.ELEMENT_NODE:
1863
- t = new C(e);
1988
+ t = new k(e);
1864
1989
  break;
1865
1990
  case Node.TEXT_NODE:
1866
1991
  t = new L(e);
1867
1992
  break;
1868
1993
  case Node.COMMENT_NODE:
1869
- t = new le(e);
1994
+ t = new ce(e);
1870
1995
  break;
1871
1996
  default:
1872
1997
  return g.warn("[Haori]", "Unsupported node type:", e.nodeType), null;
@@ -1891,7 +2016,7 @@ const G = class G {
1891
2016
  return Promise.resolve();
1892
2017
  if (this.parent) {
1893
2018
  const e = this.parent, t = e.skipMutationNodes;
1894
- return x.enqueue(() => {
2019
+ return M.enqueue(() => {
1895
2020
  e.skipMutationNodes = !0, this.target.parentNode === e.getTarget() && e.getTarget().removeChild(this.target), this.mounted = !1;
1896
2021
  }).finally(() => {
1897
2022
  e.skipMutationNodes = t;
@@ -1899,7 +2024,7 @@ const G = class G {
1899
2024
  } else {
1900
2025
  const e = this.target.parentNode;
1901
2026
  if (e)
1902
- return x.enqueue(() => {
2027
+ return M.enqueue(() => {
1903
2028
  this.target.parentNode === e && e.removeChild(this.target), this.mounted = !1;
1904
2029
  });
1905
2030
  this.mounted = !1;
@@ -1916,7 +2041,7 @@ const G = class G {
1916
2041
  return Promise.resolve();
1917
2042
  if (this.parent) {
1918
2043
  const e = this.parent, t = e.skipMutationNodes;
1919
- return x.enqueue(() => {
2044
+ return M.enqueue(() => {
1920
2045
  e.skipMutationNodes = !0, this.target.parentNode !== e.getTarget() && e.getTarget().appendChild(this.target), this.mounted = !0;
1921
2046
  }).finally(() => {
1922
2047
  e.skipMutationNodes = t;
@@ -1976,7 +2101,7 @@ const G = class G {
1976
2101
  };
1977
2102
  G.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
1978
2103
  let w = G;
1979
- const V = class V extends w {
2104
+ const j = class j extends w {
1980
2105
  /**
1981
2106
  * エレメントフラグメントのコンストラクタ。
1982
2107
  * アトリビュートや子フラグメントの作成も行います。
@@ -2002,7 +2127,7 @@ const V = class V extends w {
2002
2127
  ], this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.derivedBindingData = null, this.bindingDataCache = null, this.descendantBindingDataCache = null, this.visible = !0, this.display = null, this.displayPriority = null, this.template = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.value = null, this.skipMutationAttributes = !1, this.skipChangeValue = !1, this.syncValue(), e.getAttributeNames().forEach((t) => {
2003
2128
  const r = e.getAttribute(t);
2004
2129
  if (r !== null && !this.attributeMap.has(t)) {
2005
- const i = new Z(t, r);
2130
+ const i = new _(t, r);
2006
2131
  this.attributeMap.set(t, i);
2007
2132
  }
2008
2133
  }), e.childNodes.forEach((t) => {
@@ -2025,7 +2150,7 @@ const V = class V extends w {
2025
2150
  */
2026
2151
  getChildElementFragments() {
2027
2152
  return this.children.filter(
2028
- (e) => e instanceof V
2153
+ (e) => e instanceof j
2029
2154
  );
2030
2155
  }
2031
2156
  /**
@@ -2057,7 +2182,7 @@ const V = class V extends w {
2057
2182
  * @returns クローンされたフラグメント
2058
2183
  */
2059
2184
  clone() {
2060
- const e = new V(
2185
+ const e = new j(
2061
2186
  this.target.cloneNode(!1)
2062
2187
  );
2063
2188
  return this.attributeMap.forEach((t, r) => {
@@ -2072,7 +2197,7 @@ const V = class V extends w {
2072
2197
  */
2073
2198
  normalizeClonedVisibilityState() {
2074
2199
  (this.visible === !1 || this.getTarget().style.display === "none" || this.getTarget().hasAttribute(`${l.prefix}if-false`)) && (this.visible = !0, this.display = null, this.displayPriority = null, this.getTarget().style.removeProperty("display"), this.getTarget().removeAttribute(`${l.prefix}if-false`)), this.children.forEach((e) => {
2075
- e instanceof V && e.normalizeClonedVisibilityState();
2200
+ e instanceof j && e.normalizeClonedVisibilityState();
2076
2201
  });
2077
2202
  }
2078
2203
  /**
@@ -2160,7 +2285,7 @@ const V = class V extends w {
2160
2285
  */
2161
2286
  clearBindingDataCache() {
2162
2287
  this.bindingDataCache = null, this.descendantBindingDataCache = null, this.children.forEach((e) => {
2163
- e instanceof V && e.clearBindingDataCache();
2288
+ e instanceof j && e.clearBindingDataCache();
2164
2289
  });
2165
2290
  }
2166
2291
  /**
@@ -2310,12 +2435,12 @@ const V = class V extends w {
2310
2435
  if (r instanceof HTMLInputElement && (r.type === "checkbox" || r.type === "radio")) {
2311
2436
  const i = this.getAttribute("value"), s = r.type === "checkbox" && i === "true";
2312
2437
  let n;
2313
- return s ? n = e === !0 || e === "true" : i === "false" ? n = e === !1 : n = i === String(e), this.value = s ? n : n ? e : null, r.checked === n ? Promise.resolve() : (this.skipChangeValue = !0, x.enqueue(() => {
2438
+ return s ? n = e === !0 || e === "true" : i === "false" ? n = e === !1 : n = i === String(e), this.value = s ? n : n ? e : null, r.checked === n ? Promise.resolve() : (this.skipChangeValue = !0, M.enqueue(() => {
2314
2439
  r.checked = n, t && r.dispatchEvent(new Event("change", { bubbles: !0 }));
2315
2440
  }).finally(() => {
2316
2441
  this.skipChangeValue = !1;
2317
2442
  }));
2318
- } else return r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement ? (this.value = this.normalizeValueForElement(r, e), this.skipChangeValue = !0, x.enqueue(() => {
2443
+ } else return r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement ? (this.value = this.normalizeValueForElement(r, e), this.skipChangeValue = !0, M.enqueue(() => {
2319
2444
  r.value = e === null ? "" : String(e), t && ((r instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(r.type) || r instanceof HTMLTextAreaElement) && r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 })));
2320
2445
  }).finally(() => {
2321
2446
  this.skipChangeValue = !1;
@@ -2421,7 +2546,7 @@ const V = class V extends w {
2421
2546
  return Promise.resolve();
2422
2547
  this.attributeMap.delete(e), this.skipMutationAttributes = !0;
2423
2548
  const r = this.getTarget();
2424
- return x.enqueue(() => {
2549
+ return M.enqueue(() => {
2425
2550
  r.removeAttribute(e), t !== e && r.removeAttribute(t);
2426
2551
  }).finally(() => {
2427
2552
  this.skipMutationAttributes = !1;
@@ -2441,11 +2566,11 @@ const V = class V extends w {
2441
2566
  return Promise.resolve();
2442
2567
  if (r === null)
2443
2568
  return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
2444
- const n = new Z(e, r);
2569
+ const n = new _(e, r);
2445
2570
  if (s) {
2446
- const U = this.attributeMap.get(e);
2447
- if (U && (U.isEvaluate || U.isForceEvaluation()) && !n.isEvaluate && !n.isForceEvaluation())
2448
- return this.skipMutationAttributes = !0, x.enqueue(() => {
2571
+ const x = this.attributeMap.get(e);
2572
+ if (x && (x.isEvaluate || x.isForceEvaluation()) && !n.isEvaluate && !n.isForceEvaluation())
2573
+ return this.skipMutationAttributes = !0, M.enqueue(() => {
2449
2574
  }).finally(() => {
2450
2575
  this.skipMutationAttributes = !1;
2451
2576
  });
@@ -2456,9 +2581,9 @@ const V = class V extends w {
2456
2581
  element: a,
2457
2582
  rawName: e,
2458
2583
  template: r
2459
- }), c = n.isEvaluate || n.isRawEvaluate, d = e === t && V.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), h = n.isSingleExpression(), p = j.joinEvaluateResults(o.results), v = o.results.length === 1 ? o.results[0] : p, T = !n.isForceEvaluation() && (t !== e || d || h ? o.hasUnresolvedReference || v === null || v === void 0 || v === !1 : c && p === ""), b = n.isForceEvaluation() ? r : h ? v : p, y = i && n.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), m = T || b === null || b === !1 ? null : String(b), A = e !== t && a.getAttribute(e) !== r, F = m === null ? a.hasAttribute(t) : a.getAttribute(t) !== m, M = y && m !== null && a.value !== m;
2460
- return !A && !F && !M ? (y && m !== null && (this.value = this.normalizeValueForElement(a, m)), Promise.resolve()) : (this.skipMutationAttributes = !0, x.enqueue(() => {
2461
- A && a.setAttribute(e, r), m === null ? a.removeAttribute(t) : (F && a.setAttribute(t, m), y && (this.value = this.normalizeValueForElement(a, m), M && (a.value = m)));
2584
+ }), c = n.isEvaluate || n.isRawEvaluate, d = e === t && j.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), h = n.isSingleExpression(), p = q.joinEvaluateResults(o.results), y = o.results.length === 1 ? o.results[0] : p, T = !n.isForceEvaluation() && (t !== e || d || h ? o.hasUnresolvedReference || y === null || y === void 0 || y === !1 : c && p === ""), I = n.isForceEvaluation() ? r : h ? y : p, E = i && n.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), b = T || I === null || I === !1 ? null : String(I), v = e !== t && a.getAttribute(e) !== r, S = b === null ? a.hasAttribute(t) : a.getAttribute(t) !== b, N = E && b !== null && a.value !== b;
2585
+ return !v && !S && !N ? (E && b !== null && (this.value = this.normalizeValueForElement(a, b)), Promise.resolve()) : (this.skipMutationAttributes = !0, M.enqueue(() => {
2586
+ v && a.setAttribute(e, r), b === null ? a.removeAttribute(t) : (S && a.setAttribute(t, b), E && (this.value = this.normalizeValueForElement(a, b), N && (a.value = b)));
2462
2587
  }).finally(() => {
2463
2588
  this.skipMutationAttributes = !1;
2464
2589
  }));
@@ -2474,7 +2599,7 @@ const V = class V extends w {
2474
2599
  return Promise.resolve();
2475
2600
  this.attributeMap.delete(e), this.skipMutationAttributes = !0;
2476
2601
  const t = this.getTarget();
2477
- return x.enqueue(() => {
2602
+ return M.enqueue(() => {
2478
2603
  t.removeAttribute(e);
2479
2604
  }).finally(() => {
2480
2605
  this.skipMutationAttributes = !1;
@@ -2510,7 +2635,7 @@ const V = class V extends w {
2510
2635
  value: r.results[0],
2511
2636
  hasUnresolvedReference: r.hasUnresolvedReference
2512
2637
  } : {
2513
- value: j.joinEvaluateResults(r.results),
2638
+ value: q.joinEvaluateResults(r.results),
2514
2639
  hasUnresolvedReference: r.hasUnresolvedReference
2515
2640
  };
2516
2641
  }
@@ -2595,21 +2720,21 @@ const V = class V extends w {
2595
2720
  else {
2596
2721
  let p;
2597
2722
  if (n ? a !== -1 && a < o ? p = o - 1 : p = o : p = this.children.indexOf(t), p === -1) {
2598
- const v = this.resolveInsertionPointFromDom(
2723
+ const y = this.resolveInsertionPointFromDom(
2599
2724
  t,
2600
2725
  !1
2601
2726
  );
2602
- v === null ? (g.warn(
2727
+ y === null ? (g.warn(
2603
2728
  "[Haori]",
2604
2729
  "Reference child not found in children.",
2605
2730
  t
2606
- ), this.children.push(e)) : (this.children.splice(v.index, 0, e), d = v.referenceNode);
2731
+ ), this.children.push(e)) : (this.children.splice(y.index, 0, e), d = y.referenceNode);
2607
2732
  } else
2608
2733
  this.children.splice(p, 0, e);
2609
2734
  }
2610
2735
  e.setParent(this), e.setMounted(this.mounted);
2611
2736
  const h = this.skipMutationNodes;
2612
- return this.skipMutationNodes = !0, x.enqueue(() => {
2737
+ return this.skipMutationNodes = !0, M.enqueue(() => {
2613
2738
  this.target.insertBefore(e.getTarget(), d);
2614
2739
  }).finally(() => {
2615
2740
  this.skipMutationNodes = h;
@@ -2718,7 +2843,7 @@ const V = class V extends w {
2718
2843
  return t === null ? null : t.closestByAttribute(e);
2719
2844
  }
2720
2845
  };
2721
- V.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
2846
+ j.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
2722
2847
  "allowfullscreen",
2723
2848
  "async",
2724
2849
  "autofocus",
@@ -2743,7 +2868,7 @@ V.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
2743
2868
  "reversed",
2744
2869
  "selected"
2745
2870
  ]);
2746
- let C = V;
2871
+ let k = j;
2747
2872
  class L extends w {
2748
2873
  /**
2749
2874
  * テキストフラグメントのコンストラクタ。
@@ -2752,7 +2877,7 @@ class L extends w {
2752
2877
  * @param target 対象テキストノード
2753
2878
  */
2754
2879
  constructor(e) {
2755
- super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new j(this.text);
2880
+ super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new q(this.text);
2756
2881
  }
2757
2882
  /**
2758
2883
  * フラグメントをクローンします。
@@ -2786,7 +2911,7 @@ class L extends w {
2786
2911
  * @returns 更新のPromise
2787
2912
  */
2788
2913
  setContent(e) {
2789
- return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new j(e), this.evaluate());
2914
+ return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new q(e), this.evaluate());
2790
2915
  }
2791
2916
  /**
2792
2917
  * フラグメントを評価します。
@@ -2796,7 +2921,7 @@ class L extends w {
2796
2921
  evaluate() {
2797
2922
  return this.contents.isRawEvaluate && this.parent === null ? Promise.reject(
2798
2923
  new Error("Parent fragment is required for raw evaluation")
2799
- ) : x.enqueue(() => {
2924
+ ) : M.enqueue(() => {
2800
2925
  this.skipMutation = !0;
2801
2926
  let e = this.text;
2802
2927
  this.contents.isRawEvaluate ? e = this.contents.evaluate(
@@ -2807,7 +2932,7 @@ class L extends w {
2807
2932
  childIndex: this.parent.getChildren().indexOf(this),
2808
2933
  template: this.text
2809
2934
  }
2810
- )[0] : this.contents.isEvaluate && (e = j.joinEvaluateResults(
2935
+ )[0] : this.contents.isEvaluate && (e = q.joinEvaluateResults(
2811
2936
  this.contents.evaluate(this.parent.getBindingData(), {
2812
2937
  kind: "text",
2813
2938
  element: this.parent.getTarget(),
@@ -2822,7 +2947,7 @@ class L extends w {
2822
2947
  });
2823
2948
  }
2824
2949
  }
2825
- class le extends w {
2950
+ class ce extends w {
2826
2951
  /**
2827
2952
  * コメントフラグメントのコンストラクタ。
2828
2953
  * 対象コメントノードの内容を初期化します。
@@ -2838,7 +2963,7 @@ class le extends w {
2838
2963
  * @returns クローンされたフラグメント
2839
2964
  */
2840
2965
  clone() {
2841
- const e = new le(this.target.cloneNode(!0));
2966
+ const e = new ce(this.target.cloneNode(!0));
2842
2967
  return e.mounted = !1, e.text = this.text, e;
2843
2968
  }
2844
2969
  /**
@@ -2856,14 +2981,14 @@ class le extends w {
2856
2981
  * @return 更新のPromise
2857
2982
  */
2858
2983
  setContent(e) {
2859
- return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, x.enqueue(() => {
2984
+ return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, M.enqueue(() => {
2860
2985
  this.skipMutation = !0, this.target.textContent = this.text;
2861
2986
  }).finally(() => {
2862
2987
  this.skipMutation = !1;
2863
2988
  }));
2864
2989
  }
2865
2990
  }
2866
- const ee = class ee {
2991
+ const te = class te {
2867
2992
  /**
2868
2993
  * コンストラクタ。
2869
2994
  *
@@ -2871,7 +2996,7 @@ const ee = class ee {
2871
2996
  */
2872
2997
  constructor(e) {
2873
2998
  this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = e;
2874
- const t = [...e.matchAll(ee.PLACEHOLDER_REGEX)];
2999
+ const t = [...e.matchAll(te.PLACEHOLDER_REGEX)];
2875
3000
  let r = 0, i = !1, s = !1;
2876
3001
  for (const n of t) {
2877
3002
  n.index > r && this.contents.push({
@@ -2968,8 +3093,8 @@ const ee = class ee {
2968
3093
  return this.contents.forEach((c) => {
2969
3094
  try {
2970
3095
  if (r(c)) {
2971
- const d = Q.measure(
2972
- () => J.evaluateDetailed(c.text, e)
3096
+ const d = Z.measure(
3097
+ () => W.evaluateDetailed(c.text, e)
2973
3098
  ), h = d.value;
2974
3099
  a += d.durationMs, n.push({
2975
3100
  expression: c.text,
@@ -2987,16 +3112,16 @@ const ee = class ee {
2987
3112
  durationMs: 0
2988
3113
  }), s.push("");
2989
3114
  }
2990
- }), Q.record(
3115
+ }), Z.record(
2991
3116
  t,
2992
3117
  n,
2993
3118
  a
2994
3119
  ), { results: s, hasUnresolvedReference: o };
2995
3120
  }
2996
3121
  };
2997
- ee.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
2998
- let j = ee;
2999
- const te = class te extends j {
3122
+ te.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
3123
+ let q = te;
3124
+ const re = class re extends q {
3000
3125
  /**
3001
3126
  * コンストラクタ。
3002
3127
  *
@@ -3004,7 +3129,7 @@ const te = class te extends j {
3004
3129
  * @param text 属性値
3005
3130
  */
3006
3131
  constructor(e, t) {
3007
- super(t), this.forceEvaluation = te.FORCE_EVALUATION_ATTRIBUTES.includes(e);
3132
+ super(t), this.forceEvaluation = re.FORCE_EVALUATION_ATTRIBUTES.includes(e);
3008
3133
  }
3009
3134
  /**
3010
3135
  * 強制評価フラグを取得します。
@@ -3051,7 +3176,7 @@ const te = class te extends j {
3051
3176
  }) : r;
3052
3177
  }
3053
3178
  };
3054
- te.FORCE_EVALUATION_ATTRIBUTES = [
3179
+ re.FORCE_EVALUATION_ATTRIBUTES = [
3055
3180
  "data-if",
3056
3181
  "hor-if",
3057
3182
  "data-each",
@@ -3059,7 +3184,7 @@ te.FORCE_EVALUATION_ATTRIBUTES = [
3059
3184
  "data-derive",
3060
3185
  "hor-derive"
3061
3186
  ];
3062
- let Z = te;
3187
+ let _ = re;
3063
3188
  class R {
3064
3189
  /**
3065
3190
  * カスタムイベントを発火します。
@@ -3282,36 +3407,36 @@ class R {
3282
3407
  });
3283
3408
  }
3284
3409
  }
3285
- const Te = [
3410
+ const Pe = [
3286
3411
  "addErrorMessage",
3287
3412
  "closeDialog",
3288
3413
  "confirm",
3289
3414
  "dialog",
3290
3415
  "openDialog",
3291
3416
  "toast"
3292
- ], we = "__haoriHistoryState__", ie = "data-haori-click-lock";
3293
- function se() {
3417
+ ], Ie = "__haoriHistoryState__", ne = "data-haori-click-lock";
3418
+ function ae() {
3294
3419
  const e = globalThis.window?.Haori;
3295
- return Te.every(
3420
+ return Pe.every(
3296
3421
  (r) => typeof e?.[r] == "function"
3297
3422
  ) ? e : X;
3298
3423
  }
3299
- const De = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
3300
- function Re(E) {
3301
- return De.has(E.toUpperCase());
3424
+ const Ce = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
3425
+ function ke(m) {
3426
+ return Ce.has(m.toUpperCase());
3302
3427
  }
3303
- function Fe(E, e) {
3428
+ function Oe(m, e) {
3304
3429
  for (const [t, r] of Object.entries(e))
3305
- r !== void 0 && (r === null ? E.append(t, "") : Array.isArray(r) ? r.forEach((i) => {
3306
- E.append(t, String(i));
3307
- }) : typeof r == "object" || typeof r == "function" ? E.append(t, JSON.stringify(r)) : E.append(t, String(r)));
3430
+ r !== void 0 && (r === null ? m.append(t, "") : Array.isArray(r) ? r.forEach((i) => {
3431
+ m.append(t, String(i));
3432
+ }) : typeof r == "object" || typeof r == "function" ? m.append(t, JSON.stringify(r)) : m.append(t, String(r)));
3308
3433
  }
3309
- function Ne(E, e) {
3310
- const t = new URL(E, window.location.href), r = new URLSearchParams(t.search);
3311
- return Fe(r, e), t.search = r.toString(), t.toString();
3434
+ function $e(m, e) {
3435
+ const t = new URL(m, window.location.href), r = new URLSearchParams(t.search);
3436
+ return Oe(r, e), t.search = r.toString(), t.toString();
3312
3437
  }
3313
- function Me(E) {
3314
- return E == null ? null : typeof E == "string" ? E : E instanceof URLSearchParams ? E.toString() : E instanceof FormData ? Array.from(E.entries()).map(([e, t]) => t instanceof File ? [
3438
+ function Be(m) {
3439
+ return m == null ? null : typeof m == "string" ? m : m instanceof URLSearchParams ? m.toString() : m instanceof FormData ? Array.from(m.entries()).map(([e, t]) => t instanceof File ? [
3315
3440
  e,
3316
3441
  {
3317
3442
  type: "file",
@@ -3319,19 +3444,19 @@ function Me(E) {
3319
3444
  size: t.size,
3320
3445
  mimeType: t.type
3321
3446
  }
3322
- ] : [e, String(t)]) : String(E);
3447
+ ] : [e, String(t)]) : String(m);
3323
3448
  }
3324
- function xe(E, e) {
3449
+ function He(m, e) {
3325
3450
  const t = new Headers(
3326
3451
  e.headers || void 0
3327
3452
  ), r = Array.from(t.entries()).sort(
3328
3453
  ([i], [s]) => i.localeCompare(s)
3329
3454
  );
3330
3455
  return JSON.stringify({
3331
- url: E,
3456
+ url: m,
3332
3457
  method: String(e.method || "GET").toUpperCase(),
3333
3458
  headers: r,
3334
- body: Me(e.body || null)
3459
+ body: Be(e.body || null)
3335
3460
  });
3336
3461
  }
3337
3462
  const f = class f {
@@ -3367,7 +3492,7 @@ const f = class f {
3367
3492
  return { value: e.replace(
3368
3493
  f.DATA_PLACEHOLDER_REGEX,
3369
3494
  (s, n, a) => {
3370
- const o = J.evaluateDetailed(
3495
+ const o = W.evaluateDetailed(
3371
3496
  n ?? a ?? "",
3372
3497
  t
3373
3498
  );
@@ -3447,7 +3572,7 @@ const f = class f {
3447
3572
  return { value: e.replace(
3448
3573
  f.DATA_PLACEHOLDER_REGEX,
3449
3574
  (s, n, a, o) => {
3450
- const c = J.evaluateDetailed(
3575
+ const c = W.evaluateDetailed(
3451
3576
  n ?? a ?? "",
3452
3577
  t
3453
3578
  );
@@ -3520,22 +3645,22 @@ const f = class f {
3520
3645
  if (t) {
3521
3646
  if (e.hasAttribute(f.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(f.attrName(t, "confirm")) && (r.confirmMessage = e.getAttribute(f.attrName(t, "confirm")).replace(/\\n/g, `
3522
3647
  `)), e.hasAttribute(f.attrName(t, "data")) && (r.dataAttrName = f.attrName(t, "data")), e.hasAttribute(f.attrName(t, "form"))) {
3523
- const y = e.getRawAttribute(
3648
+ const b = e.getRawAttribute(
3524
3649
  f.attrName(t, "form")
3525
3650
  );
3526
- if (y) {
3527
- const m = document.body.querySelector(y);
3528
- m !== null ? r.formFragment = S.getFormFragment(
3529
- w.get(m)
3651
+ if (b) {
3652
+ const v = document.body.querySelector(b);
3653
+ v !== null ? r.formFragment = A.getFormFragment(
3654
+ w.get(v)
3530
3655
  ) : g.error(
3531
3656
  "Haori",
3532
- `Form element not found: ${y} (${f.attrName(t, "form")})`
3657
+ `Form element not found: ${b} (${f.attrName(t, "form")})`
3533
3658
  );
3534
3659
  } else
3535
- r.formFragment = S.getFormFragment(e);
3536
- } else t === "change" && (r.formFragment = S.getFormFragment(e));
3660
+ r.formFragment = A.getFormFragment(e);
3661
+ } else t === "change" && (r.formFragment = A.getFormFragment(e));
3537
3662
  if (e.hasAttribute(`${l.prefix}${t}-before-run`)) {
3538
- const y = e.getRawAttribute(
3663
+ const b = e.getRawAttribute(
3539
3664
  `${l.prefix}${t}-before-run`
3540
3665
  );
3541
3666
  try {
@@ -3544,90 +3669,90 @@ const f = class f {
3544
3669
  "fetchOptions",
3545
3670
  `
3546
3671
  "use strict";
3547
- ${y}
3672
+ ${b}
3548
3673
  `
3549
3674
  );
3550
- } catch (m) {
3551
- g.error("Haori", `Invalid before script: ${m}`);
3675
+ } catch (v) {
3676
+ g.error("Haori", `Invalid before script: ${v}`);
3552
3677
  }
3553
3678
  }
3554
- const b = f.attrName(t, "run");
3555
- if (e.hasAttribute(b)) {
3556
- const y = String(e.getAttribute(b) ?? "");
3679
+ const E = f.attrName(t, "run");
3680
+ if (e.hasAttribute(E)) {
3681
+ const b = String(e.getAttribute(E) ?? "");
3557
3682
  try {
3558
3683
  r.runScript = new Function(
3559
3684
  "event",
3560
3685
  `
3561
3686
  "use strict";
3562
- ${y}
3687
+ ${b}
3563
3688
  `
3564
3689
  );
3565
- } catch (m) {
3566
- g.error("Haori", `Invalid run script: ${m}`);
3690
+ } catch (v) {
3691
+ g.error("Haori", `Invalid run script: ${v}`);
3567
3692
  }
3568
3693
  }
3569
3694
  }
3570
3695
  const i = f.attrName(t, "fetch"), s = e.hasAttribute(i);
3571
3696
  if (s) {
3572
- const b = e.getAttributeEvaluation(i);
3573
- b && (r.fetchHasUnresolvedReference = b.hasUnresolvedReference, r.fetchUrl = b.hasUnresolvedReference ? null : b.value);
3697
+ const E = e.getAttributeEvaluation(i);
3698
+ E && (r.fetchHasUnresolvedReference = E.hasUnresolvedReference, r.fetchUrl = E.hasUnresolvedReference ? null : E.value);
3574
3699
  }
3575
3700
  const n = {};
3576
3701
  if (t) {
3577
- const b = f.attrName(t, "fetch-method");
3578
- if (e.hasAttribute(b)) {
3579
- const y = e.getAttributeEvaluation(b);
3580
- y?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : n.method = y?.value;
3702
+ const E = f.attrName(t, "fetch-method");
3703
+ if (e.hasAttribute(E)) {
3704
+ const b = e.getAttributeEvaluation(E);
3705
+ b?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : n.method = b?.value;
3581
3706
  }
3582
3707
  } else {
3583
- const b = f.attrName(null, "method", !0);
3584
- if (e.hasAttribute(b)) {
3585
- const y = e.getAttributeEvaluation(
3586
- b
3708
+ const E = f.attrName(null, "method", !0);
3709
+ if (e.hasAttribute(E)) {
3710
+ const b = e.getAttributeEvaluation(
3711
+ E
3587
3712
  );
3588
- y?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : n.method = y?.value;
3713
+ b?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : n.method = b?.value;
3589
3714
  }
3590
3715
  }
3591
3716
  if (t) {
3592
- const b = f.attrName(t, "fetch-headers");
3593
- if (e.hasAttribute(b)) {
3594
- const y = e.getRawAttribute(
3595
- b
3717
+ const E = f.attrName(t, "fetch-headers");
3718
+ if (e.hasAttribute(E)) {
3719
+ const b = e.getRawAttribute(
3720
+ E
3596
3721
  );
3597
3722
  try {
3598
- n.headers = P.parseDataBind(y);
3599
- } catch (m) {
3600
- g.error("Haori", `Invalid fetch headers: ${m}`);
3723
+ n.headers = P.parseDataBind(b);
3724
+ } catch (v) {
3725
+ g.error("Haori", `Invalid fetch headers: ${v}`);
3601
3726
  }
3602
3727
  }
3603
3728
  } else {
3604
- const b = f.attrName(
3729
+ const E = f.attrName(
3605
3730
  null,
3606
3731
  "headers",
3607
3732
  !0
3608
3733
  );
3609
- if (e.hasAttribute(b)) {
3610
- const y = e.getRawAttribute(
3611
- b
3734
+ if (e.hasAttribute(E)) {
3735
+ const b = e.getRawAttribute(
3736
+ E
3612
3737
  );
3613
3738
  try {
3614
- n.headers = P.parseDataBind(y);
3615
- } catch (m) {
3616
- g.error("Haori", `Invalid fetch headers: ${m}`);
3739
+ n.headers = P.parseDataBind(b);
3740
+ } catch (v) {
3741
+ g.error("Haori", `Invalid fetch headers: ${v}`);
3617
3742
  }
3618
3743
  }
3619
3744
  }
3620
3745
  if (t) {
3621
- const b = f.attrName(t, "fetch-content-type");
3622
- if (e.hasAttribute(b)) {
3623
- const y = e.getAttributeEvaluation(b);
3624
- y?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), n.headers = {
3746
+ const E = f.attrName(t, "fetch-content-type");
3747
+ if (e.hasAttribute(E)) {
3748
+ const b = e.getAttributeEvaluation(E);
3749
+ b?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), n.headers = {
3625
3750
  ...n.headers,
3626
- "Content-Type": y?.value
3751
+ "Content-Type": b?.value
3627
3752
  };
3628
3753
  } else if (n.method && n.method !== "GET" && n.method !== "HEAD" && n.method !== "OPTIONS") {
3629
- let y = !1;
3630
- n.headers && typeof n.headers == "object" && (y = "Content-Type" in n.headers), y || (n.headers = {
3754
+ let b = !1;
3755
+ n.headers && typeof n.headers == "object" && (b = "Content-Type" in n.headers), b || (n.headers = {
3631
3756
  ...n.headers,
3632
3757
  "Content-Type": "application/json"
3633
3758
  });
@@ -3636,20 +3761,20 @@ ${y}
3636
3761
  "Content-Type": "application/x-www-form-urlencoded"
3637
3762
  });
3638
3763
  } else {
3639
- const b = f.attrName(
3764
+ const E = f.attrName(
3640
3765
  null,
3641
3766
  "content-type",
3642
3767
  !0
3643
3768
  );
3644
- if (e.hasAttribute(b)) {
3645
- const y = e.getAttributeEvaluation(b);
3646
- y?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), n.headers = {
3769
+ if (e.hasAttribute(E)) {
3770
+ const b = e.getAttributeEvaluation(E);
3771
+ b?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), n.headers = {
3647
3772
  ...n.headers,
3648
- "Content-Type": y?.value
3773
+ "Content-Type": b?.value
3649
3774
  };
3650
3775
  } else if (n.method && n.method !== "GET" && n.method !== "HEAD" && n.method !== "OPTIONS") {
3651
- let y = !1;
3652
- n.headers && typeof n.headers == "object" && (y = "Content-Type" in n.headers), y || (n.headers = {
3776
+ let b = !1;
3777
+ n.headers && typeof n.headers == "object" && (b = "Content-Type" in n.headers), b || (n.headers = {
3653
3778
  ...n.headers,
3654
3779
  "Content-Type": "application/json"
3655
3780
  });
@@ -3661,15 +3786,15 @@ ${y}
3661
3786
  Object.keys(n).length > 0 && (r.fetchOptions = n);
3662
3787
  const a = t ? f.attrName(t, "bind") : f.attrName(null, "bind", !0);
3663
3788
  if (e.hasAttribute(a)) {
3664
- const b = e.getRawAttribute(a);
3665
- if (b) {
3666
- const y = document.body.querySelectorAll(b);
3667
- y.length > 0 ? (r.bindFragments = [], y.forEach((m) => {
3668
- const A = w.get(m);
3669
- A && r.bindFragments.push(A);
3789
+ const E = e.getRawAttribute(a);
3790
+ if (E) {
3791
+ const b = document.body.querySelectorAll(E);
3792
+ b.length > 0 ? (r.bindFragments = [], b.forEach((v) => {
3793
+ const S = w.get(v);
3794
+ S && r.bindFragments.push(S);
3670
3795
  })) : g.error(
3671
3796
  "Haori",
3672
- `Bind element not found: ${b} (${a})`
3797
+ `Bind element not found: ${E} (${a})`
3673
3798
  );
3674
3799
  }
3675
3800
  }
@@ -3687,45 +3812,47 @@ ${y}
3687
3812
  ) : e.hasAttribute(d) && (r.bindArg = e.getRawAttribute(d));
3688
3813
  const h = t ? f.attrName(t, "bind-params") : f.attrName(null, "bind-params", !0);
3689
3814
  if (e.hasAttribute(h)) {
3690
- const b = e.getRawAttribute(h);
3691
- r.bindParams = b.split("&").map((y) => y.trim());
3815
+ const E = e.getRawAttribute(h);
3816
+ r.bindParams = E.split("&").map((b) => b.trim());
3692
3817
  }
3693
3818
  const p = t ? f.attrName(t, "bind-append") : f.attrName(null, "bind-append", !0);
3694
3819
  if (e.hasAttribute(p)) {
3695
- const b = e.getRawAttribute(p);
3696
- r.bindAppendParams = b.split("&").map((y) => y.trim()).filter(Boolean);
3820
+ const E = e.getRawAttribute(p);
3821
+ r.bindAppendParams = E.split("&").map((b) => b.trim()).filter(Boolean);
3697
3822
  }
3698
- const v = t ? f.attrName(t, "bind-merge") : f.attrName(null, "bind-merge", !0);
3699
- e.hasAttribute(v) && (r.bindMerge = !0);
3700
- const T = t ? f.attrName(t, "copy-params") : null;
3701
- if (T && e.hasAttribute(T)) {
3702
- const b = e.getRawAttribute(T);
3703
- r.copyParams = b.split("&").map((y) => y.trim()).filter(Boolean);
3823
+ const y = t ? f.attrName(t, "bind-merge") : f.attrName(null, "bind-merge", !0);
3824
+ e.hasAttribute(y) && (r.bindMerge = !0);
3825
+ const T = t ? f.attrName(t, "bind-transform") : f.attrName(null, "bind-transform", !0);
3826
+ e.hasAttribute(T) && (r.bindTransform = e.getRawAttribute(T));
3827
+ const I = t ? f.attrName(t, "copy-params") : null;
3828
+ if (I && e.hasAttribute(I)) {
3829
+ const E = e.getRawAttribute(I);
3830
+ r.copyParams = E.split("&").map((b) => b.trim()).filter(Boolean);
3704
3831
  }
3705
3832
  if (t) {
3706
3833
  if (e.hasAttribute(f.attrName(t, "adjust"))) {
3707
- const m = e.getRawAttribute(
3834
+ const v = e.getRawAttribute(
3708
3835
  f.attrName(t, "adjust")
3709
3836
  );
3710
- if (m) {
3711
- const A = document.body.querySelectorAll(m);
3712
- A.length > 0 ? (r.adjustFragments = [], A.forEach((F) => {
3713
- const M = w.get(F);
3714
- M && r.adjustFragments.push(M);
3837
+ if (v) {
3838
+ const S = document.body.querySelectorAll(v);
3839
+ S.length > 0 ? (r.adjustFragments = [], S.forEach((N) => {
3840
+ const x = w.get(N);
3841
+ x && r.adjustFragments.push(x);
3715
3842
  })) : g.error(
3716
3843
  "Haori",
3717
- `Adjust element not found: ${m} (${f.attrName(t, "adjust")})`
3844
+ `Adjust element not found: ${v} (${f.attrName(t, "adjust")})`
3718
3845
  );
3719
3846
  }
3720
3847
  if (e.hasAttribute(f.attrName(t, "adjust-value"))) {
3721
- const A = e.getRawAttribute(
3848
+ const S = e.getRawAttribute(
3722
3849
  f.attrName(t, "adjust-value")
3723
- ), F = Number(A);
3724
- isNaN(F) || (r.adjustValue = F);
3850
+ ), N = Number(S);
3851
+ isNaN(N) || (r.adjustValue = N);
3725
3852
  }
3726
3853
  }
3727
3854
  if (e.hasAttribute(f.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(f.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(f.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(f.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${l.prefix}${t}-after-run`)) {
3728
- const m = e.getRawAttribute(
3855
+ const v = e.getRawAttribute(
3729
3856
  `${l.prefix}${t}-after-run`
3730
3857
  );
3731
3858
  try {
@@ -3733,11 +3860,11 @@ ${y}
3733
3860
  "response",
3734
3861
  `
3735
3862
  "use strict";
3736
- ${m}
3863
+ ${v}
3737
3864
  `
3738
3865
  );
3739
- } catch (A) {
3740
- g.error("Haori", `Invalid after script: ${A}`);
3866
+ } catch (S) {
3867
+ g.error("Haori", `Invalid after script: ${S}`);
3741
3868
  }
3742
3869
  }
3743
3870
  if (e.hasAttribute(f.attrName(t, "dialog")) && (r.dialogMessage = e.getAttribute(f.attrName(t, "dialog")).replace(/\\n/g, `
@@ -3745,10 +3872,10 @@ ${m}
3745
3872
  r.toastMessage = e.getAttribute(
3746
3873
  f.attrName(t, "toast")
3747
3874
  );
3748
- const m = e.getRawAttribute(
3875
+ const v = e.getRawAttribute(
3749
3876
  f.attrName(t, "toast-level")
3750
- ), F = ["info", "warning", "error", "success"].includes(m);
3751
- r.toastLevel = F ? m : null;
3877
+ ), N = ["info", "warning", "error", "success"].includes(v);
3878
+ r.toastLevel = N ? v : null;
3752
3879
  }
3753
3880
  if (e.hasAttribute(f.attrName(t, "redirect")) && (r.redirectUrl = e.getAttribute(
3754
3881
  f.attrName(t, "redirect")
@@ -3757,19 +3884,19 @@ ${m}
3757
3884
  )), e.hasAttribute(f.attrName(t, "history")) && (r.historyUrl = e.getAttribute(
3758
3885
  f.attrName(t, "history")
3759
3886
  )), e.hasAttribute(f.attrName(t, "history-data")) && (r.historyDataAttrName = f.attrName(t, "history-data")), e.hasAttribute(f.attrName(t, "history-form"))) {
3760
- const m = e.getRawAttribute(
3887
+ const v = e.getRawAttribute(
3761
3888
  f.attrName(t, "history-form")
3762
3889
  );
3763
- if (m) {
3764
- const A = document.body.querySelector(m);
3765
- A !== null ? r.historyFormFragment = S.getFormFragment(
3766
- w.get(A)
3890
+ if (v) {
3891
+ const S = document.body.querySelector(v);
3892
+ S !== null ? r.historyFormFragment = A.getFormFragment(
3893
+ w.get(S)
3767
3894
  ) : g.error(
3768
3895
  "Haori",
3769
- `Form element not found: ${m} (${f.attrName(t, "history-form")})`
3896
+ `Form element not found: ${v} (${f.attrName(t, "history-form")})`
3770
3897
  );
3771
3898
  } else
3772
- r.historyFormFragment = S.getFormFragment(e);
3899
+ r.historyFormFragment = A.getFormFragment(e);
3773
3900
  }
3774
3901
  [
3775
3902
  "reset-before",
@@ -3779,75 +3906,75 @@ ${m}
3779
3906
  "copy",
3780
3907
  "open",
3781
3908
  "close"
3782
- ].forEach((m) => {
3783
- const A = f.attrName(t, m);
3784
- if (!e.hasAttribute(A))
3909
+ ].forEach((v) => {
3910
+ const S = f.attrName(t, v);
3911
+ if (!e.hasAttribute(S))
3785
3912
  return;
3786
- const F = e.getRawAttribute(A), M = [];
3787
- if (F ? (document.body.querySelectorAll(F).forEach(($) => {
3788
- const z = w.get($);
3789
- z && M.push(z);
3790
- }), M.length === 0 && g.error("Haori", `Element not found: ${F} (${A})`)) : M.push(e), M.length > 0)
3791
- switch (m) {
3913
+ const N = e.getRawAttribute(S), x = [];
3914
+ if (N ? (document.body.querySelectorAll(N).forEach((Y) => {
3915
+ const O = w.get(Y);
3916
+ O && x.push(O);
3917
+ }), x.length === 0 && g.error("Haori", `Element not found: ${N} (${S})`)) : x.push(e), x.length > 0)
3918
+ switch (v) {
3792
3919
  case "reset-before":
3793
- r.resetBeforeFragments = M;
3920
+ r.resetBeforeFragments = x;
3794
3921
  break;
3795
3922
  case "reset":
3796
- r.resetFragments = M;
3923
+ r.resetFragments = x;
3797
3924
  break;
3798
3925
  case "refetch":
3799
- r.refetchFragments = M;
3926
+ r.refetchFragments = x;
3800
3927
  break;
3801
3928
  case "click":
3802
- r.clickFragments = M;
3929
+ r.clickFragments = x;
3803
3930
  break;
3804
3931
  case "copy":
3805
- r.copyFragments = M;
3932
+ r.copyFragments = x;
3806
3933
  break;
3807
3934
  case "open":
3808
- r.openFragments = M;
3935
+ r.openFragments = x;
3809
3936
  break;
3810
3937
  case "close":
3811
- r.closeFragments = M;
3938
+ r.closeFragments = x;
3812
3939
  break;
3813
3940
  }
3814
3941
  });
3815
- const y = f.attrName(t, "copy-source");
3816
- if (e.hasAttribute(y)) {
3817
- const m = e.getRawAttribute(
3818
- y
3942
+ const b = f.attrName(t, "copy-source");
3943
+ if (e.hasAttribute(b)) {
3944
+ const v = e.getRawAttribute(
3945
+ b
3819
3946
  );
3820
- if (m) {
3821
- const A = document.body.querySelector(m);
3822
- if (A !== null) {
3823
- const F = w.get(A);
3824
- F ? r.copySourceFragment = F : g.error(
3947
+ if (v) {
3948
+ const S = document.body.querySelector(v);
3949
+ if (S !== null) {
3950
+ const N = w.get(S);
3951
+ N ? r.copySourceFragment = N : g.error(
3825
3952
  "Haori",
3826
- `Element is not managed by Haori: ${m} (${y})`
3953
+ `Element is not managed by Haori: ${v} (${b})`
3827
3954
  );
3828
3955
  } else
3829
3956
  g.error(
3830
3957
  "Haori",
3831
- `Element not found: ${m} (${y})`
3958
+ `Element not found: ${v} (${b})`
3832
3959
  );
3833
3960
  } else
3834
3961
  r.copySourceFragment = e;
3835
3962
  }
3836
3963
  }
3837
3964
  if (!t && (e.hasAttribute(f.attrName(null, "data", !0)) && (r.dataAttrName = f.attrName(null, "data", !0)), e.hasAttribute(f.attrName(null, "form", !0)))) {
3838
- const b = e.getRawAttribute(
3965
+ const E = e.getRawAttribute(
3839
3966
  f.attrName(null, "form", !0)
3840
3967
  );
3841
- if (b) {
3842
- const y = document.body.querySelector(b);
3843
- y !== null ? r.formFragment = S.getFormFragment(
3844
- w.get(y)
3968
+ if (E) {
3969
+ const b = document.body.querySelector(E);
3970
+ b !== null ? r.formFragment = A.getFormFragment(
3971
+ w.get(b)
3845
3972
  ) : g.error(
3846
3973
  "Haori",
3847
- `Form element not found: ${b} (${f.attrName(null, "fetch-form", !0)})`
3974
+ `Form element not found: ${E} (${f.attrName(null, "fetch-form", !0)})`
3848
3975
  );
3849
3976
  } else
3850
- r.formFragment = S.getFormFragment(e);
3977
+ r.formFragment = A.getFormFragment(e);
3851
3978
  }
3852
3979
  return s && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [e]), r;
3853
3980
  }
@@ -3926,7 +4053,7 @@ ${m}
3926
4053
  return !1;
3927
4054
  this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
3928
4055
  this.options.resetBeforeFragments.map(
3929
- (d) => S.reset(d)
4056
+ (d) => A.reset(d)
3930
4057
  )
3931
4058
  ), this.captureHistorySnapshots());
3932
4059
  const r = this.prepareFetchRequest(), i = r.payload;
@@ -3944,8 +4071,8 @@ ${m}
3944
4071
  }
3945
4072
  const a = Object.keys(i).length > 0;
3946
4073
  if (s) {
3947
- const d = { ...n || {} }, h = r.requestedMethod, p = r.effectiveMethod, v = r.transportMode === "query-get", T = r.queryString;
3948
- if (v && g.info("Haori demo fetch normalization", {
4074
+ const d = { ...n || {} }, h = r.requestedMethod, p = r.effectiveMethod, y = r.transportMode === "query-get", T = r.queryString;
4075
+ if (y && g.info("Haori demo fetch normalization", {
3949
4076
  runtime: l.runtime,
3950
4077
  requestedMethod: h,
3951
4078
  effectiveMethod: p,
@@ -3954,38 +4081,38 @@ ${m}
3954
4081
  payload: a ? i : void 0,
3955
4082
  queryString: T
3956
4083
  }), this.options.targetFragment && s) {
3957
- const b = performance.now(), y = {
4084
+ const I = performance.now(), E = {
3958
4085
  runtime: l.runtime,
3959
4086
  requestedMethod: h,
3960
4087
  effectiveMethod: p,
3961
- transportMode: v ? "query-get" : "http",
3962
- ...v ? { queryString: T } : {}
4088
+ transportMode: y ? "query-get" : "http",
4089
+ ...y ? { queryString: T } : {}
3963
4090
  };
3964
4091
  return R.fetchStart(
3965
4092
  this.options.targetFragment.getTarget(),
3966
4093
  s,
3967
4094
  d,
3968
4095
  a ? i : void 0,
3969
- y
3970
- ), fetch(s, d).then((m) => this.handleFetchResult(
3971
- m,
4096
+ E
4097
+ ), fetch(s, d).then((b) => this.handleFetchResult(
4098
+ b,
3972
4099
  s || void 0,
3973
- b
3974
- )).catch((m) => {
4100
+ I
4101
+ )).catch((b) => {
3975
4102
  throw s && R.fetchError(
3976
4103
  this.options.targetFragment.getTarget(),
3977
4104
  s,
3978
- m
3979
- ), m;
4105
+ b
4106
+ ), b;
3980
4107
  });
3981
4108
  }
3982
- return fetch(s, d).then((b) => this.handleFetchResult(b, s || void 0));
4109
+ return fetch(s, d).then((I) => this.handleFetchResult(I, s || void 0));
3983
4110
  }
3984
4111
  if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && a) {
3985
4112
  const d = this.options.formFragment, h = d.getTarget(), p = /* @__PURE__ */ new Set();
3986
4113
  e && e.appliedDisabledAttribute && this.options.targetFragment && p.add(this.options.targetFragment), h.setAttribute(`${l.prefix}bind`, JSON.stringify(i));
3987
- const v = d.getBindingData();
3988
- Object.assign(v, i), await P.setBindingData(h, v, p);
4114
+ const y = d.getBindingData();
4115
+ Object.assign(y, i), await P.setBindingData(h, y, p);
3989
4116
  }
3990
4117
  const o = a ? i : {}, c = new Response(JSON.stringify(o), {
3991
4118
  headers: { "Content-Type": "application/json" }
@@ -4004,12 +4131,12 @@ ${m}
4004
4131
  if (this.eventType !== "click" || !this.options.targetFragment)
4005
4132
  return null;
4006
4133
  const t = this.options.targetFragment.getTarget();
4007
- if (f.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(ie))
4134
+ if (f.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(ne))
4008
4135
  return !1;
4009
4136
  const r = t.hasAttribute(
4010
4137
  `${l.prefix}click-no-disabled`
4011
4138
  );
4012
- return f.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(ie, ""), r || t.setAttribute("disabled", ""), {
4139
+ return f.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(ne, ""), r || t.setAttribute("disabled", ""), {
4013
4140
  target: t,
4014
4141
  appliedDisabledAttribute: !r
4015
4142
  };
@@ -4021,13 +4148,13 @@ ${m}
4021
4148
  * @returns 戻り値はありません。
4022
4149
  */
4023
4150
  releaseExecutionLock(e) {
4024
- e && (f.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(ie), e.appliedDisabledAttribute && e.target.removeAttribute("disabled"));
4151
+ e && (f.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(ne), e.appliedDisabledAttribute && e.target.removeAttribute("disabled"));
4025
4152
  }
4026
4153
  /**
4027
4154
  * フェッチ後の処理を実行します。
4028
4155
  */
4029
4156
  async handleFetchResult(e, t, r) {
4030
- const i = se();
4157
+ const i = ae();
4031
4158
  if (!e.ok)
4032
4159
  return this.options.targetFragment && t && R.fetchError(
4033
4160
  this.options.targetFragment.getTarget(),
@@ -4051,7 +4178,7 @@ ${m}
4051
4178
  }
4052
4179
  const s = [];
4053
4180
  s.push(this.bindResult(e)), s.push(this.adjust()), s.push(this.addRow()), s.push(this.removeRow()), s.push(this.movePrevRow()), s.push(this.moveNextRow()), await Promise.all(s), this.options.resetFragments && this.options.resetFragments.length > 0 && await Promise.all(
4054
- this.options.resetFragments.map((a) => S.reset(a))
4181
+ this.options.resetFragments.map((a) => A.reset(a))
4055
4182
  ), await this.copy();
4056
4183
  const n = [];
4057
4184
  if (this.options.refetchFragments && this.options.refetchFragments.length > 0 && this.options.refetchFragments.forEach((a) => {
@@ -4097,7 +4224,7 @@ ${m}
4097
4224
  h != null && (Array.isArray(h) ? h.forEach((p) => a.searchParams.append(d, String(p))) : typeof h == "object" ? a.searchParams.set(d, JSON.stringify(h)) : a.searchParams.set(d, String(h)));
4098
4225
  };
4099
4226
  i && o(t), s && o(r), history.pushState(
4100
- { [we]: !0 },
4227
+ { [Ie]: !0 },
4101
4228
  "",
4102
4229
  a.toString()
4103
4230
  );
@@ -4110,10 +4237,10 @@ ${m}
4110
4237
  */
4111
4238
  async handleFetchError(e) {
4112
4239
  let t = null;
4113
- this.options.formFragment ? t = this.options.formFragment : this.options.targetFragment && (t = S.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
4240
+ this.options.formFragment ? t = this.options.formFragment : this.options.targetFragment && (t = A.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
4114
4241
  const r = async (n) => {
4115
4242
  const a = t ? t.getTarget() : document.body;
4116
- await se().addErrorMessage(a, n);
4243
+ await ae().addErrorMessage(a, n);
4117
4244
  }, i = () => {
4118
4245
  if (!this.options.scrollOnError)
4119
4246
  return;
@@ -4139,7 +4266,7 @@ ${m}
4139
4266
  if (a.length === 0)
4140
4267
  return await r(`${e.status} ${e.statusText}`), i(), !1;
4141
4268
  for (const o of a)
4142
- o.key && t ? await S.addErrorMessage(t, o.key, o.message) : await r(o.message);
4269
+ o.key && t ? await A.addErrorMessage(t, o.key, o.message) : await r(o.message);
4143
4270
  return i(), !1;
4144
4271
  } catch {
4145
4272
  }
@@ -4198,7 +4325,7 @@ ${m}
4198
4325
  */
4199
4326
  confirm() {
4200
4327
  const e = this.options.confirmMessage;
4201
- return e == null ? Promise.resolve(!0) : se().confirm(e);
4328
+ return e == null ? Promise.resolve(!0) : ae().confirm(e);
4202
4329
  }
4203
4330
  /**
4204
4331
  * 結果データを対象のフラグメントにバインドします。
@@ -4207,6 +4334,14 @@ ${m}
4207
4334
  */
4208
4335
  bindResult(e) {
4209
4336
  return !this.options.bindFragments || this.options.bindFragments.length === 0 ? Promise.resolve() : (e.headers.get("Content-Type")?.includes("application/json") ? e.json() : e.text()).then((r) => {
4337
+ if (this.options.bindTransform)
4338
+ try {
4339
+ r = W.evaluate(this.options.bindTransform, {
4340
+ response: r
4341
+ });
4342
+ } catch (s) {
4343
+ g.error("Haori", `Invalid bind-transform: ${s}`);
4344
+ }
4210
4345
  if (this.options.bindParams) {
4211
4346
  const s = {};
4212
4347
  this.options.bindParams.forEach((n) => {
@@ -4282,7 +4417,7 @@ ${m}
4282
4417
  * copy のコピー元データを取得します。
4283
4418
  */
4284
4419
  resolveCopySourceData() {
4285
- return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? S.getValues(this.options.copySourceFragment) : { ...this.options.copySourceFragment.getBindingData() } : this.options.formFragment ? S.getValues(this.options.formFragment) : this.options.targetFragment ? { ...this.options.targetFragment.getBindingData() } : {};
4420
+ return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? A.getValues(this.options.copySourceFragment) : { ...this.options.copySourceFragment.getBindingData() } : this.options.formFragment ? A.getValues(this.options.formFragment) : this.options.targetFragment ? { ...this.options.targetFragment.getBindingData() } : {};
4286
4421
  }
4287
4422
  /**
4288
4423
  * data 属性とフォーム値を統合した送信データを作成します。
@@ -4300,7 +4435,7 @@ ${m}
4300
4435
  buildPayloadResolution() {
4301
4436
  const e = {};
4302
4437
  let t = !1;
4303
- if (this.options.formFragment && Object.assign(e, S.getValues(this.options.formFragment)), this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
4438
+ if (this.options.formFragment && Object.assign(e, A.getValues(this.options.formFragment)), this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
4304
4439
  const r = f.resolveDataAttributeDetailed(
4305
4440
  this.options.targetFragment,
4306
4441
  this.options.dataAttrName
@@ -4342,21 +4477,21 @@ ${m}
4342
4477
  let i = this.options.fetchUrl;
4343
4478
  const s = { ...this.options.fetchOptions || {} }, n = new Headers(
4344
4479
  s.headers || void 0
4345
- ), a = (s.method || "GET").toUpperCase(), o = l.runtime === "demo" && !Re(a), c = o ? "GET" : a;
4480
+ ), a = (s.method || "GET").toUpperCase(), o = l.runtime === "demo" && !ke(a), c = o ? "GET" : a;
4346
4481
  if (s.method = c, c === "GET" || c === "HEAD" || c === "OPTIONS")
4347
- Object.keys(t).length > 0 && (i = Ne(i, t));
4482
+ Object.keys(t).length > 0 && (i = $e(i, t));
4348
4483
  else if (Object.keys(t).length > 0) {
4349
4484
  const h = n.get("Content-Type") || "";
4350
4485
  if (/multipart\/form-data/i.test(h)) {
4351
4486
  n.delete("Content-Type");
4352
4487
  const p = new FormData();
4353
- for (const [v, T] of Object.entries(t))
4354
- T == null ? p.append(v, "") : T instanceof Blob ? p.append(v, T) : Array.isArray(T) ? T.forEach((b) => p.append(v, String(b))) : typeof T == "object" ? p.append(v, JSON.stringify(T)) : p.append(v, String(T));
4488
+ for (const [y, T] of Object.entries(t))
4489
+ T == null ? p.append(y, "") : T instanceof Blob ? p.append(y, T) : Array.isArray(T) ? T.forEach((I) => p.append(y, String(I))) : typeof T == "object" ? p.append(y, JSON.stringify(T)) : p.append(y, String(T));
4355
4490
  s.body = p;
4356
4491
  } else if (/application\/x-www-form-urlencoded/i.test(h)) {
4357
4492
  const p = new URLSearchParams();
4358
- for (const [v, T] of Object.entries(t))
4359
- T !== void 0 && (T === null ? p.append(v, "") : Array.isArray(T) ? T.forEach((b) => p.append(v, String(b))) : typeof T == "object" ? p.append(v, JSON.stringify(T)) : p.append(v, String(T)));
4493
+ for (const [y, T] of Object.entries(t))
4494
+ T !== void 0 && (T === null ? p.append(y, "") : Array.isArray(T) ? T.forEach((I) => p.append(y, String(I))) : typeof T == "object" ? p.append(y, JSON.stringify(T)) : p.append(y, String(T)));
4360
4495
  s.body = p;
4361
4496
  } else
4362
4497
  n.set("Content-Type", "application/json"), s.body = JSON.stringify(t);
@@ -4372,7 +4507,7 @@ ${m}
4372
4507
  effectiveMethod: c,
4373
4508
  queryString: d,
4374
4509
  transportMode: o ? "query-get" : "http",
4375
- signature: xe(i, s)
4510
+ signature: He(i, s)
4376
4511
  };
4377
4512
  }
4378
4513
  /**
@@ -4382,7 +4517,7 @@ ${m}
4382
4517
  this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = f.resolveDataAttribute(
4383
4518
  this.options.targetFragment,
4384
4519
  this.options.historyDataAttrName
4385
- ) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? S.getValues(this.options.historyFormFragment) : void 0;
4520
+ ) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? A.getValues(this.options.historyFormFragment) : void 0;
4386
4521
  }
4387
4522
  /**
4388
4523
  * history-data の評価値を取得します。
@@ -4404,7 +4539,7 @@ ${m}
4404
4539
  if (this.historyFormSnapshot !== void 0)
4405
4540
  return this.historyFormSnapshot;
4406
4541
  if (this.options.historyFormFragment)
4407
- return S.getValues(this.options.historyFormFragment);
4542
+ return A.getValues(this.options.historyFormFragment);
4408
4543
  }
4409
4544
  /**
4410
4545
  * copy-params が指定されている場合は include / exclude を考慮して抽出します。
@@ -4472,7 +4607,7 @@ ${m}
4472
4607
  const t = [], r = e.clone();
4473
4608
  return t.push(
4474
4609
  e.getParent().insertAfter(r, e)
4475
- ), t.push(P.evaluateAll(r)), t.push(S.reset(r)), Promise.all(t).then(() => {
4610
+ ), t.push(P.evaluateAll(r)), t.push(A.reset(r)), Promise.all(t).then(() => {
4476
4611
  });
4477
4612
  }
4478
4613
  /**
@@ -4525,8 +4660,8 @@ ${m}
4525
4660
  }
4526
4661
  };
4527
4662
  f.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, f.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, f.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet();
4528
- let q = f;
4529
- class Pe {
4663
+ let z = f;
4664
+ class Le {
4530
4665
  /**
4531
4666
  * URLのクエリパラメータを取得します。
4532
4667
  *
@@ -4539,7 +4674,7 @@ class Pe {
4539
4674
  }), e;
4540
4675
  }
4541
4676
  }
4542
- class Ie {
4677
+ class Ue {
4543
4678
  /**
4544
4679
  * 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
4545
4680
  *
@@ -4629,7 +4764,7 @@ const u = class u {
4629
4764
  */
4630
4765
  static isAliasedAttributeReflection(e, t) {
4631
4766
  const r = w.get(e);
4632
- return r instanceof C ? r.hasAttribute(
4767
+ return r instanceof k ? r.hasAttribute(
4633
4768
  `${l.prefix}${u.ATTRIBUTE_ALIAS_SUFFIX}${t}`
4634
4769
  ) : !1;
4635
4770
  }
@@ -4660,7 +4795,7 @@ const u = class u {
4660
4795
  static reevaluateChildren(e) {
4661
4796
  const t = [];
4662
4797
  return e.getChildren().forEach((r) => {
4663
- r instanceof C ? t.push(u.evaluateAll(r)) : r instanceof L && t.push(u.evaluateText(r));
4798
+ r instanceof k ? t.push(u.evaluateAll(r)) : r instanceof L && t.push(u.evaluateText(r));
4664
4799
  }), Promise.all(t).then(() => {
4665
4800
  });
4666
4801
  }
@@ -4710,7 +4845,7 @@ const u = class u {
4710
4845
  return Promise.resolve();
4711
4846
  const r = [];
4712
4847
  return e.hasAttribute(`${l.prefix}fetch`) && r.push(u.executeManagedFetch(e)), e.hasAttribute(`${l.prefix}import`) && r.push(u.executeManagedImport(e)), e.getChildren().forEach((i) => {
4713
- i instanceof C && r.push(
4848
+ i instanceof k && r.push(
4714
4849
  u.reevaluateReactiveSpecialAttributes(i, t)
4715
4850
  );
4716
4851
  }), Promise.all(r).then(() => {
@@ -4723,8 +4858,8 @@ const u = class u {
4723
4858
  * @returns 実行完了の Promise
4724
4859
  */
4725
4860
  static executeManagedFetch(e) {
4726
- const t = e.getTarget(), r = u.getReactiveFetchState(t), i = q.resolveAutoFetchSignature(e);
4727
- return r.running ? ((i.hasUnresolvedReference || i.signature !== r.lastSignature) && (r.rerunRequested = !0), Promise.resolve()) : i.hasUnresolvedReference || i.signature === null ? (r.lastSignature = null, Promise.resolve()) : r.lastSignature === i.signature ? Promise.resolve() : (r.lastSignature = i.signature, r.running = !0, new q(e, null).runWithResult().then(() => {
4861
+ const t = e.getTarget(), r = u.getReactiveFetchState(t), i = z.resolveAutoFetchSignature(e);
4862
+ return r.running ? ((i.hasUnresolvedReference || i.signature !== r.lastSignature) && (r.rerunRequested = !0), Promise.resolve()) : i.hasUnresolvedReference || i.signature === null ? (r.lastSignature = null, Promise.resolve()) : r.lastSignature === i.signature ? Promise.resolve() : (r.lastSignature = i.signature, r.running = !0, new z(e, null).runWithResult().then(() => {
4728
4863
  }).finally(() => {
4729
4864
  if (r.running = !1, r.rerunRequested)
4730
4865
  return r.rerunRequested = !1, u.executeManagedFetch(e);
@@ -4748,16 +4883,16 @@ const u = class u {
4748
4883
  return Promise.resolve();
4749
4884
  r.lastUrl = s, r.running = !0;
4750
4885
  const n = performance.now();
4751
- return t.setAttribute(`${l.prefix}importing`, ""), R.importStart(t, s), Ie.load(s).then((a) => {
4886
+ return t.setAttribute(`${l.prefix}importing`, ""), R.importStart(t, s), Ue.load(s).then((a) => {
4752
4887
  const o = new TextEncoder().encode(a).length;
4753
- return x.enqueue(() => {
4888
+ return M.enqueue(() => {
4754
4889
  t.innerHTML = a;
4755
4890
  }).then(() => {
4756
4891
  if (t.removeAttribute(`${l.prefix}importing`), R.importEnd(t, s, o, n), !document.body.hasAttribute("data-haori-ready")) {
4757
4892
  const c = [];
4758
4893
  return t.childNodes.forEach((d) => {
4759
4894
  const h = w.get(d);
4760
- h instanceof C ? c.push(u.scan(h.getTarget())) : h instanceof L && c.push(u.evaluateText(h));
4895
+ h instanceof k ? c.push(u.scan(h.getTarget())) : h instanceof L && c.push(u.evaluateText(h));
4761
4896
  }), Promise.all(c).then(() => {
4762
4897
  });
4763
4898
  }
@@ -4806,7 +4941,7 @@ const u = class u {
4806
4941
  }
4807
4942
  const r = [];
4808
4943
  return e.getChildren().forEach((i) => {
4809
- i instanceof C ? r.push(u.initializeElementFragment(i, t)) : i instanceof L && r.push(u.evaluateText(i));
4944
+ i instanceof k ? r.push(u.initializeElementFragment(i, t)) : i instanceof L && r.push(u.evaluateText(i));
4810
4945
  }), Promise.all(r).then(() => {
4811
4946
  u.refreshDerivedSubtreeSignature(e);
4812
4947
  });
@@ -4942,7 +5077,7 @@ const u = class u {
4942
5077
  typeof r == "string" && a.push(u.executeManagedImport(s));
4943
5078
  break;
4944
5079
  case `${l.prefix}url-param`: {
4945
- const d = s.getAttribute(`${l.prefix}url-arg`), h = Pe.readParams();
5080
+ const d = s.getAttribute(`${l.prefix}url-arg`), h = Le.readParams();
4946
5081
  if (d === null)
4947
5082
  a.push(u.setBindingData(e, h));
4948
5083
  else {
@@ -4978,7 +5113,7 @@ const u = class u {
4978
5113
  );
4979
5114
  if (e.tagName === "FORM") {
4980
5115
  const a = i.getAttribute(`${l.prefix}form-arg`), o = a && t[String(a)] && typeof t[String(a)] == "object" && !Array.isArray(t[String(a)]) ? t[String(a)] : a ? {} : t;
4981
- n = n.then(() => S.syncValues(i, o));
5116
+ n = n.then(() => A.syncValues(i, o));
4982
5117
  }
4983
5118
  return n = n.then(() => u.evaluateAll(i, r)), n = n.then(
4984
5119
  () => u.reevaluateReactiveSpecialAttributes(i, r)
@@ -5009,9 +5144,9 @@ const u = class u {
5009
5144
  return d.id ? `#${d.id}` : d.tagName.toLowerCase();
5010
5145
  }, n = (c, d, h, p) => {
5011
5146
  if (c)
5012
- for (const v of Object.keys(c))
5013
- v in i || (i[v] = {
5014
- value: c[v],
5147
+ for (const y of Object.keys(c))
5148
+ y in i || (i[y] = {
5149
+ value: c[y],
5015
5150
  source: s(d),
5016
5151
  kind: h,
5017
5152
  depth: p
@@ -5053,7 +5188,7 @@ const u = class u {
5053
5188
  if (r.isSkipMutationNodes())
5054
5189
  return;
5055
5190
  const i = w.get(t.nextSibling), s = w.get(t);
5056
- s && (r.insertBefore(s, i), s instanceof C ? u.scan(s.getTarget()) : s instanceof L && u.evaluateText(s));
5191
+ s && (r.insertBefore(s, i), s instanceof k ? u.scan(s.getTarget()) : s instanceof L && u.evaluateText(s));
5057
5192
  }
5058
5193
  /**
5059
5194
  * ノードを親要素から削除します。
@@ -5095,7 +5230,7 @@ const u = class u {
5095
5230
  i.push(r.setValue(t));
5096
5231
  const s = u.getFormFragment(r);
5097
5232
  if (s) {
5098
- const n = S.getValues(s), a = s.getAttribute(`${l.prefix}form-arg`);
5233
+ const n = A.getValues(s), a = s.getAttribute(`${l.prefix}form-arg`);
5099
5234
  let o;
5100
5235
  a ? (o = s.getRawBindingData(), o || (o = {}), o[String(a)] = n) : o = n, i.push(u.setBindingData(s.getTarget(), o));
5101
5236
  }
@@ -5162,12 +5297,12 @@ const u = class u {
5162
5297
  if (c)
5163
5298
  return;
5164
5299
  const p = [];
5165
- return e.getChildren().forEach((v) => {
5166
- if (v instanceof C) {
5167
- if (u.canSkipUnchangedNestedEach(v))
5300
+ return e.getChildren().forEach((y) => {
5301
+ if (y instanceof k) {
5302
+ if (u.canSkipUnchangedNestedEach(y))
5168
5303
  return;
5169
- p.push(u.evaluateAll(v, t));
5170
- } else v instanceof L && p.push(u.evaluateText(v));
5304
+ p.push(u.evaluateAll(y, t));
5305
+ } else y instanceof L && p.push(u.evaluateText(y));
5171
5306
  }), Promise.all(p).then(() => {
5172
5307
  });
5173
5308
  }).then(() => {
@@ -5190,7 +5325,7 @@ const u = class u {
5190
5325
  const i = e.getRawDerivedBindingData(), s = typeof r == "string" ? r.trim() : "";
5191
5326
  if (!t || s === "")
5192
5327
  return i === null ? Promise.resolve(!1) : (e.setDerivedBindingData(null), Promise.resolve(!0));
5193
- const n = J.evaluateDetailed(
5328
+ const n = W.evaluateDetailed(
5194
5329
  t,
5195
5330
  e.getBindingData()
5196
5331
  );
@@ -5273,7 +5408,7 @@ const u = class u {
5273
5408
  else {
5274
5409
  const i = e.isVisible(), s = [];
5275
5410
  e.getChildren().forEach((n) => {
5276
- n instanceof C ? s.push(
5411
+ n instanceof k ? s.push(
5277
5412
  n.isMounted() ? u.evaluateAll(n) : u.scan(n.getTarget())
5278
5413
  ) : n instanceof L && s.push(u.evaluateText(n));
5279
5414
  }), t.push(
@@ -5297,7 +5432,7 @@ const u = class u {
5297
5432
  */
5298
5433
  static triggerLoadOnShow(e) {
5299
5434
  const t = `${l.prefix}load-`;
5300
- e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new q(e, "load").run().catch((i) => {
5435
+ e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new z(e, "load").run().catch((i) => {
5301
5436
  g.error("[Haori]", "data-load procedure error (on show):", i);
5302
5437
  });
5303
5438
  }
@@ -5371,7 +5506,7 @@ const u = class u {
5371
5506
  if (r === null) {
5372
5507
  let n = !1;
5373
5508
  if (e.getChildren().forEach((a) => {
5374
- if (!n && a instanceof C) {
5509
+ if (!n && a instanceof k) {
5375
5510
  if (a.hasAttribute(`${l.prefix}each-before`) || a.hasAttribute(`${l.prefix}each-after`))
5376
5511
  return;
5377
5512
  r = a.clone(), u.markFreshInitializationSkippable(r), e.setTemplate(r), n = !0, e.removeChild(a);
@@ -5385,10 +5520,10 @@ const u = class u {
5385
5520
  ).forEach((c) => {
5386
5521
  if (!n) {
5387
5522
  const h = w.get(c);
5388
- h instanceof C && (r = h.clone(), u.markFreshInitializationSkippable(r), e.setTemplate(r), n = !0);
5523
+ h instanceof k && (r = h.clone(), u.markFreshInitializationSkippable(r), e.setTemplate(r), n = !0);
5389
5524
  }
5390
5525
  const d = w.get(c);
5391
- d instanceof C && e.getChildren().includes(d) && (e.removeChild(d), d.setMounted(!1)), c.parentNode && c.parentNode.removeChild(c);
5526
+ d instanceof k && e.getChildren().includes(d) && (e.removeChild(d), d.setMounted(!1)), c.parentNode && c.parentNode.removeChild(c);
5392
5527
  });
5393
5528
  }
5394
5529
  return this.updateDiff(e, t).then(() => {
@@ -5448,7 +5583,7 @@ const u = class u {
5448
5583
  * @returns 含むなら true
5449
5584
  */
5450
5585
  static hasDisallowedDerivedSubtreeDescendant(e) {
5451
- return e.getChildren().some((t) => t instanceof C ? t.hasAttribute(`${l.prefix}derive`) || t.hasAttribute(`${l.prefix}derive-name`) || t.hasAttribute(`${l.prefix}fetch`) || t.hasAttribute(`${l.prefix}import`) ? !0 : u.hasDisallowedDerivedSubtreeDescendant(t) : !1);
5586
+ return e.getChildren().some((t) => t instanceof k ? t.hasAttribute(`${l.prefix}derive`) || t.hasAttribute(`${l.prefix}derive-name`) || t.hasAttribute(`${l.prefix}fetch`) || t.hasAttribute(`${l.prefix}import`) ? !0 : u.hasDisallowedDerivedSubtreeDescendant(t) : !1);
5452
5587
  }
5453
5588
  /**
5454
5589
  * data-derive host が子孫要素へ公開している binding の署名を返します。
@@ -5534,7 +5669,7 @@ const u = class u {
5534
5669
  typeof n == "string" && n.trim() !== "" && (s += `[${l.prefix}derive-name="${n.trim()}"]`);
5535
5670
  const a = r.getParent();
5536
5671
  if (a) {
5537
- const o = a.getChildren().filter((c) => c instanceof C).findIndex((c) => c === r);
5672
+ const o = a.getChildren().filter((c) => c instanceof k).findIndex((c) => c === r);
5538
5673
  s += `:nth-child(${o + 1})`;
5539
5674
  }
5540
5675
  t.unshift(s), r = a;
@@ -5607,7 +5742,7 @@ const u = class u {
5607
5742
  * @returns subtree 全体を省略可能なら true
5608
5743
  */
5609
5744
  static markFreshInitializationSkippable(e) {
5610
- const t = e.getAttributeNames().some((s) => u.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof C ? !u.markFreshInitializationSkippable(s) : s instanceof L ? s.hasDynamicContent() : !1), i = !t && !r;
5745
+ const t = e.getAttributeNames().some((s) => u.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof k ? !u.markFreshInitializationSkippable(s) : s instanceof L ? s.hasDynamicContent() : !1), i = !t && !r;
5611
5746
  return e.setFreshInitializationSkippable(i), i;
5612
5747
  }
5613
5748
  /**
@@ -5636,81 +5771,81 @@ const u = class u {
5636
5771
  let i = e.getAttribute(`${l.prefix}each-index`);
5637
5772
  i && (i = String(i));
5638
5773
  const s = e.getAttribute(`${l.prefix}each-key`), n = e.getAttribute(`${l.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
5639
- t.forEach((A, F) => {
5640
- const M = u.createListKey(
5641
- A,
5774
+ t.forEach((v, S) => {
5775
+ const N = u.createListKey(
5776
+ v,
5642
5777
  s ? String(s) : null,
5643
- F
5778
+ S
5644
5779
  );
5645
- o.push(M), a.set(M, { item: A, itemIndex: F });
5780
+ o.push(N), a.set(N, { item: v, itemIndex: S });
5646
5781
  });
5647
5782
  const c = new Set(o), d = [];
5648
- let h = e.getChildren().filter((A) => A instanceof C).filter(
5649
- (A) => !A.hasAttribute(`${l.prefix}each-before`) && !A.hasAttribute(`${l.prefix}each-after`)
5783
+ let h = e.getChildren().filter((v) => v instanceof k).filter(
5784
+ (v) => !v.hasAttribute(`${l.prefix}each-before`) && !v.hasAttribute(`${l.prefix}each-after`)
5650
5785
  );
5651
- const p = h.map((A) => A.getListKey());
5652
- h = h.filter((A) => c.has(String(A.getListKey())) ? !0 : (d.push(A.remove()), !1));
5653
- const v = h.map((A) => A.getListKey()), T = /* @__PURE__ */ new Map();
5654
- h.forEach((A) => {
5655
- const F = A.getListKey();
5656
- F !== null && !T.has(F) && T.set(F, A);
5786
+ const p = h.map((v) => v.getListKey());
5787
+ h = h.filter((v) => c.has(String(v.getListKey())) ? !0 : (d.push(v.remove()), !1));
5788
+ const y = h.map((v) => v.getListKey()), T = /* @__PURE__ */ new Map();
5789
+ h.forEach((v) => {
5790
+ const S = v.getListKey();
5791
+ S !== null && !T.has(S) && T.set(S, v);
5657
5792
  });
5658
- const b = e.getChildElementFragments().slice(), y = b.filter(
5659
- (A) => A.hasAttribute(`${l.prefix}each-before`)
5793
+ const I = e.getChildElementFragments().slice(), E = I.filter(
5794
+ (v) => v.hasAttribute(`${l.prefix}each-before`)
5660
5795
  ).length;
5661
- let m = Promise.resolve();
5662
- return o.forEach((A, F) => {
5663
- const { item: M, itemIndex: U } = a.get(A);
5664
- let $;
5665
- const z = T.get(A);
5666
- if (z)
5667
- $ = z, m = m.then(
5796
+ let b = Promise.resolve();
5797
+ return o.forEach((v, S) => {
5798
+ const { item: N, itemIndex: x } = a.get(v);
5799
+ let U;
5800
+ const Y = T.get(v);
5801
+ if (Y)
5802
+ U = Y, b = b.then(
5668
5803
  () => u.updateRowFragment(
5669
- $,
5670
- M,
5671
- i,
5672
5804
  U,
5805
+ N,
5806
+ i,
5807
+ x,
5673
5808
  n ? String(n) : null,
5674
- A
5675
- ).then((k) => {
5676
- if (k)
5677
- return u.evaluateAll($);
5809
+ v
5810
+ ).then((O) => {
5811
+ if (O)
5812
+ return u.evaluateAll(U);
5678
5813
  })
5679
5814
  );
5680
5815
  else {
5681
- $ = r.clone();
5682
- const k = y + F;
5683
- m = m.then(
5816
+ U = r.clone();
5817
+ const O = E + S;
5818
+ b = b.then(
5684
5819
  () => u.updateRowFragment(
5685
- $,
5686
- M,
5687
- i,
5688
5820
  U,
5821
+ N,
5822
+ i,
5823
+ x,
5689
5824
  n ? String(n) : null,
5690
- A
5825
+ v
5691
5826
  ).then(() => {
5692
- const be = b[k] ?? null;
5693
- return e.insertBefore($, be).then(() => {
5694
- b.splice(k, 0, $);
5695
- }).then(() => u.initializeFreshEachRow($));
5827
+ const Se = I[O] ?? null;
5828
+ return e.insertBefore(U, Se).then(() => {
5829
+ I.splice(O, 0, U);
5830
+ }).then(() => u.initializeFreshEachRow(U));
5696
5831
  })
5697
5832
  );
5698
5833
  }
5699
- }), Promise.all(d).then(() => m).then(() => {
5700
- const A = o.filter(
5701
- (k) => k !== null
5702
- ), F = v.filter(
5703
- (k) => k !== null
5704
- ), M = new Set(F), U = A.filter((k) => !M.has(k)), z = p.filter(
5705
- (k) => k !== null
5834
+ }), Promise.all(d).then(() => b).then(() => {
5835
+ const v = o.filter(
5836
+ (O) => O !== null
5837
+ ), S = y.filter(
5838
+ (O) => O !== null
5839
+ ), N = new Set(S), x = v.filter((O) => !N.has(O)), Y = p.filter(
5840
+ (O) => O !== null
5706
5841
  ).filter(
5707
- (k) => !c.has(k)
5842
+ (O) => !c.has(O)
5708
5843
  );
5709
5844
  R.eachUpdate(
5710
5845
  e.getTarget(),
5711
- U,
5712
- z,
5713
- A
5846
+ x,
5847
+ Y,
5848
+ v
5714
5849
  );
5715
5850
  });
5716
5851
  }
@@ -5868,7 +6003,7 @@ u.ATTRIBUTE_ALIAS_SUFFIX = "attr-", u.PRIORITY_ATTRIBUTE_SUFFIXES = [
5868
6003
  "url-param"
5869
6004
  ], u.ATTRIBUTE_PLACEHOLDER_REGEX = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/, u.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), u.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), u.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), u.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap();
5870
6005
  let P = u;
5871
- const re = class re {
6006
+ const ie = class ie {
5872
6007
  /**
5873
6008
  * コンストラクタ。
5874
6009
  *
@@ -5877,10 +6012,10 @@ const re = class re {
5877
6012
  constructor(e = document) {
5878
6013
  this.onClick = (t) => this.delegate(t, "click"), this.onChange = (t) => this.delegate(t, "change"), this.onLoadCapture = (t) => this.delegate(t, "load"), this.onWindowLoad = () => {
5879
6014
  const t = document.documentElement, r = w.get(t);
5880
- r && new q(r, "load").run();
6015
+ r && new z(r, "load").run();
5881
6016
  }, this.onPopstate = (t) => {
5882
6017
  const r = t.state;
5883
- !r || r[re.HISTORY_STATE_KEY] !== !0 || location.reload();
6018
+ !r || r[ie.HISTORY_STATE_KEY] !== !0 || location.reload();
5884
6019
  }, this.root = e;
5885
6020
  }
5886
6021
  /**
@@ -5910,9 +6045,9 @@ const re = class re {
5910
6045
  const i = w.get(r);
5911
6046
  if (!i)
5912
6047
  return;
5913
- t === "change" && i instanceof C && i.syncValue();
6048
+ t === "change" && i instanceof k && i.syncValue();
5914
6049
  const s = () => {
5915
- new q(i, t, e).run().catch((n) => {
6050
+ new z(i, t, e).run().catch((n) => {
5916
6051
  g.error("[Haori]", "Procedure execution error:", n);
5917
6052
  });
5918
6053
  };
@@ -5943,22 +6078,30 @@ const re = class re {
5943
6078
  /**
5944
6079
  * data-click-* 属性を持つ最も近い祖先要素を返します。
5945
6080
  *
6081
+ * `data-click-passive` を持つ要素は「境界」として扱い、そこより外側(祖先方向)の
6082
+ * `data-click-*` へは遡上しません。フォーム入力欄などを囲むコンテナに
6083
+ * `data-click-passive` を付けると、その内側で発生したクリックが外側のクリック
6084
+ * アクションを誤って発火させるのを防げます(境界より内側に `data-click-*` を持つ
6085
+ * 要素があれば最近接優先でそちらが拾われるため、内側のボタン等は従来どおり動作)。
6086
+ *
5946
6087
  * @param element 探索開始要素
5947
6088
  * @returns 処理対象要素。見つからない場合は null
5948
6089
  */
5949
6090
  findClickableElement(e) {
5950
- let t = e;
5951
- for (; t; ) {
5952
- const r = `${l.prefix}click-`;
5953
- if (t.getAttributeNames().some((i) => i.startsWith(r)))
5954
- return t;
5955
- t = t.parentElement;
6091
+ const t = `${l.prefix}click-`, r = `${l.prefix}click-passive`;
6092
+ let i = e;
6093
+ for (; i; ) {
6094
+ if (i.getAttributeNames().some((n) => n.startsWith(t) && n !== r))
6095
+ return i;
6096
+ if (i.hasAttribute(r))
6097
+ return null;
6098
+ i = i.parentElement;
5956
6099
  }
5957
6100
  return null;
5958
6101
  }
5959
6102
  };
5960
- re.HISTORY_STATE_KEY = "__haoriHistoryState__";
5961
- let ae = re;
6103
+ ie.HISTORY_STATE_KEY = "__haoriHistoryState__";
6104
+ let le = ie;
5962
6105
  const D = class D {
5963
6106
  /**
5964
6107
  * ノードが現在の Window に属する HTMLElement かどうかを判定します。
@@ -5998,7 +6141,7 @@ const D = class D {
5998
6141
  (c) => {
5999
6142
  const d = D.registrations.get(e);
6000
6143
  d && c.forEach((h) => {
6001
- !h.isIntersecting || d.running || D.isDisabled(d.fragment) || (d.running = !0, new q(d.fragment, "intersect").runWithResult().then((p) => {
6144
+ !h.isIntersecting || d.running || D.isDisabled(d.fragment) || (d.running = !0, new z(d.fragment, "intersect").runWithResult().then((p) => {
6002
6145
  p && d.once && (d.observer.disconnect(), D.registrations.delete(e));
6003
6146
  }).catch((p) => {
6004
6147
  g.error(
@@ -6086,29 +6229,29 @@ D.CONFIG_KEYS = /* @__PURE__ */ new Set([
6086
6229
  "disabled",
6087
6230
  "once"
6088
6231
  ]), D.registrations = /* @__PURE__ */ new Map();
6089
- let Y = D;
6090
- const O = class O {
6232
+ let J = D;
6233
+ const $ = class $ {
6091
6234
  /**
6092
6235
  * 既存の MutationObserver をすべて停止します。
6093
6236
  */
6094
6237
  static disconnectMutationObservers() {
6095
- O._mutationObservers.forEach((e) => {
6238
+ $._mutationObservers.forEach((e) => {
6096
6239
  e.disconnect();
6097
- }), O._mutationObservers.length = 0;
6240
+ }), $._mutationObservers.length = 0;
6098
6241
  }
6099
6242
  /**
6100
6243
  * 初期化メソッド。
6101
6244
  * ドキュメントのheadとbodyを監視対象として設定します。
6102
6245
  */
6103
6246
  static async init() {
6104
- if (O._initialized)
6247
+ if ($._initialized)
6105
6248
  return;
6106
- O._initialized = !0, O.disconnectMutationObservers();
6249
+ $._initialized = !0, $.disconnectMutationObservers();
6107
6250
  const e = await Promise.allSettled([
6108
6251
  P.scan(document.head),
6109
6252
  P.scan(document.body)
6110
6253
  ]), [t, r] = e;
6111
- t.status !== "fulfilled" && g.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && g.error("[Haori]", "Failed to build body fragment:", r.reason), await x.wait(), document.body.setAttribute("data-haori-ready", ""), O.observe(document.head), O.observe(document.body), new ae().start(), Y.syncTree(document.body);
6254
+ t.status !== "fulfilled" && g.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && g.error("[Haori]", "Failed to build body fragment:", r.reason), await M.wait(), document.body.setAttribute("data-haori-ready", ""), $.observe(document.head), $.observe(document.body), new le().start(), J.syncTree(document.body);
6112
6255
  }
6113
6256
  /**
6114
6257
  * 指定された要素を監視します。
@@ -6132,14 +6275,14 @@ const O = class O {
6132
6275
  i.attributeName,
6133
6276
  s.getAttribute(i.attributeName),
6134
6277
  !0
6135
- ), Y.syncElement(s);
6278
+ ), J.syncElement(s);
6136
6279
  break;
6137
6280
  }
6138
6281
  case "childList": {
6139
6282
  Array.from(i.removedNodes).forEach((s) => {
6140
- Y.cleanupTree(s), P.removeNode(s);
6283
+ J.cleanupTree(s), P.removeNode(s);
6141
6284
  }), Array.from(i.addedNodes).forEach((s) => {
6142
- s.parentElement instanceof Element && (P.addNode(s.parentElement, s), Y.syncTree(s));
6285
+ s.parentElement instanceof Element && (P.addNode(s.parentElement, s), J.syncTree(s));
6143
6286
  });
6144
6287
  break;
6145
6288
  }
@@ -6164,23 +6307,23 @@ const O = class O {
6164
6307
  subtree: !0,
6165
6308
  attributes: !0,
6166
6309
  characterData: !0
6167
- }), O._mutationObservers.push(t);
6310
+ }), $._mutationObservers.push(t);
6168
6311
  }
6169
6312
  };
6170
- O._initialized = !1, O._mutationObservers = [];
6171
- let _ = O;
6172
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", _.init) : _.init();
6173
- const Ce = () => X.waitForRenders(), ke = "0.13.2";
6313
+ $._initialized = !1, $._mutationObservers = [];
6314
+ let ee = $;
6315
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", ee.init) : ee.init();
6316
+ const Ve = () => X.waitForRenders(), je = "0.15.0";
6174
6317
  export {
6175
6318
  P as Core,
6176
6319
  l as Env,
6177
- S as Form,
6320
+ A as Form,
6178
6321
  w as Fragment,
6179
6322
  X as Haori,
6180
6323
  g as Log,
6181
- x as Queue,
6324
+ M as Queue,
6182
6325
  X as default,
6183
- ke as version,
6184
- Ce as waitForRenders
6326
+ je as version,
6327
+ Ve as waitForRenders
6185
6328
  };
6186
6329
  //# sourceMappingURL=haori.es.js.map