stimulus_plumbers 0.4.14 → 0.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +3 -1
  4. data/app/assets/javascripts/stimulus-plumbers/controllers.manifest.json +63 -1
  5. data/app/assets/javascripts/stimulus-plumbers/index.es.js +345 -198
  6. data/app/assets/javascripts/stimulus-plumbers/index.es.js.map +1 -1
  7. data/app/assets/javascripts/stimulus-plumbers/index.umd.js +1 -1
  8. data/app/assets/javascripts/stimulus-plumbers/index.umd.js.map +1 -1
  9. data/config/locales/en.yml +12 -0
  10. data/docs/component/combobox.md +3 -2
  11. data/docs/component/form.md +85 -18
  12. data/docs/component/indicator.md +1 -1
  13. data/docs/component/plumber.md +40 -1
  14. data/docs/component/progress.md +51 -16
  15. data/docs/guide.md +63 -4
  16. data/lib/stimulus_plumbers/components/card/slots.rb +0 -2
  17. data/lib/stimulus_plumbers/components/combobox/{builder.rb → config.rb} +7 -11
  18. data/lib/stimulus_plumbers/components/combobox.rb +12 -12
  19. data/lib/stimulus_plumbers/components/password_strength.rb +103 -0
  20. data/lib/stimulus_plumbers/components/progress/shared.rb +74 -0
  21. data/lib/stimulus_plumbers/components/progress_bar.rb +127 -25
  22. data/lib/stimulus_plumbers/components/progress_meter.rb +16 -14
  23. data/lib/stimulus_plumbers/components/progress_ring.rb +9 -23
  24. data/lib/stimulus_plumbers/components/timeline/event/slots.rb +0 -1
  25. data/lib/stimulus_plumbers/form/builder.rb +35 -8
  26. data/lib/stimulus_plumbers/form/field.rb +34 -6
  27. data/lib/stimulus_plumbers/form/fields/inputs/password/revealable.rb +72 -0
  28. data/lib/stimulus_plumbers/form/fields/inputs/password/strength.rb +31 -0
  29. data/lib/stimulus_plumbers/form/fields/inputs/password.rb +34 -65
  30. data/lib/stimulus_plumbers/form/fields/inputs/progress.rb +30 -0
  31. data/lib/stimulus_plumbers/form/fields/inputs/range.rb +81 -0
  32. data/lib/stimulus_plumbers/form/fields/inputs/text.rb +1 -1
  33. data/lib/stimulus_plumbers/form/fields/renderer.rb +41 -0
  34. data/lib/stimulus_plumbers/helpers/progress_helper.rb +14 -4
  35. data/lib/stimulus_plumbers/password/requirements.rb +182 -0
  36. data/lib/stimulus_plumbers/password_strength_validator.rb +29 -0
  37. data/lib/stimulus_plumbers/plumber/config.rb +37 -0
  38. data/lib/stimulus_plumbers/plumber/dispatcher/callable_inspector.rb +4 -0
  39. data/lib/stimulus_plumbers/plumber/slots.rb +2 -2
  40. data/lib/stimulus_plumbers/themes/schema/progress/ranges.rb +13 -0
  41. data/lib/stimulus_plumbers/themes/schema.rb +23 -4
  42. data/lib/stimulus_plumbers/version.rb +1 -1
  43. data/lib/stimulus_plumbers.rb +7 -1
  44. data/vendor/ARIA.md +10 -0
  45. data/vendor/component/manifest.json +16 -2
  46. data/vendor/controller/docs/password-strength.md +38 -0
  47. data/vendor/controller/docs/progress.md +100 -23
  48. data/vendor/controller/guide.md +61 -7
  49. data/vendor/controller/manifest.json +63 -1
  50. metadata +13 -2
@@ -20,7 +20,7 @@ function r(e) {
20
20
  }
21
21
  function i(e) {
22
22
  let t = n(e);
23
- return t.length > 0 ? (t[0].focus(), !0) : !1;
23
+ return t.length > 0 && (t[0].focus(), !0);
24
24
  }
25
25
  var a = class {
26
26
  constructor(e, t = {}) {
@@ -125,9 +125,7 @@ var u = {
125
125
  case "Home":
126
126
  a = 0;
127
127
  break;
128
- case "End":
129
- a = this.items.length - 1;
130
- break;
128
+ case "End": a = this.items.length - 1;
131
129
  }
132
130
  this.setCurrentIndex(a);
133
131
  }
@@ -178,9 +176,7 @@ var u = {
178
176
  r.length && this._selectItem(r[r.length - 1]);
179
177
  break;
180
178
  case "Enter":
181
- case " ":
182
- this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)?.click();
183
- break;
179
+ case " ": this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)?.click();
184
180
  }
185
181
  }
186
182
  }, p = (e, t, n) => {
@@ -195,49 +191,49 @@ function m(e, t = {}) {
195
191
  }
196
192
  var h = (e = "a11y") => `${e}-${Math.random().toString(36).substr(2, 9)}`, ee = (e, t = "element") => e.id ||= h(t), g = (e, t, n) => {
197
193
  e.setAttribute(t, n.toString());
198
- }, _ = (e, t) => g(e, "aria-expanded", t), te = (e) => e.getAttribute("aria-expanded") === "true", ne = (e, t) => g(e, "aria-pressed", t), re = (e, t) => g(e, "aria-checked", t), v = (e, t) => g(e, "aria-selected", t), y = (e, t) => t ? e.setAttribute("aria-current", t) : e.removeAttribute("aria-current"), b = (e, t) => t ? e.setAttribute("hidden", "") : e.removeAttribute("hidden"), x = (e, t) => g(e, "aria-hidden", t), S = (e, t) => g(e, "aria-disabled", t), C = (e) => e.getAttribute("aria-disabled") === "true";
199
- function w(e, t) {
194
+ }, _ = (e, t) => g(e, "aria-expanded", t), te = (e) => e.getAttribute("aria-expanded") === "true", ne = (e, t) => g(e, "aria-pressed", t), re = (e, t) => g(e, "aria-checked", t), v = (e, t) => g(e, "aria-selected", t), y = (e, t) => t ? e.setAttribute("aria-current", t) : e.removeAttribute("aria-current"), b = (e, t) => t ? e.setAttribute("hidden", "") : e.removeAttribute("hidden"), x = (e, t) => g(e, "aria-hidden", t), S = (e, t) => g(e, "aria-disabled", t), ie = (e) => e.getAttribute("aria-disabled") === "true";
195
+ function ae(e, t) {
200
196
  g(e, "aria-disabled", t), t ? e.setAttribute("tabindex", "-1") : e.removeAttribute("tabindex");
201
197
  }
202
- var T = (e, t) => g(e, "aria-valuemin", t), E = (e, t) => g(e, "aria-valuemax", t), D = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t), ie = {
198
+ var oe = (e, t) => g(e, "aria-valuemin", t), se = (e, t) => g(e, "aria-valuemax", t), ce = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t), C = (e, t) => t == null ? e.removeAttribute("aria-valuetext") : g(e, "aria-valuetext", t), le = {
203
199
  menu: "menu",
204
200
  listbox: "listbox",
205
201
  tree: "tree",
206
202
  grid: "grid",
207
203
  dialog: "dialog"
208
- }, ae = (e, t, n) => {
204
+ }, w = (e, t, n) => {
209
205
  Object.entries(t).forEach(([t, r]) => {
210
206
  e.setAttribute(t, r), n[t] = r;
211
207
  });
212
- }, O = (e, t, n) => n || !e.hasAttribute(t);
213
- function oe({ trigger: e, target: t, role: n = null, override: r = !1 }) {
208
+ }, T = (e, t, n) => n || !e.hasAttribute(t);
209
+ function E({ trigger: e, target: t, role: n = null, override: r = !1 }) {
214
210
  let i = {
215
211
  trigger: {},
216
212
  target: {}
217
213
  };
218
214
  if (!e || !t) return i;
219
215
  let a = {}, o = {};
220
- if (n && O(t, "role", r) && (o.role = n), t.id && (O(e, "aria-controls", r) && (a["aria-controls"] = t.id), n === "tooltip" && O(e, "aria-describedby", r) && (a["aria-describedby"] = t.id)), n && O(e, "aria-haspopup", r)) {
221
- let e = ie[n] || "true";
216
+ if (n && T(t, "role", r) && (o.role = n), t.id && (T(e, "aria-controls", r) && (a["aria-controls"] = t.id), n === "tooltip" && T(e, "aria-describedby", r) && (a["aria-describedby"] = t.id)), n && T(e, "aria-haspopup", r)) {
217
+ let e = le[n] || "true";
222
218
  e && (a["aria-haspopup"] = e);
223
219
  }
224
- return ae(t, o, i.target), ae(e, a, i.trigger), i;
220
+ return w(t, o, i.target), w(e, a, i.trigger), i;
225
221
  }
226
- var se = (e, t) => {
222
+ var D = (e, t) => {
227
223
  t.forEach((t) => {
228
224
  e.hasAttribute(t) && e.removeAttribute(t);
229
225
  });
230
226
  };
231
- function ce({ trigger: e, target: t, attributes: n = null }) {
232
- !e || !t || (se(e, n || [
227
+ function ue({ trigger: e, target: t, attributes: n = null }) {
228
+ !e || !t || (D(e, n || [
233
229
  "aria-controls",
234
230
  "aria-haspopup",
235
231
  "aria-describedby"
236
- ]), (!n || n.includes("role")) && se(t, ["role"]));
232
+ ]), (!n || n.includes("role")) && D(t, ["role"]));
237
233
  }
238
234
  //#endregion
239
235
  //#region src/requestor.js
240
- var k = class {
236
+ var O = class {
241
237
  constructor() {
242
238
  this._abortController = null, this._timer = null;
243
239
  }
@@ -259,33 +255,33 @@ var k = class {
259
255
  };
260
256
  //#endregion
261
257
  //#region src/researcher.js
262
- function le(e, t) {
258
+ function de(e, t) {
263
259
  let n = 0;
264
260
  for (let r = 0; r < t.length && n < e.length; r++) t[r] === e[n] && n++;
265
261
  return n === e.length;
266
262
  }
267
- function ue(e, t) {
263
+ function fe(e, t) {
268
264
  return t.includes(e);
269
265
  }
270
- function de(e, t) {
266
+ function pe(e, t) {
271
267
  return t.startsWith(e);
272
268
  }
273
- function fe(e) {
274
- return e === "contains" ? ue : e === "prefix" ? de : le;
269
+ function me(e) {
270
+ return e === "contains" ? fe : e === "prefix" ? pe : de;
275
271
  }
276
- function pe(e, t) {
272
+ function he(e, t) {
277
273
  return t === "textContent" ? e.textContent?.trim().toLowerCase() ?? "" : (e.getAttribute(t) ?? "").toLowerCase();
278
274
  }
279
- function me(e, t, n = {}) {
280
- let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i : fe(r), s = t.toLowerCase(), c = 0;
275
+ function ge(e, t, n = {}) {
276
+ let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i : me(r), s = t.toLowerCase(), c = 0;
281
277
  return e.querySelectorAll("[role=\"option\"]").forEach((e) => {
282
- let t = a.some((t) => o(s, pe(e, t)));
278
+ let t = a.some((t) => o(s, he(e, t)));
283
279
  b(e, !t), t && c++;
284
280
  }), c;
285
281
  }
286
282
  //#endregion
287
283
  //#region src/plumbers/plumber/geometry.js
288
- var A = {
284
+ var _e = {
289
285
  get top() {
290
286
  return "bottom";
291
287
  },
@@ -299,7 +295,7 @@ var A = {
299
295
  return "left";
300
296
  }
301
297
  };
302
- function j({ x: e, y: t, width: n, height: r }) {
298
+ function k({ x: e, y: t, width: n, height: r }) {
303
299
  return {
304
300
  x: e,
305
301
  y: t,
@@ -311,42 +307,42 @@ function j({ x: e, y: t, width: n, height: r }) {
311
307
  bottom: t + r
312
308
  };
313
309
  }
314
- function he(e, t = "vertical") {
310
+ function ve(e, t = "vertical") {
315
311
  return t === "horizontal" ? e.left + e.width / 2 : e.top + e.height / 2;
316
312
  }
317
- function M() {
318
- return j({
313
+ function A() {
314
+ return k({
319
315
  x: 0,
320
316
  y: 0,
321
317
  width: window.innerWidth || document.documentElement.clientWidth,
322
318
  height: window.innerHeight || document.documentElement.clientHeight
323
319
  });
324
320
  }
325
- function ge(e) {
321
+ function ye(e) {
326
322
  if (!(e instanceof HTMLElement)) return !1;
327
- let t = M(), n = e.getBoundingClientRect(), r = n.top <= t.height && n.top + n.height > 0, i = n.left <= t.width && n.left + n.width > 0;
323
+ let t = A(), n = e.getBoundingClientRect(), r = n.top <= t.height && n.top + n.height > 0, i = n.left <= t.width && n.left + n.width > 0;
328
324
  return r && i;
329
325
  }
330
326
  //#endregion
331
327
  //#region src/plumbers/plumber/config.js
332
- var N = {
328
+ var j = {
333
329
  get visibleOnly() {
334
330
  return !0;
335
331
  },
336
332
  hiddenClass: null
337
- }, _e = {
333
+ }, be = {
338
334
  element: null,
339
335
  visible: null,
340
336
  dispatch: !0,
341
337
  prefix: ""
342
- }, P = class {
338
+ }, M = class {
343
339
  constructor(e, t = {}) {
344
340
  this.controller = e;
345
- let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({}, _e, t);
346
- this.element = n || e.element, this.visibleOnly = typeof r == "boolean" ? r : N.visibleOnly, this.visibleCallback = typeof r == "string" ? r : null, this.notify = !!i, this.prefix = typeof a == "string" && a ? a : e.identifier;
341
+ let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({}, be, t);
342
+ this.element = n || e.element, this.visibleOnly = typeof r == "boolean" ? r : j.visibleOnly, this.visibleCallback = typeof r == "string" ? r : null, this.notify = !!i, this.prefix = typeof a == "string" && a ? a : e.identifier;
347
343
  }
348
344
  get visible() {
349
- return this.element instanceof HTMLElement ? !this.visibleOnly || ge(this.element) && this.isVisible(this.element) : !1;
345
+ return this.element instanceof HTMLElement ? !this.visibleOnly || ye(this.element) && this.isVisible(this.element) : !1;
350
346
  }
351
347
  isVisible(e) {
352
348
  if (this.visibleCallback) {
@@ -375,7 +371,7 @@ var N = {
375
371
  return n instanceof Promise ? await n : n;
376
372
  }
377
373
  }
378
- }, ve = {
374
+ }, xe = {
379
375
  normalize(e) {
380
376
  return typeof e == "string" ? e : "";
381
377
  },
@@ -385,7 +381,7 @@ var N = {
385
381
  };
386
382
  //#endregion
387
383
  //#region src/plumbers/formatters/credit_card.js
388
- function ye(e) {
384
+ function Se(e) {
389
385
  let t = 0, n = !1;
390
386
  for (let r = e.length - 1; r >= 0; r--) {
391
387
  let i = parseInt(e[r], 10);
@@ -393,15 +389,15 @@ function ye(e) {
393
389
  }
394
390
  return t % 10 == 0;
395
391
  }
396
- var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
392
+ var Ce = /\D/g, we = /^\d{13,19}$/, Te = /(.{4})(?=.)/g, Ee = {
397
393
  normalize(e) {
398
- return typeof e == "string" ? e.replace(be, "") : "";
394
+ return typeof e == "string" ? e.replace(Ce, "") : "";
399
395
  },
400
396
  validate(e) {
401
- return typeof e != "string" || !xe.test(e) ? !1 : ye(e);
397
+ return typeof e != "string" || !we.test(e) ? !1 : Se(e);
402
398
  },
403
399
  format(e) {
404
- return typeof e == "string" ? e.replace(Se, "$1 ") : "";
400
+ return typeof e == "string" ? e.replace(Te, "$1 ") : "";
405
401
  },
406
402
  cells() {
407
403
  return {
@@ -414,22 +410,22 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
414
410
  length: 0
415
411
  };
416
412
  }
417
- }, F = { 1: 10 }, I = /\D/g, we = /^\+\d{7,15}$/, Te = {
413
+ }, N = { 1: 10 }, P = /\D/g, De = /^\+\d{7,15}$/, Oe = {
418
414
  normalize(e) {
419
415
  if (typeof e != "string") return "";
420
- let t = e.trimStart().startsWith("+"), n = e.replace(I, "");
416
+ let t = e.trimStart().startsWith("+"), n = e.replace(P, "");
421
417
  return t ? `+${n}` : n;
422
418
  },
423
419
  validate(e) {
424
420
  if (typeof e != "string") return !1;
425
- if (we.test(e)) return !0;
426
- let t = e.replace(I, "");
427
- return Object.values(F).includes(t.length);
421
+ if (De.test(e)) return !0;
422
+ let t = e.replace(P, "");
423
+ return Object.values(N).includes(t.length);
428
424
  },
429
425
  format(e) {
430
426
  if (typeof e != "string") return "";
431
- let t = e.replace(I, "");
432
- for (let [e, n] of Object.entries(F)) {
427
+ let t = e.replace(P, "");
428
+ for (let [e, n] of Object.entries(N)) {
433
429
  if (t.length === n) return `(${t.slice(0, 3)}) ${t.slice(3, 6)}-${t.slice(6)}`;
434
430
  let r = n + e.length;
435
431
  if (t.length === r && t.startsWith(e)) {
@@ -439,16 +435,16 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
439
435
  }
440
436
  return e;
441
437
  }
442
- }, Ee = /[^\d.,-]/g, De = /^-?\d+(\.\d+)?$/, Oe = {
438
+ }, ke = /[^\d.,-]/g, Ae = /^-?\d+(\.\d+)?$/, je = {
443
439
  normalize(e) {
444
440
  if (typeof e != "string") return "";
445
- let t = e.replace(Ee, "");
441
+ let t = e.replace(ke, "");
446
442
  if (!t) return "";
447
443
  let n = t.lastIndexOf(","), r = t.lastIndexOf(".");
448
444
  return n > -1 && r > -1 ? n > r ? t.replace(/\./g, "").replace(",", ".") : t.replace(/,/g, "") : n > -1 ? t.slice(n + 1).length <= 2 ? t.replace(",", ".") : t.replace(/,/g, "") : t;
449
445
  },
450
446
  validate(e) {
451
- return typeof e == "string" && De.test(e);
447
+ return typeof e == "string" && Ae.test(e);
452
448
  },
453
449
  format(e, t = {}) {
454
450
  if (typeof e != "string") return "";
@@ -468,18 +464,18 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
468
464
  return e;
469
465
  }
470
466
  }
471
- }, L = /^\d{4}-\d{2}-\d{2}$/, ke = /^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/, Ae = /\D/g, R = {
467
+ }, F = /^\d{4}-\d{2}-\d{2}$/, Me = /^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/, Ne = /\D/g, I = {
472
468
  normalize(e) {
473
469
  if (typeof e != "string") return "";
474
470
  let t = e.trim();
475
- if (L.test(t)) return t;
476
- let n = t.match(ke);
471
+ if (F.test(t)) return t;
472
+ let n = t.match(Me);
477
473
  if (n) {
478
474
  let [, e, t, r] = n;
479
475
  if (e.length === 4) return `${e}-${t.padStart(2, "0")}-${r.padStart(2, "0")}`;
480
476
  if (r.length === 4) return `${r}-${e.padStart(2, "0")}-${t.padStart(2, "0")}`;
481
477
  }
482
- let r = t.replace(Ae, "");
478
+ let r = t.replace(Ne, "");
483
479
  if (r.length === 8) {
484
480
  let e = parseInt(r.slice(0, 4), 10);
485
481
  return e >= 1e3 && e <= 9999 ? `${r.slice(0, 4)}-${r.slice(4, 6)}-${r.slice(6, 8)}` : `${r.slice(4, 8)}-${r.slice(0, 2)}-${r.slice(2, 4)}`;
@@ -488,8 +484,8 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
488
484
  },
489
485
  validate(e) {
490
486
  if (typeof e != "string") return !1;
491
- let t = R.normalize(e);
492
- if (!L.test(t)) return !1;
487
+ let t = I.normalize(e);
488
+ if (!F.test(t)) return !1;
493
489
  let n = /* @__PURE__ */ new Date(`${t}T00:00:00Z`);
494
490
  return !isNaN(n.getTime()) && n.toISOString().startsWith(t);
495
491
  },
@@ -509,11 +505,11 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
509
505
  return e;
510
506
  }
511
507
  }
512
- }, je = /^([01]?\d|2[0-3]):([0-5]\d)$/, z = {
508
+ }, Pe = /^([01]?\d|2[0-3]):([0-5]\d)$/, L = {
513
509
  normalize(e) {
514
510
  if (typeof e != "string") return "";
515
511
  let t = e.trim();
516
- if (je.test(t)) {
512
+ if (Pe.test(t)) {
517
513
  let [e, n] = t.split(":");
518
514
  return `${String(parseInt(e, 10)).padStart(2, "0")}:${n}`;
519
515
  }
@@ -525,7 +521,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
525
521
  return "";
526
522
  },
527
523
  validate(e) {
528
- return z.normalize(e) !== "";
524
+ return L.normalize(e) !== "";
529
525
  },
530
526
  format(e, t = {}) {
531
527
  if (typeof e != "string") return "";
@@ -536,14 +532,14 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
536
532
  let a = r < 12 ? "AM" : "PM";
537
533
  return `${r % 12 || 12}:${i} ${a}`;
538
534
  }
539
- }, B = {
535
+ }, R = {
540
536
  digits: /[^0-9]/g,
541
537
  letters: /[^a-zA-Z]/g,
542
538
  alphanumeric: /[^0-9a-zA-Z]/g
543
- }, Me = {
539
+ }, Fe = {
544
540
  normalize(e, t = {}) {
545
541
  if (typeof e != "string") return "";
546
- let n = B[t.charset] ?? B.alphanumeric, r = e.replace(n, "").toUpperCase(), i = t.length ?? 0;
542
+ let n = R[t.charset] ?? R.alphanumeric, r = e.replace(n, "").toUpperCase(), i = t.length ?? 0;
547
543
  return i > 0 ? r.slice(0, i) : r;
548
544
  },
549
545
  validate(e, t = {}) {
@@ -560,7 +556,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
560
556
  length: e.length ?? 0
561
557
  };
562
558
  }
563
- }, V = {
559
+ }, z = {
564
560
  PLAIN: "plain",
565
561
  CREDIT_CARD: "creditCard",
566
562
  PHONE: "phone",
@@ -568,26 +564,26 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
568
564
  DATE: "date",
569
565
  TIME: "time",
570
566
  CODE: "code"
571
- }, H = /* @__PURE__ */ new Map([
572
- [V.PLAIN, ve],
573
- [V.CREDIT_CARD, Ce],
574
- [V.PHONE, Te],
575
- [V.CURRENCY, Oe],
576
- [V.DATE, R],
577
- [V.TIME, z],
578
- [V.CODE, Me]
579
- ]), Ne = {
580
- type: V.PLAIN,
567
+ }, B = /* @__PURE__ */ new Map([
568
+ [z.PLAIN, xe],
569
+ [z.CREDIT_CARD, Ee],
570
+ [z.PHONE, Oe],
571
+ [z.CURRENCY, je],
572
+ [z.DATE, I],
573
+ [z.TIME, L],
574
+ [z.CODE, Fe]
575
+ ]), Ie = {
576
+ type: z.PLAIN,
581
577
  options: {}
582
- }, Pe = class extends P {
578
+ }, Le = class extends M {
583
579
  static register(e, t) {
584
- H.set(e, t);
580
+ B.set(e, t);
585
581
  }
586
582
  constructor(e, t = {}) {
587
- super(e, t), this.type = t.type ?? Ne.type, this.options = t.options ?? Ne.options, this.enhance();
583
+ super(e, t), this.type = t.type ?? Ie.type, this.options = t.options ?? Ie.options, this.enhance();
588
584
  }
589
585
  enhance() {
590
- let e = this, t = H.get(e.type) ?? H.get(V.PLAIN), n = {
586
+ let e = this, t = B.get(e.type) ?? B.get(z.PLAIN), n = {
591
587
  normalize: (n) => t.normalize?.(n, e.options) ?? (typeof n == "string" ? n : ""),
592
588
  validate: (n) => t.validate?.(n, e.options) ?? !0,
593
589
  format: (n) => t.format?.(n, e.options) ?? (typeof n == "string" ? n : ""),
@@ -600,16 +596,16 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
600
596
  configurable: !0
601
597
  });
602
598
  }
603
- }, U = (e, t) => new Pe(e, t), Fe = {
599
+ }, V = (e, t) => new Le(e, t), Re = {
604
600
  groups: [],
605
601
  length: 0
606
- }, W = (e) => {
602
+ }, ze = (e) => {
607
603
  let t = [], n = 0;
608
604
  for (let r of e) n += r, t.push(n);
609
605
  return t;
610
- }, Ie = class extends P {
606
+ }, Be = class extends M {
611
607
  constructor(e, t = {}) {
612
- super(e, t), this.groups = Array.isArray(t.groups) ? t.groups : Fe.groups, this.length = t.length ?? Fe.length, this.adopt(), this.enhance();
608
+ super(e, t), this.groups = Array.isArray(t.groups) ? t.groups : Re.groups, this.length = t.length ?? Re.length, this.adopt(), this.enhance();
613
609
  }
614
610
  get cells() {
615
611
  return this.controller.cellTargets ?? [];
@@ -628,7 +624,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
628
624
  adopt() {
629
625
  let e = this.expected();
630
626
  this.cells.length < e && console.warn(`[CharacterCells] expected ${e} cells, found ${this.cells.length}`);
631
- let t = W(this.groups);
627
+ let t = ze(this.groups);
632
628
  if (this.grouped) {
633
629
  this.cells.forEach((n, r) => {
634
630
  x(n, !0);
@@ -661,7 +657,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
661
657
  draw(e = "", { focused: t = !1 } = {}) {
662
658
  let n = typeof e == "string" ? e : "";
663
659
  if (this.grouped) {
664
- let e = W(this.groups);
660
+ let e = ze(this.groups);
665
661
  this.cells.forEach((r, i) => {
666
662
  let a = i === 0 ? 0 : e[i - 1], o = e[i];
667
663
  if (a >= this.expected()) {
@@ -682,7 +678,40 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
682
678
  e.textContent = r[n] ?? "", e.toggleAttribute("data-filled", r[n] != null), e.toggleAttribute("data-caret", t && n === r.length);
683
679
  });
684
680
  }
685
- }, Le = (e, t) => new Ie(e, t), Re = /^\d{4}-\d{2}-\d{2}$/;
681
+ }, Ve = (e, t) => new Be(e, t), H = { RULES: "rules" }, U = {
682
+ WEAK: "weak",
683
+ FINE: "fine",
684
+ STRONG: "strong"
685
+ }, He = { low: 34 }, Ue = (e, t) => {
686
+ let n = t.match(new RegExp(e, "g"));
687
+ return n ? n.length : 0;
688
+ }, We = (e, t) => {
689
+ let n = e.pattern == null ? t.length : Ue(e.pattern, t), r = e.min ?? 0, i = e.max ?? Infinity;
690
+ return n >= r && n <= i;
691
+ }, Ge = (e, t, n) => t > 0 && e === t ? U.STRONG : (t === 0 ? 0 : Math.round(e / t * 100)) < (n.low ?? He.low) ? U.WEAK : U.FINE, W = /* @__PURE__ */ new Map([[H.RULES, { score(e, t = [], n = {}) {
692
+ let r = typeof e == "string" ? e : "", i = t.reduce((e, t) => (e[t.key] = We(t, r), e), {}), a = t.filter((e) => i[e.key]).length;
693
+ return {
694
+ value: t.length === 0 ? 0 : Math.round(a / t.length * 100),
695
+ level: Ge(a, t.length, n),
696
+ rules: i
697
+ };
698
+ } }]]), Ke = class extends M {
699
+ static register(e, t) {
700
+ W.set(e, t);
701
+ }
702
+ constructor(e, t = {}) {
703
+ super(e, t), this.type = t.type ?? H.RULES, this.enhance();
704
+ }
705
+ enhance() {
706
+ let e = W.get(this.type) ?? W.get(H.RULES), t = { score: (t, n, r) => e.score(t, n ?? [], r ?? {}) };
707
+ Object.defineProperty(this.controller, "strength", {
708
+ get() {
709
+ return t;
710
+ },
711
+ configurable: !0
712
+ });
713
+ }
714
+ }, qe = (e, t) => new Ke(e, t), Je = /^\d{4}-\d{2}-\d{2}$/;
686
715
  function G(e) {
687
716
  return e instanceof Date && !isNaN(e);
688
717
  }
@@ -691,7 +720,7 @@ function K(...e) {
691
720
  if (e.length === 1) {
692
721
  let t = e[0];
693
722
  if (!t) return;
694
- if (typeof t == "string" && Re.test(t)) {
723
+ if (typeof t == "string" && Je.test(t)) {
695
724
  let [e, n, r] = t.split("-").map(Number), i = new Date(e, n - 1, r);
696
725
  if (G(i)) return i;
697
726
  } else {
@@ -705,7 +734,7 @@ function K(...e) {
705
734
  }
706
735
  //#endregion
707
736
  //#region src/plumbers/calendar.js
708
- var ze = 7, Be = 12, q = 10, Ve = {
737
+ var Ye = 7, Xe = 12, q = 10, Ze = {
709
738
  locales: ["default"],
710
739
  today: "",
711
740
  day: null,
@@ -720,15 +749,15 @@ var ze = 7, Be = 12, q = 10, Ve = {
720
749
  disabledYears: [],
721
750
  firstDayOfWeek: 0,
722
751
  onNavigated: "navigated"
723
- }, He = class extends P {
752
+ }, Qe = class extends M {
724
753
  constructor(e, t = {}) {
725
754
  super(e, t);
726
- let n = Object.assign({}, Ve, t), { onNavigated: r, since: i, till: a, firstDayOfWeek: o } = n;
727
- this.onNavigated = r, this.since = K(i), this.till = K(a), this.firstDayOfWeek = 0 <= o && o < 7 ? o : Ve.firstDayOfWeek;
755
+ let n = Object.assign({}, Ze, t), { onNavigated: r, since: i, till: a, firstDayOfWeek: o } = n;
756
+ this.onNavigated = r, this.since = K(i), this.till = K(a), this.firstDayOfWeek = 0 <= o && o < 7 ? o : Ze.firstDayOfWeek;
728
757
  let { disabledDates: s, disabledWeekdays: c, disabledDays: l, disabledMonths: u, disabledYears: d } = n;
729
758
  this.disabledDates = Array.isArray(s) ? s : [], this.disabledWeekdays = Array.isArray(c) ? c : [], this.disabledDays = Array.isArray(l) ? l : [], this.disabledMonths = Array.isArray(u) ? u : [], this.disabledYears = Array.isArray(d) ? d : [];
730
759
  let { today: f, day: p, month: m, year: h } = n;
731
- this.now = K(f) || /* @__PURE__ */ new Date(), typeof h == "number" && typeof m == "number" && typeof p == "number" ? this.current = K(h, m, p) : this.current = this.now, this.build(), this.enhance();
760
+ this.now = K(f) || /* @__PURE__ */ new Date(), this.current = typeof h == "number" && typeof m == "number" && typeof p == "number" ? K(h, m, p) : this.now, this.build(), this.enhance();
732
761
  }
733
762
  build() {
734
763
  this.daysOfWeek = this.buildDaysOfWeek(), this.daysOfMonth = this.buildDaysOfMonth(), this.monthsOfYear = this.buildMonthsOfYear(), this.yearsOfDecade = this.buildYearsOfDecade();
@@ -764,7 +793,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
764
793
  let a = new Date(t, e, i);
765
794
  n.push(r(a));
766
795
  }
767
- let s = n.length % ze, c = s === 0 ? 0 : ze - s;
796
+ let s = n.length % Ye, c = s === 0 ? 0 : Ye - s;
768
797
  for (let i = 1; i <= c; i++) {
769
798
  let a = new Date(t, e + 1, i);
770
799
  n.push(r(a));
@@ -773,7 +802,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
773
802
  }
774
803
  buildMonthsOfYear() {
775
804
  let e = new Intl.DateTimeFormat(this.localesValue, { month: "long" }), t = new Intl.DateTimeFormat(this.localesValue, { month: "short" }), n = new Intl.DateTimeFormat(this.localesValue, { month: "numeric" }), r = [];
776
- for (let i = 0; i < Be; i++) {
805
+ for (let i = 0; i < Xe; i++) {
777
806
  let a = new Date(this.year, i), o = new Date(this.year, i, 1), s = new Date(this.year, i + 1, 0), c = t.format(a), l = e.format(a), u = this.since && s < this.since || this.till && o > this.till, d = this.disabledMonths.some((e) => i == e || c === e || l === e);
778
807
  r.push({
779
808
  date: a,
@@ -940,7 +969,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
940
969
  };
941
970
  } });
942
971
  }
943
- }, J = (e, t) => new He(e, t), Ue = class extends P {
972
+ }, J = (e, t) => new Qe(e, t), $e = class extends M {
944
973
  constructor(e, t = {}) {
945
974
  super(e, t), this.handle = this.handle.bind(this), this.onSelect = t.onSelect || null;
946
975
  }
@@ -966,7 +995,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
966
995
  iso: i
967
996
  } });
968
997
  }
969
- }, We = class extends P {
998
+ }, et = class extends M {
970
999
  constructor(e, t = {}) {
971
1000
  super(e, t), this.handle = this.handle.bind(this);
972
1001
  }
@@ -983,7 +1012,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
983
1012
  let n = parseInt(t.dataset.month, 10);
984
1013
  isNaN(n) || this.dispatch("selected", { detail: { month: n } });
985
1014
  }
986
- }, Ge = class extends P {
1015
+ }, tt = class extends M {
987
1016
  constructor(e, t = {}) {
988
1017
  super(e, t), this.handle = this.handle.bind(this);
989
1018
  }
@@ -1000,20 +1029,20 @@ var ze = 7, Be = 12, q = 10, Ve = {
1000
1029
  let n = parseInt(t.dataset.year, 10);
1001
1030
  isNaN(n) || this.dispatch("selected", { detail: { year: n } });
1002
1031
  }
1003
- }, Ke = (e, t) => new Ue(e, t), qe = (e, t) => new We(e, t), Je = (e, t) => new Ge(e, t), Y = {
1032
+ }, nt = (e, t) => new $e(e, t), rt = (e, t) => new et(e, t), it = (e, t) => new tt(e, t), Y = {
1004
1033
  content: null,
1005
1034
  url: "",
1006
1035
  reload: "never",
1007
1036
  stale: 3600,
1008
1037
  onLoad: "canLoad",
1009
1038
  onLoaded: "contentLoaded"
1010
- }, Ye = class extends P {
1039
+ }, at = class extends M {
1011
1040
  constructor(e, t = {}) {
1012
1041
  super(e, t);
1013
1042
  let n = Object.assign({}, Y, t), { content: r, url: i, reload: a, stale: o } = n;
1014
1043
  this.content = r, this.url = i, this.reload = typeof a == "string" ? a : Y.reload, this.stale = typeof o == "number" ? o : Y.stale;
1015
1044
  let { onLoad: s, onLoaded: c } = n;
1016
- this.onLoad = s, this.onLoaded = c, this._requestor = new k(), this.enhance();
1045
+ this.onLoad = s, this.onLoaded = c, this._requestor = new O(), this.enhance();
1017
1046
  }
1018
1047
  get reloadable() {
1019
1048
  switch (this.reload) {
@@ -1046,7 +1075,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1046
1075
  let e = this;
1047
1076
  Object.assign(this.controller, { load: e.load.bind(e) });
1048
1077
  }
1049
- }, Xe = (e, t) => new Ye(e, t), X = class extends P {
1078
+ }, ot = (e, t) => new at(e, t), X = class extends M {
1050
1079
  observe(e) {
1051
1080
  this._handler = e, this.events.forEach((t) => window.addEventListener(t, e, !0));
1052
1081
  }
@@ -1059,21 +1088,21 @@ var ze = 7, Be = 12, q = 10, Ve = {
1059
1088
  e.unobserve(), t();
1060
1089
  };
1061
1090
  }
1062
- }, Ze = {
1091
+ }, st = {
1063
1092
  trigger: null,
1064
1093
  events: ["click"],
1065
1094
  onDismissed: "dismissed"
1066
- }, Qe = class extends X {
1095
+ }, ct = class extends X {
1067
1096
  constructor(e, t = {}) {
1068
1097
  super(e, t);
1069
- let { trigger: n, events: r, onDismissed: i } = Object.assign({}, Ze, t);
1098
+ let { trigger: n, events: r, onDismissed: i } = Object.assign({}, st, t);
1070
1099
  this.onDismissed = i, this.trigger = n || this.element, this.events = r, this.enhance(), this.observe(this.dismiss);
1071
1100
  }
1072
1101
  dismiss = async (e) => {
1073
1102
  let { target: t } = e;
1074
1103
  t instanceof HTMLElement && (this.element.contains(t) || this.visible && (this.dispatch("dismiss"), await this.awaitCallback(this.onDismissed, { target: this.trigger }), this.dispatch("dismissed")));
1075
1104
  };
1076
- }, Z = (e, t) => new Qe(e, t), $e = {
1105
+ }, Z = (e, t) => new ct(e, t), lt = {
1077
1106
  anchor: null,
1078
1107
  events: ["click"],
1079
1108
  placement: "bottom",
@@ -1081,11 +1110,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
1081
1110
  onFlipped: "flipped",
1082
1111
  ariaRole: null,
1083
1112
  respectMotion: !0
1084
- }, et = class extends X {
1113
+ }, ut = class extends X {
1085
1114
  constructor(e, t = {}) {
1086
1115
  super(e, t);
1087
- let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({}, $e, t);
1088
- this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element && oe({
1116
+ let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({}, lt, t);
1117
+ this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element && E({
1089
1118
  trigger: this.anchor,
1090
1119
  target: this.element,
1091
1120
  role: this.ariaRole
@@ -1103,7 +1132,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1103
1132
  }), this.dispatch("flipped", { detail: { placement: e } });
1104
1133
  };
1105
1134
  flippedRect(e, t) {
1106
- let n = this.quadrumRect(e, M()), r = [this.placement, A[this.placement]], i = {};
1135
+ let n = this.quadrumRect(e, A()), r = [this.placement, _e[this.placement]], i = {};
1107
1136
  for (; !Object.keys(i).length && r.length > 0;) {
1108
1137
  let a = r.shift();
1109
1138
  if (!this.biggerRectThan(n[a], t)) continue;
@@ -1114,25 +1143,25 @@ var ze = 7, Be = 12, q = 10, Ve = {
1114
1143
  }
1115
1144
  quadrumRect(e, t) {
1116
1145
  return {
1117
- left: j({
1146
+ left: k({
1118
1147
  x: t.x,
1119
1148
  y: t.y,
1120
1149
  width: e.x - t.x,
1121
1150
  height: t.height
1122
1151
  }),
1123
- right: j({
1152
+ right: k({
1124
1153
  x: e.x + e.width,
1125
1154
  y: t.y,
1126
1155
  width: t.width - (e.x + e.width),
1127
1156
  height: t.height
1128
1157
  }),
1129
- top: j({
1158
+ top: k({
1130
1159
  x: t.x,
1131
1160
  y: t.y,
1132
1161
  width: t.width,
1133
1162
  height: e.y - t.y
1134
1163
  }),
1135
- bottom: j({
1164
+ bottom: k({
1136
1165
  x: t.x,
1137
1166
  y: e.y + e.height,
1138
1167
  width: t.width,
@@ -1142,25 +1171,25 @@ var ze = 7, Be = 12, q = 10, Ve = {
1142
1171
  }
1143
1172
  quadrumPlacement(e, t, n) {
1144
1173
  switch (t) {
1145
- case "top": return j({
1174
+ case "top": return k({
1146
1175
  x: n.x,
1147
1176
  y: e.y - n.height,
1148
1177
  width: n.width,
1149
1178
  height: n.height
1150
1179
  });
1151
- case "bottom": return j({
1180
+ case "bottom": return k({
1152
1181
  x: n.x,
1153
1182
  y: e.y + e.height,
1154
1183
  width: n.width,
1155
1184
  height: n.height
1156
1185
  });
1157
- case "left": return j({
1186
+ case "left": return k({
1158
1187
  x: e.x - n.width,
1159
1188
  y: n.y,
1160
1189
  width: n.width,
1161
1190
  height: n.height
1162
1191
  });
1163
- case "right": return j({
1192
+ case "right": return k({
1164
1193
  x: e.x + e.width,
1165
1194
  y: n.y,
1166
1195
  width: n.width,
@@ -1174,7 +1203,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1174
1203
  case "top":
1175
1204
  case "bottom": {
1176
1205
  let t = e.x;
1177
- return this.alignment === "center" ? t = e.x + e.width / 2 - n.width / 2 : this.alignment === "end" && (t = e.x + e.width - n.width), j({
1206
+ return this.alignment === "center" ? t = e.x + e.width / 2 - n.width / 2 : this.alignment === "end" && (t = e.x + e.width - n.width), k({
1178
1207
  x: t,
1179
1208
  y: n.y,
1180
1209
  width: n.width,
@@ -1184,7 +1213,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1184
1213
  case "left":
1185
1214
  case "right": {
1186
1215
  let t = e.y;
1187
- return this.alignment === "center" ? t = e.y + e.height / 2 - n.height / 2 : this.alignment === "end" && (t = e.y + e.height - n.height), j({
1216
+ return this.alignment === "center" ? t = e.y + e.height / 2 - n.height / 2 : this.alignment === "end" && (t = e.y + e.height - n.height), k({
1188
1217
  x: n.x,
1189
1218
  y: t,
1190
1219
  width: n.width,
@@ -1200,11 +1229,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
1200
1229
  enhance() {
1201
1230
  super.enhance(), this.controller.flip = this.flip;
1202
1231
  }
1203
- }, tt = (e, t) => new et(e, t), nt = {
1232
+ }, dt = (e, t) => new ut(e, t), ft = {
1204
1233
  moveKey: "Alt",
1205
1234
  onMoved: null,
1206
1235
  orientation: "vertical"
1207
- }, rt = {
1236
+ }, pt = {
1208
1237
  vertical: {
1209
1238
  back: "ArrowUp",
1210
1239
  forward: "ArrowDown"
@@ -1213,11 +1242,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
1213
1242
  back: "ArrowLeft",
1214
1243
  forward: "ArrowRight"
1215
1244
  }
1216
- }, it = class extends P {
1245
+ }, mt = class extends M {
1217
1246
  constructor(e, t = {}) {
1218
1247
  super(e, t);
1219
- let { moveKey: n, onMoved: r, orientation: i } = Object.assign({}, nt, t);
1220
- this.moveKey = u[n] ? n : nt.moveKey, this.onMoved = r, this.orientation = i, this.draggingItem = null, this.onKeydown = this.onKeydown.bind(this);
1248
+ let { moveKey: n, onMoved: r, orientation: i } = Object.assign({}, ft, t);
1249
+ this.moveKey = u[n] ? n : ft.moveKey, this.onMoved = r, this.orientation = i, this.draggingItem = null, this.onKeydown = this.onKeydown.bind(this);
1221
1250
  }
1222
1251
  get items() {
1223
1252
  return this.controller.itemTargets;
@@ -1235,7 +1264,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1235
1264
  e.forEach((e) => this.detachItem(e));
1236
1265
  }
1237
1266
  resolveMoveKeys(e) {
1238
- let { back: t, forward: n } = rt[this.orientation];
1267
+ let { back: t, forward: n } = pt[this.orientation];
1239
1268
  return this.orientation === "horizontal" && getComputedStyle(e).direction === "rtl" ? {
1240
1269
  back: n,
1241
1270
  forward: t
@@ -1274,9 +1303,9 @@ var ze = 7, Be = 12, q = 10, Ve = {
1274
1303
  return this.draggingItem = null, this.dispatch("reordered", { detail: { itemIds: this.orderedIds() } }), n;
1275
1304
  }
1276
1305
  midpointOf(e) {
1277
- return he(e.getBoundingClientRect(), this.orientation);
1306
+ return ve(e.getBoundingClientRect(), this.orientation);
1278
1307
  }
1279
- }, at = (e, t) => new it(e, t), ot = {
1308
+ }, ht = (e, t) => new mt(e, t), gt = {
1280
1309
  events: ["resize"],
1281
1310
  boundaries: [
1282
1311
  "top",
@@ -1285,10 +1314,10 @@ var ze = 7, Be = 12, q = 10, Ve = {
1285
1314
  ],
1286
1315
  onShifted: "shifted",
1287
1316
  respectMotion: !0
1288
- }, st = class extends X {
1317
+ }, _t = class extends X {
1289
1318
  constructor(e, t = {}) {
1290
1319
  super(e, t);
1291
- let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({}, ot, t);
1320
+ let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({}, gt, t);
1292
1321
  this.onShifted = n, this.events = r, this.boundaries = i, this.respectMotion = a, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.enhance(), this.observe(this.shift);
1293
1322
  }
1294
1323
  shift = async () => {
@@ -1298,14 +1327,14 @@ var ze = 7, Be = 12, q = 10, Ve = {
1298
1327
  this.element.style.transition = this.respectMotion && this.prefersReducedMotion ? "none" : "", this.element.style.transform = `translate(${t}px, ${n}px)`, await this.awaitCallback(this.onShifted, e), this.dispatch("shifted", { detail: e });
1299
1328
  };
1300
1329
  overflowRect(e, t) {
1301
- let n = {}, r = M(), i = j({
1330
+ let n = {}, r = A(), i = k({
1302
1331
  x: e.x - t.x,
1303
1332
  y: e.y - t.y,
1304
1333
  width: e.width,
1305
1334
  height: e.height
1306
1335
  });
1307
1336
  for (let e of this.boundaries) {
1308
- let t = this.directionDistance(i, e, r), a = A[e];
1337
+ let t = this.directionDistance(i, e, r), a = _e[e];
1309
1338
  t < 0 ? i[a] + t >= r[a] && !n[a] && (n[e] = t) : n[e] = "";
1310
1339
  }
1311
1340
  return n;
@@ -1337,23 +1366,23 @@ var ze = 7, Be = 12, q = 10, Ve = {
1337
1366
  enhance() {
1338
1367
  super.enhance(), this.controller.shift = this.shift;
1339
1368
  }
1340
- }, ct = (e, t) => new st(e, t), lt = {
1369
+ }, vt = (e, t) => new _t(e, t), yt = {
1341
1370
  visibility: "visibility",
1342
1371
  onShown: "shown",
1343
1372
  onHidden: "hidden"
1344
- }, ut = class extends P {
1373
+ }, bt = class extends M {
1345
1374
  constructor(e, t = {}) {
1346
- let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({}, lt, t), o = typeof n == "string" ? n : lt.namespace, s = typeof t.visible == "string" ? t.visible : "isVisible";
1375
+ let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({}, yt, t), o = typeof n == "string" ? n : yt.namespace, s = typeof t.visible == "string" ? t.visible : "isVisible";
1347
1376
  (typeof t.visible != "boolean" || t.visible) && (t.visible = `${o}.${s}`), super(e, t), this.visibility = o, this.visibilityResolver = s, this.onShown = r, this.onHidden = i, this.activator = a instanceof HTMLElement ? a : null, this.enhance(), this.element instanceof HTMLElement && this.activate(this.isVisible(this.element));
1348
1377
  }
1349
1378
  isVisible(e) {
1350
1379
  if (!(e instanceof HTMLElement)) return !1;
1351
- let t = N.hiddenClass;
1380
+ let t = j.hiddenClass;
1352
1381
  return t ? !e.classList.contains(t) : !e.hasAttribute("hidden");
1353
1382
  }
1354
1383
  toggle(e, t) {
1355
1384
  if (!(e instanceof HTMLElement)) return;
1356
- let n = N.hiddenClass;
1385
+ let n = j.hiddenClass;
1357
1386
  n ? t ? e.classList.remove(n) : e.classList.add(n) : b(e, !t);
1358
1387
  }
1359
1388
  activate(e) {
@@ -1376,7 +1405,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1376
1405
  return t;
1377
1406
  } });
1378
1407
  }
1379
- }, Q = (e, t) => new ut(e, t), dt = 4, ft = class extends e {
1408
+ }, Q = (e, t) => new bt(e, t), xt = 4, St = class extends e {
1380
1409
  static targets = ["grid"];
1381
1410
  static values = {
1382
1411
  current: Number,
@@ -1398,7 +1427,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1398
1427
  }
1399
1428
  };
1400
1429
  initialize() {
1401
- this.selector = Je(this), J(this, {
1430
+ this.selector = it(this), J(this, {
1402
1431
  today: this.todayValue,
1403
1432
  year: this.currentValue || void 0,
1404
1433
  since: this.sinceValue || null,
@@ -1442,17 +1471,17 @@ var ze = 7, Be = 12, q = 10, Ve = {
1442
1471
  }
1443
1472
  let a = document.createElement("div");
1444
1473
  a.setAttribute("role", "rowgroup");
1445
- for (let e = 0; e < i.length; e += dt) {
1474
+ for (let e = 0; e < i.length; e += xt) {
1446
1475
  let t = document.createElement("div");
1447
1476
  t.setAttribute("role", "row");
1448
- for (let n of i.slice(e, e + dt)) t.appendChild(n);
1477
+ for (let n of i.slice(e, e + xt)) t.appendChild(n);
1449
1478
  a.appendChild(t);
1450
1479
  }
1451
1480
  this.gridTarget.replaceChildren(a);
1452
1481
  }
1453
- }, pt = class extends e {
1482
+ }, Ct = class extends e {
1454
1483
  initialize() {
1455
- this.selector = Je(this);
1484
+ this.selector = it(this);
1456
1485
  }
1457
1486
  connect() {
1458
1487
  this.selector.attach();
@@ -1460,7 +1489,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1460
1489
  disconnect() {
1461
1490
  this.selector.detach();
1462
1491
  }
1463
- }, mt = class extends e {
1492
+ }, wt = class extends e {
1464
1493
  static targets = ["daysOfWeek", "daysOfMonth"];
1465
1494
  static classes = [
1466
1495
  "dayOfWeek",
@@ -1505,7 +1534,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1505
1534
  }
1506
1535
  };
1507
1536
  initialize() {
1508
- this.selector = Ke(this, { onSelect: "select" }), J(this, {
1537
+ this.selector = nt(this, { onSelect: "select" }), J(this, {
1509
1538
  today: this.todayValue,
1510
1539
  since: this.sinceValue || null,
1511
1540
  till: this.tillValue || null
@@ -1594,9 +1623,9 @@ var ze = 7, Be = 12, q = 10, Ve = {
1594
1623
  }
1595
1624
  this.daysOfMonthTarget.replaceChildren(...r);
1596
1625
  }
1597
- }, ht = class extends e {
1626
+ }, Tt = class extends e {
1598
1627
  initialize() {
1599
- this.selector = Ke(this);
1628
+ this.selector = nt(this);
1600
1629
  }
1601
1630
  connect() {
1602
1631
  this.selector.attach();
@@ -1604,7 +1633,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1604
1633
  disconnect() {
1605
1634
  this.selector.detach();
1606
1635
  }
1607
- }, gt = 4, _t = class extends e {
1636
+ }, Et = 4, Dt = class extends e {
1608
1637
  static targets = ["grid"];
1609
1638
  static values = {
1610
1639
  current: Number,
@@ -1634,7 +1663,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1634
1663
  }
1635
1664
  };
1636
1665
  initialize() {
1637
- this.selector = qe(this), J(this, {
1666
+ this.selector = rt(this), J(this, {
1638
1667
  today: this.todayValue,
1639
1668
  year: this.currentValue || void 0,
1640
1669
  since: this.sinceValue || null,
@@ -1679,17 +1708,17 @@ var ze = 7, Be = 12, q = 10, Ve = {
1679
1708
  }
1680
1709
  let o = document.createElement("div");
1681
1710
  o.setAttribute("role", "rowgroup");
1682
- for (let e = 0; e < i.length; e += gt) {
1711
+ for (let e = 0; e < i.length; e += Et) {
1683
1712
  let t = document.createElement("div");
1684
1713
  t.setAttribute("role", "row");
1685
- for (let n of i.slice(e, e + gt)) t.appendChild(n);
1714
+ for (let n of i.slice(e, e + Et)) t.appendChild(n);
1686
1715
  o.appendChild(t);
1687
1716
  }
1688
1717
  this.gridTarget.replaceChildren(o);
1689
1718
  }
1690
- }, vt = class extends e {
1719
+ }, Ot = class extends e {
1691
1720
  initialize() {
1692
- this.selector = qe(this);
1721
+ this.selector = rt(this);
1693
1722
  }
1694
1723
  connect() {
1695
1724
  this.selector.attach();
@@ -1697,7 +1726,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1697
1726
  disconnect() {
1698
1727
  this.selector.detach();
1699
1728
  }
1700
- }, yt = class extends e {
1729
+ }, kt = class extends e {
1701
1730
  static targets = ["master", "item"];
1702
1731
  connect() {
1703
1732
  this.recompute();
@@ -1717,7 +1746,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1717
1746
  enabledItems() {
1718
1747
  return this.itemTargets.filter((e) => !e.disabled);
1719
1748
  }
1720
- }, bt = class extends e {
1749
+ }, At = class extends e {
1721
1750
  static targets = ["source"];
1722
1751
  static values = { contentType: {
1723
1752
  type: String,
@@ -1751,7 +1780,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1751
1780
  "month",
1752
1781
  "year",
1753
1782
  "decade"
1754
- ], xt = class extends e {
1783
+ ], jt = class extends e {
1755
1784
  static targets = [
1756
1785
  "previous",
1757
1786
  "next",
@@ -1888,7 +1917,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1888
1917
  }
1889
1918
  this.hasCalendarYearOutlet && b(this.calendarYearOutletElement, !t), this.hasCalendarDecadeOutlet && b(this.calendarDecadeOutletElement, !n);
1890
1919
  }
1891
- }, St = class extends e {
1920
+ }, Mt = class extends e {
1892
1921
  static targets = [
1893
1922
  "listbox",
1894
1923
  "loading",
@@ -1909,7 +1938,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1909
1938
  }
1910
1939
  };
1911
1940
  initialize() {
1912
- this._requestor = new k();
1941
+ this._requestor = new O();
1913
1942
  }
1914
1943
  connect() {
1915
1944
  this.hasListboxTarget && (this.listboxNav = new f(this.listboxTarget));
@@ -1919,7 +1948,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1919
1948
  }
1920
1949
  onSelect(e) {
1921
1950
  let t = e.target.closest("[role=\"option\"]");
1922
- !t || C(t) || this.select(t.dataset.value ?? "");
1951
+ !t || ie(t) || this.select(t.dataset.value ?? "");
1923
1952
  }
1924
1953
  select(e) {
1925
1954
  let t = this.listboxTarget.querySelectorAll("[role=\"option\"]");
@@ -1942,7 +1971,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1942
1971
  e.name !== "AbortError" && console.error("[combobox-dropdown] fetch failed", e);
1943
1972
  }).finally(() => this.setLoading(!1)), this.delayValue);
1944
1973
  } else {
1945
- let t = me(this.listboxTarget, e);
1974
+ let t = ge(this.listboxTarget, e);
1946
1975
  this.setEmpty(t === 0);
1947
1976
  }
1948
1977
  }
@@ -1955,7 +1984,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
1955
1984
  setEmpty(e) {
1956
1985
  this.hasEmptyTarget && b(this.emptyTarget, !e);
1957
1986
  }
1958
- }, Ct = class extends e {
1987
+ }, Nt = class extends e {
1959
1988
  static targets = [
1960
1989
  "hour",
1961
1990
  "minute",
@@ -1991,12 +2020,12 @@ var ze = 7, Be = 12, q = 10, Ve = {
1991
2020
  selectedValue(e) {
1992
2021
  return e?.querySelector("[aria-selected=\"true\"]")?.dataset.value ?? null;
1993
2022
  }
1994
- }, wt = class extends e {
2023
+ }, Pt = class extends e {
1995
2024
  static targets = ["trigger"];
1996
2025
  connect() {
1997
2026
  Z(this, { trigger: this.hasTriggerTarget ? this.triggerTarget : null });
1998
2027
  }
1999
- }, Tt = class extends e {
2028
+ }, Ft = class extends e {
2000
2029
  static targets = ["anchor", "reference"];
2001
2030
  static values = {
2002
2031
  placement: {
@@ -2021,7 +2050,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2021
2050
  console.error("FlipperController requires an anchor target. Add data-flipper-target=\"anchor\" to your element.");
2022
2051
  return;
2023
2052
  }
2024
- tt(this, {
2053
+ dt(this, {
2025
2054
  element: this.referenceTarget,
2026
2055
  anchor: this.anchorTarget,
2027
2056
  placement: this.placementValue,
@@ -2029,7 +2058,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2029
2058
  ariaRole: this.roleValue
2030
2059
  });
2031
2060
  }
2032
- }, Et = class extends e {
2061
+ }, It = class extends e {
2033
2062
  static targets = ["trigger", "input"];
2034
2063
  static values = {
2035
2064
  value: String,
@@ -2054,7 +2083,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2054
2083
  valueValueChanged(e) {
2055
2084
  this.hasInputTarget && (this.inputTarget.value = e), this.dispatch("changed", { detail: { value: e } });
2056
2085
  }
2057
- }, Dt = class extends e {
2086
+ }, Lt = class extends e {
2058
2087
  static targets = ["input", "cell"];
2059
2088
  static values = {
2060
2089
  format: {
@@ -2071,19 +2100,19 @@ var ze = 7, Be = 12, q = 10, Ve = {
2071
2100
  }
2072
2101
  };
2073
2102
  connect() {
2074
- U(this, {
2103
+ V(this, {
2075
2104
  type: this.formatValue,
2076
2105
  options: this.optionsValue
2077
2106
  }), this.attachCells(), this.primeFilledState(), this.format(this.readValue());
2078
2107
  }
2079
2108
  formatValueChanged() {
2080
- this.formatter && (U(this, {
2109
+ this.formatter && (V(this, {
2081
2110
  type: this.formatValue,
2082
2111
  options: this.optionsValue
2083
2112
  }), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
2084
2113
  }
2085
2114
  optionsValueChanged() {
2086
- this.formatter && (U(this, {
2115
+ this.formatter && (V(this, {
2087
2116
  type: this.formatValue,
2088
2117
  options: this.optionsValue
2089
2118
  }), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
@@ -2114,7 +2143,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2114
2143
  return;
2115
2144
  }
2116
2145
  let t = this.groupsValue.length > 0;
2117
- Le(this, {
2146
+ Ve(this, {
2118
2147
  groups: t ? this.groupsValue : e.groups ?? [],
2119
2148
  length: t ? 0 : e.length ?? 0
2120
2149
  });
@@ -2155,7 +2184,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2155
2184
  primeFilledState() {
2156
2185
  this.wasFull = this.isFull(this.formatter.normalize(this.readValue()));
2157
2186
  }
2158
- }, Ot = class extends e {
2187
+ }, Rt = class extends e {
2159
2188
  static targets = ["input", "clear"];
2160
2189
  initialize() {
2161
2190
  this.onInput = this.draw.bind(this), this.onEscape = this.handleEscape.bind(this);
@@ -2178,7 +2207,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2178
2207
  handleEscape(e) {
2179
2208
  e.key === "Escape" && this.inputTarget.value !== "" && (e.preventDefault(), this.clear());
2180
2209
  }
2181
- }, kt = class extends e {
2210
+ }, zt = class extends e {
2182
2211
  static targets = [
2183
2212
  "input",
2184
2213
  "toggle",
@@ -2211,7 +2240,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2211
2240
  let e = this.revealedValue ? this.concealLabelValue : this.revealLabelValue;
2212
2241
  e && this.toggleTarget.setAttribute("aria-label", e);
2213
2242
  }
2214
- }, At = class extends e {
2243
+ }, Bt = class extends e {
2215
2244
  static targets = ["modal", "overlay"];
2216
2245
  initialize() {
2217
2246
  this.onCancel = this.close.bind(this);
@@ -2243,12 +2272,73 @@ var ze = 7, Be = 12, q = 10, Ve = {
2243
2272
  let t = this.modalTarget.getBoundingClientRect();
2244
2273
  (e.clientY < t.top || e.clientY > t.bottom || e.clientX < t.left || e.clientX > t.right) && this.close();
2245
2274
  };
2246
- }, jt = class extends e {
2275
+ }, Vt = class extends e {
2247
2276
  static targets = ["content"];
2248
2277
  connect() {
2249
- ct(this, { element: this.hasContentTarget ? this.contentTarget : null });
2278
+ vt(this, { element: this.hasContentTarget ? this.contentTarget : null });
2250
2279
  }
2251
- }, Mt = class extends e {
2280
+ }, Ht = class extends e {
2281
+ static targets = [
2282
+ "input",
2283
+ "rule",
2284
+ "level",
2285
+ "checkIcon",
2286
+ "closeIcon"
2287
+ ];
2288
+ static outlets = ["progress"];
2289
+ static values = {
2290
+ scorer: {
2291
+ type: String,
2292
+ default: "rules"
2293
+ },
2294
+ rules: {
2295
+ type: Array,
2296
+ default: []
2297
+ },
2298
+ options: {
2299
+ type: Object,
2300
+ default: {}
2301
+ },
2302
+ labels: {
2303
+ type: Object,
2304
+ default: {}
2305
+ },
2306
+ announceDelay: {
2307
+ type: Number,
2308
+ default: 700
2309
+ }
2310
+ };
2311
+ connect() {
2312
+ this._requestor = new O(), this._level = null, qe(this, { type: this.scorerValue }), this.score();
2313
+ }
2314
+ disconnect() {
2315
+ this._requestor?.cancel();
2316
+ }
2317
+ score() {
2318
+ let { value: e, level: t, rules: n } = this.strength.score(this.readValue(), this.rulesValue, this.optionsValue);
2319
+ this.hasProgressOutlet && this.progressOutlet.setValue(e), this.drawRules(n), this.announce(t);
2320
+ }
2321
+ readValue() {
2322
+ return this.hasInputTarget ? this.inputTarget.value : "";
2323
+ }
2324
+ drawRules(e) {
2325
+ this.ruleTargets.forEach((t) => {
2326
+ let n = !!e[t.dataset.rule];
2327
+ t.dataset.satisfied = String(n), this.drawIcons(t, n);
2328
+ });
2329
+ }
2330
+ drawIcons(e, t) {
2331
+ let n = e.querySelector("[data-password-strength-target=\"checkIcon\"]"), r = e.querySelector("[data-password-strength-target=\"closeIcon\"]");
2332
+ !n || !r || (b(n, !t), b(r, t));
2333
+ }
2334
+ announce(e) {
2335
+ if (e === this._level || (this._level = e, !this.hasLevelTarget)) return;
2336
+ let t = this.labelsValue[e] ?? e;
2337
+ this._requestor.schedule(() => {
2338
+ this.levelTarget.textContent = t;
2339
+ }, this.announceDelayValue);
2340
+ }
2341
+ }, Ut = class extends e {
2252
2342
  static targets = [
2253
2343
  "trigger",
2254
2344
  "panel",
@@ -2280,7 +2370,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2280
2370
  }
2281
2371
  };
2282
2372
  connect() {
2283
- Xe(this, {
2373
+ ot(this, {
2284
2374
  element: this.hasPanelTarget ? this.panelTarget : null,
2285
2375
  url: this.hasUrlValue ? this.urlValue : null
2286
2376
  }), this.hasPanelTarget && (Q(this, {
@@ -2331,8 +2421,17 @@ var ze = 7, Be = 12, q = 10, Ve = {
2331
2421
  contentLoader() {
2332
2422
  if (this.hasTemplateTarget) return this.templateTarget instanceof HTMLTemplateElement ? this.templateTarget.content : this.templateTarget.innerHTML;
2333
2423
  }
2334
- }, Nt = class extends e {
2335
- static targets = ["fill", "meter"];
2424
+ }, Wt = [
2425
+ "percent",
2426
+ "value",
2427
+ "value_max"
2428
+ ], Gt = class extends e {
2429
+ static targets = [
2430
+ "fill",
2431
+ "input",
2432
+ "meter",
2433
+ "value"
2434
+ ];
2336
2435
  static values = {
2337
2436
  variant: {
2338
2437
  type: String,
@@ -2360,13 +2459,21 @@ var ze = 7, Be = 12, q = 10, Ve = {
2360
2459
  indeterminateFraction: {
2361
2460
  type: Number,
2362
2461
  default: .25
2462
+ },
2463
+ segmentMode: {
2464
+ type: String,
2465
+ default: "discrete"
2466
+ },
2467
+ format: {
2468
+ type: String,
2469
+ default: ""
2363
2470
  }
2364
2471
  };
2365
2472
  connect() {
2366
- this.variantValue === "ring" && this.hasFillTarget && this.setCircumference(this.fillTarget), this.render();
2473
+ this.variantValue === "ring" && this.hasFillTarget && this.setCircumference(this.fillTarget), this.variantValue === "range" && (this.currentValue = Number(this.rangeInput.value)), this.render();
2367
2474
  }
2368
2475
  setValue(e) {
2369
- this.currentValue = this.clamp(e), this.render(), this.dispatch("changed", { detail: {
2476
+ this.currentValue = this.clamp(e), this.variantValue === "range" && (this.rangeInput.value = `${this.currentValue}`), this.render(), this.dispatch("changed", { detail: {
2370
2477
  value: this.currentValue,
2371
2478
  min: this.minValue,
2372
2479
  max: this.maxValue
@@ -2381,14 +2488,39 @@ var ze = 7, Be = 12, q = 10, Ve = {
2381
2488
  render() {
2382
2489
  switch (this.variantValue) {
2383
2490
  case "meter": return this.renderMeter();
2491
+ case "range": return this.renderRange();
2384
2492
  case "ring":
2385
- case "bar": return T(this.element, this.minValue), E(this.element, this.maxValue), D(this.element, this.indeterminateValue ? null : this.currentValue), this.element.classList.toggle("sp-progress-indeterminate", this.indeterminateValue), this.variantValue === "ring" ? this.renderRing() : this.renderBar();
2493
+ case "bar":
2494
+ case "segmented": return oe(this.element, this.minValue), se(this.element, this.maxValue), ce(this.element, this.indeterminateValue ? null : this.clamp(this.currentValue)), this.element.classList.toggle("sp-progress-indeterminate", this.indeterminateValue), this.renderValueText(), this.variantValue === "ring" ? this.renderRing() : this.variantValue === "segmented" ? this.renderSegmented() : this.renderBar();
2386
2495
  default: return;
2387
2496
  }
2388
2497
  }
2389
2498
  percent() {
2390
2499
  let e = this.maxValue - this.minValue;
2391
- return e <= 0 ? 0 : (this.currentValue - this.minValue) / e * 100;
2500
+ return e <= 0 ? 0 : (this.clamp(this.currentValue) - this.minValue) / e * 100;
2501
+ }
2502
+ formattedValue() {
2503
+ let e = this.clamp(this.currentValue);
2504
+ switch (this.formatValue) {
2505
+ case "percent": return `${Math.round(this.percent())}%`;
2506
+ case "value": return `${e}`;
2507
+ case "value_max": return `${e} / ${this.maxValue}`;
2508
+ default: return "";
2509
+ }
2510
+ }
2511
+ renderValueText() {
2512
+ if (!this.hasValueTarget || !Wt.includes(this.formatValue)) return;
2513
+ let e = this.indeterminateValue ? "" : this.formattedValue();
2514
+ this.valueTarget.textContent = e, this.formatValue !== "percent" && this.variantValue !== "range" && C(this.element, e || null);
2515
+ }
2516
+ get rangeInput() {
2517
+ return this.hasInputTarget ? this.inputTarget : this.element;
2518
+ }
2519
+ refresh() {
2520
+ this.setValue(Number(this.rangeInput.value));
2521
+ }
2522
+ renderRange() {
2523
+ this.rangeInput.style.setProperty("--sp-progress-percent", `${this.percent()}`), this.renderValueText();
2392
2524
  }
2393
2525
  renderBar() {
2394
2526
  if (this.hasFillTarget) {
@@ -2396,9 +2528,24 @@ var ze = 7, Be = 12, q = 10, Ve = {
2396
2528
  this.fillTarget.style.width = `${this.indeterminateFractionValue * 100}%`;
2397
2529
  return;
2398
2530
  }
2399
- this.fillTarget.style.width = `${this.percent()}%`;
2531
+ this.fillTarget.style.width = `${this.percent()}%`, this.element.style.setProperty("--sp-progress-percent", `${this.percent()}`);
2400
2532
  }
2401
2533
  }
2534
+ renderSegmented() {
2535
+ let e = this.fillTargets, t = e.length;
2536
+ if (t === 0) return;
2537
+ if (this.indeterminateValue) {
2538
+ e.forEach((e, n) => {
2539
+ e.style.setProperty("--sp-progress-index", n), e.style.setProperty("--sp-progress-count", t), e.style.width = `${this.indeterminateFractionValue * 100}%`;
2540
+ });
2541
+ return;
2542
+ }
2543
+ let n = this.percent() / 100 * t;
2544
+ e.forEach((e, t) => {
2545
+ let r = Math.min(1, Math.max(0, n - t));
2546
+ this.segmentModeValue === "discrete" && (r = +(r > 0)), e.style.width = `${r * 100}%`;
2547
+ });
2548
+ }
2402
2549
  renderRing() {
2403
2550
  if (this.hasFillTarget) {
2404
2551
  if (this.circumference ?? this.setCircumference(this.fillTarget), this.indeterminateValue) {
@@ -2418,7 +2565,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2418
2565
  let e = this.meterTarget;
2419
2566
  e.value = this.currentValue, e.min = this.minValue, e.max = this.maxValue, this.hasLowValue && (e.low = this.lowValue), this.hasHighValue && (e.high = this.highValue), this.hasOptimumValue && (e.optimum = this.optimumValue);
2420
2567
  }
2421
- }, Pt = class extends e {
2568
+ }, Kt = class extends e {
2422
2569
  static targets = [
2423
2570
  "item",
2424
2571
  "handle",
@@ -2439,7 +2586,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2439
2586
  }
2440
2587
  };
2441
2588
  connect() {
2442
- this.reorderable = at(this, {
2589
+ this.reorderable = ht(this, {
2443
2590
  moveKey: this.moveKeyValue,
2444
2591
  orientation: this.orientationValue,
2445
2592
  onMoved: "moved"
@@ -2455,7 +2602,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2455
2602
  this.reorderable?.detachItem(e), this.rovingTabIndex?.updateItems(this.itemTargets);
2456
2603
  }
2457
2604
  editingValueChanged(e) {
2458
- this.triggerTargets.forEach((t) => w(t, e));
2605
+ this.triggerTargets.forEach((t) => ae(t, e));
2459
2606
  }
2460
2607
  toggleEditing() {
2461
2608
  this.editingValue = !this.editingValue;
@@ -2480,7 +2627,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
2480
2627
  moved(e) {
2481
2628
  this.rovingTabIndex?.updateItems(this.itemTargets), this.rovingTabIndex.setCurrentIndex(this.itemTargets.indexOf(e));
2482
2629
  }
2483
- }, Ft = class extends e {
2630
+ }, qt = class extends e {
2484
2631
  static targets = [
2485
2632
  "trigger",
2486
2633
  "detail",
@@ -2534,16 +2681,16 @@ var ze = 7, Be = 12, q = 10, Ve = {
2534
2681
  }
2535
2682
  timeTargetConnected(e) {
2536
2683
  if (!Object.keys(this.dateFormatValue).length || e.textContent.trim()) return;
2537
- let t = R.format(e.getAttribute("datetime"), this.dateFormatValue);
2684
+ let t = I.format(e.getAttribute("datetime"), this.dateFormatValue);
2538
2685
  t && (e.textContent = t);
2539
2686
  }
2540
- }, It = class extends e {
2687
+ }, Jt = class extends e {
2541
2688
  static targets = ["content"];
2542
2689
  connect() {
2543
2690
  Z(this);
2544
2691
  }
2545
2692
  contentTargetConnected(e) {
2546
- ct(this, { element: e }), Q(this, { element: e });
2693
+ vt(this, { element: e }), Q(this, { element: e });
2547
2694
  }
2548
2695
  async dismissed() {
2549
2696
  this.hasContentTarget && await this.visibility.hide();
@@ -2553,6 +2700,6 @@ var ze = 7, Be = 12, q = 10, Ve = {
2553
2700
  }
2554
2701
  };
2555
2702
  //#endregion
2556
- export { ie as ARIA_HASPOPUP_VALUES, ft as CalendarDecadeController, pt as CalendarDecadeSelectorController, mt as CalendarMonthController, ht as CalendarMonthSelectorController, _t as CalendarYearController, vt as CalendarYearSelectorController, Ie as CharacterCells, yt as ChecklistController, bt as ClipboardController, xt as ComboboxDateController, St as ComboboxDropdownController, Ct as ComboboxTimeController, wt as DismisserController, t as FOCUSABLE_SELECTOR, V as FORMATTER_TYPES, Tt as FlipperController, a as FocusTrap, Pe as Formatter, Ot as InputClearableController, Et as InputComboboxController, Dt as InputFormatterController, kt as InputRevealableController, f as ListboxNavigation, u as MODIFIER_KEYS, At as ModalController, jt as PannerController, Mt as PopoverController, Nt as ProgressController, Pt as ReorderableController, k as Requestor, d as RovingTabIndex, Ft as TimelineController, It as VisibilityController, m as announce, Le as attachCharacterCells, oe as connectTriggerToTarget, ce as disconnectTriggerFromTarget, ee as ensureId, me as filterOptions, i as focusFirst, le as fuzzyMatcher, h as generateId, n as getFocusableElements, s as isActivationKey, C as isAriaDisabled, c as isArrowKey, te as isExpanded, o as isKey, r as isVisible, l as preventDefault, S as setAriaDisabled, x as setAriaHidden, g as setAriaState, re as setChecked, y as setCurrent, w as setDisabled, _ as setExpanded, b as setHidden, ne as setPressed, v as setSelected, E as setValueMax, T as setValueMin, D as setValueNow };
2703
+ export { le as ARIA_HASPOPUP_VALUES, St as CalendarDecadeController, Ct as CalendarDecadeSelectorController, wt as CalendarMonthController, Tt as CalendarMonthSelectorController, Dt as CalendarYearController, Ot as CalendarYearSelectorController, Be as CharacterCells, kt as ChecklistController, At as ClipboardController, jt as ComboboxDateController, Mt as ComboboxDropdownController, Nt as ComboboxTimeController, Pt as DismisserController, t as FOCUSABLE_SELECTOR, z as FORMATTER_TYPES, Ft as FlipperController, a as FocusTrap, Le as Formatter, Rt as InputClearableController, It as InputComboboxController, Lt as InputFormatterController, zt as InputRevealableController, f as ListboxNavigation, u as MODIFIER_KEYS, Bt as ModalController, Vt as PannerController, Ke as PasswordStrength, Ht as PasswordStrengthController, Ut as PopoverController, Gt as ProgressController, Kt as ReorderableController, O as Requestor, d as RovingTabIndex, H as STRENGTH_TYPES, qt as TimelineController, Jt as VisibilityController, m as announce, Ve as attachCharacterCells, qe as attachPasswordStrength, E as connectTriggerToTarget, ue as disconnectTriggerFromTarget, ee as ensureId, ge as filterOptions, i as focusFirst, de as fuzzyMatcher, h as generateId, n as getFocusableElements, s as isActivationKey, ie as isAriaDisabled, c as isArrowKey, te as isExpanded, o as isKey, r as isVisible, l as preventDefault, S as setAriaDisabled, x as setAriaHidden, g as setAriaState, re as setChecked, y as setCurrent, ae as setDisabled, _ as setExpanded, b as setHidden, ne as setPressed, v as setSelected, se as setValueMax, oe as setValueMin, ce as setValueNow, C as setValueText };
2557
2704
 
2558
2705
  //# sourceMappingURL=index.es.js.map