haori 0.65.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +22 -22
- package/dist/haori.es.js +1029 -905
- package/dist/haori.iife.js +23 -23
- package/dist/index.d.ts +17 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Re = class Re {
|
|
2
2
|
/**
|
|
3
3
|
* 開発モードの状態を取得します。
|
|
4
4
|
*
|
|
5
5
|
* @returns 開発モードならtrue、そうでなければfalse
|
|
6
6
|
*/
|
|
7
7
|
static isEnabled() {
|
|
8
|
-
return
|
|
8
|
+
return Re.devMode;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* 開発モードを有効化します。
|
|
12
12
|
*/
|
|
13
13
|
static enable() {
|
|
14
|
-
|
|
14
|
+
Re.devMode = !0;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* 開発モードを無効化します。
|
|
18
18
|
*/
|
|
19
19
|
static disable() {
|
|
20
|
-
|
|
20
|
+
Re.devMode = !1;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* 開発モードを切り替えます。
|
|
@@ -25,23 +25,23 @@ const we = class we {
|
|
|
25
25
|
* @param enabled trueで有効化、falseで無効化
|
|
26
26
|
*/
|
|
27
27
|
static set(e) {
|
|
28
|
-
|
|
28
|
+
Re.devMode = e;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
const
|
|
34
|
-
function
|
|
31
|
+
Re.devMode = !1;
|
|
32
|
+
let V = Re;
|
|
33
|
+
const rt = "embedded";
|
|
34
|
+
function It(f) {
|
|
35
35
|
return f === "embedded" || f === "demo";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return f === null ? null :
|
|
37
|
+
function tr(f) {
|
|
38
|
+
return f === null ? null : It(f) ? f : rt;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function dt(f) {
|
|
41
41
|
const e = f.trim().toLowerCase();
|
|
42
42
|
return e !== "false" && e !== "off" && e !== "0";
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const te = class te {
|
|
45
45
|
/**
|
|
46
46
|
* CSP モードが有効かどうかを取得します。
|
|
47
47
|
*
|
|
@@ -52,7 +52,7 @@ const ee = class ee {
|
|
|
52
52
|
* @returns CSP モードなら true。
|
|
53
53
|
*/
|
|
54
54
|
static get csp() {
|
|
55
|
-
return
|
|
55
|
+
return te._csp;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* CSP モードを設定します。
|
|
@@ -61,7 +61,7 @@ const ee = class ee {
|
|
|
61
61
|
* @return 戻り値はありません。
|
|
62
62
|
*/
|
|
63
63
|
static setCsp(e) {
|
|
64
|
-
|
|
64
|
+
te._csp = e;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* 厳格バインドモードが有効かどうかを取得します。
|
|
@@ -72,7 +72,7 @@ const ee = class ee {
|
|
|
72
72
|
* @returns 厳格バインドモードなら true。
|
|
73
73
|
*/
|
|
74
74
|
static get strictBind() {
|
|
75
|
-
return
|
|
75
|
+
return te._strictBind;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* 厳格バインドモードを設定します。
|
|
@@ -81,7 +81,7 @@ const ee = class ee {
|
|
|
81
81
|
* @return 戻り値はありません。
|
|
82
82
|
*/
|
|
83
83
|
static setStrictBind(e) {
|
|
84
|
-
|
|
84
|
+
te._strictBind = e;
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* 実行モードを取得します。
|
|
@@ -89,7 +89,7 @@ const ee = class ee {
|
|
|
89
89
|
* @returns 実行モード。
|
|
90
90
|
*/
|
|
91
91
|
static get runtime() {
|
|
92
|
-
return
|
|
92
|
+
return te._runtime;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* 実行モードを設定します。
|
|
@@ -98,7 +98,7 @@ const ee = class ee {
|
|
|
98
98
|
* @return 戻り値はありません。
|
|
99
99
|
*/
|
|
100
100
|
static setRuntime(e) {
|
|
101
|
-
|
|
101
|
+
te._runtime = It(e) ? e : rt;
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* 実行環境からプレフィックスと開発モードかどうかを自動検出します。
|
|
@@ -110,31 +110,31 @@ const ee = class ee {
|
|
|
110
110
|
try {
|
|
111
111
|
const e = document.currentScript || document.querySelector('script[src*="haori"]');
|
|
112
112
|
if (e instanceof HTMLScriptElement) {
|
|
113
|
-
const r = e.getAttribute("data-prefix") ||
|
|
114
|
-
|
|
115
|
-
const i =
|
|
113
|
+
const r = e.getAttribute("data-prefix") || te._prefix;
|
|
114
|
+
te._prefix = r.endsWith("-") ? r : r + "-";
|
|
115
|
+
const i = tr(
|
|
116
116
|
e.getAttribute("data-runtime")
|
|
117
117
|
);
|
|
118
|
-
i !== null && (
|
|
119
|
-
`${
|
|
118
|
+
i !== null && (te._runtime = i), te._strictBind = e.hasAttribute(
|
|
119
|
+
`${te._prefix}strict-bind`
|
|
120
120
|
);
|
|
121
|
-
const s = e.getAttribute(`${
|
|
122
|
-
s !== null && (
|
|
121
|
+
const s = e.getAttribute(`${te._prefix}csp`);
|
|
122
|
+
s !== null && (te._csp = dt(s));
|
|
123
123
|
}
|
|
124
|
-
if (e instanceof HTMLScriptElement && e.hasAttribute(`${
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
e.getAttribute(`${
|
|
124
|
+
if (e instanceof HTMLScriptElement && e.hasAttribute(`${te._prefix}dev`)) {
|
|
125
|
+
V.set(
|
|
126
|
+
dt(
|
|
127
|
+
e.getAttribute(`${te._prefix}dev`) ?? ""
|
|
128
128
|
)
|
|
129
129
|
);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
const t = window.location.hostname;
|
|
133
133
|
if (t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "::1" || t.endsWith(".local")) {
|
|
134
|
-
|
|
134
|
+
V.set(!0);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
V.set(!1);
|
|
138
138
|
} catch {
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -144,11 +144,11 @@ const ee = class ee {
|
|
|
144
144
|
* @returns プレフィックス
|
|
145
145
|
*/
|
|
146
146
|
static get prefix() {
|
|
147
|
-
return
|
|
147
|
+
return te._prefix;
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
|
-
|
|
151
|
-
let c =
|
|
150
|
+
te._prefix = "data-", te._runtime = rt, te._strictBind = !1, te._csp = !0;
|
|
151
|
+
let c = te;
|
|
152
152
|
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", c.detect) : c.detect());
|
|
153
153
|
class m {
|
|
154
154
|
/**
|
|
@@ -158,7 +158,7 @@ class m {
|
|
|
158
158
|
* @param args 追加の引数
|
|
159
159
|
*/
|
|
160
160
|
static info(e, ...t) {
|
|
161
|
-
|
|
161
|
+
V.isEnabled() && console.log && console.log(e, ...t);
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* 開発モードでのみコンソールに警告を出力します。
|
|
@@ -167,7 +167,7 @@ class m {
|
|
|
167
167
|
* @param args 追加の引数
|
|
168
168
|
*/
|
|
169
169
|
static warn(e, ...t) {
|
|
170
|
-
|
|
170
|
+
V.isEnabled() && console.warn && console.warn(e, ...t);
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
173
173
|
* モードに関係なくコンソールにエラーを出力します。
|
|
@@ -179,7 +179,7 @@ class m {
|
|
|
179
179
|
console.error(e, ...t);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
const
|
|
182
|
+
const rr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:", I = class I {
|
|
183
183
|
/**
|
|
184
184
|
* 外部ライブラリ連携を登録します。
|
|
185
185
|
*
|
|
@@ -315,7 +315,7 @@ const tr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, dt = "new:
|
|
|
315
315
|
I.appliedKeys(e).set(r, s);
|
|
316
316
|
});
|
|
317
317
|
}), I.names(e, `${c.prefix}enhance-new`).forEach((r) => {
|
|
318
|
-
const i = `${
|
|
318
|
+
const i = `${ht}${r}`;
|
|
319
319
|
if (I.instances.get(e)?.has(i))
|
|
320
320
|
return;
|
|
321
321
|
const s = I.resolveGlobal(r);
|
|
@@ -352,7 +352,7 @@ const tr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, dt = "new:
|
|
|
352
352
|
static destroyElement(e) {
|
|
353
353
|
const t = I.instances.get(e);
|
|
354
354
|
t && (t.forEach((r, i) => {
|
|
355
|
-
if (i.startsWith(
|
|
355
|
+
if (i.startsWith(ht))
|
|
356
356
|
return;
|
|
357
357
|
const s = I.enhancers.get(i);
|
|
358
358
|
!s || typeof s.destroy != "function" || I.run(`enhance "${i}" destroy`, () => {
|
|
@@ -398,7 +398,7 @@ const tr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, dt = "new:
|
|
|
398
398
|
* @returns 解決した値。解決できない場合は null
|
|
399
399
|
*/
|
|
400
400
|
static resolveGlobal(e) {
|
|
401
|
-
if (!
|
|
401
|
+
if (!rr.test(e))
|
|
402
402
|
return m.error(
|
|
403
403
|
"[Haori]",
|
|
404
404
|
`${c.prefix}enhance-new accepts a dot-separated global reference only: ${e}`
|
|
@@ -412,7 +412,7 @@ const tr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, dt = "new:
|
|
|
412
412
|
if (t = t[r], t === void 0)
|
|
413
413
|
break;
|
|
414
414
|
}
|
|
415
|
-
return typeof t != "function" ? (
|
|
415
|
+
return typeof t != "function" ? (V.isEnabled() && !I.warnedMissingGlobals.has(e) && (I.warnedMissingGlobals.add(e), m.warn(
|
|
416
416
|
"[Haori]",
|
|
417
417
|
`${c.prefix}enhance-new could not resolve the global reference (load the library before Haori runs): ${e}`
|
|
418
418
|
)), null) : t;
|
|
@@ -424,7 +424,7 @@ const tr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, dt = "new:
|
|
|
424
424
|
* @returns 戻り値はありません。
|
|
425
425
|
*/
|
|
426
426
|
static warnUnknownName(e) {
|
|
427
|
-
!
|
|
427
|
+
!V.isEnabled() || I.warnedUnknownNames.has(e) || (I.warnedUnknownNames.add(e), m.warn(
|
|
428
428
|
"[Haori]",
|
|
429
429
|
`Enhancer "${e}" is not registered yet; the declaration is kept pending and applied when it is registered (Haori.enhancers.register('${e}', {init(el) {...}})).`
|
|
430
430
|
));
|
|
@@ -451,26 +451,26 @@ const tr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, dt = "new:
|
|
|
451
451
|
}
|
|
452
452
|
};
|
|
453
453
|
I.enhancers = /* @__PURE__ */ new Map(), I.instances = /* @__PURE__ */ new WeakMap(), I.warnedUnknownNames = /* @__PURE__ */ new Set(), I.warnedMissingGlobals = /* @__PURE__ */ new Set(), I.visited = /* @__PURE__ */ new WeakSet(), I.mutationCapture = null;
|
|
454
|
-
let
|
|
455
|
-
const
|
|
456
|
-
function
|
|
454
|
+
let le = I;
|
|
455
|
+
const Ft = "yyyy/MM/dd HH:mm", ir = "en-US", ft = 1e4;
|
|
456
|
+
function ge(f) {
|
|
457
457
|
return String(f).padStart(2, "0");
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function Ct(f, e, t, r, i, s) {
|
|
460
460
|
return {
|
|
461
461
|
yyyy: String(f).padStart(4, "0"),
|
|
462
|
-
yy:
|
|
463
|
-
MM:
|
|
462
|
+
yy: ge(f % 100),
|
|
463
|
+
MM: ge(e),
|
|
464
464
|
M: String(e),
|
|
465
|
-
dd:
|
|
465
|
+
dd: ge(t),
|
|
466
466
|
d: String(t),
|
|
467
|
-
HH:
|
|
467
|
+
HH: ge(r),
|
|
468
468
|
H: String(r),
|
|
469
|
-
mm:
|
|
470
|
-
ss:
|
|
469
|
+
mm: ge(i),
|
|
470
|
+
ss: ge(s)
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function $t(f, e) {
|
|
474
474
|
let t;
|
|
475
475
|
try {
|
|
476
476
|
t = new Intl.DateTimeFormat("en-US", {
|
|
@@ -490,9 +490,9 @@ function Ct(f, e) {
|
|
|
490
490
|
for (const u of t)
|
|
491
491
|
u.type !== "literal" && (r[u.type] = u.value);
|
|
492
492
|
const i = Number(r.year), s = Number(r.month), n = Number(r.day), a = Number(r.hour), o = Number(r.minute), l = Number(r.second);
|
|
493
|
-
return !Number.isFinite(i) || !Number.isFinite(s) || !Number.isFinite(n) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(l) ? null :
|
|
493
|
+
return !Number.isFinite(i) || !Number.isFinite(s) || !Number.isFinite(n) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(l) ? null : Ct(i, s, n, a, o, l);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ze(f, e = Ft, t) {
|
|
496
496
|
if (f == null || f === "")
|
|
497
497
|
return "";
|
|
498
498
|
const r = f instanceof Date ? f : new Date(f);
|
|
@@ -500,10 +500,10 @@ function Je(f, e = It, t) {
|
|
|
500
500
|
return "";
|
|
501
501
|
let i;
|
|
502
502
|
if (typeof t == "string" && t.trim() !== "") {
|
|
503
|
-
if (i =
|
|
503
|
+
if (i = $t(r, t.trim()), i === null)
|
|
504
504
|
return "";
|
|
505
505
|
} else
|
|
506
|
-
i =
|
|
506
|
+
i = Ct(
|
|
507
507
|
r.getFullYear(),
|
|
508
508
|
r.getMonth() + 1,
|
|
509
509
|
r.getDate(),
|
|
@@ -517,15 +517,15 @@ function Je(f, e = It, t) {
|
|
|
517
517
|
(n, a) => a !== void 0 ? a === "" ? "'" : a : s[n]
|
|
518
518
|
);
|
|
519
519
|
}
|
|
520
|
-
const
|
|
521
|
-
function Mt(f =
|
|
522
|
-
return
|
|
520
|
+
const sr = "yyyy-MM-dd";
|
|
521
|
+
function Mt(f = Ft, e) {
|
|
522
|
+
return Ze(/* @__PURE__ */ new Date(), f, e);
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Pt(f = 0, e = sr, t) {
|
|
525
525
|
const r = Number.isFinite(f) ? Math.trunc(f) : 0, i = typeof t == "string" && t.trim() !== "" ? t.trim() : "";
|
|
526
526
|
let s, n, a;
|
|
527
527
|
if (i !== "") {
|
|
528
|
-
const l =
|
|
528
|
+
const l = $t(/* @__PURE__ */ new Date(), i);
|
|
529
529
|
if (l === null)
|
|
530
530
|
return "";
|
|
531
531
|
s = Number(l.yyyy), n = Number(l.MM), a = Number(l.dd);
|
|
@@ -534,9 +534,9 @@ function $t(f = 0, e = ir, t) {
|
|
|
534
534
|
s = l.getFullYear(), n = l.getMonth() + 1, a = l.getDate();
|
|
535
535
|
}
|
|
536
536
|
const o = new Date(Date.UTC(s, n - 1, a + r));
|
|
537
|
-
return
|
|
537
|
+
return Ze(o, e, "UTC");
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Lt(f, e) {
|
|
540
540
|
if (f == null)
|
|
541
541
|
return "";
|
|
542
542
|
let t;
|
|
@@ -555,23 +555,23 @@ function Pt(f, e) {
|
|
|
555
555
|
const i = Math.max(0, Math.trunc(e));
|
|
556
556
|
r.minimumFractionDigits = i, r.maximumFractionDigits = i;
|
|
557
557
|
}
|
|
558
|
-
return new Intl.NumberFormat(
|
|
558
|
+
return new Intl.NumberFormat(ir, r).format(t);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Ot(f, e, t) {
|
|
561
561
|
let r, i, s;
|
|
562
562
|
if (e === void 0 ? (r = 0, i = f, s = 1) : (r = f, i = e, s = t === void 0 ? 1 : t), !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(s) || s === 0)
|
|
563
563
|
return [];
|
|
564
564
|
r = Math.trunc(r), i = Math.trunc(i), s = Math.trunc(s);
|
|
565
565
|
const n = [];
|
|
566
566
|
if (s > 0)
|
|
567
|
-
for (let a = r; a < i && n.length <
|
|
567
|
+
for (let a = r; a < i && n.length < ft; a += s)
|
|
568
568
|
n.push(a);
|
|
569
569
|
else
|
|
570
|
-
for (let a = r; a > i && n.length <
|
|
570
|
+
for (let a = r; a > i && n.length < ft; a += s)
|
|
571
571
|
n.push(a);
|
|
572
572
|
return n;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Bt(f, e, t = {}) {
|
|
575
575
|
const r = Math.trunc(Number(f));
|
|
576
576
|
if (!Number.isFinite(r) || r <= 0)
|
|
577
577
|
return [];
|
|
@@ -608,62 +608,62 @@ function Ot(f, e, t = {}) {
|
|
|
608
608
|
}
|
|
609
609
|
return l;
|
|
610
610
|
}
|
|
611
|
-
const
|
|
612
|
-
function
|
|
611
|
+
const nr = /^(\d{4})-(\d{1,2})$/, ar = 1200;
|
|
612
|
+
function qe(f, e) {
|
|
613
613
|
const t = Number(f);
|
|
614
614
|
return Number.isFinite(t) ? Math.trunc(t) : e;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Qe(f, e) {
|
|
617
617
|
if (typeof f != "string")
|
|
618
618
|
return "";
|
|
619
|
-
const t =
|
|
619
|
+
const t = nr.exec(f.trim());
|
|
620
620
|
if (!t)
|
|
621
621
|
return "";
|
|
622
622
|
const r = Number(t[1]), i = Number(t[2]);
|
|
623
623
|
if (i < 1 || i > 12)
|
|
624
624
|
return "";
|
|
625
625
|
const s = Number.isFinite(e) ? Math.trunc(e) : 0, n = r * 12 + (i - 1) + s, a = Math.floor(n / 12), o = n - a * 12 + 1;
|
|
626
|
-
return `${String(a).padStart(4, "0")}-${
|
|
626
|
+
return `${String(a).padStart(4, "0")}-${ge(o)}`;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function or(f) {
|
|
629
629
|
if (typeof f == "string" && f.trim() !== "")
|
|
630
|
-
return
|
|
630
|
+
return Qe(f, 0);
|
|
631
631
|
const e = /* @__PURE__ */ new Date();
|
|
632
|
-
return `${String(e.getFullYear()).padStart(4, "0")}-${
|
|
632
|
+
return `${String(e.getFullYear()).padStart(4, "0")}-${ge(e.getMonth() + 1)}`;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function Ut(f, e) {
|
|
635
635
|
const t = Math.trunc(Number(f));
|
|
636
636
|
if (!Number.isFinite(t) || t < 0)
|
|
637
637
|
return [];
|
|
638
|
-
const r =
|
|
638
|
+
const r = or(e);
|
|
639
639
|
if (r === "")
|
|
640
640
|
return [];
|
|
641
|
-
const i = Math.min(t,
|
|
641
|
+
const i = Math.min(t, ar), s = [];
|
|
642
642
|
for (let n = 0; n <= i; n += 1) {
|
|
643
|
-
const a =
|
|
643
|
+
const a = Qe(r, -n);
|
|
644
644
|
s.push({ targetMonth: a, label: a.replace(/-/g, "/") });
|
|
645
645
|
}
|
|
646
646
|
return s;
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function Ht(f, e) {
|
|
649
649
|
const t = { start: 0, end: 0, total: 0, empty: !0 };
|
|
650
650
|
if (!f || typeof f != "object")
|
|
651
651
|
return t;
|
|
652
|
-
const r = f, i =
|
|
652
|
+
const r = f, i = qe(r.totalElements ?? r.totalCount, 0);
|
|
653
653
|
if (i <= 0)
|
|
654
654
|
return t;
|
|
655
|
-
const s = Math.max(0,
|
|
655
|
+
const s = Math.max(0, qe(r.number, 0)), n = Math.max(0, qe(r.size, 0)), a = s * n, o = Math.min(a + 1, i);
|
|
656
656
|
let l;
|
|
657
657
|
if (e !== void 0 && Number.isFinite(e))
|
|
658
658
|
l = Math.max(0, Math.trunc(e));
|
|
659
659
|
else {
|
|
660
|
-
const d =
|
|
660
|
+
const d = qe(r.numberOfElements, NaN);
|
|
661
661
|
l = Number.isFinite(d) ? d : Math.min(n, i - a);
|
|
662
662
|
}
|
|
663
663
|
const u = Math.min(a + l, i);
|
|
664
664
|
return { start: o, end: Math.max(u, o), total: i, empty: !1 };
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Vt(f, e, t) {
|
|
667
667
|
if (!Array.isArray(f) || f.length === 0)
|
|
668
668
|
return null;
|
|
669
669
|
const r = String(t), i = f.find(
|
|
@@ -671,7 +671,7 @@ function Ht(f, e, t) {
|
|
|
671
671
|
);
|
|
672
672
|
return i === void 0 ? null : i;
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function qt(f, e) {
|
|
675
675
|
if (!Array.isArray(f))
|
|
676
676
|
return 0;
|
|
677
677
|
let t = 0;
|
|
@@ -684,25 +684,25 @@ function Vt(f, e) {
|
|
|
684
684
|
}
|
|
685
685
|
return t;
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function Wt(f, e) {
|
|
688
688
|
return e == null || f == null ? String(f) : String(f[e]);
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function jt(f, e) {
|
|
691
691
|
if (!Array.isArray(f))
|
|
692
692
|
return [];
|
|
693
693
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
694
694
|
for (const i of f) {
|
|
695
|
-
const s =
|
|
695
|
+
const s = Wt(i, e);
|
|
696
696
|
t.has(s) || (t.add(s), r.push(i));
|
|
697
697
|
}
|
|
698
698
|
return r;
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Kt(f, e) {
|
|
701
701
|
if (!Array.isArray(f))
|
|
702
702
|
return [];
|
|
703
703
|
const t = /* @__PURE__ */ new Map(), r = [];
|
|
704
704
|
for (const i of f) {
|
|
705
|
-
const s =
|
|
705
|
+
const s = Wt(i, e), n = t.get(s);
|
|
706
706
|
if (n === void 0) {
|
|
707
707
|
const a = i == null ? i : i[e];
|
|
708
708
|
t.set(s, r.length), r.push({ key: a, items: [i] });
|
|
@@ -711,22 +711,22 @@ function jt(f, e) {
|
|
|
711
711
|
}
|
|
712
712
|
return r;
|
|
713
713
|
}
|
|
714
|
-
const
|
|
715
|
-
date:
|
|
714
|
+
const lr = Object.freeze({
|
|
715
|
+
date: Ze,
|
|
716
716
|
now: Mt,
|
|
717
|
-
today:
|
|
718
|
-
number:
|
|
719
|
-
pages:
|
|
720
|
-
range:
|
|
721
|
-
monthAdd:
|
|
722
|
-
monthRange:
|
|
723
|
-
pageSummary:
|
|
724
|
-
findBy:
|
|
725
|
-
sum:
|
|
726
|
-
distinct:
|
|
727
|
-
groupBy:
|
|
717
|
+
today: Pt,
|
|
718
|
+
number: Lt,
|
|
719
|
+
pages: Bt,
|
|
720
|
+
range: Ot,
|
|
721
|
+
monthAdd: Qe,
|
|
722
|
+
monthRange: Ut,
|
|
723
|
+
pageSummary: Ht,
|
|
724
|
+
findBy: Vt,
|
|
725
|
+
sum: qt,
|
|
726
|
+
distinct: jt,
|
|
727
|
+
groupBy: Kt
|
|
728
728
|
});
|
|
729
|
-
class
|
|
729
|
+
class at {
|
|
730
730
|
constructor() {
|
|
731
731
|
this.MAX_BUDGET = 8, this.queue = [], this.processing = !1, this.channel = null;
|
|
732
732
|
}
|
|
@@ -838,7 +838,7 @@ class nt {
|
|
|
838
838
|
async waitForIdle(e = 1e3) {
|
|
839
839
|
let t = 0, r = 0;
|
|
840
840
|
for (; t < 2 && r < e; )
|
|
841
|
-
this.processing || this.queue.length > 0 ? (await this.wait(), t = 0) : t += 1, await
|
|
841
|
+
this.processing || this.queue.length > 0 ? (await this.wait(), t = 0) : t += 1, await at.nextTick(), r += 1;
|
|
842
842
|
}
|
|
843
843
|
/**
|
|
844
844
|
* 次のフレーム(または 1 マクロタスク)まで待機します。
|
|
@@ -851,7 +851,7 @@ class nt {
|
|
|
851
851
|
});
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
const
|
|
854
|
+
const lt = class lt {
|
|
855
855
|
/**
|
|
856
856
|
* タスクをキューに追加します。
|
|
857
857
|
*
|
|
@@ -878,9 +878,9 @@ const ot = class ot {
|
|
|
878
878
|
return this.ASYNC_QUEUE.waitForIdle(e);
|
|
879
879
|
}
|
|
880
880
|
};
|
|
881
|
-
|
|
882
|
-
let J =
|
|
883
|
-
const
|
|
881
|
+
lt.ASYNC_QUEUE = new at();
|
|
882
|
+
let J = lt;
|
|
883
|
+
const zt = /* @__PURE__ */ new Set([
|
|
884
884
|
"window",
|
|
885
885
|
"self",
|
|
886
886
|
"globalThis",
|
|
@@ -908,10 +908,10 @@ const Kt = /* @__PURE__ */ new Set([
|
|
|
908
908
|
"sessionStorage",
|
|
909
909
|
"IndexedDB",
|
|
910
910
|
"history"
|
|
911
|
-
]),
|
|
911
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
912
912
|
"eval",
|
|
913
913
|
"arguments"
|
|
914
|
-
]),
|
|
914
|
+
]), Gt = /* @__PURE__ */ new Set([
|
|
915
915
|
"location",
|
|
916
916
|
"history",
|
|
917
917
|
"document",
|
|
@@ -919,11 +919,11 @@ const Kt = /* @__PURE__ */ new Set([
|
|
|
919
919
|
"localStorage",
|
|
920
920
|
"sessionStorage",
|
|
921
921
|
"IndexedDB"
|
|
922
|
-
]),
|
|
922
|
+
]), ze = /* @__PURE__ */ new Set([
|
|
923
923
|
"constructor",
|
|
924
924
|
"__proto__",
|
|
925
925
|
"prototype"
|
|
926
|
-
]),
|
|
926
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
927
927
|
"await",
|
|
928
928
|
"break",
|
|
929
929
|
"case",
|
|
@@ -957,7 +957,7 @@ const Kt = /* @__PURE__ */ new Set([
|
|
|
957
957
|
"while",
|
|
958
958
|
"with",
|
|
959
959
|
"yield"
|
|
960
|
-
]),
|
|
960
|
+
]), it = /* @__PURE__ */ new Set([
|
|
961
961
|
"enum",
|
|
962
962
|
"implements",
|
|
963
963
|
"interface",
|
|
@@ -967,7 +967,7 @@ const Kt = /* @__PURE__ */ new Set([
|
|
|
967
967
|
"public",
|
|
968
968
|
"static",
|
|
969
969
|
"super"
|
|
970
|
-
]),
|
|
970
|
+
]), Yt = /* @__PURE__ */ new Set([
|
|
971
971
|
"Math",
|
|
972
972
|
"JSON",
|
|
973
973
|
"Intl",
|
|
@@ -1018,7 +1018,7 @@ const Kt = /* @__PURE__ */ new Set([
|
|
|
1018
1018
|
"encodeURIComponent",
|
|
1019
1019
|
"decodeURI",
|
|
1020
1020
|
"decodeURIComponent"
|
|
1021
|
-
]),
|
|
1021
|
+
]), cr = [
|
|
1022
1022
|
">>>",
|
|
1023
1023
|
"===",
|
|
1024
1024
|
"!==",
|
|
@@ -1055,7 +1055,7 @@ const Kt = /* @__PURE__ */ new Set([
|
|
|
1055
1055
|
"!",
|
|
1056
1056
|
"<",
|
|
1057
1057
|
">"
|
|
1058
|
-
],
|
|
1058
|
+
], ur = {
|
|
1059
1059
|
"==": 1,
|
|
1060
1060
|
"!=": 1,
|
|
1061
1061
|
"===": 1,
|
|
@@ -1072,19 +1072,19 @@ const Kt = /* @__PURE__ */ new Set([
|
|
|
1072
1072
|
"*": 5,
|
|
1073
1073
|
"/": 5,
|
|
1074
1074
|
"%": 5
|
|
1075
|
-
},
|
|
1075
|
+
}, dr = /* @__PURE__ */ new Set([
|
|
1076
1076
|
"undefined",
|
|
1077
1077
|
"NaN",
|
|
1078
1078
|
"Infinity"
|
|
1079
1079
|
]);
|
|
1080
|
-
function
|
|
1080
|
+
function et(f) {
|
|
1081
1081
|
return f === `
|
|
1082
1082
|
` || f === "\r" || f === "\u2028" || f === "\u2029";
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1084
|
+
function hr(f) {
|
|
1085
1085
|
return /[A-Za-z_$]/.test(f);
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function pt(f) {
|
|
1088
1088
|
return f !== void 0 && /[A-Za-z0-9_$]/.test(f);
|
|
1089
1089
|
}
|
|
1090
1090
|
function Y(f, e) {
|
|
@@ -1113,7 +1113,7 @@ const X = {
|
|
|
1113
1113
|
unaryExponent: "Unary operator used immediately before exponentiation expression",
|
|
1114
1114
|
invalidUpdate: "Invalid left-hand side expression in update operation"
|
|
1115
1115
|
};
|
|
1116
|
-
class
|
|
1116
|
+
class fr {
|
|
1117
1117
|
/**
|
|
1118
1118
|
* @param source 式の文字列
|
|
1119
1119
|
*/
|
|
@@ -1130,7 +1130,7 @@ class hr {
|
|
|
1130
1130
|
let t = !1;
|
|
1131
1131
|
for (; this.position < e.length; ) {
|
|
1132
1132
|
const n = e[this.position];
|
|
1133
|
-
if (
|
|
1133
|
+
if (et(n))
|
|
1134
1134
|
t = !0;
|
|
1135
1135
|
else if (!/\s/.test(n))
|
|
1136
1136
|
break;
|
|
@@ -1144,9 +1144,9 @@ class hr {
|
|
|
1144
1144
|
return this.readNumber(r, t);
|
|
1145
1145
|
if (i === '"' || i === "'")
|
|
1146
1146
|
return this.readString(r, t);
|
|
1147
|
-
if (
|
|
1147
|
+
if (hr(i)) {
|
|
1148
1148
|
let n = r + 1;
|
|
1149
|
-
for (;
|
|
1149
|
+
for (; pt(e[n]); )
|
|
1150
1150
|
n += 1;
|
|
1151
1151
|
return this.position = n, {
|
|
1152
1152
|
type: "identifier",
|
|
@@ -1158,7 +1158,7 @@ class hr {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
if (i === "/" && (s === "/" || s === "*"))
|
|
1160
1160
|
throw Y(X.comment, r);
|
|
1161
|
-
for (const n of
|
|
1161
|
+
for (const n of cr)
|
|
1162
1162
|
if (e.startsWith(n, r))
|
|
1163
1163
|
return this.position = r + n.length, {
|
|
1164
1164
|
type: "punct",
|
|
@@ -1185,11 +1185,11 @@ class hr {
|
|
|
1185
1185
|
let i = e + 1, s = !1;
|
|
1186
1186
|
for (; ; ) {
|
|
1187
1187
|
const l = r[i];
|
|
1188
|
-
if (l === void 0 ||
|
|
1188
|
+
if (l === void 0 || et(l))
|
|
1189
1189
|
throw Y(X.unterminatedRegExp, e);
|
|
1190
1190
|
if (l === "\\") {
|
|
1191
1191
|
const u = r[i + 1];
|
|
1192
|
-
if (
|
|
1192
|
+
if (et(u))
|
|
1193
1193
|
throw Y(X.unterminatedRegExp, e);
|
|
1194
1194
|
i += 2;
|
|
1195
1195
|
continue;
|
|
@@ -1205,7 +1205,7 @@ class hr {
|
|
|
1205
1205
|
const n = r.slice(e + 1, i);
|
|
1206
1206
|
i += 1;
|
|
1207
1207
|
const a = i;
|
|
1208
|
-
for (;
|
|
1208
|
+
for (; pt(r[i]); )
|
|
1209
1209
|
i += 1;
|
|
1210
1210
|
const o = r.slice(a, i);
|
|
1211
1211
|
try {
|
|
@@ -1409,12 +1409,12 @@ class hr {
|
|
|
1409
1409
|
};
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
class
|
|
1412
|
+
class pr {
|
|
1413
1413
|
/**
|
|
1414
1414
|
* @param source 式の文字列
|
|
1415
1415
|
*/
|
|
1416
1416
|
constructor(e) {
|
|
1417
|
-
this.lastEnd = 0, this.lexer = new
|
|
1417
|
+
this.lastEnd = 0, this.lexer = new fr(e), this.token = this.lexer.lex();
|
|
1418
1418
|
}
|
|
1419
1419
|
/**
|
|
1420
1420
|
* 式全体を解析します。
|
|
@@ -1509,7 +1509,7 @@ class fr {
|
|
|
1509
1509
|
* @param position 位置
|
|
1510
1510
|
*/
|
|
1511
1511
|
checkReferenceName(e, t) {
|
|
1512
|
-
if (
|
|
1512
|
+
if (Ge.has(e) || Ke.has(e) || it.has(e))
|
|
1513
1513
|
throw Y(X.notInExpressions(e), t);
|
|
1514
1514
|
}
|
|
1515
1515
|
/**
|
|
@@ -1532,7 +1532,7 @@ class fr {
|
|
|
1532
1532
|
* @param position 位置
|
|
1533
1533
|
*/
|
|
1534
1534
|
checkPropertyName(e, t) {
|
|
1535
|
-
if (
|
|
1535
|
+
if (Ge.has(e) || Ke.has(e) || ze.has(e))
|
|
1536
1536
|
throw Y(X.notProperty(e), t);
|
|
1537
1537
|
}
|
|
1538
1538
|
/**
|
|
@@ -1795,7 +1795,7 @@ class fr {
|
|
|
1795
1795
|
const t = this.token.start;
|
|
1796
1796
|
let r = this.parseExponent();
|
|
1797
1797
|
for (; ; ) {
|
|
1798
|
-
const i = this.token, s = i.type === "punct" ?
|
|
1798
|
+
const i = this.token, s = i.type === "punct" ? ur[i.value] : void 0;
|
|
1799
1799
|
if (s === void 0 || s < e)
|
|
1800
1800
|
return r;
|
|
1801
1801
|
this.advance();
|
|
@@ -1891,7 +1891,7 @@ class fr {
|
|
|
1891
1891
|
return !0;
|
|
1892
1892
|
switch (e.type) {
|
|
1893
1893
|
case "Identifier":
|
|
1894
|
-
return !
|
|
1894
|
+
return !dr.has(e.name);
|
|
1895
1895
|
case "Member":
|
|
1896
1896
|
case "Call":
|
|
1897
1897
|
return !0;
|
|
@@ -1996,7 +1996,7 @@ class fr {
|
|
|
1996
1996
|
return this.checkPropertyName(e.value, e.start), this.advance(), e.value;
|
|
1997
1997
|
if (e.type === "string") {
|
|
1998
1998
|
const t = e.literal;
|
|
1999
|
-
if (
|
|
1999
|
+
if (ze.has(t))
|
|
2000
2000
|
throw Y(X.notProperty(t), e.start);
|
|
2001
2001
|
return this.advance(), t;
|
|
2002
2002
|
}
|
|
@@ -2108,10 +2108,10 @@ class fr {
|
|
|
2108
2108
|
throw this.unexpected();
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2112
|
-
return new
|
|
2111
|
+
function gr(f) {
|
|
2112
|
+
return new pr(f).parseProgram();
|
|
2113
2113
|
}
|
|
2114
|
-
class
|
|
2114
|
+
class Xt extends ReferenceError {
|
|
2115
2115
|
/**
|
|
2116
2116
|
* @param identifier 参照された名前
|
|
2117
2117
|
*/
|
|
@@ -2119,25 +2119,25 @@ class Yt extends ReferenceError {
|
|
|
2119
2119
|
super(`${e} is not defined`), this.identifier = e;
|
|
2120
2120
|
}
|
|
2121
2121
|
}
|
|
2122
|
-
const
|
|
2122
|
+
const gt = /* @__PURE__ */ new Map([
|
|
2123
2123
|
["undefined", void 0],
|
|
2124
2124
|
["NaN", NaN],
|
|
2125
2125
|
["Infinity", 1 / 0]
|
|
2126
2126
|
]);
|
|
2127
|
-
function
|
|
2127
|
+
function mt(f, e) {
|
|
2128
2128
|
return Object.prototype.propertyIsEnumerable.call(f, e);
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2130
|
+
function yt(f) {
|
|
2131
2131
|
const e = typeof f == "symbol" ? f : String(f);
|
|
2132
|
-
return
|
|
2132
|
+
return ze.has(e) ? "undefined" : e;
|
|
2133
2133
|
}
|
|
2134
|
-
function
|
|
2134
|
+
function mr(f) {
|
|
2135
2135
|
return typeof f == "bigint" ? f : Number(f);
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function bt(f) {
|
|
2138
2138
|
return f[Symbol.iterator]();
|
|
2139
2139
|
}
|
|
2140
|
-
function
|
|
2140
|
+
function Et(f, e, t) {
|
|
2141
2141
|
const r = Object(e);
|
|
2142
2142
|
for (const i of Reflect.ownKeys(r)) {
|
|
2143
2143
|
if (t?.has(i))
|
|
@@ -2150,7 +2150,7 @@ function bt(f, e, t) {
|
|
|
2150
2150
|
});
|
|
2151
2151
|
}
|
|
2152
2152
|
}
|
|
2153
|
-
const
|
|
2153
|
+
const ct = class ct {
|
|
2154
2154
|
/**
|
|
2155
2155
|
* 式を解析し、評価できる形へ変換します。結果は式ごとに控えます。
|
|
2156
2156
|
*
|
|
@@ -2166,7 +2166,7 @@ const lt = class lt {
|
|
|
2166
2166
|
return t;
|
|
2167
2167
|
let r;
|
|
2168
2168
|
try {
|
|
2169
|
-
const i =
|
|
2169
|
+
const i = gr(e);
|
|
2170
2170
|
r = {
|
|
2171
2171
|
expression: e,
|
|
2172
2172
|
evaluator: this.compileNode(i, null)
|
|
@@ -2330,7 +2330,7 @@ const lt = class lt {
|
|
|
2330
2330
|
* @returns 種類
|
|
2331
2331
|
*/
|
|
2332
2332
|
static classify(e) {
|
|
2333
|
-
return
|
|
2333
|
+
return Gt.has(e) ? "rebindable" : zt.has(e) ? "forbidden" : gt.has(e) ? "constant" : Yt.has(e) ? "builtin" : "free";
|
|
2334
2334
|
}
|
|
2335
2335
|
/**
|
|
2336
2336
|
* バインドに無い識別子を参照したときの値を返します。
|
|
@@ -2341,7 +2341,7 @@ const lt = class lt {
|
|
|
2341
2341
|
*/
|
|
2342
2342
|
static missing(e, t) {
|
|
2343
2343
|
if (e.missingIdentifier === "throw")
|
|
2344
|
-
throw new
|
|
2344
|
+
throw new Xt(t);
|
|
2345
2345
|
}
|
|
2346
2346
|
/**
|
|
2347
2347
|
* 識別子の参照を変換します。
|
|
@@ -2366,14 +2366,14 @@ const lt = class lt {
|
|
|
2366
2366
|
const n = s.run;
|
|
2367
2367
|
if (n.overlay !== null && n.overlay.has(e))
|
|
2368
2368
|
return n.overlay.get(e);
|
|
2369
|
-
if (
|
|
2369
|
+
if (mt(n.bindings, e))
|
|
2370
2370
|
return n.bindings[e];
|
|
2371
2371
|
switch (i) {
|
|
2372
2372
|
// 再バインドできる禁止識別子は、バインド値に無ければ `undefined`
|
|
2373
2373
|
// (`CONSTANTS` に無い名前なので、定数の分岐と同じ結果になる)。
|
|
2374
2374
|
case "rebindable":
|
|
2375
2375
|
case "constant":
|
|
2376
|
-
return
|
|
2376
|
+
return gt.get(e);
|
|
2377
2377
|
case "builtin":
|
|
2378
2378
|
return globalThis[e];
|
|
2379
2379
|
default:
|
|
@@ -2394,7 +2394,7 @@ const lt = class lt {
|
|
|
2394
2394
|
*/
|
|
2395
2395
|
static compileUpdate(e, t) {
|
|
2396
2396
|
const r = e.argument.name, i = e.operator === "++" ? 1 : -1, s = e.prefix, n = (u) => {
|
|
2397
|
-
const d =
|
|
2397
|
+
const d = mr(u), y = typeof d == "bigint" ? d + BigInt(i) : d + i;
|
|
2398
2398
|
return [d, y];
|
|
2399
2399
|
}, a = this.findSlot(r, t);
|
|
2400
2400
|
if (a !== null) {
|
|
@@ -2407,7 +2407,7 @@ const lt = class lt {
|
|
|
2407
2407
|
const o = this.classify(r), l = this.compileIdentifier(r, null);
|
|
2408
2408
|
return (u) => {
|
|
2409
2409
|
const d = u.run;
|
|
2410
|
-
if (!(o !== "forbidden" &&
|
|
2410
|
+
if (!(o !== "forbidden" && mt(d.bindings, r)) && o !== "free")
|
|
2411
2411
|
throw new TypeError(`Assignment to constant variable '${r}'.`);
|
|
2412
2412
|
const [b, E] = n(l(u));
|
|
2413
2413
|
return d.overlay === null && (d.overlay = /* @__PURE__ */ new Map()), d.overlay.set(r, E), s ? E : b;
|
|
@@ -2483,7 +2483,7 @@ const lt = class lt {
|
|
|
2483
2483
|
return (s) => {
|
|
2484
2484
|
const n = r(s);
|
|
2485
2485
|
if (n != null)
|
|
2486
|
-
return n[
|
|
2486
|
+
return n[yt(i(s))];
|
|
2487
2487
|
};
|
|
2488
2488
|
}
|
|
2489
2489
|
/**
|
|
@@ -2508,7 +2508,7 @@ const lt = class lt {
|
|
|
2508
2508
|
if (a === null)
|
|
2509
2509
|
n += 1;
|
|
2510
2510
|
else if (a.spread) {
|
|
2511
|
-
const o =
|
|
2511
|
+
const o = bt(a.evaluate(i));
|
|
2512
2512
|
for (; ; ) {
|
|
2513
2513
|
const l = o.next();
|
|
2514
2514
|
if (l.done)
|
|
@@ -2550,7 +2550,7 @@ const lt = class lt {
|
|
|
2550
2550
|
return (i) => {
|
|
2551
2551
|
const s = {};
|
|
2552
2552
|
for (const n of r)
|
|
2553
|
-
n.key === null ?
|
|
2553
|
+
n.key === null ? Et(s, n.evaluate(i), null) : s[n.key] = n.evaluate(i);
|
|
2554
2554
|
return s;
|
|
2555
2555
|
};
|
|
2556
2556
|
}
|
|
@@ -2581,7 +2581,7 @@ const lt = class lt {
|
|
|
2581
2581
|
const y = o(d);
|
|
2582
2582
|
if (y == null)
|
|
2583
2583
|
return;
|
|
2584
|
-
const b = u === null ? l :
|
|
2584
|
+
const b = u === null ? l : yt(u(d));
|
|
2585
2585
|
return s(y[b], y, d);
|
|
2586
2586
|
};
|
|
2587
2587
|
}
|
|
@@ -2626,7 +2626,7 @@ const lt = class lt {
|
|
|
2626
2626
|
);
|
|
2627
2627
|
if (i !== null) {
|
|
2628
2628
|
const o = {};
|
|
2629
|
-
|
|
2629
|
+
Et(o, a, s), n.slots[i] = o;
|
|
2630
2630
|
}
|
|
2631
2631
|
};
|
|
2632
2632
|
}
|
|
@@ -2635,7 +2635,7 @@ const lt = class lt {
|
|
|
2635
2635
|
(s) => s === null ? null : this.compilePattern(s, t)
|
|
2636
2636
|
), i = e.rest === null ? null : this.compilePattern(e.rest, t);
|
|
2637
2637
|
return (s, n) => {
|
|
2638
|
-
const a =
|
|
2638
|
+
const a = bt(n);
|
|
2639
2639
|
let o = !1;
|
|
2640
2640
|
try {
|
|
2641
2641
|
for (const l of r) {
|
|
@@ -2710,8 +2710,8 @@ const lt = class lt {
|
|
|
2710
2710
|
};
|
|
2711
2711
|
}
|
|
2712
2712
|
};
|
|
2713
|
-
|
|
2714
|
-
let
|
|
2713
|
+
ct.COMPILE_CACHE = /* @__PURE__ */ new Map();
|
|
2714
|
+
let Le = ct;
|
|
2715
2715
|
const T = class T {
|
|
2716
2716
|
/**
|
|
2717
2717
|
* 明示バインド内に持ち込まれてはならない危険値を返します。
|
|
@@ -3169,7 +3169,7 @@ let ${e.join(", ")};`;
|
|
|
3169
3169
|
* @returns 未解決として報告する識別子名の一覧
|
|
3170
3170
|
*/
|
|
3171
3171
|
static extractUninitializedIdentifiers(e, t) {
|
|
3172
|
-
if (e instanceof
|
|
3172
|
+
if (e instanceof Xt)
|
|
3173
3173
|
return [e.identifier];
|
|
3174
3174
|
const r = String(e.message || ""), i = t.filter(
|
|
3175
3175
|
(s) => ["'", '"', "`"].some(
|
|
@@ -3199,7 +3199,7 @@ let ${e.join(", ")};`;
|
|
|
3199
3199
|
);
|
|
3200
3200
|
return;
|
|
3201
3201
|
}
|
|
3202
|
-
|
|
3202
|
+
V.isEnabled() && (e.forEach((r) => {
|
|
3203
3203
|
this.pendingUnresolvedIdentifiers.add(r);
|
|
3204
3204
|
}), this.scheduleUnresolvedIdentifierReport());
|
|
3205
3205
|
}
|
|
@@ -3256,7 +3256,7 @@ let ${e.join(", ")};`;
|
|
|
3256
3256
|
* @return 戻り値はありません。
|
|
3257
3257
|
*/
|
|
3258
3258
|
static recordRowScopeIdentifiers(e) {
|
|
3259
|
-
if (
|
|
3259
|
+
if (V.isEnabled())
|
|
3260
3260
|
for (const t of e)
|
|
3261
3261
|
typeof t == "string" && t !== "" && this.rowScopeIdentifiers.add(t);
|
|
3262
3262
|
}
|
|
@@ -3313,6 +3313,24 @@ ${t}`;
|
|
|
3313
3313
|
);
|
|
3314
3314
|
}
|
|
3315
3315
|
}
|
|
3316
|
+
/**
|
|
3317
|
+
* 未解決参照の診断に記録せずに評価します。
|
|
3318
|
+
*
|
|
3319
|
+
* 宣言を描くための評価ではないもの(入力欄の値を決めるための確認や、使用する直前に
|
|
3320
|
+
* 評価し直す属性の描画のときの評価)に使います(仕様「未解決参照の診断」)。
|
|
3321
|
+
* 入れ子にはできません(内側の呼び出しが終わると記録を再開します)。
|
|
3322
|
+
*
|
|
3323
|
+
* @param callback 評価を行う関数
|
|
3324
|
+
* @returns `callback` の戻り値
|
|
3325
|
+
*/
|
|
3326
|
+
static withoutDiagnosis(e) {
|
|
3327
|
+
T.evaluatingForDiagnosis = !0;
|
|
3328
|
+
try {
|
|
3329
|
+
return e();
|
|
3330
|
+
} finally {
|
|
3331
|
+
T.evaluatingForDiagnosis = !1;
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3316
3334
|
/**
|
|
3317
3335
|
* 予約キー(エンジン管理変数)かどうかを判定します。
|
|
3318
3336
|
*
|
|
@@ -3430,7 +3448,7 @@ ${t}`;
|
|
|
3430
3448
|
a && (s ? o[this.BUILTIN_NAMESPACE] = {
|
|
3431
3449
|
...this.BUILTIN_HELPERS,
|
|
3432
3450
|
[this.BUILTIN_DATA_PROPERTY]: { ...o }
|
|
3433
|
-
} : o[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(o),
|
|
3451
|
+
} : o[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(o), V.isEnabled() && this.recordSuppliedIdentifiers(o);
|
|
3434
3452
|
const l = r.allowMissingIdentifierRecovery, u = this.extractFreeIdentifiers(e).filter(
|
|
3435
3453
|
(b) => !(b in o) && // 禁止グローバルは buildAssignments が `const` で遮蔽するため対象外
|
|
3436
3454
|
// (二重宣言は構文エラーになる)。
|
|
@@ -3438,7 +3456,7 @@ ${t}`;
|
|
|
3438
3456
|
!this.ALLOWED_GLOBAL_IDENTIFIERS.has(b)
|
|
3439
3457
|
);
|
|
3440
3458
|
let d = null;
|
|
3441
|
-
if (
|
|
3459
|
+
if (V.isEnabled()) {
|
|
3442
3460
|
const b = this.extractBoundIdentifiers(e);
|
|
3443
3461
|
d = b.size === 0 ? u : u.filter((E) => !b.has(E));
|
|
3444
3462
|
}
|
|
@@ -3594,7 +3612,7 @@ ${t}`;
|
|
|
3594
3612
|
const o = {};
|
|
3595
3613
|
t.bindKeys.forEach((l, u) => {
|
|
3596
3614
|
o[l] = s[u];
|
|
3597
|
-
}), n = () =>
|
|
3615
|
+
}), n = () => Le.run(a, o);
|
|
3598
3616
|
} else
|
|
3599
3617
|
n = () => t.evaluator.call(this.BUILTIN_HOLDER, ...s);
|
|
3600
3618
|
return this.getExpressionProfile(e).needsPropertyBlocking ? this.withBlockedPropertyAccess(n) : n();
|
|
@@ -3613,7 +3631,7 @@ ${t}`;
|
|
|
3613
3631
|
).parameterCandidates.filter(
|
|
3614
3632
|
(E) => Object.prototype.propertyIsEnumerable.call(t, E) && !this.FORBIDDEN_BINDING_NAMES.has(E)
|
|
3615
3633
|
);
|
|
3616
|
-
if (
|
|
3634
|
+
if (V.isEnabled() && this.reportUnusableBindingKeys(
|
|
3617
3635
|
Object.keys(t).filter((E) => !this.isUsableBindingKey(E))
|
|
3618
3636
|
), c.csp)
|
|
3619
3637
|
return this.prepareInterpretedEvaluator(e, i);
|
|
@@ -3679,7 +3697,7 @@ ${u}return (${y});` + d;
|
|
|
3679
3697
|
*/
|
|
3680
3698
|
static prepareInterpretedEvaluator(e, t) {
|
|
3681
3699
|
try {
|
|
3682
|
-
const r =
|
|
3700
|
+
const r = Le.compile(e);
|
|
3683
3701
|
return { bindKeys: t, evaluator: null, compileFailed: !1, compiled: r };
|
|
3684
3702
|
} catch (r) {
|
|
3685
3703
|
return m.error("[Haori]", "Failed to compile expression:", e, r), this.compileFailedExpressions.add(e), { bindKeys: t, evaluator: null, compileFailed: !0 };
|
|
@@ -3843,13 +3861,10 @@ ${u}return (${y});` + d;
|
|
|
3843
3861
|
const r = T.splitStrictComparison(e);
|
|
3844
3862
|
if (r === null)
|
|
3845
3863
|
return null;
|
|
3846
|
-
T.
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
} finally {
|
|
3851
|
-
T.evaluatingForDiagnosis = !1;
|
|
3852
|
-
}
|
|
3864
|
+
const [i, s] = T.withoutDiagnosis(() => [
|
|
3865
|
+
T.evaluateDetailed(r.left, t),
|
|
3866
|
+
T.evaluateDetailed(r.right, t)
|
|
3867
|
+
]);
|
|
3853
3868
|
if (i.unresolvedReference || s.unresolvedReference)
|
|
3854
3869
|
return null;
|
|
3855
3870
|
const n = i.value, a = s.value;
|
|
@@ -4450,20 +4465,20 @@ ${u}return (${y});` + d;
|
|
|
4450
4465
|
}
|
|
4451
4466
|
};
|
|
4452
4467
|
T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HELPERS = {
|
|
4453
|
-
...
|
|
4468
|
+
...lr
|
|
4454
4469
|
}, T.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, T.BUILTIN_DATA_PROPERTY = "data", T.BUILTIN_DATA_REFERENCE_PATTERN = /(^|[^\w$.])haori\s*(\.\s*data(?![\w$])|\[)/, T.IDENTIFIER_NAME_PATTERN = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u, T.STRICT_PARAMETER_RESERVED_WORDS = /* @__PURE__ */ new Set([
|
|
4455
|
-
...[...
|
|
4456
|
-
...
|
|
4457
|
-
...
|
|
4470
|
+
...[...Ge].filter((e) => e !== "await"),
|
|
4471
|
+
...it,
|
|
4472
|
+
...Ke,
|
|
4458
4473
|
"extends",
|
|
4459
4474
|
"true",
|
|
4460
4475
|
"false",
|
|
4461
4476
|
"null"
|
|
4462
4477
|
]), T.evalBlockedReported = !1, T.usableBindingKeyCache = /* @__PURE__ */ new Map(), T.loggedUnusableBindingKeys = /* @__PURE__ */ new Set(), T.compileFailedExpressions = /* @__PURE__ */ new Set(), T.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), T.forbiddenBindingValueSet = null, T.forbiddenBindingValueCacheResetScheduled = !1, T.loggedForbiddenKeySignatures = /* @__PURE__ */ new Set(), T.loggedForbiddenKeyResetScheduled = !1, T.FORBIDDEN_NAMES = [
|
|
4463
|
-
...
|
|
4478
|
+
...zt
|
|
4464
4479
|
], T.STRICT_FORBIDDEN_NAMES = [
|
|
4465
|
-
...
|
|
4466
|
-
], T.REBINDABLE_FORBIDDEN_NAMES =
|
|
4480
|
+
...Ke
|
|
4481
|
+
], T.REBINDABLE_FORBIDDEN_NAMES = Gt, T.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
|
|
4467
4482
|
...T.FORBIDDEN_NAMES.filter(
|
|
4468
4483
|
(e) => !T.REBINDABLE_FORBIDDEN_NAMES.has(e)
|
|
4469
4484
|
),
|
|
@@ -4471,11 +4486,11 @@ T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HE
|
|
|
4471
4486
|
"__proto__",
|
|
4472
4487
|
"prototype",
|
|
4473
4488
|
...T.STRICT_FORBIDDEN_NAMES
|
|
4474
|
-
]), T.FORBIDDEN_PROPERTY_NAMES =
|
|
4489
|
+
]), T.FORBIDDEN_PROPERTY_NAMES = ze, T.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
|
|
4475
4490
|
"get",
|
|
4476
4491
|
"set",
|
|
4477
4492
|
"async"
|
|
4478
|
-
]), T.DISALLOWED_KEYWORDS =
|
|
4493
|
+
]), T.DISALLOWED_KEYWORDS = Ge, T.NON_SHADOWABLE_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
4479
4494
|
// リテラル・グローバル定数
|
|
4480
4495
|
"true",
|
|
4481
4496
|
"false",
|
|
@@ -4484,8 +4499,8 @@ T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HE
|
|
|
4484
4499
|
"NaN",
|
|
4485
4500
|
"Infinity",
|
|
4486
4501
|
// strict モードの予約語(`let` 宣言が構文エラーになる)
|
|
4487
|
-
...
|
|
4488
|
-
]), T.ALLOWED_GLOBAL_IDENTIFIERS =
|
|
4502
|
+
...it
|
|
4503
|
+
]), T.ALLOWED_GLOBAL_IDENTIFIERS = Yt, T.BUILTIN_HOLDER = Object.freeze(
|
|
4489
4504
|
Object.defineProperties(
|
|
4490
4505
|
{},
|
|
4491
4506
|
Object.fromEntries(
|
|
@@ -4521,8 +4536,8 @@ T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HE
|
|
|
4521
4536
|
"%",
|
|
4522
4537
|
"..."
|
|
4523
4538
|
]), T.strictComparisonSplits = /* @__PURE__ */ new Map(), T.WRAPPED_VALUES = /* @__PURE__ */ new WeakSet();
|
|
4524
|
-
let
|
|
4525
|
-
class
|
|
4539
|
+
let re = T;
|
|
4540
|
+
class Oe {
|
|
4526
4541
|
/**
|
|
4527
4542
|
* URLのクエリパラメータを取得します。
|
|
4528
4543
|
*
|
|
@@ -4603,7 +4618,7 @@ class Le {
|
|
|
4603
4618
|
return /^(?:javascript|vbscript):/i.test(t);
|
|
4604
4619
|
}
|
|
4605
4620
|
}
|
|
4606
|
-
const
|
|
4621
|
+
const ve = "data-haori-if-disabled", At = "input, select, textarea, button, fieldset", P = class P {
|
|
4607
4622
|
/**
|
|
4608
4623
|
* 集計状態を初期化します。
|
|
4609
4624
|
*/
|
|
@@ -4632,7 +4647,7 @@ const Ee = "data-haori-if-disabled", Et = "input, select, textarea, button, fiel
|
|
|
4632
4647
|
* @returns 集計中なら true
|
|
4633
4648
|
*/
|
|
4634
4649
|
static isCollecting() {
|
|
4635
|
-
return P.collecting &&
|
|
4650
|
+
return P.collecting && V.isEnabled();
|
|
4636
4651
|
}
|
|
4637
4652
|
/**
|
|
4638
4653
|
* 現在の集計結果スナップショットを返します。
|
|
@@ -4767,7 +4782,7 @@ ${u.template}`,
|
|
|
4767
4782
|
* @param expressions 今回評価した式一覧
|
|
4768
4783
|
*/
|
|
4769
4784
|
static record(e, t, r) {
|
|
4770
|
-
if (!
|
|
4785
|
+
if (!V.isEnabled() || !e || t.length === 0 || (P.ensureGlobalAccess(), !P.isCollecting()))
|
|
4771
4786
|
return;
|
|
4772
4787
|
const i = P.getOrCreateElementStore(
|
|
4773
4788
|
e.element
|
|
@@ -4800,7 +4815,7 @@ ${u.template}`,
|
|
|
4800
4815
|
* globalThis から dev-only の取得窓口を参照できるようにします。
|
|
4801
4816
|
*/
|
|
4802
4817
|
static ensureGlobalAccess() {
|
|
4803
|
-
if (!
|
|
4818
|
+
if (!V.isEnabled())
|
|
4804
4819
|
return;
|
|
4805
4820
|
const e = globalThis;
|
|
4806
4821
|
e[P.GLOBAL_KEY] === void 0 && (e[P.GLOBAL_KEY] = {
|
|
@@ -4948,31 +4963,31 @@ ${u.template}`,
|
|
|
4948
4963
|
}
|
|
4949
4964
|
};
|
|
4950
4965
|
P.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", P.ELEMENT_STORES = /* @__PURE__ */ new Map(), P.collecting = !1, P.DEFAULT_REPORT_LIMIT = 20;
|
|
4951
|
-
let
|
|
4952
|
-
const
|
|
4966
|
+
let Ye = P;
|
|
4967
|
+
const me = class me {
|
|
4953
4968
|
/**
|
|
4954
4969
|
* フラグメントのコンストラクタ。
|
|
4955
4970
|
*
|
|
4956
4971
|
* @param target 対象ノード
|
|
4957
4972
|
*/
|
|
4958
4973
|
constructor(e) {
|
|
4959
|
-
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e,
|
|
4974
|
+
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e, me.FRAGMENT_CACHE.set(e, this);
|
|
4960
4975
|
}
|
|
4961
4976
|
static get(e) {
|
|
4962
4977
|
if (e == null)
|
|
4963
4978
|
return null;
|
|
4964
|
-
if (
|
|
4965
|
-
return
|
|
4979
|
+
if (me.FRAGMENT_CACHE.has(e))
|
|
4980
|
+
return me.FRAGMENT_CACHE.get(e);
|
|
4966
4981
|
let t;
|
|
4967
4982
|
switch (e.nodeType) {
|
|
4968
4983
|
case Node.ELEMENT_NODE:
|
|
4969
4984
|
t = new R(e);
|
|
4970
4985
|
break;
|
|
4971
4986
|
case Node.TEXT_NODE:
|
|
4972
|
-
t = new
|
|
4987
|
+
t = new de(e);
|
|
4973
4988
|
break;
|
|
4974
4989
|
case Node.COMMENT_NODE:
|
|
4975
|
-
t = new
|
|
4990
|
+
t = new ot(e);
|
|
4976
4991
|
break;
|
|
4977
4992
|
default:
|
|
4978
4993
|
return m.warn("[Haori]", "Unsupported node type:", e.nodeType), null;
|
|
@@ -4990,7 +5005,7 @@ const pe = class pe {
|
|
|
4990
5005
|
* @returns キャッシュ済みのフラグメント。無ければ `null`
|
|
4991
5006
|
*/
|
|
4992
5007
|
static peek(e) {
|
|
4993
|
-
return
|
|
5008
|
+
return me.FRAGMENT_CACHE.get(e) ?? null;
|
|
4994
5009
|
}
|
|
4995
5010
|
/**
|
|
4996
5011
|
* 指定した子ノードを、エンジン自身が出し入れしている最中かどうかを返します。
|
|
@@ -5085,7 +5100,7 @@ const pe = class pe {
|
|
|
5085
5100
|
* @return 除去のPromise
|
|
5086
5101
|
*/
|
|
5087
5102
|
remove(e = !0) {
|
|
5088
|
-
return this.parent && this.parent.removeChild(this),
|
|
5103
|
+
return this.parent && this.parent.removeChild(this), me.FRAGMENT_CACHE.delete(this.target), e ? this.unmount() : Promise.resolve();
|
|
5089
5104
|
}
|
|
5090
5105
|
/**
|
|
5091
5106
|
* 対象ノードを取得します。
|
|
@@ -5112,8 +5127,8 @@ const pe = class pe {
|
|
|
5112
5127
|
this.parent = e;
|
|
5113
5128
|
}
|
|
5114
5129
|
};
|
|
5115
|
-
|
|
5116
|
-
let D =
|
|
5130
|
+
me.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
5131
|
+
let D = me;
|
|
5117
5132
|
const v = class v extends D {
|
|
5118
5133
|
/**
|
|
5119
5134
|
* エレメントフラグメントのコンストラクタ。
|
|
@@ -5125,7 +5140,7 @@ const v = class v extends D {
|
|
|
5125
5140
|
super(e), this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingWorkChain = Promise.resolve(), this.bindingWorkActive = 0, this.lastSupplySequence = 0, this.lastResetSequence = 0, this.initialBindAttribute = null, this.derivedBindingData = null, this.bindingDataCache = null, this.descendantBindingDataCache = null, this.visible = !0, this.display = null, this.displayPriority = null, this.template = null, this.rowLocalTemplate = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.initialized = !1, this.value = null, this.selfWritingAttributes = /* @__PURE__ */ new Map(), this.skipChangeValue = !1, this.valueWriteUnapplied = !1, this.pendingValueWrite = null, this.userEditSequence = 0, this.authoritativeValueSequence = 0, this.lastValueSequence = 0, this.lastValueKind = "nonSupply", this.selfWrittenBind = /* @__PURE__ */ new Map(), this.lastPathApplied = /* @__PURE__ */ new Map(), this.lastChangeSequence = 0, v.dropFollowUpArtifacts(e), this.syncValue(), this.initialBindAttribute = e.getAttribute(`${c.prefix}bind`), e.getAttributeNames().forEach((i) => {
|
|
5126
5141
|
const s = e.getAttribute(i);
|
|
5127
5142
|
if (s !== null && !this.attributeMap.has(i)) {
|
|
5128
|
-
const n = new
|
|
5143
|
+
const n = new Xe(i, s);
|
|
5129
5144
|
this.attributeMap.set(i, n);
|
|
5130
5145
|
}
|
|
5131
5146
|
});
|
|
@@ -5267,7 +5282,7 @@ const v = class v extends D {
|
|
|
5267
5282
|
*/
|
|
5268
5283
|
static dropIfVisibilityArtifacts(e) {
|
|
5269
5284
|
e.hasAttribute(`${c.prefix}if-false`) && (e.style.removeProperty("display"), e.getAttribute("style")?.trim() === "" && e.removeAttribute("style"), e.removeAttribute(`${c.prefix}if-false`), v.forEachFormControlInBranch(e, (t) => {
|
|
5270
|
-
t.hasAttribute(
|
|
5285
|
+
t.hasAttribute(ve) && (t.removeAttribute(ve), t.removeAttribute("disabled"));
|
|
5271
5286
|
}));
|
|
5272
5287
|
}
|
|
5273
5288
|
/**
|
|
@@ -5278,7 +5293,7 @@ const v = class v extends D {
|
|
|
5278
5293
|
*/
|
|
5279
5294
|
remove(e = !0) {
|
|
5280
5295
|
const t = [];
|
|
5281
|
-
return e &&
|
|
5296
|
+
return e && le.destroySubtree(this.getTarget()), this.getTarget().hasAttribute(`${c.prefix}external`) ? this.detachPreservingSubtree(e) : (this.children.slice().forEach((r) => {
|
|
5282
5297
|
t.push(r.remove(!1));
|
|
5283
5298
|
}), this.children.length = 0, this.attributeMap.clear(), this.bindingData = null, this.bindingDataCache = null, this.derivedBindingData = null, this.descendantBindingDataCache = null, this.template && (t.push(this.template.remove(!1)), this.template = null), this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.clearUnappliedValueWrite(), t.push(super.remove(e)), Promise.all(t).then(() => {
|
|
5284
5299
|
}));
|
|
@@ -5299,7 +5314,7 @@ const v = class v extends D {
|
|
|
5299
5314
|
* @returns 戻り値はありません。
|
|
5300
5315
|
*/
|
|
5301
5316
|
detachObserved() {
|
|
5302
|
-
|
|
5317
|
+
le.destroySubtree(this.getTarget());
|
|
5303
5318
|
const e = this.getParent();
|
|
5304
5319
|
e && e.removeChild(this);
|
|
5305
5320
|
}
|
|
@@ -5426,7 +5441,7 @@ const v = class v extends D {
|
|
|
5426
5441
|
* @returns 予約キーなら true
|
|
5427
5442
|
*/
|
|
5428
5443
|
static isReservedBindingKey(e) {
|
|
5429
|
-
return
|
|
5444
|
+
return re.isReservedBindingKey(e);
|
|
5430
5445
|
}
|
|
5431
5446
|
/**
|
|
5432
5447
|
* バインドデータ更新に伴う DOM 反映・再評価を、同一フラグメントでは呼出順
|
|
@@ -5964,7 +5979,7 @@ const v = class v extends D {
|
|
|
5964
5979
|
* @returns 戻り値はありません。
|
|
5965
5980
|
*/
|
|
5966
5981
|
static notifyValueToEnhancers(e) {
|
|
5967
|
-
|
|
5982
|
+
le.isApplied(e) && le.refreshSubtree(e);
|
|
5968
5983
|
}
|
|
5969
5984
|
/**
|
|
5970
5985
|
* 「載らなかった書き込み」の記録を解除します。
|
|
@@ -6211,7 +6226,7 @@ const v = class v extends D {
|
|
|
6211
6226
|
* @return 戻り値はありません。
|
|
6212
6227
|
*/
|
|
6213
6228
|
static warnUnresolvedAttribute(e, t, r, i) {
|
|
6214
|
-
if (!
|
|
6229
|
+
if (!V.isEnabled())
|
|
6215
6230
|
return;
|
|
6216
6231
|
const s = `${e} ${r}`;
|
|
6217
6232
|
v.loggedUnresolvedAttributes.has(s) || (v.loggedUnresolvedAttributes.add(s), m.warn(
|
|
@@ -6433,7 +6448,7 @@ const v = class v extends D {
|
|
|
6433
6448
|
* @returns 戻り値はありません。
|
|
6434
6449
|
*/
|
|
6435
6450
|
static warnValueTypeDeclaration(e, t, r) {
|
|
6436
|
-
if (!
|
|
6451
|
+
if (!V.isEnabled())
|
|
6437
6452
|
return;
|
|
6438
6453
|
const i = e instanceof HTMLInputElement ? `[type=${e.type}]` : "", s = `${e.tagName}${i} ${t} ${r}`;
|
|
6439
6454
|
v.loggedValueTypeDeclarations.has(s) || (v.loggedValueTypeDeclarations.add(s), m.warn(
|
|
@@ -6665,6 +6680,17 @@ const v = class v extends D {
|
|
|
6665
6680
|
});
|
|
6666
6681
|
return this.holdSelfWritingAttributes(r, a), a;
|
|
6667
6682
|
}
|
|
6683
|
+
/**
|
|
6684
|
+
* 使用する直前に評価し直す属性(`data-{event}-redirect` など)かどうかを判定します。
|
|
6685
|
+
*
|
|
6686
|
+
* @param name 属性名
|
|
6687
|
+
* @returns 使用する直前に評価し直す属性なら true
|
|
6688
|
+
*/
|
|
6689
|
+
static isLateActionAttribute(e) {
|
|
6690
|
+
return e.startsWith(c.prefix) && v.LATE_ACTION_ATTRIBUTE_SUFFIX.test(
|
|
6691
|
+
e.slice(c.prefix.length)
|
|
6692
|
+
);
|
|
6693
|
+
}
|
|
6668
6694
|
/**
|
|
6669
6695
|
* 生の属性値を保持しつつ、必要に応じて別名属性へ評価結果を反映します。
|
|
6670
6696
|
*
|
|
@@ -6689,70 +6715,70 @@ const v = class v extends D {
|
|
|
6689
6715
|
);
|
|
6690
6716
|
if (r === null)
|
|
6691
6717
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
6692
|
-
const o = new
|
|
6718
|
+
const o = new Xe(e, r);
|
|
6693
6719
|
if (s) {
|
|
6694
|
-
const
|
|
6695
|
-
if (
|
|
6696
|
-
const
|
|
6720
|
+
const fe = this.attributeMap.get(e);
|
|
6721
|
+
if (fe && (fe.isEvaluate || fe.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
6722
|
+
const Ee = J.enqueue(() => {
|
|
6697
6723
|
}).finally(() => {
|
|
6698
6724
|
this.releaseSelfWritingAttributes(n);
|
|
6699
6725
|
});
|
|
6700
|
-
return this.holdSelfWritingAttributes(n,
|
|
6726
|
+
return this.holdSelfWritingAttributes(n, Ee), Ee;
|
|
6701
6727
|
}
|
|
6702
6728
|
}
|
|
6703
6729
|
this.attributeMap.set(e, o);
|
|
6704
|
-
const l = this.getTarget(), u = o.evaluateDetailed(this.getBindingData(), {
|
|
6730
|
+
const l = this.getTarget(), u = () => o.evaluateDetailed(this.getBindingData(), {
|
|
6705
6731
|
kind: "attribute",
|
|
6706
6732
|
element: l,
|
|
6707
6733
|
rawName: e,
|
|
6708
6734
|
template: r
|
|
6709
|
-
}), d = o.isEvaluate || o.isRawEvaluate,
|
|
6710
|
-
if (
|
|
6735
|
+
}), d = v.isLateActionAttribute(e) ? re.withoutDiagnosis(u) : u(), y = o.isEvaluate || o.isRawEvaluate, b = e === t && v.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), E = o.isSingleExpression(), A = ye.joinEvaluateResults(d.results), w = d.results.length === 1 ? d.results[0] : A, $ = t === "value" && v.resolveDeclaredValueType(l) === "boolean", C = w === !1 && !$, se = !o.isForceEvaluation() && (t !== e ? d.hasUnresolvedReference || w === null || w === void 0 || C : b ? d.hasUnresolvedReference || w === null || w === void 0 || w === !1 : E ? d.hasUnresolvedReference || w === null || w === void 0 || C : y && A === "");
|
|
6736
|
+
if (se && d.hasUnresolvedReference && v.warnUnresolvedAttribute(
|
|
6711
6737
|
e,
|
|
6712
6738
|
t,
|
|
6713
6739
|
r,
|
|
6714
6740
|
l
|
|
6715
|
-
),
|
|
6716
|
-
const
|
|
6717
|
-
|
|
6741
|
+
), V.isEnabled() && w === !1 && E) {
|
|
6742
|
+
const fe = o.getSingleExpression(), Ee = fe === null ? null : re.diagnoseStrictComparison(
|
|
6743
|
+
fe,
|
|
6718
6744
|
this.getBindingData()
|
|
6719
6745
|
);
|
|
6720
|
-
|
|
6746
|
+
Ee !== null && v.warnTypeMismatchedComparison(
|
|
6721
6747
|
e,
|
|
6722
6748
|
r,
|
|
6723
|
-
|
|
6749
|
+
Ee,
|
|
6724
6750
|
l
|
|
6725
6751
|
);
|
|
6726
6752
|
}
|
|
6727
|
-
const
|
|
6728
|
-
|
|
6753
|
+
const F = o.isForceEvaluation() ? r : E ? w : A, Z = i && o.isEvaluate && t === "value" && v.isValuePropertyTarget(l), ee = l.getRootNode(), ne = this.userEditSequence, K = Z && v.isUserEditableValue(l) && (l === ee.activeElement || this.hasPendingUserEdit()), ae = se || F === null || F === !1 && !$ ? null : String(F), j = o.isEvaluate && ae !== null && v.URL_ATTRIBUTES.has(t) && Oe.hasScriptScheme(ae);
|
|
6754
|
+
j && m.warn(
|
|
6729
6755
|
"[Haori]",
|
|
6730
|
-
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${
|
|
6756
|
+
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${ae}`,
|
|
6731
6757
|
l
|
|
6732
6758
|
);
|
|
6733
|
-
const
|
|
6734
|
-
if (!
|
|
6735
|
-
return
|
|
6759
|
+
const k = j ? null : ae, B = e !== t && l.getAttribute(e) !== r, ue = k === null ? l.hasAttribute(t) : l.getAttribute(t) !== k, U = k === null ? "" : k, Q = Z && !K && l.value !== U, pe = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), ce = t === "selected" && l instanceof HTMLOptionElement, W = ee.activeElement, G = W !== null && (pe && l === W || ce && l.closest("select") === W) || (pe || ce) && this.hasPendingCheckableUserEdit(ce), ie = this.getCheckableUserEditSequence(ce), be = k !== null, _e = pe && o.isEvaluate && !G && l.checked !== be, Ve = ce && o.isEvaluate && !G && l.selected !== be;
|
|
6760
|
+
if (!B && !ue && !Q && !_e && !Ve)
|
|
6761
|
+
return Z && !K && (this.value = this.normalizeValueForElement(
|
|
6736
6762
|
l,
|
|
6737
|
-
|
|
6738
|
-
), this.clearUnappliedValueWrite()), (
|
|
6739
|
-
const
|
|
6740
|
-
const
|
|
6763
|
+
U
|
|
6764
|
+
), this.clearUnappliedValueWrite()), (pe || ce) && !G && this.syncCheckableValueFromDom(ce), Promise.resolve();
|
|
6765
|
+
const ut = J.enqueue(() => {
|
|
6766
|
+
const fe = this.getCheckableUserEditSequence(ce) !== ie, Ee = ce && (G || fe) ? v.captureSelection(
|
|
6741
6767
|
// 守るべき選択があるのは所属する `<select>` があるときだけ。
|
|
6742
6768
|
l.closest(
|
|
6743
6769
|
"select"
|
|
6744
6770
|
)
|
|
6745
6771
|
) : null;
|
|
6746
|
-
|
|
6772
|
+
B && l.setAttribute(e, r), k === null ? l.removeAttribute(t) : ue && (l.setAttribute(t, k), t === `${c.prefix}bind` && this.recordSelfWrittenBind(k)), t === "style" && this.captureAndHideDisplay(), Ee?.(), Z && !K && !(v.isUserEditableValue(l) && this.isSupersededByUserEdit(ne)) && (this.value = this.normalizeValueForElement(
|
|
6747
6773
|
l,
|
|
6748
|
-
|
|
6749
|
-
),
|
|
6750
|
-
const
|
|
6751
|
-
|
|
6774
|
+
U
|
|
6775
|
+
), Q && (l.value = U), this.recordValueWriteResult(l.value === U));
|
|
6776
|
+
const _t = _e && !fe, er = Ve && !fe;
|
|
6777
|
+
_t && (l.checked = be), er && (l.selected = be), (_e || Ve) && this.syncCheckableValueFromDom(Ve);
|
|
6752
6778
|
}).finally(() => {
|
|
6753
6779
|
this.releaseSelfWritingAttributes(n);
|
|
6754
6780
|
});
|
|
6755
|
-
return this.holdSelfWritingAttributes(n,
|
|
6781
|
+
return this.holdSelfWritingAttributes(n, ut), ut;
|
|
6756
6782
|
}
|
|
6757
6783
|
/**
|
|
6758
6784
|
* 属性の値を削除します。
|
|
@@ -6808,7 +6834,7 @@ const v = class v extends D {
|
|
|
6808
6834
|
value: r.results[0],
|
|
6809
6835
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6810
6836
|
} : {
|
|
6811
|
-
value:
|
|
6837
|
+
value: ye.joinEvaluateResults(r.results),
|
|
6812
6838
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6813
6839
|
};
|
|
6814
6840
|
}
|
|
@@ -7121,10 +7147,10 @@ const v = class v extends D {
|
|
|
7121
7147
|
* @returns 戻り値はありません。
|
|
7122
7148
|
*/
|
|
7123
7149
|
static forEachFormControlInBranch(e, t) {
|
|
7124
|
-
e.matches(
|
|
7150
|
+
e.matches(At) && t(e);
|
|
7125
7151
|
const r = (i) => {
|
|
7126
7152
|
Array.from(i.children).forEach((s) => {
|
|
7127
|
-
s.hasAttribute(`${c.prefix}if-false`) || (s instanceof HTMLElement && s.matches(
|
|
7153
|
+
s.hasAttribute(`${c.prefix}if-false`) || (s instanceof HTMLElement && s.matches(At) && t(s), r(s));
|
|
7128
7154
|
});
|
|
7129
7155
|
};
|
|
7130
7156
|
r(e);
|
|
@@ -7146,7 +7172,7 @@ const v = class v extends D {
|
|
|
7146
7172
|
*/
|
|
7147
7173
|
static disableFormControlsInBranch(e) {
|
|
7148
7174
|
v.forEachFormControlInBranch(e, (t) => {
|
|
7149
|
-
t.hasAttribute("disabled") || (t.setAttribute(
|
|
7175
|
+
t.hasAttribute("disabled") || (t.setAttribute(ve, ""), t.setAttribute("disabled", ""));
|
|
7150
7176
|
});
|
|
7151
7177
|
}
|
|
7152
7178
|
/**
|
|
@@ -7160,7 +7186,7 @@ const v = class v extends D {
|
|
|
7160
7186
|
*/
|
|
7161
7187
|
restoreFormControlsDisabledByIf() {
|
|
7162
7188
|
v.forEachFormControlInBranch(this.getTarget(), (e) => {
|
|
7163
|
-
e.hasAttribute(
|
|
7189
|
+
e.hasAttribute(ve) && (e.removeAttribute(ve), e.removeAttribute("disabled"));
|
|
7164
7190
|
});
|
|
7165
7191
|
}
|
|
7166
7192
|
/**
|
|
@@ -7246,9 +7272,11 @@ v.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, v.VALUE
|
|
|
7246
7272
|
"month",
|
|
7247
7273
|
"time",
|
|
7248
7274
|
"week"
|
|
7249
|
-
], v.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), v.sequenceCounter = 0, v.bindingWorkActiveCount = 0, v.pendingMutationFlusher = null, v.loggedUnresolvedAttributes = /* @__PURE__ */ new Set(), v.loggedTypeMismatchedComparisons = /* @__PURE__ */ new Set()
|
|
7275
|
+
], v.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), v.sequenceCounter = 0, v.bindingWorkActiveCount = 0, v.pendingMutationFlusher = null, v.loggedUnresolvedAttributes = /* @__PURE__ */ new Set(), v.loggedTypeMismatchedComparisons = /* @__PURE__ */ new Set(), v.LATE_ACTION_ATTRIBUTE_SUFFIX = new RegExp(
|
|
7276
|
+
"^.+-(?:dialog|toast|toast-level|history|scroll|redirect|redirect-replace|redirect-return-param)$"
|
|
7277
|
+
);
|
|
7250
7278
|
let R = v;
|
|
7251
|
-
class
|
|
7279
|
+
class de extends D {
|
|
7252
7280
|
/**
|
|
7253
7281
|
* テキストフラグメントのコンストラクタ。
|
|
7254
7282
|
* 対象テキストノードの内容を初期化します。
|
|
@@ -7256,7 +7284,7 @@ class le extends D {
|
|
|
7256
7284
|
* @param target 対象テキストノード
|
|
7257
7285
|
*/
|
|
7258
7286
|
constructor(e) {
|
|
7259
|
-
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new
|
|
7287
|
+
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new ye(this.text);
|
|
7260
7288
|
}
|
|
7261
7289
|
/**
|
|
7262
7290
|
* フラグメントをクローンします。
|
|
@@ -7264,7 +7292,7 @@ class le extends D {
|
|
|
7264
7292
|
* @returns クローンされたフラグメント
|
|
7265
7293
|
*/
|
|
7266
7294
|
clone() {
|
|
7267
|
-
const e = new
|
|
7295
|
+
const e = new de(this.target.cloneNode(!0));
|
|
7268
7296
|
return e.mounted = !1, e.text = this.text, e.contents = this.contents, e.renderedText = this.renderedText, e;
|
|
7269
7297
|
}
|
|
7270
7298
|
/**
|
|
@@ -7301,7 +7329,7 @@ class le extends D {
|
|
|
7301
7329
|
* @returns 更新のPromise
|
|
7302
7330
|
*/
|
|
7303
7331
|
setContent(e) {
|
|
7304
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new
|
|
7332
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new ye(e), this.evaluate());
|
|
7305
7333
|
}
|
|
7306
7334
|
/**
|
|
7307
7335
|
* フラグメントを評価します。
|
|
@@ -7317,7 +7345,7 @@ class le extends D {
|
|
|
7317
7345
|
return J.enqueue(() => {
|
|
7318
7346
|
this.skipMutation = !0;
|
|
7319
7347
|
let t = this.text;
|
|
7320
|
-
this.contents.isEvaluate && (t =
|
|
7348
|
+
this.contents.isEvaluate && (t = ye.joinEvaluateResults(
|
|
7321
7349
|
this.contents.evaluate(this.parent.getBindingData(), {
|
|
7322
7350
|
kind: "text",
|
|
7323
7351
|
element: this.parent.getTarget(),
|
|
@@ -7332,7 +7360,7 @@ class le extends D {
|
|
|
7332
7360
|
});
|
|
7333
7361
|
}
|
|
7334
7362
|
}
|
|
7335
|
-
class
|
|
7363
|
+
class ot extends D {
|
|
7336
7364
|
/**
|
|
7337
7365
|
* コメントフラグメントのコンストラクタ。
|
|
7338
7366
|
* 対象コメントノードの内容を初期化します。
|
|
@@ -7348,7 +7376,7 @@ class at extends D {
|
|
|
7348
7376
|
* @returns クローンされたフラグメント
|
|
7349
7377
|
*/
|
|
7350
7378
|
clone() {
|
|
7351
|
-
const e = new
|
|
7379
|
+
const e = new ot(this.target.cloneNode(!0));
|
|
7352
7380
|
return e.mounted = !1, e.text = this.text, e;
|
|
7353
7381
|
}
|
|
7354
7382
|
/**
|
|
@@ -7373,7 +7401,7 @@ class at extends D {
|
|
|
7373
7401
|
}));
|
|
7374
7402
|
}
|
|
7375
7403
|
}
|
|
7376
|
-
const
|
|
7404
|
+
const Je = class Je {
|
|
7377
7405
|
/**
|
|
7378
7406
|
* コンストラクタ。
|
|
7379
7407
|
*
|
|
@@ -7389,7 +7417,7 @@ const Xe = class Xe {
|
|
|
7389
7417
|
});
|
|
7390
7418
|
return;
|
|
7391
7419
|
}
|
|
7392
|
-
const r = [...e.matchAll(
|
|
7420
|
+
const r = [...e.matchAll(Je.PLACEHOLDER_REGEX)];
|
|
7393
7421
|
let i = 0, s = !1, n = !1;
|
|
7394
7422
|
for (const a of r) {
|
|
7395
7423
|
a.index > i && this.contents.push({
|
|
@@ -7494,8 +7522,8 @@ const Xe = class Xe {
|
|
|
7494
7522
|
return this.contents.forEach((l) => {
|
|
7495
7523
|
try {
|
|
7496
7524
|
if (r(l)) {
|
|
7497
|
-
const u =
|
|
7498
|
-
() =>
|
|
7525
|
+
const u = Ye.measure(
|
|
7526
|
+
() => re.evaluateDetailed(l.text, e)
|
|
7499
7527
|
), d = u.value;
|
|
7500
7528
|
a += u.durationMs, n.push({
|
|
7501
7529
|
expression: l.text,
|
|
@@ -7513,16 +7541,16 @@ const Xe = class Xe {
|
|
|
7513
7541
|
durationMs: 0
|
|
7514
7542
|
}), s.push("");
|
|
7515
7543
|
}
|
|
7516
|
-
}),
|
|
7544
|
+
}), Ye.record(
|
|
7517
7545
|
t,
|
|
7518
7546
|
n,
|
|
7519
7547
|
a
|
|
7520
7548
|
), { results: s, hasUnresolvedReference: o };
|
|
7521
7549
|
}
|
|
7522
7550
|
};
|
|
7523
|
-
|
|
7524
|
-
let
|
|
7525
|
-
const _ = class _ extends
|
|
7551
|
+
Je.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
7552
|
+
let ye = Je;
|
|
7553
|
+
const _ = class _ extends ye {
|
|
7526
7554
|
/**
|
|
7527
7555
|
* コンストラクタ。
|
|
7528
7556
|
*
|
|
@@ -7531,7 +7559,7 @@ const _ = class _ extends ge {
|
|
|
7531
7559
|
*/
|
|
7532
7560
|
constructor(e, t) {
|
|
7533
7561
|
const r = _.isEventHandlerAttribute(e);
|
|
7534
|
-
super(t, e === `${c.prefix}bind` || r), this.name = e, this.forceEvaluation = _.needsForceEvaluation(e), this.checksUrlPath = _.isRequestUrlAttribute(e), r &&
|
|
7562
|
+
super(t, e === `${c.prefix}bind` || r), this.name = e, this.forceEvaluation = _.needsForceEvaluation(e), this.checksUrlPath = _.isRequestUrlAttribute(e), r && V.isEnabled() && t.includes("{{") && _.warnEventHandlerPlaceholder(e, t);
|
|
7535
7563
|
}
|
|
7536
7564
|
/**
|
|
7537
7565
|
* イベントハンドラ属性(名前が `on` で始まる属性と `data-attr-on*`)かどうかを
|
|
@@ -7659,7 +7687,7 @@ const _ = class _ extends ge {
|
|
|
7659
7687
|
(i) => this.forceEvaluation && i.type === 0 || i.type === 1 || i.type === 2,
|
|
7660
7688
|
"attribute"
|
|
7661
7689
|
);
|
|
7662
|
-
return this.checksUrlPath &&
|
|
7690
|
+
return this.checksUrlPath && V.isEnabled() && this.diagnoseUrlPathValues(r.results), this.forceEvaluation && r.results.length > 1 ? (m.error(
|
|
7663
7691
|
"[Haori]",
|
|
7664
7692
|
"each or if expressions must have a single content.",
|
|
7665
7693
|
r.results
|
|
@@ -7670,11 +7698,11 @@ const _ = class _ extends ge {
|
|
|
7670
7698
|
}
|
|
7671
7699
|
};
|
|
7672
7700
|
_.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], _.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], _.forceEvaluationNames = null, _.forceEvaluationPrefix = null, _.WARNED_EVENT_HANDLER_PLACEHOLDERS = /* @__PURE__ */ new Set(), _.WARNED_URL_PATH_VALUES = /* @__PURE__ */ new Set();
|
|
7673
|
-
let
|
|
7674
|
-
const
|
|
7701
|
+
let Xe = _;
|
|
7702
|
+
const vt = "[Haori]", wt = {
|
|
7675
7703
|
nameRequired: "Handler name is required.",
|
|
7676
7704
|
notFunction: (f) => `Handler "${f}" must be a function.`
|
|
7677
|
-
},
|
|
7705
|
+
}, Te = class Te {
|
|
7678
7706
|
/**
|
|
7679
7707
|
* 関数を登録します。同じ名前で登録し直すと置き換えます。
|
|
7680
7708
|
*
|
|
@@ -7685,14 +7713,14 @@ const At = "[Haori]", vt = {
|
|
|
7685
7713
|
static register(e, t) {
|
|
7686
7714
|
const r = typeof e == "string" ? e.trim() : "";
|
|
7687
7715
|
if (r === "") {
|
|
7688
|
-
m.error(
|
|
7716
|
+
m.error(vt, wt.nameRequired);
|
|
7689
7717
|
return;
|
|
7690
7718
|
}
|
|
7691
7719
|
if (typeof t != "function") {
|
|
7692
|
-
m.error(
|
|
7720
|
+
m.error(vt, wt.notFunction(r));
|
|
7693
7721
|
return;
|
|
7694
7722
|
}
|
|
7695
|
-
|
|
7723
|
+
Te.handlers.set(r, t);
|
|
7696
7724
|
}
|
|
7697
7725
|
/**
|
|
7698
7726
|
* 登録した関数かどうかを返します。
|
|
@@ -7701,7 +7729,7 @@ const At = "[Haori]", vt = {
|
|
|
7701
7729
|
* @returns 登録してあれば true
|
|
7702
7730
|
*/
|
|
7703
7731
|
static has(e) {
|
|
7704
|
-
return
|
|
7732
|
+
return Te.handlers.has(e);
|
|
7705
7733
|
}
|
|
7706
7734
|
/**
|
|
7707
7735
|
* 登録した関数を返します。
|
|
@@ -7710,7 +7738,7 @@ const At = "[Haori]", vt = {
|
|
|
7710
7738
|
* @returns 関数。登録していなければ undefined
|
|
7711
7739
|
*/
|
|
7712
7740
|
static get(e) {
|
|
7713
|
-
return
|
|
7741
|
+
return Te.handlers.get(e);
|
|
7714
7742
|
}
|
|
7715
7743
|
/**
|
|
7716
7744
|
* 登録した関数をすべて返します(式のスコープへ載せるため)。
|
|
@@ -7718,12 +7746,12 @@ const At = "[Haori]", vt = {
|
|
|
7718
7746
|
* @returns 名前 → 関数
|
|
7719
7747
|
*/
|
|
7720
7748
|
static entries() {
|
|
7721
|
-
return Object.fromEntries(
|
|
7749
|
+
return Object.fromEntries(Te.handlers);
|
|
7722
7750
|
}
|
|
7723
7751
|
};
|
|
7724
|
-
|
|
7725
|
-
let
|
|
7726
|
-
const
|
|
7752
|
+
Te.handlers = /* @__PURE__ */ new Map();
|
|
7753
|
+
let De = Te;
|
|
7754
|
+
const ke = class ke {
|
|
7727
7755
|
/**
|
|
7728
7756
|
* 実行モードを取得します。
|
|
7729
7757
|
*
|
|
@@ -7820,7 +7848,7 @@ const Re = class Re {
|
|
|
7820
7848
|
*/
|
|
7821
7849
|
static openDialog(e) {
|
|
7822
7850
|
return J.enqueue(() => {
|
|
7823
|
-
e instanceof HTMLDialogElement ? (
|
|
7851
|
+
e instanceof HTMLDialogElement ? (ke.clearMessagesSync(e), e.showModal()) : m.error("[Haori]", "Element is not a dialog: ", e);
|
|
7824
7852
|
}, !0);
|
|
7825
7853
|
}
|
|
7826
7854
|
/**
|
|
@@ -7840,7 +7868,7 @@ const Re = class Re {
|
|
|
7840
7868
|
* @param message エラーメッセージ
|
|
7841
7869
|
*/
|
|
7842
7870
|
static addErrorMessage(e, t) {
|
|
7843
|
-
return
|
|
7871
|
+
return ke.addMessage(e, t, "error");
|
|
7844
7872
|
}
|
|
7845
7873
|
/**
|
|
7846
7874
|
* メッセージをレベル付きで追加します。
|
|
@@ -7865,7 +7893,7 @@ const Re = class Re {
|
|
|
7865
7893
|
*/
|
|
7866
7894
|
static clearMessages(e) {
|
|
7867
7895
|
return J.enqueue(() => {
|
|
7868
|
-
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")),
|
|
7896
|
+
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")), ke.clearMessagesSync(e);
|
|
7869
7897
|
}, !0);
|
|
7870
7898
|
}
|
|
7871
7899
|
/**
|
|
@@ -7892,7 +7920,7 @@ const Re = class Re {
|
|
|
7892
7920
|
* @returns 整形済み文字列。整形できない場合は空文字
|
|
7893
7921
|
*/
|
|
7894
7922
|
static date(e, t, r) {
|
|
7895
|
-
return
|
|
7923
|
+
return Ze(e, t, r);
|
|
7896
7924
|
}
|
|
7897
7925
|
/**
|
|
7898
7926
|
* 現在日時を指定フォーマットの文字列へ整形します。
|
|
@@ -7919,7 +7947,7 @@ const Re = class Re {
|
|
|
7919
7947
|
* @returns 整形済みの日付文字列。timeZone が不正な場合は空文字
|
|
7920
7948
|
*/
|
|
7921
7949
|
static today(e, t, r) {
|
|
7922
|
-
return
|
|
7950
|
+
return Pt(e, t, r);
|
|
7923
7951
|
}
|
|
7924
7952
|
/**
|
|
7925
7953
|
* 数値を桁区切り・小数桁付きの文字列へ整形します。
|
|
@@ -7931,7 +7959,7 @@ const Re = class Re {
|
|
|
7931
7959
|
* @returns 整形済み文字列。整形できない場合は空文字
|
|
7932
7960
|
*/
|
|
7933
7961
|
static number(e, t) {
|
|
7934
|
-
return
|
|
7962
|
+
return Lt(e, t);
|
|
7935
7963
|
}
|
|
7936
7964
|
/**
|
|
7937
7965
|
* 整数の配列を生成します(終端は排他)。
|
|
@@ -7944,7 +7972,7 @@ const Re = class Re {
|
|
|
7944
7972
|
* @returns 整数配列
|
|
7945
7973
|
*/
|
|
7946
7974
|
static range(e, t, r) {
|
|
7947
|
-
return
|
|
7975
|
+
return Ot(e, t, r);
|
|
7948
7976
|
}
|
|
7949
7977
|
/**
|
|
7950
7978
|
* 番号ページネーション用の表示要素列を生成します。
|
|
@@ -7957,7 +7985,7 @@ const Re = class Re {
|
|
|
7957
7985
|
* @returns 表示要素の配列
|
|
7958
7986
|
*/
|
|
7959
7987
|
static pages(e, t, r) {
|
|
7960
|
-
return
|
|
7988
|
+
return Bt(e, t, r);
|
|
7961
7989
|
}
|
|
7962
7990
|
/**
|
|
7963
7991
|
* `YYYY-MM` 形式の年月文字列に月数を加算します。
|
|
@@ -7969,7 +7997,7 @@ const Re = class Re {
|
|
|
7969
7997
|
* @returns 加算後の年月(`YYYY-MM` 形式)。不正な入力は空文字
|
|
7970
7998
|
*/
|
|
7971
7999
|
static monthAdd(e, t) {
|
|
7972
|
-
return
|
|
8000
|
+
return Qe(e, t);
|
|
7973
8001
|
}
|
|
7974
8002
|
/**
|
|
7975
8003
|
* 基準月から過去方向へ `count + 1` 個の年月配列を降順で返します。
|
|
@@ -7981,7 +8009,7 @@ const Re = class Re {
|
|
|
7981
8009
|
* @returns 年月情報の降順配列。不正な入力は空配列
|
|
7982
8010
|
*/
|
|
7983
8011
|
static monthRange(e, t) {
|
|
7984
|
-
return
|
|
8012
|
+
return Ut(e, t);
|
|
7985
8013
|
}
|
|
7986
8014
|
/**
|
|
7987
8015
|
* ページレスポンスから表示用サマリーを作ります。
|
|
@@ -7993,7 +8021,7 @@ const Re = class Re {
|
|
|
7993
8021
|
* @returns 表示サマリー
|
|
7994
8022
|
*/
|
|
7995
8023
|
static pageSummary(e, t) {
|
|
7996
|
-
return
|
|
8024
|
+
return Ht(e, t);
|
|
7997
8025
|
}
|
|
7998
8026
|
/**
|
|
7999
8027
|
* 配列から `item[key]` が指定値に一致する最初の要素を返します。
|
|
@@ -8007,7 +8035,7 @@ const Re = class Re {
|
|
|
8007
8035
|
* @returns 一致した最初の要素。無ければ null
|
|
8008
8036
|
*/
|
|
8009
8037
|
static findBy(e, t, r) {
|
|
8010
|
-
return
|
|
8038
|
+
return Vt(e, t, r);
|
|
8011
8039
|
}
|
|
8012
8040
|
/**
|
|
8013
8041
|
* 配列の数値合計を返します。
|
|
@@ -8020,7 +8048,7 @@ const Re = class Re {
|
|
|
8020
8048
|
* @returns 数値の合計。対象が無ければ 0
|
|
8021
8049
|
*/
|
|
8022
8050
|
static sum(e, t) {
|
|
8023
|
-
return
|
|
8051
|
+
return qt(e, t);
|
|
8024
8052
|
}
|
|
8025
8053
|
/**
|
|
8026
8054
|
* 配列から重複を取り除いた新しい配列を返します。
|
|
@@ -8033,7 +8061,7 @@ const Re = class Re {
|
|
|
8033
8061
|
* @returns 重複排除後の新しい配列。非配列は空配列
|
|
8034
8062
|
*/
|
|
8035
8063
|
static distinct(e, t) {
|
|
8036
|
-
return
|
|
8064
|
+
return jt(e, t);
|
|
8037
8065
|
}
|
|
8038
8066
|
/**
|
|
8039
8067
|
* 配列を `item[key]` ごとのグループへ分けて返します。
|
|
@@ -8046,10 +8074,10 @@ const Re = class Re {
|
|
|
8046
8074
|
* @returns グループ情報の配列。非配列は空配列
|
|
8047
8075
|
*/
|
|
8048
8076
|
static groupBy(e, t) {
|
|
8049
|
-
return
|
|
8077
|
+
return Kt(e, t);
|
|
8050
8078
|
}
|
|
8051
8079
|
};
|
|
8052
|
-
|
|
8080
|
+
ke.handlers = {
|
|
8053
8081
|
/**
|
|
8054
8082
|
* 関数を登録します。
|
|
8055
8083
|
*
|
|
@@ -8058,7 +8086,7 @@ Re.handlers = {
|
|
|
8058
8086
|
* @return 戻り値はありません。
|
|
8059
8087
|
*/
|
|
8060
8088
|
register(e, t) {
|
|
8061
|
-
|
|
8089
|
+
De.register(e, t);
|
|
8062
8090
|
},
|
|
8063
8091
|
/**
|
|
8064
8092
|
* 登録した関数かどうかを返します。
|
|
@@ -8067,9 +8095,9 @@ Re.handlers = {
|
|
|
8067
8095
|
* @return 登録してあれば true
|
|
8068
8096
|
*/
|
|
8069
8097
|
has(e) {
|
|
8070
|
-
return
|
|
8098
|
+
return De.has(e);
|
|
8071
8099
|
}
|
|
8072
|
-
},
|
|
8100
|
+
}, ke.enhancers = {
|
|
8073
8101
|
/**
|
|
8074
8102
|
* 外部ライブラリ連携を登録します。
|
|
8075
8103
|
*
|
|
@@ -8078,7 +8106,7 @@ Re.handlers = {
|
|
|
8078
8106
|
* @return 戻り値はありません。
|
|
8079
8107
|
*/
|
|
8080
8108
|
register(e, t) {
|
|
8081
|
-
|
|
8109
|
+
le.register(e, t);
|
|
8082
8110
|
},
|
|
8083
8111
|
/**
|
|
8084
8112
|
* 登録済みの連携かどうかを返します。
|
|
@@ -8087,16 +8115,16 @@ Re.handlers = {
|
|
|
8087
8115
|
* @return 登録済みなら true
|
|
8088
8116
|
*/
|
|
8089
8117
|
has(e) {
|
|
8090
|
-
return
|
|
8118
|
+
return le.has(e);
|
|
8091
8119
|
}
|
|
8092
8120
|
};
|
|
8093
|
-
let
|
|
8094
|
-
const
|
|
8095
|
-
function
|
|
8121
|
+
let xe = ke;
|
|
8122
|
+
const yr = "入力内容を確認してください", br = ["addErrorMessage", "clearMessages"], St = "data-haori-group-name";
|
|
8123
|
+
function Rt() {
|
|
8096
8124
|
const e = globalThis.window?.Haori;
|
|
8097
|
-
return
|
|
8125
|
+
return br.every(
|
|
8098
8126
|
(r) => typeof e?.[r] == "function"
|
|
8099
|
-
) ? e :
|
|
8127
|
+
) ? e : xe;
|
|
8100
8128
|
}
|
|
8101
8129
|
const p = class p {
|
|
8102
8130
|
/**
|
|
@@ -8279,13 +8307,13 @@ const p = class p {
|
|
|
8279
8307
|
return;
|
|
8280
8308
|
}
|
|
8281
8309
|
const r = e.getTarget();
|
|
8282
|
-
if (!(r instanceof HTMLInputElement) || r.type !== "radio" || r.hasAttribute("name") && !r.hasAttribute(
|
|
8310
|
+
if (!(r instanceof HTMLInputElement) || r.type !== "radio" || r.hasAttribute("name") && !r.hasAttribute(St))
|
|
8283
8311
|
return;
|
|
8284
8312
|
const i = p.resolveGroupScope(e), s = `${String(t)}--haori${p.resolveGroupScopeId(
|
|
8285
8313
|
i
|
|
8286
8314
|
)}`;
|
|
8287
8315
|
if (r.getAttribute("name") !== s)
|
|
8288
|
-
return e.setAttribute(
|
|
8316
|
+
return e.setAttribute(St, "").then(() => e.setAttribute("name", s));
|
|
8289
8317
|
}
|
|
8290
8318
|
/**
|
|
8291
8319
|
* ラジオグループのスコープとなるフラグメントを解決します。
|
|
@@ -8881,7 +8909,7 @@ const p = class p {
|
|
|
8881
8909
|
* @param value 祖先が所有している値
|
|
8882
8910
|
*/
|
|
8883
8911
|
static warnArgOwnerIsNotRecord(e, t, r) {
|
|
8884
|
-
if (!
|
|
8912
|
+
if (!V.isEnabled() || r == null)
|
|
8885
8913
|
return;
|
|
8886
8914
|
const i = e.getTarget(), s = p.warnedArgOwnerNotRecord.get(i);
|
|
8887
8915
|
s?.has(t) || (s ? s.add(t) : p.warnedArgOwnerNotRecord.set(i, /* @__PURE__ */ new Set([t])), m.warn(
|
|
@@ -9047,7 +9075,7 @@ const p = class p {
|
|
|
9047
9075
|
r.setCustomValidity("");
|
|
9048
9076
|
return;
|
|
9049
9077
|
}
|
|
9050
|
-
const s = p.buildConditionScope(e), n =
|
|
9078
|
+
const s = p.buildConditionScope(e), n = re.evaluateDetailed(
|
|
9051
9079
|
p.unwrapConditionExpression(i),
|
|
9052
9080
|
s
|
|
9053
9081
|
);
|
|
@@ -9070,7 +9098,7 @@ const p = class p {
|
|
|
9070
9098
|
*/
|
|
9071
9099
|
static resolveValidityMessage(e) {
|
|
9072
9100
|
const t = e.getAttribute(`${c.prefix}validity-message`);
|
|
9073
|
-
return typeof t == "string" && t.trim() !== "" ? t :
|
|
9101
|
+
return typeof t == "string" && t.trim() !== "" ? t : yr;
|
|
9074
9102
|
}
|
|
9075
9103
|
/**
|
|
9076
9104
|
* 条件属性の値から式を取り出します。
|
|
@@ -9095,7 +9123,7 @@ const p = class p {
|
|
|
9095
9123
|
* @returns 戻り値はありません。
|
|
9096
9124
|
*/
|
|
9097
9125
|
static warnUnvalidatedCustomValidity(e, t) {
|
|
9098
|
-
if (!
|
|
9126
|
+
if (!V.isEnabled() || !e)
|
|
9099
9127
|
return;
|
|
9100
9128
|
const r = `${c.prefix}validity`;
|
|
9101
9129
|
(e.hasAttribute(r) || e.getTarget().querySelector(`[${r}]`) !== null) && m.warn(
|
|
@@ -9158,7 +9186,7 @@ const p = class p {
|
|
|
9158
9186
|
* @param reason 退いた理由
|
|
9159
9187
|
*/
|
|
9160
9188
|
static warnPositionalRowFallback(e) {
|
|
9161
|
-
!
|
|
9189
|
+
!V.isEnabled() || p.warnedPositionalRowFallbacks.has(e) || (p.warnedPositionalRowFallbacks.add(e), m.warn(
|
|
9162
9190
|
"[Haori]",
|
|
9163
9191
|
`${c.prefix}form-list の行を出現順で対応付けます(${e})。配列と画面の行数・並びが一致していない場合、行の値を取り違えます。`
|
|
9164
9192
|
));
|
|
@@ -9178,7 +9206,7 @@ const p = class p {
|
|
|
9178
9206
|
* @param container `data-form-list` を持つコンテナのフラグメント
|
|
9179
9207
|
*/
|
|
9180
9208
|
static warnDerivedRowsWithoutKey(e) {
|
|
9181
|
-
if (!
|
|
9209
|
+
if (!V.isEnabled() || e.getRawAttribute(`${c.prefix}each-key`) !== null)
|
|
9182
9210
|
return;
|
|
9183
9211
|
const t = e.getRawAttribute(`${c.prefix}each`);
|
|
9184
9212
|
t === null || p.resolveLeadingPath(t) !== null || p.warnedDerivedRowsWithoutKey.has(t) || (p.warnedDerivedRowsWithoutKey.add(t), m.warn(
|
|
@@ -9821,42 +9849,44 @@ const p = class p {
|
|
|
9821
9849
|
return Promise.resolve();
|
|
9822
9850
|
const l = p.resolveFieldName(e), u = e.getAttribute(`${c.prefix}form-object`), d = e.getAttribute(`${c.prefix}form-list`), y = e.hasAttribute(`${c.prefix}form-list`);
|
|
9823
9851
|
if (l) {
|
|
9824
|
-
const b = t[String(l)], E = s &&
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9852
|
+
const b = t[String(l)], E = s && re.withoutDiagnosis(
|
|
9853
|
+
() => p.hasResolvedDeclarativeState(e)
|
|
9854
|
+
), A = s && typeof b > "u" && !p.isDeclarativeStateBound(e);
|
|
9855
|
+
let w = b;
|
|
9856
|
+
if (E ? w = void 0 : A && (w = null), p.isFileInput(e))
|
|
9857
|
+
return (w === null || w === "") && o.push(
|
|
9828
9858
|
p.applyFragmentValue(e, null, i, a)
|
|
9829
9859
|
), Promise.all(o).then(() => {
|
|
9830
9860
|
});
|
|
9831
|
-
if (y && Array.isArray(
|
|
9861
|
+
if (y && Array.isArray(w) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
9832
9862
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
9833
9863
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
9834
9864
|
!p.isGroupedCheckable(e) && !p.isMultipleSelect(e)) {
|
|
9835
|
-
const
|
|
9836
|
-
n.set(C
|
|
9865
|
+
const $ = String(l), C = n.get($) ?? 0;
|
|
9866
|
+
n.set($, C + 1), o.push(
|
|
9837
9867
|
p.applyFragmentValue(
|
|
9838
9868
|
e,
|
|
9839
|
-
|
|
9869
|
+
w[C] ?? null,
|
|
9840
9870
|
i,
|
|
9841
9871
|
a
|
|
9842
9872
|
)
|
|
9843
9873
|
);
|
|
9844
|
-
} else typeof
|
|
9874
|
+
} else typeof w > "u" || (Array.isArray(w) && p.isGroupedCheckable(e) || Array.isArray(w) && p.isMultipleSelect(e) || typeof w == "string" || typeof w == "number" || typeof w == "boolean" || w === null || Array.isArray(w) && e.collectsLines() ? o.push(
|
|
9845
9875
|
p.applyFragmentValue(
|
|
9846
9876
|
e,
|
|
9847
|
-
|
|
9877
|
+
w,
|
|
9848
9878
|
i,
|
|
9849
9879
|
a
|
|
9850
9880
|
)
|
|
9851
9881
|
) : o.push(
|
|
9852
|
-
p.applyFragmentValue(e, String(
|
|
9882
|
+
p.applyFragmentValue(e, String(w), i, a)
|
|
9853
9883
|
));
|
|
9854
9884
|
} else if (u) {
|
|
9855
9885
|
const b = t[String(u)], E = b && typeof b == "object" ? b : {}, A = /* @__PURE__ */ new Map();
|
|
9856
|
-
for (const
|
|
9886
|
+
for (const w of e.getChildElementFragments())
|
|
9857
9887
|
o.push(
|
|
9858
9888
|
p.setPartValues(
|
|
9859
|
-
|
|
9889
|
+
w,
|
|
9860
9890
|
E,
|
|
9861
9891
|
r,
|
|
9862
9892
|
i,
|
|
@@ -9866,17 +9896,17 @@ const p = class p {
|
|
|
9866
9896
|
)
|
|
9867
9897
|
);
|
|
9868
9898
|
} else if (d) {
|
|
9869
|
-
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(),
|
|
9899
|
+
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(), w = e.getAttribute(`${c.prefix}each-key`), $ = p.isCollectedListFromEachSource(e) ? p.pairRowsWithItems(
|
|
9870
9900
|
A,
|
|
9871
9901
|
E,
|
|
9872
|
-
|
|
9902
|
+
w == null ? null : String(w)
|
|
9873
9903
|
) : null;
|
|
9874
|
-
for (let
|
|
9875
|
-
const
|
|
9904
|
+
for (let C = 0; C < A.length; C++) {
|
|
9905
|
+
const se = A[C], F = $ ? $[C] : E.length > C ? E[C] : null;
|
|
9876
9906
|
o.push(
|
|
9877
9907
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
9878
9908
|
p.setPartValues(
|
|
9879
|
-
|
|
9909
|
+
se,
|
|
9880
9910
|
p.asPlainRecord(F) ?? {},
|
|
9881
9911
|
r,
|
|
9882
9912
|
i,
|
|
@@ -9968,7 +9998,7 @@ const p = class p {
|
|
|
9968
9998
|
sequence: t
|
|
9969
9999
|
});
|
|
9970
10000
|
}
|
|
9971
|
-
|
|
10001
|
+
le.refreshSubtree(e.getTarget());
|
|
9972
10002
|
}
|
|
9973
10003
|
/**
|
|
9974
10004
|
* 祖先が所有するキーを、リセットの書き込み対象から落とします。
|
|
@@ -10150,7 +10180,7 @@ const p = class p {
|
|
|
10150
10180
|
* @returns Promise(メッセージのクリアが完了したら解決される)
|
|
10151
10181
|
*/
|
|
10152
10182
|
static clearMessages(e) {
|
|
10153
|
-
return
|
|
10183
|
+
return Rt().clearMessages(
|
|
10154
10184
|
e.getTarget()
|
|
10155
10185
|
);
|
|
10156
10186
|
}
|
|
@@ -10177,7 +10207,7 @@ const p = class p {
|
|
|
10177
10207
|
* @return Promise(メッセージの追加が完了したら解決される)
|
|
10178
10208
|
*/
|
|
10179
10209
|
static addMessage(e, t, r, i) {
|
|
10180
|
-
const s = [], n =
|
|
10210
|
+
const s = [], n = Rt(), a = n.addMessage, o = (u) => typeof a == "function" ? a.call(n, u, r, i) : n.addErrorMessage(u, r), l = p.keepFirstRadio(
|
|
10181
10211
|
p.findFragmentsByKey(e, t)
|
|
10182
10212
|
);
|
|
10183
10213
|
return l.forEach((u) => {
|
|
@@ -10275,7 +10305,7 @@ p.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), p.LAST_ANCESTOR_ARG_VA
|
|
|
10275
10305
|
"prototype"
|
|
10276
10306
|
]), p.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), p.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), p.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), p.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), p.warnedDerivedRowsWithoutKey = /* @__PURE__ */ new Set(), p.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
10277
10307
|
let x = p;
|
|
10278
|
-
class
|
|
10308
|
+
class O {
|
|
10279
10309
|
/**
|
|
10280
10310
|
* カスタムイベントを発火します。
|
|
10281
10311
|
*
|
|
@@ -10299,7 +10329,7 @@ class B {
|
|
|
10299
10329
|
* @param version ライブラリバージョン
|
|
10300
10330
|
*/
|
|
10301
10331
|
static ready(e) {
|
|
10302
|
-
|
|
10332
|
+
O.dispatch(document, "ready", { version: e });
|
|
10303
10333
|
}
|
|
10304
10334
|
/**
|
|
10305
10335
|
* importstartイベントを発火します。
|
|
@@ -10308,7 +10338,7 @@ class B {
|
|
|
10308
10338
|
* @param url インポート対象URL
|
|
10309
10339
|
*/
|
|
10310
10340
|
static importStart(e, t) {
|
|
10311
|
-
|
|
10341
|
+
O.dispatch(e, "importstart", {
|
|
10312
10342
|
url: t,
|
|
10313
10343
|
startedAt: performance.now()
|
|
10314
10344
|
});
|
|
@@ -10322,7 +10352,7 @@ class B {
|
|
|
10322
10352
|
* @param startedAt 開始時刻
|
|
10323
10353
|
*/
|
|
10324
10354
|
static importEnd(e, t, r, i) {
|
|
10325
|
-
|
|
10355
|
+
O.dispatch(e, "importend", {
|
|
10326
10356
|
url: t,
|
|
10327
10357
|
bytes: r,
|
|
10328
10358
|
durationMs: performance.now() - i
|
|
@@ -10336,7 +10366,7 @@ class B {
|
|
|
10336
10366
|
* @param error エラー内容
|
|
10337
10367
|
*/
|
|
10338
10368
|
static importError(e, t, r) {
|
|
10339
|
-
|
|
10369
|
+
O.dispatch(e, "importerror", { url: t, error: r });
|
|
10340
10370
|
}
|
|
10341
10371
|
/**
|
|
10342
10372
|
* bindchangeイベントを発火します。
|
|
@@ -10352,7 +10382,7 @@ class B {
|
|
|
10352
10382
|
const u = t?.[l], d = r[l];
|
|
10353
10383
|
u !== d && s.push(l);
|
|
10354
10384
|
}
|
|
10355
|
-
|
|
10385
|
+
O.dispatch(e, "bindchange", {
|
|
10356
10386
|
previous: t || {},
|
|
10357
10387
|
next: r,
|
|
10358
10388
|
changedKeys: s,
|
|
@@ -10371,7 +10401,7 @@ class B {
|
|
|
10371
10401
|
* @param reason 変更理由
|
|
10372
10402
|
*/
|
|
10373
10403
|
static bindComplete(e, t = null, r = "other") {
|
|
10374
|
-
|
|
10404
|
+
O.dispatch(e, "bindcomplete", { bindArg: t, reason: r });
|
|
10375
10405
|
}
|
|
10376
10406
|
/**
|
|
10377
10407
|
* eachupdateイベントを発火します。
|
|
@@ -10382,7 +10412,7 @@ class B {
|
|
|
10382
10412
|
* @param order 現在の順序
|
|
10383
10413
|
*/
|
|
10384
10414
|
static eachUpdate(e, t, r, i) {
|
|
10385
|
-
|
|
10415
|
+
O.dispatch(e, "eachupdate", {
|
|
10386
10416
|
added: t,
|
|
10387
10417
|
removed: r,
|
|
10388
10418
|
order: i,
|
|
@@ -10398,7 +10428,7 @@ class B {
|
|
|
10398
10428
|
* @param item 行データ
|
|
10399
10429
|
*/
|
|
10400
10430
|
static rowAdd(e, t, r, i) {
|
|
10401
|
-
|
|
10431
|
+
O.dispatch(e, "rowadd", { key: t, index: r, item: i });
|
|
10402
10432
|
}
|
|
10403
10433
|
/**
|
|
10404
10434
|
* rowremoveイベントを発火します。
|
|
@@ -10408,7 +10438,7 @@ class B {
|
|
|
10408
10438
|
* @param index インデックス
|
|
10409
10439
|
*/
|
|
10410
10440
|
static rowRemove(e, t, r) {
|
|
10411
|
-
|
|
10441
|
+
O.dispatch(e, "rowremove", { key: t, index: r });
|
|
10412
10442
|
}
|
|
10413
10443
|
/**
|
|
10414
10444
|
* rowmoveイベントを発火します。
|
|
@@ -10419,7 +10449,7 @@ class B {
|
|
|
10419
10449
|
* @param to 移動後インデックス
|
|
10420
10450
|
*/
|
|
10421
10451
|
static rowMove(e, t, r, i) {
|
|
10422
|
-
|
|
10452
|
+
O.dispatch(e, "rowmove", { key: t, from: r, to: i });
|
|
10423
10453
|
}
|
|
10424
10454
|
/**
|
|
10425
10455
|
* showイベントを発火します。
|
|
@@ -10427,7 +10457,7 @@ class B {
|
|
|
10427
10457
|
* @param target data-if要素
|
|
10428
10458
|
*/
|
|
10429
10459
|
static show(e) {
|
|
10430
|
-
|
|
10460
|
+
O.dispatch(e, "show", { visible: !0 });
|
|
10431
10461
|
}
|
|
10432
10462
|
/**
|
|
10433
10463
|
* hideイベントを発火します。
|
|
@@ -10435,7 +10465,7 @@ class B {
|
|
|
10435
10465
|
* @param target data-if要素
|
|
10436
10466
|
*/
|
|
10437
10467
|
static hide(e) {
|
|
10438
|
-
|
|
10468
|
+
O.dispatch(e, "hide", { visible: !1 });
|
|
10439
10469
|
}
|
|
10440
10470
|
/**
|
|
10441
10471
|
* fetchstartイベントを発火します。
|
|
@@ -10448,7 +10478,7 @@ class B {
|
|
|
10448
10478
|
* @return 戻り値はありません。
|
|
10449
10479
|
*/
|
|
10450
10480
|
static fetchStart(e, t, r, i, s) {
|
|
10451
|
-
|
|
10481
|
+
O.dispatch(e, "fetchstart", {
|
|
10452
10482
|
url: t,
|
|
10453
10483
|
options: r || {},
|
|
10454
10484
|
payload: i,
|
|
@@ -10465,7 +10495,7 @@ class B {
|
|
|
10465
10495
|
* @param startedAt 開始時刻
|
|
10466
10496
|
*/
|
|
10467
10497
|
static fetchEnd(e, t, r, i) {
|
|
10468
|
-
|
|
10498
|
+
O.dispatch(e, "fetchend", {
|
|
10469
10499
|
url: t,
|
|
10470
10500
|
status: r,
|
|
10471
10501
|
durationMs: performance.now() - i
|
|
@@ -10481,7 +10511,7 @@ class B {
|
|
|
10481
10511
|
* @param startedAt 開始時刻(存在する場合)
|
|
10482
10512
|
*/
|
|
10483
10513
|
static fetchError(e, t, r, i, s) {
|
|
10484
|
-
|
|
10514
|
+
O.dispatch(e, "fetcherror", {
|
|
10485
10515
|
url: t,
|
|
10486
10516
|
status: i,
|
|
10487
10517
|
error: r,
|
|
@@ -10497,7 +10527,7 @@ class B {
|
|
|
10497
10527
|
* @return 戻り値はありません。
|
|
10498
10528
|
*/
|
|
10499
10529
|
static pollTimeout(e, t, r) {
|
|
10500
|
-
|
|
10530
|
+
O.dispatch(e, "polltimeout", { count: t, elapsedMs: r });
|
|
10501
10531
|
}
|
|
10502
10532
|
/**
|
|
10503
10533
|
* pollstopイベントを発火します。
|
|
@@ -10511,33 +10541,33 @@ class B {
|
|
|
10511
10541
|
* @return 戻り値はありません。
|
|
10512
10542
|
*/
|
|
10513
10543
|
static pollStop(e, t, r, i) {
|
|
10514
|
-
|
|
10544
|
+
O.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
10515
10545
|
}
|
|
10516
10546
|
}
|
|
10517
|
-
const
|
|
10547
|
+
const Er = {
|
|
10518
10548
|
401: "unauthorized-redirect",
|
|
10519
10549
|
403: "forbidden-redirect"
|
|
10520
10550
|
};
|
|
10521
|
-
function
|
|
10551
|
+
function Ar(f, e) {
|
|
10522
10552
|
return f.replace(/\{\{([\s\S]+?)\}\}/g, (t, r) => {
|
|
10523
10553
|
try {
|
|
10524
|
-
const i =
|
|
10554
|
+
const i = re.evaluate(String(r).trim(), e);
|
|
10525
10555
|
return i == null ? "" : String(i);
|
|
10526
10556
|
} catch {
|
|
10527
10557
|
return "";
|
|
10528
10558
|
}
|
|
10529
10559
|
});
|
|
10530
10560
|
}
|
|
10531
|
-
function
|
|
10561
|
+
function Tt(f, e) {
|
|
10532
10562
|
const t = f.getAttribute(e);
|
|
10533
10563
|
if (t === null || t === "")
|
|
10534
10564
|
return null;
|
|
10535
10565
|
if (!t.includes("{{"))
|
|
10536
10566
|
return t;
|
|
10537
|
-
const r = D.get(f), i = r instanceof R ? r.getBindingData() : {}, s =
|
|
10567
|
+
const r = D.get(f), i = r instanceof R ? r.getBindingData() : {}, s = Ar(t, i);
|
|
10538
10568
|
return s === "" ? null : s;
|
|
10539
10569
|
}
|
|
10540
|
-
function
|
|
10570
|
+
function vr(f, e, t) {
|
|
10541
10571
|
const r = f.getAttribute(`${e}-return-param`);
|
|
10542
10572
|
if (r === null || r === "")
|
|
10543
10573
|
return t;
|
|
@@ -10550,9 +10580,9 @@ function Ar(f, e, t) {
|
|
|
10550
10580
|
const i = window.location.pathname + window.location.search + window.location.hash, n = `${encodeURIComponent(r)}=${encodeURIComponent(i)}`, a = t.indexOf("#"), o = a >= 0 ? t.slice(a) : "", l = a >= 0 ? t.slice(0, a) : t, u = l.includes("?") ? "&" : "?";
|
|
10551
10581
|
return `${l}${u}${n}${o}`;
|
|
10552
10582
|
}
|
|
10553
|
-
function
|
|
10554
|
-
const r =
|
|
10555
|
-
if (!
|
|
10583
|
+
function kt(f, e, t) {
|
|
10584
|
+
const r = vr(f, e, t);
|
|
10585
|
+
if (!Oe.isNavigableUrl(r))
|
|
10556
10586
|
return m.error(
|
|
10557
10587
|
"Haori",
|
|
10558
10588
|
`遷移先が http: / https: / 現在ページと同じスキームの URL ではないため遷移しません: ${r}`
|
|
@@ -10564,27 +10594,27 @@ function Tt(f, e, t) {
|
|
|
10564
10594
|
}
|
|
10565
10595
|
return window.location.href = r, !0;
|
|
10566
10596
|
}
|
|
10567
|
-
function
|
|
10568
|
-
const t =
|
|
10597
|
+
function Jt(f, e = null) {
|
|
10598
|
+
const t = Er[f];
|
|
10569
10599
|
if (t === void 0 || typeof document > "u")
|
|
10570
10600
|
return !1;
|
|
10571
10601
|
if (e !== null) {
|
|
10572
10602
|
const s = `${e.attrPrefix}${t}`;
|
|
10573
10603
|
if (e.element.hasAttribute(s)) {
|
|
10574
|
-
const n =
|
|
10575
|
-
return n !== null &&
|
|
10604
|
+
const n = Tt(e.element, s);
|
|
10605
|
+
return n !== null && kt(e.element, s, n);
|
|
10576
10606
|
}
|
|
10577
10607
|
}
|
|
10578
10608
|
const r = `${c.prefix}${t}`, i = [];
|
|
10579
10609
|
document.body && i.push(document.body), document.documentElement && i.push(document.documentElement);
|
|
10580
10610
|
for (const s of i) {
|
|
10581
|
-
const n =
|
|
10611
|
+
const n = Tt(s, r);
|
|
10582
10612
|
if (n !== null)
|
|
10583
|
-
return
|
|
10613
|
+
return kt(s, r, n);
|
|
10584
10614
|
}
|
|
10585
10615
|
return !1;
|
|
10586
10616
|
}
|
|
10587
|
-
class
|
|
10617
|
+
class z {
|
|
10588
10618
|
/**
|
|
10589
10619
|
* セレクタ属性の値を評価済みの文字列として読み取ります。
|
|
10590
10620
|
*
|
|
@@ -10633,11 +10663,11 @@ class K {
|
|
|
10633
10663
|
* @returns 一致した要素の配列。セレクタが不正な場合は空配列
|
|
10634
10664
|
*/
|
|
10635
10665
|
static queryAllInListOrder(e, t) {
|
|
10636
|
-
if (
|
|
10666
|
+
if (z.queryAll(e, t).length === 0)
|
|
10637
10667
|
return [];
|
|
10638
10668
|
const r = /* @__PURE__ */ new Set();
|
|
10639
|
-
return
|
|
10640
|
-
|
|
10669
|
+
return z.splitList(e).forEach((i) => {
|
|
10670
|
+
z.queryAll(i, t).forEach(
|
|
10641
10671
|
(s) => r.add(s)
|
|
10642
10672
|
);
|
|
10643
10673
|
}), Array.from(r);
|
|
@@ -11105,8 +11135,8 @@ const N = class N {
|
|
|
11105
11135
|
}
|
|
11106
11136
|
};
|
|
11107
11137
|
N.SIGNATURES = /* @__PURE__ */ new WeakMap(), N.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), N.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), N.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
11108
|
-
let
|
|
11109
|
-
const
|
|
11138
|
+
let Be = N;
|
|
11139
|
+
const Ne = "[Haori]", Ie = {
|
|
11110
11140
|
bodyIgnored: (f) => `${f} is ignored because ${f}-handler is also declared.`,
|
|
11111
11141
|
notRegistered: (f, e) => `Handler "${f}" is not registered (${e}-handler). Register it with Haori.handlers.register().`,
|
|
11112
11142
|
argsNotArray: (f) => `${f}-args must evaluate to an array without unresolved references; the handler is not called.`,
|
|
@@ -11114,7 +11144,7 @@ const De = "[Haori]", xe = {
|
|
|
11114
11144
|
notExpression: (f) => `${f} is not run in the CSP mode (the default) because it is not a single expression. Use ${f}-handler and ${f}-args. To run it as JavaScript, select the legacy mode with <script data-csp="false">.`,
|
|
11115
11145
|
shadowed: (f, e) => `Handler(s) ${f.join(", ")} are shadowed by binding keys of the same name in ${e}; the binding values are used.`
|
|
11116
11146
|
};
|
|
11117
|
-
class
|
|
11147
|
+
class oe {
|
|
11118
11148
|
/**
|
|
11119
11149
|
* ここで組み立てる宣言かどうかを返します。false の場合、呼び出し側は従来どおり
|
|
11120
11150
|
* 本文を `new Function` で実行します。
|
|
@@ -11146,7 +11176,7 @@ class ne {
|
|
|
11146
11176
|
*/
|
|
11147
11177
|
static compile(e, t, r) {
|
|
11148
11178
|
const i = `${t}-handler`;
|
|
11149
|
-
return e.hasAttribute(i) ? (
|
|
11179
|
+
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(Ne, Ie.bodyIgnored(t), e.getTarget()), oe.compileHandler(e, t)) : oe.compileExpression(e, t, r);
|
|
11150
11180
|
}
|
|
11151
11181
|
/**
|
|
11152
11182
|
* 登録した関数を呼ぶ呼び出しを組み立てます(`-handler` / `-args`)。
|
|
@@ -11160,23 +11190,23 @@ class ne {
|
|
|
11160
11190
|
static compileHandler(e, t) {
|
|
11161
11191
|
const r = e.getRawAttribute(`${t}-handler`), i = e.getRawAttribute(`${t}-args`);
|
|
11162
11192
|
return (s) => {
|
|
11163
|
-
const n =
|
|
11193
|
+
const n = De.get(r);
|
|
11164
11194
|
if (n === void 0) {
|
|
11165
11195
|
m.warn(
|
|
11166
|
-
|
|
11167
|
-
|
|
11196
|
+
Ne,
|
|
11197
|
+
Ie.notRegistered(r, t),
|
|
11168
11198
|
e.getTarget()
|
|
11169
11199
|
);
|
|
11170
11200
|
return;
|
|
11171
11201
|
}
|
|
11172
11202
|
let a = [];
|
|
11173
11203
|
if (i !== null) {
|
|
11174
|
-
const o =
|
|
11204
|
+
const o = re.evaluateDetailed(
|
|
11175
11205
|
i,
|
|
11176
11206
|
e.getBindingData()
|
|
11177
11207
|
);
|
|
11178
11208
|
if (!Array.isArray(o.value)) {
|
|
11179
|
-
m.warn(
|
|
11209
|
+
m.warn(Ne, Ie.argsNotArray(t), i);
|
|
11180
11210
|
return;
|
|
11181
11211
|
}
|
|
11182
11212
|
a = o.value;
|
|
@@ -11198,22 +11228,22 @@ class ne {
|
|
|
11198
11228
|
static compileExpression(e, t, r) {
|
|
11199
11229
|
const i = e.getRawAttribute(t);
|
|
11200
11230
|
if (i.includes("{{"))
|
|
11201
|
-
return m.warn(
|
|
11231
|
+
return m.warn(Ne, Ie.templateInBody(t), e.getTarget()), null;
|
|
11202
11232
|
try {
|
|
11203
|
-
|
|
11233
|
+
Le.compile(i);
|
|
11204
11234
|
} catch {
|
|
11205
|
-
return m.warn(
|
|
11235
|
+
return m.warn(Ne, Ie.notExpression(t), e.getTarget()), null;
|
|
11206
11236
|
}
|
|
11207
11237
|
return (s) => {
|
|
11208
11238
|
const n = e.getBindingData();
|
|
11209
|
-
|
|
11239
|
+
V.isEnabled() && oe.reportShadowedHandlers(n, t);
|
|
11210
11240
|
const a = {
|
|
11211
|
-
...
|
|
11241
|
+
...De.entries(),
|
|
11212
11242
|
...n
|
|
11213
11243
|
};
|
|
11214
11244
|
return r.forEach((o, l) => {
|
|
11215
11245
|
a[o] = s[l];
|
|
11216
|
-
}),
|
|
11246
|
+
}), re.evaluate(i, a);
|
|
11217
11247
|
};
|
|
11218
11248
|
}
|
|
11219
11249
|
/**
|
|
@@ -11224,11 +11254,11 @@ class ne {
|
|
|
11224
11254
|
* @returns 戻り値はありません。
|
|
11225
11255
|
*/
|
|
11226
11256
|
static reportShadowedHandlers(e, t) {
|
|
11227
|
-
const r = Object.keys(e).filter((i) =>
|
|
11228
|
-
r.length > 0 && m.warn(
|
|
11257
|
+
const r = Object.keys(e).filter((i) => De.has(i));
|
|
11258
|
+
r.length > 0 && m.warn(Ne, Ie.shadowed(r, t));
|
|
11229
11259
|
}
|
|
11230
11260
|
}
|
|
11231
|
-
const
|
|
11261
|
+
const wr = [
|
|
11232
11262
|
"addErrorMessage",
|
|
11233
11263
|
"clearMessages",
|
|
11234
11264
|
"closeDialog",
|
|
@@ -11236,26 +11266,26 @@ const vr = [
|
|
|
11236
11266
|
"dialog",
|
|
11237
11267
|
"openDialog",
|
|
11238
11268
|
"toast"
|
|
11239
|
-
],
|
|
11240
|
-
let
|
|
11241
|
-
const
|
|
11242
|
-
function
|
|
11269
|
+
], Sr = "__haoriHistoryState__", tt = "data-haori-click-lock", Dt = "ファイルを保存できませんでした", Rr = 100;
|
|
11270
|
+
let Pe = null;
|
|
11271
|
+
const Tr = ["info", "warning", "error", "success"], xt = /^(\d{3})-(click|click-await|close|toast|toast-level|no-message|bind)$/;
|
|
11272
|
+
function Ae() {
|
|
11243
11273
|
const e = globalThis.window?.Haori;
|
|
11244
|
-
return
|
|
11274
|
+
return wr.every(
|
|
11245
11275
|
(r) => typeof e?.[r] == "function"
|
|
11246
|
-
) ? e :
|
|
11276
|
+
) ? e : xe;
|
|
11247
11277
|
}
|
|
11248
|
-
const
|
|
11249
|
-
function
|
|
11250
|
-
return
|
|
11278
|
+
const kr = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
11279
|
+
function je(f) {
|
|
11280
|
+
return kr.has(f.toUpperCase());
|
|
11251
11281
|
}
|
|
11252
|
-
function
|
|
11282
|
+
function Dr(f, e) {
|
|
11253
11283
|
for (const [t, r] of Object.entries(e))
|
|
11254
11284
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
11255
|
-
f.append(t,
|
|
11256
|
-
}) : f.append(t,
|
|
11285
|
+
f.append(t, Fe(i));
|
|
11286
|
+
}) : f.append(t, Fe(r)));
|
|
11257
11287
|
}
|
|
11258
|
-
function
|
|
11288
|
+
function Fe(f) {
|
|
11259
11289
|
if (f == null)
|
|
11260
11290
|
return "";
|
|
11261
11291
|
if (typeof f == "object" || typeof f == "function")
|
|
@@ -11266,11 +11296,11 @@ function Ne(f) {
|
|
|
11266
11296
|
}
|
|
11267
11297
|
return String(f);
|
|
11268
11298
|
}
|
|
11269
|
-
function
|
|
11299
|
+
function Zt(f, e) {
|
|
11270
11300
|
const t = new URL(f, window.location.href), r = new URLSearchParams(t.search);
|
|
11271
|
-
return
|
|
11301
|
+
return Dr(r, e), t.search = r.toString(), t.toString();
|
|
11272
11302
|
}
|
|
11273
|
-
function
|
|
11303
|
+
function xr(f) {
|
|
11274
11304
|
if (f == null)
|
|
11275
11305
|
return { payload: {}, dropped: !1 };
|
|
11276
11306
|
if (typeof f == "string") {
|
|
@@ -11287,12 +11317,12 @@ function Dr(f) {
|
|
|
11287
11317
|
return { payload: {}, dropped: !0 };
|
|
11288
11318
|
}
|
|
11289
11319
|
return e.includes("=") ? {
|
|
11290
|
-
payload:
|
|
11320
|
+
payload: Nt(new URLSearchParams(e)),
|
|
11291
11321
|
dropped: !1
|
|
11292
11322
|
} : { payload: {}, dropped: !0 };
|
|
11293
11323
|
}
|
|
11294
11324
|
if (f instanceof URLSearchParams)
|
|
11295
|
-
return { payload:
|
|
11325
|
+
return { payload: Nt(f), dropped: !1 };
|
|
11296
11326
|
if (typeof FormData < "u" && f instanceof FormData) {
|
|
11297
11327
|
const e = {};
|
|
11298
11328
|
let t = !1;
|
|
@@ -11301,30 +11331,30 @@ function Dr(f) {
|
|
|
11301
11331
|
t = !0;
|
|
11302
11332
|
continue;
|
|
11303
11333
|
}
|
|
11304
|
-
|
|
11334
|
+
Qt(e, r, i);
|
|
11305
11335
|
}
|
|
11306
11336
|
return { payload: e, dropped: t };
|
|
11307
11337
|
}
|
|
11308
11338
|
return { payload: {}, dropped: !0 };
|
|
11309
11339
|
}
|
|
11310
|
-
function
|
|
11340
|
+
function Nt(f) {
|
|
11311
11341
|
const e = {};
|
|
11312
11342
|
for (const [t, r] of f.entries())
|
|
11313
|
-
|
|
11343
|
+
Qt(e, t, r);
|
|
11314
11344
|
return e;
|
|
11315
11345
|
}
|
|
11316
|
-
function
|
|
11346
|
+
function Qt(f, e, t) {
|
|
11317
11347
|
const r = f[e];
|
|
11318
11348
|
r === void 0 ? f[e] = t : Array.isArray(r) ? r.push(t) : f[e] = [r, t];
|
|
11319
11349
|
}
|
|
11320
|
-
function
|
|
11350
|
+
function we(f, e) {
|
|
11321
11351
|
if (x.isCompleteSetValue(e))
|
|
11322
11352
|
return e;
|
|
11323
11353
|
if (Array.isArray(e)) {
|
|
11324
11354
|
const t = Array.isArray(f) ? f.slice() : [];
|
|
11325
11355
|
let r = !1;
|
|
11326
11356
|
return e.forEach((i, s) => {
|
|
11327
|
-
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[s] =
|
|
11357
|
+
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[s] = we(t[s], i), r = !0));
|
|
11328
11358
|
}), r ? t : f;
|
|
11329
11359
|
}
|
|
11330
11360
|
if (e !== null && typeof e == "object") {
|
|
@@ -11332,18 +11362,18 @@ function Ae(f, e) {
|
|
|
11332
11362
|
for (const [r, i] of Object.entries(
|
|
11333
11363
|
e
|
|
11334
11364
|
))
|
|
11335
|
-
t[r] =
|
|
11365
|
+
t[r] = we(t[r], i);
|
|
11336
11366
|
return t;
|
|
11337
11367
|
}
|
|
11338
11368
|
return e;
|
|
11339
11369
|
}
|
|
11340
|
-
function
|
|
11370
|
+
function Nr(f) {
|
|
11341
11371
|
const e = f?.body;
|
|
11342
11372
|
return e == null ? !1 : typeof e == "string" ? e !== "" : !0;
|
|
11343
11373
|
}
|
|
11344
|
-
function
|
|
11374
|
+
function Ir(f, e) {
|
|
11345
11375
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
11346
|
-
if (c.runtime !== "demo" ||
|
|
11376
|
+
if (c.runtime !== "demo" || je(r))
|
|
11347
11377
|
return {
|
|
11348
11378
|
url: f,
|
|
11349
11379
|
options: t,
|
|
@@ -11351,11 +11381,11 @@ function Nr(f, e) {
|
|
|
11351
11381
|
effectiveMethod: r,
|
|
11352
11382
|
normalized: !1
|
|
11353
11383
|
};
|
|
11354
|
-
const { payload: i, dropped: s } =
|
|
11384
|
+
const { payload: i, dropped: s } = xr(
|
|
11355
11385
|
t.body
|
|
11356
11386
|
);
|
|
11357
11387
|
let n = f;
|
|
11358
|
-
Object.keys(i).length > 0 && (n =
|
|
11388
|
+
Object.keys(i).length > 0 && (n = Zt(n, i)), s && m.warn(
|
|
11359
11389
|
"Haori",
|
|
11360
11390
|
`The ${r} body cannot be converted into a query string and is dropped by the demo runtime normalization. Send the values with ${c.prefix}{event}-data / ${c.prefix}{event}-form, or use the embedded runtime.`
|
|
11361
11391
|
), delete t.body, t.method = "GET";
|
|
@@ -11371,7 +11401,7 @@ function Nr(f, e) {
|
|
|
11371
11401
|
queryString: new URL(n, window.location.href).search || void 0
|
|
11372
11402
|
};
|
|
11373
11403
|
}
|
|
11374
|
-
function
|
|
11404
|
+
function Fr(f) {
|
|
11375
11405
|
return f == null ? null : typeof f == "string" ? f : f instanceof URLSearchParams ? f.toString() : f instanceof FormData ? Array.from(f.entries()).map(([e, t]) => t instanceof File ? [
|
|
11376
11406
|
e,
|
|
11377
11407
|
{
|
|
@@ -11382,20 +11412,20 @@ function Ir(f) {
|
|
|
11382
11412
|
}
|
|
11383
11413
|
] : [e, String(t)]) : String(f);
|
|
11384
11414
|
}
|
|
11385
|
-
function
|
|
11386
|
-
return f instanceof Blob ? !0 : Array.isArray(f) ? f.some(
|
|
11387
|
-
|
|
11415
|
+
function Ue(f) {
|
|
11416
|
+
return f instanceof Blob ? !0 : Array.isArray(f) ? f.some(Ue) : f !== null && typeof f == "object" ? Object.values(f).some(
|
|
11417
|
+
Ue
|
|
11388
11418
|
) : !1;
|
|
11389
11419
|
}
|
|
11390
|
-
function
|
|
11420
|
+
function Cr(f) {
|
|
11391
11421
|
return Object.values(f).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
11392
|
-
(t) => !(t instanceof Blob) &&
|
|
11393
|
-
) :
|
|
11422
|
+
(t) => !(t instanceof Blob) && Ue(t)
|
|
11423
|
+
) : Ue(e));
|
|
11394
11424
|
}
|
|
11395
|
-
function
|
|
11396
|
-
return
|
|
11425
|
+
function We(f) {
|
|
11426
|
+
return st(x.getValues(f));
|
|
11397
11427
|
}
|
|
11398
|
-
function
|
|
11428
|
+
function st(f) {
|
|
11399
11429
|
const e = (r) => {
|
|
11400
11430
|
if (r instanceof File)
|
|
11401
11431
|
return r.name;
|
|
@@ -11419,7 +11449,7 @@ function it(f) {
|
|
|
11419
11449
|
t[r] = e(i);
|
|
11420
11450
|
return x.carryCollectedRowIdentity(f, t), t;
|
|
11421
11451
|
}
|
|
11422
|
-
function
|
|
11452
|
+
function $r(f, e) {
|
|
11423
11453
|
const t = new Headers(
|
|
11424
11454
|
e.headers || void 0
|
|
11425
11455
|
), r = Array.from(t.entries()).sort(
|
|
@@ -11429,7 +11459,7 @@ function Cr(f, e) {
|
|
|
11429
11459
|
url: f,
|
|
11430
11460
|
method: String(e.method || "GET").toUpperCase(),
|
|
11431
11461
|
headers: r,
|
|
11432
|
-
body:
|
|
11462
|
+
body: Fr(e.body || null)
|
|
11433
11463
|
});
|
|
11434
11464
|
}
|
|
11435
11465
|
const g = class g {
|
|
@@ -11516,9 +11546,9 @@ const g = class g {
|
|
|
11516
11546
|
* @returns 対象のフラグメント(見つからない場合は空)
|
|
11517
11547
|
*/
|
|
11518
11548
|
static resolveSelectorTargets(e, t, r) {
|
|
11519
|
-
const i =
|
|
11549
|
+
const i = z.read(e, t), s = [];
|
|
11520
11550
|
if (i)
|
|
11521
|
-
(r === "click" || r === "error-click" ?
|
|
11551
|
+
(r === "click" || r === "error-click" ? z.queryAllInListOrder(i, t) : z.queryAll(i, t)).forEach((a) => {
|
|
11522
11552
|
const o = D.get(a);
|
|
11523
11553
|
o && s.push(o);
|
|
11524
11554
|
}), s.length === 0 && m.error("Haori", `Element not found: ${i} (${t})`);
|
|
@@ -11575,7 +11605,7 @@ const g = class g {
|
|
|
11575
11605
|
);
|
|
11576
11606
|
const s = g.attrName(r, "error-"), n = /* @__PURE__ */ new Map();
|
|
11577
11607
|
for (const a of e.getAttributeNames()) {
|
|
11578
|
-
const o = a.startsWith(s) ?
|
|
11608
|
+
const o = a.startsWith(s) ? xt.exec(a.slice(s.length)) : null;
|
|
11579
11609
|
o && o[2] === "no-message" && n.set(Number(o[1]), {
|
|
11580
11610
|
key: `error-${o[1]}`,
|
|
11581
11611
|
clickFragments: null,
|
|
@@ -11607,7 +11637,7 @@ const g = class g {
|
|
|
11607
11637
|
for (const a of e.getAttributeNames()) {
|
|
11608
11638
|
if (!a.startsWith(i))
|
|
11609
11639
|
continue;
|
|
11610
|
-
const o =
|
|
11640
|
+
const o = xt.exec(
|
|
11611
11641
|
a.slice(i.length)
|
|
11612
11642
|
);
|
|
11613
11643
|
o && s.add(o[1]);
|
|
@@ -11653,7 +11683,7 @@ const g = class g {
|
|
|
11653
11683
|
* @returns レベル。4 つの値のどれとも一致しない場合は null(`info` で表示する)
|
|
11654
11684
|
*/
|
|
11655
11685
|
static toToastLevel(e) {
|
|
11656
|
-
return
|
|
11686
|
+
return Tr.includes(e) ? e : null;
|
|
11657
11687
|
}
|
|
11658
11688
|
/**
|
|
11659
11689
|
* `data-{event}-error-status` の値を、ステータスの一覧へ変換します。
|
|
@@ -11690,7 +11720,9 @@ const g = class g {
|
|
|
11690
11720
|
* @returns 手続き開始時の評価値
|
|
11691
11721
|
*/
|
|
11692
11722
|
static readLateAttribute(e, t, r, i) {
|
|
11693
|
-
const s =
|
|
11723
|
+
const s = re.withoutDiagnosis(
|
|
11724
|
+
() => e.getAttributeEvaluation(i)
|
|
11725
|
+
);
|
|
11694
11726
|
return t.lateAttributes || (t.lateAttributes = /* @__PURE__ */ new Map()), t.lateAttributes.set(r, {
|
|
11695
11727
|
attributeName: i,
|
|
11696
11728
|
hasUnresolvedReference: s?.hasUnresolvedReference ?? !1
|
|
@@ -11831,7 +11863,7 @@ const g = class g {
|
|
|
11831
11863
|
return { value: e.replace(
|
|
11832
11864
|
g.DATA_PLACEHOLDER_REGEX,
|
|
11833
11865
|
(s, n, a) => {
|
|
11834
|
-
const o =
|
|
11866
|
+
const o = re.evaluateDetailed(
|
|
11835
11867
|
n ?? a ?? "",
|
|
11836
11868
|
t
|
|
11837
11869
|
);
|
|
@@ -11901,7 +11933,7 @@ const g = class g {
|
|
|
11901
11933
|
return { value: e.replace(
|
|
11902
11934
|
g.DATA_PLACEHOLDER_REGEX,
|
|
11903
11935
|
(s, n, a, o) => {
|
|
11904
|
-
const l =
|
|
11936
|
+
const l = re.evaluateDetailed(
|
|
11905
11937
|
n ?? a ?? "",
|
|
11906
11938
|
t
|
|
11907
11939
|
);
|
|
@@ -11972,8 +12004,8 @@ const g = class g {
|
|
|
11972
12004
|
targetFragment: e
|
|
11973
12005
|
}, i = t ? g.attrName(t, "if") : g.attrName(null, "if", !0);
|
|
11974
12006
|
if (e.hasAttribute(i)) {
|
|
11975
|
-
const
|
|
11976
|
-
typeof
|
|
12007
|
+
const k = e.getRawAttribute(i);
|
|
12008
|
+
typeof k == "string" && k.trim() !== "" ? (r.conditionExpression = x.unwrapConditionExpression(k), r.conditionAttributeName = i) : m.warn(
|
|
11977
12009
|
"Haori",
|
|
11978
12010
|
`${i} に条件式が指定されていません。`
|
|
11979
12011
|
);
|
|
@@ -11984,86 +12016,88 @@ const g = class g {
|
|
|
11984
12016
|
e.getAttribute(g.attrName(t, "confirm"))
|
|
11985
12017
|
)
|
|
11986
12018
|
)), e.hasAttribute(g.attrName(t, "data")) && (r.dataAttrName = g.attrName(t, "data")), e.hasAttribute(g.attrName(t, "form"))) {
|
|
11987
|
-
const
|
|
12019
|
+
const U = z.read(
|
|
11988
12020
|
e,
|
|
11989
12021
|
g.attrName(t, "form")
|
|
11990
12022
|
);
|
|
11991
|
-
if (
|
|
11992
|
-
const
|
|
11993
|
-
|
|
12023
|
+
if (U) {
|
|
12024
|
+
const Q = z.query(
|
|
12025
|
+
U,
|
|
11994
12026
|
g.attrName(t, "form")
|
|
11995
12027
|
);
|
|
11996
|
-
|
|
11997
|
-
D.get(
|
|
12028
|
+
Q !== null ? r.formFragment = x.getFormFragment(
|
|
12029
|
+
D.get(Q)
|
|
11998
12030
|
) : m.error(
|
|
11999
12031
|
"Haori",
|
|
12000
|
-
`Form element not found: ${
|
|
12032
|
+
`Form element not found: ${U} (${g.attrName(t, "form")})`
|
|
12001
12033
|
);
|
|
12002
12034
|
} else
|
|
12003
12035
|
r.formFragment = x.getFormFragment(e);
|
|
12004
12036
|
} else if (t === "change" || t === "input") {
|
|
12005
12037
|
r.formFragment = x.getFormFragment(e);
|
|
12006
|
-
const
|
|
12007
|
-
r.implicitFormFragment = !e.getAttributeNames().some((
|
|
12038
|
+
const U = `${c.prefix}${t}-`;
|
|
12039
|
+
r.implicitFormFragment = !e.getAttributeNames().some((Q) => Q.startsWith(U)), r.formFragment === null && g.isNamedInputFragment(e) && (r.selfValueFragment = e);
|
|
12008
12040
|
}
|
|
12009
|
-
|
|
12010
|
-
const
|
|
12011
|
-
if (
|
|
12012
|
-
const
|
|
12041
|
+
V.isEnabled() && g.warnAuthRedirectWithoutFetch(e, t);
|
|
12042
|
+
const k = `${c.prefix}${t}-before-run`;
|
|
12043
|
+
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12044
|
+
const U = oe.compile(e, k, [
|
|
12013
12045
|
"fetchUrl",
|
|
12014
12046
|
"fetchOptions"
|
|
12015
12047
|
]);
|
|
12016
|
-
|
|
12017
|
-
} else if (e.hasAttribute(
|
|
12018
|
-
const
|
|
12048
|
+
U && (r.beforeCallback = (Q, pe) => U([Q, pe]));
|
|
12049
|
+
} else if (e.hasAttribute(k)) {
|
|
12050
|
+
const U = e.getRawAttribute(k);
|
|
12019
12051
|
try {
|
|
12020
12052
|
r.beforeCallback = new Function(
|
|
12021
12053
|
"fetchUrl",
|
|
12022
12054
|
"fetchOptions",
|
|
12023
12055
|
`
|
|
12024
12056
|
"use strict";
|
|
12025
|
-
${
|
|
12057
|
+
${U}
|
|
12026
12058
|
`
|
|
12027
12059
|
);
|
|
12028
|
-
} catch (
|
|
12029
|
-
m.error("Haori", `Invalid before script: ${
|
|
12060
|
+
} catch (Q) {
|
|
12061
|
+
m.error("Haori", `Invalid before script: ${Q}`);
|
|
12030
12062
|
}
|
|
12031
12063
|
}
|
|
12032
|
-
const
|
|
12033
|
-
if (
|
|
12034
|
-
const
|
|
12035
|
-
|
|
12036
|
-
} else if (e.hasAttribute(
|
|
12037
|
-
const
|
|
12038
|
-
let
|
|
12064
|
+
const B = g.attrName(t, "run");
|
|
12065
|
+
if (oe.declared(e, B) && oe.applies(e, B)) {
|
|
12066
|
+
const U = oe.compile(e, B, ["event"]);
|
|
12067
|
+
U && (r.runScript = (Q) => U([Q]));
|
|
12068
|
+
} else if (e.hasAttribute(B)) {
|
|
12069
|
+
const U = String(e.getAttribute(B) ?? "");
|
|
12070
|
+
let Q = null;
|
|
12039
12071
|
try {
|
|
12040
|
-
|
|
12072
|
+
Q = new Function(
|
|
12041
12073
|
"event",
|
|
12042
12074
|
`"use strict"; return (
|
|
12043
|
-
${
|
|
12075
|
+
${U}
|
|
12044
12076
|
);`
|
|
12045
12077
|
);
|
|
12046
12078
|
} catch {
|
|
12047
12079
|
try {
|
|
12048
|
-
|
|
12049
|
-
${
|
|
12080
|
+
Q = new Function("event", `"use strict";
|
|
12081
|
+
${U}
|
|
12050
12082
|
`);
|
|
12051
|
-
} catch (
|
|
12052
|
-
m.error("Haori", `Invalid run script: ${
|
|
12083
|
+
} catch (pe) {
|
|
12084
|
+
m.error("Haori", `Invalid run script: ${pe}`);
|
|
12053
12085
|
}
|
|
12054
12086
|
}
|
|
12055
|
-
|
|
12087
|
+
Q && (r.runScript = Q);
|
|
12056
12088
|
}
|
|
12089
|
+
const ue = g.attrName(t, "clipboard");
|
|
12090
|
+
e.hasAttribute(ue) && (r.clipboardAttrName = ue);
|
|
12057
12091
|
}
|
|
12058
12092
|
const s = g.attrName(t, "fetch"), n = e.hasAttribute(s);
|
|
12059
12093
|
if (n) {
|
|
12060
|
-
const
|
|
12061
|
-
|
|
12094
|
+
const k = e.getAttributeEvaluation(s);
|
|
12095
|
+
k && (r.fetchHasUnresolvedReference = k.hasUnresolvedReference, r.fetchUrl = k.hasUnresolvedReference ? null : k.value);
|
|
12062
12096
|
}
|
|
12063
12097
|
const a = {}, o = t ? g.attrName(t, "fetch-method") : g.attrName(null, "method", !0);
|
|
12064
12098
|
if (e.hasAttribute(o)) {
|
|
12065
|
-
const
|
|
12066
|
-
|
|
12099
|
+
const k = e.getAttributeEvaluation(o);
|
|
12100
|
+
k?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method = g.normalizeAttributeText(k?.value) ?? void 0;
|
|
12067
12101
|
}
|
|
12068
12102
|
const l = t ? g.attrName(t, "fetch-headers") : g.attrName(null, "headers", !0), u = g.readFetchHeaders(
|
|
12069
12103
|
e,
|
|
@@ -12073,9 +12107,9 @@ ${j}
|
|
|
12073
12107
|
const d = t ? g.attrName(t, "fetch-content-type") : g.attrName(null, "content-type", !0);
|
|
12074
12108
|
let y = null;
|
|
12075
12109
|
if (e.hasAttribute(d)) {
|
|
12076
|
-
const
|
|
12077
|
-
|
|
12078
|
-
|
|
12110
|
+
const k = e.getAttributeEvaluation(d);
|
|
12111
|
+
k?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), y = g.normalizeAttributeText(
|
|
12112
|
+
k?.value
|
|
12079
12113
|
);
|
|
12080
12114
|
}
|
|
12081
12115
|
if (y !== null)
|
|
@@ -12084,10 +12118,10 @@ ${j}
|
|
|
12084
12118
|
y
|
|
12085
12119
|
);
|
|
12086
12120
|
else if (a.method && !g.hasDeclaredContentType(a.headers)) {
|
|
12087
|
-
const
|
|
12121
|
+
const k = a.method.toUpperCase();
|
|
12088
12122
|
a.headers = g.withContentType(
|
|
12089
12123
|
a.headers,
|
|
12090
|
-
|
|
12124
|
+
k === "GET" || k === "HEAD" || k === "OPTIONS" ? "application/x-www-form-urlencoded" : "application/json"
|
|
12091
12125
|
);
|
|
12092
12126
|
}
|
|
12093
12127
|
Object.keys(a).length > 0 && (r.fetchOptions = a);
|
|
@@ -12099,8 +12133,8 @@ ${j}
|
|
|
12099
12133
|
);
|
|
12100
12134
|
else if (e.hasAttribute(b)) {
|
|
12101
12135
|
r.download = !0;
|
|
12102
|
-
const
|
|
12103
|
-
r.downloadFileName =
|
|
12136
|
+
const k = e.getAttributeEvaluation(b);
|
|
12137
|
+
r.downloadFileName = k?.hasUnresolvedReference ? null : g.normalizeAttributeText(k?.value);
|
|
12104
12138
|
}
|
|
12105
12139
|
const E = t ? g.attrName(t, "fetch-download-folder") : g.attrName(null, "download-folder", !0);
|
|
12106
12140
|
e.hasAttribute(E) && (r.download ? r.downloadFolder = !0 : m.warn(
|
|
@@ -12109,55 +12143,57 @@ ${j}
|
|
|
12109
12143
|
));
|
|
12110
12144
|
const A = t ? g.attrName(t, "bind") : g.attrName(null, "bind", !0);
|
|
12111
12145
|
if (e.hasAttribute(A)) {
|
|
12112
|
-
const
|
|
12113
|
-
if (
|
|
12114
|
-
const
|
|
12115
|
-
|
|
12116
|
-
const
|
|
12117
|
-
|
|
12146
|
+
const k = z.read(e, A);
|
|
12147
|
+
if (k) {
|
|
12148
|
+
const B = z.queryAll(k, A);
|
|
12149
|
+
B.length > 0 ? (r.bindFragments = [], B.forEach((ue) => {
|
|
12150
|
+
const U = D.get(ue);
|
|
12151
|
+
U && r.bindFragments.push(U);
|
|
12118
12152
|
})) : m.error(
|
|
12119
12153
|
"Haori",
|
|
12120
|
-
`Bind element not found: ${
|
|
12154
|
+
`Bind element not found: ${k} (${A})`
|
|
12121
12155
|
);
|
|
12122
12156
|
}
|
|
12123
12157
|
}
|
|
12124
|
-
const
|
|
12125
|
-
t ? e.hasAttribute(
|
|
12126
|
-
|
|
12127
|
-
) : e.hasAttribute(
|
|
12128
|
-
const
|
|
12129
|
-
if (e.hasAttribute(
|
|
12130
|
-
const
|
|
12131
|
-
r.bindParams =
|
|
12158
|
+
const w = g.attrName(t, "bind-arg"), $ = g.attrName(null, "arg", !0), C = g.attrName(null, "bind-arg", !0);
|
|
12159
|
+
t ? e.hasAttribute(w) && (r.bindArg = e.getRawAttribute(w)) : e.hasAttribute($) ? r.bindArg = e.getRawAttribute(
|
|
12160
|
+
$
|
|
12161
|
+
) : e.hasAttribute(C) && (r.bindArg = e.getRawAttribute(C));
|
|
12162
|
+
const se = t ? g.attrName(t, "bind-params") : g.attrName(null, "bind-params", !0);
|
|
12163
|
+
if (e.hasAttribute(se)) {
|
|
12164
|
+
const k = e.getRawAttribute(se);
|
|
12165
|
+
r.bindParams = k.split("&").map((B) => B.trim());
|
|
12132
12166
|
}
|
|
12133
12167
|
const F = t ? g.attrName(t, "bind-append") : g.attrName(null, "bind-append", !0);
|
|
12134
12168
|
if (e.hasAttribute(F)) {
|
|
12135
|
-
const
|
|
12136
|
-
r.bindAppendParams =
|
|
12169
|
+
const k = e.getRawAttribute(F);
|
|
12170
|
+
r.bindAppendParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12137
12171
|
}
|
|
12138
12172
|
const Z = t ? g.attrName(t, "bind-merge") : g.attrName(null, "bind-merge", !0);
|
|
12139
12173
|
e.hasAttribute(Z) && (r.bindMerge = !0);
|
|
12140
|
-
const
|
|
12141
|
-
e.hasAttribute(
|
|
12142
|
-
const
|
|
12143
|
-
|
|
12144
|
-
|
|
12145
|
-
|
|
12174
|
+
const ee = t ? g.attrName(t, "bind-transform") : g.attrName(null, "bind-transform", !0);
|
|
12175
|
+
e.hasAttribute(ee) && (r.bindTransform = e.getRawAttribute(ee));
|
|
12176
|
+
const ne = t ? g.attrName(t, "payload-transform") : g.attrName(null, "payload-transform", !0);
|
|
12177
|
+
e.hasAttribute(ne) && (r.payloadTransform = e.getRawAttribute(ne));
|
|
12178
|
+
const K = t ? g.attrName(t, "copy-params") : null;
|
|
12179
|
+
if (K && e.hasAttribute(K)) {
|
|
12180
|
+
const k = e.getRawAttribute(K);
|
|
12181
|
+
r.copyParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12146
12182
|
}
|
|
12147
12183
|
if (t) {
|
|
12148
12184
|
if (e.hasAttribute(g.attrName(t, "adjust"))) {
|
|
12149
|
-
const W =
|
|
12185
|
+
const W = z.read(
|
|
12150
12186
|
e,
|
|
12151
12187
|
g.attrName(t, "adjust")
|
|
12152
12188
|
);
|
|
12153
12189
|
if (W) {
|
|
12154
|
-
const G =
|
|
12190
|
+
const G = z.queryAll(
|
|
12155
12191
|
W,
|
|
12156
12192
|
g.attrName(t, "adjust")
|
|
12157
12193
|
);
|
|
12158
|
-
G.length > 0 ? (r.adjustFragments = [], G.forEach((
|
|
12159
|
-
const
|
|
12160
|
-
|
|
12194
|
+
G.length > 0 ? (r.adjustFragments = [], G.forEach((ie) => {
|
|
12195
|
+
const be = D.get(ie);
|
|
12196
|
+
be && r.adjustFragments.push(be);
|
|
12161
12197
|
})) : m.error(
|
|
12162
12198
|
"Haori",
|
|
12163
12199
|
`Adjust element not found: ${W} (${g.attrName(t, "adjust")})`
|
|
@@ -12166,19 +12202,19 @@ ${j}
|
|
|
12166
12202
|
if (e.hasAttribute(g.attrName(t, "adjust-value"))) {
|
|
12167
12203
|
const G = e.getRawAttribute(
|
|
12168
12204
|
g.attrName(t, "adjust-value")
|
|
12169
|
-
),
|
|
12170
|
-
isNaN(
|
|
12205
|
+
), ie = Number(G);
|
|
12206
|
+
isNaN(ie) || (r.adjustValue = ie);
|
|
12171
12207
|
}
|
|
12172
12208
|
}
|
|
12173
12209
|
e.hasAttribute(g.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(g.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(g.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(g.attrName(t, "row-next")) && (r.rowMoveNext = !0);
|
|
12174
|
-
const
|
|
12175
|
-
if (
|
|
12176
|
-
const W =
|
|
12210
|
+
const k = `${c.prefix}${t}-after-run`;
|
|
12211
|
+
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12212
|
+
const W = oe.compile(e, k, [
|
|
12177
12213
|
"response"
|
|
12178
12214
|
]);
|
|
12179
12215
|
W && (r.afterCallback = (G) => W([G]));
|
|
12180
|
-
} else if (e.hasAttribute(
|
|
12181
|
-
const W = e.getRawAttribute(
|
|
12216
|
+
} else if (e.hasAttribute(k)) {
|
|
12217
|
+
const W = e.getRawAttribute(k);
|
|
12182
12218
|
try {
|
|
12183
12219
|
r.afterCallback = new Function(
|
|
12184
12220
|
"response",
|
|
@@ -12231,18 +12267,18 @@ ${W}
|
|
|
12231
12267
|
g.attrName(t, "error-bind")
|
|
12232
12268
|
);
|
|
12233
12269
|
}
|
|
12234
|
-
const
|
|
12235
|
-
if (
|
|
12270
|
+
const B = g.attrName(t, "redirect"), ue = g.attrName(t, "redirect-replace"), U = e.hasAttribute(B), Q = e.hasAttribute(ue);
|
|
12271
|
+
if (U && (r.redirectUrl = g.readLateAttribute(
|
|
12236
12272
|
e,
|
|
12237
12273
|
r,
|
|
12238
12274
|
"redirect",
|
|
12239
|
-
|
|
12240
|
-
)),
|
|
12275
|
+
B
|
|
12276
|
+
)), Q && (r.redirectReplaceUrl = g.readLateAttribute(
|
|
12241
12277
|
e,
|
|
12242
12278
|
r,
|
|
12243
12279
|
"redirect-replace",
|
|
12244
|
-
|
|
12245
|
-
)),
|
|
12280
|
+
ue
|
|
12281
|
+
)), U || Q) {
|
|
12246
12282
|
const W = g.attrName(
|
|
12247
12283
|
t,
|
|
12248
12284
|
"redirect-return-param"
|
|
@@ -12265,12 +12301,12 @@ ${W}
|
|
|
12265
12301
|
"history",
|
|
12266
12302
|
g.attrName(t, "history")
|
|
12267
12303
|
)), e.hasAttribute(g.attrName(t, "history-data")) && (r.historyDataAttrName = g.attrName(t, "history-data")), e.hasAttribute(g.attrName(t, "history-form"))) {
|
|
12268
|
-
const W =
|
|
12304
|
+
const W = z.read(
|
|
12269
12305
|
e,
|
|
12270
12306
|
g.attrName(t, "history-form")
|
|
12271
12307
|
);
|
|
12272
12308
|
if (W) {
|
|
12273
|
-
const G =
|
|
12309
|
+
const G = z.query(
|
|
12274
12310
|
W,
|
|
12275
12311
|
g.attrName(t, "history-form")
|
|
12276
12312
|
);
|
|
@@ -12299,41 +12335,41 @@ ${W}
|
|
|
12299
12335
|
const G = g.attrName(t, W);
|
|
12300
12336
|
if (!e.hasAttribute(G))
|
|
12301
12337
|
return;
|
|
12302
|
-
const
|
|
12338
|
+
const ie = g.resolveSelectorTargets(
|
|
12303
12339
|
e,
|
|
12304
12340
|
G,
|
|
12305
12341
|
W
|
|
12306
12342
|
);
|
|
12307
|
-
if (
|
|
12343
|
+
if (ie.length > 0)
|
|
12308
12344
|
switch (W) {
|
|
12309
12345
|
case "reset-before":
|
|
12310
|
-
r.resetBeforeFragments =
|
|
12346
|
+
r.resetBeforeFragments = ie;
|
|
12311
12347
|
break;
|
|
12312
12348
|
case "reset":
|
|
12313
|
-
r.resetFragments =
|
|
12349
|
+
r.resetFragments = ie;
|
|
12314
12350
|
break;
|
|
12315
12351
|
case "refetch":
|
|
12316
|
-
r.refetchFragments =
|
|
12352
|
+
r.refetchFragments = ie;
|
|
12317
12353
|
break;
|
|
12318
12354
|
case "click":
|
|
12319
|
-
r.clickFragments =
|
|
12355
|
+
r.clickFragments = ie, r.clickAwait = e.hasAttribute(`${G}-await`);
|
|
12320
12356
|
break;
|
|
12321
12357
|
case "copy":
|
|
12322
|
-
r.copyFragments =
|
|
12358
|
+
r.copyFragments = ie;
|
|
12323
12359
|
break;
|
|
12324
12360
|
case "open":
|
|
12325
|
-
r.openFragments =
|
|
12361
|
+
r.openFragments = ie;
|
|
12326
12362
|
break;
|
|
12327
12363
|
case "close":
|
|
12328
|
-
r.closeFragments =
|
|
12364
|
+
r.closeFragments = ie;
|
|
12329
12365
|
break;
|
|
12330
12366
|
case "error-click":
|
|
12331
|
-
r.errorClickFragments =
|
|
12367
|
+
r.errorClickFragments = ie, r.errorClickAwait = e.hasAttribute(
|
|
12332
12368
|
`${G}-await`
|
|
12333
12369
|
);
|
|
12334
12370
|
break;
|
|
12335
12371
|
case "error-close":
|
|
12336
|
-
r.errorCloseFragments =
|
|
12372
|
+
r.errorCloseFragments = ie;
|
|
12337
12373
|
break;
|
|
12338
12374
|
}
|
|
12339
12375
|
}), t !== "poll" && (r.errorStatusActions = g.readErrorStatusActions(
|
|
@@ -12341,73 +12377,73 @@ ${W}
|
|
|
12341
12377
|
r,
|
|
12342
12378
|
t
|
|
12343
12379
|
));
|
|
12344
|
-
const
|
|
12345
|
-
if (e.hasAttribute(
|
|
12346
|
-
const W =
|
|
12380
|
+
const ce = g.attrName(t, "copy-source");
|
|
12381
|
+
if (e.hasAttribute(ce)) {
|
|
12382
|
+
const W = z.read(e, ce);
|
|
12347
12383
|
if (W) {
|
|
12348
|
-
const G =
|
|
12384
|
+
const G = z.query(W, ce);
|
|
12349
12385
|
if (G !== null) {
|
|
12350
|
-
const
|
|
12351
|
-
|
|
12386
|
+
const ie = D.get(G);
|
|
12387
|
+
ie ? r.copySourceFragment = ie : m.error(
|
|
12352
12388
|
"Haori",
|
|
12353
|
-
`Element is not managed by Haori: ${W} (${
|
|
12389
|
+
`Element is not managed by Haori: ${W} (${ce})`
|
|
12354
12390
|
);
|
|
12355
12391
|
} else
|
|
12356
12392
|
m.error(
|
|
12357
12393
|
"Haori",
|
|
12358
|
-
`Element not found: ${W} (${
|
|
12394
|
+
`Element not found: ${W} (${ce})`
|
|
12359
12395
|
);
|
|
12360
12396
|
} else
|
|
12361
12397
|
r.copySourceFragment = e;
|
|
12362
12398
|
}
|
|
12363
12399
|
}
|
|
12364
12400
|
if (!t && (e.hasAttribute(g.attrName(null, "data", !0)) && (r.dataAttrName = g.attrName(null, "data", !0)), e.hasAttribute(g.attrName(null, "form", !0)))) {
|
|
12365
|
-
const
|
|
12401
|
+
const k = z.read(
|
|
12366
12402
|
e,
|
|
12367
12403
|
g.attrName(null, "form", !0)
|
|
12368
12404
|
);
|
|
12369
|
-
if (
|
|
12370
|
-
const
|
|
12371
|
-
|
|
12405
|
+
if (k) {
|
|
12406
|
+
const B = z.query(
|
|
12407
|
+
k,
|
|
12372
12408
|
g.attrName(null, "form", !0)
|
|
12373
12409
|
);
|
|
12374
|
-
|
|
12375
|
-
D.get(
|
|
12410
|
+
B !== null ? r.formFragment = x.getFormFragment(
|
|
12411
|
+
D.get(B)
|
|
12376
12412
|
) : m.error(
|
|
12377
12413
|
"Haori",
|
|
12378
|
-
`Form element not found: ${
|
|
12414
|
+
`Form element not found: ${k} (${g.attrName(null, "fetch-form", !0)})`
|
|
12379
12415
|
);
|
|
12380
12416
|
} else
|
|
12381
12417
|
r.formFragment = x.getFormFragment(e);
|
|
12382
12418
|
}
|
|
12383
12419
|
(!t || t === "poll") && g.readNoMessageDeclarations(e, r, t ?? "fetch");
|
|
12384
|
-
const
|
|
12385
|
-
if (e.hasAttribute(
|
|
12386
|
-
const
|
|
12387
|
-
|
|
12388
|
-
const
|
|
12389
|
-
|
|
12390
|
-
}),
|
|
12420
|
+
const ae = t ? g.attrName(t, "fetch-state") : g.attrName(null, "state", !0);
|
|
12421
|
+
if (e.hasAttribute(ae)) {
|
|
12422
|
+
const k = z.read(e, ae), B = [];
|
|
12423
|
+
k ? (z.queryAll(k, ae).forEach((U) => {
|
|
12424
|
+
const Q = D.get(U);
|
|
12425
|
+
Q && B.push(Q);
|
|
12426
|
+
}), B.length === 0 && m.error(
|
|
12391
12427
|
"Haori",
|
|
12392
|
-
`Element not found: ${
|
|
12393
|
-
)) :
|
|
12428
|
+
`Element not found: ${k} (${ae})`
|
|
12429
|
+
)) : B.push(e), B.length > 0 && (r.fetchStateFragments = B);
|
|
12394
12430
|
}
|
|
12395
|
-
const
|
|
12396
|
-
if (e.hasAttribute(
|
|
12397
|
-
const
|
|
12398
|
-
if (
|
|
12431
|
+
const j = t ? g.attrName(t, "store-clear") : g.attrName(null, "store-clear", !0);
|
|
12432
|
+
if (e.hasAttribute(j)) {
|
|
12433
|
+
const k = e.getRawAttribute(j), B = k === null ? "" : k.trim();
|
|
12434
|
+
if (B === "")
|
|
12399
12435
|
m.error(
|
|
12400
12436
|
"Haori",
|
|
12401
|
-
`ストレージキーが指定されていません (${
|
|
12437
|
+
`ストレージキーが指定されていません (${j})`
|
|
12402
12438
|
);
|
|
12403
12439
|
else {
|
|
12404
|
-
r.storeClearKey =
|
|
12405
|
-
const
|
|
12406
|
-
`${
|
|
12407
|
-
),
|
|
12408
|
-
|
|
12440
|
+
r.storeClearKey = B;
|
|
12441
|
+
const ue = e.getRawAttribute(
|
|
12442
|
+
`${j}-type`
|
|
12443
|
+
), U = ue === null ? "session" : ue.trim();
|
|
12444
|
+
U === "local" || U === "session" ? r.storeClearKind = U : (m.warn(
|
|
12409
12445
|
"Haori",
|
|
12410
|
-
`${
|
|
12446
|
+
`${j}-type は session または local を指定してください(session として扱います): ${U}`
|
|
12411
12447
|
), r.storeClearKind = "session");
|
|
12412
12448
|
}
|
|
12413
12449
|
}
|
|
@@ -12507,6 +12543,39 @@ ${W}
|
|
|
12507
12543
|
async runWithOutcome() {
|
|
12508
12544
|
return await this.execute() ? "success" : this.skipped ? "skipped" : "failure";
|
|
12509
12545
|
}
|
|
12546
|
+
/**
|
|
12547
|
+
* `data-{event}-clipboard` の値をクリップボードへ書き始めます。
|
|
12548
|
+
*
|
|
12549
|
+
* 値は呼んだ時点で評価します。評価結果が空(`null` / `undefined` / `false` /
|
|
12550
|
+
* `NaN` / 空文字)の場合と未解決参照を含む場合は書きません。書き込みは同期に始め、
|
|
12551
|
+
* 結果は Promise で返します(仕様「`data-{event}-clipboard`」)。
|
|
12552
|
+
*
|
|
12553
|
+
* @param attributeName 値を宣言した属性名
|
|
12554
|
+
* @returns 書き込みが完了したら true、書かなかった・失敗した場合は false
|
|
12555
|
+
* で解決する Promise
|
|
12556
|
+
*/
|
|
12557
|
+
startClipboardWrite(e) {
|
|
12558
|
+
const t = this.options.targetFragment?.getAttributeEvaluation(e);
|
|
12559
|
+
if (t?.hasUnresolvedReference)
|
|
12560
|
+
return Promise.resolve(!1);
|
|
12561
|
+
const r = t?.value, i = r == null || r === !1 || Number.isNaN(r) ? "" : String(r);
|
|
12562
|
+
if (i === "")
|
|
12563
|
+
return Promise.resolve(!1);
|
|
12564
|
+
const s = typeof navigator > "u" ? void 0 : navigator.clipboard;
|
|
12565
|
+
if (!s || typeof s.writeText != "function")
|
|
12566
|
+
return m.warn(
|
|
12567
|
+
"Haori",
|
|
12568
|
+
`${e}: navigator.clipboard is not available (it requires a secure context such as HTTPS).`
|
|
12569
|
+
), Promise.resolve(!1);
|
|
12570
|
+
try {
|
|
12571
|
+
return s.writeText(i).then(
|
|
12572
|
+
() => !0,
|
|
12573
|
+
(n) => (m.warn("Haori", `${e}: failed to write: ${n}`), !1)
|
|
12574
|
+
);
|
|
12575
|
+
} catch (n) {
|
|
12576
|
+
return m.warn("Haori", `${e}: failed to write: ${n}`), Promise.resolve(!1);
|
|
12577
|
+
}
|
|
12578
|
+
}
|
|
12510
12579
|
/**
|
|
12511
12580
|
* 一連の処理を実行します。成功結果を内部で扱うための実体です。
|
|
12512
12581
|
*
|
|
@@ -12526,104 +12595,112 @@ ${W}
|
|
|
12526
12595
|
`${c.prefix}${this.eventType ?? "fetch"}-form が解決できません`
|
|
12527
12596
|
), !this.evaluateExecutionCondition())
|
|
12528
12597
|
return this.skipped = !0, await this.commitEditOnStop(), !1;
|
|
12598
|
+
let t;
|
|
12529
12599
|
if (this.options.runScript) {
|
|
12530
|
-
const
|
|
12600
|
+
const A = this.options.targetFragment?.getTarget() ?? null;
|
|
12531
12601
|
try {
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
);
|
|
12536
|
-
b === !1 && this.domEvent && this.domEvent.preventDefault(), b != null && typeof b.then == "function" && await b;
|
|
12537
|
-
} catch (b) {
|
|
12538
|
-
m.error("Haori", `Run script execution error: ${b}`);
|
|
12602
|
+
t = this.options.runScript.call(A, this.domEvent), t === !1 && this.domEvent && this.domEvent.preventDefault();
|
|
12603
|
+
} catch (w) {
|
|
12604
|
+
m.error("Haori", `Run script execution error: ${w}`);
|
|
12539
12605
|
}
|
|
12540
12606
|
}
|
|
12607
|
+
const r = this.options.clipboardAttrName ? this.startClipboardWrite(this.options.clipboardAttrName) : null;
|
|
12608
|
+
if (t != null && typeof t.then == "function")
|
|
12609
|
+
try {
|
|
12610
|
+
await t;
|
|
12611
|
+
} catch (A) {
|
|
12612
|
+
m.error("Haori", `Run script execution error: ${A}`);
|
|
12613
|
+
}
|
|
12614
|
+
if (r && !await r)
|
|
12615
|
+
return await this.commitEditOnStop(), !1;
|
|
12541
12616
|
if (!await this.confirm())
|
|
12542
12617
|
return await this.commitEditOnStop(), !1;
|
|
12543
12618
|
if (this.options.downloadFolder && await this.prepareDownloadFolder() === "cancelled")
|
|
12544
12619
|
return !1;
|
|
12545
12620
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
12546
12621
|
this.options.resetBeforeFragments.map(
|
|
12547
|
-
(
|
|
12622
|
+
(A) => x.reset(A, this.operationSequence)
|
|
12548
12623
|
)
|
|
12549
12624
|
), this.captureHistorySnapshots());
|
|
12550
|
-
const
|
|
12625
|
+
const s = this.prepareFetchRequest();
|
|
12626
|
+
if (s.payloadTransformFailed)
|
|
12627
|
+
return await this.commitEditOnStop(), !1;
|
|
12551
12628
|
this.requestUserEditSequence = R.currentSequence();
|
|
12552
|
-
const
|
|
12553
|
-
let
|
|
12629
|
+
const n = s.payload, a = Object.keys(s.sentPayload).length > 0 ? s.sentPayload : void 0;
|
|
12630
|
+
let o = s.url, l = s.options, u = !1, d = !1;
|
|
12554
12631
|
if (this.options.beforeCallback) {
|
|
12555
|
-
const
|
|
12556
|
-
|
|
12557
|
-
|
|
12632
|
+
const A = this.options.beforeCallback(
|
|
12633
|
+
o || null,
|
|
12634
|
+
l || null
|
|
12558
12635
|
);
|
|
12559
|
-
if (
|
|
12560
|
-
if (
|
|
12636
|
+
if (A != null) {
|
|
12637
|
+
if (A === !1 || typeof A == "object" && A.stop)
|
|
12561
12638
|
return !1;
|
|
12562
|
-
typeof
|
|
12639
|
+
typeof A == "object" && (u = "fetchUrl" in A, d = "fetchOptions" in A, o = u ? A.fetchUrl : o, l = d ? A.fetchOptions : l);
|
|
12563
12640
|
}
|
|
12564
12641
|
}
|
|
12565
|
-
const
|
|
12566
|
-
if (
|
|
12642
|
+
const y = Object.keys(n).length > 0;
|
|
12643
|
+
if (o) {
|
|
12567
12644
|
this.isInputEditProcedure() && await this.commitFormValues(
|
|
12568
12645
|
this.options.formFragment,
|
|
12569
|
-
|
|
12646
|
+
n,
|
|
12570
12647
|
e
|
|
12571
12648
|
);
|
|
12572
|
-
const
|
|
12573
|
-
|
|
12574
|
-
|
|
12649
|
+
const A = (l?.method || "GET").toUpperCase(), $ = !u && d && s.transportMode === "query-get" && Nr(l) && !je(A) ? s.baseUrl ?? o : o, C = Ir(
|
|
12650
|
+
$,
|
|
12651
|
+
l
|
|
12575
12652
|
);
|
|
12576
|
-
|
|
12577
|
-
const
|
|
12578
|
-
if (
|
|
12653
|
+
o = C.url;
|
|
12654
|
+
const se = { ...C.options }, F = C.normalized ? C.requestedMethod : s.requestedMethod, Z = C.effectiveMethod, ee = s.transportMode === "query-get" || C.normalized, ne = C.queryString ?? s.queryString;
|
|
12655
|
+
if (ee && m.info("Haori demo fetch normalization", {
|
|
12579
12656
|
runtime: c.runtime,
|
|
12580
|
-
requestedMethod:
|
|
12581
|
-
effectiveMethod:
|
|
12657
|
+
requestedMethod: F,
|
|
12658
|
+
effectiveMethod: Z,
|
|
12582
12659
|
transportMode: "query-get",
|
|
12583
|
-
url:
|
|
12584
|
-
payload:
|
|
12585
|
-
queryString:
|
|
12586
|
-
}), this.options.targetFragment &&
|
|
12587
|
-
const
|
|
12660
|
+
url: o,
|
|
12661
|
+
payload: a,
|
|
12662
|
+
queryString: ne
|
|
12663
|
+
}), this.options.targetFragment && o) {
|
|
12664
|
+
const K = performance.now(), ae = {
|
|
12588
12665
|
runtime: c.runtime,
|
|
12589
|
-
requestedMethod:
|
|
12590
|
-
effectiveMethod:
|
|
12591
|
-
transportMode:
|
|
12592
|
-
...
|
|
12666
|
+
requestedMethod: F,
|
|
12667
|
+
effectiveMethod: Z,
|
|
12668
|
+
transportMode: ee ? "query-get" : "http",
|
|
12669
|
+
...ee ? { queryString: ne } : {}
|
|
12593
12670
|
};
|
|
12594
|
-
return
|
|
12671
|
+
return O.fetchStart(
|
|
12595
12672
|
this.options.targetFragment.getTarget(),
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
), await this.injectFetchState("loading"), await g.invokeFetch(
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
)).catch(async (
|
|
12605
|
-
throw
|
|
12673
|
+
o,
|
|
12674
|
+
se,
|
|
12675
|
+
a,
|
|
12676
|
+
ae
|
|
12677
|
+
), await this.injectFetchState("loading"), await g.invokeFetch(o, se).then((j) => this.handleFetchResult(
|
|
12678
|
+
j,
|
|
12679
|
+
o || void 0,
|
|
12680
|
+
K
|
|
12681
|
+
)).catch(async (j) => {
|
|
12682
|
+
throw o && O.fetchError(
|
|
12606
12683
|
this.options.targetFragment.getTarget(),
|
|
12607
|
-
|
|
12608
|
-
|
|
12684
|
+
o,
|
|
12685
|
+
j
|
|
12609
12686
|
), await this.injectFetchState(
|
|
12610
12687
|
"error",
|
|
12611
12688
|
null,
|
|
12612
|
-
|
|
12613
|
-
), await this.runErrorActions(null),
|
|
12689
|
+
j instanceof Error ? j.message : String(j)
|
|
12690
|
+
), await this.runErrorActions(null), j;
|
|
12614
12691
|
});
|
|
12615
12692
|
}
|
|
12616
|
-
return await fetch(
|
|
12693
|
+
return await fetch(o, se).then((K) => this.handleFetchResult(K, o || void 0));
|
|
12617
12694
|
}
|
|
12618
|
-
(!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment &&
|
|
12695
|
+
(!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && y && await this.commitFormValues(
|
|
12619
12696
|
this.options.formFragment,
|
|
12620
|
-
|
|
12697
|
+
n,
|
|
12621
12698
|
e
|
|
12622
|
-
), this.suppressEmptyReplaceBind = !
|
|
12623
|
-
const
|
|
12699
|
+
), this.suppressEmptyReplaceBind = !y && !this.options.formFragment && (this.eventType === "change" || this.eventType === "input"), this.twoWayCommitBind = this.eventType === "change" || this.eventType === "input";
|
|
12700
|
+
const b = y ? st(n) : {}, E = new Response(JSON.stringify(b), {
|
|
12624
12701
|
headers: { "Content-Type": "application/json" }
|
|
12625
12702
|
});
|
|
12626
|
-
return await this.handleFetchResult(
|
|
12703
|
+
return await this.handleFetchResult(E);
|
|
12627
12704
|
} finally {
|
|
12628
12705
|
this.releaseExecutionLock(e);
|
|
12629
12706
|
}
|
|
@@ -12673,7 +12750,7 @@ ${W}
|
|
|
12673
12750
|
async commitFormValues(e, t, r) {
|
|
12674
12751
|
const i = e.getTarget(), s = /* @__PURE__ */ new Set();
|
|
12675
12752
|
r && r.appliedDisabledAttribute && this.options.targetFragment && s.add(this.options.targetFragment);
|
|
12676
|
-
const n = e.getRawBindingData(), a =
|
|
12753
|
+
const n = e.getRawBindingData(), a = st(t), o = e.getAttribute(`${c.prefix}form-arg`);
|
|
12677
12754
|
let l;
|
|
12678
12755
|
if (o) {
|
|
12679
12756
|
l = { ...n ?? {} };
|
|
@@ -12709,10 +12786,10 @@ ${W}
|
|
|
12709
12786
|
if (this.eventType !== "click" || !this.options.targetFragment)
|
|
12710
12787
|
return null;
|
|
12711
12788
|
const e = this.options.targetFragment, t = e.getTarget();
|
|
12712
|
-
if (g.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(
|
|
12789
|
+
if (g.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(tt))
|
|
12713
12790
|
return !1;
|
|
12714
12791
|
const r = t.hasAttribute(`${c.prefix}click-no-disabled`);
|
|
12715
|
-
return g.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(
|
|
12792
|
+
return g.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(tt, ""), r || t.setAttribute("disabled", ""), {
|
|
12716
12793
|
target: t,
|
|
12717
12794
|
fragment: e,
|
|
12718
12795
|
appliedDisabledAttribute: !r
|
|
@@ -12754,7 +12831,7 @@ ${W}
|
|
|
12754
12831
|
if (!e)
|
|
12755
12832
|
return;
|
|
12756
12833
|
const t = e.target;
|
|
12757
|
-
if (g.RUNNING_CLICK_TARGETS.delete(t), t.removeAttribute(
|
|
12834
|
+
if (g.RUNNING_CLICK_TARGETS.delete(t), t.removeAttribute(tt), !e.appliedDisabledAttribute)
|
|
12758
12835
|
return;
|
|
12759
12836
|
const r = g.findDisabledDeclaration(
|
|
12760
12837
|
e.fragment
|
|
@@ -12780,7 +12857,7 @@ ${W}
|
|
|
12780
12857
|
* 「選んだフォルダは、そのページが開いている間だけ覚えます」)。
|
|
12781
12858
|
*/
|
|
12782
12859
|
static forgetDownloadFolder() {
|
|
12783
|
-
|
|
12860
|
+
Pe = null;
|
|
12784
12861
|
}
|
|
12785
12862
|
/**
|
|
12786
12863
|
* 保存先のフォルダを用意します。
|
|
@@ -12792,8 +12869,8 @@ ${W}
|
|
|
12792
12869
|
* 今までどおりの保存へ落とす場合は `fallback`
|
|
12793
12870
|
*/
|
|
12794
12871
|
async prepareDownloadFolder() {
|
|
12795
|
-
if (
|
|
12796
|
-
return this.downloadFolder =
|
|
12872
|
+
if (Pe)
|
|
12873
|
+
return this.downloadFolder = Pe, "ready";
|
|
12797
12874
|
const e = globalThis.showDirectoryPicker;
|
|
12798
12875
|
if (typeof e != "function")
|
|
12799
12876
|
return m.info(
|
|
@@ -12802,7 +12879,7 @@ ${W}
|
|
|
12802
12879
|
), "fallback";
|
|
12803
12880
|
try {
|
|
12804
12881
|
const t = await e.call(globalThis, { mode: "readwrite" });
|
|
12805
|
-
return
|
|
12882
|
+
return Pe = t, this.downloadFolder = t, "ready";
|
|
12806
12883
|
} catch (t) {
|
|
12807
12884
|
return t?.name === "AbortError" ? "cancelled" : (m.info(
|
|
12808
12885
|
"Haori",
|
|
@@ -12857,7 +12934,7 @@ ${W}
|
|
|
12857
12934
|
break;
|
|
12858
12935
|
await t(n), this.downloadReceivedBytes += n.byteLength, this.dropTotalBytesIfExceeded();
|
|
12859
12936
|
const a = Date.now();
|
|
12860
|
-
a - r >=
|
|
12937
|
+
a - r >= Rr && (r = a, await this.injectFetchState("loading"));
|
|
12861
12938
|
}
|
|
12862
12939
|
} catch (s) {
|
|
12863
12940
|
return m.error("Haori", `応答をファイルとして読み取れませんでした: ${s}`), !1;
|
|
@@ -12931,7 +13008,7 @@ ${W}
|
|
|
12931
13008
|
`保存先のフォルダを確かめられなかったため、今までどおり保存します: ${l}`
|
|
12932
13009
|
), "fallback";
|
|
12933
13010
|
}
|
|
12934
|
-
if (n && !await
|
|
13011
|
+
if (n && !await Ae().confirm(
|
|
12935
13012
|
`${s} は既にあります。上書きしますか?`
|
|
12936
13013
|
))
|
|
12937
13014
|
return "cancelled";
|
|
@@ -12988,7 +13065,7 @@ ${W}
|
|
|
12988
13065
|
);
|
|
12989
13066
|
if (a !== "fallback")
|
|
12990
13067
|
return a;
|
|
12991
|
-
this.downloadFolder = null,
|
|
13068
|
+
this.downloadFolder = null, Pe = null;
|
|
12992
13069
|
}
|
|
12993
13070
|
const r = await this.readResponseBody(e);
|
|
12994
13071
|
if (r === null)
|
|
@@ -13017,8 +13094,8 @@ ${W}
|
|
|
13017
13094
|
* @returns 表示の完了 Promise
|
|
13018
13095
|
*/
|
|
13019
13096
|
async showDownloadFailure(e) {
|
|
13020
|
-
const t = this.resolveMessageScope(), r =
|
|
13021
|
-
await r.clearMessages(t), e && await r.addErrorMessage(t,
|
|
13097
|
+
const t = this.resolveMessageScope(), r = Ae();
|
|
13098
|
+
await r.clearMessages(t), e && await r.addErrorMessage(t, Dt);
|
|
13022
13099
|
}
|
|
13023
13100
|
/**
|
|
13024
13101
|
* 保存するファイル名を決めます。
|
|
@@ -13101,34 +13178,34 @@ ${W}
|
|
|
13101
13178
|
* フェッチ後の処理を実行します。
|
|
13102
13179
|
*/
|
|
13103
13180
|
async handleFetchResult(e, t, r) {
|
|
13104
|
-
const i =
|
|
13181
|
+
const i = Ae();
|
|
13105
13182
|
if (!e.ok) {
|
|
13106
|
-
if (
|
|
13183
|
+
if (Jt(e.status, {
|
|
13107
13184
|
element: this.options.targetFragment.getTarget(),
|
|
13108
13185
|
attrPrefix: g.attrName(this.eventType, "", !0)
|
|
13109
13186
|
}))
|
|
13110
13187
|
return !1;
|
|
13111
|
-
this.options.targetFragment && t &&
|
|
13188
|
+
this.options.targetFragment && t && O.fetchError(
|
|
13112
13189
|
this.options.targetFragment.getTarget(),
|
|
13113
13190
|
t,
|
|
13114
13191
|
new Error(`${e.status} ${e.statusText}`),
|
|
13115
13192
|
e.status,
|
|
13116
13193
|
r
|
|
13117
13194
|
);
|
|
13118
|
-
const E = this.selectErrorActions(e.status), A = E?.bind === !0,
|
|
13195
|
+
const E = this.selectErrorActions(e.status), A = E?.bind === !0, w = await this.handleFetchError(
|
|
13119
13196
|
A ? e.clone() : e,
|
|
13120
13197
|
E?.noMessage !== !0 && !A
|
|
13121
13198
|
);
|
|
13122
|
-
return A && await this.bindResult(e).catch((
|
|
13123
|
-
m.error("Haori", "Failed to bind the error response:",
|
|
13199
|
+
return A && await this.bindResult(e).catch(($) => {
|
|
13200
|
+
m.error("Haori", "Failed to bind the error response:", $);
|
|
13124
13201
|
}), await this.injectFetchState(
|
|
13125
13202
|
"error",
|
|
13126
13203
|
e.status,
|
|
13127
13204
|
e.statusText || null,
|
|
13128
|
-
|
|
13205
|
+
w
|
|
13129
13206
|
), await this.runErrorActions(e.status), !1;
|
|
13130
13207
|
}
|
|
13131
|
-
if (this.options.targetFragment && t && r &&
|
|
13208
|
+
if (this.options.targetFragment && t && r && O.fetchEnd(
|
|
13132
13209
|
this.options.targetFragment.getTarget(),
|
|
13133
13210
|
t,
|
|
13134
13211
|
e.status,
|
|
@@ -13150,7 +13227,7 @@ ${W}
|
|
|
13150
13227
|
return await this.showDownloadFailure(A?.noMessage !== !0), await this.injectFetchState(
|
|
13151
13228
|
"error",
|
|
13152
13229
|
e.status,
|
|
13153
|
-
|
|
13230
|
+
Dt
|
|
13154
13231
|
), await this.runErrorActions(null), !1;
|
|
13155
13232
|
}
|
|
13156
13233
|
}
|
|
@@ -13198,7 +13275,7 @@ ${W}
|
|
|
13198
13275
|
"scroll",
|
|
13199
13276
|
this.options.scrollTarget
|
|
13200
13277
|
);
|
|
13201
|
-
u &&
|
|
13278
|
+
u && z.query(
|
|
13202
13279
|
u,
|
|
13203
13280
|
g.attrName(this.eventType, "scroll"),
|
|
13204
13281
|
document
|
|
@@ -13222,16 +13299,16 @@ ${W}
|
|
|
13222
13299
|
this.options.redirectReturnParam
|
|
13223
13300
|
);
|
|
13224
13301
|
if (A) {
|
|
13225
|
-
const
|
|
13226
|
-
if (
|
|
13227
|
-
const
|
|
13228
|
-
|
|
13302
|
+
const $ = new URLSearchParams(window.location.search).get(A);
|
|
13303
|
+
if ($ !== null) {
|
|
13304
|
+
const C = $.trim();
|
|
13305
|
+
Oe.isSafeLocalPath(C) ? E = C : m.warn(
|
|
13229
13306
|
"Haori",
|
|
13230
|
-
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${
|
|
13307
|
+
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${$}`
|
|
13231
13308
|
);
|
|
13232
13309
|
}
|
|
13233
13310
|
}
|
|
13234
|
-
|
|
13311
|
+
Oe.isNavigableUrl(E) ? y ? window.location.replace(E) : window.location.href = E : m.error(
|
|
13235
13312
|
"Haori",
|
|
13236
13313
|
`遷移先が http: / https: / 現在ページと同じスキームの URL ではないため遷移しません: ${E}`
|
|
13237
13314
|
);
|
|
@@ -13246,7 +13323,7 @@ ${W}
|
|
|
13246
13323
|
*/
|
|
13247
13324
|
clearStore() {
|
|
13248
13325
|
const e = this.options.storeClearKey;
|
|
13249
|
-
e &&
|
|
13326
|
+
e && Be.clear(e, this.options.storeClearKind ?? "session");
|
|
13250
13327
|
}
|
|
13251
13328
|
/**
|
|
13252
13329
|
* 対象を宣言した順にクリックします(`data-{event}-click` /
|
|
@@ -13300,7 +13377,7 @@ ${W}
|
|
|
13300
13377
|
`${t.key}-click-await`
|
|
13301
13378
|
))
|
|
13302
13379
|
return;
|
|
13303
|
-
const i =
|
|
13380
|
+
const i = Ae(), s = [];
|
|
13304
13381
|
t.closeFragments?.forEach((a) => {
|
|
13305
13382
|
const o = a.getTarget();
|
|
13306
13383
|
o instanceof HTMLElement ? s.push(i.closeDialog(o)) : m.error("Haori", "Element is not an HTML element: ", o);
|
|
@@ -13368,7 +13445,7 @@ ${W}
|
|
|
13368
13445
|
if (!i || !s || !s.hasAttribute(i.attributeName))
|
|
13369
13446
|
return r;
|
|
13370
13447
|
const n = s.getAttributeEvaluation(i.attributeName);
|
|
13371
|
-
return n === null ? r : n.hasUnresolvedReference && !i.hasUnresolvedReference ? (
|
|
13448
|
+
return n === null ? r : n.hasUnresolvedReference && !i.hasUnresolvedReference ? (V.isEnabled() && m.warn(
|
|
13372
13449
|
"Haori",
|
|
13373
13450
|
`${i.attributeName} の参照が手続きの途中で解決できなくなったため、手続き開始時の値を使います`
|
|
13374
13451
|
), r) : n.value ?? null;
|
|
@@ -13398,7 +13475,7 @@ ${W}
|
|
|
13398
13475
|
y != null && (Array.isArray(y) ? (o.searchParams.delete(d), y.forEach((b) => o.searchParams.append(d, String(b)))) : typeof y == "object" ? o.searchParams.set(d, JSON.stringify(y)) : o.searchParams.set(d, String(y)));
|
|
13399
13476
|
};
|
|
13400
13477
|
s && l(r), n && l(i), history.pushState(
|
|
13401
|
-
{ [
|
|
13478
|
+
{ [Sr]: !0 },
|
|
13402
13479
|
"",
|
|
13403
13480
|
o.toString()
|
|
13404
13481
|
), M.refreshUrlParams();
|
|
@@ -13432,10 +13509,10 @@ ${W}
|
|
|
13432
13509
|
let r = null;
|
|
13433
13510
|
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r = x.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
|
|
13434
13511
|
const i = r ? r.getTarget() : document.body;
|
|
13435
|
-
await
|
|
13512
|
+
await Ae().clearMessages(i);
|
|
13436
13513
|
const s = async (u) => {
|
|
13437
13514
|
const d = r ? r.getTarget() : document.body;
|
|
13438
|
-
await
|
|
13515
|
+
await Ae().addErrorMessage(d, u);
|
|
13439
13516
|
}, n = () => {
|
|
13440
13517
|
if (!this.options.scrollOnError)
|
|
13441
13518
|
return;
|
|
@@ -13460,14 +13537,14 @@ ${W}
|
|
|
13460
13537
|
const y = /* @__PURE__ */ new Map(), b = [];
|
|
13461
13538
|
for (const E of u)
|
|
13462
13539
|
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
13463
|
-
const A = E.key,
|
|
13464
|
-
if (
|
|
13540
|
+
const A = E.key, w = E.message, $ = typeof A == "string" && A.length > 0 ? A : null, C = typeof w == "string" ? w : w != null ? String(w) : "";
|
|
13541
|
+
if (C.length === 0)
|
|
13465
13542
|
continue;
|
|
13466
|
-
if (
|
|
13467
|
-
const
|
|
13468
|
-
|
|
13543
|
+
if ($ !== null) {
|
|
13544
|
+
const se = y.get($) ?? [];
|
|
13545
|
+
se.push(C), y.set($, se);
|
|
13469
13546
|
} else
|
|
13470
|
-
b.push(
|
|
13547
|
+
b.push(C);
|
|
13471
13548
|
} else typeof E == "string" && E.length > 0 && b.push(E);
|
|
13472
13549
|
for (const [E, A] of y)
|
|
13473
13550
|
d.push({ key: E, message: A.join(`
|
|
@@ -13604,7 +13681,7 @@ ${W}
|
|
|
13604
13681
|
const i = this.options.conditionAttributeName ?? `${c.prefix}if`, s = x.buildConditionScope(
|
|
13605
13682
|
r,
|
|
13606
13683
|
this.options.formFragment ?? null
|
|
13607
|
-
), n =
|
|
13684
|
+
), n = re.evaluateDetailed(t, s);
|
|
13608
13685
|
return n.unresolvedReference ? (e || m.warn(
|
|
13609
13686
|
"Haori",
|
|
13610
13687
|
`${i} の参照が解決できないため実行しません: ${t}`
|
|
@@ -13649,7 +13726,7 @@ ${W}
|
|
|
13649
13726
|
*/
|
|
13650
13727
|
confirm() {
|
|
13651
13728
|
const e = this.options.confirmMessage;
|
|
13652
|
-
return e == null ? Promise.resolve(!0) :
|
|
13729
|
+
return e == null ? Promise.resolve(!0) : Ae().confirm(e);
|
|
13653
13730
|
}
|
|
13654
13731
|
/**
|
|
13655
13732
|
* 結果データを対象のフラグメントにバインドします。
|
|
@@ -13666,7 +13743,7 @@ ${W}
|
|
|
13666
13743
|
let i = t ? JSON.parse(r) : r;
|
|
13667
13744
|
if (this.options.bindTransform)
|
|
13668
13745
|
try {
|
|
13669
|
-
i =
|
|
13746
|
+
i = re.evaluate(this.options.bindTransform, {
|
|
13670
13747
|
response: i
|
|
13671
13748
|
});
|
|
13672
13749
|
} catch (o) {
|
|
@@ -13701,11 +13778,11 @@ ${W}
|
|
|
13701
13778
|
apply: (b) => {
|
|
13702
13779
|
const E = this.resolveCurrentRowItem(o, b), A = { ...E };
|
|
13703
13780
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
13704
|
-
const
|
|
13781
|
+
const w = E[y], $ = w !== null && typeof w == "object" && !Array.isArray(w) ? w : {};
|
|
13705
13782
|
A[y] = this.mergeAppendBindingData(
|
|
13706
13783
|
o,
|
|
13707
13784
|
i,
|
|
13708
|
-
|
|
13785
|
+
$
|
|
13709
13786
|
);
|
|
13710
13787
|
} else
|
|
13711
13788
|
A[y] = i;
|
|
@@ -13802,7 +13879,7 @@ ${W}
|
|
|
13802
13879
|
return s.push(this.applyRowWrites(a)), Promise.all(s).then(() => {
|
|
13803
13880
|
const o = this.options.bindArg ?? null;
|
|
13804
13881
|
this.options.bindFragments.forEach((l) => {
|
|
13805
|
-
|
|
13882
|
+
O.bindComplete(l.getTarget(), o);
|
|
13806
13883
|
});
|
|
13807
13884
|
});
|
|
13808
13885
|
});
|
|
@@ -13861,9 +13938,9 @@ ${W}
|
|
|
13861
13938
|
const a = e.getAttribute(`${c.prefix}form-arg`);
|
|
13862
13939
|
if (a) {
|
|
13863
13940
|
const o = String(a), l = t[o], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
13864
|
-
return { ...t, [o]:
|
|
13941
|
+
return { ...t, [o]: we(u, n) };
|
|
13865
13942
|
}
|
|
13866
|
-
return
|
|
13943
|
+
return we(t, n);
|
|
13867
13944
|
}
|
|
13868
13945
|
/**
|
|
13869
13946
|
* 編集可能な行へのバインドについて、送信後の編集を要素データへ上書きし直します。
|
|
@@ -13890,7 +13967,7 @@ ${W}
|
|
|
13890
13967
|
e,
|
|
13891
13968
|
i ? 0 : r
|
|
13892
13969
|
);
|
|
13893
|
-
return Object.keys(s).length === 0 ? t :
|
|
13970
|
+
return Object.keys(s).length === 0 ? t : we(t, s);
|
|
13894
13971
|
}
|
|
13895
13972
|
/**
|
|
13896
13973
|
* 祖先へのバインドについて、配下の `data-form-arg` フォームで送信後に行われた
|
|
@@ -13916,7 +13993,7 @@ ${W}
|
|
|
13916
13993
|
if (Object.keys(o).length === 0)
|
|
13917
13994
|
continue;
|
|
13918
13995
|
const l = s[a], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
13919
|
-
s = { ...s, [a]:
|
|
13996
|
+
s = { ...s, [a]: we(u, o) };
|
|
13920
13997
|
}
|
|
13921
13998
|
return s;
|
|
13922
13999
|
}
|
|
@@ -13993,7 +14070,7 @@ ${W}
|
|
|
13993
14070
|
*/
|
|
13994
14071
|
resolveCurrentRowItem(e, t) {
|
|
13995
14072
|
const r = x.getValuesEditedAfter(e, 0);
|
|
13996
|
-
return Object.keys(r).length === 0 ? t :
|
|
14073
|
+
return Object.keys(r).length === 0 ? t : we(t, r);
|
|
13997
14074
|
}
|
|
13998
14075
|
/**
|
|
13999
14076
|
* 行の要素データへコピーの値を反映します。
|
|
@@ -14021,9 +14098,9 @@ ${W}
|
|
|
14021
14098
|
* @returns コピー元のデータ
|
|
14022
14099
|
*/
|
|
14023
14100
|
resolveCopySourceData() {
|
|
14024
|
-
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ?
|
|
14101
|
+
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? We(this.options.copySourceFragment) : M.withoutReservedBindingKeys(
|
|
14025
14102
|
this.options.copySourceFragment.getRawBindingData() ?? {}
|
|
14026
|
-
) : this.options.formFragment ?
|
|
14103
|
+
) : this.options.formFragment ? We(this.options.formFragment) : this.options.targetFragment ? M.withoutReservedBindingKeys(
|
|
14027
14104
|
this.options.targetFragment.getRawBindingData() ?? {}
|
|
14028
14105
|
) : {};
|
|
14029
14106
|
}
|
|
@@ -14066,6 +14143,29 @@ ${W}
|
|
|
14066
14143
|
hasUnresolvedReference: e.hasUnresolvedReference
|
|
14067
14144
|
};
|
|
14068
14145
|
}
|
|
14146
|
+
/**
|
|
14147
|
+
* `data-{event}-payload-transform` の式で送信データを変換します。
|
|
14148
|
+
*
|
|
14149
|
+
* 式の中では送信データを `payload` として参照します。評価できない場合、未解決
|
|
14150
|
+
* 参照を含む場合、結果が配列ではないオブジェクトにならない場合は、送信データを
|
|
14151
|
+
* 作れなかったものとして null を返します(仕様
|
|
14152
|
+
* 「`data-{event}-payload-transform`(非イベント:
|
|
14153
|
+
* `data-fetch-payload-transform`)」)。
|
|
14154
|
+
*
|
|
14155
|
+
* @param expression 変換式
|
|
14156
|
+
* @param payload 収集した送信データ
|
|
14157
|
+
* @returns 変換した送信データ。作れなかった場合は null
|
|
14158
|
+
*/
|
|
14159
|
+
transformPayload(e, t) {
|
|
14160
|
+
const r = re.evaluateDetailed(e, { payload: t });
|
|
14161
|
+
if (r.unresolvedReference)
|
|
14162
|
+
return null;
|
|
14163
|
+
const i = r.value;
|
|
14164
|
+
return i === null || typeof i != "object" || Array.isArray(i) ? (m.error(
|
|
14165
|
+
"Haori",
|
|
14166
|
+
"payload-transform must return an object: " + e
|
|
14167
|
+
), null) : i;
|
|
14168
|
+
}
|
|
14069
14169
|
/**
|
|
14070
14170
|
* 現在のオプションから送信前の fetch リクエストを組み立てます。
|
|
14071
14171
|
*
|
|
@@ -14079,19 +14179,42 @@ ${W}
|
|
|
14079
14179
|
baseUrl: null,
|
|
14080
14180
|
options: null,
|
|
14081
14181
|
payload: t,
|
|
14182
|
+
sentPayload: t,
|
|
14082
14183
|
hasUnresolvedReference: r,
|
|
14083
14184
|
requestedMethod: "GET",
|
|
14084
14185
|
effectiveMethod: "GET",
|
|
14085
14186
|
transportMode: "http",
|
|
14086
14187
|
signature: null
|
|
14087
14188
|
};
|
|
14088
|
-
let i =
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14189
|
+
let i = t;
|
|
14190
|
+
if (this.options.payloadTransform) {
|
|
14191
|
+
const y = this.transformPayload(
|
|
14192
|
+
this.options.payloadTransform,
|
|
14193
|
+
t
|
|
14194
|
+
);
|
|
14195
|
+
if (y === null)
|
|
14196
|
+
return {
|
|
14197
|
+
url: null,
|
|
14198
|
+
baseUrl: null,
|
|
14199
|
+
options: null,
|
|
14200
|
+
payload: t,
|
|
14201
|
+
sentPayload: t,
|
|
14202
|
+
payloadTransformFailed: !0,
|
|
14203
|
+
hasUnresolvedReference: !1,
|
|
14204
|
+
requestedMethod: "GET",
|
|
14205
|
+
effectiveMethod: "GET",
|
|
14206
|
+
transportMode: "http",
|
|
14207
|
+
signature: null
|
|
14208
|
+
};
|
|
14209
|
+
i = y;
|
|
14210
|
+
}
|
|
14211
|
+
let s = this.options.fetchUrl;
|
|
14212
|
+
const n = { ...this.options.fetchOptions || {} }, a = new Headers(
|
|
14213
|
+
n.headers || void 0
|
|
14214
|
+
), o = (n.method || "GET").toUpperCase(), l = c.runtime === "demo" && !je(o), u = l ? "GET" : o;
|
|
14215
|
+
if (n.method = u, Object.keys(i).length > 0 && Ue(i)) {
|
|
14216
|
+
const y = a.get("Content-Type") || "";
|
|
14217
|
+
!je(o) && /multipart\/form-data/i.test(y) ? Cr(i) && m.warn(
|
|
14095
14218
|
"Haori",
|
|
14096
14219
|
`A File value nested under ${c.prefix}form-object / ${c.prefix}form-list cannot be sent. Place file inputs at the top level of the collected form values.`
|
|
14097
14220
|
) : m.warn(
|
|
@@ -14099,39 +14222,40 @@ ${W}
|
|
|
14099
14222
|
`A File value cannot be sent without ${c.prefix}fetch-content-type="multipart/form-data" and a body method such as POST.`
|
|
14100
14223
|
);
|
|
14101
14224
|
}
|
|
14102
|
-
if (
|
|
14103
|
-
Object.keys(
|
|
14104
|
-
else if (Object.keys(
|
|
14105
|
-
const
|
|
14106
|
-
if (/multipart\/form-data/i.test(
|
|
14107
|
-
|
|
14108
|
-
const
|
|
14109
|
-
for (const [
|
|
14110
|
-
|
|
14111
|
-
|
|
14112
|
-
}) :
|
|
14113
|
-
|
|
14114
|
-
} else if (/application\/x-www-form-urlencoded/i.test(
|
|
14115
|
-
const
|
|
14116
|
-
for (const [
|
|
14117
|
-
|
|
14118
|
-
|
|
14225
|
+
if (u === "GET" || u === "HEAD" || u === "OPTIONS")
|
|
14226
|
+
Object.keys(i).length > 0 && (s = Zt(s, i));
|
|
14227
|
+
else if (Object.keys(i).length > 0) {
|
|
14228
|
+
const y = a.get("Content-Type") || "";
|
|
14229
|
+
if (/multipart\/form-data/i.test(y)) {
|
|
14230
|
+
a.delete("Content-Type");
|
|
14231
|
+
const b = new FormData();
|
|
14232
|
+
for (const [E, A] of Object.entries(i))
|
|
14233
|
+
A == null ? b.append(E, "") : A instanceof Blob ? b.append(E, A) : Array.isArray(A) ? A.forEach((w) => {
|
|
14234
|
+
w instanceof Blob ? b.append(E, w) : b.append(E, Fe(w));
|
|
14235
|
+
}) : b.append(E, Fe(A));
|
|
14236
|
+
n.body = b;
|
|
14237
|
+
} else if (/application\/x-www-form-urlencoded/i.test(y)) {
|
|
14238
|
+
const b = new URLSearchParams();
|
|
14239
|
+
for (const [E, A] of Object.entries(i))
|
|
14240
|
+
A !== void 0 && (Array.isArray(A) ? A.forEach((w) => b.append(E, Fe(w))) : b.append(E, Fe(A)));
|
|
14241
|
+
n.body = b;
|
|
14119
14242
|
} else
|
|
14120
|
-
|
|
14243
|
+
a.set("Content-Type", "application/json"), n.body = JSON.stringify(i);
|
|
14121
14244
|
}
|
|
14122
|
-
|
|
14123
|
-
let
|
|
14124
|
-
return
|
|
14125
|
-
url:
|
|
14245
|
+
n.headers = a;
|
|
14246
|
+
let d;
|
|
14247
|
+
return l && (d = new URL(s, window.location.href).search || void 0, a.delete("Content-Type")), {
|
|
14248
|
+
url: s,
|
|
14126
14249
|
baseUrl: this.options.fetchUrl,
|
|
14127
|
-
options:
|
|
14250
|
+
options: n,
|
|
14128
14251
|
payload: t,
|
|
14252
|
+
sentPayload: i,
|
|
14129
14253
|
hasUnresolvedReference: !1,
|
|
14130
|
-
requestedMethod:
|
|
14131
|
-
effectiveMethod:
|
|
14132
|
-
queryString:
|
|
14133
|
-
transportMode:
|
|
14134
|
-
signature:
|
|
14254
|
+
requestedMethod: o,
|
|
14255
|
+
effectiveMethod: u,
|
|
14256
|
+
queryString: d,
|
|
14257
|
+
transportMode: l ? "query-get" : "http",
|
|
14258
|
+
signature: $r(s, n)
|
|
14135
14259
|
};
|
|
14136
14260
|
}
|
|
14137
14261
|
/**
|
|
@@ -14141,7 +14265,7 @@ ${W}
|
|
|
14141
14265
|
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = g.resolveDataAttribute(
|
|
14142
14266
|
this.options.targetFragment,
|
|
14143
14267
|
this.options.historyDataAttrName
|
|
14144
|
-
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ?
|
|
14268
|
+
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? We(this.options.historyFormFragment) : void 0;
|
|
14145
14269
|
}
|
|
14146
14270
|
/**
|
|
14147
14271
|
* history-data の評価値を取得します。
|
|
@@ -14163,7 +14287,7 @@ ${W}
|
|
|
14163
14287
|
if (this.historyFormSnapshot !== void 0)
|
|
14164
14288
|
return this.historyFormSnapshot;
|
|
14165
14289
|
if (this.options.historyFormFragment)
|
|
14166
|
-
return
|
|
14290
|
+
return We(this.options.historyFormFragment);
|
|
14167
14291
|
}
|
|
14168
14292
|
/**
|
|
14169
14293
|
* copy-params が指定されている場合は include / exclude を考慮して抽出します。
|
|
@@ -14232,9 +14356,9 @@ ${W}
|
|
|
14232
14356
|
const t = this.options.targetFragment;
|
|
14233
14357
|
if (!t)
|
|
14234
14358
|
return m.error("Haori", "Target fragment is not specified for row operation."), null;
|
|
14235
|
-
const r = g.attrName(this.eventType, e), i =
|
|
14359
|
+
const r = g.attrName(this.eventType, e), i = z.read(t, r);
|
|
14236
14360
|
if (i !== null && i.trim() !== "") {
|
|
14237
|
-
const n =
|
|
14361
|
+
const n = z.query(i, r, document);
|
|
14238
14362
|
if (n === null)
|
|
14239
14363
|
return m.error(
|
|
14240
14364
|
"Haori",
|
|
@@ -14807,7 +14931,7 @@ ${W}
|
|
|
14807
14931
|
}
|
|
14808
14932
|
};
|
|
14809
14933
|
g.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, g.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, g.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet(), g.CLICK_OUTCOMES = /* @__PURE__ */ new WeakMap(), g.validationReportGeneration = 0, g.VALIDATION_SCROLL_TIMEOUT_MS = 1e3, g.VALIDATION_SCROLL_STABLE_FRAMES = 2;
|
|
14810
|
-
let
|
|
14934
|
+
let he = g;
|
|
14811
14935
|
class Mr {
|
|
14812
14936
|
/**
|
|
14813
14937
|
* 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
|
|
@@ -14830,7 +14954,7 @@ class Mr {
|
|
|
14830
14954
|
throw m.error("[Haori]", "Failed to fetch import source:", e, n), new Error(`Failed to fetch: ${e}`);
|
|
14831
14955
|
}
|
|
14832
14956
|
if (!i.ok) {
|
|
14833
|
-
|
|
14957
|
+
Jt(i.status, r);
|
|
14834
14958
|
const n = `${i.status} ${i.statusText}`;
|
|
14835
14959
|
throw m.error("[Haori]", "Import HTTP error:", e, n), new Error(`Failed to load ${e}: ${n}`);
|
|
14836
14960
|
}
|
|
@@ -14931,7 +15055,7 @@ const h = class h {
|
|
|
14931
15055
|
static reevaluateChildren(e) {
|
|
14932
15056
|
const t = [];
|
|
14933
15057
|
return e.getChildren().forEach((r) => {
|
|
14934
|
-
r instanceof R ? t.push(h.evaluateAll(r)) : r instanceof
|
|
15058
|
+
r instanceof R ? t.push(h.evaluateAll(r)) : r instanceof de && t.push(h.evaluateText(r));
|
|
14935
15059
|
}), Promise.all(t).then(() => {
|
|
14936
15060
|
});
|
|
14937
15061
|
}
|
|
@@ -15022,7 +15146,7 @@ const h = class h {
|
|
|
15022
15146
|
return Promise.all(h.initialValueRestores).then(() => h.executeManagedFetch(e, !0)).catch((a) => {
|
|
15023
15147
|
m.error("Haori", `初期表示の取得に失敗しました: ${a}`);
|
|
15024
15148
|
}), Promise.resolve();
|
|
15025
|
-
const i = h.getReactiveFetchState(r), s =
|
|
15149
|
+
const i = h.getReactiveFetchState(r), s = he.resolveAutoFetchSignature(e);
|
|
15026
15150
|
if (i.running)
|
|
15027
15151
|
return (s.hasUnresolvedReference || s.signature !== i.lastSignature) && (i.rerunRequested = !0), Promise.resolve();
|
|
15028
15152
|
if (s.hasUnresolvedReference || s.signature === null)
|
|
@@ -15030,7 +15154,7 @@ const h = class h {
|
|
|
15030
15154
|
if (i.lastSignature === s.signature)
|
|
15031
15155
|
return Promise.resolve();
|
|
15032
15156
|
i.lastSignature = s.signature, i.running = !0;
|
|
15033
|
-
const n = new
|
|
15157
|
+
const n = new he(e, null);
|
|
15034
15158
|
return n.markReentrantBind(), n.runWithResult().then(() => {
|
|
15035
15159
|
}).catch(() => {
|
|
15036
15160
|
}).finally(() => {
|
|
@@ -15056,7 +15180,7 @@ const h = class h {
|
|
|
15056
15180
|
return Promise.resolve();
|
|
15057
15181
|
r.lastUrl = s, r.running = !0;
|
|
15058
15182
|
const n = performance.now();
|
|
15059
|
-
return t.setAttribute(`${c.prefix}importing`, ""),
|
|
15183
|
+
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, s), Mr.load(s, void 0, {
|
|
15060
15184
|
element: t,
|
|
15061
15185
|
attrPrefix: `${c.prefix}import-`
|
|
15062
15186
|
}).then((a) => {
|
|
@@ -15064,15 +15188,15 @@ const h = class h {
|
|
|
15064
15188
|
return J.enqueue(() => {
|
|
15065
15189
|
t.innerHTML = a;
|
|
15066
15190
|
}).then(() => {
|
|
15067
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
15191
|
+
t.removeAttribute(`${c.prefix}importing`), O.importEnd(t, s, o, n), h.adoptImportedChildren(e);
|
|
15068
15192
|
const l = [];
|
|
15069
15193
|
return e.getChildren().forEach((u) => {
|
|
15070
|
-
u instanceof R ? l.push(h.scan(u.getTarget())) : u instanceof
|
|
15194
|
+
u instanceof R ? l.push(h.scan(u.getTarget())) : u instanceof de && l.push(h.evaluateText(u));
|
|
15071
15195
|
}), Promise.all(l).then(() => {
|
|
15072
15196
|
});
|
|
15073
15197
|
});
|
|
15074
15198
|
}).catch((a) => {
|
|
15075
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
15199
|
+
t.removeAttribute(`${c.prefix}importing`), O.importError(t, s, a), m.error("[Haori]", "Failed to import HTML:", s, a);
|
|
15076
15200
|
}).finally(() => {
|
|
15077
15201
|
if (r.running = !1, r.rerunRequested)
|
|
15078
15202
|
return r.rerunRequested = !1, h.executeManagedImport(e);
|
|
@@ -15127,7 +15251,7 @@ const h = class h {
|
|
|
15127
15251
|
() => x.restoreInitialValues(e)
|
|
15128
15252
|
);
|
|
15129
15253
|
return h.initialValueRestores.add(i), i.then(() => {
|
|
15130
|
-
h.initialValueRestores.delete(i), t &&
|
|
15254
|
+
h.initialValueRestores.delete(i), t && le.applySubtree(e);
|
|
15131
15255
|
});
|
|
15132
15256
|
}
|
|
15133
15257
|
/**
|
|
@@ -15148,7 +15272,7 @@ const h = class h {
|
|
|
15148
15272
|
const r = e.getTarget();
|
|
15149
15273
|
return R.retryUnappliedValueWrites(r, t).then(
|
|
15150
15274
|
() => {
|
|
15151
|
-
|
|
15275
|
+
le.applySubtree(r);
|
|
15152
15276
|
}
|
|
15153
15277
|
);
|
|
15154
15278
|
}
|
|
@@ -15161,7 +15285,7 @@ const h = class h {
|
|
|
15161
15285
|
*/
|
|
15162
15286
|
static initializeFreshEachRow(e) {
|
|
15163
15287
|
return h.initializeElementFragment(e, !0).then(() => {
|
|
15164
|
-
h.needsScheduledEvaluateAll(e) && h.scheduleEvaluateAll(e),
|
|
15288
|
+
h.needsScheduledEvaluateAll(e) && h.scheduleEvaluateAll(e), le.applySubtree(e.getTarget());
|
|
15165
15289
|
});
|
|
15166
15290
|
}
|
|
15167
15291
|
/**
|
|
@@ -15182,7 +15306,7 @@ const h = class h {
|
|
|
15182
15306
|
return e.getChildren().forEach((s) => {
|
|
15183
15307
|
s instanceof R ? (!r || h.isEachFixedChild(s)) && i.push(
|
|
15184
15308
|
h.initializeElementFragment(s, t)
|
|
15185
|
-
) : s instanceof
|
|
15309
|
+
) : s instanceof de && i.push(h.evaluateText(s));
|
|
15186
15310
|
}), Promise.all(i).then(() => {
|
|
15187
15311
|
h.refreshDerivedSubtreeSignature(e);
|
|
15188
15312
|
});
|
|
@@ -15337,14 +15461,14 @@ const h = class h {
|
|
|
15337
15461
|
typeof r == "string" && (d = () => h.executeManagedImport(n));
|
|
15338
15462
|
break;
|
|
15339
15463
|
case `${c.prefix}store`:
|
|
15340
|
-
r !== null && o.push(
|
|
15464
|
+
r !== null && o.push(Be.restore(n));
|
|
15341
15465
|
break;
|
|
15342
15466
|
case `${c.prefix}validity`:
|
|
15343
15467
|
case `${c.prefix}validity-message`:
|
|
15344
15468
|
return r !== null && x.applyCustomValidity(n), Promise.all(o).then(() => {
|
|
15345
15469
|
});
|
|
15346
15470
|
case `${c.prefix}url-param`: {
|
|
15347
|
-
const y = n.getAttribute(`${c.prefix}url-arg`), b =
|
|
15471
|
+
const y = n.getAttribute(`${c.prefix}url-arg`), b = Oe.readParams();
|
|
15348
15472
|
y === null && n.hasAttribute(`${c.prefix}store`) && m.warn(
|
|
15349
15473
|
"Haori",
|
|
15350
15474
|
`${c.prefix}url-param を ${c.prefix}url-arg なしで ${c.prefix}store と併用すると復元した値が消えます(${c.prefix}url-arg を指定してください)。`
|
|
@@ -15410,34 +15534,34 @@ const h = class h {
|
|
|
15410
15534
|
const y = R.currentSequence(), b = i.getRawBindingData();
|
|
15411
15535
|
d && (r.clearUserEdits ?? !0) && h.clearUserEditMarks(i, l);
|
|
15412
15536
|
const E = a ? h.resolveByPathAuthority(i, b, t, u) : t;
|
|
15413
|
-
i.setBindingData(E), a && (
|
|
15537
|
+
i.setBindingData(E), a && (O.bindChange(e, b, E, "manual"), Be.mirror(i));
|
|
15414
15538
|
const A = () => {
|
|
15415
15539
|
i.markBindingWorkStart();
|
|
15416
|
-
const
|
|
15417
|
-
let
|
|
15540
|
+
const w = i.getRawBindingData() ?? E;
|
|
15541
|
+
let $ = a ? i.setAttribute(
|
|
15418
15542
|
`${c.prefix}bind`,
|
|
15419
|
-
JSON.stringify(h.withoutReservedBindingKeys(
|
|
15543
|
+
JSON.stringify(h.withoutReservedBindingKeys(w))
|
|
15420
15544
|
) : Promise.resolve();
|
|
15421
|
-
return e.tagName === "FORM" && (
|
|
15545
|
+
return e.tagName === "FORM" && ($ = $.then(() => {
|
|
15422
15546
|
if (i.wasResetAfter(y))
|
|
15423
15547
|
return;
|
|
15424
|
-
const
|
|
15548
|
+
const C = i.getRawBindingData() ?? E;
|
|
15425
15549
|
return x.syncValues(
|
|
15426
15550
|
i,
|
|
15427
|
-
x.resolveSyncValues(i,
|
|
15551
|
+
x.resolveSyncValues(i, C),
|
|
15428
15552
|
!1,
|
|
15429
15553
|
u
|
|
15430
15554
|
);
|
|
15431
|
-
})),
|
|
15555
|
+
})), $ = $.then(
|
|
15432
15556
|
() => x.syncAncestorArgForms(i, y, u, b)
|
|
15433
|
-
),
|
|
15557
|
+
), $ = $.then(() => h.evaluateAll(i, s)), $ = $.then(
|
|
15434
15558
|
() => R.retryUnappliedValueWrites(e, y)
|
|
15435
|
-
),
|
|
15559
|
+
), $ = $.then(
|
|
15436
15560
|
() => h.reevaluateReactiveSpecialAttributes(i, s)
|
|
15437
|
-
),
|
|
15561
|
+
), $.then(
|
|
15438
15562
|
() => i.markBindingWorkEnd(),
|
|
15439
|
-
(
|
|
15440
|
-
throw i.markBindingWorkEnd(),
|
|
15563
|
+
(C) => {
|
|
15564
|
+
throw i.markBindingWorkEnd(), C;
|
|
15441
15565
|
}
|
|
15442
15566
|
);
|
|
15443
15567
|
};
|
|
@@ -15503,22 +15627,22 @@ const h = class h {
|
|
|
15503
15627
|
if (h.isPlainRecord(t) && h.isPlainRecord(r)) {
|
|
15504
15628
|
const d = t, y = r, b = {};
|
|
15505
15629
|
let E = Object.keys(d).some(
|
|
15506
|
-
(
|
|
15630
|
+
(w) => !Object.prototype.hasOwnProperty.call(y, w)
|
|
15507
15631
|
);
|
|
15508
15632
|
const A = /* @__PURE__ */ new Set([
|
|
15509
15633
|
...Object.keys(d),
|
|
15510
15634
|
...Object.keys(y)
|
|
15511
15635
|
]);
|
|
15512
|
-
for (const
|
|
15513
|
-
const
|
|
15636
|
+
for (const w of A) {
|
|
15637
|
+
const $ = s === "" ? w : `${s}.${w}`, C = h.mergePathAuthority(
|
|
15514
15638
|
e,
|
|
15515
|
-
Object.prototype.hasOwnProperty.call(d,
|
|
15516
|
-
Object.prototype.hasOwnProperty.call(y,
|
|
15639
|
+
Object.prototype.hasOwnProperty.call(d, w) ? d[w] : h.ABSENT_PATH,
|
|
15640
|
+
Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH,
|
|
15517
15641
|
i,
|
|
15518
|
-
|
|
15642
|
+
$,
|
|
15519
15643
|
n
|
|
15520
15644
|
);
|
|
15521
|
-
|
|
15645
|
+
C !== h.ABSENT_PATH && (b[w] = C), C !== (Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH) && (E = !0);
|
|
15522
15646
|
}
|
|
15523
15647
|
return E ? b : y;
|
|
15524
15648
|
}
|
|
@@ -15736,7 +15860,7 @@ const h = class h {
|
|
|
15736
15860
|
*/
|
|
15737
15861
|
static dumpScope(e) {
|
|
15738
15862
|
const t = h.collectScope(e);
|
|
15739
|
-
return
|
|
15863
|
+
return V.isEnabled() && m.info("[Haori]", "scope dump for", e, t), t;
|
|
15740
15864
|
}
|
|
15741
15865
|
/**
|
|
15742
15866
|
* スコープの解決結果と由来を収集します。
|
|
@@ -15807,7 +15931,7 @@ const h = class h {
|
|
|
15807
15931
|
return Promise.resolve();
|
|
15808
15932
|
if (r.attachObserved(s, i), s instanceof R)
|
|
15809
15933
|
return h.scan(s.getTarget());
|
|
15810
|
-
if (s instanceof
|
|
15934
|
+
if (s instanceof de)
|
|
15811
15935
|
return h.evaluateText(s);
|
|
15812
15936
|
}
|
|
15813
15937
|
return Promise.resolve();
|
|
@@ -15958,7 +16082,7 @@ const h = class h {
|
|
|
15958
16082
|
if (h.canSkipUnchangedNestedEach(A))
|
|
15959
16083
|
return;
|
|
15960
16084
|
E.push(h.evaluateAll(A, t));
|
|
15961
|
-
} else A instanceof
|
|
16085
|
+
} else A instanceof de && !t.has(A) && E.push(h.evaluateText(A));
|
|
15962
16086
|
}), Promise.all(E).then(() => {
|
|
15963
16087
|
});
|
|
15964
16088
|
}).then(() => {
|
|
@@ -15981,7 +16105,7 @@ const h = class h {
|
|
|
15981
16105
|
const i = e.getRawDerivedBindingData(), s = typeof r == "string" ? r.trim() : "";
|
|
15982
16106
|
if (!t || s === "")
|
|
15983
16107
|
return i === null ? Promise.resolve(!1) : (e.setDerivedBindingData(null), Promise.resolve(!0));
|
|
15984
|
-
const n =
|
|
16108
|
+
const n = re.evaluateDetailed(
|
|
15985
16109
|
t,
|
|
15986
16110
|
e.getBindingData()
|
|
15987
16111
|
);
|
|
@@ -16028,7 +16152,7 @@ const h = class h {
|
|
|
16028
16152
|
const t = e.getRawAttribute(`${c.prefix}if`);
|
|
16029
16153
|
if (typeof t != "string" || t.indexOf("{{") >= 0)
|
|
16030
16154
|
return;
|
|
16031
|
-
if (
|
|
16155
|
+
if (re.hasCompileFailure(t)) {
|
|
16032
16156
|
m.warn(
|
|
16033
16157
|
"[Haori]",
|
|
16034
16158
|
"data-if is hidden because the expression could not be compiled (see the preceding compile error):",
|
|
@@ -16104,7 +16228,7 @@ const h = class h {
|
|
|
16104
16228
|
static evaluateEachFixedChildren(e) {
|
|
16105
16229
|
const t = [];
|
|
16106
16230
|
return e.getChildren().forEach((r) => {
|
|
16107
|
-
r instanceof R ? h.isEachFixedChild(r) && t.push(h.evaluateAll(r)) : r instanceof
|
|
16231
|
+
r instanceof R ? h.isEachFixedChild(r) && t.push(h.evaluateAll(r)) : r instanceof de && t.push(h.evaluateText(r));
|
|
16108
16232
|
}), Promise.all(t).then(() => {
|
|
16109
16233
|
});
|
|
16110
16234
|
}
|
|
@@ -16142,9 +16266,9 @@ const h = class h {
|
|
|
16142
16266
|
static evaluateIf(e, t = /* @__PURE__ */ new Set()) {
|
|
16143
16267
|
const r = [], i = e.getAttribute(`${c.prefix}if`);
|
|
16144
16268
|
if (h.isHiddenIfCondition(i))
|
|
16145
|
-
|
|
16269
|
+
V.isEnabled() && e.isVisible() && h.logFalsyIfDiagnostics(e), r.push(
|
|
16146
16270
|
e.hide().then(() => {
|
|
16147
|
-
|
|
16271
|
+
O.hide(e.getTarget());
|
|
16148
16272
|
})
|
|
16149
16273
|
);
|
|
16150
16274
|
else {
|
|
@@ -16159,10 +16283,10 @@ const h = class h {
|
|
|
16159
16283
|
() => h.reevaluateReactiveSpecialAttributes(l)
|
|
16160
16284
|
)
|
|
16161
16285
|
) : a.push(h.scanElement(l.getTarget(), !1));
|
|
16162
|
-
} else l instanceof
|
|
16286
|
+
} else l instanceof de && !(s && t.has(l)) && a.push(h.evaluateText(l));
|
|
16163
16287
|
}), r.push(
|
|
16164
16288
|
e.show().then(() => {
|
|
16165
|
-
|
|
16289
|
+
O.show(e.getTarget()), s || (h.triggerLoadOnShow(e), le.refreshSubtree(e.getTarget(), !1));
|
|
16166
16290
|
})
|
|
16167
16291
|
), r.push(
|
|
16168
16292
|
Promise.all(a).then(() => {
|
|
@@ -16185,7 +16309,7 @@ const h = class h {
|
|
|
16185
16309
|
*/
|
|
16186
16310
|
static triggerLoadOnShow(e) {
|
|
16187
16311
|
const t = `${c.prefix}load-`;
|
|
16188
|
-
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new
|
|
16312
|
+
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new he(e, "load").run().catch((i) => {
|
|
16189
16313
|
m.error("[Haori]", "data-load procedure error (on show):", i);
|
|
16190
16314
|
});
|
|
16191
16315
|
}
|
|
@@ -16213,7 +16337,7 @@ const h = class h {
|
|
|
16213
16337
|
* @return 差分更新(再実行を含む)の完了 Promise
|
|
16214
16338
|
*/
|
|
16215
16339
|
static evaluateEach(e) {
|
|
16216
|
-
if (
|
|
16340
|
+
if (V.isEnabled() && re.recordRowScopeIdentifiers([
|
|
16217
16341
|
h.getRowScopeName(e, "each-arg"),
|
|
16218
16342
|
h.getRowScopeName(e, "each-index")
|
|
16219
16343
|
]), e.isMounted() || h.syncMountedState(e), !e.isVisible() || !e.isMounted())
|
|
@@ -16263,7 +16387,7 @@ const h = class h {
|
|
|
16263
16387
|
t.rerunRequested = !1, await h.performEachUpdate(e);
|
|
16264
16388
|
while (t.rerunRequested);
|
|
16265
16389
|
const i = e.getTarget();
|
|
16266
|
-
i.setAttribute(`${c.prefix}each-done`, ""),
|
|
16390
|
+
i.setAttribute(`${c.prefix}each-done`, ""), le.refreshSubtree(i, !1), h.runEachRenderedScript(i);
|
|
16267
16391
|
} finally {
|
|
16268
16392
|
t.running = !1, t.settled = null;
|
|
16269
16393
|
}
|
|
@@ -16283,10 +16407,10 @@ const h = class h {
|
|
|
16283
16407
|
*/
|
|
16284
16408
|
static runEachRenderedScript(e) {
|
|
16285
16409
|
const t = `${c.prefix}each-rendered-run`, r = D.get(e);
|
|
16286
|
-
if (r === null || !
|
|
16410
|
+
if (r === null || !oe.declared(r, t))
|
|
16287
16411
|
return;
|
|
16288
|
-
if (
|
|
16289
|
-
const n =
|
|
16412
|
+
if (oe.applies(r, t)) {
|
|
16413
|
+
const n = oe.compile(r, t, []);
|
|
16290
16414
|
try {
|
|
16291
16415
|
n?.([]);
|
|
16292
16416
|
} catch (a) {
|
|
@@ -16470,7 +16594,7 @@ ${i}
|
|
|
16470
16594
|
const s = (n) => {
|
|
16471
16595
|
if (h.keepsRowScopeNames(n))
|
|
16472
16596
|
for (const a of n.getChildren())
|
|
16473
|
-
a instanceof
|
|
16597
|
+
a instanceof de ? h.areExpressionsRowLocal(
|
|
16474
16598
|
h.extractInterpolations(a.getRawText()),
|
|
16475
16599
|
i
|
|
16476
16600
|
) && r.add(a) : a instanceof R && (h.isRowLocalSubtree(a, i) ? r.add(a) : s(a));
|
|
@@ -16612,7 +16736,7 @@ ${i}
|
|
|
16612
16736
|
if (i instanceof R) {
|
|
16613
16737
|
if (!h.isRowLocalSubtree(i, r))
|
|
16614
16738
|
return !1;
|
|
16615
|
-
} else if (i instanceof
|
|
16739
|
+
} else if (i instanceof de) {
|
|
16616
16740
|
const s = i.getRawText();
|
|
16617
16741
|
if (s.includes("{{") && !h.areExpressionsRowLocal(
|
|
16618
16742
|
h.extractInterpolations(s),
|
|
@@ -16636,7 +16760,7 @@ ${i}
|
|
|
16636
16760
|
const i = r.trim();
|
|
16637
16761
|
if (i === "")
|
|
16638
16762
|
continue;
|
|
16639
|
-
const s =
|
|
16763
|
+
const s = re.getFreeIdentifiers(i);
|
|
16640
16764
|
if (s.length === 0 || s.some((n) => !t.has(n)))
|
|
16641
16765
|
return !1;
|
|
16642
16766
|
}
|
|
@@ -16768,7 +16892,7 @@ ${i}
|
|
|
16768
16892
|
* @returns プロファイル
|
|
16769
16893
|
*/
|
|
16770
16894
|
static getOrCreateDerivedSubtreeProfile(e) {
|
|
16771
|
-
if (!
|
|
16895
|
+
if (!V.isEnabled() || !e.hasAttribute(`${c.prefix}derive`))
|
|
16772
16896
|
return null;
|
|
16773
16897
|
const t = h.DERIVE_SUBTREE_PROFILES.get(e);
|
|
16774
16898
|
if (t)
|
|
@@ -16885,7 +17009,7 @@ ${i}
|
|
|
16885
17009
|
const s = e.getRawAttribute(i);
|
|
16886
17010
|
return typeof s == "string" && s.includes("{{");
|
|
16887
17011
|
}) ? !0 : e.getChildren().some(
|
|
16888
|
-
(i) => i instanceof
|
|
17012
|
+
(i) => i instanceof de && i.hasDynamicContent()
|
|
16889
17013
|
);
|
|
16890
17014
|
}
|
|
16891
17015
|
/**
|
|
@@ -16895,7 +17019,7 @@ ${i}
|
|
|
16895
17019
|
* @returns subtree 全体を省略可能なら true
|
|
16896
17020
|
*/
|
|
16897
17021
|
static markFreshInitializationSkippable(e) {
|
|
16898
|
-
const t = e.getAttributeNames().some((s) => h.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof R ? !h.markFreshInitializationSkippable(s) : s instanceof
|
|
17022
|
+
const t = e.getAttributeNames().some((s) => h.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof R ? !h.markFreshInitializationSkippable(s) : s instanceof de ? s.hasDynamicContent() : !1), i = !t && !r;
|
|
16899
17023
|
return e.setFreshInitializationSkippable(i), i;
|
|
16900
17024
|
}
|
|
16901
17025
|
/**
|
|
@@ -16939,103 +17063,103 @@ ${i}
|
|
|
16939
17063
|
);
|
|
16940
17064
|
const y = d.map((F) => F.getListKey()), b = /* @__PURE__ */ new Set();
|
|
16941
17065
|
d = d.filter((F, Z) => {
|
|
16942
|
-
const
|
|
16943
|
-
if (
|
|
17066
|
+
const ee = String(F.getListKey()), ne = l.get(ee) ?? 0;
|
|
17067
|
+
if (ne === 0) {
|
|
16944
17068
|
b.add(F);
|
|
16945
|
-
const
|
|
16946
|
-
return
|
|
17069
|
+
const K = F.getListKey();
|
|
17070
|
+
return K !== null && O.rowRemove(F.getTarget(), K, Z), u.push(F.remove()), !1;
|
|
16947
17071
|
}
|
|
16948
|
-
return l.set(
|
|
17072
|
+
return l.set(ee, ne - 1), !0;
|
|
16949
17073
|
});
|
|
16950
17074
|
const E = d.map((F) => F.getListKey()), A = /* @__PURE__ */ new Map();
|
|
16951
17075
|
d.forEach((F) => {
|
|
16952
17076
|
const Z = F.getListKey();
|
|
16953
17077
|
if (Z === null)
|
|
16954
17078
|
return;
|
|
16955
|
-
const
|
|
16956
|
-
|
|
17079
|
+
const ee = A.get(Z);
|
|
17080
|
+
ee ? ee.push(F) : A.set(Z, [F]);
|
|
16957
17081
|
});
|
|
16958
|
-
const
|
|
17082
|
+
const w = e.getChildElementFragments().filter((F) => !b.has(F)), $ = w.filter(
|
|
16959
17083
|
(F) => F.hasAttribute(`${c.prefix}each-before`)
|
|
16960
17084
|
).length;
|
|
16961
|
-
let
|
|
16962
|
-
const
|
|
17085
|
+
let C = Promise.resolve();
|
|
17086
|
+
const se = [];
|
|
16963
17087
|
return a.forEach((F, Z) => {
|
|
16964
|
-
const
|
|
16965
|
-
let
|
|
16966
|
-
const
|
|
16967
|
-
if (
|
|
16968
|
-
|
|
16969
|
-
const
|
|
16970
|
-
|
|
17088
|
+
const ee = t[Z], ne = Z;
|
|
17089
|
+
let K;
|
|
17090
|
+
const ae = A.get(F)?.shift();
|
|
17091
|
+
if (ae) {
|
|
17092
|
+
K = ae;
|
|
17093
|
+
const j = $ + Z;
|
|
17094
|
+
C = C.then(
|
|
16971
17095
|
() => h.updateRowFragment(
|
|
16972
|
-
|
|
16973
|
-
|
|
17096
|
+
K,
|
|
17097
|
+
ee,
|
|
16974
17098
|
i,
|
|
16975
|
-
|
|
17099
|
+
ne,
|
|
16976
17100
|
n ? String(n) : null,
|
|
16977
17101
|
F
|
|
16978
17102
|
).then(
|
|
16979
|
-
(
|
|
17103
|
+
(k) => (
|
|
16980
17104
|
// 再利用行も新しい並び順の位置へ移動する。移動しないと、配列を並べ替え
|
|
16981
17105
|
// ただけの更新(data-each-key 指定時はキーが変わらないため全行が再利用
|
|
16982
17106
|
// される)で DOM の順序が古いまま残る。
|
|
16983
17107
|
h.repositionEachRow(
|
|
16984
17108
|
e,
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
).then((
|
|
16989
|
-
|
|
16990
|
-
|
|
17109
|
+
K,
|
|
17110
|
+
w,
|
|
17111
|
+
j
|
|
17112
|
+
).then((B) => {
|
|
17113
|
+
B !== null && O.rowMove(
|
|
17114
|
+
K.getTarget(),
|
|
16991
17115
|
F,
|
|
16992
|
-
|
|
17116
|
+
B - $,
|
|
16993
17117
|
Z
|
|
16994
|
-
), !(!
|
|
17118
|
+
), !(!k && h.isRowLocalEachTemplate(e)) && se.push(
|
|
16995
17119
|
h.evaluateAll(
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
).then(() => h.applyRowFormValues(e,
|
|
17120
|
+
K,
|
|
17121
|
+
k ? /* @__PURE__ */ new Set() : h.collectRowLocalFragments(e, K)
|
|
17122
|
+
).then(() => h.applyRowFormValues(e, K, ee))
|
|
16999
17123
|
);
|
|
17000
17124
|
})
|
|
17001
17125
|
)
|
|
17002
17126
|
)
|
|
17003
17127
|
);
|
|
17004
17128
|
} else {
|
|
17005
|
-
|
|
17006
|
-
const
|
|
17007
|
-
|
|
17129
|
+
K = r.clone();
|
|
17130
|
+
const j = $ + Z;
|
|
17131
|
+
C = C.then(
|
|
17008
17132
|
() => h.updateRowFragment(
|
|
17009
|
-
|
|
17010
|
-
|
|
17133
|
+
K,
|
|
17134
|
+
ee,
|
|
17011
17135
|
i,
|
|
17012
|
-
|
|
17136
|
+
ne,
|
|
17013
17137
|
n ? String(n) : null,
|
|
17014
17138
|
F
|
|
17015
17139
|
).then(() => {
|
|
17016
|
-
const
|
|
17017
|
-
return e.insertBefore(
|
|
17018
|
-
|
|
17019
|
-
}).then(() => h.initializeFreshEachRow(
|
|
17020
|
-
|
|
17140
|
+
const k = w[j] ?? null;
|
|
17141
|
+
return e.insertBefore(K, k).then(() => {
|
|
17142
|
+
w.splice(j, 0, K);
|
|
17143
|
+
}).then(() => h.initializeFreshEachRow(K)).then(() => h.applyRowFormValues(e, K, ee)).then(() => {
|
|
17144
|
+
O.rowAdd(K.getTarget(), F, ne, ee);
|
|
17021
17145
|
});
|
|
17022
17146
|
})
|
|
17023
17147
|
);
|
|
17024
17148
|
}
|
|
17025
|
-
}), Promise.all(u).then(() =>
|
|
17149
|
+
}), Promise.all(u).then(() => C).then(() => Promise.all(se)).then(() => {
|
|
17026
17150
|
const F = a.filter(
|
|
17027
|
-
(
|
|
17151
|
+
(j) => j !== null
|
|
17028
17152
|
), Z = E.filter(
|
|
17029
|
-
(
|
|
17030
|
-
),
|
|
17031
|
-
(
|
|
17153
|
+
(j) => j !== null
|
|
17154
|
+
), ee = new Set(Z), ne = F.filter((j) => !ee.has(j)), ae = y.filter(
|
|
17155
|
+
(j) => j !== null
|
|
17032
17156
|
).filter(
|
|
17033
|
-
(
|
|
17157
|
+
(j) => !o.has(j)
|
|
17034
17158
|
);
|
|
17035
|
-
|
|
17159
|
+
O.eachUpdate(
|
|
17036
17160
|
e.getTarget(),
|
|
17037
|
-
|
|
17038
|
-
|
|
17161
|
+
ne,
|
|
17162
|
+
ae,
|
|
17039
17163
|
F
|
|
17040
17164
|
);
|
|
17041
17165
|
});
|
|
@@ -17087,7 +17211,7 @@ ${i}
|
|
|
17087
17211
|
* @returns 戻り値はありません。
|
|
17088
17212
|
*/
|
|
17089
17213
|
static warnDuplicateEachKey(e) {
|
|
17090
|
-
!
|
|
17214
|
+
!V.isEnabled() || h.WARNED_DUPLICATE_EACH_KEYS.has(e) || (h.WARNED_DUPLICATE_EACH_KEYS.add(e), m.warn(
|
|
17091
17215
|
"[Haori]",
|
|
17092
17216
|
`${c.prefix}each-key="${e}" の値が配列の中で重複しています。行は出現順で対応付けますが、キーによる行の識別はできません。`
|
|
17093
17217
|
));
|
|
@@ -17328,7 +17452,7 @@ h.ATTRIBUTE_ALIAS_SUFFIX = "attr-", h.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
17328
17452
|
"enhance-new"
|
|
17329
17453
|
]), h.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), h.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), h.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), h.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), h.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), h.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), h.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), h.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), h.ABSENT_PATH = Symbol("absent");
|
|
17330
17454
|
let M = h;
|
|
17331
|
-
const
|
|
17455
|
+
const Me = class Me {
|
|
17332
17456
|
/**
|
|
17333
17457
|
* コンストラクタ。
|
|
17334
17458
|
*
|
|
@@ -17339,7 +17463,7 @@ const Ce = class Ce {
|
|
|
17339
17463
|
if (t.defaultPrevented || x.isResettingInternally())
|
|
17340
17464
|
return;
|
|
17341
17465
|
const r = t.target;
|
|
17342
|
-
r instanceof HTMLElement && setTimeout(() =>
|
|
17466
|
+
r instanceof HTMLElement && setTimeout(() => le.refreshSubtree(r), 0);
|
|
17343
17467
|
}, this.onChange = (t) => this.delegate(t, "change"), this.onInput = (t) => this.delegate(t, "input"), this.onLoadCapture = (t) => this.delegate(t, "load"), this.onWindowLoad = () => {
|
|
17344
17468
|
if (this.deferred) {
|
|
17345
17469
|
this.deferredProcedures.push(() => this.runWindowLoadProcedure());
|
|
@@ -17348,7 +17472,7 @@ const Ce = class Ce {
|
|
|
17348
17472
|
this.runWindowLoadProcedure();
|
|
17349
17473
|
}, this.onPopstate = (t) => {
|
|
17350
17474
|
const r = t.state;
|
|
17351
|
-
if (!r || r[
|
|
17475
|
+
if (!r || r[Me.HISTORY_STATE_KEY] !== !0) {
|
|
17352
17476
|
M.refreshUrlParams();
|
|
17353
17477
|
return;
|
|
17354
17478
|
}
|
|
@@ -17362,7 +17486,7 @@ const Ce = class Ce {
|
|
|
17362
17486
|
*/
|
|
17363
17487
|
runWindowLoadProcedure() {
|
|
17364
17488
|
const e = document.documentElement, t = D.get(e);
|
|
17365
|
-
t && new
|
|
17489
|
+
t && new he(t, "load").run();
|
|
17366
17490
|
}
|
|
17367
17491
|
/**
|
|
17368
17492
|
* イベントリスナーの登録を開始します。
|
|
@@ -17456,7 +17580,7 @@ const Ce = class Ce {
|
|
|
17456
17580
|
subscribeCustomEvent(e) {
|
|
17457
17581
|
if (e === null || e === "")
|
|
17458
17582
|
return;
|
|
17459
|
-
if (
|
|
17583
|
+
if (Me.BUILTIN_EVENT_NAMES.has(e)) {
|
|
17460
17584
|
m.warn(
|
|
17461
17585
|
"[Haori]",
|
|
17462
17586
|
`data-on="${e}" は組み込みイベントです。data-${e}-* を使用してください(data-on はカスタムイベント専用)。`
|
|
@@ -17486,7 +17610,7 @@ const Ce = class Ce {
|
|
|
17486
17610
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
17487
17611
|
return;
|
|
17488
17612
|
const s = D.get(i);
|
|
17489
|
-
s instanceof R && this.isFromTarget(s, t) && new
|
|
17613
|
+
s instanceof R && this.isFromTarget(s, t) && new he(s, "on", t).run().catch((n) => {
|
|
17490
17614
|
m.error("[Haori]", "Procedure execution error:", n);
|
|
17491
17615
|
});
|
|
17492
17616
|
});
|
|
@@ -17506,8 +17630,8 @@ const Ce = class Ce {
|
|
|
17506
17630
|
const r = `${this.onAttributeName}-target`;
|
|
17507
17631
|
if (!e.hasAttribute(r))
|
|
17508
17632
|
return !0;
|
|
17509
|
-
const i =
|
|
17510
|
-
return i === null || !(s instanceof Node) ? !1 :
|
|
17633
|
+
const i = z.read(e, r), s = t.target;
|
|
17634
|
+
return i === null || !(s instanceof Node) ? !1 : z.queryAll(i, r).some(
|
|
17511
17635
|
(n) => n.contains(s)
|
|
17512
17636
|
);
|
|
17513
17637
|
}
|
|
@@ -17574,11 +17698,11 @@ const Ce = class Ce {
|
|
|
17574
17698
|
return;
|
|
17575
17699
|
(t === "change" || t === "input") && this.syncUserEdit(e, t === "change");
|
|
17576
17700
|
const s = () => {
|
|
17577
|
-
const n = new
|
|
17701
|
+
const n = new he(i, t, r).runWithOutcome().catch((a) => (m.error("[Haori]", "Procedure execution error:", a), "failure"));
|
|
17578
17702
|
if (t === "click") {
|
|
17579
|
-
|
|
17703
|
+
he.recordClickOutcome(e, n);
|
|
17580
17704
|
const a = r.target;
|
|
17581
|
-
a instanceof HTMLElement && a !== e &&
|
|
17705
|
+
a instanceof HTMLElement && a !== e && he.recordClickOutcome(a, n);
|
|
17582
17706
|
}
|
|
17583
17707
|
};
|
|
17584
17708
|
if (t === "click" && e.hasAttribute(`${c.prefix}click-defer`)) {
|
|
@@ -17699,13 +17823,13 @@ const Ce = class Ce {
|
|
|
17699
17823
|
return null;
|
|
17700
17824
|
}
|
|
17701
17825
|
};
|
|
17702
|
-
|
|
17826
|
+
Me.HISTORY_STATE_KEY = "__haoriHistoryState__", Me.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
17703
17827
|
"click",
|
|
17704
17828
|
"change",
|
|
17705
17829
|
"input",
|
|
17706
17830
|
"load"
|
|
17707
17831
|
]);
|
|
17708
|
-
let
|
|
17832
|
+
let nt = Me;
|
|
17709
17833
|
const q = class q {
|
|
17710
17834
|
/**
|
|
17711
17835
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -17805,7 +17929,7 @@ const q = class q {
|
|
|
17805
17929
|
static runProcedure(e, t) {
|
|
17806
17930
|
t.pending = !1, t.running = !0;
|
|
17807
17931
|
let r = !1;
|
|
17808
|
-
new
|
|
17932
|
+
new he(t.fragment, "intersect").runWithResult().then((i) => {
|
|
17809
17933
|
r = i;
|
|
17810
17934
|
}).catch((i) => {
|
|
17811
17935
|
m.error("[Haori]", "Intersect procedure execution error:", i);
|
|
@@ -17875,7 +17999,7 @@ const q = class q {
|
|
|
17875
17999
|
const r = e.getAttribute(t);
|
|
17876
18000
|
if (typeof r != "string" || r.trim() === "")
|
|
17877
18001
|
return null;
|
|
17878
|
-
const i =
|
|
18002
|
+
const i = z.query(r, t, document);
|
|
17879
18003
|
return q.isHtmlElement(i) ? i : (m.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
17880
18004
|
}
|
|
17881
18005
|
static resolveRootMargin(e) {
|
|
@@ -17903,7 +18027,7 @@ q.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
17903
18027
|
"disabled",
|
|
17904
18028
|
"once"
|
|
17905
18029
|
]), q.registrations = /* @__PURE__ */ new Map();
|
|
17906
|
-
let
|
|
18030
|
+
let Ce = q;
|
|
17907
18031
|
const S = class S {
|
|
17908
18032
|
/**
|
|
17909
18033
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
@@ -18092,7 +18216,7 @@ const S = class S {
|
|
|
18092
18216
|
t.fetching = !0, t.count += 1;
|
|
18093
18217
|
let i = !1;
|
|
18094
18218
|
try {
|
|
18095
|
-
i = await new
|
|
18219
|
+
i = await new he(
|
|
18096
18220
|
t.fragment,
|
|
18097
18221
|
"poll"
|
|
18098
18222
|
).runWithResult();
|
|
@@ -18138,7 +18262,7 @@ const S = class S {
|
|
|
18138
18262
|
*/
|
|
18139
18263
|
static async handleTimeout(e) {
|
|
18140
18264
|
const t = S.registrations.get(e);
|
|
18141
|
-
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected &&
|
|
18265
|
+
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected && O.pollTimeout(
|
|
18142
18266
|
e,
|
|
18143
18267
|
t.count,
|
|
18144
18268
|
S.elapsed(t)
|
|
@@ -18158,7 +18282,7 @@ const S = class S {
|
|
|
18158
18282
|
S.registrations.delete(e);
|
|
18159
18283
|
return;
|
|
18160
18284
|
}
|
|
18161
|
-
await S.injectState(t), e.isConnected &&
|
|
18285
|
+
await S.injectState(t), e.isConnected && O.pollStop(
|
|
18162
18286
|
e,
|
|
18163
18287
|
r,
|
|
18164
18288
|
t.count,
|
|
@@ -18271,7 +18395,7 @@ const S = class S {
|
|
|
18271
18395
|
const i = r.getAttribute(t);
|
|
18272
18396
|
if (typeof i != "string" || i.trim() === "")
|
|
18273
18397
|
return r.getTarget().isConnected ? [r] : [];
|
|
18274
|
-
const s =
|
|
18398
|
+
const s = z.queryAll(
|
|
18275
18399
|
i,
|
|
18276
18400
|
t,
|
|
18277
18401
|
document
|
|
@@ -18430,9 +18554,9 @@ S.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
18430
18554
|
"disabled",
|
|
18431
18555
|
"state"
|
|
18432
18556
|
]), S.DEFAULT_INTERVAL_MS = 5e3, S.MIN_INTERVAL_MS = 100, S.registrations = /* @__PURE__ */ new Map(), S.visibilityListener = null;
|
|
18433
|
-
let
|
|
18434
|
-
const
|
|
18435
|
-
function
|
|
18557
|
+
let $e = S;
|
|
18558
|
+
const Pr = "0.66.0";
|
|
18559
|
+
function Lr(f) {
|
|
18436
18560
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => f()) : Promise.resolve().then(f);
|
|
18437
18561
|
}
|
|
18438
18562
|
const L = class L {
|
|
@@ -18570,7 +18694,7 @@ const L = class L {
|
|
|
18570
18694
|
const r = e.getAttribute(t);
|
|
18571
18695
|
if (typeof r != "string" || r.trim() === "")
|
|
18572
18696
|
return null;
|
|
18573
|
-
const i =
|
|
18697
|
+
const i = z.query(r, t, document);
|
|
18574
18698
|
return L.isHtmlElement(i) ? i : (m.error("[Haori]", `Visible range root element not found: ${r}`), null);
|
|
18575
18699
|
}
|
|
18576
18700
|
/**
|
|
@@ -18614,7 +18738,7 @@ const L = class L {
|
|
|
18614
18738
|
* @param registration 対象の登録
|
|
18615
18739
|
*/
|
|
18616
18740
|
static scheduleCompute(e) {
|
|
18617
|
-
e.scheduled || (e.scheduled = !0,
|
|
18741
|
+
e.scheduled || (e.scheduled = !0, Lr(() => {
|
|
18618
18742
|
e.scheduled = !1;
|
|
18619
18743
|
const t = e.fragment.getTarget();
|
|
18620
18744
|
L.registrations.get(t) === e && L.computeAndPublish(e);
|
|
@@ -18711,28 +18835,28 @@ const L = class L {
|
|
|
18711
18835
|
}
|
|
18712
18836
|
};
|
|
18713
18837
|
L.THRESHOLD = 0, L.DEFAULT_ROOT_MARGIN = "0px", L.registrations = /* @__PURE__ */ new Map();
|
|
18714
|
-
let
|
|
18715
|
-
const
|
|
18838
|
+
let Se = L;
|
|
18839
|
+
const H = class H {
|
|
18716
18840
|
/**
|
|
18717
18841
|
* 既存の MutationObserver をすべて停止します。
|
|
18718
18842
|
*/
|
|
18719
18843
|
static disconnectMutationObservers() {
|
|
18720
|
-
|
|
18844
|
+
H._mutationObservers.forEach((e) => {
|
|
18721
18845
|
e.disconnect();
|
|
18722
|
-
}),
|
|
18846
|
+
}), H._mutationObservers.length = 0;
|
|
18723
18847
|
}
|
|
18724
18848
|
/**
|
|
18725
18849
|
* 初期化メソッド。
|
|
18726
18850
|
* ドキュメントのheadとbodyを監視対象として設定します。
|
|
18727
18851
|
*/
|
|
18728
18852
|
static async init() {
|
|
18729
|
-
if (
|
|
18853
|
+
if (H._initialized)
|
|
18730
18854
|
return;
|
|
18731
|
-
|
|
18732
|
-
|
|
18855
|
+
H._initialized = !0, H.disconnectMutationObservers(), R.setPendingMutationFlusher(() => {
|
|
18856
|
+
H.flushPendingMutations();
|
|
18733
18857
|
});
|
|
18734
|
-
const e = new
|
|
18735
|
-
|
|
18858
|
+
const e = new nt();
|
|
18859
|
+
H._dispatcher = e, e.startDeferred(), H._initialIntakes = [];
|
|
18736
18860
|
try {
|
|
18737
18861
|
const t = await Promise.allSettled([
|
|
18738
18862
|
M.scan(document.head),
|
|
@@ -18746,11 +18870,11 @@ const U = class U {
|
|
|
18746
18870
|
"[Haori]",
|
|
18747
18871
|
"Failed to build body fragment:",
|
|
18748
18872
|
i.reason
|
|
18749
|
-
), await
|
|
18873
|
+
), await H.waitInitialIntakes(), await J.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), Ce.syncTree(document.body), $e.syncTree(document.body), Se.syncTree(document.body);
|
|
18750
18874
|
} finally {
|
|
18751
|
-
|
|
18875
|
+
H._initialIntakes = null, e.release();
|
|
18752
18876
|
}
|
|
18753
|
-
|
|
18877
|
+
O.ready(Pr);
|
|
18754
18878
|
}
|
|
18755
18879
|
/**
|
|
18756
18880
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -18759,7 +18883,7 @@ const U = class U {
|
|
|
18759
18883
|
* @returns 稼働中の EventDispatcher。未初期化の場合は null。
|
|
18760
18884
|
*/
|
|
18761
18885
|
static getDispatcher() {
|
|
18762
|
-
return
|
|
18886
|
+
return H._dispatcher;
|
|
18763
18887
|
}
|
|
18764
18888
|
/**
|
|
18765
18889
|
* 初期化の途中で取り込んだ DOM 変更の処理を、すべて待ちます。
|
|
@@ -18772,7 +18896,7 @@ const U = class U {
|
|
|
18772
18896
|
* @returns 待機完了の Promise
|
|
18773
18897
|
*/
|
|
18774
18898
|
static async waitInitialIntakes() {
|
|
18775
|
-
const e =
|
|
18899
|
+
const e = H._initialIntakes;
|
|
18776
18900
|
for (; e !== null && e.length > 0; )
|
|
18777
18901
|
await Promise.allSettled(e.splice(0));
|
|
18778
18902
|
}
|
|
@@ -18792,7 +18916,7 @@ const U = class U {
|
|
|
18792
18916
|
* @returns 戻り値はありません。
|
|
18793
18917
|
*/
|
|
18794
18918
|
static captureMutations(e) {
|
|
18795
|
-
if (
|
|
18919
|
+
if (H._mutationObservers.length > 0) {
|
|
18796
18920
|
e();
|
|
18797
18921
|
return;
|
|
18798
18922
|
}
|
|
@@ -18807,8 +18931,8 @@ const U = class U {
|
|
|
18807
18931
|
try {
|
|
18808
18932
|
e();
|
|
18809
18933
|
} finally {
|
|
18810
|
-
const r = t.takeRecords().map((i) =>
|
|
18811
|
-
t.disconnect(),
|
|
18934
|
+
const r = t.takeRecords().map((i) => H.toCapturedRecord(i));
|
|
18935
|
+
t.disconnect(), H.processMutations(r);
|
|
18812
18936
|
}
|
|
18813
18937
|
}
|
|
18814
18938
|
/**
|
|
@@ -18833,7 +18957,7 @@ const U = class U {
|
|
|
18833
18957
|
type: e.type,
|
|
18834
18958
|
target: e.target,
|
|
18835
18959
|
addedNodes: Array.from(e.addedNodes).filter(
|
|
18836
|
-
(t) => !
|
|
18960
|
+
(t) => !H.hasKnownDescendant(t)
|
|
18837
18961
|
),
|
|
18838
18962
|
removedNodes: []
|
|
18839
18963
|
};
|
|
@@ -18897,14 +19021,14 @@ const U = class U {
|
|
|
18897
19021
|
*/
|
|
18898
19022
|
static observe(e) {
|
|
18899
19023
|
const t = new MutationObserver((r) => {
|
|
18900
|
-
|
|
19024
|
+
H.processMutations(r);
|
|
18901
19025
|
});
|
|
18902
19026
|
t.observe(e, {
|
|
18903
19027
|
childList: !0,
|
|
18904
19028
|
subtree: !0,
|
|
18905
19029
|
attributes: !0,
|
|
18906
19030
|
characterData: !0
|
|
18907
|
-
}),
|
|
19031
|
+
}), H._mutationObservers.push(t);
|
|
18908
19032
|
}
|
|
18909
19033
|
/**
|
|
18910
19034
|
* 保留中の DOM 変更を同期的に引き取って処理へ載せます。
|
|
@@ -18927,15 +19051,15 @@ const U = class U {
|
|
|
18927
19051
|
* @returns 戻り値はありません。
|
|
18928
19052
|
*/
|
|
18929
19053
|
static flushPendingMutations() {
|
|
18930
|
-
for (const e of
|
|
19054
|
+
for (const e of H._mutationObservers) {
|
|
18931
19055
|
const t = e.takeRecords();
|
|
18932
19056
|
if (t.length === 0)
|
|
18933
19057
|
continue;
|
|
18934
|
-
const r = t.filter(
|
|
18935
|
-
(s) => !
|
|
19058
|
+
const r = t.filter(H.isBindAttributeRecord), i = t.filter(
|
|
19059
|
+
(s) => !H.isBindAttributeRecord(s)
|
|
18936
19060
|
);
|
|
18937
|
-
r.length > 0 &&
|
|
18938
|
-
|
|
19061
|
+
r.length > 0 && H.processMutations(r, R.nextSequence()), i.length > 0 && Promise.resolve().then(() => {
|
|
19062
|
+
H.processMutations(i);
|
|
18939
19063
|
});
|
|
18940
19064
|
}
|
|
18941
19065
|
}
|
|
@@ -18959,12 +19083,12 @@ const U = class U {
|
|
|
18959
19083
|
static processMutations(e, t) {
|
|
18960
19084
|
for (const r of e)
|
|
18961
19085
|
try {
|
|
18962
|
-
if (
|
|
19086
|
+
if (H.isExternallyManaged(r.target))
|
|
18963
19087
|
continue;
|
|
18964
19088
|
switch (r.type) {
|
|
18965
19089
|
case "attributes": {
|
|
18966
19090
|
const i = r.target;
|
|
18967
|
-
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(
|
|
19091
|
+
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(ve) && (r.attributeName === "disabled" || r.attributeName === ve))
|
|
18968
19092
|
break;
|
|
18969
19093
|
if (r.attributeName && (r.attributeName === `${c.prefix}if-false` || r.attributeName === "style" && i.hasAttribute(`${c.prefix}if-false`))) {
|
|
18970
19094
|
r.attributeName === "style" && R.reassertHiddenDisplay(i);
|
|
@@ -18979,18 +19103,18 @@ const U = class U {
|
|
|
18979
19103
|
!0,
|
|
18980
19104
|
t
|
|
18981
19105
|
);
|
|
18982
|
-
|
|
19106
|
+
H._initialIntakes?.push(s), Ce.syncElement(i), $e.syncElement(i), Se.syncElement(i);
|
|
18983
19107
|
break;
|
|
18984
19108
|
}
|
|
18985
19109
|
case "childList": {
|
|
18986
19110
|
Array.from(r.removedNodes).forEach((i) => {
|
|
18987
|
-
|
|
19111
|
+
H.isStaleExternalRemoval(r, i) || (Ce.cleanupTree(i), $e.cleanupTree(i), Se.cleanupTree(i), M.removeNode(i));
|
|
18988
19112
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
18989
19113
|
if (!(i.parentElement instanceof Element))
|
|
18990
19114
|
return;
|
|
18991
19115
|
const s = M.addNode(i.parentElement, i);
|
|
18992
|
-
|
|
18993
|
-
}), r.target instanceof Element &&
|
|
19116
|
+
H._initialIntakes?.push(s), Ce.syncTree(i), $e.syncTree(i), Se.syncTree(i);
|
|
19117
|
+
}), r.target instanceof Element && Se.syncElement(r.target);
|
|
18994
19118
|
break;
|
|
18995
19119
|
}
|
|
18996
19120
|
case "characterData": {
|
|
@@ -19010,24 +19134,24 @@ const U = class U {
|
|
|
19010
19134
|
}
|
|
19011
19135
|
}
|
|
19012
19136
|
};
|
|
19013
|
-
|
|
19014
|
-
let
|
|
19015
|
-
|
|
19016
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
19017
|
-
const
|
|
19137
|
+
H._initialized = !1, H._mutationObservers = [], H._dispatcher = null, H._initialIntakes = null;
|
|
19138
|
+
let He = H;
|
|
19139
|
+
le.setMutationCapture((f) => He.captureMutations(f));
|
|
19140
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", He.init) : He.init();
|
|
19141
|
+
const Or = () => xe.waitForRenders(), Br = xe.enhancers, Ur = xe.handlers;
|
|
19018
19142
|
export {
|
|
19019
19143
|
M as Core,
|
|
19020
|
-
|
|
19144
|
+
le as Enhance,
|
|
19021
19145
|
c as Env,
|
|
19022
19146
|
x as Form,
|
|
19023
19147
|
D as Fragment,
|
|
19024
|
-
|
|
19148
|
+
xe as Haori,
|
|
19025
19149
|
m as Log,
|
|
19026
19150
|
J as Queue,
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19151
|
+
xe as default,
|
|
19152
|
+
Br as enhancers,
|
|
19153
|
+
Ur as handlers,
|
|
19154
|
+
Pr as version,
|
|
19155
|
+
Or as waitForRenders
|
|
19032
19156
|
};
|
|
19033
19157
|
//# sourceMappingURL=haori.es.js.map
|