haori-bootstrap 0.5.55 → 0.5.57

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.
@@ -1,96 +1,96 @@
1
- function ie(e) {
2
- return typeof e == "function";
3
- }
4
1
  function ae(e) {
5
- return ie(e?.Modal) ? e?.Modal : void 0;
2
+ return typeof e == "function";
6
3
  }
7
4
  function le(e) {
8
- return ie(e?.Toast) ? e?.Toast : void 0;
5
+ return ae(e?.Modal) ? e?.Modal : void 0;
9
6
  }
10
- function y(e) {
11
- return !!ae(e);
7
+ function ce(e) {
8
+ return ae(e?.Toast) ? e?.Toast : void 0;
12
9
  }
13
- function _e(e) {
10
+ function y(e) {
14
11
  return !!le(e);
15
12
  }
16
- function D(e, n, t) {
17
- const o = ae(t);
13
+ function Pe(e) {
14
+ return !!ce(e);
15
+ }
16
+ function D(e, t, n) {
17
+ const o = le(n);
18
18
  if (o)
19
- return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, n) : new o(e, n);
19
+ return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, t) : new o(e, t);
20
20
  }
21
- function Be(e, n, t) {
22
- const o = le(t);
21
+ function xe(e, t, n) {
22
+ const o = ce(n);
23
23
  if (o)
24
- return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, n) : new o(e, n);
24
+ return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, t) : new o(e, t);
25
25
  }
26
- const De = "data-haori-dialog", Pe = "data-haori-confirm", xe = "data-haori-dialog-title", ce = "data-haori-dialog-ok", de = "data-haori-confirm-ok", ue = "data-haori-confirm-cancel", Oe = "OK", qe = "Cancel";
27
- let $e = 0;
28
- function fe() {
26
+ const Oe = "data-haori-dialog", qe = "data-haori-confirm", $e = "data-haori-dialog-title", de = "data-haori-dialog-ok", ue = "data-haori-confirm-ok", fe = "data-haori-confirm-cancel", Ue = "OK", Fe = "Cancel";
27
+ let We = 0;
28
+ function me() {
29
29
  return {
30
30
  backdrop: "static",
31
31
  keyboard: !1
32
32
  };
33
33
  }
34
- function me(e, n) {
35
- if (n.dialogContainerSelector) {
36
- const t = e.querySelector(
37
- n.dialogContainerSelector
34
+ function be(e, t) {
35
+ if (t.dialogContainerSelector) {
36
+ const n = e.querySelector(
37
+ t.dialogContainerSelector
38
38
  );
39
- if (t)
40
- return t;
39
+ if (n)
40
+ return n;
41
41
  }
42
42
  return e.body;
43
43
  }
44
- function be(e, n, t, o) {
44
+ function he(e, t, n, o) {
45
45
  const r = o.dialogTitle, s = e.createElement("div");
46
- s.className = "modal fade", s.tabIndex = -1, s.setAttribute(t ? Pe : De, "true"), s.setAttribute("aria-hidden", "true");
46
+ s.className = "modal fade", s.tabIndex = -1, s.setAttribute(n ? qe : Oe, "true"), s.setAttribute("aria-hidden", "true");
47
47
  const c = e.createElement("div");
48
48
  c.className = "modal-dialog modal-dialog-centered";
49
49
  const a = e.createElement("div");
50
50
  if (a.className = "modal-content", r) {
51
- const m = `haori-dialog-title-${++$e}`, C = e.createElement("div");
51
+ const m = `haori-dialog-title-${++We}`, C = e.createElement("div");
52
52
  C.className = "modal-header";
53
53
  const E = e.createElement("h5");
54
- E.className = "modal-title", E.id = m, E.setAttribute(xe, "true"), E.textContent = r, C.appendChild(E), a.appendChild(C), s.setAttribute("aria-labelledby", m);
54
+ E.className = "modal-title", E.id = m, E.setAttribute($e, "true"), E.textContent = r, C.appendChild(E), a.appendChild(C), s.setAttribute("aria-labelledby", m);
55
55
  }
56
56
  const u = e.createElement("div");
57
57
  u.className = "modal-body";
58
58
  const l = e.createElement("p");
59
- l.className = "mb-0", l.style.whiteSpace = "pre-line", l.textContent = n, u.appendChild(l);
59
+ l.className = "mb-0", l.style.whiteSpace = "pre-line", l.textContent = t, u.appendChild(l);
60
60
  const f = e.createElement("div");
61
- if (f.className = "modal-footer", t) {
61
+ if (f.className = "modal-footer", n) {
62
62
  const m = e.createElement("button");
63
- m.type = "button", m.className = "btn btn-secondary", m.setAttribute(ue, "true"), m.textContent = o.dialogCancelLabel ?? qe, f.appendChild(m);
63
+ m.type = "button", m.className = "btn btn-secondary", m.setAttribute(fe, "true"), m.textContent = o.dialogCancelLabel ?? Fe, f.appendChild(m);
64
64
  }
65
65
  const d = e.createElement("button");
66
- return d.type = "button", d.className = "btn btn-primary", d.setAttribute(t ? de : ce, "true"), d.textContent = o.dialogOkLabel ?? Oe, f.appendChild(d), a.append(u, f), c.appendChild(a), s.appendChild(c), s;
66
+ return d.type = "button", d.className = "btn btn-primary", d.setAttribute(n ? ue : de, "true"), d.textContent = o.dialogOkLabel ?? Ue, f.appendChild(d), a.append(u, f), c.appendChild(a), s.appendChild(c), s;
67
67
  }
68
- function he(e) {
69
- let n = !1, t = !1;
68
+ function Ee(e) {
69
+ let t = !1, n = !1;
70
70
  return {
71
71
  requestClose: (o) => {
72
- n || (n = !0, o?.(), t && e.hide());
72
+ t || (t = !0, o?.(), n && e.hide());
73
73
  },
74
74
  handleShown: () => {
75
- t = !0, n && e.hide();
75
+ n = !0, t && e.hide();
76
76
  }
77
77
  };
78
78
  }
79
- function Ue(e, n) {
80
- const t = globalThis.document, o = be(t, e, !1, n);
81
- me(t, n).appendChild(o);
79
+ function ze(e, t) {
80
+ const n = globalThis.document, o = he(n, e, !1, t);
81
+ be(n, t).appendChild(o);
82
82
  const r = D(
83
83
  o,
84
- fe(),
85
- n.bootstrap
84
+ me(),
85
+ t.bootstrap
86
86
  );
87
87
  return r ? new Promise((s, c) => {
88
88
  const a = () => {
89
89
  o.removeEventListener("shown.bs.modal", f), o.removeEventListener("hidden.bs.modal", u), o.remove(), r.dispose?.(), s();
90
90
  }, u = () => {
91
91
  a();
92
- }, l = he(r), f = l.handleShown;
93
- o.querySelector(`[${ce}]`)?.addEventListener("click", () => {
92
+ }, l = Ee(r), f = l.handleShown;
93
+ o.querySelector(`[${de}]`)?.addEventListener("click", () => {
94
94
  l.requestClose();
95
95
  }), o.addEventListener("shown.bs.modal", f), o.addEventListener("hidden.bs.modal", u, { once: !0 });
96
96
  try {
@@ -100,13 +100,13 @@ function Ue(e, n) {
100
100
  }
101
101
  }) : (o.remove(), Promise.reject(new Error("Bootstrap Modal is unavailable.")));
102
102
  }
103
- function Fe(e, n) {
104
- const t = globalThis.document, o = be(t, e, !0, n);
105
- me(t, n).appendChild(o);
103
+ function Ge(e, t) {
104
+ const n = globalThis.document, o = he(n, e, !0, t);
105
+ be(n, t).appendChild(o);
106
106
  const r = D(
107
107
  o,
108
- fe(),
109
- n.bootstrap
108
+ me(),
109
+ t.bootstrap
110
110
  );
111
111
  return r ? new Promise((s, c) => {
112
112
  let a = !1;
@@ -114,8 +114,8 @@ function Fe(e, n) {
114
114
  o.removeEventListener("shown.bs.modal", d), o.removeEventListener("hidden.bs.modal", l), o.remove(), r.dispose?.(), s(a);
115
115
  }, l = () => {
116
116
  u();
117
- }, f = he(r), d = f.handleShown, m = o.querySelector(`[${de}]`), C = o.querySelector(
118
- `[${ue}]`
117
+ }, f = Ee(r), d = f.handleShown, m = o.querySelector(`[${ue}]`), C = o.querySelector(
118
+ `[${fe}]`
119
119
  );
120
120
  m?.addEventListener("click", () => {
121
121
  f.requestClose(() => {
@@ -133,85 +133,110 @@ function Fe(e, n) {
133
133
  }
134
134
  }) : (o.remove(), Promise.reject(new Error("Bootstrap Modal is unavailable.")));
135
135
  }
136
- const T = "data-haori-owned", h = "data-haori-message-container", w = "data-haori-invalid-target", L = "data-haori-valid-target";
136
+ const A = "data-haori-owned", h = "data-haori-message-container", w = "data-haori-invalid-target", L = "data-haori-valid-target", Ke = /* @__PURE__ */ new Set([
137
+ "button",
138
+ "a",
139
+ "area",
140
+ "br",
141
+ "col",
142
+ "embed",
143
+ "hr",
144
+ "img",
145
+ "source",
146
+ "track",
147
+ "wbr"
148
+ ]);
137
149
  function S(e) {
138
150
  return e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio");
139
151
  }
140
- function g(e) {
152
+ function T(e) {
141
153
  return e instanceof HTMLInputElement && e.type === "radio";
142
154
  }
143
155
  function M(e) {
144
156
  return e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement;
145
157
  }
158
+ function z(e) {
159
+ return Ke.has(e.localName);
160
+ }
161
+ function pe(e) {
162
+ const t = e.nextElementSibling;
163
+ return t instanceof HTMLElement && t.getAttribute(h) === "true" ? t : void 0;
164
+ }
146
165
  function P(e) {
147
166
  return Array.from(e.children).find(
148
- (n) => n instanceof HTMLElement && n.getAttribute(h) === "true"
167
+ (t) => t instanceof HTMLElement && t.getAttribute(h) === "true"
149
168
  );
150
169
  }
151
- function Ee(e, n) {
152
- const t = e.createElement("div");
153
- return t.setAttribute(T, "true"), t.textContent = n, t;
170
+ function ve(e, t) {
171
+ const n = e.createElement("div");
172
+ return n.setAttribute(A, "true"), n.textContent = t, n;
154
173
  }
155
- function pe(e) {
156
- return P(e);
174
+ function Te(e) {
175
+ return z(e) ? pe(e) : P(e);
176
+ }
177
+ function Ae(e, t) {
178
+ e.insertAdjacentElement(
179
+ z(e) ? "afterend" : "afterbegin",
180
+ t
181
+ );
157
182
  }
158
183
  function I(e) {
159
184
  if (e.name) {
160
- const n = e.form ?? e.ownerDocument, t = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e.name) : e.name.replace(/(["\\])/g, "\\$1"), o = Array.from(
161
- n.querySelectorAll(`input[type="radio"][name="${t}"]`)
185
+ const t = e.form ?? e.ownerDocument, n = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e.name) : e.name.replace(/(["\\])/g, "\\$1"), o = Array.from(
186
+ t.querySelectorAll(`input[type="radio"][name="${n}"]`)
162
187
  );
163
188
  if (o.length > 0)
164
189
  return o;
165
190
  }
166
191
  return [e];
167
192
  }
168
- function We(e) {
169
- const [n, ...t] = e;
170
- if (!n)
193
+ function Ve(e) {
194
+ const [t, ...n] = e;
195
+ if (!t)
171
196
  return;
172
- let o = n;
197
+ let o = t;
173
198
  for (; o; ) {
174
- if (t.every((r) => o?.contains(r)))
199
+ if (n.every((r) => o?.contains(r)))
175
200
  return o;
176
201
  o = o.parentElement;
177
202
  }
178
203
  }
179
- function z(e) {
180
- const t = I(e).map((o) => o.closest(".form-check")).filter((o) => o instanceof HTMLElement);
181
- if (t.length > 1) {
182
- const o = We(t);
183
- if (o && !t.includes(o))
204
+ function G(e) {
205
+ const n = I(e).map((o) => o.closest(".form-check")).filter((o) => o instanceof HTMLElement);
206
+ if (n.length > 1) {
207
+ const o = Ve(n);
208
+ if (o && !n.includes(o))
184
209
  return o;
185
210
  }
186
211
  return x(e);
187
212
  }
188
213
  function x(e) {
189
- const n = e.closest(".form-check");
190
- return n instanceof HTMLElement ? n : void 0;
191
- }
192
- function ve(e) {
193
- const n = e.nextElementSibling;
194
- if (n instanceof HTMLElement && n.getAttribute(h) === "true")
195
- return n;
196
- const t = document.createElement("div");
197
- return t.className = "invalid-feedback d-block", t.setAttribute(T, "true"), t.setAttribute(h, "true"), e.insertAdjacentElement("afterend", t), t;
214
+ const t = e.closest(".form-check");
215
+ return t instanceof HTMLElement ? t : void 0;
198
216
  }
199
- function ze(e) {
200
- const n = g(e) ? z(e) : x(e);
201
- if (!n)
202
- return ve(e);
203
- const t = P(n);
204
- if (t)
217
+ function ge(e) {
218
+ const t = e.nextElementSibling;
219
+ if (t instanceof HTMLElement && t.getAttribute(h) === "true")
205
220
  return t;
206
- const o = document.createElement("div");
207
- return o.className = "invalid-feedback d-block", o.setAttribute(T, "true"), o.setAttribute(h, "true"), n.appendChild(o), o;
221
+ const n = document.createElement("div");
222
+ return n.className = "invalid-feedback d-block", n.setAttribute(A, "true"), n.setAttribute(h, "true"), e.insertAdjacentElement("afterend", n), n;
208
223
  }
209
- function Ge(e) {
210
- const n = pe(e);
224
+ function je(e) {
225
+ const t = T(e) ? G(e) : x(e);
226
+ if (!t)
227
+ return ge(e);
228
+ const n = P(t);
211
229
  if (n)
212
230
  return n;
213
- const t = document.createElement("div");
214
- return t.className = "alert alert-danger", t.setAttribute("role", "alert"), t.setAttribute(T, "true"), t.setAttribute(h, "true"), e.insertAdjacentElement("afterbegin", t), t;
231
+ const o = document.createElement("div");
232
+ return o.className = "invalid-feedback d-block", o.setAttribute(A, "true"), o.setAttribute(h, "true"), t.appendChild(o), o;
233
+ }
234
+ function Je(e) {
235
+ const t = Te(e);
236
+ if (t)
237
+ return t;
238
+ const n = document.createElement("div");
239
+ return n.className = "alert alert-danger", n.setAttribute("role", "alert"), n.setAttribute(A, "true"), n.setAttribute(h, "true"), Ae(e, n), n;
215
240
  }
216
241
  function p(e) {
217
242
  e.getAttribute(w) === "true" && (e.classList.remove("is-invalid"), e.removeAttribute(w));
@@ -219,7 +244,7 @@ function p(e) {
219
244
  function v(e) {
220
245
  e.getAttribute(L) === "true" && (e.classList.remove("is-valid"), e.removeAttribute(L));
221
246
  }
222
- function J(e) {
247
+ function X(e) {
223
248
  switch (e) {
224
249
  case "success":
225
250
  return "alert alert-success";
@@ -234,62 +259,62 @@ function J(e) {
234
259
  function k(e) {
235
260
  return e === "success" ? "valid-feedback d-block" : "invalid-feedback d-block";
236
261
  }
237
- function ge(e) {
238
- (g(e) ? I(e) : [e]).forEach((t) => {
239
- t.classList.add("is-invalid"), t.setAttribute(w, "true");
262
+ function we(e) {
263
+ (T(e) ? I(e) : [e]).forEach((n) => {
264
+ n.classList.add("is-invalid"), n.setAttribute(w, "true");
240
265
  });
241
266
  }
242
- function Ke(e) {
243
- (g(e) ? I(e) : [e]).forEach((t) => {
244
- p(t);
267
+ function Xe(e) {
268
+ (T(e) ? I(e) : [e]).forEach((n) => {
269
+ p(n);
245
270
  });
246
271
  }
247
- function Te(e, n) {
248
- const t = e.nextElementSibling;
249
- if (t instanceof HTMLElement && t.getAttribute(h) === "true")
250
- return t.className = k(n), t;
272
+ function Ce(e, t) {
273
+ const n = e.nextElementSibling;
274
+ if (n instanceof HTMLElement && n.getAttribute(h) === "true")
275
+ return n.className = k(t), n;
251
276
  const o = document.createElement("div");
252
- return o.className = k(n), o.setAttribute(T, "true"), o.setAttribute(h, "true"), e.insertAdjacentElement("afterend", o), o;
277
+ return o.className = k(t), o.setAttribute(A, "true"), o.setAttribute(h, "true"), e.insertAdjacentElement("afterend", o), o;
253
278
  }
254
- function Ve(e, n) {
255
- const t = g(e) ? z(e) : x(e);
256
- if (!t)
257
- return Te(e, n);
258
- const o = P(t);
279
+ function Qe(e, t) {
280
+ const n = T(e) ? G(e) : x(e);
281
+ if (!n)
282
+ return Ce(e, t);
283
+ const o = P(n);
259
284
  if (o)
260
- return o.className = k(n), o;
285
+ return o.className = k(t), o;
261
286
  const r = document.createElement("div");
262
- return r.className = k(n), r.setAttribute(T, "true"), r.setAttribute(h, "true"), t.appendChild(r), r;
287
+ return r.className = k(t), r.setAttribute(A, "true"), r.setAttribute(h, "true"), n.appendChild(r), r;
263
288
  }
264
- function je(e, n) {
265
- const t = pe(e);
266
- if (t)
267
- return t.className = J(n), t;
289
+ function Ye(e, t) {
290
+ const n = Te(e);
291
+ if (n)
292
+ return n.className = X(t), n;
268
293
  const o = document.createElement("div");
269
- return o.className = J(n), o.setAttribute("role", "alert"), o.setAttribute(T, "true"), o.setAttribute(h, "true"), e.insertAdjacentElement("afterbegin", o), o;
294
+ return o.className = X(t), o.setAttribute("role", "alert"), o.setAttribute(A, "true"), o.setAttribute(h, "true"), Ae(e, o), o;
270
295
  }
271
- function Je(e, n) {
272
- return (S(e) ? ze(e) : M(e) ? ve(e) : Ge(e)).appendChild(Ee(document, n)), S(e) ? ge(e) : M(e) && (e.classList.add("is-invalid"), e.setAttribute(w, "true")), Promise.resolve();
296
+ function Ze(e, t) {
297
+ return (S(e) ? je(e) : M(e) ? ge(e) : Je(e)).appendChild(ve(document, t)), S(e) ? we(e) : M(e) && (e.classList.add("is-invalid"), e.setAttribute(w, "true")), Promise.resolve();
273
298
  }
274
- function Xe(e, n, t) {
275
- if ((S(e) ? Ve(e, t) : M(e) ? Te(e, t) : je(e, t)).appendChild(Ee(document, n)), S(e)) {
276
- const r = g(e) ? I(e) : [e];
277
- t === "success" ? r.forEach((s) => {
299
+ function et(e, t, n) {
300
+ if ((S(e) ? Qe(e, n) : M(e) ? Ce(e, n) : Ye(e, n)).appendChild(ve(document, t)), S(e)) {
301
+ const r = T(e) ? I(e) : [e];
302
+ n === "success" ? r.forEach((s) => {
278
303
  p(s), s.classList.add("is-valid"), s.setAttribute(L, "true");
279
- }) : !t || t === "error" ? (r.forEach((s) => v(s)), ge(e)) : r.forEach((s) => {
304
+ }) : !n || n === "error" ? (r.forEach((s) => v(s)), we(e)) : r.forEach((s) => {
280
305
  v(s), p(s);
281
306
  });
282
- } else M(e) && (t === "success" ? (p(e), e.classList.add("is-valid"), e.setAttribute(L, "true")) : !t || t === "error" ? (v(e), e.classList.add("is-invalid"), e.setAttribute(w, "true")) : (v(e), p(e)));
307
+ } else M(e) && (n === "success" ? (p(e), e.classList.add("is-valid"), e.setAttribute(L, "true")) : !n || n === "error" ? (v(e), e.classList.add("is-invalid"), e.setAttribute(w, "true")) : (v(e), p(e)));
283
308
  return Promise.resolve();
284
309
  }
285
- function Ae(e) {
310
+ function Le(e) {
286
311
  if (S(e)) {
287
- const r = g(e) ? z(e) : x(e);
288
- (r ? P(r) : void 0)?.remove(), Ke(e), (g(e) ? I(e) : [e]).forEach((a) => v(a));
312
+ const r = T(e) ? G(e) : x(e);
313
+ (r ? P(r) : void 0)?.remove(), Xe(e), (T(e) ? I(e) : [e]).forEach((a) => v(a));
289
314
  } else if (M(e)) {
290
315
  const r = e.nextElementSibling;
291
316
  r instanceof HTMLElement && r.getAttribute(h) === "true" && r.remove(), p(e), v(e);
292
- }
317
+ } else z(e) && pe(e)?.remove();
293
318
  return e.querySelectorAll(
294
319
  `[${h}="true"]`
295
320
  ).forEach((r) => {
@@ -304,59 +329,59 @@ function Ae(e) {
304
329
  v(r);
305
330
  }), Promise.resolve();
306
331
  }
307
- const G = /* @__PURE__ */ new WeakSet(), Qe = "data-haori-dismiss-lock", U = /* @__PURE__ */ new WeakSet();
332
+ const K = /* @__PURE__ */ new WeakSet(), tt = "data-haori-dismiss-lock", U = /* @__PURE__ */ new WeakSet();
308
333
  let H = !1, F;
309
- const we = (e) => {
310
- e.target instanceof HTMLElement && G.add(e.target);
311
- }, Ce = (e) => {
312
- e.target instanceof HTMLElement && G.delete(e.target);
313
- }, Le = (e) => {
314
- const n = e.target;
315
- n instanceof HTMLElement && n.hasAttribute(Qe) && !U.has(n) && e.preventDefault();
334
+ const Se = (e) => {
335
+ e.target instanceof HTMLElement && K.add(e.target);
336
+ }, Me = (e) => {
337
+ e.target instanceof HTMLElement && K.delete(e.target);
338
+ }, Ie = (e) => {
339
+ const t = e.target;
340
+ t instanceof HTMLElement && t.hasAttribute(tt) && !U.has(t) && e.preventDefault();
316
341
  };
317
- function X(e, n) {
342
+ function Q(e, t) {
318
343
  U.add(e);
319
344
  try {
320
- n.hide();
345
+ t.hide();
321
346
  } finally {
322
347
  U.delete(e);
323
348
  }
324
349
  }
325
- function Ye(e = document) {
326
- H || (H = !0, F = e, e.addEventListener("show.bs.modal", we), e.addEventListener("shown.bs.modal", Ce), e.addEventListener("hide.bs.modal", Le));
350
+ function nt(e = document) {
351
+ H || (H = !0, F = e, e.addEventListener("show.bs.modal", Se), e.addEventListener("shown.bs.modal", Me), e.addEventListener("hide.bs.modal", Ie));
327
352
  }
328
- function Ze(e = F ?? document) {
329
- H && (H = !1, e.removeEventListener("show.bs.modal", we), e.removeEventListener("shown.bs.modal", Ce), e.removeEventListener("hide.bs.modal", Le), F = void 0);
353
+ function ot(e = F ?? document) {
354
+ H && (H = !1, e.removeEventListener("show.bs.modal", Se), e.removeEventListener("shown.bs.modal", Me), e.removeEventListener("hide.bs.modal", Ie), F = void 0);
330
355
  }
331
- function Se(e) {
356
+ function ye(e) {
332
357
  return e.classList.contains("modal") ? e : e.closest(".modal");
333
358
  }
334
- function Me(e) {
359
+ function Ne(e) {
335
360
  e.tabIndex < 0 && (e.tabIndex = -1), e.hasAttribute("aria-hidden") || e.setAttribute("aria-hidden", "true");
336
361
  }
337
- function et(e, n) {
338
- const t = Se(e);
339
- if (!t)
362
+ function rt(e, t) {
363
+ const n = ye(e);
364
+ if (!n)
340
365
  return Promise.reject(new Error('No ancestor ".modal" element was found for the target.'));
341
- Me(t), Ae(t);
342
- const o = D(t, void 0, n.bootstrap);
366
+ Ne(n), Le(n);
367
+ const o = D(n, void 0, t.bootstrap);
343
368
  return o ? (o.show(), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
344
369
  }
345
- function tt(e, n) {
346
- const t = Se(e);
347
- if (!t)
370
+ function st(e, t) {
371
+ const n = ye(e);
372
+ if (!n)
348
373
  return Promise.reject(new Error('No ancestor ".modal" element was found for the target.'));
349
- Me(t);
350
- const o = D(t, void 0, n.bootstrap);
351
- return o ? G.has(t) ? (t.addEventListener(
374
+ Ne(n);
375
+ const o = D(n, void 0, t.bootstrap);
376
+ return o ? K.has(n) ? (n.addEventListener(
352
377
  "shown.bs.modal",
353
378
  () => {
354
- X(t, o);
379
+ Q(n, o);
355
380
  },
356
381
  { once: !0 }
357
- ), Promise.resolve()) : (X(t, o), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
382
+ ), Promise.resolve()) : (Q(n, o), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
358
383
  }
359
- const Q = "data-haori-toast-container", nt = "data-haori-toast", ot = "data-haori-toast-level", rt = "data-haori-toast-accent", st = "data-haori-toast-dismiss", Y = {
384
+ const Y = "data-haori-toast-container", it = "data-haori-toast", at = "data-haori-toast-level", lt = "data-haori-toast-accent", ct = "data-haori-toast-dismiss", Z = {
360
385
  "top-start": "top-0 start-0",
361
386
  "top-center": "top-0 start-50 translate-middle-x",
362
387
  "top-end": "top-0 end-0",
@@ -364,7 +389,7 @@ const Q = "data-haori-toast-container", nt = "data-haori-toast", ot = "data-haor
364
389
  "bottom-center": "bottom-0 start-50 translate-middle-x",
365
390
  "bottom-end": "bottom-0 end-0"
366
391
  };
367
- function it(e) {
392
+ function dt(e) {
368
393
  switch (e) {
369
394
  case "success":
370
395
  return { accentClassName: "bg-success", level: "success" };
@@ -376,39 +401,39 @@ function it(e) {
376
401
  return { accentClassName: "bg-info", level: "info" };
377
402
  }
378
403
  }
379
- function at(e, n) {
380
- if (n.toastContainerSelector) {
381
- const t = e.querySelector(
382
- n.toastContainerSelector
404
+ function ut(e, t) {
405
+ if (t.toastContainerSelector) {
406
+ const n = e.querySelector(
407
+ t.toastContainerSelector
383
408
  );
384
- if (t)
385
- return t;
409
+ if (n)
410
+ return n;
386
411
  }
387
412
  return e.body;
388
413
  }
389
- function lt(e, n) {
390
- const t = at(e, n), o = Y[n.toastPosition ?? "bottom-end"], r = t.querySelector(
391
- `[${Q}="true"]`
414
+ function ft(e, t) {
415
+ const n = ut(e, t), o = Z[t.toastPosition ?? "bottom-end"], r = n.querySelector(
416
+ `[${Y}="true"]`
392
417
  );
393
418
  if (r) {
394
- const c = Object.values(Y).flatMap((a) => a.split(" "));
419
+ const c = Object.values(Z).flatMap((a) => a.split(" "));
395
420
  return r.classList.remove(...c), r.classList.add(...o.split(" ")), r;
396
421
  }
397
422
  const s = e.createElement("div");
398
- return s.className = `toast-container position-fixed ${o} p-3`, s.setAttribute(Q, "true"), t.appendChild(s), s;
423
+ return s.className = `toast-container position-fixed ${o} p-3`, s.setAttribute(Y, "true"), n.appendChild(s), s;
399
424
  }
400
- function ct(e, n, t) {
401
- const o = globalThis.document, r = it(n), s = o.createElement("div");
402
- s.className = "toast border bg-body text-body shadow-sm", s.setAttribute("role", "status"), s.setAttribute("aria-live", "polite"), s.setAttribute("aria-atomic", "true"), s.setAttribute(nt, "true"), s.setAttribute(ot, r.level);
425
+ function mt(e, t, n) {
426
+ const o = globalThis.document, r = dt(t), s = o.createElement("div");
427
+ s.className = "toast border bg-body text-body shadow-sm", s.setAttribute("role", "status"), s.setAttribute("aria-live", "polite"), s.setAttribute("aria-atomic", "true"), s.setAttribute(it, "true"), s.setAttribute(at, r.level);
403
428
  const c = o.createElement("div");
404
429
  c.className = "d-flex align-items-stretch";
405
430
  const a = o.createElement("div");
406
- a.className = `flex-shrink-0 rounded-start ${r.accentClassName}`, a.style.width = "0.375rem", a.setAttribute(rt, "true");
431
+ a.className = `flex-shrink-0 rounded-start ${r.accentClassName}`, a.style.width = "0.375rem", a.setAttribute(lt, "true");
407
432
  const u = o.createElement("div");
408
433
  u.className = "toast-body", u.style.whiteSpace = "pre-line", u.textContent = e;
409
434
  const l = o.createElement("button");
410
- l.type = "button", l.className = "btn-close me-2 m-auto flex-shrink-0", l.setAttribute("aria-label", "Close"), l.setAttribute(st, "true"), c.appendChild(a), c.appendChild(u), c.appendChild(l), s.appendChild(c), lt(o, t).appendChild(s);
411
- const f = t.toastDelay !== void 0 ? { delay: t.toastDelay } : void 0, d = Be(s, f, t.bootstrap);
435
+ l.type = "button", l.className = "btn-close me-2 m-auto flex-shrink-0", l.setAttribute("aria-label", "Close"), l.setAttribute(ct, "true"), c.appendChild(a), c.appendChild(u), c.appendChild(l), s.appendChild(c), ft(o, n).appendChild(s);
436
+ const f = n.toastDelay !== void 0 ? { delay: n.toastDelay } : void 0, d = xe(s, f, n.bootstrap);
412
437
  if (!d)
413
438
  return s.remove(), Promise.reject(new Error("Bootstrap Toast is unavailable."));
414
439
  l.addEventListener("click", () => {
@@ -426,69 +451,69 @@ function ct(e, n, t) {
426
451
  return s.remove(), d.dispose?.(), Promise.reject(m);
427
452
  }
428
453
  }
429
- const dt = {
454
+ const bt = {
430
455
  options: {
431
456
  fallbackToNative: !0
432
457
  }
433
458
  };
434
- let b = dt;
435
- function A(e) {
459
+ let b = bt;
460
+ function g(e) {
436
461
  return e ? String(e).replace(/\\n/g, `
437
462
  `) : "";
438
463
  }
439
- function Ie() {
464
+ function ke() {
440
465
  return globalThis.window;
441
466
  }
442
- function K(e) {
467
+ function V(e) {
443
468
  return Promise.resolve(e).then(() => {
444
469
  });
445
470
  }
446
471
  function O(e) {
447
- const n = b.originalHaori?.[e];
448
- return typeof n == "function" ? n : void 0;
472
+ const t = b.originalHaori?.[e];
473
+ return typeof t == "function" ? t : void 0;
449
474
  }
450
475
  function q(e) {
451
476
  console.warn(`[haori-bootstrap] ${e} skipped because Bootstrap support is unavailable.`);
452
477
  }
453
- function Z(e) {
454
- const n = A(e), t = O("dialog");
455
- if (t)
456
- return K(t(n));
457
- const o = Ie();
458
- return b.options.fallbackToNative && typeof o?.alert == "function" ? (o.alert(n), Promise.resolve()) : (q("dialog"), Promise.resolve());
459
- }
460
478
  function ee(e) {
461
- const n = A(e), t = O("confirm");
462
- if (t)
463
- return Promise.resolve(t(n)).then(
479
+ const t = g(e), n = O("dialog");
480
+ if (n)
481
+ return V(n(t));
482
+ const o = ke();
483
+ return b.options.fallbackToNative && typeof o?.alert == "function" ? (o.alert(t), Promise.resolve()) : (q("dialog"), Promise.resolve());
484
+ }
485
+ function te(e) {
486
+ const t = g(e), n = O("confirm");
487
+ if (n)
488
+ return Promise.resolve(n(t)).then(
464
489
  (r) => !!r
465
490
  );
466
- const o = Ie();
467
- return b.options.fallbackToNative && typeof o?.confirm == "function" ? Promise.resolve(o.confirm(n)) : (q("confirm"), Promise.resolve(!1));
491
+ const o = ke();
492
+ return b.options.fallbackToNative && typeof o?.confirm == "function" ? Promise.resolve(o.confirm(t)) : (q("confirm"), Promise.resolve(!1));
468
493
  }
469
- function te(e, n) {
470
- const t = A(e), o = O("toast");
471
- return o ? K(o(t, n)) : (q("toast"), Promise.resolve());
494
+ function ne(e, t) {
495
+ const n = g(e), o = O("toast");
496
+ return o ? V(o(n, t)) : (q("toast"), Promise.resolve());
472
497
  }
473
- function N(e, n) {
474
- const t = O(e);
475
- return t ? K(t(n)) : (q(e), Promise.resolve());
498
+ function N(e, t) {
499
+ const n = O(e);
500
+ return n ? V(n(t)) : (q(e), Promise.resolve());
476
501
  }
477
- function ut(e) {
502
+ function ht(e) {
478
503
  b = e;
479
504
  }
480
- class ft {
505
+ class Et {
481
506
  /**
482
507
  * 情報表示ダイアログを表示する。
483
508
  *
484
509
  * @param message 表示するメッセージ。
485
510
  * @return 完了時に解決される Promise。
486
511
  */
487
- static dialog(n) {
488
- const t = A(n);
489
- return y(b.options.bootstrap) ? Ue(t, b.options).catch(
490
- () => Z(t)
491
- ) : Z(t);
512
+ static dialog(t) {
513
+ const n = g(t);
514
+ return y(b.options.bootstrap) ? ze(n, b.options).catch(
515
+ () => ee(n)
516
+ ) : ee(n);
492
517
  }
493
518
  /**
494
519
  * 確認ダイアログを表示する。
@@ -496,11 +521,11 @@ class ft {
496
521
  * @param message 表示するメッセージ。
497
522
  * @return OK のみ true を返す Promise。
498
523
  */
499
- static confirm(n) {
500
- const t = A(n);
501
- return y(b.options.bootstrap) ? Fe(t, b.options).catch(
502
- () => ee(t)
503
- ) : ee(t);
524
+ static confirm(t) {
525
+ const n = g(t);
526
+ return y(b.options.bootstrap) ? Ge(n, b.options).catch(
527
+ () => te(n)
528
+ ) : te(n);
504
529
  }
505
530
  /**
506
531
  * トースト通知を表示する。
@@ -509,11 +534,11 @@ class ft {
509
534
  * @param level 通知レベル。
510
535
  * @return 完了時に解決される Promise。
511
536
  */
512
- static toast(n, t) {
513
- const o = A(n);
514
- return _e(b.options.bootstrap) ? ct(o, t, b.options).catch(
515
- () => te(o, t)
516
- ) : te(o, t);
537
+ static toast(t, n) {
538
+ const o = g(t);
539
+ return Pe(b.options.bootstrap) ? mt(o, n, b.options).catch(
540
+ () => ne(o, n)
541
+ ) : ne(o, n);
517
542
  }
518
543
  /**
519
544
  * 任意のダイアログ要素を開く。
@@ -521,10 +546,10 @@ class ft {
521
546
  * @param element 開く対象の要素。
522
547
  * @return 完了時に解決される Promise。
523
548
  */
524
- static openDialog(n) {
525
- return y(b.options.bootstrap) ? et(n, b.options).catch(
526
- () => N("openDialog", n)
527
- ) : N("openDialog", n);
549
+ static openDialog(t) {
550
+ return y(b.options.bootstrap) ? rt(t, b.options).catch(
551
+ () => N("openDialog", t)
552
+ ) : N("openDialog", t);
528
553
  }
529
554
  /**
530
555
  * 任意のダイアログ要素を閉じる。
@@ -532,10 +557,10 @@ class ft {
532
557
  * @param element 閉じる対象の要素。
533
558
  * @return 完了時に解決される Promise。
534
559
  */
535
- static closeDialog(n) {
536
- return y(b.options.bootstrap) ? tt(n, b.options).catch(
537
- () => N("closeDialog", n)
538
- ) : N("closeDialog", n);
560
+ static closeDialog(t) {
561
+ return y(b.options.bootstrap) ? st(t, b.options).catch(
562
+ () => N("closeDialog", t)
563
+ ) : N("closeDialog", t);
539
564
  }
540
565
  /**
541
566
  * 管理対象のエラーメッセージを追加する。
@@ -544,8 +569,8 @@ class ft {
544
569
  * @param message 表示するメッセージ。
545
570
  * @return 完了時に解決される Promise。
546
571
  */
547
- static addErrorMessage(n, t) {
548
- return Je(n, t);
572
+ static addErrorMessage(t, n) {
573
+ return Ze(t, n);
549
574
  }
550
575
  /**
551
576
  * 管理対象のメッセージをレベル付きで追加する。
@@ -555,8 +580,8 @@ class ft {
555
580
  * @param level メッセージレベル (error / success / warning / info)。省略時は error。
556
581
  * @return 完了時に解決される Promise。
557
582
  */
558
- static addMessage(n, t, o) {
559
- return Xe(n, t, o);
583
+ static addMessage(t, n, o) {
584
+ return et(t, n, o);
560
585
  }
561
586
  /**
562
587
  * 管理対象のメッセージを削除する。
@@ -564,105 +589,105 @@ class ft {
564
589
  * @param parentOrTarget 削除対象の親要素または対象要素。
565
590
  * @return 完了時に解決される Promise。
566
591
  */
567
- static clearMessages(n) {
568
- return Ae(n);
592
+ static clearMessages(t) {
593
+ return Le(t);
569
594
  }
570
595
  }
571
- const mt = "haori-bootstrap:collapse:", R = "data-haori-persist";
596
+ const pt = "haori-bootstrap:collapse:", R = "data-haori-persist";
572
597
  let _ = !1, B, W;
573
- function ye(e) {
574
- return mt + e;
598
+ function He(e) {
599
+ return pt + e;
575
600
  }
576
- function bt(e) {
601
+ function vt(e) {
577
602
  try {
578
- const n = window.sessionStorage.getItem(ye(e));
579
- return n === "shown" || n === "hidden" ? n : void 0;
603
+ const t = window.sessionStorage.getItem(He(e));
604
+ return t === "shown" || t === "hidden" ? t : void 0;
580
605
  } catch {
581
606
  return;
582
607
  }
583
608
  }
584
- function ht(e, n) {
609
+ function Tt(e, t) {
585
610
  try {
586
- window.sessionStorage.setItem(ye(e), n);
611
+ window.sessionStorage.setItem(He(e), t);
587
612
  } catch {
588
613
  }
589
614
  }
590
- function ne(e, n) {
591
- const t = e.id, o = [`[data-bs-toggle="collapse"][data-bs-target="#${t}"]`];
592
- if (t && o.push(`[data-bs-toggle="collapse"][href="#${t}"]`), !t)
615
+ function oe(e, t) {
616
+ const n = e.id, o = [`[data-bs-toggle="collapse"][data-bs-target="#${n}"]`];
617
+ if (n && o.push(`[data-bs-toggle="collapse"][href="#${n}"]`), !n)
593
618
  return;
594
619
  e.ownerDocument.querySelectorAll(o.join(",")).forEach((s) => {
595
- s.setAttribute("aria-expanded", n ? "true" : "false"), s.classList.toggle("collapsed", !n);
620
+ s.setAttribute("aria-expanded", t ? "true" : "false"), s.classList.toggle("collapsed", !t);
596
621
  });
597
622
  }
598
- function oe(e) {
599
- const n = e.getAttribute(R);
600
- if (!n)
601
- return;
602
- const t = bt(n);
623
+ function re(e) {
624
+ const t = e.getAttribute(R);
603
625
  if (!t)
604
626
  return;
627
+ const n = vt(t);
628
+ if (!n)
629
+ return;
605
630
  const o = e.classList.contains("show");
606
- t === "shown" && !o ? (e.classList.add("show"), ne(e, !0)) : t === "hidden" && o && (e.classList.remove("show"), ne(e, !1));
631
+ n === "shown" && !o ? (e.classList.add("show"), oe(e, !0)) : n === "hidden" && o && (e.classList.remove("show"), oe(e, !1));
607
632
  }
608
- function re(e) {
609
- e instanceof HTMLElement && e.hasAttribute(R) && oe(e), e.querySelectorAll(`[${R}]`).forEach(oe);
633
+ function se(e) {
634
+ e instanceof HTMLElement && e.hasAttribute(R) && re(e), e.querySelectorAll(`[${R}]`).forEach(re);
610
635
  }
611
- function Ne(e, n) {
612
- const t = e.target;
613
- if (!(t instanceof HTMLElement))
636
+ function Re(e, t) {
637
+ const n = e.target;
638
+ if (!(n instanceof HTMLElement))
614
639
  return;
615
- const o = t.getAttribute(R);
616
- o && ht(o, n);
640
+ const o = n.getAttribute(R);
641
+ o && Tt(o, t);
617
642
  }
618
- const ke = (e) => Ne(e, "shown"), He = (e) => Ne(e, "hidden");
619
- function Et(e = document) {
643
+ const _e = (e) => Re(e, "shown"), Be = (e) => Re(e, "hidden");
644
+ function At(e = document) {
620
645
  if (_)
621
646
  return;
622
- _ = !0, W = e, e.addEventListener("shown.bs.collapse", ke), e.addEventListener("hidden.bs.collapse", He);
623
- const n = () => {
624
- re(e), B = new MutationObserver((t) => {
625
- for (const o of t)
647
+ _ = !0, W = e, e.addEventListener("shown.bs.collapse", _e), e.addEventListener("hidden.bs.collapse", Be);
648
+ const t = () => {
649
+ se(e), B = new MutationObserver((n) => {
650
+ for (const o of n)
626
651
  o.addedNodes.forEach((r) => {
627
- r instanceof HTMLElement && re(r);
652
+ r instanceof HTMLElement && se(r);
628
653
  });
629
654
  }), e.body && B.observe(e.body, { childList: !0, subtree: !0 });
630
655
  };
631
- e.body ? n() : e.addEventListener("DOMContentLoaded", n, { once: !0 });
656
+ e.body ? t() : e.addEventListener("DOMContentLoaded", t, { once: !0 });
632
657
  }
633
- function pt(e = W ?? document) {
634
- _ && (_ = !1, e.removeEventListener("shown.bs.collapse", ke), e.removeEventListener("hidden.bs.collapse", He), B?.disconnect(), B = void 0, W = void 0);
658
+ function gt(e = W ?? document) {
659
+ _ && (_ = !1, e.removeEventListener("shown.bs.collapse", _e), e.removeEventListener("hidden.bs.collapse", Be), B?.disconnect(), B = void 0, W = void 0);
635
660
  }
636
- const vt = [
661
+ const wt = [
637
662
  {
638
663
  attribute: "dialog-ok-label",
639
- apply: (e, n) => {
640
- e.dialogOkLabel = n;
664
+ apply: (e, t) => {
665
+ e.dialogOkLabel = t;
641
666
  }
642
667
  },
643
668
  {
644
669
  attribute: "dialog-cancel-label",
645
- apply: (e, n) => {
646
- e.dialogCancelLabel = n;
670
+ apply: (e, t) => {
671
+ e.dialogCancelLabel = t;
647
672
  }
648
673
  }
649
- ], gt = typeof document < "u" && document.currentScript instanceof HTMLScriptElement ? document.currentScript : null;
650
- function $(e, n) {
651
- const t = e?.getAttribute(n) ?? null;
652
- if (!(t === null || t.trim() === ""))
653
- return t;
674
+ ], Ct = typeof document < "u" && document.currentScript instanceof HTMLScriptElement ? document.currentScript : null;
675
+ function $(e, t) {
676
+ const n = e?.getAttribute(t) ?? null;
677
+ if (!(n === null || n.trim() === ""))
678
+ return n;
654
679
  }
655
- function Tt(e = typeof document > "u" ? null : document, n = gt) {
656
- const t = {};
657
- for (const { attribute: o, apply: r } of vt) {
658
- const s = $(n, `data-${o}`) ?? $(e?.documentElement ?? null, `data-haori-${o}`) ?? $(e?.body ?? null, `data-haori-${o}`);
659
- s !== void 0 && r(t, s);
680
+ function Lt(e = typeof document > "u" ? null : document, t = Ct) {
681
+ const n = {};
682
+ for (const { attribute: o, apply: r } of wt) {
683
+ const s = $(t, `data-${o}`) ?? $(e?.documentElement ?? null, `data-haori-${o}`) ?? $(e?.body ?? null, `data-haori-${o}`);
684
+ s !== void 0 && r(n, s);
660
685
  }
661
- return t;
686
+ return n;
662
687
  }
663
- const V = {
688
+ const j = {
664
689
  fallbackToNative: !0
665
- }, se = /* @__PURE__ */ new Set([
690
+ }, ie = /* @__PURE__ */ new Set([
666
691
  "dialog",
667
692
  "confirm",
668
693
  "toast",
@@ -672,101 +697,101 @@ const V = {
672
697
  "addMessage",
673
698
  "clearMessages"
674
699
  ]);
675
- function At(e) {
676
- const n = ft;
700
+ function St(e) {
701
+ const t = Et;
677
702
  return new Proxy(e, {
678
- get(t, o, r) {
679
- return typeof o == "string" && se.has(o) ? n[o] : Reflect.get(t, o, r);
703
+ get(n, o, r) {
704
+ return typeof o == "string" && ie.has(o) ? t[o] : Reflect.get(n, o, r);
680
705
  },
681
- has(t, o) {
682
- return typeof o == "string" && se.has(o) ? !0 : Reflect.has(t, o);
706
+ has(n, o) {
707
+ return typeof o == "string" && ie.has(o) ? !0 : Reflect.has(n, o);
683
708
  }
684
709
  });
685
710
  }
686
711
  const i = {
687
712
  installed: !1,
688
- options: V
713
+ options: j
689
714
  };
690
- function j() {
715
+ function J() {
691
716
  return globalThis.window;
692
717
  }
693
- function wt(e, n) {
694
- const t = Tt();
718
+ function Mt(e, t) {
719
+ const n = Lt();
695
720
  return {
696
- bootstrap: e.bootstrap ?? n?.bootstrap,
697
- fallbackToNative: e.fallbackToNative ?? V.fallbackToNative,
698
- runtime: e.runtime ?? i.options.runtime ?? n?.Haori?.runtime,
721
+ bootstrap: e.bootstrap ?? t?.bootstrap,
722
+ fallbackToNative: e.fallbackToNative ?? j.fallbackToNative,
723
+ runtime: e.runtime ?? i.options.runtime ?? t?.Haori?.runtime,
699
724
  toastContainerSelector: e.toastContainerSelector ?? i.options.toastContainerSelector,
700
725
  dialogContainerSelector: e.dialogContainerSelector ?? i.options.dialogContainerSelector,
701
726
  dialogTitle: e.dialogTitle ?? i.options.dialogTitle,
702
- dialogOkLabel: e.dialogOkLabel ?? i.options.dialogOkLabel ?? t.dialogOkLabel,
703
- dialogCancelLabel: e.dialogCancelLabel ?? i.options.dialogCancelLabel ?? t.dialogCancelLabel,
727
+ dialogOkLabel: e.dialogOkLabel ?? i.options.dialogOkLabel ?? n.dialogOkLabel,
728
+ dialogCancelLabel: e.dialogCancelLabel ?? i.options.dialogCancelLabel ?? n.dialogCancelLabel,
704
729
  toastPosition: e.toastPosition ?? i.options.toastPosition,
705
730
  toastDelay: e.toastDelay ?? i.options.toastDelay
706
731
  };
707
732
  }
708
- function Ct(e = j()) {
733
+ function It(e = J()) {
709
734
  return !!(e?.Haori && e.bootstrap);
710
735
  }
711
- function Lt(e = {}) {
712
- const n = j();
713
- if (!n?.Haori)
736
+ function yt(e = {}) {
737
+ const t = J();
738
+ if (!t?.Haori)
714
739
  throw new Error("window.Haori is required before calling install().");
715
- if (i.originalHaori || (i.originalHaori = n.Haori, i.originalRuntime = n.Haori.runtime), i.options = wt(e, n), i.options.runtime) {
716
- const t = i.originalHaori ?? n.Haori;
717
- typeof t.setRuntime == "function" ? t.setRuntime(i.options.runtime) : console.warn(
740
+ if (i.originalHaori || (i.originalHaori = t.Haori, i.originalRuntime = t.Haori.runtime), i.options = Mt(e, t), i.options.runtime) {
741
+ const n = i.originalHaori ?? t.Haori;
742
+ typeof n.setRuntime == "function" ? n.setRuntime(i.options.runtime) : console.warn(
718
743
  "[haori-bootstrap] Haori.setRuntime が利用できません。runtime 設定は無視されます。"
719
744
  );
720
745
  }
721
- ut({
746
+ ht({
722
747
  originalHaori: i.originalHaori,
723
748
  options: i.options
724
- }), n.Haori = At(i.originalHaori), Et(), Ye(), i.installed = !0;
749
+ }), t.Haori = St(i.originalHaori), At(), nt(), i.installed = !0;
725
750
  }
726
- function Nt() {
727
- const e = j();
751
+ function _t() {
752
+ const e = J();
728
753
  if (!e || !i.originalHaori)
729
754
  return;
730
- const n = i.originalHaori;
731
- typeof n.setRuntime == "function" ? n.setRuntime(i.originalRuntime) : n.runtime = i.originalRuntime, e.Haori = i.originalHaori, pt(), Ze(), i.installed = !1, i.originalHaori = void 0, i.originalRuntime = void 0, i.options = V;
755
+ const t = i.originalHaori;
756
+ typeof t.setRuntime == "function" ? t.setRuntime(i.originalRuntime) : t.runtime = i.originalRuntime, e.Haori = i.originalHaori, gt(), ot(), i.installed = !1, i.originalHaori = void 0, i.originalRuntime = void 0, i.options = j;
732
757
  }
733
- function kt() {
758
+ function Bt() {
734
759
  return i.installed;
735
760
  }
736
- const Re = "__haoriJsBootstrapAutoEnabled__";
737
- function St() {
761
+ const De = "__haoriJsBootstrapAutoEnabled__";
762
+ function Nt() {
738
763
  return globalThis.window;
739
764
  }
740
- function Mt(e) {
741
- return !!e[Re];
765
+ function kt(e) {
766
+ return !!e[De];
742
767
  }
743
- function It(e) {
744
- e[Re] = !0;
768
+ function Ht(e) {
769
+ e[De] = !0;
745
770
  }
746
- function yt() {
747
- const e = St();
748
- if (!(!e || Mt(e))) {
749
- if (!Ct(e)) {
771
+ function Rt() {
772
+ const e = Nt();
773
+ if (!(!e || kt(e))) {
774
+ if (!It(e)) {
750
775
  console.warn(
751
776
  "[haori-bootstrap] Auto-enable skipped because window.Haori or window.bootstrap is missing."
752
777
  );
753
778
  return;
754
779
  }
755
780
  try {
756
- Lt({ bootstrap: e.bootstrap }), It(e);
757
- } catch (n) {
758
- console.warn("[haori-bootstrap] Auto-enable failed.", n);
781
+ yt({ bootstrap: e.bootstrap }), Ht(e);
782
+ } catch (t) {
783
+ console.warn("[haori-bootstrap] Auto-enable failed.", t);
759
784
  }
760
785
  }
761
786
  }
762
- yt();
763
- const Ht = "0.5.55";
787
+ Rt();
788
+ const Dt = "0.5.57";
764
789
  export {
765
- ft as BootstrapHaori,
766
- Ct as hasAutoEnablePrerequisites,
767
- Lt as install,
768
- kt as isInstalled,
769
- Nt as uninstall,
770
- Ht as version
790
+ Et as BootstrapHaori,
791
+ It as hasAutoEnablePrerequisites,
792
+ yt as install,
793
+ Bt as isInstalled,
794
+ _t as uninstall,
795
+ Dt as version
771
796
  };
772
797
  //# sourceMappingURL=haori-bootstrap.js.map