haori 0.4.8 → 0.4.10

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
@@ -29,22 +29,22 @@ const C = class C {
29
29
  }
30
30
  };
31
31
  C.devMode = !1;
32
- let B = C;
32
+ let L = C;
33
33
  const z = "embedded";
34
- function rt(P) {
35
- return P === "embedded" || P === "demo";
34
+ function rt(R) {
35
+ return R === "embedded" || R === "demo";
36
36
  }
37
- function it(P) {
38
- return P === null ? null : rt(P) ? P : z;
37
+ function it(R) {
38
+ return R === null ? null : rt(R) ? R : z;
39
39
  }
40
- const D = class D {
40
+ const k = class k {
41
41
  /**
42
42
  * 実行モードを取得します。
43
43
  *
44
44
  * @returns 実行モード。
45
45
  */
46
46
  static get runtime() {
47
- return D._runtime;
47
+ return k._runtime;
48
48
  }
49
49
  /**
50
50
  * 実行モードを設定します。
@@ -53,7 +53,7 @@ const D = class D {
53
53
  * @return 戻り値はありません。
54
54
  */
55
55
  static setRuntime(t) {
56
- D._runtime = rt(t) ? t : z;
56
+ k._runtime = rt(t) ? t : z;
57
57
  }
58
58
  /**
59
59
  * 実行環境からプレフィックスと開発モードかどうかを自動検出します。
@@ -65,23 +65,23 @@ const D = class D {
65
65
  try {
66
66
  const t = document.currentScript || document.querySelector('script[src*="haori"]');
67
67
  if (t instanceof HTMLScriptElement) {
68
- const r = t.getAttribute("data-prefix") || D._prefix;
69
- D._prefix = r.endsWith("-") ? r : r + "-";
70
- const i = it(
68
+ const r = t.getAttribute("data-prefix") || k._prefix;
69
+ k._prefix = r.endsWith("-") ? r : r + "-";
70
+ const s = it(
71
71
  t.getAttribute("data-runtime")
72
72
  );
73
- i !== null && (D._runtime = i);
73
+ s !== null && (k._runtime = s);
74
74
  }
75
- if (t instanceof HTMLScriptElement && t.hasAttribute(`${D._prefix}dev`)) {
76
- B.set(!0);
75
+ if (t instanceof HTMLScriptElement && t.hasAttribute(`${k._prefix}dev`)) {
76
+ L.set(!0);
77
77
  return;
78
78
  }
79
79
  const e = window.location.hostname;
80
80
  if (e === "localhost" || e.endsWith(".localhost") || e === "127.0.0.1" || e === "::1" || e.endsWith(".local")) {
81
- B.set(!0);
81
+ L.set(!0);
82
82
  return;
83
83
  }
84
- B.set(!1);
84
+ L.set(!1);
85
85
  } catch {
86
86
  }
87
87
  }
@@ -91,13 +91,13 @@ const D = class D {
91
91
  * @returns プレフィックス
92
92
  */
93
93
  static get prefix() {
94
- return D._prefix;
94
+ return k._prefix;
95
95
  }
96
96
  };
97
- D._prefix = "data-", D._runtime = z;
98
- let l = D;
99
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", l.detect) : l.detect();
100
- class d {
97
+ k._prefix = "data-", k._runtime = z;
98
+ let u = k;
99
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", u.detect) : u.detect();
100
+ class f {
101
101
  /**
102
102
  * 開発モードでのみコンソールに情報を出力します。
103
103
  *
@@ -105,7 +105,7 @@ class d {
105
105
  * @param args 追加の引数
106
106
  */
107
107
  static info(t, ...e) {
108
- B.isEnabled() && console.log && console.log(t, ...e);
108
+ L.isEnabled() && console.log && console.log(t, ...e);
109
109
  }
110
110
  /**
111
111
  * 開発モードでのみコンソールに警告を出力します。
@@ -114,7 +114,7 @@ class d {
114
114
  * @param args 追加の引数
115
115
  */
116
116
  static warn(t, ...e) {
117
- B.isEnabled() && console.warn && console.warn(t, ...e);
117
+ L.isEnabled() && console.warn && console.warn(t, ...e);
118
118
  }
119
119
  /**
120
120
  * モードに関係なくコンソールにエラーを出力します。
@@ -138,17 +138,17 @@ class st {
138
138
  * @returns 処理完了Promise
139
139
  */
140
140
  enqueue(t, e = !1) {
141
- let r, i;
141
+ let r, s;
142
142
  const n = new Promise((a, o) => {
143
- r = a, i = o;
144
- }), s = {
143
+ r = a, s = o;
144
+ }), i = {
145
145
  task: t,
146
146
  timestamp: performance.now(),
147
147
  promise: n,
148
148
  resolve: r,
149
- reject: i
149
+ reject: s
150
150
  };
151
- return e ? this.queue.unshift(s) : this.queue.push(s), this.scheduleProcessing(), n;
151
+ return e ? this.queue.unshift(i) : this.queue.push(i), this.scheduleProcessing(), n;
152
152
  }
153
153
  /**
154
154
  * キューを処理します。
@@ -168,13 +168,13 @@ class st {
168
168
  const r = await e.task();
169
169
  e.resolve(r);
170
170
  } catch (r) {
171
- e.reject(r), d.error("[Haori]", `Task ${e.timestamp} failed:`, r);
171
+ e.reject(r), f.error("[Haori]", `Task ${e.timestamp} failed:`, r);
172
172
  }
173
173
  if (performance.now() - t > this.MAX_BUDGET)
174
174
  break;
175
175
  }
176
176
  } catch (t) {
177
- d.error("[Haori]", "Error processing queue:", t);
177
+ f.error("[Haori]", "Error processing queue:", t);
178
178
  } finally {
179
179
  this.processing = !1, this.queue.length > 0 && this.scheduleProcessing();
180
180
  }
@@ -229,7 +229,7 @@ class X {
229
229
  * @return 実行モード。
230
230
  */
231
231
  static get runtime() {
232
- return l.runtime;
232
+ return u.runtime;
233
233
  }
234
234
  /**
235
235
  * 実行モードを設定します。
@@ -238,7 +238,7 @@ class X {
238
238
  * @return 戻り値はありません。
239
239
  */
240
240
  static setRuntime(t) {
241
- l.setRuntime(t);
241
+ u.setRuntime(t);
242
242
  }
243
243
  /**
244
244
  * 通知ダイアログを表示します。
@@ -284,7 +284,7 @@ class X {
284
284
  */
285
285
  static openDialog(t) {
286
286
  return F.enqueue(() => {
287
- t instanceof HTMLDialogElement ? t.showModal() : d.error("[Haori]", "Element is not a dialog: ", t);
287
+ t instanceof HTMLDialogElement ? t.showModal() : f.error("[Haori]", "Element is not a dialog: ", t);
288
288
  }, !0);
289
289
  }
290
290
  /**
@@ -294,7 +294,7 @@ class X {
294
294
  */
295
295
  static closeDialog(t) {
296
296
  return F.enqueue(() => {
297
- t instanceof HTMLDialogElement ? t.close() : d.error("[Haori]", "Element is not a dialog: ", t);
297
+ t instanceof HTMLDialogElement ? t.close() : f.error("[Haori]", "Element is not a dialog: ", t);
298
298
  }, !0);
299
299
  }
300
300
  /**
@@ -315,8 +315,8 @@ class X {
315
315
  */
316
316
  static addMessage(t, e, r) {
317
317
  return F.enqueue(() => {
318
- const i = t instanceof HTMLFormElement ? t : t.parentElement ?? t;
319
- i.setAttribute("data-message", e), r !== void 0 ? i.setAttribute("data-message-level", r) : i.removeAttribute("data-message-level");
318
+ const s = t instanceof HTMLFormElement ? t : t.parentElement ?? t;
319
+ s.setAttribute("data-message", e), r !== void 0 ? s.setAttribute("data-message-level", r) : s.removeAttribute("data-message-level");
320
320
  }, !0);
321
321
  }
322
322
  /**
@@ -339,7 +339,7 @@ function et() {
339
339
  (r) => typeof t?.[r] == "function"
340
340
  ) ? t : X;
341
341
  }
342
- class y {
342
+ class A {
343
343
  /**
344
344
  * フォーム内にある入力エレメントの値をオブジェクトとして取得します。
345
345
  * data-form-object属性があると、そのエレメント内の値はオブジェクトとして処理されます。
@@ -350,7 +350,7 @@ class y {
350
350
  */
351
351
  static getValues(t) {
352
352
  const e = {};
353
- return y.getPartValues(t, e);
353
+ return A.getPartValues(t, e);
354
354
  }
355
355
  /**
356
356
  * フォーム内の各入力エレメントから値を取得し、オブジェクトとして返します。
@@ -361,32 +361,32 @@ class y {
361
361
  * @returns values と同じオブジェクト
362
362
  */
363
363
  static getPartValues(t, e) {
364
- const r = t.getAttribute("name"), i = t.getAttribute(`${l.prefix}form-object`), n = t.getAttribute(`${l.prefix}form-list`);
364
+ const r = t.getAttribute("name"), s = t.getAttribute(`${u.prefix}form-object`), n = t.getAttribute(`${u.prefix}form-list`);
365
365
  if (r) {
366
- n ? Array.isArray(e[String(r)]) ? e[String(r)].push(t.getValue()) : e[String(r)] = [t.getValue()] : e[String(r)] = t.getValue(), i && d.warn(
366
+ n ? Array.isArray(e[String(r)]) ? e[String(r)].push(t.getValue()) : e[String(r)] = [t.getValue()] : e[String(r)] = t.getValue(), s && f.warn(
367
367
  "Haori",
368
- `Element cannot have both ${l.prefix}form-object and name attributes.`
368
+ `Element cannot have both ${u.prefix}form-object and name attributes.`
369
369
  );
370
- for (const s of t.getChildElementFragments())
371
- y.getPartValues(s, e);
372
- } else if (i) {
373
- const s = {};
370
+ for (const i of t.getChildElementFragments())
371
+ A.getPartValues(i, e);
372
+ } else if (s) {
373
+ const i = {};
374
374
  for (const a of t.getChildElementFragments())
375
- y.getPartValues(a, s);
376
- Object.keys(s).length > 0 && (e[String(i)] = s), n && d.warn(
375
+ A.getPartValues(a, i);
376
+ Object.keys(i).length > 0 && (e[String(s)] = i), n && f.warn(
377
377
  "Haori",
378
- `Element cannot have both ${l.prefix}form-list and ${l.prefix}form-object attributes.`
378
+ `Element cannot have both ${u.prefix}form-list and ${u.prefix}form-object attributes.`
379
379
  );
380
380
  } else if (n) {
381
- const s = [];
381
+ const i = [];
382
382
  for (const a of t.getChildElementFragments()) {
383
383
  const o = {};
384
- y.getPartValues(a, o), Object.keys(o).length > 0 && s.push(o);
384
+ A.getPartValues(a, o), Object.keys(o).length > 0 && i.push(o);
385
385
  }
386
- s.length > 0 && (e[String(n)] = s);
386
+ i.length > 0 && (e[String(n)] = i);
387
387
  } else
388
- for (const s of t.getChildElementFragments())
389
- y.getPartValues(s, e);
388
+ for (const i of t.getChildElementFragments())
389
+ A.getPartValues(i, e);
390
390
  return e;
391
391
  }
392
392
  /**
@@ -399,7 +399,7 @@ class y {
399
399
  * @returns Promise(DOMの更新が完了したら解決される)
400
400
  */
401
401
  static setValues(t, e, r = !1) {
402
- return y.setPartValues(t, e, null, r, !0);
402
+ return A.setPartValues(t, e, null, r, !0);
403
403
  }
404
404
  /**
405
405
  * フォーム内にある入力エレメントに値をイベントなしで設定します。
@@ -411,7 +411,7 @@ class y {
411
411
  * @returns Promise(DOMの更新が完了したら解決される)
412
412
  */
413
413
  static syncValues(t, e, r = !1) {
414
- return y.setPartValues(t, e, null, r, !1);
414
+ return A.setPartValues(t, e, null, r, !1);
415
415
  }
416
416
  /**
417
417
  * 単一フラグメントへ値を設定します。
@@ -433,53 +433,53 @@ class y {
433
433
  * @param force data-form-detach属性があるエレメントにも値を反映するかどうか
434
434
  * @returns Promise(DOMの更新が完了したら解決される)
435
435
  */
436
- static setPartValues(t, e, r = null, i = !1, n = !0) {
437
- const s = [], a = t.getAttribute("name"), o = t.getAttribute(`${l.prefix}form-object`), h = t.getAttribute(`${l.prefix}form-list`), b = t.getAttribute(`${l.prefix}form-detach`);
436
+ static setPartValues(t, e, r = null, s = !1, n = !0) {
437
+ const i = [], a = t.getAttribute("name"), o = t.getAttribute(`${u.prefix}form-object`), l = t.getAttribute(`${u.prefix}form-list`), m = t.getAttribute(`${u.prefix}form-detach`);
438
438
  if (a) {
439
- if (!b || i) {
439
+ if (!m || s) {
440
440
  const g = e[String(a)];
441
- h && Array.isArray(g) && r !== null ? s.push(
442
- y.applyFragmentValue(t, g[r] ?? null, n)
443
- ) : typeof g > "u" || (typeof g == "string" || typeof g == "number" || typeof g == "boolean" || g === null ? s.push(y.applyFragmentValue(t, g, n)) : s.push(
444
- y.applyFragmentValue(t, String(g), n)
441
+ l && Array.isArray(g) && r !== null ? i.push(
442
+ A.applyFragmentValue(t, g[r] ?? null, n)
443
+ ) : typeof g > "u" || (typeof g == "string" || typeof g == "number" || typeof g == "boolean" || g === null ? i.push(A.applyFragmentValue(t, g, n)) : i.push(
444
+ A.applyFragmentValue(t, String(g), n)
445
445
  ));
446
446
  }
447
447
  } else if (o) {
448
448
  const g = e[String(o)];
449
449
  if (g && typeof g == "object")
450
- for (const E of t.getChildElementFragments())
451
- s.push(
452
- y.setPartValues(
453
- E,
450
+ for (const T of t.getChildElementFragments())
451
+ i.push(
452
+ A.setPartValues(
453
+ T,
454
454
  g,
455
455
  null,
456
- i,
456
+ s,
457
457
  n
458
458
  )
459
459
  );
460
- } else if (h) {
461
- const g = e[String(h)];
460
+ } else if (l) {
461
+ const g = e[String(l)];
462
462
  if (Array.isArray(g)) {
463
- const E = t.getChildElementFragments();
464
- for (let v = 0; v < E.length; v++) {
465
- const c = E[v];
466
- g.length > v ? s.push(
467
- y.setPartValues(
468
- c,
463
+ const T = t.getChildElementFragments();
464
+ for (let v = 0; v < T.length; v++) {
465
+ const h = T[v];
466
+ g.length > v ? i.push(
467
+ A.setPartValues(
468
+ h,
469
469
  g[v],
470
470
  v,
471
- i,
471
+ s,
472
472
  n
473
473
  )
474
- ) : s.push(y.setPartValues(c, {}, v, i, n));
474
+ ) : i.push(A.setPartValues(h, {}, v, s, n));
475
475
  }
476
476
  }
477
477
  } else
478
478
  for (const g of t.getChildElementFragments())
479
- s.push(
480
- y.setPartValues(g, e, null, i, n)
479
+ i.push(
480
+ A.setPartValues(g, e, null, s, n)
481
481
  );
482
- return Promise.all(s).then(() => {
482
+ return Promise.all(i).then(() => {
483
483
  });
484
484
  }
485
485
  /**
@@ -490,9 +490,9 @@ class y {
490
490
  * @returns すべての初期化処理が完了するPromise
491
491
  */
492
492
  static async reset(t) {
493
- y.clearValues(t), await Promise.all([
494
- y.clearMessages(t),
495
- y.clearEachClones(t)
493
+ A.clearValues(t), await Promise.all([
494
+ A.clearMessages(t),
495
+ A.clearEachClones(t)
496
496
  ]), await F.enqueue(() => {
497
497
  const e = t.getTarget();
498
498
  if (e instanceof HTMLFormElement)
@@ -500,11 +500,11 @@ class y {
500
500
  else {
501
501
  const r = e.parentElement;
502
502
  if (r) {
503
- const i = e.nextElementSibling, n = document.createElement("form");
504
- n.appendChild(e), n.reset(), r.insertBefore(e, i);
503
+ const s = e.nextElementSibling, n = document.createElement("form");
504
+ n.appendChild(e), n.reset(), r.insertBefore(e, s);
505
505
  }
506
506
  }
507
- }), await R.evaluateAll(t);
507
+ }), await P.evaluateAll(t);
508
508
  }
509
509
  /**
510
510
  * data-each によって生成された複製(テンプレート以外)を削除します。
@@ -514,19 +514,19 @@ class y {
514
514
  */
515
515
  static clearEachClones(t) {
516
516
  const e = [], r = (n) => {
517
- if (n.hasAttribute(`${l.prefix}each`))
518
- for (const s of n.getChildElementFragments()) {
519
- const a = s.hasAttribute(`${l.prefix}each-before`), o = s.hasAttribute(`${l.prefix}each-after`);
520
- !a && !o && e.push(s.remove());
517
+ if (n.hasAttribute(`${u.prefix}each`))
518
+ for (const i of n.getChildElementFragments()) {
519
+ const a = i.hasAttribute(`${u.prefix}each-before`), o = i.hasAttribute(`${u.prefix}each-after`);
520
+ !a && !o && e.push(i.remove());
521
521
  }
522
- }, i = (n) => {
522
+ }, s = (n) => {
523
523
  r(n);
524
- for (const s of n.getChildElementFragments())
525
- i(s);
524
+ for (const i of n.getChildElementFragments())
525
+ s(i);
526
526
  };
527
527
  r(t);
528
528
  for (const n of t.getChildElementFragments())
529
- i(n);
529
+ s(n);
530
530
  return Promise.all(e).then(() => {
531
531
  });
532
532
  }
@@ -538,7 +538,7 @@ class y {
538
538
  static clearValues(t) {
539
539
  t.clearValue();
540
540
  for (const e of t.getChildElementFragments())
541
- y.clearValues(e);
541
+ A.clearValues(e);
542
542
  }
543
543
  /**
544
544
  * フラグメントとその子要素のメッセージをクリアします。
@@ -561,7 +561,7 @@ class y {
561
561
  * @return Promise(メッセージの追加が完了したら解決される)
562
562
  */
563
563
  static addErrorMessage(t, e, r) {
564
- return y.addMessage(t, e, r, "error");
564
+ return A.addMessage(t, e, r, "error");
565
565
  }
566
566
  /**
567
567
  * キーに一致するフラグメントにレベル付きメッセージを追加します。
@@ -573,11 +573,11 @@ class y {
573
573
  * @param level メッセージのレベル(省略可能)
574
574
  * @return Promise(メッセージの追加が完了したら解決される)
575
575
  */
576
- static addMessage(t, e, r, i) {
577
- const n = [], s = et(), a = s.addMessage, o = (b) => typeof a == "function" ? a.call(s, b, r, i) : s.addErrorMessage(b, r), h = y.findFragmentsByKey(t, e);
578
- return h.forEach((b) => {
579
- n.push(o(b.getTarget()));
580
- }), h.length === 0 && n.push(o(t.getTarget())), Promise.all(n).then(() => {
576
+ static addMessage(t, e, r, s) {
577
+ const n = [], i = et(), a = i.addMessage, o = (m) => typeof a == "function" ? a.call(i, m, r, s) : i.addErrorMessage(m, r), l = A.findFragmentsByKey(t, e);
578
+ return l.forEach((m) => {
579
+ n.push(o(m.getTarget()));
580
+ }), l.length === 0 && n.push(o(t.getTarget())), Promise.all(n).then(() => {
581
581
  });
582
582
  }
583
583
  /**
@@ -588,7 +588,7 @@ class y {
588
588
  * @returns 一致するフラグメントの配列
589
589
  */
590
590
  static findFragmentsByKey(t, e) {
591
- return y.findFragmentByKeyParts(t, e.split("."));
591
+ return A.findFragmentByKeyParts(t, e.split("."));
592
592
  }
593
593
  /**
594
594
  * 指定されたキーに一致するフラグメントを検索します。
@@ -599,24 +599,24 @@ class y {
599
599
  * @returns 一致するフラグメントの配列
600
600
  */
601
601
  static findFragmentByKeyParts(t, e) {
602
- const r = [], i = e[0];
603
- if (e.length == 1 && t.getAttribute("name") === i && r.push(t), t.hasAttribute(`${l.prefix}form-object`))
604
- e.length > 1 && t.getAttribute(`${l.prefix}form-object`) === i && t.getChildElementFragments().forEach((s) => {
605
- r.push(...y.findFragmentByKeyParts(s, e.slice(1)));
602
+ const r = [], s = e[0];
603
+ if (e.length == 1 && t.getAttribute("name") === s && r.push(t), t.hasAttribute(`${u.prefix}form-object`))
604
+ e.length > 1 && t.getAttribute(`${u.prefix}form-object`) === s && t.getChildElementFragments().forEach((i) => {
605
+ r.push(...A.findFragmentByKeyParts(i, e.slice(1)));
606
606
  });
607
- else if (t.hasAttribute(`${l.prefix}form-list`)) {
607
+ else if (t.hasAttribute(`${u.prefix}form-list`)) {
608
608
  if (e.length > 1) {
609
- const n = t.getAttribute(`${l.prefix}form-list`), s = i.lastIndexOf("["), a = i.lastIndexOf("]");
610
- if (s !== -1 && a !== -1 && s < a) {
611
- const o = i.substring(0, s);
609
+ const n = t.getAttribute(`${u.prefix}form-list`), i = s.lastIndexOf("["), a = s.lastIndexOf("]");
610
+ if (i !== -1 && a !== -1 && i < a) {
611
+ const o = s.substring(0, i);
612
612
  if (n === o) {
613
- const h = i.substring(s + 1, a), b = Number(h);
614
- if (isNaN(b))
615
- d.error("Haori", `Invalid index: ${i}`);
613
+ const l = s.substring(i + 1, a), m = Number(l);
614
+ if (isNaN(m))
615
+ f.error("Haori", `Invalid index: ${s}`);
616
616
  else {
617
- const g = t.getChildElementFragments().filter((E) => E.hasAttribute(`${l.prefix}row`));
618
- b < g.length && r.push(
619
- ...y.findFragmentByKeyParts(g[b], e.slice(1))
617
+ const g = t.getChildElementFragments().filter((T) => T.hasAttribute(`${u.prefix}row`));
618
+ m < g.length && r.push(
619
+ ...A.findFragmentByKeyParts(g[m], e.slice(1))
620
620
  );
621
621
  }
622
622
  }
@@ -624,7 +624,7 @@ class y {
624
624
  }
625
625
  } else
626
626
  t.getChildElementFragments().forEach((n) => {
627
- r.push(...y.findFragmentByKeyParts(n, e));
627
+ r.push(...A.findFragmentByKeyParts(n, e));
628
628
  });
629
629
  return r;
630
630
  }
@@ -686,28 +686,28 @@ const M = class M {
686
686
  */
687
687
  static evaluate(t, e = {}) {
688
688
  if (t.trim() === "")
689
- return d.warn("[Haori]", t, "Expression is empty"), null;
689
+ return f.warn("[Haori]", t, "Expression is empty"), null;
690
690
  if (this.containsDangerousPatterns(t))
691
- return d.warn("[Haori]", t, "Expression contains dangerous patterns"), null;
691
+ return f.warn("[Haori]", t, "Expression contains dangerous patterns"), null;
692
692
  if (this.containsForbiddenKeys(e))
693
- return d.warn("[Haori]", e, "Binded values contain forbidden keys"), null;
693
+ return f.warn("[Haori]", e, "Binded values contain forbidden keys"), null;
694
694
  if (this.containsForbiddenBindingValues(e))
695
- return d.warn(
695
+ return f.warn(
696
696
  "[Haori]",
697
697
  e,
698
698
  "Binded values contain forbidden values"
699
699
  ), null;
700
- const r = Object.keys(e).filter((s) => !this.FORBIDDEN_BINDING_NAMES.has(s)).sort(), i = `${t}:${r.join(",")}`;
701
- let n = this.EXPRESSION_CACHE.get(i);
700
+ const r = Object.keys(e).filter((i) => !this.FORBIDDEN_BINDING_NAMES.has(i)).sort(), s = `${t}:${r.join(",")}`;
701
+ let n = this.EXPRESSION_CACHE.get(s);
702
702
  if (!n) {
703
- const s = this.buildAssignments(r), a = s ? `"use strict";
704
- ${s};
703
+ const i = this.buildAssignments(r), a = i ? `"use strict";
704
+ ${i};
705
705
  return (${t});` : `"use strict";
706
706
  return (${t});`;
707
707
  try {
708
- n = new Function(...r, a), this.EXPRESSION_CACHE.set(i, n);
708
+ n = new Function(...r, a), this.EXPRESSION_CACHE.set(s, n);
709
709
  } catch (o) {
710
- return d.error(
710
+ return f.error(
711
711
  "[Haori]",
712
712
  "Failed to compile expression:",
713
713
  t,
@@ -716,12 +716,12 @@ return (${t});`;
716
716
  }
717
717
  }
718
718
  try {
719
- const s = [], a = this.wrapBoundValues(e);
719
+ const i = [], a = this.wrapBoundValues(e);
720
720
  return r.forEach((o) => {
721
- s.push(a[o]);
722
- }), this.withBlockedPropertyAccess(() => n(...s));
723
- } catch (s) {
724
- return d.error("[Haori]", "Expression evaluation error:", t, s), s instanceof ReferenceError ? void 0 : null;
721
+ i.push(a[o]);
722
+ }), this.withBlockedPropertyAccess(() => n(...i));
723
+ } catch (i) {
724
+ return f.error("[Haori]", "Expression evaluation error:", t, i), i instanceof ReferenceError ? void 0 : null;
725
725
  }
726
726
  }
727
727
  /**
@@ -751,21 +751,21 @@ return (${t});`;
751
751
  if (e === null || e.length === 0)
752
752
  return !1;
753
753
  const r = [];
754
- let i = null;
754
+ let s = null;
755
755
  for (let n = 0; n < e.length; n++) {
756
- const s = e[n], a = e[n + 1] || null, o = r[r.length - 1] || null, h = e[n - 2] || null, b = e[n - 3] || null;
756
+ const i = e[n], a = e[n + 1] || null, o = r[r.length - 1] || null, l = e[n - 2] || null, m = e[n - 3] || null;
757
757
  if (this.startsObjectKey(
758
758
  o,
759
- i,
760
- h,
761
- b
762
- ) && (s.value === "[" || s.type === "identifier" && this.FORBIDDEN_PROPERTY_NAMES.has(s.value) || s.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
763
- this.decodeStringLiteral(s.value)
764
- )) || s.type === "identifier" && (this.DISALLOWED_KEYWORDS.has(s.value) || this.STRICT_FORBIDDEN_NAMES.includes(s.value) || (i?.value === "." || i?.value === "?.") && this.FORBIDDEN_PROPERTY_NAMES.has(s.value)) || o === "member" && s.value !== "]" && s.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
765
- this.decodeStringLiteral(s.value)
766
- ) || s.value === "." && a?.type !== "identifier" || s.value === "?." && a?.type !== "identifier" && a?.value !== "[" && a?.value !== "(")
759
+ s,
760
+ l,
761
+ m
762
+ ) && (i.value === "[" || i.type === "identifier" && this.FORBIDDEN_PROPERTY_NAMES.has(i.value) || i.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
763
+ this.decodeStringLiteral(i.value)
764
+ )) || i.type === "identifier" && (this.DISALLOWED_KEYWORDS.has(i.value) || this.STRICT_FORBIDDEN_NAMES.includes(i.value) || (s?.value === "." || s?.value === "?.") && this.FORBIDDEN_PROPERTY_NAMES.has(i.value)) || o === "member" && i.value !== "]" && i.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
765
+ this.decodeStringLiteral(i.value)
766
+ ) || i.value === "." && a?.type !== "identifier" || i.value === "?." && a?.type !== "identifier" && a?.value !== "[" && a?.value !== "(")
767
767
  return !1;
768
- switch (s.value) {
768
+ switch (i.value) {
769
769
  case "(":
770
770
  r.push("paren");
771
771
  break;
@@ -775,7 +775,7 @@ return (${t});`;
775
775
  break;
776
776
  }
777
777
  case "[": {
778
- const g = this.startsMemberAccess(i) ? "member" : "array";
778
+ const g = this.startsMemberAccess(s) ? "member" : "array";
779
779
  r.push(g);
780
780
  break;
781
781
  }
@@ -793,7 +793,7 @@ return (${t});`;
793
793
  break;
794
794
  }
795
795
  }
796
- i = s;
796
+ s = i;
797
797
  }
798
798
  return r.length === 0;
799
799
  }
@@ -816,7 +816,7 @@ return (${t});`;
816
816
  "==",
817
817
  "!=",
818
818
  "=>"
819
- ], i = /* @__PURE__ */ new Set([
819
+ ], s = /* @__PURE__ */ new Set([
820
820
  "(",
821
821
  ")",
822
822
  "{",
@@ -838,14 +838,14 @@ return (${t});`;
838
838
  ]);
839
839
  let n = 0;
840
840
  for (; n < t.length; ) {
841
- const s = t[n];
842
- if (/\s/.test(s)) {
841
+ const i = t[n];
842
+ if (/\s/.test(i)) {
843
843
  n += 1;
844
844
  continue;
845
845
  }
846
- if (s === "/" && (t[n + 1] === "/" || t[n + 1] === "*"))
846
+ if (i === "/" && (t[n + 1] === "/" || t[n + 1] === "*"))
847
847
  return null;
848
- if (s === '"' || s === "'") {
848
+ if (i === '"' || i === "'") {
849
849
  const o = this.readStringToken(t, n);
850
850
  if (o === null)
851
851
  return null;
@@ -859,18 +859,18 @@ return (${t});`;
859
859
  e.push({ type: "operator", value: a, position: n }), n += a.length;
860
860
  continue;
861
861
  }
862
- if (/[0-9]/.test(s)) {
862
+ if (/[0-9]/.test(i)) {
863
863
  const o = this.readNumberToken(t, n);
864
864
  e.push(o.token), n = o.nextIndex;
865
865
  continue;
866
866
  }
867
- if (/[A-Za-z_$]/.test(s)) {
867
+ if (/[A-Za-z_$]/.test(i)) {
868
868
  const o = this.readIdentifierToken(t, n);
869
869
  e.push(o.token), n = o.nextIndex;
870
870
  continue;
871
871
  }
872
- if (i.has(s)) {
873
- e.push({ type: "operator", value: s, position: n }), n += 1;
872
+ if (s.has(i)) {
873
+ e.push({ type: "operator", value: i, position: n }), n += 1;
874
874
  continue;
875
875
  }
876
876
  return null;
@@ -886,23 +886,23 @@ return (${t});`;
886
886
  */
887
887
  static readStringToken(t, e) {
888
888
  const r = t[e];
889
- let i = e + 1;
890
- for (; i < t.length; ) {
891
- const n = t[i];
889
+ let s = e + 1;
890
+ for (; s < t.length; ) {
891
+ const n = t[s];
892
892
  if (n === "\\") {
893
- i += 2;
893
+ s += 2;
894
894
  continue;
895
895
  }
896
896
  if (n === r)
897
897
  return {
898
898
  token: {
899
899
  type: "string",
900
- value: t.slice(e, i + 1),
900
+ value: t.slice(e, s + 1),
901
901
  position: e
902
902
  },
903
- nextIndex: i + 1
903
+ nextIndex: s + 1
904
904
  };
905
- i += 1;
905
+ s += 1;
906
906
  }
907
907
  return null;
908
908
  }
@@ -965,8 +965,8 @@ return (${t});`;
965
965
  * @param previous 直前のトークン
966
966
  * @returns object literal のキー位置であれば true
967
967
  */
968
- static startsObjectKey(t, e, r, i) {
969
- return t !== "object" ? !1 : e?.value === "{" || e?.value === "," || e?.type === "identifier" && this.OBJECT_PROPERTY_MODIFIERS.has(e.value) && (r?.value === "{" || r?.value === ",") ? !0 : e?.value !== "*" ? !1 : r?.value === "{" || r?.value === "," ? !0 : r?.type === "identifier" && r.value === "async" && (i?.value === "{" || i?.value === ",");
968
+ static startsObjectKey(t, e, r, s) {
969
+ return t !== "object" ? !1 : e?.value === "{" || e?.value === "," || e?.type === "identifier" && this.OBJECT_PROPERTY_MODIFIERS.has(e.value) && (r?.value === "{" || r?.value === ",") ? !0 : e?.value !== "*" ? !1 : r?.value === "{" || r?.value === "," ? !0 : r?.type === "identifier" && r.value === "async" && (s?.value === "{" || s?.value === ",");
970
970
  }
971
971
  /**
972
972
  * 文字列リテラルをプレーン文字列へ変換します。
@@ -1014,8 +1014,8 @@ return (${t});`;
1014
1014
  */
1015
1015
  static wrapBoundValues(t) {
1016
1016
  const e = /* @__PURE__ */ new WeakMap(), r = {};
1017
- return Object.entries(t).forEach(([i, n]) => {
1018
- r[i] = this.wrapBoundValue(n, e);
1017
+ return Object.entries(t).forEach(([s, n]) => {
1018
+ r[s] = this.wrapBoundValue(n, e);
1019
1019
  }), r;
1020
1020
  }
1021
1021
  /**
@@ -1028,35 +1028,35 @@ return (${t});`;
1028
1028
  static wrapBoundValue(t, e) {
1029
1029
  if (!this.shouldWrapValue(t))
1030
1030
  return t;
1031
- const r = t, i = e.get(r);
1032
- if (i !== void 0)
1033
- return i;
1031
+ const r = t, s = e.get(r);
1032
+ if (s !== void 0)
1033
+ return s;
1034
1034
  const n = new Proxy(r, {
1035
- get: (s, a, o) => {
1035
+ get: (i, a, o) => {
1036
1036
  if (typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a))
1037
1037
  return;
1038
- const h = Reflect.get(s, a, o);
1039
- return typeof a == "symbol" ? h : this.wrapBoundValue(
1040
- h,
1038
+ const l = Reflect.get(i, a, o);
1039
+ return typeof a == "symbol" ? l : this.wrapBoundValue(
1040
+ l,
1041
1041
  e
1042
1042
  );
1043
1043
  },
1044
- has: (s, a) => typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a) ? !1 : Reflect.has(s, a),
1045
- getOwnPropertyDescriptor: (s, a) => {
1044
+ has: (i, a) => typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a) ? !1 : Reflect.has(i, a),
1045
+ getOwnPropertyDescriptor: (i, a) => {
1046
1046
  if (!(typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a)))
1047
- return Reflect.getOwnPropertyDescriptor(s, a);
1047
+ return Reflect.getOwnPropertyDescriptor(i, a);
1048
1048
  },
1049
- apply: (s, a, o) => {
1050
- const h = Reflect.apply(
1051
- s,
1049
+ apply: (i, a, o) => {
1050
+ const l = Reflect.apply(
1051
+ i,
1052
1052
  a,
1053
1053
  o
1054
1054
  );
1055
- return this.isIteratorLike(h) ? h : this.wrapBoundValue(h, e);
1055
+ return this.isIteratorLike(l) ? l : this.wrapBoundValue(l, e);
1056
1056
  },
1057
- construct: (s, a, o) => this.wrapBoundValue(
1057
+ construct: (i, a, o) => this.wrapBoundValue(
1058
1058
  Reflect.construct(
1059
- s,
1059
+ i,
1060
1060
  a,
1061
1061
  o
1062
1062
  ),
@@ -1092,12 +1092,12 @@ return (${t});`;
1092
1092
  { target: Object.prototype, property: "constructor" },
1093
1093
  { target: Function.prototype, property: "constructor" },
1094
1094
  { target: Object.prototype, property: "__proto__" }
1095
- ].map((i) => ({
1096
- ...i,
1097
- descriptor: Object.getOwnPropertyDescriptor(i.target, i.property)
1098
- })).filter((i) => i.descriptor?.configurable === !0);
1099
- r.forEach(({ target: i, property: n }) => {
1100
- Object.defineProperty(i, n, {
1095
+ ].map((s) => ({
1096
+ ...s,
1097
+ descriptor: Object.getOwnPropertyDescriptor(s.target, s.property)
1098
+ })).filter((s) => s.descriptor?.configurable === !0);
1099
+ r.forEach(({ target: s, property: n }) => {
1100
+ Object.defineProperty(s, n, {
1101
1101
  configurable: !0,
1102
1102
  enumerable: !1,
1103
1103
  get: () => {
@@ -1109,8 +1109,8 @@ return (${t});`;
1109
1109
  try {
1110
1110
  return t();
1111
1111
  } finally {
1112
- r.forEach(({ target: i, property: n, descriptor: s }) => {
1113
- s !== void 0 && Object.defineProperty(i, n, s);
1112
+ r.forEach(({ target: s, property: n, descriptor: i }) => {
1113
+ i !== void 0 && Object.defineProperty(s, n, i);
1114
1114
  });
1115
1115
  }
1116
1116
  }
@@ -1153,7 +1153,7 @@ return (${t});`;
1153
1153
  for (const r of Object.values(t)) {
1154
1154
  if (typeof r == "function") {
1155
1155
  if (this.getForbiddenBindingValues().some(
1156
- (i) => i === r
1156
+ (s) => s === r
1157
1157
  ))
1158
1158
  return !0;
1159
1159
  continue;
@@ -1274,7 +1274,7 @@ const I = class I {
1274
1274
  e = new Z(t);
1275
1275
  break;
1276
1276
  default:
1277
- return d.warn("[Haori]", "Unsupported node type:", t.nodeType), null;
1277
+ return f.warn("[Haori]", "Unsupported node type:", t.nodeType), null;
1278
1278
  }
1279
1279
  return e;
1280
1280
  }
@@ -1407,8 +1407,8 @@ class x extends w {
1407
1407
  ], this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingDataCache = null, this.visible = !0, this.display = null, this.template = null, this.listKey = null, this.value = null, this.skipMutationAttributes = !1, this.skipChangeValue = !1, this.syncValue(), t.getAttributeNames().forEach((e) => {
1408
1408
  const r = t.getAttribute(e);
1409
1409
  if (r !== null && !this.attributeMap.has(e)) {
1410
- const i = new U(e, r);
1411
- this.attributeMap.set(e, i);
1410
+ const s = new U(e, r);
1411
+ this.attributeMap.set(e, s);
1412
1412
  }
1413
1413
  }), t.childNodes.forEach((e) => {
1414
1414
  const r = w.get(e);
@@ -1451,7 +1451,7 @@ class x extends w {
1451
1451
  removeChild(t) {
1452
1452
  const e = this.children.indexOf(t);
1453
1453
  if (e < 0) {
1454
- d.warn("[Haori]", "Child fragment not found.", t);
1454
+ f.warn("[Haori]", "Child fragment not found.", t);
1455
1455
  return;
1456
1456
  }
1457
1457
  this.children.splice(e, 1), t.setParent(null);
@@ -1476,7 +1476,7 @@ class x extends w {
1476
1476
  * clone 時に runtime の hidden 状態だけを落とします。
1477
1477
  */
1478
1478
  normalizeClonedVisibilityState() {
1479
- (this.visible === !1 || this.getTarget().style.display === "none" || this.getTarget().hasAttribute(`${l.prefix}if-false`)) && (this.visible = !0, this.display = "", this.getTarget().style.display = "", this.getTarget().removeAttribute(`${l.prefix}if-false`)), this.children.forEach((t) => {
1479
+ (this.visible === !1 || this.getTarget().style.display === "none" || this.getTarget().hasAttribute(`${u.prefix}if-false`)) && (this.visible = !0, this.display = "", this.getTarget().style.display = "", this.getTarget().removeAttribute(`${u.prefix}if-false`)), this.children.forEach((t) => {
1480
1480
  t instanceof x && t.normalizeClonedVisibilityState();
1481
1481
  });
1482
1482
  }
@@ -1606,10 +1606,10 @@ class x extends w {
1606
1606
  return Promise.resolve();
1607
1607
  const r = this.getTarget();
1608
1608
  if (r instanceof HTMLInputElement && (r.type === "checkbox" || r.type === "radio")) {
1609
- const i = this.getAttribute("value"), n = r.type === "checkbox" && i === "true";
1610
- let s;
1611
- return n ? s = t === !0 || t === "true" : i === "false" ? s = t === !1 : s = i === String(t), this.value = n ? s : s ? t : null, r.checked === s ? Promise.resolve() : (this.skipChangeValue = !0, F.enqueue(() => {
1612
- r.checked = s, e && r.dispatchEvent(new Event("change", { bubbles: !0 }));
1609
+ const s = this.getAttribute("value"), n = r.type === "checkbox" && s === "true";
1610
+ let i;
1611
+ return n ? i = t === !0 || t === "true" : s === "false" ? i = t === !1 : i = s === String(t), this.value = n ? i : i ? t : null, r.checked === i ? Promise.resolve() : (this.skipChangeValue = !0, F.enqueue(() => {
1612
+ r.checked = i, e && r.dispatchEvent(new Event("change", { bubbles: !0 }));
1613
1613
  }).finally(() => {
1614
1614
  this.skipChangeValue = !1;
1615
1615
  }));
@@ -1617,7 +1617,7 @@ class x extends w {
1617
1617
  r.value = t === null ? "" : String(t), e && ((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 })));
1618
1618
  }).finally(() => {
1619
1619
  this.skipChangeValue = !1;
1620
- })) : (d.warn(
1620
+ })) : (f.warn(
1621
1621
  "[Haori]",
1622
1622
  "setValue is not supported for this element type.",
1623
1623
  r
@@ -1708,20 +1708,20 @@ class x extends w {
1708
1708
  * @param syncValueProperty value 属性更新時に DOM property も同期するかどうか
1709
1709
  * @returns 属性更新の Promise
1710
1710
  */
1711
- setAttributeInternal(t, e, r, i) {
1711
+ setAttributeInternal(t, e, r, s) {
1712
1712
  if (this.skipMutationAttributes)
1713
1713
  return Promise.resolve();
1714
1714
  if (r === null)
1715
1715
  return t === e ? this.removeAttribute(t) : this.removeAliasedAttribute(t, e);
1716
1716
  const n = new U(t, r);
1717
1717
  this.attributeMap.set(t, n), this.skipMutationAttributes = !0;
1718
- const s = this.getTarget(), a = n.isForceEvaluation() ? r : this.getAttribute(t);
1718
+ const i = this.getTarget(), a = n.isForceEvaluation() ? r : this.getAttribute(t);
1719
1719
  return F.enqueue(() => {
1720
- if (s.getAttribute(t) !== r && s.setAttribute(t, r), a === null || a === !1)
1721
- s.removeAttribute(e);
1720
+ if (i.getAttribute(t) !== r && i.setAttribute(t, r), a === null || a === !1)
1721
+ i.removeAttribute(e);
1722
1722
  else {
1723
1723
  const o = String(a);
1724
- s.getAttribute(e) !== o && s.setAttribute(e, o), i && n.isEvaluate && e === "value" && (s instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(s.type) || s instanceof HTMLTextAreaElement || s instanceof HTMLSelectElement) && (this.value = o, s.value !== o && (s.value = o));
1724
+ i.getAttribute(e) !== o && i.setAttribute(e, o), s && n.isEvaluate && e === "value" && (i instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(i.type) || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement) && (this.value = o, i.value !== o && (i.value = o));
1725
1725
  }
1726
1726
  }).finally(() => {
1727
1727
  this.skipMutationAttributes = !1;
@@ -1756,7 +1756,7 @@ class x extends w {
1756
1756
  if (e === void 0)
1757
1757
  return null;
1758
1758
  const r = e.evaluate(this.getBindingData());
1759
- return r.length === 1 ? r[0] : $.joinEvaluateResults(r);
1759
+ return r.length === 1 ? r[0] : B.joinEvaluateResults(r);
1760
1760
  }
1761
1761
  /**
1762
1762
  * 属性の生の値を取得します。
@@ -1796,18 +1796,18 @@ class x extends w {
1796
1796
  const r = t.getTarget();
1797
1797
  if (r.parentNode !== this.target)
1798
1798
  return null;
1799
- const i = e ? r.nextSibling : r;
1799
+ const s = e ? r.nextSibling : r;
1800
1800
  let n = e ? r.nextSibling : r;
1801
1801
  for (; n !== null; ) {
1802
- const s = w.get(n);
1803
- if (s !== null) {
1804
- const a = this.children.indexOf(s);
1802
+ const i = w.get(n);
1803
+ if (i !== null) {
1804
+ const a = this.children.indexOf(i);
1805
1805
  if (a !== -1)
1806
- return { index: a, referenceNode: i };
1806
+ return { index: a, referenceNode: s };
1807
1807
  }
1808
1808
  n = n.nextSibling;
1809
1809
  }
1810
- return { index: this.children.length, referenceNode: i };
1810
+ return { index: this.children.length, referenceNode: s };
1811
1811
  }
1812
1812
  /**
1813
1813
  * 子ノードを参照ノードの前に挿入します。
@@ -1821,40 +1821,40 @@ class x extends w {
1821
1821
  if (this.skipMutationNodes)
1822
1822
  return Promise.resolve();
1823
1823
  if (t === this)
1824
- return d.error("[Haori]", "Cannot insert element as child of itself"), Promise.reject(new Error("Self-insertion not allowed"));
1825
- const i = /* @__PURE__ */ new Set();
1824
+ return f.error("[Haori]", "Cannot insert element as child of itself"), Promise.reject(new Error("Self-insertion not allowed"));
1825
+ const s = /* @__PURE__ */ new Set();
1826
1826
  let n = this.parent;
1827
1827
  for (; n; )
1828
- i.add(n), n = n.getParent();
1829
- if (i.has(t))
1830
- return d.error("[Haori]", "Cannot create circular reference"), Promise.reject(new Error("Circular reference detected"));
1831
- const s = t.getParent() === this;
1828
+ s.add(n), n = n.getParent();
1829
+ if (s.has(t))
1830
+ return f.error("[Haori]", "Cannot create circular reference"), Promise.reject(new Error("Circular reference detected"));
1831
+ const i = t.getParent() === this;
1832
1832
  let a = -1, o = -1;
1833
- s && (a = this.children.indexOf(t), e !== null && (o = this.children.indexOf(e)));
1834
- const h = t.getParent();
1835
- h !== null && h.removeChild(t);
1836
- let b = r === void 0 ? e?.getTarget() || null : r;
1833
+ i && (a = this.children.indexOf(t), e !== null && (o = this.children.indexOf(e)));
1834
+ const l = t.getParent();
1835
+ l !== null && l.removeChild(t);
1836
+ let m = r === void 0 ? e?.getTarget() || null : r;
1837
1837
  if (e === null)
1838
1838
  this.children.push(t);
1839
1839
  else {
1840
- let E;
1841
- if (s ? a !== -1 && a < o ? E = o - 1 : E = o : E = this.children.indexOf(e), E === -1) {
1840
+ let T;
1841
+ if (i ? a !== -1 && a < o ? T = o - 1 : T = o : T = this.children.indexOf(e), T === -1) {
1842
1842
  const v = this.resolveInsertionPointFromDom(
1843
1843
  e,
1844
1844
  !1
1845
1845
  );
1846
- v === null ? (d.warn(
1846
+ v === null ? (f.warn(
1847
1847
  "[Haori]",
1848
1848
  "Reference child not found in children.",
1849
1849
  e
1850
- ), this.children.push(t)) : (this.children.splice(v.index, 0, t), b = v.referenceNode);
1850
+ ), this.children.push(t)) : (this.children.splice(v.index, 0, t), m = v.referenceNode);
1851
1851
  } else
1852
- this.children.splice(E, 0, t);
1852
+ this.children.splice(T, 0, t);
1853
1853
  }
1854
1854
  t.setParent(this), t.setMounted(this.mounted);
1855
1855
  const g = this.skipMutationNodes;
1856
1856
  return this.skipMutationNodes = !0, F.enqueue(() => {
1857
- this.target.insertBefore(t.getTarget(), b);
1857
+ this.target.insertBefore(t.getTarget(), m);
1858
1858
  }).finally(() => {
1859
1859
  this.skipMutationNodes = g;
1860
1860
  });
@@ -1871,18 +1871,18 @@ class x extends w {
1871
1871
  return this.insertBefore(t, null);
1872
1872
  const r = this.children.indexOf(e);
1873
1873
  if (r === -1) {
1874
- const i = this.resolveInsertionPointFromDom(
1874
+ const s = this.resolveInsertionPointFromDom(
1875
1875
  e,
1876
1876
  !0
1877
1877
  );
1878
- return i === null ? (d.warn(
1878
+ return s === null ? (f.warn(
1879
1879
  "[Haori]",
1880
1880
  "Reference child not found in children.",
1881
1881
  e
1882
1882
  ), this.insertBefore(t, null)) : this.insertBefore(
1883
1883
  t,
1884
- this.children[i.index] || null,
1885
- i.referenceNode
1884
+ this.children[s.index] || null,
1885
+ s.referenceNode
1886
1886
  );
1887
1887
  }
1888
1888
  return this.insertBefore(t, this.children[r + 1] || null);
@@ -1927,7 +1927,7 @@ class x extends w {
1927
1927
  * @returns エレメントの非表示のPromise
1928
1928
  */
1929
1929
  hide() {
1930
- return this.visible = !1, this.display = this.getTarget().style.display, this.getTarget().style.display = "none", this.getTarget().setAttribute(`${l.prefix}if-false`, ""), Promise.resolve();
1930
+ return this.visible = !1, this.display = this.getTarget().style.display, this.getTarget().style.display = "none", this.getTarget().setAttribute(`${u.prefix}if-false`, ""), Promise.resolve();
1931
1931
  }
1932
1932
  /**
1933
1933
  * エレメントを表示します。
@@ -1935,7 +1935,7 @@ class x extends w {
1935
1935
  * @return エレメントの表示のPromise
1936
1936
  */
1937
1937
  show() {
1938
- return this.getTarget().style.display = this.display ?? "", this.getTarget().removeAttribute(`${l.prefix}if-false`), this.visible = !0, Promise.resolve();
1938
+ return this.getTarget().style.display = this.display ?? "", this.getTarget().removeAttribute(`${u.prefix}if-false`), this.visible = !0, Promise.resolve();
1939
1939
  }
1940
1940
  /**
1941
1941
  * 指定した属性名を持つ最も近い親要素を返します。
@@ -1959,7 +1959,7 @@ class O extends w {
1959
1959
  * @param target 対象テキストノード
1960
1960
  */
1961
1961
  constructor(t) {
1962
- super(t), this.skipMutation = !1, this.text = t.textContent || "", this.contents = new $(this.text);
1962
+ super(t), this.skipMutation = !1, this.text = t.textContent || "", this.contents = new B(this.text);
1963
1963
  }
1964
1964
  /**
1965
1965
  * フラグメントをクローンします。
@@ -1985,7 +1985,7 @@ class O extends w {
1985
1985
  * @returns 更新のPromise
1986
1986
  */
1987
1987
  setContent(t) {
1988
- return this.skipMutation || this.text === t ? Promise.resolve() : (this.text = t, this.contents = new $(t), this.evaluate());
1988
+ return this.skipMutation || this.text === t ? Promise.resolve() : (this.text = t, this.contents = new B(t), this.evaluate());
1989
1989
  }
1990
1990
  /**
1991
1991
  * フラグメントを評価します。
@@ -1998,7 +1998,7 @@ class O extends w {
1998
1998
  ) : F.enqueue(() => {
1999
1999
  this.skipMutation = !0, this.contents.isRawEvaluate ? this.parent.getTarget().innerHTML = this.contents.evaluate(
2000
2000
  this.parent.getBindingData()
2001
- )[0] : this.contents.isEvaluate ? this.target.textContent = $.joinEvaluateResults(
2001
+ )[0] : this.contents.isEvaluate ? this.target.textContent = B.joinEvaluateResults(
2002
2002
  this.contents.evaluate(this.parent.getBindingData())
2003
2003
  ) : this.target.textContent = this.text;
2004
2004
  }).finally(() => {
@@ -2047,7 +2047,7 @@ class Z extends w {
2047
2047
  }));
2048
2048
  }
2049
2049
  }
2050
- const K = class K {
2050
+ const G = class G {
2051
2051
  /**
2052
2052
  * コンストラクタ。
2053
2053
  *
@@ -2055,26 +2055,26 @@ const K = class K {
2055
2055
  */
2056
2056
  constructor(t) {
2057
2057
  this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = t;
2058
- const e = [...t.matchAll(K.PLACEHOLDER_REGEX)];
2059
- let r = 0, i = !1, n = !1;
2060
- for (const s of e) {
2061
- s.index > r && this.contents.push({
2062
- text: t.slice(r, s.index),
2058
+ const e = [...t.matchAll(G.PLACEHOLDER_REGEX)];
2059
+ let r = 0, s = !1, n = !1;
2060
+ for (const i of e) {
2061
+ i.index > r && this.contents.push({
2062
+ text: t.slice(r, i.index),
2063
2063
  type: 0
2064
2064
  /* TEXT */
2065
2065
  });
2066
2066
  const a = {
2067
- text: s[1] ?? s[2],
2068
- type: s[1] ? 2 : 1
2067
+ text: i[1] ?? i[2],
2068
+ type: i[1] ? 2 : 1
2069
2069
  /* EXPRESSION */
2070
2070
  };
2071
- i = !0, n = n || a.type === 2, this.contents.push(a), r = s.index + s[0].length;
2071
+ s = !0, n = n || a.type === 2, this.contents.push(a), r = i.index + i[0].length;
2072
2072
  }
2073
2073
  r < t.length && this.contents.push({
2074
2074
  text: t.slice(r),
2075
2075
  type: 0
2076
2076
  /* TEXT */
2077
- }), this.isEvaluate = i, this.isRawEvaluate = n, this.checkRawExpressions();
2077
+ }), this.isEvaluate = s, this.isRawEvaluate = n, this.checkRawExpressions();
2078
2078
  }
2079
2079
  /**
2080
2080
  * 評価結果を結合して文字列にします。
@@ -2098,7 +2098,7 @@ const K = class K {
2098
2098
  */
2099
2099
  checkRawExpressions() {
2100
2100
  for (let t = 0; t < this.contents.length; t++)
2101
- this.contents[t].type === 2 && this.contents.length > 1 && (d.error(
2101
+ this.contents[t].type === 2 && this.contents.length > 1 && (f.error(
2102
2102
  "[Haori]",
2103
2103
  "Raw expressions are not allowed in multi-content expressions."
2104
2104
  ), this.contents[t].type = 1);
@@ -2116,23 +2116,23 @@ const K = class K {
2116
2116
  return this.contents.forEach((r) => {
2117
2117
  try {
2118
2118
  if (r.type === 1 || r.type === 2) {
2119
- const i = j.evaluate(r.text, t);
2120
- e.push(i);
2119
+ const s = j.evaluate(r.text, t);
2120
+ e.push(s);
2121
2121
  } else
2122
2122
  e.push(r.text);
2123
- } catch (i) {
2124
- d.error(
2123
+ } catch (s) {
2124
+ f.error(
2125
2125
  "[Haori]",
2126
2126
  `Error evaluating text expression: ${r.text}`,
2127
- i
2127
+ s
2128
2128
  ), e.push("");
2129
2129
  }
2130
2130
  }), e;
2131
2131
  }
2132
2132
  };
2133
- K.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
2134
- let $ = K;
2135
- const G = class G extends $ {
2133
+ G.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
2134
+ let B = G;
2135
+ const K = class K extends B {
2136
2136
  /**
2137
2137
  * コンストラクタ。
2138
2138
  *
@@ -2140,7 +2140,7 @@ const G = class G extends $ {
2140
2140
  * @param text 属性値
2141
2141
  */
2142
2142
  constructor(t, e) {
2143
- super(e), this.forceEvaluation = G.FORCE_EVALUATION_ATTRIBUTES.includes(t);
2143
+ super(e), this.forceEvaluation = K.FORCE_EVALUATION_ATTRIBUTES.includes(t);
2144
2144
  }
2145
2145
  /**
2146
2146
  * 強制評価フラグを取得します。
@@ -2163,31 +2163,31 @@ const G = class G extends $ {
2163
2163
  return this.contents.forEach((r) => {
2164
2164
  try {
2165
2165
  if (this.forceEvaluation && r.type === 0 || r.type === 1 || r.type === 2) {
2166
- const i = j.evaluate(r.text, t);
2167
- e.push(i);
2166
+ const s = j.evaluate(r.text, t);
2167
+ e.push(s);
2168
2168
  } else
2169
2169
  e.push(r.text);
2170
- } catch (i) {
2171
- d.error(
2170
+ } catch (s) {
2171
+ f.error(
2172
2172
  "[Haori]",
2173
2173
  `Error evaluating attribute expression: ${r.text}`,
2174
- i
2174
+ s
2175
2175
  ), e.push("");
2176
2176
  }
2177
- }), this.forceEvaluation && e.length > 1 ? (d.error(
2177
+ }), this.forceEvaluation && e.length > 1 ? (f.error(
2178
2178
  "[Haori]",
2179
2179
  "each or if expressions must have a single content.",
2180
2180
  e
2181
2181
  ), [e[0]]) : e;
2182
2182
  }
2183
2183
  };
2184
- G.FORCE_EVALUATION_ATTRIBUTES = [
2184
+ K.FORCE_EVALUATION_ATTRIBUTES = [
2185
2185
  "data-if",
2186
2186
  "hor-if",
2187
2187
  "data-each",
2188
2188
  "hor-each"
2189
2189
  ];
2190
- let U = G;
2190
+ let U = K;
2191
2191
  class N {
2192
2192
  /**
2193
2193
  * カスタムイベントを発火します。
@@ -2197,11 +2197,11 @@ class N {
2197
2197
  * @param detail イベントの詳細データ
2198
2198
  * @param options イベントオプション
2199
2199
  */
2200
- static dispatch(t, e, r, i) {
2200
+ static dispatch(t, e, r, s) {
2201
2201
  const n = new CustomEvent(`haori:${e}`, {
2202
- bubbles: i?.bubbles ?? !0,
2203
- cancelable: i?.cancelable ?? !1,
2204
- composed: i?.composed ?? !0,
2202
+ bubbles: s?.bubbles ?? !0,
2203
+ cancelable: s?.cancelable ?? !1,
2204
+ composed: s?.composed ?? !0,
2205
2205
  detail: r
2206
2206
  });
2207
2207
  return t.dispatchEvent(n);
@@ -2242,11 +2242,11 @@ class N {
2242
2242
  * @param bytes 取得バイト数
2243
2243
  * @param startedAt 開始時刻
2244
2244
  */
2245
- static importEnd(t, e, r, i) {
2245
+ static importEnd(t, e, r, s) {
2246
2246
  N.dispatch(t, "importend", {
2247
2247
  url: e,
2248
2248
  bytes: r,
2249
- durationMs: performance.now() - i
2249
+ durationMs: performance.now() - s
2250
2250
  });
2251
2251
  }
2252
2252
  /**
@@ -2267,17 +2267,17 @@ class N {
2267
2267
  * @param next 変更後のデータ
2268
2268
  * @param reason 変更理由
2269
2269
  */
2270
- static bindChange(t, e, r, i = "other") {
2271
- const n = [], s = new Set(Object.keys(e || {})), a = new Set(Object.keys(r)), o = /* @__PURE__ */ new Set([...s, ...a]);
2272
- for (const h of o) {
2273
- const b = e?.[h], g = r[h];
2274
- b !== g && n.push(h);
2270
+ static bindChange(t, e, r, s = "other") {
2271
+ const n = [], i = new Set(Object.keys(e || {})), a = new Set(Object.keys(r)), o = /* @__PURE__ */ new Set([...i, ...a]);
2272
+ for (const l of o) {
2273
+ const m = e?.[l], g = r[l];
2274
+ m !== g && n.push(l);
2275
2275
  }
2276
2276
  N.dispatch(t, "bindchange", {
2277
2277
  previous: e || {},
2278
2278
  next: r,
2279
2279
  changedKeys: n,
2280
- reason: i
2280
+ reason: s
2281
2281
  });
2282
2282
  }
2283
2283
  /**
@@ -2288,12 +2288,12 @@ class N {
2288
2288
  * @param removed 削除された行のキー
2289
2289
  * @param order 現在の順序
2290
2290
  */
2291
- static eachUpdate(t, e, r, i) {
2291
+ static eachUpdate(t, e, r, s) {
2292
2292
  N.dispatch(t, "eachupdate", {
2293
2293
  added: e,
2294
2294
  removed: r,
2295
- order: i,
2296
- total: i.length
2295
+ order: s,
2296
+ total: s.length
2297
2297
  });
2298
2298
  }
2299
2299
  /**
@@ -2304,8 +2304,8 @@ class N {
2304
2304
  * @param index インデックス
2305
2305
  * @param item 行データ
2306
2306
  */
2307
- static rowAdd(t, e, r, i) {
2308
- N.dispatch(t, "rowadd", { key: e, index: r, item: i });
2307
+ static rowAdd(t, e, r, s) {
2308
+ N.dispatch(t, "rowadd", { key: e, index: r, item: s });
2309
2309
  }
2310
2310
  /**
2311
2311
  * rowremoveイベントを発火します。
@@ -2325,8 +2325,8 @@ class N {
2325
2325
  * @param from 移動前インデックス
2326
2326
  * @param to 移動後インデックス
2327
2327
  */
2328
- static rowMove(t, e, r, i) {
2329
- N.dispatch(t, "rowmove", { key: e, from: r, to: i });
2328
+ static rowMove(t, e, r, s) {
2329
+ N.dispatch(t, "rowmove", { key: e, from: r, to: s });
2330
2330
  }
2331
2331
  /**
2332
2332
  * showイベントを発火します。
@@ -2354,11 +2354,11 @@ class N {
2354
2354
  * @param metadata runtime とメソッド変換情報。
2355
2355
  * @return 戻り値はありません。
2356
2356
  */
2357
- static fetchStart(t, e, r, i, n) {
2357
+ static fetchStart(t, e, r, s, n) {
2358
2358
  N.dispatch(t, "fetchstart", {
2359
2359
  url: e,
2360
2360
  options: r || {},
2361
- payload: i,
2361
+ payload: s,
2362
2362
  startedAt: performance.now(),
2363
2363
  ...n
2364
2364
  });
@@ -2371,11 +2371,11 @@ class N {
2371
2371
  * @param status HTTPステータス
2372
2372
  * @param startedAt 開始時刻
2373
2373
  */
2374
- static fetchEnd(t, e, r, i) {
2374
+ static fetchEnd(t, e, r, s) {
2375
2375
  N.dispatch(t, "fetchend", {
2376
2376
  url: e,
2377
2377
  status: r,
2378
- durationMs: performance.now() - i
2378
+ durationMs: performance.now() - s
2379
2379
  });
2380
2380
  }
2381
2381
  /**
@@ -2387,10 +2387,10 @@ class N {
2387
2387
  * @param status HTTPステータス(存在する場合)
2388
2388
  * @param startedAt 開始時刻(存在する場合)
2389
2389
  */
2390
- static fetchError(t, e, r, i, n) {
2390
+ static fetchError(t, e, r, s, n) {
2391
2391
  N.dispatch(t, "fetcherror", {
2392
2392
  url: e,
2393
- status: i,
2393
+ status: s,
2394
2394
  error: r,
2395
2395
  durationMs: n ? performance.now() - n : void 0
2396
2396
  });
@@ -2411,20 +2411,20 @@ function W() {
2411
2411
  ) ? t : X;
2412
2412
  }
2413
2413
  const lt = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
2414
- function ut(P) {
2415
- return lt.has(P.toUpperCase());
2414
+ function ut(R) {
2415
+ return lt.has(R.toUpperCase());
2416
2416
  }
2417
- function ct(P, t) {
2417
+ function ct(R, t) {
2418
2418
  for (const [e, r] of Object.entries(t))
2419
- r !== void 0 && (r === null ? P.append(e, "") : Array.isArray(r) ? r.forEach((i) => {
2420
- P.append(e, String(i));
2421
- }) : typeof r == "object" || typeof r == "function" ? P.append(e, JSON.stringify(r)) : P.append(e, String(r)));
2419
+ r !== void 0 && (r === null ? R.append(e, "") : Array.isArray(r) ? r.forEach((s) => {
2420
+ R.append(e, String(s));
2421
+ }) : typeof r == "object" || typeof r == "function" ? R.append(e, JSON.stringify(r)) : R.append(e, String(r)));
2422
2422
  }
2423
- function ht(P, t) {
2424
- const e = new URL(P, window.location.href), r = new URLSearchParams(e.search);
2423
+ function ht(R, t) {
2424
+ const e = new URL(R, window.location.href), r = new URLSearchParams(e.search);
2425
2425
  return ct(r, t), e.search = r.toString(), e.toString();
2426
2426
  }
2427
- const u = class u {
2427
+ const c = class c {
2428
2428
  /**
2429
2429
  * イベント属性名を正しく生成します。
2430
2430
  * 例: ("click", "fetch") => "data-click-fetch"
@@ -2433,7 +2433,7 @@ const u = class u {
2433
2433
  * 非イベント変種が "data-fetch-xxx" として存在するものについては、event が null の場合にそちらを返します。
2434
2434
  */
2435
2435
  static attrName(t, e, r = !1) {
2436
- return t ? `${l.prefix}${t}-${e}` : r ? `${l.prefix}fetch-${e}` : `${l.prefix}${e}`;
2436
+ return t ? `${u.prefix}${t}-${e}` : r ? `${u.prefix}fetch-${e}` : `${u.prefix}${e}`;
2437
2437
  }
2438
2438
  /**
2439
2439
  * data 属性のテンプレート式評価結果を URLSearchParams 向けに組み立てます。
@@ -2444,13 +2444,13 @@ const u = class u {
2444
2444
  */
2445
2445
  static resolveDataParamString(t, e) {
2446
2446
  return t.replace(
2447
- u.DATA_PLACEHOLDER_REGEX,
2448
- (r, i, n) => {
2449
- const s = j.evaluate(
2450
- i ?? n ?? "",
2447
+ c.DATA_PLACEHOLDER_REGEX,
2448
+ (r, s, n) => {
2449
+ const i = j.evaluate(
2450
+ s ?? n ?? "",
2451
2451
  e
2452
2452
  );
2453
- return s == null || Number.isNaN(s) ? "" : encodeURIComponent(typeof s == "object" ? JSON.stringify(s) : String(s));
2453
+ return i == null || Number.isNaN(i) ? "" : encodeURIComponent(typeof i == "object" ? JSON.stringify(i) : String(i));
2454
2454
  }
2455
2455
  );
2456
2456
  }
@@ -2462,18 +2462,18 @@ const u = class u {
2462
2462
  * @returns JSON 文字列中なら true
2463
2463
  */
2464
2464
  static isJsonStringContext(t, e) {
2465
- let r = !1, i = !1;
2465
+ let r = !1, s = !1;
2466
2466
  for (let n = 0; n < e; n += 1) {
2467
- const s = t[n];
2468
- if (i) {
2469
- i = !1;
2467
+ const i = t[n];
2468
+ if (s) {
2469
+ s = !1;
2470
2470
  continue;
2471
2471
  }
2472
- if (s === "\\") {
2473
- i = !0;
2472
+ if (i === "\\") {
2473
+ s = !0;
2474
2474
  continue;
2475
2475
  }
2476
- s === '"' && (r = !r);
2476
+ i === '"' && (r = !r);
2477
2477
  }
2478
2478
  return r;
2479
2479
  }
@@ -2501,7 +2501,7 @@ const u = class u {
2501
2501
  static stringifyJsonTemplateStringContent(t) {
2502
2502
  if (t == null || Number.isNaN(t))
2503
2503
  return "";
2504
- const e = typeof t == "object" ? u.stringifyJsonTemplateValue(t) : String(t);
2504
+ const e = typeof t == "object" ? c.stringifyJsonTemplateValue(t) : String(t);
2505
2505
  return JSON.stringify(e).slice(1, -1);
2506
2506
  }
2507
2507
  /**
@@ -2513,13 +2513,13 @@ const u = class u {
2513
2513
  */
2514
2514
  static resolveDataJsonString(t, e) {
2515
2515
  return t.replace(
2516
- u.DATA_PLACEHOLDER_REGEX,
2517
- (r, i, n, s) => {
2516
+ c.DATA_PLACEHOLDER_REGEX,
2517
+ (r, s, n, i) => {
2518
2518
  const a = j.evaluate(
2519
- i ?? n ?? "",
2519
+ s ?? n ?? "",
2520
2520
  e
2521
2521
  );
2522
- return u.isJsonStringContext(t, s) ? u.stringifyJsonTemplateStringContent(a) : u.stringifyJsonTemplateValue(a);
2522
+ return c.isJsonStringContext(t, i) ? c.stringifyJsonTemplateStringContent(a) : c.stringifyJsonTemplateValue(a);
2523
2523
  }
2524
2524
  );
2525
2525
  }
@@ -2531,19 +2531,19 @@ const u = class u {
2531
2531
  * @returns 送信データ
2532
2532
  */
2533
2533
  static resolveDataAttribute(t, e) {
2534
- const r = t.getRawAttribute(e), i = t.getAttribute(e);
2535
- if (i && typeof i == "object" && !Array.isArray(i))
2536
- return i;
2537
- if (typeof i != "string" || r === null)
2534
+ const r = t.getRawAttribute(e), s = t.getAttribute(e);
2535
+ if (s && typeof s == "object" && !Array.isArray(s))
2536
+ return s;
2537
+ if (typeof s != "string" || r === null)
2538
2538
  return null;
2539
2539
  const n = r.trim();
2540
- return u.SINGLE_PLACEHOLDER_REGEX.test(n) ? R.parseDataBind(i) : n.startsWith("{") || n.startsWith("[") ? R.parseDataBind(
2541
- u.resolveDataJsonString(
2540
+ return c.SINGLE_PLACEHOLDER_REGEX.test(n) ? P.parseDataBind(s) : n.startsWith("{") || n.startsWith("[") ? P.parseDataBind(
2541
+ c.resolveDataJsonString(
2542
2542
  r,
2543
2543
  t.getBindingData()
2544
2544
  )
2545
- ) : R.parseDataBind(
2546
- u.resolveDataParamString(r, t.getBindingData())
2545
+ ) : P.parseDataBind(
2546
+ c.resolveDataParamString(r, t.getBindingData())
2547
2547
  );
2548
2548
  }
2549
2549
  /**
@@ -2558,30 +2558,30 @@ const u = class u {
2558
2558
  targetFragment: t
2559
2559
  };
2560
2560
  if (e) {
2561
- if (t.hasAttribute(u.attrName(e, "validate")) && (r.valid = !0), t.hasAttribute(u.attrName(e, "confirm")) && (r.confirmMessage = t.getAttribute(
2562
- u.attrName(e, "confirm")
2561
+ if (t.hasAttribute(c.attrName(e, "validate")) && (r.valid = !0), t.hasAttribute(c.attrName(e, "confirm")) && (r.confirmMessage = t.getAttribute(
2562
+ c.attrName(e, "confirm")
2563
2563
  ).replace(/\\n/g, `
2564
- `)), t.hasAttribute(u.attrName(e, "data")) && (r.data = u.resolveDataAttribute(
2564
+ `)), t.hasAttribute(c.attrName(e, "data")) && (r.data = c.resolveDataAttribute(
2565
2565
  t,
2566
- u.attrName(e, "data")
2567
- )), t.hasAttribute(u.attrName(e, "form"))) {
2568
- const c = t.getRawAttribute(
2569
- u.attrName(e, "form")
2566
+ c.attrName(e, "data")
2567
+ )), t.hasAttribute(c.attrName(e, "form"))) {
2568
+ const h = t.getRawAttribute(
2569
+ c.attrName(e, "form")
2570
2570
  );
2571
- if (c) {
2572
- const f = document.body.querySelector(c);
2573
- f !== null ? r.formFragment = y.getFormFragment(
2574
- w.get(f)
2575
- ) : d.error(
2571
+ if (h) {
2572
+ const d = document.body.querySelector(h);
2573
+ d !== null ? r.formFragment = A.getFormFragment(
2574
+ w.get(d)
2575
+ ) : f.error(
2576
2576
  "Haori",
2577
- `Form element not found: ${c} (${u.attrName(e, "form")})`
2577
+ `Form element not found: ${h} (${c.attrName(e, "form")})`
2578
2578
  );
2579
2579
  } else
2580
- r.formFragment = y.getFormFragment(t);
2581
- } else e === "change" && (r.formFragment = y.getFormFragment(t));
2582
- if (t.hasAttribute(`${l.prefix}${e}-before-run`)) {
2583
- const c = t.getRawAttribute(
2584
- `${l.prefix}${e}-before-run`
2580
+ r.formFragment = A.getFormFragment(t);
2581
+ } else e === "change" && (r.formFragment = A.getFormFragment(t));
2582
+ if (t.hasAttribute(`${u.prefix}${e}-before-run`)) {
2583
+ const h = t.getRawAttribute(
2584
+ `${u.prefix}${e}-before-run`
2585
2585
  );
2586
2586
  try {
2587
2587
  r.beforeCallback = new Function(
@@ -2589,216 +2589,216 @@ const u = class u {
2589
2589
  "fetchOptions",
2590
2590
  `
2591
2591
  "use strict";
2592
- ${c}
2592
+ ${h}
2593
2593
  `
2594
2594
  );
2595
- } catch (f) {
2596
- d.error("Haori", `Invalid before script: ${f}`);
2595
+ } catch (d) {
2596
+ f.error("Haori", `Invalid before script: ${d}`);
2597
2597
  }
2598
2598
  }
2599
2599
  }
2600
- const i = u.attrName(e, "fetch"), n = t.hasAttribute(i);
2601
- n && (r.fetchUrl = t.getAttribute(i));
2602
- const s = {};
2600
+ const s = c.attrName(e, "fetch"), n = t.hasAttribute(s);
2601
+ n && (r.fetchUrl = t.getAttribute(s));
2602
+ const i = {};
2603
2603
  if (e) {
2604
- const c = u.attrName(e, "fetch-method");
2605
- t.hasAttribute(c) && (s.method = t.getAttribute(
2606
- c
2604
+ const h = c.attrName(e, "fetch-method");
2605
+ t.hasAttribute(h) && (i.method = t.getAttribute(
2606
+ h
2607
2607
  ));
2608
2608
  } else {
2609
- const c = u.attrName(null, "method", !0);
2610
- t.hasAttribute(c) && (s.method = t.getAttribute(
2611
- c
2609
+ const h = c.attrName(null, "method", !0);
2610
+ t.hasAttribute(h) && (i.method = t.getAttribute(
2611
+ h
2612
2612
  ));
2613
2613
  }
2614
2614
  if (e) {
2615
- const c = u.attrName(e, "fetch-headers");
2616
- if (t.hasAttribute(c)) {
2617
- const f = t.getRawAttribute(
2618
- c
2615
+ const h = c.attrName(e, "fetch-headers");
2616
+ if (t.hasAttribute(h)) {
2617
+ const d = t.getRawAttribute(
2618
+ h
2619
2619
  );
2620
2620
  try {
2621
- s.headers = R.parseDataBind(f);
2622
- } catch (m) {
2623
- d.error("Haori", `Invalid fetch headers: ${m}`);
2621
+ i.headers = P.parseDataBind(d);
2622
+ } catch (b) {
2623
+ f.error("Haori", `Invalid fetch headers: ${b}`);
2624
2624
  }
2625
2625
  }
2626
2626
  } else {
2627
- const c = u.attrName(
2627
+ const h = c.attrName(
2628
2628
  null,
2629
2629
  "headers",
2630
2630
  !0
2631
2631
  );
2632
- if (t.hasAttribute(c)) {
2633
- const f = t.getRawAttribute(
2634
- c
2632
+ if (t.hasAttribute(h)) {
2633
+ const d = t.getRawAttribute(
2634
+ h
2635
2635
  );
2636
2636
  try {
2637
- s.headers = R.parseDataBind(f);
2638
- } catch (m) {
2639
- d.error("Haori", `Invalid fetch headers: ${m}`);
2637
+ i.headers = P.parseDataBind(d);
2638
+ } catch (b) {
2639
+ f.error("Haori", `Invalid fetch headers: ${b}`);
2640
2640
  }
2641
2641
  }
2642
2642
  }
2643
2643
  if (e) {
2644
- const c = u.attrName(
2644
+ const h = c.attrName(
2645
2645
  e,
2646
2646
  "fetch-content-type"
2647
2647
  );
2648
- if (t.hasAttribute(c))
2649
- s.headers = {
2650
- ...s.headers,
2651
- "Content-Type": t.getAttribute(c)
2648
+ if (t.hasAttribute(h))
2649
+ i.headers = {
2650
+ ...i.headers,
2651
+ "Content-Type": t.getAttribute(h)
2652
2652
  };
2653
- else if (s.method && s.method !== "GET" && s.method !== "HEAD" && s.method !== "OPTIONS") {
2654
- let f = !1;
2655
- s.headers && typeof s.headers == "object" && (f = "Content-Type" in s.headers), f || (s.headers = {
2656
- ...s.headers,
2653
+ else if (i.method && i.method !== "GET" && i.method !== "HEAD" && i.method !== "OPTIONS") {
2654
+ let d = !1;
2655
+ i.headers && typeof i.headers == "object" && (d = "Content-Type" in i.headers), d || (i.headers = {
2656
+ ...i.headers,
2657
2657
  "Content-Type": "application/json"
2658
2658
  });
2659
- } else s.method && (s.method === "GET" || s.method === "HEAD" || s.method === "OPTIONS") && (s.headers = {
2660
- ...s.headers,
2659
+ } else i.method && (i.method === "GET" || i.method === "HEAD" || i.method === "OPTIONS") && (i.headers = {
2660
+ ...i.headers,
2661
2661
  "Content-Type": "application/x-www-form-urlencoded"
2662
2662
  });
2663
2663
  } else {
2664
- const c = u.attrName(
2664
+ const h = c.attrName(
2665
2665
  null,
2666
2666
  "content-type",
2667
2667
  !0
2668
2668
  );
2669
- if (t.hasAttribute(c))
2670
- s.headers = {
2671
- ...s.headers,
2672
- "Content-Type": t.getAttribute(c)
2669
+ if (t.hasAttribute(h))
2670
+ i.headers = {
2671
+ ...i.headers,
2672
+ "Content-Type": t.getAttribute(h)
2673
2673
  };
2674
- else if (s.method && s.method !== "GET" && s.method !== "HEAD" && s.method !== "OPTIONS") {
2675
- let f = !1;
2676
- s.headers && typeof s.headers == "object" && (f = "Content-Type" in s.headers), f || (s.headers = {
2677
- ...s.headers,
2674
+ else if (i.method && i.method !== "GET" && i.method !== "HEAD" && i.method !== "OPTIONS") {
2675
+ let d = !1;
2676
+ i.headers && typeof i.headers == "object" && (d = "Content-Type" in i.headers), d || (i.headers = {
2677
+ ...i.headers,
2678
2678
  "Content-Type": "application/json"
2679
2679
  });
2680
- } else s.method && (s.method === "GET" || s.method === "HEAD" || s.method === "OPTIONS") && (s.headers = {
2681
- ...s.headers,
2680
+ } else i.method && (i.method === "GET" || i.method === "HEAD" || i.method === "OPTIONS") && (i.headers = {
2681
+ ...i.headers,
2682
2682
  "Content-Type": "application/x-www-form-urlencoded"
2683
2683
  });
2684
2684
  }
2685
- Object.keys(s).length > 0 && (r.fetchOptions = s);
2686
- const a = e ? u.attrName(e, "bind") : u.attrName(null, "bind", !0);
2685
+ Object.keys(i).length > 0 && (r.fetchOptions = i);
2686
+ const a = e ? c.attrName(e, "bind") : c.attrName(null, "bind", !0);
2687
2687
  if (t.hasAttribute(a)) {
2688
- const c = t.getRawAttribute(a);
2689
- if (c) {
2690
- const f = document.body.querySelectorAll(c);
2691
- f.length > 0 ? (r.bindFragments = [], f.forEach((m) => {
2692
- const A = w.get(m);
2693
- A && r.bindFragments.push(A);
2694
- })) : d.error(
2688
+ const h = t.getRawAttribute(a);
2689
+ if (h) {
2690
+ const d = document.body.querySelectorAll(h);
2691
+ d.length > 0 ? (r.bindFragments = [], d.forEach((b) => {
2692
+ const E = w.get(b);
2693
+ E && r.bindFragments.push(E);
2694
+ })) : f.error(
2695
2695
  "Haori",
2696
- `Bind element not found: ${c} (${a})`
2696
+ `Bind element not found: ${h} (${a})`
2697
2697
  );
2698
2698
  }
2699
2699
  }
2700
- const o = u.attrName(e, "bind-arg"), h = u.attrName(
2700
+ const o = c.attrName(e, "bind-arg"), l = c.attrName(
2701
2701
  null,
2702
2702
  "arg",
2703
2703
  !0
2704
- ), b = u.attrName(
2704
+ ), m = c.attrName(
2705
2705
  null,
2706
2706
  "bind-arg",
2707
2707
  !0
2708
2708
  );
2709
- e ? t.hasAttribute(o) && (r.bindArg = t.getRawAttribute(o)) : t.hasAttribute(h) ? r.bindArg = t.getRawAttribute(
2710
- h
2711
- ) : t.hasAttribute(b) && (r.bindArg = t.getRawAttribute(b));
2712
- const g = e ? u.attrName(e, "bind-params") : u.attrName(null, "bind-params", !0);
2709
+ e ? t.hasAttribute(o) && (r.bindArg = t.getRawAttribute(o)) : t.hasAttribute(l) ? r.bindArg = t.getRawAttribute(
2710
+ l
2711
+ ) : t.hasAttribute(m) && (r.bindArg = t.getRawAttribute(m));
2712
+ const g = e ? c.attrName(e, "bind-params") : c.attrName(null, "bind-params", !0);
2713
2713
  if (t.hasAttribute(g)) {
2714
- const c = t.getRawAttribute(g);
2715
- r.bindParams = c.split("&").map((f) => f.trim());
2714
+ const h = t.getRawAttribute(g);
2715
+ r.bindParams = h.split("&").map((d) => d.trim());
2716
2716
  }
2717
- const E = e ? u.attrName(e, "bind-append") : u.attrName(null, "bind-append", !0);
2718
- if (t.hasAttribute(E)) {
2719
- const c = t.getRawAttribute(E);
2720
- r.bindAppendParams = c.split("&").map((f) => f.trim()).filter(Boolean);
2717
+ const T = e ? c.attrName(e, "bind-append") : c.attrName(null, "bind-append", !0);
2718
+ if (t.hasAttribute(T)) {
2719
+ const h = t.getRawAttribute(T);
2720
+ r.bindAppendParams = h.split("&").map((d) => d.trim()).filter(Boolean);
2721
2721
  }
2722
- const v = e ? u.attrName(e, "copy-params") : null;
2722
+ const v = e ? c.attrName(e, "copy-params") : null;
2723
2723
  if (v && t.hasAttribute(v)) {
2724
- const c = t.getRawAttribute(
2724
+ const h = t.getRawAttribute(
2725
2725
  v
2726
2726
  );
2727
- r.copyParams = c.split("&").map((f) => f.trim()).filter(Boolean);
2727
+ r.copyParams = h.split("&").map((d) => d.trim()).filter(Boolean);
2728
2728
  }
2729
2729
  if (e) {
2730
- if (t.hasAttribute(u.attrName(e, "adjust"))) {
2731
- const f = t.getRawAttribute(
2732
- u.attrName(e, "adjust")
2730
+ if (t.hasAttribute(c.attrName(e, "adjust"))) {
2731
+ const d = t.getRawAttribute(
2732
+ c.attrName(e, "adjust")
2733
2733
  );
2734
- if (f) {
2735
- const m = document.body.querySelectorAll(f);
2736
- m.length > 0 ? (r.adjustFragments = [], m.forEach((A) => {
2737
- const T = w.get(A);
2738
- T && r.adjustFragments.push(T);
2739
- })) : d.error(
2734
+ if (d) {
2735
+ const b = document.body.querySelectorAll(d);
2736
+ b.length > 0 ? (r.adjustFragments = [], b.forEach((E) => {
2737
+ const y = w.get(E);
2738
+ y && r.adjustFragments.push(y);
2739
+ })) : f.error(
2740
2740
  "Haori",
2741
- `Adjust element not found: ${f} (${u.attrName(e, "adjust")})`
2741
+ `Adjust element not found: ${d} (${c.attrName(e, "adjust")})`
2742
2742
  );
2743
2743
  }
2744
- if (t.hasAttribute(u.attrName(e, "adjust-value"))) {
2745
- const m = t.getRawAttribute(
2746
- u.attrName(e, "adjust-value")
2747
- ), A = Number(m);
2748
- isNaN(A) || (r.adjustValue = A);
2744
+ if (t.hasAttribute(c.attrName(e, "adjust-value"))) {
2745
+ const b = t.getRawAttribute(
2746
+ c.attrName(e, "adjust-value")
2747
+ ), E = Number(b);
2748
+ isNaN(E) || (r.adjustValue = E);
2749
2749
  }
2750
2750
  }
2751
- if (t.hasAttribute(u.attrName(e, "row-add")) && (r.rowAdd = !0), t.hasAttribute(u.attrName(e, "row-remove")) && (r.rowRemove = !0), t.hasAttribute(u.attrName(e, "row-prev")) && (r.rowMovePrev = !0), t.hasAttribute(u.attrName(e, "row-next")) && (r.rowMoveNext = !0), t.hasAttribute(`${l.prefix}${e}-after-run`)) {
2752
- const f = t.getRawAttribute(
2753
- `${l.prefix}${e}-after-run`
2751
+ if (t.hasAttribute(c.attrName(e, "row-add")) && (r.rowAdd = !0), t.hasAttribute(c.attrName(e, "row-remove")) && (r.rowRemove = !0), t.hasAttribute(c.attrName(e, "row-prev")) && (r.rowMovePrev = !0), t.hasAttribute(c.attrName(e, "row-next")) && (r.rowMoveNext = !0), t.hasAttribute(`${u.prefix}${e}-after-run`)) {
2752
+ const d = t.getRawAttribute(
2753
+ `${u.prefix}${e}-after-run`
2754
2754
  );
2755
2755
  try {
2756
2756
  r.afterCallback = new Function(
2757
2757
  "response",
2758
2758
  `
2759
2759
  "use strict";
2760
- ${f}
2760
+ ${d}
2761
2761
  `
2762
2762
  );
2763
- } catch (m) {
2764
- d.error("Haori", `Invalid after script: ${m}`);
2763
+ } catch (b) {
2764
+ f.error("Haori", `Invalid after script: ${b}`);
2765
2765
  }
2766
2766
  }
2767
- if (t.hasAttribute(u.attrName(e, "dialog")) && (r.dialogMessage = t.getAttribute(
2768
- u.attrName(e, "dialog")
2767
+ if (t.hasAttribute(c.attrName(e, "dialog")) && (r.dialogMessage = t.getAttribute(
2768
+ c.attrName(e, "dialog")
2769
2769
  ).replace(/\\n/g, `
2770
- `)), t.hasAttribute(u.attrName(e, "toast"))) {
2770
+ `)), t.hasAttribute(c.attrName(e, "toast"))) {
2771
2771
  r.toastMessage = t.getAttribute(
2772
- u.attrName(e, "toast")
2772
+ c.attrName(e, "toast")
2773
2773
  );
2774
- const f = t.getRawAttribute(
2775
- u.attrName(e, "toast-level")
2776
- ), A = ["info", "warning", "error", "success"].includes(f);
2777
- r.toastLevel = A ? f : null;
2774
+ const d = t.getRawAttribute(
2775
+ c.attrName(e, "toast-level")
2776
+ ), E = ["info", "warning", "error", "success"].includes(d);
2777
+ r.toastLevel = E ? d : null;
2778
2778
  }
2779
- if (t.hasAttribute(u.attrName(e, "redirect")) && (r.redirectUrl = t.getAttribute(
2780
- u.attrName(e, "redirect")
2781
- )), t.hasAttribute(u.attrName(e, "scroll-error")) && (r.scrollOnError = !0), t.hasAttribute(u.attrName(e, "scroll")) && (r.scrollTarget = t.getAttribute(
2782
- u.attrName(e, "scroll")
2783
- )), t.hasAttribute(u.attrName(e, "history")) && (r.historyUrl = t.getAttribute(
2784
- u.attrName(e, "history")
2785
- )), t.hasAttribute(u.attrName(e, "history-data")) && (r.historyData = u.resolveDataAttribute(
2779
+ if (t.hasAttribute(c.attrName(e, "redirect")) && (r.redirectUrl = t.getAttribute(
2780
+ c.attrName(e, "redirect")
2781
+ )), t.hasAttribute(c.attrName(e, "scroll-error")) && (r.scrollOnError = !0), t.hasAttribute(c.attrName(e, "scroll")) && (r.scrollTarget = t.getAttribute(
2782
+ c.attrName(e, "scroll")
2783
+ )), t.hasAttribute(c.attrName(e, "history")) && (r.historyUrl = t.getAttribute(
2784
+ c.attrName(e, "history")
2785
+ )), t.hasAttribute(c.attrName(e, "history-data")) && (r.historyData = c.resolveDataAttribute(
2786
2786
  t,
2787
- u.attrName(e, "history-data")
2788
- )), t.hasAttribute(u.attrName(e, "history-form"))) {
2789
- const f = t.getRawAttribute(
2790
- u.attrName(e, "history-form")
2787
+ c.attrName(e, "history-data")
2788
+ )), t.hasAttribute(c.attrName(e, "history-form"))) {
2789
+ const d = t.getRawAttribute(
2790
+ c.attrName(e, "history-form")
2791
2791
  );
2792
- if (f) {
2793
- const m = document.body.querySelector(f);
2794
- m !== null ? r.historyFormFragment = y.getFormFragment(
2795
- w.get(m)
2796
- ) : d.error(
2792
+ if (d) {
2793
+ const b = document.body.querySelector(d);
2794
+ b !== null ? r.historyFormFragment = A.getFormFragment(
2795
+ w.get(b)
2796
+ ) : f.error(
2797
2797
  "Haori",
2798
- `Form element not found: ${f} (${u.attrName(e, "history-form")})`
2798
+ `Form element not found: ${d} (${c.attrName(e, "history-form")})`
2799
2799
  );
2800
2800
  } else
2801
- r.historyFormFragment = y.getFormFragment(t);
2801
+ r.historyFormFragment = A.getFormFragment(t);
2802
2802
  }
2803
2803
  [
2804
2804
  "reset",
@@ -2807,54 +2807,54 @@ ${f}
2807
2807
  "copy",
2808
2808
  "open",
2809
2809
  "close"
2810
- ].forEach((f) => {
2811
- const m = u.attrName(e, f);
2812
- if (!t.hasAttribute(m))
2810
+ ].forEach((d) => {
2811
+ const b = c.attrName(e, d);
2812
+ if (!t.hasAttribute(b))
2813
2813
  return;
2814
- const A = t.getRawAttribute(m), T = [];
2815
- if (A ? (document.body.querySelectorAll(A).forEach((J) => {
2814
+ const E = t.getRawAttribute(b), y = [];
2815
+ if (E ? (document.body.querySelectorAll(E).forEach((J) => {
2816
2816
  const tt = w.get(J);
2817
- tt && T.push(tt);
2818
- }), T.length === 0 && d.error("Haori", `Element not found: ${A} (${m})`)) : T.push(t), T.length > 0)
2819
- switch (f) {
2817
+ tt && y.push(tt);
2818
+ }), y.length === 0 && f.error("Haori", `Element not found: ${E} (${b})`)) : y.push(t), y.length > 0)
2819
+ switch (d) {
2820
2820
  case "reset":
2821
- r.resetFragments = T;
2821
+ r.resetFragments = y;
2822
2822
  break;
2823
2823
  case "refetch":
2824
- r.refetchFragments = T;
2824
+ r.refetchFragments = y;
2825
2825
  break;
2826
2826
  case "click":
2827
- r.clickFragments = T;
2827
+ r.clickFragments = y;
2828
2828
  break;
2829
2829
  case "copy":
2830
- r.copyFragments = T;
2830
+ r.copyFragments = y;
2831
2831
  break;
2832
2832
  case "open":
2833
- r.openFragments = T;
2833
+ r.openFragments = y;
2834
2834
  break;
2835
2835
  case "close":
2836
- r.closeFragments = T;
2836
+ r.closeFragments = y;
2837
2837
  break;
2838
2838
  }
2839
2839
  });
2840
2840
  }
2841
- if (!e && (t.hasAttribute(u.attrName(null, "data", !0)) && (r.data = u.resolveDataAttribute(
2841
+ if (!e && (t.hasAttribute(c.attrName(null, "data", !0)) && (r.data = c.resolveDataAttribute(
2842
2842
  t,
2843
- u.attrName(null, "data", !0)
2844
- )), t.hasAttribute(u.attrName(null, "form", !0)))) {
2845
- const c = t.getRawAttribute(
2846
- u.attrName(null, "form", !0)
2843
+ c.attrName(null, "data", !0)
2844
+ )), t.hasAttribute(c.attrName(null, "form", !0)))) {
2845
+ const h = t.getRawAttribute(
2846
+ c.attrName(null, "form", !0)
2847
2847
  );
2848
- if (c) {
2849
- const f = document.body.querySelector(c);
2850
- f !== null ? r.formFragment = y.getFormFragment(
2851
- w.get(f)
2852
- ) : d.error(
2848
+ if (h) {
2849
+ const d = document.body.querySelector(h);
2850
+ d !== null ? r.formFragment = A.getFormFragment(
2851
+ w.get(d)
2852
+ ) : f.error(
2853
2853
  "Haori",
2854
- `Form element not found: ${c} (${u.attrName(null, "fetch-form", !0)})`
2854
+ `Form element not found: ${h} (${c.attrName(null, "fetch-form", !0)})`
2855
2855
  );
2856
2856
  } else
2857
- r.formFragment = y.getFormFragment(t);
2857
+ r.formFragment = A.getFormFragment(t);
2858
2858
  }
2859
2859
  return n && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [t]), r;
2860
2860
  }
@@ -2877,7 +2877,7 @@ ${f}
2877
2877
  * @param arg2 イベント名
2878
2878
  */
2879
2879
  constructor(t, e = null) {
2880
- u.isElementFragment(t) ? this.options = u.buildOptions(t, e) : this.options = t;
2880
+ c.isElementFragment(t) ? (this.options = c.buildOptions(t, e), this.eventType = e) : (this.options = t, this.eventType = null);
2881
2881
  }
2882
2882
  /**
2883
2883
  * 一連の処理を実行します。オプションが空の場合は即座にresolveされます。
@@ -2902,106 +2902,136 @@ ${f}
2902
2902
  * @returns 実行成功時は true、停止や失敗時は false
2903
2903
  */
2904
2904
  async execute() {
2905
- if (Object.keys(this.options).length === 0 || this.options.formFragment && this.validate(this.options.formFragment) === !1 || !await this.confirm())
2905
+ const t = this.acquireExecutionLock();
2906
+ if (t === !1)
2906
2907
  return !1;
2907
- let e = this.options.fetchUrl, r = this.options.fetchOptions;
2908
- if (this.options.beforeCallback) {
2909
- const o = this.options.beforeCallback(
2910
- e || null,
2911
- r || null
2912
- );
2913
- if (o != null) {
2914
- if (o === !1 || typeof o == "object" && o.stop)
2915
- return !1;
2916
- typeof o == "object" && (e = "fetchUrl" in o ? o.fetchUrl : e, r = "fetchOptions" in o ? o.fetchOptions : r);
2908
+ try {
2909
+ if (Object.keys(this.options).length === 0 || this.options.formFragment && this.validate(this.options.formFragment) === !1 || !await this.confirm())
2910
+ return !1;
2911
+ let r = this.options.fetchUrl, s = this.options.fetchOptions;
2912
+ if (this.options.beforeCallback) {
2913
+ const l = this.options.beforeCallback(
2914
+ r || null,
2915
+ s || null
2916
+ );
2917
+ if (l != null) {
2918
+ if (l === !1 || typeof l == "object" && l.stop)
2919
+ return !1;
2920
+ typeof l == "object" && (r = "fetchUrl" in l ? l.fetchUrl : r, s = "fetchOptions" in l ? l.fetchOptions : s);
2921
+ }
2917
2922
  }
2918
- }
2919
- const i = {};
2920
- if (this.options.formFragment) {
2921
- const o = y.getValues(this.options.formFragment);
2922
- Object.assign(i, o);
2923
- }
2924
- this.options.data && typeof this.options.data == "object" && Object.assign(i, this.options.data);
2925
- const n = Object.keys(i).length > 0;
2926
- if (e) {
2927
- const o = { ...r || {} }, h = new Headers(
2928
- o.headers || void 0
2929
- ), b = (o.method || "GET").toUpperCase(), g = l.runtime === "demo" && !ut(b), E = g ? "GET" : b;
2930
- if (o.method = E, E === "GET" || E === "HEAD" || E === "OPTIONS")
2931
- n && (e = ht(e, i));
2932
- else if (n) {
2933
- const c = h.get("Content-Type") || "";
2934
- if (/multipart\/form-data/i.test(c)) {
2935
- h.delete("Content-Type");
2936
- const f = new FormData();
2937
- for (const [m, A] of Object.entries(i))
2938
- A == null ? f.append(m, "") : A instanceof Blob ? f.append(m, A) : Array.isArray(A) ? A.forEach((T) => f.append(m, String(T))) : typeof A == "object" ? f.append(m, JSON.stringify(A)) : f.append(m, String(A));
2939
- o.body = f;
2940
- } else if (/application\/x-www-form-urlencoded/i.test(c)) {
2941
- const f = new URLSearchParams();
2942
- for (const [m, A] of Object.entries(i))
2943
- A !== void 0 && (A === null ? f.append(m, "") : Array.isArray(A) ? A.forEach((T) => f.append(m, String(T))) : typeof A == "object" ? f.append(m, JSON.stringify(A)) : f.append(m, String(A)));
2944
- o.body = f;
2945
- } else
2946
- h.set("Content-Type", "application/json"), o.body = JSON.stringify(i);
2923
+ const n = {};
2924
+ if (this.options.formFragment) {
2925
+ const l = A.getValues(this.options.formFragment);
2926
+ Object.assign(n, l);
2947
2927
  }
2948
- o.headers = h;
2949
- let v;
2950
- if (g && (v = e && new URL(e, window.location.href).search || void 0, h.delete("Content-Type"), d.info("Haori demo fetch normalization", {
2951
- runtime: l.runtime,
2952
- requestedMethod: b,
2953
- effectiveMethod: E,
2954
- transportMode: "query-get",
2955
- url: e,
2956
- payload: n ? i : void 0,
2957
- queryString: v
2958
- })), this.options.targetFragment && e) {
2959
- const c = performance.now(), f = {
2960
- runtime: l.runtime,
2961
- requestedMethod: b,
2962
- effectiveMethod: E,
2963
- transportMode: g ? "query-get" : "http",
2964
- ...g ? { queryString: v } : {}
2965
- };
2966
- return N.fetchStart(
2967
- this.options.targetFragment.getTarget(),
2968
- e,
2969
- o,
2970
- n ? i : void 0,
2971
- f
2972
- ), fetch(e, o).then((m) => this.handleFetchResult(
2973
- m,
2974
- e || void 0,
2975
- c
2976
- )).catch((m) => {
2977
- throw e && N.fetchError(
2928
+ this.options.data && typeof this.options.data == "object" && Object.assign(n, this.options.data);
2929
+ const i = Object.keys(n).length > 0;
2930
+ if (r) {
2931
+ const l = { ...s || {} }, m = new Headers(
2932
+ l.headers || void 0
2933
+ ), g = (l.method || "GET").toUpperCase(), T = u.runtime === "demo" && !ut(g), v = T ? "GET" : g;
2934
+ if (l.method = v, v === "GET" || v === "HEAD" || v === "OPTIONS")
2935
+ i && (r = ht(r, n));
2936
+ else if (i) {
2937
+ const d = m.get("Content-Type") || "";
2938
+ if (/multipart\/form-data/i.test(d)) {
2939
+ m.delete("Content-Type");
2940
+ const b = new FormData();
2941
+ for (const [E, y] of Object.entries(n))
2942
+ y == null ? b.append(E, "") : y instanceof Blob ? b.append(E, y) : Array.isArray(y) ? y.forEach((D) => b.append(E, String(D))) : typeof y == "object" ? b.append(E, JSON.stringify(y)) : b.append(E, String(y));
2943
+ l.body = b;
2944
+ } else if (/application\/x-www-form-urlencoded/i.test(d)) {
2945
+ const b = new URLSearchParams();
2946
+ for (const [E, y] of Object.entries(n))
2947
+ y !== void 0 && (y === null ? b.append(E, "") : Array.isArray(y) ? y.forEach((D) => b.append(E, String(D))) : typeof y == "object" ? b.append(E, JSON.stringify(y)) : b.append(E, String(y)));
2948
+ l.body = b;
2949
+ } else
2950
+ m.set("Content-Type", "application/json"), l.body = JSON.stringify(n);
2951
+ }
2952
+ l.headers = m;
2953
+ let h;
2954
+ if (T && (h = r && new URL(r, window.location.href).search || void 0, m.delete("Content-Type"), f.info("Haori demo fetch normalization", {
2955
+ runtime: u.runtime,
2956
+ requestedMethod: g,
2957
+ effectiveMethod: v,
2958
+ transportMode: "query-get",
2959
+ url: r,
2960
+ payload: i ? n : void 0,
2961
+ queryString: h
2962
+ })), this.options.targetFragment && r) {
2963
+ const d = performance.now(), b = {
2964
+ runtime: u.runtime,
2965
+ requestedMethod: g,
2966
+ effectiveMethod: v,
2967
+ transportMode: T ? "query-get" : "http",
2968
+ ...T ? { queryString: h } : {}
2969
+ };
2970
+ return N.fetchStart(
2978
2971
  this.options.targetFragment.getTarget(),
2979
- e,
2980
- m
2981
- ), m;
2982
- });
2972
+ r,
2973
+ l,
2974
+ i ? n : void 0,
2975
+ b
2976
+ ), fetch(r, l).then((E) => this.handleFetchResult(
2977
+ E,
2978
+ r || void 0,
2979
+ d
2980
+ )).catch((E) => {
2981
+ throw r && N.fetchError(
2982
+ this.options.targetFragment.getTarget(),
2983
+ r,
2984
+ E
2985
+ ), E;
2986
+ });
2987
+ }
2988
+ return fetch(r, l).then((d) => this.handleFetchResult(d, r || void 0));
2983
2989
  }
2984
- return fetch(e, o).then((c) => this.handleFetchResult(c, e || void 0));
2985
- }
2986
- if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && n) {
2987
- const o = this.options.formFragment, h = o.getTarget();
2988
- h.setAttribute(
2989
- `${l.prefix}bind`,
2990
- JSON.stringify(i)
2991
- );
2992
- const b = o.getBindingData();
2993
- Object.assign(b, i), await R.setBindingData(h, b);
2990
+ if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && i) {
2991
+ const l = this.options.formFragment, m = l.getTarget();
2992
+ m.setAttribute(
2993
+ `${u.prefix}bind`,
2994
+ JSON.stringify(n)
2995
+ );
2996
+ const g = l.getBindingData();
2997
+ Object.assign(g, n), await P.setBindingData(m, g);
2998
+ }
2999
+ const a = i ? n : {}, o = new Response(JSON.stringify(a), {
3000
+ headers: { "Content-Type": "application/json" }
3001
+ });
3002
+ return this.handleFetchResult(o);
3003
+ } finally {
3004
+ this.releaseExecutionLock(t);
2994
3005
  }
2995
- const s = n ? i : {}, a = new Response(JSON.stringify(s), {
2996
- headers: { "Content-Type": "application/json" }
3006
+ }
3007
+ /**
3008
+ * click 手続きの重複実行を防ぐためのロックを取得します。
3009
+ *
3010
+ * @returns ロック情報。取得不要なら null、取得失敗なら false。
3011
+ */
3012
+ acquireExecutionLock() {
3013
+ if (this.eventType !== "click" || !this.options.targetFragment)
3014
+ return null;
3015
+ const t = this.options.targetFragment.getTarget();
3016
+ return c.RUNNING_CLICK_TARGETS.has(t) || t.hasAttribute("disabled") ? !1 : (c.RUNNING_CLICK_TARGETS.add(t), t.setAttribute("disabled", ""), {
3017
+ target: t,
3018
+ appliedDisabledAttribute: !0
2997
3019
  });
2998
- return this.handleFetchResult(a);
3020
+ }
3021
+ /**
3022
+ * 取得済みの実行ロックを解放します。
3023
+ *
3024
+ * @param executionLock 解放対象のロック情報。
3025
+ * @returns 戻り値はありません。
3026
+ */
3027
+ releaseExecutionLock(t) {
3028
+ t && (c.RUNNING_CLICK_TARGETS.delete(t.target), t.appliedDisabledAttribute && t.target.removeAttribute("disabled"));
2999
3029
  }
3000
3030
  /**
3001
3031
  * フェッチ後の処理を実行します。
3002
3032
  */
3003
3033
  async handleFetchResult(t, e, r) {
3004
- const i = W();
3034
+ const s = W();
3005
3035
  if (!t.ok)
3006
3036
  return this.options.targetFragment && e && N.fetchError(
3007
3037
  this.options.targetFragment.getTarget(),
@@ -3025,11 +3055,11 @@ ${f}
3025
3055
  }
3026
3056
  const n = [];
3027
3057
  n.push(this.bindResult(t)), n.push(this.adjust()), n.push(this.addRow()), n.push(this.removeRow()), n.push(this.movePrevRow()), n.push(this.moveNextRow()), await Promise.all(n), this.options.resetFragments && this.options.resetFragments.length > 0 && await Promise.all(
3028
- this.options.resetFragments.map((a) => y.reset(a))
3058
+ this.options.resetFragments.map((a) => A.reset(a))
3029
3059
  ), await this.copy();
3030
- const s = [];
3060
+ const i = [];
3031
3061
  return this.options.refetchFragments && this.options.refetchFragments.length > 0 && this.options.refetchFragments.forEach((a) => {
3032
- s.push(new u(a, null).run());
3062
+ i.push(new c(a, null).run());
3033
3063
  }), this.options.clickFragments && this.options.clickFragments.length > 0 && this.options.clickFragments.forEach((a) => {
3034
3064
  const o = a.getTarget();
3035
3065
  typeof o.click == "function" ? o.click() : o.dispatchEvent(
@@ -3037,11 +3067,11 @@ ${f}
3037
3067
  );
3038
3068
  }), this.options.openFragments && this.options.openFragments.length > 0 && this.options.openFragments.forEach((a) => {
3039
3069
  const o = a.getTarget();
3040
- o instanceof HTMLElement ? s.push(i.openDialog(o)) : d.error("Haori", "Element is not an HTML element: ", o);
3070
+ o instanceof HTMLElement ? i.push(s.openDialog(o)) : f.error("Haori", "Element is not an HTML element: ", o);
3041
3071
  }), this.options.closeFragments && this.options.closeFragments.length > 0 && this.options.closeFragments.forEach((a) => {
3042
3072
  const o = a.getTarget();
3043
- o instanceof HTMLElement ? s.push(i.closeDialog(o)) : d.error("Haori", "Element is not an HTML element: ", o);
3044
- }), await Promise.all(s), this.options.dialogMessage && await i.dialog(this.options.dialogMessage), this.options.toastMessage && await i.toast(
3073
+ o instanceof HTMLElement ? i.push(s.closeDialog(o)) : f.error("Haori", "Element is not an HTML element: ", o);
3074
+ }), await Promise.all(i), this.options.dialogMessage && await s.dialog(this.options.dialogMessage), this.options.toastMessage && await s.toast(
3045
3075
  this.options.toastMessage,
3046
3076
  this.options.toastLevel ?? "info"
3047
3077
  ), this.pushHistory(), this.options.scrollTarget && document.querySelector(this.options.scrollTarget)?.scrollIntoView({ behavior: "smooth", block: "nearest" }), this.options.redirectUrl && (window.location.href = this.options.redirectUrl), !0;
@@ -3057,21 +3087,21 @@ ${f}
3057
3087
  const t = this.options.historyUrl !== void 0 && this.options.historyUrl !== null, e = this.options.historyData !== void 0 && this.options.historyData !== null, r = this.options.historyFormFragment !== void 0 && this.options.historyFormFragment !== null;
3058
3088
  if (!(!t && !e && !r))
3059
3089
  try {
3060
- const i = t ? this.options.historyUrl : window.location.pathname, n = new URL(i, window.location.href);
3090
+ const s = t ? this.options.historyUrl : window.location.pathname, n = new URL(s, window.location.href);
3061
3091
  if (n.origin !== window.location.origin) {
3062
3092
  const a = "history.pushState: cross-origin URL is not allowed: " + n.toString();
3063
- d.error(
3093
+ f.error(
3064
3094
  "Haori",
3065
3095
  a
3066
3096
  );
3067
3097
  return;
3068
3098
  }
3069
- const s = (a) => {
3070
- for (const [o, h] of Object.entries(a))
3071
- h != null && (Array.isArray(h) ? h.forEach((b) => n.searchParams.append(o, String(b))) : typeof h == "object" ? n.searchParams.set(o, JSON.stringify(h)) : n.searchParams.set(o, String(h)));
3099
+ const i = (a) => {
3100
+ for (const [o, l] of Object.entries(a))
3101
+ l != null && (Array.isArray(l) ? l.forEach((m) => n.searchParams.append(o, String(m))) : typeof l == "object" ? n.searchParams.set(o, JSON.stringify(l)) : n.searchParams.set(o, String(l)));
3072
3102
  };
3073
- e && s(this.options.historyData), r && s(
3074
- y.getValues(
3103
+ e && i(this.options.historyData), r && i(
3104
+ A.getValues(
3075
3105
  this.options.historyFormFragment
3076
3106
  )
3077
3107
  ), history.pushState(
@@ -3079,8 +3109,8 @@ ${f}
3079
3109
  "",
3080
3110
  n.toString()
3081
3111
  );
3082
- } catch (i) {
3083
- d.error("Haori", `history.pushState failed: ${i}`);
3112
+ } catch (s) {
3113
+ f.error("Haori", `history.pushState failed: ${s}`);
3084
3114
  }
3085
3115
  }
3086
3116
  /**
@@ -3088,46 +3118,46 @@ ${f}
3088
3118
  */
3089
3119
  async handleFetchError(t) {
3090
3120
  let e = null;
3091
- this.options.formFragment ? e = this.options.formFragment : this.options.targetFragment && (e = y.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
3092
- const r = async (s) => {
3121
+ this.options.formFragment ? e = this.options.formFragment : this.options.targetFragment && (e = A.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
3122
+ const r = async (i) => {
3093
3123
  const a = e ? e.getTarget() : document.body;
3094
- await W().addErrorMessage(a, s);
3095
- }, i = () => {
3124
+ await W().addErrorMessage(a, i);
3125
+ }, s = () => {
3096
3126
  if (!this.options.scrollOnError)
3097
3127
  return;
3098
- const s = e ? e.getTarget() : document.body;
3099
- (s.getAttribute("data-message-level") === "error" ? s : s.parentElement?.getAttribute("data-message-level") === "error" ? s.parentElement : s.querySelector('[data-message-level="error"]'))?.scrollIntoView({ behavior: "smooth", block: "nearest" });
3128
+ const i = e ? e.getTarget() : document.body;
3129
+ (i.getAttribute("data-message-level") === "error" ? i : i.parentElement?.getAttribute("data-message-level") === "error" ? i.parentElement : i.querySelector('[data-message-level="error"]'))?.scrollIntoView({ behavior: "smooth", block: "nearest" });
3100
3130
  };
3101
3131
  if ((t.headers.get("Content-Type") || "").includes("application/json"))
3102
3132
  try {
3103
- const s = await t.json(), a = [];
3104
- if (s && typeof s == "object") {
3105
- if (typeof s.message == "string" && a.push({ message: s.message }), Array.isArray(s.messages))
3106
- for (const o of s.messages)
3133
+ const i = await t.json(), a = [];
3134
+ if (i && typeof i == "object") {
3135
+ if (typeof i.message == "string" && a.push({ message: i.message }), Array.isArray(i.messages))
3136
+ for (const o of i.messages)
3107
3137
  typeof o == "string" && a.push({ message: o });
3108
- if (s.errors && typeof s.errors == "object")
3109
- for (const [o, h] of Object.entries(s.errors))
3110
- Array.isArray(h) ? a.push({ key: o, message: h.join(`
3111
- `) }) : typeof h == "string" ? a.push({ key: o, message: h }) : h != null && a.push({ key: o, message: String(h) });
3138
+ if (i.errors && typeof i.errors == "object")
3139
+ for (const [o, l] of Object.entries(i.errors))
3140
+ Array.isArray(l) ? a.push({ key: o, message: l.join(`
3141
+ `) }) : typeof l == "string" ? a.push({ key: o, message: l }) : l != null && a.push({ key: o, message: String(l) });
3112
3142
  if (a.length === 0)
3113
- for (const [o, h] of Object.entries(s))
3114
- o === "message" || o === "messages" || o === "errors" || (Array.isArray(h) ? a.push({ key: o, message: h.join(`
3115
- `) }) : typeof h == "string" && a.push({ key: o, message: h }));
3143
+ for (const [o, l] of Object.entries(i))
3144
+ o === "message" || o === "messages" || o === "errors" || (Array.isArray(l) ? a.push({ key: o, message: l.join(`
3145
+ `) }) : typeof l == "string" && a.push({ key: o, message: l }));
3116
3146
  }
3117
3147
  if (a.length === 0)
3118
- return await r(`${t.status} ${t.statusText}`), i(), !1;
3148
+ return await r(`${t.status} ${t.statusText}`), s(), !1;
3119
3149
  for (const o of a)
3120
- o.key && e ? await y.addErrorMessage(e, o.key, o.message) : await r(o.message);
3121
- return i(), !1;
3150
+ o.key && e ? await A.addErrorMessage(e, o.key, o.message) : await r(o.message);
3151
+ return s(), !1;
3122
3152
  } catch {
3123
3153
  }
3124
3154
  try {
3125
- const s = await t.text();
3126
- s && s.trim().length > 0 ? await r(s.trim()) : await r(`${t.status} ${t.statusText}`);
3155
+ const i = await t.text();
3156
+ i && i.trim().length > 0 ? await r(i.trim()) : await r(`${t.status} ${t.statusText}`);
3127
3157
  } catch {
3128
3158
  await r(`${t.status} ${t.statusText}`);
3129
3159
  }
3130
- return i(), !1;
3160
+ return s(), !1;
3131
3161
  }
3132
3162
  /**
3133
3163
  * 対象のフラグメント以下の入力要素に対してバリデーションを実行します。
@@ -3152,8 +3182,8 @@ ${f}
3152
3182
  findFirstInvalid(t) {
3153
3183
  let e = null;
3154
3184
  for (const r of t.getChildElementFragments().reverse()) {
3155
- const i = this.findFirstInvalid(r);
3156
- i !== null && (e = i);
3185
+ const s = this.findFirstInvalid(r);
3186
+ s !== null && (e = s);
3157
3187
  }
3158
3188
  return this.checkOne(t) ? e : t.getTarget();
3159
3189
  }
@@ -3187,44 +3217,44 @@ ${f}
3187
3217
  return !this.options.bindFragments || this.options.bindFragments.length === 0 ? Promise.resolve() : (t.headers.get("Content-Type")?.includes("application/json") ? t.json() : t.text()).then((r) => {
3188
3218
  if (this.options.bindParams) {
3189
3219
  const n = {};
3190
- this.options.bindParams.forEach((s) => {
3191
- r && typeof r == "object" && s in r && (n[s] = r[s]);
3220
+ this.options.bindParams.forEach((i) => {
3221
+ r && typeof r == "object" && i in r && (n[i] = r[i]);
3192
3222
  }), r = n;
3193
3223
  }
3194
- const i = [];
3224
+ const s = [];
3195
3225
  if (this.options.bindArg)
3196
3226
  this.options.bindFragments.forEach((n) => {
3197
- const s = n.getBindingData(), a = this.options.bindArg;
3227
+ const i = n.getBindingData(), a = this.options.bindArg;
3198
3228
  if (r && typeof r == "object" && !Array.isArray(r)) {
3199
- const o = s[a], h = o && typeof o == "object" && !Array.isArray(o) ? o : {};
3200
- s[a] = this.mergeAppendBindingData(
3229
+ const o = i[a], l = o && typeof o == "object" && !Array.isArray(o) ? o : {};
3230
+ i[a] = this.mergeAppendBindingData(
3201
3231
  n,
3202
3232
  r,
3203
- h
3233
+ l
3204
3234
  );
3205
3235
  } else
3206
- s[a] = r;
3207
- i.push(R.setBindingData(n.getTarget(), s));
3236
+ i[a] = r;
3237
+ s.push(P.setBindingData(n.getTarget(), i));
3208
3238
  });
3209
3239
  else {
3210
3240
  if (typeof r == "string")
3211
- return d.error("Haori", "string data cannot be bound without a bindArg."), Promise.reject(
3241
+ return f.error("Haori", "string data cannot be bound without a bindArg."), Promise.reject(
3212
3242
  new Error("string data cannot be bound without a bindArg.")
3213
3243
  );
3214
3244
  this.options.bindFragments.forEach((n) => {
3215
- const s = this.mergeAppendBindingData(
3245
+ const i = this.mergeAppendBindingData(
3216
3246
  n,
3217
3247
  r
3218
3248
  );
3219
- i.push(
3220
- R.setBindingData(
3249
+ s.push(
3250
+ P.setBindingData(
3221
3251
  n.getTarget(),
3222
- s
3252
+ i
3223
3253
  )
3224
3254
  );
3225
3255
  });
3226
3256
  }
3227
- return Promise.all(i).then(() => {
3257
+ return Promise.all(s).then(() => {
3228
3258
  });
3229
3259
  });
3230
3260
  }
@@ -3234,12 +3264,12 @@ ${f}
3234
3264
  mergeAppendBindingData(t, e, r = t.getBindingData()) {
3235
3265
  if (!this.options.bindAppendParams || this.options.bindAppendParams.length === 0)
3236
3266
  return e;
3237
- const i = { ...e }, n = r;
3238
- for (const s of this.options.bindAppendParams) {
3239
- const a = i[s], o = n[s];
3240
- Array.isArray(o) && Array.isArray(a) && (i[s] = o.concat(a));
3267
+ const s = { ...e }, n = r;
3268
+ for (const i of this.options.bindAppendParams) {
3269
+ const a = s[i], o = n[i];
3270
+ Array.isArray(o) && Array.isArray(a) && (s[i] = o.concat(a));
3241
3271
  }
3242
- return i;
3272
+ return s;
3243
3273
  }
3244
3274
  /**
3245
3275
  * 指定されたフラグメントへバインディングデータをコピーします。
@@ -3247,12 +3277,12 @@ ${f}
3247
3277
  copy() {
3248
3278
  if (!this.options.copyFragments || this.options.copyFragments.length === 0)
3249
3279
  return Promise.resolve();
3250
- const t = this.resolveCopySourceData(), e = this.pickCopyData(t), r = this.options.copyFragments.map((i) => {
3280
+ const t = this.resolveCopySourceData(), e = this.pickCopyData(t), r = this.options.copyFragments.map((s) => {
3251
3281
  const n = {
3252
- ...i.getBindingData(),
3282
+ ...s.getBindingData(),
3253
3283
  ...e
3254
3284
  };
3255
- return R.setBindingData(i.getTarget(), n);
3285
+ return P.setBindingData(s.getTarget(), n);
3256
3286
  });
3257
3287
  return Promise.all(r).then(() => {
3258
3288
  });
@@ -3261,7 +3291,7 @@ ${f}
3261
3291
  * copy のコピー元データを取得します。
3262
3292
  */
3263
3293
  resolveCopySourceData() {
3264
- return this.options.formFragment ? y.getValues(this.options.formFragment) : this.options.targetFragment ? { ...this.options.targetFragment.getBindingData() } : {};
3294
+ return this.options.formFragment ? A.getValues(this.options.formFragment) : this.options.targetFragment ? { ...this.options.targetFragment.getBindingData() } : {};
3265
3295
  }
3266
3296
  /**
3267
3297
  * copy-params が指定されている場合は対象キーだけ抽出します。
@@ -3282,9 +3312,9 @@ ${f}
3282
3312
  return Promise.resolve();
3283
3313
  const t = this.options.adjustValue ?? 0, e = [];
3284
3314
  for (const r of this.options.adjustFragments) {
3285
- let i = r.getValue();
3286
- (i == null || i === "") && (i = "0");
3287
- let n = Number(i);
3315
+ let s = r.getValue();
3316
+ (s == null || s === "") && (s = "0");
3317
+ let n = Number(s);
3288
3318
  isNaN(n) && (n = 0), n += t, e.push(r.setValue(String(n)));
3289
3319
  }
3290
3320
  return Promise.all(e).then(() => {
@@ -3297,11 +3327,11 @@ ${f}
3297
3327
  */
3298
3328
  getRowFragment() {
3299
3329
  if (!this.options.targetFragment)
3300
- return d.error("Haori", "Target fragment is not specified for row operation."), null;
3330
+ return f.error("Haori", "Target fragment is not specified for row operation."), null;
3301
3331
  const t = this.options.targetFragment.closestByAttribute(
3302
- `${l.prefix}row`
3332
+ `${u.prefix}row`
3303
3333
  );
3304
- return t || (d.error("Haori", "Row fragment not found."), null);
3334
+ return t || (f.error("Haori", "Row fragment not found."), null);
3305
3335
  }
3306
3336
  /**
3307
3337
  * 行を追加します。
@@ -3317,7 +3347,7 @@ ${f}
3317
3347
  const e = [], r = t.clone();
3318
3348
  return e.push(
3319
3349
  t.getParent().insertAfter(r, t)
3320
- ), e.push(R.evaluateAll(r)), e.push(y.reset(r)), Promise.all(e).then(() => {
3350
+ ), e.push(P.evaluateAll(r)), e.push(A.reset(r)), Promise.all(e).then(() => {
3321
3351
  });
3322
3352
  }
3323
3353
  /**
@@ -3332,7 +3362,7 @@ ${f}
3332
3362
  if (!t)
3333
3363
  return Promise.reject(new Error("Row fragment not found."));
3334
3364
  const e = t.getParent();
3335
- return e && e.getChildElementFragments().filter((i) => !i.hasAttribute(`${l.prefix}each-before`) && !i.hasAttribute(`${l.prefix}each-after`)).length <= 1 ? Promise.resolve() : t.remove();
3365
+ return e && e.getChildElementFragments().filter((s) => !s.hasAttribute(`${u.prefix}each-before`) && !s.hasAttribute(`${u.prefix}each-after`)).length <= 1 ? Promise.resolve() : t.remove();
3336
3366
  }
3337
3367
  /**
3338
3368
  * 前の行へ移動します。
@@ -3369,8 +3399,8 @@ ${f}
3369
3399
  return r ? r.insertAfter(t, e) : Promise.resolve();
3370
3400
  }
3371
3401
  };
3372
- u.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, u.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/;
3373
- let V = u;
3402
+ c.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, c.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, c.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet();
3403
+ let V = c;
3374
3404
  class ft {
3375
3405
  /**
3376
3406
  * URLのクエリパラメータを取得します。
@@ -3379,8 +3409,8 @@ class ft {
3379
3409
  */
3380
3410
  static readParams() {
3381
3411
  const t = {}, e = window.location.search;
3382
- return new URLSearchParams(e).forEach((i, n) => {
3383
- t[n] = i;
3412
+ return new URLSearchParams(e).forEach((s, n) => {
3413
+ t[n] = s;
3384
3414
  }), t;
3385
3415
  }
3386
3416
  }
@@ -3402,23 +3432,23 @@ class dt {
3402
3432
  try {
3403
3433
  r = await fetch(t, e);
3404
3434
  } catch (n) {
3405
- throw d.error("[Haori]", "Failed to fetch import source:", t, n), new Error(`Failed to fetch: ${t}`);
3435
+ throw f.error("[Haori]", "Failed to fetch import source:", t, n), new Error(`Failed to fetch: ${t}`);
3406
3436
  }
3407
3437
  if (!r.ok) {
3408
3438
  const n = `${r.status} ${r.statusText}`;
3409
- throw d.error("[Haori]", "Import HTTP error:", t, n), new Error(`Failed to load ${t}: ${n}`);
3439
+ throw f.error("[Haori]", "Import HTTP error:", t, n), new Error(`Failed to load ${t}: ${n}`);
3410
3440
  }
3411
- let i;
3441
+ let s;
3412
3442
  try {
3413
- i = await r.text();
3443
+ s = await r.text();
3414
3444
  } catch (n) {
3415
- throw d.error("[Haori]", "Failed to read response text:", t, n), new Error(`Failed to read response from: ${t}`);
3445
+ throw f.error("[Haori]", "Failed to read response text:", t, n), new Error(`Failed to read response from: ${t}`);
3416
3446
  }
3417
3447
  try {
3418
- const s = new DOMParser().parseFromString(i, "text/html");
3419
- return s && s.body ? s.body.innerHTML : (d.warn("[Haori]", "No body found in imported document:", t), i);
3448
+ const i = new DOMParser().parseFromString(s, "text/html");
3449
+ return i && i.body ? i.body.innerHTML : (f.warn("[Haori]", "No body found in imported document:", t), s);
3420
3450
  } catch (n) {
3421
- return d.error("[Haori]", "Failed to parse imported HTML:", t, n), i;
3451
+ return f.error("[Haori]", "Failed to parse imported HTML:", t, n), s;
3422
3452
  }
3423
3453
  }
3424
3454
  }
@@ -3431,7 +3461,7 @@ const p = class p {
3431
3461
  */
3432
3462
  static isDeferredAttributeName(t) {
3433
3463
  return p.DEFERRED_ATTRIBUTE_SUFFIXES.some(
3434
- (e) => t === `${l.prefix}${e}`
3464
+ (e) => t === `${u.prefix}${e}`
3435
3465
  );
3436
3466
  }
3437
3467
  /**
@@ -3442,7 +3472,7 @@ const p = class p {
3442
3472
  */
3443
3473
  static isEvaluateAllExcludedAttributeName(t) {
3444
3474
  return p.EVALUATE_ALL_EXCLUDED_ATTRIBUTE_SUFFIXES.some(
3445
- (e) => t === `${l.prefix}${e}`
3475
+ (e) => t === `${u.prefix}${e}`
3446
3476
  );
3447
3477
  }
3448
3478
  /**
@@ -3462,7 +3492,7 @@ const p = class p {
3462
3492
  * @returns 実際の属性名。data-attr-* でない場合は null
3463
3493
  */
3464
3494
  static getAliasedAttributeName(t) {
3465
- const e = `${l.prefix}${p.ATTRIBUTE_ALIAS_SUFFIX}`;
3495
+ const e = `${u.prefix}${p.ATTRIBUTE_ALIAS_SUFFIX}`;
3466
3496
  return !t.startsWith(e) || t.length <= e.length ? null : t.slice(e.length);
3467
3497
  }
3468
3498
  /**
@@ -3475,7 +3505,7 @@ const p = class p {
3475
3505
  static isAliasedAttributeReflection(t, e) {
3476
3506
  const r = w.get(t);
3477
3507
  return r instanceof x ? r.hasAttribute(
3478
- `${l.prefix}${p.ATTRIBUTE_ALIAS_SUFFIX}${e}`
3508
+ `${u.prefix}${p.ATTRIBUTE_ALIAS_SUFFIX}${e}`
3479
3509
  ) : !1;
3480
3510
  }
3481
3511
  /**
@@ -3488,9 +3518,9 @@ const p = class p {
3488
3518
  static reevaluateInterpolatedAttributes(t) {
3489
3519
  let e = Promise.resolve();
3490
3520
  for (const r of t.getAttributeNames()) {
3491
- const i = t.getRawAttribute(r);
3492
- p.shouldReevaluateAttribute(r, i) && (e = e.then(
3493
- () => p.setAttribute(t.getTarget(), r, i)
3521
+ const s = t.getRawAttribute(r);
3522
+ p.shouldReevaluateAttribute(r, s) && (e = e.then(
3523
+ () => p.setAttribute(t.getTarget(), r, s)
3494
3524
  ));
3495
3525
  }
3496
3526
  return e.then(() => {
@@ -3508,39 +3538,39 @@ const p = class p {
3508
3538
  return Promise.resolve();
3509
3539
  t.parentNode && (w.get(t.parentNode)?.isMounted() || document.body.contains(t) ? e.setMounted(!0) : e.setMounted(!1));
3510
3540
  let r = Promise.resolve();
3511
- const i = /* @__PURE__ */ new Set();
3541
+ const s = /* @__PURE__ */ new Set();
3512
3542
  for (const n of p.PRIORITY_ATTRIBUTE_SUFFIXES) {
3513
- const s = l.prefix + n;
3514
- e.hasAttribute(s) && (r = r.then(
3543
+ const i = u.prefix + n;
3544
+ e.hasAttribute(i) && (r = r.then(
3515
3545
  () => p.setAttribute(
3516
3546
  e.getTarget(),
3517
- s,
3518
- e.getRawAttribute(s)
3547
+ i,
3548
+ e.getRawAttribute(i)
3519
3549
  )
3520
- ), i.add(s));
3550
+ ), s.add(i));
3521
3551
  }
3522
3552
  for (const n of e.getAttributeNames()) {
3523
- if (i.has(n) || p.isDeferredAttributeName(n))
3553
+ if (s.has(n) || p.isDeferredAttributeName(n))
3524
3554
  continue;
3525
- const s = e.getRawAttribute(n);
3526
- s !== null && (r = r.then(
3527
- () => p.setAttribute(e.getTarget(), n, s)
3555
+ const i = e.getRawAttribute(n);
3556
+ i !== null && (r = r.then(
3557
+ () => p.setAttribute(e.getTarget(), n, i)
3528
3558
  ));
3529
3559
  }
3530
3560
  for (const n of p.DEFERRED_ATTRIBUTE_SUFFIXES) {
3531
- const s = l.prefix + n;
3532
- e.hasAttribute(s) && (r = r.then(
3561
+ const i = u.prefix + n;
3562
+ e.hasAttribute(i) && (r = r.then(
3533
3563
  () => p.setAttribute(
3534
3564
  e.getTarget(),
3535
- s,
3536
- e.getRawAttribute(s)
3565
+ i,
3566
+ e.getRawAttribute(i)
3537
3567
  )
3538
- ), i.add(s));
3568
+ ), s.add(i));
3539
3569
  }
3540
3570
  return r.then(() => {
3541
3571
  const n = [];
3542
- return e.getChildren().forEach((s) => {
3543
- s instanceof x ? n.push(p.scan(s.getTarget())) : s instanceof O && n.push(p.evaluateText(s));
3572
+ return e.getChildren().forEach((i) => {
3573
+ i instanceof x ? n.push(p.scan(i.getTarget())) : i instanceof O && n.push(p.evaluateText(i));
3544
3574
  }), Promise.all(n).then(() => {
3545
3575
  });
3546
3576
  }).then(() => {
@@ -3556,64 +3586,64 @@ const p = class p {
3556
3586
  * @returns Promise (DOM操作が完了したときに解決される)
3557
3587
  */
3558
3588
  static setAttribute(t, e, r) {
3559
- const i = w.get(t), n = p.getAliasedAttributeName(e);
3589
+ const s = w.get(t), n = p.getAliasedAttributeName(e);
3560
3590
  if (n !== null)
3561
- return r === null ? i.removeAliasedAttribute(e, n) : i.setAliasedAttribute(e, n, r);
3562
- const s = [];
3591
+ return r === null ? s.removeAliasedAttribute(e, n) : s.setAliasedAttribute(e, n, r);
3592
+ const i = [];
3563
3593
  switch (e) {
3564
- case `${l.prefix}bind`: {
3565
- r === null ? (i.clearBindingDataCache(), i.setBindingData({})) : i.setBindingData(p.parseDataBind(r));
3594
+ case `${u.prefix}bind`: {
3595
+ r === null ? (s.clearBindingDataCache(), s.setBindingData({})) : s.setBindingData(p.parseDataBind(r));
3566
3596
  break;
3567
3597
  }
3568
- case `${l.prefix}if`:
3569
- s.push(p.evaluateIf(i));
3598
+ case `${u.prefix}if`:
3599
+ i.push(p.evaluateIf(s));
3570
3600
  break;
3571
- case `${l.prefix}each`:
3572
- s.push(p.evaluateEach(i));
3601
+ case `${u.prefix}each`:
3602
+ i.push(p.evaluateEach(s));
3573
3603
  break;
3574
- case `${l.prefix}fetch`:
3575
- s.push(
3576
- new V(i, null).run().then(() => {
3604
+ case `${u.prefix}fetch`:
3605
+ i.push(
3606
+ new V(s, null).run().then(() => {
3577
3607
  })
3578
3608
  );
3579
3609
  break;
3580
- case `${l.prefix}import`: {
3610
+ case `${u.prefix}import`: {
3581
3611
  if (typeof r == "string") {
3582
- const a = i.getTarget(), o = performance.now();
3583
- a.setAttribute(`${l.prefix}importing`, ""), N.importStart(a, r), s.push(
3584
- dt.load(r).then((h) => {
3585
- const b = new TextEncoder().encode(h).length;
3612
+ const a = s.getTarget(), o = performance.now();
3613
+ a.setAttribute(`${u.prefix}importing`, ""), N.importStart(a, r), i.push(
3614
+ dt.load(r).then((l) => {
3615
+ const m = new TextEncoder().encode(l).length;
3586
3616
  return F.enqueue(() => {
3587
- a.innerHTML = h;
3617
+ a.innerHTML = l;
3588
3618
  }).then(() => {
3589
- if (a.removeAttribute(`${l.prefix}importing`), N.importEnd(a, r, b, o), !document.body.hasAttribute("data-haori-ready")) {
3619
+ if (a.removeAttribute(`${u.prefix}importing`), N.importEnd(a, r, m, o), !document.body.hasAttribute("data-haori-ready")) {
3590
3620
  const g = [];
3591
- return a.childNodes.forEach((E) => {
3592
- const v = w.get(E);
3621
+ return a.childNodes.forEach((T) => {
3622
+ const v = w.get(T);
3593
3623
  v instanceof x ? g.push(p.scan(v.getTarget())) : v instanceof O && g.push(p.evaluateText(v));
3594
3624
  }), Promise.all(g).then(() => {
3595
3625
  });
3596
3626
  }
3597
3627
  });
3598
- }).catch((h) => {
3599
- a.removeAttribute(`${l.prefix}importing`), N.importError(a, r, h), d.error("[Haori]", "Failed to import HTML:", r, h);
3628
+ }).catch((l) => {
3629
+ a.removeAttribute(`${u.prefix}importing`), N.importError(a, r, l), f.error("[Haori]", "Failed to import HTML:", r, l);
3600
3630
  })
3601
3631
  );
3602
3632
  }
3603
3633
  break;
3604
3634
  }
3605
- case `${l.prefix}url-param`: {
3606
- const a = i.getAttribute(`${l.prefix}url-arg`), o = ft.readParams();
3635
+ case `${u.prefix}url-param`: {
3636
+ const a = s.getAttribute(`${u.prefix}url-arg`), o = ft.readParams();
3607
3637
  if (a === null)
3608
- s.push(p.setBindingData(t, o));
3638
+ i.push(p.setBindingData(t, o));
3609
3639
  else {
3610
- const h = i.getRawBindingData() || {};
3611
- h[String(a)] = o, s.push(p.setBindingData(t, h));
3640
+ const l = s.getRawBindingData() || {};
3641
+ l[String(a)] = o, i.push(p.setBindingData(t, l));
3612
3642
  }
3613
3643
  break;
3614
3644
  }
3615
3645
  }
3616
- return r === null ? s.push(i.removeAttribute(e)) : s.push(i.setAttribute(e, r)), Promise.all(s).then(() => {
3646
+ return r === null ? i.push(s.removeAttribute(e)) : i.push(s.setAttribute(e, r)), Promise.all(i).then(() => {
3617
3647
  });
3618
3648
  }
3619
3649
  /**
@@ -3625,17 +3655,17 @@ const p = class p {
3625
3655
  * @returns Promise (DOM操作が完了したときに解決される)
3626
3656
  */
3627
3657
  static setBindingData(t, e) {
3628
- const r = w.get(t), i = r.getRawBindingData();
3658
+ const r = w.get(t), s = r.getRawBindingData();
3629
3659
  r.setBindingData(e);
3630
3660
  let n = r.setAttribute(
3631
- `${l.prefix}bind`,
3661
+ `${u.prefix}bind`,
3632
3662
  JSON.stringify(e)
3633
3663
  );
3634
3664
  if (t.tagName === "FORM") {
3635
- const s = r.getAttribute(`${l.prefix}form-arg`), a = s && e[String(s)] && typeof e[String(s)] == "object" && !Array.isArray(e[String(s)]) ? e[String(s)] : s ? {} : e;
3636
- n = n.then(() => y.syncValues(r, a));
3665
+ const i = r.getAttribute(`${u.prefix}form-arg`), a = i && e[String(i)] && typeof e[String(i)] == "object" && !Array.isArray(e[String(i)]) ? e[String(i)] : i ? {} : e;
3666
+ n = n.then(() => A.syncValues(r, a));
3637
3667
  }
3638
- return n = n.then(() => p.evaluateAll(r)), N.bindChange(t, i, e, "manual"), n.then(() => {
3668
+ return n = n.then(() => p.evaluateAll(r)), N.bindChange(t, s, e, "manual"), n.then(() => {
3639
3669
  });
3640
3670
  }
3641
3671
  /**
@@ -3649,12 +3679,12 @@ const p = class p {
3649
3679
  try {
3650
3680
  return JSON.parse(t);
3651
3681
  } catch (e) {
3652
- return d.error("[Haori]", "Invalid JSON in data-bind:", e), {};
3682
+ return f.error("[Haori]", "Invalid JSON in data-bind:", e), {};
3653
3683
  }
3654
3684
  else {
3655
3685
  const e = new URLSearchParams(t), r = {};
3656
- for (const [i, n] of e.entries())
3657
- r[i] !== void 0 ? Array.isArray(r[i]) ? r[i].push(n) : r[i] = [r[i], n] : r[i] = n;
3686
+ for (const [s, n] of e.entries())
3687
+ r[s] !== void 0 ? Array.isArray(r[s]) ? r[s].push(n) : r[s] = [r[s], n] : r[s] = n;
3658
3688
  return r;
3659
3689
  }
3660
3690
  }
@@ -3668,8 +3698,8 @@ const p = class p {
3668
3698
  const r = w.get(t);
3669
3699
  if (r.isSkipMutationNodes())
3670
3700
  return;
3671
- const i = w.get(e.nextSibling), n = w.get(e);
3672
- n && (r.insertBefore(n, i), n instanceof x ? p.scan(n.getTarget()) : n instanceof O && p.evaluateText(n));
3701
+ const s = w.get(e.nextSibling), n = w.get(e);
3702
+ n && (r.insertBefore(n, s), n instanceof x ? p.scan(n.getTarget()) : n instanceof O && p.evaluateText(n));
3673
3703
  }
3674
3704
  /**
3675
3705
  * ノードを親要素から削除します。
@@ -3707,15 +3737,15 @@ const p = class p {
3707
3737
  const r = w.get(t);
3708
3738
  if (r.getValue() === e)
3709
3739
  return Promise.resolve();
3710
- const i = [];
3711
- i.push(r.setValue(e));
3740
+ const s = [];
3741
+ s.push(r.setValue(e));
3712
3742
  const n = p.getFormFragment(r);
3713
3743
  if (n) {
3714
- const s = y.getValues(n), a = n.getAttribute(`${l.prefix}form-arg`);
3744
+ const i = A.getValues(n), a = n.getAttribute(`${u.prefix}form-arg`);
3715
3745
  let o;
3716
- a ? (o = n.getRawBindingData(), o || (o = {}), o[String(a)] = s) : o = s, i.push(p.setBindingData(n.getTarget(), o));
3746
+ a ? (o = n.getRawBindingData(), o || (o = {}), o[String(a)] = i) : o = i, s.push(p.setBindingData(n.getTarget(), o));
3717
3747
  }
3718
- return Promise.all(i).then(() => {
3748
+ return Promise.all(s).then(() => {
3719
3749
  });
3720
3750
  }
3721
3751
  /**
@@ -3738,13 +3768,7 @@ const p = class p {
3738
3768
  */
3739
3769
  static evaluateAll(t) {
3740
3770
  const e = [];
3741
- return e.push(p.reevaluateInterpolatedAttributes(t)), t.hasAttribute(`${l.prefix}if`) && e.push(p.evaluateIf(t)), t.hasAttribute(`${l.prefix}each`) ? Promise.all(e).then(() => p.evaluateEach(t)).then(() => {
3742
- const r = [];
3743
- return t.getChildren().forEach((i) => {
3744
- i instanceof x ? r.push(p.evaluateAll(i)) : i instanceof O && r.push(p.evaluateText(i));
3745
- }), Promise.all(r).then(() => {
3746
- });
3747
- }) : (t.getChildren().forEach((r) => {
3771
+ return e.push(p.reevaluateInterpolatedAttributes(t)), t.hasAttribute(`${u.prefix}if`) && e.push(p.evaluateIf(t)), t.hasAttribute(`${u.prefix}each`) ? Promise.all(e).then(() => p.evaluateEach(t)) : (t.getChildren().forEach((r) => {
3748
3772
  r instanceof x ? e.push(p.evaluateAll(r)) : r instanceof O && e.push(p.evaluateText(r));
3749
3773
  }), Promise.all(e).then(() => {
3750
3774
  }));
@@ -3766,7 +3790,7 @@ const p = class p {
3766
3790
  * @return Promise (DOM操作が完了したときに解決される)
3767
3791
  */
3768
3792
  static evaluateIf(t) {
3769
- const e = [], r = t.getAttribute(`${l.prefix}if`);
3793
+ const e = [], r = t.getAttribute(`${u.prefix}if`);
3770
3794
  if (r === !1 || r === void 0 || r === null || Number.isNaN(r))
3771
3795
  e.push(
3772
3796
  t.hide().then(() => {
@@ -3774,14 +3798,14 @@ const p = class p {
3774
3798
  })
3775
3799
  );
3776
3800
  else {
3777
- const i = [];
3801
+ const s = [];
3778
3802
  t.getChildren().forEach((n) => {
3779
- n instanceof x ? i.push(p.evaluateAll(n)) : n instanceof O && i.push(p.evaluateText(n));
3803
+ n instanceof x ? s.push(p.evaluateAll(n)) : n instanceof O && s.push(p.evaluateText(n));
3780
3804
  }), e.push(
3781
3805
  t.show().then(() => {
3782
3806
  N.show(t.getTarget());
3783
3807
  })
3784
- ), e.push(Promise.all(i).then(() => {
3808
+ ), e.push(Promise.all(s).then(() => {
3785
3809
  }));
3786
3810
  }
3787
3811
  return Promise.all(e).then(() => {
@@ -3798,21 +3822,21 @@ const p = class p {
3798
3822
  return Promise.resolve();
3799
3823
  let e = t.getTemplate();
3800
3824
  if (e === null) {
3801
- let i = !1;
3802
- t.getChildren().forEach((s) => {
3803
- if (!i && s instanceof x) {
3804
- if (s.hasAttribute(`${l.prefix}each-before`) || s.hasAttribute(`${l.prefix}each-after`))
3825
+ let s = !1;
3826
+ t.getChildren().forEach((i) => {
3827
+ if (!s && i instanceof x) {
3828
+ if (i.hasAttribute(`${u.prefix}each-before`) || i.hasAttribute(`${u.prefix}each-after`))
3805
3829
  return;
3806
- e = s.clone(), t.setTemplate(e), i = !0, t.removeChild(s);
3807
- const a = s.getTarget();
3808
- a.parentNode && a.parentNode.removeChild(a), s.setMounted(!1);
3830
+ e = i.clone(), t.setTemplate(e), s = !0, t.removeChild(i);
3831
+ const a = i.getTarget();
3832
+ a.parentNode && a.parentNode.removeChild(a), i.setMounted(!1);
3809
3833
  }
3810
3834
  });
3811
- const n = t.getAttribute(`${l.prefix}each`);
3812
- return Array.isArray(n) ? this.updateDiff(t, n) : (d.error("[Haori]", "Invalid each attribute:", n), Promise.reject(new Error("Invalid each attribute.")));
3835
+ const n = t.getAttribute(`${u.prefix}each`);
3836
+ return Array.isArray(n) ? this.updateDiff(t, n) : (f.error("[Haori]", "Invalid each attribute:", n), Promise.reject(new Error("Invalid each attribute.")));
3813
3837
  }
3814
- const r = t.getAttribute(`${l.prefix}each`);
3815
- return Array.isArray(r) ? this.updateDiff(t, r) : (d.error("[Haori]", "Invalid each attribute:", r), Promise.reject(new Error("Invalid each attribute.")));
3838
+ const r = t.getAttribute(`${u.prefix}each`);
3839
+ return Array.isArray(r) ? this.updateDiff(t, r) : (f.error("[Haori]", "Invalid each attribute:", r), Promise.reject(new Error("Invalid each attribute.")));
3816
3840
  }
3817
3841
  /**
3818
3842
  * 差分を更新します。
@@ -3823,73 +3847,73 @@ const p = class p {
3823
3847
  static updateDiff(t, e) {
3824
3848
  const r = t.getTemplate();
3825
3849
  if (r === null)
3826
- return d.error("[Haori]", "Template is not set for each element."), Promise.resolve();
3827
- let i = t.getAttribute(`${l.prefix}each-index`);
3828
- i && (i = String(i));
3829
- const n = t.getAttribute(`${l.prefix}each-key`), s = t.getAttribute(`${l.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
3830
- e.forEach((c, f) => {
3831
- const m = p.createListKey(
3832
- c,
3850
+ return f.error("[Haori]", "Template is not set for each element."), Promise.resolve();
3851
+ let s = t.getAttribute(`${u.prefix}each-index`);
3852
+ s && (s = String(s));
3853
+ const n = t.getAttribute(`${u.prefix}each-key`), i = t.getAttribute(`${u.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
3854
+ e.forEach((h, d) => {
3855
+ const b = p.createListKey(
3856
+ h,
3833
3857
  n ? String(n) : null,
3834
- f
3858
+ d
3835
3859
  );
3836
- o.push(m), a.set(m, { item: c, itemIndex: f });
3860
+ o.push(b), a.set(b, { item: h, itemIndex: d });
3837
3861
  });
3838
- const h = [];
3839
- let b = t.getChildren().filter((c) => c instanceof x).filter(
3840
- (c) => !c.hasAttribute(`${l.prefix}each-before`) && !c.hasAttribute(`${l.prefix}each-after`)
3862
+ const l = [];
3863
+ let m = t.getChildren().filter((h) => h instanceof x).filter(
3864
+ (h) => !h.hasAttribute(`${u.prefix}each-before`) && !h.hasAttribute(`${u.prefix}each-after`)
3841
3865
  );
3842
- b = b.filter((c) => o.indexOf(String(c.getListKey())) === -1 ? (h.push(c.remove()), !1) : !0);
3843
- const g = b.map((c) => c.getListKey()), E = t.getChildren().filter((c) => c instanceof x).filter((c) => c.hasAttribute(`${l.prefix}each-before`)).length;
3866
+ m = m.filter((h) => o.indexOf(String(h.getListKey())) === -1 ? (l.push(h.remove()), !1) : !0);
3867
+ const g = m.map((h) => h.getListKey()), T = t.getChildren().filter((h) => h instanceof x).filter((h) => h.hasAttribute(`${u.prefix}each-before`)).length;
3844
3868
  let v = Promise.resolve();
3845
- return o.forEach((c, f) => {
3846
- const m = g.indexOf(c), { item: A, itemIndex: T } = a.get(c);
3847
- let k;
3848
- if (m !== -1)
3849
- k = b[m], v = v.then(
3869
+ return o.forEach((h, d) => {
3870
+ const b = g.indexOf(h), { item: E, itemIndex: y } = a.get(h);
3871
+ let D;
3872
+ if (b !== -1)
3873
+ D = m[b], v = v.then(
3850
3874
  () => p.updateRowFragment(
3851
- k,
3852
- A,
3853
- i,
3854
- T,
3855
- s ? String(s) : null,
3856
- c
3857
- ).then(() => p.evaluateAll(k)).then(() => p.scheduleEvaluateAll(k))
3875
+ D,
3876
+ E,
3877
+ s,
3878
+ y,
3879
+ i ? String(i) : null,
3880
+ h
3881
+ ).then(() => p.evaluateAll(D)).then(() => p.scheduleEvaluateAll(D))
3858
3882
  );
3859
3883
  else {
3860
- k = r.clone();
3861
- const J = E + f;
3884
+ D = r.clone();
3885
+ const J = T + d;
3862
3886
  v = v.then(
3863
3887
  () => p.updateRowFragment(
3864
- k,
3865
- A,
3866
- i,
3867
- T,
3868
- s ? String(s) : null,
3869
- c
3888
+ D,
3889
+ E,
3890
+ s,
3891
+ y,
3892
+ i ? String(i) : null,
3893
+ h
3870
3894
  ).then(
3871
3895
  () => t.insertBefore(
3872
- k,
3896
+ D,
3873
3897
  t.getChildren()[J] || null
3874
- ).then(() => p.evaluateAll(k)).then(() => p.scheduleEvaluateAll(k))
3898
+ ).then(() => p.evaluateAll(D)).then(() => p.scheduleEvaluateAll(D))
3875
3899
  )
3876
3900
  );
3877
3901
  }
3878
- }), Promise.all(h).then(() => v).then(() => {
3879
- const c = o.filter(
3880
- (T) => T !== null
3881
- ), f = g.filter(
3882
- (T) => T !== null
3883
- ), m = c.filter(
3884
- (T) => !f.includes(T)
3885
- ), A = f.filter(
3886
- (T) => !c.includes(T)
3902
+ }), Promise.all(l).then(() => v).then(() => {
3903
+ const h = o.filter(
3904
+ (y) => y !== null
3905
+ ), d = g.filter(
3906
+ (y) => y !== null
3907
+ ), b = h.filter(
3908
+ (y) => !d.includes(y)
3909
+ ), E = d.filter(
3910
+ (y) => !h.includes(y)
3887
3911
  );
3888
3912
  N.eachUpdate(
3889
3913
  t.getTarget(),
3890
- m,
3891
- A,
3892
- c
3914
+ b,
3915
+ E,
3916
+ h
3893
3917
  );
3894
3918
  });
3895
3919
  }
@@ -3902,16 +3926,16 @@ const p = class p {
3902
3926
  * @returns リストキー
3903
3927
  */
3904
3928
  static createListKey(t, e, r) {
3905
- let i;
3929
+ let s;
3906
3930
  if (typeof t == "object" && t !== null)
3907
3931
  if (e) {
3908
3932
  const n = t[e];
3909
- n == null ? i = `__index_${r}` : typeof n == "object" ? i = JSON.stringify(n) : i = String(n);
3933
+ n == null ? s = `__index_${r}` : typeof n == "object" ? s = JSON.stringify(n) : s = String(n);
3910
3934
  } else
3911
- i = `__index_${r}`;
3935
+ s = `__index_${r}`;
3912
3936
  else
3913
- i = String(t);
3914
- return i;
3937
+ s = String(t);
3938
+ return s;
3915
3939
  }
3916
3940
  /**
3917
3941
  * 行フラグメントにデータを設定します。
@@ -3924,22 +3948,22 @@ const p = class p {
3924
3948
  * @param listKey リストキー
3925
3949
  * @returns 行メタデータの更新完了 Promise
3926
3950
  */
3927
- static updateRowFragment(t, e, r, i, n, s) {
3951
+ static updateRowFragment(t, e, r, s, n, i) {
3928
3952
  let a = e;
3929
3953
  if (typeof e == "object" && e !== null)
3930
- a = { ...e }, r && (a[r] = i), n && (a = {
3954
+ a = { ...e }, r && (a[r] = s), n && (a = {
3931
3955
  [n]: a
3932
3956
  });
3933
3957
  else if (n)
3934
3958
  a = {
3935
3959
  [n]: e
3936
- }, r && (a[r] = i);
3960
+ }, r && (a[r] = s);
3937
3961
  else
3938
- return d.error(
3962
+ return f.error(
3939
3963
  "[Haori]",
3940
- `Primitive value requires '${l.prefix}each-arg' attribute: ${e}`
3964
+ `Primitive value requires '${u.prefix}each-arg' attribute: ${e}`
3941
3965
  ), Promise.resolve();
3942
- return t.setListKey(s), t.setBindingData(a), t.setAttribute(`${l.prefix}row`, s);
3966
+ return t.setListKey(i), t.setBindingData(a), t.setAttribute(`${u.prefix}row`, i);
3943
3967
  }
3944
3968
  /**
3945
3969
  * フラグメントの再評価を次のイベントループで実行します。
@@ -3960,7 +3984,7 @@ p.ATTRIBUTE_ALIAS_SUFFIX = "attr-", p.PRIORITY_ATTRIBUTE_SUFFIXES = ["bind", "if
3960
3984
  "import",
3961
3985
  "url-param"
3962
3986
  ], p.ATTRIBUTE_PLACEHOLDER_REGEX = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/;
3963
- let R = p;
3987
+ let P = p;
3964
3988
  const Y = class Y {
3965
3989
  /**
3966
3990
  * コンストラクタ。
@@ -3999,9 +4023,9 @@ const Y = class Y {
3999
4023
  const r = this.getElementFromTarget(t.target);
4000
4024
  if (!r)
4001
4025
  return;
4002
- const i = w.get(r);
4003
- i && (e === "change" && i instanceof x && i.syncValue(), new V(i, e).run().catch((n) => {
4004
- d.error("[Haori]", "Procedure execution error:", n);
4026
+ const s = w.get(r);
4027
+ s && (e === "change" && s instanceof x && s.syncValue(), new V(s, e).run().catch((n) => {
4028
+ f.error("[Haori]", "Procedure execution error:", n);
4005
4029
  }));
4006
4030
  }
4007
4031
  /**
@@ -4030,37 +4054,37 @@ const S = class S {
4030
4054
  }
4031
4055
  if (typeof IntersectionObserver > "u")
4032
4056
  return;
4033
- const i = S.resolveRoot(r), n = S.resolveRootMargin(r), s = S.resolveThreshold(r), a = r.hasAttribute(`${l.prefix}intersect-once`);
4034
- if (e && e.observer.root === i && e.observer.rootMargin === n && S.sameThreshold(
4057
+ const s = S.resolveRoot(r), n = S.resolveRootMargin(r), i = S.resolveThreshold(r), a = r.hasAttribute(`${u.prefix}intersect-once`);
4058
+ if (e && e.observer.root === s && e.observer.rootMargin === n && S.sameThreshold(
4035
4059
  e.observer.thresholds,
4036
- s
4060
+ i
4037
4061
  ) && e.once === a) {
4038
4062
  e.fragment = r;
4039
4063
  return;
4040
4064
  }
4041
4065
  e && (e.observer.disconnect(), S.registrations.delete(t));
4042
4066
  const o = new IntersectionObserver(
4043
- (h) => {
4044
- const b = S.registrations.get(t);
4045
- b && h.forEach((g) => {
4046
- !g.isIntersecting || b.running || S.isDisabled(b.fragment) || (b.running = !0, new V(b.fragment, "intersect").runWithResult().then((E) => {
4047
- E && b.once && (b.observer.disconnect(), S.registrations.delete(t));
4048
- }).catch((E) => {
4049
- d.error(
4067
+ (l) => {
4068
+ const m = S.registrations.get(t);
4069
+ m && l.forEach((g) => {
4070
+ !g.isIntersecting || m.running || S.isDisabled(m.fragment) || (m.running = !0, new V(m.fragment, "intersect").runWithResult().then((T) => {
4071
+ T && m.once && (m.observer.disconnect(), S.registrations.delete(t));
4072
+ }).catch((T) => {
4073
+ f.error(
4050
4074
  "[Haori]",
4051
4075
  "Intersect procedure execution error:",
4052
- E
4076
+ T
4053
4077
  );
4054
4078
  }).finally(() => {
4055
- const E = S.registrations.get(t);
4056
- E && (E.running = !1);
4079
+ const T = S.registrations.get(t);
4080
+ T && (T.running = !1);
4057
4081
  }));
4058
4082
  });
4059
4083
  },
4060
4084
  {
4061
- root: i,
4085
+ root: s,
4062
4086
  rootMargin: n,
4063
- threshold: s
4087
+ threshold: i
4064
4088
  }
4065
4089
  );
4066
4090
  o.observe(t), S.registrations.set(t, {
@@ -4087,38 +4111,38 @@ const S = class S {
4087
4111
  }
4088
4112
  static shouldObserve(t) {
4089
4113
  return t.getAttributeNames().some((e) => {
4090
- if (!e.startsWith(`${l.prefix}intersect-`))
4114
+ if (!e.startsWith(`${u.prefix}intersect-`))
4091
4115
  return !1;
4092
- const r = e.slice(`${l.prefix}intersect-`.length);
4116
+ const r = e.slice(`${u.prefix}intersect-`.length);
4093
4117
  return !S.CONFIG_KEYS.has(r);
4094
4118
  });
4095
4119
  }
4096
4120
  static resolveRoot(t) {
4097
- const e = `${l.prefix}intersect-root`;
4121
+ const e = `${u.prefix}intersect-root`;
4098
4122
  if (!t.hasAttribute(e))
4099
4123
  return null;
4100
4124
  const r = t.getAttribute(e);
4101
4125
  if (typeof r != "string" || r.trim() === "")
4102
4126
  return null;
4103
- const i = document.querySelector(r);
4104
- return i instanceof HTMLElement ? i : (d.error("[Haori]", `Intersect root element not found: ${r}`), null);
4127
+ const s = document.querySelector(r);
4128
+ return s instanceof HTMLElement ? s : (f.error("[Haori]", `Intersect root element not found: ${r}`), null);
4105
4129
  }
4106
4130
  static resolveRootMargin(t) {
4107
- const e = `${l.prefix}intersect-root-margin`, r = t.getAttribute(e);
4131
+ const e = `${u.prefix}intersect-root-margin`, r = t.getAttribute(e);
4108
4132
  return r === null || r === !1 || r === "" ? "0px" : String(r);
4109
4133
  }
4110
4134
  static resolveThreshold(t) {
4111
- const e = `${l.prefix}intersect-threshold`, r = t.getAttribute(e), i = typeof r == "number" ? r : Number.parseFloat(String(r ?? 0));
4112
- return Number.isNaN(i) ? 0 : Math.min(1, Math.max(0, i));
4135
+ const e = `${u.prefix}intersect-threshold`, r = t.getAttribute(e), s = typeof r == "number" ? r : Number.parseFloat(String(r ?? 0));
4136
+ return Number.isNaN(s) ? 0 : Math.min(1, Math.max(0, s));
4113
4137
  }
4114
4138
  static isDisabled(t) {
4115
- const e = `${l.prefix}intersect-disabled`, r = t.getAttribute(e);
4139
+ const e = `${u.prefix}intersect-disabled`, r = t.getAttribute(e);
4116
4140
  if (r === null || r === !1)
4117
4141
  return !1;
4118
4142
  if (typeof r == "boolean")
4119
4143
  return r;
4120
- const i = String(r).trim().toLowerCase();
4121
- return i !== "" && i !== "false" && i !== "0";
4144
+ const s = String(r).trim().toLowerCase();
4145
+ return s !== "" && s !== "false" && s !== "0";
4122
4146
  }
4123
4147
  static sameThreshold(t, e) {
4124
4148
  return t.length === 1 && t[0] === e;
@@ -4131,7 +4155,7 @@ S.CONFIG_KEYS = /* @__PURE__ */ new Set([
4131
4155
  "disabled",
4132
4156
  "once"
4133
4157
  ]), S.registrations = /* @__PURE__ */ new Map();
4134
- let L = S;
4158
+ let $ = S;
4135
4159
  const H = class H {
4136
4160
  /**
4137
4161
  * 初期化メソッド。
@@ -4142,10 +4166,10 @@ const H = class H {
4142
4166
  return;
4143
4167
  H._initialized = !0;
4144
4168
  const t = await Promise.allSettled([
4145
- R.scan(document.head),
4146
- R.scan(document.body)
4169
+ P.scan(document.head),
4170
+ P.scan(document.body)
4147
4171
  ]), [e, r] = t;
4148
- e.status !== "fulfilled" && d.error("[Haori]", "Failed to build head fragment:", e.reason), r.status !== "fulfilled" && d.error("[Haori]", "Failed to build body fragment:", r.reason), await F.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), new Q().start(), L.syncTree(document.body);
4172
+ e.status !== "fulfilled" && f.error("[Haori]", "Failed to build head fragment:", e.reason), r.status !== "fulfilled" && f.error("[Haori]", "Failed to build body fragment:", r.reason), await F.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), new Q().start(), $.syncTree(document.body);
4149
4173
  }
4150
4174
  /**
4151
4175
  * 指定された要素を監視します。
@@ -4154,81 +4178,81 @@ const H = class H {
4154
4178
  */
4155
4179
  static observe(t) {
4156
4180
  new MutationObserver(async (r) => {
4157
- for (const i of r)
4181
+ for (const s of r)
4158
4182
  try {
4159
- switch (i.type) {
4183
+ switch (s.type) {
4160
4184
  case "attributes": {
4161
- d.info(
4185
+ f.info(
4162
4186
  "[Haori]",
4163
4187
  "Attribute changed:",
4164
- i.target,
4165
- i.attributeName
4188
+ s.target,
4189
+ s.attributeName
4166
4190
  );
4167
- const n = i.target;
4168
- if (i.attributeName && R.isAliasedAttributeReflection(
4191
+ const n = s.target;
4192
+ if (s.attributeName && P.isAliasedAttributeReflection(
4169
4193
  n,
4170
- i.attributeName
4194
+ s.attributeName
4171
4195
  ))
4172
4196
  break;
4173
- R.setAttribute(
4197
+ P.setAttribute(
4174
4198
  n,
4175
- i.attributeName,
4176
- n.getAttribute(i.attributeName)
4177
- ), L.syncElement(n);
4199
+ s.attributeName,
4200
+ n.getAttribute(s.attributeName)
4201
+ ), $.syncElement(n);
4178
4202
  break;
4179
4203
  }
4180
4204
  case "childList": {
4181
- d.info(
4205
+ f.info(
4182
4206
  "[Haori]",
4183
4207
  "Child list changed:",
4184
- Array.from(i.removedNodes).map((n) => n.nodeName),
4185
- Array.from(i.addedNodes).map((n) => n.nodeName)
4186
- ), Array.from(i.removedNodes).forEach((n) => {
4187
- L.cleanupTree(n), R.removeNode(n);
4188
- }), Array.from(i.addedNodes).forEach((n) => {
4189
- n.parentElement instanceof HTMLElement && (R.addNode(n.parentElement, n), L.syncTree(n));
4208
+ Array.from(s.removedNodes).map((n) => n.nodeName),
4209
+ Array.from(s.addedNodes).map((n) => n.nodeName)
4210
+ ), Array.from(s.removedNodes).forEach((n) => {
4211
+ $.cleanupTree(n), P.removeNode(n);
4212
+ }), Array.from(s.addedNodes).forEach((n) => {
4213
+ n.parentElement instanceof HTMLElement && (P.addNode(n.parentElement, n), $.syncTree(n));
4190
4214
  });
4191
4215
  break;
4192
4216
  }
4193
4217
  case "characterData": {
4194
- d.info(
4218
+ f.info(
4195
4219
  "[Haori]",
4196
4220
  "Character data changed:",
4197
- i.target,
4198
- i.target.textContent
4199
- ), i.target instanceof Text || i.target instanceof Comment ? R.changeText(i.target, i.target.textContent) : d.warn(
4221
+ s.target,
4222
+ s.target.textContent
4223
+ ), s.target instanceof Text || s.target instanceof Comment ? P.changeText(s.target, s.target.textContent) : f.warn(
4200
4224
  "[Haori]",
4201
4225
  "Unsupported character data type:",
4202
- i.target
4226
+ s.target
4203
4227
  );
4204
4228
  break;
4205
4229
  }
4206
4230
  default:
4207
- d.warn("[Haori]", "Unknown mutation type:", i.type);
4231
+ f.warn("[Haori]", "Unknown mutation type:", s.type);
4208
4232
  continue;
4209
4233
  }
4210
4234
  } catch (n) {
4211
- d.error("[Haori]", "Error processing mutation:", n);
4235
+ f.error("[Haori]", "Error processing mutation:", n);
4212
4236
  }
4213
4237
  }).observe(t, {
4214
4238
  childList: !0,
4215
4239
  subtree: !0,
4216
4240
  attributes: !0,
4217
4241
  characterData: !0
4218
- }), d.info("[Haori]", "Observer initialized for", t);
4242
+ }), f.info("[Haori]", "Observer initialized for", t);
4219
4243
  }
4220
4244
  };
4221
4245
  H._initialized = !1;
4222
4246
  let q = H;
4223
4247
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", q.init) : q.init();
4224
- const pt = "0.4.8";
4248
+ const pt = "0.4.10";
4225
4249
  export {
4226
- R as Core,
4227
- l as Env,
4228
- y as Form,
4250
+ P as Core,
4251
+ u as Env,
4252
+ A as Form,
4229
4253
  w as Fragment,
4230
4254
  X as Haori,
4231
- d as Log,
4255
+ f as Log,
4232
4256
  F as Queue,
4233
4257
  X as default,
4234
4258
  pt as version